/* ============================================================
 * Design system — extracted verbatim from restaurant_system_mockup_full.html
 * (§2.8 of NEW_SYSTEM_REFERENCE.md: new layout must match the mockup exactly,
 * no relation to the old Bootstrap layout it replaces).
 *
 * Two additions beyond the mockup, both logical-property fixes so the same
 * rules mirror correctly for English/LTR (§2.7 — mockup itself is Arabic/RTL
 * only, this app is bilingual):
 *   - .badge uses inset-inline-start instead of left
 *   - table.dtable th uses text-align:start instead of right
 * Everything else (colors, spacing, radii, shadows, component shapes) is
 * unchanged from the mockup so every future module page matches pixel-for-
 * pixel. Do not "clean up" values here without checking the mockup first.
 * ============================================================ */

:root{
  --page:#f4f5f9; --canvas:#ffffff;
  --ink:#1c1e26; --ink-soft:#6b7080; --ink-faint:#a7abb8;
  --line:#eceef2;
  --shadow-tile:0 10px 22px -10px rgba(20,22,30,.25);
  --shadow-modal:0 30px 90px -20px rgba(15,17,26,.5);
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html,body{height:100%;}
body{
  margin:0; font-family:'Tajawal',sans-serif;
  background:var(--page); color:var(--ink); min-height:100vh;
}

/* ---------- app bar (full width) ---------- */
.appbar{
  position:sticky; top:0; z-index:40; background:rgba(255,255,255,.92); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 40px; flex-wrap:wrap; gap:14px;
}
/* §22 — small-screen: the decorative (non-functional, static text)
   search chip is the first thing worth dropping to free up room; it
   was eating a fixed 190px minimum on every screen size. */
@media (max-width:680px){
  .appbar{ padding:12px 14px; }
  .search-chip{ display:none; }
}
.brand{ display:flex; align-items:center; gap:14px; text-decoration:none; color:inherit; }
.brand-mark{
  width:44px; height:44px; border-radius:13px; background:linear-gradient(155deg,#111319,#2b2e3a);
  display:flex; align-items:center; justify-content:center; color:#fff; font-weight:900; font-size:15px; flex-shrink:0;
}
.brand-title{ font-size:17px; font-weight:800; margin:0; }
.brand-sub{ font-size:12px; color:var(--ink-soft); font-weight:600; margin-top:1px; }
.appbar-right{ display:flex; align-items:center; gap:14px; }
.search-chip{
  display:flex; align-items:center; gap:8px; background:#f0f1f5; border-radius:12px; padding:9px 14px;
  font-size:12.5px; color:var(--ink-faint); font-weight:600; min-width:190px;
}
.clock-chip{ background:#fff; border:1px solid var(--line); border-radius:14px; padding:8px 16px; text-align:center; box-shadow:0 4px 12px -8px rgba(20,22,30,.2); }
.clock-chip .t{ font-size:15px; font-weight:800; font-variant-numeric:tabular-nums; }
.clock-chip .d{ font-size:10.5px; color:var(--ink-soft); font-weight:600; }

/* small chip buttons in the appbar that aren't in the original mockup
   (lang toggle, user/logout) — same visual language as .clock-chip so they
   don't look bolted-on */
.chip-btn{
  background:#fff; border:1px solid var(--line); border-radius:14px; padding:8px 16px;
  font-family:inherit; font-size:12.5px; font-weight:800; color:var(--ink); cursor:pointer;
  text-decoration:none; display:inline-flex; align-items:center; gap:6px;
}
.chip-btn:hover{ background:#f6f7fa; }

/* ---------- main / grid ---------- */
.main{ max-width:1560px; margin:0 auto; padding:34px 40px 60px; }
/* §22 — small-screen fix: .main's fixed 40px side padding + .page-card's
   own padding left almost no usable width for POS/Kitchen content on a
   phone/small tablet (real POS tills are often exactly this size) — the
   page never technically broke (nothing overflowed), it just had too
   little room to be usable. Tightened here rather than per-module. */
@media (max-width:680px){ .main{ padding:16px 12px 40px; } }
/* §25 — kiosk mode: hides the app's own appbar on top of the browser-
   level Fullscreen API toggle (toggleFullscreen(), views/layouts/main.php)
   — the real complaint was the app chrome itself eating room on a small
   POS/kitchen screen, not just the browser's tab/address bar. */
.kiosk-mode .appbar{ display:none; }
.kiosk-mode .main{ padding-top:10px; }
.kiosk-exit-btn{
  display:none; position:fixed; top:10px; inset-inline-end:10px; z-index:999;
  width:34px; height:34px; border-radius:50%; border:none; background:#111319; color:#fff;
  font-size:14px; font-weight:800; cursor:pointer; box-shadow:var(--shadow-tile);
}
.kiosk-mode .kiosk-exit-btn{ display:flex; align-items:center; justify-content:center; }
.section-eyebrow{ font-size:12px; font-weight:800; color:var(--ink-faint); letter-spacing:.04em; margin:0 0 18px; }

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(148px,1fr));
  gap:30px 22px;
}
.tile{
  background:none; border:none; cursor:pointer; padding:0;
  display:flex; flex-direction:column; align-items:center; gap:10px;
  font-family:inherit; outline:none; user-select:none; text-decoration:none;
}
.icon-wrap{
  width:88px; height:88px; border-radius:24px;
  display:flex; align-items:center; justify-content:center;
  box-shadow:var(--shadow-tile); position:relative;
  transition:transform .22s cubic-bezier(.2,.8,.2,1);
}
.icon-wrap::after{
  content:''; position:absolute; inset:0; border-radius:inherit;
  background:linear-gradient(155deg, rgba(255,255,255,.35), rgba(255,255,255,0) 45%);
  pointer-events:none;
}
.tile:hover .icon-wrap{ transform:translateY(-4px) scale(1.05); }
.icon-wrap svg{ width:36px; height:36px; position:relative; z-index:1; }
.badge{
  position:absolute; top:-6px; inset-inline-start:-6px; background:#e5384d; color:#fff;
  font-size:11px; font-weight:800; min-width:21px; height:21px; border-radius:11px;
  display:flex; align-items:center; justify-content:center; padding:0 5px;
  border:2px solid #fff; z-index:2;
}
.tile-label{ font-size:13.5px; font-weight:700; color:#33353e; text-align:center; line-height:1.25; }
.tile-tag{ font-size:10px; font-weight:800; color:#a7abb8; }

/* ---------- page card (module pages) ----------
   Same visual language as the mockup's .sheet/.overlay modal, but rendered
   as a normal static block on a real page instead of a JS overlay — see
   §2.8/§6 decision: every module is a real server-rendered route, not a
   client-side sheet. Header/tabs/body markup below is intentionally
   byte-for-byte the same classnames as the mockup's sheet-header/tabs/
   sheet-body so the two look identical. */
.page-card{
  max-width:960px; margin:0 auto; background:#fbfbfd;
  border-radius:30px; box-shadow:var(--shadow-modal);
  display:flex; flex-direction:column; overflow:hidden;
}
/* Operational/big-screen modules (POS terminal, Kitchen Display) need the
   product grid/cart/order columns to breathe on an actual till or wall
   monitor — squeezing them into the same 960px reading-width card as a
   CRUD form (Settings, Customers...) wastes most of the screen. Modifier,
   not a change to .page-card itself, so every other module keeps its
   narrower centered-card look untouched (raised 7 Aug 2026, §21). */
.page-card-wide{
  max-width:1520px;
}
.sheet-header{ display:flex; align-items:center; gap:16px; padding:22px 28px; border-bottom:1px solid var(--line); }
.sheet-header .mini-icon{ width:48px; height:48px; border-radius:15px; display:flex; align-items:center; justify-content:center; flex-shrink:0; box-shadow:0 8px 16px -8px rgba(0,0,0,.35); }
.sheet-header .mini-icon svg{ width:24px; height:24px; }
.sheet-header .titles{ flex:1; min-width:0; }
.sheet-header h2{ margin:0; font-size:19.5px; font-weight:800; }
.sheet-header p{ margin:2px 0 0; font-size:12.5px; color:var(--ink-soft); font-weight:500; }
.close-btn{ width:34px; height:34px; border-radius:50%; border:none; background:#f0f1f5; color:#5b5f6b; display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; text-decoration:none; }
.close-btn:hover{ background:#e4e6ec; }
.close-btn svg{ width:16px; height:16px; }

.tabs{ display:flex; gap:6px; padding:14px 24px; overflow-x:auto; border-bottom:1px solid var(--line); scrollbar-width:none; }
.tabs::-webkit-scrollbar{ display:none; }
.tab-btn{ border:none; background:transparent; padding:9px 15px; border-radius:11px; font-family:inherit; font-size:13px; font-weight:700; color:var(--ink-soft); cursor:pointer; white-space:nowrap; text-decoration:none; display:inline-block; }
.tab-btn.active{ background:var(--tab-bg,#efeaff); color:var(--tab-fg,#5b34e0); }

.sheet-body{ padding:24px 28px 32px; overflow-y:auto; }
/* §22 — same small-screen tightening as .main/.appbar above, so the
   page-card's own fixed padding doesn't re-eat the room just freed up —
   POS/Kitchen tablets are the real target, not just phones. */
@media (max-width:680px){
  .sheet-header{ padding:16px 16px; gap:10px; }
  .tabs{ padding:10px 14px; }
  .sheet-body{ padding:16px 14px 24px; }
}

/* ---------- shared components ---------- */
.kpi-row{ display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:14px; margin-bottom:20px; }
.kpi-card{ background:#fff; border:1px solid var(--line); border-radius:16px; padding:16px 18px; }
.kpi-card .lbl{ font-size:11.5px; color:var(--ink-soft); font-weight:700; }
.kpi-card .val{ font-size:21px; font-weight:800; margin-top:5px; }
.kpi-card .delta{ font-size:11px; font-weight:700; margin-top:4px; }
.delta.up{ color:#0e9f6e; } .delta.down{ color:#e02424; }

.section-title{ font-size:13.5px; font-weight:800; color:var(--ink); margin:22px 0 12px; }
.section-title:first-child{ margin-top:0; }

table.dtable{ width:100%; border-collapse:collapse; background:#fff; border:1px solid var(--line); border-radius:14px; overflow:hidden; }
table.dtable th{ background:#f6f7fa; font-size:11.5px; font-weight:800; color:var(--ink-soft); padding:11px 14px; text-align:start; }
table.dtable td{ font-size:13.5px; padding:12px 14px; border-top:1px solid var(--line); font-weight:500; }
input.qty-in{ width:64px; padding:5px 8px; border-radius:8px; border:1px solid var(--line); font-family:inherit; font-weight:700; font-size:12.5px; text-align:center; }

.tag{ display:inline-flex; align-items:center; font-size:11px; font-weight:800; padding:4px 11px; border-radius:20px; }
.tag.green{ background:#e5f8ef; color:#0e9f6e; } .tag.amber{ background:#fff4e2; color:#c17a05; }
.tag.red{ background:#fdeaea; color:#d92d2d; } .tag.blue{ background:#e8f1ff; color:#2563eb; } .tag.gray{ background:#f0f1f5; color:#5b5f6b; }

.list{ display:flex; flex-direction:column; gap:9px; }
.list-item{ display:flex; align-items:center; gap:13px; background:#fff; border:1px solid var(--line); border-radius:14px; padding:13px 15px; }
.list-item .avatar{ width:40px; height:40px; border-radius:12px; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:14px; flex-shrink:0; }
.list-item .info{ flex:1; min-width:0; } .list-item .info .n{ font-size:13.5px; font-weight:700; } .list-item .info .s{ font-size:11.5px; color:var(--ink-soft); font-weight:500; margin-top:1px; }

.bars{ display:flex; align-items:flex-end; gap:16px; height:160px; padding:12px 8px 0; background:#fff; border:1px solid var(--line); border-radius:16px; }
.bar-col{ flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; height:100%; justify-content:flex-end; }
.bar{ width:100%; max-width:36px; border-radius:8px 8px 0 0; } .bar-col .blabel{ font-size:10.5px; color:var(--ink-soft); font-weight:700; }

.btn{ border:none; border-radius:12px; padding:10px 18px; font-family:inherit; font-weight:800; font-size:12.5px; cursor:pointer; color:#fff; display:inline-flex; align-items:center; gap:6px; text-decoration:none; }
.btn.ghost{ background:#f0f1f5; color:#3a3d47; }
/* §25 — active-state modifier for a ghost button used as a tab/filter
   pill (POS category tabs) — same "sel" naming convention as .ot-btn.sel
   /.pay-btn.sel above, just extended to .btn.ghost too. */
.btn.ghost.sel{ background:#111319; color:#fff; }

.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media (max-width:640px){ .grid2{ grid-template-columns:1fr; } }

/* POS */
.pos-wrap{ display:grid; grid-template-columns:1.5fr 1fr; gap:18px; }
@media (max-width:680px){ .pos-wrap{ grid-template-columns:1fr; } }
.row-controls{ display:flex; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.sel{ padding:10px 13px; border-radius:11px; border:1px solid var(--line); font-family:inherit; font-weight:700; font-size:12.5px; background:#fff; }
.order-type{ display:flex; gap:6px; }
.ot-btn{ border:1px solid var(--line); background:#fff; border-radius:10px; padding:8px 13px; font-size:12px; font-weight:800; cursor:pointer; font-family:inherit; }
.ot-btn.sel{ background:#111319; color:#fff; border-color:#111319; }
.prod-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
/* §22 — fixed 3 columns had no small-screen fallback at all (the only
   .prod-grid rule in the whole stylesheet) — on a narrow phone/tablet
   each tile got squeezed to a sliver. auto-fill/minmax matches the
   pattern already used by .grid/.floor elsewhere in this file. */
@media (max-width:520px){ .prod-grid{ grid-template-columns:repeat(auto-fill,minmax(96px,1fr)); } }
.prod-btn{ background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px 8px; cursor:pointer; font-family:inherit; text-align:center; }
.prod-btn:active{ transform:scale(.96); }
.prod-btn .pi{ font-size:24px; } .prod-btn .pn{ font-size:12px; font-weight:800; margin-top:5px; } .prod-btn .pp{ font-size:11px; color:var(--ink-soft); font-weight:700; margin-top:2px; }
.cart-panel{ background:#fff; border:1px solid var(--line); border-radius:16px; padding:16px; display:flex; flex-direction:column; }
.cart-items{ flex:1; display:flex; flex-direction:column; gap:9px; min-height:90px; margin-bottom:12px; }
.cart-empty{ font-size:12px; color:var(--ink-faint); text-align:center; padding:26px 0; font-weight:600; }
.cart-row{ display:flex; justify-content:space-between; align-items:center; font-size:12.5px; font-weight:700; }
.cart-row .rm{ cursor:pointer; color:#d92d2d; font-size:11px; font-weight:800; background:none; border:none; font-family:inherit; }
.cart-total{ display:flex; justify-content:space-between; font-size:15px; font-weight:800; padding-top:11px; border-top:1px dashed var(--line); }
.pay-row{ display:flex; gap:8px; margin-top:11px; }
.pay-btn{ flex:1; border:1px solid var(--line); background:#f9f9fb; border-radius:10px; padding:9px; font-size:11.5px; font-weight:800; cursor:pointer; font-family:inherit; }
.pay-btn.sel{ background:#111319; color:#fff; border-color:#111319; }

/* tables floor plan */
.floor{ display:grid; grid-template-columns:repeat(auto-fill,minmax(90px,1fr)); gap:14px; }
.table-chip{ border:none; border-radius:16px; padding:16px 8px; cursor:pointer; font-family:inherit; text-align:center; }
.table-chip .tn{ font-size:13px; font-weight:800; } .table-chip .ts2{ font-size:10.5px; font-weight:700; margin-top:3px; }
.table-chip.free{ background:#e5f8ef; color:#0e9f6e; } .table-chip.busy{ background:#fdeaea; color:#d92d2d; } .table-chip.wait{ background:#fff4e2; color:#c17a05; }
.table-chip.selected{ outline:3px solid #111319; outline-offset:2px; }

/* cash reconciliation */
.cash-row{ display:flex; justify-content:space-between; align-items:center; background:#fff; border:1px solid var(--line); border-radius:14px; padding:13px 16px; margin-bottom:10px; }
.cash-row .lbl{ font-size:12.5px; font-weight:700; color:var(--ink-soft); }
.cash-row .val{ font-size:15px; font-weight:800; }
.cash-input{ width:120px; padding:9px 12px; border-radius:10px; border:1px solid var(--line); font-family:inherit; font-weight:800; font-size:14px; text-align:center; }
.variance-box{ margin-top:14px; padding:16px; border-radius:14px; text-align:center; font-weight:800; font-size:15px; }
.variance-box.ok{ background:#e5f8ef; color:#0e9f6e; } .variance-box.bad{ background:#fdeaea; color:#d92d2d; } .variance-box.neutral{ background:#f0f1f5; color:#5b5f6b; }

/* keypad */
.keypad-wrap{ display:flex; flex-direction:column; align-items:center; gap:16px; padding:8px 0 4px; }
.pin-display{ display:flex; gap:10px; }
.pin-dot{ width:14px; height:14px; border-radius:50%; border:2px solid #d6d9e0; }
.pin-dot.filled{ background:#111319; border-color:#111319; }
.keypad{ display:grid; grid-template-columns:repeat(3,66px); gap:12px; }
.kp-btn{ width:66px; height:66px; border-radius:50%; border:1px solid var(--line); background:#fff; font-size:18px; font-weight:800; cursor:pointer; font-family:inherit; }
.kp-btn:active{ background:#f0f1f5; }
.kp-msg{ font-size:12.5px; font-weight:700; color:var(--ink-soft); min-height:18px; }
.kp-msg.ok{ color:#0e9f6e; }

/* kitchen display */
.kds-board{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
@media (max-width:680px){ .kds-board{ grid-template-columns:1fr; } }
.kds-col{ background:#f6f7fa; border-radius:16px; padding:14px; min-height:220px; }
.kds-col h4{ margin:0 0 12px; font-size:12.5px; font-weight:800; color:var(--ink-soft); display:flex; justify-content:space-between; }
.kds-card{ background:#fff; border:1px solid var(--line); border-radius:13px; padding:12px 13px; margin-bottom:10px; }
.kds-card .kh{ display:flex; justify-content:space-between; font-size:12.5px; font-weight:800; margin-bottom:6px; }
.kds-card .ki{ font-size:11.5px; color:var(--ink-soft); font-weight:600; line-height:1.6; }
.kds-card button{ margin-top:9px; width:100%; border:none; border-radius:9px; padding:8px; font-size:11.5px; font-weight:800; cursor:pointer; font-family:inherit; color:#fff; }

.footnote{ margin-top:22px; padding-top:15px; border-top:1px dashed var(--line); font-size:11.5px; color:var(--ink-faint); font-weight:500; line-height:1.75; }
.newtag{ display:inline-block; background:#111319; color:#fff; font-size:9.5px; font-weight:800; padding:2px 8px; border-radius:20px; margin-inline-start:6px; vertical-align:middle; }

/* ---------- pre-auth pages (login/forgot/reset) ----------
   Not covered by the mockup itself (it has no auth screen) — kept minimal
   and using the same tokens/typography so it doesn't clash with the rest
   of the app once auth is built (§6 bullet 2). */
.authwrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; }
.authcard{ width:100%; max-width:380px; background:var(--canvas); border-radius:24px; box-shadow:var(--shadow-modal); padding:36px 32px; }
.authcard h1{ font-size:19px; font-weight:800; margin:0 0 4px; text-align:center; }
.authcard .sub{ font-size:12.5px; color:var(--ink-soft); font-weight:600; text-align:center; margin:0 0 26px; }
.field{ margin-bottom:16px; }
.field label{ display:block; font-size:12px; font-weight:700; color:var(--ink-soft); margin-bottom:6px; }
.field input{ width:100%; padding:11px 14px; border-radius:11px; border:1px solid var(--line); font-family:inherit; font-size:13.5px; font-weight:600; }
.field input:focus{ outline:2px solid #111319; outline-offset:1px; }
.btn.block{ width:100%; justify-content:center; background:#111319; padding:12px; font-size:13px; }
