* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: #f2f4f5;
    color: #222222;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    box-sizing: border-box;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================================
   COMMON COLORS
   ========================================================= */

:root {
    --primary: #4f8f9a;
    --primary-dark: #3f7d87;
    --primary-light: #8bb8bf;
    --background: #f2f4f5;
    --white: #ffffff;
    --text: #222222;
    --muted: #6b7280;
    --border: #d7dde0;
    --success: #2e8b57;
    --danger: #c94b4b;
    --warning: #b7791f;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

/* =========================================================
   GENERAL CONTAINERS
   ========================================================= */

.container {
    width: min(94%, 1000px);
    margin: 0 auto;
    padding: 30px 0 50px;
}

.admin-container {
    width: min(94%, 1200px);
    margin: 0 auto;
    padding: 30px 0 50px;
}

.admin-dashboard {
    width: min(94%, 1200px);
    margin: 0 auto;
    padding: 30px 0 50px;
}

/* =========================================================
   MAIN SITE HEADER
   ========================================================= */

.site-header {
    background: var(--primary);
    color: var(--white);
    text-align: center;
    padding: 25px 20px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.association-logo {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 10px;
}

.site-header h1 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
}

.system-title {
    margin-top: 4px;
    font-size: 15px;
    opacity: 0.95;
}

/* =========================================================
   ADMIN HEADER
   ========================================================= */

.admin-header {
    width: 100%;
    min-height: 82px;
    padding: 14px 24px;
    background: var(--primary);
    color: var(--white);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.admin-header-left .association-logo,
.admin-logo {
    width: 58px;
    height: 58px;
    min-width: 58px;
    object-fit: cover;
    border-radius: 50%;
}

.admin-header h1 {
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
}

.admin-header p {
    font-size: 13px;
    opacity: 0.95;
    margin-top: 2px;
}

/* =========================================================
   FOOTER
   ========================================================= */

footer {
    text-align: center;
    padding: 25px 15px;
    color: var(--muted);
    font-size: 13px;
}

footer p {
    margin: 0;
}

/* =========================================================
   COMMON CARDS
   ========================================================= */

.welcome-card,
.admin-welcome-card,
.admin-card,
.dashboard-section {
    background: var(--white);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.welcome-card {
    padding: 24px;
    margin-bottom: 22px;
}

.admin-welcome-card {
    padding: 24px;
}

.admin-card {
    padding: 24px;
    margin-bottom: 24px;
}

.dashboard-section {
    padding: 24px;
    margin-bottom: 24px;
}

.welcome-card h2,
.admin-welcome-card h2,
.admin-card h2,
.dashboard-section h2 {
    color: var(--text);
    margin-bottom: 8px;
}

.welcome-card h3,
.admin-welcome-card h3 {
    margin-bottom: 8px;
}

.welcome-card p,
.admin-welcome-card p,
.admin-card p,
.dashboard-section p {
    color: var(--muted);
}

/* =========================================================
   LABELS
   ========================================================= */

label {
    display: block;
    margin-bottom: 8px;
    color: #333333;
    font-size: 15px;
    font-weight: 700;
}

.small-label {
    color: var(--primary) !important;
    font-size: 12px !important;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* =========================================================
   FORM GROUPS
   ========================================================= */

.form-group {
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

/* =========================================================
   MAIN TEXT INPUTS
   ========================================================= */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    min-height: 54px;

    padding: 14px 16px;

    border: 2px solid var(--border);
    border-radius: 16px;

    background: #ffffff;
    color: #222222;

    font-size: 16px;
    line-height: 1.4;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

/* Placeholder */

input::placeholder,
textarea::placeholder {
    color: #9aa1a6;
    opacity: 1;
}

/* Focus */

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);

    box-shadow: 0 0 0 3px rgba(79, 143, 154, 0.14);
}

/* Disabled */

input:disabled,
select:disabled,
textarea:disabled {
    background: #eef1f2;
    color: #8a9296;
    cursor: not-allowed;
}

/* =========================================================
   TEXTAREA
   ========================================================= */

textarea {
    min-height: 120px;
    resize: vertical;
    overflow: auto;
}

/* =========================================================
   FILE INPUT
   ========================================================= */

input[type="file"] {
    width: 100%;
    min-height: 54px;

    padding: 10px 12px;

    border: 2px solid var(--border);
    border-radius: 16px;

    background: #ffffff;
    color: #333333;

    font-size: 15px;

    cursor: pointer;
    box-sizing: border-box;
}

input[type="file"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 143, 154, 0.14);
}

/* =========================================================
   FILE INPUT BUTTON
   ========================================================= */

input[type="file"]::file-selector-button {
    margin-right: 12px;

    padding: 10px 14px;

    border: none;
    border-radius: 10px;

    background: var(--primary);
    color: #ffffff;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
    background: var(--primary-dark);
}

/* =========================================================
   CHECKBOXES & RADIO BUTTONS
   ========================================================= */

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--primary);
}

/* =========================================================
   PRIMARY BUTTON
   ========================================================= */

.primary-btn,
.login-button,
.vote-button,
#add-voter-btn,
#import-voters-btn,
#save-candidate-btn,
#addCandidateBtn,
#lookupStudentBtn,
#confirm-import-btn,
#preview-import-btn {
    min-height: 50px;

    padding: 12px 20px;

    border: none;
    border-radius: 14px;

    background: var(--primary);
    color: #ffffff;

    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.2px;

    transition:
        background-color 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;
}

.primary-btn:hover,
.login-button:hover,
.vote-button:hover,
#add-voter-btn:hover,
#import-voters-btn:hover,
#save-candidate-btn:hover,
#addCandidateBtn:hover,
#lookupStudentBtn:hover,
#confirm-import-btn:hover,
#preview-import-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 5px 14px rgba(79, 143, 154, 0.22);
}

.primary-btn:active,
.login-button:active,
.vote-button:active,
#add-voter-btn:active,
#import-voters-btn:active,
#save-candidate-btn:active,
#addCandidateBtn:active,
#lookupStudentBtn:active,
#confirm-import-btn:active,
#preview-import-btn:active {
    transform: translateY(1px);
}

/* =========================================================
   DISABLED BUTTONS
   ========================================================= */

button:disabled,
.primary-btn:disabled,
.login-button:disabled,
.vote-button:disabled {
    background: var(--primary-light);
    color: #ffffff;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* =========================================================
   SECONDARY BUTTON
   ========================================================= */

.secondary-btn,
.logout-button,
#back-btn {
    min-height: 46px;

    padding: 10px 18px;

    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;

    background: transparent;
    color: #ffffff;

    font-size: 13px;
    font-weight: 800;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.secondary-btn:hover,
.logout-button:hover,
#back-btn:hover {
    background: #ffffff;
    color: var(--primary);
}

/* =========================================================
   ADMIN BUTTON AREA
   ========================================================= */

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.action-buttons button {
    min-width: 150px;
}

/* =========================================================
   LOGIN PAGE
   ========================================================= */

.login-container {
    width: min(92%, 460px);
    margin: 50px auto;
}

.login-card {
    background: #ffffff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 8px;
}

.login-card p {
    text-align: center;
    color: var(--muted);
    margin-bottom: 25px;
}

.login-button {
    width: 100%;
    margin-top: 8px;
}

/* =========================================================
   ADMIN WELCOME
   ========================================================= */

.admin-welcome-card .role-badge {
    display: inline-flex;
    align-items: center;

    min-height: 30px;
    padding: 5px 10px;

    border-radius: 999px;

    background: rgba(79, 143, 154, 0.12);
    color: var(--primary);

    font-size: 12px;
    font-weight: 800;
}

/* =========================================================
   SECTION HEADER
   ========================================================= */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.section-header h2 {
    margin-bottom: 4px;
}

.section-header p {
    margin: 0;
}

/* =========================================================
   MESSAGES
   ========================================================= */

.message {
    margin-top: 15px;
    padding: 12px 14px;

    border-radius: 12px;

    font-size: 14px;
}

#candidate-message,
#voter-message,
#import-message,
#vote-message {
    margin-top: 14px;
}

.message.success {
    background: #e9f7ef;
    color: var(--success);
}

.message.error {
    background: #fcecec;
    color: var(--danger);
}

.message.warning {
    background: #fff7e6;
    color: var(--warning);
}

/* =========================================================
   ELECTION INFO
   ========================================================= */

.election-info {
    margin-top: 18px;
    padding: 16px;

    border-radius: 14px;
    background: #f5f8f9;

    border: 1px solid #e1e7e9;
}

/* =========================================================
   ADMIN ACCESS
   ========================================================= */

.admin-access {
    margin-top: 25px;
    text-align: center;
}

.admin-access button {
    min-height: 46px;
}

/* =========================================================
   RESPONSIVE BASE
   ========================================================= */

@media (max-width: 700px) {

    .container,
    .admin-container,
    .admin-dashboard {
        width: 92%;
        padding-top: 22px;
    }

    .welcome-card,
    .admin-welcome-card,
    .admin-card,
    .dashboard-section {
        padding: 20px;
        border-radius: 16px;
    }

    .admin-header {
        padding: 12px 16px;
    }

    .admin-header-left {
        gap: 10px;
    }

    .admin-header-left .association-logo,
    .admin-logo {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }

    .admin-header h1 {
        font-size: 18px;
    }

    .admin-header p {
        font-size: 12px;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .action-buttons {
        width: 100%;
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        width: 100%;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="date"],
    input[type="datetime-local"],
    select,
    textarea,
    input[type="file"] {
        min-height: 52px;
        font-size: 16px;
    }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 18px;
    box-shadow: var(--shadow);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.09);
}

.dashboard-card h3 {
    margin-bottom: 8px;
}

.dashboard-card p {
    color: var(--muted);
}


/* =========================================================
   ADMIN DASHBOARD CARDS
   ========================================================= */

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.admin-dashboard-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 18px;
    box-shadow: var(--shadow);

    border: 1px solid #edf0f1;
}

.admin-dashboard-card h3 {
    color: var(--text);
    margin-bottom: 6px;
}

.admin-dashboard-card p {
    color: var(--muted);
    margin-bottom: 18px;
}

.admin-dashboard-card button {
    width: 100%;
}


/* =========================================================
   CANDIDATE MANAGEMENT
   ========================================================= */

#candidate-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

#candidate-form label {
    margin-top: 4px;
}

#candidate-form input,
#candidate-form select {
    margin-bottom: 18px;
}


/* Candidate lookup area */

.candidate-lookup {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.candidate-lookup input {
    flex: 1;
}

.candidate-lookup button {
    min-width: 190px;
}


/* Student lookup result */

#student-result {
    margin-top: 16px;
    padding: 16px;

    border: 1px solid #e1e7e9;
    border-radius: 16px;

    background: #f7f9fa;
}

.student-result-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.student-result-card img {
    width: 58px;
    height: 58px;

    border-radius: 50%;
    object-fit: cover;

    border: 2px solid var(--primary-light);
}

.student-result-card h4 {
    margin-bottom: 2px;
}

.student-result-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}


/* Candidate list */

#candidate-list {
    display: grid;
    gap: 16px;
}

.candidate-card {
    display: flex;
    align-items: center;
    gap: 16px;

    padding: 18px;

    background: #ffffff;
    border: 1px solid #e1e7e9;
    border-radius: 16px;
}

.candidate-card img,
.candidate-image,
.candidate-profile-image {
    width: 72px;
    height: 72px;

    flex: 0 0 72px;

    border-radius: 50%;
    object-fit: cover;

    border: 2px solid #e1e7e9;
}

.candidate-card-content {
    flex: 1;
    min-width: 0;
}

.candidate-card-content h3,
.candidate-card-content h4 {
    margin-bottom: 3px;
}

.candidate-card-content p {
    margin: 2px 0;
    color: var(--muted);
    font-size: 14px;
}

.candidate-position {
    display: inline-flex;

    padding: 4px 9px;

    border-radius: 999px;

    background: rgba(79, 143, 154, 0.12);
    color: var(--primary);

    font-size: 12px;
    font-weight: 800;
}


/* Candidate image preview */

#image-preview,
.image-preview {
    margin-top: 14px;
}

#image-preview img,
.image-preview img {
    width: 100px;
    height: 100px;

    border-radius: 50%;
    object-fit: cover;

    border: 3px solid #e1e7e9;
}


/* Draft warning */

#draft-warning,
.draft-warning {
    margin-bottom: 20px;
    padding: 14px 16px;

    border-radius: 14px;

    background: #fff7e6;
    border: 1px solid #f1d59c;

    color: #8a6116;
}

#draft-warning strong,
.draft-warning strong {
    color: #76500d;
}


/* =========================================================
   VOTER MANAGEMENT
   ========================================================= */

.voter-list {
    display: grid;
    gap: 12px;
}

.voter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    padding: 16px 18px;

    background: #ffffff;

    border: 1px solid #e1e7e9;
    border-radius: 14px;
}

.voter-item-left {
    min-width: 0;
}

.voter-item strong {
    color: var(--text);
}

.voter-item small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}


/* Voter status */

.voter-status {
    display: inline-flex;
    align-items: center;

    padding: 5px 10px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 800;

    white-space: nowrap;
}

.voter-status.eligible {
    background: #e9f7ef;
    color: var(--success);
}

.voter-status.voted {
    background: rgba(79, 143, 154, 0.12);
    color: var(--primary);
}


/* =========================================================
   IMPORT PREVIEW
   ========================================================= */

.import-instructions {
    margin: 18px 0;
    padding: 16px;

    border-radius: 14px;

    background: #f6f8f9;
    border: 1px solid #e1e7e9;
}

.import-instructions p {
    margin: 5px 0;
}

.import-instructions pre {
    margin-top: 12px;

    padding: 14px;

    border-radius: 10px;

    background: #eef2f3;

    overflow-x: auto;

    font-size: 13px;
    line-height: 1.6;
}

.import-summary {
    margin: 15px 0;

    padding: 14px;

    border-radius: 12px;

    background: #f5f8f9;
}


/* =========================================================
   TABLES
   ========================================================= */

.preview-table-wrapper {
    width: 100%;
    overflow-x: auto;

    margin-top: 15px;

    border-radius: 14px;
    border: 1px solid #e1e7e9;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;

    background: #ffffff;

    min-width: 600px;
}

.admin-table th {
    padding: 14px 16px;

    background: #f3f6f7;

    color: #333333;

    text-align: left;

    font-size: 13px;
    font-weight: 800;

    border-bottom: 1px solid #e1e7e9;
}

.admin-table td {
    padding: 14px 16px;

    border-bottom: 1px solid #edf0f1;

    color: #444444;

    font-size: 14px;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background: #fafcfc;
}


/* =========================================================
   STUDENT MANAGEMENT
   ========================================================= */

.student-list {
    display: grid;
    gap: 14px;
}

.student-card {
    display: flex;
    align-items: center;
    gap: 15px;

    padding: 16px;

    background: #ffffff;

    border: 1px solid #e1e7e9;
    border-radius: 16px;
}

.student-card img {
    width: 60px;
    height: 60px;

    flex: 0 0 60px;

    border-radius: 50%;
    object-fit: cover;

    border: 2px solid #e1e7e9;
}

.student-card-content {
    flex: 1;
    min-width: 0;
}

.student-card-content h3 {
    margin-bottom: 2px;
}

.student-card-content p {
    margin: 0;

    color: var(--muted);
    font-size: 14px;
}


/* Student search */

.student-search {
    margin-bottom: 20px;
}

.student-search input {
    width: 100%;
}


/* =========================================================
   STUDENT PROFILE
   ========================================================= */

.profile-card {
    background: #ffffff;

    padding: 28px;

    border-radius: 20px;

    box-shadow: var(--shadow);

    text-align: center;
}

.profile-picture-wrapper {
    width: 130px;
    height: 130px;

    margin: 0 auto 18px;

    position: relative;
}

.profile-picture,
.profile-picture-wrapper img {
    width: 130px;
    height: 130px;

    border-radius: 50%;

    object-fit: cover;

    border: 4px solid #ffffff;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.profile-picture-change {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 44px;

    margin-top: 12px;

    padding: 10px 18px;

    border: none;
    border-radius: 12px;

    background: var(--primary);
    color: #ffffff;

    font-size: 13px;
    font-weight: 800;

    cursor: pointer;
}


/* =========================================================
   STUDENT DASHBOARD
   ========================================================= */

.student-dashboard {
    width: min(94%, 1000px);
    margin: 0 auto;

    padding: 30px 0 50px;
}

.student-welcome {
    background: #ffffff;

    padding: 25px;

    border-radius: 20px;

    box-shadow: var(--shadow);

    margin-bottom: 22px;
}

.student-welcome h2 {
    margin-bottom: 5px;
}

.student-welcome p {
    color: var(--muted);
}

.student-dashboard-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 18px;
}

.student-dashboard-option {
    display: block;

    padding: 22px;

    background: #ffffff;

    border-radius: 18px;

    border: 1px solid #e5eaec;

    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.05);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.student-dashboard-option:hover {
    transform: translateY(-2px);

    border-color: var(--primary-light);

    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.student-dashboard-option h3 {
    margin-bottom: 5px;
}

.student-dashboard-option p {
    color: var(--muted);
    font-size: 14px;
}


/* =========================================================
   ELECTION STATUS
   ========================================================= */

.status-badge {
    display: inline-flex;
    align-items: center;

    min-height: 30px;

    padding: 5px 11px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 800;
}

.status-draft {
    background: #eef1f2;
    color: #667077;
}

.status-upcoming {
    background: #fff7e6;
    color: var(--warning);
}

.status-active {
    background: #e9f7ef;
    color: var(--success);
}

.status-ended {
    background: #f1f1f1;
    color: #6b6b6b;
}

.status-error {
    background: #fcecec;
    color: var(--danger);
}


/* =========================================================
   ELECTION CARDS
   ========================================================= */

.election-card {
    background: #ffffff;

    padding: 22px;

    margin-bottom: 16px;

    border-radius: 18px;

    border: 1px solid #e3e8ea;

    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.05);
}

.election-card h3 {
    margin-bottom: 5px;
}

.election-card p {
    color: var(--muted);
}

.election-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    gap: 15px;

    margin-bottom: 12px;
}

.election-card button {
    margin-top: 15px;
}


/* =========================================================
   VOTING PAGE
   ========================================================= */

#positions-container {
    display: grid;
    gap: 20px;
}

.position-card {
    background: #ffffff;

    padding: 22px;

    border-radius: 18px;

    box-shadow: var(--shadow);

    border: 1px solid #e4e9eb;
}

.position-card h3 {
    margin-bottom: 16px;

    color: var(--text);
}


/* Candidate voting option */

.candidate-option {
    position: relative;

    display: flex;
    align-items: center;
    gap: 14px;

    width: 100%;

    padding: 14px;

    margin-bottom: 10px;

    border: 2px solid #e1e7e9;

    border-radius: 16px;

    background: #ffffff;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease;
}

.candidate-option:hover {
    border-color: var(--primary-light);
    background: #f8fafb;
}

.candidate-option.selected {
    border-color: var(--primary);
    background: rgba(79, 143, 154, 0.07);
}

.candidate-option input[type="radio"] {
    width: 20px;
    height: 20px;

    flex: 0 0 20px;
}

.candidate-option img {
    width: 58px;
    height: 58px;

    flex: 0 0 58px;

    border-radius: 50%;

    object-fit: cover;
}

.candidate-option-info {
    flex: 1;
    min-width: 0;
}

.candidate-option-info strong {
    display: block;

    color: var(--text);

    margin-bottom: 2px;
}

.candidate-option-info span {
    color: var(--muted);

    font-size: 13px;
}


/* =========================================================
   VOTE SUMMARY
   ========================================================= */

#vote-summary {
    margin-top: 22px;
}

#selected-votes {
    display: grid;
    gap: 10px;
}

.selected-vote-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 13px 15px;

    background: #f6f8f9;

    border-radius: 12px;
}

.selected-vote-item span {
    color: var(--muted);
    font-size: 14px;
}

.selected-vote-item strong {
    color: var(--text);
}


/* Cast vote button */

.vote-button {
    display: block;

    width: 100%;

    min-height: 56px;

    margin: 25px auto 0;

    border-radius: 16px;

    font-size: 15px;
}


/* =========================================================
   RESULTS
   ========================================================= */

.results-list {
    display: grid;
    gap: 16px;
}

.result-card {
    background: #ffffff;

    padding: 20px;

    border-radius: 18px;

    border: 1px solid #e2e8ea;

    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.05);
}

.result-card-header {
    display: flex;

    align-items: center;

    gap: 15px;
}

.result-card img {
    width: 68px;
    height: 68px;

    border-radius: 50%;

    object-fit: cover;
}

.result-card-info {
    flex: 1;
}

.result-card-info h3 {
    margin-bottom: 2px;
}

.result-card-info p {
    color: var(--muted);
    font-size: 14px;
}

.vote-count {
    font-size: 22px;
    font-weight: 800;

    color: var(--primary);

    white-space: nowrap;
}


/* Result percentage */

.result-percentage {
    margin-top: 14px;

    font-size: 14px;
    font-weight: 700;

    color: var(--muted);
}

.result-bar {
    width: 100%;

    height: 10px;

    margin-top: 8px;

    overflow: hidden;

    border-radius: 999px;

    background: #e9edef;
}

.result-bar-fill {
    height: 100%;

    border-radius: inherit;

    background: var(--primary);

    transition: width 0.3s ease;
}


/* =========================================================
   EMPTY STATES
   ========================================================= */

.empty-state {
    padding: 35px 20px;

    text-align: center;

    background: #f7f9fa;

    border: 1px dashed #d5dde0;

    border-radius: 16px;
}

.empty-state h3 {
    margin-bottom: 6px;
}

.empty-state p {
    color: var(--muted);
}


/* =========================================================
   LOADING
   ========================================================= */

.loading {
    padding: 25px;

    text-align: center;

    color: var(--muted);
}

.loading-spinner {
    width: 32px;
    height: 32px;

    margin: 0 auto 12px;

    border: 4px solid #e1e7e9;
    border-top-color: var(--primary);

    border-radius: 50%;

    animation: spin 0.8s linear infinite;
}

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


/* =========================================================
   ERROR / SUCCESS ALERTS
   ========================================================= */

.alert {
    padding: 14px 16px;

    margin-bottom: 18px;

    border-radius: 14px;

    font-size: 14px;
}

.alert-success {
    background: #e9f7ef;
    color: #247047;
    border: 1px solid #c8e8d5;
}

.alert-error {
    background: #fcecec;
    color: #a13c3c;
    border: 1px solid #f0caca;
}

.alert-warning {
    background: #fff7e6;
    color: #8a6116;
    border: 1px solid #f1d59c;
}

.alert-info {
    background: #eef6f8;
    color: #3e7079;
    border: 1px solid #d3e6e9;
}


/* =========================================================
   HIDDEN UTILITY
   ========================================================= */

.hidden {
    display: none !important;
}


/* =========================================================
   VISUALLY HIDDEN
   ========================================================= */

.visually-hidden {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    padding: 0 !important;
    margin: -1px !important;

    overflow: hidden !important;

    clip: rect(0, 0, 0, 0) !important;

    white-space: nowrap !important;

    border: 0 !important;
}


/* =========================================================
   MOBILE RESPONSIVENESS
   ========================================================= */

@media (max-width: 700px) {

    .dashboard-grid,
    .admin-dashboard-grid,
    .student-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .site-header {
        padding: 22px 15px;
    }

    .site-header h1 {
        font-size: 24px;
    }

    .candidate-lookup {
        flex-direction: column;
    }

    .candidate-lookup button {
        width: 100%;
        min-width: 0;
    }

    .candidate-card {
        align-items: flex-start;
    }

    .candidate-card img,
    .candidate-image,
    .candidate-profile-image {
        width: 60px;
        height: 60px;

        flex-basis: 60px;
    }

    .voter-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .election-card-header {
        flex-direction: column;
    }

    .result-card-header {
        align-items: flex-start;
    }

    .vote-count {
        font-size: 19px;
    }

    .candidate-option {
        padding: 12px;
    }

    .candidate-option img {
        width: 52px;
        height: 52px;

        flex-basis: 52px;
    }

    .profile-card {
        padding: 22px 18px;
    }

    .admin-header {
        flex-wrap: wrap;
    }

    .admin-header .secondary-btn,
    .admin-header .logout-button {
        width: 100%;
    }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 420px) {

    .container,
    .admin-container,
    .admin-dashboard,
    .student-dashboard {
        width: 94%;
    }

    .welcome-card,
    .admin-welcome-card,
    .admin-card,
    .dashboard-section {
        padding: 17px;
    }

    .site-header h1 {
        font-size: 22px;
    }

    .system-title {
        font-size: 14px;
    }

    .candidate-card {
        gap: 11px;
        padding: 14px;
    }

    .candidate-card img,
    .candidate-image,
    .candidate-profile-image {
        width: 52px;
        height: 52px;

        flex-basis: 52px;
    }

    .student-card img {
        width: 52px;
        height: 52px;

        flex-basis: 52px;
    }

    .profile-picture,
    .profile-picture-wrapper,
    .profile-picture-wrapper img {
        width: 110px;
        height: 110px;
    }
}


/* =========================================================
   PRINT
   ========================================================= */

@media print {

    .admin-header,
    .site-header,
    footer,
    button,
    .admin-access {
        display: none !important;
    }

    body {
        background: #ffffff;
    }

    .welcome-card,
    .admin-card,
    .admin-welcome-card,
    .dashboard-section,
    .result-card {
        box-shadow: none;
        border: 1px solid #dddddd;
    }
}
.page-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.page-container .card {
    background: #ffffff;
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.page-container .card h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--primary);
}

.status-box {
    margin-top: 16px;
    padding: 13px 16px;
    border-radius: 10px;
    background: #f2f4f5;
    color: #333333;
    font-weight: 700;
    text-align: center;
}

.status-box.active {
    background: #e6f4f5;
    color: #286d76;
}

.status-box.upcoming {
    background: #eef3f4;
    color: #557177;
}

.status-box.ended {
    background: #e8f1f2;
    color: #365d63;
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 20px;
}

.summary-card {
    background: #f2f4f5;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
}

.summary-card span {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #666666;
    margin-bottom: 6px;
}

.summary-card strong {
    display: block;
    font-size: 28px;
    color: var(--primary);
}

#result-image-section {
    text-align: center;
}

#result-image-message {
    color: #666666;
    line-height: 1.5;
}

#generate-result-image-btn,
#download-result-image-btn {
    margin: 12px auto;
}

#result-image-preview {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}

#result-image-preview img {
    width: 100%;
    max-width: 900px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}

#back-btn {
    background: var(--primary);
    color: #ffffff;
    border: 2px solid var(--primary);
}

#back-btn:hover {
    background: #ffffff;
    color: var(--primary);
}

@media (max-width: 600px) {
    .page-container {
        padding: 16px 12px 30px;
    }

    .page-container .card {
        padding: 16px;
        border-radius: 14px;
    }

    .results-summary {
        grid-template-columns: 1fr;
    }

    .summary-card strong {
        font-size: 24px;
    }

    #generate-result-image-btn,
    #download-result-image-btn,
    #back-btn {
        width: 100%;
    }
}
.position-results {
    margin-bottom: 28px;
}

.position-results:last-child {
    margin-bottom: 0;
}

.position-results > h3 {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 22px;
}

.position-results > p {
    margin: 0 0 14px;
    color: #666;
    font-size: 14px;
}

.position-results .result-card {
    margin-bottom: 12px;
}

.position-results .result-card:last-child {
    margin-bottom: 0;
}
/* =========================================================
   STUDENT AUTH SECONDARY BUTTONS
   ========================================================= */

#forgot-pin-btn,
#change-pin-btn,
#back-to-choice-from-login,
#back-to-choice-from-signup,
#back-to-login-from-forgot,
#back-to-login-from-change {
    display: block;
    width: 100%;
    max-width: 320px;
    min-height: 46px;
    margin: 10px auto 0;
    padding: 10px 18px;
    border: 2px solid var(--primary);
    border-radius: 12px;
    background: #ffffff;
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

#forgot-pin-btn:hover,
#change-pin-btn:hover,
#back-to-choice-from-login:hover,
#back-to-choice-from-signup:hover,
#back-to-login-from-forgot:hover,
#back-to-login-from-change:hover {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(79, 143, 154, 0.22);
}

#forgot-pin-btn:active,
#change-pin-btn:active,
#back-to-choice-from-login:active,
#back-to-choice-from-signup:active,
#back-to-login-from-forgot:active,
#back-to-login-from-change:active {
    transform: translateY(1px);
}