/* ZettaPix licence portal — an internal tool, so it is built to be read at a
   glance and operated quickly rather than to impress. */

:root {
  --ground: #F2F5F6;
  --surface: #FFFFFF;
  --sunk: #E8EEF1;
  --ink: #141A20;
  --ink-soft: #3D4854;
  --muted: #667380;
  --rule: #D7DFE4;
  --rule-firm: #B8C4CC;
  --accent: #0B6E68;
  --accent-soft: #D7ECEA;
  --accent-ink: #FFFFFF;
  --good: #0B6E68;
  --good-soft: #D7ECEA;
  --warn: #8A5108;
  --warn-soft: #F6E7D2;
  --bad: #9C2B1C;
  --bad-soft: #F6DCD7;
  --idle: #5A6672;
  --idle-soft: #E3E8EB;
  --shadow: 0 1px 2px rgba(20, 26, 32, .05), 0 8px 24px -18px rgba(20, 26, 32, .3);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0F1418;
    --surface: #161D23;
    --sunk: #1D262D;
    --ink: #E6EDF2;
    --ink-soft: #BDC9D3;
    --muted: #8A97A4;
    --rule: #28323B;
    --rule-firm: #3A4650;
    --accent: #4ECDC0;
    --accent-soft: #0F3330;
    --accent-ink: #06201E;
    --good: #4ECDC0;
    --good-soft: #0F3330;
    --warn: #E0A155;
    --warn-soft: #332411;
    --bad: #E3796A;
    --bad-soft: #351915;
    --idle: #8A97A4;
    --idle-soft: #212A32;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -20px rgba(0, 0, 0, .9);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
h1, h2, h3 { margin: 0; letter-spacing: -.012em; text-wrap: balance; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 640; }
h3 { font-size: 14px; font-weight: 640; }
p { margin: 0; }

/* ---------------------------------------------------------------- shell -- */

.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }

.side {
  background: var(--surface);
  border-right: 1px solid var(--rule);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* No mark beside the name: the sidebar says what this is in words, and a
   letter in a box said nothing the heading did not. */
.brand { display: flex; flex-direction: column; gap: 1px; padding: 0 8px; }
.brand .name { font-weight: 650; font-size: 15px; }
.brand .sub { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 7px;
  color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 500;
}
.nav a:hover { background: var(--sunk); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-group { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 10px; margin-bottom: 4px; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 8px; }
.who { font-size: 13px; }
.who .email { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  border-bottom: 1px solid var(--rule); background: var(--surface);
  padding: 16px 28px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.topbar .grow { flex: 1; min-width: 0; }
.crumb { font-size: 12px; color: var(--muted); }
.content { padding: 24px 28px 64px; display: flex; flex-direction: column; gap: 22px; max-width: 1240px; width: 100%; }

/* --------------------------------------------------------------- pieces -- */

.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 10px; overflow: hidden;
}
.card > header {
  padding: 13px 18px; border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card > header .grow { flex: 1; }
.card .body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.card .empty { padding: 34px 18px; text-align: center; color: var(--muted); font-size: 14px; }

.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.figure { background: var(--surface); padding: 15px 17px; display: flex; flex-direction: column; gap: 2px; }
.figure .v { font-size: 27px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.figure .k { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.figure .note { font-size: 12px; color: var(--muted); }
.figure.flag .v { color: var(--warn); }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tablewrap { overflow-x: auto; }
th, td { text-align: left; padding: 10px 18px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--sunk); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--sunk); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.mono, .mono { font-family: var(--mono); font-size: 13px; }
td .sub { color: var(--muted); font-size: 12.5px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.pill.bound    { background: var(--good-soft); color: var(--good); }
.pill.unused   { background: var(--idle-soft); color: var(--idle); }
.pill.released { background: var(--warn-soft); color: var(--warn); }
.pill.revoked  { background: var(--bad-soft);  color: var(--bad); }
.pill.live     { background: var(--good-soft); color: var(--good); }
.pill.quiet    { background: var(--warn-soft); color: var(--warn); }
.pill.gone     { background: var(--idle-soft); color: var(--idle); }
.pill.admin    { background: var(--accent-soft); color: var(--accent); }
.pill.staff    { background: var(--idle-soft); color: var(--idle); }

.bar { height: 6px; border-radius: 99px; background: var(--sunk); overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; background: var(--accent); }

/* --------------------------------------------------------------- forms -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--rule-firm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 550; text-decoration: none;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--sunk); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field .hint { font-size: 12px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
  font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule-firm);
  border-radius: 8px; padding: 8px 10px; width: 100%;
}
textarea { min-height: 72px; resize: vertical; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 150px; }

.notice { padding: 11px 16px; border-radius: 9px; font-size: 14px; border: 1px solid; }
.notice.ok   { background: var(--good-soft); color: var(--good); border-color: transparent; }
.notice.bad  { background: var(--bad-soft);  color: var(--bad);  border-color: transparent; }

.keylist { font-family: var(--mono); font-size: 13px; line-height: 1.9; background: var(--sunk); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; max-height: 320px; overflow: auto; white-space: pre; }

/* ---------------------------------------------------------------- login -- */

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.login .card .body { gap: 16px; }
.login .lede { color: var(--muted); font-size: 13.5px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { border-right: none; border-bottom: 1px solid var(--rule); }
  .side-foot { margin-top: 0; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
}

/* How much of a volume allowance a key has spent. Drawn under the figures
   rather than instead of them: a bar shows the shape at a glance, the numbers
   are what someone acts on. */
.meter { height: 4px; background: rgba(127,127,127,.18); border-radius: 2px; margin-top: 5px; overflow: hidden; max-width: 160px; }
.meter i { display: block; height: 100%; background: currentColor; opacity: .5; }
td .bad { color: var(--bad, #e5484d); font-weight: 500; }
