/* ============================================================
   Cooperative Bank of Cotabato - Voting System Stylesheet
   Theme: Green (Primary) + Yellow (Secondary)
   ============================================================ */

:root {
    --green-dark:    #1a5c2a;
    --green:         #2e7d32;
    --green-mid:     #388e3c;
    --green-light:   #4caf50;
    --green-pale:    #e8f5e9;
    --green-tint:    #f1f8f2;

    --yellow:        #f9c22e;
    --yellow-dark:   #f0a500;
    --yellow-light:  #fff8e1;
    --yellow-pale:   #fffde7;

    --white:         #ffffff;
    --gray-50:       #fafafa;
    --gray-100:      #f5f5f5;
    --gray-200:      #eeeeee;
    --gray-300:      #e0e0e0;
    --gray-400:      #bdbdbd;
    --gray-500:      #9e9e9e;
    --gray-600:      #757575;
    --gray-700:      #616161;
    --gray-800:      #424242;
    --gray-900:      #212121;

    --red:           #d32f2f;
    --red-light:     #ffebee;
    --blue:          #1565c0;
    --blue-light:    #e3f2fd;

    --shadow-sm:     0 1px 4px rgba(0,0,0,0.08);
    --shadow-md:     0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg:     0 8px 32px rgba(0,0,0,0.14);
    --shadow-xl:     0 16px 48px rgba(0,0,0,0.18);

    --radius:        12px;
    --radius-sm:     8px;
    --radius-lg:     20px;
    --radius-pill:   50px;

    --sidebar-w:     260px;
    --header-h:      64px;
    --transition:    0.25s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
ul { list-style: none; }

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

.login-body {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 50%, var(--green-mid) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 960px;
    width: 100%;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    min-height: 580px;
}

.login-left {
    background: linear-gradient(160deg, var(--green-dark) 0%, var(--green-mid) 100%);
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-brand { position: relative; z-index: 1; }

.brand-logo {
    width: 72px; height: 72px;
    background: var(--yellow);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    color: var(--green-dark);
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(249,194,46,0.4);
}

.login-brand h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    color: var(--white);
    line-height: 1.25;
    margin-bottom: 8px;
}

.login-brand p {
    color: rgba(255,255,255,0.75);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.login-illustration {
    position: relative;
    z-index: 1;
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.floating-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: floatUp 0.6s ease both;
}

.floating-card i { color: var(--yellow); }
.fc1 { animation-delay: 0.1s; }
.fc2 { animation-delay: 0.25s; }
.fc3 { animation-delay: 0.4s; }

@keyframes floatUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-right {
    padding: 48px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
}

.login-box { width: 100%; max-width: 380px; }

.login-header { margin-bottom: 28px; }
.login-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--green-dark);
    margin-bottom: 6px;
}
.login-header p { color: var(--gray-600); font-size: 0.9rem; }

.login-form { display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 6px;
}
.form-group label i { color: var(--green); }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--gray-900);
    transition: var(--transition);
    background: var(--white);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(46,125,50,0.12);
}

.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.toggle-pw {
    position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--gray-500); padding: 4px;
    transition: var(--transition);
}
.toggle-pw:hover { color: var(--green); }

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-mid) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(46,125,50,0.3);
}
.btn-login:hover {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
    box-shadow: 0 6px 20px rgba(46,125,50,0.4);
    transform: translateY(-1px);
}

.login-footer {
    margin-top: 20px;
    padding: 12px;
    background: var(--green-pale);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 6px;
}
.login-footer p i { color: var(--green); }

.demo-credentials {
    margin-top: 12px;
    padding: 12px;
    background: var(--yellow-pale);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--gray-700);
    border-left: 3px solid var(--yellow);
}
.demo-credentials p { margin-bottom: 2px; }

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

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-weight: 500;
}
.alert-danger  { background: var(--red-light);  color: var(--red);  border-left: 4px solid var(--red);  }
.alert-success { background: var(--green-pale);  color: var(--green-dark); border-left: 4px solid var(--green); }
.alert-warning { background: var(--yellow-light); color: #b45309; border-left: 4px solid var(--yellow); }
.alert-info    { background: var(--blue-light);  color: var(--blue); border-left: 4px solid var(--blue); }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--green-dark) 0%, #1b4d20 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    box-shadow: 4px 0 16px rgba(0,0,0,0.15);
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 44px; height: 44px;
    background: var(--yellow);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    color: var(--green-dark);
    flex-shrink: 0;
}

.sidebar-logo-text h3 {
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    color: var(--white);
    line-height: 1.25;
}
.sidebar-logo-text span {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
}

.sidebar-nav { flex: 1; padding: 16px 12px; }

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    padding: 12px 8px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
}
.nav-item:hover {
    background: rgba(255,255,255,0.12);
    color: var(--white);
}
.nav-item.active {
    background: var(--yellow);
    color: var(--green-dark);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(249,194,46,0.35);
}
.nav-item i { width: 20px; text-align: center; font-size: 1rem; }

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}
.sidebar-user-avatar {
    width: 36px; height: 36px;
    background: var(--yellow);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    color: var(--green-dark);
    font-weight: 700;
    flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-info strong {
    display: block;
    font-size: 0.82rem;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-info span {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.55);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(211,47,47,0.2);
    border: 1px solid rgba(211,47,47,0.3);
    border-radius: var(--radius-sm);
    color: #ff8a80;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
    font-family: 'DM Sans', sans-serif;
}
.btn-logout:hover {
    background: rgba(211,47,47,0.35);
    color: #ffcdd2;
}

/* MAIN CONTENT */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.top-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--green-dark);
}

.top-header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.status-badge.pending  { background: var(--gray-200); color: var(--gray-700); }
.status-badge.ongoing  { background: #e8f5e9; color: var(--green-dark); }
.status-badge.ended    { background: var(--red-light); color: var(--red); }
.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
}
.status-badge.ongoing .status-dot  { background: var(--green); animation: pulse 1.5s infinite; }
.status-badge.pending .status-dot  { background: var(--gray-500); }
.status-badge.ended .status-dot    { background: var(--red); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.page-content { padding: 28px; flex: 1; }

/* ============================================================
   STAT CARDS
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.stat-card.green::before  { background: var(--green); }
.stat-card.yellow::before { background: var(--yellow); }
.stat-card.blue::before   { background: var(--blue); }
.stat-card.red::before    { background: var(--red); }

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.stat-icon.green  { background: var(--green-pale);  color: var(--green); }
.stat-icon.yellow { background: var(--yellow-light); color: var(--yellow-dark); }
.stat-icon.blue   { background: var(--blue-light);   color: var(--blue); }
.stat-icon.red    { background: var(--red-light);    color: var(--red); }

.stat-info {}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-label {
    font-size: 0.82rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* ============================================================
   CARDS & PANELS
   ============================================================ */

.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gray-50);
}
.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--green-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header h3 i { color: var(--green); }

.card-body { padding: 24px; }

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }

.btn-secondary {
    background: var(--yellow);
    color: var(--green-dark);
    border-color: var(--yellow);
}
.btn-secondary:hover { background: var(--yellow-dark); border-color: var(--yellow-dark); }

.btn-danger {
    background: var(--red-light);
    color: var(--red);
    border-color: var(--red);
}
.btn-danger:hover { background: var(--red); color: var(--white); }

.btn-outline {
    background: transparent;
    color: var(--green);
    border-color: var(--green);
}
.btn-outline:hover { background: var(--green-pale); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

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

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead th {
    background: var(--green-pale);
    color: var(--green-dark);
    font-weight: 700;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid var(--green-light);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition);
}
tbody tr:hover { background: var(--gray-50); }
tbody td { padding: 12px 16px; vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-success { background: var(--green-pale); color: var(--green-dark); }
.badge-warning { background: var(--yellow-light); color: #92400e; }
.badge-danger  { background: var(--red-light); color: var(--red); }
.badge-info    { background: var(--blue-light); color: var(--blue); }
.badge-gray    { background: var(--gray-200); color: var(--gray-700); }

/* ============================================================
   MODALS
   ============================================================ */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--green-dark);
}
.modal-close {
    width: 32px; height: 32px;
    background: var(--gray-100);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--gray-600);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.modal-close:hover { background: var(--red-light); color: var(--red); }

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    color: var(--gray-900);
    transition: var(--transition);
    background: var(--white);
    outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group select { cursor: pointer; }

/* ============================================================
   CANDIDATE CARDS (Ballot)
   ============================================================ */

.ballot-page {
    background: var(--gray-50);
    min-height: 100vh;
}

.ballot-header {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
    color: var(--white);
    padding: 0;
}

.ballot-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ballot-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ballot-brand-icon {
    width: 50px; height: 50px;
    background: var(--yellow);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    color: var(--green-dark);
}

.ballot-brand h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--white);
    line-height: 1.2;
}
.ballot-brand span { font-size: 0.8rem; color: rgba(255,255,255,0.7); }

.ballot-user-info {
    text-align: right;
}
.ballot-user-info strong { display: block; color: var(--white); font-size: 0.9rem; }
.ballot-user-info span { font-size: 0.8rem; color: rgba(255,255,255,0.7); }

.ballot-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 28px;
}

.ballot-intro {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 28px;
    border-left: 5px solid var(--green);
    box-shadow: var(--shadow-sm);
}
.ballot-intro h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--green-dark);
    margin-bottom: 4px;
}
.ballot-intro p { color: var(--gray-600); font-size: 0.875rem; }

.position-section {
    margin-bottom: 36px;
}

.position-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.position-title h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--green-dark);
}

.position-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--green-light), transparent);
}

.position-limit {
    font-size: 0.78rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
}

.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.candidate-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 2px solid var(--gray-200);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.candidate-card:hover {
    border-color: var(--green-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.candidate-card.selected {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(46,125,50,0.15), var(--shadow-md);
}
.candidate-card.selected::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 10px; right: 10px;
    width: 28px; height: 28px;
    background: var(--green);
    color: var(--white);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    z-index: 1;
}

.candidate-card input[type="radio"],
.candidate-card input[type="checkbox"] {
    display: none;
}

.candidate-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--green-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--green-light);
}

.candidate-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.candidate-info {
    padding: 14px;
}

.candidate-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gray-900);
    margin-bottom: 4px;
    line-height: 1.3;
}

.candidate-branch-tag {
    display: inline-block;
    font-size: 0.7rem;
    background: var(--green-pale);
    color: var(--green-dark);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    margin-bottom: 8px;
}

.candidate-platform {
    font-size: 0.78rem;
    color: var(--gray-600);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* BALLOT ACTIONS */
.ballot-actions {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 16px 28px;
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
    z-index: 50;
}

.ballot-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-text { font-size: 0.875rem; color: var(--gray-600); }
.progress-bar-wrap {
    width: 160px;
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-pill);
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--green), var(--green-light));
    border-radius: var(--radius-pill);
    transition: width 0.4s ease;
}

/* ============================================================
   REVIEW BALLOT
   ============================================================ */

.review-section { margin-bottom: 20px; }
.review-position-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--green);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--green-pale);
}

.review-candidate {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: var(--green-pale);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--green);
    margin-bottom: 8px;
}
.review-candidate img,
.review-candidate .review-thumb-placeholder {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--green-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
    flex-shrink: 0;
}

/* ============================================================
   ELECTION CONTROL
   ============================================================ */

.election-control-card {
    max-width: 640px;
}

.election-status-display {
    text-align: center;
    padding: 48px 24px;
}

.election-icon-big {
    font-size: 5rem;
    margin-bottom: 20px;
    line-height: 1;
}

.election-status-display h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--green-dark);
    margin-bottom: 8px;
}
.election-status-display p { color: var(--gray-600); max-width: 400px; margin: 0 auto 28px; }

.btn-start { background: var(--green); color: var(--white); border-color: var(--green); }
.btn-start:hover { background: var(--green-dark); }
.btn-end { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-end:hover { background: #b71c1c; }

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

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.winner-card {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
    border-radius: var(--radius);
    padding: 20px;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 16px;
}
.winner-crown { font-size: 2rem; }
.winner-info strong { display: block; font-size: 1rem; }
.winner-info span { font-size: 0.8rem; opacity: 0.8; }
.winner-votes {
    margin-left: auto;
    text-align: center;
}
.winner-votes strong { display: block; font-size: 1.5rem; }
.winner-votes span { font-size: 0.75rem; opacity: 0.75; }

.chart-container { position: relative; width: 100%; }

/* ============================================================
   CANDIDATE MANAGEMENT CARD (admin)
   ============================================================ */

.candidate-admin-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    transition: var(--transition);
}
.candidate-admin-card:hover { box-shadow: var(--shadow-sm); border-color: var(--green-light); }

.candidate-thumb {
    width: 52px; height: 52px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--green-pale);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    color: var(--green-light);
    flex-shrink: 0;
    overflow: hidden;
}
.candidate-thumb img { width: 100%; height: 100%; object-fit: cover; }

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

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-500); }
.text-green  { color: var(--green); }
.text-yellow { color: var(--yellow-dark); }
.text-red    { color: var(--red); }
.fw-bold     { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: 0.875rem;
}
.search-bar i { color: var(--gray-400); }
.search-bar input {
    border: none;
    outline: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    background: none;
    min-width: 200px;
    color: var(--gray-900);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}
.empty-state i { font-size: 3rem; margin-bottom: 12px; color: var(--gray-300); }
.empty-state p { font-size: 0.9rem; }

.voted-overlay {
    background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.voted-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-xl);
}
.voted-box .check-icon {
    font-size: 4rem;
    color: var(--green);
    margin-bottom: 16px;
}
.voted-box h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--green-dark);
    margin-bottom: 8px;
}
.voted-box p { color: var(--gray-600); margin-bottom: 24px; }

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

@media (max-width: 900px) {
    .login-wrapper { grid-template-columns: 1fr; max-width: 440px; }
    .login-left { display: none; }
    .results-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .candidates-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .ballot-actions { flex-direction: column; gap: 12px; }
    .page-content { padding: 16px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* No election banner */
.election-warning {
    background: linear-gradient(135deg, #b45309, #d97706);
    color: var(--white);
    padding: 16px 20px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Confirmation page */
.confirm-table td { padding: 8px 12px; }
.confirm-table tr:nth-child(even) td { background: var(--gray-50); }
