/* Managed by Terraform (files/status.css), deployed as /assets/theme.css — the ONE shared theme
   of the web UI: /status/, /stats/, the mirror directory listings (banner) and, via
   files/goaccess.css, the GoAccess dashboards /stats/<vhost>/.
   Theme from the oiv.ae logo drafts (webui/oiv.ae Logo Drafts.html), variant g01-l4
   "honey gold on black": logo and text in honey gold #E0B44C on black #000000, one dark
   theme for every visitor. Status colours stay functional. Fonts are not downloaded (CSP):
   IBM Plex / Inter / Roboto are used when installed locally, otherwise the system font. */
:root {
  --bg: #000000; --panel: #0d0b06; --fg: #e0b44c; --muted: #a8894a; --line: #2e2612;
  --accent: #e0b44c; --accent-bg: #2a200a; --ink: #e0b44c;
  --ok: #5fd39b; --ok-bg: #0f2a1d; --run: #7fb0ff; --run-bg: #13213a;
  --warn: #ff9a3c; --warn-bg: #3a1f08; --bad: #ff8a80; --bad-bg: #3a1614; --new: #a8894a; --new-bg: #1c170b;
  --radius: 10px;
  --mono: "IBM Plex Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 "IBM Plex Sans", Inter, Roboto, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code, pre { font-family: var(--mono); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; min-width: 0; text-decoration: none; }
.wordmark { height: 34px; width: auto; max-width: 100%; display: block; }  /* <img src=/assets/logo.svg>; the SVG carries its own gold */
.tag { color: var(--muted); font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 520px) { .wordmark { height: auto; width: 100%; } }
.overall { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--new-bg); color: var(--new); font-weight: 600; }
.overall .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.overall.ok { background: var(--ok-bg); color: var(--ok); }
.overall.warn { background: var(--warn-bg); color: var(--warn); }
.overall.bad { background: var(--bad-bg); color: var(--bad); }

.intro { color: var(--muted); margin: 20px 0; max-width: 70ch; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile .k { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.tile .v { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .s { color: var(--muted); font-size: .85rem; }
.meter { display: block; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.meter span { display: block; height: 100%; width: 0; background: var(--ok); }
.meter span.warn { background: var(--warn); }
.meter span.bad { background: var(--bad); }

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.controls input { flex: 1 1 220px; min-width: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--fg); font: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font: inherit; font-size: .9rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); cursor: pointer; }
.chips button.on { background: var(--accent); color: var(--panel); border-color: var(--accent); }

.group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.group h2 { margin: 0; padding: 12px 16px; font-size: 1rem; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line); }
.group h2 small { color: var(--muted); font-weight: 400; }
/* Project blocks are <details> (collapsible, like a spoiler); chevron as in .howto */
details.group > summary { display: block; list-style: none; cursor: pointer; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary h2 { justify-content: flex-start; align-items: center; }
details.group > summary h2::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); transition: transform .15s; flex: none; }
details.group[open] > summary h2::before { transform: rotate(45deg); }
details.group > summary h2 small { margin-left: auto; text-align: right; }
details.group > summary:hover h2 { background: var(--accent-bg); }
details.group:not([open]) > summary h2 { border-bottom: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.repo { font-weight: 600; word-break: break-word; }
.path { display: block; font-size: .85rem; word-break: break-all; }
.sub { display: block; color: var(--muted); font-size: .82rem; }
.age { display: block; height: 4px; background: var(--line); border-radius: 2px; margin-top: 6px; max-width: 160px; overflow: hidden; }
.age span { display: block; height: 100%; width: 0; background: var(--ok); }
.age span.warn { background: var(--warn); }
.age span.bad { background: var(--bad); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.run { background: var(--run-bg); color: var(--run); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.stale { background: var(--bad-bg); color: var(--bad); }
.badge.new { background: var(--new-bg); color: var(--new); }

.empty, .error { padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.error { color: var(--bad); border-color: var(--bad); }

.legend { margin: 28px 0 8px; }
.legend h2 { font-size: 1rem; }
.legend dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0; }
.legend dd { margin: 0; color: var(--muted); }

.foot { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); font-size: .85rem; padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--line); margin-top: 28px; }
.foot .disclaimer { flex-basis: 100%; }
.intro.sub { margin-top: -8px; }

/* Content sections from the oiv.ae docs: use the mirror, acceptable use, get involved */
.docs { margin: 28px 0 8px; max-width: 900px; }
.docs h2 { font-size: 1.15rem; margin: 0 0 8px; }
.docs h3 { font-size: .95rem; margin: 18px 0 6px; }
.docs p, .docs li { color: var(--muted); max-width: 80ch; }
.docs li { margin: 4px 0; }
.docs code { font-size: .88em; }
.docs :not(pre) > code, .intro code { background: var(--accent-bg); color: var(--fg); padding: 1px 5px; border-radius: 4px; }
.scroll { overflow-x: auto; margin: 12px 0 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table.plain td { word-break: normal; }
table.plain .sub { margin-top: 2px; }
table.plain a { text-decoration: none; }
table.plain a:hover code { text-decoration: underline; }
.howto { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.howto > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 10px; }
.howto > summary::-webkit-details-marker { display: none; }
.howto > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); transition: transform .15s; flex: none; }
.howto[open] > summary::before { transform: rotate(45deg); }
.howto[open] > summary { border-bottom: 1px solid var(--line); }
.howto > :not(summary) { margin-left: 16px; margin-right: 16px; }
.howto > :last-child { margin-bottom: 16px; }
.howto ol { padding-left: 20px; }
pre.cmd { position: relative; margin: 8px 0 12px; padding: 12px 14px; padding-right: 72px; background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; overflow-x: auto; font-size: .85rem; line-height: 1.5; color: var(--fg); }
.copy { position: absolute; top: 6px; right: 6px; font: inherit; font-family: var(--mono); font-size: .72rem; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--muted); cursor: pointer; }
.copy:hover { color: var(--accent); border-color: var(--accent); }
.note { border-left: 3px solid var(--warn); background: var(--warn-bg); padding: 8px 12px; border-radius: 0 6px 6px 0; color: var(--fg) !important; }
@media (prefers-reduced-motion: reduce) { .howto > summary::before, details.group > summary h2::before { transition: none; } }

/* Phones: rows become cards */
@media (max-width: 760px) {
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  tr:last-child { border-bottom: 0; }
  td { border: 0; padding: 3px 0; }
  td[data-l]::before { content: attr(data-l); display: inline-block; min-width: 110px; color: var(--muted); font-size: .8rem; }
  td.num { white-space: normal; }
  .legend dl { grid-template-columns: 1fr; }
}

/* Admin overview (/stats/) — reuses this stylesheet, logo and favicon */
.nav { display: flex; flex-wrap: wrap; gap: 6px; font-size: .9rem; }
.nav a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); text-decoration: none; }
.nav a:hover { border-color: var(--accent); }
.h1 { font-size: 1.15rem; margin: 28px 0 0; }
.h1 + .intro { margin-top: 6px; }
.dash { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 0; margin: 0 0 8px; list-style: none; }
.dash a { display: block; padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--panel); color: var(--fg); text-decoration: none; min-width: 0; }
.dash a:hover { border-color: var(--accent); }
.dash .sub { font-family: var(--mono); word-break: break-all; }
.tile.what { border-color: var(--accent); background: var(--accent-bg); }
.fit-ok { color: var(--ok); font-weight: 600; }
.fit-bad { color: var(--bad); font-weight: 600; }
td input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.foot code { font-size: .9em; }

/* Mirror directory listings (nginx autoindex): banner from templates/mirror-header.html.tftpl
   is prepended by add_before_body; the listing itself is bare <h1>, <hr>, <pre>. */
body > h1, body > hr, body > pre { margin-left: 16px; margin-right: 16px; }
body > h1 { font-size: 1.3rem; }
body > hr { border: 0; border-top: 1px solid var(--line); }
body > pre { font-family: var(--mono); font-size: .85rem; overflow-x: auto; }
.oiv-banner { margin: 0 0 16px; padding: 16px; background: var(--panel); border-bottom: 1px solid var(--line); color: var(--fg); font-size: .9rem; }
.oiv-banner pre { margin: 0 0 8px; color: var(--accent); font: min(13px, 2.2vw)/1 var(--mono); overflow: hidden; }
