/* =====================================================================
   Falcon Management System, Prototype 2: "Executive Corporate Command Center"
   Two-tier navigation · dense data grids · navy / corporate blue / cyan
   ===================================================================== */

:root {
  /* Brand */
  --navy-950: #0B1726;
  --navy-900: #0F1E31;
  --navy-800: #14263D;   /* primary navy */
  --navy-700: #1B3150;
  --navy-600: #25406A;
  --navy-500: #3A5A85;
  --navy-300: #8EA3BF;
  --navy-200: #B9C7DA;
  --blue-700: #1D4ED8;
  --blue-600: #2563EB;   /* corporate blue */
  --blue-500: #3B82F6;
  --blue-100: #DCE7FE;
  --blue-50:  #EEF3FF;
  --cyan-500: #06B6D4;   /* accent (on navy) */
  --cyan-700: #0E7490;   /* accent text on white (AA) */
  --cyan-50:  #E3F7FB;

  /* Neutrals */
  --bg: #F3F6FA;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #EEF2F7;
  --border: #DCE3EC;
  --border-strong: #C3CEDC;
  --text: #0F1C2E;
  --text-2: #334155;
  --text-3: #556578;     /* 5.6:1 on white, 5.2:1 on --bg */
  --text-inv: #FFFFFF;
  --text-inv-2: #B9C7DA; /* 8.5:1 on navy-800 */

  /* Status (text on tinted bg, all >= 4.5:1) */
  --ok: #157A3E;     --ok-bg: #E6F5EC;    --ok-bd: #B5E0C5;
  --warn: #9A4A06;   --warn-bg: #FEF3E2;  --warn-bd: #F7D29B;
  --bad: #B42318;    --bad-bg: #FDECEB;   --bad-bd: #F5B9B3;
  --info: #1D4ED8;   --info-bg: #EAF1FE;  --info-bd: #BCD0FB;
  --vio: #6230C9;    --vio-bg: #F1ECFD;   --vio-bd: #D3C4F6;
  --cy: #0B6A80;     --cy-bg: #E1F5F9;    --cy-bd: #A8DDE9;
  --neu: #475569;    --neu-bg: #EEF2F6;   --neu-bd: #D3DBE5;

  /* Charts */
  --c1: #2563EB; --c2: #06B6D4; --c3: #14263D; --c4: #7C9CC9; --c5: #F59E0B; --c6: #10B981; --c7: #A855F7; --c8: #94A3B8;

  --radius: 6px;        /* controls: buttons, inputs */
  --radius-sm: 4px;     /* tags, small chips */
  --radius-lg: 10px;    /* cards, panels, data grids, modals */
  /* Type scale */
  --fs-2xs: 11px; --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 30px;
  /* Spacing (4/8 grid) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  /* Motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1); --dur-1: 150ms; --dur-2: 200ms; --dur-3: 250ms;
  /* Semantic surfaces */
  --row-hover: #F4F7FC; --sel-bg: var(--navy-800); --sel-fg: #fff; --sel-sub: var(--navy-600);
  --chrome: var(--navy-800); --chrome-2: var(--navy-700); --chrome-rail: var(--navy-900); --chrome-line: var(--navy-700);
  --hero-bg: linear-gradient(180deg, #172C47 0%, #14263D 100%); --hero-line: rgba(255, 255, 255, .09);
  --sk-a: #E7ECF3; --sk-b: #F2F5F9;
  --note-info: #1E3A8A; --note-warn: #7A3A05; --note-bad: #8E1C13; --note-ok: #0F5A2D;
  --shadow-1: 0 1px 2px rgba(15, 30, 49, .06), 0 1px 1px rgba(15, 30, 49, .04);
  --chart-grid: #EDF1F6; --chart-tick: #5B6B7F; --chart-muted: #C9D3E0;
  --font-chart: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --rail-w: 76px;
  --sub-w: 240px;
  --top-h: 56px;
  --ctx-h: 44px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "IBM Plex Sans", "Segoe UI", Tahoma, "Geeza Pro", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--blue-600);
  --shadow-pop: 0 8px 28px rgba(15, 30, 49, .18), 0 1px 3px rgba(15, 30, 49, .12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
html[lang="ar"] body { font-family: var(--font-ar); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.005em; }
p { margin: 0; }
a { color: var(--blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.num, .tnum, td, .kpi-val, .metric-val { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: 8px; top: -40px; z-index: 1000; background: var(--blue-600); color: #fff; padding: 8px 12px; border-radius: var(--radius); }
.skip-link:focus { top: 8px; }
svg.lucide { width: 16px; height: 16px; stroke-width: 1.9; flex: none; }
[dir="rtl"] .flip-rtl svg, [dir="rtl"] svg.flip-rtl { transform: scaleX(-1); }

/* ---------------------------------------------------------------- Header */
.topbar {
  height: var(--top-h);
  background: var(--navy-800);
  color: var(--text-inv);
  display: flex; align-items: center; gap: 12px;
  padding-inline: 0 14px;
  border-bottom: 1px solid var(--navy-700);
  position: relative; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; width: calc(var(--rail-w) + var(--sub-w)); padding-inline-start: 18px; flex: none; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 6px; background: linear-gradient(140deg, var(--blue-600), var(--cyan-500)); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-weight: 600; font-size: 14px; line-height: 1.1; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--text-inv-2); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.menu-btn { display: none; }
.top-search { position: relative; flex: 1; max-width: 460px; }
.top-search input {
  width: 100%; height: 34px; border-radius: var(--radius); border: 1px solid var(--navy-600);
  background: var(--navy-900); color: #fff; padding-inline: 34px 52px;
}
.top-search input::placeholder { color: var(--navy-300); }
.top-search input:focus { outline: none; border-color: var(--cyan-500); box-shadow: 0 0 0 1px var(--cyan-500); }
.top-search > svg { position: absolute; inset-inline-start: 10px; top: 9px; color: var(--navy-300); }
.kbd { font-family: var(--mono); font-size: 10.5px; border: 1px solid var(--navy-500); color: var(--navy-200); border-radius: 3px; padding: 1px 5px; }
.top-search .kbd { position: absolute; inset-inline-end: 9px; top: 8px; }
.search-pop { position: absolute; top: 40px; inset-inline: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); max-height: 420px; overflow: auto; z-index: 60; }
.search-pop .sr-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--surface-3); }
.search-pop .sr-item[aria-selected="true"], .search-pop .sr-item:hover { background: var(--blue-50); }
.search-pop .sr-head { padding: 7px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.search-pop .sr-empty { padding: 16px 12px; color: var(--text-3); }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.tbtn {
  height: 34px; min-width: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: 1px solid transparent; color: var(--text-inv-2); border-radius: var(--radius); padding: 0 8px; position: relative;
}
.tbtn:hover { background: var(--navy-700); color: #fff; }
.tbtn.outlined { border-color: var(--navy-600); }
.tbtn .dot { position: absolute; top: 3px; inset-inline-end: 2px; min-width: 17px; height: 17px; border-radius: 9px; background: #E5484D; color: #fff; font-size: 10.5px; font-weight: 600; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--navy-800); }
.role-btn { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 4px; border-radius: var(--radius); background: transparent; border: 1px solid var(--navy-600); color: #fff; }
.role-btn:hover { background: var(--navy-700); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--blue-600); color: #fff; flex: none; }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.role-btn .rb-text { text-align: start; line-height: 1.15; }
.role-btn .rb-name { font-size: 13px; font-weight: 500; white-space: nowrap; }
.role-btn .rb-role { font-size: 11px; color: var(--text-inv-2); white-space: nowrap; }

/* Context / scope band */
.ctxbar {
  height: var(--ctx-h); background: var(--navy-700); color: var(--text-inv-2);
  display: flex; align-items: center; gap: 8px; padding-inline: 18px 14px; border-bottom: 1px solid var(--navy-900);
  position: relative; z-index: 25;
}
.ctx-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--navy-200); margin-inline-end: 4px; display: inline-flex; gap: 6px; align-items: center; }
.scope-chip {
  height: 26px; display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 10px;
  border-radius: 13px; border: 1px solid var(--navy-500); background: var(--navy-800); color: #fff; font-size: 12px; white-space: nowrap;
}
.scope-chip .sc-k { color: var(--navy-200); }
.scope-chip.set { border-color: var(--cyan-500); background: rgba(6, 182, 212, .14); }
.scope-chip .sc-open { background: none; border: 0; color: inherit; display: inline-flex; align-items: center; gap: 4px; padding: 0 4px; height: 24px; }
.scope-chip .sc-x { width: 20px; height: 20px; border-radius: 50%; border: 0; background: transparent; color: var(--navy-200); display: grid; place-items: center; }
.scope-chip .sc-x:hover { background: var(--navy-600); color: #fff; }
.scope-chip .sc-x svg { width: 13px; height: 13px; }
.ctx-right { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; font-size: 12px; white-space: nowrap; }
.ctx-right .clock { color: var(--navy-200); }
.ctx-link { background: none; border: 0; color: var(--navy-200); display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 6px; border-radius: var(--radius-sm); }
.ctx-link:hover { color: #fff; background: var(--navy-600); }
.sim-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 10px; border: 1px dashed var(--cyan-700); color: var(--cyan-700); background: var(--cyan-50); white-space: nowrap; }
.ctxbar .sim-badge { color: #8FE6F5; border-color: #3FA9BD; background: transparent; }

/* ---------------------------------------------------------------- Shell */
.shell {
  display: grid;
  grid-template-columns: var(--rail-w) var(--sub-w) minmax(0, 1fr);
  height: calc(100vh - var(--top-h) - var(--ctx-h));
}
.shell.sub-collapsed { grid-template-columns: var(--rail-w) 0 minmax(0, 1fr); }
.shell.sub-collapsed .subnav { visibility: hidden; border: 0; }
.rail {
  background: var(--navy-900); color: var(--text-inv-2); overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; padding: 6px 0 10px; scrollbar-width: none;
}
.rail-group { padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.rail-group:last-of-type { border-bottom: 0; }
.rail-cap { display: block; text-align: center; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--navy-300); padding: 6px 2px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail a {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px 6px; margin: 1px 6px;
  border-radius: var(--radius); color: var(--text-inv-2); font-size: 10.5px; line-height: 1.15; text-align: center; position: relative;
}
.rail a svg { width: 20px; height: 20px; }
.rail a:hover { background: var(--navy-700); color: #fff; text-decoration: none; }
.rail a[aria-current="true"] { background: var(--navy-600); color: #fff; }
.rail a[aria-current="true"]::before { content: ""; position: absolute; inset-inline-start: -6px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cyan-500); }
[dir="rtl"] .rail a[aria-current="true"]::before { border-radius: 3px 0 0 3px; }
.rail .rail-badge { position: absolute; top: 3px; inset-inline-end: 6px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; border-radius: 8px; background: var(--cyan-500); color: var(--navy-950); font-weight: 700; display: grid; place-items: center; }
.rail-foot { margin-top: auto; padding-top: 6px; }
.rail-foot button { width: calc(100% - 12px); margin: 2px 6px; background: none; border: 0; color: var(--navy-300); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; padding: 7px 2px; border-radius: var(--radius); }
.rail-foot button:hover { background: var(--navy-700); color: #fff; }

.subnav { background: var(--surface); border-inline-end: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }
.sub-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.sub-kicker { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); }
.sub-title { font-size: 16px; font-weight: 600; margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.sub-sec { border-bottom: 1px solid var(--surface-3); }
.sub-sec-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; background: none; border: 0; padding: 10px 16px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); font-weight: 600; }
.sub-sec-btn svg { width: 14px; height: 14px; transition: transform .15s; }
.sub-sec-btn[aria-expanded="false"] svg { transform: rotate(-90deg); }
[dir="rtl"] .sub-sec-btn[aria-expanded="false"] svg { transform: rotate(90deg); }
.sub-sec-body { padding: 0 8px 10px; }
.sub-sec-body[hidden] { display: none; }
.sub-link { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--radius); color: var(--text-2); font-size: 13px; }
.sub-link:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.sub-link[aria-current="page"] { background: var(--blue-50); color: var(--blue-700); font-weight: 600; box-shadow: inset 2px 0 0 var(--blue-600); }
[dir="rtl"] .sub-link[aria-current="page"] { box-shadow: inset -2px 0 0 var(--blue-600); }
.sub-link .cnt { margin-inline-start: auto; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sub-stat { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; font-size: 13px; color: var(--text-2); border-radius: var(--radius); }
.sub-stat:hover { background: var(--surface-3); text-decoration: none; }
.sub-stat b { font-variant-numeric: tabular-nums; font-size: 13px; }
.sub-stat .tone-bad { color: var(--bad); } .sub-stat .tone-warn { color: var(--warn); } .sub-stat .tone-ok { color: var(--ok); }
.sub-note { margin: 10px 16px; font-size: 12px; color: var(--text-3); line-height: 1.4; }
.backdrop { display: none; }

main#main { overflow: auto; min-width: 0; position: relative; }
.page { padding: 16px 22px 40px; max-width: 1680px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); margin-bottom: 4px; flex-wrap: wrap; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--blue-700); }
.crumbs svg { width: 12px; height: 12px; }
.page-title { font-size: 20px; line-height: 1.25; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- Buttons & inputs */
.btn {
  height: 32px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--navy-300); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.btn.primary:hover { background: var(--blue-700); border-color: var(--blue-700); }
.btn.navy { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.btn.navy:hover { background: var(--navy-700); }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.success:hover { background: #106532; }
.btn.danger { background: var(--surface); border-color: var(--bad-bd); color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; gap: 4px; }
.btn.sm svg { width: 14px; height: 14px; }
.btn.icon { width: 32px; padding: 0; }
.btn.sm.icon { width: 26px; }
.btn.spin svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.input, select.input, textarea.input {
  height: 32px; width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
  padding: 0 10px; font-size: 13px; min-width: 0;
}
textarea.input { height: auto; min-height: 70px; padding: 7px 10px; resize: vertical; }
.input:hover { border-color: var(--navy-300); }
.input:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.input:disabled { background: var(--surface-3); color: var(--text-3); }
.input.sm { height: 26px; font-size: 12px; padding: 0 7px; }
select.input { padding-inline-end: 26px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > .flabel { font-size: 12px; font-weight: 500; color: var(--text-2); }
.req { color: var(--bad); margin-inline-start: 2px; }
.field .help { font-size: 12px; color: var(--text-3); }
.field .err { font-size: 12px; color: var(--bad); display: none; align-items: center; gap: 4px; }
.field.has-error .input { border-color: var(--bad); }
.field.has-error .err { display: flex; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 14px; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; } .col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--blue-600); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; font-size: 13px; color: var(--text-2); border-inline-end: 1px solid var(--border); display: inline-flex; align-items: center; gap: 6px; }
.seg button:last-child { border-inline-end: 0; }
.seg button[aria-pressed="true"] { background: var(--navy-800); color: #fff; }
.seg.sm button { height: 26px; padding: 0 9px; font-size: 12px; }

/* ---------------------------------------------------------------- Cards / panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); min-height: 44px; }
.panel-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-title svg { color: var(--text-3); }
.panel-sub { font-size: 12px; color: var(--text-3); font-weight: 400; }
.panel-body { padding: 12px 14px; flex: 1; min-width: 0; }
.panel-body.flush { padding: 0; }
.panel-foot { border-top: 1px solid var(--border); padding: 8px 14px; font-size: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.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-9 { grid-column: span 9; } .span-12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 290px; }
.chart-box.short { height: 200px; }
.chart-box canvas { cursor: pointer; }

/* Metric tiles (light) */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 14px; overflow: hidden; }
.tile { padding: 10px 14px; border-inline-end: 1px solid var(--border); min-width: 0; background: var(--surface); text-align: start; border-top: 0; border-bottom: 0; border-inline-start: 0; }
.tile:last-child { border-inline-end: 0; }
button.tile:hover { background: var(--surface-2); }
.tile-k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; }
.tile-s { font-size: 12px; color: var(--text-3); }
.tile.t-bad .tile-v { color: var(--bad); } .tile.t-warn .tile-v { color: var(--warn); } .tile.t-ok .tile-v { color: var(--ok); }

/* Executive hero */
.hero { background: var(--navy-800); color: #fff; border-radius: var(--radius); border: 1px solid var(--navy-700); margin-bottom: 14px; overflow: hidden; }
.hero-top { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--navy-600); flex-wrap: wrap; }
.hero-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.hero-scope { font-size: 12px; color: var(--text-inv-2); }
.hero-top .seg { background: var(--navy-900); border-color: var(--navy-600); }
.hero-top .seg button { color: var(--text-inv-2); border-color: var(--navy-600); }
.hero-top .seg button[aria-pressed="true"] { background: var(--blue-600); color: #fff; }
.metrics { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.metric { padding: 12px 14px 13px; border-inline-end: 1px solid var(--navy-600); background: transparent; border-top: 0; border-bottom: 0; border-inline-start: 0; color: #fff; text-align: start; min-width: 0; position: relative; }
.metric:last-child { border-inline-end: 0; }
.metric:hover { background: var(--navy-700); }
.metric-k { font-size: 11px; color: var(--text-inv-2); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-k svg { width: 13px; height: 13px; color: var(--cyan-500); }
.metric-val { font-size: 26px; font-weight: 600; line-height: 1.15; margin-top: 4px; letter-spacing: -.01em; }
.metric-val small { font-size: 14px; font-weight: 500; color: var(--text-inv-2); }
.metric-d { font-size: 12px; margin-top: 3px; display: flex; align-items: center; gap: 3px; color: var(--text-inv-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-d svg { width: 13px; height: 13px; }
.metric-d.up { color: #6EE7A8; } .metric-d.down { color: #FCA5A1; } .metric-d.warn { color: #FCD38A; }
.metric .go { position: absolute; top: 10px; inset-inline-end: 10px; opacity: 0; color: var(--cyan-500); }
.metric:hover .go, .metric:focus-visible .go { opacity: 1; }
.metric:focus-visible { box-shadow: inset 0 0 0 2px var(--cyan-500); border-radius: 0; }

/* Exceptions */
.exc { list-style: none; margin: 0; padding: 0; }
.exc li { border-bottom: 1px solid var(--surface-3); }
.exc li:last-child { border-bottom: 0; }
.exc a, .exc .exc-row { display: grid; grid-template-columns: 4px 1fr auto; gap: 10px; align-items: center; padding: 9px 14px 9px 0; color: var(--text); }
.exc a:hover { background: var(--surface-2); text-decoration: none; }
.exc .sev { width: 4px; align-self: stretch; border-radius: 0 3px 3px 0; }
.sev-high { background: var(--bad); } .sev-med { background: #E08A1E; } .sev-low { background: var(--blue-500); }
.exc .exc-t { font-weight: 500; font-size: 13px; }
.exc .exc-s { font-size: 12px; color: var(--text-3); }
.exc .exc-n { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.exc .exc-n.high { color: var(--bad); } .exc .exc-n.med { color: var(--warn); } .exc .exc-n.low { color: var(--info); }

/* Pipeline */
.pipe { display: flex; flex-direction: column; gap: 12px; }
.pipe-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: center; }
.pipe-name { font-size: 13px; font-weight: 600; }
.pipe-name small { display: block; font-weight: 400; color: var(--text-3); font-size: 11px; }
.pipe-stages { display: flex; gap: 2px; min-width: 0; }
.pipe-stage {
  flex: 1 1 0; min-width: 0; border: 1px solid var(--border); background: var(--surface-2); padding: 5px 8px 5px 12px; text-align: start;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%);
  border-radius: 0;
}
.pipe-stage:first-child { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); padding-inline-start: 8px; }
[dir="rtl"] .pipe-stage { clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 50%, 100% 100%, 8px 100%, 0 50%); }
[dir="rtl"] .pipe-stage:first-child { clip-path: polygon(8px 0, 100% 0, 100% 100%, 8px 100%, 0 50%); }
.pipe-stage:hover { background: var(--blue-50); }
.pipe-stage .ps-n { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pipe-stage .ps-l { font-size: 10.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.pipe-stage.hot { background: var(--warn-bg); border-color: var(--warn-bd); }
.pipe-stage.hot .ps-n { color: var(--warn); }
.pipe-stage.done .ps-n { color: var(--ok); }
.pipe-stage.bad .ps-n { color: var(--bad); }

/* Feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 8px 14px; border-bottom: 1px solid var(--surface-3); }
.feed li:last-child { border-bottom: 0; }
.feed .f-ic { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-3); color: var(--navy-600); }
.feed .f-ic svg { width: 15px; height: 15px; }
.feed .f-t { font-size: 13px; }
.feed .f-s { font-size: 12px; color: var(--text-3); }
.feed .f-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.feed.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feed.cols li:nth-last-child(2):nth-child(odd) { border-bottom: 0; }

/* Approvals list */
.appr { list-style: none; margin: 0; padding: 0; }
.appr li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--surface-3); }
.appr li:last-child { border-bottom: 0; }
.appr .a-t { font-size: 13px; font-weight: 500; }
.appr .a-s { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid; line-height: 1; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.plain::before { display: none; }
.b-ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-bd); }
.b-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-bd); }
.b-bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-bd); }
.b-info { color: var(--info); background: var(--info-bg); border-color: var(--info-bd); }
.b-vio { color: var(--vio); background: var(--vio-bg); border-color: var(--vio-bd); }
.b-cy { color: var(--cy); background: var(--cy-bg); border-color: var(--cy-bd); }
.b-neu { color: var(--neu); background: var(--neu-bg); border-color: var(--neu-bd); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 12px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.tag.navy { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.sla { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.sla svg { width: 13px; height: 13px; }
.sla.ok { color: var(--ok); } .sla.warn { color: var(--warn); } .sla.bad { color: var(--bad); }

/* ---------------------------------------------------------------- Data grid */
.dg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.dg-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.dg-search { position: relative; width: 240px; max-width: 100%; }
.dg-search svg { position: absolute; inset-inline-start: 9px; top: 8px; color: var(--text-3); width: 15px; height: 15px; }
.dg-search .input { padding-inline-start: 30px; }
.views { display: flex; gap: 4px; flex-wrap: wrap; }
.view-chip { height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 12px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.view-chip:hover { border-color: var(--navy-300); background: var(--surface-2); }
.view-chip[aria-pressed="true"] { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.view-chip .vc-n { font-size: 11px; font-variant-numeric: tabular-nums; padding: 0 5px; border-radius: 8px; background: var(--surface-3); color: var(--text-2); }
.view-chip[aria-pressed="true"] .vc-n { background: var(--navy-600); color: #fff; }
.dg-tools { margin-inline-start: auto; display: flex; gap: 6px; align-items: center; position: relative; }
.dg-scope { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 12px; align-items: center; }
.fchip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 3px 0 8px; border-radius: 11px; background: var(--blue-50); border: 1px solid var(--blue-100); color: var(--blue-700); font-size: 12px; }
.fchip button { width: 18px; height: 18px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; color: inherit; padding: 0; }
.fchip button:hover { background: var(--blue-100); }
.fchip button svg { width: 12px; height: 12px; }
.dg-bulk { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--navy-800); color: #fff; font-size: 13px; flex-wrap: wrap; }
.dg-bulk .btn { background: var(--navy-700); border-color: var(--navy-500); color: #fff; }
.dg-bulk .btn:hover { background: var(--navy-600); }
.dg-bulk .btn.link { background: none; border-color: transparent; color: var(--navy-200); }
.dg-wrap { overflow: auto; max-height: max(360px, calc(100vh - 330px)); position: relative; }
.dg-wrap.auto-h { max-height: none; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.t th, table.t td { padding: 0 10px; height: 38px; border-bottom: 1px solid var(--surface-3); text-align: start; vertical-align: middle; }
table.t thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); white-space: nowrap; height: 34px; }
table.t thead tr.frow th { top: 34px; background: var(--surface); text-transform: none; letter-spacing: 0; height: 36px; padding: 4px 6px; font-weight: 400; }
table.t thead tr.frow .input { height: 26px; font-size: 12px; padding: 0 6px; }
table.t thead tr.frow select.input { padding-inline-end: 20px; }
table.t th .sort { background: none; border: 0; padding: 0; display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
table.t th .sort svg { width: 13px; height: 13px; opacity: .35; }
table.t th .sort.on svg { opacity: 1; color: var(--blue-700); }
table.t tbody tr { background: var(--surface); }
table.t tbody tr.clickable { cursor: pointer; }
table.t tbody tr:hover { background: #F5F8FD; }
table.t tbody tr.sel { background: var(--blue-50); }
table.t tbody tr.hl-bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
table.t tbody tr.hl-warn td:first-child { box-shadow: inset 3px 0 0 #E08A1E; }
[dir="rtl"] table.t tbody tr.hl-bad td:first-child { box-shadow: inset -3px 0 0 var(--bad); }
[dir="rtl"] table.t tbody tr.hl-warn td:first-child { box-shadow: inset -3px 0 0 #E08A1E; }
table.t tbody tr:focus-visible { outline: 2px solid var(--blue-600); outline-offset: -2px; box-shadow: none; }
table.t td.end, table.t th.end { text-align: end; }
table.t td.c, table.t th.c { text-align: center; }
table.t .cb { width: 36px; padding-inline: 10px 4px; }
table.t .cb input { width: 15px; height: 15px; accent-color: var(--blue-600); cursor: pointer; vertical-align: middle; }
table.t .acts { white-space: nowrap; text-align: end; width: 1%; }
table.t .acts .btn { margin-inline-start: 2px; }
.cell-main { font-weight: 500; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--text-3); }
.cell-2 { line-height: 1.25; }
.idlink { font-family: var(--mono); font-size: 12px; color: var(--blue-700); }
table.t.simple th { position: static; }
table.t.compact td { height: 32px; }
.dg-foot { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.dg-foot .pager { margin-inline-start: auto; display: flex; gap: 4px; align-items: center; }
.dg-foot select.input { width: auto; height: 26px; font-size: 12px; }
.pager .btn { min-width: 26px; }
.pager .btn[aria-current="true"] { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.colchooser { position: absolute; top: 36px; inset-inline-end: 0; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 8px; width: 220px; max-height: 340px; overflow: auto; }
.colchooser .check { display: flex; padding: 5px 6px; border-radius: 4px; }
.colchooser .check:hover { background: var(--surface-2); }
.colchooser-h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 2px 6px 6px; }
.empty { padding: 36px 20px; text-align: center; color: var(--text-3); }
.empty svg { width: 30px; height: 30px; color: var(--navy-300); margin-bottom: 6px; }
.empty .e-t { font-weight: 600; color: var(--text-2); font-size: 14px; }
.empty .btn { margin-top: 10px; }
.fbird { width: 30px; height: 30px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border); display: grid; place-items: center; flex: none; overflow: hidden; }
.fbird svg { width: 26px; height: 26px; }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; }

/* ---------------------------------------------------------------- Stepper / tracker */
.tracker { display: flex; align-items: flex-start; gap: 0; padding: 4px 0; overflow-x: auto; }
.tr-step { flex: 1 1 0; min-width: 110px; position: relative; padding-top: 0; }
.tr-step .tr-line { position: absolute; top: 13px; inset-inline-start: calc(50% + 16px); inset-inline-end: calc(-50% + 16px); height: 2px; background: var(--border); }
.tr-step:last-child .tr-line { display: none; }
.tr-step.done .tr-line { background: var(--ok); }
.tr-dot { width: 28px; height: 28px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; border: 2px solid var(--border-strong); background: var(--surface); color: var(--text-3); font-size: 12px; font-weight: 600; position: relative; z-index: 1; }
.tr-dot svg { width: 14px; height: 14px; }
.tr-step.done .tr-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tr-step.current .tr-dot { border-color: var(--blue-600); color: var(--blue-700); box-shadow: 0 0 0 4px var(--blue-100); }
.tr-step.rejected .tr-dot { background: var(--bad); border-color: var(--bad); color: #fff; }
.tr-step.skipped .tr-dot { border-style: dashed; }
.tr-label { text-align: center; font-size: 12px; font-weight: 600; margin-top: 6px; padding: 0 4px; }
.tr-step.todo .tr-label { color: var(--text-3); font-weight: 500; }
.tr-meta { text-align: center; font-size: 11px; color: var(--text-3); padding: 0 4px; line-height: 1.35; }

/* Wizard steps (form) */
.wsteps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; margin-bottom: 14px; }
.wstep { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border: 0; border-inline-end: 1px solid var(--border); background: var(--surface); text-align: start; min-width: 0; }
.wstep:last-child { border-inline-end: 0; }
.wstep .ws-n { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--text-3); flex: none; }
.wstep .ws-l { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wstep .ws-s { font-size: 11px; color: var(--text-3); }
.wstep[aria-current="step"] { background: var(--blue-50); box-shadow: inset 0 -2px 0 var(--blue-600); }
.wstep[aria-current="step"] .ws-n { border-color: var(--blue-600); color: var(--blue-700); }
.wstep.done .ws-n { background: var(--ok); border-color: var(--ok); color: #fff; }
.wstep.err .ws-n { background: var(--bad); border-color: var(--bad); color: #fff; }

/* Timeline */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl li { position: relative; padding: 0 0 14px 26px; }
[dir="rtl"] .tl li { padding: 0 26px 14px 0; }
.tl li::before { content: ""; position: absolute; inset-inline-start: 7px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.tl li:last-child::before { display: none; }
.tl .tl-dot { position: absolute; inset-inline-start: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--blue-600); background: var(--surface); }
.tl .tl-dot.ok { border-color: var(--ok); background: var(--ok-bg); } .tl .tl-dot.bad { border-color: var(--bad); background: var(--bad-bg); } .tl .tl-dot.warn { border-color: #E08A1E; background: var(--warn-bg); } .tl .tl-dot.cy { border-color: var(--cyan-700); background: var(--cy-bg); } .tl .tl-dot.vio { border-color: var(--vio); background: var(--vio-bg); } .tl .tl-dot.neu { border-color: var(--navy-300); }
.tl .tl-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 500; }
.tl .tl-m { font-size: 12px; color: var(--text-3); }
.tl .tl-b { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.tl .tl-c { font-size: 12px; color: var(--text-2); margin-top: 4px; padding: 6px 9px; background: var(--surface-2); border-inline-start: 2px solid var(--border-strong); border-radius: 0 4px 4px 0; }

/* Key-value */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0; border-top: 1px solid var(--surface-3); }
.kv > div { padding: 8px 0; border-bottom: 1px solid var(--surface-3); padding-inline-end: 12px; min-width: 0; }
.kv dt, .kv .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.kv dd, .kv .v { margin: 2px 0 0; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.kv.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sec-h { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 600; margin: 16px 0 6px; display: flex; align-items: center; gap: 8px; }
.sec-h:first-child { margin-top: 0; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tab { height: 38px; padding: 0 14px; border: 0; background: none; font-size: 13px; font-weight: 500; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--blue-700); border-bottom-color: var(--blue-600); font-weight: 600; }
.tab .cnt { font-size: 11px; background: var(--surface-3); border-radius: 8px; padding: 0 6px; color: var(--text-2); }

/* ---------------------------------------------------------------- Falcon profile */
.prof-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; padding: 14px; align-items: start; }
.photos { display: flex; gap: 8px; }
.photo { width: 104px; text-align: center; }
.photo .ph { width: 104px; height: 92px; border-radius: var(--radius); background: linear-gradient(160deg, #E8EEF6, #D5DFEC); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; }
.photo .ph.none { background: var(--surface-2); border-style: dashed; color: var(--text-3); font-size: 11px; }
.photo .ph svg { width: 86px; height: 76px; }
.photo .pl { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.prof-name { font-size: 22px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prof-ar { font-family: var(--font-ar); font-size: 16px; color: var(--text-2); }
.prof-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.prof-meta > div { min-width: 0; }
.prof-meta .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.prof-meta .v { font-size: 13px; font-weight: 500; }
.qa { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lineage { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lin-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; gap: 10px; align-items: center; background: var(--surface-2); }
a.lin-card:hover { border-color: var(--blue-600); text-decoration: none; background: var(--blue-50); }
.lin-card .lc-k { font-size: 11px; text-transform: uppercase; color: var(--text-3); letter-spacing: .05em; }
.lin-card .lc-v { font-weight: 600; color: var(--text); }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--surface-3); }
.doc-row .d-ic { width: 32px; height: 32px; border-radius: 5px; background: var(--blue-50); color: var(--blue-700); display: grid; place-items: center; flex: none; }
.doc-row .d-n { font-weight: 500; font-size: 13px; }
.doc-row .d-s { font-size: 12px; color: var(--text-3); }
.doc-row .btn { margin-inline-start: auto; }
.drop { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 14px; text-align: center; color: var(--text-3); font-size: 13px; background: var(--surface-2); }

/* ---------------------------------------------------------------- Picker */
.picker { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.picker-top { padding: 8px; border-bottom: 1px solid var(--border); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.picker-top .input { flex: 1; min-width: 160px; }
.picker-list { max-height: 240px; overflow: auto; }
.picker-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--surface-3); cursor: pointer; font-size: 13px; }
.picker-item:hover { background: var(--surface-2); }
.picker-item.on { background: var(--blue-50); }
.picker-item.dis { opacity: .55; cursor: not-allowed; }
.picker-item input { accent-color: var(--blue-600); width: 15px; height: 15px; }
.picker-sel { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-top: 1px solid var(--border); background: var(--surface-2); min-height: 38px; align-items: center; }

/* ---------------------------------------------------------------- Boards / cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-t { font-weight: 600; font-size: 14px; }
.card-s { font-size: 12px; color: var(--text-3); }
.big-n { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.fchip-link { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.fchip-link:hover { border-color: var(--blue-600); color: var(--blue-700); text-decoration: none; background: var(--blue-50); }
.bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--blue-600); border-radius: 4px; }
.bar.warn > span { background: #E08A1E; } .bar.bad > span { background: var(--bad); } .bar.ok > span { background: var(--ok); }
.region-h { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; margin: 4px 0 8px; display: flex; align-items: center; gap: 8px; }
.region-h::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.egg-list { display: flex; flex-direction: column; gap: 4px; }
.egg-row { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 4px 6px; border-radius: 4px; background: var(--surface-2); }
.egg-row.near { background: var(--warn-bg); }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-inline-start: 1px solid var(--border); }
.cal-h { padding: 6px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); background: var(--surface-2); border-inline-end: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal-d { min-height: 96px; padding: 4px 5px; border-inline-end: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); min-width: 0; }
.cal-d.out { background: var(--surface-2); }
.cal-d.out .cal-n { color: var(--navy-300); }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--blue-600); }
.cal-n { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 3px; display: flex; justify-content: space-between; }
.cal-ev { display: block; width: 100%; font-size: 11px; padding: 2px 5px; border-radius: 3px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; text-align: start; border-inline-start: 3px solid; }
.cal-ev.s-Scheduled { background: var(--info-bg); color: var(--info); border-color: var(--blue-600); }
.cal-ev.s-Overdue { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.cal-ev.s-Completed { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.cal-ev.s-Cancelled { background: var(--neu-bg); color: var(--neu); border-color: var(--navy-300); text-decoration: line-through; }
.cal-more { font-size: 11px; color: var(--text-3); }

/* Matrix */
.mx td.low { background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.mx td.na { color: var(--navy-300); }
.mx td .lowtag { font-size: 10px; margin-inline-start: 4px; }

/* Reports */
.rep-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
.rep-rail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; }
.rep-cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.rep-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.rep-card:hover { border-color: var(--blue-600); text-decoration: none; background: var(--blue-50); }
.rep-card .r-ic { width: 34px; height: 34px; border-radius: 6px; background: var(--navy-800); color: var(--cyan-500); display: grid; place-items: center; flex: none; }
.rep-card .r-t { font-weight: 600; font-size: 13px; }
.rep-card .r-d { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------------------------------------------------------------- Overlays */
.ov { position: fixed; inset: 0; background: rgba(11, 23, 38, .48); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; animation: fade .12s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--radius); width: 560px; max-width: 100%; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); border: 1px solid var(--border); }
.modal.lg { width: 820px; } .modal.sm { width: 440px; } .modal.xl { width: 1000px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); gap: 10px; }
.modal-t { font-size: 16px; font-weight: 600; }
.modal-b { padding: 14px 16px; overflow: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }
.drawer-ov { position: fixed; inset: 0; background: rgba(11, 23, 38, .28); z-index: 70; animation: fade .12s; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: 520px; max-width: 100vw; background: var(--surface); z-index: 71; display: flex; flex-direction: column; border-inline-start: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: slide .16s ease-out; }
.drawer.wide { width: 680px; }
@keyframes slide { from { transform: translateX(24px); opacity: .4; } }
[dir="rtl"] .drawer { animation-name: slide-r; }
@keyframes slide-r { from { transform: translateX(-24px); opacity: .4; } }
.drawer-h { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); }
.drawer-h .d-kick { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.drawer-h .d-title { font-size: 16px; font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.drawer-b { padding: 14px 16px; overflow: auto; flex: 1; }
.drawer-f { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--surface-2); }
.pop { position: absolute; z-index: 90; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 6px; min-width: 220px; color: var(--text); max-height: 70vh; overflow: auto; }
.pop-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; background: none; text-align: start; border-radius: 4px; font-size: 13px; color: var(--text); }
.pop-item:hover, .pop-item:focus-visible { background: var(--blue-50); }
.pop-item[aria-checked="true"] { font-weight: 600; color: var(--blue-700); }
.pop-item .pi-s { margin-inline-start: auto; font-size: 11px; color: var(--text-3); }
.pop-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); padding: 6px 10px 4px; }
.pop-sep { height: 1px; background: var(--border); margin: 4px 0; }
.notif-pop { width: 380px; padding: 0; }
.np-h { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.np-list { max-height: 400px; overflow: auto; }
.np-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--surface-3); cursor: pointer; align-items: start; }
.np-item:hover { background: var(--surface-2); }
.np-item.unread { background: #F6F9FF; }
.np-item.unread .np-t { font-weight: 600; }
.np-item .np-ic { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; }
.np-ic.approval { background: var(--warn-bg); color: var(--warn); } .np-ic.reminder { background: var(--info-bg); color: var(--info); } .np-ic.error { background: var(--bad-bg); color: var(--bad); } .np-ic.info { background: var(--cy-bg); color: var(--cy); }
.np-t { font-size: 13px; }
.np-b { font-size: 12px; color: var(--text-3); }
.np-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.np-f { padding: 8px 12px; text-align: center; font-size: 13px; }
.udot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-600); display: inline-block; }

#toasts { position: fixed; bottom: 18px; inset-inline-end: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 280px; max-width: 420px; background: var(--navy-800); color: #fff; border-radius: var(--radius); padding: 10px 12px; display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: start; box-shadow: var(--shadow-pop); border-inline-start: 4px solid var(--cyan-500); animation: slide .18s ease-out; font-size: 13px; }
.toast.ok { border-inline-start-color: #34D399; } .toast.bad { border-inline-start-color: #F87171; } .toast.warn { border-inline-start-color: #FBBF24; }
.toast button { background: none; border: 0; color: var(--navy-200); padding: 0; }
.toast .t-s { font-size: 12px; color: var(--navy-200); }

/* Notice / callouts */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: var(--radius); border: 1px solid var(--info-bd); background: var(--info-bg); color: #1E3A8A; font-size: 13px; margin-bottom: 12px; }
.note.warn { border-color: var(--warn-bd); background: var(--warn-bg); color: #7A3A05; }
.note.bad { border-color: var(--bad-bd); background: var(--bad-bg); color: #8E1C13; }
.note.ok { border-color: var(--ok-bd); background: var(--ok-bg); color: #0F5A2D; }
.note.neu { border-color: var(--border); background: var(--surface-2); color: var(--text-2); }
.note svg { margin-top: 1px; }

/* Approval panel */
.approval { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.approval-h { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--navy-800); color: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.approval-h .panel-title svg { color: var(--cyan-500); }
.approval-b { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.sla-meter { display: flex; flex-direction: column; gap: 4px; }
.sla-meter .bar { height: 6px; }

/* Skeleton */
.skel { padding: 16px 22px; }
.sk { background: linear-gradient(90deg, #E7ECF3 0%, #F2F5F9 50%, #E7ECF3 100%); background-size: 200% 100%; animation: shimmer 1s infinite linear; border-radius: 4px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* 404 / restricted */
.nf { max-width: 520px; margin: 8vh auto; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.nf .nf-code { font-size: 54px; font-weight: 600; color: var(--navy-800); letter-spacing: -.02em; line-height: 1; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1360px) {
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metric:nth-child(4n) { border-inline-end: 0; }
  .metric:nth-child(-n+4) { border-bottom: 1px solid var(--navy-600); }
}
@media (max-width: 1280px) {
  .span-3.r-6 { grid-column: span 6; }
  .span-4.r-6 { grid-column: span 6; }
  .span-5.r-12, .span-7.r-12, .span-8.r-12, .span-4.r-12 { grid-column: span 12; }
  .brand { width: auto; padding-inline-end: 8px; }
}
@media (max-width: 1100px) {
  .shell, .shell.sub-collapsed { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .subnav { position: fixed; top: calc(var(--top-h) + var(--ctx-h)); bottom: 0; inset-inline-start: var(--rail-w); width: var(--sub-w); z-index: 40; transform: translateX(-110%); transition: transform .18s; box-shadow: var(--shadow-pop); visibility: hidden; }
  [dir="rtl"] .subnav { transform: translateX(110%); }
  .shell.sub-open .subnav { transform: none; visibility: visible; }
  .shell.sub-collapsed .subnav { border-inline-end: 1px solid var(--border); }
  .shell.sub-open .backdrop { display: block; position: fixed; inset: 0; top: calc(var(--top-h) + var(--ctx-h)); background: rgba(11, 23, 38, .3); z-index: 35; }
  .menu-btn { display: inline-flex; }
  .brand { padding-inline-start: 10px; }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9 { grid-column: span 12; }
  .span-3.r-6, .span-4.r-6, .span-6.r-6 { grid-column: span 6; }
  .rep-layout { grid-template-columns: 1fr; }
  .rep-rail { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .prof-head { grid-template-columns: 1fr; }
  .qa { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .ctx-right .clock { display: none; }
}
@media (max-width: 900px) {
  :root { --rail-w: 64px; }
  .rail a { font-size: 9.5px; margin: 1px 4px; }
  .rail-cap { font-size: 8px; }
  .brand-sub { display: none; }
  .role-btn .rb-text { display: none; }
  .top-search .kbd { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(n) { border-inline-end: 1px solid var(--navy-600); border-bottom: 1px solid var(--navy-600); }
  .metric:nth-child(2n) { border-inline-end: 0; }
  .span-3.r-6, .span-4.r-6, .span-6.r-6 { grid-column: span 12; }
  .page { padding: 14px 14px 32px; }
  .wsteps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wstep:nth-child(2) { border-inline-end: 0; }
  .wstep:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .col-3, .col-4 { grid-column: span 6; }
  .col-6, .col-8 { grid-column: span 12; }
  .feed.cols { grid-template-columns: 1fr; }
  .ctxbar { overflow-x: auto; scrollbar-width: none; }
  .ctx-label span { display: none; }
  .photos { flex-wrap: wrap; }
  .lineage { grid-template-columns: 1fr; }
  .kv.two { grid-template-columns: 1fr; }
  .drawer, .drawer.wide { width: 100vw; }
}
@media (max-width: 640px) {
  .shell, .shell.sub-collapsed { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; top: calc(var(--top-h) + var(--ctx-h)); bottom: 0; inset-inline-start: 0; z-index: 41; transform: translateX(-110%); transition: transform .18s; width: var(--rail-w); }
  .shell.sub-open .rail { transform: none; }
  .tbtn.lang-btn .lbl { display: none; }
  .col-3, .col-4 { grid-column: span 12; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------------------------------------------------------------- Print */
@media print {
  body { overflow: visible; background: #fff; }
  .topbar, .ctxbar, .rail, .subnav, .page-actions, .dg-toolbar, .dg-foot, .rep-rail, #toasts, .no-print, .dg-bulk, table.t thead tr.frow { display: none !important; }
  .shell { display: block; height: auto; }
  main#main { overflow: visible; }
  .dg-wrap { max-height: none; overflow: visible; }
  .panel, .dg { border-color: #999; break-inside: avoid; }
  table.t thead th { position: static; }
  .rep-layout { display: block; }
}

/* ---------------------------------------------------------------- Refinements (QA pass 1) */
.metric-k { white-space: normal; line-height: 1.25; min-height: 27px; align-items: flex-start; overflow: visible; }
.metric-k svg { margin-top: 1px; }
.metric-d { white-space: normal; line-height: 1.3; overflow: visible; }
.photo .ph.none { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.photo .ph.none svg { width: 22px; height: 22px; }
.tabs.wrap { flex-wrap: wrap; overflow: visible; }
.tabs.wrap .tab { padding: 0 10px; }
/* frozen actions column in wide grids */
table.t thead th.acts { position: sticky; inset-inline-end: 0; z-index: 3; }
table.t td.acts { position: sticky; inset-inline-end: 0; z-index: 1; background: inherit; box-shadow: inset 1px 0 0 var(--surface-3); }
[dir="rtl"] table.t td.acts { box-shadow: inset -1px 0 0 var(--surface-3); }
table.t td.acts:empty { box-shadow: none; }
/* RTL: English content paragraphs keep their own direction */
[dir="rtl"] .page-sub, [dir="rtl"] .metric-d, [dir="rtl"] .hero-scope, [dir="rtl"] .panel-sub, [dir="rtl"] .sub-note, [dir="rtl"] .tile-s,
[dir="rtl"] .exc-s, [dir="rtl"] .f-s, [dir="rtl"] .a-s, [dir="rtl"] .clock, [dir="rtl"] .np-b, [dir="rtl"] .card-s, [dir="rtl"] .note > div, [dir="rtl"] .help { unicode-bidi: plaintext; }

/* =====================================================================
   DESIGN REFINEMENT v2
   Shape rule: controls 6px, cards/panels/grids/modals 10px, chips and badges pill.
   Motion: 150-250ms ease-out for UI state, exits faster than entrances, transform/opacity only.
   ===================================================================== */
html { color-scheme: light; -webkit-tap-highlight-color: transparent; }
body { font-size: var(--fs-md); text-rendering: optimizeLegibility; }
h1, h2, h3 { text-wrap: balance; }
button, a, [role="button"] { touch-action: manipulation; }
.boot { padding: 40px; color: var(--text-3); font-family: var(--font); }
.tnum, .mono, td.end, .num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; box-shadow: none; }
.btn:focus-visible, .input:focus-visible { outline-offset: 1px; }
body.login-mode #app { display: none; }
#view.enter { animation: pageIn var(--dur-3) var(--ease-out) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------------- Top bar */
.topbar { background: var(--chrome); border-bottom-color: var(--chrome-line); gap: 0; padding-inline-end: 16px; }
.brand { padding-inline-start: 22px; gap: 12px; width: calc(var(--rail-w) + var(--sub-w)); }
body.sub-collapsed .brand { width: calc(var(--rail-w) + 168px); }
.brand-mark { width: 32px; height: 32px; background: none; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 4px 12px rgba(6, 182, 212, .18); }
.brand-mark svg { width: 32px; height: 32px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-size: var(--fs-md); font-weight: 600; letter-spacing: -.005em; }
.brand-sub { font-size: var(--fs-2xs); letter-spacing: .06em; color: var(--text-inv-2); }
.top-search { margin-inline-start: 24px; max-width: 520px; }
.top-search input { height: 36px; border-radius: 8px; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); transition: background var(--dur-1), border-color var(--dur-1); }
.top-search input:hover { background: rgba(255,255,255,.09); }
.top-search input:focus { background: var(--navy-950); }
.top-search > svg { top: 10px; }
.top-search .kbd { top: 9px; }
.top-actions { gap: 4px; }
.tbtn { height: 36px; min-width: 36px; border-radius: 8px; color: var(--text-inv-2); transition: background var(--dur-1), color var(--dur-1); }
.tbtn:hover { background: rgba(255,255,255,.08); }
.tbtn[aria-pressed="true"] { color: #FCD34D; }
.tbtn .dot { background: #D93036; border-color: var(--chrome); top: 2px; }
.top-sep { width: 1px; height: 24px; background: rgba(255,255,255,.14); margin-inline: 8px; }
.role-btn { height: 40px; border-color: transparent; border-radius: 8px; padding: 0 8px 0 4px; transition: background var(--dur-1); }
.role-btn:hover { background: rgba(255,255,255,.08); }
.role-btn .rb-text { display: flex; flex-direction: column; }
.role-btn .rb-name { font-size: var(--fs-sm); }
.role-btn .rb-role { font-size: var(--fs-2xs); }
.role-btn > svg { color: var(--text-inv-2); }

/* ---------------------------------------------------------------- Scope bar */
.ctxbar { background: var(--chrome-2); border-bottom: 1px solid rgba(0,0,0,.25); padding-inline: 0 16px; gap: 0; }
.ctx-label { width: var(--rail-w); flex: none; justify-content: center; margin: 0; font-size: var(--fs-2xs); letter-spacing: .1em; color: var(--navy-200); flex-direction: column; gap: 2px; }
.ctx-label svg { width: 16px; height: 16px; color: var(--cyan-500); }
.ctx-chips { display: flex; align-items: center; gap: 8px; padding-inline-start: 16px; min-width: 0; }
.scope-chip { height: 30px; padding: 0; gap: 0; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.04); transition: border-color var(--dur-1), background var(--dur-1); }
.scope-chip:hover { border-color: rgba(255,255,255,.32); background: rgba(255,255,255,.08); }
.scope-chip .sc-open { height: 28px; padding: 0 8px 0 10px; gap: 6px; border-radius: 7px; font-size: var(--fs-sm); }
.scope-chip .sc-open > svg:first-child { width: 14px; height: 14px; color: var(--navy-200); }
.scope-chip .sc-k { color: var(--navy-200); font-weight: 400; }
.scope-chip .sc-v { color: #fff; font-weight: 500; }
.scope-chip .sc-car { width: 14px; height: 14px; color: var(--navy-200); transition: transform var(--dur-1); }
.scope-chip .sc-open[aria-expanded="true"] .sc-car { transform: rotate(180deg); }
.scope-chip.set { border-color: rgba(34, 211, 238, .55); background: rgba(6, 182, 212, .14); }
.scope-chip.set .sc-open > svg:first-child { color: #67E8F9; }
.scope-chip .sc-x { width: 28px; height: 28px; border-radius: 0 7px 7px 0; border-inline-start: 1px solid rgba(34, 211, 238, .35); color: #A5F3FC; }
[dir="rtl"] .scope-chip .sc-x { border-radius: 7px 0 0 7px; }
.scope-chip .sc-x:hover { background: rgba(6, 182, 212, .28); color: #fff; }
.ctx-clear { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: #A5F3FC; font-size: var(--fs-sm); font-weight: 500; }
.ctx-clear svg { width: 14px; height: 14px; }
.ctx-clear:hover { background: rgba(255,255,255,.08); color: #fff; }
.ctx-right .clock { font-size: var(--fs-xs); color: var(--navy-200); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Rail */
.rail { background: var(--chrome-rail); padding-top: 8px; }
.rail-cap { font-size: 9.5px; letter-spacing: .12em; color: #7F95B3; padding-top: 8px; }
.rail a { font-size: var(--fs-2xs); padding: 8px 4px 7px; border-radius: 8px; transition: background var(--dur-1), color var(--dur-1); }
.rail a[aria-current="true"] { background: rgba(37, 99, 235, .22); color: #fff; }
.rail a[aria-current="true"] svg { color: #7DD3FC; }
.rail a[aria-current="true"]::before { top: 10px; bottom: 10px; }

/* ---------------------------------------------------------------- Secondary module panel */
.subnav { background: var(--surface); }
.sub-head { padding: 16px 16px 12px; }
.sub-kicker { font-size: var(--fs-2xs); letter-spacing: .1em; }
.sub-title { font-size: var(--fs-lg); letter-spacing: -.01em; flex-wrap: wrap; row-gap: 4px; }
.sub-sec { border-bottom: 1px solid var(--border); }
.sub-sec:last-of-type { border-bottom: 0; }
.sub-sec-btn { font-size: var(--fs-2xs); padding: 12px 16px 6px; border-radius: 0; }
.sub-sec-body { padding: 0 8px 12px; }
.sub-link { gap: 10px; padding: 7px 10px; font-size: var(--fs-sm); min-height: 34px; transition: background var(--dur-1); }
.sub-link > svg { color: var(--text-3); }
.sub-link[aria-current="page"] > svg { color: var(--blue-700); }
.sub-link .cnt { min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 10px; background: var(--surface-3); color: var(--text-2); font-weight: 500; }
.sub-stats { display: grid; gap: 2px; }
.sub-stat { min-height: 32px; font-size: var(--fs-sm); padding: 6px 10px; }
.sub-stat b { font-size: var(--fs-md); }
.sub-link.rec { align-items: center; }
.sub-link.rec .rec-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sub-link.rec .rec-t > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-s { font-size: var(--fs-2xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-empty { font-size: var(--fs-xs); color: var(--text-3); padding: 4px 10px 2px; line-height: 1.45; }
.health { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius); color: var(--text-2); min-height: 38px; }
.health:hover { background: var(--surface-3); text-decoration: none; }
.h-ic { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.h-ic svg { width: 14px; height: 14px; }
.h-ok { background: var(--ok-bg); color: var(--ok); } .h-warn { background: var(--warn-bg); color: var(--warn); } .h-bad { background: var(--bad-bg); color: var(--bad); }
.h-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; font-size: var(--fs-sm); font-weight: 500; color: var(--text); }
.h-s { font-size: var(--fs-2xs); color: var(--text-3); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-foot { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.sub-foot .sf-n { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-foot .sf-r { font-size: var(--fs-2xs); color: var(--text-3); }

/* ---------------------------------------------------------------- Page header */
.page { padding: 20px 24px 48px; }
.page-head { margin-bottom: 16px; align-items: flex-end; }
.crumbs { font-size: var(--fs-xs); margin-bottom: 6px; }
.page-title { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
.page-sub { font-size: var(--fs-sm); margin-top: 4px; max-width: 80ch; }

/* ---------------------------------------------------------------- Buttons */
.btn { height: 34px; border-radius: var(--radius); font-weight: 500; transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1), transform var(--dur-1); box-shadow: var(--shadow-1); }
.btn.ghost, .btn.link { box-shadow: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.sm { height: 28px; }
.btn.sm.icon { width: 28px; }
.btn.icon { width: 34px; }
.btn.lg { height: 44px; padding: 0 18px; font-size: var(--fs-md); border-radius: 8px; }
.btn.primary { box-shadow: 0 1px 2px rgba(37, 99, 235, .3), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-group { display: inline-flex; }
.btn-group > .btn { border-radius: 0; margin-inline-start: -1px; }
.btn-group > .btn:first-child { border-start-start-radius: var(--radius); border-end-start-radius: var(--radius); margin-inline-start: 0; }
.btn-group > .btn:last-child { border-start-end-radius: var(--radius); border-end-end-radius: var(--radius); }
.btn-group > .btn:hover { position: relative; z-index: 1; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue-700); font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.pop-item.danger { color: var(--bad); }

/* ---------------------------------------------------------------- Panels */
.panel, .dg, .tiles, .card, .approval, .rep-rail, .rep-card, .wsteps, .nf, .lin-card, .picker { border-radius: var(--radius-lg); }
.panel, .dg, .tiles, .card, .approval, .rep-card { box-shadow: var(--shadow-1); }
.grid12 { gap: 16px; }
.panel-head { padding: 12px 16px; min-height: 56px; }
.panel-title { align-items: flex-start; gap: 10px; min-width: 0; }
.panel-title > svg { margin-top: 2px; width: 16px; height: 16px; }
.pt-txt { display: flex; flex-direction: column; min-width: 0; }
.pt-txt h2 { font-size: var(--fs-md); font-weight: 600; line-height: 1.3; }
.pt-txt .panel-sub { font-size: var(--fs-xs); line-height: 1.35; margin-top: 1px; }
.panel-body { padding: 14px 16px; }
.panel-link { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; color: var(--blue-700); padding: 4px 6px; border-radius: var(--radius-sm); }
.panel-link svg { width: 14px; height: 14px; }
.chart-box { height: 252px; }
.legend-inline { display: flex; gap: 16px; font-size: var(--fs-xs); color: var(--text-3); margin-top: 8px; }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.lg-uae { background: var(--c1); } .lg-intl { background: var(--c2); }

/* Chart tooltip (HTML) */
.ctip { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 5; min-width: 140px; max-width: 260px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; box-shadow: var(--shadow-pop); font-size: var(--fs-xs); transition: opacity var(--dur-1), transform 90ms linear; opacity: 0; }
.ctip-h { font-weight: 600; margin-bottom: 4px; color: var(--text); }
.ctip-r { display: grid; grid-template-columns: 8px 1fr auto; gap: 8px; align-items: center; padding: 1px 0; color: var(--text-2); }
.ctip-r i { width: 8px; height: 8px; border-radius: 2px; }
.ctip-r b { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.ctip-s, .ctip-f { color: var(--text-3); font-size: var(--fs-2xs); padding-inline-start: 16px; }

/* ---------------------------------------------------------------- Executive summary band */
.hero { background: var(--hero-bg); border: 1px solid var(--navy-700); border-radius: var(--radius-lg); margin-bottom: 16px; box-shadow: 0 8px 24px rgba(15, 30, 49, .12); }
.hero-top { padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--hero-line); gap: 12px; }
.hero-title { gap: 10px; }
.hero-title svg { color: var(--cyan-500); }
.hero-title h2 { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.01em; }
.hero-scope { font-size: var(--fs-xs); color: var(--text-inv-2); padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.06); }
.hero-live { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-inv-2); font-variant-numeric: tabular-nums; }
.hero-live svg { width: 13px; height: 13px; }
.hero-top .seg { border-radius: 8px; background: rgba(0,0,0,.2); border-color: rgba(255,255,255,.14); }
.hero-top .seg button { height: 28px; padding: 0 12px; font-variant-numeric: tabular-nums; border-color: rgba(255,255,255,.1); }
.hero-top .seg button:hover { color: #fff; background: rgba(255,255,255,.06); }
.metric { padding: 14px 14px 14px 18px; border-inline-end: 1px solid var(--hero-line); display: flex; flex-direction: column; gap: 6px; transition: background var(--dur-1); }
.metric:hover { background: rgba(255,255,255,.05); }
.metric-k { min-height: 2.6em; font-size: var(--fs-xs); font-weight: 500; text-transform: none; letter-spacing: 0; gap: 6px; align-items: flex-start; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; color: #C7D3E3; }
.metric-k svg { margin-top: 1px; }
.metric-k span { overflow-wrap: normal; word-break: normal; hyphens: none; }
.metric-val { font-size: var(--fs-3xl); font-weight: 600; letter-spacing: -.02em; line-height: 1.05; margin-top: 2px; font-variant-numeric: tabular-nums; }
.metric-val small { font-size: var(--fs-lg); margin-inline-start: 1px; }
.metric-d { font-size: var(--fs-xs); font-weight: 500; gap: 5px; margin-top: auto; align-items: flex-start; white-space: normal; line-height: 1.3; }
.metric-d svg { width: 14px; height: 14px; margin-top: 1px; }
.metric-d.t-good { color: #6EE7A8; } .metric-d.t-bad { color: #FDA29B; } .metric-d.t-warn { color: #FCD38A; } .metric-d.t-neutral { color: #C7D3E3; }
.metric .go { top: 14px; inset-inline-end: 12px; width: 14px; height: 14px; transition: opacity var(--dur-1); }

/* ---------------------------------------------------------------- Exceptions, pipeline, feed */
.exc a, .exc .exc-row { grid-template-columns: 4px minmax(0,1fr) auto auto; padding: 10px 16px 10px 0; gap: 12px; }
.exc .exc-t { font-size: var(--fs-sm); }
.exc .exc-s { font-size: var(--fs-xs); }
.exc .exc-n { font-size: var(--fs-xl); min-width: 28px; text-align: end; font-variant-numeric: tabular-nums; }
.exc .exc-n:not(.high):not(.med):not(.low) { color: var(--text-3); font-weight: 500; }
.sev-l { font-size: var(--fs-2xs); font-weight: 600; padding: 2px 7px; border-radius: 999px; border: 1px solid; }
.sev-l-high { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-bd); }
.sev-l-med { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-bd); }
.sev-l-low { color: var(--info); background: var(--info-bg); border-color: var(--info-bd); }
.pipe { gap: 14px; }
.pipe-row { grid-template-columns: 132px minmax(0,1fr); }
.pipe-name { font-size: var(--fs-sm); }
.pipe-name small { font-size: var(--fs-2xs); }
.pipe-stage { padding: 7px 8px 7px 14px; transition: background var(--dur-1); }
.pipe-stage .ps-n { font-size: var(--fs-lg); }
.pipe-stage .ps-l { font-size: var(--fs-2xs); color: var(--text-3); }
.feed li { padding: 10px 16px; }
.feed .f-ic { border-radius: 8px; color: var(--blue-700); background: var(--blue-50); }
.feed .f-t { font-size: var(--fs-sm); }
.feed .f-t a { color: var(--text); font-weight: 500; }
.feed .f-t a:hover { color: var(--blue-700); }
.appr li { padding: 10px 16px; }
.appr .a-t { font-size: var(--fs-sm); }
.appr .a-t a { color: var(--text); }

.link-list a { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--text); font-size: var(--fs-sm); font-weight: 500; border-bottom: 1px solid var(--surface-3); min-height: 42px; }
.link-list a:last-child { border-bottom: 0; }
.link-list a:hover { background: var(--row-hover); text-decoration: none; }
.link-list a > svg:first-child { color: var(--blue-700); }
.link-list span { flex: 1; }
.link-list .ll-car { color: var(--text-3); width: 14px; height: 14px; }

/* ---------------------------------------------------------------- Badges, chips */
.badge { height: 22px; font-size: var(--fs-xs); padding: 0 9px; border-radius: 999px; }
.fchip { height: 28px; border-radius: 999px; font-size: var(--fs-xs); gap: 6px; padding: 0 2px 0 10px; }
.fchip > svg { width: 13px; height: 13px; }
.fchip button { width: 24px; height: 24px; }
.fchip.has-av { padding-inline-start: 3px; }
.fchip-link { height: 26px; border-radius: 999px; gap: 6px; padding: 0 10px 0 3px; font-size: var(--fs-xs); }
.view-chip { height: 30px; border-radius: 999px; font-size: var(--fs-xs); padding: 0 12px; transition: background var(--dur-1), border-color var(--dur-1); }
.view-chip[aria-pressed="true"] { background: var(--sel-bg); border-color: var(--sel-bg); color: var(--sel-fg); }
.view-chip[aria-pressed="true"] .vc-n { background: var(--sel-sub); color: var(--sel-fg); }
.seg button[aria-pressed="true"] { background: var(--sel-bg); color: var(--sel-fg); }
.pager .btn[aria-current="true"] { background: var(--sel-bg); color: var(--sel-fg); border-color: var(--sel-bg); }
.tag.navy { background: var(--sel-bg); border-color: var(--sel-bg); color: var(--sel-fg); }

/* ---------------------------------------------------------------- Photos */
.fthumb { display: inline-block; flex: none; border-radius: 50%; overflow: hidden; background: var(--surface-3); box-shadow: 0 0 0 1px var(--border); }
.fthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gal-tile { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-3); padding: 0; display: block; }
button.gal-tile { cursor: zoom-in; }
.gal-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-3) var(--ease-out); }
button.gal-tile:hover img { transform: scale(1.04); }
.gal-cap { position: absolute; inset-inline-start: 6px; bottom: 6px; font-size: var(--fs-2xs); font-weight: 500; color: #fff; background: rgba(11, 23, 38, .66); padding: 2px 7px; border-radius: 999px; }
.gal-tile.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-style: dashed; background: var(--surface-2); color: var(--text-3); font-size: var(--fs-xs); text-align: center; padding: 6px; }
.gal-tile.empty svg { width: 18px; height: 18px; }
.gal-up { font-size: var(--fs-xs); font-weight: 500; }

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 130; background: rgba(5, 10, 18, .94); backdrop-filter: blur(6px); display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 48px 72px 16px; animation: fade var(--dur-2) var(--ease-out); }
.lb-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; max-height: 100%; min-height: 0; }
.lb-img { max-width: min(1100px, 100%); max-height: calc(100vh - 190px); border-radius: 8px; object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb-cap { display: flex; gap: 14px; color: #D6E0EE; font-size: var(--fs-sm); }
.lb-n { color: #93A5BE; font-variant-numeric: tabular-nums; }
.lb-btn { position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; transition: background var(--dur-1); }
.lb-btn:hover { background: rgba(255,255,255,.18); }
.lb-btn svg { width: 20px; height: 20px; }
.lb-x { top: 16px; inset-inline-end: 16px; }
.lb-prev { inset-inline-start: 16px; top: 50%; margin-top: -22px; }
.lb-next { inset-inline-end: 16px; top: 50%; margin-top: -22px; }
.lb-strip { display: flex; gap: 8px; }
.lb-th { padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: none; opacity: .6; transition: opacity var(--dur-1); }
.lb-th img { display: block; width: 56px; height: 42px; object-fit: cover; }
.lb-th[aria-current="true"] { border-color: var(--cyan-500); opacity: 1; }
.lb :focus-visible { outline-color: var(--cyan-500); }

/* Credits */
.credits { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.credit { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
.credit img { border-radius: 4px; object-fit: cover; flex: none; }
.cr-t { font-size: var(--fs-xs); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-s { font-size: var(--fs-2xs); color: var(--text-3); }

/* ---------------------------------------------------------------- Falcon profile hero */
.prof-hero { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 24px; padding: 20px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.prof-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--blue-600), var(--cyan-500)); }
.ph-media { display: flex; flex-direction: column; gap: 8px; }
.ph-main { position: relative; width: 184px; height: 184px; border-radius: 12px; overflow: hidden; padding: 0; border: 1px solid var(--border); background: var(--surface-3); cursor: zoom-in; display: block; }
.ph-main img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-3) var(--ease-out); }
.ph-main:hover img { transform: scale(1.03); }
.ph-main.none { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-style: dashed; color: var(--text-3); cursor: default; }
.ph-zoom { position: absolute; inset-inline-end: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-2xs); font-weight: 500; color: #fff; background: rgba(11, 23, 38, .7); padding: 3px 8px; border-radius: 999px; }
.ph-zoom svg { width: 12px; height: 12px; }
.ph-minis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ph-mini { position: relative; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: zoom-in; }
.ph-mini img { width: 100%; height: 100%; object-fit: cover; }
.ph-mini span { position: absolute; inset: auto 0 0 0; font-size: 10px; color: #fff; background: linear-gradient(transparent, rgba(11,23,38,.75)); padding: 6px 0 2px; text-align: center; }
.ph-mini.none { border-style: dashed; cursor: default; color: var(--text-3); }
.ph-mini.none svg { width: 14px; height: 14px; margin-bottom: 12px; }
.ph-mini.none span { background: none; color: var(--text-3); }
.ph-info { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.ph-top { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.ph-ids { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.ph-ids .mono { font-size: var(--fs-xs); color: var(--text-3); padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); }
.ph-name { font-size: var(--fs-3xl); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ph-ar { font-family: var(--font-ar); font-size: var(--fs-xl); font-weight: 500; color: var(--text-3); }
.ph-sub { font-size: var(--fs-sm); color: var(--text-3); margin-top: 6px; }
.ph-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ph-facts { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 10px 0 0; border-top: 1px dashed var(--border); }
.ph-fact { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-2); }
.ph-fact svg { width: 14px; height: 14px; color: var(--text-3); }
.ph-fact .pf-k { color: var(--text-3); }
.ph-fact .pf-v { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.ph-fact.bad .pf-v, .ph-fact.bad svg { color: var(--bad); } .ph-fact.warn .pf-v, .ph-fact.warn svg { color: var(--warn); }
.stat-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.35fr); gap: 8px; margin-top: auto; }
.stat-chip .sc-s { font-size: var(--fs-2xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-chip .sc-s.mono, .stat-chip .sc-v.mono { font-size: var(--fs-2xs); color: var(--text); font-weight: 500; }
.stat-chip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); min-width: 0; }
.stat-chip > svg { color: var(--blue-700); width: 16px; height: 16px; margin-top: 2px; }
.stat-chip > div { min-width: 0; }
.stat-chip .sc-k { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.stat-chip .sc-v { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat-chip .sc-v.mono { font-size: var(--fs-xs); font-weight: 500; }
.lin-card .fthumb { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border); }
.lin-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); flex: none; }
.lin-card.ext { border-style: dashed; background: var(--surface); }

/* Upload tiles (form) */
.up-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 12px; }
.up-tile { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.up-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; height: auto; }
.up-empty { aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-3); background: var(--surface-2); border-bottom: 1px dashed var(--border-strong); font-size: var(--fs-xs); }
.up-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; }
.up-l { font-size: var(--fs-xs); font-weight: 500; margin-inline-end: auto; }

/* ---------------------------------------------------------------- Data grid */
.dg { overflow: hidden; }
.dg-toolbar .dg-search { order: 0; }
.dg-toolbar .dg-tools { order: 1; }
.dg-toolbar .views { order: 2; flex-basis: 100%; }
.dg-toolbar { padding: 12px; gap: 8px; }
.dg-search { width: 280px; }
.dg-search .input { height: 32px; }
table.t th, table.t td { height: 44px; padding: 0 12px; }
table.t thead th { height: 36px; font-size: var(--fs-2xs); letter-spacing: .06em; color: var(--text-3); background: var(--surface-2); }
table.t thead tr.frow th { top: 36px; }
table.t tbody tr { transition: background var(--dur-1); }
table.t tbody tr:hover { background: var(--row-hover); }
table.t tbody tr.sel { background: var(--blue-50); box-shadow: inset 2px 0 0 var(--blue-600); }
table.t td.end, table.t th.end { text-align: end; font-variant-numeric: tabular-nums; }
.cell-main { font-weight: 500; }
.dg-foot { padding: 10px 12px; }
.dg-wrap { max-height: max(380px, calc(100vh - 340px)); }
.empty { padding: 44px 20px; }
.empty svg { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--surface-3); color: var(--text-3); margin-bottom: 10px; }
.empty .e-t { font-size: var(--fs-md); color: var(--text); margin-bottom: 2px; }
.who .fthumb { box-shadow: 0 0 0 1px var(--border); }
.picker-item { grid-template-columns: 18px minmax(0,1fr) auto; padding: 8px 10px; }

/* ---------------------------------------------------------------- Popovers & account menu */
.pop { border-radius: 10px; padding: 6px; animation: popIn var(--dur-1) var(--ease-out); }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } }
.pop-item { min-height: 34px; border-radius: 6px; }
.pop-item > svg { color: var(--text-3); }
.role-pop { width: 288px; }
.am-head { display: flex; gap: 10px; align-items: center; padding: 8px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.am-head .avatar { width: 36px; height: 36px; font-size: var(--fs-xs); }
.am-n { font-weight: 600; font-size: var(--fs-sm); }
.am-r { font-size: var(--fs-xs); color: var(--text-3); }
.switch { width: 30px; height: 18px; border-radius: 999px; background: var(--border-strong); position: relative; flex: none; transition: background var(--dur-1); }
.switch::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform var(--dur-2) var(--ease-out); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch.on { background: var(--blue-600); }
.switch.on::after { transform: translateX(12px); }
[dir="rtl"] .switch.on::after { transform: translateX(-12px); }

/* ---------------------------------------------------------------- Modal, drawer, toast */
.modal { border-radius: 12px; animation: modalIn var(--dur-2) var(--ease-out); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.modal-h { padding: 14px 20px; }
.modal-t { font-size: var(--fs-lg); }
.modal-b { padding: 16px 20px; overscroll-behavior: contain; }
.modal-f { padding: 12px 20px; border-radius: 0 0 12px 12px; }
.drawer-b { overscroll-behavior: contain; }
.drawer { animation-duration: var(--dur-3); animation-timing-function: var(--ease-out); }
.toast { border-radius: 10px; background: var(--navy-800); }

/* ---------------------------------------------------------------- Skeletons */
.sk { background: linear-gradient(90deg, var(--sk-a) 0%, var(--sk-b) 50%, var(--sk-a) 100%); background-size: 200% 100%; animation: shimmer 1.1s infinite linear; }
.sk-grid { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.sk-bar { display: flex; gap: 10px; padding: 12px; border-bottom: 1px solid var(--border); }
.sk-row { display: flex; gap: 16px; align-items: center; padding: 0 12px; height: 44px; border-bottom: 1px solid var(--surface-3); }

/* ---------------------------------------------------------------- Sign-in */
.login { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr); background: var(--surface); overflow: auto; z-index: 5; }
.login-hero { position: relative; overflow: hidden; background: var(--navy-900); min-height: 100%; }
.lh-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.lh-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 23, 38, .25) 0%, rgba(11, 23, 38, .35) 40%, rgba(11, 23, 38, .92) 100%), linear-gradient(90deg, rgba(20, 38, 61, .55), rgba(20, 38, 61, 0) 60%); }
.lh-copy { position: absolute; inset: auto 48px 48px 48px; color: #fff; max-width: 560px; }
.lh-brand { position: absolute; top: 32px; inset-inline-start: 40px; display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: var(--fs-lg); color: #fff; }
.lh-title { font-size: 36px; line-height: 1.15; letter-spacing: -.02em; font-weight: 600; }
.lh-sub { margin-top: 12px; font-size: var(--fs-lg); color: #D6E0EE; max-width: 46ch; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px 40px; background: var(--surface); }
.lp-inner { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.lp-mark svg { border-radius: 10px; }
.lp-title { font-size: var(--fs-2xl); letter-spacing: -.015em; }
.lp-sub { color: var(--text-3); font-size: var(--fs-sm); margin-top: -8px; }
.btn.sso { width: 100%; gap: 10px; }
.btn.sso.loading { opacity: .85; cursor: progress; }
.btn.sso.loading svg { animation: pulse .9s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .35; } }
.lp-or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: var(--fs-xs); }
.lp-or::before, .lp-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.personas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.persona { display: flex; align-items: center; gap: 10px; padding: 10px; min-height: 52px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); text-align: start; transition: border-color var(--dur-1), background var(--dur-1); }
.persona:hover { border-color: var(--blue-600); background: var(--blue-50); }
.pe-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pe-t b { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe-t span { font-size: var(--fs-2xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-foot { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-xs); color: var(--text-3); padding-top: 8px; border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------- Night operations (dark) theme */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A1420; --surface: #0F1C2E; --surface-2: #13233A; --surface-3: #1A2D47;
  --border: #23395B; --border-strong: #31507A;
  --text: #E7EEF8; --text-2: #C4D0E1; --text-3: #9AACC4; --text-inv-2: #B9C7DA;
  --blue-700: #8AB4FF; --blue-500: #5B9BFF; --blue-100: #1E3A66; --blue-50: #142B4D;
  --cyan-700: #5CD6EA; --cyan-50: #0E2E3A;
  --navy-300: #6F87A8;
  --ok: #5FD892;   --ok-bg: #0F2C22;   --ok-bd: #1E5A3E;
  --warn: #F7BE5E; --warn-bg: #2E2210; --warn-bd: #6B4A14;
  --bad: #FF9A90;  --bad-bg: #35161A;  --bad-bd: #7A2C2C;
  --info: #93B7FF; --info-bg: #14284A; --info-bd: #2C4F8C;
  --vio: #C3AEFF;  --vio-bg: #241B45;  --vio-bd: #4B3B8A;
  --cy: #6ADCEF;   --cy-bg: #0D2C36;   --cy-bd: #1D5E6E;
  --neu: #B7C4D6;  --neu-bg: #1A2A40;  --neu-bd: #33496A;
  --c1: #4F8DFF; --c2: #22D3EE; --c3: #C9D6E8; --c4: #7C9CC9; --c5: #F5B54A; --c6: #34D399; --c7: #C084FC; --c8: #94A3B8;
  --chart-grid: #1C2F4C; --chart-tick: #9AACC4; --chart-muted: #2C4266;
  --row-hover: #15263E; --sel-bg: #2563EB; --sel-fg: #fff; --sel-sub: #1D4ED8;
  --chrome: #08111D; --chrome-2: #0C1828; --chrome-rail: #07101B; --chrome-line: #172741;
  --hero-bg: linear-gradient(180deg, #13284A 0%, #0F2140 100%); --hero-line: rgba(255, 255, 255, .08);
  --sk-a: #16263D; --sk-b: #1D3150;
  --note-info: #BFD3FF; --note-warn: #F9D594; --note-bad: #FFC2BB; --note-ok: #A6EBC2;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px #5B9BFF;
}
:root[data-theme="dark"] body { background: var(--bg); }
:root[data-theme="dark"] :focus-visible { outline-color: #6FA6FF; }
:root[data-theme="dark"] .hero { border-color: #24406A; box-shadow: none; }
:root[data-theme="dark"] .approval-h, :root[data-theme="dark"] .dg-bulk { background: #16294A; }
:root[data-theme="dark"] .dg-bulk .btn { background: #1E3760; border-color: #31507A; }
:root[data-theme="dark"] .toast { background: #172B48; border: 1px solid #2A4670; }
:root[data-theme="dark"] .nf .nf-code { color: var(--text); }
:root[data-theme="dark"] .btn.primary:hover { background: #1D4ED8; }
:root[data-theme="dark"] .btn.success { background: #15803D; border-color: #15803D; color: #fff; }
:root[data-theme="dark"] .btn.success:hover { background: #166534; }
:root[data-theme="dark"] .btn.danger.solid { background: #C2352B; border-color: #C2352B; color: #fff; }
:root[data-theme="dark"] .btn.navy { background: #1E3760; border-color: #31507A; }
:root[data-theme="dark"] .tr-step.done .tr-dot, :root[data-theme="dark"] .wstep.done .ws-n { color: #06210F; }
:root[data-theme="dark"] .tr-step.rejected .tr-dot, :root[data-theme="dark"] .wstep.err .ws-n { color: #2A0B0B; }
:root[data-theme="dark"] .np-item.unread { background: var(--blue-50); }
:root[data-theme="dark"] .note { color: var(--note-info); }
:root[data-theme="dark"] .note.warn { color: var(--note-warn); } :root[data-theme="dark"] .note.bad { color: var(--note-bad); } :root[data-theme="dark"] .note.ok { color: var(--note-ok); }
:root[data-theme="dark"] .note.neu { color: var(--text-2); }
:root[data-theme="dark"] .rep-card .r-ic { background: var(--surface-3); color: var(--cyan-700); }
:root[data-theme="dark"] select.input option, :root[data-theme="dark"] select.input optgroup { background: var(--surface); color: var(--text); }
:root[data-theme="dark"] .input::placeholder { color: #7F93AE; }
:root[data-theme="dark"] .sev-high { background: #F0675C; } :root[data-theme="dark"] .sev-med { background: #E8A13A; } :root[data-theme="dark"] .sev-low { background: #5B9BFF; }
:root[data-theme="dark"] .bar.warn > span, :root[data-theme="dark"] .tl .tl-dot.warn { border-color: #E8A13A; }
:root[data-theme="dark"] .login-panel, :root[data-theme="dark"] .login { background: var(--surface); }
:root[data-theme="dark"] .ctip { background: #13233A; border-color: #2A4670; }
:root[data-theme="dark"] .feed .f-ic { color: #9CC1FF; }
:root[data-theme="dark"] .pipe-stage.hot { background: var(--warn-bg); }
:root[data-theme="dark"] .ph-mini span, :root[data-theme="dark"] .gal-cap { color: #fff; }
:root[data-theme="dark"] .tbtn[aria-pressed="true"] { color: #FCD34D; background: rgba(252, 211, 77, .08); }

/* ---------------------------------------------------------------- Responsive (v2) */
@media (max-width: 1360px) {
  .metric:nth-child(-n+4) { border-bottom: 1px solid var(--hero-line); }
}
@media (max-width: 1280px) {
  .brand { width: auto; padding-inline-end: 8px; }
  body.sub-collapsed .brand { width: auto; }
  .stat-chips { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 1100px) {
  .ctx-label { width: auto; padding-inline: 16px 0; flex-direction: row; }
  .prof-hero { grid-template-columns: 1fr; }
  .ph-media { flex-direction: row; align-items: flex-start; }
  .ph-main { width: 140px; height: 140px; }
  .ph-minis { grid-template-columns: repeat(3, 72px); }
  .login { grid-template-columns: 1fr; }
  .login-hero { min-height: 260px; }
}
@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metric:nth-child(n) { border-inline-end: 1px solid var(--hero-line); border-bottom: 0; }
  .metric:nth-child(4n) { border-inline-end: 0; }
  .metric:nth-child(-n+4) { border-bottom: 1px solid var(--hero-line); }
  .metric { padding: 12px; }
  .top-search { margin-inline-start: 8px; }
  .top-sep { display: none; }
  .metric-val { font-size: var(--fs-2xl); }
  .tbtn.lang-btn .lbl { display: none; }
  .up-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .credits { grid-template-columns: 1fr; }
  .lh-title { font-size: var(--fs-2xl); }
  .lh-copy { inset: auto 24px 24px 24px; }
  .page { padding: 16px 16px 40px; }
  .ctx-chips { gap: 6px; }
  .scope-chip .sc-k { display: none; }
}
@media (max-width: 640px) {
  .personas { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  #view.enter, .pop, .modal, .lb { animation: none !important; }
  .gal-tile img, .ph-main img { transition: none !important; }
}

/* RTL: English runs inside new v2 elements keep their own direction */
[dir="rtl"] .metric-d span, [dir="rtl"] .h-s, [dir="rtl"] .rec-s, [dir="rtl"] .sub-empty, [dir="rtl"] .pt-txt .panel-sub, [dir="rtl"] .hero-live, [dir="rtl"] .sf-r, [dir="rtl"] .ph-sub, [dir="rtl"] .stat-chip .sc-s, [dir="rtl"] .ctip { unicode-bidi: plaintext; }
