/* BJG Hosting — one stylesheet, no build step, no CDN.
   Design goals, in priority order:
     1. Every action is a large, obvious, thumb-sized target.
     2. Suggestion chips are first-class UI, not decoration — the fastest path
        through any form is tapping, never typing.
     3. Readable at a glance in both light and dark, since the operator uses
        this on a phone in a garage as often as at a desk. */

:root {
  --bg:            #f6f7f9;
  --surface:       #ffffff;
  --surface-2:     #eef1f5;
  --border:        #d8dee6;
  --text:          #16202c;
  --text-dim:      #5b6876;
  --accent:        #1d4ed8;
  --accent-hover:  #1e40af;
  --accent-soft:   #e6edfe;
  --good:          #0f7b4f;
  --good-soft:     #dff5e9;
  --warn:          #9a5b00;
  --warn-soft:     #fdf0d8;
  --bad:           #b3261e;
  --bad-soft:      #fbe4e2;
  --radius:        12px;
  --radius-lg:     18px;
  --shadow:        0 1px 2px rgba(16,24,40,.06), 0 4px 14px rgba(16,24,40,.06);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #0f1419;
    --surface:      #171d25;
    --surface-2:    #1e2630;
    --border:       #2c3643;
    --text:         #e7edf4;
    --text-dim:     #97a4b4;
    --accent:       #5b8cff;
    --accent-hover: #7ba3ff;
    --accent-soft:  #1b2942;
    --good:         #4ade80;
    --good-soft:    #14301f;
    --warn:         #fbbf24;
    --warn-soft:    #33280c;
    --bad:          #f87171;
    --bad-soft:     #3a1a18;
    --shadow:       0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
small { font-size: .85rem; color: var(--text-dim); }

/* ── layout ── */
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.stack > * + * { margin-top: 18px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.spacer { flex: 1; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }

/* ── header ── */
header.site {
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
header.site .inner { display: flex; align-items: center; gap: 18px; padding: 12px 20px;
  max-width: 1140px; margin: 0 auto; flex-wrap: wrap; }
.brand { font-weight: 750; font-size: 1.15rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }
nav.main { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
nav.main a {
  padding: 8px 13px; border-radius: 9px; color: var(--text-dim);
  font-weight: 550; font-size: .93rem;
}
nav.main a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
nav.main a.active { background: var(--accent-soft); color: var(--accent); }

/* ── cards ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
}
.card.tight { padding: 16px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }

/* ── buttons: big by default ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: var(--radius);
  background: var(--accent); color: #fff; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-align: center;
  transition: background .12s ease, transform .05s ease;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface-2); color: var(--text); }
.btn.ghost { background: transparent; color: var(--accent); border-color: transparent; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #8f1e17; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: .88rem; }
.btn.block { width: 100%; }
.btn.big { min-height: 60px; font-size: 1.05rem; padding: 16px 28px; }

/* ── the tile grid: the primary one-tap surface ── */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  min-height: 122px; padding: 16px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text); cursor: pointer; text-align: left;
  font: inherit; transition: border-color .12s, background .12s, transform .06s;
}
.tile:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; transform: translateY(-1px); }
.tile .ico { font-size: 1.9rem; line-height: 1; }
.tile .name { font-weight: 640; font-size: .97rem; }
.tile .meta { font-size: .8rem; color: var(--text-dim); margin-top: auto; }

/* ── suggestion chips ── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.chip {
  padding: 9px 15px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: .9rem;
  cursor: pointer; min-height: 40px; transition: all .12s;
}
.chip:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.chip-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-dim); font-weight: 650; margin-bottom: 2px; }

/* ── forms ── */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=tel], input[type=file], select, textarea {
  width: 100%; padding: 13px 14px; font: inherit; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); min-height: 50px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field { margin-bottom: 18px; }
.field .hint { font-size: .85rem; color: var(--text-dim); margin-top: 5px; font-weight: 400; }
fieldset { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 0 0 18px; }
legend { padding: 0 8px; font-weight: 650; font-size: .9rem; }
.checkline { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.checkline input { width: 22px; height: 22px; min-height: 0; }

/* ── stats ── */
.stat { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; }
.stat .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-dim); font-weight: 680; }
.stat .v { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat .sub { font-size: .84rem; color: var(--text-dim); }
.stat.good .v { color: var(--good); }
.stat.bad .v { color: var(--bad); }
.stat.warn .v { color: var(--warn); }

/* ── tables ── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-dim); font-weight: 700; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: var(--surface-2); }

/* ── clickable rows ──
   The whole row is a hit target; the first cell still holds a real link so the
   keyboard path and no-JS path both work. */
tr[data-href] { cursor: pointer; }
tr[data-href]:hover { background: var(--accent-soft); }
tr[data-href] td a.row-title { color: var(--text); font-weight: 640; }
tr[data-href]:hover td a.row-title { color: var(--accent); }
tr[data-href] td a.row-title:hover { text-decoration: none; }
/* Give the row a visible focus ring when its inner link is focused. */
tr[data-href]:focus-within { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
tr.total td { font-weight: 700; border-top: 2px solid var(--border); background: var(--surface-2); }

/* ── badges & notes ── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 650; background: var(--surface-2); color: var(--text-dim); }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad  { background: var(--bad-soft);  color: var(--bad); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

.note { padding: 14px 16px; border-radius: var(--radius); border-left: 4px solid var(--accent);
  background: var(--accent-soft); font-size: .93rem; }
.note.warn { border-color: var(--warn); background: var(--warn-soft); }
.note.bad  { border-color: var(--bad);  background: var(--bad-soft); }
.note.good { border-color: var(--good); background: var(--good-soft); }
.note p:last-child { margin-bottom: 0; }
.note strong { font-weight: 700; }

/* ── progress ── */
.bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--good); border-radius: 999px; }
.bar.low > span { background: var(--bad); }
.bar.mid > span { background: var(--warn); }

/* ── action rail: the big-button workflow on the dashboard ── */
.actions { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.action {
  display: flex; align-items: center; gap: 14px; min-height: 74px;
  padding: 16px 18px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1.5px solid var(--border); color: var(--text);
  font: inherit; text-align: left; cursor: pointer; transition: all .12s;
}
.action:hover { border-color: var(--accent); background: var(--accent-soft);
  text-decoration: none; transform: translateY(-1px); }
.action .ico { font-size: 1.75rem; line-height: 1; flex: none; }
.action .lbl { font-weight: 650; font-size: 1rem; }
.action .sub { font-size: .84rem; color: var(--text-dim); }
.action.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.action.primary:hover { background: var(--accent-hover); }
.action.primary .sub { color: rgba(255,255,255,.85); }

/* the approve control that lives inside a lead row */
.btn.approve { background: var(--good); border-color: var(--good); min-height: 42px;
  padding: 8px 18px; font-weight: 650; white-space: nowrap; }
.btn.approve:hover { background: #0b6440; }

/* ── marketing ── */
.hero { padding: 72px 0 56px; text-align: center; }
.hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); margin-bottom: .35em; }
.hero .lede { font-size: 1.2rem; color: var(--text-dim); max-width: 660px; margin: 0 auto 32px; }
.plan { display: flex; flex-direction: column; }
.plan .price { font-size: 2.2rem; font-weight: 750; letter-spacing: -.03em; margin: 8px 0 2px; }
.plan .price span { font-size: .95rem; font-weight: 500; color: var(--text-dim); }
.plan ul { list-style: none; padding: 0; margin: 16px 0; }
.plan li { padding: 7px 0 7px 26px; position: relative; font-size: .94rem; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 700; }
.plan .btn { margin-top: auto; }
.plan.featured { border-color: var(--accent); border-width: 2px; }

footer.site { border-top: 1px solid var(--border); margin-top: 64px; padding: 32px 0;
  color: var(--text-dim); font-size: .9rem; background: var(--surface); }

/* ── misc ── */
.mono { font-family: var(--mono); font-size: .88em; }
.dim { color: var(--text-dim); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.inline-form { display: inline; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 28px 0 14px; }
.section-title h2 { margin: 0; }

@media (max-width: 640px) {
  .hero { padding: 44px 0 32px; }
  .card { padding: 16px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  header.site .inner { gap: 10px; }
  nav.main a { padding: 7px 10px; font-size: .88rem; }
}

@media print {
  header.site, footer.site, .no-print, nav.main { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card { border: 1px solid #999; box-shadow: none; break-inside: avoid; }
  a { color: #000; }
}

/* ── password show/hide (auth.js wraps each field at runtime) ── */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 2.6rem; }
.pw-eye {
  position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; font-size: 1.05rem;
  line-height: 1; padding: .25rem; opacity: .65;
}
.pw-eye:hover, .pw-eye:focus-visible { opacity: 1; }
