/*
 * GFM Hub. Layout mirrors the Credixa Hub (Argon): fixed sidebar with section headings, a header band
 * with four stat cards, and content cards that overlap the band. Colours come only from gfm-tokens.css.
 */
:root {
  --hub-side: 250px;
  --hub-card-shadow: 0 0 2rem 0 rgb(35 74 58 / 12%);
  --hub-band: linear-gradient(87deg, var(--gfm-primary-strong) 0%, var(--gfm-primary) 55%, #2f6b50 100%);
}

[data-theme='dark'] {
  --hub-card-shadow: 0 0 2rem 0 rgb(0 0 0 / 35%);
  --hub-band: linear-gradient(87deg, #0f2219 0%, #173a2c 60%, #1f4d3a 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--gfm-page);
  color: var(--gfm-ink);
  font: 400 14px/1.5 var(--gfm-font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gfm-text-accent); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gfm-focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link {
  position: fixed;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--gfm-surface);
  color: var(--gfm-primary);
  font-weight: 700;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 16px; }
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; fill: none; stroke: currentcolor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Sidebar ---------- */
.side {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--hub-side);
  background: var(--gfm-surface);
  border-right: 1px solid var(--gfm-card-border);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: transform 0.2s ease;
}

.side-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--gfm-card-border);
}

.side-brand img { height: 46px; width: auto; }
[data-theme='dark'] .side-brand img { filter: brightness(1.15); }

.side-search {
  margin: 14px 16px 4px;
  position: relative;
}

.side-search .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gfm-label);
  font-size: 12px;
}

.side-search input {
  width: 100%;
  border: 1px solid var(--gfm-card-border);
  background: var(--gfm-soft);
  border-radius: 999px;
  padding: 7px 12px 7px 32px;
  font-size: 13px;
}

.side-nav { overflow-y: auto; flex: 1; padding: 6px 0 18px; }

.side-heading {
  margin: 18px 24px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gfm-label);
}

.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px;
  color: var(--gfm-ink);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
}

.side-link .icon { width: 18px; height: 18px; text-align: center; color: var(--gfm-green-button); font-size: 14px; }
.side-link:hover { background: var(--gfm-soft); }
.side-link.on { background: var(--gfm-active-bg); border-left-color: var(--gfm-active-indicator); font-weight: 600; }
.side-link.on .icon { color: var(--gfm-text-accent); }
.side-count { margin-left: auto; font-size: 11px; color: var(--gfm-label); }

.side-foot {
  border-top: 1px solid var(--gfm-card-border);
  padding: 12px 24px 16px;
  font-size: 12px;
  color: var(--gfm-label);
}

/* ---------- Main ---------- */
.main { margin-left: var(--hub-side); min-height: 100vh; display: flex; flex-direction: column; }

.band { background: var(--hub-band); color: var(--gfm-on-hero); padding: 0 32px 104px; }

.top {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
}

.top-burger {
  display: none;
  background: none;
  border: 0;
  color: inherit;
  font-size: 18px;
  padding: 6px;
  cursor: pointer;
}

.top-crumb {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.top-grow { flex: 1; }

.top-btn {
  background: rgb(255 255 255 / 12%);
  border: 1px solid rgb(255 255 255 / 22%);
  color: inherit;
  border-radius: 999px;
  height: 36px;
  min-width: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.top-btn:hover { background: rgb(255 255 255 / 20%); }
.top-btn[aria-pressed='true'] { background: rgb(255 255 255 / 24%); }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gfm-accent);
  color: #1d2b24;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.user { position: relative; }
.user-btn { padding: 0 12px 0 3px; height: 38px; }
.user-name { font-weight: 600; font-size: 13px; }
.user-role { font-size: 11px; opacity: 0.85; }
.user-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 250px;
  background: var(--gfm-surface);
  color: var(--gfm-ink);
  border: 1px solid var(--gfm-card-border);
  border-radius: 10px;
  box-shadow: var(--hub-card-shadow);
  padding: 8px 0;
  z-index: 40;
}

.menu h6 { margin: 6px 16px 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gfm-label); }
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 8px 16px;
  cursor: pointer;
}
.menu button:hover { background: var(--gfm-soft); }
.menu button.on { font-weight: 600; color: var(--gfm-text-accent); }
.menu hr { border: 0; border-top: 1px solid var(--gfm-card-border); margin: 6px 0; }
.menu .menu-note { padding: 2px 16px 8px; font-size: 12px; color: var(--gfm-muted); }

.title-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 6px 0 22px; }
.title-row h1 { margin: 0; font: 700 30px/1.15 var(--gfm-font-display); }
.title-row p { margin: 4px 0 0; opacity: 0.9; max-width: 760px; }
.title-side { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.sample-badge {
  border: 1px dashed rgb(255 255 255 / 55%);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
}

.backend-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  border-radius: 999px;
  padding: 5px 11px;
  background: rgb(255 255 255 / 10%);
  border: 1px solid rgb(255 255 255 / 18%);
  font-size: 11px;
  line-height: 1.3;
}

.workspace-context {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 10px;
  background: rgb(255 255 255 / 9%);
}

.workspace-copy { min-width: 210px; }
.workspace-copy > span,
.role-switch > span,
.eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.workspace-copy > span,
.role-switch > span { color: rgb(255 255 255 / 72%); }
.workspace-copy strong { display: block; font: 700 18px/1.25 var(--gfm-font-display); }
.workspace-copy p { margin: 2px 0 0; font-size: 12px; color: rgb(255 255 255 / 82%); }
.role-switch { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.role-switch > span { margin-right: 3px; }
.role-switch button {
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
}
.role-switch button:hover { background: rgb(255 255 255 / 12%); }
.role-switch button[aria-pressed='true'] { background: var(--gfm-surface); color: var(--gfm-primary); border-color: var(--gfm-surface); font-weight: 700; }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

.stat {
  background: var(--gfm-surface);
  color: var(--gfm-ink);
  border-radius: 10px;
  box-shadow: var(--hub-card-shadow);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
}

.stat-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gfm-label); }
.stat-value { font: 700 24px/1.2 var(--gfm-font-display); grid-column: 1; font-variant-numeric: tabular-nums; }
.stat-note { grid-column: 1 / -1; font-size: 12px; color: var(--gfm-muted); }
.stat-note b.up { color: var(--gfm-tag-good); }
.stat-note b.down { color: var(--gfm-tag-bad); }

.stat-icon {
  grid-column: 2;
  grid-row: 1 / 3;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 10px rgb(0 0 0 / 12%);
}

.i-green { background: var(--gfm-green-button); }
.i-gold { background: #a8852f; }
.i-red { background: var(--gfm-alert); }
.i-ink { background: var(--gfm-primary); }

/* ---------- Content ---------- */
.content { margin-top: -72px; padding: 0 32px; flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

.card {
  background: var(--gfm-surface);
  border: 1px solid var(--gfm-card-border);
  border-radius: 10px;
  box-shadow: var(--hub-card-shadow);
  margin-bottom: 24px;
  min-width: 0;
}

.card-head { padding: 18px 24px 14px; border-bottom: 1px solid var(--gfm-card-border); display: flex; gap: 12px; align-items: flex-start; }
.card-head h2 { margin: 0; font: 700 18px/1.3 var(--gfm-font-display); }
.card-head p { margin: 4px 0 0; color: var(--gfm-muted); font-size: 13px; max-width: 820px; }
.card-head .grow { flex: 1; min-width: 0; }
.card-body { padding: 18px 24px; }
.card-scroll { overflow-x: auto; }
.section-row { margin-bottom: 0; }

.journey-card { overflow: hidden; }
.journey-card .eyebrow { color: var(--gfm-gold-dark); margin-bottom: 3px; }
.prototype-chip { border: 1px solid var(--gfm-border-strong); border-radius: 999px; color: var(--gfm-muted); padding: 4px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.journey { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.journey-step {
  position: relative;
  min-width: 0;
  padding: 20px 18px 22px;
  border-right: 1px solid var(--gfm-card-border);
  color: var(--gfm-ink);
  text-decoration: none;
}
.journey-step:last-child { border-right: 0; }
.journey-step:hover { background: var(--gfm-row-tint); }
.journey-number { display: block; color: var(--gfm-label); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; }
.journey-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin: 10px 0 12px; border-radius: 9px; background: var(--gfm-active-bg); color: var(--gfm-text-accent); font-size: 17px; }
.journey-step strong { display: block; font: 700 15px/1.25 var(--gfm-font-display); }
.journey-step small { display: block; margin-top: 4px; color: var(--gfm-muted); font-size: 12px; line-height: 1.4; }
.journey-arrow { position: absolute; top: 36px; right: -9px; z-index: 2; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--gfm-surface); color: var(--gfm-label); }

/* Argon "thead-light" tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  background: var(--gfm-soft);
  color: var(--gfm-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  padding: 10px 16px;
  white-space: nowrap;
  border-bottom: 1px solid var(--gfm-card-border);
}
td { padding: 11px 16px; border-bottom: 1px solid var(--gfm-card-border); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--gfm-row-tint); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; white-space: nowrap; }
td.act { white-space: nowrap; text-align: right; }
td.yes { color: var(--gfm-tag-good); font-weight: 700; text-align: center; }
td.no { color: var(--gfm-label); text-align: center; }

.tag { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.t-good { background: var(--gfm-tag-good-bg); color: var(--gfm-tag-good); }
.t-warn { background: var(--gfm-tag-warn-bg); color: var(--gfm-tag-warn); }
.t-bad { background: var(--gfm-tag-bad-bg); color: var(--gfm-tag-bad); }
.t-mute { background: var(--gfm-tag-mute-bg); color: var(--gfm-tag-mute); }

.btn {
  border: 1px solid var(--gfm-green-button);
  background: var(--gfm-primary);
  color: var(--gfm-on-primary);
  border-radius: 6px;
  padding: 7px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.btn:hover { background: var(--gfm-primary-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: var(--gfm-tag-mute-bg); color: var(--gfm-tag-mute); border-color: var(--gfm-card-border); cursor: not-allowed; }
.btn.sm { padding: 4px 10px; font-size: 12px; min-height: 28px; }
.btn.ghost { background: transparent; color: var(--gfm-text-accent); border-color: var(--gfm-border-strong); }
.btn.ghost:hover { background: var(--gfm-soft); }
.btn.light { background: var(--gfm-surface); color: var(--gfm-primary); border-color: transparent; }
td.act .btn + .btn { margin-left: 6px; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 24px; border-bottom: 1px solid var(--gfm-card-border); }
.list li:last-child { border-bottom: 0; }
.list .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--gfm-ok); }
.list .dot.warn { background: var(--gfm-accent); }
.list .dot.bad { background: var(--gfm-alert); }
.list .when { font-size: 12px; color: var(--gfm-muted); }
.list .grow { flex: 1; min-width: 0; }
.list .grow a { display: inline-flex; align-items: center; min-height: 24px; padding-inline: 3px; }

/* Charts */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--gfm-chart-grid); }
.chart .axis { fill: var(--gfm-label); font-size: 11px; }
.chart .bar { fill: var(--gfm-green-button); }
.chart .bar.hi { fill: var(--gfm-primary); }
.chart .bar.gold { fill: var(--gfm-accent); }
.chart .line { fill: none; stroke: var(--gfm-primary); stroke-width: 2.5; }
.chart .area { fill: var(--gfm-active-bg); }
.chart .pt { fill: var(--gfm-surface); stroke: var(--gfm-primary); stroke-width: 2; }
.chart .val { fill: var(--gfm-ink); font-size: 11px; font-weight: 600; }
.legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend .v { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-wrap { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: center; }

.meter { height: 8px; background: var(--gfm-track); border-radius: 999px; overflow: hidden; min-width: 80px; }
.meter > span { display: block; height: 100%; background: var(--gfm-green-button); }
.meter.warn > span { background: var(--gfm-accent); }
.meter.bad > span { background: var(--gfm-alert); }

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--gfm-surface);
  color: var(--gfm-ink);
  border: 1px solid var(--gfm-card-border);
  border-left: 4px solid var(--gfm-accent);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 13px;
}

.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.role-card { border: 1px solid var(--gfm-card-border); border-radius: 8px; padding: 16px; background: var(--gfm-row-tint); }
.role-card h3 { margin: 0 0 5px; font: 700 16px/1.25 var(--gfm-font-display); }
.role-card p { margin: 0; color: var(--gfm-muted); font-size: 12px; }
.role-modules { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.role-modules li { border: 1px solid var(--gfm-card-border); border-radius: 999px; background: var(--gfm-surface); padding: 3px 8px; font-size: 11px; }

.donut {
  width: 148px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--segments);
  position: relative;
}
.donut::after { content: ''; position: absolute; inset: 25%; border-radius: 50%; background: var(--gfm-surface); }
.chart-empty { color: var(--gfm-muted); min-height: 120px; display: grid; place-items: center; }

.denied { text-align: center; padding: 48px 24px; }
.denied .icon { width: 32px; height: 32px; color: var(--gfm-label); }
.denied h2 { font: 700 20px var(--gfm-font-display); margin: 12px 0 6px; }

/* Footer */
.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
  padding: 16px 32px 24px;
  font-size: 12px;
  color: var(--gfm-label);
}
.vvv { font: italic 600 13px var(--gfm-font-display); letter-spacing: 0.14em; color: var(--gfm-text-accent); }

/* Toast */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 420px;
  background: var(--gfm-primary-strong);
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 25%);
  font-size: 13px;
  z-index: 60;
}

/* ---------- Sign-in (Argon guest layout) ---------- */
.guest { min-height: 100vh; background: var(--hub-band); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; color: #fff; }
.guest .instance-pill { margin: 0 0 10px; padding: 4px 10px; border: 1px solid rgb(255 255 255 / 28%); border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.guest h1 { font: 700 28px var(--gfm-font-display); margin: 0 0 6px; text-align: center; }
.guest > p { margin: 0 0 24px; opacity: 0.9; text-align: center; }
.guest-card { width: 100%; max-width: 420px; background: var(--gfm-surface); color: var(--gfm-ink); border-radius: 12px; box-shadow: 0 24px 60px rgb(8 20 15 / 35%); padding: 28px; }
.guest-card img { display: block; height: 52px; margin: 0 auto 18px; }
.guest-card label { display: block; font-size: 12px; font-weight: 600; color: var(--gfm-label); margin: 12px 0 6px; }
.field { position: relative; }
.field .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gfm-label); }
.field input,
.field select { width: 100%; min-height: 42px; border: 1px solid var(--gfm-border-strong); border-radius: 8px; padding: 10px 12px 10px 36px; background: var(--gfm-surface); }
.guest-card .btn { width: 100%; justify-content: center; margin-top: 20px; min-height: 42px; font-size: 14px; }
.guest-help { font-size: 12px; color: var(--gfm-muted); margin: 14px 0 0; text-align: center; }
.demo-roles { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--gfm-border-strong); }
.demo-roles p { margin: 0 0 10px; font-size: 12px; color: var(--gfm-muted); text-align: center; }
.demo-roles div { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.guest .vvv { color: #fff; opacity: 0.9; margin-top: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3 { grid-template-columns: 1fr; }
  .workspace-context { align-items: flex-start; }
  .role-switch { max-width: 520px; }
  .journey { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .journey-step { border-bottom: 1px solid var(--gfm-card-border); }
  .journey-step:nth-child(3) { border-right: 0; }
  .journey-arrow { display: none; }
}

@media (max-width: 991px) {
  .side { transform: translateX(-100%); box-shadow: var(--hub-card-shadow); }
  .side.open { transform: none; }
  .main { margin-left: 0; }
  .top-burger { display: inline-flex; }
  .grid2 { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-context { display: block; }
  .role-switch { margin: 12px 0 0; justify-content: flex-start; }
  .scrim { position: fixed; inset: 0; background: rgb(0 0 0 / 35%); z-index: 25; }
}

@media (max-width: 575px) {
  .band { padding: 0 16px 96px; }
  .content { padding: 0 16px; }
  .foot { padding: 16px; }
  .stats { grid-template-columns: 1fr; gap: 12px; }
  .title-row h1 { font-size: 24px; }
  .user-text { display: none; }
  .card-head, .card-body { padding-left: 16px; padding-right: 16px; }
  th:first-child, td:first-child { padding-left: 16px; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .role-grid { grid-template-columns: 1fr; }
  .toast { left: 16px; right: 16px; }
  .backend-note { border-radius: 8px; }
  .journey { grid-template-columns: 1fr; }
  .journey-step { border-right: 0; }
  .journey-step:last-child { border-bottom: 0; }
  .role-switch { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; }
  .role-switch > span, .role-switch button { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* =====================================================================================
 * Green Fleet Hub (Laravel) additions: working forms, alerts, truth badges, journals.
 * Colours come only from gfm-tokens.css.
 * ===================================================================================== */
body { padding-top: 32px; }
.ribbon {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 32px;
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 16px;
  background: var(--gfm-gold); color: #1d2b24; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ribbon strong { letter-spacing: 0.1em; }
.ribbon span { overflow: hidden; text-overflow: ellipsis; }
.side { top: 32px; }
.guest { min-height: calc(100vh - 0px); }
body:has(.guest) { padding-top: 0; }

.top-crumb a, .top-crumb span { color: inherit; text-decoration: none; }
.top-crumb a:hover { text-decoration: underline; }
.top-crumb span[aria-hidden] { margin: 0 6px; opacity: 0.6; }
.user summary { list-style: none; }
.user summary::-webkit-details-marker { display: none; }
.band.compact { padding-bottom: 88px; }
.band .stats { margin-bottom: 0; }
.content:focus { outline: none; }

.stat-link { text-decoration: none; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.stat-link:hover { transform: translateY(-1px); box-shadow: 0 0 0 2px var(--gfm-active-indicator), var(--hub-card-shadow); }
.stat-drill { grid-column: 1 / -1; font-size: 11px; color: var(--gfm-text-accent); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }

.truth {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px;
  font-size: 11px; font-weight: 600; white-space: nowrap; border: 1px dashed currentcolor;
}
.truth-dot { width: 7px; height: 7px; border-radius: 50%; background: currentcolor; }
.truth.t-good { color: var(--gfm-tag-good); background: var(--gfm-tag-good-bg); }
.truth.t-warn { color: var(--gfm-tag-warn); background: var(--gfm-tag-warn-bg); }
.truth.t-mute { color: var(--gfm-tag-mute); background: var(--gfm-tag-mute-bg); }
.truth.on-band { background: rgb(255 255 255 / 12%); color: #fff; border-color: rgb(255 255 255 / 55%); }
.truth-asof { font-weight: 400; opacity: 0.85; }
.tag .icon { width: 12px; height: 12px; }

.alert { display: flex; gap: 12px; align-items: flex-start; border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; font-size: 13px; background: var(--gfm-surface); border: 1px solid var(--gfm-card-border); box-shadow: var(--hub-card-shadow); }
.alert .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert.ok { border-left: 4px solid var(--gfm-ok); }
.alert.ok .icon { color: var(--gfm-ok); }
.alert.bad { border-left: 4px solid var(--gfm-alert); }
.alert.bad .icon { color: var(--gfm-alert); }
.guest-card .alert { box-shadow: none; }
.notice .icon { width: 18px; height: 18px; flex: none; color: var(--gfm-gold-dark); margin-top: 1px; }

.muted { color: var(--gfm-muted); }
.nowrap { white-space: nowrap; }
td.wrap { min-width: 220px; }
.mono, code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; }
code { background: var(--gfm-soft); border-radius: 4px; padding: 1px 5px; }
.row-head { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: var(--gfm-ink); background: transparent; }
.row-head code { margin-left: 6px; color: var(--gfm-muted); }
.matrix td.yes .icon { width: 16px; height: 16px; }
td.num.pos { color: var(--gfm-tag-good); }
td.num.neg { color: var(--gfm-tag-bad); }
tr.total td { font-weight: 700; background: var(--gfm-soft); border-top: 2px solid var(--gfm-border-strong); }
tr.is-sim td:first-child { box-shadow: inset 3px 0 0 var(--gfm-gold); }
a.row-link { color: var(--gfm-ink); font-weight: 600; text-decoration: none; }
a.row-link:hover { color: var(--gfm-text-accent); text-decoration: underline; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-all { grid-column: 1 / -1; }
.form-field { margin-bottom: 14px; min-width: 0; }
.form-field label { display: block; font-size: 12px; font-weight: 600; color: var(--gfm-label); margin-bottom: 6px; }
.form-field .req { color: var(--gfm-alert); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; min-height: 40px; border: 1px solid var(--gfm-field-outline); border-radius: 6px; padding: 8px 12px;
  background: var(--gfm-surface); color: var(--gfm-ink);
}
.form-field input:hover, .form-field select:hover, .form-field textarea:hover { border-color: var(--gfm-field-outline-hover); }
.form-field.has-error input, .form-field.has-error select, .form-field.has-error textarea { border-color: var(--gfm-alert); }
.field-hint { margin: 5px 0 0; font-size: 12px; color: var(--gfm-muted); }
.field-error { margin: 5px 0 0; font-size: 12px; color: var(--gfm-tag-bad); font-weight: 600; }
.guest .field-error { text-align: left; }
.check-row { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 14px; font-size: 13px; }
.check-row input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--gfm-primary); }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--gfm-card-border); margin-top: 8px; }
.form-actions .grow { flex: 1; }
.btn.danger { background: var(--gfm-alert); border-color: var(--gfm-alert); }
.btn.danger:hover { filter: brightness(0.92); background: var(--gfm-alert); }
.btn.gold { background: var(--gfm-gold); border-color: var(--gfm-gold); color: #1d2b24; }
.btn .icon { width: 14px; height: 14px; }
a.btn { text-decoration: none; }
span.btn[aria-disabled='true'] { opacity: 0.5; cursor: default; }

.filters { display: flex; flex-wrap: wrap; gap: 0 16px; align-items: flex-end; padding: 16px 24px 4px; border-bottom: 1px solid var(--gfm-card-border); }
.filters .form-field { min-width: 180px; flex: 1; max-width: 280px; }
.filter-actions { margin-bottom: 14px; display: flex; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 24px; border-bottom: 1px solid var(--gfm-card-border); }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--gfm-border-strong); border-radius: 999px; padding: 4px 12px; font-size: 12px; color: var(--gfm-ink); text-decoration: none; background: var(--gfm-surface); min-height: 28px; }
.chip:hover { background: var(--gfm-soft); }
.chip.on { background: var(--gfm-active-bg); border-color: var(--gfm-active-indicator); font-weight: 700; }
.chip b { font-variant-numeric: tabular-nums; }
.pager { padding: 12px 24px; border-top: 1px solid var(--gfm-card-border); }
.pager-nav { display: flex; gap: 12px; align-items: center; justify-content: space-between; }

/* Facts, 360 headers, tabs */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px 24px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gfm-label); }
.facts dd { margin: 3px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.facts dd.big { font: 700 20px/1.2 var(--gfm-font-display); font-variant-numeric: tabular-nums; }
.record-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.record-head .ref { font-family: ui-monospace, Menlo, monospace; background: rgb(255 255 255 / 14%); padding: 2px 8px; border-radius: 6px; font-size: 13px; }
.split-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; }

/* Checklist and stepper */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--gfm-card-border); font-size: 13px; }
.checklist li:last-child { border-bottom: 0; }
.checklist .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.checklist .ok .icon { color: var(--gfm-ok); }
.checklist .no .icon { color: var(--gfm-alert); }
.checklist .grow { flex: 1; }
.stepper { list-style: none; display: flex; margin: 0 0 20px; padding: 0; gap: 0; counter-reset: step; flex-wrap: wrap; }
.stepper li { flex: 1; min-width: 120px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--gfm-label); border-bottom: 3px solid var(--gfm-track); counter-increment: step; }
.stepper li::before { content: counter(step); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gfm-track); color: var(--gfm-ink); font-size: 11px; }
.stepper li.done { color: var(--gfm-tag-good); border-color: var(--gfm-ok); }
.stepper li.done::before { background: var(--gfm-ok); color: #fff; content: '✓'; }
.stepper li.now { color: var(--gfm-ink); border-color: var(--gfm-gold); }
.stepper li.now::before { background: var(--gfm-gold); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; position: relative; font-size: 13px; }
.timeline li:not(:last-child)::after { content: ''; position: absolute; left: 4px; top: 26px; bottom: -6px; width: 1px; background: var(--gfm-card-border); }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gfm-green-button); margin-top: 5px; flex: none; }
.tl-detail { color: var(--gfm-muted); }
.when { font-size: 12px; color: var(--gfm-muted); }

.empty { text-align: center; padding: 36px 24px; color: var(--gfm-muted); }
.empty .icon { width: 28px; height: 28px; color: var(--gfm-label); }
.empty h3 { margin: 10px 0 4px; font: 700 16px var(--gfm-font-display); color: var(--gfm-ink); }

/* Money: journal preview and split bars */
.journal { margin-top: 4px; }
.journal td.dr, .journal td.cr { width: 140px; }
.balance-line { display: flex; gap: 8px; align-items: center; padding: 10px 24px; font-size: 13px; font-weight: 600; }
.balance-line.ok { color: var(--gfm-tag-good); }
.balance-line.bad { color: var(--gfm-tag-bad); }
.splitbar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--gfm-track); margin: 8px 0 12px; }
.splitbar span { display: block; height: 100%; }
.sw-owner { background: var(--gfm-primary); }
.sw-swap { background: #7b8a82; }
.sw-guarantee { background: var(--gfm-gold); }
.sw-fee { background: var(--gfm-green-button); }
.sw-excess { background: #a8852f; }
.sw-suspense { background: var(--gfm-alert); }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 90px; gap: 12px; align-items: center; font-size: 13px; text-decoration: none; color: var(--gfm-ink); }
.bar-row:hover .meter { outline: 2px solid var(--gfm-active-indicator); }
.bar-row .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-inline { display: flex; gap: 28px; flex-wrap: wrap; }
.kpi-inline div span { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gfm-label); }
.kpi-inline div strong { font: 700 20px/1.3 var(--gfm-font-display); font-variant-numeric: tabular-nums; }

.queue { list-style: none; margin: 0; padding: 0; }
.queue li { display: flex; gap: 12px; align-items: center; padding: 12px 24px; border-bottom: 1px solid var(--gfm-card-border); }
.queue li:last-child { border-bottom: 0; }
.queue .grow { flex: 1; min-width: 0; }
.queue .count { font: 700 20px var(--gfm-font-display); min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.queue a.grow { color: var(--gfm-ink); text-decoration: none; }
.queue a.grow:hover strong { text-decoration: underline; }
.queue small { display: block; color: var(--gfm-muted); }

.demo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; text-align: left; }
.demo-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.demo-list span { color: var(--gfm-muted); }

details.drawer { border-top: 1px solid var(--gfm-card-border); }
details.drawer > summary { cursor: pointer; padding: 12px 24px; font-weight: 600; color: var(--gfm-text-accent); }
details.drawer > div { padding: 0 24px 16px; }

@media (max-width: 991px) {
  .form-grid, .form-grid.three, .split-cols { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 110px 1fr 80px; }
  .ribbon span { display: none; }
}
@media (max-width: 575px) {
  .filters { padding: 12px 16px 0; }
  .filters .form-field { max-width: none; }
  .queue li, .chips, .pager { padding-left: 16px; padding-right: 16px; }
  .facts { grid-template-columns: 1fr 1fr; }
}
@media print {
  .side, .ribbon, .top, .foot, .filters, .form-actions { display: none !important; }
  .main { margin: 0; }
  body { padding: 0; }
}
