:root {
    --ink: #16202a;
    --muted: #667085;
    --line: #e4e7ec;
    --paper: #ffffff;
    --surface: #f4f6f8;
    --brand: #b42318;
    --brand-dark: #7a271a;
    --success: #067647;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--surface); font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; color: white; background: #101828; }
.brand { font-size: 1.25rem; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.brand span { color: #f97066; font-weight: 500; }
.identity { display: grid; text-align: right; }
.identity small { color: #d0d5dd; }
.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.sidebar { padding: 24px 16px; color: #344054; background: var(--paper); border-right: 1px solid var(--line); }
.sidebar a { display: block; padding: 10px 14px; margin-bottom: 4px; border-radius: 8px; text-decoration: none; }
.nav-label { display: block; margin: 22px 14px 8px; color: #98a2b3; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.logout-form { margin: 0; }
.logout-form button { width: 100%; padding: 10px 14px; color: inherit; background: transparent; border: 0; border-radius: 8px; font: inherit; text-align: left; cursor: pointer; }
.sidebar a:hover, .sidebar a:focus-visible, .logout-form button:hover, .logout-form button:focus-visible { color: var(--brand); background: #fff1f0; }
.content { width: 100%; max-width: 1280px; padding: 40px; }
.page-heading { margin-bottom: 28px; }
.page-heading h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.04em; }
.page-heading p { color: var(--muted); }
.page-heading.split { display: flex; justify-content: space-between; align-items: end; }
.eyebrow { margin: 0 0 4px; color: var(--brand) !important; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.metric-card { display: grid; min-height: 160px; padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; box-shadow: 0 1px 2px rgb(16 24 40 / 4%); }
.metric-card:hover { border-color: #f97066; transform: translateY(-2px); }
.metric-card strong { align-self: end; font-size: 2.5rem; }
.metric-card small { color: var(--muted); }
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); background: #f9fafb; font-size: .8rem; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.status { display: inline-block; padding: 4px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.status.read { color: #475467; background: #f2f4f7; }
.status.unread { color: #b54708; background: #fffaeb; }
.status.state-0 { color: #b54708; background: #fffaeb; }
.status.state-1 { color: #175cd3; background: #eff8ff; }
.status.state-2 { color: var(--success); background: #ecfdf3; }
.status.state-3 { color: #b42318; background: #fef3f2; }
.button { display: inline-block; padding: 9px 14px; color: white; background: var(--brand); border: 0; border-radius: 8px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--brand-dark); }
.bulletin-list { display: grid; gap: 16px; }
.bulletin-card, .empty-state, .privacy-form { padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.bulletin-card h2 { margin: 8px 0; }
.bulletin-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; }
.language-switch { display: flex; gap: 4px; }
.language-switch a { padding: 7px 10px; border-radius: 7px; text-decoration: none; }
.language-switch .active { color: white; background: var(--brand); }
.privacy-form { display: grid; gap: 20px; justify-items: start; }
.notice { margin-bottom: 20px; padding: 12px 16px; border-radius: 8px; }
.notice.success { color: var(--success); background: #ecfdf3; }
.notice.error { color: #b42318; background: #fef3f2; }
.notice.warning { color: #93370d; background: #fffaeb; }
.section-title { margin-top: 36px; }
.action-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.action-grid a { padding: 12px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; text-decoration: none; }
.form-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.form-card label { display: grid; gap: 6px; font-weight: 700; }
.form-card input, .form-card select, .form-card textarea, .admin-tools input { width: 100%; padding: 10px 12px; border: 1px solid #98a2b3; border-radius: 8px; font: inherit; }
.form-card .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 16px; }
.actions { display: flex; align-items: center; gap: 12px; }
.actions form { margin: 0; }
.actions button, .link-danger { padding: 0; color: var(--brand); background: none; border: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.admin-tools { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.search-form, .import-form { display: flex; gap: 8px; align-items: center; }
.button.secondary { background: #344054; }
.profile-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.profile-summary div { display: grid; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.profile-summary small { color: var(--muted); }
.consent-form label { display: flex; align-items: center; gap: 10px; }
.consent-form input[type="checkbox"] { width: auto; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(100%, 480px); display: grid; gap: 12px; padding: 30px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 30px rgb(16 24 40 / 8%); }
.auth-card h1 { margin: 0; }
.auth-card p { color: var(--muted); }
.auth-card input, .auth-card select { width: 100%; padding: 11px 12px; border: 1px solid #98a2b3; border-radius: 8px; background: var(--paper); font: inherit; }
.auth-card .button { margin-top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

@media (max-width: 760px) {
    .topbar { padding: 14px 18px; }
    .identity { display: none; }
    .shell { display: block; }
    .sidebar { display: flex; gap: 4px; overflow-x: auto; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
    .sidebar a, .logout-form button { white-space: nowrap; margin: 0; }
    .nav-label { display: none; }
    .content { padding: 24px 16px; }
    .form-card { grid-template-columns: 1fr; }
    .admin-tools { display: grid; }
    .search-form, .import-form { align-items: stretch; flex-direction: column; }
}
