:root {
    color-scheme: light;
    --ink: #172033;
    --muted: #64748b;
    --line: #dbe3ef;
    --blue: #155eef;
    --blue-dark: #0b3da8;
    --soft: #f3f6fb;
    --good: #157347;
    --danger: #b42318;
    --warning: #9a6700;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--soft); color: var(--ink); }
a { color: var(--blue-dark); }
button, input, textarea, select { font: inherit; }

.topbar {
    position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px;
    min-height: 68px; padding: 10px 3vw; background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 800; text-decoration: none; white-space: nowrap; }
.brand span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--blue); color: #fff; font-size: 13px; }
.brand--large { margin-bottom: 30px; font-size: 20px; }
.topbar nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.topbar nav a { padding: 9px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; white-space: nowrap; font-size: 14px; }
.topbar nav a:hover, .topbar nav a.active { background: #eaf0ff; color: var(--blue-dark); }
.link-button { padding: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }

.shell { width: min(1220px, 94vw); margin: 0 auto; padding: 42px 0 72px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.page-head h1 { margin: 6px 0 8px; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.04em; }
.page-head p { max-width: 780px; margin: 0; color: var(--muted); line-height: 1.6; }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }

.metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 24px; }
.metrics article, .panel, .legal-panel, .contact-card, .task, .empty { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(23, 32, 51, .04); }
.metrics article { padding: 22px; }
.metrics strong { display: block; font-size: 34px; letter-spacing: -.04em; }
.metrics span { color: var(--muted); font-size: 13px; }
.panel, .legal-panel, .empty { padding: 26px; margin-bottom: 20px; }
.panel h2, .legal-panel h2 { margin-top: 0; }
.panel--narrow { max-width: 700px; }
.legal-panel { border-color: #f0d99a; background: #fffbeb; }
.legal-panel li { margin: 9px 0; line-height: 1.5; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.cards, .stack { display: grid; gap: 14px; }
.contact-card { padding: 20px; display: grid; gap: 12px; }
.contact-card > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.contact-card small, td small, .campaign-row small, .task small { display: block; color: var(--muted); margin-top: 5px; }

label { display: grid; gap: 7px; margin: 0 0 16px; font-weight: 700; font-size: 14px; }
label small, .hint { color: var(--muted); font-weight: 400; }
input, textarea, select { width: 100%; border: 1px solid #cbd5e1; border-radius: 10px; padding: 11px 12px; color: var(--ink); background: #fff; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(21, 94, 239, .15); border-color: var(--blue); }
.check { grid-template-columns: 20px 1fr; align-items: start; font-weight: 500; line-height: 1.45; }
.check input { width: 18px; height: 18px; margin-top: 2px; }
.inline-form { display: grid; grid-template-columns: 1fr 260px auto; gap: 12px; align-items: end; }
.inline-form label { margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 16px; padding: 16px; }
legend { font-weight: 800; padding: 0 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

.button { display: inline-flex; justify-content: center; align-items: center; min-height: 43px; padding: 10px 16px; border: 1px solid var(--blue); border-radius: 10px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 800; cursor: pointer; }
.button:hover { background: var(--blue-dark); }
.button--secondary { background: #fff; color: var(--blue-dark); }
.button--danger { background: var(--danger); border-color: var(--danger); }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
tbody tr:last-child td { border-bottom: 0; }
.status, .consent { display: inline-block; width: max-content; padding: 5px 9px; border-radius: 999px; background: #eef2f7; color: #475569; font-size: 12px; font-weight: 800; }
.consent--confirmed { background: #dcfce7; color: var(--good); }
.consent--revoked { background: #fee2e2; color: var(--danger); }
.score { display: flex; align-items: baseline; gap: 10px; }
.score strong { font-size: 44px; color: var(--blue); }
.score span { color: var(--muted); }
.preview { padding: 18px; border-radius: 12px; background: var(--soft); line-height: 1.6; white-space: normal; }
.campaign-row, .task { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 18px; text-decoration: none; color: var(--ink); }
.campaign-row { border: 1px solid var(--line); border-radius: 12px; }
.task--done { opacity: .58; }
.warning { padding: 16px; margin-bottom: 18px; border-radius: 12px; background: #fff4e5; color: #7a4200; }
.flash { margin: 0 0 22px; padding: 14px 16px; border-radius: 12px; font-weight: 700; }
.flash--success { color: var(--good); background: #dcfce7; }
.flash--error { color: var(--danger); background: #fee2e2; }
.report-list { display: grid; gap: 10px; }
.report-list div { display: flex; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.report-list dd { font-weight: 900; }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 20%, #dce8ff, transparent 40%), #f3f6fb; }
.login-card, .public-card { width: min(460px, 100%); padding: 34px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 20px 70px rgba(23, 32, 51, .12); }
.login-card h1, .public-card h1 { margin-bottom: 8px; }
.login-card > p, .public-card p { color: var(--muted); line-height: 1.55; }
.public-card { margin: 10vh auto; }
.footer { padding: 24px 3vw 48px; color: var(--muted); text-align: center; font-size: 12px; }
.footer p { max-width: 900px; margin: 7px auto; }

@media (max-width: 980px) {
    .topbar { align-items: flex-start; flex-wrap: wrap; }
    .topbar nav { order: 3; width: 100%; }
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .shell { padding-top: 26px; }
    .page-head { align-items: stretch; flex-direction: column; }
    .metrics { grid-template-columns: 1fr 1fr; }
    .metrics article { padding: 16px; }
    .panel, .legal-panel { padding: 20px; }
    .inline-form { grid-template-columns: 1fr; }
    .campaign-row, .task { align-items: flex-start; flex-direction: column; }
}
