@import url('../assets/fonts/fonts.css');
:root {
  --bk: #0B0D12; --ch: #141820; --pn: #1C222C; --el: #252C37; --el2: #2c3440; --line: rgba(255,255,255,.07); --line2: rgba(255,255,255,.12);
  --o: #E57B24; --oh: #FF6A10; --o-soft: rgba(229,123,36,.12); --o-line: rgba(229,123,36,.38);
  --wt: #F7F8FA; --tx: #D9DEE6; --mu: #99A3B3; --mu2: #6B7484;
  --ok: #3ECF8E; --ok-soft: rgba(62,207,142,.12); --warn: #F5B544; --warn-soft: rgba(245,181,68,.12); --err: #EF5350; --err-soft: rgba(239,83,80,.12); --info: #7AA2FF; --info-soft: rgba(122,162,255,.12);
  --r: 14px; --r-sm: 10px; --r-lg: 20px;
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, 'DejaVu Sans', sans-serif; --font-en: 'Inter', 'Segoe UI', sans-serif;
  --side: 248px; --top: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bk); color: var(--tx); font-family: var(--font); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.en, .num { font-family: var(--font-en); }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
h1, h2, h3, h4 { margin: 0; color: var(--wt); font-weight: 700; line-height: 1.35; }
h1 { font-size: 26px; } h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
.muted { color: var(--mu); } .faint { color: var(--mu2); } .small { font-size: 12px; } .tiny { font-size: 11px; }
.orange { color: var(--o); } .okc { color: var(--ok); } .errc { color: var(--err); } .warnc { color: var(--warn); }
::selection { background: rgba(229,123,36,.35); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #2a313c; border-radius: 10px; border: 2px solid var(--bk); } ::-webkit-scrollbar-track { background: transparent; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: linear-gradient(180deg, #0f1218, #0B0D12); border-left: 1px solid var(--line); padding: 16px 12px 24px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 18px; }
.brand img { height: 34px; }
.brand .bt { display: flex; flex-direction: column; line-height: 1.1; }
.brand .bt b { font-family: var(--font-en); font-size: 17px; color: var(--wt); letter-spacing: -.01em; }
.brand .bt span { font-family: var(--font-en); font-size: 10px; color: var(--o); letter-spacing: .32em; margin-top: 3px; }
.nav-group { margin-top: 12px; }
.nav-title { font-size: 11px; color: var(--mu2); padding: 6px 12px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; }
.nav-title:hover { color: var(--mu); }
.nav-group.collapsed .nav-items { display: none; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; color: var(--mu); font-size: 13.5px; position: relative; transition: background .15s, color .15s; }
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.04); color: var(--tx); }
.nav-item.active { background: var(--o-soft); color: var(--wt); }
.nav-item.active::before { content: ''; position: absolute; right: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--o); }
.nav-item .badge { margin-inline-start: auto; }
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); font-size: 11px; color: var(--mu2); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: rgba(11,13,18,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.search { flex: 1; max-width: 420px; position: relative; }
.search input { width: 100%; background: var(--ch); border: 1px solid var(--line); border-radius: 10px; padding: 8px 36px 8px 12px; outline: none; }
.search input:focus { border-color: var(--o-line); }
.search svg { position: absolute; right: 11px; top: 10px; width: 16px; height: 16px; color: var(--mu2); }
.search-results { position: absolute; top: 44px; right: 0; left: 0; background: var(--pn); border: 1px solid var(--line2); border-radius: 12px; padding: 6px; box-shadow: 0 20px 40px rgba(0,0,0,.5); max-height: 380px; overflow: auto; }
.search-results a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px; } .search-results a:hover { background: var(--el); }
.top-spacer { flex: 1; }
.mode-pill { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line2); font-size: 12px; color: var(--tx); background: var(--ch); }
.mode-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--ch); cursor: pointer; color: var(--mu); }
.icon-btn:hover { color: var(--wt); border-color: var(--line2); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .badge { position: absolute; top: -5px; left: -5px; }
.estop { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 10px; border: 1px solid rgba(239,83,80,.45); background: var(--err-soft); color: #ffb4b2; cursor: pointer; font-weight: 600; font-size: 12.5px; }
.estop:hover { background: rgba(239,83,80,.22); }
.estop.on { background: var(--err); color: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(239,83,80,.18); } }
.avatar-btn { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(145deg, var(--o), var(--oh)); display: grid; place-items: center; color: #fff; font-weight: 700; cursor: pointer; border: 0; }
.content { padding: 24px; max-width: 1560px; width: 100%; margin: 0 auto; }
.banner { margin: 0 24px; margin-top: 14px; padding: 10px 16px; border-radius: 12px; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.banner.demo { background: rgba(122,162,255,.1); border: 1px solid rgba(122,162,255,.35); color: #c9d8ff; }
.banner.stop { background: var(--err-soft); border: 1px solid rgba(239,83,80,.45); color: #ffc9c8; }

/* ---------- primitives ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.crumb { font-size: 12px; color: var(--mu); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.crumb .en { color: var(--o); font-weight: 600; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; } .row.between { justify-content: space-between; } .row.nowrap { flex-wrap: nowrap; }
.stack { display: flex; flex-direction: column; gap: 12px; } .stack.lg { gap: 20px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } .g-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.card { background: linear-gradient(180deg, rgba(28,34,44,.92), rgba(22,27,35,.92)); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; position: relative; }
.card.flat { background: var(--ch); }
.card.hover { transition: border-color .2s, transform .2s; cursor: pointer; } .card.hover:hover { border-color: var(--o-line); transform: translateY(-2px); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-h h3 { display: flex; align-items: center; gap: 8px; }
.card-h .en { font-size: 12px; color: var(--o); font-weight: 600; }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; }
.sec-title h2 { font-size: 16px; } .sec-title .line { flex: 1; height: 1px; background: var(--line); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--el); color: var(--wt); cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; }
.btn:hover { background: var(--el2); border-color: rgba(255,255,255,.18); }
.btn.primary { background: linear-gradient(135deg, var(--o), var(--oh)); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 6px 18px rgba(229,123,36,.25); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; } .btn.danger { border-color: rgba(239,83,80,.4); color: #ffb4b2; background: var(--err-soft); } .btn.okb { border-color: rgba(62,207,142,.4); color: #b7f3d6; background: var(--ok-soft); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; } .btn.xs { padding: 3px 8px; font-size: 11px; border-radius: 7px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 15px; height: 15px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 99px; background: var(--o); color: #fff; font-size: 10.5px; font-weight: 700; font-family: var(--font-en); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; border: 1px solid var(--line2); color: var(--mu); white-space: nowrap; line-height: 20px; }
.pill .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); border-color: rgba(62,207,142,.3); }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(245,181,68,.3); }
.pill.err { color: var(--err); background: var(--err-soft); border-color: rgba(239,83,80,.3); }
.pill.info { color: var(--info); background: var(--info-soft); border-color: rgba(122,162,255,.3); }
.pill.o { color: var(--o); background: var(--o-soft); border-color: var(--o-line); }
.pill.run .d { animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line2); background: var(--ch); color: var(--mu); font-size: 12px; cursor: pointer; }
.chip.on { border-color: var(--o-line); color: var(--wt); background: var(--o-soft); }
.tag { font-family: var(--font-en); font-size: 10.5px; padding: 1px 7px; border-radius: 6px; background: rgba(255,255,255,.06); color: var(--mu); }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.kbd { font-family: var(--font-en); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line2); color: var(--mu); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--mu); }
.input, select.input, textarea.input { width: 100%; background: var(--ch); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 12px; outline: none; transition: border-color .15s; }
.input:focus { border-color: var(--o); box-shadow: 0 0 0 3px rgba(229,123,36,.15); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.6; }
textarea.mono, .mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12px; direction: ltr; text-align: left; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--tx); cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--o); }
.help { font-size: 11.5px; color: var(--mu2); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: right; font-weight: 500; font-size: 11.5px; color: var(--mu); padding: 10px 12px; background: rgba(255,255,255,.02); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: rgba(255,255,255,.025); }
.trunc { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* KPI */
.kpi { padding: 16px 18px; }
.kpi .kl { font-size: 12px; color: var(--mu); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi .kv { font-family: var(--font-en); font-size: 28px; font-weight: 700; color: var(--wt); letter-spacing: -.02em; margin-top: 6px; line-height: 1.1; }
.kpi .kv small { font-size: 13px; color: var(--mu); font-weight: 500; margin-inline-start: 4px; }
.kpi .ks { font-size: 11.5px; color: var(--mu2); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.kpi .delta.up { color: var(--ok); } .kpi .delta.down { color: var(--err); }
.kpi .spark { position: absolute; left: 14px; bottom: 12px; opacity: .9; }

/* empty states */
.empty { text-align: center; padding: 34px 20px; color: var(--mu); border: 1px dashed var(--line2); border-radius: var(--r); background: rgba(255,255,255,.01); }
.empty svg { width: 42px; height: 42px; color: var(--mu2); margin-bottom: 8px; }
.empty b { display: block; color: var(--tx); margin-bottom: 4px; font-size: 14px; }
.empty .btn { margin-top: 12px; }

/* progress */
.bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--oh), var(--o)); }
.ring { position: relative; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring .rv { position: absolute; text-align: center; }

/* live strip */
.live-strip { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; margin-bottom: 18px; }
.ls-item { display: flex; flex-direction: column; justify-content: center; padding: 8px 16px; border-radius: 12px; background: var(--ch); border: 1px solid var(--line); min-width: 110px; }
.ls-item .lv { font-family: var(--font-en); font-weight: 700; color: var(--wt); font-size: 18px; line-height: 1.2; }
.ls-item .lv em { font-style: normal; color: var(--o); }
.ls-item .ll { font-size: 11px; color: var(--mu); }
.ls-sum { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; border-color: rgba(229,123,36,.22); }
.hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 90% at 85% 0%, rgba(229,123,36,.13), transparent 60%); border-radius: inherit; }
.hero-l { padding: 24px 26px; display: flex; flex-direction: column; gap: 14px; position: relative; z-index: 1; }
.hero-r { position: relative; display: flex; align-items: flex-end; justify-content: center; padding: 18px 18px 0; background: linear-gradient(180deg, rgba(229,123,36,.04), rgba(229,123,36,.0)); border-right: 1px solid var(--line); }
.hero-r svg.illus { width: 100%; max-width: 460px; height: auto; }
.hero h1 { font-size: 24px; }
.hero .objective { padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.exec-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.health { display: flex; align-items: center; gap: 14px; }

/* department cards */
.dept-grid { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dept-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.dept-card .dc-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 0; gap: 8px; }
.dept-card .dc-name { display: flex; align-items: baseline; gap: 8px; }
.dept-card .dc-name b { color: var(--wt); font-size: 14px; }
.dept-card .dc-name .en { color: var(--o); font-size: 12px; font-weight: 600; }
.dept-card .dc-ill { height: 112px; padding: 6px 10px 0; display: flex; align-items: center; justify-content: center; }
.dept-card .dc-ill svg { width: 100%; height: 100%; }
.dept-card .dc-body { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); background: rgba(0,0,0,.12); }
.dept-card .roles { display: flex; gap: 4px; flex-wrap: wrap; }
.handoff-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: visible; }
.handoff-layer path { fill: none; stroke: var(--o); stroke-width: 1.6; stroke-dasharray: 5 7; opacity: .55; animation: dash 1.2s linear infinite; }
.handoff-layer circle { fill: var(--o); filter: drop-shadow(0 0 6px var(--o)); }
@keyframes dash { to { stroke-dashoffset: -24; } }

/* pipeline (سير العمل) */
.pipeline { display: flex; gap: 0; align-items: stretch; overflow-x: auto; padding-bottom: 4px; }
.pstep { flex: 1; min-width: 170px; padding: 14px; border-radius: 14px; background: var(--ch); border: 1px solid var(--line); position: relative; }
.pstep.active { border-color: var(--o-line); box-shadow: 0 0 0 1px rgba(229,123,36,.15) inset; }
.pstep .pn { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pstep .pnum { font-family: var(--font-en); font-weight: 700; color: var(--o); font-size: 12px; }
.pstep .picon { width: 30px; height: 30px; border-radius: 9px; background: var(--o-soft); border: 1px solid var(--o-line); display: grid; place-items: center; color: var(--o); }
.pstep .picon svg { width: 16px; height: 16px; }
.pstep b { color: var(--wt); font-size: 13.5px; display: block; }
.pstep ul { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12px; color: var(--mu); display: flex; flex-direction: column; gap: 3px; }
.pstep li::before { content: '✓'; color: var(--ok); margin-left: 6px; font-weight: 700; }
.parrow { display: grid; place-items: center; width: 26px; flex: none; color: var(--mu2); }
.pcounts { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: rgba(255,255,255,.015); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 140px; }
.kcol-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--mu); margin: 2px 4px 10px; }
.kcard { background: var(--pn); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s; }
.kcard:hover { border-color: var(--o-line); }
.kcard .kt { color: var(--wt); font-size: 13px; font-weight: 600; }
.kcard .km { font-size: 11.5px; color: var(--mu); margin-top: 4px; }
.needs-reply { border-color: rgba(229,123,36,.55) !important; box-shadow: 0 0 0 1px rgba(229,123,36,.2), 0 0 24px rgba(229,123,36,.08); }

/* content cards (poster style) */
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.poster { aspect-ratio: 9 / 13; border-radius: 16px; overflow: hidden; position: relative; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer;
  background: radial-gradient(90% 60% at 20% 0%, rgba(229,123,36,.35), transparent 60%), linear-gradient(170deg, #1d232d, #0d1015); border: 1px solid var(--line2); }
.poster:hover { border-color: var(--o-line); }
.poster .pidx { font-family: var(--font-en); font-size: 11px; color: var(--mu); display: flex; justify-content: space-between; align-items: center; }
.poster .ptitle { color: var(--wt); font-weight: 700; font-size: 16px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.poster .pfoot { display: flex; justify-content: space-between; align-items: center; }
.poster .pfoot img { height: 18px; opacity: .9; }
.poster::after { content: ''; position: absolute; left: -30px; bottom: -40px; width: 140px; height: 160px; background: url('../assets/brand/logo.svg') no-repeat center / contain; opacity: .07; transform: rotate(-12deg); }

/* timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; padding: 8px 0; align-items: start; border-bottom: 1px dashed var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; margin: 6px auto 0; background: var(--mu2); box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.tl-dot.ok { background: var(--ok); } .tl-dot.warn { background: var(--warn); } .tl-dot.err { background: var(--err); } .tl-dot.o { background: var(--o); } .tl-dot.info { background: var(--info); }
.day-track { position: relative; height: 70px; margin: 8px 6px 0; }
.day-track .axis { position: absolute; top: 26px; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--line2), var(--o-line), var(--line2)); }
.day-track .pt { position: absolute; top: 19px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--bk); transform: translateX(50%); cursor: pointer; }
.day-track .hr { position: absolute; top: 42px; font-family: var(--font-en); font-size: 10px; color: var(--mu2); transform: translateX(50%); }

/* workflow graph */
.graph-wrap { position: relative; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1px, transparent 0) 0 0 / 22px 22px, var(--ch); min-height: 320px; }
.graph { position: relative; }
.graph svg.edges { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.graph svg.edges path { fill: none; stroke: var(--line2); stroke-width: 2; }
.graph svg.edges path.done { stroke: rgba(62,207,142,.55); }
.graph svg.edges path.live { stroke: var(--o); stroke-dasharray: 6 6; animation: dash 1s linear infinite; }
.gnode { position: absolute; width: 210px; padding: 10px 12px; border-radius: 12px; background: var(--pn); border: 1px solid var(--line2); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.gnode:hover, .gnode.sel { border-color: var(--o); box-shadow: 0 0 0 3px rgba(229,123,36,.15); }
.gnode .gt { color: var(--wt); font-weight: 600; font-size: 12.5px; line-height: 1.4; }
.gnode .ga { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; color: var(--mu); }
.gnode .gk { position: absolute; top: -9px; left: 10px; }
.gnode[data-s="completed"] { border-color: rgba(62,207,142,.45); }
.gnode[data-s="running"] { border-color: var(--o); box-shadow: 0 0 18px rgba(229,123,36,.25); }
.gnode[data-s="waiting_approval"], .gnode[data-s="waiting_input"] { border-color: rgba(245,181,68,.6); }
.gnode[data-s="failed"], .gnode[data-s="dead_letter"], .gnode[data-s="rejected"] { border-color: rgba(239,83,80,.6); }
.gnode[data-s="limit_reached"] { border-color: rgba(239,83,80,.6); background: repeating-linear-gradient(-45deg, var(--pn), var(--pn) 8px, rgba(239,83,80,.06) 8px, rgba(239,83,80,.06) 16px); }
.gnode[data-s="skipped"], .gnode[data-s="cancelled"] { opacity: .5; }
.drawer { position: fixed; top: 0; left: 0; bottom: 0; width: min(620px, 92vw); background: #12161d; border-right: 1px solid var(--line2); z-index: 60; box-shadow: 30px 0 60px rgba(0,0,0,.5); display: flex; flex-direction: column; animation: slidein .2s ease; }
@keyframes slidein { from { transform: translateX(-30px); opacity: 0; } }
.drawer-h { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.drawer-b { padding: 18px 20px; overflow-y: auto; flex: 1; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; }

/* modal + toast */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(5,6,9,.62); backdrop-filter: blur(4px); padding: 20px; }
.modal-box { width: min(640px, 100%); max-height: 90vh; overflow: auto; background: #151a22; border: 1px solid var(--line2); border-radius: 18px; box-shadow: 0 40px 80px rgba(0,0,0,.6); }
.modal-box.wide { width: min(980px, 100%); }
.modal-h { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-b { padding: 20px 22px; }
.modal-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-start; gap: 8px; }
.toasts { position: fixed; bottom: 20px; left: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 280px; max-width: 420px; padding: 12px 14px; border-radius: 12px; background: #1c222c; border: 1px solid var(--line2); box-shadow: 0 16px 30px rgba(0,0,0,.5); font-size: 13px; animation: slidein .2s ease; }
.toast.err { border-color: rgba(239,83,80,.5); } .toast.ok { border-color: rgba(62,207,142,.5); } .toast.warn { border-color: rgba(245,181,68,.5); }
.notif-panel { position: absolute; top: 54px; left: 0; width: 380px; max-height: 520px; overflow: auto; background: #151a22; border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 30px 60px rgba(0,0,0,.55); z-index: 40; padding: 8px; }
.notif { padding: 10px 12px; border-radius: 10px; display: grid; grid-template-columns: 10px 1fr; gap: 10px; }
.notif:hover { background: rgba(255,255,255,.03); }
.notif.unread { background: rgba(229,123,36,.05); }

/* markdown */
.md { color: var(--tx); font-size: 13.5px; line-height: 1.8; overflow-wrap: anywhere; }
.md h1 { font-size: 18px; margin: 4px 0 10px; } .md h2 { font-size: 15px; margin: 18px 0 8px; color: var(--o); } .md h3 { font-size: 14px; margin: 14px 0 6px; }
.md p { margin: 6px 0; } .md ul, .md ol { margin: 6px 0; padding-right: 20px; }
.md blockquote { margin: 8px 0; padding: 8px 12px; border-right: 3px solid var(--o); background: var(--o-soft); border-radius: 8px; color: var(--mu); font-size: 12.5px; }
.md table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 12.5px; }
.md th, .md td { border: 1px solid var(--line2); padding: 6px 10px; text-align: right; } .md th { background: rgba(255,255,255,.03); color: var(--mu); font-weight: 500; }
.md code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: rgba(255,255,255,.06); padding: 1px 5px; border-radius: 5px; direction: ltr; unicode-bidi: isolate; }
pre.code { background: #0d1015; border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: auto; max-height: 420px; font-size: 12px; direction: ltr; text-align: left; margin: 0; white-space: pre-wrap; }

/* agents */
.agent-card { display: flex; flex-direction: column; gap: 10px; }
.agent-top { display: flex; gap: 12px; align-items: center; }
.agent-av { width: 54px; height: 54px; border-radius: 16px; flex: none; overflow: hidden; background: var(--ch); border: 1px solid var(--line2); }
.agent-av svg { width: 100%; height: 100%; display: block; }
.agent-av.lg { width: 96px; height: 96px; border-radius: 24px; }
.state-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--mu2); }
.state-dot.running { background: var(--o); box-shadow: 0 0 0 4px rgba(229,123,36,.2); animation: blink 1.2s infinite; }
.state-dot.queued, .state-dot.active { background: var(--info); } .state-dot.waiting_approval, .state-dot.waiting_input { background: var(--warn); } .state-dot.limit_reached { background: var(--err); } .state-dot.paused { background: var(--mu2); outline: 2px solid var(--mu2); outline-offset: 2px; }

/* video */
.player-frame { width: 100%; aspect-ratio: 9 / 16; max-height: 640px; border: 0; border-radius: 16px; background: #000; display: block; }
.player-frame.land { aspect-ratio: 16 / 9; }
video.vid { width: 100%; max-height: 620px; border-radius: 14px; background: #000; }
.scene-track { display: flex; gap: 3px; height: 34px; margin-top: 10px; }
.scene-track div { border-radius: 6px; background: var(--el); font-size: 10px; color: var(--mu); display: grid; place-items: center; overflow: hidden; white-space: nowrap; border: 1px solid var(--line); }
.scene-track div:nth-child(odd) { background: rgba(229,123,36,.12); border-color: var(--o-line); color: var(--tx); }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: 11px; color: var(--mu); text-align: center; padding: 4px; }
.cal .day { min-height: 104px; border-radius: 10px; background: var(--ch); border: 1px solid var(--line); padding: 6px; font-size: 11px; display: flex; flex-direction: column; gap: 3px; }
.cal .day.today { border-color: var(--o-line); }
.cal .day .dn { font-family: var(--font-en); color: var(--mu); font-size: 11px; }
.cal .ev { padding: 2px 6px; border-radius: 6px; background: var(--el); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.o { background: var(--o-soft); color: #ffd2ad; } .cal .ev.ok { background: var(--ok-soft); color: #b7f3d6; } .cal .ev.info { background: var(--info-soft); color: #cdd9ff; }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: #000 url('../assets/brand/hero-tile.jpg') center / cover no-repeat; }
.auth-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(270deg, rgba(11,13,18,1) 0%, rgba(11,13,18,0) 40%); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-box { width: min(420px, 100%); display: flex; flex-direction: column; gap: 16px; }

/* misc */
.loading { padding: 60px; text-align: center; color: var(--mu); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--o); animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { padding: 9px 14px; cursor: pointer; color: var(--mu); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13px; }
.tab.on { color: var(--wt); border-bottom-color: var(--o); }
.stat-line { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.stat-line:last-child { border-bottom: 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--mu); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; vertical-align: -1px; }
.guarantee { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 13px; }
.guarantee svg { width: 18px; height: 18px; color: var(--ok); flex: none; margin-top: 2px; }
.stepper { position: fixed; left: 18px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 20; }
.stepper a { width: 10px; height: 10px; border-radius: 50%; background: var(--el2); border: 1px solid var(--line2); position: relative; }
.stepper a:hover, .stepper a.on { background: var(--o); }
.stepper a span { position: absolute; left: 18px; top: -5px; white-space: nowrap; font-size: 11px; color: var(--mu); opacity: 0; transition: opacity .15s; pointer-events: none; background: var(--pn); padding: 1px 8px; border-radius: 6px; }
.stepper a:hover span { opacity: 1; }

@media (max-width: 1280px) { .dept-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1080px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3, .g-2-1, .g-1-2, .g-3-2 { grid-template-columns: 1fr; } .hero { grid-template-columns: 1fr; } .hero-r { border-right: 0; border-top: 1px solid var(--line); } .stepper { display: none; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; } .side { position: fixed; z-index: 70; right: 0; width: 270px; transform: translateX(100%); transition: transform .2s; } .side.open { transform: none; box-shadow: -30px 0 60px rgba(0,0,0,.5); }
  .menu-btn { display: grid !important; } .dept-grid, .g2 { grid-template-columns: 1fr 1fr; } .content { padding: 16px; } .top { padding: 0 14px; } .mode-pill .lbl, .estop .lbl { display: none; } .auth { grid-template-columns: 1fr; } .auth-art { display: none; } .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .dept-grid, .g2, .g4, .g5 { grid-template-columns: 1fr; } .search { display: none; } }
.menu-btn { display: none !important; }
.banner svg { width: 18px; height: 18px; flex: none; }
.estop { white-space: nowrap; } .estop svg { width: 15px; height: 15px; }
.mode-pill { white-space: nowrap; }
.handoff-layer { z-index: 0; } .dept-card { z-index: 1; }
.pill svg { width: 13px; height: 13px; }
table.t td:first-child { min-width: 170px; }
#scrub, .scene-track { direction: ltr; }
