:root {
    --ssc-teal: #6BB2B3;
    --ssc-sage: #9CA18E;
    --ssc-stone: #6F735F;
    --ssc-light: #F7EBD7;
    --ssc-orange: #F49322;
    --ssc-amber: #E4803F;
    --ssc-yellow: #FBE5C1;
    --ssc-soft-yellow: #F7D6A7;
    --ssc-beige: #F7EBD7;
    --ssc-cream: #FBE5C1;
    --ssc-gold: #F49322;
    --ssc-brown: #4F564C;
    --ssc-body: #2F312A;
    --ssc-nav: #3F6665;
    --ssc-white: #FFFFFF;
    --ssc-border: rgba(111, 115, 95, 0.35);
    --ssc-green: #6BB2B3;
    --ssc-red: #E4803F;
    --ssc-ink: #1f1e1b;
    --shadow-soft: 0 16px 40px rgba(63, 102, 101, 0.16);
    --shadow-hover: 0 24px 48px rgba(63, 102, 101, 0.22);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #fffbfa;
    /* Slightly cleaner background */
    color: var(--ssc-body);
    font-family: 'Public Sans', system-ui, -apple-system, sans-serif !important;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ssc-brown);
    transition: color 0.2s ease, transform 0.2s ease;
}

h1,
h2,
h3,
h4 {
    color: var(--ssc-brown);
    font-family: 'Public Sans', system-ui, sans-serif !important;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.site-navbar {
    background: rgba(255, 211, 61, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(122, 63, 0, 0.12);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand-lockup {
    align-items: center;
    color: var(--ssc-nav);
    display: inline-flex;
    font-weight: 800;
    gap: 0.65rem;
    text-decoration: none;
}

.brand-lockup:hover {
    color: var(--ssc-brown);
}

.brand-mark {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: var(--ssc-yellow);
    display: inline-flex;
    font-size: 0.9rem;
    height: 2.35rem;
    justify-content: center;
    overflow: hidden;
    width: 2.35rem;
}

.brand-mark img,
.ssc-logo-img {
    background: transparent;
    border-radius: 50%;
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.navbar-nav .nav-link {
    color: var(--ssc-nav);
    font-weight: 700;
}

.hero-band {
    background: linear-gradient(135deg, var(--ssc-yellow), var(--ssc-soft-yellow));
    min-height: 74vh;
    padding: 5.25rem 0 3.5rem;
}

.hero-grid {
    align-items: center;
    display: grid;
    gap: 3rem;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.hero-copy h1 {
    font-size: clamp(2.35rem, 5vw, 4.85rem);
    line-height: 1.03;
    max-width: 900px;
}

.hero-copy .lead {
    color: var(--ssc-nav);
    font-size: 1.2rem;
    max-width: 760px;
}

.hero-intro-pubmat {
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(111, 115, 95, 0.2);
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(47, 49, 42, 0.18);
    margin: 1.4rem 0 0;
    max-width: min(420px, 100%);
    overflow: hidden;
}

.hero-intro-pubmat img {
    aspect-ratio: 1 / 1;
    display: block;
    object-fit: contain;
    object-position: center;
    width: 100%;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 2rem;
}

.hero-status {
    align-items: center;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(122, 63, 0, 0.16);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 148px 1fr;
    padding: 1.25rem;
}

.hero-status p {
    color: var(--ssc-nav);
    margin: 0.7rem 0 0;
}

.hero-seal {
    background: transparent;
    border-radius: 50%;
    display: block;
    height: 108px;
    object-fit: cover;
    width: 108px;
}

.hero-pubmat {
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(47, 49, 42, 0.14);
    height: 140px;
    object-fit: contain;
    object-position: center;
    width: 140px;
}

.hero-form-panel {
    width: 100%;
}

.btn-google-bsu {
    align-items: center;
    background: #fff;
    border: 1.5px solid rgba(111, 115, 95, 0.3);
    border-radius: 8px;
    color: #3c4043;
    display: flex;
    font-family: 'Public Sans', sans-serif !important;
    font-size: 0.95rem;
    font-weight: 700;
    gap: 0.75rem;
    justify-content: center;
    padding: 0.7rem 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 100%;
}



.btn-google-bsu:hover {
    background: #f8f9fa;
    border-color: #4285F4;
    box-shadow: 0 4px 16px rgba(66, 133, 244, 0.18);
    color: #3c4043;
    transform: translateY(-1px);
}

.google-agreement-note {
    margin-top: 0.9rem;
}

.google-access-note {
    align-items: center;
    background: rgba(107, 178, 179, 0.1);
    border: 1px solid rgba(63, 102, 101, 0.18);
    border-radius: 8px;
    color: var(--ssc-nav);
    display: flex;
    font-size: 0.78rem;
    font-weight: 650;
    gap: 0.5rem;
    justify-content: flex-start;
    line-height: 1.4;
    margin: 0.9rem 0 0;
    padding: 0.6rem 0.7rem;
    text-align: left;
}

.google-access-note i {
    color: var(--ssc-nav);
    flex: 0 0 auto;
    font-size: 1rem;
}

.eyebrow {
    color: var(--ssc-nav);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.btn {
    border-radius: 8px;
    font-weight: 700;
    font-family: 'Public Sans', sans-serif !important;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.btn:active {
    transform: translateY(1px);
}

.spin {
    animation: rotate 1s linear infinite;
    display: inline-block;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.btn-brown {
    background: linear-gradient(135deg, var(--ssc-brown), var(--ssc-nav));
    border: none;
    color: var(--ssc-white);
}

.btn-brown:hover,
.btn-brown:focus {
    background: linear-gradient(135deg, var(--ssc-nav), var(--ssc-ink));
    color: var(--ssc-yellow);
    box-shadow: 0 8px 24px rgba(92, 47, 0, 0.25);
}

.btn-outline-brown {
    border-color: var(--ssc-brown);
    color: var(--ssc-brown);
}

.btn-outline-brown:hover,
.btn-outline-brown:focus {
    background: var(--ssc-brown);
    border-color: var(--ssc-brown);
    color: var(--ssc-white);
}

.section-band {
    background: var(--ssc-beige);
    border-top: 6px solid var(--ssc-gold);
    padding: 3.5rem 0;
}

.content-band {
    background: #fff9ea;
    padding: 3.5rem 0 4.5rem;
}

.section-heading {
    margin-bottom: 1.5rem;
}

.section-heading h2 {
    font-size: clamp(1.6rem, 3vw, 2.5rem);
}

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

.metric-card {
    background: var(--ssc-white);
    border: 1px solid rgba(201, 147, 59, 0.45);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(122, 63, 0, 0.08);
    padding: 1.25rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--ssc-brown);
}

.metric-card span {
    color: var(--ssc-body);
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    min-height: 1.4rem;
}

.metric-card strong {
    color: var(--ssc-brown);
    display: block;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    line-height: 1;
    margin-top: 0.65rem;
}

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

.step-card,
.form-card,
.admin-panel,
.empty-state {
    background: var(--ssc-white);
    border: 1px solid rgba(201, 147, 59, 0.42);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(122, 63, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.step-card:hover,
.form-card:focus-within {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.step-card {
    padding: 1.25rem;
}

.step-card i {
    color: var(--ssc-brown);
    font-size: 2rem;
}

.step-card h3 {
    font-size: 1.2rem;
    margin-top: 0.85rem;
}

.compact-page {
    background: linear-gradient(135deg, var(--ssc-yellow), #fff8dc 58%, #fff9ea);
    min-height: calc(100vh - 124px);
    padding: 4rem 0;
}


.form-card {
    padding: 1.35rem;
}

.form-control,
.form-select {
    border-color: rgba(201, 147, 59, 0.75);
    border-radius: 8px;
    color: var(--ssc-ink);
    min-height: 2.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ssc-brown);
    box-shadow: 0 0 0 0.2rem rgba(255, 211, 61, 0.32);
}

.form-label {
    color: var(--ssc-brown);
    font-weight: 750;
}

.flash-container {
    margin-top: 1rem;
}

.alert {
    border-radius: 8px;
}

.status-pill {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    justify-content: center;
    min-width: 76px;
    padding: 0.35rem 0.7rem;
    text-transform: uppercase;
}

.status-pill.is-open {
    background: rgba(40, 122, 75, 0.12);
    color: var(--ssc-green);
}

.status-pill.is-closed {
    background: rgba(180, 35, 24, 0.12);
    color: var(--ssc-red);
}

.status-pill.is-pending {
    background: rgba(122, 63, 0, 0.1);
    color: var(--ssc-brown);
}

.ballot-page {
    background: #fff9ea;
    padding: 2rem 0 4rem;
}

.ballot-header,
.submit-strip {
    align-items: center;
    background: var(--ssc-yellow);
    border: 1px solid rgba(122, 63, 0, 0.18);
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding: 1.2rem;
}

.ballot-header h1 {
    margin: 0;
}

.ballot-header p,
.position-heading p,
.submit-strip span {
    color: var(--ssc-nav);
    margin: 0;
}

.position-block {
    background: var(--ssc-cream);
    border: 1px solid rgba(201, 147, 59, 0.65);
    border-radius: 8px;
    margin-bottom: 1.25rem;
    padding: 1rem;
}

.position-heading {
    align-items: start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.position-heading h2 {
    font-size: 1.45rem;
    margin-bottom: 0.25rem;
}

.position-heading>span {
    background: var(--ssc-white);
    border-radius: 8px;
    color: var(--ssc-brown);
    flex: 0 0 auto;
    font-weight: 800;
    padding: 0.5rem 0.7rem;
}

.candidate-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.candidate-card {
    background: var(--ssc-white);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    gap: 0.6rem;
    min-height: 100%;
    padding: 0.75rem;
    position: relative;
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.candidate-card:hover {
    border-color: rgba(122, 63, 0, 0.4);
    box-shadow: 0 12px 22px rgba(122, 63, 0, 0.12);
    transform: translateY(-2px);
}

.candidate-card input {
    accent-color: var(--ssc-brown);
    height: 1.15rem;
    position: absolute;
    right: 0.8rem;
    top: 0.8rem;
    width: 1.15rem;
}

.candidate-card:has(input:checked) {
    border-color: var(--ssc-brown);
    box-shadow: 0 14px 26px rgba(122, 63, 0, 0.16);
}

.candidate-card img {
    aspect-ratio: 4 / 3;
    background: var(--ssc-soft-yellow);
    border-radius: 8px;
    object-fit: cover;
    width: 100%;
}

.candidate-name {
    color: var(--ssc-brown);
    font-size: 1.05rem;
    font-weight: 800;
}

.candidate-card small {
    color: var(--ssc-body);
    font-weight: 700;
}

.empty-inline {
    background: var(--ssc-white);
    border: 1px dashed var(--ssc-border);
    border-radius: 8px;
    color: var(--ssc-brown);
    font-weight: 750;
    padding: 1rem;
}

.submit-strip {
    margin-top: 1.5rem;
}

.submit-strip strong,
.submit-strip span {
    display: block;
}

.receipt-state {
    margin: 0 auto;
    max-width: 680px;
}

.receipt-state>i {
    color: var(--ssc-green);
    font-size: 3rem;
}

.receipt-code {
    background: var(--ssc-cream);
    border: 1px dashed var(--ssc-border);
    border-radius: 8px;
    color: var(--ssc-brown);
    display: inline-block;
    font-size: 1.3rem;
    font-weight: 850;
    margin: 1rem 0;
    padding: 0.75rem 1rem;
}

.empty-state {
    padding: 2rem;
    text-align: center;
}

.admin-shell {
    background: #fff9ea;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
    font-family: 'Public Sans', system-ui, sans-serif !important;
}

.admin-shell h1,
.admin-shell h2,
.admin-shell h3,
.admin-shell h4,
.admin-shell strong,
.admin-shell b,
.admin-shell .eyebrow,
.admin-shell .ssc-dashboard-tagline {
    font-family: 'Public Sans', system-ui, sans-serif !important;
}

.admin-sidebar {
    background: var(--ssc-brown);
    color: var(--ssc-white);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 100vh;
    padding: 1rem;
    position: sticky;
    top: 0;
}

.admin-brand {
    color: var(--ssc-white);
    padding: 0.45rem 0;
}

.admin-brand .brand-mark {
    background: var(--ssc-yellow);
    color: var(--ssc-brown);
}

.admin-nav {
    display: grid;
    gap: 0.4rem;
}

.admin-nav a {
    align-items: center;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.88);
    display: flex;
    gap: 0.65rem;
    min-height: 2.6rem;
    padding: 0.65rem 0.8rem;
    text-decoration: none;
}

.admin-nav a:hover,
.admin-nav a:focus {
    background: rgba(255, 211, 61, 0.16);
    color: var(--ssc-yellow);
}

.admin-main {
    min-width: 0;
}

.admin-topbar {
    align-items: center;
    background: var(--ssc-yellow);
    border-bottom: 1px solid rgba(122, 63, 0, 0.18);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem 1.5rem;
}

.admin-topbar h1 {
    font-size: 1.6rem;
    margin: 0;
}

.admin-user {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    color: var(--ssc-brown);
    display: grid;
    line-height: 1.2;
    padding: 0.55rem 0.75rem;
    text-align: right;
}

.admin-user span {
    font-weight: 800;
}

.admin-user small {
    text-transform: capitalize;
}

.admin-content {
    display: grid;
    gap: 1rem;
    padding: 1.5rem;
}

.admin-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
}

.admin-panel {
    overflow: hidden;
    padding: 1rem;
}

.panel-heading,
.report-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.panel-heading h2,
.report-header h2 {
    font-size: 1.3rem;
    margin: 0;
}

.table {
    --bs-table-bg: transparent;
    color: var(--ssc-body);
}

.table th {
    color: var(--ssc-brown);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.voter-admin-grid {
    grid-template-columns: 1fr !important;
}

.election-settings-grid {
    grid-template-columns: 1fr !important;
}

.ballot-content-grid {
    grid-template-columns: 1fr !important;
}

.ballot-content-panel {
    max-width: 980px;
}

.ballot-admin-preview {
    margin-bottom: 0;
}

.election-settings-panel {
    max-width: 920px;
}

.election-settings-form .btn-group {
    width: 100%;
}

.election-settings-form .btn-group .btn {
    flex: 1 1 0;
}

.voter-registry-panel {
    padding: 1.5rem;
}

.voter-registry-heading {
    align-items: flex-start;
}

.voter-registry-heading .panel-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.voter-registry-panel.is-loading {
    opacity: 0.82;
    transition: opacity 0.15s ease;
}

.voter-filter-bar {
    align-items: end;
    background: rgba(248, 250, 252, 0.86);
    border: 1px solid rgba(111, 115, 95, 0.12);
    border-radius: 14px;
    display: grid;
    gap: 0.8rem;
    grid-template-columns: minmax(180px, 0.85fr) minmax(240px, 1.15fr);
    margin-bottom: 0.8rem;
    padding: 0.85rem;
}

.voter-filter-field {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
}

.voter-filter-field span {
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 850;
    text-transform: uppercase;
}

.voter-filter-field input,
.voter-filter-field select {
    background: #ffffff;
    border: 1px solid rgba(176, 106, 36, 0.18);
    border-radius: 10px;
    color: #263248;
    font-weight: 700;
    min-width: 0;
    padding: 0.62rem 0.75rem;
    width: 100%;
}

.voter-filter-field input:focus,
.voter-filter-field select:focus {
    border-color: var(--ssc-orange);
    box-shadow: 0 0 0 3px rgba(244, 147, 34, 0.12);
    outline: none;
}

.voter-filter-submit,
.voter-filter-reset {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 42px;
    white-space: nowrap;
}

.voter-filter-actions {
    display: flex;
    grid-column: 1 / -1;
    gap: 0.55rem;
    justify-content: flex-end;
}

.voter-filter-actions .btn,
.voter-filter-actions .btn-filter-reset {
    flex: 0 0 auto;
}

.voter-table-summary {
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.78rem;
    font-weight: 750;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.voter-table-wrap {
    border: 1px solid rgba(111, 115, 95, 0.12);
    border-radius: 14px;
    max-height: 700px;
    overflow: auto;
    background: #fff;
}

.voter-table {
    margin-bottom: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.voter-table th {
    background: #fdfaf5 !important;
    color: #4f564c !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    padding: 1rem 1.25rem !important;
    border-bottom: 2px solid rgba(111, 115, 95, 0.08) !important;
    position: sticky;
    top: 0;
    z-index: 10;
}

.voter-row-new td {
    padding: 0.75rem 1.25rem !important;
    border-bottom: 1px solid rgba(111, 115, 95, 0.05) !important;
    vertical-align: middle !important;
}

.voter-row-new:hover {
    background: rgba(16, 185, 129, 0.02);
}

/* SR Pill */
.voter-sr-pill {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-family: 'Public Sans', monospace;
    border: 1px solid #e2e8f0;
}

/* Profile Box */
.voter-profile-box {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.voter-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #064e3b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.voter-id-info {
    display: flex;
    flex-direction: column;
}

.voter-name-label {
    color: #1e293b;
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.2;
}

.voter-email-sub {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 500;
}

/* Academic Stack */
.voter-academic-stack {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.college-tag {
    color: #b06a24;
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.program-text {
    color: #334155;
    font-weight: 600;
    font-size: 0.82rem;
}

.level-badge {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 500;
}

/* Status Badge */
.voter-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.voter-status-badge.is-voted {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.voter-status-badge.is-pending {
    background: #f1f5f9;
    color: #64748b;
}

.status-alignment {
    display: flex;
    justify-content: flex-end;
}

.voter-person,
.voter-academic {
    display: grid;
    gap: 0.2rem;
}

.voter-person strong,
.voter-academic strong,
.voter-academic span {
    color: #0f172a;
    font-weight: 850;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.voter-person small,
.voter-academic small {
    color: #64748b;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.voter-empty-state {
    align-items: center;
    color: #64748b;
    display: grid;
    gap: 0.25rem;
    justify-items: center;
    padding: 2.5rem 1rem;
    text-align: center;
}

.voter-empty-state i {
    color: var(--ssc-orange);
    font-size: 1.8rem;
}

.voter-empty-state strong {
    color: #263248;
    font-size: 1rem;
}

.voter-actions-column {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.voter-add-toggle {
    align-items: center;
    box-shadow: 0 10px 20px rgba(79, 86, 76, 0.2);
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    padding: 1rem;
    width: 100%;
}

/* --- Voter Modal System --- */
.voter-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(0px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    transition: backdrop-filter 0.3s ease;
    padding: 1.5rem;
}

.voter-modal-overlay.is-open {
    backdrop-filter: blur(10px);
}

.voter-modal-content {
    max-width: 650px !important;
    width: 100% !important;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    margin-bottom: 0 !important;
}

.voter-modal-content.is-open {
    transform: translateY(0);
    opacity: 1;
}

.btn-close-modal {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
}

.btn-close-modal:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: rotate(90deg);
}

/* --- Professional Upload Zones --- */
.import-upload-zone {
    position: relative;
    border: 2px dashed rgba(111, 115, 95, 0.2);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}

.import-upload-zone:hover,
.import-upload-zone.has-file {
    border-color: var(--ssc-brown);
    background: rgba(176, 106, 36, 0.03);
    transform: translateY(-2px);
}

.import-upload-zone i {
    font-size: 2.5rem;
    color: var(--ssc-brown);
    margin-bottom: 1rem;
    display: block;
}

.import-upload-zone p {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.import-upload-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-hint {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.photo-upload-zone {
    padding: 2rem 1.25rem;
}

.photo-upload-zone i {
    font-size: 2rem;
}

.csv-format-note {
    align-items: flex-start;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
    color: #4f564c;
    display: flex;
    font-size: 0.82rem;
    gap: 0.55rem;
    line-height: 1.55;
    margin-bottom: 1rem;
    padding: 1rem;
}

#saveVoterBtn:disabled,
#importBtn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.result-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.result-card {
    background: var(--ssc-cream);
    border: 1px solid rgba(201, 147, 59, 0.45);
    border-radius: 8px;
    padding: 1rem;
}

.result-card h3 {
    font-size: 1.1rem;
}

.result-row {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 0.7rem;
}

.result-row span {
    color: var(--ssc-nav);
    font-weight: 750;
}

.result-row strong {
    color: var(--ssc-brown);
}

.result-bar {
    background: rgba(122, 63, 0, 0.12);
    border-radius: 999px;
    height: 0.55rem;
    margin-top: 0.35rem;
    overflow: hidden;
}

.result-bar span {
    background: var(--ssc-gold);
    display: block;
    height: 100%;
}

.candidate-position-block {
    margin-bottom: 3rem !important;
}

.position-title-premium {
    font-size: 1.15rem;
    color: var(--ssc-brown);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-left: 5px solid var(--ssc-brown);
    padding-left: 1.25rem;
}

.candidate-management-table {
    width: 100%;
}

.candidate-management-table thead th {
    background: #fdfaf5 !important;
    border-bottom: 2px solid rgba(111, 115, 95, 0.08) !important;
    color: #64748b !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    padding: 1.25rem 1rem !important;
}

.candidate-management-table tbody td {
    padding: 1rem !important;
    border-bottom: 1px solid rgba(111, 115, 95, 0.05) !important;
}

.candidate-management-table tbody tr:hover td {
    background: rgba(16, 185, 129, 0.02) !important;
}

.sort-order-badge {
    background: #f1f5f9;
    color: #475569;
    font-weight: 800;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
}

.candidate-table-photo img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.candidate-table-identity strong {
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 700;
}

.btn-icon-only {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.25rem;
}

.btn-icon-only:hover {
    background: rgba(176, 106, 36, 0.1);
    color: var(--ssc-brown);
    transform: scale(1.1);
}

.btn-icon-only.text-danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

.candidate-admin-item strong,
.candidate-admin-item span {
    display: block;
}

.muted-copy {
    color: var(--ssc-body);
}



.admin-shell {
    background: #eef2f7;
    color: #263248;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 2rem 3rem !important;
}

.admin-profile-logout-form {
    margin: 0;
}

.admin-profile-dropdown {
    position: relative;
}

.admin-profile-btn {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 12px;
    color: inherit;
    cursor: pointer;
    display: flex;
    font: inherit;
    gap: 0.8rem;
    padding: 0.4rem 0.8rem;
    transition: all 0.2s ease;
}

.admin-profile-btn::after {
    display: none;
}

.admin-profile-menu {
    border: 1px solid rgba(111, 115, 95, 0.2);
    border-radius: 12px;
    box-shadow: 0 18px 36px rgba(47, 49, 42, 0.16);
    min-width: 220px;
    padding: 0.45rem;
}

.admin-profile-menu-header {
    border-bottom: 1px solid rgba(111, 115, 95, 0.14);
    display: grid;
    gap: 0.15rem;
    padding: 0.65rem 0.75rem 0.7rem;
}

.admin-profile-menu-header strong {
    color: #1f1817;
    font-size: 0.9rem;
    line-height: 1.2;
}

.admin-profile-menu-header span {
    color: rgba(31, 24, 23, 0.68);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-logout-item {
    align-items: center;
    border-radius: 8px;
    color: var(--ssc-brown);
    display: flex;
    font-weight: 800;
    gap: 0.5rem;
    padding: 0.68rem 0.75rem;
}

.admin-logout-item:hover,
.admin-logout-item:focus {
    background: rgba(244, 147, 34, 0.14);
    color: var(--ssc-brown);
}

.admin-user-info {
    align-items: flex-end;
    flex-direction: column;
    line-height: 1.2;
}

.admin-user-info span {
    color: #1f1817;
    font-weight: 800;
}

.admin-user-info small {
    color: rgba(31, 24, 23, 0.7);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-avatar-circle {
    align-items: center;
    background: #fff;
    border: 2px solid rgba(31, 24, 23, 0.1);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    color: #1f1817;
    display: flex;
    font-size: 1.4rem;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.admin-profile-btn:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-1px);
}

.admin-profile-btn:active {
    transform: translateY(0);
}

.admin-sidebar {
    align-self: start;
    background: #eef2f7;
    color: #4e617d;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

.admin-brand {
    color: #182238;
    display: grid;
    grid-template-columns: 42px 1fr;
    line-height: 1.1;
    padding: 0.45rem 0.55rem;
}

.admin-brand .brand-mark {
    background: var(--ssc-yellow);
    border: 5px solid var(--ssc-white);
    box-shadow: 0 8px 24px rgba(122, 63, 0, 0.14);
    color: var(--ssc-brown);
    height: 42px;
    width: 42px;
}

.admin-brand strong,
.admin-brand small {
    display: block;
}

.admin-brand small {
    color: #50627f;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-top: 0.22rem;
    text-transform: uppercase;
}

.admin-nav {
    display: grid;
    gap: 0.55rem;
}

.admin-nav a,
.admin-signout {
    align-items: center;
    border: 0;
    border-radius: 999px;
    color: #50627f;
    display: flex;
    font-weight: 750;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0.62rem 1rem;
    text-decoration: none;
    transition: background 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
    width: 100%;
}

.admin-nav a:hover,
.admin-nav a:focus,
.admin-nav a.is-active {
    background: var(--ssc-white);
    box-shadow: 0 10px 24px rgba(38, 50, 72, 0.08);
    color: var(--ssc-brown);
    transform: translateY(-1px);
}

.admin-nav i,
.admin-signout i {
    font-size: 1.05rem;
    width: 1.1rem;
}

.admin-signout {
    background: transparent;
    text-align: left;
}

.admin-signout:hover,
.admin-signout:focus {
    background: rgba(122, 63, 0, 0.08);
    color: var(--ssc-brown);
}

.admin-main {
    min-width: 0;
}

.admin-topbar {
    align-items: center;
    background: var(--ssc-white);
    border: 0;
    border-radius: 0 0 0 28px;
    box-shadow: 0 16px 36px rgba(38, 50, 72, 0.08);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    min-height: 96px;
    padding: 1.45rem 2rem;
}

.admin-topbar h1 {
    color: #182238;
    font-family: 'Public Sans', system-ui, sans-serif !important;
    font-size: clamp(1.45rem, 3vw, 1.7rem);
    line-height: 1.1;
    margin: 0;
}

.admin-topbar p {
    color: #60708d;
    font-weight: 650;
    margin: 0.25rem 0 0;
}

.admin-topbar p span {
    color: var(--ssc-brown);
    font-weight: 850;
    margin-left: 0.45rem;
}

.admin-user {
    background: #f8fafc;
    border: 1px solid rgba(80, 98, 127, 0.12);
    border-radius: 999px;
    color: #182238;
    display: grid;
    line-height: 1.15;
    min-width: 158px;
    padding: 0.65rem 1rem;
    text-align: right;
}

.admin-user span {
    font-weight: 850;
}

.admin-user small {
    color: #60708d;
    text-transform: capitalize;
}

.admin-content {
    display: grid;
    gap: 1.5rem;
    padding: 1rem 2rem 2rem;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
    align-items: stretch;
}

@media (max-width: 1200px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-stat-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-stat-card {
    align-items: center;
    background: var(--ssc-white) !important;
    border: 1px solid rgba(80, 98, 127, 0.05) !important;
    border-radius: 24px !important;
    box-shadow: 0 10px 30px rgba(38, 50, 72, 0.08) !important;
    display: grid;
    gap: 0.9rem;
    grid-template-columns: 52px 1fr;
    min-height: 136px;
    padding: 1.4rem 1.5rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.dashboard-stat-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 20px 40px rgba(38, 50, 72, 0.12) !important;
    border-color: rgba(107, 178, 179, 0.2) !important;
}

.dashboard-stat-card span,
.dashboard-stat-card small {
    color: #667592;
    display: block;
    font-weight: 760;
}

.dashboard-stat-card strong {
    color: #263248;
    display: block;
    font-family: 'Public Sans', system-ui, sans-serif !important;
    font-size: clamp(1.65rem, 3vw, 2rem);
    line-height: 1.05;
    margin: 0.2rem 0;
}

.dashboard-stat-card small {
    font-size: 0.82rem;
}

.college-count-panel {
    display: grid;
    gap: 1rem;
}

/* Campus-Wide Turnout Hero */
.campus-turnout-hero {
    margin-bottom: 1.5rem;
}

.campus-turnout-card {
    background: #faf7ed;
    border: 1px solid rgba(133, 77, 14, 0.1);
    border-radius: 20px;
    padding: 1.25rem 2rem;
    display: block;
    text-decoration: none;
    color: #1e293b !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(133, 77, 14, 0.06);
    transition: all 0.3s ease;
}

.campus-turnout-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(133, 77, 14, 0.1);
}

.campus-turnout-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.campus-tag {
    color: #854d0e;
    font-weight: 900;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.campus-big-number {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.04em;
    margin: 0;
    color: #1e293b;
}

.campus-student-count {
    color: #64748b;
    font-weight: 700;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.campus-turnout-right {
    text-align: right;
}

.overall-label {
    font-weight: 900;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.15rem;
    letter-spacing: 0.05em;
}

.overall-percentage {
    font-size: 2.75rem;
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.03em;
    color: #854d0e;
}

.campus-turnout-progress {
    height: 5px;
    background: rgba(133, 77, 14, 0.1);
    border-radius: 20px;
    width: 100%;
    overflow: hidden;
}

.campus-progress-bar {
    height: 100%;
    background: #854d0e;
    border-radius: 20px;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* College Turnout Rows */
.college-turnout-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: 440px;
    /* Approximately 4 items */
    overflow-y: auto;
    padding-right: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(133, 77, 14, 0.2) transparent;
}

.college-turnout-list::-webkit-scrollbar {
    width: 5px;
}

.college-turnout-list::-webkit-scrollbar-track {
    background: transparent;
}

.college-turnout-list::-webkit-scrollbar-thumb {
    background: rgba(133, 77, 14, 0.15);
    border-radius: 10px;
}

.college-turnout-list::-webkit-scrollbar-thumb:hover {
    background: rgba(133, 77, 14, 0.3);
}

.college-turnout-list.college-turnout-list--canvassing-dashboard {
    max-height: min(440px, 52vh);
}

.college-turnout-row {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    border-radius: 12px !important;
    padding: 1rem 1.5rem !important;
    text-decoration: none !important;
    color: inherit !important;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
    position: relative;
    padding-left: 2.25rem !important;
}

.college-turnout-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 5px;
    border-radius: 0 4px 4px 0;
    background: #e2e8f0;
}

.program-count-panel--plain .college-turnout-row::before {
    display: none;
}

.program-count-panel--plain .program-turnout-row {
    padding-left: 1.5rem !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
}

.program-count-panel--plain .program-turnout-row:hover {
    transform: translateY(-2px) !important;
}

.program-count-panel--plain .turnout-badge {
    background: #f8fafc;
    color: #334155;
}

.program-count-panel--plain .progress-fill {
    background: #94a3b8;
}

.program-turnout-list {
    max-height: 520px;
}

.program-grade-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.program-grade-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 0.9rem 1rem;
}

.program-grade-card p {
    margin: 0;
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 700;
}

.program-grade-card strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.35rem;
    color: #0f172a;
}

.program-grade-card small {
    color: #64748b;
}

.college-turnout-row:hover {
    transform: translateX(6px) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06) !important;
}

.college-row-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.college-row-title {
    font-size: 1.05rem !important;
    font-weight: 850 !important;
    color: #1e293b !important;
    margin: 0 0 0.25rem 0 !important;
}

.college-row-meta {
    display: flex;
    gap: 1.25rem;
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 700;
}

.voted-label strong {
    color: #1e293b;
    font-weight: 850;
}

.turnout-badge {
    background: #f8fafc;
    color: #64748b;
    padding: 0.4rem 1rem;
    border-radius: 10px;
    font-weight: 900;
    font-size: 0.95rem;
}

.college-row-progress {
    height: 6px;
    background: #f1f5f9;
    border-radius: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #cbd5e1;
    border-radius: 20px;
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}


/* Specialized Colors */
.college-card-yellow-white::before {
    background: #f59e0b !important;
}

.college-card-yellow-white .turnout-badge {
    background: #fef9c3 !important;
    color: #b45309 !important;
}

.college-card-yellow-white .progress-fill {
    background: #f59e0b !important;
}

.college-card-green-white::before {
    background: #10b981 !important;
}

.college-card-green-white .turnout-badge {
    background: #d1fae5 !important;
    color: #065f46 !important;
}

.college-card-green-white .progress-fill {
    background: #10b981 !important;
}

.college-card-red-white::before {
    background: #ef4444 !important;
}

.college-card-red-white .turnout-badge {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.college-card-red-white .progress-fill {
    background: #ef4444 !important;
}

.college-card-blue-white::before {
    background: #3b82f6 !important;
}

.college-card-blue-white .turnout-badge {
    background: #dbeafe !important;
    color: #1e40af !important;
}

.college-card-blue-white .progress-fill {
    background: #3b82f6 !important;
}

.college-card-gray-white::before {
    background: #475569 !important;
}

.college-card-gray-white .turnout-badge {
    background: #f1f5f9 !important;
    color: #1e293b !important;
}

.college-card-gray-white .progress-fill {
    background: #475569 !important;
}

.college-card-purple-white::before {
    background: #8b5cf6 !important;
}

.college-card-purple-white .turnout-badge {
    background: #f5f3ff !important;
    color: #5b21b6 !important;
}

.college-card-purple-white .progress-fill {
    background: #8b5cf6 !important;
}


.turnout-zero {
    color: #000000 !important;
}

.college-card-yellow-white {
    background: linear-gradient(135deg, #ffffff, #fef9c3) !important;
    border-color: rgba(244, 147, 34, 0.4) !important;
}

.college-card-yellow-white:hover {
    background: linear-gradient(135deg, #ffffff, #fef3c7) !important;
    box-shadow: 0 24px 48px rgba(234, 179, 8, 0.2) !important;
}

.college-card-green-white {
    background: linear-gradient(135deg, #ffffff, #ecfdf5) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.college-card-green-white:hover {
    background: linear-gradient(135deg, #ffffff, #d1fae5) !important;
    box-shadow: 0 24px 48px rgba(16, 185, 129, 0.15) !important;
}

.college-card-red-white {
    background: linear-gradient(135deg, #ffffff, #fef2f2) !important;
    border-color: rgba(220, 38, 38, 0.3) !important;
}

.college-card-red-white:hover {
    background: linear-gradient(135deg, #ffffff, #fee2e2) !important;
    box-shadow: 0 24px 48px rgba(220, 38, 38, 0.15) !important;
}

.college-card-gray-white {
    background: linear-gradient(135deg, #ffffff, #f1f5f9) !important;
    border-color: rgba(71, 85, 105, 0.3) !important;
}

.college-card-gray-white:hover {
    background: linear-gradient(135deg, #ffffff, #e2e8f0) !important;
    box-shadow: 0 24px 48px rgba(71, 85, 105, 0.15) !important;
}

.college-card-blue-white {
    background: linear-gradient(135deg, #ffffff, #eff6ff) !important;
    border-color: rgba(37, 99, 235, 0.3) !important;
}

.college-card-blue-white:hover {
    background: linear-gradient(135deg, #ffffff, #dbeafe) !important;
    box-shadow: 0 24px 48px rgba(37, 99, 235, 0.15) !important;
}

.stat-icon {
    align-items: center;
    background: #fff9ea;
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(38, 50, 72, 0.08);
    display: inline-flex;
    height: 52px;
    justify-content: center;
    width: 52px;
}

.stat-icon i {
    font-size: 1.35rem;
}

.stat-voters i {
    color: var(--ssc-brown);
}

.stat-cast i {
    color: #287a4b;
}

.stat-turnout i {
    color: #a855f7;
}

.stat-status i {
    color: #e15b00;
}

.dashboard-activity-panel,
.admin-panel {
    background: var(--ssc-white);
    border: 0;
    border-radius: 22px;
    box-shadow: 0 18px 38px rgba(38, 50, 72, 0.1);
    overflow: hidden;
    padding: 1.45rem;
}

.activity-list {
    display: grid !important;
    gap: 1rem !important;
    max-height: 440px !important;
    overflow-y: auto !important;
    padding-right: 0.5rem !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.activity-list::-webkit-scrollbar {
    width: 6px;
}

.activity-list::-webkit-scrollbar-track {
    background: transparent;
}

.activity-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.activity-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

.panel-heading {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.15rem;
}

.panel-heading h2 {
    color: #263248;
    font-family: 'Public Sans', system-ui, sans-serif !important;
    font-size: 1.25rem;
    margin: 0;
}

.activity-item {
    align-items: center;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(80, 98, 127, 0.06);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(38, 50, 72, 0.08);
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 0.7rem 1fr;
    min-height: 58px;
    padding: 0.8rem 1rem;
}

.activity-dot {
    background: #f0a000;
    border-radius: 999px;
    height: 0.5rem;
    width: 0.5rem;
}

.activity-dot.is-muted {
    background: var(--ssc-border);
}

.activity-item strong {
    color: #263248;
    display: block;
    font-weight: 760;
}

.activity-item small {
    color: #7b879b;
    display: block;
}



.dashboard-chart-panel,
.dashboard-mini-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chart-frame {
    flex: 1 1 auto;
    height: auto;
    max-height: none;
    min-height: 340px;
    position: relative;
    width: 100%;
}

.chart-frame canvas {
    display: block;
    height: 100% !important;
    width: 100% !important;
}

.turnout-list {
    display: grid;
    gap: 0.75rem;
    min-height: 0;
}

.dashboard-mini-panel .turnout-list {
    overflow-y: auto;
    padding-right: 0.25rem;
}

.turnout-item {
    align-items: center;
    background: #f8fafc;
    border-radius: 16px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.85rem 1rem;
}

.turnout-item strong,
.turnout-item small {
    display: block;
}

.turnout-item strong {
    color: #263248;
    font-weight: 800;
}

.turnout-item small {
    color: #7b879b;
}

.turnout-item span,
.dashboard-soft-pill {
    background: #fff7dc;
    border-radius: 999px;
    color: var(--ssc-brown);
    flex: 0 0 auto;
    font-weight: 850;
    padding: 0.4rem 0.7rem;
}

.btn-gold {
    background: var(--ssc-gold);
    border-color: var(--ssc-gold);
    color: var(--ssc-nav);
}

.btn-gold:hover,
.btn-gold:focus {
    background: var(--ssc-yellow);
    border-color: var(--ssc-yellow);
    color: var(--ssc-brown);
}

.result-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.result-grid.is-filtered {
    grid-template-columns: 1fr;
}

.result-card {
    background: #ffffff !important;
    border: 1px solid rgba(80, 98, 127, 0.1) !important;
    border-radius: 22px !important;
    padding: 1.5rem !important;
    box-shadow: 0 6px 15px rgba(38, 50, 72, 0.04) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.result-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 16px 32px rgba(38, 50, 72, 0.08) !important;
    border-color: rgba(107, 178, 179, 0.25) !important;
}

.result-card h3 {
    color: #263248;
    font-family: 'Public Sans', system-ui, sans-serif !important;
    font-size: 1.08rem;
}

.result-bar {
    background: rgba(80, 98, 127, 0.12);
}

.result-bar span {
    background: var(--ssc-gold);
}

.site-footer {
    background: var(--ssc-nav);
    color: var(--ssc-cream);
    padding: 1rem 0;
}

@media (max-width: 992px) {

    .hero-grid,
    .form-shell,
    .admin-grid {
        grid-template-columns: 1fr;
    }

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

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

    .admin-shell {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

    .admin-sidebar {
        align-self: stretch !important;
        height: auto !important;
        min-height: 0 !important;
        overflow-y: visible !important;
        position: relative;
        flex: 0 0 auto;
        padding-bottom: 0.5rem;
        z-index: 50;
    }

    #adminSidebarCollapse {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #eef2f7;
        box-shadow: 0 16px 36px rgba(38, 50, 72, 0.12);
        padding: 1rem 1.5rem 1.5rem;
        border-radius: 0 0 20px 20px;
        z-index: 50;
    }

    .admin-main {
        flex: 1 1 auto;
    }

    .admin-nav {
        display: grid;
        gap: 0.5rem;
    }

    .admin-nav a {
        justify-content: flex-start;
        padding: 0.65rem 0.8rem;
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    .hero-band {
        min-height: auto;
        padding: 3.25rem 0 2.5rem;
    }

    .hero-actions,
    .ballot-header,
    .position-heading,
    .submit-strip,
    .panel-heading,
    .report-header,
    .admin-topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-status {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-seal {
        justify-self: center;
    }

    .metric-grid,
    .dashboard-stat-grid,
    .steps-grid,
    .signature-grid {
        grid-template-columns: 1fr;
    }

    .compact-page {
        padding: 2.5rem 0;
    }

    .admin-content,
    .admin-topbar {
        padding: 1rem;
    }

    .admin-user {
        text-align: left;
    }
}

@media print {

    body,
    .admin-shell {
        background: #fff;
        display: block;
    }

    .admin-sidebar,
    .admin-topbar,
    .no-print,
    .flash-container {
        display: none !important;
    }

    .admin-content {
        padding: 0;
    }

    .admin-panel {
        border: 0;
        box-shadow: none;
    }
}

/* Animations */
@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeUp 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    opacity: 0;
}

.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

/* ==========================================================================
   BALLOT REDESIGN - SPLIT SCREEN & HEURISTICS
   ========================================================================== */

.ballot-split-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: #fdfbf7;
}

/* --- Left Sidebar --- */
.ballot-sidebar {
    width: 300px;
    background: linear-gradient(160deg, #422400 0%, #261400 100%);
    color: var(--ssc-white);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    z-index: 1000;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ssc-yellow);
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.sidebar-brand i {
    font-size: 1.5rem;
}

.voter-identity-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.voter-info h3 {
    color: var(--ssc-white);
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
}

.voter-info p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.voter-identity-card .status-pill {
    margin-top: 1rem;
}

/* Progress Ring */
.progress-ring-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 2rem;
}

.progress-ring-circle-bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.progress-ring-circle {
    stroke: var(--ssc-green);
    transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--ssc-white);
}

/* Jump Nav */
.jump-nav {
    flex-grow: 1;
    margin-bottom: 2rem;
}

.jump-nav-title {
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.jump-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.jump-nav li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.jump-nav li:hover {
    color: var(--ssc-white);
    transform: translateX(4px);
}

.jump-nav-icon {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.3s;
}

.jump-nav li.filled .jump-nav-icon {
    color: var(--ssc-green);
}

.sidebar-footer {
    margin-top: auto;
}

/* --- Right Main Panel --- */
.ballot-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Important for flex child */
}

.main-topbar {
    background: var(--ssc-white);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--ssc-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-topbar h1 {
    font-size: 1.75rem;
    margin: 0 0 0.5rem 0;
}

.compact-progress-bar {
    height: 6px;
    background: var(--ssc-beige);
    border-radius: 3px;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
}

.compact-progress-fill {
    height: 100%;
    background: var(--ssc-green);
    transition: width 0.4s ease;
}

.main-content {
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.instruction-banner {
    border-radius: 12px;
    margin-bottom: 2rem;
}

.position-block-new {
    background: var(--ssc-white);
    border: 1px solid rgba(201, 147, 59, 0.3);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(92, 47, 0, 0.04);
}

.position-heading-new {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.position-heading-new h2 {
    margin: 0.25rem 0;
    font-size: 1.5rem;
}

.position-heading-new p {
    color: var(--ssc-nav);
    margin: 0;
}

.position-controls-new {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.selection-counter {
    background: rgba(255, 211, 61, 0.15);
    color: var(--ssc-brown);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.85rem;
    border: 1px solid var(--ssc-border);
}

.btn-clear {
    background: none;
    border: none;
    color: var(--ssc-body);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.btn-clear:hover {
    color: var(--ssc-red);
}

.inline-error {
    background: rgba(163, 28, 19, 0.05);
    color: var(--ssc-red);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--ssc-red);
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Candidate Grid & Card */
.candidate-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.candidate-card-new {
    background: #fbfbf9;
    border: 2px solid rgba(201, 147, 59, 0.15);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    position: relative;
    transition: all 0.2s ease;
    align-items: center;
    /* Center horizontally */
    text-align: center;
    /* Center text inside */
}

.candidate-card-new:hover {
    border-color: rgba(122, 63, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(122, 63, 0, 0.08);
}

.candidate-card-new:has(input:checked),
.candidate-card-new.is-checked {
    border-color: var(--ssc-green);
    background: rgba(32, 110, 64, 0.02);
    box-shadow: 0 8px 20px rgba(32, 110, 64, 0.1);
}

.ballot-abstain-row {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px dashed rgba(122, 63, 0, 0.28);
    background: rgba(247, 235, 215, 0.45);
}

.ballot-abstain-label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0;
    cursor: pointer;
    font-size: 0.95rem;
    color: #4f564c;
}

.ballot-abstain-label .ballot-abstain-input {
    position: static;
    opacity: 1;
    z-index: 1;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
    accent-color: var(--ssc-green);
}

.ballot-abstain-copy strong {
    color: #7a3f00;
}

.candidate-input {
    opacity: 0;
    position: absolute;
    z-index: -1;
}

.card-check-indicator {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    color: var(--ssc-green);
    font-size: 1.25rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
    background: #fff;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.candidate-card-new:has(input:checked) .card-check-indicator,
.candidate-card-new.is-checked .card-check-indicator {
    opacity: 1;
    transform: scale(1);
}

.candidate-img-square {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    background: var(--ssc-soft-yellow);
    margin-bottom: 1rem;
}

.candidate-info-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.candidate-name {
    color: var(--ssc-brown);
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.candidate-party {
    color: var(--ssc-body);
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.candidate-party i {
    color: var(--ssc-yellow);
}

/* Submit Strip Mobile */
.submit-strip-mobile {
    display: none;
    /* Hidden on desktop */
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(38, 20, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--ssc-white);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(201, 147, 59, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.admin-shell .chart-frame {
    min-height: 220px;
}

/* --- Printable Report Styles --- */
.printable-report {
    background: #ffffff !important;
    color: #1a1a1a !important;
    padding: 2.5rem !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
}

.report-header {
    border-bottom: 3px solid #b06a24;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-header h2 {
    color: #b06a24;
    font-weight: 850;
    font-size: 1.75rem;
    margin: 0.25rem 0;
}

.report-header .eyebrow {
    color: #64748b;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
    font-size: 0.75rem;
}

.report-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.report-metrics .metric-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 1.5rem 1.25rem;
    border-radius: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.report-metrics .metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

/* Specific Metric Colors */
.metric-card.voters {
    border-top: 4px solid #3b82f6;
    /* Blue */
    background: linear-gradient(to bottom, #eff6ff, #ffffff);
}

.metric-card.voters i {
    color: #2563eb;
}

.metric-card.votes-cast {
    border-top: 4px solid #10b981;
    /* Green */
    background: linear-gradient(to bottom, #ecfdf5, #ffffff);
}

.metric-card.votes-cast i {
    color: #059669;
}

.metric-card.turnout {
    border-top: 4px solid #b06a24;
    /* SSC Brown */
    background: linear-gradient(to bottom, #fffbeb, #ffffff);
}

.metric-card.turnout i {
    color: #b06a24;
}

.report-metrics .metric-card i {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.report-metrics .metric-card span {
    font-size: 0.7rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.25rem;
    letter-spacing: 0.05em;
}

.report-metrics .metric-card strong {
    font-size: 1.75rem;
    color: #1e293b;
    font-weight: 900;
}

.printable-report h3 {
    font-size: 1.15rem;
    font-weight: 850;
    color: #0f172a;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-left: 5px solid #b06a24;
    padding-left: 1rem;
}

.report-table {
    width: 100%;
    margin-bottom: 2rem;
    border-collapse: collapse;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.report-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.report-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    font-size: 0.95rem;
}

.report-table tr:last-child td {
    border-bottom: none;
}

.report-table tr:hover {
    background: #fdfaf6;
}

.signature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 2px solid #f1f5f9;
}

.signature-grid div {
    text-align: center;
}

.signature-grid span {
    display: block;
    border-bottom: 1.5px solid #1e293b;
    height: 35px;
    margin-bottom: 0.5rem;
}

.signature-grid p {
    font-size: 0.7rem;
    font-weight: 750;
    color: #64748b;
    text-transform: uppercase;
}



.btn-close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--ssc-nav);
    cursor: pointer;
    line-height: 1;
}

.btn-close-modal:hover {
    color: var(--ssc-red);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-instruction {
    margin-top: 0;
    color: var(--ssc-body);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.review-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ballot-email-code-panel {
    background: rgba(107, 178, 179, 0.1);
    border: 1px solid rgba(63, 102, 101, 0.2);
    border-radius: 12px;
    padding: 1rem;
    width: 100%;
}

.ballot-email-code-status {
    align-items: flex-start;
    color: var(--ssc-nav);
    display: flex;
    font-size: 0.9rem;
    font-weight: 750;
    gap: 0.6rem;
    line-height: 1.4;
    margin-bottom: 0.9rem;
}

.ballot-email-code-status.is-error {
    color: #b91c1c;
}

.ballot-email-code-status i {
    flex: 0 0 auto;
    margin-top: 0.1rem;
}

.ballot-email-code-panel label {
    color: var(--ssc-brown);
    display: block;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}

.ballot-email-code-panel input {
    background: #fff;
    border: 1.5px solid rgba(111, 115, 95, 0.26);
    border-radius: 10px;
    color: var(--ssc-ink);
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    min-height: 3rem;
    padding: 0.75rem 1rem;
    text-align: center;
    width: 100%;
}

.ballot-email-code-panel input:focus {
    border-color: var(--ssc-orange);
    box-shadow: 0 0 0 0.18rem rgba(244, 147, 34, 0.18);
    outline: none;
}

.review-position {
    background: #fbfbf9;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--ssc-border);
}

.review-position h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.review-choices {
    margin: 0;
    padding: 0;
    list-style: none;
    font-weight: 700;
    color: var(--ssc-nav);
}

.review-choices li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.3rem;
}

.review-choices li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--ssc-brown);
}

.review-unvoted {
    color: var(--ssc-red);
    font-style: italic;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(201, 147, 59, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.animate-zoom-in {
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .ballot-sidebar {
        width: 240px;
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 768px) {
    .ballot-split-layout {
        flex-direction: column;
    }

    .ballot-sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 1rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .sidebar-brand span,
    .voter-identity-card,
    .jump-nav,
    .sidebar-footer {
        display: none;
    }

    .sidebar-brand {
        margin: 0;
    }

    .progress-ring-container {
        margin: 0;
        transform: scale(0.5);
        /* Make it small for the top bar */
        transform-origin: right center;
    }

    .progress-ring-text {
        font-size: 2rem;
        /* Will be scaled down to 1rem */
    }

    .main-topbar {
        padding: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .submit-strip-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: var(--ssc-yellow);
        padding: 1rem;
        border-radius: 12px;
        margin-top: 2rem;
    }
}

/* ==========================================================================
   BALLOT REDESIGN - FINAL MATCH TO IMAGE
   ========================================================================== */

.ballot-global-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #FAF6F0 !important;
    /* Soft beige background from image */
    font-family: 'Public Sans', system-ui, sans-serif !important;
}

/* --- Top Bar --- */
.ballot-topbar {
    background: linear-gradient(135deg, #e4e392 0%, #ffc13b 100%);
    color: #1f1817;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 2000;
    border-bottom: 3px solid #000000;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.flash-wrapper-home {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.topbar-logo-box {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.topbar-titles {
    display: flex;
    flex-direction: column;
}

.sys-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1f1817;
    line-height: 1.2;
}

.sys-subtitle {
    font-size: 0.75rem;
    color: rgba(31, 24, 23, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.session-timer {
    color: #1f1817;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/**
 * Ballot header: voter text + avatar must stay on-screen on narrow phones (no d-md-only hiding).
 */
.ballot-global-layout:not(.admin-shell) .ballot-session-timer {
    margin-right: 0;
    white-space: nowrap;
}

@media (min-width: 992px) {
    .ballot-global-layout:not(.admin-shell) .ballot-session-timer {
        margin-right: 1.25rem;
    }
}

.ballot-global-layout:not(.admin-shell) .ballot-voter-dropdown {
    min-width: 0;
}

.ballot-global-layout:not(.admin-shell) .ballot-voter-profile-btn {
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 12px;
    box-sizing: border-box;
    display: flex;
    gap: clamp(0.45rem, 2vw, 0.65rem);
    max-width: 100%;
    min-width: 0;
    padding: 0.3rem 0.25rem 0.3rem 0.4rem;
    transition: background 0.2s ease;
}

.ballot-global-layout:not(.admin-shell) .ballot-voter-profile-btn:focus-visible {
    outline: 2px solid #1f1817;
    outline-offset: 2px;
}

.ballot-global-layout:not(.admin-shell) .ballot-voter-profile-btn:hover {
    background: rgba(255, 255, 255, 0.38);
}

.ballot-global-layout:not(.admin-shell) .ballot-voter-user-info {
    align-items: flex-end;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.1rem;
    line-height: 1.28;
    min-width: 0;
    text-align: right;
}

.ballot-global-layout:not(.admin-shell) .ballot-voter-name {
    color: #1f1817;
    font-size: clamp(0.72rem, 2.85vw, 0.92rem);
    font-weight: 800;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ballot-global-layout:not(.admin-shell) .ballot-voter-college {
    color: rgba(31, 24, 23, 0.78);
    font-size: clamp(0.55rem, 2.35vw, 0.72rem);
    font-weight: 700;
    line-height: 1.35;
    max-width: 100%;
    overflow-wrap: anywhere;
    text-transform: uppercase;
    word-break: break-word;
}

.ballot-global-layout:not(.admin-shell) .ballot-voter-avatar-circle {
    align-items: center;
    background: #fff;
    border: 2px solid rgba(31, 24, 23, 0.12);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
    box-sizing: border-box;
    color: #1f1817;
    display: flex;
    flex-shrink: 0;
    font-size: 1.3rem;
    height: clamp(2.65rem, 9vw, 2.85rem);
    justify-content: center;
    line-height: 1;
    min-height: clamp(2.65rem, 9vw, 2.85rem);
    min-width: clamp(2.65rem, 9vw, 2.85rem);
    overflow: hidden;
    width: clamp(2.65rem, 9vw, 2.85rem);
}

.ballot-global-layout:not(.admin-shell) .ballot-voter-avatar-circle i {
    display: flex;
}

.secure-badge {
    background: rgba(255, 255, 255, 0.4);
    color: #1B5E20;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(27, 94, 32, 0.5);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-exit {
    background: transparent;
    border: 1px solid rgba(31, 24, 23, 0.3);
    color: #1f1817;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.btn-exit:hover {
    background: rgba(255, 255, 255, 0.4);
    border-color: #1f1817;
    color: #1f1817;
}

/* --- Split Content Area --- */
.ballot-split-content {
    display: flex;
    flex-grow: 1;
    flex-direction: row !important;
}

/* --- Left Sidebar --- */
.ballot-sidebar {
    width: 280px !important;
    background: linear-gradient(135deg, #e4e392 0%, #ffc13b 100%) !important;
    color: #1f1817 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    position: sticky !important;
    top: 56px !important;
    height: calc(100vh - 56px) !important;
    overflow-y: auto !important;
    border-right: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.sidebar-header {
    display: flex !important;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.sidebar-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sidebar-header-titles h2 {
    color: #1f1817 !important;
    font-size: 1.2rem !important;
    margin: 0 0 0.2rem 0 !important;
}

.sidebar-header-titles p {
    color: rgba(31, 24, 23, 0.7) !important;
    font-size: 0.7rem !important;
    margin: 0 !important;
    font-weight: 700 !important;
}

.voter-identity-card {
    background: rgba(255, 255, 255, 0.4) !important;
    border-radius: 12px !important;
    padding: 0.8rem 1rem !important;
    margin: 0 1.25rem 1rem 1.25rem !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.8rem !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
}

.voter-avatar i {
    font-size: 2.5rem;
    color: #1f1817;
    line-height: 1;
}

.voter-info h3 {
    color: #1f1817 !important;
    margin: 0 0 0.2rem !important;
    font-size: 1rem !important;
}

.voter-info p {
    color: rgba(31, 24, 23, 0.7) !important;
    margin: 0 0 0.5rem 0 !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
}

.voter-info .status-pill {
    background: rgba(107, 178, 179, 0.2) !important;
    color: var(--ssc-nav) !important;
    border: 1px solid var(--ssc-teal) !important;
    font-size: 0.65rem !important;
    padding: 0.2rem 0.5rem !important;
    margin-top: 0 !important;
}

.sidebar-progress-row {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 0 1.25rem 1rem 1.25rem !important;
    border-bottom: 1px solid rgba(31, 24, 23, 0.1) !important;
}

.progress-ring-container-small {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 !important;
}

.progress-ring-circle-bg-small {
    stroke: rgba(31, 24, 23, 0.1);
}

.progress-ring-circle-small {
    stroke: #22c55e;
    transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.progress-ring-text-small {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 800;
    color: #1f1817;
}

.sidebar-progress-text {
    display: flex;
    flex-direction: column;
}

.sidebar-progress-text strong {
    font-size: 1.1rem;
    color: #1f1817;
}

.sidebar-progress-text span {
    font-size: 0.75rem;
    color: rgba(31, 24, 23, 0.7);
}

/* Jump Nav */
.jump-nav {
    flex-grow: 1;
    padding: 1rem 1.25rem;
    margin: 0 !important;
}

/* Admin Sidebar Typography */
.admin-shell .jump-nav-title {
    color: #000000 !important;
    font-size: 0.75rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.1em !important;
    margin-bottom: 1rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
    text-transform: uppercase !important;
    font-family: 'Public Sans', sans-serif !important;
}

/* Ballot Sidebar Typography - Slightly Smaller */
.ballot-global-layout:not(.admin-shell) .jump-nav-title {
    color: #000000 !important;
    font-size: 0.7rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.1em !important;
    margin-bottom: 1rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    text-transform: uppercase !important;
    font-family: 'Public Sans', sans-serif !important;
}

.jump-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Admin Sidebar Navigation Items */
.admin-shell .jump-nav li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: #000000 !important;
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Public Sans', sans-serif !important;
}

/* Ballot Sidebar Navigation Items - Slightly Smaller */
.ballot-global-layout:not(.admin-shell) .jump-nav li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    color: #000000 !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Public Sans', sans-serif !important;
}

.jump-nav li:hover {
    background: rgba(255, 255, 255, 0.4);
    color: #1f1817 !important;
    transform: none !important;
}

.jump-nav-name {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.jump-nav-name i {
    font-size: 1.35rem;
    color: rgba(0, 0, 0, 0.2) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.jump-nav li.filled .jump-nav-name i {
    color: #10b981 !important;
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.2));
}

.jump-nav-arrow {
    font-size: 0.9rem;
    color: #000000 !important;
}

.admin-sidebar-actions {
    border-top: 1px solid rgba(31, 24, 23, 0.14);
    display: grid;
    gap: 0.75rem;
    margin: auto 1.25rem 1rem;
    padding-top: 1rem;
}

.admin-sidebar-account {
    align-items: center;
    background: rgba(255, 255, 255, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 8px;
    display: flex;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.65rem 0.75rem;
}

.admin-sidebar-account>i {
    color: #1f1817;
    flex: 0 0 auto;
    font-size: 1.35rem;
}

.admin-sidebar-account div {
    min-width: 0;
}

.admin-sidebar-account strong,
.admin-sidebar-account span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-sidebar-account strong {
    color: #1f1817;
    font-size: 0.86rem;
    font-weight: 900;
}

.admin-sidebar-account span {
    color: rgba(31, 24, 23, 0.68);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.security-stat-grid .dashboard-stat-card strong {
    font-variant-numeric: tabular-nums;
}

.security-rule-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.security-rule {
    position: relative;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.security-rule:hover {
    border-color: var(--ssc-orange);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.security-rule .rule-icon-box {
    flex: 0 0 48px;
    height: 48px;
    background: rgba(176, 106, 36, 0.08);
    color: var(--ssc-orange);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.security-rule-content {
    flex: 1;
    min-width: 0;
    /* Prevents overflow issues */
}

.rule-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.security-rule strong {
    display: block;
    color: #1e293b;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 0;
    /* Handled by title-row */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.security-rule span {
    display: block;
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
}

.rule-status-badge {
    flex: 0 0 auto;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #d1fae5;
    display: inline-flex;
    align-items: center;
}

.security-source-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.security-source-item {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    transition: all 0.2s ease;
}

.security-source-item:hover {
    border-color: #cbd5e1;
    transform: translateX(4px);
    background: #f8fafc;
}

.source-item-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.source-icon-box {
    flex: 0 0 36px;
    height: 36px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.source-info {
    min-width: 0;
}

.security-source-item strong {
    display: block;
    color: #1e293b;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: 'JetBrains Mono', 'Cascadia Code', monospace;
}

.security-source-item span {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
    margin-top: 0.1rem;
}

.source-event-badge {
    background: #fef2f2;
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    border: 1px solid #fee2e2;
    white-space: nowrap;
}

.security-source-list .empty-mini-state {
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.875rem;
    background: rgba(0, 0, 0, 0.02);
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
}

.security-note-list {
    display: grid;
    gap: 0.75rem;
}

.security-note-list p {
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(111, 115, 95, 0.16);
    border-radius: 8px;
    color: rgba(31, 30, 27, 0.72);
    display: flex;
    gap: 0.65rem;
    line-height: 1.5;
    margin: 0;
    padding: 0.9rem 1rem;
}

.security-note-list i {
    color: var(--ssc-orange);
    flex: 0 0 auto;
    margin-top: 0.12rem;
}

.security-events-table {
    border: 1px solid rgba(111, 115, 95, 0.18);
    border-radius: 10px;
    max-height: 560px;
    overflow: auto;
}

.security-events-table:focus {
    box-shadow: 0 0 0 3px rgba(244, 147, 34, 0.18);
    outline: none;
}

.security-events-table .table {
    margin-bottom: 0;
    min-width: 1120px;
    table-layout: fixed;
}

.security-events-table thead th {
    background: #fff8ea;
    border-bottom: 1px solid rgba(111, 115, 95, 0.22);
    position: sticky;
    top: 0;
    z-index: 2;
}

.security-events-table td {
    font-size: 0.92rem;
    line-height: 1.45;
    padding: 0.85rem 0.7rem;
    vertical-align: top;
}

.security-events-table td strong,
.security-events-table td small {
    display: block;
}

.security-events-table td small {
    color: rgba(31, 30, 27, 0.62);
    margin-top: 0.18rem;
}

.security-events-table code {
    color: var(--ssc-nav);
    display: inline-block;
    font-size: 0.82rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.security-col-time {
    width: 102px;
}

.security-col-severity {
    width: 96px;
}

.security-col-event {
    width: 210px;
}

.security-col-ip {
    width: 150px;
}

.security-col-method {
    width: 76px;
}

.security-col-path {
    width: 210px;
}

.security-col-count {
    width: 72px;
}

.security-col-agent {
    width: 260px;
}

.security-ip-address {
    background: rgba(107, 178, 179, 0.12);
    border-radius: 999px;
    padding: 0.22rem 0.48rem;
}

.security-severity {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 900;
    justify-content: center;
    min-width: 72px;
    padding: 0.25rem 0.55rem;
    text-transform: uppercase;
}

.security-severity.is-low {
    background: rgba(107, 178, 179, 0.16);
    color: var(--ssc-nav);
}

.security-severity.is-medium {
    background: rgba(244, 147, 34, 0.16);
    color: #9a5a12;
}

.security-severity.is-high {
    background: rgba(228, 128, 63, 0.18);
    color: #a63f13;
}

.security-severity.is-critical {
    background: rgba(220, 38, 38, 0.16);
    color: #b91c1c;
}

.security-user-agent {
    max-width: 260px;
    word-break: normal;
}

.security-user-agent strong {
    color: var(--ssc-ink);
    font-size: 0.9rem;
    line-height: 1.3;
    margin-bottom: 0.18rem;
}

.security-user-agent small {
    display: -webkit-box !important;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-overflow: ellipsis;
}

.sidebar-footer {
    padding: 1rem 1.25rem !important;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 !important;
}

.btn-review-sidebar {
    background: transparent;
    color: #1f1817;
    border: 2px solid #1f1817;
    padding: 0.8rem;
    border-radius: 8px;
    width: 100%;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-review-sidebar:hover {
    background: #1f1817;
    color: #FFF;
}

.btn-ghost-outline {
    background: transparent !important;
    color: #1f1817 !important;
    border: 2px solid #1f1817 !important;
    font-weight: 800 !important;
    transition: all 0.2s !important;
}

.btn-ghost-outline:hover {
    background: #1f1817 !important;
    color: #FFF !important;
}

.btn-bright-green {
    background: var(--ssc-orange) !important;
    color: #FFF !important;
    border: none !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.2) !important;
    transition: all 0.2s !important;
}

.btn-bright-green:hover {
    background: var(--ssc-teal) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 178, 179, 0.3) !important;
}

/* --- Right Main Panel --- */
.ballot-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 2rem 3rem !important;
}

.main-header-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(122, 63, 0, 0.1);
    padding-bottom: 1rem;
}

.main-header-left .eyebrow {
    color: #b06a24;
    font-weight: 800;
    font-size: 0.8rem;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.main-header-left h1 {
    font-size: 2rem !important;
    color: #1f1817 !important;
    margin: 0 !important;
}

.hiraya-title-tagline {
    color: var(--ssc-nav);
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0.4rem 0 0;
}

.hiraya-ballot-brief {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(251, 229, 193, 0.82));
    border: 1px solid rgba(176, 106, 36, 0.22);
    border-left: 5px solid var(--ssc-orange);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(47, 49, 42, 0.08);
    margin-bottom: 1.4rem;
    padding: 1.25rem 1.35rem;
}

.hiraya-ballot-content {
    align-items: center;
    display: grid;
    gap: 1.35rem;
    grid-template-columns: minmax(0, 1fr) 230px;
}

.hiraya-ballot-copy {
    min-width: 0;
}

.hiraya-ballot-kicker {
    align-items: center;
    color: #b06a24;
    display: flex;
    font-size: 0.74rem;
    font-weight: 850;
    gap: 0.45rem;
    letter-spacing: 0.08em;
    margin: 0 0 0.45rem;
    text-transform: uppercase;
}

.hiraya-ballot-copy h2 {
    color: var(--ssc-brown);
    font-size: 1.2rem;
    line-height: 1.25;
    margin: 0 0 0.65rem;
}

.hiraya-ballot-copy p:not(.hiraya-ballot-kicker) {
    color: var(--ssc-body);
    font-size: 0.9rem;
    line-height: 1.65;
    margin: 0;
}

.brief-filter-bar {
    align-items: center;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 10px;
    display: flex;
    gap: 1.5rem;
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
}

.js-tally-filter-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(210px, 0.55fr) auto auto;
    gap: 0.85rem 1rem;
    overflow: hidden;
}

.js-tally-filter-form .filter-group {
    min-width: 0;
}

.js-tally-filter-form .filter-select {
    min-width: 0;
    width: 100%;
}

.js-tally-filter-form .filter-select.select-wide {
    min-width: 0;
}

.js-tally-filter-form .btn-filter-reset {
    justify-content: center;
    white-space: nowrap;
}

#live-tally.is-loading,
#canvassing-results.is-loading {
    opacity: 0.65;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.filter-group {
    align-items: center;
    display: flex;
    gap: 0.6rem;
}

.filter-group label {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.filter-group label i {
    color: #b06a24;
    font-size: 0.9rem;
}

.filter-select {
    background: #ffffff;
    border: 1px solid rgba(176, 106, 36, 0.15);
    border-radius: 8px;
    color: #1e293b;
    font-size: 0.88rem;
    font-weight: 650;
    padding: 0.45rem 2rem 0.45rem 0.75rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    appearance: none;
}

.filter-select.select-wide {
    min-width: 380px;
    border-color: rgba(129, 140, 248, 0.4);
}

.filter-select:focus {
    border-color: var(--ssc-orange);
    box-shadow: 0 0 0 3px rgba(176, 106, 36, 0.1);
    outline: none;
}

.btn-filter-reset {
    align-items: center;
    background: #ffffff;
    border: 1px solid rgba(176, 106, 36, 0.15);
    border-radius: 8px;
    color: #64748b;
    display: flex;
    font-size: 0.82rem;
    font-weight: 750;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    transition: all 0.2s ease;
}

.btn-filter-reset:hover {
    background: #f8fafc;
    border-color: var(--ssc-orange);
    color: var(--ssc-brown);
}

.filter-legend {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 700;
    margin-left: auto;
}

.filter-legend i {
    font-size: 0.85rem;
}

.hiraya-ballot-copy p:last-child {
    margin-bottom: 0;
}

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.live-status-pill {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid rgba(111, 115, 95, 0.12);
    border-radius: 12px;
    padding: 0.75rem 1.35rem;
    gap: 1.15rem;
    width: fit-content;
    box-shadow: 0 4px 12px rgba(47, 49, 42, 0.04);
}

.live-status-pill i {
    color: #94a3b8;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.live-status-label,
.live-status-data {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    flex-shrink: 0;
}

.live-status-label small,
.live-status-data small {
    font-size: 0.75rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.live-status-label strong,
.live-status-data strong {
    font-size: 0.95rem;
    font-family: 'Public Sans', system-ui, sans-serif !important;
    font-weight: 850;
    color: #1e293b;
}

.live-status-bar-container {
    width: 140px;
    height: 8px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.live-status-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ssc-gold), #e67e00);
    border-radius: 10px;
}


.turnout-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.turnout-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.turnout-meta strong {
    font-size: 0.88rem;
    color: #1e293b;
}

.turnout-meta .percentage {
    font-size: 0.95rem;
    font-weight: 850;
    color: var(--ssc-brown);
}

.turnout-progress {
    height: 6px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
}

.turnout-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6BB2B3, #4f8b8c);
    border-radius: 10px;
}

.voter-count {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
}

.hiraya-ballot-poster {
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(111, 115, 95, 0.18);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(47, 49, 42, 0.16);
    margin: 0;
    overflow: hidden;
}

.hiraya-ballot-poster img {
    aspect-ratio: 1 / 1;
    display: block;
    object-fit: contain;
    object-position: center;
    width: 100%;
}

.btn-toggle-activity {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(111, 115, 95, 0.2);
    border-radius: 8px;
    color: var(--ssc-brown);
    cursor: pointer;
    display: flex;
    font-size: 1.1rem;
    padding: 0.45rem;
    transition: all 0.2s ease;
}

.btn-toggle-activity:hover {
    background: #ffffff;
    border-color: var(--ssc-gold);
    color: var(--ssc-gold);
    transform: translateY(-1px);
}

.activity-list {
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

.activity-list.is-collapsed {
    display: none !important;
}

.progress-box {
    background: #FFF;
    border: 1px solid rgba(122, 63, 0, 0.15);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.progress-box>span:first-child {
    font-weight: 800;
    color: #22c55e !important;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.progress-bar-small {
    width: 100px;
    height: 6px;
    background: #EAE0D5;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill-small {
    height: 100%;
    background: #22c55e;
    transition: width 0.4s ease;
}

.progress-box>span:last-child {
    font-weight: 800;
    color: #1f1817;
    font-size: 0.85rem;
}

.canvassing-dashboard-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.canvassing-command-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.canvassing-command-panel {
    background: linear-gradient(135deg, rgba(107, 178, 179, 0.18), rgba(244, 147, 34, 0.14)), #ffffff;
}

.canvassing-command-status {
    align-items: center;
    display: flex;
    gap: 0.85rem;
    margin-bottom: 1.1rem;
}

.canvassing-command-status h2 {
    color: #263248;
    font-family: 'Public Sans', system-ui, sans-serif !important;
    font-size: clamp(1.5rem, 3vw, 2.15rem);
    margin: 0;
}

.canvassing-command-meter {
    background: rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    height: 12px;
    margin: 1rem 0;
    overflow: hidden;
}

.canvassing-command-meter-fill {
    background: linear-gradient(90deg, var(--ssc-teal), var(--ssc-gold));
    border-radius: inherit;
    height: 100%;
}

.canvassing-command-panel p {
    color: #4e617d;
    font-weight: 650;
    margin: 0;
}

.canvassing-action-list,
.canvassing-leader-list {
    display: grid;
    gap: 0.75rem;
}

.canvassing-action-list a {
    align-items: center;
    background: #f8fafc;
    border: 1px solid rgba(80, 98, 127, 0.08);
    border-radius: 16px;
    color: #263248;
    display: grid;
    font-weight: 800;
    gap: 0.75rem;
    grid-template-columns: 38px 1fr;
    padding: 0.8rem 1rem;
    text-decoration: none;
}

.canvassing-action-list a:hover,
.canvassing-action-list a:focus {
    background: #fff7dc;
    color: var(--ssc-brown);
    transform: translateY(-1px);
}

.canvassing-action-list i {
    align-items: center;
    background: #ffffff;
    border-radius: 50%;
    color: var(--ssc-gold);
    display: inline-flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.canvassing-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.canvassing-leader-row {
    align-items: center;
    background: #f8fafc;
    border: 1px solid rgba(80, 98, 127, 0.08);
    border-radius: 16px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.85rem 1rem;
}

.canvassing-leader-row strong,
.canvassing-leader-row span {
    display: block;
}

.canvassing-leader-row strong {
    color: #263248;
    font-weight: 850;
}

.canvassing-leader-row span {
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 650;
}

.canvassing-leader-row b {
    align-items: center;
    background: #fff7dc;
    border-radius: 999px;
    color: var(--ssc-brown);
    display: inline-flex;
    font-size: 0.95rem;
    justify-content: center;
    min-width: 42px;
    padding: 0.35rem 0.65rem;
}

.main-content {
    max-width: 100% !important;
    padding: 0 !important;
}

.instruction-banner {
    background: #ffce9c !important;
    /* Peach */
    border: 1px solid #b06a24 !important;
    color: #1f1817 !important;
    border-radius: 8px !important;
    padding: 1rem 1.5rem !important;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem !important;
    font-size: 0.9rem;
}

.instruction-banner i {
    color: #dc1f0d !important;
    font-size: 1.2rem !important;
}

.position-block-new {
    background: #FFF !important;
    border: 1px solid rgba(220, 31, 13, 0.4) !important;
    /* Reddish border from palette */
    border-radius: 12px !important;
    padding: 0.75rem 0.5rem !important;
    margin-bottom: 1rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
}

.position-heading-new {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem !important;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(122, 63, 0, 0.1);
}

.position-heading-new .eyebrow {
    color: #dc1f0d !important;
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    margin: 0 0 0.5rem 0 !important;
    text-transform: uppercase !important;
}

.position-heading-new h2 {
    color: #1f1817 !important;
    font-size: 1.4rem !important;
    margin: 0 0 0.25rem 0 !important;
}

.position-heading-new p {
    color: #b06a24 !important;
    font-size: 0.85rem !important;
    margin: 0 !important;
}

.selection-counter-box {
    border: 1px solid rgba(176, 106, 36, 0.3);
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    text-align: center;
    color: #1f1817;
}

.selection-counter-box strong {
    font-size: 1.2rem;
    line-height: 1;
}

.selection-counter-box small {
    color: rgba(74, 37, 17, 0.5);
    font-weight: 700;
}

.inline-error {
    background: rgba(251, 229, 193, 0.72) !important;
    color: var(--ssc-brown) !important;
    padding: 0.75rem 1rem !important;
    border-radius: 6px !important;
    margin-bottom: 1.5rem !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    display: flex;
    align-items: center !important;
    gap: 0.5rem !important;
    border: 1px solid rgba(111, 115, 95, 0.25) !important;
    border-left: 1px solid rgba(111, 115, 95, 0.25) !important;
    /* Overriding old style */
}

/* Candidate Grid & Card */
/* --- Dynamic Candidate Layouts --- */

/* 1. Unopposed (Single Candidate) */
.candidate-grid-new.is-unopposed {
    display: flex !important;
    justify-content: center !important;
    padding: 1.5rem 0 !important;
    width: 100% !important;
}

.is-unopposed .candidate-card-new {
    max-width: 380px !important;
    width: 100% !important;
}

.is-unopposed .candidate-img-square {
    width: 140px !important;
    height: 140px !important;
}

/* 2. Head-to-Head (2 Candidates) */
.candidate-grid-new.is-head-to-head {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.25rem !important;
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.is-head-to-head .candidate-img-square {
    width: 110px !important;
    height: 110px !important;
}

/* 3. Multi-Grid (3+ Candidates) */
.candidate-grid-new.is-multi-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.75rem !important;
}

.is-multi-grid .candidate-img-square {
    width: 80px !important;
    height: 80px !important;
}

.candidate-grid-new {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 1rem !important;
}

.candidate-card-new {
    background: transparent !important;
    border: 2px solid transparent !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    position: relative !important;
    transition: all 0.2s ease !important;
    align-items: center !important;
    text-align: center !important;
}

.candidate-img-wrapper {
    background: rgba(16, 185, 129, 0.05) !important;
    border-radius: 12px !important;
    padding: 0.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    margin-bottom: 0.75rem !important;
    border: 2px solid transparent !important;
    transition: all 0.3s ease !important;
}

.candidate-eyebrow {
    font-size: 0.6rem;
    font-weight: 800;
    color: #b06a24;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.candidate-img-square {
    width: 90px;
    height: 90px;
    object-fit: cover !important;
    border-radius: 12px !important;
    background: rgba(16, 185, 129, 0.1) !important;
    transition: all 0.3s ease;
}

.candidate-info-center {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
}

.candidate-name {
    color: #064e3b !important;
    font-size: 0.9rem !important;
    font-weight: 850 !important;
    margin-bottom: 0.25rem !important;
    line-height: 1.2 !important;
}

.candidate-party {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #059669 !important;
    padding: 0.2rem 0.75rem !important;
    border-radius: 999px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
}

.candidate-card-new:has(input:checked) .candidate-img-wrapper {
    border-color: var(--ssc-orange);
    box-shadow: 0 4px 12px rgba(244, 147, 34, 0.15);
}

.card-check-indicator {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    color: var(--ssc-orange) !important;
    font-size: 1.25rem !important;
    opacity: 0 !important;
    transform: scale(0.5) !important;
    transition: all 0.2s ease !important;
    background: #FFF !important;
    border-radius: 50% !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
}

.candidate-card-new:has(input:checked) .card-check-indicator {
    opacity: 1 !important;
    transform: scale(1) !important;
}

@media (max-width: 768px) {
    .ballot-topbar {
        padding: 0.5rem 1rem;
    }

    .topbar-titles {
        display: none;
    }

    .ballot-split-content {
        flex-direction: column !important;
    }

    .ballot-sidebar {
        width: 100% !important;
        height: auto !important;
        position: static !important;
        border-right: none !important;
    }

    .sidebar-header,
    .voter-identity-card,
    .sidebar-progress-row,
    .jump-nav,
    .sidebar-footer {
        display: none !important;
    }

    .ballot-main {
        padding: 1rem !important;
    }

    .main-header-area {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    .main-header-left h1 {
        font-size: 1.45rem !important;
    }

    .hiraya-title-tagline {
        font-size: 0.82rem;
    }

    .hiraya-ballot-brief {
        border-left-width: 4px;
        padding: 1rem;
    }

    .hiraya-ballot-content {
        gap: 1rem;
        grid-template-columns: 1fr;
    }

    .hiraya-ballot-copy h2 {
        font-size: 1rem;
    }

    .hiraya-ballot-copy p:not(.hiraya-ballot-kicker) {
        font-size: 0.84rem;
    }

    .hiraya-ballot-poster {
        justify-self: center;
        max-width: min(260px, 100%);
        width: 100%;
    }
}

/* SSC logo background palette: teal, sage, cream, and warm orange */
body,
.admin-shell,
.ballot-global-layout {
    background: linear-gradient(135deg, #FFF8ED 0%, var(--ssc-light) 46%, rgba(107, 178, 179, 0.18) 100%) !important;
    color: var(--ssc-body);
}

.site-navbar,
.admin-topbar,
.ballot-topbar,
.ballot-sidebar {
    background: linear-gradient(135deg, var(--ssc-teal) 0%, var(--ssc-sage) 48%, var(--ssc-orange) 100%) !important;
    border-color: rgba(31, 30, 27, 0.16) !important;
    color: var(--ssc-ink) !important;
}

.brand-mark,
.admin-brand .brand-mark {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--ssc-brown) !important;
}

.topbar-logo-box,
.sidebar-icon-box {
    background: transparent !important;
    border: 0 !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

.admin-sidebar {
    background: linear-gradient(180deg, rgba(251, 229, 193, 0.92) 0%, rgba(247, 235, 215, 0.96) 52%, rgba(107, 178, 179, 0.18) 100%) !important;
    color: var(--ssc-body) !important;
}

.admin-brand,
.admin-brand strong,
.admin-topbar h1,
.panel-heading h2,
.dashboard-stat-card strong,
.result-card h3,
.main-header-left h1,
.position-heading-new h2,
.candidate-name,
.sys-title,
.session-timer,
.btn-exit,
.btn-review-sidebar,
.btn-ghost-outline,
.progress-ring-text-small,
.sidebar-progress-text strong,
.progress-box>span:last-child {
    color: var(--ssc-ink) !important;
}

.admin-brand small,
.admin-topbar p,
.admin-user small,
.dashboard-stat-card span,
.dashboard-stat-card small,
.turnout-item small,
.activity-item small,
.sys-subtitle,
.sidebar-header-titles p,
.voter-info p,
.sidebar-progress-text span,
.jump-nav-title,
.jump-nav li,
.jump-nav-arrow,
.selection-counter-box small {
    color: rgba(31, 30, 27, 0.68) !important;
}

.admin-nav a,
.admin-signout {
    color: var(--ssc-body) !important;
}

.admin-nav a:hover,
.admin-nav a:focus,
.admin-nav a.is-active,
.admin-user,
.dashboard-stat-card,
.dashboard-activity-panel,
.admin-panel,
.result-card,
.turnout-item,
.activity-item,
.progress-box,
.position-block-new,
.voter-identity-card {
    background: rgba(255, 255, 255, 0.76) !important;
    border-color: rgba(111, 115, 95, 0.28) !important;
    box-shadow: 0 16px 34px rgba(63, 102, 101, 0.16) !important;
}

.hero-band {
    background: linear-gradient(135deg, var(--ssc-teal) 0%, var(--ssc-sage) 42%, var(--ssc-orange) 100%) !important;
}

.section-band,
.content-band,
.candidate-admin-group,
.stat-icon,
.candidate-img-wrapper,
.inline-error {
    background: var(--ssc-light) !important;
    border-color: rgba(111, 115, 95, 0.3) !important;
    color: var(--ssc-stone) !important;
}

.btn-brown,
.btn-gold,
.activity-dot,
.result-bar span {
    background: var(--ssc-orange) !important;
    border-color: var(--ssc-orange) !important;
    color: var(--ssc-ink) !important;
}

.btn-bright-green,
.progress-bar-fill-small {
    background: #22c55e !important;
    border-color: #22c55e !important;
    color: #fff !important;
}

.btn-brown:hover,
.btn-brown:focus,
.btn-gold:hover,
.btn-gold:focus,
.btn-bright-green:hover,
.btn-bright-green:focus {
    background: var(--ssc-teal) !important;
    border-color: var(--ssc-teal) !important;
    color: var(--ssc-ink) !important;
}

.btn-outline-brown,
.btn-ghost-outline,
.btn-review-sidebar,
.btn-exit {
    border-color: var(--ssc-stone) !important;
    color: var(--ssc-ink) !important;
}

.btn-outline-brown:hover,
.btn-outline-brown:focus,
.btn-ghost-outline:hover,
.btn-review-sidebar:hover,
.btn-exit:hover {
    background: var(--ssc-stone) !important;
    border-color: var(--ssc-stone) !important;
    color: var(--ssc-cream) !important;
}

.eyebrow,
.main-header-left .eyebrow,
.position-heading-new .eyebrow,
.position-heading-new p,
.candidate-eyebrow,
.candidate-party,
.progress-box>span:first-child,
a {
    color: var(--ssc-stone) !important;
}

.status-pill,
.secure-badge,
.voter-info .status-pill,
.card-check-indicator {
    background: rgba(251, 229, 193, 0.72) !important;
    border-color: var(--ssc-stone) !important;
    color: var(--ssc-stone) !important;
}

.candidate-card-new:has(input:checked) .candidate-img-wrapper {
    border-color: #22c55e !important;
    box-shadow: 0 8px 18px rgba(34, 197, 94, 0.28) !important;
}

.candidate-card-new:has(input:checked) .card-check-indicator,
.jump-nav li.filled .jump-nav-name i {
    color: #22c55e !important;
}

.progress-ring-circle-small {
    stroke: #22c55e !important;
}

.site-footer {
    background: var(--ssc-stone) !important;
    color: var(--ssc-cream) !important;
}

.btn-ready-green {
    background-color: #22c55e !important;
    border-color: #22c55e !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4) !important;
}

.btn-ready-green:hover {
    background-color: #16a34a !important;
    border-color: #16a34a !important;
}

/* ── Homepage Specific Styles (Moved from index.php) ── */
.site-navbar,
.site-footer {
    display: none !important;
}

body,
main {
    padding: 0 !important;
    margin: 0 !important;
}

.home-status-bar {
    background: linear-gradient(90deg, #15803d, #166534);
    color: #fff;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.home-status-bar.is-closed {
    background: linear-gradient(90deg, #991b1b, #7f1d1d);
}

.status-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
    animation: pulse-live 1.5s ease-in-out infinite;
}

.is-closed .status-live-dot {
    animation: none;
    opacity: 0.6;
}

@keyframes pulse-live {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(1.5);
    }
}

.topbar-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.8rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.topbar-status-badge.open {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.topbar-status-badge.closed {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.form-card-header {
    background: linear-gradient(135deg, var(--ssc-brown), var(--ssc-nav));
    border-radius: 10px 10px 0 0;
    padding: 1.1rem 1.35rem 1rem;
    margin: -1.35rem -1.35rem 1.25rem;
}

.form-card-header h2 {
    font-family: 'Public Sans', system-ui, sans-serif !important;
    font-weight: 800;
    font-size: 1.05rem;
    color: #fff;
    margin: 0 0 0.15rem;
}

.form-card-header p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.field-hint {
    font-size: 0.74rem;
    color: var(--ssc-nav);
    margin-top: 0.28rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.75rem;
}

.trust-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(111, 115, 95, 0.2);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ssc-nav);
}

.trust-badge-pill i {
    color: var(--ssc-brown);
}

.step-card {
    padding: 1.75rem 1.35rem;
    text-align: center;
    border-radius: 14px;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.1);
}

.step-card i {
    font-size: 2.2rem;
    color: var(--ssc-brown);
    display: block;
    margin-bottom: 1rem;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ssc-brown), var(--ssc-nav));
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.6rem;
}

.hero-band {
    background: linear-gradient(135deg, var(--ssc-yellow) 0%, #fffbea 60%, #f0fdf4 100%) !important;
    min-height: 85vh;
    display: flex;
    align-items: center;
}

.hero-grid {
    align-items: center;
}

.hero-copy h1 {
    font-size: clamp(2.2rem, 4.5vw, 4rem);
}

.content-band {
    background: #fff;
    border-top: 1px solid rgba(201, 147, 59, 0.18);
    padding: 4rem 0;
}

.section-heading h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.vf-steps-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0 auto 3.5rem;
    max-width: 1100px;
}

.vf-step-card {
    background: #ffffff;
    border: 1px solid rgba(111, 115, 95, 0.15);
    border-radius: 20px;
    padding: 2.25rem 1.75rem 1.75rem;
    flex: 1 1 280px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
    outline: none;
    position: relative;
    z-index: 1;
}

.vf-step-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(63, 102, 101, 0.12);
    border-color: var(--ssc-nav);
}

.vf-step-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.vf-step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--ssc-brown), var(--ssc-nav));
    color: #fff;
    font-weight: 900;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 15px rgba(63, 102, 101, 0.25);
}

.vf-icon {
    font-size: 2.2rem;
    color: var(--ssc-nav);
    opacity: 0.85;
}

.vf-step-title {
    font-family: 'Public Sans', system-ui, sans-serif !important;
    font-weight: 850;
    font-size: 1.25rem;
    color: var(--ssc-brown);
    margin: 0.25rem 0 0;
}

.vf-step-desc {
    font-size: 0.92rem;
    color: #4b5563;
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.vf-step-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: rgba(251, 229, 193, 0.4);
    border-left: 4px solid var(--ssc-orange);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
    color: #5a4200;
    font-weight: 600;
    margin-top: 0.5rem;
}

.vf-step-tip i {
    color: var(--ssc-orange);
    flex-shrink: 0;
    margin-top: 1px;
}

.vf-tip-warning {
    background: rgba(254, 226, 226, 0.4);
    border-left-color: #ef4444;
    color: #7f1d1d;
}

.vf-tip-warning i {
    color: #ef4444;
}

.vf-step-footer {
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.vf-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(63, 102, 101, 0.08);
    color: var(--ssc-nav);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 800;
}

.vf-badge-green {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
}

.vf-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--ssc-orange);
    opacity: 0.4;
    padding: 0 0.75rem;
    align-self: center;
    z-index: 0;
}

.vf-help-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    font-size: 0.95rem;
    color: var(--ssc-nav);
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border-radius: 999px;
    padding: 0.8rem 2rem;
    max-width: fit-content;
    margin: 0 auto;
}

.vf-help-row i {
    color: var(--ssc-nav);
}

.vf-help-link {
    font-weight: 700;
    color: var(--ssc-nav);
    text-decoration: underline;
    transition: color 0.2s;
}

.vf-help-link:hover {
    color: #1a1a1a;
}

.privacy-guide-dialog {
    max-width: 460px;
}

.privacy-guide-content {
    border: 1px solid rgba(111, 115, 95, 0.2);
    border-radius: 14px;
    max-height: min(78vh, 520px);
    overflow: hidden;
}

.privacy-guide-content .modal-header,
.privacy-guide-content .modal-body,
.privacy-guide-content .modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
}

.privacy-guide-content .modal-title {
    color: var(--ssc-brown);
    font-family: 'Public Sans', system-ui, sans-serif !important;
    font-size: 1.2rem;
    font-weight: 850;
}

.privacy-guide-body {
    display: grid;
    gap: 0.65rem;
}

.privacy-guide-section {
    background: rgba(247, 235, 215, 0.72);
    border: 1px solid rgba(111, 115, 95, 0.18);
    border-radius: 10px;
    padding: 0.7rem;
}

.privacy-guide-section h3 {
    align-items: center;
    color: var(--ssc-brown);
    display: flex;
    font-size: 0.92rem;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
}

.privacy-guide-section p,
.privacy-guide-section li {
    color: var(--ssc-body);
    font-size: 0.84rem;
}

.privacy-guide-section ul,
.privacy-guide-section ol {
    margin: 0;
    padding-left: 1.2rem;
}

.privacy-guide-warning {
    background: rgba(251, 229, 193, 0.9);
    border-color: rgba(244, 147, 34, 0.35);
}

.privacy-guide-content .btn {
    min-height: 38px;
    padding-bottom: 0.45rem;
    padding-top: 0.45rem;
}

.modal-backdrop {
    z-index: 2100;
}

.modal {
    z-index: 2110;
}

@media (max-width: 768px) {
    .vf-steps-row {
        flex-direction: column;
        align-items: center;
    }

    .vf-connector {
        transform: rotate(90deg);
    }

    .vf-step-card {
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr !important;
    }

    .hero-band {
        min-height: auto;
        padding: 3.5rem 0;
    }

    .steps-grid {
        grid-template-columns: 1fr !important;
    }

    .trust-strip {
        display: none;
    }
}

@media (max-width: 600px) {
    .ballot-topbar {
        padding: 0.7rem 1rem;
    }
}

.btn-how-to-vote {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #000000;
    background: rgba(201, 147, 59, 0.12);
    border: 1.5px solid rgba(201, 147, 59, 0.35);
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-how-to-vote:hover {
    background: var(--ssc-brown);
    color: #fff;
    border-color: var(--ssc-brown);
}

@media (max-width: 600px) {
    .ballot-global-layout:not(.admin-shell) .candidate-grid-new {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 0.75rem !important;
    }

    .ballot-global-layout:not(.admin-shell) .candidate-grid-new.is-head-to-head,
    .ballot-global-layout:not(.admin-shell) .candidate-grid-new.is-multi-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .ballot-global-layout:not(.admin-shell) .candidate-card-new {
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        padding: 0.7rem 0.55rem !important;
        gap: 0.75rem !important;
        min-height: auto !important;
    }

    /* Larger tap target + full image visible (no aggressive crop) */
    .ballot-global-layout:not(.admin-shell) .candidate-img-wrapper {
        width: 5.25rem !important;
        height: 5.25rem !important;
        min-width: 5.25rem !important;
        padding: 0.2rem !important;
        margin-bottom: 0 !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        background: #F8EEDF !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        box-sizing: border-box !important;
    }

    .ballot-global-layout:not(.admin-shell) .candidate-eyebrow {
        display: none !important;
    }

    .ballot-global-layout:not(.admin-shell) .candidate-img-square {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 10px !important;
        object-fit: contain !important;
        object-position: center !important;
    }

    .ballot-global-layout:not(.admin-shell) .candidate-info-center {
        align-items: flex-start !important;
        text-align: left !important;
        width: auto !important;
        flex-grow: 1 !important;
        min-width: 0 !important;
        gap: 0.15rem !important;
    }

    .ballot-global-layout:not(.admin-shell) .candidate-name {
        font-size: 1rem !important;
        margin-bottom: 0 !important;
        line-height: 1.25 !important;
    }

    .ballot-global-layout:not(.admin-shell) .candidate-party {
        font-size: 0.75rem !important;
    }

    .ballot-global-layout:not(.admin-shell) .card-check-indicator {
        position: static !important;
        margin-left: auto !important;
        flex-shrink: 0 !important;
        opacity: 0.2 !important;
        transform: scale(0.95) !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .ballot-global-layout:not(.admin-shell) .candidate-card-new:has(input:checked) .card-check-indicator {
        opacity: 1 !important;
        transform: scale(1.1) !important;
        color: #22c55e !important;
    }

    .ballot-global-layout:not(.admin-shell) .candidate-card-new:has(input:checked) {
        background: #f0fdf4 !important;
        border-color: #22c55e !important;
    }
}

html {
    scroll-behavior: smooth;
}

/* Public home mobile layout */
.home-topbar {
    gap: 1rem;
    height: auto !important;
    min-height: 64px;
}

.home-topbar-actions {
    flex-shrink: 0;
    min-width: 0;
}

.home-topbar .topbar-left,
.home-topbar .topbar-right,
.hero-copy,
.hero-form-panel,
.hero-form-panel .form-card,
.vf-step-card {
    min-width: 0;
}

.flow-status-pill {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

#voting-flow {
    overflow: hidden;
    padding: clamp(3rem, 8vw, 6rem) 0 !important;
}

.home-footer-inner {
    margin: 0 auto;
    max-width: 1180px;
}

@media (max-width: 900px) {
    .hero-band {
        padding: 3rem 0 3.5rem !important;
    }

    .hero-grid {
        gap: 2rem;
    }

    .hero-copy {
        margin: 0 auto;
        max-width: 720px;
        text-align: center;
    }

    .hero-copy .lead {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-intro-pubmat {
        margin-left: auto;
        margin-right: auto;
        max-width: min(360px, 100%);
    }

    .hero-form-panel {
        margin: 0 auto;
        max-width: 520px;
    }

    .trust-strip {
        display: flex !important;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .home-topbar {
        align-items: center;
        gap: 0.45rem;
        min-height: 54px;
        padding: 0.55rem 0.75rem !important;
    }

    .home-topbar .topbar-left {
        gap: 0.55rem;
    }

    .home-topbar .topbar-logo-box {
        height: 34px;
        width: 34px;
    }

    .home-topbar-actions {
        gap: 0.4rem !important;
    }

    .btn-how-to-vote {
        font-size: 0;
        height: 34px;
        justify-content: center;
        padding: 0 !important;
        width: 38px;
    }

    .btn-how-to-vote i {
        font-size: 1rem;
    }

    .topbar-status-badge {
        font-size: 0.62rem;
        letter-spacing: 0.02em;
        padding: 0.28rem 0.5rem;
        white-space: nowrap;
    }

    .hero-band {
        padding: 2rem 0 2.5rem !important;
    }

    .hero-grid {
        gap: 1.35rem;
    }

    .hero-copy h1 {
        font-size: clamp(2rem, 11vw, 2.75rem);
        line-height: 1.05;
    }

    .hero-copy .lead {
        font-size: 0.98rem;
    }

    .hero-intro-pubmat {
        border-radius: 10px;
        margin-top: 1rem;
        max-width: min(300px, 100%);
    }

    .trust-strip {
        gap: 0.4rem;
        margin-top: 1.15rem;
    }

    .trust-badge-pill {
        border-radius: 8px;
        justify-content: center;
        width: 100%;
    }

    .hero-form-panel .form-card {
        border-radius: 12px !important;
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12) !important;
        padding: 1rem !important;
    }

    .form-card-header {
        margin: -1rem -1rem 1rem;
        padding: 0.95rem 1rem;
    }

    .btn-brown,
    .btn-google-bsu {
        min-height: 46px;
    }

    #voting-flow {
        padding: 3rem 0 !important;
    }

    #voting-flow .section-heading {
        margin-bottom: 2rem !important;
    }

    #voting-flow .section-heading h2 {
        font-size: 1.75rem !important;
    }

    #voting-flow .section-heading p {
        font-size: 0.95rem !important;
    }

    .flow-status-pill {
        align-items: stretch !important;
        border-radius: 16px !important;
        flex-direction: column;
        gap: 0.45rem !important;
        padding: 0.85rem 1rem !important;
        width: 100%;
    }

    .flow-status-pill>span[style*="color:#9ca3af"] {
        display: none;
    }

    .vf-step-card {
        border-radius: 14px;
        padding: 1.4rem 1.1rem;
    }

    .vf-step-icon-wrap {
        margin-bottom: 0.35rem;
    }

    .vf-connector {
        font-size: 1.4rem;
        margin: -0.25rem 0;
    }

    .vf-help-row {
        border-radius: 14px;
        flex-direction: column;
        padding: 0.9rem 1rem;
        text-align: center;
    }

    .home-footer {
        padding: 1.5rem 0 !important;
    }

    .home-footer-inner {
        padding: 0 1rem !important;
    }

    .home-footer-grid {
        align-items: flex-start !important;
        flex-direction: column;
        text-align: left;
    }

    .home-footer-grid>div:last-child {
        text-align: left !important;
    }
}

/* Ballot layout stabilization */
.ballot-split-content {
    align-items: stretch !important;
    display: flex !important;
}

.ballot-sidebar {
    flex: 0 0 280px !important;
    height: calc(100vh - 64px) !important;
    min-width: 280px !important;
    overflow-x: hidden !important;
    top: 64px !important;
    width: 280px !important;
}

.ballot-main {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.main-header-area {
    gap: 1.5rem !important;
}

.main-header-left {
    min-width: 0;
}

.main-header-left h1 {
    max-width: 780px;
}

.main-header-right {
    flex: 0 0 auto;
}

.hiraya-ballot-content {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr) clamp(220px, 22vw, 300px);
}

.hiraya-ballot-copy {
    align-self: center;
}

.hiraya-ballot-poster {
    align-self: center;
}

.jump-nav-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
    .ballot-sidebar {
        flex-basis: 250px !important;
        min-width: 250px !important;
        width: 250px !important;
    }

    .ballot-main {
        padding: 1.5rem 2rem !important;
    }

    .main-header-area {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .hiraya-ballot-content {
        grid-template-columns: minmax(0, 1fr) 220px;
    }
}

@media (max-width: 900px) {
    .ballot-sidebar {
        flex: 0 0 auto !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    .hiraya-ballot-content {
        grid-template-columns: 1fr;
    }

    .hiraya-ballot-poster {
        justify-self: center;
        max-width: min(300px, 100%);
        width: 100%;
    }
}

/* Final ballot mobile overrides */
@media (max-width: 900px) {
    .ballot-topbar {
        gap: 0.75rem !important;
        height: auto !important;
        min-height: 58px !important;
        padding: 0.55rem 0.8rem !important;
    }

    .ballot-topbar .topbar-left {
        gap: 0.6rem !important;
        min-width: 0;
    }

    .ballot-topbar .topbar-logo-box {
        flex: 0 0 34px;
        height: 34px;
        width: 34px;
    }

    .ballot-topbar .topbar-titles {
        min-width: 0;
    }

    .ballot-topbar .sys-title {
        display: block;
        font-size: 0.92rem;
        max-width: 48vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ballot-topbar .sys-subtitle {
        display: none;
    }

    .ballot-topbar .topbar-right {
        flex: 1 1 auto !important;
        gap: clamp(0.35rem, 2vw, 0.65rem) !important;
        justify-content: flex-end !important;
        min-width: 0 !important;
    }

    .ballot-global-layout:not(.admin-shell) .ballot-session-timer {
        font-size: clamp(0.62rem, 2.75vw, 0.76rem);
    }

    .ballot-split-content {
        flex-direction: column !important;
        width: 100%;
    }

    .ballot-sidebar {
        display: none !important;
    }

    .ballot-main {
        padding: 0.75rem 0.45rem !important;
        width: 100%;
    }

    .main-header-area {
        align-items: stretch !important;
        flex-direction: column !important;
        gap: 1rem !important;
        margin-bottom: 1.2rem !important;
    }

    .main-header-left h1 {
        font-size: clamp(1.35rem, 7vw, 2rem) !important;
        line-height: 1.08;
        max-width: none;
    }

    .hiraya-title-tagline {
        font-size: 0.84rem;
        line-height: 1.35;
    }

    .main-header-right,
    .progress-box {
        width: 100%;
    }

    .progress-box {
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .progress-bar-small {
        flex: 1 1 auto;
        max-width: none;
        min-width: 80px;
    }

    .hiraya-ballot-brief {
        border-left-width: 4px;
        margin-bottom: 1rem;
        padding: 0.95rem;
    }

    .hiraya-ballot-content {
        grid-template-columns: 1fr;
    }

    .hiraya-ballot-copy h2 {
        font-size: 1rem;
        line-height: 1.3;
    }

    .hiraya-ballot-copy p:not(.hiraya-ballot-kicker) {
        font-size: 0.84rem;
        line-height: 1.55;
    }

    .hiraya-ballot-poster {
        justify-self: center;
        max-width: min(280px, 100%);
        width: 100%;
    }

    .instruction-banner {
        align-items: flex-start !important;
        font-size: 0.84rem !important;
        margin-bottom: 1rem !important;
        padding: 0.85rem 2.5rem 0.85rem 0.9rem !important;
    }

    .position-block-new {
        padding: 0.85rem 0.5rem !important;
    }

    .position-heading-new {
        flex-direction: column;
        gap: 0.85rem;
    }

    .selection-counter-box {
        align-self: flex-start;
    }

    .ballot-global-layout:not(.admin-shell) .instruction-banner {
        padding: 0.75rem 2.25rem 0.75rem 0.75rem !important;
    }

    /*
     * Head-to-head and multi-candidate grids use repeat(2|3, 1fr) in the base stylesheet.
     * That beats the generic .candidate-grid-new mobile rule and overflows narrow screens.
     */
    .ballot-global-layout:not(.admin-shell) .candidate-grid-new.is-head-to-head,
    .ballot-global-layout:not(.admin-shell) .candidate-grid-new.is-multi-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .ballot-global-layout:not(.admin-shell) .candidate-grid-new.is-unopposed {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        justify-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .ballot-global-layout:not(.admin-shell) .candidate-card-new {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 600px) {
    .ballot-topbar .sys-title {
        max-width: 42vw;
    }

    .session-timer {
        font-size: 0.72rem;
        gap: 0.25rem;
    }

    .btn-exit {
        height: 34px;
        justify-content: center;
        padding: 0 !important;
        width: 40px;
    }

    .btn-exit {
        font-size: 0;
    }

    .btn-exit i {
        font-size: 0.95rem;
    }

    .ballot-global-layout:not(.admin-shell) .ballot-main {
        padding: 0.55rem 0.38rem !important;
    }

    .hiraya-ballot-poster {
        max-width: min(230px, 100%);
    }

    .progress-box {
        gap: 0.6rem;
        padding: 0.55rem 0.7rem;
    }

    .ballot-global-layout:not(.admin-shell) .position-block-new {
        padding: 0.75rem 0.42rem !important;
    }
}

@media (max-width: 480px) {

    html,
    body,
    .ballot-global-layout,
    .ballot-split-content,
    .ballot-main,
    .main-content {
        max-width: 100vw;
        overflow-x: hidden !important;
    }

    .ballot-topbar {
        align-items: center !important;
        max-width: 100vw;
        padding: 0.55rem 0.45rem !important;
        row-gap: 0.35rem;
    }

    .ballot-topbar .topbar-left {
        flex: 0 0 auto;
    }

    .ballot-topbar .topbar-titles {
        display: none !important;
    }

    .ballot-topbar .topbar-logo-box {
        flex-basis: 30px;
        height: 30px;
        width: 30px;
    }

    .ballot-global-layout:not(.admin-shell) .ballot-topbar .topbar-right {
        flex-wrap: nowrap;
        gap: 0.35rem !important;
        max-width: calc(100vw - 3.25rem);
    }

    .ballot-global-layout:not(.admin-shell) .ballot-session-timer {
        font-size: 0.62rem;
        white-space: nowrap;
    }

    .main-header-left .eyebrow {
        font-size: 0.68rem;
        line-height: 1.2;
    }

    .main-header-left h1 {
        font-size: clamp(1.1rem, 7.5vw, 1.45rem) !important;
        line-height: 1.05;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .hiraya-title-tagline {
        font-size: 0.72rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .progress-box {
        gap: 0.45rem;
        min-width: 0;
        overflow: hidden;
        padding: 0.5rem 0.55rem;
    }

    .progress-box>span:first-child,
    .progress-box>span:last-child {
        flex: 0 0 auto;
        font-size: 0.68rem !important;
        white-space: nowrap;
    }

    .progress-bar-small {
        flex: 1 1 48px;
        min-width: 36px;
        width: auto;
    }

    .hiraya-ballot-brief {
        border-left-width: 3px;
        max-width: 100%;
        overflow: hidden;
        padding: 0.75rem 0.65rem;
        width: 100%;
    }

    .hiraya-ballot-content,
    .hiraya-ballot-copy {
        min-width: 0;
        width: 100%;
    }

    .hiraya-ballot-kicker {
        font-size: 0.62rem;
        letter-spacing: 0.04em;
    }

    .hiraya-ballot-copy h2 {
        font-size: 0.86rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .hiraya-ballot-copy p:not(.hiraya-ballot-kicker) {
        font-size: 0.72rem;
        line-height: 1.45;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .hiraya-ballot-poster {
        max-width: min(210px, 100%);
    }

    .instruction-banner {
        font-size: 0.74rem !important;
        line-height: 1.4;
    }

    .ballot-global-layout:not(.admin-shell) .ballot-main {
        padding: 0.45rem 0.32rem !important;
    }

    .ballot-global-layout:not(.admin-shell) .position-block-new {
        padding: 0.65rem 0.38rem !important;
    }

    .ballot-global-layout:not(.admin-shell) .hiraya-ballot-brief {
        padding: 0.65rem 0.5rem !important;
    }

    .ballot-global-layout:not(.admin-shell) .candidate-img-wrapper {
        width: clamp(4.5rem, 22vw, 5.5rem) !important;
        height: clamp(4.5rem, 22vw, 5.5rem) !important;
        min-width: clamp(4.5rem, 22vw, 5.5rem) !important;
    }
}

/* Admin responsive layout overrides */
.admin-shell .ballot-split-content {
    display: flex !important;
    flex-direction: row !important;
}

.admin-shell .ballot-sidebar {
    display: flex !important;
    flex: 0 0 260px !important;
    height: calc(100vh - 64px) !important;
    min-width: 260px !important;
    top: 64px !important;
    width: 260px !important;
}

.admin-shell .admin-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 2rem 3rem !important;
}

.admin-shell .admin-content {
    min-width: 0;
}

.admin-shell .panel-heading,
.admin-shell .brief-filter-bar,
.admin-shell .turnout-item {
    min-width: 0;
}

.admin-shell .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-shell .table {
    min-width: 720px;
}

@media (max-width: 1180px) {
    .admin-shell .admin-main {
        padding: 1.5rem 2rem !important;
    }

    .admin-shell .dashboard-main-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .canvassing-command-grid,
    .canvassing-stat-grid {
        grid-template-columns: 1fr;
    }

    .admin-shell .brief-filter-bar {
        align-items: stretch;
        display: grid;
        gap: 0.85rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-shell .filter-group {
        align-items: stretch;
        flex-direction: column;
        gap: 0.35rem;
    }

    .admin-shell .filter-select,
    .admin-shell .filter-select.select-wide {
        min-width: 0;
        width: 100%;
    }

    .admin-shell .filter-legend {
        display: none;
    }

    .admin-shell .js-tally-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-shell .voter-filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-shell .voter-filter-actions {
        grid-column: 1 / -1;
    }

    .security-rule-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .admin-shell .ballot-split-content {
        flex-direction: column !important;
    }

    .admin-shell .ballot-sidebar {
        display: flex !important;
        flex: 0 0 auto !important;
        height: auto !important;
        min-width: 0 !important;
        overflow: visible !important;
        position: sticky !important;
        top: 64px !important;
        width: 100% !important;
        z-index: 1900;
    }

    .admin-shell .sidebar-header {
        display: flex !important;
    }

    .admin-shell #adminSidebarCollapse {
        background: rgba(251, 229, 193, 0.98);
        border: 1px solid rgba(111, 115, 95, 0.18);
        border-radius: 0 0 16px 16px;
        box-shadow: 0 16px 36px rgba(63, 102, 101, 0.16);
        left: 0;
        padding: 0.75rem 1rem 1rem;
        position: absolute;
        right: 0;
        top: 100%;
        width: 100%;
        z-index: 1901;
    }

    .admin-shell .jump-nav {
        display: block !important;
        padding: 0 !important;
    }

    .admin-shell .admin-sidebar-actions {
        margin: 0.9rem 0 0;
    }

    .admin-shell .admin-main {
        padding: 1rem !important;
        width: 100%;
    }

    .admin-shell .admin-content {
        padding: 1rem 0 0;
    }

    .admin-shell .main-header-area {
        align-items: stretch !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .admin-shell .main-header-right,
    .admin-shell .progress-box {
        width: 100%;
    }

    .admin-shell .admin-grid,
    .admin-shell .dashboard-main-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 640px) {
    .admin-shell .ballot-topbar {
        min-height: 58px !important;
        padding: 0.55rem 0.75rem !important;
    }

    .admin-shell .topbar-left {
        gap: 0.55rem !important;
        min-width: 0;
    }

    .admin-shell .topbar-logo-box {
        flex: 0 0 34px;
        height: 34px;
        width: 34px;
    }

    .admin-shell .topbar-titles {
        min-width: 0;
    }

    .admin-shell .sys-title {
        display: block;
        font-size: 0.9rem;
        max-width: 48vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .admin-shell .sys-subtitle,
    .admin-shell .admin-user-info {
        display: none !important;
    }

    .admin-shell .admin-profile-btn {
        padding: 0.2rem !important;
    }

    .admin-shell .admin-avatar-circle {
        height: 34px !important;
        width: 34px !important;
    }

    .admin-shell .sidebar-header {
        padding: 0.8rem 1rem;
    }

    .admin-shell .sidebar-header-titles h2 {
        font-size: 1rem !important;
    }

    .admin-shell .sidebar-header-titles p {
        font-size: 0.62rem !important;
    }

    .admin-shell .dashboard-stat-grid,
    .admin-shell .brief-filter-bar,
    .admin-shell .voter-filter-bar {
        grid-template-columns: 1fr !important;
    }

    .admin-shell .voter-filter-actions {
        flex-direction: column;
    }

    .admin-shell .dashboard-stat-card,
    .admin-shell .admin-panel,
    .admin-shell .dashboard-activity-panel {
        border-radius: 14px;
        padding: 1rem;
    }

    .admin-shell .panel-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.75rem;
    }

    .admin-shell .panel-heading h2 {
        font-size: 1.08rem;
        overflow-wrap: anywhere;
    }

    .admin-shell .result-grid {
        grid-template-columns: 1fr !important;
    }

    .admin-shell .chart-frame {
        min-height: 220px;
    }
}

/* --- Improved Position Filter Pills --- */
.btn-filter-pill {
    white-space: nowrap;
    padding: 0.6rem 1.25rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-filter-pill:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

.btn-filter-pill.active {
    background: #b06a24;
    border-color: #b06a24;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(176, 106, 36, 0.25);
}

.pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.1rem 0.6rem;
    border-radius: 6px;
    min-width: 24px;
}

.btn-filter-pill.active .pill-count {
    background: rgba(255, 255, 255, 0.2);
}

/* --- Final Priority Print Rules --- */
@media print {
    .no-print,
    .ballot-topbar,
    .ballot-sidebar,
    .sidebar-header,
    .sidebar-header-titles,
    .btn-brown.no-print,
    .admin-profile-dropdown,
    header,
    aside,
    #adminSidebarCollapse,
    button[data-bs-toggle='collapse'],
    .bi-list,
    .d-lg-none.border-0.p-1 {
        display: none !important;
    }

    .printable-report {
        padding: 0 !important;
        border: none !important;
        margin: 0 !important;
        box-shadow: none !important;
        width: 100% !important;
        max-width: none !important;
    }

    body {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .admin-main {
        padding: 0 !important;
        margin: 0 !important;
    }

    .admin-shell {
        display: block !important;
    }

    .ballot-split-content {
        display: block !important;
    }
}

/* --- Sidebar Quick Guide --- */
.sidebar-quick-guide {
    margin: 2rem 1.25rem 1.5rem;
    padding: 1.25rem;
    background: rgba(176, 106, 36, 0.05);
    border: 1px solid rgba(176, 106, 36, 0.1);
    border-radius: 16px;
}

.guide-title {
    font-size: 0.7rem;
    font-weight: 900;
    color: var(--ssc-brown);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.guide-step {
    display: flex;
    gap: 0.85rem;
}

.step-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: var(--ssc-brown);
    color: #ffffff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    font-family: 'Public Sans', sans-serif;
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.step-content strong {
    font-size: 0.85rem;
    color: #1f1817;
    font-weight: 800;
    line-height: 1.2;
}

.step-content p {
    font-size: 0.75rem;
    color: rgba(31, 24, 23, 0.7);
    margin: 0;
    line-height: 1.5;
}
