/* QaderFN Orders — shared styles. Two looks (modern, classic), set per café. */
:root {
  --accent: #0E6B5E;
  --accent-ink: #ffffff;
  --accent-tint: color-mix(in srgb, var(--accent) 12%, #ffffff);
  --bg: #F6F4F0;
  --card: #ffffff;
  --ink: #1A1917;
  --muted: #5B5750;
  --line: #E2DED6;
  --chip: #ECE8E0;
  --radius: 16px;
  --radius-sm: 12px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
}
body.classic {
  --bg: #F4ECDD;
  --card: #FBF6EA;
  --ink: #2A1E19;
  --muted: #5E4B3F;
  --line: #D9CBB0;
  --chip: #E9DEC8;
  --radius: 6px;
  --radius-sm: 4px;
  --font: 'Lora', Georgia, serif;
  --head: 'Playfair Display', Georgia, serif;
}
[dir='rtl'] { --font: 'Cairo', system-ui, sans-serif; --head: 'Cairo', system-ui, sans-serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--head); margin: 0; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.hero { max-width: 520px; text-align: center; display: flex; flex-direction: column; gap: 12px; }

/* ---------- Buttons ---------- */
.btn { min-height: 44px; padding: 0 20px; border-radius: var(--radius-sm); border: 1px solid var(--ink); background: transparent; color: var(--ink); font-weight: 600; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.big { min-height: 56px; width: 100%; font-size: 17px; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn.danger { border-color: #9B1C1C; color: #9B1C1C; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.link-btn { min-height: 44px; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Customer page ---------- */
.app { max-width: 520px; margin: 0 auto; padding: 0 20px 120px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 20px 0 12px; }
.logo { width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-family: var(--head); font-weight: 700; font-size: 20px; flex-shrink: 0; }
.topbar .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar .who strong { font-family: var(--head); font-size: 18px; }
.topbar .who span { font-size: 13px; color: var(--muted); }
.langs { display: flex; background: var(--chip); border-radius: var(--radius-sm); padding: 2px; direction: ltr; }
.langs button { width: 44px; height: 44px; border: 0; background: transparent; border-radius: calc(var(--radius-sm) - 2px); font-size: 13px; font-weight: 600; color: var(--muted); }
.langs button[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-weight: 500; white-space: nowrap; }
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
body.classic .chip { border-radius: 4px; }

.list { display: flex; flex-direction: column; gap: 12px; }
.item { background: var(--card); border-radius: var(--radius); padding: 12px; display: flex; gap: 14px; align-items: center; }
.item .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item .name { font-family: var(--head); font-weight: 600; font-size: 17px; }
.item .desc { font-size: 13px; color: var(--muted); line-height: 1.4; }
.item .price { font-weight: 600; margin-top: 2px; }
.item.soldout { opacity: 0.6; }
.badge { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; align-self: flex-start; }
body.classic .item { background: transparent; border-radius: 0; border-bottom: 1px solid var(--line); padding: 14px 0; }
body.classic .list { gap: 0; }
body.classic .item .price { color: var(--accent); }

.stepper { display: flex; align-items: center; gap: 4px; }
.stepper .num { min-width: 22px; text-align: center; font-weight: 700; }
.round { width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.round.plus { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
body.classic .round.plus { background: transparent; color: var(--accent); border-color: var(--accent); border-radius: 999px; }

.cartbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 20px 20px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.cartbar .btn { max-width: 480px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 16px; margin-bottom: 8px; border-radius: var(--radius-sm); border: 1px solid var(--accent); background: var(--accent-tint); text-align: start; font-weight: 600; }

.card { background: var(--card); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
body.classic .card { border: 1px solid var(--line); }
.hero-card { background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 6px; }
.hero-card .big { font-family: var(--head); font-size: 40px; font-weight: 700; line-height: 1.1; }
.row { display: flex; justify-content: space-between; gap: 12px; }
.total { font-weight: 700; font-size: 18px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 0; width: 100%; }
.steps { display: flex; flex-direction: column; gap: 18px; }
.step { display: flex; align-items: center; gap: 14px; }
.dot { width: 32px; height: 32px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.dot.done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dot.done::before { content: '✓'; font-weight: 700; font-size: 16px; }
.dot.now { border: 3px solid var(--accent); }
.step .t { font-weight: 600; }
.step .s { font-size: 13px; color: var(--muted); }
.step.todo .t { color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 14px; font-weight: 600; }
.input { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; width: 100%; }
textarea.input { min-height: 80px; resize: vertical; }
.error { color: #9B1C1C; font-weight: 600; font-size: 14px; }
.back { align-self: flex-start; }

/* ---------- Kitchen ---------- */
body.kitchen { --bg: #1A1917; --card: #2D2B28; --ink: #F6F4F0; --muted: #D4CEC3; --line: #4a4640; --chip: #2D2B28; --accent: #5CC8B4; --accent-ink: #0B2E29; min-height: 100vh; }
.k-wrap { padding: 20px; display: flex; flex-direction: column; gap: 16px; min-height: 100vh; }
.k-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.k-head .left { display: flex; align-items: center; gap: 12px; }
.k-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.k-tools .btn { border-color: var(--line); }
.k-tools .btn[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.k-cols { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; align-items: start; }
.k-col { background: #232220; border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.k-col h2 { font-size: 18px; display: flex; justify-content: space-between; align-items: center; }
.count { min-width: 28px; height: 28px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ticket { background: var(--card); border-radius: var(--radius-sm); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ticket.ready { border: 2px solid var(--accent); }
.ticket .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ticket .tbl { font-family: var(--head); font-size: 24px; font-weight: 700; }
.ticket .age { font-size: 14px; color: var(--muted); }
.ticket .age.late { color: #F2C879; font-weight: 700; }
.ticket .lines { display: flex; flex-direction: column; gap: 4px; font-size: 17px; }
.ticket .note { color: #F2C879; font-size: 14px; }
.ticket .acts { display: flex; gap: 8px; }
.ticket .acts .btn { flex: 1; min-height: 52px; }
.k-empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.waiters .k-col.hide-w { display: none; }
.waiters .ticket .tbl { font-size: 34px; }
.waiters .ticket .lines { font-size: 20px; }

/* ---------- Owner and setup pages ---------- */
.shell { max-width: 1100px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.shell header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.shell header .left { display: flex; align-items: center; gap: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-weight: 600; }
.tab[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.panel h2 { font-size: 20px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.cat-block { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.cat-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; background: var(--chip); }
.cat-head .names { font-weight: 700; }
.cat-head .names span { font-weight: 400; color: var(--muted); margin-inline-start: 8px; }
.irow { display: grid; grid-template-columns: minmax(0, 2fr) 90px auto; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.irow .n { display: flex; flex-direction: column; min-width: 0; }
.irow .n small { color: var(--muted); }
.irow .btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.toggle { min-height: 44px; min-width: 90px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; color: var(--muted); }
.toggle[aria-pressed='true'] { background: var(--accent-tint); border-color: var(--accent); color: #0B4F45; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch { width: 44px; height: 44px; border-radius: 999px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--ink); }
body.kitchen .btn.danger { border-color: #F2A0A0; color: #F2A0A0; }
.ticket .acts .btn.small { flex: 0 0 auto; }
.shell a:not(.btn) { color: var(--accent); }
.seg { align-self: flex-start; display: inline-flex; background: var(--chip); border-radius: var(--radius-sm); padding: 2px; }
.seg button { min-height: 44px; padding: 0 20px; border: 0; background: transparent; border-radius: calc(var(--radius-sm) - 2px); font-weight: 600; color: var(--muted); }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 16px; }
.checks label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.qr-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; background: #fff; color: #1A1917; }
.qr-card svg { width: 140px; height: 140px; }
.qr-card .url { font-size: 11px; word-break: break-all; color: #5B5750; }
table.plain { width: 100%; border-collapse: collapse; }
table.plain th, table.plain td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 15px; }
table.plain th { color: var(--muted); font-size: 13px; }
.table-scroll { overflow-x: auto; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; width: min(560px, calc(100vw - 24px)); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
dialog form { display: flex; flex-direction: column; gap: 14px; }
dialog .acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.keybox { font-family: ui-monospace, Menlo, monospace; background: var(--chip); padding: 10px 12px; border-radius: var(--radius-sm); word-break: break-all; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 600; z-index: 50; }

@media print {
  .noprint { display: none !important; }
  body { background: #fff; }
  .shell { padding: 0; max-width: none; }
  .panel { border: 0; padding: 0; }
  .qr-card { break-inside: avoid; }
}
