/* Staff panel. The app's pit-wall look (app/renderer/style.css): near-black, hairlines instead of boxes, small spaced
   labels, tabular numbers, colour only where it means something. */
:root {
  color-scheme: dark;
  --bg: #07080a;
  --panel: #0e1013;
  --panel-2: #13161a;
  --line: #1f242b;
  --line-strong: #2c333c;
  --text: #e9ecf1;
  --soft: #b3bbc7;
  --muted: #7d8694;
  --faint: #4a525e;
  --ok: #2fd27a;
  --tight: #f5b83d;
  --short: #ff4d4d;
  --accent: #3d8bfd;
  --radius: 8px;
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --edge-left: max(20px, env(safe-area-inset-left));
  --edge-right: max(20px, env(safe-area-inset-right));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, p { margin: 0; }
a { color: inherit; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.label { color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.sub { color: var(--muted); font-size: 12.5px; }
.warn { color: var(--tight); }

.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 300; letter-spacing: .02em;
  white-space: nowrap; }
.brand b { color: var(--accent); font-weight: 800; }
.tag { border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 9px; color: var(--soft); font-size: 10px;
  font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }

/* controls: 16px text in fields, or iPhones zoom in on them */
input, select { min-width: 0; padding: 9px 11px; background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: var(--radius); color: var(--text); font: 16px var(--font); }
select { padding-right: 8px; }
input:focus, select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61, 139, 253, .2); }
input::placeholder { color: var(--faint); }
button { padding: 9px 16px; border: 0; border-radius: var(--radius); background: var(--accent); color: #fff;
  font: 600 14px var(--font); cursor: pointer; white-space: nowrap; }
button:hover { background: #5a9cff; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .55; cursor: default; }
button.small { padding: 5px 11px; background: transparent; border: 1px solid var(--line-strong); color: var(--soft);
  font-size: 12.5px; }
button.small:hover { border-color: var(--muted); color: var(--text); }
button.danger:hover { border-color: var(--short); color: var(--short); }
button.secondary { background: transparent; border: 1px solid var(--line-strong); color: var(--text); }
button.secondary:hover { background: var(--panel-2); border-color: var(--muted); }
button.link { padding: 0; background: none; color: var(--muted); font-weight: 400; }
button.link:hover { color: var(--text); }

/* signing in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px var(--edge-right) 24px var(--edge-left); }
.signin-card { width: min(100%, 360px); display: grid; gap: 16px; padding: 28px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; }
.signin-card .brand { margin-bottom: 6px; }
.signin-step { display: grid; gap: 16px; }
.signin-card label { display: grid; gap: 6px; color: var(--soft); font-size: 13px; }
.signin-card button { padding: 11px; }
.signin-card button.link { justify-self: center; padding: 2px; font-size: 13px; }
.step-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.no-passkeys .passkey-only { display: none; }
.msg { min-height: 1.5em; color: var(--soft); font-size: 13px; }
.msg:empty { display: none; }
.msg.error { color: var(--short); }

/* the bar */
.bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 28px; min-height: 56px;
  padding: env(safe-area-inset-top) var(--edge-right) 0 var(--edge-left); background: rgba(7, 8, 10, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { position: relative; padding: 17px 12px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); }
.nav a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  border-radius: 2px; background: var(--accent); }
.who { display: flex; align-items: center; gap: 14px; color: var(--soft); white-space: nowrap; }
.who a { color: var(--soft); text-decoration: none; }
.who a:hover { color: var(--text); text-decoration: underline; }

/* a view */
.view { max-width: 1160px; margin: 0 auto; padding: 32px var(--edge-right) max(48px, env(safe-area-inset-bottom)) var(--edge-left); }
.view-head { margin-bottom: 24px; }
.view-head h1 { font-size: 26px; font-weight: 650; letter-spacing: -.015em; }
.view-head .sub { margin-top: 6px; font-size: 14px; max-width: 46rem; }
h2.section { margin: 36px 0 12px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; }
.loading, .empty { color: var(--muted); padding: 18px 0; }
.section-note { margin: -6px 0 14px; }
input:disabled { opacity: .45; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tile { display: grid; gap: 4px; padding: 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; text-decoration: none; }
a.tile:hover { border-color: var(--line-strong); background: var(--panel-2); }
.tile-value { font-size: 30px; font-weight: 600; line-height: 1.2; }
.tiles.money { margin-top: 12px; }
.tiles.money .tile-value { font-size: 24px; }
.tile.gain .tile-value { color: var(--ok); }
.tile.loss .tile-value { color: var(--short); }

/* Wide tables scroll inside their own box, never the page. */
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 12px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; text-align: left; white-space: nowrap; }
td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td.num, th.num { text-align: right; }
td.end, th.end { text-align: right; width: 1%; white-space: nowrap; }
tbody tr:hover td { background: rgba(255, 255, 255, .015); }
.two-line { display: grid; }
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state.ok { color: var(--ok); }
.state.muted { color: var(--muted); }
.state.faint { color: var(--faint); }

.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.inline-form label { display: grid; gap: 6px; flex: 1 1 220px; color: var(--soft); font-size: 13px; }
.inline-form label.narrow { flex: 0 1 100px; }
.inline-form label.narrow-date { flex: 0 1 150px; }
.actions { display: inline-flex; gap: 6px; }
.search { width: min(100%, 380px); margin-bottom: 16px; }

.reveal { display: grid; gap: 8px; margin-bottom: 24px; padding: 16px 18px; background: rgba(61, 139, 253, .06);
  border: 1px solid rgba(61, 139, 253, .35); border-radius: 12px; }
.reveal-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.reveal code { font: 600 20px var(--mono); letter-spacing: .04em; user-select: all; word-break: break-all; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100% - 40px); padding: 11px 16px; background: var(--panel-2); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); }
.toast[data-kind="error"] { border-color: rgba(255, 77, 77, .5); color: #ffb3b3; }

@media (max-width: 1100px) {
  .bar { flex-wrap: wrap; gap: 0 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .bar .brand { flex: 1; }
  .nav { order: 3; flex-basis: 100%; margin: 0 calc(-1 * var(--edge-right)) 0 calc(-1 * var(--edge-left));
    padding: 0 var(--edge-right) 0 var(--edge-left); }
  .nav a { padding: 12px 10px; }
  .view { padding-top: 24px; }
  .tile-value { font-size: 26px; }
}
