/* NEXRIDE owner portal — tokens mirror the app design system (nexride-ui). */
@font-face {
  font-family: "Archivo";
  src: url("fonts/Archivo-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
:root {
  --surface: #ffffff;
  --sunken: #f2f2f2;
  --page: #f6f6f5;
  --inverse: #000000;
  --ink: #000000;
  --ink-2: #5e5e62;
  --ink-3: #8a8a8f;
  --border: #e4e4e6;
  --gold: #f5b301;
  --gold-pressed: #c98a00;
  --gold-wash: #fff6dc;
  --positive: #0e7a36;
  --critical: #c4291c;
  --radius-card: 16px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.04);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Top bar ─────────────────────────────────────────── */
.topbar {
  background: var(--inverse); color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.topbar-in {
  max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 64px;
  display: flex; align-items: center; gap: 16px;
}
.wordmark { font-weight: 800; font-size: 22px; letter-spacing: .01em; text-decoration: none; }
.wordmark .ride { color: var(--gold); }
.topbar .role { color: #b9b9be; font-size: 14px; padding-left: 12px; border-left: 1px solid #2a2a2c; }
.topbar .spacer { flex: 1; }
.live {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: #fff;
  padding: 6px 12px; border-radius: var(--radius-pill); background: #1a1a1c;
}
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.live.paused .dot { background: #6b6b70; }
.live.down .dot { background: var(--critical); }
.topbar .who { color: #b9b9be; font-size: 14px; }
.topbar .signout { color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; padding: 8px 12px; border-radius: 10px; }
.topbar .signout:hover { background: #1a1a1c; }

/* ── Page ────────────────────────────────────────────── */
main { max-width: 1240px; margin: 0 auto; padding: 28px 24px 56px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
h1 { font-size: 32px; line-height: 1.1; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.sub { color: var(--ink-2); margin-top: 6px; }
.updated { color: var(--ink-3); font-size: 13px; }

.banner {
  display: none; align-items: center; gap: 10px;
  background: #fdecea; color: #7a1a12; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 16px; font-weight: 500;
}
.banner.show { display: flex; }

/* ── Tiles ───────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.tile {
  background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow);
  padding: 20px; min-height: 148px; display: flex; flex-direction: column;
}
.tile .label { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.tile .value { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin-top: 10px; line-height: 1.05; }
.tile .foot { color: var(--ink-2); font-size: 13px; margin-top: auto; padding-top: 12px; }
.tile.hero { background: var(--inverse); color: #fff; }
.tile.hero .label, .tile.hero .foot { color: #c9c9ce; }
.tile.hero .label { display: flex; align-items: center; gap: 10px; }
.bolt {
  width: 28px; height: 28px; border-radius: 50%; background: var(--gold);
  display: inline-grid; place-items: center; flex: none;
}
.bolt svg { width: 16px; height: 16px; }
.inflight { display: none; margin-top: 8px; font-size: 13px; color: var(--gold); font-weight: 600; }
.inflight.show { display: block; }

/* ── Panels ──────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: minmax(0, 13fr) minmax(0, 7fr); gap: 16px; align-items: start; }
.panel { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.panel-head h2 { font-size: 18px; font-weight: 700; margin: 0; }
.panel-head .hint { color: var(--ink-3); font-size: 13px; }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .04em; padding: 10px 20px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 14px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.m-only { display: none; }
.panel.compact th, .panel.compact td { padding-left: 14px; padding-right: 14px; }
.panel.compact th:first-child, .panel.compact td:first-child { padding-left: 20px; }
.panel.compact th:last-child, .panel.compact td:last-child { padding-right: 20px; }
.ref { display: block; margin-top: 4px; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--ink-2); font-size: 13px; }
.ref { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .02em; }
tr.fresh td { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { background: var(--gold-wash); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { tr.fresh td { animation: none; background: var(--gold-wash); } }

.badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface);
}
.badge svg { width: 14px; height: 14px; }
.b-time { white-space: pre; }
.badge.funded { color: var(--positive); }
.badge.funding { background: var(--inverse); color: #fff; border-color: var(--inverse); }
.badge.funding .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.badge.cash { background: var(--sunken); border-color: var(--sunken); color: var(--ink); }

.empty { padding: 28px 20px 32px; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

/* ── Login ───────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login {
  width: 100%; max-width: 400px; background: var(--surface);
  border-radius: 20px; box-shadow: var(--shadow); overflow: hidden;
}
.login-top { background: var(--inverse); color: #fff; padding: 28px 28px 24px; }
.login-top .wordmark { font-size: 28px; }
.login-top p { color: #c9c9ce; margin: 8px 0 0; }
.login form { padding: 24px 28px 28px; display: grid; gap: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%; height: 52px; padding: 0 16px; font: inherit; font-size: 16px;
  border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(245,179,1,.35); }
.btn {
  height: 54px; border: 0; border-radius: var(--radius-pill); background: var(--gold); color: #000;
  font: inherit; font-weight: 700; font-size: 16px; cursor: pointer;
}
.btn:hover { background: #e8a900; }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.alert {
  display: flex; gap: 10px; align-items: flex-start; color: var(--critical);
  background: #fdecea; border-radius: 12px; padding: 12px 14px; font-weight: 500; font-size: 14px;
}
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.login-foot { color: var(--ink-3); font-size: 13px; text-align: center; padding: 0 28px 24px; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1080px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar-in { padding: 0 16px; gap: 10px; }
  .topbar .role, .topbar .who { display: none; }
  main { padding: 20px 16px 40px; }
  h1 { font-size: 26px; }
  .tiles { grid-template-columns: 1fr; gap: 12px; }
  .tile { min-height: 0; }
  .tile .value { font-size: 30px; }
  .col-split, .col-time { display: none; }
  .m-only { display: inline; }
  td { white-space: normal; }
  td .badge { white-space: nowrap; }
  .b-time { display: none; }
  .badge { padding: 4px 8px; }
  .panel-head { flex-direction: column; gap: 2px; }
  .ref { display: none; }
  th, td { padding-left: 14px; padding-right: 14px; }
}
