/* Reactore ORBIT – design system layer (approved 26 Nov 2026): tokens, light / dark themes, components.
   Loaded after app.css and knowledge-hub.css. Only presentation changes; no behaviour lives here. */

/* ---------------------------------------------------------------- tokens: light */
:root{
  --red:#EC2027; --red-d:#C4161C; --red-t:#FDECEC; --char:#333333;
  --ink:#1F2328; --ink-2:#4B5563; --muted:#6B7280; --line:#E5E7EB; --line-strong:#D1D5DB; --bg:#F6F7F9; --card:#FFFFFF; --tint:#F3F4F6; --surface-2:#FAFAFB;
  --g:#1E8E4E; --g-t:#E6F4EC; --g-ink:#166534; --a:#D97706; --a-t:#FEF3C7; --a-ink:#92400E; --r:#EC2027; --r-t:#FDECEC; --r-ink:#B4141A; --b:#2563EB; --b-t:#E8F0FE; --b-ink:#1D4ED8;
  --side:#FFFFFF; --side-ink:#374151; --side-muted:#6B7280; --side-hover:#F3F4F6; --side-active:#FDECEC; --side-active-ink:#C4161C; --side-line:#E5E7EB;
  --top:#FFFFFF; --overlay:rgba(16,24,40,.45); --toast:#1F2328; --toast-ink:#FFFFFF; --th:#F9FAFB; --th-ink:#6B7280; --row-alt:transparent; --row-hover:#FAFAFB;
  --radius:10px; --radius-sm:8px; --shadow:0 1px 2px rgba(16,24,40,.05),0 1px 3px rgba(16,24,40,.06); --shadow-lg:0 12px 32px rgba(16,24,40,.16);
  --focus:0 0 0 3px rgba(236,32,39,.22); color-scheme:light;
  font-family:"Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;
}
/* ---------------------------------------------------------------- tokens: dark (explicit choice, or system dark when no choice) */
:root[data-theme="dark"]{
  --red:#F0393F; --red-d:#F0393F; --red-t:rgba(240,57,63,.15); --char:#0E1013;
  --ink:#E8EAED; --ink-2:#C2C7CF; --muted:#9AA0A9; --line:#2C313A; --line-strong:#3A404B; --bg:#121418; --card:#1A1D23; --tint:#22262E; --surface-2:#1F232A;
  --g:#4ADE80; --g-t:rgba(74,222,128,.13); --g-ink:#86EFAC; --a:#FBBF24; --a-t:rgba(251,191,36,.13); --a-ink:#FCD34D; --r:#FF6B70; --r-t:rgba(255,107,112,.14); --r-ink:#FCA5A5; --b:#7AA7FF; --b-t:rgba(122,167,255,.14); --b-ink:#A9C5FF;
  --side:#16181D; --side-ink:#C2C7CF; --side-muted:#8A919C; --side-hover:#22262E; --side-active:rgba(240,57,63,.16); --side-active-ink:#FF8A8E; --side-line:#262A31;
  --top:#16181D; --overlay:rgba(0,0,0,.6); --toast:#E8EAED; --toast-ink:#121418; --th:#1F232A; --th-ink:#9AA0A9; --row-hover:#20242B;
  --shadow:0 1px 2px rgba(0,0,0,.45); --shadow-lg:0 16px 40px rgba(0,0,0,.55); --focus:0 0 0 3px rgba(240,57,63,.35); color-scheme:dark;
}
@media (prefers-color-scheme:dark){:root:not([data-theme]){
  --red:#F0393F; --red-d:#F0393F; --red-t:rgba(240,57,63,.15); --char:#0E1013;
  --ink:#E8EAED; --ink-2:#C2C7CF; --muted:#9AA0A9; --line:#2C313A; --line-strong:#3A404B; --bg:#121418; --card:#1A1D23; --tint:#22262E; --surface-2:#1F232A;
  --g:#4ADE80; --g-t:rgba(74,222,128,.13); --g-ink:#86EFAC; --a:#FBBF24; --a-t:rgba(251,191,36,.13); --a-ink:#FCD34D; --r:#FF6B70; --r-t:rgba(255,107,112,.14); --r-ink:#FCA5A5; --b:#7AA7FF; --b-t:rgba(122,167,255,.14); --b-ink:#A9C5FF;
  --side:#16181D; --side-ink:#C2C7CF; --side-muted:#8A919C; --side-hover:#22262E; --side-active:rgba(240,57,63,.16); --side-active-ink:#FF8A8E; --side-line:#262A31;
  --top:#16181D; --overlay:rgba(0,0,0,.6); --toast:#E8EAED; --toast-ink:#121418; --th:#1F232A; --th-ink:#9AA0A9; --row-hover:#20242B;
  --shadow:0 1px 2px rgba(0,0,0,.45); --shadow-lg:0 16px 40px rgba(0,0,0,.55); --focus:0 0 0 3px rgba(240,57,63,.35); color-scheme:dark;}}

html,body{background:var(--bg);color:var(--ink)}
body{-webkit-font-smoothing:antialiased;font-size:14px;line-height:1.5}
a{color:var(--b)}
h1{font-size:24px;font-weight:700;letter-spacing:-.01em;line-height:1.25}h2{font-size:16px;font-weight:650}h3{font-weight:650}
svg.i{width:18px;height:18px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}
:focus-visible{outline:none;box-shadow:var(--focus);border-radius:6px}

/* ---------------------------------------------------------------- shell */
.app{grid-template-columns:248px minmax(0,1fr);grid-template-rows:60px 1fr;min-width:0}
.sidebar{background:var(--side);color:var(--side-ink);border-right:1px solid var(--side-line)}
.sidebar .brand{height:60px;padding:0 18px;border-bottom:1px solid var(--side-line)}
.sidebar .brand img{height:30px;width:auto}.sidebar .brand .logo-dark{display:none}
:root[data-theme="dark"] .sidebar .brand .logo-light,:root[data-theme="dark"] .loading-brand .logo-light{display:none}:root[data-theme="dark"] .sidebar .brand .logo-dark,:root[data-theme="dark"] .loading-brand .logo-dark{display:inline}
@media (prefers-color-scheme:dark){:root:not([data-theme]) .sidebar .brand .logo-light,:root:not([data-theme]) .loading-brand .logo-light{display:none}:root:not([data-theme]) .sidebar .brand .logo-dark,:root:not([data-theme]) .loading-brand .logo-dark{display:inline}}
.loading-brand .logo-dark{display:none}
.nav{padding:10px}
.nav a{color:var(--side-ink);padding:7px 10px;border-radius:7px;font-size:13.5px;gap:10px}
.nav a:hover{background:var(--side-hover);color:var(--ink)}
.nav a.active{background:var(--side-active);color:var(--side-active-ink);font-weight:600}
.nav .ico{width:18px;opacity:1;display:inline-flex;align-items:center;justify-content:center}
.nav-group>summary{color:var(--side-muted);padding:8px 10px;margin-top:6px;font-size:11px}
.nav-group>summary:hover,.nav-group.has-active>summary{color:var(--ink);background:transparent}
.nav-group.has-active>summary{border-left:0}
.nav-group-links a{margin-left:0}
.sidebar .foot{color:var(--side-muted);border-top:1px solid var(--side-line);display:flex;justify-content:space-between;gap:8px}
.topbar{background:var(--top);border-bottom:1px solid var(--line);gap:10px;padding:0 20px}
.topbar .search{max-width:520px}
.topbar .search input{height:38px;border-radius:8px;background:var(--surface-2);padding-left:36px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA0A9' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:11px center;background-size:16px}
.iconbtn{font-size:16px;color:var(--ink-2);width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;padding:0;border-radius:8px}
.iconbtn:hover{background:var(--tint);color:var(--ink)}
.badge{top:3px;right:3px;border:2px solid var(--top)}
.main{min-width:0;padding:24px 28px 48px}
.page-head{margin-bottom:18px}.page-head .sub{color:var(--muted)}.kicker{color:var(--red);letter-spacing:.07em}

/* ---------------------------------------------------------------- controls */
input[type=text],input[type=password],input[type=number],input[type=date],input[type=email],input[type=search],input[type=time],input[type=url],select,textarea{border:1px solid var(--line-strong);border-radius:8px;background:var(--card);color:var(--ink);min-height:36px;padding:7px 10px}
input::placeholder,textarea::placeholder{color:var(--muted)}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--red);box-shadow:var(--focus)}
.btn{border:1px solid var(--line-strong);background:var(--card);color:var(--ink);border-radius:8px;min-height:36px;padding:7px 14px;font-weight:600}
.btn:hover{background:var(--tint)}
.btn.primary{background:var(--red);border-color:var(--red);color:#fff}.btn.primary:hover{background:var(--red-d);border-color:var(--red-d)}
.btn.dark{background:var(--ink);border-color:var(--ink);color:var(--card)}
.btn.ghost{background:transparent;border-color:transparent}.btn.ghost:hover{background:var(--tint)}
.btn.danger{color:var(--r-ink);border-color:color-mix(in srgb,var(--red) 40%,var(--line))}
.btn.sm{min-height:30px;padding:4px 10px;font-size:12.5px}
.btn.qa{color:var(--red-d);border-color:color-mix(in srgb,var(--red) 35%,var(--line));background:var(--red-t)}

/* ---------------------------------------------------------------- surfaces */
.card,.tile,.sprintbox{border-radius:var(--radius);border-color:var(--line);box-shadow:var(--shadow);background:var(--card)}
.card{padding:18px}
.tile{padding:14px 16px}.tile .v{font-size:28px;letter-spacing:-.02em}.tile .l{color:var(--muted)}
.tile.click:hover,.pcard:hover{border-color:color-mix(in srgb,var(--red) 35%,var(--line));box-shadow:var(--shadow-lg)}
.tabs{gap:4px;border-color:var(--line)}.tabs a{color:var(--muted);padding:9px 12px;font-size:13.5px}.tabs a.active{color:var(--ink);border-bottom-color:var(--red)}
table.t{font-size:13.5px}
table.t th{background:var(--th);color:var(--th-ink);font-size:11.5px;letter-spacing:.04em;text-transform:uppercase;padding:9px 12px;border-bottom:1px solid var(--line)}
table.t td{padding:10px 12px;border-bottom:1px solid var(--line)}
table.t tr:nth-child(even) td{background:var(--row-alt)}
table.t tr.click:hover td,table.t tr:hover td{background:var(--row-hover)}
.tablewrap{border-radius:var(--radius);border-color:var(--line);background:var(--card)}
.chip{border-radius:20px;padding:2px 9px;font-size:11.5px}
.chip.todo,.chip.Low,.chip.Lowest{background:var(--tint);color:var(--ink-2)}
.avatar{background:var(--tint);color:var(--ink-2)}
.col{background:var(--surface-2);border:1px solid var(--line)}
.col.no-drop .cb{background:var(--tint)}
.bcard{border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow)}
.row:hover{background:var(--row-hover)}
.hist{border-bottom-color:var(--line)}
.gantt .gr{border-bottom-color:var(--line)}
.empty{color:var(--muted)}

/* ---------------------------------------------------------------- dialogs, menus, toasts */
.overlay{background:var(--overlay)}
.modal{background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-lg)}
.modal .mh{border-bottom:1px solid var(--line)}.modal .mf{border-top:1px solid var(--line);background:var(--surface-2);border-radius:0 0 14px 14px}
.form label{color:var(--ink-2);font-weight:600}
.menu,.dropdown{background:var(--card);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow-lg);color:var(--ink)}
.menu a{color:var(--ink)}.menu a:hover{background:var(--tint)}
.toast{background:var(--toast);color:var(--toast-ink);border-radius:10px;box-shadow:var(--shadow-lg)}
.toast.err{background:var(--red-d);color:#fff}.toast.warn{background:#8a5a00;color:#fff}
.toast-link{color:var(--red)}:root[data-theme="dark"] .toast-link{color:#C4161C}

/* ---------------------------------------------------------------- theme switch */
.theme-toggle .sun{display:none}:root[data-theme="dark"] .theme-toggle .sun{display:inline}:root[data-theme="dark"] .theme-toggle .moon{display:none}
@media (prefers-color-scheme:dark){:root:not([data-theme]) .theme-toggle .sun{display:inline}:root:not([data-theme]) .theme-toggle .moon{display:none}}

/* ---------------------------------------------------------------- Quick Access (replaces the Tools side tab) */
.global-utility-dock{right:0;top:44%;gap:0}
.global-dock-arrow{writing-mode:vertical-rl;transform:rotate(180deg);width:auto;height:auto;padding:12px 7px;border:0;border-radius:0 8px 8px 0;background:var(--red);color:#fff;box-shadow:var(--shadow-lg);animation:none;font-weight:700;font-size:12px;letter-spacing:.04em;display:flex;flex-direction:row;gap:6px;align-items:center}
.global-dock-arrow:hover{background:var(--red-d)}
.global-dock-arrow svg.i{transform:rotate(90deg);width:16px;height:16px}
.qa-drawer{position:fixed;top:0;right:0;height:100vh;width:360px;max-width:100vw;background:var(--card);color:var(--ink);border-left:1px solid var(--line);box-shadow:var(--shadow-lg);z-index:70;display:flex;flex-direction:column;transform:translateX(105%);transition:transform .2s ease}
.qa-drawer.open{transform:none}
.qa-scrim{position:fixed;inset:0;background:var(--overlay);z-index:65}
.qa-head{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--line)}.qa-head h2{margin:0;font-size:16px;display:flex;align-items:center;gap:8px}.qa-head h2 svg{color:var(--red)}
.qa-body{padding:12px 18px 20px;overflow:auto}
.qa-body h3{margin:16px 0 8px;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);display:flex;justify-content:space-between;align-items:center}
.qa-find{width:100%}
.qa-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.qa-tile{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 6px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);font-size:12px;font-weight:600;text-align:center;color:var(--ink);cursor:pointer;text-decoration:none!important;min-height:84px;justify-content:center}
.qa-tile:hover,.qa-tile:focus-visible{border-color:var(--red);color:var(--red-d)}
.qa-ic{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;background:var(--red-t);color:var(--red-d)}
.qa-ic.b{background:var(--b-t);color:var(--b-ink)}.qa-ic.g{background:var(--g-t);color:var(--g-ink)}.qa-ic.y{background:var(--a-t);color:var(--a-ink)}
.qa-tile .global-dock-remove{position:absolute;top:4px;right:4px;width:18px;height:18px;border-radius:50%;border:0;background:var(--tint);color:var(--muted);opacity:0;cursor:pointer;font-size:12px;line-height:18px}
.qa-tile:hover .global-dock-remove,.qa-tile:focus-within .global-dock-remove{opacity:1}
.qa-note{font-size:12px;color:var(--muted);margin-top:12px}
.global-dock-menu{display:none!important}

/* ---------------------------------------------------------------- dark-mode fixes for colours set inline by scripts and charts */
:root[data-theme="dark"] [style*="background:#fff"],:root[data-theme="dark"] [style*="background: #fff"]{background:var(--card)!important}
:root[data-theme="dark"] svg.chart text,:root[data-theme="dark"] .chart text{fill:var(--muted)}
:root[data-theme="dark"] svg [stroke="#eee"],:root[data-theme="dark"] svg [stroke="#ccc"],:root[data-theme="dark"] svg [stroke="#e3e3e3"]{stroke:var(--line)}
:root[data-theme="dark"] svg [fill="#333"],:root[data-theme="dark"] svg [fill="#333333"]{fill:#C2C7CF}
:root[data-theme="dark"] svg [fill="#555"],:root[data-theme="dark"] svg [fill="#777"],:root[data-theme="dark"] svg [fill="#999"]{fill:var(--muted)}
:root[data-theme="dark"] .legend i[style*="#333"]{background:#C2C7CF!important}
:root[data-theme="dark"] img.kh-img,:root[data-theme="dark"] .md-img{background:#fff}
@media (prefers-color-scheme:dark){:root:not([data-theme]) [style*="background:#fff"]{background:var(--card)!important}:root:not([data-theme]) svg.chart text{fill:var(--muted)}:root:not([data-theme]) svg [fill="#333"]{fill:#C2C7CF}}

@media (max-width:900px){.app{grid-template-columns:1fr}.qa-drawer{width:100vw}.btn.qa .lbl{display:none}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* ---------------------------------------------------------------- sign-in, registration and password pages */
.login-brand{background:#16181D;color:#E8EAED}
.login-brand .login-logo{height:auto;width:min(380px,80%);align-self:flex-start}
.login-brand h1{color:#fff}.login-brand p{color:#C2C7CF}
.login-form{background:var(--card);color:var(--ink)}
.loading-brand img{height:auto;width:min(320px,60vw)}
@media (min-width:901px){.topbar .nav-toggle{display:none}}
.topbar .search{flex:1 1 300px;min-width:200px}
.sidebar .brand img{height:38px}

/* ---------------------------------------------------------------- component colour fixes found in the dark-mode sweep */
.project-picker-toggle{background:var(--card);border-color:var(--line-strong);height:38px;border-radius:8px}.project-picker-toggle:hover,.project-picker-toggle[aria-expanded=true]{border-color:var(--muted)}
.project-option{background:transparent}.project-option:hover,.project-option[aria-selected=true]{color:var(--red-d)}
.process-step{background:var(--tint);color:var(--ink-2)}.process-step.is-done{background:var(--g-t);color:var(--g-ink)}.process-step.is-current{background:var(--a-t);color:var(--a-ink)}.process-step.is-blocked{background:var(--r-t);color:var(--r-ink)}
.process-wrap{box-shadow:var(--shadow)}
.orbit-iq-inline-tip{color:var(--ink-2)}.orbit-iq-inline-tip b{color:var(--a-ink)}
.guidance-card{border-color:color-mix(in srgb,var(--a) 45%,var(--line))}.guidance-card b{color:var(--a-ink)}
.wf-rule{background:var(--surface-2)}
.recognition-badge{background:var(--a-t);color:var(--a-ink)}
.world-clock-card{border-color:var(--line)}
.orbit-iq-quality,.orbit-iq-done-advice{border-color:color-mix(in srgb,var(--a) 45%,var(--line));border-left-color:var(--a)}
:root[data-theme="dark"] .btn.dark{background:#E8EAED;border-color:#E8EAED;color:#121418}
:root[data-theme="dark"] .avatar[style*="background:#eee"]{background:var(--tint)!important;color:var(--muted)!important}
:root[data-theme="dark"] td[style*="background:#"],:root[data-theme="dark"] .chip[style*="background:#"]{color:#1F2328}
:root[data-theme="dark"] td[style*="background:#"] .muted,:root[data-theme="dark"] td[style*="background:#"] .tiny{color:#4B5563}
@media (prefers-color-scheme:dark){:root:not([data-theme]) .btn.dark{background:#E8EAED;border-color:#E8EAED;color:#121418}:root:not([data-theme]) td[style*="background:#"]{color:#1F2328}}
@media(max-width:760px){.global-dock-arrow{width:auto;height:auto;padding:10px 6px}.global-utility-dock{right:0}}
@media (max-width:900px){.topbar .btn .lbl{display:none}.topbar .btn.primary,.topbar .btn.qa{padding:0;width:38px;justify-content:center}}
.login-foot{color:#9AA0A9}.login-foot a,.login-brand a{color:#E8EAED;text-decoration:underline;text-underline-offset:2px}.login-foot a:hover{color:#fff}
.sidebar .foot{flex-direction:column;gap:2px;font-size:11px}.sidebar .foot a{color:var(--side-muted);text-decoration:underline;text-underline-offset:2px}.sidebar .foot a:hover{color:var(--red)}

/* Audit fix B10: the work item page must fit a phone. A plain 1fr column grew to its widest child (ORBIT IQ tips,
   long keys, tables), so cards were cut off at 375 px. Columns may now shrink and long text wraps. */
@media (max-width:1100px){.issue-grid{grid-template-columns:minmax(0,1fr)}}
.issue-grid>div,.issue-grid .card,.orbit-iq-quality{min-width:0;max-width:100%}
.issue-grid .desc,.orbit-iq-quality li,.issue-grid .hist,.issue-grid .row .ttl{overflow-wrap:anywhere}
.issue-grid .card .tablewrap{max-width:100%}
/* Audit fix B07: list pager */
.pager .btn+.btn{margin-left:6px}
/* Audit fix E02: project tick-boxes in the New user dialog */
.user-new-projects label.check{display:inline-flex;align-items:center;gap:6px;margin:0;font-weight:400}
.user-new-projects label.check input{width:auto;margin:0}

/* Microsoft 365 sign-in and authenticator codes (plan RIPL-PMO-PLN-2026-007) */
.sso-btn{display:flex;align-items:center;justify-content:center;gap:10px;padding:10px;font-weight:600;background:var(--card);color:var(--ink);border:1px solid var(--line-2,var(--line));text-decoration:none}
.sso-btn:hover{background:var(--hover,var(--tint));text-decoration:none}
.login-or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:12px;margin:4px 0}
.login-or::before,.login-or::after{content:"";flex:1;border-top:1px solid var(--line)}
.login-note{border:1px solid var(--line);border-left:3px solid var(--red);background:var(--tint);border-radius:var(--radius);padding:8px 10px;font-size:13px}
.pw-details{display:grid;gap:12px}.pw-details>summary{cursor:pointer;color:var(--muted);list-style:revert}
.pw-details[open]>summary{margin-bottom:4px}.pw-fields{display:grid;gap:12px}
.mfa-secret{font-family:ui-monospace,Consolas,monospace;font-size:16px;letter-spacing:.06em;padding:8px 10px;border:1px dashed var(--line);border-radius:6px;background:var(--tint);user-select:all;word-break:break-all}
.mfa-codes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 16px;font-family:ui-monospace,Consolas,monospace;font-size:15px;padding:10px;border:1px solid var(--line);border-radius:6px;background:var(--tint)}
.sso-kv{display:grid;grid-template-columns:200px minmax(0,1fr);gap:6px 12px}.sso-kv code{word-break:break-all}
@media (max-width:600px){.sso-kv{grid-template-columns:1fr}}
