/* Buddys & Buddys brand (Brandbook v1.0): Electric Green #20B820 · Deep Navy #002B49 · White · Mist #F2F5F4
   White/mist for space, navy for structure and text, green for emphasis. Type: DejaVu Sans. */
@font-face { font-family: "DejaVu Sans"; src: url("/static/fonts/DejaVuSans.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DejaVu Sans"; src: url("/static/fonts/DejaVuSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
:root {
  --brand-green: #20B820; --brand-navy: #002B49; --brand-mist: #F2F5F4;
  --bg: #F2F5F4; --surface: #FFFFFF; --surface-2: #E9EFED; --border: #D3DDDA;
  --text: #002B49; --muted: #4B6377; --accent: #002B49; --accent-ink: #FFFFFF; --link: #0E7A14;
  --ok: #0E7A14; --ok-bg: #E2F5E2; --warn: #7A5300; --warn-bg: #FFF2D1;
  --bad: #B3261E; --bad-bg: #FDE7E5; --skip: #4B6377; --skip-bg: #E6ECEA;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,43,73,.06), 0 1px 3px rgba(0,43,73,.08);
  --mono: "DejaVu Sans Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #001A2D; --surface: #002B49; --surface-2: #073A5E; --border: #17496D;
    --text: #FFFFFF; --muted: #A8BFD0; --accent: #20B820; --accent-ink: #002B49; --link: #5FD65F;
    --ok: #5FD65F; --ok-bg: #0B3B2C; --warn: #F2C46B; --warn-bg: #3A3014;
    --bad: #FF8A80; --bad-bg: #3D1C24; --skip: #B9CBD8; --skip-bg: #0F3D5E;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 "DejaVu Sans", Verdana, -apple-system, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 16px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* Header: navy structure with a green accent rule, same in both themes */
header.top { background: var(--brand-navy); border-bottom: 3px solid var(--brand-green); color: #fff; }
header.top .inner { max-width: 1280px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: #fff; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { height: 32px; width: auto; display: block; }
.brand span { color: var(--brand-green); }
nav.main { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
nav.main a { padding: 6px 12px; border-radius: 8px; color: #C9D7E2; white-space: nowrap; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
nav.main a.active, nav.main a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
nav.main a.active { box-shadow: inset 0 -2px 0 var(--brand-green); }
.userbox { display: flex; align-items: center; gap: 10px; color: #C9D7E2; font-size: 13px; white-space: nowrap; }
header.top .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
header.top .btn:hover { background: rgba(255,255,255,.1); }
main { max-width: 1280px; margin: 0 auto; padding: 24px 20px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.stack > * + * { margin-top: 16px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); padding: 8px 14px; border-radius: 8px; font: inherit; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; cursor: pointer; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 11px; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
table input[type=text], table input[type=number], table select { padding: 5px 7px; font-size: 13px; }

.alert { padding: 12px 14px; border-radius: 8px; border: 1px solid transparent; margin-bottom: 16px; }
.alert.bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.info { background: var(--surface-2); color: var(--text); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); position: sticky; top: 0; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
tr.detail td { background: var(--surface-2); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.skip { background: var(--skip-bg); color: var(--skip); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: none; padding: 10px 14px; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.steps .s { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.steps .s.on { background: var(--accent); color: var(--accent-ink); }
.steps .s.done { background: var(--ok-bg); color: var(--ok); }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 12.5px; }
.location-banner { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }

.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .3s; }

.tile { display: block; color: inherit; }
.tile:hover { text-decoration: none; border-color: var(--accent); }
.tile .t { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.tile.soon { opacity: .55; }

dialog { border: 1px solid var(--border); border-radius: 14px; padding: 24px; background: var(--surface); color: var(--text); max-width: 520px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.toast { position: fixed; bottom: 20px; right: 20px; padding: 10px 16px; border-radius: 8px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); z-index: 10; }
.center-box { max-width: 420px; margin: 8vh auto; }
code { font-family: var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

@media (max-width: 720px) {
  header.top .inner { gap: 12px; padding: 0 16px; }
  main { padding: 16px 16px 48px; }
  .userbox .who { display: none; }
}

/* Brand accents (green = emphasis only, never small body text on light) */
.kpi { border-top: 3px solid var(--brand-green); }
.tile { border-top: 3px solid var(--brand-green); }
.tile:hover { border-color: var(--brand-green); }
.steps .s.on { box-shadow: inset 0 -2px 0 var(--brand-green); }
.tabs button.on { border-bottom-color: var(--brand-green); }
.progress > div { background: var(--brand-green); }
th, .tabs button, .steps .s, label.field > span { letter-spacing: .03em; }
.tabs button, .steps .s { font-size: 12px; font-weight: 700; text-transform: uppercase; }
.location-banner { color: var(--text); }
.center-box { border-top: 4px solid var(--brand-green); }
.tagline { color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.brand img { height: 34px; }
.brand .divider { width: 1px; height: 26px; background: rgba(255,255,255,.3); }
/* login / setup logo: big and centred; white-lettering version is swapped in for dark mode */
.auth-logo { display: block; text-align: center; margin: 8px 0 20px; }
.auth-logo img { width: 360px; max-width: 100%; height: auto; display: inline-block; }
.center-box h1, .center-box > p.muted { text-align: center; }
