/* C3BI Nexus. Tokens and components follow the Nexus design canvas (Claude
   Design artifact 9jn11iR3PddtND1Va82Dif). Shell: dark chrome #222222 for the
   sidebar, top bar and footer; Orange #EB9B4B marks the current place and the
   primary action; Navy #2A3D50 for links, selected segments and focus. Status
   colours are for data states only. */

@font-face { font-family: "Mulish"; font-weight: 400; font-display: swap; src: url("../fonts/mulish-latin-400-normal.7ef9dd981bae.woff2") format("woff2"); }
@font-face { font-family: "Mulish"; font-weight: 500; font-display: swap; src: url("../fonts/mulish-latin-500-normal.d910e6484f8a.woff2") format("woff2"); }
@font-face { font-family: "Mulish"; font-weight: 600; font-display: swap; src: url("../fonts/mulish-latin-600-normal.9b22febd2ee0.woff2") format("woff2"); }
@font-face { font-family: "Mulish"; font-weight: 700; font-display: swap; src: url("../fonts/mulish-latin-700-normal.37c0b6908762.woff2") format("woff2"); }
@font-face { font-family: "Mulish"; font-weight: 800; font-display: swap; src: url("../fonts/mulish-latin-800-normal.d5f9ffffc6f3.woff2") format("woff2"); }

:root {
  --chrome: #222222; --chrome-line: rgba(255,255,255,.08); --chrome-text: rgba(255,255,255,.72);
  --page: #F8F5F2; --card: #FFFFFF; --line: #E2E0DC; --line-2: #EFEDE9; --sunk: #F3EFEA; --hover: #FBF9F7;
  --ink: #222222; --ink-2: #5B6168; --ink-3: #8A8F95;
  --orange: #EB9B4B; --orange-hover: #DA8A3B; --orange-100: #FBEBD7; --orange-text: #A85C12;
  --navy: #2A3D50; --navy-600: #38506A; --navy-100: #D5DDE4; --navy-50: #EEF2F5;
  --good: #1E9E57; --good-text: #1B7A45; --good-bg: #E6F4EC;
  --warning: #F2B233; --warning-text: #8A5A00; --warning-bg: #FDF3DC;
  --serious: #E0784A; --serious-text: #A2471E; --serious-bg: #FBEAE1;
  --critical: #D0453B; --critical-text: #B3322A; --critical-bg: #FBE7E5;
  --idle: #A3A9B0;
  /* Data-viz roles (fixed across the app) */
  --s-total: #2A78D6; --s-sk: #12A4B6; --s-rg: #4A3AA7; --s-ai: #B8860B;
  --e-c3bi: #1F3F77; --e-c3rer: #A23B87; --e-c3res: #0E7C66; --e-gmbh: #6D5BD0;
  --compare: #9A968C; --grid: rgba(122,122,122,.22);
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--chrome); font-family: "Mulish", system-ui, sans-serif; color: var(--ink); font-variant-numeric: tabular-nums; }
a { color: var(--navy); }
a:hover { color: var(--orange-text); }
button, input, select, textarea { font-family: "Mulish", system-ui, sans-serif; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--chrome); color: #FFFFFF; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--chrome-line); }
.sidebar .logo-btn { height: 64px; flex-shrink: 0; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; padding: 0 24px; }
.sidebar .logo-full { width: 152px; height: auto; display: block; }
.sidebar .logo-mark { width: 34px; height: auto; display: none; }
.sidebar nav { padding: 8px 12px 16px 0; display: flex; flex-direction: column; gap: 1px; }
.sb-mod, .sb-sec { display: flex; align-items: center; text-decoration: none; border-radius: 0 8px 8px 0; }
.sb-mod { gap: 12px; min-height: 42px; padding: 0 12px 0 24px; font-size: 14px; font-weight: 600; color: rgba(255,255,255,.78); }
.sb-mod svg { flex-shrink: 0; }
.sb-sec { min-height: 36px; padding: 0 12px 0 54px; font-size: 13px; font-weight: 500; color: var(--chrome-text); }
.sb-mod:hover, .sb-sec:hover { color: #FFFFFF; }
.sb-mod.open { color: #FFFFFF; font-weight: 700; }
.sb-mod.on, .sb-sec.on { color: #FFFFFF; font-weight: 700; background: rgba(255,255,255,.07); box-shadow: inset 3px 0 0 var(--orange); }
.sb-secs { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 8px; }

body.sb-collapsed { --sidebar-w: 72px; }
body.sb-collapsed .sidebar .logo-btn { justify-content: center; padding: 0; }
body.sb-collapsed .logo-full, body.sb-collapsed .sb-label, body.sb-collapsed .sb-secs { display: none; }
body.sb-collapsed .logo-mark { display: block; }
body.sb-collapsed .sidebar nav { padding: 8px 0 16px 0; }
body.sb-collapsed .sb-mod { padding: 0 0 0 27px; }
body.sb-collapsed .sb-mod.open { background: rgba(255,255,255,.07); box-shadow: inset 3px 0 0 var(--orange); }

.main-col { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; flex-shrink: 0; background: var(--chrome); display: flex; align-items: center; gap: 12px; padding: 0 24px 0 32px; border-bottom: 1px solid var(--chrome-line); }
.crumbs { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.crumb-line { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.crumb { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.62); text-decoration: none; }
.crumb:hover { color: #FFFFFF; }
.crumb-sep { font-size: 12px; color: rgba(255,255,255,.4); }
.topbar h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; color: #FFFFFF; white-space: nowrap; }
.topbar .spacer { flex-grow: 1; }
.tb-btn { min-height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.28); background: transparent; color: #FFFFFF; font: 600 13px "Mulish", sans-serif; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.tb-btn:hover { border-color: rgba(255,255,255,.6); color: #FFFFFF; }
.tb-pri { min-height: 36px; padding: 0 16px; border-radius: 8px; border: none; background: var(--orange); color: var(--ink); font: 700 13px "Mulish", sans-serif; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.tb-pri:hover { background: var(--orange-hover); color: var(--ink); }
.avatar { width: 36px; height: 36px; border-radius: 999px; border: none; background: var(--orange); color: var(--ink); font: 800 13px "Mulish", sans-serif; display: flex; align-items: center; justify-content: center; cursor: pointer; list-style: none; }
.avatar::-webkit-details-marker { display: none; }
.menu { position: relative; }
.menu-panel { position: absolute; right: 0; top: 44px; z-index: 20; min-width: 240px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 12px 32px rgba(34,34,34,.18); display: flex; flex-direction: column; }
.menu-panel .who { padding: 10px 12px; font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.menu-panel .who b { display: block; color: var(--ink); font-size: 14px; }
.menu-panel a, .menu-panel button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: transparent; border-radius: 8px; font: 600 14px "Mulish", sans-serif; color: var(--ink); text-decoration: none; cursor: pointer; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--sunk); }

.tabband { height: 44px; flex-shrink: 0; background: #FFFFFF; border-bottom: 1px solid var(--line); display: flex; align-items: stretch; gap: 24px; padding: 0 32px; overflow-x: auto; }
.tabband a { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: 14px; white-space: nowrap; color: var(--ink-2); font-weight: 600; }
.tabband a:hover { color: var(--ink); }
.tabband a.on { color: var(--ink); font-weight: 800; box-shadow: inset 0 -3px 0 var(--orange); }
.tabband .group { display: flex; align-items: center; padding-left: 16px; margin-left: 4px; margin-right: -10px; border-left: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }

main.content { background: var(--page); flex-grow: 1; padding: 24px 32px 32px; display: flex; flex-direction: column; gap: 24px; }

.footer { height: 40px; flex-shrink: 0; background: var(--chrome); display: flex; align-items: center; gap: 16px; padding: 0 32px; font-size: 12px; color: rgba(255,255,255,.64); }
.footer .grow { flex-grow: 1; }
.env { display: inline-flex; align-items: center; gap: 7px; color: #FFFFFF; font-weight: 700; }
.foot-link { display: inline-flex; align-items: center; gap: 7px; color: rgba(255,255,255,.84); text-decoration: none; }
.foot-link:hover { color: #FFFFFF; }

/* Components (same names as the canvas) */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi b, .kpi-v { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.muted { color: var(--ink-2); }
.small { font-size: 12px; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; flex-shrink: 0; }
.st { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.num { text-align: right !important; white-space: nowrap; }
.pos { color: var(--good-text); font-weight: 700; }
.neg { color: var(--critical-text); font-weight: 700; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv > span:first-child { color: var(--ink-2); }
.kv > span:last-child { font-weight: 700; text-align: right; }
.t { width: 100%; border-collapse: collapse; }
.t th { font-size: 12px; font-weight: 600; color: var(--ink-2); text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { font-size: 14px; padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tbody tr:hover td { background: var(--hover); }
.t tr:last-child td { border-bottom: none; }
.t .tot td { font-weight: 800; border-top: 1px solid var(--line); background: var(--sunk); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--sunk); color: var(--ink-2); }
.pill.good { background: var(--good-bg); color: var(--good-text); }
.pill.warn { background: var(--warning-bg); color: var(--warning-text); }
.pill.serious { background: var(--serious-bg); color: var(--serious-text); }
.pill.crit { background: var(--critical-bg); color: var(--critical-text); }
.pill.navy { background: var(--navy-50); color: var(--navy); }
.pill.accent { background: var(--orange-100); color: var(--orange-text); }

.btn, .btn-pri, .btn-ghost { min-height: 36px; border-radius: 8px; font: 600 13px "Mulish", sans-serif; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.btn { padding: 0 14px; border: 1px solid var(--line); background: #FFFFFF; color: var(--ink); }
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-pri { padding: 0 16px; border: none; background: var(--orange); color: var(--ink); font-weight: 700; }
.btn-pri:hover { background: var(--orange-hover); color: var(--ink); }
.btn-ghost { padding: 0 10px; border: none; background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--navy-50); color: var(--navy); }
.btn:disabled, .btn-pri:disabled { background: #FFFFFF; border: 1px solid var(--line); color: var(--ink-3); cursor: not-allowed; }
.segs { display: inline-flex; padding: 3px; gap: 2px; background: var(--sunk); border-radius: 10px; }
.seg { min-height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font: 600 13px "Mulish", sans-serif; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.seg:hover { color: var(--ink); }
.seg.on { background: #FFFFFF; color: var(--navy); font-weight: 700; box-shadow: 0 1px 2px rgba(34,34,34,.12); }

.empty { padding: 72px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.empty h2 { margin: 0; font-size: 18px; font-weight: 800; }
.empty p { margin: 0; font-size: 14px; color: var(--ink-2); }

.messages { display: flex; flex-direction: column; gap: 8px; }
.msg { background: #FFFFFF; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 10px; padding: 12px 16px; font-size: 14px; }
.msg.success { border-left-color: var(--good); }
.msg.error { border-left-color: var(--critical); }
.msg.warning { border-left-color: var(--warning); }

/* Tooltip: the only place for a definition (formula, basis, what is excluded).
   <button type="button" class="tip" aria-label="Definition"><span aria-hidden="true">i</span><span class="tip-b" role="tooltip">…</span></button>
   Add .tip-r on the button when it sits near the right edge of a card. */
.tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 6px; padding: 0; border-radius: 999px; border: 1px solid #C9C6C0; background: #FFFFFF; color: var(--ink-2); font: 800 10px "Mulish", sans-serif; cursor: help; vertical-align: middle; flex-shrink: 0; }
.tip:hover, .tip:focus { border-color: var(--navy); color: var(--navy); outline: none; }
.tip .tip-b { display: none; position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); z-index: 40; width: max-content; max-width: 280px; background: var(--chrome); color: #FFFFFF; font: 500 12px/1.45 "Mulish", sans-serif; padding: 8px 10px; border-radius: 8px; box-shadow: 0 8px 24px rgba(34,34,34,.24); text-align: left; white-space: normal; }
.tip.tip-r .tip-b { left: auto; right: -8px; transform: none; }
.tip:hover .tip-b, .tip:focus .tip-b { display: block; }

/* Forms (also styles allauth's default elements) */
form p { margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], select, textarea {
  height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; font: 400 15px "Mulish", sans-serif; color: var(--ink); background: #FFFFFF; width: 100%;
}
textarea { height: auto; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(42,61,80,.15); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--navy); outline-offset: 1px; }
.errorlist { list-style: none; margin: 0 0 8px; padding: 0; color: var(--critical-text); font-size: 13px; font-weight: 600; }
.panel button, .auth-card button, .panel .btnlike { min-height: 40px; padding: 0 16px; border-radius: 8px; border: none; background: var(--orange); color: var(--ink); font: 700 14px "Mulish", sans-serif; cursor: pointer; margin: 4px 8px 4px 0; }
.panel button[type=button], .auth-card button[type=button] { background: #FFFFFF; color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.panel { padding: 24px; max-width: 720px; }
.panel h1, .panel h2 { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
.panel table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; }
.panel th, .panel td { text-align: left; font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line-2); }

/* Auth pages */
body.auth { background: var(--page); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 32px 16px; }
.auth-wrap .logo { width: 280px; height: auto; }
.auth-card { width: 100%; max-width: 420px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.auth-card h1 { margin: 0 0 18px; font-size: 20px; font-weight: 800; }
.auth-card button[type=submit] { width: 100%; margin: 8px 0 0; }
.auth-card hr { border: 0; border-top: 1px solid var(--line-2); margin: 20px 0; }
.auth-card #passkey_login { background: #FFFFFF; color: var(--ink); border: 1px solid var(--line); font-weight: 700; width: 100%; margin: 0; }
.auth-env { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--warning-text); text-transform: uppercase; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar { padding: 0 16px; height: 56px; }
  .topbar h1 { font-size: 17px; }
  .crumb-line { display: none; }
  .tabband { padding: 0 16px; gap: 20px; }
  main.content { padding: 16px; }
  .footer { padding: 0 16px; }
}
