/* ===== Admin Panel Styles (extends styles.css theme) ===== */
.admin-body { padding-bottom: 40px; }

/* Login gate */
.login-gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 0%, #1a1a24, var(--bg));
}
.login-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 40px 34px;
  width: 100%; max-width: 380px;
  text-align: center;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow);
}
.login-card h1 { font-family: 'Cormorant Garamond', serif; font-size: 30px; }
.brand-mark.big { width: 64px; height: 64px; font-size: 34px; margin: 0 auto 6px; }
.login-card input, .form-grid input, .form-grid textarea, .form-grid select {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  color: var(--text);
  font-family: inherit; font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-card input:focus, .form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,169,95,0.12);
}
.pw-error { color: #e05353; font-size: 13px; }
.small { font-size: 12px; }

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--gold), #a97e3a);
  color: #1a1a1a; border: none; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 12px;
  transition: 0.2s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent; border: 1px solid var(--line);
  color: var(--text); cursor: pointer; text-decoration: none;
  font-family: inherit; font-size: 14px;
  padding: 9px 16px; border-radius: 999px;
  transition: 0.2s; display: inline-block;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); }
.btn-danger {
  background: rgba(224,83,83,0.15); color: #ff8080;
  border: 1px solid rgba(224,83,83,0.4); cursor: pointer;
  font-family: inherit; font-weight: 500; font-size: 14px;
  padding: 11px 20px; border-radius: 12px; transition: 0.2s;
}
.btn-danger:hover { background: #e05353; color: #fff; }

/* Header */
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 50px);
  border-bottom: 1px solid var(--line);
  background: rgba(14,14,18,0.85); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 20;
  flex-wrap: wrap; gap: 12px;
}
.admin-actions { display: flex; gap: 10px; }

/* Tabs */
.admin-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 20px clamp(16px, 4vw, 50px) 0;
}
.atab {
  background: var(--card); border: 1px solid var(--line);
  color: var(--muted); cursor: pointer;
  font-family: inherit; font-size: 14px;
  padding: 10px 18px; border-radius: 999px; transition: 0.2s;
}
.atab:hover { color: var(--text); }
.atab.active { background: var(--gold); color: #1a1a1a; border-color: var(--gold); font-weight: 500; }

/* Views */
.admin-view { padding: 24px clamp(16px, 4vw, 50px); max-width: 1000px; }
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.admin-view h2 { font-family: 'Cormorant Garamond', serif; font-size: 30px; }

/* Dish list */
.dish-list { display: flex; flex-direction: column; gap: 12px; }
.dish-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px;
  transition: 0.2s;
}
.dish-row:hover { border-color: var(--gold); }
.dish-thumb {
  width: 60px; height: 60px; border-radius: 10px; flex-shrink: 0;
  background-size: cover; background-position: center;
  background-color: #26262f;
  display: grid; place-items: center; font-size: 26px;
}
.dish-main { flex: 1; min-width: 0; }
.dish-name { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.dish-name .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.veg { background: #52c26a; } .dot.nonveg { background: #e05353; }
.dish-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.dish-cat-tag { color: var(--gold-soft); font-size: 12px; }
.dish-row-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-size: 16px; transition: 0.2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--gold); }
.icon-btn.del:hover { background: #e05353; color: #fff; border-color: #e05353; }

.cat-group-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; color: var(--gold-soft);
  margin: 18px 0 4px;
}

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); }
.form-grid label.check input { width: auto; }

/* Info cards */
.info-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; margin-bottom: 16px;
}
.info-card h3 { margin-bottom: 8px; font-size: 17px; }
.info-card.danger { border-color: rgba(224,83,83,0.35); }
.deploy-steps { margin: 10px 0 10px 18px; line-height: 1.9; }
.info-card code { background: rgba(212,169,95,0.12); color: var(--gold-soft); padding: 2px 6px; border-radius: 5px; font-size: 13px; }

/* Modal wide */
.modal-card.wide { max-width: 560px; width: 100%; text-align: left; }
.modal-card.wide h3 { font-family: 'Cormorant Garamond', serif; font-size: 26px; margin-bottom: 18px; text-align: center; }
.modal-foot { display: flex; justify-content: flex-end; position: sticky; bottom: -30px; background: var(--bg-soft); padding-top: 14px; margin: 0 -28px -30px; padding: 14px 28px 6px; }

/* Lock background scroll while a modal is open */
body.modal-open { overflow: hidden; }

/* Image upload */
.img-upload { display: flex; flex-direction: column; gap: 10px; }
.or-divider { color: var(--muted); font-size: 12px; text-align: center; }
.upload-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.upload-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px dashed var(--gold);
  color: var(--gold-soft); cursor: pointer;
  padding: 12px 20px; border-radius: 12px;
  font-family: inherit; font-size: 14px; transition: 0.2s;
}
.upload-btn:hover { background: rgba(212,169,95,0.12); }
.img-preview { position: relative; width: 74px; height: 74px; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.clear-img {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #e05353; color: #fff; border: none; cursor: pointer;
  font-size: 15px; line-height: 1; display: grid; place-items: center;
}

/* Toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1e1e28; border: 1px solid var(--gold);
  color: var(--text); padding: 13px 22px; border-radius: 999px;
  font-size: 14px; z-index: 200; opacity: 0; transition: 0.3s;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ===== Orders Dashboard ===== */
.order-badge {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 5px; margin-left: 4px;
  background: #e05353; color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.orders-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sound-toggle { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.order-filter {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 8px 14px; font-family: inherit; font-size: 13px; cursor: pointer; outline: none;
}
.orders-board {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.order-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px;
  animation: rise 0.35s ease both;
}
.order-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.order-where { font-weight: 600; }
.order-num { color: var(--muted); font-size: 12px; margin-left: 6px; }
.order-status { font-size: 13px; font-weight: 600; white-space: nowrap; }
.order-cust { font-size: 13px; color: var(--muted); }
.order-items { list-style: none; display: flex; flex-direction: column; gap: 5px; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); padding: 10px 0; }
.order-items li { display: flex; justify-content: space-between; font-size: 14px; }
.order-items li span:last-child { color: var(--gold-soft); }
.order-note { font-size: 13px; color: #e0a53f; background: rgba(224,165,63,0.1); padding: 6px 10px; border-radius: 8px; }
.order-card-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.order-total { font-size: 19px; font-weight: 700; color: var(--gold-soft); }
.order-time { font-size: 11px; color: var(--muted); }
.order-btns { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.btn-primary.sm, .btn-danger.sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; white-space: nowrap; }
.btn-ghost.sm { padding: 8px 10px; font-size: 14px; border-radius: 10px; line-height: 1; }

/* Table QR codes */
.qr-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 10px; }
.qr-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.qr-controls input { min-width: 220px; }
.qr-controls input[type="number"] { min-width: 110px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 20px; }
.qr-card { background: #fff; color: #111; border-radius: 14px; padding: 14px; text-align: center; }
.qr-shop { font-weight: 700; font-size: 14px; }
.qr-table { font-size: 20px; font-weight: 800; margin: 2px 0 10px; }
.qr-img { display: grid; place-items: center; }
.qr-cap { color: #666 !important; margin-top: 8px; }
