.campaign-splash {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.campaign-splash .splash-inner {
    background: #fff;
    border-radius: 14px;
    padding: 12px;
    max-width: min(92vw, 680px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    text-align: center;
}
.campaign-splash img { max-width: 100%; height: auto; display: block; margin: 0 auto 10px; border-radius: 8px; }
.campaign-splash .splash-countdown { margin-top: 6px; font-size: 0.9rem; color: #333; }
@import url('https://fonts.googleapis.com/css2?family=Hind:wght@300;400;500;600;700&display=swap');

:root {
    --skin-primary: #223954;
    --skin-secondary: #d1242b;
    --skin-accent: #f7c66d;
    --gray-light: #f4f5f7;
    --gray-border: #dee2e6;
    --success-green: #33a852;
}

* {
    box-sizing: border-box;
}


body {
    font-family: 'Hind', 'Noto Sans Devanagari', Arial, sans-serif;
    background-color: #dcdcd7;
    color: #111;
    min-height: 100vh;
}

.ballot-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 15px;
    background: radial-gradient(circle at top, #f1f1eb, #c5c5c0);
}

.ballot-wrapper {
    width: 1024px;
    max-width: 100%;
    background: #f7f5ed;
    border: 8px solid #d4d0c5;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(43, 36, 26, 0.35);
    overflow: hidden;
}

.ballot-unit {
    padding: 18px 22px 22px; /* tighter spacing to mimic EVM */
    background: #fefdf7;
}

/* Removed unit-top-strip and related styles as they're no longer needed */

.unit-info {
    border-bottom: 2px solid #c7c2b8;
    padding: 10px 4px;
    margin: 0 auto;
    max-width: 80%;
}

.unit-subtext {
    display: block;
    font-size: 0.85rem;
    color: #6b655a;
}

.unit-ward {
    font-size: 1.1rem;
    color: #333;
    margin-top: 4px;
}

.ballot-table-wrapper {
    margin-top: 12px;
    border: 2px solid #c9c3ba;
    background: #fff;
    overflow: hidden;
}

.ballot-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    table-layout: fixed;
    border-spacing: 0;
    /* band stop across क्र.अ. + उमेदवार + चिन्ह */
    --band-stop: 68.3%;
}

.ballot-table thead th {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    background: #ece7da;
    padding: 10px;
}

.ballot-table th,
.ballot-table td {
    border: 1px solid #d6cfc2;
}

.ballot-table td {
    padding: 12px 10px;
    vertical-align: middle;
    height: 84px;
    line-height: 1.1;
}

.ballot-row:nth-child(2n) {
    background: #fcfaf3;
}

.ballot-row.selected-row {
    background: inherit !important;
    box-shadow: none;
}
.ballot-row.selected-row .slot-num,
.ballot-row.selected-row .candidate-info,
.ballot-row.selected-row .symbol-cell,
.ballot-row.selected-row .bulb-cell,
.ballot-row.selected-row .button-cell {
    background: var(--ward-bg, #f8f9fa) !important;
}
.ballot-row.selected-row .candidate-info strong { font-weight: 800; }

.ballot-row .candidate-info {
    background: var(--ward-bg, transparent);
    padding: 0.5rem 1rem;
    margin: 0 -1rem;
    position: relative;
    z-index: 1;
}

.ballot-row .slot-num,
.ballot-row .symbol-cell {
    background: var(--ward-bg, transparent);
    position: relative;
    z-index: 1;
}

/* Ensure ward colors are always applied and can't be overridden */
.ballot-row .candidate-info,
.ballot-row .slot-num,
.ballot-row .symbol-cell {
    background: var(--ward-bg, #f8f9fa) !important;
}
.col-total { width: 12%; }

.slot-num {
    text-align: center;
    font-weight: 600;
}

.candidate-info {
    display: table-cell; /* ensure background fills full cell width */
    vertical-align: middle;
}

.candidate-info > * { margin: 0; }

/* keep cells layered normally */
.slot-num,
.candidate-info { position: relative; }

/* place content above the band */
.slot-num, .candidate-info, .symbol-cell, .bulb-cell, .button-cell { position: relative; z-index: 1; }

.candidate-meta {
    font-size: 0.85rem;
    color: #4a4a45;
}

.candidate-meta.meta-light {
    color: #7b7469;
    font-size: 0.8rem;
}

.candidate-empty {
    color: #bbb;
    font-style: italic;
}

.symbol-cell,
.bulb-cell,
.button-cell {
    text-align: center;
}
/* enforce separator between candidate and symbol columns */
.symbol-cell { border-left: 1px solid #d6cfc2 !important; }
.bulb-cell { border-left: 1px solid #d6cfc2 !important; }
.button-cell { border-left: 1px solid #d6cfc2 !important; }
.bulb-cell, .button-cell { padding: 8px; }
.bulb-cell { overflow: hidden; }
.button-cell { overflow: hidden; }

/* extend the ward color slightly into the चिन्ह cell to remove any visual gap */
.symbol-cell { padding-left: 10px !important; position: static; }
.symbol-cell > * { margin-left: 0; }

.symbol-img {
    width: 64px;
    height: 48px;
    object-fit: contain;
}

.symbol-placeholder {
    color: #aaa;
}

.bulb-cell { position: static; }
.button-cell { position: static; }

/* make band meet the चिन्ह column: no left padding on symbol cell */
.symbol-cell { padding-left: 0 !important; }
.symbol-cell > * { margin-left: 8px; }

/* Bulb = crisp left arrow (shaft + head) via clip-path */
.bulb-arrow {
    display: inline-block;
    width: 48px;   /* slightly narrower to avoid crossing into button column */
    height: 20px;
    margin-right: 4px; /* breathing room from the right border */
    background: linear-gradient(180deg, #ff5a5a 0%, #d81b1b 100%); /* original lighter base */
    -webkit-clip-path: polygon(0% 50%, 16px 0%, 16px 4px, 100% 4px, 100% 16px, 16px 16px, 16px 100%);
            clip-path: polygon(0% 50%, 16px 0%, 16px 4px, 100% 4px, 100% 16px, 16px 16px, 16px 100%);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.6), inset 0 -1px 1px rgba(0,0,0,0.14);
    transition: box-shadow 150ms ease, background 150ms ease, transform 150ms ease, filter 150ms ease;
}
.bulb-cell .bulb-arrow { position: static; transform: none; }
.bulb-arrow.placeholder {
    background: #e6dfd5;
}
.bulb-arrow.glow {
    /* Stronger outer glow and brighter face for visibility */
    filter: drop-shadow(0 0 3px rgba(255,0,0,0.95))
            drop-shadow(0 0 10px rgba(255,0,0,0.9))
            drop-shadow(0 0 18px rgba(255,40,40,0.85));
    background: linear-gradient(180deg, #ff2d2d 0%, #9a0000 100%);
    box-shadow: 0 0 0 4px rgba(255,0,0,0.55),
                0 0 22px 10px rgba(255,0,0,0.75),
                inset 0 2px 3px rgba(255,255,255,0.9);
    animation: bulbPulse 0.9s ease-out;
}

@keyframes bulbPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

/* remove inner borders so color band reaches up to चिन्ह column */
.candidate-info { border-left: 0 !important; border-right: 0 !important; }

.vote-btn {
    width: 88px; /* fit inside column reliably */
    height: 54px; /* compact */
    border-radius: 12px;
    border: 2px solid #2b4a91;
    background: linear-gradient(180deg, #4667c2, #274182);
    display: inline-block;
    margin: 0 auto;
    max-width: 100%;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.4), 0 4px 10px rgba(10, 24, 71, 0.4);
    transition: transform 0.15s ease, opacity 0.2s;
}
.button-cell .vote-btn { position: static; transform: none; }

/* smaller headers for Bulb/Button */
.ballot-table thead th.col-bulb,
.ballot-table thead th.col-button { font-size: 0.72rem; letter-spacing: 0.3px; }

.vote-btn .arrow-icon {
    width: 24px;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 20px solid #fefefe;
    margin-left: 4px;
}

.vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-placeholder {
    display: inline-block;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 2px dashed #bbb2a5;
}

.total-cell {
    text-align: center;
    font-weight: 600;
    color: #2e2a25;
}

@media (max-width: 992px) {
    .ballot-wrapper {
        padding: 20px 16px;
    }
    .ballot-unit {
        padding: 20px;
        border-width: 2px;
    }
    .unit-info {
        gap: 6px;
    }
    .ballot-table {
        font-size: 0.85rem;
    }
    .ballot-table td {
        padding: 12px 8px;
    }
    .col-name { width: 44%; }
    .ballot-table { --band-stop: 68%; }
    .col-symbol { width: 18%; }
    .col-button { width: 18%; }
}

@media (max-width: 576px) {
    .ballot-body {
        padding: 12px;
    }
    .ballot-wrapper {
        padding: 0;
        box-shadow: none;
        background: transparent;
    }
    .ballot-unit {
        border-radius: 12px;
        padding: 16px 12px;
    }
    .unit-top-strip {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .unit-info {
        flex-direction: column;
        gap: 4px;
        text-align: left;
    }
    .ballot-table td {
        height: auto;
        padding: 8px 6px;
    }
    .candidate-info {
        gap: 2px;
    }
    .candidate-info strong { font-size: 0.88rem; line-height: 1.1; }
    .candidate-meta { font-size: 0.72rem; }
    .candidate-meta.meta-light { font-size: 0.68rem; }
    .bulb-arrow { transform: scale(0.65); }
    .vote-btn { width: 64px; height: 42px; border-radius: 10px; }
    .symbol-img { width: 38px; height: 28px; }
    .col-serial { width: 12%; }
    .col-name { width: 40%; }
    .ballot-table { --band-stop: 70%; }
    .col-symbol { width: 18%; }
    .col-bulb { width: 12%; }
    .col-button { width: 18%; }
}

.arrow-icon::after {
    content: '';
}

/* Modal */
.modal-content {
    border-radius: 16px;
    border: none;
}

.modal-header {
    border-bottom: none;
    padding-bottom: 0;
}

.modal-title {
    font-weight: 600;
}

.modal-footer {
    border-top: none;
}

.btn-ok {
    background: var(--skin-primary);
    color: #fff;
    border-radius: 999px;
    padding: 8px 30px;
}

/* Admin styles */
.admin-shell {
    min-height: 100vh;
    display: flex;
}

.admin-sidebar {
    width: 260px;
    background: #172335;
    color: #fff;
    padding: 24px 16px;
}

.admin-sidebar a {
    color: #cfd8e3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    text-decoration: none;
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.admin-content {
    flex: 1;
    padding: 32px;
    background: #f5f7fb;
}

.card-counter {
    border-radius: 18px;
    padding: 24px;
    color: #fff;
}

.card-counter .count-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    opacity: 0.85;
}

.card-counter .count-value {
    font-size: 2.2rem;
    font-weight: 700;
}
