/* ════════════════════════════════════════════════════════════
   LIVE ELECTION RESULTS — Styles
   JRMSU Tampilisan Campus · Digital Voting System
   ════════════════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
    --primary-blue:       #1A237E;
    --primary-blue-light: #3949AB;
    --primary-red:        #D32F2F;
    --primary-red-light:  #EF5350;
    --success-green:      #10b981;
    --warning-orange:     #f59e0b;
    --danger-red:         #ef4444;

    --text-dark:    #1a202c;
    --text-body:    #4B5563;
    --text-muted:   #9CA3AF;

    --bg-main:      #F8F9FA;
    --bg-card:      #FFFFFF;
    --border-light: #E5E7EB;

    --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:  0 4px 6px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.02);
    --shadow-lg:  0 10px 25px rgba(0,0,0,0.08);
    --shadow-xl:  0 20px 40px rgba(0,0,0,0.1);

    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-xl:  20px;

    /* Fluid spacing */
    --space-page-x: clamp(0.75rem, 3vw, 2rem);
    --space-page-y: clamp(1rem, 3vw, 2rem);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}


/* ── Base Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; height: auto; display: block; }
a   { text-decoration: none; color: inherit; }


/* ── Accessibility ── */
:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ── Animations ── */
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(1.3); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes highlight {
    0%   { color: var(--success-green); transform: scale(1.05); }
    100% { color: var(--primary-red); transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.05); opacity: 0.8; }
}

.fade-in { animation: slideIn 0.4s ease-out; }


/* ════════════════════════════════════════════
   PAGE WRAPPER
════════════════════════════════════════════ */
.page-wrapper {
    padding: var(--space-page-y) 0;
    padding-top: calc(var(--space-page-y) + var(--safe-top));
    padding-bottom: calc(var(--space-page-y) + var(--safe-bottom));
    min-height: 100vh;
}


/* ════════════════════════════════════════════
   BACK LINK
════════════════════════════════════════════ */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    margin-bottom: 1.25rem;
    transition: all 0.2s ease;
    min-height: 44px;
}

.back-link:hover {
    color: var(--primary-red);
    transform: translateX(-3px);
}


/* ════════════════════════════════════════════
   HEADER
════════════════════════════════════════════ */
.results-header {
    background: var(--bg-card);
    padding: clamp(1rem, 2.5vw, 1.5rem) clamp(1rem, 3vw, 2rem);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ── Header Left: Logo + Title ── */
.header-left {
    display: flex;
    align-items: center;
    gap: clamp(0.65rem, 2vw, 1rem);
    min-width: 0;
}

.header-logo {
    width: clamp(42px, 8vw, 56px);
    height: clamp(42px, 8vw, 56px);
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
    border: 2px solid var(--border-light);
    background: var(--bg-main);
    padding: 2px;
}

.header-title-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.header-title-group h2 {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 700;
    margin: 0;
    color: var(--primary-blue);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-title-group h2 span {
    color: var(--primary-red);
}

.header-title-group p {
    margin: 0;
    color: var(--text-muted);
    font-size: clamp(0.7rem, 1.5vw, 0.85rem);
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Header Right: Controls ── */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}


/* ════════════════════════════════════════════
   LIVE BADGE
════════════════════════════════════════════ */
.live-badge {
    padding: 0.4rem 0.85rem;
    border-radius: 50px;
    font-size: clamp(0.65rem, 1.5vw, 0.75rem);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 32px;
}

.live-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulseDot 1.5s ease-in-out infinite;
}

.live-badge.connected {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
}
.live-badge.connected::before { background: var(--success-green); }

.live-badge.connecting {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-orange);
}
.live-badge.connecting::before {
    background: var(--warning-orange);
    animation: spin 1s linear infinite;
    border-radius: 0;
    border: 2px solid var(--warning-orange);
    border-top-color: transparent;
}

.live-badge.disconnected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-red);
}
.live-badge.disconnected::before { background: var(--danger-red); animation: none; }

.last-update {
    font-size: clamp(0.7rem, 1.5vw, 0.8rem);
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.time-remaining {
    font-size: clamp(0.7rem, 1.5vw, 0.8rem);
    color: var(--primary-red);
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(211, 47, 47, 0.08);
    padding: 0.35rem 0.7rem;
    border-radius: 50px;
}

.election-selector {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    font-weight: 600;
    color: var(--primary-blue);
    cursor: pointer;
    min-width: 160px;
    min-height: 40px;
    transition: border-color 0.2s ease;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231A237E' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.election-selector:hover,
.election-selector:focus {
    border-color: var(--primary-blue);
    outline: none;
}


/* ════════════════════════════════════════════
   STATS ROW
════════════════════════════════════════════ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(0.65rem, 2vw, 1rem);
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: clamp(0.85rem, 2vw, 1.25rem) clamp(1rem, 2vw, 1.5rem);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: clamp(0.65rem, 2vw, 1rem);
    transition: all 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.stat-icon-badge {
    width: clamp(40px, 8vw, 52px);
    height: clamp(40px, 8vw, 52px);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: white;
    flex-shrink: 0;
}

.stat-icon-badge.blue   { background: var(--primary-blue); }
.stat-icon-badge.green  { background: var(--success-green); }
.stat-icon-badge.red    { background: var(--primary-red); }
.stat-icon-badge.orange { background: var(--warning-orange); }

.stat-text { flex: 1; min-width: 0; }

.stat-value {
    font-size: clamp(1.15rem, 3vw, 1.65rem);
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.1;
    margin: 0;
}

.stat-label {
    font-size: clamp(0.6rem, 1.3vw, 0.75rem);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
}

/* Turnout bar */
.vote-rate-bar-wrap {
    margin-top: 0.5rem;
    background: var(--bg-main);
    border-radius: 6px;
    overflow: hidden;
    height: 6px;
}

.vote-rate-bar-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-red));
    transition: width 0.5s cubic-bezier(.4,0,.2,1);
}

.vote-rate-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.4rem;
    font-size: clamp(0.6rem, 1.2vw, 0.7rem);
    font-weight: 600;
}

.vote-rate-labels .voted  { color: var(--success-green); }
.vote-rate-labels .didnot { color: var(--primary-red); }


/* ════════════════════════════════════════════
   FULLSCREEN STATE (Empty & Expired)
════════════════════════════════════════════ */
.fullscreen-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    text-align: center;
    padding: clamp(2rem, 5vw, 4rem);
    animation: fadeIn 0.6s ease;
}


/* ════════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════════ */
.empty-state {
    background: transparent;
    max-width: 550px;
    margin: 0 auto;
}

.empty-state-icon {
    width: clamp(140px, 30vw, 200px);
    height: clamp(140px, 30vw, 200px);
    background: linear-gradient(135deg, rgba(26, 35, 126, 0.06), rgba(211, 47, 47, 0.06));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2.5rem;
    animation: float 3s ease-in-out infinite;
}

.empty-state-icon i {
    font-size: clamp(4rem, 12vw, 6rem);
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state h3 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1.25rem;
}

.empty-state p {
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    color: var(--text-muted);
    max-width: 450px;
    margin: 0 auto;
    line-height: 1.8;
}

.empty-state-hint {
    margin-top: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.empty-state-hint i {
    font-size: 1.1rem;
    color: var(--primary-blue);
    flex-shrink: 0;
}

.empty-state-hint span {
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: var(--text-muted);
    font-weight: 500;
}


/* ════════════════════════════════════════════
   LOADING
════════════════════════════════════════════ */
.loading-container {
    text-align: center;
    padding: clamp(2.5rem, 6vw, 4rem) clamp(1.25rem, 4vw, 2rem);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-light);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.25rem;
}

.loading-container p {
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 600;
    color: var(--primary-blue);
    margin: 0;
}


/* ════════════════════════════════════════════
   EXPIRED MESSAGE
════════════════════════════════════════════ */
.expired-message {
    background: transparent;
    max-width: 550px;
    margin: 0 auto;
}

.expired-message .expired-icon {
    width: clamp(140px, 30vw, 200px);
    height: clamp(140px, 30vw, 200px);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(211, 47, 47, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.expired-message .expired-icon i {
    font-size: clamp(4rem, 12vw, 6rem);
    color: var(--danger-red);
}

.expired-message h3 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1.25rem;
}

.expired-message p {
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    color: var(--text-muted);
    max-width: 450px;
    margin: 0 auto;
    line-height: 1.8;
}

.expired-contact {
    margin-top: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.expired-contact i {
    font-size: 1.1rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.expired-contact span {
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: var(--text-muted);
    font-weight: 500;
}


/* ════════════════════════════════════════════
   FILTER BAR
════════════════════════════════════════════ */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: clamp(0.75rem, 2vw, 1rem) clamp(0.85rem, 2vw, 1.25rem);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}

.filter-label {
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.dept-pill {
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    font-weight: 600;
    border: 2px solid var(--border-light);
    background: var(--bg-main);
    color: var(--text-body);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    font-family: inherit;
}

.dept-pill:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: rgba(26, 35, 126, 0.04);
}

.dept-pill.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}


/* ════════════════════════════════════════════
   SECTION HEADING
════════════════════════════════════════════ */
.results-section { margin-bottom: 2rem; }

.section-heading {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: clamp(0.75rem, 2vw, 1rem) clamp(1rem, 2.5vw, 1.5rem);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.section-icon {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    flex-shrink: 0;
    color: var(--primary-blue);
}

.section-title {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    font-weight: 700;
    margin: 0;
    color: var(--text-dark);
}

.section-badge {
    margin-left: auto;
    background: var(--bg-main);
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: clamp(0.7rem, 1.3vw, 0.8rem);
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-muted);
}


/* ════════════════════════════════════════════
   LEADERBOARD GRID
════════════════════════════════════════════ */
.leaderboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.leaderboard-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: clamp(1rem, 2.5vw, 1.5rem);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    width: 100%;
    transition: all 0.25s ease;
}

.leaderboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.leaderboard-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 3px solid var(--primary-blue);
}

.leaderboard-title {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    flex: 1;
    min-width: 0;
}

.leaderboard-icon {
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    color: var(--primary-red);
    flex-shrink: 0;
}


/* ════════════════════════════════════════════
   DEPARTMENT INLINE STATS
════════════════════════════════════════════ */
.dept-inline-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: clamp(0.65rem, 1.5vw, 1rem);
    background: var(--bg-main);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.dept-inline-stat {
    text-align: center;
    padding: 0.4rem 0.2rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}

.dept-inline-stat-value {
    font-size: clamp(0.9rem, 2vw, 1.15rem);
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}

.dept-inline-stat-value.total   { color: var(--primary-blue); }
.dept-inline-stat-value.voted   { color: var(--success-green); }
.dept-inline-stat-value.abstain { color: var(--danger-red); }
.dept-inline-stat-value.turnout { color: var(--warning-orange); }

.dept-inline-stat-label {
    font-size: clamp(0.55rem, 1.1vw, 0.65rem);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 0.15rem;
}

.dept-inline-turnout-bar {
    grid-column: 1 / -1;
    height: 5px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.dept-inline-turnout-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--success-green));
    border-radius: 4px;
    transition: width 0.5s ease;
}


/* ════════════════════════════════════════════
   POSITION LABEL
════════════════════════════════════════════ */
.position-label {
    font-size: clamp(0.65rem, 1.3vw, 0.75rem);
    font-weight: 700;
    color: white;
    background: var(--primary-blue);
    padding: 0.3rem 0.85rem;
    border-radius: 50px;
    display: inline-block;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* ════════════════════════════════════════════
   CANDIDATE ITEMS
════════════════════════════════════════════ */
.candidates-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.candidate-item {
    background: var(--bg-main);
    border-radius: var(--radius-md);
    padding: clamp(0.65rem, 1.5vw, 0.9rem) clamp(0.7rem, 1.5vw, 1rem);
    display: flex;
    gap: clamp(0.5rem, 1.5vw, 0.85rem);
    align-items: center;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.candidate-item:hover {
    transform: translateX(4px);
    background: var(--bg-card);
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}

/* Rank badge */
.candidate-rank {
    width: clamp(24px, 5vw, 28px);
    height: clamp(24px, 5vw, 28px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.65rem, 1.3vw, 0.75rem);
    font-weight: 800;
    flex-shrink: 0;
    color: white;
}

.candidate-rank.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f; }
.candidate-rank.rank-2 { background: linear-gradient(135deg, #9ca3af, #6b7280); }
.candidate-rank.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); }
.candidate-rank.rank-n { background: var(--border-light); color: var(--text-muted); }

/* Avatar */
.candidate-avatar {
    width: clamp(34px, 8vw, 44px);
    height: clamp(34px, 8vw, 44px);
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-light);
}

.candidate-avatar-initials {
    width: clamp(34px, 8vw, 44px);
    height: clamp(34px, 8vw, 44px);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-red));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.85rem, 1.8vw, 1rem);
    font-weight: 700;
}

/* Info */
.candidate-info { flex: 1; min-width: 0; }

.candidate-name {
    font-size: clamp(0.8rem, 1.8vw, 0.95rem);
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.candidate-party {
    font-size: clamp(0.65rem, 1.3vw, 0.75rem);
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg-card);
    padding: 0.1rem 0.5rem;
    border-radius: 50px;
    display: inline-block;
    margin: 0;
    border: 1px solid var(--border-light);
}

/* Vote bar */
.vote-bar-container { margin-top: 0.4rem; }

.vote-bar {
    height: 4px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.vote-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-red));
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(.4,0,.2,1);
}

/* Stats column */
.candidate-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
    flex-shrink: 0;
}

.vote-count {
    font-size: clamp(0.95rem, 2.2vw, 1.25rem);
    font-weight: 700;
    color: var(--primary-red);
    margin: 0;
}

.vote-count.updated { animation: highlight 0.6s ease-out; }

.vote-pct {
    font-size: clamp(0.6rem, 1.3vw, 0.75rem);
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0;
}


/* ════════════════════════════════════════════
   RESPONSIVE — Tablets+ (≥768px)
════════════════════════════════════════════ */
@media (min-width: 768px) {
    .stats-row {
        grid-template-columns: repeat(4, 1fr);
    }
}


/* ════════════════════════════════════════════
   RESPONSIVE — Small tablets (≤768px)
════════════════════════════════════════════ */
@media (max-width: 768px) {
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-left {
        justify-content: flex-start;
    }

    .header-right {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .empty-state-hint,
    .expired-contact {
        flex-direction: column;
        gap: 0.4rem;
    }
}


/* ════════════════════════════════════════════
   RESPONSIVE — Small phones (≤480px)
════════════════════════════════════════════ */
@media (max-width: 480px) {
    .header-right {
        gap: 0.4rem;
    }

    .election-selector {
        min-width: 0;
        width: 100%;
    }

    .dept-inline-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .fullscreen-state {
        min-height: calc(100vh - 100px);
        padding: clamp(1.5rem, 4vw, 2rem);
    }

    .empty-state-icon,
    .expired-message .expired-icon {
        width: 120px;
        height: 120px;
    }

    .empty-state-icon i,
    .expired-message .expired-icon i {
        font-size: 3.5rem;
    }
}


/* ════════════════════════════════════════════
   RESPONSIVE — Extra small (≤360px)
════════════════════════════════════════════ */
@media (max-width: 360px) {
    .header-title-group h2 {
        font-size: 1rem;
    }

    .header-title-group p {
        font-size: 0.65rem;
    }

    .header-logo {
        width: 38px;
        height: 38px;
    }
}