/* Stivel Computers: a dark console. Black panels, hairline borders, one orange accent.
   Regions: US orange, Europe blue, APAC gold (checked for colour-blind separation on #1c1c1c). */
:root {
  color-scheme: dark;
  --bg: #121212; --side: #0e0e0e; --surface: #1c1c1c; --surface2: #222222; --surface3: #2a2a2a; --hover: #242424;
  --ink: #ededed; --muted: #a3a3a3; --dim: #808080; --line: #2b2b2b; --line2: #3a3a3a;
  --brand: #f97316; --brand-ink: #fb923c; --brand-bg: rgba(249,115,22,.11); --brand-line: rgba(249,115,22,.38); --on-brand: #0a0a0a;
  --ok: #4ade80; --ok-bg: rgba(74,222,128,.09); --ok-line: rgba(74,222,128,.28);
  --gold: #fbbf24; --gold-bg: rgba(251,191,36,.09); --gold-line: rgba(251,191,36,.3);
  --neg: #f87171; --neg-bg: rgba(248,113,113,.09); --neg-line: rgba(248,113,113,.3);
  --info: #93b4f0; --info-bg: rgba(147,180,240,.09); --info-line: rgba(147,180,240,.28);
  --us: #e5630d; --eu: #4a84e0; --ap: #b8860b;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r: 6px; --sidew: 216px;
}
* { box-sizing: border-box; scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 12.5px/1.5 var(--sans); }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
::selection { background: rgba(249,115,22,.35); color: #fff; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--brand-line); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.code { font-family: var(--mono); font-size: 11.5px; letter-spacing: -.01em; }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.neg { color: var(--neg); }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 18px; } h2 { font-size: 13.5px; } h3 { font-size: 12.5px; }
p { margin: 0; }

/* ---------- shell: fixed sidebar + content column ---------- */
.shell { display: flex; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; width: var(--sidew); flex: none; display: flex; flex-direction: column; background: var(--side);
  border-right: 1px solid var(--line); padding: 12px 10px; z-index: 35; }
.col { flex: 1; min-width: 0; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); padding: 4px 6px 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.brand b { display: block; font-size: 13px; font-weight: 600; letter-spacing: -.015em; }
.brand small { display: block; font-family: var(--mono); font-size: 10px; color: var(--dim); margin-top: -1px; }
nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
nav a { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 6px 8px; border-radius: 5px; border: 1px solid transparent; }
nav a svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
nav a:hover { color: var(--ink); background: var(--hover); text-decoration: none; }
nav a.on { color: var(--ink); background: var(--surface2); border-color: var(--line); }
nav a.on svg { color: var(--brand); opacity: 1; }
.sidefoot { padding: 10px 4px 2px; border-top: 1px solid var(--line); }
.tag { display: inline-flex; align-items: center; gap: 7px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line2); font-size: 11px; color: var(--muted); white-space: nowrap; }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(249,115,22,.18); animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .tag .dot { animation: none; } }

/* top bar: breadcrumb and company switch */
.top { position: sticky; top: 0; z-index: 30; background: rgba(18,18,18,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 9px 22px; }
.crumb { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 12.5px; }
.crumb b { font-weight: 500; }
.crumb .slash { color: var(--line2); }
.coswitch { display: inline-flex; border: 1px solid var(--line2); border-radius: 999px; padding: 2px; background: var(--surface); }
.coswitch a { padding: 3px 11px; border-radius: 999px; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.coswitch a:hover { text-decoration: none; color: var(--ink); }
.coswitch a.on { background: var(--brand); color: var(--on-brand); font-weight: 500; }
.mswitch { display: none; }

/* ticker: share price and the three regional clocks */
.ticker { border-top: 1px solid var(--line); background: var(--side); color: var(--muted); }
.ticker .bar { padding: 5px 22px; gap: 6px 24px; font-size: 11.5px; }
.ticker b { color: var(--ink); font-weight: 500; }
.ticker .sym { font-family: var(--mono); font-weight: 500; color: var(--brand); }
.ticker .up { color: var(--ok); } .ticker .down { color: var(--neg); }
.ticker .clock { display: inline-flex; align-items: center; gap: 7px; }
.ticker .clock i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.ticker .clock .t { font-family: var(--mono); color: var(--ink); }
.ticker .sep { flex: 1; }

main { max-width: 1380px; padding: 20px 22px 60px; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px; margin-bottom: 14px; }
.pagehead p { color: var(--muted); margin-top: 3px; max-width: 760px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 11px; border-radius: var(--r); border: 1px solid var(--line2);
  background: var(--surface2); cursor: pointer; white-space: nowrap; color: var(--ink); }
.btn:hover { border-color: #555; background: var(--surface3); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 500; }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn.sm { min-height: 24px; padding: 0 8px; font-size: 11.5px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 10px; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field > span { font-size: 10.5px; color: var(--muted); }
input[type=text], input[type=date], select { min-height: 28px; padding: 0 8px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--bg); color: var(--ink); outline: none; }
input::placeholder { color: var(--dim); }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.75); }
select option { background: var(--surface); color: var(--ink); }
input[type=text] { min-width: 180px; }
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(249,115,22,.18); }
.filters .grow { flex: 1; }
.quick { display: inline-flex; gap: 3px; }

/* sub-report tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 0 0 12px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 6px 10px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--brand); }

/* ---------- tables ---------- */
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; max-height: calc(100vh - 280px); min-height: 160px; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 5px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; background: var(--surface2); font-weight: 500; font-size: 11px; color: var(--muted); z-index: 1; }
tbody tr:hover td { background: var(--hover); }
td.wrap { white-space: normal; min-width: 220px; max-width: 420px; }
tfoot td { position: sticky; bottom: 0; background: var(--surface2); font-weight: 600; border-top: 1px solid var(--line2); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px; color: var(--muted); flex-wrap: wrap; }
.chip { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: 11px; line-height: 18px; background: var(--surface2); color: var(--muted); border: 1px solid var(--line2); }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.chip.warn { background: var(--gold-bg); color: var(--gold); border-color: var(--gold-line); }
.chip.bad { background: var(--neg-bg); color: var(--neg); border-color: var(--neg-line); }
.chip.info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }

/* statements */
.stmt td { border-bottom-color: #232323; }
.stmt tr.head td { font-weight: 600; padding-top: 12px; color: var(--ink); background: transparent; border-bottom-color: var(--line2); }
.stmt tr.line td:first-child { padding-left: 22px; }
.stmt tr.sub td { font-weight: 600; border-top: 1px solid var(--line2); }
.stmt tr.total td { font-weight: 600; border-top: 1px solid var(--muted); border-bottom: 3px double var(--muted); background: var(--surface2); }

/* ---------- cards, KPIs, charts ---------- */
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: 1.6fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g2e { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .g2, .g3, .g2e { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card .hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.card .hd p { color: var(--muted); font-size: 11.5px; }
.card .bd { padding: 12px 14px; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; }
@media (max-width: 1240px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpi:nth-child(n+3) { border-top: 1px solid var(--line); } .kpi:nth-child(odd) { border-left: 0; } }
.kpi { padding: 12px 14px; border-left: 1px solid var(--line); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi .l { font-size: 11px; color: var(--muted); }
.kpi .v { font-size: 20px; font-weight: 500; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 11px; color: var(--dim); margin-top: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
svg.chart text { font-family: var(--sans); font-size: 10.5px; fill: var(--dim); }
svg.chart .grid line { stroke: var(--line); }
.tip { position: fixed; pointer-events: none; z-index: 60; background: #0a0a0a; color: var(--ink); border: 1px solid var(--line2); padding: 6px 9px; border-radius: 5px; font-size: 11px; line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); display: none; max-width: 280px; }
.tip b { font-weight: 600; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; padding: 6px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.feed li:last-child { border-bottom: 0; }
.feed .e { justify-self: start; min-width: 30px; font-family: var(--mono); font-size: 10.5px; font-weight: 500; padding: 1px 6px; border-radius: 3px; color: #0a0a0a; text-align: center; }
.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0; }
.cases a { display: block; padding: 10px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); }
.cases a:hover { background: var(--hover); text-decoration: none; }
.cases a:hover .n { color: var(--brand-ink); }
.cases .n { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cases .d { font-size: 11px; color: var(--muted); }

/* order panel */
#panel { position: fixed; inset: 0; z-index: 50; display: none; }
#panel.open { display: block; }
#panel .shade { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
#panel .sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--surface); border-left: 1px solid var(--line2); overflow: auto; box-shadow: -16px 0 40px rgba(0,0,0,.5); }
#panel .sheet .hd { position: sticky; top: 0; background: var(--surface); padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; z-index: 2; }
#panel .sheet .bd { padding: 14px 18px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; margin-bottom: 14px; }
.kv div > span:first-child { display: block; font-size: 10.5px; color: var(--muted); }

/* about */
.prose { max-width: 820px; }
.prose p, .prose li { color: #d4d4d4; line-height: 1.65; }
.prose p + p { margin-top: 8px; }
.prose ul { margin: 6px 0 0; padding-left: 18px; }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11.5px; }
.steps span { padding: 3px 8px; border: 1px solid var(--line2); border-radius: 4px; background: var(--surface2); }
.steps em { font-style: normal; color: var(--dim); }

.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.progress { height: 6px; background: var(--surface3); border-radius: 3px; overflow: hidden; margin: 14px auto; max-width: 360px; }
.progress div { height: 100%; background: var(--brand); }
.busy { opacity: .5; pointer-events: none; transition: opacity .1s; }
#out { transition: opacity .12s; }
#out.loading { opacity: .55; }

/* ---------- narrow screens: the sidebar becomes a top strip ---------- */
@media (max-width: 900px) {
  .shell { display: block; }
  .side { position: sticky; top: 0; height: auto; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 16px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { border-bottom: 0; margin: 0; padding: 0 0 6px; }
  nav { order: 3; flex-basis: 100%; flex-direction: row; overflow-x: auto; margin: 0 -16px; padding: 0 10px 6px; gap: 2px; }
  nav a { white-space: nowrap; padding: 5px 9px; }
  nav a svg { display: none; }
  .sidefoot { display: none; }
  .top { position: static; }
  .bar { padding: 8px 16px; }
  .top .head { display: none; }
  .mswitch { display: inline-flex; margin: 0 0 6px auto; }
  .ticker .bar { padding: 5px 16px; }
  main { padding: 14px 16px 50px; }
}
@media (max-width: 720px) {
  .coswitch a { padding: 3px 8px; }
  .ticker .clock, .ticker .sep { display: none; }
  .tablewrap { max-height: none; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 8px; }
  .tabs a { white-space: nowrap; }
  .kpi .v { font-size: 18px; }
}

/* company switcher sits at the left of the top bar */
.top .head .coswitch { margin-right: auto; }
