:root {
    --primary-color: #d32f2f;
    /* Formal Red */
    --secondary-color: #fbc02d;
    /* Gold */
    --accent-color: #1a237e;
    /* Navy Blue */
    --bg-color: #f4f6f9;
    --text-color: #2c3e50;
    --card-bg: #ffffff;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/*
.cand-divider,
.cand-actions {
    display: none !important;
}
*/
/* Header & Banner */
header {
    background: linear-gradient(135deg, var(--accent-color) 0%, #0d1245 100%);
    color: white;
    padding: 2.5rem 1rem;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(251, 192, 45, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color), var(--secondary-color));
}

header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    max-width: 1200px;
    margin: 0 auto;
    line-height: 1.4;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header h1 span {
    display: block;
    color: var(--secondary-color);
    margin-top: 0.5rem;
}

/* Search Section */
.search-container {
    max-width: 600px;
    margin: -25px auto 2rem;
    padding: 0 1rem;
    position: relative;
    z-index: 10;
}

.search-wrapper {
    background: white;
    border-radius: 50px;
    padding: 5px 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.search-wrapper:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-color);
}

.search-icon {
    color: #95a5a6;
    margin-right: 12px;
}

#search-input {
    border: none;
    outline: none;
    width: 100%;
    padding: 12px 0;
    font-size: 1rem;
    background: transparent;
}

/* Main Content */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.table-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: visible;
    /* Changed from overflow-x: auto to not break sticky header */
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f8fafc;
    /* Ensure solid background when sticking */
}

th {
    padding: 1.25rem 1rem;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent-color);
    white-space: nowrap;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--accent-color);
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

td {
    padding: 1rem;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.95rem;
    vertical-align: middle;
}

tr:hover td {
    background-color: #fcfcfc;
}

tr:last-child td {
    border-bottom: none;
}

.stt-col {
    width: 50px;
    text-align: center;
}

.img-col {
    width: 100px;
    text-align: center;
}

.name-col {
    font-weight: 600;
    color: var(--accent-color);
    min-width: 140px;
    line-height: 1.4;
}

.thumbnail {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid white;
}

.thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.btn-detail {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-detail:hover {
    background-color: #b71c1c;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: none;
}

.modal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.cand-zoom-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 5;
    opacity: 0.8;
}

.cand-zoom-icon:hover {
    transform: scale(1.1);
    background: white;
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-chup-anh {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-chup-anh:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
}

.btn-close-x {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-close-x:hover {
    color: var(--primary-color);
}

.btn-close-modal {
    padding: 8px 20px;
    background: #64748b;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-close-modal:hover {
    background: #475569;
}

.modal-content {
    background: white;
    padding: 0;
    border-radius: var(--border-radius);
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.modal-title {
    font-weight: 700;
    color: var(--accent-color);
}

.modal-body {
    padding: 0;
    overflow: auto;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.pdf-frame {
    width: 100%;
    height: 80vh;
    border: none;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #edf2f7;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f9fa;
}

.btn-close {
    background-color: #64748b;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.btn-open {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #64748b;
    font-size: 0.9rem;
    background: #f8f9fa;
    border-top: 1px solid #edf2f7;
}

/* Detail Page Styling */
.detail-container {
    max-width: 1000px;
    margin: 20px auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.back-nav {
    margin-bottom: 2rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #64748b;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-back:hover {
    background-color: #475569;
    transform: translateX(-5px);
}

.candidate-header {
    display: flex;
    gap: 3rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f4f8;
}

.candidate-img-container {
    flex: 0 0 250px;
}

.candidate-img-large {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    cursor: zoom-in;
    transition: var(--transition);
    border: 4px solid white;
}

.candidate-img-large:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.candidate-info-summary {
    flex: 1;
}

.candidate-info-summary h2 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.info-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    margin-bottom: 2rem;
}

.info-label {
    font-weight: 700;
    color: #64748b;
    background: #f8fafc;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.info-value {
    padding: 8px 0;
    color: var(--text-color);
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
}

.full-info-section {
    margin-top: 3rem;
}

.section-title {
    font-size: 1.4rem;
    color: var(--accent-color);
    border-left: 6px solid var(--accent-color);
    padding-left: 15px;
    margin-bottom: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.full-info-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.full-info-table tr td {
    padding: 12px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.full-info-table tr:last-child td {
    border-bottom: none;
}

.full-info-table tr td:first-child {
    width: 30%;
    background-color: #f8fafc;
    font-weight: 700;
    color: #475569;
    font-size: 0.9rem;
}

.actions-container {
    margin-top: 2rem;
    display: flex;
    gap: 20px;
}

.btn-pdf-detail,
.btn-zoom-large {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-pdf-detail {
    background: linear-gradient(135deg, var(--primary-color) 0%, #b71c1c 100%);
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.25);
}

.btn-pdf-detail:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.35);
}

.btn-zoom-large {
    background: linear-gradient(135deg, var(--accent-color) 0%, #0d1245 100%);
    box-shadow: 0 4px 15px rgba(26, 35, 126, 0.25);
}

.btn-zoom-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(26, 35, 126, 0.35);
}


#bottom-nav-container {
    max-width: 1000px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.bottom-nav {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f4f8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.btn-save-image {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
    font-size: 0.95rem;
}

.btn-save-image:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35);
}

.btn-save-image:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-top {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: #b71c1c;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(100, 116, 139, 0.2);
    font-size: 0.95rem;
}

.btn-top:hover {
    background: #475569;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(100, 116, 139, 0.3);
}

@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
    }

    header {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 1.2rem;
    }

    .hide-on-mobile {
        display: none;
    }

    td,
    th {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .thumbnail {
        width: 60px;
        height: 75px;
    }

    .btn-detail {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    /* Detail Page Responsive */
    .detail-container {
        padding: 1.25rem;
        margin: 10px;
    }

    .candidate-header {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
        text-align: center;
        padding-bottom: 1.5rem;
    }

    .candidate-img-container {
        flex: 0 0 200px;
        width: 200px;
    }

    .candidate-info-summary h2 {
        font-size: 1.6rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
        text-align: left;
        gap: 5px;
    }

    .info-label {
        background: transparent;
        padding: 0;
        margin-top: 10px;
        color: #94a3b8;
        font-size: 0.8rem;
    }

    .info-value {
        padding-top: 2px;
        border-bottom: 1px solid #f1f5f9;
        font-size: 0.9rem;
    }

    /* Stack table columns for better mobile display */
    .full-info-table thead {
        display: none;
    }

    .full-info-table tr {
        display: block;
        border-bottom: 2px solid #e2e8f0;
        padding: 5px 0;
    }

    .full-info-table tr td {
        display: block;
        width: 100% !important;
        padding: 8px 15px;
        border: none;
    }

    .full-info-table tr td:first-child {
        background-color: #f8fafc;
        font-weight: 700;
        color: var(--accent-color);
        padding-bottom: 2px;
        font-size: 0.8rem;
        text-transform: uppercase;
    }

    .full-info-table tr td:last-child {
        padding-top: 2px;
        font-size: 0.95rem;
    }

    .actions-container {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .btn-pdf-detail,
    .btn-zoom-large,
    .btn-back {
        width: 100%;
        justify-content: center;
    }

    .bottom-nav {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        margin-top: 2rem;
    }

    .btn-save-image,
    .btn-top {
        width: 100%;
        justify-content: center;
    }
}

/* Floating Back to Top Button */
.floating-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(26, 35, 126, 0.4);
    transition: var(--transition);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    border: 2px solid white;
    outline: none;
}

.floating-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.floating-top-btn:hover {
    background: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.5);
}

@media (max-width: 768px) {
    .floating-top-btn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* ===== COUNTDOWN - Đã ẩn vì bầu cử kết thúc ===== */
.countdown-section {
    display: none;
}


/* ===== FILTER BAR ===== */
.filter-bar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.filter-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.filter-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid #cbd5e1;
    background: transparent;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Search input in filter bar */
.filter-search-wrap {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 20px;
    padding: 4px 12px;
    gap: 6px;
    transition: all 0.2s ease;
}

.filter-search-wrap:focus-within {
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.08);
}

.filter-search-wrap i {
    color: #94a3b8;
    font-size: 0.75rem;
}

.filter-search-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.8rem;
    font-family: inherit;
    color: var(--text-color);
    width: 160px;
    padding: 2px 0;
}

.filter-search-input::placeholder {
    color: #94a3b8;
}

/* ===== TOGGLE - Hiển thị người không trúng cử ===== */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    transition: all 0.2s ease;
    user-select: none;
}

.toggle-wrap:hover {
    border-color: #ef4444;
    background: #fff5f5;
}

.toggle-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    display: inline-block;
    width: 36px;
    height: 20px;
    background: #cbd5e1;
    border-radius: 20px;
    position: relative;
    transition: background 0.25s ease;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background: #ef4444;
}

.toggle-switch input:checked+.toggle-slider::after {
    transform: translateX(16px);
}

/* ===== MAIN LAYOUT ===== */
.tbc-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    padding-bottom: 1px;
}

/* ===== TỔ SECTION ===== */
.to-section {
    margin-bottom: 3rem;
    scroll-margin-top: 60px;
}

.to-header {
    background: linear-gradient(135deg, var(--accent-color) 0%, #2a3a8c 100%);
    color: white;
    border-radius: 14px 14px 0 0;
    padding: 1.2rem 1.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.to-header::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    background: rgba(251, 192, 45, 0.07);
    border-radius: 50%;
}

.to-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.to-badge {
    background: var(--secondary-color);
    color: var(--accent-color);
    font-size: 1.3rem;
    font-weight: 800;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.to-title-wrap {
    text-align: center;
}

.to-ubbc {
    font-size: 1rem;
    font-weight: 800;
    color: var(--secondary-color);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
    opacity: 1;
}

.to-title-wrap h2 {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.to-thon {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 3px;
}

.to-thon i {
    margin-right: 4px;
    color: var(--secondary-color);
}

.to-stats {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 3px;
}

.to-body {
    background: white;
    border-radius: 0 0 14px 14px;
    border: 1px solid #e2e8f0;
    border-top: none;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* ===== CANDIDATES GRID ===== */
.candidates-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* ===== CANDIDATE CARD ===== */
.cand-card {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cand-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(26, 35, 126, 0.13);
    border-color: var(--accent-color);
}

.cand-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #e2e8f0;
}

.cand-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.4s ease;
}

.cand-card:hover .cand-img-wrap img {
    transform: scale(1.04);
}

/* Badge trúng cử / không trúng cử */
.cand-trungcu-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 7px 10px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-trungcu {
    background: linear-gradient(135deg, rgba(180, 130, 0, 0.92) 0%, rgba(212, 175, 55, 0.95) 100%);
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    box-shadow: 0 -2px 10px rgba(212, 175, 55, 0.4);
}

.badge-trungcu i {
    color: #fff7cc;
    font-size: 0.85rem;
    filter: drop-shadow(0 0 3px rgba(255, 220, 50, 0.7));
}

.badge-khongtrungcu {
    background: rgba(60, 60, 70, 0.82);
    color: rgba(255, 255, 255, 0.75);
}

.badge-khongtrungcu i {
    color: rgba(255, 255, 255, 0.5);
}

/* Card border theo trạng thái */
.card-trungcu {
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 0 1.5px rgba(212, 175, 55, 0.25);
}

.card-trungcu:hover {
    border-color: rgba(180, 130, 0, 0.8);
    box-shadow: 0 12px 28px rgba(180, 130, 0, 0.22);
}

.card-khongtrungcu {
    opacity: 0.78;
}

.card-khongtrungcu:hover {
    opacity: 1;
}

/* Gender badge cũ (vẫn giữ cho tương thích) */
.cand-gender-badge {
    position: absolute;
    top: 9px;
    right: 9px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 20px;
}

/* Gender badge inline trong meta-row */
.cand-gender-inline {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    vertical-align: middle;
}

.badge-nam {
    background: rgba(26, 35, 126, 0.85);
    color: white;
}

.badge-nu {
    background: rgba(211, 47, 47, 0.85);
    color: white;
}

.cand-info {
    padding: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cand-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 0.1rem;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.cand-name-khac {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-top: 2px;
}

.cand-chucvu {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.4;
    margin-bottom: 0.65rem;
    padding: 6px 10px;
    text-align: center;
    /*display: flex;*/
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cand-meta {
    font-size: 0.77rem;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow: hidden;
}

.cand-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.cand-meta-row i {
    color: var(--primary-color);
    width: 16px;
    margin-top: 4px;
}

.cand-meta-value {
    color: var(--text-color);
    line-height: 1.4;
}

.cand-work-row {
    flex-direction: column;
    gap: 5px;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px dashed #ddd;
}

.work-history-title {
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    color: #8B0000;
    /* Màu đỏ đô */
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.cand-work-row i {
    margin-top: 0;
}

.work-history-list {
    margin-top: 5px;
    font-size: 0.85rem;
    color: #555;
}

.work-item {
    margin-bottom: 10px;
    padding-left: 12px;
    border-left: 2px solid var(--secondary-color);
    line-height: 1.4;
}

.work-time {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 0.8rem;
    display: block;
    margin-bottom: 2px;
}

.work-desc {
    font-size: 0.85rem;
    color: #333;
}

.cand-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.6rem 0;
}

.btn-tieu-su {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #b71c1c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
    width: 100%;
}

.btn-tieu-su:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.35);
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
}

/* Actions row at bottom of card */
.cand-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

/* Removed flex: 1 to allow centering */

.btn-xem-pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px;
    background: linear-gradient(135deg, #b71c1c 0%, #7f0000 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-xem-pdf:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(127, 0, 0, 0.4);
    background: linear-gradient(135deg, #c62828 0%, #7f0000 100%);
}

/* ===== MODAL OVERLAY ===== */
.bio-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    backdrop-filter: blur(6px);
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.bio-modal-overlay.active {
    display: flex;
}

.bio-modal {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    margin: auto;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.bio-modal-header {
    background: linear-gradient(135deg, var(--accent-color) 0%, #0d1245 100%);
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bio-modal-header-title {
    color: white;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.bio-modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    font-family: inherit;
}

.bio-modal-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.bio-modal-body {
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
}

.bio-img-col {
    flex: 0 0 140px;
}

.bio-img-col img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border: 3px solid white;
}

.bio-info-col {
    flex: 1;
}

.bio-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
    line-height: 1.3;
    margin-bottom: 0.3rem;
}

.bio-chucvu {
    font-size: 0.82rem;
    color: #64748b;
    font-style: italic;
    margin-bottom: 1rem;
}

.bio-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.bio-table tr td {
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.bio-table tr:last-child td {
    border-bottom: none;
}

.bio-table tr td:first-child {
    width: 38%;
    font-weight: 700;
    color: #475569;
    background: #f8fafc;
    border-radius: 4px;
    font-size: 0.8rem;
}

.bio-table tr td:last-child {
    color: var(--text-color);
    font-weight: 500;
}

.bio-section-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--accent-color);
    border-left: 4px solid var(--accent-color);
    padding-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 1.2rem 0 0.8rem;
}

.bio-history {
    font-size: 0.82rem;
    color: #374151;
    line-height: 1.7;
}

.bio-history-item {
    padding: 5px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.bio-history-item:last-child {
    border-bottom: none;
}

.bio-history-period {
    font-weight: 700;
    color: var(--accent-color);
}

.bio-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-view-detail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #0d1245 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view-detail:hover {
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.35);
}

.btn-view-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #b71c1c 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view-pdf:hover {
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.35);
}

.btn-bio-close {
    padding: 9px 18px;
    background: #64748b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

/* ===== FOOTER (index page) ===== */
.tbc-footer {
    text-align: center;
    padding: 20px;
    color: #64748b;
    font-size: 0.9rem;
    background: #f8f9fa;
    border-top: 1px solid #edf2f7;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ===== INDEX PAGE RESPONSIVE ===== */
@media (max-width: 1200px) {
    .candidates-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .candidates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.1rem;
    }

    .to-header {
        padding: 1rem 1.2rem;
        border-radius: 12px 12px 0 0;
    }

    .to-stats {
        gap: 10px;
    }

    .stat-item {
        padding: 6px 10px;
    }

    .stat-num {
        font-size: 1.2rem;
    }

    .bio-modal-body {
        flex-direction: column;
        padding: 1.2rem;
    }

    .bio-img-col {
        flex: none;
        width: 110px;
        margin: 0 auto;
    }

    .countdown-timer {
        gap: 8px;
    }

    .countdown-item {
        min-width: 60px;
        padding: 8px 12px;
    }

    .countdown-num {
        font-size: 1.6rem;
    }

    .filter-btn {
        font-size: 0.75rem;
        padding: 5px 11px;
    }

    .filter-search-input {
        width: 120px;
    }
}

@media (max-width: 480px) {
    .candidates-grid {
        grid-template-columns: 1fr;
    }

    .to-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .to-header-left {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .to-title-wrap {
        text-align: center;
        align-items: center;
        display: flex;
        flex-direction: column;
    }

    .to-thon {
        text-align: center;
    }

    .to-stats {
        width: 100%;
        justify-content: center;
    }
}

/* Landscape Phones & portrait tablets */
@media (min-width: 481px) and (max-width: 900px) {
    .candidates-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .to-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .to-header-left {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .to-title-wrap {
        text-align: center;
        align-items: center;
        display: flex;
        flex-direction: column;
    }

    .to-stats {
        margin-top: 1rem;
        width: 100%;
        justify-content: center;
    }
}

/* ===== SEARCH NO RESULT ===== */
.search-no-result {
    text-align: center;
    padding: 3rem 1rem;
    color: #ef4444;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.search-no-result i {
    font-size: 1.4rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}