:root {
    --primary: #1d4ed8;
    --accent: #dc2626;
    --danger: #dc2626;
    --ink: #121212;
    --muted: #667085;
    --line: #d9dee7;
    --paper: #ffffff;
    --soft: #eef8f5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(29, 78, 216, .10), rgba(220, 38, 38, .08) 48%, rgba(14, 165, 233, .10)),
        #eef4ff;
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px 14px;
    background: #fff;
    color: var(--ink);
}

label {
    display: grid;
    gap: 7px;
    color: #273142;
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px;
    text-align: left;
    vertical-align: top;
}

th {
    color: #354052;
    background: #eef2f7;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 14px 24px;
    background: linear-gradient(90deg, #1e3a8a, var(--primary) 55%, #b91c1c);
    border-bottom: 0;
    color: #fff;
    box-shadow: 0 10px 28px rgba(29, 78, 216, .20);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.brand img {
    width: 64px;
    height: 46px;
    object-fit: contain;
    flex: 0 0 64px;
    border-radius: 8px;
    background: #ffffff;
    padding: 4px;
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.topbar nav a {
    border-radius: 8px;
    padding: 9px 11px;
    color: #fff;
    font-weight: 700;
}

.topbar nav a:hover {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.page {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 60px;
}

.page-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    margin-bottom: 20px;
}

.page-title p,
.page-title h1 {
    margin: 0;
}

.page-title p {
    color: var(--muted);
    font-weight: 700;
}

.page-title h1 {
    margin-top: 5px;
    font-size: 32px;
}

.user-pill {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    color: #344054;
    font-weight: 700;
}

.panel,
.metric,
.hero-action,
.empty-state,
.matter-box,
.confirmed {
    border: 1px solid rgba(15, 118, 110, .18);
    border-radius: 8px;
    background: var(--paper);
    padding: 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
}

.panel + .panel,
.actions + .panel {
    margin-top: 18px;
}

.control-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
    background: #fff;
}

.control-strip h2,
.control-strip p {
    margin: 0;
}

.control-strip p {
    margin-top: 6px;
    color: var(--muted);
    font-weight: 700;
}

.session-live {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    border: 2px solid var(--danger);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 18px;
    background: #fff7f7;
}

.session-live form {
    display: grid;
    gap: 8px;
}

.session-live form::before {
    content: "Finalizar votacao";
    display: block;
    color: #7f1d1d;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
}

.session-live span {
    display: inline-flex;
    border-radius: 8px;
    padding: 6px 10px;
    background: var(--danger);
    color: #fff;
    font-weight: 900;
}

.session-live h2 {
    margin: 10px 0 6px;
}

.session-live p {
    margin: 0;
    color: #374151;
    font-weight: 700;
}

.finish-alert,
.progress-note {
    margin-top: 12px;
    border-radius: 8px;
    padding: 12px;
    font-weight: 900;
}

.finish-alert {
    background: #dcfce7;
    color: #14532d;
    border: 2px solid #1d4ed8;
}

.progress-note {
    background: #eef2ff;
    color: #312e81;
}

.close-big {
    min-height: 88px;
    min-width: 300px;
    font-size: 20px;
}

.panel h2,
.panel h3 {
    margin-top: 0;
}

.stack {
    display: grid;
    gap: 16px;
}

.mini-stack {
    display: grid;
    gap: 8px;
    min-width: 260px;
    margin-top: 10px;
}

.wide-form {
    max-width: 920px;
}

.grid-form,
.option-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
}

.check input {
    width: auto;
}

.logo-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
    font-weight: 900;
}

.logo-preview img {
    max-width: 150px;
    max-height: 90px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 6px;
}

.two-columns {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.metric strong {
    display: block;
    font-size: 36px;
    color: var(--primary);
}

.metric span {
    color: var(--muted);
    font-weight: 700;
}

.metric.live {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.hero-action {
    margin-top: 18px;
    background: linear-gradient(90deg, #ffffff, #f7fafc);
}

.hero-action p,
.hero-action h2 {
    margin-top: 0;
}

.hero-action h2 {
    font-size: 34px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 11px 16px;
    background: #e5e7eb;
    color: #111827;
    font-weight: 800;
    cursor: pointer;
}

.btn.primary {
    background: var(--primary);
    color: #fff;
}

.btn.success {
    background: var(--accent);
    color: #fff;
}

.btn.danger {
    background: var(--danger);
    color: #fff;
}

.btn.dark {
    background: #181818;
    color: #fff;
}

.btn.small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 14px;
}

.actions,
.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.status {
    display: inline-flex;
    border-radius: 8px;
    padding: 5px 9px;
    background: #e5e7eb;
    font-weight: 800;
}

.status.open {
    background: #dcfce7;
    color: #166534;
}

.status.planned {
    background: #dbeafe;
    color: #1e3a8a;
}

.status.closed {
    background: #fee2e2;
    color: #991b1b;
}

.reopen-box {
    max-width: 330px;
}

.reopen-box summary {
    cursor: pointer;
    color: #991b1b;
    font-weight: 900;
}

.flash {
    margin: 0 0 16px;
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 800;
}

.flash.success {
    background: #dcfce7;
    color: #14532d;
}

.flash.danger {
    background: #fee2e2;
    color: #7f1d1d;
}

.login-body {
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at top, #ffffff 0, #eef2f7 36%, #dfe5ee 100%);
}

.login-panel {
    width: min(430px, 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 30px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(16, 24, 40, 0.16);
}

.login-panel h1 {
    margin-bottom: 4px;
}

.login-panel p {
    margin-top: 0;
    color: var(--muted);
}

.vote-screen {
    display: grid;
    gap: 18px;
    min-height: calc(100vh - 180px);
}

.matter-box {
    border-left: 8px solid var(--primary);
}

.matter-box p:first-child {
    margin: 0 0 8px;
    color: var(--muted);
    font-weight: 900;
    text-transform: uppercase;
}

.matter-box h2 {
    margin: 0 0 10px;
    font-size: 42px;
}

.vote-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    min-height: 52vh;
}

.vote-btn {
    min-height: clamp(220px, 38vh, 390px);
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-size: clamp(52px, 7vw, 92px);
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 18px 26px rgba(16, 24, 40, 0.18);
    touch-action: manipulation;
}

.vote-btn.yes {
    background: #1d4ed8;
}

.vote-btn.no {
    background: #dc2626;
}

.vote-btn.abstain {
    grid-column: 1 / -1;
    min-height: clamp(110px, 18vh, 180px);
    background: #4b5563;
    font-size: clamp(34px, 5vw, 60px);
}

.confirmed {
    display: grid;
    gap: 8px;
    border-color: var(--accent);
    background: #f0fdf4;
    color: #14532d;
}

.confirmed strong {
    font-size: 40px;
}

.confirmed span {
    font-size: 28px;
    font-weight: 900;
}

.locked-vote {
    border-color: #1d4ed8 !important;
    background: #eff6ff !important;
    color: #1e3a8a !important;
    text-align: center;
}

.locked-vote strong {
    font-size: clamp(34px, 5vw, 58px);
}

.locked-vote span {
    color: #334155;
    font-size: clamp(18px, 2.8vw, 28px);
}

.empty-state {
    text-align: center;
    padding: 70px 22px;
}

.table-wrap {
    overflow-x: auto;
}

.report-head,
.result-strip {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.report-grid span,
.result-strip {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}

.report-grid span {
    display: grid;
    gap: 6px;
    align-content: start;
    line-height: 1.35;
}

.report-grid span b {
    display: block;
    color: #334155;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.result-strip strong {
    font-size: 26px;
}

.report-vote-table th,
.report-vote-table td {
    text-align: center;
}

.report-vote-table th:first-child,
.report-vote-table td:first-child,
.report-vote-table th:nth-child(2),
.report-vote-table td:nth-child(2) {
    text-align: left;
}

.report-mark {
    font-size: 24px;
    font-weight: 900;
}

.report-mark.sim {
    color: #1d4ed8;
}

.report-mark.nao {
    color: #b91c1c;
}

.report-mark.abstencao {
    color: #4b5563;
}

.tv-body {
    background: #050505;
    color: #fff;
    overflow: hidden;
}

.tv-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
    padding: 28px;
}

.tv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 18px;
}

.tv-header p,
.tv-header h1 {
    margin: 0;
}

.tv-header p {
    color: #cbd5e1;
    font-weight: 800;
}

.tv-header h1 {
    font-size: 38px;
}

#clock {
    font-size: 30px;
}

.tv-content {
    display: grid;
    gap: 20px;
    align-content: start;
    padding-top: 24px;
}

.tv-content.is-final {
    grid-template-rows: auto 1fr;
    gap: 16px;
    padding-top: 14px;
    min-height: 0;
}

.tv-matter {
    border-left: 10px solid var(--primary);
    padding-left: 24px;
}

.tv-matter h2 {
    margin: 0 0 10px;
    font-size: 56px;
}

.tv-matter p {
    margin: 0;
    color: #e5e7eb;
    font-size: 28px;
    line-height: 1.3;
}

.tv-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.tv-stat {
    border: 1px solid #333;
    border-radius: 8px;
    padding: 18px;
    background: #111;
}

.tv-stat strong {
    display: block;
    font-size: 44px;
}

.tv-stat span {
    color: #cbd5e1;
    font-weight: 900;
}

.council-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-height: 46vh;
    overflow: auto;
}

.council-card {
    border: 1px solid #333;
    border-radius: 8px;
    padding: 18px;
    background: #111;
}

.council-card strong {
    display: block;
    font-size: clamp(24px, 2.2vw, 34px);
}

.council-card span {
    color: #cbd5e1;
    font-size: 18px;
    font-weight: 800;
}

.vote-label {
    display: inline-block;
    margin-top: 12px;
    border-radius: 8px;
    padding: 10px 13px;
    font-size: clamp(22px, 2.4vw, 36px);
    font-weight: 900;
    background: #334155;
    color: #fff;
}

.vote-label.sim {
    background: #1d4ed8;
}

.vote-label.nao {
    background: #dc2626;
}

.vote-label.abstencao {
    background: #6b7280;
}

.vote-label.registrado {
    background: #2563eb;
}

.tv-idle,
.tv-result {
    display: grid;
    place-items: center;
    text-align: center;
}

.tv-idle {
    min-height: 65vh;
}

.tv-result {
    min-height: auto;
}

.tv-idle h2,
.tv-result h2 {
    font-size: 54px;
    margin: 0;
}

.tv-result strong {
    display: block;
    margin-top: 12px;
    color: var(--accent);
    font-size: 76px;
}

.final-score {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    width: min(760px, 100vw - 80px);
    margin: 18px auto 0;
}

.final-score span {
    border: 0;
    border-radius: 8px;
    padding: 14px;
    background: #111;
    font-size: 26px;
    font-weight: 900;
}

.final-score b {
    display: block;
    font-size: 58px;
}

.final-grid {
    max-height: 34vh;
}

.final-card {
    background: #0d0d0d;
}

.tv-final-list {
    display: grid;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
}

.tv-final-list h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 28px;
    text-transform: uppercase;
}

.vote-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 12px;
    min-height: 0;
}

.vote-sheet {
    display: grid;
    gap: 4px;
    align-content: start;
    min-width: 0;
}

.vote-head,
.vote-row {
    display: grid;
    align-items: center;
    gap: 8px;
}

.vote-sheet.has-abstention .vote-head,
.vote-sheet.has-abstention .vote-row {
    grid-template-columns: minmax(190px, 1fr) 86px 86px 132px;
}

.vote-sheet.no-abstention .vote-head,
.vote-sheet.no-abstention .vote-row {
    grid-template-columns: minmax(190px, 1fr) 96px 96px;
}

.secret-sheet .vote-head,
.secret-sheet .vote-row {
    grid-template-columns: minmax(190px, 1fr) 150px;
}

.vote-head {
    color: #f8fafc;
    font-size: 22px;
    font-weight: 900;
    text-transform: uppercase;
}

.vote-head span:not(:first-child) {
    text-align: center;
}

.vote-row {
    min-height: 44px;
    border-radius: 8px;
    padding: 7px 10px;
    background: #111;
}

.vote-row:nth-child(odd) {
    background: #171717;
}

.vote-row strong {
    color: #fff;
    font-size: 24px;
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vote-row span:not(.vote-chip) {
    min-height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 26px;
    font-weight: 900;
}

.vote-check.sim {
    background: #14532d;
    color: #dcfce7;
}

.vote-check.nao {
    background: #7f1d1d;
    color: #fee2e2;
}

.vote-check.abstencao {
    background: #374151;
    color: #f3f4f6;
}

.vote-chip {
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
    font-weight: 900;
}

.vote-chip.registrado {
    background: #1d4ed8;
    color: #dbeafe;
}

.vote-chip.pendente {
    background: #334155;
    color: #cbd5e1;
}

.vote-columns.dense .vote-head {
    font-size: 18px;
}

.vote-columns.dense .vote-row {
    min-height: 36px;
    padding: 5px 8px;
}

.vote-columns.dense .vote-row strong {
    font-size: 19px;
}

.vote-columns.dense .vote-row span:not(.vote-chip) {
    min-height: 28px;
    font-size: 22px;
}

@media (max-width: 820px) {
    .topbar,
    .page-title,
    .report-head,
    .result-strip,
    .control-strip,
    .session-live {
        align-items: stretch;
        flex-direction: column;
    }

    .grid-form,
    .option-grid,
    .two-columns,
    .stats-grid,
    .vote-buttons,
    .report-grid,
    .tv-grid,
    .council-grid {
        grid-template-columns: 1fr;
    }

    .vote-btn {
        min-height: 180px;
        font-size: 54px;
    }

    .tv-shell {
        padding: 18px;
    }

    .tv-header h1,
    .tv-matter h2 {
        font-size: 32px;
    }

    .tv-matter p {
        font-size: 20px;
    }

    .tv-idle h2,
    .tv-result h2,
    .tv-result strong {
        font-size: 42px;
    }

    .final-score {
        grid-template-columns: 1fr;
    }
}

@media print {
    .topbar,
    .page-title,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .page {
        width: 100%;
        padding: 0;
    }

    .panel {
        border: 0;
        padding: 0;
    }
}

/* Visual refresh */
.login-body {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .16), rgba(245, 158, 11, .12)),
        #edf7f5;
}

.login-card {
    width: min(430px, 100%);
    border: 1px solid rgba(15, 118, 110, .18);
    border-top: 8px solid var(--primary);
    border-radius: 8px;
    padding: 30px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .14);
}

.login-card h1,
.login-card p {
    margin: 0;
}

.login-card p {
    margin: 6px 0 18px;
    color: var(--muted);
}

.login-logo {
    max-width: 92px;
    max-height: 70px;
    object-fit: contain;
    margin-bottom: 14px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.metric {
    min-height: 120px;
    display: grid;
    align-content: center;
    gap: 8px;
    border: 0;
    color: #fff;
}

.metric strong {
    font-size: 34px;
    line-height: 1;
}

.metric span {
    font-weight: 800;
    text-transform: uppercase;
}

.metric.color-a { background: linear-gradient(135deg, #1d4ed8, #0ea5e9); }
.metric.color-b { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.metric.color-c { background: linear-gradient(135deg, #dc2626, #991b1b); }

.welcome-panel {
    border-left: 8px solid var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 11px 16px;
    background: #e5e7eb;
    color: #111827;
    font-weight: 900;
    cursor: pointer;
}

.btn.primary { background: var(--primary); color: #fff; }
.btn.accent { background: var(--accent); color: #111827; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.dark { background: #111827; color: #fff; }
.btn.small { min-height: 36px; padding: 8px 10px; font-size: 14px; }
.btn.big { min-height: 62px; font-size: 20px; }

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-grid.two,
.option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid.inline {
    grid-template-columns: 1.2fr 1fr auto auto;
    align-items: end;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check input {
    width: auto;
}

.flash {
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
    font-weight: 900;
}

.flash.success { background: #dcfce7; color: #14532d; }
.flash.error { background: #fee2e2; color: #991b1b; }

.status {
    display: inline-flex;
    border-radius: 8px;
    padding: 8px 10px;
    font-weight: 900;
}

.status.draft { background: #e0f2fe; color: #075985; }
.status.open { background: #dcfce7; color: #14532d; }
.status.closed { background: #fee2e2; color: #991b1b; }

.complete-alert {
    padding: 10px 12px;
    border-radius: 8px;
    background: #fef3c7;
    color: #78350f;
    font-weight: 900;
}

.vote-terminal {
    min-height: calc(100vh - 230px);
    display: grid;
    align-content: center;
    gap: 18px;
    border-top: 8px solid var(--primary);
}

.vote-terminal h2 {
    font-size: 42px;
    margin: 0;
}

.vote-terminal p {
    font-size: 22px;
}

.kicker {
    color: var(--primary);
    font-weight: 900;
    text-transform: uppercase;
}

.vote-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.vote-btn {
    min-height: 180px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-size: 56px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 18px 35px rgba(15, 23, 42, .18);
}

.vote-btn.yes { background: #1d4ed8; }
.vote-btn.no { background: #dc2626; }
.vote-btn.abstain {
    grid-column: 1 / -1;
    background: #334155;
    color: #fff;
}

.score-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0;
}

.score-row strong {
    border-radius: 8px;
    padding: 16px 20px;
    background: #f1f5f9;
    font-size: 22px;
}

.mini-form {
    display: grid;
    gap: 8px;
    min-width: 240px;
    margin-top: 8px;
}

.score-modal {
    width: min(620px, calc(100% - 32px));
    border: 0;
    border-radius: 8px;
    padding: 24px;
    color: #111827;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
}

.score-modal::backdrop {
    background: rgba(15, 23, 42, .62);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #d7deea;
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.modal-head h2 {
    margin: 0;
}

.modal-head button {
    border: 0;
    border-radius: 8px;
    background: #e5e7eb;
    padding: 9px 12px;
    font-weight: 900;
    cursor: pointer;
}

.signature-box > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 48px;
}

.signature-box span {
    border-top: 1px solid #111827;
    padding-top: 10px;
    text-align: center;
    font-weight: 800;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.section-head h2,
.section-head p {
    margin: 0;
}

.section-head p {
    margin-top: 6px;
    color: #475569;
    font-weight: 700;
}

.attendance-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.attendance-form {
    display: grid;
    gap: 14px;
}

.attendance-form-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 18px;
    align-items: end;
}

.attendance-form-head label {
    display: grid;
    gap: 6px;
    max-width: 220px;
}

.attendance-form-head p {
    margin: 0;
    color: #475569;
    font-weight: 700;
}

.attendance-sheet {
    border: 1px solid #d7deea;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.attendance-sheet-head,
.attendance-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.8fr) minmax(150px, 0.9fr) minmax(190px, 1.2fr);
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
}

.attendance-sheet-head {
    background: #eff4fb;
    color: #334155;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.attendance-row {
    border-top: 1px solid #e5edf6;
}

.attendance-row.present {
    background: #f8fbff;
}

.attendance-row.absent {
    background: #fff7f7;
}

.attendance-person {
    display: grid;
    gap: 4px;
}

.attendance-person strong {
    font-size: 16px;
}

.attendance-person small,
.attendance-note-cell small {
    color: #475569;
    font-weight: 700;
}

.attendance-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.attendance-check input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 0;
}

.attendance-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border-radius: 999px;
    padding: 0 14px;
    background: #dbeafe;
    color: #1d4ed8;
}

.attendance-row.absent .attendance-badge {
    background: #fee2e2;
    color: #b91c1c;
}

.attendance-note-cell {
    display: grid;
    gap: 6px;
    justify-items: start;
}

.attendance-note-cell small {
    line-height: 1.35;
}

.attendance-note-modal {
    width: min(520px, calc(100vw - 32px));
    border: 0;
    border-radius: 8px;
    padding: 18px;
}

.attendance-note-modal::backdrop {
    background: rgba(15, 23, 42, 0.4);
}

.attendance-note-modal label {
    display: grid;
    gap: 8px;
}

.attendance-note-modal textarea {
    width: 100%;
    min-height: 120px;
}

.attendance-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attendance-summary span {
    border-radius: 8px;
    padding: 8px 10px;
    background: #dbeafe;
    color: #1e3a8a;
    font-weight: 900;
}

.attendance-summary span.absent {
    background: #fee2e2;
    color: #991b1b;
}

.compact-attendance {
    display: grid;
    gap: 16px;
}

.attendance-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding-top: 6px;
}

.attendance-status {
    display: grid;
    gap: 6px;
}

.attendance-status small {
    color: #475569;
    font-weight: 700;
}

.attendance-toggle {
    position: relative;
}

.attendance-toggle summary {
    list-style: none;
}

.attendance-toggle summary::-webkit-details-marker {
    display: none;
}

.attendance-toggle[open] {
    width: min(100%, 1020px);
}

.attendance-toggle[open] > summary {
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .attendance-sheet-head {
        display: none;
    }

    .attendance-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .attendance-note-cell {
        justify-items: stretch;
    }
}

.muted-note {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    border-radius: 8px;
    padding: 8px 10px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 800;
}

.muted-copy {
    margin: 14px 0 0;
    color: #475569;
    font-weight: 700;
}

.session-launch {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    border-left: 8px solid #1d4ed8 !important;
    margin-bottom: 18px;
}

.session-launch.needs-attention {
    border-left-color: #dc2626 !important;
    background: #fff7f7 !important;
}

.session-launch.is-ready {
    background: #f8fbff !important;
}

.compact-launch {
    align-items: center;
}

.launch-actions {
    justify-content: flex-end;
}

.launch-step {
    margin: 0 0 8px;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.launch-copy h2,
.launch-copy p {
    margin: 0;
}

.launch-copy p:last-child {
    margin-top: 8px;
    color: #475569;
    font-weight: 700;
}

.launch-state {
    min-width: 250px;
    border-radius: 8px;
    padding: 16px 18px;
    background: #ffffff;
    border: 1px solid #d7deea;
}

.launch-state strong,
.launch-state span {
    display: block;
}

.launch-state strong {
    font-size: 22px;
}

.launch-state span {
    margin-top: 6px;
    color: #475569;
    font-weight: 700;
}

.report-grid span {
    display: grid !important;
    gap: 6px !important;
    align-content: start !important;
    font-weight: 600 !important;
}

.report-grid span b {
    display: block !important;
    color: #334155 !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
}

@media (max-width: 760px) {
    .topbar,
    .page-title,
    .session-launch,
    .control-strip,
    .session-live {
        align-items: stretch;
        flex-direction: column;
    }

    .metric-grid,
    .form-grid.two,
    .form-grid.inline,
    .option-grid,
    .vote-actions {
        grid-template-columns: 1fr;
    }

    .vote-btn {
        min-height: 150px;
        font-size: 46px;
    }

    .vote-terminal h2 {
        font-size: 34px;
    }
}

/* Blue and red councilor tablet experience */
.tablet-preview {
    margin-top: 18px;
    border: 1px solid rgba(29, 78, 216, .18);
    border-radius: 8px;
    padding: 18px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .07);
}

.preview-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.preview-title strong {
    color: #1e3a8a;
    font-size: 20px;
}

.preview-title span {
    border-radius: 8px;
    padding: 8px 10px;
    background: #dbeafe;
    color: #1e3a8a;
    font-weight: 900;
}

.preview-score {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.preview-score div {
    border-radius: 8px;
    padding: 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.preview-score b {
    display: block;
    color: #1d4ed8;
    font-size: 28px;
    line-height: 1;
}

.preview-score span {
    color: #475569;
    font-weight: 900;
    text-transform: uppercase;
}

.preview-voters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 8px;
}

.preview-voter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
    padding: 11px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.preview-chip {
    border-radius: 8px;
    padding: 7px 9px;
    background: #e2e8f0;
    color: #334155;
    font-weight: 900;
    white-space: nowrap;
}

.preview-chip.sim { background: #dbeafe; color: #1d4ed8; }
.preview-chip.nao { background: #fee2e2; color: #b91c1c; }
.preview-chip.abstencao { background: #e2e8f0; color: #334155; }
.preview-chip.registrado { background: #dbeafe; color: #1d4ed8; }

.finish-alert {
    background: #dbeafe;
    color: #1e3a8a;
    border-color: #1d4ed8;
}

.report-mark.sim {
    color: #1d4ed8;
}

.vote-label.sim {
    background: #1d4ed8;
}

@media (max-width: 900px) {
    .page {
        width: min(100% - 18px, 1180px);
        padding-top: 16px;
    }

    .topbar nav {
        justify-content: flex-start;
    }

    .vote-terminal {
        min-height: auto;
        padding: 18px;
    }

    .vote-terminal h2 {
        font-size: 30px;
    }

    .vote-terminal p {
        font-size: 18px;
    }

    .vote-actions {
        gap: 12px;
    }

    .vote-btn {
        min-height: 150px;
        font-size: 44px;
    }

    .preview-score {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Institutional visual standard: flat colors, high contrast, no gradients. */
body {
    background: #f3f6fb !important;
    color: #111827;
}

.topbar {
    background: #1e3a8a !important;
    border-bottom: 4px solid #b91c1c !important;
    box-shadow: none !important;
}

.topbar nav a {
    color: #ffffff !important;
}

.topbar nav a:hover {
    background: #ffffff !important;
    color: #1e3a8a !important;
}

.topbar .brand {
    min-height: 58px !important;
}

.topbar .brand img {
    width: 76px !important;
    height: 52px !important;
    max-width: 76px !important;
    max-height: 52px !important;
    object-fit: contain !important;
    flex: 0 0 76px !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    padding: 5px !important;
}

.panel,
.metric,
.hero-action,
.empty-state,
.matter-box,
.confirmed,
.tablet-preview,
.login-card {
    background: #ffffff !important;
    border: 1px solid #d7deea !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06) !important;
}

.metric {
    color: #111827 !important;
    border-left: 6px solid #1d4ed8 !important;
}

.metric.color-a,
.metric.color-b,
.metric.color-c {
    background: #ffffff !important;
}

.metric.color-c {
    border-left-color: #b91c1c !important;
}

.metric strong {
    color: #1e3a8a !important;
}

.metric.color-c strong {
    color: #b91c1c !important;
}

.metric span,
.page-title p,
.user-pill {
    color: #334155 !important;
}

.welcome-panel,
.control-strip {
    border-left: 6px solid #b91c1c !important;
    border-top: 1px solid #d7deea !important;
    border-right: 1px solid #d7deea !important;
    border-bottom: 1px solid #d7deea !important;
}

.btn.primary,
.vote-btn.yes {
    background: #1d4ed8 !important;
    color: #ffffff !important;
}

.btn.accent {
    background: #b91c1c !important;
    color: #ffffff !important;
}

.btn.danger,
.vote-btn.no {
    background: #dc2626 !important;
    color: #ffffff !important;
}

.btn.dark {
    background: #1f2937 !important;
    color: #ffffff !important;
}

.login-body {
    background: #f3f6fb !important;
}

.login-card {
    border-top: 6px solid #1e3a8a !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #1d4ed8 !important;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .14) !important;
}

/* TV screen must always keep its original black broadcast style. */
body.tv-body {
    min-height: 100vh !important;
    background: #050505 !important;
    color: #ffffff !important;
    overflow: hidden !important;
}

.tv-body .tv-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 24px !important;
    min-height: 112px !important;
    padding: 20px 28px !important;
    border-bottom: 1px solid #2a2a2a !important;
    background: #050505 !important;
    color: #ffffff !important;
}

.tv-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.tv-logo {
    width: 128px !important;
    height: 72px !important;
    max-width: 128px !important;
    max-height: 72px !important;
    object-fit: contain !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    padding: 6px !important;
    flex: 0 0 128px !important;
}

.tv-brand span,
.tv-brand strong {
    display: block;
    color: #ffffff !important;
    line-height: 1.1;
}

.tv-brand span {
    color: #cbd5e1 !important;
    font-size: 18px;
    font-weight: 800;
}

.tv-brand strong {
    margin-top: 4px;
    font-size: 34px;
    font-weight: 900;
}

.tv-body #clock {
    color: #ffffff !important;
    font-size: 30px;
    font-weight: 900;
    white-space: nowrap;
}

.tv-body .tv-content {
    min-height: calc(100vh - 113px) !important;
    padding: 28px !important;
    background: #050505 !important;
    color: #ffffff !important;
}

.tv-body .tv-idle {
    min-height: calc(100vh - 170px) !important;
}

.tv-body .tv-idle h2 {
    color: #ffffff !important;
    opacity: 1 !important;
}

@media (max-width: 900px) {
    .tv-body .tv-header {
        min-height: 96px !important;
        padding: 14px 18px !important;
    }

    .tv-logo {
        width: 92px !important;
        height: 56px !important;
        max-width: 92px !important;
        max-height: 56px !important;
        flex-basis: 92px !important;
    }

    .tv-brand strong {
        font-size: 24px;
    }

    .tv-brand span,
    .tv-body #clock {
        font-size: 16px;
    }
}
