:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5d6b7c;
  --border: #d7dce3;
  --accent: #1f5f99;
  --accent-text: #ffffff;
  --ok: #1d7a46;
  --warn: #8a5a00;
  --warn-bg: #fff6e0;
  --error: #a32020;
  --error-bg: #fdecec;
  --info-bg: #eaf2fb;
  --radius: 6px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}
.surface-admin { --accent: #5b3a8c; }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c; --surface: #1b2129; --text: #e6e9ee; --muted: #9aa6b5; --border: #313a46;
    --accent: #6ea8de; --accent-text: #0d1117; --info-bg: #17283a; --warn-bg: #2e2412; --error-bg: #3a1717;
    --ok: #57c98a; --warn: #e5b45a; --error: #f08a8a;
  }
  .surface-admin { --accent: #b69ae6; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; }
a { color: var(--accent); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }
.topbar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding: 10px 20px; background: var(--surface); border-bottom: 3px solid var(--accent); }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 14px; flex: 1; }
.topbar nav a { text-decoration: none; padding: 4px 2px; }
.brand { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--text); }
.user { display: flex; align-items: center; gap: 8px; color: var(--muted); }
main { padding: 20px; max-width: 1200px; margin: 0 auto; }
h1 { font-size: 1.5rem; margin: 0.2em 0 0.6em; }
h2 { font-size: 1.2rem; margin: 0.4em 0; }
h3 { font-size: 1.05rem; margin: 0.4em 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin: 16px 0; }
.card.narrow { max-width: 520px; margin: 48px auto; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.field-label { font-weight: 600; font-size: 0.92rem; }
.field small, .muted { color: var(--muted); }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); max-width: 100%; }
textarea { width: 100%; }
input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, .btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.btn { font: inherit; border-radius: 4px; padding: 7px 14px; cursor: pointer; border: 1px solid var(--accent); display: inline-block; text-decoration: none; margin: 4px 6px 4px 0; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-secondary { background: var(--surface); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--accent); border-color: transparent; }
.btn-danger { background: var(--surface); color: var(--error); border-color: var(--error); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.alert { border-radius: var(--radius); padding: 10px 14px; margin: 10px 0; border: 1px solid var(--border); }
.alert-info { background: var(--info-bg); }
.alert-ok { background: var(--info-bg); border-color: var(--ok); }
.alert-warn { background: var(--warn-bg); border-color: var(--warn); }
.alert-error { background: var(--error-bg); border-color: var(--error); color: var(--text); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.85rem; color: var(--muted); }
.badge { display: inline-block; font-size: 0.78rem; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); }
.badge.warn, .status-dpia_required, .status-pending_approval { border-color: var(--warn); color: var(--warn); }
.status-active, .status-approved, .status-published, .status-validated, .status-verified { border-color: var(--ok); color: var(--ok); }
.status-rejected, .status-suspended, .status-disabled, .status-ineffective { border-color: var(--error); color: var(--error); }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); margin: 12px 0; padding: 10px 14px; background: var(--surface); }
legend { font-weight: 600; padding: 0 6px; }
.group { margin: 18px 0; }
.rows .row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.cell { display: flex; flex-direction: column; font-size: 0.88rem; }
.refs { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; padding: 4px; border: 1px solid var(--border); border-radius: 4px; }
.check { display: flex; gap: 6px; align-items: baseline; }
.check.muted { color: var(--muted); }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.checklist { list-style: none; padding: 0; }
.checklist .ok { color: var(--ok); }
.checklist .todo { color: var(--warn); }
.summary { white-space: pre-wrap; background: var(--bg); padding: 8px; border-radius: 4px; font-size: 0.85rem; max-height: 360px; overflow: auto; }
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.score { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.qr { background: #fff; display: inline-block; padding: 4px; }
.secret { word-break: break-all; }
.codes code { font-size: 1.05rem; }
.tree { margin: 4px 0 4px 18px; padding: 0; }
.question { padding: 6px 0; border-bottom: 1px dashed var(--border); }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-word; }
.context select { margin-left: 4px; }
.mail-body { max-height: 60vh; }
