/* =====================================================================
   نظام إدارة البلايستيشن - الواجهة
   ===================================================================== */
@font-face { font-family: 'Cairo'; src: url('fonts/Cairo-arabic.woff2') format('woff2'); font-weight: 200 1000; font-display: swap; 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: 'Cairo'; src: url('fonts/Cairo-latin.woff2') format('woff2'); font-weight: 200 1000; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #0a0f1d;
  --bg2: #0e1426;
  --card: #131b31;
  --card2: #182241;
  --line: #233154;
  --line2: #2d3d66;
  --text: #e8edf8;
  --muted: #8f9bbb;
  --faint: #5d6a8c;
  --accent: #4f8cff;
  --accent2: #8b5cf6;
  --grad: linear-gradient(135deg, #4f8cff, #8b5cf6);
  --ok: #22c55e;
  --ok-bg: rgba(34, 197, 94, .12);
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, .13);
  --bad: #ef4444;
  --bad-bg: rgba(239, 68, 68, .13);
  --info-bg: rgba(79, 140, 255, .13);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --r: 14px;
  --r-sm: 10px;
  --nav-w: 230px;
  --top-h: 60px;
  color-scheme: dark;
}
body.light {
  --bg: #eef2f9;
  --bg2: #e6ebf5;
  --card: #ffffff;
  --card2: #f5f7fc;
  --line: #dfe5f1;
  --line2: #cdd6e8;
  --text: #17203a;
  --muted: #5d6886;
  --faint: #95a0bb;
  --ok-bg: rgba(34, 197, 94, .12);
  --shadow: 0 8px 24px rgba(30, 45, 90, .10);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.b { font-weight: 700; }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
hr.sep { border: 0; border-top: 1px dashed var(--line2); margin: 12px 0; }

/* ---------- الهيكل العام ---------- */
.app { min-height: 100%; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: rgba(10, 15, 29, .82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
body.light .topbar { background: rgba(255, 255, 255, .85); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; white-space: nowrap; }
.brand .logo { width: 36px; height: 36px; border-radius: 11px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(79, 140, 255, .35); }
.brand .logo svg { width: 22px; height: 22px; fill: #fff; }
.topbar .burger { display: none; }
.shift-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; cursor: pointer; white-space: nowrap; }
.shift-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.shift-chip.off .dot { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); }
.clock { font-weight: 700; font-size: 15px; color: var(--muted); }
.userbtn { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 14px; }
.layout { display: flex; min-height: calc(100% - var(--top-h)); }
.sidenav {
  width: var(--nav-w); flex: 0 0 var(--nav-w); padding: 14px 10px; border-left: 1px solid var(--line);
  background: var(--bg2); position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto;
}
.sidenav .grp { font-size: 11.5px; color: var(--faint); margin: 14px 10px 6px; font-weight: 700; letter-spacing: .3px; }
.navlink { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 11px; color: var(--muted); font-weight: 600; transition: .15s; cursor: pointer; position: relative; }
.navlink:hover { background: var(--card); color: var(--text); }
.navlink.active { background: var(--info-bg); color: var(--text); }
.navlink.active::before { content: ''; position: absolute; right: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--grad); }
.navlink .ic { width: 22px; text-align: center; font-size: 17px; }
.navlink .badge { margin-right: auto; }
.main { flex: 1; min-width: 0; padding: 18px 20px 40px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: 21px; margin: 0; font-weight: 800; }
.page-head .sub { color: var(--muted); font-size: 13px; }

/* ---------- عناصر عامة ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h3 { margin: 0 0 12px; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card h3 .spacer { flex: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 11px; border: 1px solid var(--line2);
  background: var(--card2); color: var(--text); font-weight: 700; cursor: pointer; transition: .15s; white-space: nowrap; user-select: none;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(79, 140, 255, .28); }
.btn.ok { background: var(--ok); border-color: transparent; color: #052e14; }
.btn.danger { background: var(--bad); border-color: transparent; color: #fff; }
.btn.warn { background: var(--warn); border-color: transparent; color: #3a2402; }
.btn.ghost { background: transparent; }
.btn.soft-ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.btn.soft-bad { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
.btn.soft-warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.btn.soft { background: var(--info-bg); border-color: transparent; color: var(--accent); }
.btn.sm { padding: 5px 10px; border-radius: 9px; font-size: 13px; }
.btn.lg { padding: 13px 22px; font-size: 17px; border-radius: 13px; }
.btn.xl { padding: 16px 24px; font-size: 19px; border-radius: 15px; }
.btn.block { width: 100%; }
.btn.icon { padding: 7px 10px; }
.btn.busy { pointer-events: none; opacity: .7; }
.btn.busy::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-left-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 13px; color: var(--muted); font-weight: 700; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); outline: none; transition: .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 140, 255, .18); }
.input.lg { font-size: 22px; font-weight: 800; padding: 12px 14px; text-align: center; }
.input.num-in { direction: ltr; text-align: center; font-weight: 700; }
textarea.input { min-height: 70px; resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 42px; height: 24px; flex: 0 0 42px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line2); border-radius: 24px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; right: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(-18px); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card2); cursor: pointer; font-weight: 700; font-size: 14px; transition: .15s; user-select: none;
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--grad); border-color: transparent; color: #fff; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--card2); border: 1px solid var(--line2); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.info { background: var(--info-bg); color: var(--accent); border-color: transparent; }
.badge.violet { background: rgba(139, 92, 246, .15); color: #a78bfa; border-color: transparent; }
.pill-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; position: relative; overflow: hidden; }
.kpi .lbl { color: var(--muted); font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 25px; font-weight: 900; margin-top: 4px; letter-spacing: -.3px; }
.kpi .val small { font-size: 13px; color: var(--muted); font-weight: 700; margin-right: 3px; }
.kpi .hint { font-size: 12px; color: var(--faint); margin-top: 2px; }
.kpi.accent { background: var(--grad); border-color: transparent; color: #fff; }
.kpi.accent .lbl, .kpi.accent .hint, .kpi.accent .val small { color: rgba(255, 255, 255, .85); }
.kpi.okk .val { color: var(--ok); }
.kpi.badk .val { color: var(--bad); }

table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { text-align: right; color: var(--muted); font-weight: 700; font-size: 12.5px; padding: 9px 10px; border-bottom: 1px solid var(--line2); white-space: nowrap; position: sticky; top: 0; background: var(--card); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--card2); }
.tbl tr.click { cursor: pointer; }
.tbl tfoot td { font-weight: 800; border-top: 2px solid var(--line2); border-bottom: 0; }
.tbl .n { text-align: left; direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl-wrap { overflow: auto; border-radius: var(--r-sm); }
.tbl td.small { white-space: nowrap; }
.tbl-wrap.max { max-height: 62vh; }
.empty { text-align: center; color: var(--faint); padding: 28px 10px; }
.empty .big { font-size: 34px; display: block; margin-bottom: 6px; }

.notice { padding: 11px 14px; border-radius: 12px; background: var(--info-bg); border: 1px solid rgba(79, 140, 255, .25); font-size: 14px; }
.notice.warn { background: var(--warn-bg); border-color: rgba(245, 158, 11, .3); }
.notice.bad { background: var(--bad-bg); border-color: rgba(239, 68, 68, .3); }
.notice.ok { background: var(--ok-bg); border-color: rgba(34, 197, 94, .3); }

.lines { display: flex; flex-direction: column; }
.line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.line:last-child { border-bottom: 0; }
.line .v { font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; white-space: nowrap; }
.line.total { font-size: 18px; border-top: 2px solid var(--line2); border-bottom: 0; margin-top: 4px; padding-top: 10px; }
.line.minus .v { color: var(--bad); }
.line.plus .v { color: var(--ok); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { padding: 9px 14px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 800; cursor: pointer; white-space: nowrap; }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }

.range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.range .input { width: auto; padding: 7px 10px; }

/* ---------- الشارتات ---------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 8px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bars .b .fill { width: 100%; max-width: 38px; border-radius: 7px 7px 3px 3px; background: var(--grad); min-height: 2px; transition: height .4s ease; position: relative; }
.bars .b .fill.alt { background: linear-gradient(180deg, #22c55e, #16a34a); }
.bars .b .fill:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -6px); background: #000c; color: #fff; padding: 3px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap; z-index: 3; }
.bars .b .x { font-size: 11px; color: var(--faint); margin-top: 5px; white-space: nowrap; }
.hbar { display: flex; align-items: center; gap: 10px; margin: 7px 0; font-size: 14px; }
.hbar .name { width: 150px; flex: 0 0 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { flex: 1; height: 10px; border-radius: 6px; background: var(--card2); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 6px; background: var(--grad); }
.hbar .v { width: 110px; text-align: left; font-weight: 800; direction: ltr; font-variant-numeric: tabular-nums; }

/* ---------- شاشة الأجهزة (الكاشير) ---------- */
.pos-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.pos-bar .info { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 16px; flex: 1; min-width: 280px; }
.pos-bar .info .it { display: flex; flex-direction: column; line-height: 1.25; }
.pos-bar .info .it b { font-size: 18px; font-variant-numeric: tabular-nums; }
.pos-bar .info .it span { font-size: 12px; color: var(--muted); font-weight: 700; }
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 14px; }
.room {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; cursor: pointer;
  transition: transform .15s, box-shadow .2s, border-color .2s; overflow: hidden; min-height: 196px; display: flex; flex-direction: column; user-select: none;
}
.room:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line2); }
.room .top { display: flex; align-items: center; gap: 8px; }
.room .name { font-size: 19px; font-weight: 900; }
.room .kind { margin-right: auto; }
.room .pad { position: absolute; left: -14px; bottom: -18px; width: 120px; height: 120px; opacity: .06; }
.room .pad svg { width: 100%; height: 100%; fill: currentColor; }
.room .body { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 8px 0; }
.room .timer { font-size: 34px; font-weight: 900; letter-spacing: 1px; font-variant-numeric: tabular-nums; direction: ltr; line-height: 1.1; }
.room .tlabel { font-size: 12px; color: var(--muted); font-weight: 700; }
.room .cost { font-size: 15px; font-weight: 800; color: var(--muted); }
.room .cost b { color: var(--text); font-size: 20px; }
.room .foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 26px; }
.room .free-cta { font-size: 15px; font-weight: 800; color: var(--ok); display: flex; align-items: center; gap: 8px; }
.room .free-cta .plus { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: var(--ok-bg); transition: .2s; }
.room:hover .free-cta .plus { transform: scale(1.08) rotate(90deg); }
.room.busy { border-color: transparent; background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box; border: 2px solid transparent; }
.room.busy .timer { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.room.soon { background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(135deg, #f59e0b, #f97316) border-box; }
.room.soon .timer { background: linear-gradient(135deg, #f59e0b, #f97316); -webkit-background-clip: text; background-clip: text; }
.room.over { background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(135deg, #ef4444, #f43f5e) border-box; animation: pulse 1.2s ease-in-out infinite; }
.room.over .timer { background: linear-gradient(135deg, #ef4444, #f43f5e); -webkit-background-clip: text; background-clip: text; }
.room.over.ack { animation: none; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); } 50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } }
.room.off { opacity: .45; cursor: default; }

/* ---------- النوافذ المنبثقة ---------- */
.overlay { position: fixed; inset: 0; background: rgba(3, 6, 15, .62); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); border: 1px solid var(--line2); border-radius: 20px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0, 0, 0, .5); animation: pop .18s ease; }
.modal.wide { max-width: 860px; }
.modal.xwide { max-width: 1120px; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.modal .mh { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.modal .mh h2 { margin: 0; font-size: 18px; font-weight: 900; }
.modal .mh .x { margin-right: auto; width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--card2); cursor: pointer; font-size: 18px; color: var(--muted); }
.modal .mb { padding: 16px 18px; overflow-y: auto; }
.modal .mf { padding: 12px 18px 16px; display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; border-top: 1px solid var(--line); }
.modal .mf .btn { min-width: 110px; }
.confirm-amt { font-size: 34px; font-weight: 900; text-align: center; margin: 8px 0; direction: ltr; }

/* لوحة الجلسة (نافذة كبيرة) */
.sess { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; }
.sess .bill { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.sess .hero { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--grad); color: #fff; margin-bottom: 12px; }
.sess .hero .t { font-size: 34px; font-weight: 900; direction: ltr; font-variant-numeric: tabular-nums; line-height: 1; }
.sess .hero .lbl { font-size: 12px; opacity: .85; font-weight: 700; }
.sess .hero .due { margin-right: auto; text-align: left; }
.sess .hero .due b { font-size: 28px; display: block; line-height: 1.1; direction: ltr; }
.sess .acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.sess .acts .btn { padding: 10px 6px; font-size: 14px; flex-direction: column; gap: 2px; }
.sess .acts .btn .e { font-size: 19px; }
.item-line { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.item-line .nm { flex: 1; font-weight: 700; min-width: 0; }
.item-line .q { font-weight: 900; min-width: 26px; text-align: center; }
.item-line .t { font-weight: 800; min-width: 64px; text-align: left; direction: ltr; }
.qbtn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line2); background: var(--card2); cursor: pointer; font-weight: 900; display: grid; place-items: center; }
.qbtn:hover { border-color: var(--accent); }
.qbtn.minus:hover { border-color: var(--bad); color: var(--bad); }

.prod-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; max-height: 50vh; overflow-y: auto; padding: 2px; }
.prod { background: var(--card2); border: 1px solid var(--line); border-radius: 13px; padding: 10px 8px; cursor: pointer; text-align: center; transition: .12s; position: relative; user-select: none; }
.prod:hover { border-color: var(--accent); transform: translateY(-2px); }
.prod:active { transform: scale(.97); }
.prod .pn { font-weight: 800; font-size: 14px; line-height: 1.3; min-height: 36px; display: flex; align-items: center; justify-content: center; }
.prod .pp { color: var(--accent); font-weight: 900; font-size: 15px; }
.prod .ps { font-size: 11px; color: var(--faint); }
.prod.out { opacity: .4; pointer-events: none; }
.prod.low .ps { color: var(--warn); font-weight: 800; }
.prod .added { position: absolute; top: 6px; left: 6px; }
.flash-add { animation: flashadd .45s ease; }
@keyframes flashadd { 0% { background: var(--ok-bg); border-color: var(--ok); } }

.typepick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.typepick .opt { border: 2px solid var(--line2); border-radius: 16px; padding: 16px; text-align: center; cursor: pointer; transition: .15s; background: var(--card2); }
.typepick .opt:hover { border-color: var(--accent); }
.typepick .opt.on { border-color: transparent; background: var(--grad); color: #fff; }
.typepick .opt .e { font-size: 30px; }
.typepick .opt .t { font-size: 18px; font-weight: 900; }
.typepick .opt .p { font-size: 13px; opacity: .85; }

.cashpad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.change-box { text-align: center; padding: 12px; border-radius: 14px; background: var(--ok-bg); color: var(--ok); font-weight: 900; font-size: 22px; }
.change-box.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- الإشعارات ---------- */
.toasts { position: fixed; bottom: 18px; left: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { background: var(--card); border: 1px solid var(--line2); border-right: 4px solid var(--accent); border-radius: 12px; padding: 11px 14px; box-shadow: var(--shadow); font-weight: 700; animation: slidein .2s ease; }
.toast.ok { border-right-color: var(--ok); }
.toast.bad { border-right-color: var(--bad); }
.toast.warn { border-right-color: var(--warn); }
@keyframes slidein { from { transform: translateX(-20px); opacity: 0; } }
/* نسخة تجريبية: إطار أحمر + لافتة (بس لو الإعدادات فيها trial_banner) */
body[data-trial]::after { content: ''; position: fixed; inset: 0; border: 3px solid #e11d48; pointer-events: none; z-index: 400; }
body[data-trial]::before { content: attr(data-trial); position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 401; pointer-events: none; background: #e11d48; color: #fff; font-size: 12px; font-weight: 800; line-height: 1.6; padding: 1px 14px 3px; border-radius: 0 0 10px 10px; white-space: nowrap; box-shadow: 0 4px 14px rgba(225, 29, 72, .35); }
@media (max-width: 640px) { body[data-trial]::before { content: 'نسخة تجريبية'; font-size: 11px; } }
.netbar { position: fixed; top: 0; left: 0; right: 0; z-index: 300; background: var(--bad); color: #fff; text-align: center; padding: 6px; font-weight: 800; font-size: 14px; }

/* ---------- الدخول ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 80% -10%, rgba(139, 92, 246, .25), transparent), radial-gradient(900px 500px at 0% 110%, rgba(79, 140, 255, .22), transparent), var(--bg); }
.login { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line2); border-radius: 24px; padding: 28px 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.login .logo-big { width: 68px; height: 68px; border-radius: 20px; background: var(--grad); display: grid; place-items: center; margin: 0 auto 12px; box-shadow: 0 12px 30px rgba(79, 140, 255, .4); }
.login .logo-big svg { width: 40px; height: 40px; fill: #fff; }
.login h1 { text-align: center; margin: 0 0 4px; font-size: 22px; }
.login p.sub { text-align: center; color: var(--muted); margin: 0 0 20px; }
.login .input { padding: 13px 14px; font-size: 16px; }

/* ---------- القوائم المنسدلة ---------- */
.menu { position: fixed; z-index: 150; background: var(--card); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; min-width: 200px; animation: pop .12s ease; }
.menu .mi { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-weight: 700; }
.menu .mi:hover { background: var(--card2); }
.menu .mi.danger { color: var(--bad); }
.menu .sep { height: 1px; background: var(--line); margin: 4px 0; }

/* ---------- الطباعة ---------- */
@media print { body * { visibility: hidden; } }

/* ---------- الشاشات الصغيرة ---------- */
@media (max-width: 980px) {
  .sess { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  body { overflow-x: hidden; }
  .topbar { gap: 8px; padding: 0 10px; }
  .topbar .burger { display: inline-flex; }
  .userbtn { padding: 3px; }
  .userbtn .b, .userbtn .badge { display: none; }
  .shift-chip { min-width: 0; flex: 1 1 auto; overflow: hidden; }
  #shifttext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; min-width: 0; }
  .topbar .spacer { display: none; }
  .sidenav:not(.open) { visibility: hidden; }
  .sidenav { position: fixed; top: var(--top-h); right: 0; z-index: 40; height: calc(100vh - var(--top-h)); transform: translateX(105%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidenav.open { transform: none; }
  .main { padding: 14px 12px 40px; }
  .clock, .brand .nm { display: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .rooms { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .room { min-height: 165px; padding: 12px; }
  .room .timer { font-size: 26px; }
  .modal { border-radius: 18px 18px 0 0; max-height: 94vh; }
  .overlay { align-items: flex-end; padding: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .val { font-size: 20px; }
  .hbar .name { width: 95px; flex-basis: 95px; }
}

/* شبكة الدورات */
.cycgrid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 820px) { .cycgrid { grid-template-columns: 1fr; } }
.perm-tbl td:nth-child(n+2), .perm-tbl th:nth-child(n+2) { text-align: center; width: 110px; }
