/* Outshined RMM — outshined.io look: charcoal, mint, Archivo + Red Hat Display. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Display";
  src: url("../fonts/red-hat-display.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --bg: #151515;
  --surface: #1c1c1c;
  --surface-2: #242424;
  --border: #303030;
  --text: #f3f3f1;
  --muted: #a4a4a0;
  --mint: #43ffae;
  --mint-text: #43ffae;
  --on-mint: #121212;
  --danger: #ff6b6b;
  --danger-bg: rgba(255, 107, 107, 0.12);
  --warn: #ffc857;
  --warn-bg: rgba(255, 200, 87, 0.12);
  --ok-bg: rgba(67, 255, 174, 0.12);
  --info: #8ab4ff;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f6f3;
    --surface: #ffffff;
    --surface-2: #f0f0ec;
    --border: #e1e1dc;
    --text: #151515;
    --muted: #5d5d58;
    --mint-text: #0a7f4f;
    --danger: #c62828;
    --danger-bg: rgba(198, 40, 40, 0.09);
    --warn: #9a6200;
    --warn-bg: rgba(255, 176, 32, 0.16);
    --ok-bg: rgba(10, 127, 79, 0.1);
    --info: #2457c5;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f0f0ec;
  --border: #e1e1dc;
  --text: #151515;
  --muted: #5d5d58;
  --mint-text: #0a7f4f;
  --danger: #c62828;
  --danger-bg: rgba(198, 40, 40, 0.09);
  --warn: #9a6200;
  --warn-bg: rgba(255, 176, 32, 0.16);
  --ok-bg: rgba(10, 127, 79, 0.1);
  --info: #2457c5;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Red Hat Display", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand { font-family: "Archivo", system-ui, sans-serif; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; font-weight: 800; margin: 0 0 0.25rem; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 2rem 0 0.75rem; }
h3 { font-size: 1rem; font-weight: 700; margin: 1rem 0 0.5rem; }
a { color: var(--mint-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.86em; }
pre { white-space: pre-wrap; word-break: break-word; margin: 0; }

/* Header */
.topbar {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: 0.9rem 1.5rem; border-bottom: 1px solid var(--border); background: var(--bg);
}
.brand { font-weight: 800; font-size: 1.25rem; color: var(--text); white-space: nowrap; }
.brand .accent { color: var(--mint-text); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 0.25rem; flex-wrap: wrap; flex: 1; }
.nav a {
  color: var(--muted); padding: 0.35rem 0.75rem; border-radius: 999px;
  font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.nav a:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.nav a.active { color: var(--on-mint); background: var(--mint); }
.who { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.85rem; }
.who form { margin: 0; }

main { max-width: 1240px; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }
.eyebrow { color: var(--mint-text); font-family: "Archivo", sans-serif; font-weight: 700; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 0.3rem; }
.lede { color: var(--muted); margin: 0 0 1.5rem; max-width: 70ch; }

/* Buttons and pills */
.btn, button {
  display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer;
  font: 700 0.85rem "Red Hat Display", sans-serif; padding: 0.5rem 1.05rem; border-radius: 999px;
  border: 1px solid var(--mint); background: var(--mint); color: var(--on-mint);
}
.btn:hover, button:hover { filter: brightness(1.06); text-decoration: none; }
.btn-ghost, button.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover, button.ghost:hover { border-color: var(--muted); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button.small, .btn.small { padding: 0.25rem 0.7rem; font-size: 0.78rem; }
.inline { display: inline; margin: 0; }

.pill {
  display: inline-block; padding: 0.12rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap; text-transform: lowercase;
}
.pill.ok, .pill.online { color: var(--mint-text); border-color: transparent; background: var(--ok-bg); }
.pill.warning { color: var(--warn); border-color: transparent; background: var(--warn-bg); }
.pill.error, .pill.offline { color: var(--danger); border-color: transparent; background: var(--danger-bg); }
.pill.info { color: var(--info); }
.pill.revoked { text-decoration: line-through; }

/* Cards, stats, tables */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.9rem; margin: 1.25rem 0 0.5rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.stat .n { font-family: "Archivo", sans-serif; font-size: 2rem; font-weight: 800; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.stat.bad .n { color: var(--danger); }
.stat.good .n { color: var(--mint-text); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.empty { color: var(--muted); padding: 1.25rem; text-align: center; }
.output { max-width: 46ch; color: var(--muted); }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 0.85rem; }
dl.kv dd { margin: 0; word-break: break-word; }

/* Forms */
form.stack { display: grid; gap: 0.8rem; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem; }
label { display: grid; gap: 0.3rem; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 0.5rem; color: var(--text); font-weight: 500; }
input, select, textarea {
  font: 0.95rem "Red Hat Display", sans-serif; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px; padding: 0.55rem 0.7rem; width: 100%;
}
textarea { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; min-height: 4.5rem; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--mint); outline-offset: 1px;
}
input[type="checkbox"] { width: auto; accent-color: var(--mint); }

.flash, .error-box { border-radius: 12px; padding: 0.75rem 1rem; margin: 0 0 1.25rem; font-weight: 600; }
.flash { background: var(--ok-bg); color: var(--mint-text); }
.error-box { background: var(--danger-bg); color: var(--danger); }

.token-box { border: 1px solid var(--mint); border-radius: 14px; padding: 1rem 1.25rem; margin: 0 0 1.5rem; background: var(--ok-bg); }
.token-box pre { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem; margin: 0.5rem 0; user-select: all; }

/* Login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth { width: 100%; max-width: 400px; }
.auth .brand { display: block; font-size: 1.6rem; margin-bottom: 1.5rem; text-align: center; }
.auth h1 { font-size: 1.5rem; }
.auth .card { padding: 1.5rem; }
.auth button { width: 100%; justify-content: center; padding: 0.7rem; font-size: 0.95rem; }
input.code { font-size: 1.6rem; letter-spacing: 0.4em; text-align: center; font-family: ui-monospace, Consolas, monospace; }

footer { color: var(--muted); font-size: 0.78rem; text-align: center; padding: 2rem 1rem; }
.theme-toggle { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 0.3rem 0.65rem; }

details summary { cursor: pointer; color: var(--muted); font-weight: 600; }

@media (max-width: 640px) {
  .topbar { padding: 0.75rem 1rem; gap: 0.75rem; }
  main { padding: 1.25rem 1rem 3rem; }
  h1 { font-size: 1.5rem; }
  .who span { display: none; }
}

.mt { margin-top: 1rem; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }

/* Docs */
.search { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.search input { flex: 1; min-width: 200px; }
.tags { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0 0 1.25rem; }
.tags a.pill.active { color: var(--on-mint); background: var(--mint); border-color: var(--mint); }
.doc-list { display: grid; gap: 0.75rem; }
.doc-list .card h3 { margin: 0 0 0.25rem; }
.doc-row { padding: 0.35rem 0; border-bottom: 1px solid var(--border); }
.doc-row:last-of-type { border-bottom: 0; }
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .doc-layout { grid-template-columns: 1fr; } }
textarea.editor { min-height: 28rem; line-height: 1.5; }
select[multiple] { min-height: 9rem; }

.prose { line-height: 1.65; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: 1.6rem; margin: 1.5rem 0 0.5rem; }
.prose h2 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; }
.prose h3 { font-size: 1.05rem; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose table, .prose pre { margin: 0 0 1rem; }
.prose code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0.05rem 0.35rem; }
.prose pre { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 0.85rem 1rem; overflow-x: auto; white-space: pre; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose blockquote { border-left: 3px solid var(--mint); padding: 0.1rem 0 0.1rem 1rem; color: var(--muted); }
.prose table { border: 1px solid var(--border); border-radius: 10px; display: block; overflow-x: auto; }
.prose img { max-width: 100%; }
.prose ul.contains-task-list { list-style: none; padding-left: 0.5rem; }
.warn-box { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 0.75rem 1rem; margin: 0 0 1.25rem; font-weight: 600; }
