/* ASL FOOD — YAGONA DIZAYN MANBAI. Rang, shrift, o'lcham, tugma, jadval, oyna — faqat shu yerda.
   Qoida (AGENTS.md): sahifalarda font-size px yozilmaydi — faqat var(--fs-*); rang — faqat o'zgaruvchilar. */
@font-face { font-family: 'Plus Jakarta Sans'; src: url('/fonts/PlusJakartaSans-var.ttf') format('truetype'); font-weight: 200 800; font-display: swap; }

:root {
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 15px; --fs-md: 17px; --fs-lg: 20px; --fs-xl: 26px; --fs-2xl: 34px;
  --r-sm: 10px; --r: 14px; --r-lg: 20px;
  --accent: #ea580c; --accent-2: #f97316; --accent-soft: #fff1e6; --accent-ink: #fff;
  --ok: #16a34a; --ok-soft: #dcfce7; --warn: #d97706; --warn-soft: #fef3c7; --bad: #dc2626; --bad-soft: #fee2e2; --info: #0284c7;
  --bg: #f7f5f2; --surface: #ffffff; --surface-2: #faf8f6; --line: #ece7e1; --text: #1c1917; --muted: #78716c;
  --shadow: 0 1px 2px rgba(28, 25, 23, .05), 0 8px 24px rgba(28, 25, 23, .06);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #12100e; --surface: #1c1916; --surface-2: #231f1b; --line: #332d27; --text: #f5f2ee; --muted: #a8a29e; --accent-soft: #3a2010; --ok-soft: #14321f; --warn-soft: #3a2a0c; --bad-soft: #3b1414; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); } }
:root[data-theme="dark"] { --bg: #12100e; --surface: #1c1916; --surface-2: #231f1b; --line: #332d27; --text: #f5f2ee; --muted: #a8a29e; --accent-soft: #3a2010; --ok-soft: #14321f; --warn-soft: #3a2a0c; --bad-soft: #3b1414; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: var(--fs-base); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; line-height: 1.45; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-xl); } h2 { font-size: var(--fs-lg); } h3 { font-size: var(--fs-md); }
.muted { color: var(--muted); } .small { font-size: var(--fs-sm); }

/* ---- Ilova karkasi: chap menyu + ish joyi (telefonda pastki menyu) ---- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 800; font-size: var(--fs-md); }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--accent-2), var(--accent)); display: grid; place-items: center; color: #fff; font-size: var(--fs-lg); box-shadow: 0 6px 16px rgba(234, 88, 12, .35); }
.brand small { display: block; font-weight: 600; color: var(--muted); font-size: var(--fs-xs); }
.nav { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-weight: 600; cursor: pointer; border: 0; background: none; font: inherit; text-align: left; }
.nav:hover { background: var(--surface-2); }
.nav.active { background: var(--accent-soft); color: var(--accent); }
.nav .ic { width: 22px; text-align: center; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.main { padding: 26px 30px 60px; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px; border-right: 0; border-top: 1px solid var(--line); z-index: 50; overflow-x: auto; }
  .side .brand, .side .side-foot { display: none; }
  .nav { flex-direction: column; gap: 2px; font-size: var(--fs-xs); padding: 6px 10px; min-width: 72px; text-align: center; }
  .main { padding: 16px 16px 90px; }
}

/* ---- Kartochka, tugma, maydon ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 10px 16px; border-radius: var(--r-sm); font: inherit; font-weight: 700; cursor: pointer; transition: transform .06s, background .15s, border-color .15s; min-height: 42px; }
.btn:hover { border-color: var(--accent-2); }
a.btn, a.tab, a.nav { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: var(--fs-sm); }
.btn[disabled] { opacity: .55; cursor: wait; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: var(--fs-sm); }
.input, select.input, textarea.input { font: inherit; font-size: var(--fs-base); color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; min-height: 42px; width: 100%; }
.input:focus { outline: 2px solid var(--accent-2); outline-offset: 0; border-color: transparent; background: var(--surface); }
.input.invalid { border-color: var(--bad); background: var(--bad-soft); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-weight: 700; cursor: pointer; color: var(--text); }
.tab.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.empty { padding: 34px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi b { display: block; font-size: var(--fs-lg); margin-top: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- Taom kartochkalari (menyu, kassa) ---- */
.dishes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.dish { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .1s; display: flex; flex-direction: column; }
.dish:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.dish-img { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); display: grid; place-items: center; font-size: var(--fs-2xl); background-size: cover; background-position: center; }
.dish-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.dish-name { font-weight: 700; }
.dish-price { font-weight: 800; color: var(--accent); }
.dish.stop { opacity: .55; }
.dish.stop .dish-img::after { content: 'STOP'; background: var(--bad); color: #fff; font-size: var(--fs-sm); font-weight: 800; padding: 4px 10px; border-radius: 8px; }

/* ---- Stollar ---- */
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.tbl { aspect-ratio: 1; border-radius: var(--r-lg); border: 2px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 800; font-size: var(--fs-lg); cursor: pointer; }
.tbl small { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.tbl.busy { border-color: var(--accent); background: var(--accent-soft); }

/* ---- STANDART JADVAL ---- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.t th { position: sticky; top: 0; background: var(--surface-2); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 700; white-space: nowrap; cursor: pointer; user-select: none; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover { background: var(--surface-2); }
table.t td.r, table.t th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tr.click { cursor: pointer; }

/* ---- OYNA (modal): ekranga sig'adi, ichi aylanadi ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(12, 10, 9, .45); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .12s; }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 30px 80px rgba(0,0,0,.3); width: min(560px, 96vw); max-height: 94vh; display: flex; flex-direction: column; }
.modal.wide { width: min(880px, 96vw); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-body { padding: 18px 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }

/* ---- Xabar (toast) ---- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--text); color: var(--surface); padding: 12px 16px; border-radius: var(--r-sm); box-shadow: var(--shadow); font-weight: 600; max-width: 380px; animation: fade .15s; }
.toast.bad { background: var(--bad); color: #fff; }
@media (max-width: 860px) { .toasts { bottom: auto; top: 12px; left: 16px; right: 16px; } }

/* ---- Kirish sahifasi ---- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: radial-gradient(circle at 30% 20%, #fdba74, transparent 45%), radial-gradient(circle at 80% 70%, #fb7185, transparent 40%), linear-gradient(135deg, #ea580c, #9a3412); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art h1 { font-size: var(--fs-2xl); line-height: 1.15; max-width: 460px; }
.auth-art ul { padding-left: 18px; line-height: 1.9; font-weight: 600; }
.auth-form { display: grid; place-items: center; padding: 24px; }
.auth-form .card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }
@media (max-width: 860px) { .dishes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .dish-img { font-size: var(--fs-xl); } }

/* ---- CHEK (80 mm) — faqat chop etishda ko'rinadi ---- */
#receipt { display: none; }
@media print {
  @page { size: 80mm auto; margin: 3mm; }
  body * { visibility: hidden !important; }
  #receipt, #receipt * { visibility: visible !important; }
  #receipt { display: block; position: absolute; left: 0; top: 0; width: 74mm; font: 12px/1.35 monospace; color: #000; }
  #receipt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
  #receipt .rc-c { text-align: center; } #receipt .rc-b { font-weight: 700; } #receipt .rc-big { font-size: 15px; font-weight: 700; }
  #receipt .rc-row { display: flex; justify-content: space-between; gap: 8px; margin: 2px 0; } #receipt small { font-size: 11px; }
}

/* ---- KASSA / OFITSIANT ---- */
.pos { display: grid; grid-template-rows: auto 1fr; height: 100vh; }
.pos-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pos-top .brand { padding: 0; }
.pos-top .sp { flex: 1; }
.pos-home { overflow: auto; padding: 18px; }
.pos-order { display: grid; grid-template-columns: 1fr 400px; min-height: 0; }
.pos-menu { display: flex; flex-direction: column; min-height: 0; padding: 14px 16px; gap: 12px; }
.pos-menu .dishes { overflow: auto; padding-bottom: 20px; align-content: start; flex: 1; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.pos-menu .dish-img { aspect-ratio: 16 / 10; }
.ticket { background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ticket-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ticket-items { flex: 1; overflow: auto; padding: 6px 10px; }
.ti { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 6px; border-bottom: 1px dashed var(--line); }
.ti-name { font-weight: 700; } .ti-sub { font-size: var(--fs-sm); color: var(--muted); }
.ti-qty { display: flex; align-items: center; gap: 6px; }
.ti-qty button { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font: inherit; font-weight: 800; cursor: pointer; color: var(--text); }
.ti.cancelled { opacity: .45; text-decoration: line-through; }
.st { font-size: var(--fs-xs); font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.st.draft { background: var(--warn-soft); color: var(--warn); } .st.queued, .st.cooking { background: #e0f2fe; color: #0369a1; } .st.ready { background: var(--ok-soft); color: var(--ok); }
.ticket-sum { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }
.ticket-sum .row { justify-content: space-between; }
.ticket-sum .total { font-size: var(--fs-lg); font-weight: 800; }
.ticket-act { padding: 12px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 1px solid var(--line); }
.ticket-act .btn { min-height: 52px; font-size: var(--fs-md); }
.tbl .tbl-sum { font-size: var(--fs-xs); font-weight: 700; color: var(--accent); }
.tbl.ready { border-color: var(--ok); background: var(--ok-soft); }
.mobbar { display: none; }
@media (max-width: 860px) {
  .pos-order { grid-template-columns: 1fr; }
  .ticket { position: fixed; inset: 0; z-index: 60; border: 0; transform: translateY(100%); transition: transform .2s; }
  .ticket.open { transform: none; }
  .mobbar { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 55; }
  .mobbar .btn { flex: 1; min-height: 56px; box-shadow: var(--shadow); }
  .pos-menu .dishes { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 90px; }
}
.pay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-grid .btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.big-num { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; }

/* ---- OSHXONA EKRANI ---- */
.kds { min-height: 100vh; background: #0f0d0b; color: #f5f2ee; }
.kds-top { display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: #1a1714; border-bottom: 1px solid #2c2622; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.kds-top .tab { background: #231f1b; color: #f5f2ee; border-color: #3a332d; }
.kds-top .tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding: 16px; align-items: start; }
.kc { background: #1c1916; border: 2px solid #3a332d; border-radius: 18px; overflow: hidden; }
.kc.warn { border-color: #d97706; } .kc.late { border-color: #dc2626; animation: pulse 1.6s infinite; } .kc.done { opacity: .6; border-color: #16a34a; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, .25); } }
.kc-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: #231f1b; }
.kc-num { font-size: var(--fs-xl); font-weight: 800; }
.kc-time { font-variant-numeric: tabular-nums; font-weight: 800; font-size: var(--fs-md); }
.kc-items { padding: 6px 8px; }
.ki { padding: 10px 8px; border-radius: 12px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-md); user-select: none; }
.ki:hover { background: #2a2520; }
.ki b { min-width: 34px; font-size: var(--fs-lg); }
.ki small { display: block; color: #fbbf24; font-size: var(--fs-sm); }
.ki.cooking { background: rgba(2, 132, 199, .18); } .ki.ready { opacity: .45; text-decoration: line-through; }
.kc .btn { width: calc(100% - 16px); margin: 0 8px 10px; min-height: 50px; }
