/* ===== dolceva coffee — the base: Dolceva cream and burgundy, one face (Readex Pro), quiet surfaces ===== */
:root {
  --bg: #f3eee6;            /* the page: Dolceva cream, a shade lighter for long shifts */
  --surface: #ffffff;
  --surface-2: #faf6f0;
  --border: #e5dbcf;
  --border-strong: #d6c8b8;
  --text: #22120f;
  --muted: #6b5a52;
  --primary: #580806;       /* Dolceva burgundy: the main action, the selection, the key numbers */
  --primary-600: #420504;
  --primary-50: #f6ebe7;
  --accent: #7b4a3f;        /* Dolceva brown: secondary marks */
  --success: #1d6b45;
  --success-50: #e8f3ec;
  --warning: #9a5410;
  --warning-50: #fbf1e3;
  --danger: #b3261e;
  --danger-50: #fcebe9;
  --info: #2c5a70;
  --info-50: #e9f1f5;
  --sidebar: #4a0806;
  --sidebar-2: #5a0f0b;
  --sidebar-text: #eedfd7;
  --sidebar-dim: #c7a59b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(58, 20, 12, .04);
  --shadow-pop: 0 12px 32px -8px rgba(58, 20, 12, .22), 0 2px 6px rgba(58, 20, 12, .06);
  --ring: 0 0 0 3px rgba(88, 8, 6, .16);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: 'Readex Pro', 'Segoe UI', Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
svg[aria-hidden] { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: rgba(88, 8, 6, .16); color: var(--text); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
input, textarea { caret-color: var(--primary); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
a { color: var(--primary); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
.nav a:hover, .tabs a:hover, .btn:hover { text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
b, strong { font-weight: 600; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.mt-0 { margin-top: 0; }

/* the Dolceva wordmark, in whatever colour its place needs */
.wordmark { display: inline-block; width: 132px; aspect-ratio: 728 / 211; background: currentColor; -webkit-mask: url(/img/dolceva-logo.png) center / contain no-repeat; mask: url(/img/dolceva-logo.png) center / contain no-repeat; flex: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40; scrollbar-color: rgba(255,255,255,.18) transparent; }
.brand { padding: 26px 22px 18px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; color: #f6e9e2; }
.brand .wordmark { width: 128px; }
.brand-sub { font-size: 12px; color: var(--sidebar-dim); letter-spacing: .01em; }
/* «الإعدادات ← بيانات الشركة والشعار»: the logo, its buttons, and the print preview */
.settings-co { align-items: start; }
.logo-edit { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.logo-box { width: 170px; height: 120px; border: 1px dashed var(--border-strong); border-radius: var(--radius); display: grid; place-items: center; background: #fff; padding: 8px; flex: none; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-actions { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 200px; align-items: flex-start; }
.logo-preview { margin-top: 12px; background: var(--surface-2); padding: 12px; text-align: center; border-radius: var(--radius-sm); max-height: 75vh; overflow: auto; }
.logo-preview img { width: 100%; max-width: 360px; background: #fff; box-shadow: var(--shadow-pop); }
/* the company's uploaded logo in a small square (prints and a few screens) */
.brand-logo { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); display: grid; place-items: center; color: #fff; flex: none; }
.brand-logo svg { width: 22px; height: 22px; }
.brand-logo.has-img { background: #fff; padding: 3px; overflow: hidden; border: 1px solid var(--border); }
.brand-logo.has-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name { color: #fff; font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.nav { padding: 4px 12px 24px; display: flex; flex-direction: column; gap: 1px; }
.nav-group { font-size: 11.5px; color: var(--sidebar-dim); padding: 18px 12px 6px; font-weight: 500; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 999px; color: var(--sidebar-text); font-size: 14.5px; transition: background .15s, color .15s; }
.nav a svg { opacity: .78; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: #fbf4ef; color: var(--primary); font-weight: 600; }
.nav a.active svg { opacity: 1; }
.nav a .badge { margin-inline-start: auto; }
.nav svg { width: 18px; height: 18px; flex: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { background: rgba(243, 238, 230, .86); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); padding: 12px 28px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; min-height: 64px; }
.topbar h1 { font-size: 20px; margin: 0; font-weight: 600; }
.topbar .spacer { flex: 1; }
.clock { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.icon-btn.menu-toggle { display: none; }
.content { padding: 24px 28px 40px; width: 100%; }

.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; line-height: 1.25; transition: border-color .15s; }
.user-chip:hover { border-color: var(--border-strong); }
.user-chip .name { font-size: 13.5px; font-weight: 500; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); min-width: 220px; padding: 6px; z-index: 50; animation: fade .16s var(--ease); }
.dropdown-menu button { display: flex; gap: 9px; align-items: center; width: 100%; text-align: start; background: none; border: 0; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.dropdown-menu button:hover { background: var(--surface-2); }

.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; transition: border-color .15s, background .15s; }
.icon-btn:hover { border-color: var(--border-strong); }
.icon-btn svg { width: 19px; height: 19px; }
.pdot { position: absolute; top: 6px; inset-inline-end: 6px; width: 9px; height: 9px; border-radius: 50%; background: #cfc3b8; border: 2px solid var(--surface); }
.pdot.on { background: var(--success); }
.pdot.warn { background: var(--warning); animation: pulse 1.2s infinite; }
.chips label.chip { display: inline-flex; }
.chips label.chip input { width: 15px; height: 15px; }

/* the kitchen screen for a kitchen user: no side menu, the whole width for the orders */
.shell.kiosk { grid-template-columns: 1fr; }
.shell.kiosk .sidebar, .shell.kiosk .menu-toggle { display: none !important; }
.shell.kiosk .content { padding: 14px 18px; }
.shell.kiosk .topbar { background: var(--sidebar); -webkit-backdrop-filter: none; backdrop-filter: none; color: #f6e9e2; border-bottom-color: transparent; }
.shell.kiosk .topbar h1 { color: var(--sidebar-dim); font-size: 16px; font-weight: 500; }
.shell.kiosk .topbar .clock { color: #f6e9e2; font-size: 18px; }
.shell.kiosk .topbar .user-chip, .shell.kiosk .topbar .icon-btn, .shell.kiosk .topbar .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #f6e9e2; }
.shell.kiosk .user-chip .muted { color: var(--sidebar-dim); }
.kiosk-brand { display: flex; align-items: center; color: #f6e9e2; }
.kiosk-brand .wordmark { width: 104px; }
.shell.kiosk .ticket li { font-size: 19px; }
.shell.kiosk .ticket-head .no { font-size: 46px; }


/* ---------- the customers' display (a TV by the counter): Dolceva cream, burgundy numbers read from across the room ---------- */
.tv { position: fixed; inset: 0; background: #fbf8f3; color: var(--primary); display: flex; flex-direction: column; overflow: hidden; z-index: 30; font-family: var(--font); }
.tv.idle { cursor: none; }
.tv-head { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2vw; padding: 3.2vh 3.5vw 3vh; background: #efe5d8; }
.tv-title { margin: 0; text-align: center; font-size: min(9vh, 5.6vw); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; color: var(--primary); }
.tv-title small, .tv-prep-t small { display: block; font-size: .38em; font-weight: 400; letter-spacing: .06em; opacity: .75; margin: .55em 0 0; line-height: 1; color: var(--accent); }
.tv-brand { display: flex; justify-content: flex-start; color: var(--primary); }
.tv-brand .wordmark { width: min(15vw, 260px); }
.tv-clock { font-size: min(3.6vh, 2.2vw); font-weight: 500; color: var(--accent); direction: ltr; justify-self: end; font-variant-numeric: tabular-nums; }
.tv-off { position: absolute; top: 1.5vh; left: 50%; transform: translateX(-50%); background: var(--danger); color: #fff; padding: 6px 18px; border-radius: 999px; font-weight: 600; font-size: clamp(13px, 1.4vw, 24px); z-index: 4; }
.tv-main { flex: 1; display: flex; flex-direction: column; gap: 3vh; padding: 4vh 4vw 0; min-height: 0; position: relative; z-index: 1; }
/* the ready numbers: side by side, thin burgundy rules between them; fewer waiting = bigger */
.tv-ready { flex: 1; min-height: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; row-gap: 3vh; --nsize: min(30vh, 17vw); }
.tv-ready[data-n="4"] { --nsize: min(24vh, 14vw); }
.tv-ready[data-n="5"], .tv-ready[data-n="6"] { --nsize: min(18vh, 11vw); }
.tv-ready[data-n="7"] { --nsize: min(13vh, 8vw); }
.tv-n { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 3.2vw; position: relative; }
.tv-n + .tv-n::before { content: ''; position: absolute; inset-inline-start: 0; top: 18%; bottom: 18%; width: 2px; background: rgba(123, 74, 63, .35); }
.tv-n b { font-size: var(--nsize); font-weight: 700; line-height: .95; color: var(--primary); letter-spacing: -.02em; }
.tv-n span { font-size: calc(var(--nsize) * .16); color: var(--accent); font-weight: 500; max-width: 26vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-n.fresh b { animation: tvpulse 1.1s var(--ease) 4; }
@keyframes tvpulse { 50% { transform: scale(1.07); } }
.tv-none { font-size: min(5vh, 3.2vw); color: rgba(123, 74, 63, .55); font-weight: 500; text-align: center; }
.tv-none small { display: block; font-size: .6em; }
/* the orders being prepared: a cream strip with its label at the start */
.tv-prepzone { display: flex; align-items: center; gap: 3vw; background: #efe5d8; border-radius: 999px; padding: 2vh 3.5vw; margin: 0 4vw; min-height: 0; }
.tv-prep-t { font-size: min(4.6vh, 2.8vw); font-weight: 600; color: var(--primary); white-space: nowrap; line-height: 1.1; padding-inline-end: 3vw; border-inline-end: 2px solid rgba(123, 74, 63, .35); }
.tv-strip { display: flex; gap: 0; flex-wrap: nowrap; overflow: hidden; flex: 1; align-items: center; }
.tv-strip b { font-size: min(7vh, 4.4vw); font-weight: 600; color: var(--accent); padding: 0 2.4vw; line-height: 1.1; position: relative; font-variant-numeric: tabular-nums; }
.tv-strip b + b::before { content: ''; position: absolute; inset-inline-start: 0; top: 20%; bottom: 20%; width: 2px; background: rgba(123, 74, 63, .25); }
.tv-empty { color: rgba(123, 74, 63, .45); font-size: min(5vh, 3vw); font-weight: 500; }
/* the Dubai skyline from the cups, along the bottom */
.tv-sky { height: 13vh; flex: none; margin-top: 2vh; background: var(--primary); opacity: .85; -webkit-mask: url(/img/skyline.png) center bottom / auto 100% repeat-x; mask: url(/img/skyline.png) center bottom / auto 100% repeat-x; }
/* the call: the number full screen for a few seconds */
.tv-pop { position: absolute; inset: 0; background: rgba(251, 248, 243, .97); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 5; animation: fade .3s var(--ease); cursor: pointer; }
.tv-pop .lbl { font-size: clamp(28px, 4.5vw, 84px); color: var(--accent); font-weight: 500; }
.tv-pop .n { font-size: clamp(130px, 28vw, 520px); font-weight: 700; color: var(--primary); line-height: 1; letter-spacing: -.02em; animation: pop .5s var(--ease); }
.tv-pop .who { font-size: clamp(26px, 4vw, 72px); color: var(--text); font-weight: 500; }
.tv-pop .s { font-size: clamp(28px, 4.5vw, 84px); color: var(--primary); font-weight: 600; margin-top: 1vh; text-align: center; }
.tv small { font-size: .62em; opacity: .75; margin-inline-start: .5em; font-weight: 500; }
.tv-tools { position: absolute; bottom: 1.5vh; inset-inline-start: 1.5vw; display: flex; gap: 8px; transition: opacity .4s; z-index: 6; }
.tv.idle.sound-on .tv-tools { opacity: 0; pointer-events: none; }
.tv-btn { background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 500; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.tv-btn svg { width: 18px; height: 18px; }
.tv-btn.on { background: var(--success-50); border-color: #bfdccb; color: var(--success); }
.tv-btn.attn { background: var(--primary); border-color: var(--primary); color: #fff; animation: pulse 1.6s infinite; }
/* a TV turned upright still works */
@media (orientation: portrait) { .tv-head { grid-template-columns: 1fr; text-align: center; } .tv-brand, .tv-clock { justify-self: center; justify-content: center; } .tv-ready { --nsize: 24vw; } .tv-strip { flex-wrap: wrap; } }


/* ---------- elements ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text); min-height: 40px; padding: 8px 18px; border-radius: 999px; cursor: pointer; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .1s var(--ease); }
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: scale(.98); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #155636; border-color: #155636; }
.btn-info { background: var(--text); border-color: var(--text); color: #fff; }
.btn-info:hover { background: #3a2622; border-color: #3a2622; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-warning:hover { background: #7f450c; border-color: #7f450c; }
.btn-danger { background: var(--surface); border-color: #efc4c0; color: var(--danger); }
.btn-danger:hover { background: var(--danger-50); border-color: var(--danger); }
.btn-sm { min-height: 32px; padding: 5px 13px; font-size: 13px; }
.btn-lg { min-height: 52px; padding: 12px 24px; font-size: 16.5px; font-weight: 600; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }
.card + .card { margin-top: 18px; }

.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.toolbar label.field { min-width: 140px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* the numbers row: one quiet strip of figures, not a wall of coloured tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(156px, 1fr)); gap: 0; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); overflow: hidden; }
.stat { background: var(--surface); padding: 16px 20px; position: relative; border-inline-start: 1px solid var(--border); margin-inline-start: -1px; border-top: 1px solid var(--border); margin-top: -1px; }
.stat.s-danger .value { color: var(--danger); }
.stat.s-success .value { color: var(--success); }
.stat.s-primary .value { color: var(--primary); }
.stats.compact { margin-bottom: 6px; }
.stats.compact .stat { padding: 10px 14px; }
.stats.compact .value { font-size: 18px; }
.stat .value.small { font-size: 15px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .sub { font-size: 12.5px; color: var(--muted); }
.stat.link { cursor: pointer; transition: background .15s; }
.stat.link:hover { background: var(--surface-2); }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.input { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 12px; min-height: 42px; padding: 8px 12px; color: var(--text); width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: #9a8a81; }
.input:hover { border-color: #c4b3a1; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
select.input { cursor: pointer; }
textarea.input { resize: vertical; min-height: 72px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--text); font-weight: 400; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { text-align: start; font-weight: 500; color: var(--muted); font-size: 12.5px; background: transparent; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid #efe7dd; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.clickable { cursor: pointer; }
.table tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--border); }
.table .end { text-align: end; }
.table tr.muted-row td { opacity: .55; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: #f1e9e1; color: #5b4840; white-space: nowrap; }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-info { background: var(--info-50); color: var(--info); }
.badge-primary { background: var(--primary-50); color: var(--primary); }
.nav .badge { background: #fbf4ef; color: var(--primary); font-weight: 600; min-width: 22px; justify-content: center; }
.nav a.active .badge { background: var(--primary); color: #fff; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin: 12px 0; border: 1px solid; }
.alert-danger { background: var(--danger-50); border-color: #efc4c0; color: #7d1a14; }
.alert-warning { background: var(--warning-50); border-color: #ecd3ad; color: #6e3c0b; }
.alert-info { background: var(--info-50); border-color: #c9dbe4; color: #22485a; }
.alert-success { background: var(--success-50); border-color: #bfdccb; color: #14502f; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button { padding: 11px 16px; border: 0; background: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; transition: color .15s, border-color .15s; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs a.active, .tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* the date / month / time fields (text fields with English digits, core.js) and their calendar */
.dt-input { background-repeat: no-repeat; background-position: right 9px center; background-size: 16px; padding-right: 32px; cursor: pointer; font-variant-numeric: tabular-nums; }
.dt-date, .dt-month { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b6a5e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E"); }
.dt-time { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b6a5e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.dt-pop { position: fixed; z-index: 300; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 32px rgba(58, 20, 12, .18); padding: 10px; width: 272px; font-size: 14px; animation: fade .12s; }
.dt-pop.dt-pop-time { width: 236px; }
.dt-pop button { font: inherit; border: 0; background: none; cursor: pointer; color: var(--text); border-radius: 8px; font-variant-numeric: tabular-nums; }
.dt-pop button:hover:not(:disabled) { background: var(--primary-50); color: var(--primary); }
.dt-pop button:disabled { opacity: .3; cursor: default; }
.dt-pop button.on { background: var(--primary); color: #fff; }
.dt-pop button.today:not(.on) { box-shadow: inset 0 0 0 1.5px var(--accent); }
.dt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dt-head b { font-weight: 600; }
.dt-head button { width: 32px; height: 32px; font-size: 22px; line-height: 1; }
.dt-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dt-grid i { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 700; padding: 4px 0; }
.dt-grid button { height: 34px; }
.dt-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.dt-months button { padding: 8px 4px; font-size: 13px; }
.dt-months b { display: block; font-size: 15px; }
.dt-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dt-cols > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; max-height: 220px; overflow-y: auto; align-content: start; position: relative; }
.dt-cols small { grid-column: 1 / -1; color: var(--muted); font-weight: 700; text-align: center; position: sticky; top: 0; background: var(--surface); padding-bottom: 2px; }
.dt-cols button { padding: 6px 0; }
.dt-foot { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.dt-foot button { padding: 5px 12px; font-weight: 700; color: var(--primary); }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 16px; cursor: pointer; font-weight: 500; border-radius: 999px; color: var(--muted); transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button + button { border-inline-start: 0; }
.seg button.active { background: var(--primary); color: #fff; }

/* ---------- modal / toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(34, 18, 15, .42); display: grid; place-items: center; padding: 16px; z-index: 100; animation: fade .16s var(--ease); }
.modal { background: var(--surface); border-radius: 22px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 64px -12px rgba(34, 18, 15, .35); animation: pop .22s var(--ease); }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.close-x { border: 0; background: none; width: 34px; height: 34px; border-radius: 999px; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); transition: background .15s, color .15s; }
.close-x:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 22px 22px; }
#toast-root { position: fixed; bottom: 20px; inset-inline-start: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--text); color: #fff; padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-pop); max-width: 400px; animation: fade .2s var(--ease); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-card { background: var(--surface); width: min(400px, 100%); border-radius: 24px; padding: 40px 32px 32px; border: 1px solid var(--border); box-shadow: 0 30px 60px -30px rgba(58, 20, 12, .28); text-align: center; }
.login-card .login-mark { width: 170px; color: var(--primary); margin: 0 auto 10px; display: block; }
.login-card h1 { text-align: center; margin: 0 0 4px; font-size: 22px; }
.login-card p.sub { text-align: center; color: var(--muted); margin: 0 0 26px; font-size: 14px; }
.login-card form { display: grid; gap: 16px; text-align: start; }
.login-card .lang-switch { margin-top: 18px; }


/* ---------- POS (the cashier and the order-taker): the menu as photos, the order beside it ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.pos-menu { min-width: 0; }
.pos-top { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.pos-top .input { max-width: 340px; border-radius: 999px; padding-inline: 18px; }
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; min-height: 40px; padding: 7px 18px; cursor: pointer; white-space: nowrap; font-weight: 500; color: var(--text); transition: background .15s, border-color .15s, color .15s; }
.cat-tab:hover { border-color: var(--border-strong); }
.cat-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.prod { border: 1px solid var(--border); background: var(--surface); border-radius: 18px; padding: 8px 8px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; position: relative; user-select: none; -webkit-tap-highlight-color: transparent; transition: border-color .15s, box-shadow .2s var(--ease), transform .12s var(--ease); }
.prod:hover { border-color: var(--border-strong); box-shadow: 0 8px 20px -12px rgba(58, 20, 12, .25); }
.prod:active { transform: scale(.975); }
.prod.in { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.prod .ph { position: relative; display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #efe7dc; margin-bottom: 6px; }
.prod .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod .ph i { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 34px; font-weight: 600; color: var(--accent); }
.prod .n { font-weight: 500; font-size: 14.5px; line-height: 1.35; padding-inline: 4px; }
.prod .p { color: var(--primary); font-weight: 600; font-size: 14px; margin-top: auto; padding-inline: 4px; font-variant-numeric: tabular-nums; }
.prod.out { opacity: .6; }
.prod .out-tag { position: absolute; bottom: 8px; inset-inline-start: 8px; background: var(--danger); color: #fff; border-radius: 999px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; }
.prod .add-tag-p { position: absolute; top: 8px; inset-inline-start: 8px; background: rgba(255, 255, 255, .92); color: var(--primary); border-radius: 999px; width: 26px; height: 26px; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(58, 20, 12, .15); }
.prod .add-tag-p svg { width: 14px; height: 14px; }
.prod .q { position: absolute; top: 8px; inset-inline-end: 8px; background: var(--primary); color: #fff; border-radius: 999px; min-width: 28px; height: 28px; font-size: 14px; font-weight: 600; display: grid; place-items: center; padding: 0 8px; box-shadow: 0 2px 6px rgba(58, 20, 12, .3); animation: pop .2s var(--ease); }

.pos-cart { position: sticky; top: 84px; display: flex; flex-direction: column; max-height: calc(100vh - 104px); overflow: hidden; }
.cart-bar { display: none; }
.cart-title { display: flex; flex-direction: column; gap: 2px; }
.cart-title b { font-size: 18px; font-weight: 600; }
.type-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 14px; border-bottom: 1px solid var(--border); }
.type-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 9px 4px; cursor: pointer; font-weight: 500; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 13.5px; transition: border-color .15s, background .15s; }
.type-btn svg { width: 22px; height: 22px; }
.type-btn.active { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.type-fields { padding: 18px 18px 14px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.type-fields .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add-banner { background: var(--warning-50); border-bottom: 1px solid #ecd3ad; color: #6e3c0b; padding: 12px 16px; display: flex; gap: 8px; align-items: center; font-weight: 500; }
.cart-lines { overflow-y: auto; flex: 1; min-height: 90px; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 18px; border-bottom: 1px solid #efe7dd; animation: fade .18s var(--ease); }
.cart-line b { font-size: 14.5px; font-weight: 500; }
.cart-line .note { grid-column: 1 / -1; font-size: 12.5px; color: var(--warning); }
.cart-line .ctrl { display: flex; align-items: center; gap: 6px; }
.qty-btn { width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 16px; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.qty-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.qty-btn svg { width: 15px; height: 15px; }
.cart-line .lt { font-weight: 600; min-width: 64px; text-align: end; font-variant-numeric: tabular-nums; }
.line-addons { font-size: 12.5px; color: var(--accent); font-weight: 400; line-height: 1.4; }
.cart-empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.cart-empty svg { width: 28px; height: 28px; opacity: .5; margin-bottom: 4px; }
.cart-totals { padding: 14px 18px; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.cart-totals .r { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cart-totals .r.big { font-size: 22px; font-weight: 600; color: var(--text); margin-top: 4px; }
.cart-totals .r.big span:last-child { color: var(--primary); }
.cart-actions { padding: 4px 18px 18px; display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.cart-actions > div .btn { width: 44px; padding: 0; }

.it-addons { display: block; margin-inline-start: 34px; color: var(--accent); font-size: 14px; }
.it-addons b { display: block; }
/* the add-ons window at the cashier */
.addon-group { margin-bottom: 16px; }
.addon-group h4 { margin: 0 0 8px; display: flex; gap: 8px; align-items: center; font-size: 15.5px; }
.addon-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.addon-opt { border: 2px solid var(--border); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; background: var(--surface); user-select: none; }
.addon-opt:hover { border-color: var(--accent); }
.addon-opt.on { border-color: var(--primary); background: var(--primary-50); }
.addon-opt.out { border-style: dashed; }
.addon-opt .an { font-weight: 600; }
.addon-opt .ap { color: var(--primary); font-weight: 700; font-size: 13px; }
.addon-opt .aq { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.ad-foot { display: flex; gap: 10px; align-items: center; width: 100%; flex-wrap: wrap; }
.ad-foot .input { flex: 1; min-width: 160px; }
.ad-qty { display: flex; align-items: center; gap: 8px; }
.ad-qty b { min-width: 24px; text-align: center; font-size: 18px; }

/* ---------- the add-ons control panel («الإضافات»): group cards and the group editor ---------- */
.ag-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.ag-kpi { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.ag-kpi b { display: block; font-size: 24px; font-weight: 700; line-height: 1.15; }
.ag-kpi div > span { color: var(--muted); font-size: 13px; }
.ag-kpi-i { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.ag-kpi-i svg { width: 22px; height: 22px; }
.ag-kpi-i.k1 { background: var(--primary-50); color: var(--primary); }
.ag-kpi-i.k2 { background: var(--info-50); color: var(--info); }
.ag-kpi-i.k3 { background: var(--success-50); color: var(--success); }
.ag-kpi-i.k4 { background: var(--surface-2); color: var(--muted); }
.ag-kpi.warn .ag-kpi-i.k4 { background: var(--warning-50); color: var(--warning); }
.ag-kpi.warn b { color: var(--warning); }
.ag-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ag-bar .spacer { flex: 1; }
.ag-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 12px; min-width: 240px; flex: 0 1 380px; color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.ag-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88, 8, 6, .18); }
.ag-search input { border: 0; outline: 0; background: none; padding: 10px 0; width: 100%; font: inherit; color: var(--text); }
.ag-search.sm { min-width: 170px; flex: 0 1 240px; padding: 0 10px; }
.ag-search.sm input { padding: 7px 0; font-size: 14px; }
.ag-hint { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13.5px; margin: 4px 2px 14px; }
.ag-hint svg { color: var(--accent); margin-top: 3px; }
.ag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; align-items: start; }
.ag-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 1px 2px rgba(58, 20, 12, .05), 0 6px 18px rgba(58, 20, 12, .06); overflow: hidden; transition: box-shadow .18s, transform .18s; }
.ag-card:hover { box-shadow: 0 2px 4px rgba(58, 20, 12, .06), 0 14px 30px rgba(58, 20, 12, .10); transform: translateY(-2px); }
.ag-card.off { opacity: .6; }
.ag-head { display: flex; gap: 12px; align-items: center; padding: 16px 16px 10px; }
.ag-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; color: #fff; background: var(--primary); }
.ag-ico.multiple { background: var(--text); }
.ag-ico svg { width: 22px; height: 22px; }
.ag-title { flex: 1; min-width: 0; }
.ag-title h3 { margin: 0 0 5px; font-size: 17px; font-weight: 600; }
.ag-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.ag-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.ag-pill.red { background: var(--danger-50); color: var(--danger); border-color: #fecaca; }
.ag-pill.soft { background: var(--info-50); color: var(--info); border-color: #bae6fd; }
.ag-pill.gray { opacity: .85; }
.ag-acts { display: flex; gap: 6px; align-items: center; }
.ag-icon { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: background .15s, color .15s, border-color .15s; flex: none; }
.ag-icon:hover { background: var(--surface-2); color: var(--text); }
.ag-icon.danger:hover { background: var(--danger-50); color: var(--danger); border-color: #fecaca; }
.ag-opts { list-style: none; margin: 0; padding: 0 10px 10px; }
.ag-opts li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; padding: 9px 8px; border-radius: 10px; }
.ag-opts li + li { border-top: 1px dashed var(--border); }
.ag-opts li:hover { background: var(--surface-2); }
.ag-opts li.off { opacity: .55; }
.ag-on { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.ag-def { color: #e3a008; display: inline-grid; }
.ag-def svg { fill: currentColor; }
.ag-sub { display: flex; gap: 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ag-sub .pos { color: var(--success); font-weight: 700; }
.ag-sub .neg { color: var(--danger); font-weight: 700; }
.ag-price { font-weight: 600; color: var(--primary); background: var(--primary-50); padding: 3px 10px; border-radius: 999px; font-size: 13.5px; min-width: 66px; text-align: center; }
.ag-price.free { color: var(--success); background: var(--success-50); font-weight: 700; }
.ag-opts .ag-none { display: block; color: var(--muted); padding: 16px 8px; text-align: center; }
.ag-foot { display: flex; gap: 10px; align-items: center; padding: 10px 16px 12px; border-top: 1px solid var(--border); background: var(--surface-2); }
.ag-prods { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.ag-chip { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #fff; color: var(--text); border: 1px solid var(--border); border-inline-start: 3px solid var(--c, var(--accent)); }
.ag-chip.more { color: var(--muted); border-inline-start-color: var(--border); }
.ag-link { flex: none; }
.ag-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 20px; background: var(--surface); border: 2px dashed var(--border); border-radius: 18px; color: var(--muted); text-align: center; }
.ag-empty svg { width: 42px; height: 42px; color: var(--accent); }
.ag-empty b { color: var(--text); font-size: 16px; }

.modal.ag-modal { width: min(1000px, 100%); }
.ag-modal .modal-body { background: var(--bg); padding: 14px; }
.ag-editor { display: grid; gap: 14px; }
.ag-sec { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.ag-sec-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ag-sec-h h4 { margin: 0; font-size: 16px; font-weight: 600; }
.ag-sec-h .spacer { flex: 1; }
.ag-num { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13.5px; flex: none; }
.ag-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--muted); min-width: 0; }
.ag-field > span:first-child { white-space: nowrap; }
.ag-field .input { color: var(--text); font-weight: 600; }
.ag-big { font-size: 17px; padding: 11px 14px; font-weight: 700 !important; }
.ag-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.ag-choice-card { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; text-align: start; border: 2px solid var(--border); background: var(--surface); border-radius: 14px; padding: 12px 14px; cursor: pointer; font: inherit; color: var(--text); transition: border-color .15s, background .15s, box-shadow .15s; }
.ag-choice-card:hover { border-color: var(--accent); }
.ag-choice-i { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); transition: background .15s, color .15s; }
.ag-choice-card b { font-size: 15px; }
.ag-choice-card small { color: var(--muted); font-size: 12.5px; }
.ag-choice-card.on { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px rgba(88, 8, 6, .10); }
.ag-choice-card.on .ag-choice-i { background: var(--primary); color: #fff; }
.ag-toggles { display: flex; gap: 14px 26px; flex-wrap: wrap; align-items: center; }
.ag-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; position: relative; }
.ag-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ag-switch i { width: 44px; height: 25px; border-radius: 999px; background: #d9cec5; position: relative; transition: background .2s; flex: none; }
.ag-switch i::after { content: ''; position: absolute; top: 3px; right: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: right .2s; }
.ag-switch input:checked + i { background: var(--success); }
.ag-switch input:checked + i::after { right: 22px; }
.ag-switch input:focus-visible + i { box-shadow: 0 0 0 3px rgba(88, 8, 6, .35); }
.ag-switch span { display: flex; flex-direction: column; line-height: 1.3; }
.ag-switch small { color: var(--muted); font-size: 12px; }
.ag-switch.sm { flex-direction: column; gap: 4px; align-self: flex-end; }
.ag-switch.sm i { width: 38px; height: 21px; }
.ag-switch.sm i::after { width: 15px; height: 15px; }
.ag-switch.sm input:checked + i::after { right: 20px; }
.ag-stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); width: fit-content; }
.ag-stepper button { border: 0; background: var(--surface-2); width: 34px; cursor: pointer; color: var(--text); display: grid; place-items: center; transition: background .15s, color .15s; }
.ag-stepper button:hover { background: var(--primary-50); color: var(--primary); }
.ag-stepper .input { border: 0; border-radius: 0; width: 58px; text-align: center; padding: 8px 4px; -moz-appearance: textfield; appearance: textfield; }
.ag-stepper .input::-webkit-inner-spin-button, .ag-stepper .input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ag-stepper.sm button { width: 28px; }
.ag-stepper.sm .input { width: 44px; padding: 7px 2px; }
.ag-bulk { background: var(--surface-2); border: 1.5px dashed var(--accent); border-radius: 12px; padding: 10px; margin-bottom: 12px; animation: agIn .2s ease-out; }
.ag-bulk textarea { width: 100%; resize: vertical; font: inherit; line-height: 1.7; }
.ag-bulk-a { display: flex; gap: 8px; margin-top: 8px; }
.ag-preview { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 12.5px; color: var(--muted); font-weight: 700; }
#ag-prev { display: flex; gap: 6px; flex-wrap: wrap; }
.ag-prev-opt { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 999px; padding: 4px 12px; color: var(--text); font-size: 13px; }
.ag-prev-opt b { color: var(--primary); }
.ag-prev-opt.on { border-color: var(--primary); background: var(--primary-50); }
.ag-prev-m { width: 13px; height: 13px; border: 2px solid #c9bbb0; flex: none; }
.ag-prev-m.radio { border-radius: 50%; }
.ag-prev-m.box { border-radius: 4px; }
.ag-prev-opt.on .ag-prev-m { border-color: var(--primary); background: radial-gradient(var(--primary) 42%, transparent 48%); }
.ag-opts-ed { display: grid; gap: 10px; }
.ag-opt { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 10px 12px; transition: box-shadow .15s, border-color .15s, background .35s; }
.ag-opt:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88, 8, 6, .14); }
.ag-opt.enter { animation: agIn .25s ease-out; }
.ag-opt.leave { animation: agOut .2s ease-in forwards; }
.ag-opt.moved { background: var(--primary-50); }
@keyframes agIn { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
@keyframes agOut { to { opacity: 0; transform: scale(.97); } }
.ag-opt-main { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ag-opt-main .grow { flex: 1 1 200px; }
.ag-field.w-price { width: 140px; }
.ag-field.w-qty { width: 124px; }
.ag-order { display: flex; flex-direction: column; gap: 2px; align-self: center; }
.ag-order button { border: 0; background: none; color: #b9aba0; cursor: pointer; padding: 0; height: 17px; display: grid; place-items: center; border-radius: 5px; }
.ag-order button:hover { color: var(--primary); background: var(--primary-50); }
.ag-affix { position: relative; display: block; }
.ag-affix .input { padding-right: 40px; }
.ag-affix i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; color: var(--muted); pointer-events: none; }
.ag-star { display: flex; flex-direction: column; align-items: center; gap: 1px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 5px 9px; cursor: pointer; color: #c9bbb0; font: inherit; transition: all .15s; }
.ag-star small { font-size: 11px; color: var(--muted); font-weight: 700; }
.ag-star:hover { border-color: #f6d27a; }
.ag-star.on { color: #e3a008; border-color: #f6d27a; background: var(--warning-50); }
.ag-star.on svg { fill: currentColor; }
.ag-opt-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.ag-opt-foot .spacer { flex: 1; }
.ag-margin { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.ag-margin .pos { color: var(--success); }
.ag-margin .neg { color: var(--danger); }
.ag-rec-btn svg:last-child { transition: transform .2s; }
.ag-rec-btn.open svg:last-child { transform: rotate(180deg); }
.ag-rec { margin-top: 10px; padding: 12px; background: var(--surface-2); border-radius: 12px; display: grid; gap: 10px; animation: agIn .2s ease-out; }
.ag-add-opt { width: 100%; margin-top: 10px; border: 2px dashed var(--border); background: transparent; border-radius: 14px; padding: 12px; font: inherit; font-weight: 600; color: var(--primary); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: border-color .15s, background .15s; }
.ag-add-opt:hover { border-color: var(--primary); background: var(--primary-50); }
.ag-add-opt small { color: var(--muted); font-weight: 600; }
.ag-pcats { display: grid; gap: 14px; max-height: 340px; overflow-y: auto; padding: 2px 2px 4px; }
.ag-pcat-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; font-size: 14px; padding-inline-start: 8px; border-inline-start: 3px solid var(--c); }
.ag-linkbtn { border: 0; background: none; color: var(--info); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.ag-linkbtn:hover { background: var(--info-50); }
.ag-pchips { display: flex; flex-wrap: wrap; gap: 7px; }
.ag-pchip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--text); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.ag-pchip svg { width: 0; opacity: 0; transition: width .15s, opacity .15s; }
.ag-pchip:hover { border-color: var(--c); }
.ag-pchip.on { border-color: var(--primary); background: var(--primary-50); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.ag-pchip.on svg { width: 1em; opacity: 1; }
.ag-ed-foot { display: flex; align-items: center; gap: 8px; width: 100%; flex-wrap: wrap; }
.ag-ed-foot .spacer { flex: 1; }
#ag-sum { color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
#ag-sum b { color: var(--text); }
.shake { animation: shake .35s; border-color: var(--danger) !important; }
@keyframes shake { 25% { transform: translateX(4px); } 50% { transform: translateX(-4px); } 75% { transform: translateX(2px); } }
@media (max-width: 760px) {
  .ag-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ag-grid { grid-template-columns: 1fr; }
  .ag-choice { grid-template-columns: 1fr; }
  .ag-search { min-width: 0; flex: 1 1 100%; }
  .ag-field.w-price, .ag-field.w-qty { width: calc(50% - 5px); }
  .ag-opts li { grid-template-columns: minmax(0, 1fr) auto; }
  .ag-sub { grid-column: 1 / -1; grid-row: 2; }
  .ag-foot { flex-wrap: wrap; }
}
/* «طلب شراء وتوفير حاجيات» (pages-requests.js) */
.rq-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.rq-h { margin: 14px 0 8px; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.rq-supplies { display: grid; gap: 8px; }
.rq-supply { border: 1px solid var(--border); border-inline-start: 3px solid var(--success); border-radius: 10px; padding: 8px 12px; background: var(--surface); display: grid; gap: 3px; }
.rq-supply-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rq-supply-h .spacer { flex: 1; }
.rq-kpis.rq-kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#rq-sum .alert { margin: 10px 0; }
.rq-levels { display: grid; gap: 2px; font-size: 13px; }
.rq-got { display: grid; gap: 2px; font-size: 13.5px; }
.rq-got svg { width: 14px; height: 14px; vertical-align: -2px; }
.rq-levels svg { width: 14px; height: 14px; vertical-align: -2px; }
.rq-src { min-width: 190px; padding: 6px 8px; font-size: 13px; }
.rq-kpi { font: inherit; color: inherit; text-align: start; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.rq-kpi:hover { border-color: var(--accent); }
.rq-kpi.on { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(88, 8, 6, .12); }
.ag-kpi-i.k-warn { background: var(--warning-50); color: var(--warning); }
.rq-form { display: grid; gap: 12px; }
.rq-pri { display: flex; align-items: center; gap: 10px; }
.rq-pri .seg button[data-p=urgent].active { background: var(--danger); }
.rq-lines-h { display: flex; align-items: center; gap: 10px; }
.rq-lines-h h4 { margin: 0; }
.rq-lines-h .spacer { flex: 1; }
#rq-lines { display: grid; gap: 8px; }
.rq-line { display: grid; grid-template-columns: 30px minmax(0, 2.2fr) 92px 110px minmax(0, 1.4fr) 34px; gap: 6px 8px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; background: var(--surface); }
.rq-line:focus-within { border-color: var(--accent); }
.rq-kind { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.rq-kind.free { background: var(--info-50); color: var(--info); }
.rq-kind svg { width: 16px; height: 16px; }
.rq-stock { grid-column: 2 / -1; }
.rq-stock svg { width: 14px; height: 14px; vertical-align: -2px; }
.rq-add { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rq-add .ag-add-opt { margin-top: 0; }
.rq-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.rq-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 16px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.rq-meta > div { display: flex; flex-direction: column; gap: 2px; }
.rq-meta > div > span:first-child { color: var(--muted); font-size: 12.5px; }
.rq-foot { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; align-items: center; }
.rq-foot .spacer { flex: 1; }
.rq-aq { display: flex; align-items: center; gap: 6px; }
.rq-aq .input { width: 100px; }
@media (max-width: 760px) {
  .rq-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rq-line { grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) 34px; }
  .rq-kind { grid-row: 1; grid-column: 1; }
  .rq-name { grid-row: 1; grid-column: 2 / 4; }
  .rq-line [data-del] { grid-row: 1; grid-column: 4; }
  .rq-qty { grid-row: 2; grid-column: 2; }
  .rq-unit { grid-row: 2; grid-column: 3; }
  .rq-note { grid-row: 3; grid-column: 2 / 4; }
  .rq-stock { grid-row: 4; grid-column: 2 / 4; }
  .rq-add { grid-template-columns: 1fr; }
}
/* the tabs in the middle (auto margins: still scrolls from the start when they do not fit) */
.tabs.center a:first-child, .tabs.center button:first-child { margin-inline-start: auto; }
.tabs.center a:last-child, .tabs.center button:last-child { margin-inline-end: auto; }
/* «قائمة الإضافات»: the add row at the top, then every add-on with edit / delete on its row */
.ai-add { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.ai-add-h { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.ai-add-h .ag-kpi-i { width: 36px; height: 36px; border-radius: 11px; }
.ai-add-h .ag-kpi-i svg { width: 18px; height: 18px; }
.ai-add-h b { display: block; font-size: 16px; font-weight: 600; }
.ai-add-h small { color: var(--muted); font-size: 12.5px; }
.ai-add-f { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ai-add-f .grow { flex: 1 1 220px; }
.ag-field.w-group { width: 200px; }
.ai-add-btn { padding: 9px 24px; }
.ai-gnote:not(:empty) { margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.ai-gnote svg { width: 15px; height: 15px; vertical-align: -2px; }
.ai-table td { white-space: nowrap; }
.ai-table td:nth-child(2) { white-space: normal; min-width: 150px; }
.ai-table .ag-price { display: inline-block; }
.ai-table .ag-def svg { width: 15px; height: 15px; vertical-align: -2px; }
.ai-acts { display: inline-flex; gap: 6px; }
.ai-table tr.ai-editing td { background: var(--primary-50); }
.ai-table tr.ai-editing .input { min-width: 90px; padding: 6px 8px; }
.ai-table tr.ai-editing .ag-affix .input { padding-right: 40px; }
.ai-table tr.ai-editing [data-k=name] { min-width: 170px; }
.ai-table tr.ai-new td { animation: aiFlash 1.8s ease-out; }
@keyframes aiFlash { from { background: var(--success-50); } }
@media (max-width: 760px) {
  .ag-field.w-group { width: 100%; }
  .ai-add-btn { width: 100%; }
}
/* recipe editor and option rows in the admin */
.rec-row, .opt-row { display: grid; gap: 8px; align-items: center; margin-bottom: 6px; }
.rec-row { grid-template-columns: minmax(0, 2fr) 110px 60px 90px 34px; }
.opt-row { grid-template-columns: minmax(0, 2fr) 100px 90px 90px 70px 60px auto 34px; background: var(--surface-2); padding: 8px; border-radius: 10px; border: 1px solid var(--border); }
.opt-recipe { grid-column: 1 / -1; background: var(--surface); border: 1px dashed var(--border); border-radius: 10px; padding: 10px; }
.prod-pick { max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.prod-pick .pcat { margin: 8px 0 4px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.prod-pick .chips { gap: 4px 12px; }
.group-card .card-head { background: var(--surface-2); }
.stock-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 4px; border: 1px solid var(--border); }
.stock-bar i { display: block; height: 100%; background: var(--success); }
.stock-bar i.low { background: var(--accent); }
.stock-bar i.out { background: var(--danger); }
/* a purchase line split between the places (part to the shop, part home) */
.rec-row.pur-row { grid-template-columns: minmax(0, 2fr) 100px 100px 110px 100px 34px; }
.pur-line { border: 1px solid var(--border); border-radius: 10px; padding: 8px; margin-bottom: 8px; background: var(--surface); }
.pur-line .rec-row { margin-bottom: 0; }
.split-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 13px; }
.split-row label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.split-row label .input { width: 92px; padding: 5px 8px; }
.split-row label.is-def .input { background: var(--surface-2); }
.split-row .spacer { flex: 1; }
/* the transfer between the places: what is sent and what stays, per material */
.xfer-wrap { max-height: 52vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.xfer-wrap table { margin: 0; }
.xfer-wrap thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
.xfer-wrap td .input { width: 96px; padding: 5px 8px; }
.xfer-wrap tr.sending td { background: var(--surface-2); }
.xfer-wrap tr.sending td:first-child { box-shadow: inset -3px 0 0 var(--primary); }
.xfer-sum { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-top: 10px; font-weight: 700; }
@media (max-width: 760px) {
  .rec-row { grid-template-columns: minmax(0, 1fr) 90px 34px; }
  .rec-row.pur-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rec-row.pur-row > :first-child { grid-column: 1 / -1; }
  .split-row label .input { width: 74px; }
  .rec-row .rec-unit, .rec-row .rec-cost { display: none; }
  .opt-row { grid-template-columns: 1fr 1fr; }
}

/* a takeaway's vehicle: emirate · category · number (required) */
.plate-row { display: grid; grid-template-columns: 1.3fr .9fr 1.2fr; gap: 6px; align-items: center; }
.plate-row .plate-lbl { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--muted); }
.plate-row .plate-lbl svg { width: 16px; height: 16px; }
.plate-row .input { min-width: 0; padding-inline: 8px; }
.plate-row input[data-plate=number] { font-weight: 600; letter-spacing: 1px; text-align: center; }
.pick-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 2px dashed var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); cursor: pointer; font-weight: 700; width: 100%; }
.pick-btn.set { border-style: solid; border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-weight: 700; font-size: 13.5px; }
.chip.active { background: var(--info); border-color: var(--info); color: #fff; }

.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.tbl { border: 2px solid var(--border); border-radius: 12px; padding: 12px 6px; text-align: center; cursor: pointer; background: var(--surface); }
.tbl .tn { font-size: 22px; font-weight: 600; }
.tbl .ts { font-size: 12px; color: var(--muted); }
.tbl:hover { border-color: var(--primary); }
.tbl.busy { background: var(--warning-50); border-color: #fbbf24; }
.tbl.busy .ts { color: var(--warning); font-weight: 700; }
.tbl.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.tbl.selected .ts { color: #f3e4d8; }
.zone-title { font-weight: 600; margin: 14px 0 8px; color: var(--muted); font-size: 13.5px; }
.zone-title:first-child { margin-top: 0; }

.big-no { font-size: 64px; font-weight: 700; color: var(--primary); text-align: center; line-height: 1; margin: 6px 0 2px; }
.quick-notes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- order tickets (kitchen + collection) ---------- */
/* ---------- the order cards: the V60 bar, the kitchen, collection, «ready for handover» ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.board-col { min-height: 220px; }
.board-col > h3 { margin: 0 4px 12px; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.board-col > h3 .badge:last-child { margin-inline-start: auto; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-variant-numeric: tabular-nums; }
.board-col .empty { border: 1px dashed var(--border-strong); border-radius: 20px; padding: 34px 16px; }
.tickets { display: grid; gap: 12px; }
.ticket { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.ticket-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; color: var(--text); }
.ticket-head .no { font-size: 40px; font-weight: 700; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; letter-spacing: -.02em; min-width: 1.2em; }
.ticket-head .meta { flex: 1; line-height: 1.35; font-size: 14px; color: var(--muted); min-width: 0; }
.ticket-head .meta b { font-size: 15px; color: var(--text); font-weight: 500; }
.ticket-head .timer { display: inline-flex; align-items: center; gap: 5px; font-size: 15px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 4px 11px; border-radius: 999px; direction: ltr; font-variant-numeric: tabular-nums; }
.ticket-head .timer svg { width: 15px; height: 15px; }
.ticket-head .timer b { font-weight: 600; color: var(--text); }
.ticket-head > .small { color: var(--muted); }
.k-done { display: inline-flex; align-items: center; gap: 5px; color: var(--success); font-weight: 500; font-size: 14px; font-variant-numeric: tabular-nums; }
.k-done svg { width: 16px; height: 16px; }
.ticket.late { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.ticket.late .timer { background: var(--danger); border-color: var(--danger); color: #fff; animation: pulse 1.4s infinite; }
.ticket.late .timer b { color: #fff; }
.ticket.fresh { animation: flash 1s 3; }
.k-ready.ticket { background: var(--surface-2); }
.k-ready .ticket-head .no { color: var(--muted); }
@keyframes pulse { 50% { opacity: .6; } }
@keyframes flash { 50% { box-shadow: 0 0 0 4px rgba(88, 8, 6, .35); border-color: var(--primary); } }
.ticket ul { list-style: none; margin: 0; padding: 2px 16px 8px; }
.ticket li { padding: 10px 0; border-top: 1px solid #efe7dd; font-size: 17px; line-height: 1.4; }
.ticket li .qn { display: inline-block; min-width: 34px; font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; }
.ticket li .it-addons { display: block; margin-inline-start: 34px; color: var(--accent); font-size: 14.5px; }
.ticket li .it-addons b { display: block; font-weight: 500; }
.ticket li .it-note { display: flex; align-items: center; gap: 5px; color: var(--danger); font-size: 14px; font-weight: 500; margin-inline-start: 34px; margin-top: 2px; }
.ticket li .it-note svg { width: 15px; height: 15px; }
.ticket li.done { opacity: .42; }
.ticket li.done > :not(.st-tag) { text-decoration: line-through; }
.ticket li .add-tag { font-size: 11.5px; background: var(--warning-50); color: var(--warning); border-radius: 999px; padding: 1px 8px; margin-inline-start: 6px; font-weight: 500; text-decoration: none; }
.ticket li .st-tag { font-size: 12px; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 9px; margin-inline-start: 8px; font-weight: 500; white-space: nowrap; vertical-align: 2px; }
.ticket .o-note { display: flex; align-items: center; gap: 6px; margin: 0 16px 10px; padding: 8px 12px; border-radius: 12px; background: var(--warning-50); color: #6e3c0b; font-weight: 500; font-size: 14px; }
.ticket .o-note svg { width: 16px; height: 16px; flex: none; }
.ticket-foot { display: flex; gap: 8px; padding: 12px 16px 16px; align-items: center; flex-wrap: wrap; }
.ticket-foot .btn-lg { flex: 1; font-size: 16px; }
.ticket-foot .k-quick { flex: 0 0 auto; width: 52px; padding: 0; }
.ticket .amount { font-size: 20px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }


.kitchen-full { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow: auto; padding: 18px; }
.kbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.kbar .spacer { flex: 1; }
.kbar .k-count { font-weight: 400; font-size: 14px; color: var(--muted); }
/* numbered explanation steps (cash receivers…) */
ol.steps { margin: 0; padding-inline-start: 22px; display: grid; gap: 6px; line-height: 1.7; }
/* storage places (the shop, home) */
.place-card .card-head h3 { display: inline-flex; align-items: center; gap: 6px; }
.place-card .card-head h3 svg { width: 20px; height: 20px; }
.place-card .card-head { gap: 8px; }
/* kitchen screens: which screen this is, choosing one, and how the other screens are doing with the order */
.kbar .k-screen { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 20px; color: var(--text); }
.kbar .k-screen svg { width: 22px; height: 22px; }
.k-stations button { font-size: 14.5px; }
.k-parts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; }
.k-part { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; border-radius: 999px; padding: 3px 10px; background: var(--warning-50); color: var(--warning); border: 1px solid transparent; }
.k-part svg { width: 13px; height: 13px; }
.k-part.p-preparing { background: var(--info-50); color: var(--info); }
.k-part.p-ready { background: var(--success-50); color: var(--success); }
.k-part.mine { border-color: currentColor; }
.st-assign { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }

.hand-card .ticket-foot { flex-wrap: wrap; }
.collect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

/* payment dialog */
.pay-total { text-align: center; padding: 10px; border-radius: 12px; background: var(--primary-50); margin-bottom: 14px; }
.pay-total .v { font-size: 34px; font-weight: 700; color: var(--primary); }
.methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.method { border: 2px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; background: var(--surface); font-weight: 600; display: flex; gap: 8px; align-items: center; justify-content: center; }
.method.active { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.method:disabled { opacity: .4; cursor: not-allowed; }
.cash-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.change-box { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--success-50); color: var(--success); font-weight: 600; font-size: 18px; display: flex; justify-content: space-between; }
.change-box.bad { background: var(--danger-50); color: var(--danger); }

/* order details */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin-bottom: 14px; }
.kv div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--border); padding: 4px 0; }
.kv span:first-child { color: var(--muted); }
.timeline { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.timeline .step { flex: 1; min-width: 110px; border-radius: 10px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.timeline .step b { display: block; font-size: 13.5px; }
.timeline .step.on { background: var(--success-50); border-color: #bbf7d0; }

/* charts */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar .col { width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--accent), var(--primary)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar .lbl { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.bar .val { font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.hbar { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; margin: 7px 0; font-size: 14px; }
.hbar .track { background: var(--surface-2); border-radius: 999px; height: 10px; overflow: hidden; border: 1px solid var(--border); }
.hbar .fill { height: 100%; background: var(--accent); border-radius: 999px; }

/* commission on the daily target */
.cbars { display: flex; gap: 4px; align-items: flex-end; overflow-x: auto; overflow-y: hidden; padding-top: 6px; }
.cbar { flex: 1; min-width: 26px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.cbar .cw { position: relative; width: 100%; height: 170px; }
.cbar .col { position: absolute; bottom: 0; inset-inline: 14%; border-radius: 5px 5px 2px 2px; background: #d6d3d1; }
.cbar .col.ok { background: var(--success); }
.cbar .col.miss { background: var(--accent); }
.cbar .tl { position: absolute; inset-inline: 0; height: 0; border-top: 2px dashed var(--danger); }
.cbar .v { font-size: 10px; color: var(--muted); white-space: nowrap; }
.cbar .l { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; }
.day-card.on .card-head { background: var(--success-50); }
.lvl { display: grid; grid-template-columns: 1fr 1fr 30px; gap: 8px; align-items: end; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.lvl .field { font-size: 12px; }
.lvl .input { padding: 6px 8px; font-weight: 600; font-size: 15px; }
.target-card .bigline { font-size: 15px; margin: 6px 0; }
.target-card .meter { height: 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; position: relative; }
.target-card .meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--success)); border-radius: 999px; }

.perm-group { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.perm-group h4 { margin: 0 0 6px; font-size: 14px; }
.perm-group .check { display: flex; margin: 5px 0; }

.report-sheet .line { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.report-sheet .line.total { font-weight: 600; font-size: 16px; border-bottom: 2px solid var(--border); }
.report-sheet .line.grand { font-weight: 700; font-size: 19px; color: var(--primary); border: 0; padding-top: 10px; }
.report-sheet h4 { margin: 16px 0 6px; color: var(--muted); font-size: 14px; }

.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; }

/* ---------- print (receipt 80mm / reports A4) ---------- */
#print-root { display: none; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; }
  body { background: #fff; }
  @page { margin: 6mm; }
}
.receipt { width: 72mm; margin: 0 auto; font-size: 12.5px; color: #000; font-family: var(--font); }
.receipt h2 { text-align: center; margin: 0; font-size: 17px; }
.receipt .r-logo { display: block; margin: 0 auto 6px; max-width: 60%; max-height: 28mm; object-fit: contain; }
.receipt .c { text-align: center; }
.receipt .big { font-size: 30px; font-weight: 700; text-align: center; margin: 4px 0; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 2px 0; vertical-align: top; }
.receipt td.e { text-align: end; white-space: nowrap; }
.receipt .tot td { font-weight: 600; font-size: 15px; }
.receipt .kt li { font-size: 16px; font-weight: 600; padding: 3px 0; }
.receipt .kt { list-style: none; padding: 0; margin: 0; }
.receipt .kt .nt { display: block; font-size: 13px; font-weight: 700; }
/* the working day: when each day's work ends (settings, commission targets) */
.day-ends { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 10px; }
.day-ends .field.late select { border-color: var(--info); }
.day-end-field { margin-bottom: 10px; }
.day-end-field .input { font-size: 13.5px; }
/* the money (as in the car wash system): totals rows, a select with an add button, the box note */
.table tr.row-total td { font-weight: 600; border-top: 2px solid var(--border); background: var(--surface-2); }
.inline-add { display: flex; gap: 8px; align-items: center; }
.inline-add select { flex: 1; }
.box-note { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--info-50); border-radius: 8px; padding: 8px 10px; }
/* printed A4 documents: the payment voucher (سند صرف) and the cash deposit slip, with signature boxes */
.doc-preview { border: 1px solid var(--border); border-radius: 10px; padding: 18px; background: #fff; color: #000; }
.doc-print { color: #000; font-family: var(--font); font-size: 14px; }
.doc-print h2 { margin: 0 0 4px; text-align: center; font-size: 20px; }
.doc-print h3 { margin: 2px 0 12px; text-align: center; font-size: 17px; }
.doc-print table { width: 100%; border-collapse: collapse; }
.doc-print th, .doc-print td { border: 1px solid #555; padding: 6px 9px; text-align: start; vertical-align: top; }
.doc-print th { width: 30%; background: #f3f3f3; font-weight: 700; }
/* a printed report table (the fingerprint attendance, the audit log's counts): plain, small enough for many columns */
.doc-print.table-print { font-size: 12px; }
.doc-print.table-print th { width: auto; }
.doc-print.table-print th, .doc-print.table-print td { padding: 4px 6px; }
/* the audit log: the kinds of movement (add / edit / delete / cancel / other), and each group's counts as a bar */
.audit-kinds { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 10px; }
.audit-kinds .check { gap: 4px; }
.audit-stat { cursor: pointer; }
.audit-stat.on { outline: 2px solid var(--primary); }
.audit-drill { display: inline-block; min-width: 28px; padding: 2px 6px; border-radius: 6px; text-align: center; text-decoration: underline dotted; color: inherit; }
.audit-drill:hover { background: var(--surface-2); }
.audit-bar { display: flex; height: 10px; min-width: 6px; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.audit-bar span { display: block; min-width: 2px; }
.audit-bar .k-add { background: #16a34a; }
.audit-bar .k-edit { background: #0891b2; }
.audit-bar .k-delete { background: #dc2626; }
.audit-bar .k-cancel { background: #f59e0b; }
.audit-bar .k-other { background: #94a3b8; }
.signatures { display: flex; gap: 18px; margin: 30px 0 14px; break-inside: avoid; }
.sign-box { flex: 1; border: 1px solid #000; border-radius: 6px; padding: 10px 12px 12px; }
.sign-line { height: 32px; display: flex; align-items: flex-end; border-bottom: 1px dotted #000; padding-bottom: 2px; }
.print-report { color: #000; font-family: var(--font); }
.print-report h1 { font-size: 20px; margin: 0 0 4px; }
.print-report table { width: 100%; border-collapse: collapse; font-size: 12px; }
.print-report th, .print-report td { border: 1px solid #999; padding: 4px 6px; text-align: start; }

/* ---------- the reports center (التقارير) ---------- */
.rc-hero { display: flex; gap: 16px 24px; align-items: center; flex-wrap: wrap; background: linear-gradient(120deg, #2b1d16 0%, #5a3622 55%, #7c4a2d 100%); color: #f6ebe2; border-radius: 20px; padding: 20px 22px; margin-bottom: 16px; box-shadow: 0 12px 30px rgba(43, 29, 22, .18); }
.rc-hero-t { display: flex; gap: 14px; align-items: center; flex: 1 1 320px; }
.rc-hero-i { width: 52px; height: 52px; border-radius: 16px; background: rgba(255, 255, 255, .12); display: grid; place-items: center; flex: none; }
.rc-hero-i svg { width: 26px; height: 26px; }
.rc-hero h2 { margin: 0; font-size: 22px; font-weight: 700; color: #fff; }
.rc-hero p { margin: 2px 0 0; font-size: 13.5px; opacity: .8; }
.rc-hero .rc-range { margin: 0; flex: 0 1 auto; background: transparent; border: 0; padding: 0; }
.rc-hero .rc-range .field { color: #f6ebe2; }
.rc-hero .rc-range .field > span, .rc-hero .rc-range label { color: #f6ebe2; }
.rc-hero .rc-range .input { background: rgba(255, 255, 255, .95); }
.rc-hero .seg { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); }
.rc-hero .seg button { color: #f6ebe2; }
.rc-hero .seg button + button { border-color: rgba(255, 255, 255, .2); }
.rc-hero .seg button:hover { background: rgba(255, 255, 255, .12); }
.rc-period { margin: -4px 4px 18px; display: flex; gap: 6px; align-items: center; }
.rc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rc-kpi { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px 12px; box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.rc-kpi-top { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; font-weight: 700; }
.rc-kpi-i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--tone-50); color: var(--tone); }
.rc-kpi-v { font-size: 24px; font-weight: 700; margin: 8px 0 4px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-kpi-f { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); min-height: 18px; }
.rc-kpi-s { color: var(--muted); }
.rc-spark { position: absolute; inset-inline: 0; bottom: 0; width: 100%; height: 30px; opacity: .9; pointer-events: none; }
.rc-spark .l { fill: none; stroke: var(--tone); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.rc-spark .a { fill: var(--tone-50); stroke: none; }
.rc-kpi:has(.rc-spark) { padding-bottom: 34px; }
.rc-delta { display: inline-flex; gap: 3px; align-items: center; font-weight: 600; padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.rc-delta.up { background: var(--success-50); color: var(--success); }
.rc-delta.down { background: var(--danger-50); color: var(--danger); }
.rc-delta.flat { background: var(--surface-2); color: var(--muted); }
/* the tones of the cards and figures */
.t1 { --tone: var(--primary); --tone-50: var(--primary-50); }
.t2 { --tone: var(--info); --tone-50: var(--info-50); }
.t3 { --tone: #b45309; --tone-50: #fff7ed; }
.t4 { --tone: var(--success); --tone-50: var(--success-50); }
.t5 { --tone: #7c3aed; --tone-50: #f5f3ff; }
.t6 { --tone: var(--danger); --tone-50: var(--danger-50); }
.rc-sec { margin-bottom: 20px; }
.rc-sec > header { display: flex; gap: 10px; align-items: baseline; margin: 0 4px 10px; flex-wrap: wrap; }
.rc-sec > header h3 { margin: 0; font-size: 17px; font-weight: 700; }
.rc-sec > header small { color: var(--muted); }
.rc-sec-i { align-self: center; width: 30px; height: 30px; border-radius: 10px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; }
.rc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.rc-card { position: relative; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s; overflow: hidden; }
.rc-card::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--tone); opacity: .85; }
.rc-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(58, 20, 12, .12); border-color: color-mix(in srgb, var(--tone) 35%, var(--border)); }
.rc-card-i { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--tone-50); color: var(--tone); }
.rc-card-i svg { width: 23px; height: 23px; }
.rc-card-b b { display: block; font-size: 16px; font-weight: 600; margin-bottom: 3px; }
.rc-card-b small { color: var(--muted); font-size: 13px; line-height: 1.5; display: block; }
.rc-card-h { margin-top: auto; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 13px; }
.rc-card-h small { color: var(--muted); }
.rc-card-h b { font-size: 15.5px; font-weight: 600; color: var(--tone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 65%; }
.rc-card-h.neg b { color: var(--danger); }
.rc-card-go { position: absolute; top: 16px; inset-inline-end: 16px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); transition: background .18s, color .18s, transform .18s; }
.rc-card:hover .rc-card-go { background: var(--tone); color: #fff; transform: translateX(-3px); }
/* one report */
.rc-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.rc-back { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); background: var(--surface-2); transition: background .15s, color .15s; }
.rc-back svg { transform: scaleX(-1); }
.rc-back:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.rc-head-i { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; background: var(--tone-50); color: var(--tone); flex: none; }
.rc-head-i svg { width: 25px; height: 25px; }
.rc-head-t { flex: 1 1 260px; min-width: 0; }
.rc-crumb { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.rc-crumb a { color: var(--info); text-decoration: none; font-weight: 700; }
.rc-head-t h2 { margin: 2px 0; font-size: 20px; font-weight: 700; }
.rc-head-t p { margin: 0; color: var(--muted); font-size: 13px; }
.rc-head-a { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rc-switch { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 0 0 0 4px; padding-inline-start: 10px; background: var(--surface); color: var(--muted); }
.rc-switch select { border: 0; background: none; padding: 8px 6px; font: inherit; font-weight: 700; color: var(--text); max-width: 210px; cursor: pointer; }
.rc-range { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; margin-bottom: 14px; }
.rc-body { display: grid; gap: 0; }
.rc-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 14px; min-width: 0; overflow: hidden; }
.rc-panel > header { display: flex; gap: 10px; align-items: center; padding: 14px 16px 6px; }
.rc-panel > header h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.rc-panel > header small { color: var(--muted); font-size: 12px; }
.rc-panel > header .spacer { flex: 1; }
.rc-panel-i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.rc-panel-b { padding: 8px 16px 16px; }
.rc-grid { display: grid; gap: 14px; }
.rc-grid > .rc-panel, .rc-grid > .rc-stack { margin-bottom: 0; }
.rc-grid { margin-bottom: 14px; }
.rc-grid.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rc-grid.g-12 { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.rc-stack { display: grid; gap: 14px; }
.rc-stack .rc-panel { margin: 0; }
.rc-none { color: var(--muted); text-align: center; padding: 24px 8px; font-size: 13.5px; }
.rc-note { display: flex; gap: 10px; align-items: flex-start; background: var(--warning-50); border: 1px solid #fde68a; color: #92400e; border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.rc-boxname { margin: 0 4px 12px; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.rc-table .table-wrap { margin: 0 -16px -16px; border-radius: 0; }
.rc-table .table { margin: 0; }
/* columns */
.rc-cols { display: flex; align-items: flex-end; gap: 4px; padding: 22px 2px 0; }
.rc-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; cursor: default; }
.rc-col i { display: block; width: 100%; max-width: 46px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--accent), var(--primary)); transition: filter .15s, transform .15s; transform-origin: bottom; animation: rcGrow .5s ease-out; }
.rc-cols.c2 .rc-col i { background: linear-gradient(180deg, #22a3b8, var(--info)); }
.rc-cols.c3 .rc-col i { background: linear-gradient(180deg, #f59e0b, #b45309); }
.rc-cols.c6 .rc-col i { background: linear-gradient(180deg, #f87171, var(--danger)); }
.rc-col.mark i { background: linear-gradient(180deg, #34d399, var(--success)); }
.rc-col:hover i { filter: brightness(1.12); }
.rc-col-v { font-size: 10.5px; font-weight: 600; color: var(--muted); margin-bottom: 3px; white-space: nowrap; }
.rc-col-l { font-size: 11px; color: var(--muted); height: 18px; line-height: 18px; margin-top: 4px; white-space: nowrap; }
@keyframes rcGrow { from { transform: scaleY(0); } }
/* the ring */
.rc-donut { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.rc-donut-g { position: relative; width: 170px; height: 170px; flex: none; }
.rc-donut-g svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rc-donut-g circle { transition: stroke-width .15s; }
.rc-donut-g circle:hover { stroke-width: 7.5; }
.rc-donut-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.rc-donut-c b { font-size: 24px; font-weight: 700; line-height: 1; }
.rc-donut-c small { color: var(--muted); }
.rc-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 180px; display: grid; gap: 6px; min-width: 0; }
.rc-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 52px; gap: 8px; align-items: center; font-size: 13.5px; }
.rc-legend i { width: 12px; height: 12px; border-radius: 4px; }
.rc-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-legend small { color: var(--muted); text-align: end; }
/* horizontal bars */
.rc-hbars { display: grid; gap: 9px; }
.rc-hbar { display: grid; grid-template-columns: minmax(80px, 150px) minmax(0, 1fr) auto 50px; gap: 10px; align-items: center; font-size: 13.5px; }
.rc-hbar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.rc-hbar-t { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.rc-hbar-t i { display: block; height: 100%; border-radius: 999px; animation: rcGrowX .5s ease-out; transform-origin: right; }
@keyframes rcGrowX { from { transform: scaleX(0); } }
.rc-hbar small { color: var(--muted); text-align: end; }
.rc-hbar-x { grid-column: 2 / -1; margin-top: -6px; font-size: 11.5px; color: var(--muted); }
/* the income statement */
.rc-sheet .rc-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; padding: 7px 4px; border-bottom: 1px dashed var(--border); }
.rc-sheet .rc-line small { color: var(--muted); font-size: 11.5px; min-width: 44px; text-align: end; }
.rc-sheet .rc-line b { min-width: 90px; text-align: end; }
.rc-sheet .rc-line.minus { color: #5b4a40; }
.rc-sheet .rc-line.sub { background: var(--surface-2); border-radius: 8px; font-weight: 600; border-bottom-color: transparent; margin: 4px 0; padding: 8px 8px; }
.rc-sheet .rc-line.grand { font-size: 18px; font-weight: 700; color: var(--success); border: 2px solid var(--success-50); background: var(--success-50); border-radius: 12px; padding: 12px 10px; margin-top: 10px; }
.rc-sheet .rc-line.grand.neg { color: var(--danger); background: var(--danger-50); border-color: var(--danger-50); }
.rc-sheet h4 { margin: 14px 4px 4px; color: var(--muted); font-size: 13px; }
/* the busy hours */
.rc-heat-wrap { overflow-x: auto; }
.rc-heat { display: grid; gap: 3px; min-width: 520px; }
.rc-heat-h { font-size: 11px; color: var(--muted); text-align: center; }
.rc-heat-d { font-size: 12.5px; font-weight: 700; align-self: center; }
.rc-heat-c { height: 30px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff;
  background: color-mix(in srgb, var(--primary) calc(var(--v) * 100%), var(--surface-2)); transition: transform .12s; }
.rc-heat-c:hover { transform: scale(1.12); position: relative; z-index: 1; }
.rc-heat-key { display: flex; gap: 4px; align-items: center; justify-content: flex-end; margin-top: 8px; }
.rc-heat-key i { width: 18px; height: 10px; border-radius: 3px; background: var(--primary); }
.rc-heat-key i:nth-child(1) { opacity: .15; } .rc-heat-key i:nth-child(2) { opacity: .35; } .rc-heat-key i:nth-child(3) { opacity: .55; } .rc-heat-key i:nth-child(4) { opacity: .75; }
/* small bits */
.rc-rank { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 8px; background: var(--surface-2); font-weight: 600; font-size: 12px; }
.rc-share { height: 4px; background: var(--surface-2); border-radius: 999px; margin-top: 4px; overflow: hidden; min-width: 60px; }
.rc-share i { display: block; height: 100%; background: var(--accent); }
.rc-margin { font-weight: 600; color: var(--success); font-size: 13px; }
.rc-margin.low { color: var(--danger); }
.rc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; }
.rc-chip small { color: var(--muted); font-weight: 600; }
.rc-print .rc-cols { break-inside: avoid; }
.rc-print .rc-panel { box-shadow: none; break-inside: avoid; border-color: #bbb; }
.rc-print .rc-kpis { grid-template-columns: repeat(4, 1fr); }
.rc-print .rc-spark { display: none; }
@media (max-width: 1100px) { .rc-grid.g-12 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .rc-grid.g-2 { grid-template-columns: 1fr; }
  .rc-hero { padding: 16px; }
  .rc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rc-kpi-v { font-size: 19px; }
  .rc-hbar { grid-template-columns: 90px minmax(0, 1fr) auto; }
  .rc-hbar small { display: none; }
  .rc-head-a { width: 100%; }
  .rc-switch { flex: 1; }
  .rc-switch select { max-width: none; width: 100%; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .pos { grid-template-columns: minmax(0, 1fr) 340px; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 250px; transform: translateX(100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .icon-btn.menu-toggle { display: grid; }
  /* tablets keep the cart beside the menu */
  .pos { grid-template-columns: minmax(0, 1fr) 310px; gap: 14px; }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
  .type-btn { font-size: 12px; padding: 7px 2px; }
  .pos-cart { min-width: 0; }
  .cart-actions { grid-template-columns: 1fr; }
  .cart-actions .btn-lg { order: -1; white-space: normal; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .user-chip .name { display: none; }
  .clock { display: none; }
}
@media (max-width: 640px) {
  .content { padding: 14px 12px; }
  .topbar { padding: 8px 12px; }
  .board { grid-template-columns: 1fr; }
  /* the phone (the order-taker at the door): the menu fills the screen; the order is a bar at the bottom that opens as a sheet */
  .pos { grid-template-columns: 1fr; padding-bottom: 92px; }
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pos-top .input { max-width: none; flex: 1 1 100%; }
  .pos-cart { position: fixed; inset-inline: 0; bottom: 0; top: auto; max-height: 88vh; border-radius: 24px 24px 0 0; z-index: 60; border-bottom: 0; box-shadow: 0 -12px 32px -12px rgba(58, 20, 12, .3); }
  .pos-cart:not(.open) > :not(.cart-bar) { display: none !important; }
  .pos-cart.open { overflow-y: auto; box-shadow: 0 0 0 100vmax rgba(34, 18, 15, .38); animation: pop .22s var(--ease); }
  .cart-bar { display: flex; align-items: center; gap: 12px; width: calc(100% - 24px); margin: 12px; min-height: 56px; border: 0; border-radius: 999px; background: var(--primary); color: #fff; padding: 0 12px 0 20px; font-size: 16px; font-weight: 600; cursor: pointer; flex: none; }
  .pos-cart:not(.has-items) .cart-bar { background: var(--surface-2); color: var(--muted); font-weight: 400; justify-content: center; }
  .pos-cart.open .cart-bar { position: sticky; top: 0; z-index: 1; background: var(--surface); color: var(--text); border: 1px solid var(--border); }
  .cb-n { background: #fff; color: var(--primary); border-radius: 999px; min-width: 30px; height: 30px; display: grid; place-items: center; font-size: 14px; padding: 0 9px; }
  .pos-cart.open .cb-n { background: var(--primary); color: #fff; }
  .cb-l { flex: 1; text-align: start; }
  .cb-t { padding-inline-end: 8px; }
  .cart-lines { max-height: none; }
  .form-grid, .kv { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .value { font-size: 19px; }
  .hbar { grid-template-columns: 90px 1fr auto; }
}

/* ---------- cheques (pages-cheques.js; the leaf's own styles are in CHEQUE_CSS there, shared with its printed page) ---------- */
.cheque-amount { text-align: center; padding: 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.cheque-amount .big { font-size: 26px; font-weight: 600; }
.cq-infos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 16px; margin-bottom: 12px; font-size: 13.5px; }
.cq-info > .muted { font-size: 12px; }
.cheque-preview { overflow: auto; padding: 12px; margin-top: 12px; background: var(--surface-2); border-radius: var(--radius); }
.cheque-preview .cheque-leaf { outline: 1px dashed #94a3b8; margin: 0 auto; box-shadow: var(--shadow); }
.cheque-preview.small-preview { padding: 8px; }
.layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.layout-table td { padding: 4px 8px; vertical-align: middle; }
.invoice-picks { display: grid; gap: 6px; max-height: 200px; overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
.cheque-box { border: 1px dashed var(--primary); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-2); }
.cheque-box-head { font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; color: var(--primary); }
.cheque-box-head svg { width: 18px; height: 18px; }
.cheque-box [data-cheque-words] { margin-top: 6px; }
.cq-name-en { padding: 8px 2px; display: flex; gap: 6px; align-items: center; }
.cq-name-en svg { width: 16px; height: 16px; color: var(--muted); }
.cq-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px; }
.cq-book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.table tr.row-danger td { background: color-mix(in srgb, var(--danger, #dc2626) 6%, transparent); }
.cheque-copy h3 { display: flex; gap: 8px; align-items: center; justify-content: center; }
.cheque-copy h4 { margin: 14px 0 6px; }

/* ---------- the English interface (public/js/i18n.js: the page turns left-to-right) ---------- */
@media (max-width: 960px) {
  html[dir="ltr"] .sidebar { transform: translateX(-100%); }
  html[dir="ltr"] .sidebar.open { transform: none; }
}
html[dir="ltr"] .ag-switch i::after { right: auto; left: 3px; transition: left .2s; }
html[dir="ltr"] .ag-switch input:checked + i::after { left: 22px; }
html[dir="ltr"] .ag-switch.sm input:checked + i::after { left: 20px; }
html[dir="ltr"] .rc-card:hover .rc-card-go { transform: translateX(3px); }
.login-card .lang-switch { margin: 14px auto 0; display: flex; gap: 6px; align-items: center; }
.lang-switch svg, .dropdown-menu [data-act="lang"] svg { width: 16px; height: 16px; }
/* the language button of the top bar: «English» / «العربية» */
.topbar .lang-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; padding-inline: 12px; }
.topbar .lang-btn svg { width: 17px; height: 17px; }
.topbar .lang-btn span { font-family: system-ui, "Segoe UI", Tahoma, sans-serif; }
@media (max-width: 600px) { .topbar .lang-btn span { display: none; } .topbar .lang-btn { padding-inline: 9px; } }

/* ---------- human resources (as in the car wash system: public/js/pages-hr.js) ---------- */
.emp-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-inline-end: 8px; border: 1px solid var(--border); }
.emp-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.emp-images > div { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.emp-image-box { width: 100%; height: 150px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.emp-image-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.emp-images .btn input[type=file] { display: none; }
.batch-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 4px; margin: 0; }
.batch-box legend { font-weight: 700; padding: 0 6px; color: var(--primary); }
.batch-box .form-grid { margin-top: 8px; }
.batch-total { font-size: 15px; }
.hr-info { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; margin-bottom: 12px; font-size: 13px; }
.salary-slip .table th { width: 55%; }
.salary-slip .hr-info { font-size: 13px; }
.att-off td { opacity: .55; }
