/* Domain Review Dashboard
   Colours come from the validated reference palette. Status colours are the
   fixed four (good / warning / serious / critical) and are always shown with
   an icon and the status text, never colour alone. */

:root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --page: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --gridline: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);

  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;

  --accent: #2a78d6;
  --accent-soft: #cde2fb;
  --success-text: #006300;

  --radius: 10px;
  --gap: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --page: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --gridline: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --accent-soft: #184f95;
    --success-text: #0ca30c;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1a1a19;
  --page: #0d0d0d;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --gridline: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #3987e5;
  --accent-soft: #184f95;
  --success-text: #0ca30c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--accent); }

/* --- layout ------------------------------------------------------------ */

header.bar {
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { font-weight: 600; letter-spacing: -0.01em; }

nav { display: flex; gap: 4px; flex-wrap: wrap; }

nav a {
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
}
nav a:hover { background: var(--gridline); }
nav a[aria-current="page"] { background: var(--accent); color: #fff; }

.bar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-muted); }

main { padding: 24px 20px 64px; max-width: 1240px; margin: 0 auto; }

h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 32px 0 12px; }
.sub { color: var(--text-secondary); margin: 0 0 24px; font-size: 14px; }

/* --- stat tiles -------------------------------------------------------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--gap);
  margin-bottom: 28px;
}

.tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.tile .label { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.tile .value { font-size: 30px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.tile .note { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* Exactly one hero figure per view. */
.tile.hero .value { font-size: 52px; }
.tile.hero { border-color: var(--accent); }

.tile.is-critical .value { color: var(--critical); }
.tile.is-good .value { color: var(--success-text); }
.tile.is-warning .value { color: var(--text-primary); }

/* --- cards & tables ---------------------------------------------------- */

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--gridline);
  white-space: nowrap;
}

td { padding: 12px 14px; border-bottom: 1px solid var(--gridline); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }

td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.domain-cell { font-weight: 500; }
.domain-cell a { text-decoration: none; }
.domain-cell a:hover { text-decoration: underline; }
.meta { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* --- status badges ----------------------------------------------------- */
/* Icon + text always present: the colour is a reinforcement, not the message. */

.badges { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  border: 1px solid var(--border);
  background: var(--surface-1);
  white-space: nowrap;
}

.badge .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.badge .isp { color: var(--text-muted); font-size: 11px; }
.badge .txt { color: var(--text-primary); font-variant-numeric: tabular-nums; }

.badge.good .dot { background: var(--good); }
.badge.critical .dot { background: var(--critical); }
.badge.warning .dot { background: var(--warning); }
.badge.serious .dot { background: var(--serious); }
.badge.none .dot { background: var(--baseline); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
}
.pill.good { color: var(--success-text); }
.pill.critical { color: var(--critical); }
.pill.warning { color: var(--text-primary); }
.pill.serious { color: var(--critical); }

/* --- bar rows (single hue: one measure, no categorical palette) --------- */

.barrow { display: grid; grid-template-columns: 110px 1fr 64px; align-items: center; gap: 12px; margin-bottom: 10px; }
.barrow .name { font-size: 13px; color: var(--text-secondary); }
.barrow .track { background: var(--gridline); border-radius: 4px; height: 14px; overflow: hidden; }
.barrow .fill { background: var(--accent); height: 100%; border-radius: 0 4px 4px 0; }
.barrow .val { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary); }

/* --- misc -------------------------------------------------------------- */

.notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  background: var(--surface-1);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
}
.notice.bad { border-left-color: var(--critical); }
.notice.good { border-left-color: var(--good); }

.btn {
  font: inherit;
  font-size: 14px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: var(--gridline); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }

.empty { padding: 40px 20px; text-align: center; color: var(--text-secondary); }
.empty .big { font-size: 15px; color: var(--text-primary); margin-bottom: 4px; }

.readonly-flag {
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px dashed var(--baseline);
  border-radius: 999px;
  padding: 3px 10px;
}

footer { color: var(--text-muted); font-size: 12px; padding: 24px 20px; text-align: center; }

@media (max-width: 640px) {
  .barrow { grid-template-columns: 84px 1fr 48px; }
  th, td { padding: 10px 10px; }
  .hide-sm { display: none; }
}
