/* ============================================================
   app.css — shared styles for Election Voting System
   ============================================================ */

/* --- Brand color override (#323978) ----------------------- */
:root {
    --bs-body-font-family: "Nunito", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-primary:             #00305f;
    --bs-primary-rgb:         0, 48, 95;
    --bs-link-color:          #00305f;
    --bs-link-hover-color:    #001f3f;
    --brand:                  #00305f;
    --brand-dark:             #001f3f;
    --brand-light:            #cae4db;
    --brand-accent:           #e9ad0f;
    --mist:                   #7a9d96;
    --page-bg:                #f7fbf9;
    --surface-soft:           #eef6f2;
    --sidebar-bg:             #00305f;
    --sidebar-text:           #f7f8ff;
    --sidebar-hover:          rgba(255,255,255,0.17);
    --table-head-text:        #2c4961;
    --table-row-hover:        #edf6f2;
    --stat-primary:           #00305f;
    --stat-success:           #7a9d96;
    --stat-secondary:         #e9ad0f;
    --status-published:       #00305f;
}

[data-theme="teal-gold"] {
    --bs-primary:             #1b2d2f;
    --bs-primary-rgb:         27, 45, 47;
    --bs-link-color:          #1b2d2f;
    --bs-link-hover-color:    #122224;
    --brand:                  #1b2d2f;
    --brand-dark:             #122224;
    --brand-light:            #e4f1f1;
    --brand-accent:           #e3e270;
    --mist:                   #50adb1;
    --page-bg:                #f7fbfb;
    --surface-soft:           #eaf6f6;
    --sidebar-bg:             #1b2d2f;
    --sidebar-text:           #f5f9f9;
    --sidebar-hover:          rgba(228,241,241,0.26);
    --table-head-text:        #214145;
    --table-row-hover:        #edf8f8;
    --stat-primary:           #1b2d2f;
    --stat-success:           #50adb1;
    --stat-secondary:         #e3e270;
    --status-published:       #1b2d2f;
}

[data-theme="care-bright"] {
    --bs-primary:             #14467c;
    --bs-primary-rgb:         20, 70, 124;
    --bs-link-color:          #14467c;
    --bs-link-hover-color:    #0f3560;
    --brand:                  #14467c;
    --brand-dark:             #0f3560;
    --brand-light:            #f8f5ee;
    --brand-accent:           #f9cc48;
    --mist:                   #52b774;
    --page-bg:                #fcfbf7;
    --surface-soft:           #f8f5ee;
    --sidebar-bg:             #14467c;
    --sidebar-text:           #f5f8ff;
    --sidebar-hover:          rgba(248,245,238,0.22);
    --table-head-text:        #1f4d75;
    --table-row-hover:        #f9f7f0;
    --stat-primary:           #14467c;
    --stat-success:           #52b774;
    --stat-secondary:         #f9cc48;
    --status-published:       #14467c;
}

[data-theme="royal-purple"] {
    --bs-primary:             #4b3f72;
    --bs-primary-rgb:         75, 63, 114;
    --bs-link-color:          #4b3f72;
    --bs-link-hover-color:    #3a3158;
    --brand:                  #4b3f72;
    --brand-dark:             #3a3158;
    --brand-light:            #f2eefb;
    --brand-accent:           #d8b4fe;
    --mist:                   #8f7ac0;
    --page-bg:                #f8f7fc;
    --surface-soft:           #f2eefb;
    --sidebar-bg:             #2f2850;
    --sidebar-text:           #f5f2ff;
    --sidebar-hover:          rgba(216,180,254,0.24);
    --table-head-text:        #3f3563;
    --table-row-hover:        #f2eefb;
    --stat-primary:           #4b3f72;
    --stat-success:           #8f7ac0;
    --stat-secondary:         #d8b4fe;
    --status-published:       #4b3f72;
}

[data-theme="sunset-coral"] {
    --bs-primary:             #c44536;
    --bs-primary-rgb:         196, 69, 54;
    --bs-link-color:          #c44536;
    --bs-link-hover-color:    #98362b;
    --brand:                  #c44536;
    --brand-dark:             #98362b;
    --brand-light:            #fff0ec;
    --brand-accent:           #ffbe76;
    --mist:                   #e17055;
    --page-bg:                #fff8f6;
    --surface-soft:           #fff0ec;
    --sidebar-bg:             #7f2c23;
    --sidebar-text:           #fff6f4;
    --sidebar-hover:          rgba(255,190,118,0.24);
    --table-head-text:        #7f2c23;
    --table-row-hover:        #fff1ee;
    --stat-primary:           #c44536;
    --stat-success:           #e17055;
    --stat-secondary:         #ffbe76;
    --status-published:       #c44536;
}

[data-theme="forest-mint"] {
    --bs-primary:             #1f6f5f;
    --bs-primary-rgb:         31, 111, 95;
    --bs-link-color:          #1f6f5f;
    --bs-link-hover-color:    #18574a;
    --brand:                  #1f6f5f;
    --brand-dark:             #18574a;
    --brand-light:            #e9f7f3;
    --brand-accent:           #95d5b2;
    --mist:                   #4ea68e;
    --page-bg:                #f5fbf9;
    --surface-soft:           #e9f7f3;
    --sidebar-bg:             #174e44;
    --sidebar-text:           #effaf6;
    --sidebar-hover:          rgba(149,213,178,0.25);
    --table-head-text:        #1f5d51;
    --table-row-hover:        #ecf8f4;
    --stat-primary:           #1f6f5f;
    --stat-success:           #4ea68e;
    --stat-secondary:         #95d5b2;
    --status-published:       #1f6f5f;
}

[data-theme="slate-amber"] {
    --bs-primary:             #334155;
    --bs-primary-rgb:         51, 65, 85;
    --bs-link-color:          #334155;
    --bs-link-hover-color:    #253244;
    --brand:                  #334155;
    --brand-dark:             #253244;
    --brand-light:            #f3f4f6;
    --brand-accent:           #f59e0b;
    --mist:                   #64748b;
    --page-bg:                #f8fafc;
    --surface-soft:           #f1f5f9;
    --sidebar-bg:             #1e293b;
    --sidebar-text:           #f8fafc;
    --sidebar-hover:          rgba(245,158,11,0.23);
    --table-head-text:        #334155;
    --table-row-hover:        #f1f5f9;
    --stat-primary:           #334155;
    --stat-success:           #64748b;
    --stat-secondary:         #f59e0b;
    --status-published:       #334155;
}

[data-theme="rose-night"] {
    --bs-primary:             #7a1f4d;
    --bs-primary-rgb:         122, 31, 77;
    --bs-link-color:          #7a1f4d;
    --bs-link-hover-color:    #60183d;
    --brand:                  #7a1f4d;
    --brand-dark:             #60183d;
    --brand-light:            #fdf0f6;
    --brand-accent:           #f8b4d9;
    --mist:                   #b65f8f;
    --page-bg:                #fff8fb;
    --surface-soft:           #fdeff6;
    --sidebar-bg:             #4f1432;
    --sidebar-text:           #fff2f8;
    --sidebar-hover:          rgba(248,180,217,0.24);
    --table-head-text:        #6a2248;
    --table-row-hover:        #fdeff6;
    --stat-primary:           #7a1f4d;
    --stat-success:           #b65f8f;
    --stat-secondary:         #f8b4d9;
    --status-published:       #7a1f4d;
}

html, body {
    font-family: var(--bs-body-font-family);
}

.brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.brand-logo-sm {
    width: 24px;
    height: 24px;
}

/* Ensure form and button controls match body font */
button, input, select, textarea, .btn, .form-control, .form-select {
    font-family: var(--bs-body-font-family);
}
.btn-primary {
    background-color: var(--brand);
    border-color:     var(--brand);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--brand-dark);
    border-color:     var(--brand-dark);
}
.btn-outline-primary {
    color:        var(--brand);
    border-color: var(--brand);
}
.btn-outline-primary:hover {
    background-color: var(--brand);
    border-color:     var(--brand);
}
.bg-primary  { background-color: var(--brand) !important; }
.text-primary { color: var(--brand) !important; }
.border-primary { border-color: var(--brand) !important; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

/* --- Admin layout ----------------------------------------- */
#admin-wrapper {
    min-height: 100vh;
}
#admin-sidebar {
    width: 220px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-height: 100vh;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1030;
    align-self: flex-start;
    overflow: hidden;
    background-color: var(--sidebar-bg);
    transition: width .25s ease;
}
#admin-content {
    margin-left: 220px;
    min-width: 0;
}
#admin-sidebar .sidebar-main {
    flex: 1;
}
#admin-sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    border-radius: 4px;
}
#admin-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: background-color .2s ease, transform .2s ease, color .2s ease;
    padding: .55rem .65rem;
    color: var(--sidebar-text) !important;
}
#admin-sidebar .nav-link:hover {
    transform: translateX(2px);
}
#admin-sidebar .nav-link i {
    font-size: 1.05rem;
    width: 18px;
    text-align: center;
}
#admin-sidebar .sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--sidebar-text);
}
#admin-sidebar .sidebar-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
}
#admin-sidebar .sidebar-title {
    display: inline-block;
    font-size: 1.05rem;
    letter-spacing: .02em;
}
#admin-sidebar .admin-role {
    color: rgba(255,255,255,0.72);
}

.admin-layout {
    background-color: var(--page-bg);
}
#admin-content > header {
    background-color: #ffffff;
}

#admin-wrapper.sidebar-collapsed #admin-sidebar {
    width: 76px;
}
html.sidebar-pref-collapsed #admin-sidebar {
    width: 76px;
}
#admin-wrapper.sidebar-collapsed #admin-content {
    margin-left: 76px;
}
html.sidebar-pref-collapsed #admin-content {
    margin-left: 76px;
}
#admin-wrapper.sidebar-collapsed #admin-sidebar .nav-label,
#admin-wrapper.sidebar-collapsed #admin-sidebar .admin-role,
#admin-wrapper.sidebar-collapsed #admin-sidebar .sidebar-title {
    display: none;
}
html.sidebar-pref-collapsed #admin-sidebar .nav-label,
html.sidebar-pref-collapsed #admin-sidebar .admin-role,
html.sidebar-pref-collapsed #admin-sidebar .sidebar-title {
    display: none;
}
#admin-wrapper.sidebar-collapsed #admin-sidebar .sidebar-brand {
    justify-content: center;
    width: 100%;
}
html.sidebar-pref-collapsed #admin-sidebar .sidebar-brand {
    justify-content: center;
    width: 100%;
}
#admin-wrapper.sidebar-collapsed #admin-sidebar .nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
html.sidebar-pref-collapsed #admin-sidebar .nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
#admin-wrapper.sidebar-collapsed #admin-sidebar .nav-link:hover {
    transform: none;
}
html.sidebar-pref-collapsed #admin-sidebar .nav-link:hover {
    transform: none;
}
#admin-wrapper.sidebar-collapsed #admin-sidebar .sidebar-settings {
    align-items: center;
}
html.sidebar-pref-collapsed #admin-sidebar .sidebar-settings {
    align-items: center;
}

#admin-sidebar .sidebar-settings {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.18);
}

/* --- Admin dashboard refresh ------------------------------- */
.dashboard-stats .stat-card {
    border: 0;
    border-radius: 14px;
    overflow: hidden;
}
.dashboard-stats .stat-card .card-body {
    padding: 1.2rem 1.3rem;
}
.dashboard-stats .stat-card .card-title {
    text-transform: uppercase;
    letter-spacing: .05em;
    opacity: .92;
}
.dashboard-stats .stat-card .display-6 {
    font-weight: 700;
    margin-bottom: 0;
}
.dashboard-stats .stat-card-primary {
    background-color: var(--stat-primary);
}
.dashboard-stats .stat-card-success {
    background-color: var(--stat-success);
}
.dashboard-stats .stat-card-secondary {
    background-color: var(--stat-secondary);
}

.dashboard-table {
    border-radius: 14px;
    background: #fff;
}
.dashboard-table .table thead th {
    border-bottom: 0;
    color: var(--table-head-text);
    background: var(--surface-soft);
    font-weight: 600;
}
.dashboard-table .table tbody td {
    border-color: #eef0f8;
}
.dashboard-table .table tbody tr:hover {
    background-color: var(--table-row-hover);
}

/* --- Ballot sections -------------------------------------- */
.ballot-section {
    border-left: 0;
}
.ballot-section .form-check-label {
    cursor: pointer;
}
.ballot-section .form-check-input:checked + .form-check-label strong {
    color: var(--bs-primary);
}

/* --- Candidate photo thumbnails -------------------------- */
.candidate-photo {
    object-fit: cover;
    border: 2px solid #dee2e6;
}

/* --- Ballot timer ----------------------------------------- */
#ballot-timer {
    position: sticky;
    top: 0;
    z-index: 100;
}
#ballot-timer.urgent {
    background-color: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

/* --- Voter layout ----------------------------------------- */
.voter-layout header {
    border-bottom: 1px solid #d9e6e1;
}
.ballot-warning {
    font-size: 0.75rem;
    letter-spacing: .03em;
}

/* --- Status badges ---------------------------------------- */
.status-draft     { background-color: #ffc107; color: #000; }
.status-open      { background-color: #198754; color: #fff; }
.status-closed    { background-color: #6c757d; color: #fff; }
.status-published { background-color: var(--status-published); color: #fff; }

/* --- Settings page ---------------------------------------- */
.settings-page {
    max-width: 760px;
}
.settings-card {
    background: #fff;
    border: 1px solid #e2e9e6;
    border-radius: 12px;
    padding: 1rem;
}
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.page-theme-option {
    width: 100%;
    background: #fff;
    color: #1f2f42;
    border: 1px solid #dbe5e2;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}
.page-theme-option.active {
    border-color: var(--brand-accent);
    background: var(--surface-soft);
}
.page-theme-option .theme-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* --- Voter codes page -------------------------------------- */
.voter-codes-page .voter-code-stat-card {
    border: 0;
    border-radius: 12px;
}
.voter-codes-page .voter-code-stat-card .display-6 {
    font-weight: 700;
}
.voter-codes-page .voter-codes-panel {
    border-radius: 12px;
    overflow: hidden;
}
.voter-codes-page .voter-codes-panel .card-header {
    background: var(--surface-soft);
    border-bottom: 1px solid #dde6e2;
    font-weight: 600;
}
.voter-codes-page .voter-codes-tabs .nav-link {
    border-radius: 999px;
    padding: .38rem .85rem;
    font-size: .86rem;
    color: #415365;
    border: 1px solid #d8e3df;
    background: #fff;
}
.voter-codes-page .voter-codes-tabs .nav-link.active {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}
.voter-codes-page .voter-codes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}
.voter-codes-page .table thead th {
    font-size: .83rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #4c6071;
}
.voter-codes-page .table td {
    vertical-align: middle;
}

/* --- Results page ------------------------------------------ */
.results-page .results-header {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #dfe8e5 !important;
}
.results-stat-card {
    border-radius: 12px;
    border: 1px solid #dfe8e5;
    background: #fff;
}
.results-stat-label {
    color: #667785;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .35rem;
}
.results-stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: #1b2e3a;
    line-height: 1.1;
}
.results-stat-leader {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1b2e3a;
}
.results-table-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #dfe8e5 !important;
}
.results-table-card thead th {
    background: #f3f8f6;
    font-weight: 700;
    color: #304253;
}
.results-rank-badge {
    display: inline-flex;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    background: #eaf4f0;
    color: #1f3a4a;
}
.results-progress {
    height: 10px;
    background: #edf1f4;
}
.results-progress .progress-bar {
    background-color: var(--brand);
}
.results-category-card {
    border-radius: 12px;
    border: 1px solid #dfe8e5 !important;
    overflow: hidden;
}
.results-category-card .card-header {
    background: #f3f8f6;
    border-bottom: 1px solid #dfe8e5;
    font-weight: 700;
}
.results-category-meta {
    display: flex;
    gap: 14px;
    align-items: center;
}
.results-candidate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 16px;
}
.results-candidate-card {
    border: 1px solid #e2e9e6;
    border-radius: 12px;
    padding: 10px 10px 12px;
    background: #fff;
    position: relative;
}
.results-candidate-card.is-leading {
    border-color: #b8d7c8;
}
.results-candidate-rank {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #274658;
    border: 1px solid #d8e3df;
}
.results-candidate-photo-wrap {
    width: 100%;
    height: 190px;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f6f8;
    margin-bottom: 10px;
}
.results-candidate-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.results-candidate-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6f7f8e;
    font-size: .9rem;
}
.results-candidate-name {
    font-weight: 700;
    color: #1b2e3a;
    line-height: 1.25;
    min-height: 38px;
}
.results-candidate-meta {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
@media (max-width: 768px) {
    .results-category-meta {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .results-candidate-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    .results-candidate-photo-wrap {
        height: 150px;
    }
}

/* --- Utility ---------------------------------------------- */
.font-monospace { font-family: var(--bs-font-monospace); }

/* Reports page cards */
.reports-page .report-card {
    border: 1px solid #d9e4ef;
    border-radius: 12px;
    background: #fff;
    transition: border-color .15s ease;
}
.reports-page .report-card:hover {
    border-color: #9ab5cf;
}
.reports-page .report-card-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #d9e4ef;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
    margin-bottom: 8px;
    color: #2f4f6d;
}
.reports-page .report-pdf .report-card-type {
    border-color: #f1c8c8;
    color: #a13232;
}
.reports-page .report-excel .report-card-type {
    border-color: #bedecc;
    color: #1f6a45;
}
.reports-page .report-csv .report-card-type {
    border-color: #cad5e0;
    color: #3a4a5a;
}
.reports-page .report-audit .report-card-type {
    border-color: #d8d0ea;
    color: #5b468a;
}

/* Election edit page */
.election-edit-header {
    border: 1px solid #d9e4ef !important;
    border-radius: 12px;
    background: #ffffff;
}
.election-edit-card {
    border: 1px solid #d9e4ef !important;
    border-radius: 12px;
    background: #ffffff;
}
.election-edit-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: #1b2e3a;
    margin-bottom: .35rem;
}
.election-edit-page .btn {
    border-radius: 10px;
}
.election-edit-title-wrap h5 {
    line-height: 1.2;
}
.election-edit-page .card-body {
    padding: .95rem 1rem;
}
.election-edit-page .form-label {
    margin-bottom: .25rem;
    font-size: .86rem;
    color: #506473;
}
.election-edit-page .btn {
    padding: .34rem .72rem;
    font-size: .86rem;
}

/* Candidates grouped sections */
.candidate-group-card {
    border: 1px solid #d9e4ef;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.candidate-group-header {
    padding: 10px 12px;
    background: #f3f8f6;
    border-bottom: 1px solid #d9e4ef;
    font-weight: 800;
    color: #1f3d55;
}

/* Voter verification — minimal */
.verification-layout {
    min-height: 100vh;
    background: #fafafa;
    font-family: "Inter", "Segoe UI", sans-serif;
    color: #111;
    -webkit-font-smoothing: antialiased;
}
.vfy-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid #eaeaea;
    background: #fff;
}
.vfy-header-brand {
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: -.02em;
}
.vfy-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .82rem;
    color: #666;
}
.vfy-header-link {
    color: #111;
    text-decoration: none;
    font-weight: 500;
}
.vfy-header-link:hover { text-decoration: underline; }
.vfy-header-user { color: #888; }
.vfy-main {
    max-width: 920px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}
.vfy-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.vfy-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -.03em;
}
.vfy-meta {
    margin: .35rem 0 0;
    font-size: .85rem;
    color: #888;
}
.vfy-meta-ok { color: #15803d; }
.vfy-election-tag {
    font-size: .75rem;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .25rem .5rem;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
}
.vfy-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}
.vfy-input {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: .6rem .75rem;
    font: inherit;
    font-size: .9rem;
    color: #111;
    background: #fff;
    transition: border-color .15s;
}
.vfy-input:focus {
    outline: none;
    border-color: #111;
}
.vfy-select {
    flex: 1 1 180px;
    min-width: 0;
}
.vfy-search-wrap {
    flex: 2 1 220px;
    min-width: 0;
}
.vfy-search {
    width: 100%;
}
.vfy-mode {
    display: inline-flex;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.vfy-mode-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.vfy-mode-label {
    padding: .6rem .85rem;
    font-size: .82rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    margin: 0;
    user-select: none;
}
.vfy-mode-input:checked + .vfy-mode-label {
    background: #111;
    color: #fff;
}
.vfy-btn {
    padding: .6rem 1.1rem;
    border: 0;
    border-radius: 8px;
    background: #111;
    color: #fff;
    font: inherit;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
}
.vfy-btn:hover { background: #333; }
.vfy-btn:disabled { opacity: .5; cursor: not-allowed; }
.vfy-message {
    margin-bottom: 1rem;
    padding: .55rem .75rem;
    border-radius: 6px;
    font-size: .85rem;
}
.vfy-message.is-success { background: #f0fdf4; color: #15803d; }
.vfy-message.is-error { background: #fef2f2; color: #b91c1c; }
.vfy-message.is-warning { background: #fffbeb; color: #92400e; }
.vfy-empty {
    margin: 2rem 0;
    text-align: center;
    color: #888;
    font-size: .9rem;
}
.vfy-table-wrap {
    border: 1px solid #eaeaea;
    border-radius: 10px;
    background: #fff;
    overflow: auto;
    max-height: calc(100vh - 220px);
}
.vfy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
.vfy-table thead th {
    position: sticky;
    top: 0;
    background: #fafafa;
    text-align: left;
    font-size: .72rem;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .65rem 1rem;
    border-bottom: 1px solid #eaeaea;
}
.vfy-table tbody td {
    padding: .7rem 1rem;
    border-bottom: 1px solid #f3f3f3;
    vertical-align: middle;
}
.vfy-table tbody tr:last-child td { border-bottom: 0; }
.verification-roll-row.is-highlight { background: #fffbeb; }
.verification-roll-row.is-verified-row { background: #fafdf9; }
.vfy-name { font-weight: 500; }
.vfy-code {
    font-family: ui-monospace, monospace;
    font-size: .82rem;
    color: #666;
    letter-spacing: .03em;
}
.vfy-status { color: #888; font-size: .82rem; }
.vfy-status-ok { color: #15803d; font-weight: 500; }
.vfy-status-wait { color: #a16207; }
.vfy-status-bad { color: #b91c1c; }
.vroll-action { text-align: right; width: 72px; }
.vfy-link {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    font-size: .82rem;
    font-weight: 500;
    color: #111;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.vfy-link:hover { color: #15803d; }
.vfy-link:disabled { opacity: .4; cursor: not-allowed; }
.vfy-check { color: #15803d; font-weight: 600; }
@media (max-width: 640px) {
    .vfy-main { padding: 1rem; }
    .vfy-toolbar { flex-direction: column; }
    .vfy-select, .vfy-search-wrap, .vfy-mode, .vfy-btn { width: 100%; }
    .vfy-mode { justify-content: stretch; }
    .vfy-mode-label { flex: 1; text-align: center; }
    .vfy-table-wrap { max-height: none; }
}

/* Voter counts — display board */
.counts-layout {
    min-height: 100vh;
    background: #f5f5f5;
    font-family: "Inter", "Segoe UI", sans-serif;
    color: #111;
    -webkit-font-smoothing: antialiased;
}
.counts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1.5rem;
    border-bottom: 1px solid #e8e8e8;
    background: #fff;
}
.counts-header-brand {
    font-weight: 700;
    font-size: .9rem;
    letter-spacing: -.02em;
}
.counts-header-link {
    font-size: .82rem;
    font-weight: 500;
    color: #666;
    text-decoration: none;
}
.counts-header-link:hover { color: #111; text-decoration: underline; }
.counts-main {
    min-height: calc(100vh - 49px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem 3rem;
}
.counts-board {
    width: 100%;
    max-width: 720px;
    text-align: center;
}
.counts-picker {
    margin-bottom: 2rem;
}
.counts-picker-select {
    width: 100%;
    max-width: 420px;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: .75rem 1rem;
    font: inherit;
    font-size: .95rem;
    background: #fff;
    color: #111;
}
.counts-election-title {
    margin: 0 0 .5rem;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 600;
    letter-spacing: -.03em;
    line-height: 1.25;
    color: #333;
}
.counts-updated {
    margin: 0 0 2.5rem;
    font-size: .85rem;
    color: #999;
}
.counts-hero {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(1.5rem, 6vw, 4rem);
    margin-bottom: 2.5rem;
}
.counts-hero-stat { text-align: center; }
.counts-hero-value {
    display: block;
    font-size: clamp(4rem, 14vw, 7.5rem);
    font-weight: 700;
    letter-spacing: -.05em;
    line-height: 1;
    color: #111;
    font-variant-numeric: tabular-nums;
}
.counts-hero-stat-primary .counts-hero-value { color: #15803d; }
.counts-hero-label {
    display: block;
    margin-top: .6rem;
    font-size: .8rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.counts-bar-block {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 560px;
    margin: 0 auto 1.25rem;
}
.counts-bar-large {
    flex: 1;
    height: 10px;
    border-radius: 999px;
    background: #e0e0e0;
    overflow: hidden;
}
.counts-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: #111;
    transition: width .4s ease;
}
.counts-turnout-large {
    font-size: 1.1rem;
    font-weight: 600;
    color: #444;
    min-width: 3.5rem;
    font-variant-numeric: tabular-nums;
}
.counts-footnote {
    margin: 0;
    font-size: .95rem;
    color: #888;
}
.counts-empty {
    margin: 0;
    font-size: 1rem;
    color: #888;
}
@media (max-width: 640px) {
    .counts-main { padding: 1.5rem 1rem 2rem; align-items: flex-start; }
    .counts-hero { flex-direction: column; align-items: center; gap: 1.5rem; }
}
