/* Fruit Bite Cafe — admin dashboard (no database, localStorage backed) */
.admin-body { min-height: 100vh; }

.admin-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251,246,236,.94); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.admin-header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.admin-header-actions .btn { min-height: 40px; padding: 0 15px; font-size: 12.5px; }

.admin-main { padding: 48px 0 80px; }
.admin-intro h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.035em; color: var(--ink); }
.admin-intro h1 em { font-family: var(--font-serif); font-style: italic; color: var(--gold-deep); }
.admin-intro > div > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 15px; }

.storage-notice {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 26px; padding: 14px 18px;
  border: 1px solid rgba(201,106,18,.32); border-radius: 12px; background: rgba(201,106,18,.08);
}
.storage-notice span { color: var(--orange); font-size: 18px; line-height: 1.2; }
.storage-notice p { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.6; }
.storage-notice strong { color: var(--gold-deep); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 26px; }
.stat-card {
  padding: 18px 20px; border: 1px solid var(--line-soft); border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow-gold);
}
.stat-card span { display: block; color: var(--dim); font-size: 12px; }
.stat-card strong { display: block; margin-top: 5px; color: var(--gold-deep); font-size: 26px; line-height: 1.2; }

.panel { margin-top: 30px; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow-gold); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-size: 19px; color: var(--ink); }
.panel-head p { margin: 4px 0 0; color: var(--dim); font-size: 12.5px; }
.panel-tools { display: flex; gap: 10px; align-items: center; }
.admin-search { flex: 0 0 230px; min-height: 40px; }
.admin-select {
  min-height: 40px; padding: 0 12px; border: 1px solid var(--line-soft); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: 13px; max-width: 100%;
}
.admin-select:focus { border-color: var(--gold); outline: 0; }

.table-wrap { overflow-x: auto; }
.item-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.item-table th { padding: 13px 16px; text-align: left; color: var(--gold-deep); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; border-bottom: 1px solid var(--line-soft); white-space: nowrap; background: var(--bg-2); }
.item-table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.item-table tr:last-child td { border-bottom: 0; }
.item-table tbody tr:hover { background: rgba(160,108,30,.06); }
.item-cell { display: flex; align-items: center; gap: 12px; min-width: 230px; }
.item-cell img { width: 54px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-soft); flex: 0 0 auto; }
.item-cell strong { display: block; font-weight: 600; line-height: 1.3; color: var(--ink); }
.item-cell small { color: var(--dim); font-size: 11px; }
.category-pill { display: inline-block; padding: 5px 10px; border-radius: 999px; background: rgba(160,108,30,.1); border: 1px solid var(--line); color: var(--gold-deep); font-size: 11.5px; white-space: nowrap; }
.diet-label { color: var(--muted); font-size: 12.5px; }
.diet-label.nonveg { color: var(--red); }

.price-input {
  width: 92px; min-height: 36px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--line-soft); background: var(--surface); color: var(--gold-deep); font-weight: 700; font-size: 13px;
}
.price-input:focus { border-color: var(--gold); outline: 0; }
.price-save {
  margin-left: 6px; min-height: 36px; padding: 0 11px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--gold-deep); font-size: 11.5px; font-weight: 700;
}
.price-save:hover { background: rgba(160,108,30,.12); }
.row-actions { display: flex; gap: 6px; }
.mini-btn {
  min-height: 34px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-soft);
  background: var(--surface); color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.mini-btn:hover { border-color: var(--gold); color: var(--gold-deep); }
.mini-btn.danger:hover { border-color: var(--red); color: var(--red); }

.admin-footer-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; }
.admin-footer-actions p { margin: 0; color: var(--dim); font-size: 12px; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(46,36,24,.45); backdrop-filter: blur(4px); }
.modal-panel {
  width: min(640px, 100%); max-height: calc(100vh - 40px); overflow-y: auto;
  padding: 24px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); box-shadow: 0 24px 70px rgba(86,58,22,.28);
}
.modal-panel-small { width: min(420px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-head h2 { margin: 0; font-size: 22px; color: var(--ink); }
.admin-form .field { margin-bottom: 14px; }
.admin-form .field label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.admin-form .field input, .admin-form .field textarea, .admin-form .field select { font-size: 13.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.span-2 { grid-column: 1 / -1; }
.image-preview-wrap img { width: 180px; max-width: 100%; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line-soft); }
.checkbox-field label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-field input { width: 16px; height: 16px; accent-color: var(--gold); min-height: 0; padding: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-actions .btn { min-width: 120px; }
.btn-danger { border-color: rgba(185,59,46,.55); color: var(--red); background: rgba(255,255,255,.6); }
.btn-danger:hover { background: rgba(185,59,46,.12); }
.confirm-text { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.admin-body .toast { bottom: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-head { flex-direction: column; align-items: stretch; }
  .admin-search { flex: 1 1 auto; }
}

@media (max-width: 720px) {
  .admin-header-inner { min-height: auto; flex-wrap: wrap; padding-block: 12px; }
  .admin-header-actions { width: 100%; justify-content: flex-start; }
  .admin-main { padding-top: 34px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .item-table thead { display: none; }
  .item-table, .item-table tbody, .item-table tr, .item-table td { display: block; width: 100%; }
  .item-table tr { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
  .item-table td { padding: 6px 0; border: 0; }
  .item-table td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--dim); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
  .item-table td:first-child::before { display: none; }
  .row-actions { flex-wrap: wrap; }
  .admin-footer-actions { flex-direction: column; align-items: flex-start; }
  .modal { padding: 10px; align-items: flex-start; }
  .modal-panel { max-height: calc(100vh - 20px); padding: 18px; }
  .modal-actions .btn { flex: 1; min-width: 0; }
}

@media (max-width: 420px) {
  .stats-grid { gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card strong { font-size: 21px; }
  .panel-tools { flex-direction: column; align-items: stretch; }
  .admin-select { width: 100%; }
}
