/* Acumino brand (www.acumino.ai): Poppins and JetBrains Mono, sage green on graphite, steel and caution accents.
   Fonts are self-hosted (SIL Open Font License, see fonts/*-OFL.txt) so the console needs nothing from other origins. */
@font-face { font-family: Poppins; font-weight: 400; font-display: swap; src: url(/fonts/Poppins-400.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 500; font-display: swap; src: url(/fonts/Poppins-500.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 600; font-display: swap; src: url(/fonts/Poppins-600.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 700; font-display: swap; src: url(/fonts/Poppins-700.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400 600; font-display: swap; src: url(/fonts/JetBrainsMono.woff2) format("woff2"); }

:root {
  --bg: hsl(60 10% 96%);
  --chrome: hsl(60 8% 94%);
  --panel: #ffffff;
  --panel-2: hsl(60 7% 92%);
  --border: hsl(60 5% 85%);
  --text: hsl(0 0% 8%);
  --muted: hsl(0 0% 43%);
  --accent: hsl(78 32% 33%);
  --accent-text: #ffffff;
  --accent-soft: hsl(78 32% 33% / .12);
  --steel: hsl(202 22% 40%);
  --ok: hsl(78 32% 30%);
  --ok-bg: hsl(78 32% 33% / .13);
  --warn: hsl(32 55% 36%);
  --warn-bg: hsl(32 55% 42% / .14);
  --bad: hsl(0 72% 45%);
  --bad-bg: hsl(0 72% 48% / .1);
  --grid: hsl(0 0% 8% / .045);
  --radius: 8px;
  --sans: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: hsl(0 0% 8%);
    --chrome: hsl(0 0% 6%);
    --panel: hsl(0 1% 14%);
    --panel-2: hsl(0 0% 17%);
    --border: hsl(0 0% 20%);
    --text: hsl(0 0% 95%);
    --muted: hsl(0 0% 58%);
    --accent: hsl(78 32% 62%);
    --accent-text: hsl(0 0% 8%);
    --accent-soft: hsl(78 32% 62% / .14);
    --steel: hsl(202 22% 64%);
    --ok: hsl(78 32% 66%);
    --ok-bg: hsl(78 32% 62% / .14);
    --warn: hsl(32 55% 66%);
    --warn-bg: hsl(32 55% 64% / .14);
    --bad: hsl(0 84% 70%);
    --bad-bg: hsl(0 84% 60% / .14);
    --grid: hsl(0 0% 100% / .035);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.boot { padding: 40px; color: var(--muted); }
[hidden] { display: none !important; }

/* Layout */
.shell { display: grid; grid-template-columns: 240px 1fr; grid-template-rows: 56px 1fr; height: 100vh; }
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--chrome); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* The wordmark is a mask, so it takes the text color in both themes. */
.brand .logo {
  width: 128px; height: 18px; flex: none; background: currentColor;
  -webkit-mask: url(/acumino-logo.svg) no-repeat left center / contain; mask: url(/acumino-logo.svg) no-repeat left center / contain;
}
.brand .product {
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); padding-left: 10px; border-left: 1px solid var(--border); line-height: 18px;
}
.brand small { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-left: 4px; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.sidebar { background: var(--chrome); border-right: 1px solid var(--border); padding: 16px 12px; overflow-y: auto; }
.sidebar h3 { font-family: var(--mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 18px 10px 6px; }
.sidebar select { width: 100%; }
.nav button {
  display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px;
  border-radius: 6px; cursor: pointer; color: var(--text);
}
.nav button:hover { background: var(--panel-2); }
.nav button.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
main { overflow-y: auto; padding: 24px 28px 60px; }
h1, h2 { letter-spacing: -.02em; }
main h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.subtitle { color: var(--muted); margin: 0 0 20px; }
.toolbar { display: flex; gap: 8px; align-items: center; margin: 0 0 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

/* Controls */
input, select, textarea {
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; min-width: 0;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { border: 1px solid var(--border); background: var(--panel); border-radius: 6px; padding: 6px 12px; cursor: pointer; font-weight: 500; }
button:hover { background: var(--panel-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.primary:hover { background: var(--accent); filter: brightness(1.08); }
button.danger { color: var(--bad); }
button.ghost { border-color: transparent; background: none; }
button.small { padding: 2px 8px; font-size: 12.5px; }
button:disabled { opacity: .5; cursor: default; }

/* Tables and cards */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-family: var(--mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--panel-2); }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 14px 16px; }
.stat .label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.section-title { font-size: 16px; font-weight: 600; margin: 28px 0 10px; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--steel); background: var(--panel-2); border: 1px solid var(--border); }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); font-size: 12.5px; }
.chip button { border: 0; background: none; padding: 0 5px; color: var(--muted); }
.chip.plain { padding-right: 9px; }
.muted { color: var(--muted); }

/* Login */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  /* The faint engineering grid from acumino.ai. */
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
}
.login .card { width: 100%; max-width: 380px; padding: 30px 28px; box-shadow: 0 24px 60px rgb(0 0 0 / .12); }
.login .brand .logo { width: 150px; height: 21px; }
.login h1 { font-size: 26px; font-weight: 700; margin: 22px 0 4px; }
.login form { display: grid; gap: 12px; margin-top: 18px; }

/* Forms and dialogs */
label.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
label.field span { font-size: 12.5px; color: var(--muted); }
label.field small { color: var(--muted); }
dialog {
  border: 1px solid var(--border); border-radius: 12px; padding: 0; width: min(480px, calc(100vw - 32px));
  background: var(--panel); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / .25);
}
dialog::backdrop { background: rgb(8 8 8 / .55); }
dialog form, dialog .body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 22px; }
dialog .body .body { padding: 0; }
dialog h2 { font-size: 19px; font-weight: 700; margin: 0 0 2px; }
dialog h3 { font-family: var(--mono); font-size: 11px; font-weight: 500; margin: 8px 0 0; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
dialog p { margin: 0; }
dialog .toolbar { margin: 0; }
.qr { justify-self: center; max-width: 100%; padding: 8px; background: #fff; border-radius: 8px; line-height: 0; }
.qr svg { max-width: 100%; height: auto; }
pre.codes {
  margin: 0; padding: 12px 14px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 14px; line-height: 1.7; columns: 2; user-select: all;
}
a { color: var(--accent); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.error { color: var(--bad); margin: 0; }
.notice { padding: 10px 12px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); }
.reveal { display: flex; gap: 8px; }
.reveal input { flex: 1; min-width: 0; font-family: var(--mono); }
pre.meta { margin: 0; min-width: 240px; max-width: 440px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.card:has(> table) { overflow-x: auto; }
.toast {
  position: fixed; bottom: 20px; right: 20px; background: var(--text); color: var(--bg); padding: 10px 14px;
  border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / .2);
}

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; height: auto; min-height: 100vh; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; row-gap: 8px; }
  .topbar .spacer { display: none; }
  .topbar > span.muted { flex-basis: 100%; order: 10; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  main { padding: 18px 16px 48px; }
  .card { overflow-x: auto; }
  .brand small { display: none; }
  .brand .logo { width: 112px; height: 16px; }
}
