/* Astora sites (app.astora.agency, spo.astora.agency): additions to styles.css, the 28 Nov stats dashboard sheet, served unchanged.
   Monochrome, Geist (sans-serif) only, solid 6 digit hex only, no glow: cards get a 1px line instead of the lit inset shadow.
   Color only for one thing: a green dot is online, a red dot is offline. Everything else (warnings, problems, flags) is monochrome
   text in a 1px outlined label. The stats page keeps its own look. */
:root {
  --on: #3DDC84;
  --off: #E1393E;
  --line: #1E1F22;
  --field: #0B0B0B;
}

/* Cards without glow on every page except the stats dashboard. */
body.site:not(.stats-page) .section { box-shadow: inset 0 0 0 1px var(--line); animation: none; }
body.site:not(.stats-page) .kpi { box-shadow: inset 0 0 0 1px var(--line); animation: none; }
body.site:not(.stats-page) .top h1 { animation: none; }
body.site .side-foot a { color: var(--muted); text-decoration: none; }
body.site .side-foot a:hover { color: var(--text); }
body.site .side-user form { margin: 0; }
body.site .side-user .btn { white-space: nowrap; }

/* Section links (Stats, Control panel, Staff, Creators), above the stats page's own links. */
.secnav { display: flex; flex-direction: column; gap: 1px; }
.secnav a {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; font-size: 13.5px; text-decoration: none; transition: color 0.2s ease, background-color 0.2s ease;
}
.secnav a:hover { color: var(--text); background: var(--hover); }
.secnav a.on { color: var(--text); background: var(--card); box-shadow: inset 0 0 0 1px var(--line2); }
.secnav .ico { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stats-page .secnav { padding-bottom: 12px; margin-bottom: 2px; border-bottom: 1px solid var(--border); }

/* Online and offline: the only colored marks. */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--faint); flex: 0 0 auto; }
.dot.on { background: var(--on); }
.dot.off { background: var(--off); }
/* Everything that needs a look: a monochrome outlined label. */
.flag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin-right: 6px; border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--text); background: var(--raise); box-shadow: inset 0 0 0 1px var(--text2); white-space: nowrap; vertical-align: 1px; }
.ok-line { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* Loading, empty and error states. */
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; padding: 28px 4px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line2); border-top-color: var(--text2); animation: spin 0.9s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.empty-action { margin-top: 12px; }

/* Forms. */
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack label, .form-grid label { font-size: 13px; color: var(--text2); font-weight: 500; }
.site input:not([type=radio]):not([type=checkbox]), .site select, .site textarea {
  background: var(--field); border: 1px solid var(--line2); border-radius: 11px; padding: 9px 12px; font-size: 15px; color: var(--text); width: 100%;
  color-scheme: dark;
}
.site textarea { min-height: 84px; resize: vertical; font: inherit; }
.site input:focus, .site select:focus, .site textarea:focus { outline: 2px solid var(--text2); outline-offset: 0; border-color: var(--text2); }
.form-grid { max-width: 560px; }
fieldset.field-row { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 14px; margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
fieldset.field-row legend { color: var(--muted); font-size: 12.5px; padding: 0 6px; }
.radio, .check { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; color: var(--text) !important; font-size: 14px !important; }
.indent { padding-left: 26px; display: flex; flex-direction: column; gap: 6px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; }
.actions-row form { margin: 0; }
.actions-row .muted { align-self: center; font-size: 12.5px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 12.5px; color: var(--muted); }
.field small { color: var(--faint); font-size: 11.5px; }
.field[hidden] { display: none; }
.site input.w-short { max-width: 90px; }
.site .actions-row select, .site .actions-row input { width: auto; flex: 0 1 auto; }
.login-ok { margin: 0; color: var(--text2); font-size: 14.5px; }
.login-card .stack .btn { margin-top: 8px; font-size: 14px; height: 42px; }
.form-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 12px; align-items: end; }
.form-inline > div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-inline label { font-size: 12.5px; color: var(--muted); }
.msg { min-height: 20px; margin: 8px 0 0; font-size: 13px; color: var(--text2); }
.msg.err { color: var(--text); font-weight: 600; }

/* Hub: apps. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); }
.app-tile { display: flex; flex-direction: column; gap: 4px; text-decoration: none; min-height: 140px; transition: background-color 0.2s ease; }
.app-tile:hover { background: var(--raise); }
.app-tile h2 { font-size: 18px !important; color: var(--text) !important; }
.app-group { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.group-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.group-head .tag { margin-top: 0; }
.group-head a { margin-left: auto; font-size: 12.5px; text-decoration: none; }
.tile-ico { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 10px; background: var(--raise); box-shadow: inset 0 0 0 1px var(--line2); color: var(--text2); margin-bottom: 8px; }
.tile-ico .ico { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-account { color: var(--text2); text-decoration: none; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-account:hover { color: var(--text); }
.tag { display: inline-flex; align-self: flex-start; margin-top: auto; height: 24px; align-items: center; padding: 0 10px; border-radius: 999px; background: var(--raise); color: var(--text2); font-size: 12px; box-shadow: inset 0 0 0 1px var(--line2); }
.notice { border: 1px solid var(--line2); }
table.audit td:last-child { white-space: normal; max-width: 360px; overflow-wrap: anywhere; font-size: 12.5px; }

/* Control panel. */
.banner .muted { margin-left: auto; font-size: 13px; font-weight: 400; }
.srv .card-head h2 { display: flex; align-items: center; }
.srv .card-head .muted { font-size: 12.5px; text-align: right; }
.warn-list { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--text2); }
.warn-list li { padding: 5px 0; }
.quick { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.toggle-list { display: flex; flex-direction: column; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row small { display: block; color: var(--faint); font-size: 11.5px; margin-top: 2px; }
.switch { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 0; border-radius: 10px; cursor: pointer; font: inherit; font-size: 12.5px;
  background: var(--field); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line2); }
.switch .switch-name { color: var(--muted); }
.switch .switch-state { min-width: 26px; text-align: left; }
.switch[aria-checked="true"] { background: var(--text); color: var(--on-accent); box-shadow: none; }
.switch[aria-checked="true"] .switch-name { color: var(--on-accent); }
.switch[disabled] { cursor: default; opacity: 0.6; }
.console { height: 340px; overflow: auto; margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line2);
  font-size: 12px; line-height: 1.55; font-variant-numeric: tabular-nums; }
.console .cl { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.console .cl-strong { color: var(--text); font-weight: 600; }
.console-cmd { margin-top: 4px; }
.err-card h3 { margin: 0 0 6px; font-size: 13px; color: var(--text); }
.errors small { display: block; color: var(--faint); font-size: 11px; }
.errors li { margin-bottom: 6px; overflow-wrap: anywhere; }
td.wrap { text-align: left; white-space: normal; overflow-wrap: anywhere; max-width: 380px; }

/* The two step confirm. */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--page); }
.sheet-card { width: 100%; max-width: 420px; padding: 22px; border-radius: var(--radius); background: var(--card); box-shadow: inset 0 0 0 1px var(--line2); display: flex; flex-direction: column; gap: 10px; }
.sheet-card h2 { margin: 0; font-size: 17px; color: var(--text); }
.sheet-card .confirm-code { margin: 4px 0; font-size: 34px; }
.site input.code-input { font-size: 22px; letter-spacing: 0.2em; }
.banner { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); background: var(--card); font-weight: 500; font-size: 15px; }
.srv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--gap); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.rows li:last-child { border-bottom: 0; }
.rows .name { color: var(--muted); display: flex; align-items: center; min-width: 0; }
.rows .value { text-align: right; overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; gap: 0; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--raise); color: var(--text2); margin-left: 10px; letter-spacing: 0.02em; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.card-head h2 { margin: 0 !important; font-size: 15px !important; color: var(--text) !important; }
.sub { color: var(--muted); font-size: 12px; margin: 14px 0 4px; }
.errors { margin: 0; padding-left: 18px; color: var(--text2); font-size: 12.5px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 12px; }
.confirm-code { font-size: 22px; font-weight: 600; letter-spacing: 0.12em; }

/* Staff and creators. */
.staff-table td, .staff-table th { white-space: nowrap; }
.staff-table tr.muted td { color: var(--faint); }
.person-link { display: inline-flex; align-items: center; color: var(--text); font-weight: 500; }
.back { color: var(--muted); text-decoration: none; font-size: 13px; }
.back::before { content: "< "; }
.back:hover { color: var(--text); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; overflow-wrap: anywhere; }
.timeline small { display: block; color: var(--faint); font-size: 11.5px; }
.addr { color: var(--text2); font-size: 13px; }
.addr-big { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); margin: 2px 0 4px; overflow-wrap: anywhere; }
.cmd { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.cmd code { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 9px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line2); font: inherit; font-size: 13px; overflow-wrap: anywhere; }
.notes { list-style: none; margin: 8px 0 0; padding: 0; }
.notes li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.notes li small { display: block; color: var(--faint); font-size: 11.5px; margin-bottom: 2px; }
.staff-card .kv td { height: 34px; }
.person-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.person-head h2 { font-size: 16px !important; color: var(--text) !important; margin: 0 !important; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 10px; border-bottom: 1px solid var(--line2); }
.bars .b { flex: 1; min-width: 2px; background: var(--text2); border-radius: 3px 3px 0 0; }
.bars .b.zero { background: var(--line2); height: 2px !important; }
.bars-axis { display: flex; justify-content: space-between; color: var(--faint); font-size: 11.5px; margin-top: 6px; }
.seg-small { display: inline-flex; gap: 2px; padding: 3px; border-radius: 13px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.seg-small button { border: 0; background: transparent; color: var(--muted); border-radius: 10px; height: 30px; padding: 0 12px; cursor: pointer; font-size: 12.5px; font-weight: 500; }
.seg-small button[aria-pressed="true"] { background: var(--sel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.list-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.list-pick button { border: 0; height: 32px; padding: 0 12px; border-radius: 10px; background: var(--raise); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; font-size: 13px; }
.list-pick button[aria-pressed="true"] { color: var(--text); box-shadow: inset 0 0 0 1px var(--text2); }

/* Tablet: the sidebar stays, a little narrower. */
@media (min-width: 861px) and (max-width: 1099px) {
  :root { --side: 210px; }
}

/* Phone: the sidebar becomes a top bar; the section links get their own scrolling row. */
@media (max-width: 860px) {
  .side { flex-wrap: wrap; row-gap: 8px; }
  .secnav { order: 5; flex-direction: row; overflow-x: auto; width: 100%; gap: 4px; scrollbar-width: none; }
  .secnav a { white-space: nowrap; height: 34px; font-size: 13px; }
  .stats-page .secnav { border-bottom: 0; padding-bottom: 0; margin: 0; }
  .side-user { margin-left: auto; }
  .side-foot { display: none; }
  .copy-row { flex-direction: column; }
  .form-inline { grid-template-columns: minmax(0, 1fr); }
  .bars { height: 120px; gap: 2px; }
  .toggle-row { flex-direction: column; align-items: flex-start; }
  .banner { flex-wrap: wrap; }
  .banner .muted { margin-left: 0; width: 100%; }
  .group-head a { margin-left: 0; }
  .console { height: 280px; }
  .sheet-card .confirm-code { font-size: 30px; }
}

/* The sign-out block sits at the bottom of the sidebar on every page, also without a side-foot above it. */
@media (min-width: 861px) { body.site .side > .side-user { margin-top: auto; } body.site .side > .side-foot + .side-user { margin-top: 0; } }
