/* =========================================================================
   Linearyze EMS — interface design system
   Direction: calm glass "control room". Cool mist canvas, translucent chrome,
   one dark stage where the hall rises in 3D. Logical properties throughout,
   so Arabic (RTL) mirrors without overrides.
   ========================================================================= */
:root {
  --accent: #4F46E5;
  --accent-ink: #fff;
  --accent-soft: color-mix(in oklab, var(--accent) 10%, white);
  --gold: #B8893B;
  --bg: #ECEEF2;
  --surface: rgba(255, 255, 255, .72);
  --surface-solid: #FFFFFF;
  --surface-2: #F5F6F8;
  --ink: #0B1020;
  --ink-2: #3B4356;
  --ink-3: #697184;
  --ink-4: #9AA1B0;
  --line: rgba(11, 16, 32, .09);
  --line-2: rgba(11, 16, 32, .055);
  --available: #1F9D6B; --reserved: #D99A00; --confirmed: #D64545; --negotiation: #7A8499;
  --ok: #188A5D; --warn: #A87300; --bad: #C93B3B;
  --sms: #128C4B;
  --r-xl: 28px; --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --sh-1: 0 1px 1px rgba(11, 16, 32, .04), 0 2px 6px -2px rgba(11, 16, 32, .06);
  --sh-2: 0 1px 2px rgba(11, 16, 32, .05), 0 10px 30px -10px rgba(11, 16, 32, .16);
  --sh-3: 0 24px 64px -16px rgba(11, 16, 32, .32), 0 6px 18px -8px rgba(11, 16, 32, .18);
  --f: 'Geist', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --spring: cubic-bezier(.2, .9, .25, 1);
  --glass: blur(24px) saturate(180%);
  color-scheme: light;
}
:root[dir="rtl"] { --f: 'IBM Plex Sans Arabic', 'Geist', system-ui, sans-serif; }
:root[data-theme="dark"] {
  --bg: #07090F; --surface: rgba(22, 26, 38, .72); --surface-solid: #141824; --surface-2: #1A1F2D;
  --ink: #EEF1F7; --ink-2: #B9C0CF; --ink-3: #8C94A6; --ink-4: #636B7D; --line: rgba(255, 255, 255, .1); --line-2: rgba(255, 255, 255, .06);
  --accent-soft: color-mix(in oklab, var(--accent) 22%, #141824);
  --available: #24A271; --reserved: #C99418; --confirmed: #E35D5D; --ok: #2DB07E; --warn: #D9A21F; --bad: #E35D5D;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .4); --sh-2: 0 12px 34px -12px rgba(0, 0, 0, .7); --sh-3: 0 30px 70px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body {
  font: 15px/1.5 var(--f); color: var(--ink); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
  background: radial-gradient(1200px 600px at 85% -10%, color-mix(in oklab, var(--accent) 9%, transparent), transparent 60%), radial-gradient(900px 500px at -10% 110%, color-mix(in oklab, var(--gold) 8%, transparent), transparent 60%), var(--bg);
  background-attachment: fixed; min-height: 100dvh;
}
[dir="rtl"] body { line-height: 1.65; }
body.modal-open { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.015em; line-height: 1.2; }
[dir="rtl"] :is(h1, h2, h3, h4) { letter-spacing: 0; line-height: 1.35; }
h1 { font-size: clamp(28px, 2.6vw, 38px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; }
h2 { font-size: 18px; } h3 { font-size: 15.5px; } h4 { font-size: 15px; }
p { margin: 0 0 .7em; }
a { color: var(--accent); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1:focus { outline: none; }
.muted { color: var(--ink-3); } .small { font-size: 13px; } .nowrap { white-space: nowrap; }
mark { background: color-mix(in oklab, var(--reserved) 30%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; } }

/* ============ Shell ============ */
.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 12px; height: calc(100dvh - 24px); margin: 12px; margin-inline-end: 0;
  border-radius: var(--r-xl); background: color-mix(in oklab, var(--surface-solid) 64%, transparent); backdrop-filter: var(--glass);
  border: 1px solid var(--line); box-shadow: var(--sh-2); display: flex; flex-direction: column; padding: 16px 12px; overflow-y: auto;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 18px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(145deg, var(--accent), color-mix(in oklab, var(--accent) 55%, #000)); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 19px; flex: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 14px -6px var(--accent); overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand b { display: block; font-size: 16.5px; letter-spacing: -0.01em; }
.brand small { color: var(--ink-3); font-size: 12px; display: block; line-height: 1.3; }
.nav-group { margin: 2px 0 12px; }
.nav-group > span { display: block; color: var(--ink-4); font-size: 11.5px; font-weight: 600; padding: 0 12px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14.5px; position: relative; transition: background .15s, transform .1s; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--line-2); color: var(--ink); }
.nav a:active { transform: scale(.98); }
.nav a[aria-current="page"] { background: var(--surface-solid); color: var(--ink); box-shadow: var(--sh-1); font-weight: 600; }
.nav a[aria-current="page"] svg { color: var(--accent); opacity: 1; }
.nav .count { margin-inline-start: auto; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--line-2); color: var(--ink-3); }
.nav .count.hot { background: var(--confirmed); color: #fff; }
.side-foot { margin-top: auto; padding: 12px; border-radius: 16px; background: var(--line-2); font-size: 12.5px; color: var(--ink-3); }
.side-foot b { color: var(--ink); display: block; font-size: 13px; }
.side-foot button { background: none; border: 0; padding: 4px 0 0; color: var(--accent); cursor: pointer; font-weight: 600; }

.main-col { min-width: 0; }
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 14px 28px 12px;
  background: linear-gradient(to bottom, color-mix(in oklab, var(--bg) 92%, transparent) 60%, transparent); backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent); mask-image: linear-gradient(to bottom, #000 78%, transparent);
}
.spot-trigger { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; height: 42px; padding-inline: 14px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); backdrop-filter: var(--glass); color: var(--ink-3); cursor: pointer; text-align: start; box-shadow: var(--sh-1); transition: box-shadow .2s, border-color .2s; }
.spot-trigger:hover { border-color: color-mix(in oklab, var(--accent) 35%, var(--line)); box-shadow: var(--sh-2); }
.spot-trigger svg { width: 17px; height: 17px; flex: none; }
.spot-trigger span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14.5px; }
kbd { font: 600 11px var(--f); color: var(--ink-3); border: 1px solid var(--line); border-radius: 7px; padding: 2px 7px; background: var(--surface-solid); }
.top-right { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); backdrop-filter: var(--glass); display: grid; place-items: center; cursor: pointer; position: relative; color: var(--ink-2); flex: none; transition: transform .12s var(--spring), background .15s; }
.icon-btn:hover { color: var(--ink); background: var(--surface-solid); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .badge { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 19px; height: 19px; border-radius: 99px; background: var(--confirmed); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--bg); }
.lang-btn { font-weight: 700; font-size: 14px; width: auto; padding: 0 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(145deg, var(--accent-soft), color-mix(in oklab, var(--accent) 20%, white)); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; border: 1px solid color-mix(in oklab, var(--accent) 22%, transparent); }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.me { display: flex; gap: 10px; align-items: center; background: none; border: 0; cursor: pointer; padding: 2px; border-radius: 99px; text-align: start; }
.me b { display: block; font-size: 13.5px; line-height: 1.2; } .me small { color: var(--ink-3); font-size: 12px; }

.seg { display: inline-flex; background: color-mix(in oklab, var(--ink) 6%, transparent); border-radius: 12px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: none; padding: 6px 13px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); flex: none; white-space: nowrap; transition: background .2s var(--spring), box-shadow .2s, color .2s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface-solid); color: var(--ink); box-shadow: 0 1px 3px rgba(11, 16, 32, .14), 0 0 0 .5px rgba(11, 16, 32, .06); }
.role-switch { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }

main#main { padding: 8px 28px 72px; max-width: 1440px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 6px 0 22px; }
.page-head .eyebrow { font-size: 13.5px; color: var(--ink-3); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-head .lede { color: var(--ink-2); margin: 8px 0 0; max-width: 72ch; font-size: 15.5px; }
.page-head .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 13.5px; color: var(--ink-3); margin-bottom: 6px; } .crumb a { color: var(--ink-3); text-decoration: none; } .crumb a:hover { color: var(--accent); }

/* ============ Controls ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-solid); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: var(--sh-1); transition: transform .12s var(--spring), background .15s, box-shadow .15s, border-color .15s; }
.btn:hover { border-color: color-mix(in oklab, var(--ink) 20%, transparent); }
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 88%, white), var(--accent)); border-color: transparent; color: var(--accent-ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 16px -8px var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.dark { background: var(--ink); color: var(--surface-solid); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--line-2); }
.btn.on-dark { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.16); box-shadow: none; backdrop-filter: blur(10px); }
.btn.on-dark:hover { background: rgba(255,255,255,.18); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
[dir="rtl"] .flip svg, [dir="rtl"] svg.flip { transform: scaleX(-1); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; padding-inline-start: 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.st-available, .t-ontime { color: var(--ok); } .st-reserved, .ct-reserved, .t-late { color: var(--warn); } .st-confirmed, .ct-signed, .t-overdue { color: var(--bad); }
.ct-negotiation, .t-open { color: var(--negotiation); }
.pill:is(.st-available, .st-reserved, .st-confirmed, .ct-reserved, .ct-signed, .ct-negotiation, .t-ontime, .t-late, .t-overdue, .t-open) { background: color-mix(in oklab, currentColor 11%, var(--surface-solid)); }
.prio-high { color: var(--bad); font-weight: 700; font-size: 12.5px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea, .input { height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-solid); color: var(--ink); padding: 0 13px; font: 14.5px var(--f); width: 100%; transition: border-color .15s, box-shadow .15s; }
.field textarea { height: auto; min-height: 88px; padding: 10px 13px; resize: vertical; }
.field :is(input, select, textarea):focus, .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 16%, transparent); }
.field [aria-invalid="true"] { border-color: var(--bad); }
.field-error, .field > .field-error { color: var(--bad); font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; font-size: 13.5px; font-weight: 500; background: var(--surface-solid); transition: border-color .15s, background .15s; }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.check input { accent-color: var(--accent); margin: 0; }
.switch { position: relative; width: 44px; height: 26px; flex: none; display: inline-block; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: color-mix(in oklab, var(--ink) 16%, transparent); transition: background .25s var(--spring); }
.switch span::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.22); transition: transform .3s var(--spring); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
[dir="rtl"] .switch input:checked + span::after { transform: translateX(-18px); }
.switch input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: .45; }

/* ============ Surfaces ============ */
.panel { background: var(--surface); backdrop-filter: var(--glass); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--sh-1); }
.panel-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.panel-head h2, .panel-head h3 { flex: 1; }
.panel-head a { font-size: 13px; color: var(--ink-3); text-decoration: none; font-weight: 500; } .panel-head a:hover { color: var(--accent); }
.panel.flush { padding: 0; overflow: hidden; } .panel.flush .panel-head { padding: 18px 22px 4px; }
.grid { display: grid; gap: 16px; } .grid > * { min-width: 0; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.g-side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .spacer { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.note { background: color-mix(in oklab, var(--reserved) 10%, var(--surface-solid)); border: 1px solid color-mix(in oklab, var(--reserved) 28%, transparent); border-radius: 12px; padding: 10px 13px; font-size: 13.5px; }
.demo-note { font-size: 12.5px; color: var(--ink-3); display: inline-flex; gap: 7px; align-items: center; }
.demo-note::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none; }

/* ============ Dashboard: stage hero ============ */
.stage {
  position: relative; overflow: hidden; border-radius: var(--r-xl); color: #fff; isolation: isolate;
  background: radial-gradient(700px 380px at 78% 30%, color-mix(in oklab, var(--accent) 42%, transparent), transparent 70%), radial-gradient(500px 300px at 10% 110%, color-mix(in oklab, var(--gold) 30%, transparent), transparent 70%), linear-gradient(160deg, #111833, #070A14 70%);
  box-shadow: var(--sh-3), inset 0 1px 0 rgba(255,255,255,.08);
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); min-height: 430px;
}
.stage::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%); mask-image: linear-gradient(to bottom, #000, transparent 85%); z-index: -1; }
.stage-copy { padding: 28px 30px; display: flex; flex-direction: column; gap: 14px; }
.stage .eyebrow { font-size: 13px; color: rgba(255,255,255,.62); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stage .eyebrow .live { display: inline-flex; align-items: center; gap: 6px; color: #7CF2C2; font-weight: 600; }
.stage .eyebrow .live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #34D399; animation: livepulse 2.4s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); } 70% { box-shadow: 0 0 0 9px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.stage h2 { font-size: clamp(24px, 2.3vw, 32px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.12; }
[dir="rtl"] .stage h2 { letter-spacing: 0; line-height: 1.3; }
.stage .venue { color: rgba(255,255,255,.66); font-size: 14px; margin-top: -6px; }
.ring-row { display: flex; align-items: center; gap: 22px; margin-top: 4px; }
.ring-legend { display: grid; gap: 10px; }
.ring-legend div { display: grid; grid-template-columns: 10px auto; column-gap: 9px; align-items: baseline; }
.ring-legend i { width: 10px; height: 10px; border-radius: 3px; display: block; transform: translateY(1px); }
.ring-legend b { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.ring-legend span { grid-column: 2; font-size: 12.5px; color: rgba(255,255,255,.62); }
.countdown { display: flex; align-items: baseline; gap: 8px; }
.countdown b { font-size: 46px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.countdown span { color: rgba(255,255,255,.66); font-size: 14px; }
.stage-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.stage-plan { position: relative; padding: 10px 18px 14px; display: flex; flex-direction: column; justify-content: center; }
.stage-plan .iso { width: 100%; height: auto; filter: drop-shadow(0 30px 40px rgba(0,0,0,.45)); }
.stage-plan .toggle { position: absolute; top: 18px; inset-inline-end: 18px; z-index: 2; }
.stage .seg { background: rgba(255,255,255,.08); }
.stage .seg button { color: rgba(255,255,255,.7); }
.stage .seg button[aria-pressed="true"] { background: rgba(255,255,255,.92); color: #0B1020; }
.stage .legend-dark { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: 12.5px; color: rgba(255,255,255,.7); margin-top: 4px; }

/* light theme: the hero becomes a bright sheet with the same indigo and gold glow */
[data-theme="light"] .stage {
  color: var(--ink);
  background: radial-gradient(700px 380px at 78% 30%, color-mix(in oklab, var(--accent) 13%, transparent), transparent 70%), radial-gradient(500px 300px at 10% 110%, color-mix(in oklab, var(--gold) 14%, transparent), transparent 70%), linear-gradient(160deg, #FFFFFF, #F2F3F9 70%);
  box-shadow: var(--sh-2), inset 0 0 0 1px var(--line);
}
[data-theme="light"] .stage::after { background-image: radial-gradient(rgba(11,16,32,.07) 1px, transparent 1px); }
[data-theme="light"] .stage .eyebrow, [data-theme="light"] .stage .venue, [data-theme="light"] .stage .countdown span, [data-theme="light"] .stage .ring-legend span { color: var(--ink-3); }
[data-theme="light"] .stage .eyebrow .live { color: #0E8F63; }
[data-theme="light"] .stage .seg { background: rgba(11,16,32,.06); }
[data-theme="light"] .stage .seg button { color: var(--ink-2); }
[data-theme="light"] .stage .seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
[data-theme="light"] .stage .legend-dark { color: var(--ink-2); }
[data-theme="light"] .stage-plan .iso { filter: drop-shadow(0 24px 30px rgba(11,16,32,.16)); }
[data-theme="light"] .stage .btn.on-dark { background: rgba(255,255,255,.8); color: var(--ink); border-color: var(--line); box-shadow: var(--sh-1); }
[data-theme="light"] .stage .btn.on-dark:hover { background: #fff; }

.iso .iso-floor { fill: #1A2240; stroke: rgba(255,255,255,.08); stroke-width: .08; }
.iso .iso-slab-l { fill: #0E1428; } .iso .iso-slab-r { fill: #131A33; }
.iso .iso-feature polygon { fill: rgba(255,255,255,.08); stroke: rgba(255,255,255,.1); stroke-width: .06; }
.iso .iso-feature text { fill: rgba(255,255,255,.55); font: 600 1.15px var(--f); }
.iso .iso-booth { cursor: pointer; transition: transform .35s var(--spring); }
.iso .iso-booth .f-t { stroke: rgba(255,255,255,.18); stroke-width: .05; }
.iso .iso-booth.available .f-t { fill: #2BB27F; } .iso .iso-booth.available .f-r { fill: #1E8A62; } .iso .iso-booth.available .f-l { fill: #176E4E; }
.iso .iso-booth.reserved .f-t { fill: #EDAE1A; } .iso .iso-booth.reserved .f-r { fill: #C38E0C; } .iso .iso-booth.reserved .f-l { fill: #9C7108; }
.iso .iso-booth.confirmed .f-t { fill: #EA5A5A; } .iso .iso-booth.confirmed .f-r { fill: #C24242; } .iso .iso-booth.confirmed .f-l { fill: #9D3333; }
.iso .iso-booth .talk { fill: #fff; stroke: #7A8499; stroke-width: .18; }
.iso .iso-id { fill: rgba(255,255,255,.92); font: 700 1.3px var(--f); pointer-events: none; }
.iso .iso-booth:hover, .iso .iso-booth:focus-visible { transform: translateY(-0.9px); }
.iso .iso-booth:focus { outline: none; }
.iso .iso-booth.sel .f-t { stroke: #fff; stroke-width: .3; }
.iso.rise .iso-booth { animation: rise .7s var(--spring) both; animation-delay: calc(var(--i) * 12ms + 120ms); }
@keyframes rise { from { transform: translateY(5px); opacity: 0; } to { transform: none; opacity: 1; } }
.iso.light .iso-floor { fill: #E9ECF3; stroke: #D3D8E2; } .iso.light .iso-slab-l { fill: #CBD1DD; } .iso.light .iso-slab-r { fill: #D9DEE8; }
.iso.light .iso-feature polygon { fill: #D5DAE4; } .iso.light .iso-feature text { fill: #6A7285; }
/* the hero plan follows the theme through CSS, so switching theme repaints it at once */
[data-theme="light"] .stage .iso .iso-floor { fill: #E9ECF3; stroke: #D3D8E2; } [data-theme="light"] .stage .iso .iso-slab-l { fill: #CBD1DD; } [data-theme="light"] .stage .iso .iso-slab-r { fill: #D9DEE8; }
[data-theme="light"] .stage .iso .iso-feature polygon { fill: #D5DAE4; } [data-theme="light"] .stage .iso .iso-feature text { fill: #6A7285; }

.rings .ring-track { fill: none; opacity: .2; }
.rings .ring-arc { fill: none; stroke-linecap: round; }
.rings.draw .ring-arc { animation: ringdraw 1.4s var(--spring) both .2s; }
@keyframes ringdraw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: var(--off); } }

.pulse { display: flex; gap: 10px; align-items: stretch; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin-top: 14px; }
.pulse::-webkit-scrollbar { display: none; }
.pulse-item { flex: none; display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 16px; background: var(--surface); backdrop-filter: var(--glass); border: 1px solid var(--line); box-shadow: var(--sh-1); text-decoration: none; color: inherit; max-width: 360px; transition: transform .2s var(--spring); }
.pulse-item:hover { transform: translateY(-2px); }
.pulse-item i { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; }
.pulse-item i svg { width: 15px; height: 15px; }
.pulse-item span { min-width: 0; }
.pulse-item b { font-size: 13.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse-item small { color: var(--ink-3); font-size: 12px; }

.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.bento > * { min-width: 0; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.metric { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; transition: transform .2s var(--spring), box-shadow .2s; }
a.metric:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.metric .label { font-size: 13px; color: var(--ink-3); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.metric .value { font-size: 34px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
.metric .sub { font-size: 13px; color: var(--ink-2); }
.metric .value.bad { color: var(--bad); }
.metric .spark { margin-top: 6px; }
.spark .spark-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .spark-area { fill: color-mix(in oklab, var(--accent) 14%, transparent); }
.spark .spark-dot { fill: var(--accent); stroke: var(--surface-solid); stroke-width: 2; }

.funnel { display: grid; gap: 10px; margin-top: 4px; }
.funnel-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; font-size: 13.5px; }
.funnel-bar { height: 30px; border-radius: 9px; display: flex; align-items: center; padding-inline: 10px; color: #fff; font-weight: 700; font-size: 13px; min-width: 34px; }
.funnel-row .val { font-weight: 600; color: var(--ink-2); font-size: 13px; }

.ev-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; transition: transform .25s var(--spring), box-shadow .25s; }
.ev-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.iso-wrap { border-radius: 16px; background: linear-gradient(160deg, #111833, #080B16); padding: 8px; }
.iso-wrap .iso { width: 100%; height: auto; display: block; }

/* ============ Floor plan (2D) ============ */
.plan-wrap { position: relative; background: var(--surface-2); border-radius: 16px; border: 1px solid var(--line); overflow: hidden; }
.plan-wrap.dark { background: linear-gradient(160deg, #111833, #080B16); border-color: transparent; padding: 10px; }
.plan-wrap.dark .iso { width: 100%; height: auto; display: block; }
.plan-svg { width: 100%; height: auto; display: block; }
.plan-svg .hall { fill: var(--surface-solid); stroke: var(--line); stroke-width: .15; }
.plan-svg .feature rect { fill: color-mix(in oklab, var(--ink-3) 16%, var(--surface-solid)); }
.plan-svg .feature text { fill: var(--ink-3); font: 600 1.15px var(--f); }
.plan-svg .booth { cursor: pointer; }
.plan-svg .booth rect.b { stroke: var(--surface-solid); stroke-width: .28; transition: opacity .15s; }
.plan-svg .booth.available rect.b { fill: var(--available); } .plan-svg .booth.reserved rect.b { fill: var(--reserved); } .plan-svg .booth.confirmed rect.b { fill: var(--confirmed); }
.plan-svg .booth rect.hatch { pointer-events: none; }
.plan-svg .booth text { fill: #fff; font: 700 1.05px var(--f); pointer-events: none; }
.plan-svg .booth .talk { fill: var(--surface-solid); stroke: var(--negotiation); stroke-width: .18; }
.plan-svg .booth:hover rect.b, .plan-svg .booth:focus rect.b { stroke: var(--ink); stroke-width: .35; }
.plan-svg .booth:focus { outline: none; }
.plan-svg .booth.sel rect.b { stroke: var(--ink); stroke-width: .5; }
.plan-svg.dim .booth:not(.match) { opacity: .16; }
.plan-svg.editing .booth { cursor: move; }
.plan-svg .bg-img { opacity: .55; }
.plan-svg.mini .booth text { display: none; }
.plan-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--ink-2); align-items: center; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.bg-confirmed { background: var(--confirmed); } .bg-reserved { background: var(--reserved); } .bg-available { background: var(--available); }
.hatch-key { background: repeating-linear-gradient(45deg, var(--reserved) 0 3px, color-mix(in oklab, var(--reserved) 50%, #fff) 3px 5px); }
.talk-key { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--negotiation); display: inline-block; margin-inline-end: 6px; vertical-align: -1px; }
.plan-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.plan-tip { position: absolute; pointer-events: none; background: rgba(11,16,32,.92); color: #fff; padding: 8px 11px; border-radius: 11px; font-size: 12.5px; box-shadow: var(--sh-2); z-index: 5; transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; }
.plan-tip b { display: block; font-size: 13px; }
.occ-line { display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.occ-line i { display: block; height: 100%; }
.big-stat { font-size: 52px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; display: flex; align-items: baseline; gap: 8px; }
.big-stat small { font-size: 14px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }

/* ============ Tables & lists ============ */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; transition: background .12s; } .tbl tr.click:hover td { background: color-mix(in oklab, var(--accent) 4%, transparent); }
.tbl .num { text-align: end; }
.tbl.compact td, .tbl.compact th { padding: 8px 10px; font-size: 13.5px; }
.tbl-wrap { overflow-x: auto; }
.cell-main b { display: block; font-weight: 600; } .cell-main small { color: var(--ink-3); font-size: 12.5px; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; } .list b { font-weight: 600; } .list small { color: var(--ink-3); font-size: 12.5px; display: block; }
.list a { color: inherit; text-decoration: none; } .list a:hover b { color: var(--accent); }
ul.plain { padding-inline-start: 18px; margin: 6px 0 10px; } ul.ticks li { margin: 4px 0; }
.fmt { font: 700 10px/1 var(--f); padding: 5px 6px; border-radius: 6px; color: #fff; background: var(--ink-3); flex: none; letter-spacing: .02em; }
.fmt-pdf { background: #D94B3F; } .fmt-docx { background: #2F5BD3; } .fmt-xlsx { background: #19824F; } .fmt-img { background: #7A5AF8; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 8px 14px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--ink-3); text-decoration: none; transition: background .15s; white-space: nowrap; }
.tabs a:hover { background: var(--line-2); color: var(--ink); }
.tabs a[aria-current="page"], .tabs a[aria-selected="true"] { background: var(--surface-solid); color: var(--ink); box-shadow: var(--sh-1); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters .input { width: auto; min-width: 170px; height: 38px; font-size: 14px; }
.filters .search { min-width: 250px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding-block-end: 14px; padding-inline-start: 24px; font-size: 14px; }
.timeline li::before { content: ''; position: absolute; inset-inline-start: 3px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface-solid); border: 2px solid var(--ink-4); }
.timeline li::after { content: ''; position: absolute; inset-inline-start: 8px; top: 20px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.agent::before { border-color: var(--accent); background: var(--accent); }
.timeline small { display: block; color: var(--ink-3); font-size: 12.5px; }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.board.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col { background: color-mix(in oklab, var(--ink) 4%, transparent); border-radius: var(--r-lg); padding: 10px; min-height: 200px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; font-size: 14px; }
.col-head .muted { font-weight: 500; font-size: 12.5px; margin-inline-start: auto; }
.card { background: var(--surface-solid); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 13px; margin-bottom: 8px; box-shadow: var(--sh-1); cursor: pointer; display: block; text-decoration: none; color: inherit; width: 100%; text-align: start; transition: transform .18s var(--spring), box-shadow .18s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.card:active { transform: scale(.98); }
.card b { display: block; font-size: 14.5px; }
.card .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-top: 6px; align-items: center; }
.card .amt { font-weight: 700; font-size: 15px; margin-top: 6px; letter-spacing: -0.01em; }
.col.drop { outline: 2px dashed var(--accent); outline-offset: -4px; }

/* ============ Assistant ============ */
.chat { display: flex; flex-direction: column; min-height: calc(100dvh - 190px); }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 18px; padding-bottom: 18px; }
.msg-q { align-self: flex-end; background: var(--ink); color: var(--surface-solid); padding: 11px 16px; border-radius: 20px; border-end-end-radius: 6px; max-width: 70ch; font-weight: 500; }
.msg-a { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; max-width: 880px; }
.msg-a .bot { width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(145deg, var(--accent), color-mix(in oklab, var(--accent) 55%, #000)); color: #fff; display: grid; place-items: center; font-weight: 700; }
.msg-a .bot svg { width: 17px; height: 17px; }
.msg-a.advisor .bot { background: linear-gradient(145deg, var(--gold), color-mix(in oklab, var(--gold) 50%, #000)); }
.msg-body { background: var(--surface-solid); border: 1px solid var(--line-2); border-radius: 20px; border-start-start-radius: 6px; padding: 15px 18px; box-shadow: var(--sh-1); min-width: 0; }
.msg-body > p:last-child { margin-bottom: 0; }
.answer-quote { border-inline-start: 3px solid var(--accent); padding-block: 4px; padding-inline-start: 12px; font-size: 15.5px; }
.src-card { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin: 10px 0; background: var(--surface-2); }
.src-card h4 { font-weight: 650; font-size: 15px; margin: 6px 0; }
.src-card blockquote { margin: 8px 0; padding: 12px 14px; background: var(--surface-solid); border-radius: 12px; border: 1px solid var(--line-2); font-size: 14px; line-height: 1.8; max-height: 320px; overflow: auto; }
.src-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--ink-3); }
.src-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.src-foot .btn { margin-inline-start: auto; }
.trace { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.trace summary { cursor: pointer; font-weight: 600; }
.trace ol { margin: 6px 0 0; padding-left: 18px; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12px; direction: ltr; text-align: left; }
.msg-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.composer { position: sticky; bottom: 0; padding: 14px 0 8px; background: linear-gradient(transparent, var(--bg) 35%); }
.composer form { display: flex; gap: 8px; background: var(--surface); backdrop-filter: var(--glass); border: 1px solid var(--line); border-radius: 20px; padding: 7px; padding-inline-start: 18px; box-shadow: var(--sh-2); }
.composer input { flex: 1; border: 0; background: none; font: 15.5px var(--f); color: var(--ink); min-width: 0; }
.composer input:focus { outline: none; }
.suggests { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.suggest { border: 1px solid var(--line); background: var(--surface); backdrop-filter: var(--glass); border-radius: 14px; padding: 10px 14px; font-size: 13.5px; cursor: pointer; text-align: start; color: var(--ink-2); max-width: 460px; transition: transform .15s var(--spring), border-color .15s; }
.suggest:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.chat-intro { padding: 10px 0 20px; }
.a-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.a-kpi { background: var(--surface-2); border-radius: 14px; padding: 11px 13px; }
.a-kpi span { font-size: 12.5px; color: var(--ink-3); display: block; }
.a-kpi strong { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; display: block; }
.a-kpi em { font-style: normal; font-size: 12.5px; color: var(--ink-2); }
.cover-bar { margin: 20px 0 6px; position: relative; padding-top: 22px; }
.cb-track { height: 16px; border-radius: 6px; background: var(--available); display: flex; overflow: hidden; gap: 2px; }
.cb-seg { height: 100%; } .cb-conf { background: var(--confirmed); } .cb-res { background: var(--reserved); }
.cb-cost { position: absolute; top: 0; bottom: 26px; border-inline-start: 2px dashed var(--ink); }
.cb-cost span { position: absolute; top: -2px; inset-inline-start: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.cover-bar figcaption { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.hbars { display: flex; flex-direction: column; gap: 9px; margin: 14px 0; }
.hb-row { display: grid; grid-template-columns: 190px 1fr 110px; gap: 10px; align-items: center; font-size: 13.5px; }
.hb-track { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hb-fill { height: 100%; background: color-mix(in oklab, var(--ink-3) 55%, transparent); border-radius: 6px; }
.hb-fill.hl { background: var(--accent); }
.hb-val { text-align: end; font-weight: 600; }
.delta { font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 99px; display: inline-block; }
.delta.up { color: var(--ok); background: color-mix(in oklab, var(--ok) 12%, transparent); }
.delta.down { color: var(--bad); background: color-mix(in oklab, var(--bad) 12%, transparent); }
.slider-row { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; margin: 12px 0; flex-wrap: wrap; }
.slider-row input { flex: 1; min-width: 160px; accent-color: var(--accent); }
.slider-row span { font-weight: 500; color: var(--ink-3); }

/* ============ Spotlight ============ */
#spot[hidden] { display: none; }
#spot { position: fixed; inset: 0; z-index: 95; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
#spot .scrim { position: absolute; inset: 0; background: rgba(8, 11, 20, .32); backdrop-filter: blur(6px); animation: fadein .2s ease both; }
.spot-panel { position: relative; width: min(680px, 100%); border-radius: 24px; background: color-mix(in oklab, var(--surface-solid) 84%, transparent); backdrop-filter: blur(40px) saturate(180%); border: 1px solid var(--line); box-shadow: var(--sh-3); overflow: hidden; animation: sheetin .32s var(--spring) both; }
@keyframes sheetin { from { transform: translateY(-10px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } }
.spot-input { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.spot-input svg { width: 22px; height: 22px; color: var(--ink-3); flex: none; }
.spot-input input { flex: 1; border: 0; background: none; font: 500 20px var(--f); color: var(--ink); min-width: 0; }
.spot-input input:focus { outline: none; }
.spot-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.spot-sec { font-size: 12px; font-weight: 600; color: var(--ink-4); padding: 10px 12px 6px; }
.spot-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px; cursor: pointer; text-decoration: none; color: inherit; width: 100%; border: 0; background: none; text-align: start; }
.spot-item:hover, .spot-item.active { background: color-mix(in oklab, var(--accent) 12%, transparent); }
.spot-item .ic { width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--ink-2); }
.spot-item .ic svg { width: 16px; height: 16px; }
.spot-item > span:not(.ic):not(.go) { min-width: 0; }
.spot-item b { font-weight: 600; font-size: 14.5px; display: block; }
.spot-item small { color: var(--ink-3); font-size: 12.5px; display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.spot-item .go { margin-inline-start: auto; color: var(--ink-4); font-size: 12px; flex: none; }
.spot-foot { display: flex; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }

/* ============ Drawer / modal / toast ============ */
#drawer-scrim { position: fixed; inset: 0; background: rgba(8, 11, 20, .28); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 70; }
#drawer-scrim.show { opacity: 1; pointer-events: auto; }
#drawer { position: fixed; top: 12px; bottom: 12px; inset-inline-end: 12px; width: min(460px, calc(100vw - 24px)); background: color-mix(in oklab, var(--surface-solid) 92%, transparent); backdrop-filter: blur(30px) saturate(180%); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--sh-3); z-index: 71; transform: translateX(calc(100% + 24px)); transition: transform .42s var(--spring), visibility 0s .42s; display: flex; flex-direction: column; visibility: hidden; }
[dir="rtl"] #drawer { transform: translateX(calc(-100% - 24px)); }
#drawer.open { transform: none; visibility: visible; transition: transform .42s var(--spring); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { flex: 1; font-size: 19px; }
.drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 9px 12px; font-size: 14px; margin: 0 0 16px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
#modal[hidden] { display: none; }
#modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 11, 20, .45); backdrop-filter: blur(4px); animation: fadein .2s both; }
.modal-card { position: relative; background: var(--surface-solid); border-radius: 26px; width: min(640px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; box-shadow: var(--sh-3); animation: sheetin .32s var(--spring) both; border: 1px solid var(--line); }
.modal-card.wide { width: min(1100px, 100%); }
.modal-card.viewer { width: min(1180px, 100%); height: calc(100dvh - 40px); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.modal-foot .demo-note { margin-inline-end: auto; }
#toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; align-items: center; pointer-events: none; }
.toast { background: #0B0F1A; color: #F2F4F8; padding: 11px 18px; border-radius: 99px; box-shadow: 0 18px 40px -12px rgba(0,0,0,.5); display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 500; max-width: min(640px, 92vw); animation: island .45s var(--spring) both; transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateY(-8px) scale(.96); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: #34D399; flex: none; }
.toast.warn .toast-dot { background: #FBBF24; }
@keyframes island { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.popover { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; width: 390px; max-width: calc(100vw - 24px); max-height: 70vh; overflow: auto; background: color-mix(in oklab, var(--surface-solid) 92%, transparent); backdrop-filter: blur(30px) saturate(180%); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--sh-3); z-index: 60; animation: sheetin .28s var(--spring) both; }
.popover header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif { display: grid; grid-template-columns: 8px 1fr; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: inherit; }
.notif:hover { background: var(--line-2); }
.notif .unread { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 7px; }
.notif b { font-size: 14px; display: block; } .notif p { margin: 2px 0 6px; font-size: 13px; color: var(--ink-2); }
.chans { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-3); align-items: center; }
.chan { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); font-weight: 600; color: var(--ink-2); }
.chan i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.chan.sms i { background: var(--sms); } .chan.email i { background: var(--accent); }

.previews { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 16px; }
.phone { border-radius: 34px; background: #0B0D12; padding: 9px; box-shadow: var(--sh-3); }
.phone-screen { border-radius: 26px; overflow: hidden; height: 380px; display: flex; flex-direction: column; }
.phone-bar { padding: 12px 14px; color: #fff; font-size: 13px; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.phone-bar i { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; font-style: normal; font-size: 12px; }
/* SMS preview: a plain native messages thread, no buttons (SMS cannot carry them) */
.sms .phone-bar { background: #F2F2F7; color: #111; border-bottom: 1px solid #E1E1E6; } .sms .phone-bar i { background: #8E8E93; color: #fff; } .sms .phone-chat { background: #fff; }
.sms .bubble { background: #E9E9EB; box-shadow: none; border-radius: 16px; border-end-start-radius: 4px; }
.sms .bubble .slink { display: block; margin-top: 4px; color: #1f7adf; text-decoration: underline; direction: ltr; text-align: start; }
.phone-chat { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.bubble { background: #fff; color: #111; border-radius: 12px; border-end-start-radius: 3px; padding: 9px 11px; font-size: 12.5px; line-height: 1.55; max-width: 92%; box-shadow: 0 1px 1px rgba(0,0,0,.1); }
.bubble b { display: block; margin-bottom: 2px; }
.bubble time { display: block; text-align: end; font-size: 10.5px; color: #777; margin-top: 3px; }
.bubble .btnrow { display: flex; gap: 4px; margin-top: 6px; }
.bubble .btnrow span { flex: 1; text-align: center; border-top: 1px solid #e5e5e5; padding-top: 6px; color: #1f7adf; font-weight: 600; font-size: 12px; }
.mail { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; color: #1d2433; height: 398px; display: flex; flex-direction: column; box-shadow: var(--sh-3); }
.mail-head { padding: 12px 16px; border-bottom: 1px solid #e6e8ee; font-size: 12px; color: #5a6275; }
.mail-head b { color: #1d2433; display: block; font-size: 13.5px; }
.mail-body { padding: 16px; font-size: 13px; line-height: 1.6; overflow: auto; }
.mail-body .mbrand { display: flex; gap: 8px; align-items: center; font-weight: 700; margin-bottom: 12px; }
.mail-body .mbrand i { width: 24px; height: 24px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font-style: normal; font-size: 12px; }
.mail-body .mbtn { display: inline-block; background: var(--accent); color: #fff; padding: 8px 13px; border-radius: 9px; font-weight: 700; margin-top: 8px; font-size: 12.5px; }

.matrix th, .matrix td { text-align: center; } .matrix th:first-child, .matrix td:first-child { text-align: start; }
.role-card { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--surface-solid); }
.role-card header { padding: 16px 18px; color: #fff; }
.role-card header b { font-size: 17px; display: block; } .role-card header small { opacity: .8; }
.role-card.r-management header { background: linear-gradient(145deg, #1B2340, #0B1020); } .role-card.r-employee header { background: linear-gradient(145deg, var(--accent), color-mix(in oklab, var(--accent) 60%, #000)); } .role-card.r-admin header { background: linear-gradient(145deg, var(--gold), color-mix(in oklab, var(--gold) 55%, #000)); }
.role-card ul { margin: 0; padding-block: 12px 16px; padding-inline: 34px 18px; font-size: 13.5px; } .role-card li { margin: 4px 0; } .role-card li.no { color: var(--ink-3); text-decoration: line-through; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 12px; border: 3px solid var(--surface-solid); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.dropzone { border: 2px dashed var(--line); border-radius: var(--r-lg); padding: 24px; text-align: center; background: var(--surface); cursor: pointer; display: block; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone b { display: block; font-size: 15px; }
.lock { font-size: 12px; font-weight: 700; color: var(--bad); }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.mini-stat { display: flex; justify-content: space-between; font-size: 13.5px; margin: 12px 0 6px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-2); }
.empty-state.big { padding: 80px 20px; max-width: 580px; margin: 0 auto; }
.empty-state h1 { margin-bottom: 10px; font-size: 26px; }
.lock-glyph { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 18px; background: var(--surface-solid); border: 1px solid var(--line); position: relative; box-shadow: var(--sh-1); }
.lock-glyph::before { content: ''; position: absolute; left: 18px; top: 10px; width: 16px; height: 14px; border: 3px solid var(--ink-3); border-bottom: 0; border-radius: 9px 9px 0 0; }
.lock-glyph::after { content: ''; position: absolute; left: 14px; top: 24px; width: 28px; height: 18px; background: var(--ink-3); border-radius: 5px; }

/* paper viewer (documents & reports) */
.viewer-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 8px 0 24px; background: color-mix(in oklab, var(--ink) 7%, var(--bg)); border-radius: 16px; }
.sheet-frame { box-shadow: 0 18px 50px -18px rgba(0,0,0,.45); border-radius: 3px; overflow: hidden; background: #fff; flex: none; }
.sheet-frame > .sheet { transform-origin: top left; }
.paper-inline { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 18px; background: color-mix(in oklab, var(--ink) 7%, var(--bg)); border-radius: 20px; overflow: hidden; }

/* ============ Responsive ============ */
@media (max-width: 1240px) { .stage { grid-template-columns: 1fr; } .g-main, .g-side { grid-template-columns: 1fr; } .previews { grid-template-columns: 1fr 1fr; } .span-3, .span-4 { grid-column: span 6; } .span-5, .span-7, .span-8 { grid-column: span 12; } .role-switch > span { display: none; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; height: 100dvh; margin: 0; border-radius: 0; width: 280px; z-index: 80; transform: translateX(-105%); transition: transform .35s var(--spring); }
  [dir="rtl"] .side { transform: translateX(105%); }
  .side.open { transform: none !important; }
  .top { padding: 10px 16px; flex-wrap: wrap; }
  .spot-trigger { order: 5; flex-basis: 100%; max-width: none; }
  main#main { padding: 8px 16px 60px; }
  .g-2, .g-3, .board, .board.cols-4, .previews { grid-template-columns: 1fr; }
  .bento > * { grid-column: span 12 !important; }
  .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; }
  .me b, .me small { display: none; }
  .hb-row { grid-template-columns: 110px 1fr 84px; }
  .top-right { gap: 6px; flex: 1; justify-content: flex-end; min-width: 0; }
  .role-switch .seg button { padding: 5px 9px; font-size: 12.5px; }
  .stage-copy { padding: 22px; } .countdown b { font-size: 38px; }
  .ring-row { flex-wrap: wrap; }
  .page-head .actions { margin-inline-start: 0; }
  .kv { grid-template-columns: 110px 1fr; }
}
.menu-btn { display: none !important; }
@media (max-width: 900px) { .menu-btn { display: grid !important; } }
@media (max-width: 420px) { .top-right > .me { display: none; } }
@media (prefers-reduced-transparency: reduce) { .side, .panel, .top, .spot-panel, #drawer, .popover { backdrop-filter: none; background: var(--surface-solid); } }

/* polish (visual QA round 1) */
#toasts { top: 76px; }
.pulse { --pulse-fade: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent); -webkit-mask-image: var(--pulse-fade); mask-image: var(--pulse-fade); padding-inline: 24px; margin-inline: -24px; }
.metric .value { overflow-wrap: anywhere; }
[dir="rtl"] .metric .value { font-size: 30px; }

#toasts { top: auto; bottom: 24px; flex-direction: column-reverse; }

/* 3D hall respects the status/search filter, same as the 2D plan */
.iso.dim .iso-booth:not(.match) { opacity: .14; }
.iso.dim .iso-booth.match .f-t { stroke: #fff; stroke-width: .22; }

.badge[hidden] { display: none; }
