/* ============================================
   STYLE APLIKASI PEMILIHAN KETUA OSIS
   Bootstrap 5 + Tailwind CSS Hybrid Responsive Design
   Warna: Putih, Merah Maroon Tua, Hitam
   ============================================ */

:root {
    --maroon: #7a0f1d;
    --maroon-dark: #5b0b17;
    --maroon-soft: #f8e9eb;
    --success: #16a34a;
    --success-dark: #15803d;
    --success-soft: #ecfdf5;
    --page-bg: #ffffff;
    --white: #ffffff;
    --text-dark: #111111;
    --text: #111111;
    --text-light: #ffffff;
    --muted: #555555;
    --border: #e8e8e8;
    --shadow: rgba(122, 15, 29, 0.08);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--maroon);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    color: var(--maroon-dark);
}

button,
input,
select,
textarea {
    font-family: inherit;
}

::selection {
    background: rgba(122, 15, 29, 0.12);
    color: var(--text);
}

body {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    background: #ffffff;
    background-attachment: scroll;
    background-position: center top;
    background-size: cover;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body,
.container,
.hero,
.card,
.stat-card,
.table-container,
.chart-box,
.hasil-item,
.kandidat-card,
.auth-card,
.landing-card,
.modal-content,
.modal-body,
.form-group label,
.form-group input,
.form-group select,
.form-group textarea,
.form-group > small,
.auth-footer,
.logo-auth p,
.auth-card .form-group label,
.auth-card .form-group input,
.result-summary,
.total-suara,
.hasil-info,
.hasil-item h3,
.hasil-item .kelas,
.hasil-item .jumlah-suara,
.chart-box h3,
.kandidat-card .body,
.kandidat-card .body h3,
.kandidat-card .body .kelas,
.kandidat-card .body .visi-misi p,
.kandidat-card .body .visi-misi h4,
.modal-header h3,
.modal-title,
.card h2,
.admin-stats,
.landing-card h3,
.landing-card p,
.landing-card strong,
.login-page-body,
.landing-page-body {
    color: var(--text-dark);
}

p, li, td, th, label, small, span, strong, em, input, select, textarea, button {
    color: inherit;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

/* ===== NAVBAR (Bootstrap 5 Custom) ===== */
.navbar {
    background: #7a0f1d !important;
    border-bottom: 3px solid #f2dcdc;
    box-shadow: 0 6px 18px rgba(122, 15, 29, 0.12);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar,
.navbar-brand,
.navbar .nav-link,
.navbar .dropdown-item,
.navbar .dropdown-toggle,
.footer,
.card-header-title,
.modal-header,
.modal-header h3,
.modal-title,
.modal-close,
table th,
.btn-primary,
.btn-success,
.btn-info,
.btn-danger,
.status-badge {
    color: var(--text-light) !important;
}

.navbar-brand {
    color: var(--white) !important;
    font-weight: 800;
}

.navbar-brand .text-white-50 {
    color: rgba(255, 255, 255, 0.95) !important;
}

.navbar .nav-link {
    color: var(--white) !important;
    font-weight: 600;
    transition: all 0.3s;
}

.navbar .nav-link:hover {
    color: var(--maroon) !important;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 8px;
    transform: translateY(-2px);
}

.navbar .nav-link.active {
    color: var(--maroon) !important;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 8px;
}

.navbar .dropdown-menu {
    background: #ffffff !important;
    border: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(17, 17, 17, 0.08);
    border-radius: 12px;
    min-width: 210px;
    padding: 8px;
    margin-top: 10px;
    z-index: 1060;
}

.navbar .dropdown-menu[data-bs-popper] {
    right: 0;
    left: auto;
}

.navbar .dropdown-item {
    color: #111111 !important;
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 600;
    white-space: nowrap;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item.active {
    background: #fff3f4 !important;
    color: var(--maroon) !important;
}

.navbar .nav-link.text-warning {
    color: #fff3cd !important;
}

@media (max-width: 991.98px) {
    .navbar .dropdown-menu {
        width: 100%;
        min-width: 100%;
        margin-top: 4px;
        border-radius: 10px;
    }

    .navbar .dropdown-item {
        padding: 11px 14px;
    }
}

.navbar-toggler {
    border: none;
    outline: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

/* Dropdowns */
.dropdown-menu-dark {
    background: #7a0f1d !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.dropdown-item {
    color: #ffffff !important;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

.dropdown-item.active {
    background: rgba(128, 0, 0, 0.4) !important;
    color: #ffffff !important;
}

/* ===== HERO ===== */
.hero {
    text-align: center;
    padding: 20px 15px;
    margin-bottom: 20px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(17, 17, 17, 0.04);
}

.hero h1 {
    font-size: 24px;
    color: #111111;
    margin-bottom: 8px;
    text-shadow: none;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.hero p {
    font-size: 13px;
    color: var(--muted);
    max-width: 100%;
    margin: 0 auto;
    line-height: 1.5;
}

/* ===== CARD ===== */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 30px rgba(17, 17, 17, 0.04);
    margin-bottom: 15px;
    color: var(--text-dark);
}

.card:hover {
    box-shadow: 0 16px 35px rgba(17, 17, 17, 0.06);
}

.card-header-title {
    color: #ffffff;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 15px 18px;
    background: #7a0f1d;
    border-bottom: 2px solid #7a0f1d;
    margin-bottom: 18px;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 8px 18px rgba(122, 15, 29, 0.12);
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.card-table-shell {
    overflow: visible;
    padding: 0;
    border-radius: 14px;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #fff9f9 0%, #ffffff 100%);
    border: 1px solid #f0e3e5;
    border-bottom: 1px solid #f0e3e5;
    border-radius: 14px 14px 0 0;
    padding: 14px 18px;
    margin: 0;
}

.table-toolbar-title {
    color: #111111;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.table-toolbar-meta {
    color: #555555;
    font-size: 12px;
    font-weight: 600;
}

.table-toolbar-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.table-filter-select {
    background: #fff;
    border: 1px solid #e6d8da;
    border-radius: 9px;
    color: var(--text);
    padding: 8px 12px;
    min-width: 170px;
    max-width: 220px;
    height: 38px;
    font-size: 13px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.table-filter-select:focus {
    outline: none;
    border-color: var(--maroon);
    box-shadow: 0 0 0 4px rgba(122, 15, 29, 0.08);
}

.table-toolbar .btn {
    height: 38px;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 13px;
}

.card h2 {
    color: var(--maroon);
    font-weight: 800;
    margin-bottom: 16px;
}

.card-centered {
    text-align: center;
}

.card-centered p {
    color: var(--muted);
    margin-bottom: 15px;
}

.card-body {
    padding: 1rem;
}

/* ===== SUCCESS CARD ===== */
#success-card {
    text-align: center;
    padding: 30px 18px !important;
}

#success-card h2 {
    font-size: 26px;
    margin-bottom: 15px;
    color: var(--success);
}

#success-card i {
    font-size: 42px;
    color: var(--success);
}

#success-card p {
    color: #111111;
    font-size: 15px;
    margin-bottom: 25px;
    font-weight: 500;
}

/* ===== TABLE TEXT WRAP ===== */
.table-wrap {
    white-space: nowrap;
}

/* ===== FORM (Bootstrap + Custom) ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #111111;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text);
    font-size: 14px;
    transition: all 0.3s;
    max-width: 100%;
    display: block;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #8a8a8a;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--maroon);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(122, 15, 29, 0.08);
}

.form-group select {
    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='%237a0f1d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.form-group select option {
    background: #800000;
    color: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group img {
    display: block;
    margin-top: 10px;
    max-width: 100%;
    height: auto;
}

input[type="file"] {
    padding: 10px;
    background: #ffffff;
    border: 2px solid var(--border);
    border-radius: 10px;
    color: #111111;
    width: 100%;
    font-size: 14px;
}

input[type="file"]::file-selector-button {
    background: #ffffff;
    color: #800000;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    margin-right: 10px;
}

.form-upload {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.form-group > small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    font-style: italic;
}

/* ===== BUTTON ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 6px 18px rgba(122, 15, 29, 0.12);
    white-space: nowrap;
    transform: translateY(0);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--maroon);
    color: var(--white);
    border: none;
}

.btn-primary:hover {
    background: var(--maroon-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(122, 15, 29, 0.25);
}

.btn-secondary {
    background: #f0f0f0;
    color: var(--text);
    border: 1px solid #d7d7d7;
}

.btn-secondary:hover {
    background: #e5e5e5;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: var(--success-dark);
    transform: translateY(-2px);
}

.btn-info {
    background: var(--maroon);
    color: var(--white);
}

.btn-info:hover {
    background: var(--maroon-dark);
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--maroon-soft);
    color: var(--maroon);
    border: 1px solid rgba(122, 15, 29, 0.15);
}

.btn-warning:hover {
    background: #f2dfe2;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--maroon);
    color: var(--white);
    border: 1px solid rgba(122, 15, 29, 0.15);
}

.btn-danger:hover {
    background: var(--maroon-dark);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 16px;
}

.btn-submit {
    width: 100%;
    padding: 14px 20px;
    margin-top: 25px;
    font-size: 15px;
    font-weight: 600;
}

/* ===== ALERT ===== */
.alert {
    padding: 15px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 8px 18px rgba(122, 15, 29, 0.08);
}

.alert-success {
    background: var(--success-soft);
    border: 1px solid rgba(22, 163, 74, 0.35);
    color: var(--success-dark);
}

.badge-success,
.text-success {
    color: var(--success-dark) !important;
}

.alert-danger {
    background: #fff4f4;
    border: 1px solid #d9b7b7;
    color: #7a0f1d;
}

.alert-warning {
    background: #fff8e8;
    border: 1px solid #f2d898;
    color: #7a0f1d;
}

.pemenang-alert {
    margin-top: 30px;
    font-size: 18px;
    text-align: center;
    background: var(--success-soft);
    border-color: rgba(22, 163, 74, 0.35);
    color: var(--success-dark);
}

/* ===== AUTH PAGE ===== */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: #ffffff;
}

.auth-card {
    background: #ffffff;
    border-radius: 15px;
    padding: 35px 25px;
    box-shadow: 0 18px 45px rgba(122, 15, 29, 0.12);
    width: 100%;
    max-width: 450px;
    border: 3px solid var(--maroon);
}

.landing-page-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: var(--text);
}

/* ===== LOGIN PAGE — Dark Maroon & White Theme ===== */
.login-page-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(1200px 800px at 50% 115%, rgba(92, 0, 0, 0.60), transparent 65%),
                linear-gradient(160deg, #800000 0%, #5c0000 48%, #4a0000 100%);
    background-attachment: fixed;
    color: var(--white);
}

.login-page-shell,
.landing-shell {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px;
}

.login-page-shell .auth-card {
    max-width: 520px;
    margin: 0 auto;
}

.landing-hero {
    text-align: center;
    margin-bottom: 2rem;
}

.landing-hero h1 {
    color: var(--maroon);
    font-weight: 800;
}

.landing-hero p {
    color: var(--muted);
    letter-spacing: 0.04em;
}

.countdown-item {
    background: #ffffff;
    border: 2px solid rgba(122, 15, 29, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    text-align: center;
    min-width: 80px;
    box-shadow: 0 8px 20px rgba(122, 15, 29, 0.06);
}

.countdown-number {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: var(--maroon);
}

.countdown-label {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
}

.landing-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 12px 28px rgba(122, 15, 29, 0.06);
}

.landing-card h3,
.landing-card p,
.landing-card strong {
    color: #111111;
}

.status-badge {
    background: var(--success);
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    display: inline-block;
}

.auth-icon,
.landing-badge {
    color: var(--maroon);
}

.logo-auth {
    text-align: center;
    margin-bottom: 25px;
}

.logo-duo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.logo-auth h1 {
    font-size: 18px;
    color: #800000;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.logo-auth p {
    font-size: 12px;
    color: #000000;
    line-height: 1.5;
    margin: 0;
}

.auth-card .form-group label {
    color: #000000;
    font-weight: 600;
    font-size: 12px;
}

.auth-card .form-group input {
    background: #f8f9fa;
    border: 2px solid #800000;
    color: #000000;
    padding: 11px 14px;
}

.auth-card .btn-primary {
    background: #800000;
    color: #ffffff;
    width: 100%;
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    margin-top: 15px;
}

.auth-footer {
    text-align: center;
    margin-top: 15px;
    color: #000000;
    font-size: 13px;
}

.auth-footer a {
    color: #800000;
    text-decoration: none;
    font-weight: 600;
}

.admin-login-link {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    border: 1px solid #800000;
    border-radius: 8px;
    color: #800000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.admin-login-link:hover {
    background: rgba(128, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* ===== LOGIN PAGE DARK MAROON + WHITE THEME OVERRIDES ===== */
.login-page-body .auth-card {
    background: rgba(40, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55) !important;
}

.login-page-body .auth-card .form-group label,
.login-page-body .auth-card .form-label {
    color: var(--white);
    font-weight: 600;
    font-size: 13px;
}

.login-page-body .auth-card .form-control,
.login-page-body .auth-card .form-group input,
.login-page-body .auth-card .form-group select,
.login-page-body .auth-card .form-group textarea {
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.25);
    color: var(--white);
    padding: 11px 14px;
}

.login-page-body .auth-card .form-control::placeholder,
.login-page-body .auth-card .form-group input::placeholder,
.login-page-body .auth-card .form-group select::placeholder,
.login-page-body .auth-card .form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.login-page-body .auth-card .form-control:focus,
.login-page-body .auth-card .form-group input:focus,
.login-page-body .auth-card .form-group select:focus,
.login-page-body .auth-card .form-group textarea:focus {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--white);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.2);
}

.login-page-body .auth-card .btn-primary {
    background: linear-gradient(135deg, #7a0f1d 0%, #800000 100%);
    color: var(--white);
    border: none;
    width: 100%;
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    margin-top: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 6px 18px rgba(122, 15, 29, 0.45);
}

.login-page-body .auth-card .btn-primary:hover {
    background: linear-gradient(135deg, #800000 0%, #7a0f1d 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(122, 15, 29, 0.55);
}

.login-page-body .auth-footer {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.login-page-body .auth-footer a {
    color: var(--white);
    text-decoration: underline;
    font-weight: 600;
}

.login-page-body .logo-auth h1 {
    color: var(--white);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
}

.login-page-body .logo-auth p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 600;
}

.login-page-body .logo-auth .logo-img,
.login-page-body .logo-img {
    width: 70px;
    height: 70px;
    background: var(--white);
    border-radius: 50%;
    padding: 6px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3), 0 8px 20px rgba(0, 0, 0, 0.35);
}

.login-page-body .alert-warning {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--white);
}

.login-page-body .alert-danger {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fca5a5;
}

/* ===== ADMIN STATS ===== */
.admin-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 8px 18px rgba(17, 17, 17, 0.03);
}

.stat-card .stat-number {
    font-size: 28px;
    font-weight: 800;
    color: #111111;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    color: var(--muted);
    font-size: 13px;
}

/* ===== TABLE ===== */
.table-container {
    overflow-x: auto;
    overflow-y: visible;
    margin-top: 0;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    border-radius: 0 0 14px 14px;
    border: 1px solid var(--border);
    border-top: none;
    background: #ffffff;
}

.table-container::-webkit-scrollbar {
    height: 5px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #d7b4ba;
    border-radius: 10px;
}

table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 10px;
    overflow: visible;
}

table th,
table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
    overflow: visible;
}

tbody td {
    padding-top: 14px;
    padding-bottom: 14px;
}

table th {
    background: #7a0f1d;
    background-clip: padding-box;
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #7a0f1d;
    position: sticky;
    top: 0;
    z-index: 2;
}

table td {
    color: #111111;
    background: #ffffff;
    position: relative;
}

.table-container,
.chart-box,
.hasil-item,
.kandidat-card,
.auth-card,
.landing-card,
.modal-content {
    color: var(--text-dark);
}

tbody tr {
    transition: background 0.2s ease, transform 0.2s ease;
    overflow: visible;
}

tbody tr:hover {
    background: #fff7f8;
}

tbody {
    overflow: visible;
}

/* ===== ACTION DROPDOWN ===== */
.action-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 36px;
    z-index: 3;
}

.action-btn {
    background: #fff7f7;
    border: 1px solid rgba(122, 15, 29, 0.18);
    color: var(--maroon);
    width: 38px;
    min-width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(122, 15, 29, 0.08);
    padding: 0;
    text-shadow: none;
    position: relative;
    z-index: 4;
}

.action-btn:hover,
.action-btn:focus-visible {
    background: var(--maroon);
    color: #ffffff;
    border-color: var(--maroon);
    box-shadow: 0 8px 18px rgba(122, 15, 29, 0.18);
    transform: translateY(-1px);
    outline: none;
}

table td:last-child {
    min-width: 90px;
    width: 90px;
    text-align: center;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}

.action-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 4px;
    background: #ffffff;
    border: 1px solid #e8d9db;
    border-radius: 12px;
    min-width: 170px;
    z-index: 99999;
    box-shadow: 0 20px 36px rgba(122, 15, 29, 0.18);
    overflow: visible;
    animation: dropdownIn 0.2s ease;
    isolation: isolate;
}

/* Dropdown opens upward when near bottom edge */
.action-dropdown.open-upward {
    top: auto;
    bottom: calc(100% + 10px);
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.action-dropdown.active {
    display: block;
}

.action-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: var(--text);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
}

.action-dropdown a:last-child {
    border-bottom: none;
}

.action-dropdown a:hover {
    background: #fff7f8;
    padding-left: 18px;
}

.action-dropdown a.action-edit:hover {
    background: rgba(122, 15, 29, 0.08);
}

.action-dropdown a.action-delete {
    color: #a1202f;
}

.action-dropdown a.action-delete:hover {
    background: rgba(161, 32, 47, 0.08);
}

/* ===== MODAL (Bootstrap Override) ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 17, 17, 0.6);
    backdrop-filter: blur(6px);
    z-index: 9999;
    overflow-y: auto;
    padding: 24px 16px;
}

.modal-content {
    background: #ffffff;
    color: var(--text);
    border: 1px solid rgba(122, 15, 29, 0.12);
    border-radius: 18px;
    width: 100%;
    max-width: 650px;
    margin: 40px auto;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(17, 17, 17, 0.15);
    animation: modalFadeIn 0.22s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, #7a0f1d 0%, #5b0b17 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
}

.modal-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 15px;
}

.modal-header h3,
.modal-title {
    color: #ffffff;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #ffffff;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: all 0.25s ease;
}

.modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    transform: rotate(90deg);
}

.modal-form {
    background: #ffffff;
}

.modal-body {
    padding: 22px 20px 12px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 0;
}

.modal-form .form-group {
    margin-bottom: 18px;
}

.modal-form .full-width {
    grid-column: 1 / -1;
}

.modal-form label {
    display: block;
    margin-bottom: 8px;
    color: #111111;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.modal-form .form-control {
    width: 100%;
    min-height: 46px;
    border: 1px solid #e1d5d7;
    background: #ffffff;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 14px;
    color: #111111;
    box-shadow: none;
    transition: all 0.2s ease;
}

.modal-form .form-control:focus {
    border-color: var(--maroon);
    box-shadow: 0 0 0 4px rgba(122, 15, 29, 0.08);
    outline: none;
}

.modal-form .form-control::placeholder {
    color: #8a8a8a;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #111111;
    cursor: pointer;
}

.checkbox-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--maroon);
    cursor: pointer;
    margin: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #f0ebeb;
    background: #fff;
    padding: 18px 20px 22px;
}

.modal-footer .btn {
    min-width: 150px;
    width: auto;
    margin: 0;
}

/* ===== VOTING CARD ===== */
.voting-card {
    position: relative;
    cursor: pointer;
    display: block;
    background: #ffffff;
    border: 2px solid rgba(122, 15, 29, 0.2);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    text-align: center;
}

.voting-card:hover {
    transform: translateY(-5px);
    border-color: var(--maroon);
    box-shadow: 0 10px 30px rgba(17, 17, 17, 0.08);
    background: #fffdfd;
}

.voting-card .kandidat-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.voting-card .kandidat-card-inner {
    padding: 20px;
    position: relative;
}

.voting-card .nomor-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ffffff;
    color: #800000;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.voting-card .foto-kandidat {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    margin: 15px auto 12px;
    overflow: hidden;
    border: 3px solid #ffffff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    background: #800000;
}

.voting-card .foto-kandidat img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.voting-card .foto-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    font-weight: bold;
    color: #ffffff;
    background: linear-gradient(135deg, #800000, #000000);
}

.voting-card .kandidat-info {
    padding: 0 8px;
}

.voting-card .kandidat-info h3 {
    color: #111111;
    font-size: 20px;
    margin-bottom: 4px;
}

.voting-card .kandidat-info .kelas {
    color: #333333;
    font-size: 13px;
    margin-bottom: 12px;
}

.voting-card .visi-misi {
    text-align: left;
    margin-bottom: 12px;
    max-height: 120px;
    overflow-y: auto;
    padding-right: 5px;
    color: #111111;
}

.voting-card .visi-misi h4 {
    color: #111111;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 700;
}

.voting-card .visi-misi p {
    color: #111111;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 8px;
    white-space: pre-line;
}

.voting-card .pilih-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
}

.voting-card .radio-circle {
    width: 22px;
    height: 22px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: all 0.3s;
}

.voting-card .pilih-text {
    color: #111111;
    font-size: 13px;
    font-weight: 500;
}

/* Kartu terpilih (selected) */
.voting-card.selected {
    border-color: var(--maroon);
    background: #fffdfd;
    box-shadow: 0 0 0 3px rgba(122, 15, 29, 0.15), 0 10px 30px rgba(17, 17, 17, 0.08);
    transform: translateY(-5px);
}

.voting-card.selected .radio-circle {
    background: var(--maroon);
    border-color: #ffffff;
    box-shadow: inset 0 0 0 4px #ffffff;
}

.voting-card.selected .pilih-text {
    color: #111111;
    font-weight: bold;
}

/* Kartu Calon Kosong (Golput) */
.calon-kosong-card {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.04);
}

.calon-kosong-card .nomor-kosong {
    background: #555555;
    color: #ffffff;
}

.calon-kosong-card .foto-kosong {
    background: #555555;
    border-color: #cccccc;
}

.calon-kosong-card .foto-placeholder {
    background: linear-gradient(135deg, #555555, #222222);
    font-size: 46px;
}

.calon-kosong-card.selected {
    border-color: #800000;
    background: rgba(128, 0, 0, 0.35);
    box-shadow: 0 0 0 3px #800000, 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* ===== CHART ===== */
.chart-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.chart-box {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    min-width: 0;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(17, 17, 17, 0.03);
}

.chart-box h3 {
    text-align: center;
    font-size: 16px;
    margin-bottom: 12px;
    color: #111111;
    font-weight: 800;
}

.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* ===== HASIL VOTING ===== */
.hasil-container {
    text-align: center;
}

.hasil-container .total-suara {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 20px;
    font-weight: 600;
}

.progress-bar-container {
    background: #f2f2f2;
    border-radius: 8px;
    height: 26px;
    margin: 8px 0 15px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--maroon), var(--maroon-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: #ffffff;
    font-weight: bold;
    font-size: 12px;
    transition: width 1s ease;
}

.hasil-item {
    background: #fffaf9;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 15px;
    text-align: left;
}

.hasil-item .hasil-item-inner {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hasil-item .hasil-foto {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hasil-item .hasil-foto img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #ffffff;
    display: block;
}

.hasil-item .foto-placeholder {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #800000, #5c0000);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 28px;
    border: 3px solid #ffffff;
}

.hasil-item .hasil-info {
    flex: 1;
    min-width: 0;
}

.hasil-item h3 {
    color: var(--maroon);
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 800;
}

.hasil-item .kelas {
    color: var(--muted);
    margin-bottom: 10px;
    font-size: 13px;
}

.hasil-item .jumlah-suara {
    font-size: 20px;
    font-weight: 800;
    color: var(--maroon);
}

/* ===== KANDIDAT GRID ===== */
.kandidat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

.kandidat-card {
    background: #ffffff;
    border: 2px solid var(--border);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s;
    text-align: center;
    box-shadow: 0 10px 25px rgba(122, 15, 29, 0.05);
}

.kandidat-card:hover {
    transform: translateY(-5px);
    border-color: var(--maroon);
    box-shadow: 0 12px 28px rgba(122, 15, 29, 0.1);
}

.kandidat-card .foto {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 20px auto 12px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: #800000;
    border: 4px solid #fff;
    overflow: hidden;
}

.kandidat-card .foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kandidat-card .body {
    padding: 16px;
}

.kandidat-card .body h3 {
    color: var(--maroon);
    font-size: 20px;
    margin-bottom: 4px;
}

.kandidat-card .body .kelas {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 12px;
}

.kandidat-card .body .visi-misi h4 {
    color: var(--maroon);
    margin-bottom: 4px;
    font-size: 13px;
}

.kandidat-card .body .visi-misi p {
    color: var(--text);
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 8px;
    white-space: pre-line;
}

/* ===== VOTING FORM ===== */
.voting-form {
    text-align: center;
}

.voting-form .kandidat-option {
    display: block;
    margin: 12px 0;
    padding: 16px;
    background: #fffaf9;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.voting-form .kandidat-option:hover {
    border-color: var(--maroon);
    background: #fff3f4;
}

.voting-form .kandidat-option input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.3);
    accent-color: #800000;
}

.voting-form .kandidat-option .option-info {
    display: inline-block;
    vertical-align: middle;
}

.voting-form .kandidat-option .option-info strong {
    color: #ffffff;
    font-size: 16px;
}

.voting-form .kandidat-option .option-info span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 20px 15px;
    color: #fff;
    font-size: 13px;
    background: #7a0f1d;
    border-top: 2px solid rgba(255, 255, 255, 0.18);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: auto;
    box-shadow: 0 -6px 18px rgba(122, 15, 29, 0.12);
}

/* ===== ANIMATIONS ===== */
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== RESPONSIVE - TABLET (Bootstrap Breakpoint) ===== */
@media (min-width: 768px) {
    .container {
        padding: 20px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 14px;
        max-width: 600px;
    }

    .card {
        padding: 22px;
        margin-bottom: 20px;
    }

    .card h2 {
        font-size: 22px;
    }

    .card-header-title {
        font-size: 22px;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-card .stat-number {
        font-size: 32px;
    }

    .kandidat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .voting-card .foto-kandidat {
        width: 140px;
        height: 140px;
    }

    .chart-row {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }

    .chart-container {
        height: 280px;
    }

    .auth-card {
        max-width: 450px;
        padding: 40px 35px;
    }

    .logo-auth h1 {
        font-size: 20px;
    }

    .logo-img {
        width: 80px;
        height: 80px;
    }
}

/* ===== RESPONSIVE - DESKTOP ===== */
@media (min-width: 992px) {
    body {
        background-attachment: fixed;
    }

    .container {
        padding: 25px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .card {
        padding: 25px;
    }

    .admin-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .kandidat-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }

    .chart-container {
        height: 300px;
    }

    table th,
    table td {
        padding: 14px 18px;
    }
}

/* ===== RESPONSIVE - LARGE DESKTOP ===== */
@media (min-width: 1200px) {
    .container {
        max-width: 1320px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .card {
        padding: 28px 30px;
    }

    .admin-stats {
        gap: 25px;
    }

    .stat-card .stat-number {
        font-size: 36px;
    }

    table th,
    table td {
        padding: 16px 20px;
    }
}

/* ===== RESPONSIVE - SMALL MOBILE ===== */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .hero h1 {
        font-size: 20px;
    }

    .hero p {
        font-size: 12px;
    }

    .card {
        padding: 15px;
        border-radius: 12px;
    }

    .card h2 {
        font-size: 18px;
    }

    .card-header-title {
        font-size: 18px;
        padding: 14px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 13px;
    }

    .form-group label {
        font-size: 11px;
    }

    .btn {
        padding: 10px 18px;
        font-size: 13px;
    }

    .btn-lg {
        padding: 10px 20px;
        font-size: 13px;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 11px;
    }

    .table-container {
        font-size: 11px;
        max-width: 100%;
    }

    table {
        min-width: 480px;
    }

    table th,
    table td {
        padding: 8px 10px;
        font-size: 11px;
    }

    .admin-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card .stat-number {
        font-size: 24px;
    }

    .stat-card .stat-label {
        font-size: 12px;
    }

    .chart-container {
        height: 220px;
    }

    .voting-card .foto-kandidat {
        width: 100px;
        height: 100px;
        margin: 12px auto 10px;
    }

    .voting-card .kandidat-card-inner {
        padding: 16px 12px;
    }

    .voting-card .kandidat-info h3 {
        font-size: 16px;
    }

    .voting-card .kandidat-info .kelas {
        font-size: 12px;
    }

    .voting-card .visi-misi {
        max-height: 160px;
    }

    .voting-card .visi-misi h4 {
        font-size: 12px;
    }

    .voting-card .visi-misi p {
        font-size: 11px;
    }

    .voting-card .pilih-text {
        font-size: 12px;
    }

    .kandidat-grid {
        gap: 12px;
    }

    .hasil-item {
        padding: 14px;
    }

    .hasil-item .hasil-item-inner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .hasil-item .hasil-info {
        text-align: left;
    }

    .hasil-item h3 {
        font-size: 16px;
    }

    .hasil-item .jumlah-suara {
        font-size: 18px;
    }

    .progress-bar {
        font-size: 10px;
        padding-right: 8px;
    }

    .auth-card {
        padding: 20px 15px;
        max-width: 100%;
        width: 100%;
        border-width: 2px;
    }

    .logo-auth h1 {
        font-size: 16px;
    }

    .logo-img {
        width: 60px;
        height: 60px;
    }

    .modal-content {
        width: 96%;
        margin: 5% auto;
        max-height: 95vh;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-header h3 {
        font-size: 15px;
    }

    .modal-body {
        padding: 16px;
    }

    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }

    .action-dropdown {
        min-width: 140px;
        right: -5px;
    }

    .action-dropdown a {
        padding: 10px 14px;
        font-size: 12px;
    }
}

/* ===== RESPONSIVE - MEDIUM SCREENS (LARGE PHONE / SMALL TABLET) ===== */
@media (min-width: 481px) and (max-width: 767px) {
    .container {
        padding: 15px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero p {
        font-size: 13px;
    }

    .card {
        padding: 20px;
    }

    .card h2 {
        font-size: 20px;
    }

    .card-header-title {
        font-size: 20px;
        padding: 14px 18px;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card .stat-number {
        font-size: 28px;
    }

    .kandidat-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .voting-card .foto-kandidat {
        width: 110px;
        height: 110px;
    }

    .voting-card .kandidat-card-inner {
        padding: 16px 14px;
    }

    .voting-card .kandidat-info h3 {
        font-size: 18px;
    }

    .voting-card .visi-misi {
        max-height: 140px;
    }

    .chart-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .chart-container {
        height: 240px;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .logo-auth h1 {
        font-size: 17px;
    }

    .logo-img {
        width: 65px;
        height: 65px;
    }
}

/* ===== RESPONSIVE - LANDSCAPE MOBILE ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .chart-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .chart-container {
        height: 200px;
    }

    .modal-content {
        margin: 5% auto;
        max-height: 90vh;
    }
}

/* ===== RESPONSIVE ENHANCEMENTS - MOBILE (max-width: 767px) ===== */
@media (max-width: 767.98px) {
    /* Navbar adjustments */
    .navbar {
        padding: 8px 0;
    }

    .navbar-brand {
        font-size: 15px;
    }

    .navbar-brand .text-white-50 {
        font-size: 13px;
    }

    .navbar .nav-link {
        padding: 10px 14px;
        font-size: 14px;
        text-align: left;
        border-radius: 6px;
        margin: 2px 0;
    }

    .navbar .nav-link.text-warning {
        text-align: center;
        margin-top: 8px;
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    .navbar .dropdown-menu {
        margin-top: 4px;
        margin-bottom: 8px;
        border-radius: 10px;
    }

    .navbar .dropdown-item {
        padding: 12px 16px;
        font-size: 14px;
    }

    .navbar-collapse {
        background: #7a0f1d;
        margin-top: 10px;
        padding: 12px;
        border-radius: 12px;
        box-shadow: 0 12px 28px rgba(122, 15, 29, 0.25);
        max-height: 75vh;
        overflow-y: auto;
    }

    /* Hero section */
    .hero {
        padding: 18px 12px;
        margin-bottom: 16px;
    }

    .hero h1 {
        font-size: 22px;
        line-height: 1.3;
    }

    .hero p {
        font-size: 13px;
    }

    /* Cards */
    .card {
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 14px;
    }

    .card h2 {
        font-size: 19px;
        margin-bottom: 14px;
    }

    .card-header-title {
        font-size: 18px;
        padding: 14px 16px;
    }

    .card-header-flex {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    /* Table toolbar */
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 14px;
        gap: 10px;
    }

    .table-toolbar-title {
        font-size: 14px;
        justify-content: center;
        text-align: center;
    }

    .table-toolbar-form {
        margin-left: 0;
        justify-content: center;
        flex-wrap: wrap;
    }

    .table-filter-select {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
        height: 40px;
        font-size: 14px;
    }

    .table-toolbar .btn {
        width: 100%;
        height: 40px;
    }

    /* Forms */
    .form-group {
        margin-bottom: 14px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 11px 14px;
        font-size: 14px;
    }

    .form-group label {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Buttons */
    .btn {
        padding: 11px 20px;
        font-size: 14px;
        border-radius: 10px;
    }

    .btn-sm {
        padding: 8px 14px;
        font-size: 12px;
    }

    .btn-lg {
        padding: 11px 24px;
        font-size: 15px;
    }

    .btn-block {
        width: 100%;
    }

    /* Tables */
    .table-container {
        font-size: 12px;
        -webkit-overflow-scrolling: touch;
        border-radius: 0 0 12px 12px;
    }

    table {
        min-width: 520px;
    }

    table th,
    table td {
        padding: 10px 12px;
        font-size: 12px;
    }

    table th {
        font-size: 11px;
    }

    tbody td {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    /* Action menu */
    .action-btn {
        width: 34px;
        min-width: 34px;
        height: 34px;
        font-size: 16px;
        border-radius: 8px;
    }

    .action-dropdown {
        min-width: 160px;
        right: 0;
    }
}

/* ================================================================
   RESPONSIVENESS REFINEMENTS — HP, Tablet, Laptop
   Cross-device layout & usability polish (cascade-safe).
   Media queries mirror the existing breakpoints so the cascade
   stays predictable and prior behaviour is preserved at each tier.
================================================================ */

/* --- Center & constrain the voting confirmation card ---
   Previously #success-card stretched full container width (~1200px)
   on desktop, making the "Terima Kasih!" message awkward to read. */
#success-card {
    max-width: 520px;
    margin: 0 auto;
    padding: 32px 24px !important;
}

/* Fluid typography for the centered confirmation card.
   No media query overrides this selector, so clamp() is safe. */
#success-card h2 { font-size: clamp(24px, 5vw, 32px); }
#success-card i { font-size: clamp(36px, 8vw, 48px); }

/* Generic containment safety: never let images/form controls overflow
   their container on any device */
img { max-width: 100%; height: auto; }

.form-control,
.form-group input,
.form-group select,
.form-group textarea,
.form-group img { max-width: 100%; }

/* ===== TOUCH-FRIENDLY ACTION BUTTONS (HP/Tablet) =====
   Apple HIG & Material recommend >= 44px for finger targets. */
@media (max-width: 767.98px) {
    .action-btn {
        width: 44px;
        min-width: 44px;
        height: 44px;
        font-size: 18px;
        border-radius: 10px;
    }

    .action-menu { min-height: 44px; }

    /* Stack toolbar buttons full-width on mobile */
    .table-toolbar .btn,
    .table-toolbar .btn-sm { width: 100%; }
}

/* ===== SMALL MOBILE (< 480px) =====
   Keep the landing countdown tiles in a single row on very narrow
   screens and shrink large elements to fit the viewport. */
@media (max-width: 479px) {
    .container { padding: 10px; }

    /* Countdown: 4 tiles must fit one row even on ~320px screens */
    .countdown-item {
        min-width: 62px;
        padding: 10px 8px;
    }

    .countdown-number { font-size: 22px; }

    .countdown-label { font-size: 10px; }

    /* Voting card photo + inner padding for tiny screens */
    .voting-card .foto-kandidat { width: 100px; height: 100px; }

    .voting-card .kandidat-card-inner { padding: 16px 14px; }

    /* Tighten progress bar text */
    .progress-bar { font-size: 10px; padding-right: 8px; }

    /* Shorter charts on portrait phones */
    .chart-container { height: 200px; }

    /* Tighten the confirmation card on micro screens */
    #success-card { padding: 24px 16px !important; }
}

/* ===== LARGE PHONE / SMALL TABLET (480-767) ===== */
@media (min-width: 480px) and (max-width: 767.98px) {
    .countdown-item { min-width: 70px; }

    .voting-card .visi-misi { max-height: 140px; }

    .chart-container { height: 230px; }

    .hasil-item .hasil-item-inner { gap: 12px; }

    .hasil-item .hasil-foto {
        width: 64px;
        height: 64px;
    }

    .hasil-item .hasil-foto img {
        width: 64px;
        height: 64px;
    }

    .hasil-item .foto-placeholder {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }
}

/* ===== TABLET (768-991) =====
   Two-column candidate grid is used; give cards a little more room
   for the visi/misi scroll area and keep the confirmation card
   proportional. */
@media (min-width: 768px) and (max-width: 991.98px) {
    .voting-card .visi-misi { max-height: 140px; }
    #success-card { max-width: 560px; }

    .chart-container { height: 260px; }
}

/* ===== HP & TABLET: thead + table compactness =====
   "thead melebar" root cause: .table-container had "overflow: visible"
   overriding "overflow-x: auto", so the whole table (thead included)
   spilled past its card. Fixed at the source -> tables scroll instead
   of spilling. These rules keep the sticky thead from bleeding and let
   cells wrap so headers/tables read cleanly on phones & tablets. */
@media (max-width: 1023.98px) {
    .table-container {
        overflow-x: auto;
        overflow-y: visible;
    }

    table {
        width: 100%;
        max-width: 100%;
    }

    table th,
    table td {
        padding: 9px 10px;
        white-space: normal;
        overflow-wrap: break-word;
    }

    table th {
        position: static;
        font-size: 11px;
        background-clip: padding-box;
        z-index: 2;
    }

    table td:last-child { min-width: 70px; }
}
