:root {
  --ink: #172724;
  --ink-2: #21423d;
  --ink-3: #31534d;
  --paper: #f3f5f0;
  --paper-2: #ffffff;
  --paper-3: #e6ece5;
  --line: #cbd5cd;
  --muted: #667772;
  --orange: #ff6338;
  --orange-dark: #d94520;
  --green: #0a8d68;
  --green-bright: #42d89a;
  --cyan: #168e9c;
  --amber: #c87912;
  --red: #ca4337;
  --display: "Arial Narrow", "Aptos Display", "Segoe UI", sans-serif;
  --body: "Segoe UI", Inter, Arial, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --shadow: 0 18px 45px rgba(23, 39, 36, .11);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(21, 35, 40, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 35, 40, .035) 1px, transparent 1px);
  background-size: 32px 32px;
  font-family: var(--body);
  font-size: 14px;
}

button, input, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  display: block;
  color: var(--orange-dark);
  font: 600 11px/1.2 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.eyebrow.light { color: var(--green-bright); }

/* Login */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(420px, .9fr);
}

.login-visual {
  position: relative;
  min-height: 700px;
  overflow: hidden;
  padding: clamp(36px, 6vw, 86px);
  color: var(--paper-2);
  background: var(--ink);
  border-right: 8px solid var(--orange);
}

.login-visual::before,
.login-visual::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.login-visual::before {
  inset: 0;
  opacity: .18;
  background-image:
    linear-gradient(rgba(99, 216, 163, .25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 216, 163, .25) 1px, transparent 1px);
  background-size: 48px 48px;
}

.login-visual::after {
  width: 44%;
  height: 8px;
  right: 0;
  bottom: 15%;
  background: var(--orange);
  box-shadow: -88px 20px 0 var(--paper-2), -180px -18px 0 var(--green-bright);
}

.login-brand,
.brand-lockup {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 20px;
}

.login-brand img {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border: 2px solid rgba(250, 247, 238, .15);
}

.login-brand h1 {
  margin: 4px 0 0;
  font: 700 clamp(44px, 6vw, 78px)/.8 var(--display);
  letter-spacing: -.02em;
}

.login-brand h1 span,
.brand-lockup strong span { color: var(--orange); }

.login-radar {
  position: absolute;
  z-index: 1;
  width: min(52vw, 610px);
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  transform: translate(-45%, -48%);
  border: 1px solid rgba(99, 216, 163, .18);
  border-radius: 50%;
}

.login-radar::before,
.login-radar::after,
.login-radar i {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(99, 216, 163, .16);
  border-radius: 50%;
}

.login-radar::after { inset: 28%; }
.login-radar i:nth-child(1) { inset: 44%; }
.login-radar i:nth-child(2) { inset: 50% 0 auto; border-radius: 0; border-width: 1px 0 0; }
.login-radar i:nth-child(3) { inset: 0 auto 0 50%; border-radius: 0; border-width: 0 0 0 1px; }

.login-radar b {
  position: absolute;
  width: 9px;
  height: 9px;
  background: var(--green-bright);
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(99, 216, 163, .08);
  animation: signalPulse 2.4s ease-in-out infinite;
}

.login-radar b:nth-of-type(1) { left: 20%; top: 35%; }
.login-radar b:nth-of-type(2) { right: 18%; top: 24%; animation-delay: -.5s; }
.login-radar b:nth-of-type(3) { right: 29%; bottom: 18%; animation-delay: -1s; }
.login-radar b:nth-of-type(4) { left: 35%; bottom: 27%; animation-delay: -1.5s; }

.login-message {
  position: absolute;
  z-index: 2;
  left: clamp(36px, 6vw, 86px);
  bottom: 16%;
  max-width: 620px;
}

.login-message p {
  margin: 0;
  color: var(--orange);
  font: 600 18px/1 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-message strong {
  display: block;
  margin-top: 12px;
  font: 600 clamp(32px, 4vw, 60px)/.95 var(--display);
  text-transform: uppercase;
}

.login-signal {
  position: absolute;
  z-index: 2;
  left: clamp(36px, 6vw, 86px);
  bottom: 7%;
  font-size: 11px;
  letter-spacing: .14em;
}

.login-signal i,
.infra-state > i,
.sync-state > i,
.live-cell > i,
.big-status > i,
.ai-status > i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  background: var(--green-bright);
  border-radius: 50%;
  animation: signalPulse 2s ease-in-out infinite;
}

.login-card {
  display: grid;
  place-items: center;
  padding: 40px;
  background: var(--paper);
}

.login-card-inner { width: min(100%, 480px); }
.login-card h2 {
  margin: 8px 0 10px;
  font: 700 clamp(40px, 5vw, 64px)/.95 var(--display);
  text-transform: uppercase;
}
.form-intro { margin: 0 0 34px; color: var(--muted); line-height: 1.7; }

.login-card form { display: grid; }
.login-card form > label,
.form-grid label > span {
  margin: 18px 0 8px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
}

input, select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper-2);
  padding: 10px 12px;
  color: var(--ink);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input:hover, select:hover { border-color: var(--ink-3); }
input:focus, select:focus { border-color: var(--orange); box-shadow: inset 4px 0 0 var(--orange); outline: none; }

.inline-error {
  margin: 14px 0 0;
  padding: 12px;
  border-left: 4px solid var(--red);
  background: #f7ddd8;
  color: #87291f;
  line-height: 1.5;
}

.login-footnote {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.login-footnote i { display: inline-block; width: 18px; height: 1px; margin: 0 8px 3px 0; background: var(--orange); }

/* Controls */
.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: transform .16s, box-shadow .16s, background .16s, color .16s;
}
.button:not(:disabled):hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 rgba(21, 35, 40, .18); }
.button:not(:disabled):active { transform: translate(0); box-shadow: none; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button.primary { color: white; background: var(--orange); border-color: var(--orange); }
.button.primary:hover { background: var(--orange-dark); }
.button.success { color: white; background: var(--green); border-color: var(--green); }
.button.warning { color: var(--ink); background: #e8b95e; border-color: #d49c33; }
.button.danger { color: white; background: var(--red); border-color: var(--red); }
.button.danger:hover { background: #9f2f29; border-color: #9f2f29; }
.button.ghost { background: transparent; border-color: var(--ink-3); }
.button.ghost:hover { color: white; background: var(--ink-2); }
.button.danger-outline { color: var(--red); background: transparent; border-color: var(--red); }
.button.danger-outline:hover { color: white; background: var(--red); }
.button.wide { width: 100%; }
.button.is-loading span { opacity: 0; }
.button.is-loading::after { content: "···"; }

.text-button,
.text-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-decoration: none;
}
.text-button:hover, .text-link:hover { color: var(--ink); }

/* Application frame */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 244px;
  display: flex;
  flex-direction: column;
  color: var(--paper-2);
  background: var(--ink);
  border-right: 5px solid var(--orange);
}

.brand-lockup { min-height: 96px; padding: 18px; border-bottom: 1px solid rgba(250, 247, 238, .12); }
.brand-lockup img { width: 48px; height: 48px; object-fit: cover; }
.brand-lockup strong { display: block; font: 700 27px/.9 var(--display); letter-spacing: .01em; }
.brand-lockup small { color: #8ba0a4; font-size: 8px; letter-spacing: .18em; }

.main-nav { padding: 22px 12px; display: grid; gap: 5px; }
.nav-button {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  min-height: 48px;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  padding: 0 12px;
  color: #b8c4c4;
  text-align: left;
  transition: color .16s, background .16s, border-color .16s, padding .16s;
}
.nav-button i { color: #738b8e; font: normal 19px var(--mono); }
.nav-button span { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.nav-button b { min-width: 22px; color: var(--ink); background: var(--paper-3); padding: 3px 5px; font-size: 9px; text-align: center; }
.nav-button em { color: var(--orange); font-size: 7px; font-style: normal; letter-spacing: .08em; }
.nav-button:hover { color: white; background: rgba(255, 255, 255, .05); padding-left: 16px; }
.nav-button.is-active { color: white; background: #20353a; border-left-color: var(--orange); }
.nav-button.is-active i { color: var(--orange); }

.sidebar-foot { margin-top: auto; padding: 16px; border-top: 1px solid rgba(250, 247, 238, .12); }
.infra-state { display: flex; align-items: center; margin-bottom: 16px; }
.infra-state > i { flex: 0 0 auto; }
.infra-state strong, .infra-state small { display: block; }
.infra-state strong { font-size: 9px; letter-spacing: .12em; }
.infra-state small { margin-top: 3px; color: #718589; font-size: 8px; }
.logout-button { width: 100%; border: 1px solid #53686c; background: transparent; padding: 10px; color: #bac6c7; font-size: 9px; letter-spacing: .1em; text-align: left; }
.logout-button span { float: right; color: var(--orange); }
.logout-button:hover { color: white; border-color: var(--orange); }

.app-content { grid-column: 2; min-width: 0; }
.topbar {
  min-height: 96px;
  display: grid;
  grid-template-columns: 1fr minmax(220px, 320px) auto;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(22px, 4vw, 58px);
  background: rgba(240, 236, 223, .96);
  border-bottom: 1px solid var(--line);
}

.page-heading h2 { margin: 2px 0 0; font: 700 34px/.9 var(--display); text-transform: uppercase; }
.account-context { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
.account-context label { color: var(--muted); font-size: 8px; font-weight: 600; letter-spacing: .13em; }
.account-context select { min-height: 38px; padding: 7px 9px; background: var(--paper-2); font-size: 11px; font-weight: 600; }
#system-clock { font: 600 20px var(--mono); letter-spacing: .04em; }
.sidebar-toggle { display: none; border: 0; background: transparent; font-size: 24px; }

.live-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, .65fr)) minmax(260px, 1.3fr) minmax(210px, .9fr);
  min-height: 66px;
  color: white;
  background: var(--ink-2);
  border-bottom: 4px solid var(--ink);
}
.live-cell, .sync-state { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 12px 18px; border-right: 1px solid #405258; }
.live-cell > span { color: #92a4a7; font-size: 8px; letter-spacing: .12em; }
.live-cell > strong { margin-left: auto; font-size: 10px; letter-spacing: .08em; white-space: nowrap; }
.live-cell > i { width: 7px; height: 7px; margin: 0; background: #7d9194; animation: none; }
.live-cell[data-state="ok"] > i { background: var(--green-bright); animation: signalPulse 1.8s infinite; }
.live-cell[data-state="warning"] > i { background: #efb148; }
.live-cell[data-state="error"] > i { background: #ee6658; }
.live-cell.latency { justify-content: space-between; }
.live-cell.latency > strong { margin: 0; font-size: 16px; }
.live-cell.latency small { color: #788b8e; font-size: 7px; font-weight: 400; }
.sync-state { justify-content: flex-end; background: #182b30; }
.sync-state i { margin: 0; }
.sync-state span { font-size: 8px; letter-spacing: .08em; }
.sync-state time { color: #8da0a3; font-size: 9px; }
.sync-state[data-state="error"] i { background: #ee6658; }

.workspace { padding: 38px clamp(22px, 4vw, 58px) 72px; }
.page { animation: pageIn .3s ease both; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.section-heading h3 { margin: 5px 0 0; font: 700 clamp(34px, 4vw, 52px)/.92 var(--display); text-transform: uppercase; }
.section-heading > p { max-width: 430px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; text-align: right; }
.action-heading { align-items: center; }
.heading-actions, .log-controls { display: flex; align-items: center; gap: 10px; }
.count-chip, .coming-badge { padding: 8px 10px; border: 1px solid var(--line); background: var(--paper-2); color: var(--muted); font-size: 9px; letter-spacing: .1em; }

.panel {
  border: 1px solid var(--line);
  border-top: 4px solid var(--ink);
  border-radius: 3px;
  background: rgba(250, 247, 238, .92);
  box-shadow: var(--shadow);
}
.panel-top { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 600; letter-spacing: .11em; }
.panel-top > i { flex: 1; height: 1px; background: var(--line); }
.panel-index { color: var(--orange-dark); }

.overview-grid { display: grid; grid-template-columns: 1.05fr 1fr .9fr; gap: 20px; }
.mission-panel { border-top-color: var(--orange); }
.mission-core { min-height: 200px; display: grid; place-content: center; padding: 28px; text-align: center; }
.mission-core span { font: 700 clamp(44px, 5vw, 72px)/.9 var(--display); text-transform: uppercase; }
.mission-core p { max-width: 380px; margin: 14px auto 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.action-row { display: flex; gap: 10px; padding: 16px; border-top: 1px solid var(--line); }
.action-row .button { flex: 1; }
.action-row.end { justify-content: flex-end; }
.action-row.end .button { flex: 0 1 auto; }

.score-grid { display: grid; grid-template-columns: repeat(3, 1fr); min-height: 205px; }
.score-grid > div { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 20px 8px; border-right: 1px solid var(--line); }
.score-grid > div:last-child { border-right: 0; }
.score-grid small, .score-grid span { color: var(--muted); font-size: 8px; letter-spacing: .1em; text-align: center; }
.score-grid strong { font: 700 clamp(40px, 4vw, 62px)/1 var(--display); }
.score-grid [data-tone="green"] strong { color: var(--green); }
.score-grid [data-tone="red"] strong { color: var(--red); }
.score-grid [data-tone="amber"] strong { color: var(--amber); }
.score-foot { display: flex; justify-content: space-between; padding: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.score-foot b { color: var(--ink); font-size: 13px; }

.profile-name { padding: 22px 18px 12px; }
.profile-name small { display: block; color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.profile-name strong { display: block; margin-top: 8px; font: 600 28px/1 var(--display); text-transform: uppercase; }
.profile-facts { margin: 0; padding: 0 18px; }
.profile-facts > div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.profile-facts dt { color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.profile-facts dd { margin: 0; font-size: 10px; font-weight: 600; }
.profile-facts dd[data-state="expired"] { color: var(--red); }
.subscription-panel .text-button { margin: 20px 18px; }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.quick-link { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; min-height: 84px; border: 1px solid var(--line); background: var(--paper-2); padding: 14px 18px; text-align: left; transition: transform .16s, border-color .16s, box-shadow .16s; }
.quick-link > i { display: grid; place-items: center; width: 36px; height: 36px; color: white; background: var(--ink-2); font: normal 18px var(--mono); }
.quick-link strong, .quick-link small { display: block; }
.quick-link strong { font: 600 18px var(--display); text-transform: uppercase; }
.quick-link small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.quick-link > b { color: var(--orange); font-size: 20px; }
.quick-link:hover { transform: translateY(-3px); border-color: var(--orange); box-shadow: 0 6px 0 rgba(240, 90, 50, .13); }

/* Accounts */
.accounts-layout { display: grid; grid-template-columns: minmax(260px, .75fr) minmax(0, 2fr); gap: 22px; }
.account-directory { align-self: start; overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 8px; margin: 14px; border-bottom: 1px solid var(--line); }
.search-field input { min-height: 40px; border: 0; background: transparent; box-shadow: none; }
.search-field span { color: var(--orange); font-size: 20px; }
.motoboy-list { max-height: 640px; overflow-y: auto; padding: 0 10px 12px; }
.motoboy-card { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-height: 70px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 12px 8px; text-align: left; }
.motoboy-card > i { width: 8px; height: 8px; background: #95a2a2; border-radius: 50%; }
.motoboy-card[data-state="connected"] > i { background: var(--green); box-shadow: 0 0 0 5px rgba(21, 149, 108, .11); }
.motoboy-card[data-state="waiting_qr"] > i, .motoboy-card[data-state="starting"] > i { background: var(--amber); }
.motoboy-card[data-state="error"] > i, .motoboy-card[data-state="expired"] > i { background: var(--red); }
.motoboy-card strong, .motoboy-card small { display: block; }
.motoboy-card strong { font: 600 17px var(--display); text-transform: uppercase; }
.motoboy-card small { margin-top: 3px; color: var(--muted); font-size: 7px; letter-spacing: .06em; }
.motoboy-card > span:last-child { color: var(--muted); font-size: 8px; }
.motoboy-card:hover { background: var(--paper-3); }
.motoboy-card[aria-current="true"] { background: #fff5e9; box-shadow: inset 4px 0 0 var(--orange); }
.fleet-empty { padding: 20px; color: var(--muted); font-size: 11px; }
.account-detail { display: grid; gap: 22px; }
.form-panel, .connection-panel, .plan-editor { overflow: hidden; }
.form-grid { display: grid; gap: 12px; padding: 18px; }
.form-grid.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label { display: grid; align-content: start; }
.form-grid label > span { margin: 0 0 7px; }
.form-grid label small { margin-top: 6px; color: var(--muted); font-size: 9px; }
.form-note { margin: 0; padding: 0 18px 18px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.connection-summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px; }
.big-status { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 10px; }
.big-status > i { grid-row: 1 / span 2; width: 14px; height: 14px; margin: 0; background: #98a5a6; animation: none; }
.big-status[data-state="connected"] > i { background: var(--green); animation: signalPulse 1.8s infinite; }
.big-status[data-state="waiting_qr"] > i, .big-status[data-state="starting"] > i { background: var(--amber); }
.big-status[data-state="error"] > i, .big-status[data-state="expired"] > i { background: var(--red); }
.big-status span { color: var(--muted); font-size: 8px; letter-spacing: .12em; }
.big-status strong { font: 600 28px/1 var(--display); }
.connection-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.invite-panel { position: relative; display: grid; gap: 14px; padding: 22px; background: #e7f2ec; border-top: 1px solid #acd0bf; }
.invite-panel h4 { margin: 5px 0 0; font: 600 22px var(--display); text-transform: uppercase; }
.copy-field { display: grid; grid-template-columns: 1fr auto; }
.copy-field input { border-color: #9bbcaf; background: white; }
.copy-field button { border: 0; background: var(--ink); color: white; padding: 0 16px; font-size: 9px; font-weight: 600; }
.qr-frame { position: absolute; right: 22px; bottom: 18px; width: 130px; padding: 8px; background: white; border: 1px solid #9bbcaf; }
.qr-frame img { display: block; width: 100%; height: auto; }

/* Groups */
.group-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.metric-tile { min-height: 120px; display: flex; flex-direction: column; justify-content: center; border-top: 4px solid var(--ink); background: var(--paper-2); padding: 18px; }
.metric-tile span, .metric-tile small { color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.metric-tile strong { margin: 8px 0 5px; font: 700 28px/1 var(--display); text-transform: uppercase; }
.current-group-note { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 20px; margin-bottom: 20px; border-top-color: var(--orange); }
.current-group-note p { max-width: 720px; margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.group-editor { margin-bottom: 22px; overflow: hidden; }
.group-editor-grid { display: grid; grid-template-columns: 1fr 1fr; }
.group-editor fieldset { min-width: 0; margin: 0; border: 0; border-right: 1px solid var(--line); padding: 20px; }
.group-editor fieldset:last-child { border-right: 0; }
.group-editor legend { font: 600 20px var(--display); text-transform: uppercase; }
.group-editor fieldset > p { color: var(--muted); font-size: 9px; }
.selection-count { margin-bottom: 8px; color: var(--orange-dark); font-size: 10px; font-weight: 600; }
.group-options { max-height: 370px; overflow-y: auto; display: grid; gap: 5px; }
.fleet-group-option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); background: white; padding: 10px; }
.fleet-group-option input { width: 16px; min-height: 16px; accent-color: var(--orange); }
.fleet-group-option strong { font: 600 16px var(--display); }
.fleet-group-option small { color: var(--muted); font-size: 8px; }
.fleet-group-option:has(input:checked) { border-color: var(--orange); background: #fff2e8; }
.fleet-group-option.is-disabled { opacity: .45; }
.group-monitor-panel { margin-top: 22px; overflow: hidden; }
.empty-state { padding: 34px; color: var(--muted); font-size: 11px; text-align: center; }
.group-monitor-list { display: grid; }
.group-monitor-row { display: grid; grid-template-columns: minmax(140px, 1.3fr) 3fr repeat(3, minmax(70px, .5fr)); align-items: center; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line); }
.group-monitor-row:first-child { border-top: 0; }
.group-monitor-row strong { font: 600 17px var(--display); text-transform: uppercase; }
.group-monitor-row small { color: var(--muted); font-size: 8px; }
.volume-bar { height: 7px; background: var(--paper-3); overflow: hidden; }
.volume-bar i { display: block; height: 100%; background: var(--orange); transform-origin: left; animation: barGrow .5s ease both; }
.group-monitor-stat span { display: block; color: var(--muted); font-size: 7px; }
.group-monitor-stat b { font-size: 11px; }

.account-config-panel, .portal-access-panel, .archive-panel { padding-bottom: 20px; }
.inline-config-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; padding: 18px; }
.inline-config-form label, .portal-access-result label, .archive-panel > label { display: grid; gap: 7px; }
.inline-config-form label span, .portal-access-result label span, .archive-panel > label span { color: var(--muted); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.inline-config-form input, .portal-access-result input, .archive-panel > label input { height: 42px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 0 12px; font: 500 11px var(--mono); }
.portal-access-panel > .button, .archive-panel > .button { margin: 0 18px; }
.portal-access-result { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; padding: 16px 18px 0; }
.diagnostic-result { margin: 0; border-top: 1px solid var(--line); background: var(--paper); padding: 12px 18px; color: var(--muted); font: 9px/1.55 var(--mono); }
.diagnostic-result[data-state="ready"] { color: #19684e; background: #e5f5ec; }
.diagnostic-result[data-state="attention"] { color: #8c471e; background: #fff0e2; }
.archive-panel { border-left: 3px solid var(--red); }
.archive-panel > label { margin: 0 18px 12px; }
.account-danger-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 18px; }

.finance-admin-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.finance-admin-grid article { border: 1px solid var(--line); background: var(--paper-2); padding: 18px; }
.finance-admin-grid span { display: block; color: var(--muted); font-size: 8px; letter-spacing: .11em; }
.finance-admin-grid strong { display: block; margin: 8px 0; font: 700 25px var(--display); }
.finance-admin-grid small { color: var(--muted); font-size: 8px; }
.finance-admin-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; }
.admin-receivable-list { display: grid; gap: 8px; padding: 18px; }
.admin-receivable-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 10px; background: var(--paper); border: 1px solid var(--line); }
.admin-receivable-row select { height: 34px; border: 1px solid var(--line); background: white; }
.admin-receivable-row button { height: 34px; border: 0; background: var(--green); color: white; font: 600 8px var(--mono); cursor: pointer; }
.ai-analysis-result { margin-top: 18px; padding: 18px; background: var(--paper); border-left: 4px solid var(--green); }
.ai-analysis-result > strong { display: block; font: 600 20px/1.35 var(--display); margin-bottom: 16px; }
.ai-analysis-result div > span { color: var(--muted); font-size: 8px; letter-spacing: .12em; }
.ai-analysis-result ul { margin: 7px 0 14px; padding-left: 18px; font-size: 10px; line-height: 1.7; }

/* Analytics */
.segmented { display: flex; border: 1px solid var(--line); background: var(--paper-2); }
.segmented button { border: 0; border-right: 1px solid var(--line); background: transparent; padding: 9px 12px; color: var(--muted); font-size: 9px; }
.segmented button:last-child { border-right: 0; }
.segmented button.is-active { color: white; background: var(--ink); }
.analytics-scope { display: flex; align-items: center; gap: 12px; margin: -10px 0 20px; }
.analytics-scope label, .log-controls label { color: var(--muted); font-size: 8px; letter-spacing: .12em; }
.analytics-scope select, .log-controls select { width: auto; min-height: 36px; padding: 6px 34px 6px 9px; font-size: 10px; }
.analytics-scope > span { margin-left: auto; color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.analytics-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.analytics-kpis article { min-height: 128px; border-left: 5px solid var(--ink); background: var(--paper-2); padding: 18px; }
.analytics-kpis article:nth-child(2) { border-color: var(--green); }
.analytics-kpis article:nth-child(3) { border-color: var(--orange); }
.analytics-kpis article:nth-child(4) { border-color: var(--amber); }
.analytics-kpis span, .analytics-kpis small { display: block; color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.analytics-kpis strong { display: block; margin: 10px 0 7px; font: 700 38px/1 var(--display); }
.chart-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; }
.chart-panel { min-width: 0; padding: 18px; }
.chart-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 12px; }
.chart-heading span, .chart-heading small { color: var(--muted); font-size: 8px; letter-spacing: .1em; }
.chart-heading strong { display: block; margin-top: 4px; font: 600 22px var(--display); text-transform: uppercase; }
.chart-panel canvas { display: block; width: 100%; height: 270px; }
.ranking-panel { margin-top: 20px; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); background: var(--paper-3); font-size: 8px; letter-spacing: .09em; }
td { font-size: 10px; }
td:first-child { font: 600 16px var(--display); text-transform: uppercase; }
.table-empty { color: var(--muted); text-align: center; }

/* Logs */
.privacy-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; border: 1px solid #9bcdb7; background: #e6f2ec; padding: 12px 16px; }
.privacy-banner > i { display: grid; place-items: center; width: 24px; height: 24px; color: white; background: var(--green); border-radius: 50%; font-style: normal; }
.privacy-banner p { flex: 1; margin: 0; color: #416359; font-size: 9px; line-height: 1.5; }
.privacy-banner p strong { margin-right: 6px; color: #22634c; }
.privacy-banner > span { color: #416359; font-size: 9px; }
.log-console { overflow: hidden; border: 1px solid #34494f; background: #122328; box-shadow: var(--shadow); color: #dce6e1; }
.console-head { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #34494f; background: #1b3035; color: #819699; font-size: 8px; letter-spacing: .12em; }
.console-head div { display: flex; gap: 6px; }
.console-head i { width: 7px; height: 7px; border-radius: 50%; background: #586b6e; }
.console-head i:first-child { background: var(--red); }
.console-head i:nth-child(2) { background: var(--amber); }
.console-head i:last-child { background: var(--green); }
.log-list { min-height: 430px; max-height: 650px; overflow: auto; margin: 0; padding: 8px 0; list-style: none; }
.log-line { display: grid; grid-template-columns: 90px 62px minmax(160px, .8fr) minmax(260px, 2fr); gap: 14px; padding: 8px 16px; border-left: 3px solid transparent; font-size: 9px; line-height: 1.5; }
.log-line:hover { background: #1b3035; border-left-color: var(--orange); }
.log-line.is-new { animation: logIn .35s ease both; }
.log-time { color: #71878a; }
.log-level { color: #a7b7b8; font-weight: 600; }
.log-level[data-level="warn"] { color: #efb148; }
.log-level[data-level="error"], .log-level[data-level="fatal"] { color: #ee776a; }
.log-event { color: var(--green-bright); }
.log-detail { color: #9fb0b1; overflow-wrap: anywhere; }
.log-empty { padding: 40px; color: #71878a; text-align: center; font-size: 10px; }

/* Settings */
.context-empty { padding: 28px; border-left: 4px solid var(--orange); }
.context-empty h4 { margin: 8px 0; font: 600 30px/1 var(--display); text-transform: uppercase; }
.context-empty p { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.7; }
.context-account-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.context-account-button { border: 1px solid var(--line); background: var(--paper-2); padding: 11px 14px; color: var(--ink); cursor: pointer; font: 600 9px var(--mono); text-transform: uppercase; transition: border-color .18s, transform .18s; }
.context-account-button:hover { border-color: var(--orange); transform: translateY(-2px); }
.fleet-finance-row > span { display: grid; gap: 4px; }
.fleet-finance-row small { color: var(--muted); font-size: 8px; }
.settings-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; }
.settings-panel { overflow: hidden; }
.settings-layout .settings-panel:first-child { grid-row: span 2; }
.toggle-field { display: flex !important; flex-direction: row; justify-content: space-between; align-items: center !important; min-height: 46px; margin-top: 25px; border: 1px solid var(--line); background: var(--paper-2); padding: 8px 12px; }
.toggle-field > span { margin: 0 !important; }
.toggle-field input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-field i { position: relative; width: 38px; height: 20px; background: #a8b0ae; border-radius: 12px; transition: background .18s; }
.toggle-field i::after { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: transform .18s; }
.toggle-field input:checked + i { background: var(--green); }
.toggle-field input:checked + i::after { transform: translateX(18px); }
.check-line { display: flex !important; grid-template-columns: auto 1fr; flex-direction: row; align-items: center !important; gap: 8px; }
.check-line input { width: 16px; min-height: 16px; accent-color: var(--orange); }
.check-line span { margin: 0 !important; }
.safety-panel { align-self: start; padding-bottom: 18px; }
.safety-panel p { padding: 4px 18px 14px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.safety-panel .button { width: calc(100% - 36px); margin: 0 18px; }
.settings-submit { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 1px solid var(--line); padding-top: 20px; }
.settings-submit p { max-width: 650px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

/* AI */
.ai-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 24px; }
.ai-manifesto { position: relative; min-height: 500px; overflow: hidden; padding: 42px; color: white; background: var(--ink); border-top-color: var(--orange); }
.ai-manifesto h4 { position: relative; z-index: 2; max-width: 650px; margin: 18px 0; font: 600 clamp(42px, 5vw, 68px)/.94 var(--display); text-transform: uppercase; }
.ai-manifesto p { position: relative; z-index: 2; max-width: 620px; color: #aec0c0; line-height: 1.8; }
.ai-orbit { position: absolute; right: -120px; bottom: -150px; width: 440px; height: 440px; border: 1px solid #3a555a; border-radius: 50%; animation: orbitSpin 18s linear infinite; }
.ai-orbit::before { content: ""; position: absolute; inset: 60px; border: 1px solid #3a555a; border-radius: 50%; }
.ai-orbit i { position: absolute; width: 12px; height: 12px; background: var(--orange); border-radius: 50%; }
.ai-orbit i:first-child { left: 8%; top: 30%; }
.ai-orbit i:nth-child(2) { right: 7%; bottom: 35%; background: var(--green-bright); }
.ai-orbit b { position: absolute; inset: 0; display: grid; place-items: center; color: var(--orange); font-size: 80px; }
.ai-status { position: absolute; z-index: 2; left: 42px; bottom: 36px; display: flex; align-items: center; border: 1px solid #50666a; padding: 10px 13px; color: #aabbbc; font-size: 9px; letter-spacing: .1em; }
.ai-status i { margin: 0 8px 0 0; background: var(--amber); animation: none; }
.ai-roadmap { display: grid; gap: 12px; }
.ai-roadmap article { display: grid; grid-template-columns: auto 1fr; gap: 16px; border-left: 4px solid var(--orange); background: var(--paper-2); padding: 20px; }
.ai-roadmap article > span { color: var(--orange); font: 700 28px var(--display); }
.ai-roadmap strong { font: 600 21px var(--display); text-transform: uppercase; }
.ai-roadmap p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.ai-roadmap aside { padding: 20px; border: 1px dashed var(--line); color: var(--muted); }
.ai-roadmap aside strong { color: var(--ink); font-size: 14px; }
.ai-roadmap code { color: var(--orange-dark); }
.ai-chart-lab { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; }
.ai-chart-card { min-width: 0; overflow: hidden; padding-bottom: 18px; }
.ai-chart-card > p { min-height: 44px; margin: 14px 18px 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.ai-chart-wide { grid-column: 1 / -1; }
.ai-hourly-bars { display: grid; grid-template-columns: repeat(24, 1fr); align-items: end; gap: 3px; height: 180px; margin: 20px 18px 0; border-bottom: 1px solid var(--line); }
.ai-hourly-bar { display: grid; grid-template-rows: 1fr 16px; align-items: end; height: 100%; }
.ai-hourly-bar i { display: block; height: var(--bar-height); min-height: 3px; background: var(--orange); transform-origin: bottom; animation: aiBarRise .55s cubic-bezier(.2,.8,.2,1) var(--bar-delay) both; }
.ai-hourly-bar:hover i { background: var(--green); }
.ai-hourly-bar span { overflow: visible; color: var(--muted); font-size: 7px; white-space: nowrap; transform: translateX(-2px); }
.ai-result-bars { display: grid; gap: 14px; padding: 24px 18px 10px; }
.ai-result-row { display: grid; grid-template-columns: 82px 1fr 30px; align-items: center; gap: 10px; }
.ai-result-row > span { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.ai-result-row > div { height: 12px; overflow: hidden; background: var(--paper-3); }
.ai-result-row i { display: block; width: var(--bar-width); height: 100%; background: #829296; transform-origin: left; animation: aiResultGrow .65s cubic-bezier(.2,.8,.2,1) var(--bar-delay) both; }
.ai-result-row[data-tone="green"] i { background: var(--green); }
.ai-result-row[data-tone="red"] i { background: var(--red); }
.ai-result-row[data-tone="amber"] i { background: var(--amber); }
.ai-result-row strong { font-size: 11px; text-align: right; }
.ai-insight-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.ai-insight-pair > div { min-height: 125px; padding: 22px; }
.ai-insight-pair > div + div { border-left: 1px solid var(--line); }
.ai-insight-pair span { color: var(--orange-dark); font-size: 8px; letter-spacing: .12em; }
.ai-insight-pair p { margin: 10px 0 0; color: var(--ink); font-size: 11px; line-height: 1.7; }

/* Feedback */
.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; width: min(390px, calc(100vw - 40px)); display: grid; gap: 10px; }
.toast { border-left: 5px solid var(--green); background: var(--ink); color: white; padding: 15px 17px; box-shadow: 7px 7px 0 rgba(21, 35, 40, .2); font-size: 10px; line-height: 1.6; animation: toastIn .3s ease both; }
.toast[data-kind="warning"] { border-left-color: var(--amber); }
.toast[data-kind="error"] { border-left-color: var(--red); }
.value-updated { animation: valueFlash .55s ease; }

@keyframes signalPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 216, 163, .38); opacity: 1; }
  50% { box-shadow: 0 0 0 8px rgba(99, 216, 163, 0); opacity: .72; }
}
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes logIn { from { opacity: 0; transform: translateX(-10px); background: rgba(99, 216, 163, .13); } to { opacity: 1; transform: translateX(0); } }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes orbitSpin { to { transform: rotate(360deg); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes valueFlash { 0%, 100% { color: inherit; } 50% { color: var(--orange); } }
@keyframes aiBarRise { from { transform: scaleY(0); opacity: .3; } to { transform: scaleY(1); opacity: 1; } }
@keyframes aiResultGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 1280px) {
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .subscription-panel { grid-column: 1 / -1; }
  .profile-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .profile-facts > div { display: block; }
  .profile-facts dd { margin-top: 6px; }
  .live-strip { grid-template-columns: repeat(4, 1fr); }
  .sync-state { grid-column: 1 / -1; justify-content: center; min-height: 34px; }
  .group-summary-grid, .analytics-kpis { grid-template-columns: repeat(2, 1fr); }
  .finance-admin-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { min-height: 360px; border-right: 0; border-bottom: 6px solid var(--orange); }
  .login-radar { width: 430px; left: auto; right: -100px; transform: translateY(-52%); }
  .login-message { bottom: 17%; max-width: 70%; }
  .login-message strong { font-size: 38px; }
  .login-card { min-height: 600px; }
  .app-shell { grid-template-columns: 1fr; }
  .app-content { grid-column: 1; }
  .sidebar { transform: translateX(-105%); transition: transform .22s ease; box-shadow: 10px 0 30px rgba(0,0,0,.2); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-toggle { display: block; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .account-context { grid-column: 1 / -1; }
  .accounts-layout, .chart-grid, .settings-layout, .ai-layout, .ai-chart-lab { grid-template-columns: 1fr; }
  .ai-chart-wide { grid-column: auto; }
  .finance-admin-layout { grid-template-columns: 1fr; }
  .portal-access-result { grid-template-columns: 1fr; }
  .settings-layout .settings-panel:first-child { grid-row: auto; }
  .quick-grid { grid-template-columns: 1fr; }
  .group-editor-grid { grid-template-columns: 1fr; }
  .group-editor fieldset { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 720px) {
  body { font-size: 13px; }
  .login-visual { min-height: 320px; padding: 26px; }
  .login-brand img { width: 72px; height: 72px; }
  .login-brand h1 { font-size: 48px; }
  .login-message { left: 26px; bottom: 18%; max-width: calc(100% - 52px); }
  .login-message strong { font-size: 30px; }
  .login-signal { left: 26px; bottom: 7%; }
  .login-card { padding: 28px 22px; }
  .topbar { gap: 12px; padding: 14px 18px; }
  .page-heading h2 { font-size: 28px; }
  #system-clock { font-size: 14px; }
  .live-strip { grid-template-columns: 1fr 1fr; }
  .live-cell { min-height: 55px; }
  .live-cell.latency, .sync-state { grid-column: 1 / -1; }
  .workspace { padding: 28px 16px 60px; }
  .section-heading, .action-heading { align-items: stretch; flex-direction: column; }
  .section-heading > p { text-align: left; }
  .heading-actions, .log-controls { flex-wrap: wrap; }
  .overview-grid, .group-summary-grid, .analytics-kpis { grid-template-columns: 1fr; }
  .finance-admin-grid { grid-template-columns: 1fr; }
  .inline-config-form { grid-template-columns: 1fr; }
  .subscription-panel { grid-column: auto; }
  .profile-facts { grid-template-columns: 1fr 1fr; }
  .form-grid.columns-2 { grid-template-columns: 1fr; }
  .connection-summary { align-items: stretch; flex-direction: column; }
  .connection-actions { justify-content: stretch; }
  .connection-actions .button { flex: 1; }
  .current-group-note { align-items: stretch; flex-direction: column; }
  .analytics-scope { align-items: stretch; flex-direction: column; }
  .analytics-scope select { width: 100%; }
  .analytics-scope > span { margin-left: 0; }
  .segmented { overflow-x: auto; }
  .group-monitor-row { grid-template-columns: 1fr 2fr; }
  .group-monitor-stat { display: none; }
  .log-line { grid-template-columns: 70px 50px 1fr; gap: 8px; }
  .log-detail { grid-column: 1 / -1; padding-left: 0; }
  .privacy-banner { align-items: flex-start; flex-wrap: wrap; }
  .settings-submit { align-items: stretch; flex-direction: column; }
  .ai-manifesto { min-height: 570px; padding: 28px; }
  .ai-status { left: 28px; right: 28px; bottom: 28px; }
  .ai-insight-pair { grid-template-columns: 1fr; }
  .ai-insight-pair > div + div { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 460px) {
  .login-visual { min-height: 270px; }
  .login-brand { gap: 12px; }
  .login-brand img { width: 56px; height: 56px; }
  .login-brand h1 { font-size: 38px; }
  .login-radar { display: none; }
  .login-message strong { font-size: 25px; }
  .score-grid { grid-template-columns: 1fr; }
  .score-grid > div { min-height: 120px; border-right: 0; border-bottom: 1px solid var(--line); }
  .action-row, .connection-actions { flex-direction: column; }
  .profile-facts { grid-template-columns: 1fr; }
  .copy-field { grid-template-columns: 1fr; }
  .copy-field button { min-height: 40px; }
  .qr-frame { position: static; width: 160px; }
  .group-summary-grid, .analytics-kpis { gap: 8px; }
}

/* RotaOps 2.0 — interface operacional leve */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    radial-gradient(circle at 10% 0, rgba(22, 142, 156, .1), transparent 30%),
    var(--paper);
}

.login-topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(22px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .86);
}

.login-wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.login-wordmark img {
  width: 42px;
  height: 42px;
  border-radius: 9px 2px 9px 2px;
}

.login-wordmark span { display: grid; gap: 2px; }
.login-wordmark strong { font: 800 20px/.9 var(--display); letter-spacing: .02em; }
.login-wordmark small,
.login-environment {
  color: var(--muted);
  font: 600 8px/1.2 var(--mono);
  letter-spacing: .14em;
}

.login-environment { display: flex; align-items: center; color: var(--ink-3); }
.login-environment i,
.login-footnote i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: signalPulse 2s ease-in-out infinite;
}

.login-stage {
  width: min(1480px, 100%);
  min-height: 680px;
  margin: auto;
  padding: clamp(24px, 4vw, 60px);
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(380px, .82fr);
  gap: clamp(24px, 4vw, 68px);
  align-items: stretch;
}

.login-visual {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  padding: clamp(34px, 5vw, 72px);
  color: white;
  background: #143f3a;
  border: 0;
  border-radius: 5px 54px 5px 5px;
  box-shadow: var(--shadow);
}

.login-visual::before,
.login-visual::after { content: ""; position: absolute; pointer-events: none; }
.login-visual::before {
  inset: 0;
  opacity: .22;
  background-image:
    linear-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .12) 1px, transparent 1px);
  background-size: 42px 42px;
}

.login-visual::after {
  width: 170px;
  height: 170px;
  right: -65px;
  top: -65px;
  border: 30px solid var(--orange);
  border-radius: 50%;
  opacity: .92;
  background: transparent;
  box-shadow: none;
}

.login-copy { position: relative; z-index: 2; max-width: 760px; }
.login-copy h1 {
  margin: 18px 0 22px;
  font: 800 clamp(44px, 5.5vw, 78px)/.88 var(--display);
  letter-spacing: -.045em;
  text-transform: uppercase;
}

.login-copy h1 span { color: #72e5bb; }
.login-copy p {
  max-width: 610px;
  margin: 0;
  color: #c9dcd7;
  font-size: clamp(14px, 1.35vw, 18px);
  line-height: 1.65;
}

.route-visual {
  position: relative;
  z-index: 2;
  min-height: 205px;
  margin-top: clamp(34px, 6vh, 70px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 2px 28px 2px 2px;
  background: rgba(5, 28, 25, .42);
}

.route-map-grid {
  position: absolute;
  inset: 0;
  opacity: .3;
  background-image:
    linear-gradient(rgba(114, 229, 187, .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(114, 229, 187, .16) 1px, transparent 1px);
  background-size: 34px 34px;
}

.route-line {
  position: absolute;
  left: 13%;
  right: 13%;
  top: 50%;
  height: 2px;
  background: rgba(114, 229, 187, .48);
}

.route-line-b {
  left: 48%;
  top: 35%;
  right: 12%;
  transform: rotate(-17deg);
  transform-origin: left center;
}

.route-node {
  position: absolute;
  z-index: 2;
  top: calc(50% - 10px);
  width: 20px;
  height: 20px;
  background: #143f3a;
  border: 4px solid #72e5bb;
  border-radius: 50%;
  box-shadow: 0 0 0 9px rgba(114, 229, 187, .08);
}

.node-origin { left: 12%; }
.node-group { left: calc(50% - 10px); }
.node-rider { right: 12%; top: calc(27% - 10px); border-color: var(--orange); }

.route-packet {
  position: absolute;
  z-index: 3;
  top: calc(50% - 4px);
  left: 14%;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 14px white;
  animation: routePacket 3s linear infinite;
}

.packet-b { animation-delay: -1.5s; }
.route-label {
  position: absolute;
  z-index: 3;
  color: #aac8c1;
  font: normal 600 8px/1 var(--mono);
  letter-spacing: .12em;
}

.label-origin { left: 9%; top: 66%; }
.label-group { left: 45%; top: 66%; }
.label-rider { right: 7%; top: 11%; color: #ffc1ae; }

.login-proof-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 22px;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .13);
}

.login-proof-grid > div {
  min-width: 0;
  padding: 18px;
  display: grid;
  gap: 4px;
  background: #143f3a;
}

.login-proof-grid strong { color: var(--orange); font: 700 11px var(--mono); }
.login-proof-grid span { font: 700 11px var(--display); letter-spacing: .06em; }
.login-proof-grid small { color: #96b1aa; font-size: 9px; line-height: 1.45; }

.login-card {
  display: grid;
  place-items: center;
  padding: clamp(22px, 4vw, 52px);
  background: var(--paper-2);
  border-top: 5px solid var(--orange);
  border-radius: 3px 3px 28px 3px;
  box-shadow: var(--shadow);
}

.login-card-inner { width: min(100%, 460px); }
.login-card-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.login-step { color: #8b9a95; font: 600 9px var(--mono); letter-spacing: .1em; }
.login-card h2 {
  margin: 18px 0 10px;
  font: 800 clamp(38px, 5vw, 58px)/.92 var(--display);
  letter-spacing: -.035em;
  text-transform: uppercase;
}

.login-card .form-intro { margin: 0 0 30px; }
.login-card form > label { margin: 17px 0 8px; }
.password-field { position: relative; }
.password-field input { padding-right: 90px; }
.password-field button {
  position: absolute;
  right: 7px;
  top: 7px;
  min-height: 38px;
  padding: 0 10px;
  color: var(--ink-3);
  background: var(--paper-3);
  border: 0;
  font: 700 8px var(--mono);
  letter-spacing: .08em;
}

.login-card .button.wide {
  min-height: 54px;
  margin-top: 22px;
  justify-content: space-between;
  padding-inline: 20px;
}

.login-card .button.wide b { font-size: 18px; }
.login-footnote {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.login-footnote i { flex: 0 0 auto; margin: 0; }
.login-footnote span { display: grid; color: var(--muted); font: 9px/1.4 var(--mono); }
.login-footnote strong { color: var(--ink-3); font-size: 9px; text-transform: uppercase; }
.login-footer {
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px clamp(22px, 4vw, 58px);
  color: #7a8985;
  border-top: 1px solid var(--line);
  font: 600 8px var(--mono);
  letter-spacing: .12em;
}

@keyframes routePacket {
  0% { left: 14%; opacity: 0; }
  8% { opacity: 1; }
  48% { left: 49%; opacity: 1; }
  62% { left: 62%; top: 43%; opacity: 1; }
  92% { left: 86%; top: 29%; opacity: 1; }
  100% { left: 88%; top: 27%; opacity: 0; }
}

.app-shell { grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { background: #123a36; box-shadow: 8px 0 30px rgba(18, 58, 54, .12); }
.brand-lockup { min-height: 86px; padding: 16px 18px; }
.brand-lockup img { border-radius: 10px 2px 10px 2px; }
.main-nav { padding: 16px 12px 22px; gap: 3px; }
.nav-caption {
  margin: 16px 10px 7px;
  color: #72918b;
  font: 700 8px var(--mono);
  letter-spacing: .18em;
}

.nav-caption:first-child { margin-top: 4px; }
.nav-button {
  min-height: 46px;
  border-left-width: 0;
  border-radius: 3px 12px 3px 3px;
}

.nav-button:hover { background: rgba(255, 255, 255, .07); padding-left: 14px; }
.nav-button.is-active {
  color: #143f3a;
  background: #f5fbf7;
  box-shadow: inset 4px 0 0 var(--orange);
}

.nav-button.is-active i { color: var(--orange-dark); }
.topbar {
  min-height: 86px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
}

.live-strip {
  min-height: 66px;
  background: #e8eee8;
  border-bottom: 1px solid var(--line);
}

.live-cell { background: rgba(255, 255, 255, .3); }
.workspace { padding-top: 32px; background: var(--paper); }
.section-heading h3 { letter-spacing: -.02em; }
.panel {
  border-color: #d4ddd5;
  border-radius: 3px 18px 3px 3px;
  box-shadow: 0 12px 32px rgba(23, 39, 36, .06);
}

.quick-link {
  border-radius: 3px 14px 3px 3px;
  background: white;
  box-shadow: 0 10px 24px rgba(23, 39, 36, .05);
}

.system-health-panel {
  margin-top: 18px;
  overflow: hidden;
  background: #173f3a;
  color: white;
  border-radius: 3px 24px 3px 3px;
  box-shadow: var(--shadow);
}

.system-health-heading {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.health-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #173f3a;
  background: #72e5bb;
  border-radius: 50%;
  font: 800 23px var(--display);
}

.system-health-heading h4 { margin: 3px 0 0; font: 700 23px var(--display); }
.health-state {
  margin-left: auto;
  padding: 7px 10px;
  color: #173f3a;
  background: #72e5bb;
  font: 700 8px var(--mono);
  letter-spacing: .1em;
}

.health-state[data-state="warning"] { background: #ffc66d; }
.health-state[data-state="error"] { color: white; background: var(--red); }
.health-state[data-state="checking"] { color: #dce9e5; background: rgba(255, 255, 255, .12); }
.system-health-actions { display: flex; gap: 7px; }
.system-health-actions button {
  min-height: 31px;
  border: 1px solid rgba(255, 255, 255, .24);
  background: transparent;
  color: white;
  padding: 0 10px;
  font: 700 8px var(--mono);
  letter-spacing: .08em;
}
.system-health-actions button:hover { border-color: #72e5bb; color: #72e5bb; }
.system-health-actions button.danger:hover { border-color: #ff9e89; color: #ff9e89; }
.system-health-actions button:disabled { opacity: .55; cursor: wait; }
.system-health-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.system-health-grid > div {
  min-width: 0;
  padding: 20px 22px;
  border-right: 1px solid rgba(255, 255, 255, .11);
}

.system-health-grid > div:last-child { border-right: 0; }
.system-health-grid span { color: #92b2ab; font: 600 8px var(--mono); letter-spacing: .11em; }
.system-health-grid strong { display: block; margin: 7px 0 2px; font: 800 27px var(--display); }
.system-health-grid small { color: #aec3be; font-size: 9px; }
.system-health-panel > p {
  margin: 0;
  padding: 12px 22px;
  color: #aac0ba;
  background: rgba(0, 0, 0, .12);
  font: 9px/1.5 var(--mono);
}

@media (max-width: 1060px) {
  .login-stage { grid-template-columns: 1fr; }
  .login-visual { min-height: 590px; }
  .login-card { min-height: 520px; }
  .system-health-grid { grid-template-columns: 1fr 1fr; }
  .system-health-grid > div { border-bottom: 1px solid rgba(255, 255, 255, .11); }
  .system-health-grid > div:nth-child(even) { border-right: 0; }
  .system-health-grid > div:last-child { border-bottom: 0; }
  .system-health-heading { flex-wrap: wrap; }
  .system-health-actions { width: 100%; margin-left: 56px; }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .nav-caption { margin-inline: 16px; }
}

@media (max-width: 720px) {
  .login-topbar { min-height: 64px; padding-inline: 16px; }
  .login-environment { display: none; }
  .login-stage { min-height: 0; padding: 14px; gap: 14px; }
  .login-visual { min-height: 470px; padding: 28px 22px; border-radius: 3px 28px 3px 3px; }
  .login-copy h1 { font-size: clamp(39px, 12vw, 62px); }
  .route-visual { min-height: 150px; margin-top: 28px; }
  .login-proof-grid { grid-template-columns: 1fr; }
  .login-proof-grid > div { grid-template-columns: 30px 1fr; padding: 12px 14px; }
  .login-proof-grid small { grid-column: 2; }
  .login-card { min-height: 500px; padding: 30px 22px; }
  .login-footer { align-items: flex-start; gap: 6px; flex-direction: column; padding: 12px 16px; }
  .system-health-grid { grid-template-columns: 1fr; }
  .system-health-grid > div { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .11); }
  .system-health-grid > div:last-child { border-bottom: 0; }
  .system-health-heading { align-items: flex-start; flex-wrap: wrap; }
  .health-state { margin-left: 0; }
  .system-health-actions { width: 100%; margin-left: 0; flex-wrap: wrap; }
}

@media (max-width: 460px) {
  .login-visual { min-height: 430px; }
  .route-label { display: block; }
  .login-card h2 { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .route-packet { animation: none; opacity: .8; left: 62%; top: 43%; }
}
