:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0e7490;
  --primary-600: #0b5f76;
  --primary-50: #ecfeff;
  --accent: #0ea5e9;
  --success: #15803d;
  --success-50: #f0fdf4;
  --warning: #b45309;
  --warning-50: #fffbeb;
  --danger: #b91c1c;
  --danger-50: #fef2f2;
  --sidebar: #0f2a36;
  --sidebar-text: #cbd9df;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --font: 'Tajawal', '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; }
/* In the English (left-to-right) interface, Arabic data such as item and customer names keeps its own direction */
[dir="ltr"] :is(td, .tile .n, .notif .t, .notif .b, .job, .cart-line b, .brand-name, .login-card h1, .stat .label) { unicode-bidi: plaintext; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.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); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 240px 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; }
.brand { padding: 18px 18px 14px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #22d3ee, #0e7490); display: grid; place-items: center; color: #fff; flex: none; }
.brand-name { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.3; }
.nav { padding: 10px 8px 20px; display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 12px; color: #7c97a3; padding: 14px 12px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--sidebar-text); font-size: 14.5px; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--primary); color: #fff; }
.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: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 22px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 19px; margin: 0; font-weight: 700; }
.topbar .spacer { flex: 1; }
.icon-btn.menu-toggle { display: none; }
.content { padding: 22px; max-width: 1500px; width: 100%; }

.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(15,23,42,.12); min-width: 220px; padding: 6px; z-index: 50; }
.dropdown-menu button, .dropdown-menu a { display: block; width: 100%; text-align: start; background: none; border: 0; padding: 9px 12px; border-radius: 6px; cursor: pointer; color: var(--text); }
.dropdown-menu button:hover, .dropdown-menu a:hover { background: var(--surface-2); }

.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: -5px; inset-inline-start: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; display: grid; place-items: center; font-weight: 700; }

.notif-panel { width: 360px; max-height: 70vh; overflow-y: auto; padding: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.notif-tabs { display: flex; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--border); overflow-x: auto; background: var(--surface-2); position: sticky; top: 45px; z-index: 1; }
.notif-tabs button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.notif-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.notif { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; gap: 10px; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: #f0f9ff; }
.notif .t { font-weight: 700; font-size: 14px; }
.notif .b { font-size: 13px; color: var(--muted); white-space: pre-line; }
.notif .when { font-size: 12px; color: var(--muted); }
.notif-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.notif-ico svg { width: 16px; height: 16px; }

/* ---------- elements ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.95); background: var(--success); }
.btn-danger { background: var(--surface); border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: var(--danger-50); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 12px 20px; font-size: 17px; font-weight: 700; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

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

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 22px; font-weight: 800; margin-top: 2px; }
.stat .sub { font-size: 12.5px; color: var(--muted); }
.stat.link { cursor: pointer; }
.stat.link:hover { border-color: var(--primary); }

label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 8px 10px; color: var(--text); width: 100%; min-width: 0; }
.input:focus { outline: 2px solid rgba(14,116,144,.25); border-color: var(--primary); }
textarea.input { resize: vertical; min-height: 70px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 14px; color: var(--text); }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-weight: 700; color: var(--muted); font-size: 12.5px; background: var(--surface-2); padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcff; }
.table tr.clickable { cursor: pointer; }
.table tfoot td { font-weight: 800; background: var(--surface-2); }
.table .actions { white-space: nowrap; text-align: end; }
.table .actions .btn + .btn { margin-inline-start: 4px; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge-success { background: var(--success-50); color: var(--success); border-color: #bbf7d0; }
.badge-warning { background: var(--warning-50); color: var(--warning); border-color: #fde68a; }
.badge-danger { background: var(--danger-50); color: var(--danger); border-color: #fecaca; }
.badge-info { background: var(--primary-50); color: var(--primary); border-color: #a5f3fc; }
.nav .badge { background: var(--danger); color: #fff; border: 0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 9px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }

.alert { padding: 10px 14px; border-radius: 8px; border: 1px solid; margin-bottom: 12px; font-size: 14px; }
.alert-warning { background: var(--warning-50); border-color: #fde68a; color: #78350f; }
.alert-info { background: var(--primary-50); border-color: #a5f3fc; color: #164e63; }
.alert-danger { background: var(--danger-50); border-color: #fecaca; color: #7f1d1d; }

/* ---------- modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 14px; z-index: 100; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 900px; }
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.close-x { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }

#toast-root { position: fixed; bottom: 18px; inset-inline-start: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #0f172a; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 380px; font-size: 14px; animation: slide .2s ease-out; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #0f2a36 0%, #0e7490 100%); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 16px; padding: 30px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-card h1 { margin: 12px 0 4px; font-size: 22px; text-align: center; }
.login-card .brand-logo { margin: 0 auto; width: 56px; height: 56px; border-radius: 14px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.login-page { position: relative; }
.login-link { text-align: center; }
.login-links { display: flex; justify-content: space-between; gap: 10px; }
.lang-switch { position: absolute; top: 16px; inset-inline-end: 16px; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); color: #fff; }
.lang-switch:hover { background: rgba(255,255,255,.22); }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 440px); gap: 16px; align-items: start; }
.scan-box { display: flex; gap: 8px; }
.scan-box .input { font-size: 17px; padding: 11px 14px; }
.cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.cat-tabs button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 5px 14px; cursor: pointer; font-size: 13.5px; }
.cat-tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.cat-tabs.sub-tabs { margin-top: -4px; padding: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.cat-tabs.sub-tabs button.active { background: var(--primary-50); color: var(--primary); }
.cat-tabs button.multi { border-style: dashed; border-color: var(--primary); color: var(--primary); display: inline-flex; align-items: center; gap: 5px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 12px; text-align: start; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 92px; transition: border-color .15s, transform .05s; }
.tile:hover { border-color: var(--primary); }
.tile:active { transform: scale(.98); }
.tile .n { font-weight: 700; font-size: 14px; line-height: 1.35; }
.tile .code { align-self: flex-start; font-size: 12px; font-weight: 800; color: var(--primary); background: var(--surface-2, #eef6f9); border-radius: 6px; padding: 0 7px; line-height: 1.6; }
.tile .p { color: var(--primary); font-weight: 800; margin-top: auto; }
.tile .q { font-size: 12px; color: var(--muted); }
.tile.service { border-inline-start: 4px solid #22d3ee; }
.tile.out { opacity: .55; }
.cart-line { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty button { width: 28px; height: 30px; border: 0; background: var(--surface-2); cursor: pointer; font-size: 16px; }
.qty input { width: 46px; border: 0; text-align: center; height: 30px; }
.price-input { width: 80px; padding: 4px 6px !important; }
.totals { margin-top: 10px; }
.totals .row { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-size: 22px; font-weight: 800; color: var(--primary); border-top: 2px solid var(--border); margin-top: 6px; padding-top: 8px; }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pay-methods button { padding: 9px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; cursor: pointer; font-weight: 600; }
.pay-methods button.active { background: var(--primary-50); border-color: var(--primary); color: var(--primary); }
.pay-methods.two { grid-template-columns: 1fr 1fr; }
.plate-row { display: grid; grid-template-columns: 1.4fr 0.9fr 1.4fr; gap: 10px; }
.plate-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.plate-chips .chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; background: var(--surface-2); direction: ltr; }
.plate-chips .chip button { border: 0; background: none; cursor: pointer; color: var(--danger); font-size: 15px; line-height: 1; padding: 0 4px; }
.plate-src { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.plate-src h4 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.pay-methods.two button { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px; }

/* ---------- jobs board ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 14px; overflow-x: auto; }
.col { background: #eef2f7; border-radius: var(--radius); padding: 10px; min-height: 300px; }
.col h3 { margin: 2px 4px 10px; font-size: 15px; display: flex; justify-content: space-between; }
.job { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
.job .plate { font-weight: 800; font-size: 16px; letter-spacing: .5px; }
.job .svc { font-size: 13px; color: var(--muted); margin: 4px 0; }
.job .actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- kiosk ---------- */
.kiosk { min-height: 100vh; background: linear-gradient(160deg, #0f2a36, #0e7490); color: #fff; display: grid; place-items: center; text-align: center; padding: 20px; }
.kiosk .clock { font-size: 72px; font-weight: 800; letter-spacing: 2px; direction: ltr; }
.kiosk .date { font-size: 20px; opacity: .85; }
.kiosk input { margin-top: 30px; font-size: 22px; padding: 14px 18px; border-radius: 12px; border: 0; width: min(420px, 90vw); text-align: center; }
.kiosk .result { margin-top: 26px; font-size: 28px; font-weight: 700; min-height: 90px; }
.kiosk .result.in { color: #86efac; }
.kiosk .result.out { color: #fde68a; }
.kiosk .result.err { color: #fca5a5; }

/* ---------- charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar i { display: block; width: 100%; max-width: 34px; background: linear-gradient(180deg, #22d3ee, #0e7490); border-radius: 5px 5px 2px 2px; min-height: 2px; }
.bars .bar span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; }
.kv > div:nth-child(odd) { color: var(--muted); }
.kv > div:nth-child(even) { font-weight: 700; text-align: end; }
.kv .total { border-top: 1px solid var(--border); padding-top: 6px; color: var(--text) !important; font-weight: 800 !important; }

.perm-group { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.perm-group h4 { margin: 0 0 8px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.perm-group .items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }

.details-json { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: 13px; white-space: pre-wrap; direction: ltr; text-align: left; max-height: 50vh; overflow: auto; }

/* ---------- print ---------- */
#print-root { display: none; }
.receipt { width: 76mm; font-size: 12.5px; color: #000; margin: 0 auto; font-family: var(--font); }
.receipt h2 { text-align: center; margin: 0; font-size: 16px; }
.receipt .c { text-align: center; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td, .receipt th { padding: 2px 0; text-align: start; }
.receipt .line { border-top: 1px dashed #000; margin: 6px 0; }
.receipt .big { font-size: 16px; font-weight: 800; }
.receipt .amt { text-align: end; white-space: nowrap; }
.receipt svg.barcode { width: 100%; height: auto; max-height: 60px; }
.bc-labels { display: flex; flex-wrap: wrap; gap: 4mm; }
.bc-label { width: 50mm; border: 1px dashed #bbb; padding: 2mm; text-align: center; font-size: 11px; page-break-inside: avoid; color: #000; }
.bc-label svg.barcode { width: 100%; height: auto; }
.bc-label .n { font-weight: 700; }
.badge-card { width: 85mm; height: 54mm; border: 1px solid #999; border-radius: 3mm; padding: 4mm; display: flex; flex-direction: column; align-items: center; justify-content: space-between; color: #000; page-break-inside: avoid; }
.badge-card svg.barcode { width: 100%; height: auto; max-height: 22mm; }
.report-print h2 { margin: 0 0 6px; }
.report-print .report-info { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 12px; }
.report-print .card { break-inside: avoid; }
.request-sheet h3, .cheque-copy h3 { margin: 4px 0 8px; display: flex; gap: 8px; align-items: center; }
.signatures { display: flex; gap: 32px; margin: 36px 0 18px; break-inside: avoid; }
.sign-box { flex: 1; border: 1px solid #000; border-radius: 6px; padding: 10px 14px 14px; }
.sign-line { height: 34px; display: flex; align-items: flex-end; border-bottom: 1px dotted #000; padding-bottom: 2px; }
.hist { line-height: 1.45; white-space: nowrap; }
.grid .full { grid-column: 1 / -1; }
/* cheques */
.cheque-copy .table th { width: 32%; color: #000; }
/* queue printout: the counts and the signature at the bottom */
.queue-foot, .daily-foot { break-inside: avoid; margin-top: 12px; }
.queue-counts { display: flex; gap: 12px; flex-wrap: wrap; }
.queue-count { flex: 1; min-width: 140px; border: 2px solid currentColor; border-radius: 8px; padding: 8px 12px; text-align: center; }
.queue-count b { font-size: 26px; }
.queue-count.free { border-style: dashed; }
.inline-add { display: flex; gap: 8px; align-items: center; }
.checkin-gate { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 15px; }
.inline-add select { flex: 1; }
/* cash deposit slip */
.deposit-slip .table th, .deposit-slip .table td { padding: 5px 8px; }
.stats.compact { margin-bottom: 4px; gap: 10px; }
.stats.compact .stat { padding: 8px 12px; box-shadow: none; }
.stats.compact .value { font-size: 18px; }
.cheque-amount { text-align: center; padding: 10px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.cheque-amount .big { font-size: 24px; font-weight: 800; }
.invoice-picks { display: grid; gap: 6px; max-height: 190px; overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
/* the cheque leaf's own styles are in pages-cheques.js (CHEQUE_CSS), shared with its printed page */
.cheque-preview { overflow: auto; padding: 12px; background: var(--surface-2); border-radius: var(--radius); }
.cheque-preview .cheque-leaf { outline: 1px dashed #94a3b8; margin: 0 auto; box-shadow: var(--shadow); }
.layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.layout-table td { padding: 4px 8px; }
/* reports section */
.report-group { margin: 6px 0 10px; font-size: 15px; color: var(--muted); }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 18px; }
.report-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.report-card:hover { border-color: var(--primary); }
.report-card .ico { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.report-card .ico svg { width: 22px; height: 22px; }
.report-card b { display: block; margin-bottom: 2px; }
.report-card .d { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.report-desc { margin: -6px 0 14px; }
.report-note { padding: 8px 16px 0; }
.table tr.row-total td { font-weight: 800; border-top: 2px solid var(--border); background: var(--surface-2); }

@media print {
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  body { background: #fff; }
  @page { margin: 6mm; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .pos { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 260px; z-index: 60; transform: translateX(100%); transition: transform .2s; }
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  .sidebar.open, [dir="ltr"] .sidebar.open { transform: none; }
  .icon-btn.menu-toggle { display: grid; }
  .content { padding: 14px; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .perm-group .items { grid-template-columns: 1fr; }
  .plate-row { grid-template-columns: 1fr 1fr; }
  .plate-row > :last-child { grid-column: 1 / -1; }
  .topbar h1 { font-size: 16px; }
  .user-chip .name { display: none; }
  .user-chip { padding: 3px; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat .value { font-size: 18px; }
  .notif-panel { width: 92vw; }
  .board { grid-template-columns: repeat(4, 260px); }
}

/* ---------- employees: photo and ID picture ---------- */
.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; }

/* ---------- date fields: English digits and an English calendar ---------- */
.input.date-field { font-variant-numeric: tabular-nums; text-align: left; }
.input.date-field.invalid { border-color: var(--danger); background: var(--danger-50); }
.dp-pop { position: fixed; z-index: 300; width: 262px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(15,23,42,.18); padding: 10px; font-family: 'Segoe UI', Arial, sans-serif; font-size: 13px; color: var(--text); direction: ltr; }
.dp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dp-head select { flex: 1; padding: 4px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font: inherit; }
.dp-head b { flex: 1; text-align: center; }
.dp-pop button { border: 0; background: none; cursor: pointer; font: inherit; color: inherit; border-radius: 6px; }
.dp-head button { width: 28px; height: 28px; font-size: 18px; line-height: 1; }
.dp-pop button:hover { background: var(--primary-50); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp-grid i { font-style: normal; color: var(--muted); font-size: 11px; padding: 4px 0; }
.dp-grid button { height: 30px; }
.dp-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dp-months button { height: 36px; }
.dp-pop button.today { outline: 1px solid var(--primary); }
.dp-pop button.on { background: var(--primary); color: #fff; }
.dp-time { margin-top: 8px; }
.dp-time .input { width: 90px; margin-left: 6px; text-align: center; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; border-top: 1px solid var(--border); padding-top: 6px; }
.dp-foot button { padding: 4px 10px; color: var(--primary); font-weight: 600; }
/* ---------- salaries paid together by cheques ---------- */
.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; }
/* a WhatsApp message as it is sent */
.wa-text { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: inherit; font-size: 13px; line-height: 1.7; margin: 6px 0 0; direction: rtl; text-align: start; }
