/* Restaurant - admin dashboard */
:root { --charcoal: #171717; --cream: #F8F5EF; --gold: #C9A45C; --gold-dark: #a8853f; --grey: #777; --line: #e7e2d8; --bg: #f5f3ee; --red: #b7412e; --green: #2f7d4f; --radius: 14px; --sans: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: #262626; background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--gold-dark); }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.25; }
h2 { font-size: 1.1rem; }
img { max-width: 100%; }
code { background: #eee; padding: 1px 5px; border-radius: 4px; }
.icon { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--grey); }
.mt { margin-top: 1.5rem; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; padding: .6em 1.1em; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, transform .15s; line-height: 1.2; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: .4em .8em; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-gold { background: var(--gold); color: var(--charcoal); }
.btn-gold:hover { background: #d6b46f; }
.btn-dark { background: var(--charcoal); color: #fff; }
.btn-light { background: #fff; border-color: var(--line); color: #262626; }
.btn-light:hover { border-color: var(--gold); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-outline { background: #fff; color: var(--red); border-color: #e9c3bb; }
.btn-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: #333; }
.btn-icon:hover { border-color: var(--gold); }
.btn-icon-danger { color: var(--red); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.inline-form { display: inline; margin: 0; }
.admin .panel > div[style*="border-bottom"] > div.order-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.admin .panel > div[style*="border-bottom"] > div.order-actions form { margin: .5rem 0 !important; }

/* Layout */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: var(--charcoal); color: #ddd; padding: 18px 12px; position: fixed; inset: 0 auto 0 0; overflow-y: auto; transform: translateX(-100%); transition: transform .25s ease; z-index: 30; display: flex; flex-direction: column; }
.sidebar.is-open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 8px 18px; font-weight: 700; }
.sidebar-brand img { border-radius: 50%; }
.sidebar-brand small { display: block; color: var(--gold); font-weight: 500; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a, .sidebar-logout { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #cfcfcf; text-decoration: none; font: inherit; width: 100%; background: none; border: 0; cursor: pointer; text-align: left; }
.sidebar a:hover, .sidebar-logout:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar a[aria-current="page"] { background: rgba(201,164,92,.16); color: var(--gold); }
.sidebar-site { margin-top: auto; font-size: .85rem; }
.admin-main { flex: 1; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 10px 18px; }
.topbar h1 { font-size: 1.2rem; margin: 0; flex: 1; }
.sidebar-toggle { background: none; border: 0; font-size: 1.4rem; cursor: pointer; display: inline-flex; padding: 4px; }
.topbar-right { display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.admin-user { display: none; color: var(--grey); }
.net-badge { background: #fff3dd; color: #7a5310; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.pending-badge { background: #fde6c4; color: #6b4300; padding: 3px 10px; border-radius: 999px; font-weight: 600; text-decoration: none; }
.admin-content { padding: 18px; max-width: 1300px; }
@media (min-width: 1000px) {
  .sidebar { transform: none; }
  .admin-main { margin-left: 250px; }
  .sidebar-toggle { display: none; }
  .admin-user { display: inline; }
  .admin-content { padding: 28px; }
}

/* Panels and stats */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.panel.narrow { max-width: 560px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }
.panel-grid { display: grid; gap: 18px; }
.panel-grid > .panel { margin-bottom: 0; }
.panel-grid + .panel, .panel-grid + section { margin-top: 18px; }
@media (min-width: 1000px) { .panel-grid { grid-template-columns: 1.6fr 1fr; } }
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); margin-bottom: 18px; }
@media (min-width: 700px) { .stat-grid { grid-template-columns: repeat(5, 1fr); } }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit; display: grid; gap: 2px; transition: border-color .15s, transform .15s; }
.stat-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(201,164,92,.15); color: var(--gold-dark); margin-bottom: 6px; }
.stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-label { color: var(--grey); font-size: .85rem; }
.status-list { margin: 0; display: grid; gap: 10px; }
.status-list div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.status-list dt { color: var(--grey); }
.status-list dd { margin: 0; font-weight: 600; text-align: right; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill-green { background: #e6f2ea; color: var(--green); }
.pill-red { background: #fbe9e5; color: var(--red); }
.pill-grey { background: #eee; color: #555; }
.pill-amber { background: #fff3dd; color: #7a5310; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table-recent-dishes { table-layout: fixed; min-width: 640px; }
.table-recent-dishes th:nth-child(1), .table-recent-dishes td:nth-child(1) { width: 34%; }
.table-recent-dishes th:nth-child(2), .table-recent-dishes td:nth-child(2) { width: 22%; }
.table-recent-dishes th:nth-child(3), .table-recent-dishes td:nth-child(3) { width: 12%; white-space: nowrap; }
.table-recent-dishes th:nth-child(4), .table-recent-dishes td:nth-child(4) { width: 14%; }
.table-recent-dishes th:nth-child(5), .table-recent-dishes td:nth-child(5) { width: 18%; }
.table-recent-dishes td:nth-child(2), .table-recent-dishes td:nth-child(5) { overflow-wrap: anywhere; }
.table-recent-dishes td.cell-dish { display: table-cell; min-width: 0; }
.table-recent-dishes td.cell-dish img { vertical-align: middle; margin-right: 10px; }
.table-recent-dishes .cell-dish a { min-width: 0; overflow-wrap: normal; word-break: normal; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--grey); }
.table th a { color: inherit; text-decoration: none; }
.table tr:hover td { background: #fcfbf8; }
.table .thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; display: block; }
.cell-dish { display: flex; align-items: center; gap: 10px; }
.cell-dish img { width: 40px; height: 30px; object-fit: cover; border-radius: 6px; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions .btn-icon { margin-left: 4px; }
tr.is-pending td { background: #fff8ea; }
.pending-flag { display: block; font-size: .78rem; color: #8a5a00; font-weight: 600; }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.pagination a { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; color: inherit; background: #fff; }
.pagination a[aria-current="page"] { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }

/* Switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #d5d2cb; border-radius: 999px; transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Forms */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.toolbar .muted { margin: 0; max-width: 70ch; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: .6em .75em; border: 1px solid #d9d4c9; border-radius: 10px; font: inherit; background: #fff; color: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,164,92,.22); }
.filters input, .filters select { width: auto; min-width: 150px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
label small, .image-field small { font-weight: 400; color: var(--grey); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold-dark); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; display: grid; gap: 10px; }
legend { font-weight: 700; padding: 0 6px; }
.form-stack { display: grid; gap: 14px; }
.file-picker { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 4px; min-width: 0; }
.file-picker > .file-picker-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-picker .btn { justify-self: start; }
.file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--grey); font-size: .82rem; font-weight: 400; }
.add-file-picker { width: 125px; max-width: 125px; flex: 0 0 125px !important; box-sizing: border-box; }
.add-file-picker .file-name { width: 125px; }
.file-picker input[type=file] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.file-picker input[type=file]:focus-visible + .btn { outline: 3px solid rgba(201,164,92,.45); outline-offset: 2px; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }
.form-row { display: flex; gap: 8px; align-items: end; }
.form-row-wrap { flex-wrap: wrap; }
.form-row .grow { flex: 1; min-width: 200px; }
.toggles { display: flex; flex-wrap: wrap; gap: 18px; }
.field-error { color: var(--red); font-size: .82rem; font-weight: 500; min-height: 0; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.form-note { background: #fff3dd; color: #7a5310; padding: 8px 12px; border-radius: 8px; margin: 0; }
.image-field { display: grid; gap: 6px; align-content: start; }
.image-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.image-field .label { font-weight: 600; font-size: .9rem; }
.image-preview { width: 160px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--cream); }
.logo-preview { width: 80px; height: 80px; border-radius: 50%; }
.hours-editor { display: grid; gap: 8px; margin-bottom: 6px; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(245,243,238,.96); padding: 12px 0; display: flex; justify-content: flex-end; align-items: center; gap: 14px; }

/* Alerts and toasts */
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.alert-success { background: #e6f2ea; color: #1f5c39; }
.alert-error { background: #fbe9e5; color: #8a2d1f; }
.alert-info { background: #eef1f6; color: #3b4a63; }
.alert-warning { background: #fff3dd; color: #7a5310; }
.toast-stack { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; max-width: min(92vw, 380px); }
.toast { background: var(--charcoal); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: toastIn .25s ease; border-left: 4px solid var(--green); }
.toast-error { border-left-color: var(--red); }
.toast-warning { border-left-color: var(--gold); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Modal */
.modal { border: 0; border-radius: 16px; padding: 22px; width: min(94vw, 480px); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal-lg { width: min(96vw, 760px); }
.modal::backdrop { background: rgba(23,23,23,.55); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-head h2 { margin: 0; font-size: 1.25rem; }
@media (min-width: 700px) { .modal-lg .modal-head { grid-column: span 2; } }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.modal-confirm p { color: #444; }

/* Lists */
.feature-admin-list, .export-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.feature-admin-list li { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; flex-wrap: wrap; }
.feature-admin-list img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; }
.feature-admin-list li > div { flex: 1; display: grid; min-width: 140px; }
.order-input { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.order-input input { width: 80px; }
.export-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 10px; }
.export-list li div { display: grid; }
.help-list { padding-left: 1.2em; display: grid; gap: 8px; margin: 0 0 12px; }
.import-panel { margin-top: 0; }
.import-summary { background: #eef1f6; color: #3b4a63; border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.import-actions { align-items: center; margin-top: 10px; }
.import-actions form { margin: 0; }
.offline-entry { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.offline-entry h3 { font-size: 1rem; margin-bottom: 4px; }
.change-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 6px 0; }
.change-table td, .change-table th { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; }

/* Gallery admin */
.gallery-admin { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery-admin figure { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; }
.gallery-admin img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
.gallery-admin .file-picker { gap: 4px; }

/* QR */
.qr-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.qr-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.qr-item h3 { font-size: 1rem; margin: 10px 0 4px; }
.qr-item .btn-row { justify-content: center; }
.qr-preview svg { width: 100%; max-width: 180px; height: auto; display: block; margin: 0 auto; }
.qr-url { font-size: .78rem; word-break: break-all; color: var(--grey); }

/* Auth pages */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--charcoal) radial-gradient(circle at 20% 0%, rgba(201,164,92,.25), transparent 60%); }
.auth-card { background: #fff; width: min(100%, 420px); border-radius: 18px; padding: 30px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.auth-logo { display: block; margin: 0 auto 10px; }
.auth-card h1 { text-align: center; font-size: 1.5rem; margin-bottom: 2px; }
.auth-sub { text-align: center; color: var(--grey); margin-top: 0; }
.auth-foot { text-align: center; font-size: .9rem; margin: 14px 0 0; }

/* Printable QR cards */
.print-page { background: #eee; }
.print-toolbar { display: flex; gap: 10px; align-items: center; padding: 14px; background: #fff; position: sticky; top: 0; flex-wrap: wrap; }
.print-sheet { display: flex; flex-wrap: wrap; gap: 0; justify-content: center; padding: 20px; }
.qr-card { width: 90mm; height: 130mm; background: var(--charcoal); color: #fff; border: 1px dashed #999; text-align: center; padding: 9mm 8mm; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3mm; break-inside: avoid; page-break-inside: avoid; }
.qr-card-logo { width: 16mm; height: 16mm; border-radius: 50%; }
.qr-card-name { font-family: "Playfair Display", Georgia, serif; color: var(--gold); font-size: 20pt; margin: 0; }
.qr-card-code { background: #fff; padding: 4mm; border-radius: 4mm; width: 56mm; }
.qr-card-code svg { max-width: none; width: 100%; }
.qr-card-cta { margin: 0; font-size: 12pt; letter-spacing: .08em; text-transform: uppercase; }
.qr-card-table { margin: 0; background: var(--gold); color: var(--charcoal); font-weight: 700; padding: 1.5mm 6mm; border-radius: 999px; font-size: 13pt; }
@media print {
  .no-print { display: none !important; }
  .print-page { background: #fff; }
  .print-sheet { padding: 0; }
  .qr-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 8mm; }
}
label input[type], label select, label textarea { font-weight: 400; }
.form-grid > label, .form-stack > label { align-content: start; }
