/* Same visual language as the fleet-architecture doc: a verdigris accent on a
   neutral ground with a slight green-blue cast, mono type for anything
   structural (labels, code, numbers), sans for reading text. This is a tool
   that gets scanned and operated, not read top-to-bottom -- density and
   at-a-glance state (pills) matter more than editorial hierarchy here. */
:root {
  --paper: #EEF2F1; --surface: #FFFFFF; --surface-2: #E4EAE8;
  --text: #121A1C; --muted: #5A6A6C; --line: #C3CFCD; --line-soft: #AFBEBB;
  --accent: #1E8570; --accent-wash: #DDEDE8;
  --warn: #A76A16; --warn-wash: #F6E9D3;
  --danger: #B04740; --danger-wash: #F6DFDD;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0C1113; --surface: #141C1E; --surface-2: #1C2629; --text: #DCE6E4;
    --muted: #8A9C9B; --line: #2C3A3D; --line-soft: #3A4B4E; --accent: #45C4AB;
    --accent-wash: #12312B; --warn: #E0A44E; --warn-wash: #33260F;
    --danger: #E58179; --danger-wash: #3A1E1C;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper); color: var(--text); font-family: var(--sans);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }
.loading { color: var(--muted); font-family: var(--mono); font-size: 13px; }

a { color: var(--accent); }
code, .mono { font-family: var(--mono); }

/* ---- login screen ---- */
.login-card {
  max-width: 420px; margin: 12vh auto 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px; padding: 36px 32px;
  text-align: center;
}
.login-card h1 { font-family: var(--mono); font-size: 20px; margin: 0 0 8px; }
.login-card p { color: var(--muted); font-size: 14px; margin: 0 0 28px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; border: none; border-radius: 4px;
  padding: 11px 22px; font-size: 14.5px; font-weight: 600; cursor: pointer;
  font-family: var(--sans); text-decoration: none;
}
.btn-primary:hover { filter: brightness(1.06); }

/* ---- header ---- */
header.topbar {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 2px solid var(--text); padding-bottom: 18px; margin-bottom: 28px;
  flex-wrap: wrap; gap: 12px;
}
header.topbar h1 { font-family: var(--mono); font-size: 22px; margin: 0; letter-spacing: -.01em; }
.who { font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 14px; }
.who .email { color: var(--text); font-weight: 600; }
.who a { font-size: 13px; }

/* ---- summary strip ---- */
.summary { display: flex; gap: 28px; margin-bottom: 32px; flex-wrap: wrap; }
.summary .stat { }
.summary .stat .n { font-family: var(--mono); font-size: 26px; font-weight: 700; line-height: 1; }
.summary .stat .l { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

/* ---- sections ---- */
section { margin-bottom: 40px; }
h2 { font-family: var(--mono); font-size: 15px; font-weight: 700; margin: 0 0 14px; }

/* ---- create form ---- */
.create-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 20px 22px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field input[type=text], .field input[type=number] {
  font-family: var(--sans); font-size: 14px; padding: 8px 10px; border: 1px solid var(--line-soft);
  border-radius: 4px; background: var(--paper); color: var(--text); min-width: 220px;
}
.field input:focus, .scope-item input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.scopes { display: flex; gap: 10px; flex-wrap: wrap; }
.scope-item {
  display: flex; align-items: center; gap: 7px; border: 1px solid var(--line-soft);
  border-radius: 100px; padding: 6px 12px 6px 10px; cursor: pointer; font-size: 13.5px;
  background: var(--paper);
}
.scope-item.danger-scope { border-color: var(--danger); }
.scope-item .desc { color: var(--muted); font-size: 12px; }
.btn { font-family: var(--sans); font-size: 13.5px; font-weight: 600; border-radius: 4px; padding: 9px 16px; cursor: pointer; border: 1px solid var(--line-soft); background: var(--surface); color: var(--text); }
.btn:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--danger-wash); }
.error-msg { color: var(--danger); font-size: 13.5px; margin-top: 10px; }

/* ---- token reveal ---- */
.reveal {
  margin-top: 16px; border: 1.5px solid var(--accent); background: var(--accent-wash);
  border-radius: 6px; padding: 16px 18px;
}
.reveal .lbl { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.reveal .tokenbox {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; font-family: var(--mono);
  font-size: 13px; word-break: break-all;
}
.reveal .tokenbox button { flex: none; }
.reveal .warn { font-size: 12.5px; color: var(--warn); margin-top: 8px; }

/* ---- table ---- */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; min-width: 720px; }
th, td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; border-bottom: 1.5px solid var(--line-soft); }
td.num, .mono-cell { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.5px; }
.pill { display: inline-block; font-family: var(--mono); font-size: 10.5px; padding: 2px 8px; border-radius: 100px; font-weight: 700; border: 1px solid currentColor; white-space: nowrap; }
.pill-active { color: var(--accent); }
.pill-revoked { color: var(--danger); }
.pill-expired { color: var(--warn); }
.scope-pill { display: inline-block; font-family: var(--mono); font-size: 10.5px; padding: 1px 7px; border-radius: 100px; background: var(--surface-2); color: var(--muted); margin: 1px 3px 1px 0; }
.muted { color: var(--muted); }
.empty { color: var(--muted); font-size: 13.5px; padding: 16px 0; }

footer { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 48px; color: var(--muted); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
