/* Revoa. Neutral, quiet surfaces in the manner of Apple's system apps, with
   the brand's gold as the single accent, used sparingly. Brand: Regal Taupe
   #82796D, Antique Gold #B58A42, Champagne Gold #E5B96E, Royal Gold #C99A50. */
:root {
  --bg: #f2f2f7; --surface: #ffffff; --side: rgb(255 255 255 / 0.72); --fill: rgb(118 118 128 / 0.1); --fill-2: rgb(118 118 128 / 0.16);
  --text: #1c1c1e; --text-2: #636366; --text-3: #8e8e93; --line: rgb(60 60 67 / 0.12); --ring: rgb(0 0 0 / 0.06);
  --gold: #b58a42; --gold-ink: #8a6522; --gold-wash: rgb(181 138 66 / 0.12); --on-gold: #1c1c1e;
  --gold-button: linear-gradient(180deg, #e3bd77, #cfa257);
  --ok: #1f8a4c; --ok-wash: rgb(52 199 89 / 0.14); --bad: #c9342a; --bad-wash: rgb(255 59 48 / 0.11);
  --warn: #9a6200; --warn-wash: rgb(255 159 10 / 0.16);
  --shadow: 0 0 0 1px var(--ring), 0 1px 2px rgb(0 0 0 / 0.04), 0 10px 30px rgb(0 0 0 / 0.05);
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --surface: #1c1c1e; --side: rgb(22 22 24 / 0.78); --fill: rgb(118 118 128 / 0.2); --fill-2: rgb(118 118 128 / 0.3);
    --text: #f5f5f7; --text-2: #aeaeb2; --text-3: #8e8e93; --line: rgb(255 255 255 / 0.09); --ring: rgb(255 255 255 / 0.07);
    --gold: #e5b96e; --gold-ink: #e5b96e; --gold-wash: rgb(229 185 110 / 0.14); --on-gold: #1c1c1e;
    --gold-button: linear-gradient(180deg, #edc98a, #d9ac62);
    --ok: #4cd97b; --ok-wash: rgb(48 209 88 / 0.16); --bad: #ff6961; --bad-wash: rgb(255 69 58 / 0.16);
    --warn: #ffb340; --warn-wash: rgb(255 159 10 / 0.18);
    --shadow: 0 0 0 1px var(--ring), 0 12px 40px rgb(0 0 0 / 0.5);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1 { font-size: 28px; line-height: 1.15; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.022em; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; letter-spacing: -0.012em; }
p { margin: 0 0 10px; }
a { color: var(--gold-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--text-2); } .small { font-size: 13px; }
.strong { font-weight: 600; color: var(--text); }
.mono { font: 12.5px var(--mono); }
.pre { white-space: pre-wrap; margin: 8px 0 0; }
.only-dark { display: none !important; }
@media (prefers-color-scheme: dark) { .only-dark { display: block !important; } .only-light { display: none !important; } }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 16px;
  background: var(--side); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-right: 1px solid var(--line); }
.logo { height: 28px; width: auto; display: block; }
.home { display: block; padding: 2px 10px 22px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-weight: 500; }
.side nav a:hover { background: var(--fill); color: var(--text); text-decoration: none; }
.side nav a[aria-current="page"] { background: var(--fill-2); color: var(--text); }
.side nav a[aria-current="page"] .icon { color: var(--gold); }
.icon { display: inline-flex; width: 20px; height: 20px; flex: none; } .icon svg { width: 100%; height: 100%; }
.who { margin-top: auto; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 10px; align-items: center; padding: 14px 8px 0; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600;
  background: var(--gold-wash); color: var(--gold-ink); }
.who-name { font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-text .small { line-height: 1.3; }
.who-actions { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 2px; }
.who-actions a.quiet { color: var(--text-2); font-size: 13px; padding: 6px 10px; border-radius: 8px; text-decoration: none; }
.who-actions a.quiet:hover, .who-actions a.quiet[aria-current="page"] { background: var(--fill); color: var(--text); }
.content { min-width: 0; }
main { max-width: 1080px; margin: 0 auto; padding: 36px 36px 28px; }
main > * { animation: rise 0.34s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.foot { max-width: 1080px; margin: 0 auto; padding: 0 36px 36px; color: var(--text-3); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ cards */
.card { background: var(--surface); border-radius: 18px; padding: 22px; margin-top: 18px; box-shadow: var(--shadow); }
.card.tight { padding: 6px 22px; }
.bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bar h2 { margin-bottom: 0; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.two > .card { margin-top: 18px; }
.filters { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.filters input { flex: 2 1 260px; } .filters select { flex: 1 1 170px; width: auto; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.row.eight { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.actions.left { justify-content: flex-start; margin-top: 10px; }
.narrow { min-width: 190px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- sign-in */
.signin { max-width: 380px; margin: 16vh auto 0; padding: 32px; position: relative; }
.signin .logo { height: 38px; margin-bottom: 18px; }
.signin h1 { font-size: 22px; }
.signin button.primary { width: 100%; margin-top: 22px; padding: 11px 16px; }
.under { margin: 16px 0 0; text-align: center; }
button.linkish { background: none; padding: 4px 6px; color: var(--gold-ink); font-size: 14px; font-weight: 500; }
button.linkish:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------- controls */
label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; }
input, select, textarea { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid transparent;
  background: var(--fill); color: var(--text); font: inherit; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-wash); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
button { font: inherit; font-weight: 500; padding: 8px 15px; border-radius: 10px; border: 0; background: var(--fill); color: var(--text);
  cursor: pointer; white-space: nowrap; }
button:hover { background: var(--fill-2); }
button.primary { background: var(--gold-button); color: var(--on-gold); font-weight: 600; margin-top: 18px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), 0 1px 2px rgb(0 0 0 / 0.12); }
button.primary:hover { filter: brightness(1.04); }
button.primary.flat { margin-top: 0; }
button.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
button.quiet { background: transparent; color: var(--text-2); font-size: 13px; padding: 6px 10px; text-align: left; }
button.quiet:hover { background: var(--fill); color: var(--text); }
button.ai { background: var(--gold-wash); color: var(--gold-ink); font-weight: 600; }
button.ai:hover { background: var(--gold-wash); filter: brightness(1.06); }
button.ai::before { content: "✦"; margin-right: 7px; }
button:disabled { opacity: 0.5; cursor: default; }

/* ----------------------------------------------------------------- tables */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px; padding: 12px 14px 9px 0; white-space: nowrap; letter-spacing: 0.01em; }
td { padding: 12px 14px 12px 0; border-top: 1px solid var(--line); vertical-align: middle; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.row-link { cursor: pointer; } tr.row-link:hover td { background: var(--fill); }
tr.row-link td:first-child { padding-left: 10px; border-radius: 10px 0 0 10px; } tr.row-link td:last-child { border-radius: 0 10px 10px 0; }
td .pill { margin: 0 4px 2px 0; }
td a.strong:hover { text-decoration: none; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1.45; }
.pill.ok { color: var(--ok); background: var(--ok-wash); } .pill.bad { color: var(--bad); background: var(--bad-wash); }
.pill.warn { color: var(--warn); background: var(--warn-wash); } .pill.gold { color: var(--gold-ink); background: var(--gold-wash); }
.pill.muted-pill { color: var(--text-2); background: var(--fill); }
.notice { margin: 12px 0 0; font-size: 14px; } .notice:empty { display: none; } .notice.bad { color: var(--bad); }
code { font: 13px var(--mono); background: var(--fill); padding: 2px 7px; border-radius: 6px; user-select: all; }

/* -------------------------------------------------------------- dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 22px; }
.stat { display: block; background: var(--surface); border-radius: 18px; padding: 16px 18px 18px; box-shadow: var(--shadow); color: var(--text); }
.stat:hover { text-decoration: none; transform: translateY(-1px); }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--text-3); }
.stat-label { font-size: 13px; color: var(--text-2); }
.stat b { display: block; margin-top: 12px; font-size: 34px; line-height: 1; font-weight: 600; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.stat.attn .icon { color: var(--gold); } .stat.attn b { color: var(--gold-ink); }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 170px; margin-top: 14px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar-fill { width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--gold), color-mix(in srgb, var(--gold) 45%, transparent)); min-height: 4px; }
.bar-fill.h0 { height: 4px; background: var(--fill-2); }
.bar-fill.h1 { height: 10%; } .bar-fill.h2 { height: 20%; } .bar-fill.h3 { height: 30%; } .bar-fill.h4 { height: 40%; } .bar-fill.h5 { height: 50%; }
.bar-fill.h6 { height: 60%; } .bar-fill.h7 { height: 70%; } .bar-fill.h8 { height: 78%; } .bar-fill.h9 { height: 84%; } .bar-fill.h10 { height: 88%; }
.bar-n { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 16px; }
.bar-day { font-size: 12px; color: var(--text-3); }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 10px; margin: 0 -10px; border-radius: 12px; color: var(--text); }
.list-row + .list-row { box-shadow: 0 -1px 0 var(--line); }
.list-row:hover { background: var(--fill); text-decoration: none; box-shadow: none; } .list-row:hover + .list-row { box-shadow: none; }

/* ------------------------------------------------------------------ chart */
.chart-head h1 { font-size: 30px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px 24px; margin: 18px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.facts dt { font-size: 12px; color: var(--text-3); } .facts dd { margin: 3px 0 0; }
.tabs { display: inline-flex; gap: 2px; margin-top: 20px; padding: 3px; border-radius: 11px; background: var(--fill); max-width: 100%; overflow-x: auto; }
.tabs a { padding: 6px 15px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 14px; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a[aria-selected="true"] { color: var(--text); background: var(--surface); box-shadow: 0 0 0 0.5px var(--ring), 0 2px 6px rgb(0 0 0 / 0.12); }
@media (prefers-color-scheme: dark) { .tabs a[aria-selected="true"] { background: rgb(99 99 102 / 0.55); } }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.tile { background: var(--fill); border-radius: 14px; padding: 13px 15px; }
.tile b { display: block; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tile span { color: var(--text-2); font-size: 12px; }
.note { padding: 16px 0; border-top: 1px solid var(--line); }
.note:first-of-type { border-top: 0; padding-top: 4px; }
.note.draft { background: var(--warn-wash); border: 0; border-radius: 14px; padding: 16px; margin: 10px 0; }
.note.resolved { opacity: 0.55; }
.ai-box { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--gold-wash); }
.ai-box[hidden] { display: none; }
.ai-tag { font-size: 13px; color: var(--gold-ink); font-weight: 600; }
.ai-tag::before { content: "✦"; margin-right: 7px; }
.warn-line { margin: 8px 0 0; font-size: 14px; }
dialog { width: min(720px, calc(100vw - 32px)); color: var(--text); margin-top: 8vh; border: 0; }
dialog::backdrop { background: rgb(0 0 0 / 0.4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* ------------------------------------------------------------------ small */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; height: auto; flex-direction: row; align-items: center; gap: 6px 14px; flex-wrap: wrap; padding: 10px 14px;
    border-right: 0; border-bottom: 1px solid var(--line); z-index: 5; }
  .home { padding: 0 6px 0 2px; } .logo { height: 24px; }
  .side nav { flex-direction: row; order: 3; flex-basis: 100%; overflow-x: auto; }
  .side nav a { padding: 6px 10px; white-space: nowrap; }
  .who { margin: 0 0 0 auto; padding: 0; border: 0; grid-template-columns: auto; }
  .who-text, .avatar { display: none; } .who-actions { grid-column: auto; flex-direction: row; }
  main { padding: 22px 16px 20px; } .foot { padding: 0 16px 28px; }
  .card { padding: 18px; } .card.tight { padding: 4px 18px; }
  h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { main > * { animation: none; } }
@media (prefers-reduced-motion: no-preference) {
  button, .side nav a, tr.row-link td, .list-row, .stat { transition: background-color 0.18s ease, filter 0.18s ease, transform 0.18s ease, color 0.18s ease; }
}

/* Password fields: a quiet Show / Hide control inside the field. */
.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw .reveal { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); padding: 4px 10px; font-size: 13px;
  border-radius: 7px; background: transparent; color: var(--text-2); }
.pw .reveal:hover { background: var(--fill-2); color: var(--text); }

/* Sign-in security: the authenticator app. */
input.code { font-family: var(--mono); font-size: 18px; letter-spacing: 0.12em; }
.under.tight { margin-top: 4px; }
.page-head { margin-bottom: 4px; }
.security { max-width: 720px; }
.security h3 { font-size: 15px; font-weight: 600; margin: 14px 0 6px; }
.security .actions { justify-content: flex-start; }
.steps { margin: 4px 0 0; padding-left: 22px; display: grid; gap: 18px; }
.steps li::marker { color: var(--text-3); font-weight: 600; }
.qr-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.qr { width: 176px; height: 176px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line); flex: none; }
.key { display: block; margin: 6px 0; font-family: var(--mono); font-size: 14px; letter-spacing: 0.04em; word-break: break-all; user-select: all;
  background: var(--fill); padding: 8px 10px; border-radius: 8px; max-width: 380px; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.inline-form > div { min-width: 180px; }
.codes { list-style: none; padding: 14px 16px; margin: 10px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; max-width: 360px;
  font-family: var(--mono); font-size: 15px; background: var(--fill); border-radius: 12px; user-select: all; }
