:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #20242a;
    --muted: #6d7580;
    --line: #dfe3e8;
    --primary: #1769aa;
    --primary-dark: #0f548b;
    --danger: #b42318;
    --success: #157347;
    --warning: #8a5a00;
    --radius: 14px;
    --shadow: 0 8px 24px rgba(31, 41, 55, 0.07);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}
a { color: var(--primary); }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar__inner { min-height: 70px; display: flex; align-items: center; gap: 24px; }
.brand { font-weight: 700; font-size: 20px; color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 16px; }
.nav a { color: var(--text); text-decoration: none; }
.view-switcher { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.view-switcher label { font-size: 13px; color: var(--muted); }
.demo-warning { padding: 8px 16px; background: #fff3cd; color: #664d03; text-align: center; font-size: 14px; border-bottom: 1px solid #ffecb5; }
.page { padding: 32px 0 60px; }
.page-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.page-header h1 { margin: 0 0 6px; font-size: clamp(28px, 4vw, 42px); line-height: 1.15; }
.page-header__actions { display: flex; align-items: center; gap: 10px; }
.eyebrow { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.muted { color: var(--muted); }
.compact { margin: 4px 0; font-size: 13px; }
.card, .agenda-item, .empty-state { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card { padding: 22px; margin-bottom: 22px; }
.card h2 { margin-top: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: end; }
.form-grid label, .vote-form label { display: flex; flex-direction: column; gap: 6px; }
.form-grid label > span, .vote-form label > span, .member-row label > span { font-size: 13px; color: var(--muted); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
input, select, textarea, button { font: inherit; }
input[type="text"], input[type="date"], input[type="time"], input[type="number"], input[type="file"], select, textarea {
    width: 100%; border: 1px solid #cbd1d8; border-radius: 9px; padding: 10px 12px; background: #fff; color: var(--text);
}
textarea { resize: vertical; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; }
.checkbox-label input { width: 18px; height: 18px; }
.form-actions { display: flex; gap: 10px; align-items: center; }
.button { border: 0; border-radius: 9px; padding: 10px 16px; background: var(--primary); color: #fff; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.button:hover { background: var(--primary-dark); }
.button--secondary { background: #eef2f6; color: var(--text); }
.button--secondary:hover { background: #e0e6ec; }
.button--danger { background: #fee4e2; color: var(--danger); }
.button--danger:hover { background: #fecdca; }
.link-danger { border: 0; background: transparent; color: var(--danger); cursor: pointer; }
.meeting-list, .stack, .agenda-list { display: grid; gap: 16px; }
.meeting-card { display: flex; justify-content: space-between; gap: 24px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.meeting-card:hover { border-color: #aeb9c5; transform: translateY(-1px); }
.meeting-card h2 { margin: 5px 0 10px; font-size: 21px; }
.meeting-card__number { color: var(--muted); font-size: 13px; }
.meeting-card__meta, .protocol-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.meeting-card__side { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; text-align: right; min-width: 190px; }
.status { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #eef2f6; }
.status--draft { background: #eef2f6; color: #475467; }
.status--voting { background: #e0f2fe; color: #075985; }
.status--closed { background: #fef3c7; color: #92400e; }
.status--published { background: #dcfce7; color: #166534; }
.status--cancelled { background: #fee2e2; color: #991b1b; }
.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.alert--success { background: #dcfce7; color: #166534; }
.alert--error { background: #fee2e2; color: #991b1b; }
.empty-state { padding: 34px; text-align: center; color: var(--muted); }
.member-row { display: grid; grid-template-columns: 2fr 1.4fr 100px auto auto; gap: 12px; align-items: end; margin-bottom: 0; }
.member-row label { display: flex; flex-direction: column; gap: 6px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form input[type="text"] { min-width: 280px; flex: 1; }
.details-form { margin-top: 18px; }
details summary { cursor: pointer; font-weight: 700; }
.participants-table table, .results-table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); background: #f8fafc; }
.table-scroll { overflow-x: auto; }
.participant-list { display: grid; gap: 8px; }
.tag { display: inline-flex; margin-left: 8px; padding: 3px 8px; border-radius: 999px; background: #e0f2fe; color: #075985; font-size: 12px; }
.tag--muted { background: #eef2f6; color: #475467; }
.agenda-item { padding: 28px; }
.agenda-item__heading { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.agenda-item__heading h2 { margin: 0; font-size: 25px; }
.agenda-number { width: 42px; height: 42px; border-radius: 50%; background: #eef2f6; display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.protocol-text { white-space: normal; }
.admin-box { margin: 20px 0; padding: 18px; border: 1px dashed #aeb9c5; border-radius: 12px; background: #fafbfc; }
.subsection { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.subsection h3, .decision-box h3 { margin: 0 0 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats-grid > div { padding: 14px; background: #f8fafc; border-radius: 10px; }
.stats-grid span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.stats-grid strong { font-size: 18px; }
.vote-question { margin: 18px 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.vote-question h4 { margin: 0 0 12px; font-size: 18px; }
.result-input { width: 100px !important; }
.admin-tools { display: grid; gap: 10px; margin-top: 14px; }
.attachment-list { display: grid; gap: 10px; }
.attachment-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px; background: #f8fafc; border-radius: 10px; }
.decision-box, .final-decision { margin-top: 24px; padding: 18px; border-radius: 12px; background: #f8fafc; border-left: 4px solid var(--primary); }
.final-decision--accepted { border-left-color: var(--success); background: #f0fdf4; }
.final-decision--rejected { border-left-color: var(--danger); background: #fef2f2; }
.vote-totals { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 18px; }
.vote-totals span { padding: 8px 12px; background: #f8fafc; border-radius: 999px; }
.vote-options { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.vote-options label { display: flex; flex-direction: row; align-items: center; gap: 7px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.vote-form { max-width: 720px; padding: 18px; background: #f8fafc; border-radius: 12px; margin-bottom: 18px; }
.danger-form { margin-top: 12px; }
.footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); background: #fff; }

@media (max-width: 820px) {
    .topbar__inner { flex-wrap: wrap; padding: 12px 0; gap: 12px; }
    .view-switcher { width: 100%; margin-left: 0; }
    .view-switcher select { flex: 1; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: span 1; }
    .meeting-card, .page-header { flex-direction: column; }
    .meeting-card__side { align-items: flex-start; text-align: left; min-width: 0; }
    .member-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .agenda-item { padding: 20px; }
}

@media print {
    body { background: #fff; font-family: "Times New Roman", serif; font-size: 12pt; }
    .no-print, .admin-box, details, .footer { display: none !important; }
    .container { width: 100%; max-width: none; }
    .page { padding: 0; }
    .agenda-item, .card { border: 0; box-shadow: none; padding: 0; margin: 0 0 24px; }
    .agenda-item { break-inside: avoid-page; }
    .page-header h1 { font-size: 20pt; }
    .agenda-item__heading h2 { font-size: 15pt; }
    a { color: #000; text-decoration: none; }
    th, td { border: 1px solid #999; }
}
