/* PollGrid — Dark Theme inspired by Kunnam AC-148 */

:root {
    --primary:       #1a237e;
    --primary-dark:  #111827;
    --primary-mid:   #1e293b;
    --accent:        #e65100;
    --accent-badge:  #FF6F00;
    --success:       #43a047;
    --warning:       #f57f17;
    --danger:        #c62828;
    --info:          #1e88e5;
    --teal:          #00897b;
    --teal-light:    #80cbc4;
    --bg:            #111827;
    --bg-card:       #1e293b;
    --bg-input:      rgba(255,255,255,0.08);
    --text:          #f1f5f9;
    --text-secondary: rgba(255,255,255,0.85);
    --text-muted:    rgba(255,255,255,0.6);
    --text-dim:      rgba(255,255,255,0.4);
    --text-faint:    rgba(255,255,255,0.2);
    --border:        rgba(255,255,255,0.1);
    --border-hover:  rgba(255,255,255,0.22);
    --radius:        12px;
    --radius-lg:     20px;
    --radius-sm:     8px;
    --shadow:        0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg:     0 4px 20px rgba(0,0,0,0.4);
    --font:          'Noto Sans Tamil', 'Segoe UI', Arial, sans-serif;

    /* Turnout colors */
    --turnout-low:     #c62828;
    --turnout-medium:  #f57f17;
    --turnout-good:    #388e3c;
    --turnout-high:    #1565c0;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===== NAVBAR ===== */
.pg-navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    z-index: 1050;
}

.pg-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 20px;
    color: var(--text) !important;
    text-decoration: none;
}

.pg-logo-icon {
    background: var(--info);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 18px;
}

.pg-ac-badge {
    background: rgba(255,111,0,0.2);
    color: #ffcc02;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 16px;
    border-radius: 20px;
    border: 1px solid #FF6F00;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pg-live-dot {
    width: 8px;
    height: 8px;
    background: #f44336;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.pg-navbar .nav-link {
    color: rgba(255,255,255,0.75) !important;
    font-size: 13px;
    padding: 6px 12px !important;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.pg-navbar .nav-link:hover,
.pg-navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.1);
}

.pg-lang-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pg-lang-toggle a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.pg-lang-toggle a.active {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

.pg-lang-sep {
    color: var(--text-dim);
}

/* ===== MAIN ===== */
.pg-main {
    min-height: calc(100vh - 130px);
    padding: 20px 16px;
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: hidden;
    box-sizing: border-box;
    width: 100%;
}

/* ===== FOOTER ===== */
.pg-footer {
    background: var(--bg-card);
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 16px;
    color: rgba(255,255,255,0.35);
    font-size: 12px;
}

/* ===== HERO SECTION ===== */
.pg-hero {
    background: linear-gradient(135deg, #1e293b 0%, #1e3a5f 40%, #1976d2 100%);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    margin-bottom: 24px;
    border: none;
}

.pg-hero h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.pg-hero .pg-subtitle {
    font-size: 14px;
    color: #fff;
    opacity: 0.65;
    margin-bottom: 20px;
}

.pg-hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* ===== STAT BOXES ===== */
.pg-stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.pg-stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    min-width: 0;
    flex: 1;
}

.pg-stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--info);
    line-height: 1.2;
}

.pg-stat-value.green { color: var(--success); }
.pg-stat-value.teal { color: var(--teal); }
.pg-stat-value.orange { color: #ff6d00; }
.pg-stat-value.danger { color: var(--danger); }

.pg-stat-label {
    font-size: 10px;
    color: #fff;
    opacity: 0.5;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ===== CARDS ===== */
.pg-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.15s;
}

.pg-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.pg-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.pg-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

/* ===== BOOTH CARDS GRID ===== */
.pg-booth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 9px;
}

.pg-booth-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius);
    padding: 12px;
    transition: all 0.15s;
    cursor: pointer;
    min-width: 0;
    overflow: hidden;
}

.pg-booth-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.pg-booth-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.pg-booth-number {
    background: var(--info);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pg-booth-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pg-booth-meta {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    margin-bottom: 12px;
}

.pg-booth-actions {
    display: flex;
    gap: 8px;
}

/* ===== BUTTONS ===== */
.btn-pg-primary {
    background: var(--info);
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-pg-primary:hover {
    background: #1976d2;
    color: #fff;
    transform: translateY(-1px);
}

.btn-pg-teal {
    background: rgba(0,137,91,0.2);
    color: var(--teal-light);
    border: 1px solid rgba(0,137,91,0.4);
    padding: 9px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-pg-teal:hover {
    background: rgba(0,137,91,0.35);
    color: #fff;
}

.btn-pg-accent {
    background: #ff6d00;
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-pg-accent:hover {
    background: #bf4400;
    color: #fff;
}

.btn-pg-success {
    background: var(--success);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-pg-success:hover {
    background: #388e3c;
    color: #fff;
}

.btn-pg-danger {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.btn-pg-sm {
    padding: 6px 14px;
    font-size: 12px;
}

/* Gold gradient button (Leader Dashboard CTA) */
.btn-pg-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ff8f00 100%);
    color: #000;
    border: none;
    padding: 16px 24px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 16px;
    min-width: 155px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(255,215,0,0.3);
}

.btn-pg-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,215,0,0.4);
    color: #000;
}

/* CTA buttons in hero */
.pg-hero-actions .btn-pg-primary,
.pg-hero-actions .btn-pg-teal {
    min-width: 155px;
    padding: 16px 24px;
    border-radius: 14px;
    font-size: 16px;
}

/* Full-width booth open button */
.btn-pg-booth-open {
    background: var(--info);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-pg-booth-open:hover {
    background: #1976d2;
    color: #fff;
}

/* ===== SEARCH / CONTROLS ===== */
.pg-controls {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.pg-controls.sticky {
    position: sticky;
    top: 60px;
    z-index: 100;
}

.pg-search-input {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    width: 100%;
    font-family: var(--font);
    transition: border-color 0.2s;
}

.pg-search-input::placeholder {
    color: rgba(255,255,255,0.25);
}

.pg-search-input:focus {
    outline: none;
    border-color: var(--info);
    box-shadow: 0 0 0 3px rgba(30,136,229,0.15);
}

/* Filter Chips */
.pg-filter-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: none;
}

.pg-filter-chips::-webkit-scrollbar {
    display: none;
}

.pg-chip {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.55);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.pg-chip:hover,
.pg-chip.active {
    background: var(--info);
    color: #fff;
    border-color: var(--info);
}

.pg-result-count {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    padding: 6px 0 0;
}

/* ===== PROGRESS BAR ===== */
.pg-progress {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.pg-progress-bar {
    height: 100%;
    border-radius: 10px;
    background: var(--info);
    transition: width 0.5s ease;
}

.pg-progress-bar.green { background: var(--success); }
.pg-progress-bar.orange { background: var(--warning); }
.pg-progress-bar.red { background: var(--danger); }

/* ===== MODULE NAV GRID ===== */
.pg-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.pg-module-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.pg-module-card:hover {
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    color: var(--text);
}

.pg-module-icon {
    font-size: 28px;
    color: var(--info);
}

.pg-module-label {
    font-size: 13px;
    font-weight: 600;
}

/* ===== CONSTITUENCY CARDS ===== */
.pg-ac-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: all 0.15s;
}

.pg-ac-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.pg-ac-number {
    background: var(--info);
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 8px;
}

/* ===== SECTION TITLE ===== */
.pg-section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--info);
    display: inline-block;
}

/* ===== ACTIVITY FEED ===== */
.pg-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pg-activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.pg-activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.pg-activity-icon.voted { background: rgba(67,160,71,0.15); color: var(--success); }
.pg-activity-icon.undone { background: rgba(198,40,40,0.15); color: var(--danger); }

.pg-activity-time {
    color: var(--text-dim);
    font-size: 11px;
}

/* ===== FORMS ===== */
.pg-form-group {
    margin-bottom: 16px;
}

.pg-form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

.pg-form-control {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    width: 100%;
    font-family: var(--font);
}

.pg-form-control:focus {
    outline: none;
    border-color: var(--info);
    box-shadow: 0 0 0 3px rgba(30,136,229,0.15);
}

select.pg-form-control option {
    background: #1e293b;
    color: #f1f5f9;
}

/* ===== TABLES ===== */
.pg-table {
    width: 100%;
    border-collapse: collapse;
}

.pg-table th {
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.pg-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.pg-table tr:hover {
    background: rgba(255,255,255,0.02);
}

/* ===== CHAT ===== */
.pg-chat-container {
    max-width: 800px;
    margin: 0 auto;
}

.pg-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 0;
    min-height: 400px;
    max-height: 60vh;
    overflow-y: auto;
}

.pg-chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.6;
}

.pg-chat-bubble.user {
    background: var(--info);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.pg-chat-bubble.ai {
    background: var(--bg-card);
    border: 1px solid var(--border);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.pg-chat-input-row {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

/* ===== LOGIN PAGE ===== */
.pg-login-wrapper {
    max-width: 400px;
    margin: 60px auto;
    padding: 0 16px;
}

.pg-login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
}

.pg-login-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.pg-login-card .pg-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ===== VOTER CARD ===== */
.pg-voter-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
}

.pg-voter-name-ta {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.pg-voter-name-en {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.pg-voter-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    font-size: 13px;
}

.pg-voter-detail-label {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
}

/* ===== MARK VOTED BTN ===== */
.btn-mark-voted {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    height: 60px;
    transition: all 0.2s;
}

.btn-mark-voted:hover {
    background: #bf4400;
    transform: scale(1.01);
}

.btn-mark-voted.voted {
    background: var(--success);
    cursor: default;
}

/* ===== ELECTION STATUS BANNER ===== */
.pg-election-banner {
    border-radius: var(--radius);
    padding: 16px 24px;
    text-align: center;
    font-weight: 600;
    margin-bottom: 20px;
}

.pg-election-banner.not-started {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.pg-election-banner.active {
    background: rgba(67,160,71,0.1);
    border: 1px solid rgba(67,160,71,0.3);
    color: var(--success);
}

.pg-election-banner.paused {
    background: rgba(245,127,23,0.1);
    border: 1px solid rgba(245,127,23,0.3);
    color: var(--warning);
}

.pg-election-banner.closed {
    background: rgba(198,40,40,0.1);
    border: 1px solid rgba(198,40,40,0.3);
    color: var(--danger);
}

/* ===== TABS (custom) ===== */
.pg-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.pg-tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.pg-tab:hover,
.pg-tab.active {
    color: var(--text);
    border-bottom-color: var(--info);
}

/* ===== TOAST ===== */
.pg-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s;
}

.pg-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===== DRAWER (Booth Detail) ===== */
.pg-drawer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1060;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.pg-drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.pg-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 1070;
    transition: right 0.3s;
    overflow-y: auto;
    padding: 24px;
}

.pg-drawer.open {
    right: 0;
}

.pg-drawer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

/* ===== PRINT SLIP ===== */
.pg-slip {
    border: 1px solid #333;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    page-break-inside: avoid;
}

.pg-slip-header {
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .pg-main {
        padding: 12px 10px;
    }

    .pg-hero {
        padding: 24px 16px;
    }

    .pg-hero h1 {
        font-size: 22px;
    }

    .pg-stat-box {
        min-width: 100px;
        padding: 12px 16px;
    }

    .pg-stat-value {
        font-size: 22px;
    }

    .pg-booth-grid {
        grid-template-columns: 1fr;
    }

    .pg-module-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .pg-drawer {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 80vh;
        border-left: none;
        border-top: 1px solid var(--border);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .pg-drawer.open {
        right: 0;
    }
}

@media (max-width: 400px) {
    .pg-module-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pg-stats-row {
        gap: 8px;
    }
}

/* ===== BADGE VARIANTS ===== */
.badge-live {
    background: #f44336;
    color: #fff;
    animation: pulse-dot 1.5s infinite;
}

/* ===== DROPDOWN OVERRIDES ===== */
.dropdown-menu-dark {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.dropdown-menu-dark .dropdown-item {
    color: var(--text-muted);
    font-size: 13px;
}

.dropdown-menu-dark .dropdown-item:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

/* ===== TURNOUT BORDER CLASSES ===== */
.turnout-low { border-left: 3px solid var(--turnout-low) !important; }
.turnout-medium { border-left: 3px solid var(--turnout-medium) !important; }
.turnout-good { border-left: 3px solid var(--turnout-good) !important; }
.turnout-high { border-left: 3px solid var(--turnout-high) !important; }

/* ===== LOADING SPINNER ===== */
.pg-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--info);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== PLATFORM HERO (Super Admin) ===== */
.pg-platform-hero {
    background: linear-gradient(135deg, #1e293b 0%, #1e3a5f 40%, #1976d2 100%);
    border-radius: var(--radius-lg);
    padding: 32px 24px 28px;
    text-align: center;
    margin-bottom: 20px;
}

.pg-platform-hero-badge {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
}

.pg-platform-hero-badge i {
    color: var(--info);
    margin-right: 6px;
}

.pg-platform-hero-sub {
    color: rgba(255,255,255,0.55);
    font-size: 14px;
    margin: 0 0 20px 0;
}

.pg-platform-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 18px 12px;
    gap: 0;
}

.pg-platform-stat {
    flex: 1;
    text-align: center;
}

.pg-platform-stat-num {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.pg-platform-stat-label {
    font-size: 10px;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    margin-top: 4px;
}

.pg-platform-stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .pg-platform-hero { padding: 24px 16px 20px; }
    .pg-platform-hero-badge { font-size: 18px; }
    .pg-platform-stat-num { font-size: 18px; }
    .pg-platform-stats { padding: 14px 8px; }
}

/* ===== LEADER DASHBOARD ===== */
.pg-leader-hero {
    background: linear-gradient(135deg, #1e293b 0%, #1e3a5f 40%, #1976d2 100%);
    border-radius: var(--radius-lg);
    padding: 28px 24px 24px;
    margin-bottom: 20px;
}

.pg-leader-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.pg-leader-hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.pg-leader-hero-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 4px 0;
}

.pg-leader-hero-sub {
    color: rgba(255,255,255,0.55);
    margin: 0;
    font-size: 16px;
}

.pg-leader-status-chip {
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

.pg-leader-status-chip.not-started {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
}

.pg-leader-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 16px 8px;
    margin-bottom: 16px;
}

.pg-leader-stat {
    flex: 1;
    text-align: center;
}

.pg-leader-stat-num {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.pg-leader-stat-label {
    font-size: 10px;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-top: 4px;
}

.pg-leader-stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.pg-leader-progress-wrap {
    margin-top: 4px;
}

.pg-leader-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-top: 8px;
}

.pg-leader-refresh {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
}

/* Summary cards */
.pg-leader-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.pg-leader-summary-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    padding: 16px;
}

.pg-leader-summary-header {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pg-leader-summary-header.good { color: #66bb6a; }
.pg-leader-summary-header.bad { color: #ef5350; }

.pg-leader-summary-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.pg-leader-summary-num {
    background: rgba(30,136,229,0.15);
    color: #42a5f5;
    font-weight: 800;
    font-size: 11px;
    min-width: 30px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pg-leader-summary-bar-wrap {
    flex: 1;
    min-width: 0;
}

.pg-leader-summary-pct {
    font-size: 12px;
    font-weight: 700;
    min-width: 40px;
    text-align: right;
}

.pg-leader-summary-pct.good { color: #66bb6a; }
.pg-leader-summary-pct.bad { color: #ef5350; }

@media (max-width: 600px) {
    .pg-leader-summary-grid {
        grid-template-columns: 1fr;
    }
    .pg-leader-stat-num {
        font-size: 20px;
    }
    .pg-leader-hero-title {
        font-size: 20px;
    }
}

/* ===== ANALYSIS PAGE ===== */
.pg-analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
}

.pg-analysis-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.pg-analysis-stat {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
}

.pg-analysis-stat:hover {
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

.pg-analysis-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.pg-analysis-stat-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.pg-analysis-stat-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-top: 2px;
}

.pg-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 20px;
}

.pg-analysis-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.2s;
}

.pg-analysis-card:hover {
    border-color: rgba(255,255,255,0.15);
}

.pg-analysis-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.pg-analysis-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.pg-analysis-card-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.pg-analysis-card-sub {
    font-size: 12px;
    color: var(--text-dim);
    margin: 2px 0 0 0;
}

.pg-analysis-chart-wrap {
    position: relative;
    height: 260px;
}

.pg-analysis-chart-tall {
    height: 400px;
}

@media (max-width: 900px) {
    .pg-analysis-grid {
        grid-template-columns: 1fr;
    }
    .pg-analysis-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 500px) {
    .pg-analysis-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Booth table */
.pg-booth-table-wrap {
    max-height: 520px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.06);
}

.pg-booth-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.pg-booth-table thead th {
    background: rgba(13,20,33,0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.pg-sortable {
    user-select: none;
    white-space: nowrap;
}

.pg-sortable:hover {
    color: var(--text);
}

.pg-sortable i {
    font-size: 14px;
    opacity: 0.4;
    vertical-align: middle;
}

.pg-booth-num-badge {
    background: rgba(30,136,229,0.15);
    color: #42a5f5;
    font-weight: 800;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    min-width: 32px;
    text-align: center;
}

.pg-booth-name-cell {
    font-size: 12px;
    color: var(--text-muted);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pg-distrib-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
}

.pg-distrib-male {
    background: rgba(66,165,245,0.7);
    transition: width 0.3s;
}

.pg-distrib-female {
    background: rgba(236,64,122,0.7);
    transition: width 0.3s;
}

.pg-pct-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

.pg-pct-badge.good {
    background: rgba(102,187,106,0.15);
    color: #66bb6a;
}

.pg-pct-badge.mid {
    background: rgba(255,167,38,0.15);
    color: #ffa726;
}

.pg-pct-badge.low {
    background: rgba(239,83,80,0.15);
    color: #ef5350;
}

/* ===== EMPTY STATE ===== */
.pg-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.pg-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.3;
}
