:root {
  color-scheme: light;
  --paper: #f6f7f3;
  --surface: #fffefa;
  --ink: #192e32;
  --muted: #55686b;
  --line: #dce3dd;
  --navy: #102c32;
  --teal: #11675e;
  --mint: #8de4c9;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); }
main, .content, .panel, .metric { min-width: 0; }
h1, h2, h3, p { margin: 0 0 .65rem; }
h1, h2, h3, strong { text-wrap: pretty; }
h1 { font-size: clamp(1.85rem, 3.4vw, 3rem); letter-spacing: -.055em; line-height: 1.09; font-weight: 650; }
h2 { font-size: 1.3rem; letter-spacing: -.035em; line-height: 1.25; }
h3 { font-size: 1rem; letter-spacing: -.015em; }
a { color: var(--teal); text-underline-offset: .2em; }
.muted, small { color: var(--muted); }
code { overflow-wrap: anywhere; font: .86em/1.5 ui-monospace, Consolas, monospace; }
.shell { min-height: 100vh; display: grid; grid-template-columns: clamp(205px, 18vw, 260px) minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; gap: 1.75rem; padding: 2rem 1.15rem; color: #eaf5ef; background: radial-gradient(ellipse at 0% 100%, #235147 0, transparent 50%), var(--navy); }
.brand { display: inline-flex; align-items: center; gap: .68rem; font-size: 1.16rem; line-height: 1.15; font-weight: 650; letter-spacing: -.035em; color: inherit; text-decoration: none; }
.brand img, .brand svg { width: 2.45rem; height: 2.45rem; flex: none; }
.sidebar nav { display: grid; gap: .28rem; }
.sidebar nav a, .navlink { display: flex; align-items: center; gap: .65rem; color: #d9e8e1; border-radius: .55rem; padding: .67rem .85rem; font-size: .95rem; text-decoration: none; }
.sidebar nav a:hover, .navlink:hover { background: #24454a; }
.sidebar [aria-current="page"], .sidebar .active { color: #acffdf; background: #244a47; box-shadow: inset 3px 0 #83e5c6; }
.sidebar small, .sidebar .muted { color: #b3d1c8; }
.sidebar form:last-child { margin-top: auto; }
.sidebar button { border-color: #517271; background: transparent; color: #ecfaf5; }
.content { width: 100%; max-width: 1600px; padding: clamp(1.25rem, 3.7vw, 4rem); margin-inline: auto; }
.topbar, .actions { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.topbar { margin-bottom: 1.7rem; }
.actions { justify-content: flex-start; }
.cards, .cols { display: grid; gap: 1rem; margin: 1.25rem 0; }
.cards { grid-template-columns: repeat(auto-fit, minmax(min(150px,100%), 1fr)); }
.cols { grid-template-columns: repeat(2, minmax(0,1fr)); }
.metric, .panel, .auth-card { border: 1px solid var(--line); background: var(--surface); border-radius: 1rem; box-shadow: 0 3px 12px #17352b05; }
.panel { padding: clamp(1.1rem, 2vw, 1.65rem); margin-block: 1rem; }
.cols > .panel { margin: 0; }
.metric { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .35rem; padding: 1.2rem; border-top: 3px solid #86bcaa; }
.metric:nth-child(2) { border-top-color: #5990a3; }
.metric:nth-child(3) { border-top-color: #c28b58; }
.metric:nth-child(4) { border-top-color: #9c8caf; }
.metric strong { display: block; font-size: clamp(1.85rem, 3vw, 2.7rem); line-height: 1.1; font-weight: 650; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.metric span { font-size: .91rem; color: var(--muted); }
.chart-row { display: grid; grid-template-columns: minmax(4.8rem, 1fr) minmax(3rem, 3fr) auto; align-items: center; gap: .65rem; margin: .85rem 0; font-variant-numeric: tabular-nums; }
meter { min-width: 0; width: 100%; height: .85rem; border: 0; background: transparent; }
meter::-webkit-meter-bar { background: #e9eee7; border: 0; border-radius: 1rem; }
meter::-webkit-meter-optimum-value { border-radius: 1rem; background: linear-gradient(90deg, #23695f, #70bd9e); }
meter::-moz-meter-bar { border-radius: 1rem; background: #388571; }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; text-align: left; }
th, td { padding: .82rem .65rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 600; color: var(--muted); background: #f2f5f0; font-size: .8rem; }
tbody tr:hover { background: #f7faf5; }
.pill { display: inline-flex; white-space: nowrap; align-items: center; border: 1px solid #c6ded0; border-radius: 99px; padding: .16rem .65rem; background: #e6f3e9; color: #205e46; font-size: .8rem; font-weight: 600; }
.pill.revoked, .pill.expired { color: #873b2f; background: #f9ece5; border-color: #ebcfc2; }
.pill.unused { color: #495e73; background: #ecf0f5; border-color: #d1dce6; }
.notice { padding: .85rem 1rem; margin: 1rem 0; border: 1px solid #b9dacc; border-left: 4px solid #418c72; border-radius: .65rem; background: #e9f4ed; color: #174a3f; overflow-wrap: anywhere; }
form { display: grid; gap: .85rem; align-content: start; }
label { display: grid; gap: .32rem; color: #334c4a; font-size: .9rem; font-weight: 600; }
label:has(input[type=checkbox]) { display: flex; align-items: center; }
input, select, textarea, button { max-width: 100%; font: inherit; }
input, select, textarea { width: 100%; min-height: 2.7rem; padding: .53rem .75rem; color: var(--ink); border: 1px solid #b8c9c1; background: #fff; border-radius: .48rem; }
input[type=checkbox], input[type=radio] { width: 1rem; min-height: 0; height: 1rem; accent-color: var(--teal); }
button, a.button { width: fit-content; min-height: 2.55rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #10564f; border-radius: .55rem; padding: .52rem 1rem; font-weight: 600; color: #fff; background: var(--teal); cursor: pointer; text-decoration: none; }
button:hover, a.button:hover { filter: brightness(.93); }
button.danger, .danger button { background: #923d33; border-color: #923d33; }
a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, button:focus-visible { outline: 3px solid #259f99; outline-offset: 3px; }
details { border-top: 1px solid var(--line); padding-block: .75rem; }
summary { cursor: pointer; font-weight: 600; color: var(--teal); }
details[open] > summary { margin-bottom: 1rem; }
.auth { min-height: 100vh; display: grid; align-content: center; justify-items: center; padding: 2rem 1rem; background-color: var(--navy); background-image: radial-gradient(ellipse at 20% 10%,#245349 0,transparent 45%), repeating-linear-gradient(135deg,transparent 0 23px,#a7dfc709 24px 25px,transparent 26px 48px); }
.auth-card { width: min(100%, 38rem); padding: clamp(1.4rem, 4vw, 3rem); }
.auth-card h1 { font-size: clamp(1.8rem, 4vw, 2.45rem); margin: 1rem 0; }
.auth-card form { margin-block: 1.1rem; }
.auth-card button { margin-top: .4rem; }
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0,1fr); }
  .sidebar { padding: 1rem; gap: .8rem; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: .18rem; }
  .sidebar .navlink, .sidebar nav a { padding: .4rem .65rem; }
  .sidebar form:last-child { margin-top: 0; }
  .cols { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 480px) {
  .cards { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem; }
  .metric, .panel { padding: .9rem; }
  .brand { font-size: 1rem; }
  .chart-row { font-size: .88rem; }
}
