/* Compass — visual system
   Ink navy for structure, a teal signal for anything KHIVE decides,
   SAP semantic colours for status so it reads correctly to Fiori users. */

:root {
  --ink: #0c2233;
  --ink-soft: #43596b;
  --muted: #6b8093;
  --line: #d8e0e8;
  --line-soft: #eaeff4;
  --surface: #f3f6f9;
  --card: #ffffff;
  --accent: #0a6ed1;
  --accent-dark: #085caf;
  --khive: #00857a;
  --khive-soft: #e2f3f1;
  --good: #107e3e;
  --warn: #e9730c;
  --bad: #bb0000;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(12, 34, 51, .08), 0 6px 18px rgba(12, 34, 51, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.boot { padding: 80px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- layout */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--ink);
  color: #cfdae4;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  margin-bottom: 14px;
}
.brand .mark {
  width: 30px; height: 30px; flex: 0 0 30px;
  display: grid; place-items: center;
  background: var(--khive);
  border-radius: 8px;
  color: #04231f; font-weight: 800;
}
.brand h1 { font-size: 16px; margin: 0; color: #fff; letter-spacing: -.2px; }
.brand span { display: block; font-size: 11px; color: #7f9ab0; font-weight: 400; letter-spacing: .3px; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.nav a {
  padding: 9px 12px;
  border-radius: var(--radius);
  color: #cfdae4;
  font-size: 13.5px;
  display: flex; justify-content: space-between; align-items: center;
}
.nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }
.nav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav .group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: #6f8ba3; padding: 16px 12px 6px; }
.nav .pill { background: rgba(255,255,255,.16); border-radius: 20px; padding: 1px 7px; font-size: 11px; }

.who { padding: 14px 20px 0; border-top: 1px solid rgba(255,255,255,.09); margin-top: 12px; font-size: 12px; color: #96adc0; }
.who strong { display: block; color: #fff; font-size: 13px; font-weight: 600; }
.who button {
  margin-top: 10px; width: 100%; background: transparent; color: #cfdae4;
  border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius);
  padding: 7px; font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.who button:hover { background: rgba(255,255,255,.08); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar h2 { margin: 0; font-size: 19px; letter-spacing: -.3px; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.content { padding: 24px 28px 60px; max-width: 1400px; width: 100%; }

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card > h3 { margin: 0 0 4px; font-size: 15px; letter-spacing: -.1px; }
.card > h3 + .sub { margin: 0 0 16px; color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.kpi .value { font-size: 26px; font-weight: 650; letter-spacing: -.8px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.accent .value { color: var(--khive); }

/* ---------------------------------------------------------------- inputs */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; color: var(--ink-soft); }
label.field .hint { font-weight: 400; color: var(--muted); }

input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-bottom: 2px solid #b9c6d2;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13.5px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-bottom-color: var(--accent); }
textarea { min-height: 76px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  padding: 8px 15px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: #eaf3fc; }
.btn.quiet { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn.quiet:hover { background: var(--line-soft); }
.btn.khive { background: var(--khive); border-color: var(--khive); }
.btn.khive:hover { background: #00706a; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn.danger { background: var(--bad); border-color: var(--bad); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:hover { background: #fafcfe; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 3px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .2px; white-space: nowrap;
}
.badge.grey { background: #edf1f5; color: var(--ink-soft); }
.badge.blue { background: #e3f0fb; color: var(--accent-dark); }
.badge.green { background: #e4f2e9; color: var(--good); }
.badge.amber { background: #fdf0e2; color: #a05000; }
.badge.red { background: #fbe6e6; color: var(--bad); }
.badge.teal { background: var(--khive-soft); color: var(--khive); }

/* ------------------------------------------------------- signature: score */
.meter { display: flex; align-items: center; gap: 8px; }
.meter .track { flex: 1; height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; min-width: 60px; }
.meter .fill { height: 100%; background: var(--khive); border-radius: 3px; }
.meter .val { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 13px; width: 34px; text-align: right; }

/* The KHIVE cost ladder: the framework's argument, drawn.
   Top track is what a purpose-built model costs to run; bottom track is the
   same workload answered token by token. */
.ladder { margin-top: 12px; }
.ladder .lane { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; font-size: 12px; }
.ladder .lane .cap { width: 108px; flex: 0 0 108px; color: var(--muted); }
.ladder .lane .bar { height: 14px; border-radius: 2px; min-width: 2px; }
.ladder .lane.khive .bar { background: var(--khive); }
.ladder .lane.llm .bar { background: repeating-linear-gradient(135deg, #c8d3dd, #c8d3dd 4px, #dfe6ec 4px, #dfe6ec 8px); }
.ladder .lane .amt { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-soft); }
.ladder .verdict { font-size: 12.5px; color: var(--khive); font-weight: 600; margin-top: 6px; }

/* ------------------------------------------------------------- use cases */
.uc {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.uc.selected { border-left-color: var(--khive); background: #fcfefe; }
.uc h4 { margin: 0 0 4px; font-size: 15px; letter-spacing: -.1px; }
.uc .summary { color: var(--ink-soft); margin: 0 0 12px; max-width: 78ch; }
.uc .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.uc .scores { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin: 14px 0; padding: 12px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.uc .scores .s .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 3px; }
.uc details { margin-top: 10px; }
.uc summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 600; }
.uc dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 12px 0 0; font-size: 13px; }
.uc dt { color: var(--muted); }
.uc dd { margin: 0; }

.rank-handle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 4px; background: var(--ink); color: #fff;
  font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- stepper */
.steps { display: flex; gap: 0; margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.steps button {
  flex: 1; padding: 12px 14px; background: transparent; border: 0; border-right: 1px solid var(--line);
  font-family: inherit; font-size: 13px; text-align: left; cursor: pointer; color: var(--muted);
}
.steps button:last-child { border-right: 0; }
.steps button strong { display: block; color: var(--ink); font-size: 13.5px; }
.steps button.active { background: #f0f7fd; box-shadow: inset 0 -3px 0 var(--accent); }
.steps button.active strong { color: var(--accent-dark); }
.steps button:disabled { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------- checkboxes */
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.checks label {
  display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: 13px; background: #fff;
}
.checks label:hover { border-color: var(--accent); }
.checks label.on { border-color: var(--khive); background: var(--khive-soft); }
.checks input { margin: 2px 0 0; }

.scale { display: flex; gap: 6px; }
.scale button {
  flex: 1; padding: 8px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius);
  cursor: pointer; font-family: inherit; font-size: 13px;
}
.scale button.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------ login */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-hero { background: var(--ink); color: #fff; padding: 56px 52px; display: flex; flex-direction: column; justify-content: center; }
.auth-hero .mark { width: 44px; height: 44px; background: var(--khive); border-radius: 10px; display: grid; place-items: center; color: #04231f; font-weight: 800; font-size: 20px; margin-bottom: 26px; }
.auth-hero h1 { font-size: 34px; line-height: 1.15; letter-spacing: -1px; margin: 0 0 14px; max-width: 15ch; }
.auth-hero p { color: #9fb6c8; font-size: 15px; max-width: 46ch; margin: 0 0 30px; }
.auth-hero ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 44ch; }
.auth-hero li { display: flex; gap: 11px; font-size: 13.5px; color: #cfdae4; }
.auth-hero li b { color: var(--khive); font-variant-numeric: tabular-nums; }
.auth-form { display: grid; place-items: center; padding: 40px; }
.auth-form .inner { width: 100%; max-width: 380px; }
.auth-form h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.4px; }
.auth-form .sub { color: var(--muted); margin: 0 0 24px; }
.demo-login { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.demo-login-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: var(--ink-soft); font-size: 12px; }
.demo-login-head span { font-weight: 700; }
.demo-login-head small { color: var(--muted); }
.demo-login-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.demo-account { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 9px 10px; color: var(--ink); cursor: pointer; font: inherit; }
.demo-account:hover { border-color: var(--accent); background: #f5faff; }
.demo-account b, .demo-account span { display: block; }
.demo-account b { font-size: 12.5px; }
.demo-account span { margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.demo-account:disabled { opacity: .55; cursor: wait; }

/* ----------------------------------------------------------------- misc */
.empty { text-align: center; padding: 46px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: #fff; }
.empty h4 { margin: 0 0 6px; color: var(--ink); font-size: 15px; }

.error { background: #fbe6e6; border: 1px solid #f0c0c0; color: #8b0000; padding: 10px 12px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; }
.notice { background: #fdf6e3; border: 1px solid #f0e0b0; color: #6b5200; padding: 10px 12px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 120%);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: var(--radius);
  font-size: 13.5px; box-shadow: var(--shadow); transition: transform .22s ease; z-index: 99; max-width: 80vw;
}
.toast.show { transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }

.modal-back { position: fixed; inset: 0; background: rgba(12,34,51,.45); display: grid; place-items: center; z-index: 60; padding: 20px; }
.modal { background: #fff; border-radius: 8px; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; padding: 22px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h3 { margin: 0 0 4px; font-size: 17px; }
.modal .sub { color: var(--muted); margin: 0 0 18px; font-size: 13px; }

.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

@media (max-width: 980px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex: none; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav .group { display: none; }
  .grid.c4, .grid.c3, .grid.c2 { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { padding: 36px 26px; }
  .uc .scores { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.content { padding-bottom: 40px; }
.toast { bottom: 22px; }

@media (max-width: 1100px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uc .scores { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { padding: 34px 26px; }
  .sidebar { display: none; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------- CIO strategy */
.layer-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.layer-row:last-child { border-bottom: 0; }
.layer-row .cap { width: 150px; flex: 0 0 150px; color: var(--ink-soft); }
.layer-row .track { flex: 1; height: 7px; background: var(--line-soft); border-radius: 4px; overflow: hidden; min-width: 60px; }
.layer-row .track .fill { display: block; height: 100%; border-radius: 4px; }
.layer-row .amt { font-variant-numeric: tabular-nums; font-weight: 650; width: 40px; text-align: right; }

.q { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 12px 0 7px; }
.levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.levels button {
  text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 9px; cursor: pointer; font-family: inherit; font-size: 12px; color: var(--muted);
  display: flex; flex-direction: column; gap: 3px; min-height: 62px;
}
.levels button:hover { border-color: var(--accent); }
.levels button .lv { font-weight: 700; font-size: 11px; color: var(--muted); }
.levels button .lb { color: var(--ink-soft); line-height: 1.3; }
.levels button.on { background: var(--ink); border-color: var(--ink); }
.levels button.on .lv, .levels button.on .lb { color: #fff; }

ul.dep { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-soft); }

.wave { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 14px; }
.wave-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 10px; }
.wave-head h4 { margin: 0 0 2px; font-size: 16px; letter-spacing: -.2px; }
.wave-head .meter { margin-top: 4px; }

.init { display: flex; align-items: flex-start; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.init:last-child { border-bottom: 0; }
.init .tag { flex: 0 0 78px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; padding-top: 3px; }
.init.use_case .tag { color: var(--khive); }
.init.capability .tag { color: var(--accent); }
.init.data .tag { color: var(--warn); }
.init strong { font-size: 13.5px; }

.qchart { display: grid; gap: 14px; margin-top: 6px; }
.qbar { display: grid; grid-template-columns: 60px 1fr 190px; gap: 14px; align-items: center; }
.qbar .qlab { font-weight: 650; font-size: 13px; }
.qbar .qtracks { display: grid; gap: 4px; }
.qbar .lane { display: flex; align-items: center; gap: 8px; height: 15px; }
.qbar .lane span { height: 13px; border-radius: 2px; min-width: 2px; display: block; }
.qbar .lane em { font-style: normal; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qbar .lane.out span { background: repeating-linear-gradient(135deg, #c8d3dd, #c8d3dd 4px, #dfe6ec 4px, #dfe6ec 8px); }
.qbar .lane.in span { background: var(--khive); }
.qbar .qcum { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.qbar .qcum .cumbar { flex: 1; height: 8px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.qbar .qcum .cumbar span { display: block; height: 100%; border-radius: 4px; }
.qbar .qcum.neg .cumbar span { background: var(--bad); }
.qbar .qcum.pos .cumbar span { background: var(--good); }
.qbar .qcum.neg .mono { color: var(--bad); }
.qbar .qcum.pos .mono { color: var(--good); }

td select { padding: 5px 7px; font-size: 12.5px; border-bottom-width: 1px; }
