/* زينة برو: design system (RTL, offline fonts) */
@font-face { font-family: 'Plex Arabic'; font-weight: 400; font-display: swap; src: url('../fonts/plex-arabic-400.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Plex Arabic'; font-weight: 500; font-display: swap; src: url('../fonts/plex-arabic-500.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Plex Arabic'; font-weight: 600; font-display: swap; src: url('../fonts/plex-arabic-600.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Plex Arabic'; font-weight: 700; font-display: swap; src: url('../fonts/plex-arabic-700.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Plex Arabic'; font-weight: 400; font-display: swap; src: url('../fonts/plex-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plex Arabic'; font-weight: 500; font-display: swap; src: url('../fonts/plex-latin-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plex Arabic'; font-weight: 600; font-display: swap; src: url('../fonts/plex-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plex Arabic'; font-weight: 700; font-display: swap; src: url('../fonts/plex-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --font: 'Plex Arabic', 'Segoe UI', Tahoma, sans-serif;
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #e3e8ef;
  --line-2: #d4dbe5;
  --ink: #0f1b2d;
  --ink-2: #334155;
  --muted: #6b7a90;
  --brand: #0f766e;
  --brand-2: #0b5d57;
  --brand-soft: #e6f4f2;
  --accent: #e8590c;
  --accent-soft: #fff1e8;
  --ok: #15803d;
  --ok-soft: #e8f6ee;
  --warn: #b45309;
  --warn-soft: #fff7e6;
  --bad: #c62828;
  --bad-soft: #fdecec;
  --info: #1d4ed8;
  --info-soft: #eaf0ff;
  --side: #0c1524;
  --side-2: #142036;
  --side-ink: #c6d1e1;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 1px rgba(15, 27, 45, .04);
  --shadow-lg: 0 18px 50px rgba(15, 27, 45, .22);
  --side-w: 236px;
  --top-h: 58px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
.ic { flex: none; vertical-align: middle; }
.num, .mono { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
td.num, th.num, td.mono, th.mono { display: table-cell; }
.kpi .v.num { display: block; text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 700; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.right { text-align: right; } .left { text-align: left; } .center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.hidden { display: none !important; }
.sep { height: 1px; background: var(--line); margin: 12px 0; }
.gap-s { gap: 6px; } .gap-l { gap: 16px; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100vh; overflow: hidden; }
.shell.collapsed { --side-w: 68px; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; min-height: 0; border-left: 1px solid #0a111d; }
.side .brand { height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 16px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.06); }
.side .brand .logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #14b8a6, #0f766e); display: grid; place-items: center; color: #fff; flex: none; overflow: hidden; }
.side .brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.side .brand b { font-size: 15.5px; letter-spacing: .2px; }
.side .brand small { display: block; color: #8fa1ba; font-size: 11px; font-weight: 500; margin-top: -2px; }
.side nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.side .group { margin: 14px 8px 6px; font-size: 11px; color: #6d7f99; font-weight: 600; letter-spacing: .3px; }
.side a.nav { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; color: var(--side-ink); font-weight: 500; text-decoration: none; margin: 1px 0; white-space: nowrap; }
.side a.nav:hover { background: var(--side-2); color: #fff; }
.side a.nav.active { background: linear-gradient(90deg, rgba(20,184,166,.18), rgba(20,184,166,.06)); color: #fff; box-shadow: inset -3px 0 0 #2dd4bf; }
.side a.nav .badge { margin-inline-start: auto; }
.shell.collapsed .side .brand b, .shell.collapsed .side .brand small, .shell.collapsed .side .group, .shell.collapsed .side a.nav span, .shell.collapsed .side a.nav .badge { display: none; }
.shell.collapsed .side a.nav { justify-content: center; padding: 10px 0; }
.side .foot { padding: 10px 14px; font-size: 11px; color: #6d7f99; border-top: 1px solid rgba(255,255,255,.06); }
.shell.collapsed .side .foot { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { height: var(--top-h); background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 18px; flex: none; }
.top h1 { font-size: 17px; font-weight: 700; }
.top .crumb { color: var(--muted); font-size: 12.5px; }
.top .spacer { flex: 1; }
.top .clock { color: var(--muted); font-size: 12.5px; }
.content { flex: 1; overflow: auto; padding: 18px; min-height: 0; }
.content.flush { padding: 0; overflow: hidden; }
.page-host { display: contents; }
.page { max-width: 1400px; margin: 0 auto; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--panel-2); border-color: #c3ccd8; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(15,118,110,.25); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: #cf4f0a; }
.btn.danger { color: var(--bad); border-color: #f0c7c7; background: #fff; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #eef2f7; }
.btn.sm { height: 31px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 46px; padding: 0 20px; font-size: 15.5px; }
.btn.xl { height: 58px; font-size: 18px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 31px; }
.btn.block { width: 100%; }
.btn .kbd { font-size: 10.5px; opacity: .7; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; line-height: 15px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, select.input, textarea.input {
  height: 38px; width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; padding: 0 11px; outline: none;
  transition: border-color .12s, box-shadow .12s; min-width: 0;
}
textarea.input { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,110,.15); }
.input[readonly] { background: var(--panel-2); }
.input.num-in { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.input.lg { height: 46px; font-size: 16px; }
.input.invalid { border-color: var(--bad); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .btn { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: 0; }
.search-box { position: relative; }
.search-box .ic { position: absolute; top: 50%; right: 11px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box .input { padding-right: 36px; }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.card-h h3 { font-size: 15px; font-weight: 700; }
.card-h .sub { color: var(--muted); font-size: 12.5px; }
.card-b { padding: 16px; }
.card-f { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 15px 16px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.kpi .t { color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kpi .v { font-size: 23px; font-weight: 700; letter-spacing: -.2px; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi .ico { position: absolute; left: 14px; top: 14px; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi.orange .ico { background: var(--accent-soft); color: var(--accent); }
.kpi.blue .ico { background: var(--info-soft); color: var(--info); }
.kpi.red .ico { background: var(--bad-soft); color: var(--bad); }

/* ---------- toolbar / page header ---------- */
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h2 { font-size: 19px; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.toolbar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.toolbar .field { min-width: 140px; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.t th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); color: var(--ink-2); font-weight: 600; font-size: 12.5px; text-align: right;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr:hover td { background: #fafcff; }
table.t tr.click { cursor: pointer; }
table.t td.n, table.t th.n { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tfoot td { font-weight: 700; background: var(--panel-2); border-top: 1px solid var(--line-2); }
table.t .actions { white-space: nowrap; text-align: left; }
table.t tr.muted-row td { color: var(--muted); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty .ic { color: #b6c2d2; margin-bottom: 8px; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 10px 14px; color: var(--muted); font-size: 12.5px; }

/* ---------- badges / chips / tabs ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: #eef2f7; color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.dark { background: #1e293b; color: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 10px; overflow-x: auto; }
.tab { padding: 11px 14px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.seg { display: inline-flex; background: #eef2f7; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.seg button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(10, 18, 32, .52); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; animation: fade .12s ease-out; }
.modal { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; display: flex; flex-direction: column; animation: pop .14s ease-out; }
.modal.wide { max-width: 860px; } .modal.xwide { max-width: 1120px; } .modal.narrow { max-width: 420px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-h h3 { font-size: 16.5px; font-weight: 700; flex: 1; }
.modal-b { padding: 18px; }
.modal-f { padding: 13px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-start; flex-wrap: wrap; background: var(--panel-2); border-radius: 0 0 14px 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } }

/* ---------- toast ---------- */
.toasts { position: fixed; bottom: 18px; left: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: #0f1b2d; color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; align-items: flex-start; gap: 9px; font-weight: 500; animation: pop .15s ease-out; }
.toast.ok { background: #0f5132; } .toast.bad { background: #8a1c1c; } .toast.warn { background: #7c4a03; }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 9px; background: var(--info-soft); color: #1e3a8a; font-size: 13px; }
.alert.warn { background: var(--warn-soft); color: #7c4a03; }
.alert.bad { background: var(--bad-soft); color: #7f1d1d; }
.alert.ok { background: var(--ok-soft); color: #14532d; }

/* ---------- dropdown / autocomplete ---------- */
.ac { position: relative; }
.ac-list { position: absolute; top: calc(100% + 4px); right: 0; left: 0; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 50; max-height: 320px; overflow-y: auto; }
.ac-item { padding: 9px 12px; cursor: pointer; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #f1f4f8; }
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item.active { background: var(--brand-soft); }
.ac-item .meta { color: var(--muted); font-size: 12px; }
.menu-pop { position: absolute; z-index: 60; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 190px; padding: 5px; }
.menu-pop button { display: flex; width: 100%; gap: 9px; align-items: center; padding: 8px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: right; font-weight: 500; }
.menu-pop button:hover { background: var(--panel-2); }

/* ---------- auth screens ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(1200px 500px at 85% -10%, rgba(20,184,166,.18), transparent 60%),
  radial-gradient(900px 500px at -10% 110%, rgba(232,89,12,.12), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card.wide { max-width: 860px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; justify-content: center; }
.auth-brand .logo { width: 48px; height: 48px; border-radius: 13px; background: linear-gradient(135deg, #14b8a6, #0f766e); display: grid; place-items: center; color: #fff; }
.auth-brand h1 { font-size: 22px; }
.steps { display: flex; gap: 8px; margin-bottom: 16px; }
.steps .s { flex: 1; height: 5px; border-radius: 9px; background: #dfe5ee; }
.steps .s.on { background: var(--brand); }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 430px; height: 100%; min-height: 0; }
.pos-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--line); }
.pos-search { padding: 12px 14px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.pos-search .search-box { flex: 1; }
.pos-cats { padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.pos-cats .chips { flex-wrap: nowrap; }
.pos-grid { flex: 1; overflow-y: auto; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; }
.tile > * { flex-shrink: 0; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 128px;
  transition: border-color .1s, box-shadow .1s, transform .05s; position: relative; text-align: right; }
.tile:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(15,118,110,.12); }
.tile:active { transform: scale(.985); }
.tile .nm { font-weight: 600; font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .pr { margin-top: auto; font-weight: 700; color: var(--brand); font-size: 15px; }
.tile .st { font-size: 11px; color: var(--muted); }
.tile .st.low { color: var(--bad); }
.tile .bar { position: absolute; top: 0; right: 0; left: 0; height: 3px; border-radius: 11px 11px 0 0; }
.tile.svc .pr { color: var(--accent); }
.pos-right { display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.pos-cust { padding: 11px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.pos-cust .who { flex: 1; min-width: 0; }
.pos-cust .who b { display: block; font-size: 14px; }
.pos-cart { flex: 1; overflow-y: auto; min-height: 0; }
.cart-line { padding: 10px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.cart-line .nm { font-weight: 600; font-size: 13.5px; }
.cart-line .meta { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cart-line .tot { font-weight: 700; text-align: left; }
.cart-line.sel { background: #f2fbf9; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; height: 30px; }
.qty button { width: 28px; height: 100%; border: 0; background: var(--panel-2); cursor: pointer; display: grid; place-items: center; }
.qty input { width: 56px; height: 100%; border: 0; text-align: center; direction: ltr; outline: none; font-weight: 600; }
.mini { height: 30px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; background: #fff; font-size: 12.5px; max-width: 150px; }
.mini.num-in { width: 84px; direction: ltr; text-align: right; }
.pos-totals { border-top: 1px solid var(--line); padding: 12px 14px; background: var(--panel-2); }
.pos-totals .ln { display: flex; justify-content: space-between; font-size: 13.5px; padding: 2px 0; color: var(--ink-2); }
.pos-totals .grand { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.pos-totals .grand b { font-size: 26px; letter-spacing: -.3px; }
.pos-actions { padding: 10px 14px 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: var(--panel-2); }
.pos-actions .pay { grid-column: 1 / -1; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.pay-m { border: 1.5px solid var(--line-2); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; background: #fff; }
.pay-m.on { border-color: var(--brand); background: #f3fbfa; }
.pay-m label { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.keypad button { height: 44px; border: 1px solid var(--line-2); background: #fff; border-radius: 8px; font-size: 17px; font-weight: 600; cursor: pointer; }
.keypad button:hover { background: var(--panel-2); }
.big-total { font-size: 34px; font-weight: 700; letter-spacing: -.5px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.status-dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { display: block; width: 100%; max-width: 46px; background: linear-gradient(180deg, #14b8a6, #0f766e); border-radius: 6px 6px 3px 3px; min-height: 3px; }
.bars .b span { font-size: 11px; color: var(--muted); }
.bars .b em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink-2); direction: ltr; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.list-plain li:last-child { border-bottom: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 22px 14px 0; }
.timeline li::before { content: ''; position: absolute; right: 5px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.timeline li::after { content: ''; position: absolute; right: 9px; top: 18px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); }
.logo-prev { width: 76px; height: 76px; border-radius: 12px; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; background: var(--panel-2); }
.logo-prev img { max-width: 100%; max-height: 100%; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid #dbe3ec; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
iframe.print-frame { position: fixed; width: 0; height: 0; border: 0; left: -10px; top: -10px; }

@media (max-width: 1280px) { .pos { grid-template-columns: minmax(0, 1fr) 390px; } }
@media (max-width: 1100px) { .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 0 0 auto; width: 260px; z-index: 90; transform: translateX(100%); transition: transform .18s; }
  .shell.mob-open .side { transform: none; }
  .shell.collapsed { --side-w: 236px; }
  .pos { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  .content { padding: 12px; }
  .form-grid .span-2 { grid-column: auto; }
  .kv { grid-template-columns: 110px 1fr; }
}
@media (max-width: 600px) {
  .top { padding: 0 10px; gap: 6px; }
  .top .clock, #user-btn > span:not(.badge) { display: none; }
  .top h1 { font-size: 15px; }
}

/* ---- v1.1: appointments calendar ---- */
.ap-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ap-toolbar .ap-date { width: 150px; }
.ap-toolbar .ap-tech { width: 170px; }
.ap-toolbar .ap-search { width: 230px; }
.ap-title { min-width: 0; line-height: 1.35; }
.ap-title b { font-size: 15px; }
.ap-counts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); min-height: 39px; }
.ap-scroll { overflow: auto; max-height: calc(100vh - 262px); min-height: 320px; position: relative; overscroll-behavior: contain; }
.ap-day { display: grid; grid-template-columns: 62px repeat(var(--cols), minmax(178px, 1fr)); min-width: calc(62px + var(--cols) * 178px); position: relative; }
.ap-corner, .ap-head { position: sticky; top: 0; z-index: 4; background: var(--panel-2); border-bottom: 1px solid var(--line-2); height: 42px; }
.ap-corner { inset-inline-start: 0; z-index: 6; display: grid; place-items: center; color: var(--muted); border-inline-end: 1px solid var(--line); }
.ap-head { display: flex; align-items: center; gap: 7px; padding: 0 12px; font-weight: 700; font-size: 13.5px; border-inline-start: 1px solid var(--line); min-width: 0; }
.ap-head .ic { color: var(--brand); }
.ap-gutter { position: sticky; inset-inline-start: 0; z-index: 3; background: var(--panel); border-inline-end: 1px solid var(--line); }
.ap-gutter .t { position: absolute; inset-inline: 0; transform: translateY(-50%); text-align: center; font-size: 11.5px; color: var(--muted); background: var(--panel); line-height: 16px; }
.ap-gutter .t:first-child { transform: none; }
.ap-gutter .ap-now-t { position: absolute; inset-inline: 2px; transform: translateY(-50%); text-align: center; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--bad); border-radius: 5px; line-height: 17px; z-index: 2; }
.ap-col { position: relative; border-inline-start: 1px solid var(--line); background: var(--panel); }
.ap-slot { position: absolute; inset-inline: 0; border-top: 1px dashed #edf1f6; }
.ap-slot.hour { border-top: 1px solid var(--line); }
.ap-slot.free { cursor: pointer; }
.ap-slot.free:hover { background: var(--brand-soft); }
.ap-slot.free:hover::after { content: '+ حجز'; position: absolute; inset-inline-start: 8px; top: 50%; transform: translateY(-50%); font-size: 11.5px; font-weight: 700; color: var(--brand); }
.ap-now { position: absolute; inset-inline: 0; height: 2px; background: var(--bad); z-index: 2; pointer-events: none; }
.ap-now::before { content: ''; position: absolute; inset-inline-start: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.ap-ev { position: absolute; z-index: 1; overflow: hidden; cursor: pointer; border-radius: 8px; padding: 4px 8px 4px 6px; font-size: 12px; line-height: 1.4;
  background: var(--info-soft); color: #1e3a8a; border: 1px solid #c9d7fb; border-inline-start: 4px solid var(--info); box-shadow: var(--shadow); transition: box-shadow .12s, transform .05s; }
.ap-ev:hover, .ap-ev:focus-visible { box-shadow: 0 6px 18px rgba(15, 27, 45, .18); z-index: 2; outline: none; }
.ap-ev .tm { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; opacity: .9; white-space: nowrap; overflow: hidden; }
.ap-ev .nm { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.ap-ev .sub, .ap-ev .sv { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.ap-ev .sv { font-size: 11.5px; opacity: .85; }
.ap-ev.short { padding-top: 2px; padding-bottom: 2px; }
.ap-ev.short .tm { display: inline-flex; margin-inline-end: 6px; }
.ap-ev.short .nm { display: inline; }
.ap-ev.short .sub, .ap-ev.short .sv { display: none; }
.ap-tag { margin-inline-start: auto; font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.75); white-space: nowrap; }
.ap-tag.bad { background: var(--bad); color: #fff; }
:is(.ap-ev, .ap-wcard).st-confirmed { background: var(--brand-soft); color: var(--brand-2); border-color: #bfe3de; border-inline-start-color: var(--brand); }
:is(.ap-ev, .ap-wcard).st-arrived { background: var(--warn-soft); color: #7c4a03; border-color: #f6dcae; border-inline-start-color: #f59e0b; }
:is(.ap-ev, .ap-wcard).st-done { background: var(--ok-soft); color: #14532d; border-color: #c4e8d2; border-inline-start-color: var(--ok); }
:is(.ap-ev, .ap-wcard).st-no_show { background: #f4f5f7; color: var(--muted); border-color: #e3e6eb; border-inline-start-color: #9aa5b5; opacity: .82; }
:is(.ap-ev, .ap-wcard).st-cancelled { background: repeating-linear-gradient(135deg, #f7f8fa 0 6px, #eef1f5 6px 12px); color: var(--muted); border-color: #e3e6eb; border-style: dashed; border-inline-start: 4px solid #b8c1cf; opacity: .72; box-shadow: none; }
:is(.ap-ev, .ap-wcard):is(.st-no_show, .st-cancelled) .nm { color: var(--muted); text-decoration: line-through; }
.ap-ev.late, .ap-wcard.late { box-shadow: 0 0 0 2px rgba(198, 40, 40, .35); }
.ap-flash { animation: apflash 1.6s ease-out 1; }
@keyframes apflash { 0%, 40% { box-shadow: 0 0 0 4px rgba(232, 89, 12, .55); } 100% { box-shadow: var(--shadow); } }
.ap-emptyday { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); background: var(--panel-2); }

/* week */
.ap-week { display: grid; grid-template-columns: repeat(7, minmax(146px, 1fr)); min-width: 1022px; align-items: stretch; }
.ap-wcol { border-inline-start: 1px solid var(--line); min-height: 420px; display: flex; flex-direction: column; background: var(--panel); }
.ap-wcol:first-child { border-inline-start: 0; }
.ap-wcol.today { background: #fbfefd; }
.ap-whead { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; width: 100%; padding: 9px 10px; border: 0; border-bottom: 1px solid var(--line-2);
  background: var(--panel-2); cursor: pointer; text-align: right; font: inherit; color: var(--ink); }
.ap-whead:hover { background: #eef5f4; }
.ap-whead .badge { margin-inline-start: auto; }
.ap-wcol.today .ap-whead { background: var(--brand-soft); box-shadow: inset 0 -2px 0 var(--brand); }
.ap-wcol.sel:not(.today) .ap-whead { box-shadow: inset 0 -2px 0 var(--line-2); }
.ap-wlist { padding: 6px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ap-wcard { border-radius: 8px; padding: 6px 8px; font-size: 12px; cursor: pointer; line-height: 1.45; min-width: 0;
  background: var(--info-soft); color: #1e3a8a; border: 1px solid #c9d7fb; border-inline-start: 4px solid var(--info); }
.ap-wcard:hover, .ap-wcard:focus-visible { box-shadow: 0 4px 12px rgba(15, 27, 45, .14); outline: none; }
.ap-wcard .tm { font-weight: 700; color: var(--ink); }
.ap-wcard .nm { font-weight: 700; color: var(--ink); font-size: 12.5px; }
.ap-wcard .sub { color: var(--ink-2); }
.ap-wcard .badge { height: 19px; padding: 0 7px; font-size: 10.5px; }
.ap-wempty { color: #a3afbf; font-size: 12px; text-align: center; padding: 14px 0 6px; }
.ap-wadd { margin-top: auto; border: 1px dashed var(--line-2); background: transparent; border-radius: 8px; padding: 5px; color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.ap-wadd:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* dialogs */
.ap-form { align-items: start; }
.ap-when-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ap-free-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ap-cust { border: 1px dashed var(--line-2); border-radius: 10px; padding: 12px; background: var(--panel-2); }
.ap-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 30px; align-items: center; }
.ap-chip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 6px 0 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-2); font-weight: 600; font-size: 12.5px; }
.ap-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.ap-chip button:hover { background: rgba(15, 118, 110, .15); }
.ap-okhint { display: flex; align-items: center; gap: 6px; color: var(--ok); font-size: 12.5px; font-weight: 600; }
.ap-when { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.ap-when .ic { color: var(--brand); }
.ap-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 1100px) { .ap-toolbar .ap-search { width: 100%; order: 9; } }
@media (max-width: 900px) {
  .ap-scroll { max-height: none; }
  .ap-form { grid-template-columns: 1fr; }
  .ap-toolbar .ap-date, .ap-toolbar .ap-tech { flex: 1 1 140px; width: auto; }
  .ap-actions .btn { flex: 1 1 calc(50% - 8px); }
}
