/* لوحة المحل: شريط جانبي + هيدر ثابت + محتوى. على الموبايل الشريط بيبقى درج. كل الألوان من الثيم (assets/brand.css). */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
/* لون الشريط الجانبي ممدود لآخر الصفحة حتى لو المحتوى أطول من الشاشة */
@media (min-width: 961px) { .shell { background: linear-gradient(to left, var(--side) 251px, var(--sideLine) 251px 252px, var(--bg) 252px); } }
.side { background: var(--side); color: var(--sideInk); border-inline-end: 1px solid var(--sideLine); position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 22px 14px 14px; gap: 2px; z-index: 40; scrollbar-width: thin; }
.brand { padding: 2px 10px 20px; display: flex; flex-direction: column; gap: 2px; }
.brand .wordmark { font-size: 20px; color: var(--sideInk); }
.brand small { font-size: 12.5px; color: var(--sideMuted); }
:root[data-theme="onyx"] .brand .wordmark { color: var(--accentInk); }
.navlink { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--sideMuted); font-size: 14.5px; }
.navlink:hover { background: color-mix(in srgb, var(--sideInk) 7%, transparent); color: var(--sideInk); text-decoration: none; }
.navlink.on { background: var(--sideOn); color: var(--sideOnInk); font-weight: 600; }
.navlink.on svg { color: inherit; }
:root[data-theme="emerald"] .navlink.on::before { content: ''; position: absolute; inset-inline-start: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--sideMark); }
.navlink .badge { margin-inline-start: auto; background: var(--danger); color: var(--surface); }
:root[data-theme="onyx"] .navlink .badge { background: var(--accent); color: var(--onAccent); }
:root[data-theme="onyx"] .navlink.on .badge { background: var(--onAccent); color: var(--accent); }
.side .me { font-size: 13px; color: var(--sideMuted); padding: 12px 10px; border-top: 1px solid var(--sideLine); margin-top: 8px; }
.side .me b { display: block; color: var(--sideInk); font-weight: 600; }
.main { min-width: 0; padding: 0 32px 56px; }
.top { position: sticky; top: 0; z-index: 30; background: var(--bg); display: flex; align-items: center; gap: 12px; padding: 18px 0 16px; margin-bottom: 22px; }
.top .ttl { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top h1 { margin: 0; font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--headerInk); }
.top .sub { color: var(--headerMuted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.top-actions select { width: auto; min-height: 42px; font-size: 14px; padding: 6px 10px; }
:root[data-theme="onyx"] .top, :root[data-theme="crystal"] .top { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
:root[data-theme="onyx"] .top .theme-btn, :root[data-theme="onyx"] .top .btn.ghost { border-radius: 50%; }
:root[data-theme="crystal"] .top .theme-btn { border-color: transparent; box-shadow: var(--shadow); }
/* زمرد: الهيدر شريط أخضر كامل وتحته عمود الكوافير */
:root[data-theme="emerald"] .top { background: var(--headerBg); margin: 0 -32px 30px; padding: 20px 32px 18px; }
:root[data-theme="emerald"] .top::after { content: ''; position: absolute; inset-inline: 0; bottom: -7px; height: 7px; background: var(--pole); opacity: .92; }
:root[data-theme="emerald"] .top h1 { font-size: 27px; }
:root[data-theme="emerald"] .top .theme-btn, :root[data-theme="emerald"] .top .btn.ghost { background: transparent; color: var(--headerInk); border-color: var(--headerLine); }
:root[data-theme="emerald"] .top .theme-btn:hover, :root[data-theme="emerald"] .top .btn.ghost:hover { background: color-mix(in srgb, var(--headerInk) 10%, transparent); }
:root[data-theme="emerald"] .top .theme-btn .theme-dot { box-shadow: 0 0 0 2px var(--headerBg); }
:root[data-theme="emerald"] .top-actions select { background: transparent; color: var(--headerInk); border-color: var(--headerLine); }
:root[data-theme="emerald"] .top-actions select option { color: var(--ink); background: var(--surface); }
:root[data-theme="emerald"] .top .bell .badge { box-shadow: 0 0 0 2px var(--headerBg); }
.menu-btn { display: none !important; }
.scrim { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 280px; transform: translateX(100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 35; }
  .menu-btn { display: inline-flex !important; }
  .main { padding: 0 16px 40px; }
  .top { padding: 12px 0; margin-bottom: 16px; gap: 8px; }
  .top h1 { font-size: 20px; }
  :root[data-theme="emerald"] .top { margin: 0 -16px 24px; padding: 12px 16px; }
  :root[data-theme="emerald"] .top h1 { font-size: 22px; }
  .top .theme-btn, .top .btn.icon { width: 40px; height: 40px; min-width: 40px; }
}
@media (max-width: 560px) { .top-actions select { max-width: 112px; } .top-actions { gap: 6px; } }
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .field { margin: 0; }
.toolbar .grow { flex: 1; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 28px 0 12px; }
.section-title h2 { margin: 0; }
:root[data-theme="emerald"] .section-title h2 { font-size: 21px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sec-h h3 { margin: 0; font-size: 16px; }
.sec-h a { font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 2px; }
.sec-h a svg { width: 15px; height: 15px; }
:root[data-theme="emerald"] .sec-h h3 { font-size: 19px; display: flex; align-items: center; gap: 10px; flex: 1; }
:root[data-theme="emerald"] .sec-h h3::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---- الجرس */
.bell { position: relative; }
.bell .badge { position: absolute; top: -4px; inset-inline-end: -4px; box-shadow: 0 0 0 2px var(--bg); }
.bell-panel { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: 360px; max-height: 70vh; overflow: auto; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm); z-index: 45; box-shadow: var(--shadow-lg); }
.bell-panel header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.note { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.note:hover { background: var(--surface2); }
.note .t { font-weight: 500; }
.note .b { color: var(--muted); font-size: 13px; }
.note.unread .t::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); margin-inline-start: 6px; vertical-align: 2px; }
.note svg { color: var(--muted); margin-top: 3px; }
@media (max-width: 560px) { .bell-panel { position: fixed; top: 64px; inset-inline: 10px; width: auto; } }

/* ---- الرئيسية: كارت الرقم الكبير + كروت الأرقام */
.home-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 1100px) { .home-top { grid-template-columns: minmax(0, 1fr); } }
.hero-card { position: relative; overflow: hidden; border-radius: calc(var(--r) + 4px); padding: 24px 26px; background: var(--hero); border: 1px solid var(--heroLine); color: var(--heroText);
  display: flex; flex-direction: column; gap: 4px; min-height: 230px; isolation: isolate; }
.hero-card .hc-l { font-size: 14px; color: var(--heroMuted); }
.hero-card .hc-big { display: flex; align-items: baseline; gap: 8px; color: var(--heroInk); margin: 2px 0 8px; direction: rtl; }
.hero-card .hc-big .num { font-size: 52px; font-weight: 600; line-height: 1.1; letter-spacing: -1px; font-family: var(--font-head); }
.hero-card .hc-big small { font-size: 18px; color: var(--heroMuted); }
.hc-delta { align-self: flex-start; display: inline-flex; gap: 6px; align-items: center; font-size: 13px; padding: 5px 12px; border-radius: 999px; background: var(--okBg); color: var(--ok); }
.hc-delta b { font-weight: 600; }
.hc-delta.down { background: var(--dangerBg); color: var(--danger); }
/* أونيكس: لمعة دهبي ومنحنى */
:root[data-theme="onyx"] .hero-card::after { content: ''; position: absolute; z-index: -1; top: -45%; inset-inline-start: -20%; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(201, 163, 91, .2), transparent 65%); }
.hc-spark { margin-top: auto; padding-top: 10px; }
.hs { display: block; width: 100%; height: 92px; overflow: visible; }
.hs stop { stop-color: var(--accent); stop-opacity: .35; } .hs stop + stop { stop-opacity: 0; }
.hs .hs-a { fill: url(#hsg); }
.hs .hs-l { fill: none; stroke: var(--accentInk); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.hs .hs-d { fill: var(--heroInk); stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
/* كريستال: دواير شفافة وحبوب */
:root[data-theme="crystal"] .hero-card { box-shadow: 0 18px 40px -20px rgba(23, 71, 255, .65); }
:root[data-theme="crystal"] .hero-card::before { content: ''; position: absolute; z-index: -1; width: 300px; height: 300px; border-radius: 50%; background: var(--heroSoft); inset-inline-end: -80px; bottom: -150px; }
:root[data-theme="crystal"] .hero-card::after { content: ''; position: absolute; z-index: -1; width: 190px; height: 190px; border-radius: 50%; background: var(--heroSoft); inset-inline-end: 60px; top: -110px; }
.hc-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 10px; }
.hc-pills span { background: var(--heroSoft); border-radius: var(--r-sm); padding: 7px 13px; font-size: 13px; }
.hc-pills b { font-weight: 600; }
/* زمرد: كارت تذكرة بخط متقطع وتلات أعمدة */
:root[data-theme="emerald"] .hero-card { box-shadow: var(--shadow-lg); border-radius: var(--r); }
:root[data-theme="emerald"] .hero-card .hc-big .num { font-size: 56px; letter-spacing: 0; }
.hc-split { display: flex; border-top: 1.5px dashed var(--line); margin-top: auto; padding-top: 14px; }
.hc-split > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hc-split > div + div { border-inline-start: 1px solid var(--line); padding-inline-start: 14px; }
.hc-split small { font-size: 12.5px; color: var(--heroMuted); }
.hc-split b { font-size: 19px; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stats.n3 > :first-child { grid-column: 1 / -1; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stats.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .stats.n3 > :first-child { grid-column: auto; } }
@media (max-width: 760px) { .stats, .stats.n3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats.n3 > :first-child { grid-column: 1 / -1; } }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; }
.stat .st-ic { width: 38px; height: 38px; border-radius: var(--r-xs); display: grid; place-items: center; margin-bottom: 10px; background: var(--surface2); color: var(--muted); }
.stat .st-ic svg { width: 19px; height: 19px; }
.stat.c-ok .st-ic { background: var(--okBg); color: var(--ok); } .stat.c-late .st-ic { background: var(--lateBg); color: var(--late); }
.stat.c-res .st-ic { background: var(--resBg); color: var(--res); } .stat.c-busy .st-ic { background: var(--busyBg); color: var(--busy); }
.stat .st-l { color: var(--muted); font-size: 13px; }
.stat .st-v { font-size: 26px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat .st-v small { font-size: 14px; font-weight: 400; color: var(--muted); }
:root[data-theme="emerald"] .stat .st-v { font-family: var(--font-head); color: var(--accent); }
.stat .st-s { font-size: 12.5px; color: var(--muted); margin-top: auto; padding-top: 4px; }
.stat .bar { margin-top: 6px; } .stat .bar > i { background: var(--res); }
.mbars { display: flex; gap: 4px; align-items: flex-end; height: 28px; margin-top: 8px; }
.mbars i { flex: 1; border-radius: 4px; background: var(--okBg); }
.mbars i.h { background: var(--ok); }
:root[data-theme="onyx"] .stat .st-ic { border-radius: 50%; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi .v { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.kpi .v small { font-size: 14px; font-weight: 400; }
.kpi .s { font-size: 12.5px; color: var(--muted); }
.delta { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }

/* ---- «شغّال دلوقتي» + زرار المهمة الأساسية */
.home-mid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: stretch; }
.home-mid.one { grid-template-columns: minmax(0, 1fr); }
.home-mid > #liveBox:empty { display: none; }
.home-mid > #liveBox > .card { height: 100%; }
@media (max-width: 1100px) { .home-mid { grid-template-columns: minmax(0, 1fr); } }
.live-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.lc { flex: 1 0 84px; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink); text-align: center; padding: 4px 2px; border-radius: var(--r-sm); }
.lc:hover { text-decoration: none; background: var(--surface2); }
.lc b { font-size: 13.5px; font-weight: 600; margin-top: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc small { font-size: 12px; }
.lc small.st-late { color: var(--late); font-weight: 600; } .lc small.st-free { color: var(--ok); }
.cta-card { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow); }
.cta-card:hover { text-decoration: none; border-color: var(--accent); }
.cta-card b { display: block; font-size: 17px; font-weight: 600; font-family: var(--font-head); }
.cta-card small { display: block; font-size: 13px; color: var(--muted); }
.cta-n { width: 52px; height: 52px; border-radius: var(--r-sm); background: var(--lateBg); color: var(--late); display: grid; place-items: center; font-size: 22px; font-weight: 700; flex: none; }
.cta-go { display: inline-flex; align-items: center; gap: 4px; background: var(--ink); color: var(--surface); border-radius: var(--r-sm); padding: 10px 16px; font-weight: 600; font-size: 14px; flex: none; }
.cta-go svg { width: 16px; height: 16px; }
:root[data-theme="crystal"] .cta-card { border-color: transparent; }
:root[data-theme="onyx"] .cta-card { background: var(--accent); color: var(--onAccent); border-color: var(--accent); }
:root[data-theme="onyx"] .cta-card small { color: var(--onAccent); opacity: .72; }
:root[data-theme="onyx"] .cta-card .cta-n { display: none; }
:root[data-theme="onyx"] .cta-go { width: 46px; height: 46px; border-radius: 50%; padding: 0; justify-content: center; background: var(--onAccent); color: var(--accent); }
:root[data-theme="onyx"] .cta-go svg { width: 20px; height: 20px; }
:root[data-theme="emerald"] .cta-card { border-inline-start: 6px solid var(--busy); }
:root[data-theme="emerald"] .cta-n { background: var(--busyBg); color: var(--busy); font-family: var(--font-head); }
:root[data-theme="emerald"] .cta-go { background: var(--accent); color: var(--onAccent); }

.spark { position: relative; }
.spark svg { display: block; width: 100%; height: 170px; overflow: visible; }
.spark .area { fill: var(--accent); opacity: .12; }
.spark .ln { fill: none; stroke: var(--accent); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.spark .xl { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); direction: ltr; margin-top: 6px; font-variant-numeric: tabular-nums; }
.spark .yl { position: absolute; inset-inline-start: 0; font-size: 11.5px; color: var(--muted); background: var(--surface); padding-inline-end: 6px; transform: translateY(-50%); }
:root[data-theme="onyx"] .spark .ln { stroke: var(--accentInk); }
.hbars { display: flex; align-items: stretch; gap: 6px; height: 196px; direction: ltr; background: var(--surface2); border-radius: var(--r-sm); padding: 14px 12px 8px; }
.hbars .hb { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.hbars .hb i { width: 100%; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--muted) 35%, var(--surface)); }
.hbars .hb.now i { background: var(--accent); }
.hbars .hb.fut i { opacity: .35; }
.hbars small { font-size: 10.5px; color: var(--muted); height: 15px; white-space: nowrap; }
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: flex-start; }
.alerts li:last-child { border-bottom: 0; }
.alerts .warn svg { color: var(--late); } .alerts .info svg { color: var(--muted); } .alerts .danger svg { color: var(--danger); }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 500; box-shadow: var(--shadow); }
:root[data-theme="crystal"] .quick a { border-color: transparent; }
.quick a:hover { border-color: var(--accent); text-decoration: none; }
.quick .q-ic { width: 38px; height: 38px; border-radius: var(--r-xs); display: grid; place-items: center; background: var(--accentSoft); color: var(--accentInk); flex: none; }
.quick .q-ic svg { width: 19px; height: 19px; }
@media (max-width: 860px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mini-floor { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13.5px; }
.mini-floor span { display: inline-flex; align-items: center; gap: 6px; }

/* ---- كروت التأكيد (فاتورة) */
.entries { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
@media (max-width: 560px) { .entries { grid-template-columns: minmax(0, 1fr); } }
.entry { display: flex; flex-direction: column; gap: 12px; position: relative; }
.entry .who { font-weight: 600; font-size: 16px; }
.entry ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.entry li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.entry .times { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13.5px; color: var(--muted); }
.entry .times b { color: var(--ink); font-weight: 500; }
.entry footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.entry .total { font-size: 18px; font-weight: 600; }
.rc-card { padding: 20px; gap: 14px; }
.rc-who { display: flex; align-items: center; gap: 12px; }
.rc-who .av { width: 50px; height: 50px; font-size: 20px; }
.rc-who b { display: block; font-size: 17px; font-weight: 600; font-family: var(--font-head); }
.rc-who small { display: block; font-size: 13px; }
.rc-who .chip { align-self: flex-start; }
.rc-times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rc-times > div { background: var(--surface2); border-radius: var(--r-sm); padding: 9px 8px; text-align: center; display: flex; flex-direction: column; }
.rc-times small { font-size: 11.5px; color: var(--muted); }
.rc-times b { font-size: 16px; font-weight: 600; }
.rc-times .ok { background: var(--okBg); color: var(--ok); } .rc-times .ok small { color: inherit; }
.rc-times .late { background: var(--lateBg); color: var(--late); } .rc-times .late small { color: inherit; }
.entry .rc-items { border-top: 0; }
.entry .rc-items li { padding: 11px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; gap: 12px; }
.rc-items li > div > b { font-weight: 500; font-size: 15px; display: block; }
.rc-items li small { font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 2px; }
.rc-items li > b.num { font-weight: 600; font-size: 15px; }
.rc-ln { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.rc-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.rc-total > span { color: var(--muted); font-size: 14px; }
.rc-total > b { font-size: 28px; font-weight: 600; font-family: var(--font-head); }
.rc-total > b .money small { font-size: 15px; font-weight: 400; color: var(--muted); }
:root[data-theme="onyx"] .rc-total > b { color: var(--heroInk); }
:root[data-theme="emerald"] .rc-total > b { color: var(--accent); }
.rc-acts { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.rc-acts .btn.ghost { border-color: var(--line); }
/* الكارت اللي جاي من إشعار */
.entry.focus-hl { box-shadow: 0 0 0 3px var(--accentSoft), 0 0 0 1.5px var(--accent); }
/* «تعديل» شغلانة مستنية */
.ed-rows { display: flex; flex-direction: column; gap: 6px; }
.ed-add { margin-top: 10px; }
.ed-add summary { cursor: pointer; color: var(--accentInk); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; }
.ed-add .vo-cat { margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: minmax(0, 1fr); } .rc-acts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .rc-acts [data-approve] { grid-column: 1 / -1; } }
.rc-acts .btn { width: 100%; }
:root[data-theme="onyx"] .rc-acts .btn.danger { background: var(--surface2); border-color: var(--line); }
/* زمرد: ختم مايل «في الميعاد» / «متأخر» */
.stamp { position: absolute; top: 66px; inset-inline-end: 22px; transform: rotate(-12deg); border: 2px solid currentColor; border-radius: 10px; padding: 1px 10px; font-family: var(--font-head);
  font-weight: 700; font-size: 14px; color: var(--ok); opacity: .85; pointer-events: none; background: var(--surface); }
.stamp.late { color: var(--late); }
:root[data-theme="emerald"] .rc-card { border-top: 4px solid var(--accent); }
:root[data-theme="emerald"] .rc-card .rc-who .chip { display: none; }
:root[data-theme="emerald"] .rc-card .rc-times { margin-top: 18px; }
.pay-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 10px; margin-bottom: 8px; }
.pay-row label { font-size: 14px; }
.sum-box { background: var(--surface2); border-radius: var(--r-sm); padding: 6px 14px; margin-top: 10px; }

/* ---- صالة الكراسي */
.floor { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
@media (max-width: 560px) { .floor { grid-template-columns: minmax(0, 1fr); } }
.chair-card { position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "av main side"; gap: 14px; align-items: center; padding: 16px; }
.chair-card .cc-av { grid-area: av; display: grid; }
.chair-card .cc-main { grid-area: main; min-width: 0; }
.chair-card .cc-side { grid-area: side; text-align: end; display: flex; flex-direction: column; align-items: flex-end; min-width: 56px; }
.chair-card .cc-side b { font-size: 26px; font-weight: 600; line-height: 1.1; font-family: var(--font-head); }
.chair-card .cc-side small { font-size: 11.5px; color: var(--muted); }
.chair-card.st-late .cc-side b, .chair-card.st-late .cc-side small { color: var(--late); }
.chair-card h3 { margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chair-card .cc-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.chair-card .cc-chip, .chair-card .cc-bar, .chair-card .cc-ft { display: none; }
.cc-q { display: flex; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.cc-q i { width: 22px; height: 22px; border-radius: 50%; background: var(--surface2); color: var(--muted); display: grid; place-items: center; font-style: normal; font-size: 10px; box-shadow: 0 0 0 2px var(--surface); }
.cc-q i + i { margin-inline-start: -6px; }
.cc-q i svg { width: 12px; height: 12px; }
.cc-q span { margin-inline-start: 8px; } .cc-q b { color: var(--ink); font-weight: 600; }
.chair-card .next { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: flex; gap: 5px; align-items: center; }
.chair-card .next svg { width: 14px; height: 14px; }
.cc-seat { width: 56px; height: 56px; border-radius: var(--r-sm); background: var(--surface2); display: grid; place-items: center; color: var(--muted); }
.cc-seat svg { width: 28px; height: 28px; }
.st-busy .cc-seat { color: var(--busy); } .st-late .cc-seat { color: var(--late); } .st-free .cc-seat { color: var(--ok); } .st-reserved .cc-seat { color: var(--res); }
.chair-card.st-closed { opacity: .7; }
/* زمرد: شريط لون الحالة على الطرف */
:root[data-theme="emerald"] .chair-card::before { content: ''; position: absolute; inset-block: 0; inset-inline-end: 0; width: 6px; background: var(--line); }
:root[data-theme="emerald"] .chair-card.st-busy::before { background: var(--busy); } :root[data-theme="emerald"] .chair-card.st-late::before { background: var(--late); }
:root[data-theme="emerald"] .chair-card.st-free::before { background: var(--ok); } :root[data-theme="emerald"] .chair-card.st-reserved::before { background: var(--res); }
:root[data-theme="emerald"] .chair-card .cc-side b { color: var(--accent); }
:root[data-theme="emerald"] .chair-card.st-late .cc-side b { color: var(--late); }
:root[data-theme="onyx"] .chair-card.st-late { border-color: color-mix(in srgb, var(--late) 35%, var(--line)); }
/* كريستال: شبكة كروت فيها أفاتار مربع + شارة + شريط تقدم */
:root[data-theme="crystal"] .floor { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@media (max-width: 560px) { :root[data-theme="crystal"] .floor { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
:root[data-theme="crystal"] .chair-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "av" "main" "bar" "ft"; gap: 10px; align-items: start; padding: 16px; }
:root[data-theme="crystal"] .chair-card .cc-side { display: none; }
:root[data-theme="crystal"] .chair-card .cc-chip { display: inline-flex; position: absolute; top: 16px; inset-inline-end: 16px; }
:root[data-theme="crystal"] .chair-card .cc-chip::before { display: none; }
:root[data-theme="crystal"] .chair-card .ring svg { display: none; }
:root[data-theme="crystal"] .chair-card .ring > .av { width: 100%; height: 100%; font-size: 22px; border-radius: 30%; }
:root[data-theme="crystal"] .chair-card h3 { white-space: normal; }
:root[data-theme="crystal"] .chair-card .cc-bar { display: block; grid-area: bar; }
:root[data-theme="crystal"] .chair-card .cc-bar > i { background: var(--busy); }
:root[data-theme="crystal"] .chair-card.st-late .cc-bar > i { background: var(--late); }
:root[data-theme="crystal"] .chair-card .cc-ft { display: flex; grid-area: ft; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
:root[data-theme="crystal"] .chair-card .cc-ft b { color: var(--ink); font-weight: 600; }
:root[data-theme="crystal"] .chair-card.st-late .cc-ft > span:first-child b { color: var(--late); }
:root[data-theme="crystal"] .chair-card .cc-q span { display: none; }
@media (max-width: 560px) { :root[data-theme="crystal"] .chair-card { padding: 14px 12px; } :root[data-theme="crystal"] .chair-card .cc-chip { top: 12px; inset-inline-end: 12px; } :root[data-theme="crystal"] .chair-card .ring { width: 52px !important; height: 52px !important; } }
@media (max-width: 420px) { .chair-card { gap: 10px; padding: 14px 12px; } .chair-card .ring { width: 54px !important; height: 54px !important; } .chair-card .cc-side b { font-size: 22px; } }
.legend { display: flex; gap: 8px 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend b { color: var(--ink); font-weight: 600; }
:root[data-theme="emerald"] .legend .dot { border-radius: 3px; }

/* ---- الحجوزات */
.cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.col { background: var(--surface2); border-radius: var(--r-sm); padding: 10px; min-height: 160px; }
.col > header { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 10px; font-weight: 600; }
.bk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 8px; font-size: 13.5px; }
.bk .tm { font-weight: 600; font-variant-numeric: tabular-nums; }
.bk .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.bk.cancelled, .bk.no_show { opacity: .6; }
.svc-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.svc-pick label { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; cursor: pointer; font-size: 14px; }
.svc-pick label:has(input:checked) { border-color: var(--accent); background: var(--accentSoft); }
.svc-pick small { display: block; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 6px; max-height: 220px; overflow: auto; }
.slots button { font: inherit; font-size: 13.5px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 6px 4px; cursor: pointer; font-variant-numeric: tabular-nums; }
.slots button.on { background: var(--accent); color: var(--onAccent); border-color: var(--accent); }

/* ---- الشات */
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); height: calc(100vh - 220px); min-height: 420px; overflow: hidden; }
.threads { border-inline-end: 1px solid var(--line); overflow-y: auto; }
.thread { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.thread:hover { background: var(--surface2); text-decoration: none; }
.thread.on { background: var(--surface2); }
.thread .p { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.convo > header { padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; gap: 10px; align-items: center; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 75%; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface2); font-size: 14px; align-self: flex-start; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--accentSoft); }
.msg .m { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.composer input { flex: 1; }
@media (max-width: 760px) {
  .chat { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 190px); }
  .chat.has-thread .threads { display: none; }
  .chat:not(.has-thread) .convo { display: none; }
}

/* ---- الدخول */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; gap: 18px; }
.auth-top { width: 100%; max-width: 400px; display: flex; justify-content: space-between; align-items: center; }
.auth-top .wordmark { font-size: 22px; color: var(--ink); }
.auth-card { width: 100%; max-width: 400px; padding: 26px; }
.code-input { text-transform: uppercase; letter-spacing: 3px; text-align: center !important; font-weight: 600; }

/* ---- تقارير */
.pl .kv { padding: 8px 0; }
.pl .grp { font-size: 12.5px; color: var(--muted); margin: 14px 0 2px; font-weight: 500; }
.pl .net { font-size: 18px; font-weight: 600; border-top: 2px solid var(--ink); border-bottom: 0; margin-top: 6px; padding-top: 12px; }
.pl .sub { padding-inline-start: 16px; font-size: 13px; color: var(--muted); }
.neg { color: var(--danger); }
.method { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13.5px; margin-bottom: 10px; }
.method .bar > i { background: var(--accent); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.statement .kv.big { font-size: 17px; font-weight: 600; }
.cat-pct { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .cat-pct { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.split { display: grid; gap: 14px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .kpi .v { font-size: 21px; } .card.kpi { padding: 14px; } }

/* ---- صوت التنبيهات (في لوحة الجرس) */
.bell-panel header { gap: 6px; }
.btn.snd { gap: 6px; padding: 4px 10px; }
.btn.snd[aria-pressed="false"] { color: var(--muted); }
@media (max-width: 560px) { .btn.snd span { display: none; } }

/* ---- شات الزبون */
.chip.cust { background: var(--t-hairBg); color: var(--t-hair); padding: 0 8px; font-size: 11px; }
.chip.cust::before { display: none; }
.thread.cust { border-inline-start: 3px solid var(--t-hair); }
.thread .tn, .convo .tn { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo > header .ph { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); text-align: start; width: max-content; }
.convo > header .btn span { white-space: nowrap; }
@media (max-width: 760px) { .convo > header #propose span { display: none; } .convo > header #propose { width: 32px; padding: 0; } }
.qr { display: flex; gap: 6px; padding: 8px 10px 0; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); }
.qr button { flex: none; font: inherit; font-size: 13px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 12px; cursor: pointer; white-space: nowrap; }
.qr button:hover { border-color: var(--accent); background: var(--accentSoft); }
.qr button:disabled { opacity: .5; }
.qr + .composer { border-top: 0; }
.msg.sys { align-self: center; background: transparent; border: 1px dashed var(--line); color: var(--muted); font-size: 12.5px; max-width: 90%; text-align: center; padding: 4px 12px; }
.msg.has-prop { padding: 8px; min-width: min(280px, 75%); }
.msg.has-prop .m { padding: 0 4px; }
.prop { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; white-space: normal; }
.prop > .row b { font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.prop > .row b svg { color: var(--accent); }
.prop .kv { font-size: 13px; padding: 5px 0; }
.prop .kv b { font-weight: 500; text-align: end; }

/* ---- رسايل صوتية */
.composer { align-items: center; }
.composer .mic { flex: none; }
.composer .mic.danger { color: var(--danger); border-color: var(--danger); }
.recbar { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; }
.recbar .hint { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rdot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); flex: none; animation: rpulse 1s ease-in-out infinite; }
@keyframes rpulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .rdot { animation: none; } }
.voice { display: flex; align-items: center; gap: 10px; min-width: 200px; max-width: 280px; padding: 2px 0; white-space: normal; }
.voice .vp { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent); color: var(--onAccent); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.voice .vp svg { width: 16px; height: 16px; fill: currentColor; stroke-width: 1.2; }
.voice.loading .vp { opacity: .6; }
.voice .vtrack { flex: 1; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 30%, transparent); position: relative; cursor: pointer; }
.voice .vtrack::after { content: ''; position: absolute; inset: -8px 0; }
.voice .vtrack i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--accent); transition: width .2s linear; }
.voice .vt { font-size: 12px; color: var(--muted); min-width: 32px; text-align: end; }
.msg .cap { margin-top: 4px; }
@media (max-width: 560px) { .voice { min-width: 180px; } }

/* ---- الطابور */
.chair-card .qline { font-size: 13px; margin-top: 8px; display: flex; gap: 5px; align-items: center; color: var(--res); }
.chair-card .qline b { font-weight: 600; }
.section-title h2 { display: inline-flex; gap: 8px; align-items: center; }
.section-title h2 svg { color: var(--accent); }
.qbranch { margin: 18px 0 10px; font-size: 15px; color: var(--muted); }
.queue { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
@media (max-width: 560px) { .queue { grid-template-columns: minmax(0, 1fr); } }
.qcard { display: flex; flex-direction: column; gap: 10px; }
.qcard.any { border-style: dashed; }
.qserve { font-size: 13.5px; background: var(--busyBg); color: var(--busy); border-radius: 8px; padding: 6px 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.qserve b { font-weight: 600; }
.qlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.qlist li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.qlist li b { font-weight: 600; }
.qlist .qn { width: 24px; height: 24px; border-radius: 50%; background: var(--surface2); display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; flex: none; }
.qlist li:first-child .qn { background: var(--resBg); color: var(--res); }
.qlist .qs { font-size: 12.5px; }
.qlist .chip.app { font-size: 11px; padding: 0 6px; }
.qeta { font-size: 13px; color: var(--muted); white-space: nowrap; }
.qeta b { color: var(--ink); font-weight: 600; }
.qacts { display: flex; gap: 6px; }
@media (max-width: 560px) { .qacts { width: 100%; padding-inline-start: 34px; } .qacts .btn { flex: 1; } }
.qempty { font-size: 13.5px; padding: 4px 0; }
.qfoot { display: flex; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.qfoot b { color: var(--ink); font-weight: 600; }
.qfoot svg { width: 14px; height: 14px; }

/* ---- تعديل الرسايل الجاهزة */
.qr-edit { display: grid; gap: 8px; }
.qr-row { display: flex; gap: 8px; align-items: center; }

/* ---- تنبيهات جوه الصفحة */
.notice { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); font-size: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.notice > svg { flex: none; }
.notice b { font-weight: 600; }
.notice .muted { font-size: 13px; }
.notice.warn { background: var(--lateBg); border-color: color-mix(in srgb, var(--late) 30%, transparent); }
.notice.warn > svg { color: var(--late); }
a.notice { color: var(--ink); }
a.notice:hover { text-decoration: none; border-color: var(--late); }
.notice.hint .go { color: var(--accentInk); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.notice .grow { min-width: 0; }

/* ---- تقفيل اليوم */
.dc-when { font-size: 13px; padding-bottom: 8px; }
.calc .kv { padding: 9px 0; }
.calc .kv > span:first-child small { display: block; font-size: 12px; }
.calc .in { color: var(--ok); white-space: nowrap; }
.calc .neg { white-space: nowrap; }
.calc .kv.total { font-size: 18px; font-weight: 600; border-top: 2px solid var(--ink); border-bottom: 0; margin-top: 4px; padding-top: 12px; }
.big-input input { font-size: 24px; font-weight: 600; min-height: 54px; font-variant-numeric: tabular-nums; }
.diff { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 14px; border-radius: var(--r-sm); font-size: 14px; }
.diff .dl { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; }
.diff .dl b { font-weight: 600; }
.diff > .num { font-size: 13px; opacity: .85; }
.diff.idle { background: var(--surface2); color: var(--muted); }
.diff.ok { background: var(--okBg); color: var(--ok); }
.diff.short { background: var(--dangerBg); color: var(--danger); }
.diff.over { background: var(--resBg); color: var(--res); }
.ro { min-height: 40px; display: flex; align-items: center; padding: 0 12px; border-radius: var(--r-sm); background: var(--surface2); font-weight: 600; }
.dc-done h3 { display: inline-flex; gap: 8px; align-items: center; }
.dc-done h3 svg { color: var(--ok); }
.dc-done .row { margin-bottom: 6px; }
.short { color: var(--danger); } .over { color: var(--res); }
.wrap-txt { white-space: pre-wrap; text-align: end; overflow-wrap: anywhere; }
.chip.warn::before { display: inline-block; }
.dc-confirm { background: var(--surface2); border-radius: var(--r-sm); padding: 4px 14px; }
.dc-confirm .kv { border-color: var(--line); }
.done-sheet { text-align: center; padding-top: 4px; }
.done-sheet > svg { width: 40px; height: 40px; color: var(--ok); margin-bottom: 6px; }
.done-sheet h2 { margin-bottom: 4px !important; }
.done-sheet + .actions { justify-content: center; }

/* ---- الاشتراكات */
.chip.sub { background: var(--resBg); color: var(--res); }
.chip.sub svg { width: 14px; height: 14px; }
.chip.sub .x { border: 0; background: none; color: inherit; padding: 0; margin-inline-start: 2px; cursor: pointer; display: inline-flex; }
.chip.sub .x svg { width: 13px; height: 13px; }
.sub-use { border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 14px; }
.sub-use .row { flex-wrap: wrap; gap: 8px; }
.sub-find { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.sub-find .field { flex: 1; margin: 0; }
.sub-msg { font-size: 13.5px; padding: 8px 0 2px; }
#subList .err-msg { padding-top: 8px; }
.sub-opts { display: grid; gap: 8px; margin-top: 10px; }
.sub-opts label { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; cursor: pointer; font-size: 14px; }
.sub-opts label input { margin-top: 3px; }
.sub-opts label small { display: block; font-size: 12.5px; }
.sub-opts label small.cov { color: var(--ok); }
.sub-opts label b { font-weight: 600; }
.sub-opts label:has(input:checked) { border-color: var(--accent); background: var(--accentSoft); }
.sub-opts label.off { opacity: .65; cursor: default; }
.sub-tools { align-items: center; }
.search { position: relative; flex: 0 1 240px; min-width: 180px; }
.search svg { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-right: 36px; text-align: right; }
.search input::placeholder { text-align: right; }
.sub-count { font-size: 13px; margin: -6px 0 10px; min-height: 1px; }
.subs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.sub-card { display: flex; flex-direction: column; gap: 10px; }
.sub-card .nm { font-weight: 600; font-size: 16px; }
.sub-card .ph { font-size: 13px; }
.sub-card .plan { display: flex; align-items: center; gap: 8px; font-size: 14px; background: var(--surface2); border-radius: 8px; padding: 7px 10px; }
.sub-card .plan svg { color: var(--accent); }
.sub-card .visits { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.sub-card .visits b { font-weight: 600; }
.sub-card .meta { font-size: 12.5px; }
.sub-card.off { opacity: .78; }
.vseg { display: flex; gap: 4px; }
.vseg i { flex: 1; height: 8px; border-radius: 4px; background: var(--accent); }
.vseg i.u { background: var(--surface2); box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 560px) { .subs { grid-template-columns: minmax(0, 1fr); } .search { flex: 1 1 100%; } .sub-tools .seg { width: 100%; } .sub-tools .seg button { flex: 1; padding: 7px 6px; } .sub-tools #sell { width: 100%; } }
.plan-card { display: flex; flex-direction: column; gap: 10px; }
.plan-card.off { opacity: .7; }
.plan-card .price { font-size: 24px; font-weight: 600; }
.plan-card .facts, .plan-sum { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--muted); }
.plan-card .facts span, .plan-sum > span { display: inline-flex; gap: 5px; align-items: center; }
.plan-card .facts svg, .plan-sum svg { color: var(--accent); width: 16px; height: 16px; }
.covers { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.covers .lbl { margin-inline-end: 2px; }
.plan-sum { background: var(--surface2); border-radius: var(--r-sm); padding: 9px 12px; margin-top: -2px; }
.rc-btn { gap: 5px; }
@media (max-width: 960px) { .rc-btn span { display: none; } .rc-btn { width: 32px; padding: 0; } }

/* ---- الإيصال */
.modal .box.rc-box { max-width: 420px; background: var(--surface2); }
.rcpt { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 20px 18px 16px; font-size: 14px; max-width: 360px; margin: 0 auto;
  box-shadow: var(--shadow-lg); }
.rc-hd { text-align: center; padding-bottom: 12px; font-size: 13px; }
.rc-shop { font-size: 18px; font-weight: 600; }
.rc-no { margin-top: 8px; font-size: 13.5px; }
.rc-no b { font-weight: 600; letter-spacing: .5px; }
.rc-sec { border-top: 1px dashed color-mix(in srgb, var(--muted) 45%, transparent); padding: 8px 0; }
.rc-ln { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.rc-ln > span:last-child { white-space: nowrap; text-align: end; }
.rc-ln b { font-weight: 600; }
.rc-ln.tot { font-size: 17px; font-weight: 600; padding: 6px 0; }
.rc-ln.pay { font-size: 13px; color: var(--muted); }
.rc-subs { display: flex; gap: 8px; align-items: center; background: var(--resBg); color: var(--res); border-radius: 8px; padding: 7px 10px; font-size: 13.5px; margin-top: 4px; }
.rc-subs b { font-weight: 600; }
.rc-ft { text-align: center; color: var(--muted); font-size: 13px; padding-top: 12px; border-top: 1px dashed color-mix(in srgb, var(--muted) 45%, transparent); margin-top: 8px; }
@media (max-width: 560px) { .modal .box.rc-box { padding: 16px 12px 20px; } }
@media print {
  body * { visibility: hidden !important; }
  #rcpt, #rcpt * { visibility: visible !important; }
  #rcpt { position: absolute; top: 0; inset-inline: 0; margin: 0 auto; box-shadow: none; border: 0; color: #000; background: #fff; }
  .modal { background: none; }
}
.rc-cov { font-size: 11px; padding: 0 6px; margin-inline-start: 4px; }

/* ---- الباركود */
.scan-in { position: relative; display: flex; gap: 8px; align-items: center; }
.scan-in > svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.scan-in input { padding-right: 40px; text-align: right; letter-spacing: .5px; }
.scan-in input::placeholder { letter-spacing: 0; }
.scan-msg { font-size: 13.5px; min-height: 22px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: -4px 0 10px; color: var(--muted); }
.scan-msg.ok { color: var(--ok); } .scan-msg.err { color: var(--danger); }
.scan-msg b { font-weight: 600; }

/* ---- بيع منتجات */
.pos { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.pos-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.scan-card .lbl { display: block; margin-bottom: 6px; }
.scan-in.big > svg { width: 22px; height: 22px; }
.scan-in.big input { font-size: 20px; min-height: 52px; font-weight: 500; padding-right: 44px; }
.scan-in.big .btn { min-height: 52px; }
.scan-card .scan-msg { margin: 8px 0 4px; }
.pos-pick select { font-size: 14px; color: var(--muted); }
.cart-card h3 { display: inline-flex; gap: 8px; align-items: center; }
.cart-card h3 svg { color: var(--accent); }
.cart { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--line); }
.cart li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cart li b { font-weight: 600; }
.cart .cs { font-size: 12.5px; }
.cart .qty { display: inline-flex; align-items: center; gap: 6px; }
.cart .qty .num { min-width: 22px; text-align: center; font-weight: 600; }
.cart .lt { min-width: 84px; text-align: end; font-weight: 600; }
.cart .rm { color: var(--muted); border-color: transparent; }
.cart-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 12px; }
.cart-empty svg { width: 34px; height: 34px; color: var(--line); }
.pos-pay { position: sticky; top: 86px; }
.pos-pay .total-line { font-size: 18px; font-weight: 600; border-top: 2px solid var(--ink); padding-top: 10px; }
.pos-more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 14px; }
.pos-more summary { cursor: pointer; color: var(--accentInk); font-weight: 500; }
.sale-no { font-size: 26px; font-weight: 600; letter-spacing: 1px; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
@media (max-width: 960px) { .pos { grid-template-columns: minmax(0, 1fr); } .pos-pay { position: static; } }
@media (max-width: 560px) {
  .scan-in.big .btn span { display: none; } .scan-in.big .btn { width: 52px; padding: 0; }
  .scan-in.big input { font-size: 17px; }
  .cart li { flex-wrap: wrap; gap: 6px 10px; } .cart li > .grow { flex: 1 1 calc(100% - 44px); }
  .cart .qty { margin-inline-start: 0; } .cart .lt { flex: 1; }
}
.scan-in input:placeholder-shown, .search input:placeholder-shown { direction: rtl; }

/* أوردر بالصوت: الكوافير سجّل صوت من غير بنود ← المدير يسمع ويختار */
.vorder { display: flex; flex-direction: column; gap: 10px; background: var(--accentSoft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: var(--r-sm); padding: 12px 14px; }
.vorder .vo-h, .vo-h { font-weight: 600; color: var(--accentInk); font-size: 15px; }
.vo-h.sm { font-size: 13px; display: block; margin-bottom: 4px; }
.vorder .voice { max-width: none; }
.vorder .voice .vp { width: 42px; height: 42px; }
.vorder .voice .vp svg { width: 18px; height: 18px; }
.vq { display: block; color: var(--ink); font-size: 14px; line-height: 1.6; quotes: '«' '»'; }
.vq::before { content: open-quote; color: var(--muted); } .vq::after { content: close-quote; color: var(--muted); }
.vnote { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; background: var(--surface2); border-radius: var(--r-sm); padding: 6px 10px; }
.vnote .voice { min-width: 160px; flex: 1; }
.vnote .vq { flex-basis: 100%; font-size: 13px; color: var(--muted); }
.vnote .voice .vp { width: 28px; height: 28px; }
.vcell { display: flex; flex-direction: column; gap: 2px; min-width: 190px; }
.vcell.sm { margin-top: 6px; }
.vcell .voice .vp { width: 28px; height: 28px; }
.vcell .vq { font-size: 12.5px; color: var(--muted); }
.tbd { font-size: 14px; font-weight: 500; color: var(--accentInk); }
.vo-pick { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.vo-ct { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.vo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.pchip small { color: var(--muted); font-size: 12px; }
.pchip[aria-pressed="true"] { border-color: var(--accent); background: var(--accentSoft); color: var(--accentInk); font-weight: 600; }
.pchip[aria-pressed="true"] small { color: var(--accentInk); }
.pchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vo-prods { display: flex; flex-direction: column; }
.vo-prod { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.vo-prod:last-child { border-bottom: 0; }
.vo-prod.on { color: var(--accentInk); font-weight: 600; }
.vo-prod .qty { display: inline-flex; align-items: center; gap: 6px; }
.vo-prod .qty b { min-width: 22px; text-align: center; }
.vo-sum { font-size: 16px; font-weight: 600; }

/* ---- شريط المحل التجريبي */
.demo-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 0; padding: 10px 14px; border-radius: var(--r-sm); background: var(--accentSoft); color: var(--accentInk); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-size: 14px; }
.demo-bar .tx { flex: 1; min-width: 160px; }
.demo-bar .tx b { font-weight: 600; }
@media (max-width: 960px) { .demo-bar { margin-top: 10px; padding: 8px 12px; } .demo-bar .btn.ghost { display: none; } }

/* ---- ادعي زميلك واكسب */
.ref-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; padding: 22px; }
.ref-code { font-size: 34px; font-weight: 600; letter-spacing: 4px; margin: 2px 0 10px; font-variant-numeric: tabular-nums; color: var(--accentInk); }
.ref-l { border-inline-end: 1px solid var(--line); padding-inline-end: 24px; }
.share-txt { background: var(--surface2); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13.5px; line-height: 1.7; color: var(--ink); }
.ref-bal { border-color: var(--accent); }
.ref-bal .v { color: var(--accentInk); }
b.ref-plus { color: var(--ok); }
.btn.copied { border-color: var(--ok); color: var(--ok); }
@media (max-width: 760px) { .ref-hero { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; } .ref-l { border: 0; padding: 0 0 16px; border-bottom: 1px solid var(--line); } .ref-code { font-size: 28px; } }

/* ---- الإعداد أول مرة */
.setup { max-width: 680px; margin: 0 auto; padding: 0 16px 48px; }
.setup-top { display: flex; align-items: center; gap: 10px; padding: 16px 0; }
.setup-top .wordmark { font-size: 19px; color: var(--ink); }
.setup-hi { text-align: center; padding: 18px 0 6px; }
.setup-hi h1 { font-size: 24px; margin-bottom: 4px; }
.setup-hi .ok-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--okBg); color: var(--ok); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.setup-hi .ok-ic svg { width: 26px; height: 26px; }
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 18px 0 14px; }
.steps li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); text-align: center; position: relative; }
.steps li::before { content: ''; position: absolute; top: 13px; inset-inline-start: calc(50% + 16px); inset-inline-end: calc(-50% + 16px); height: 1px; background: var(--line); }
.steps li:last-child::before { display: none; }
.steps .n { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.steps .n svg { width: 14px; height: 14px; }
.steps li.on { color: var(--ink); font-weight: 600; }
.steps li.on .n { border-color: var(--accent); background: var(--accent); color: var(--onAccent); }
.steps li.done .n { border-color: var(--ok); background: var(--okBg); color: var(--ok); }
.setup-card { padding: 22px; }
.setup-card .actions { display: flex; gap: 10px; margin-top: 18px; align-items: center; }
.stepper { display: flex; align-items: center; gap: 14px; margin: 8px 0 16px; }
.stepper b { font-size: 34px; font-weight: 600; min-width: 48px; text-align: center; }
.chairs-prev { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.chairs-prev > div { display: flex; flex-direction: column; align-items: center; }
.chairs-prev > div.off { opacity: .35; }
.chairs-prev small { color: var(--muted); font-size: 12px; }
.st-head, .st-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.3fr) 40px; gap: 8px; align-items: center; }
.st-head { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.st-row + .st-row { margin-top: 8px; }
.cred-list { display: grid; gap: 10px; }
.cred { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px 12px; }
.cred .who { display: flex; gap: 8px; align-items: center; margin-bottom: 2px; }
.cred .kv { align-items: center; }
.cred > .btn { margin-top: 8px; }
.setup-go { text-align: center; margin-top: 18px; }
.setup-go .btn { min-width: 220px; }
@media (max-width: 560px) {
  .steps .t { display: none; } .steps li.on .t { display: block; position: absolute; top: 30px; white-space: nowrap; }
  .steps { margin-bottom: 34px; }
  .st-head { display: none; }
  .st-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); }
  .st-row [name=n] { grid-column: 1 / 3; grid-row: 1; } .st-row [data-rm] { grid-row: 1; grid-column: 3; } .st-row [name=r] { grid-column: 1; grid-row: 2; } .st-row [name=p] { grid-column: 2 / 4; grid-row: 2; }
  .setup-card { padding: 16px; }
}

/* على الموبايل: علامة ساعة كل 4 ساعات بس عشان الكلام مايلزقش في بعضه */
@media (max-width: 560px) {
  .hbars { gap: 3px; padding-inline: 8px; }
  .hbars .hb:nth-child(4n+3) small { visibility: hidden; }
  .cta-card { padding: 16px; gap: 12px; } .cta-card b { font-size: 16px; }
  :root[data-theme="crystal"] .chair-card h3 { font-size: 15px; }
}

/* ---- صفحة الدخول: شريط بلون الثيم فوق والكارت راكب عليه */
.auth { position: relative; isolation: isolate; }
.auth::before { content: ''; position: absolute; z-index: -1; inset: 0 0 auto 0; height: 44vh; }
:root[data-theme="emerald"] .auth::before { background: var(--headerBg); }
:root[data-theme="emerald"] .auth::after { content: ''; position: absolute; z-index: -1; inset-inline: 0; top: 44vh; height: 7px; background: var(--pole); }
:root[data-theme="crystal"] .auth::before { background: var(--hero); border-radius: 0 0 48px 48px; }
:root[data-theme="onyx"] .auth::before { height: 70vh; background: radial-gradient(ellipse at 50% 0, rgba(201, 163, 91, .18), transparent 65%); }
:root[data-theme="emerald"] .auth-top .wordmark, :root[data-theme="crystal"] .auth-top .wordmark { color: var(--headerInk); }
:root[data-theme="crystal"] .auth-top .wordmark { color: var(--heroInk); }
:root[data-theme="onyx"] .auth-top .wordmark { color: var(--accentInk); }
:root[data-theme="emerald"] .auth-top .theme-btn { background: transparent; color: var(--headerInk); border-color: var(--headerLine); }
:root[data-theme="crystal"] .auth-top .theme-btn { background: var(--heroSoft); color: var(--heroInk); border-color: transparent; }
.auth-card { box-shadow: var(--shadow-lg); }
:root[data-theme="crystal"] .auth-card { border-color: transparent; }
.auth-card h1 { font-size: 24px; }
.auth-card .btn.block { min-height: 50px; font-size: 15px; margin-top: 4px; }

/* ---- الإعداد أول مرة: الهيدر بلون الثيم */
.setup-top { position: relative; }
:root[data-theme="emerald"] .setup-top { background: var(--headerBg); box-shadow: 0 0 0 100vmax var(--headerBg); clip-path: inset(0 -100vmax -7px); margin-bottom: 14px; }
:root[data-theme="emerald"] .setup-top::after { content: ''; position: absolute; left: calc(50% - 50vw); width: 100vw; bottom: -7px; height: 7px; background: var(--pole); }
:root[data-theme="emerald"] .setup-top .wordmark { color: var(--headerInk); }
:root[data-theme="emerald"] .setup-top .theme-btn, :root[data-theme="emerald"] .setup-top .btn.ghost { background: transparent; color: var(--headerInk); border-color: var(--headerLine); }
:root[data-theme="onyx"] .setup-top .wordmark { color: var(--accentInk); }
.setup-card { box-shadow: var(--shadow-lg); }
.setup-hi h1 { font-size: 28px; }
:root[data-theme="emerald"] .setup-hi h1 { color: var(--accent); }
