/* ============================================================
   Wall of Fame — WOF — Dangote Cement Senegal
   Charte graphique officielle
   ============================================================ */

:root {
    --brand:        #CC2929;
    --brand-light:  #FCEBEB;
    --brand-dark:   #8B1A1A;
    --brand-navy:   #1B2A6B;
    --success:      #3B6D11;
    --success-bg:   #EAF3DE;
    --warning:      #854F0B;
    --warning-bg:   #FAEEDA;
    --text-main:    #1a1a1a;
    --text-muted:   #6b7280;
    --border:       rgba(0,0,0,0.12);
    --surface:      #ffffff;
    --bg:           #f4f4f2;
    --radius:       10px;
    --shadow:       0 2px 12px rgba(0,0,0,0.10);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text-main);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.5;
}

/* ============================================================
   HEADER
   ============================================================ */
#app-header {
    background: var(--brand-navy);
    color: #fff;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

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

.header-logo {
    height: 56px;
    width: auto;
    filter: brightness(0) invert(1);
}

.header-title-block {
    text-align: center;
    flex: 1;
}

.header-subtitle {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 2px;
}

.header-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
}

.header-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

.header-badge.badge-open {
    background: #2d7a1f;
    color: #fff;
}

.header-badge.badge-closed {
    background: var(--brand);
    color: #fff;
}

.header-badge.badge-upcoming {
    background: #854F0B;
    color: #fff;
}

/* ============================================================
   TIMER BANNER
   ============================================================ */
#timer-banner {
    background: var(--brand-navy);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 10px 0;
}

.timer-inner {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.timer-block {
    text-align: center;
    min-width: 54px;
}

.timer-num {
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
}

.timer-label {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.55);
    margin-top: 2px;
}

.timer-sep {
    font-size: 24px;
    font-weight: 800;
    color: rgba(255,255,255,0.4);
    padding-bottom: 12px;
}

#timer-banner.urgent .timer-num {
    color: #ff6b6b;
    animation: pulse-red 1s ease-in-out infinite;
}

#timer-closed-msg {
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 8px;
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* ============================================================
   MAIN CONTAINER
   ============================================================ */
.main-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

/* ============================================================
   STEPPER
   ============================================================ */
#stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    gap: 0;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 24px;
    transition: all 0.3s;
    white-space: nowrap;
}

.step.active {
    background: var(--brand);
    color: #fff;
}

.step.done {
    background: var(--success-bg);
    color: var(--success);
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.12);
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.step.active .step-num { background: rgba(255,255,255,0.25); }
.step.done .step-num   { background: var(--success); color: #fff; }

.step-line {
    flex: 1;
    max-width: 60px;
    height: 2px;
    background: var(--border);
    margin: 0 6px;
}

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--brand-navy);
    margin-bottom: 6px;
}

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

/* ============================================================
   CANDIDATE GRID
   ============================================================ */
.candidate-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.candidate-card {
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    position: relative;
    user-select: none;
}

.candidate-card:hover {
    border-color: var(--brand-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.13);
}

.candidate-card.selected {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(204,41,41,0.18);
}

.candidate-photo-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #eee;
}

.candidate-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.candidate-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
}

.checkmark {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.candidate-card.selected .checkmark { opacity: 1; }

.candidate-info {
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border);
}

.candidate-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 3px;
    line-height: 1.3;
}

.candidate-dept {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.candidate-years {
    font-size: 11px;
    color: var(--brand);
    font-weight: 600;
}

/* Couleurs d'initiales par index */
.init-color-0 { background: linear-gradient(135deg, #CC2929, #8B1A1A); }
.init-color-1 { background: linear-gradient(135deg, #1B2A6B, #2d4a9e); }
.init-color-2 { background: linear-gradient(135deg, #3B6D11, #5a9e1a); }
.init-color-3 { background: linear-gradient(135deg, #854F0B, #c97a10); }
.init-color-4 { background: linear-gradient(135deg, #444, #777); }
.init-color-5 { background: linear-gradient(135deg, #5B2D8E, #8e4dba); }
.init-color-6 { background: linear-gradient(135deg, #0b6b6b, #1aabab); }
.init-color-7 { background: linear-gradient(135deg, #7a2d0b, #c94d1a); }
.init-color-8 { background: linear-gradient(135deg, #0b3d6b, #1a6aab); }

/* ============================================================
   SESSION CLOSED MESSAGE
   ============================================================ */
.session-closed-box {
    background: var(--brand-light);
    border: 1px solid var(--brand);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    margin: 20px 0;
}

.session-closed-box .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.session-closed-box h2 {
    color: var(--brand-dark);
    font-size: 22px;
    margin-bottom: 8px;
}

.session-closed-box p {
    color: var(--text-muted);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(204,41,41,0.4);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-main);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: #f0f0f0;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 10px 20px;
}

.btn-ghost:hover { color: var(--text-main); }

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-block { width: 100%; }

/* ============================================================
   STEP 2 — IDENTITY VERIFICATION
   ============================================================ */
#step-2 .content-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    max-width: 540px;
    margin: 0 auto;
}

.selected-candidate-recap {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--brand-light);
    border: 1px solid rgba(204,41,41,0.2);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 24px;
}

.recap-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--brand);
}

.recap-avatar-initials {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    border: 2px solid var(--brand);
}

.recap-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--brand-dark);
}

.recap-dept {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

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

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

.form-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-main);
    background: var(--surface);
    transition: border-color 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(204,41,41,0.12);
}

.form-input::placeholder { color: #b0b0b0; }

/* Lookup status cards */
.lookup-status {
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

.lookup-status.found {
    background: var(--success-bg);
    border: 1px solid rgba(59,109,17,0.25);
}

.lookup-status.error {
    background: var(--brand-light);
    border: 1px solid rgba(204,41,41,0.25);
}

.lookup-status.warning {
    background: var(--warning-bg);
    border: 1px solid rgba(133,79,11,0.25);
}

.lookup-status .status-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.lookup-status .status-text strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.lookup-status .status-text span {
    font-size: 13px;
    color: var(--text-muted);
}

.lookup-status.found .status-text strong  { color: var(--success); }
.lookup-status.error .status-text strong  { color: var(--brand-dark); }
.lookup-status.warning .status-text strong { color: var(--warning); }

/* Spinner */
.spinner-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 18px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid #e5e7eb;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ============================================================
   MODAL
   ============================================================ */
#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

#modal-overlay[hidden] { display: none; }

.modal-card {
    background: var(--surface);
    border-radius: 14px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: slideUp 0.25s ease;
}

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

.modal-header {
    background: var(--brand-navy);
    color: #fff;
    padding: 18px 24px;
    font-size: 17px;
    font-weight: 800;
    text-align: center;
}

.modal-body { padding: 24px; }

.modal-section {
    margin-bottom: 18px;
}

.modal-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.modal-person {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f8f8;
    border-radius: 8px;
    padding: 12px 14px;
}

.modal-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.modal-avatar-initials {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

.modal-person-name {
    font-weight: 700;
    font-size: 14px;
}

.modal-person-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.modal-warning {
    background: #fff8f8;
    border: 1px solid rgba(204,41,41,0.3);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--brand-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ============================================================
   STEP 3 — SUCCESS
   ============================================================ */
#step-3 {
    text-align: center;
}

.success-card {
    background: var(--surface);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 40px 32px;
    max-width: 480px;
    margin: 0 auto;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}

.success-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--success);
    margin-bottom: 8px;
}

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

.success-candidate {
    font-size: 20px;
    font-weight: 800;
    color: var(--brand);
    background: var(--brand-light);
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 24px;
    display: inline-block;
}

.receipt-box {
    background: #f8f8f8;
    border-radius: 10px;
    padding: 18px 20px;
    text-align: left;
    border: 1px solid var(--border);
}

.receipt-box h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 14px;
    font-weight: 700;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 5px 0;
    border-bottom: 1px solid #ececec;
    font-size: 13px;
}

.receipt-row:last-child { border-bottom: none; }

.receipt-row .lbl {
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.receipt-row .val {
    font-weight: 700;
    text-align: right;
}

/* ============================================================
   STEP ACTION BAR
   ============================================================ */
.step-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.step-actions .btn-back {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.step-actions .btn-back:hover { color: var(--text-main); }

/* ============================================================
   ADMIN — LOGIN PAGE
   ============================================================ */
.admin-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
}

.admin-login-card {
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.12);
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
}

.admin-login-logo {
    height: 60px;
    width: auto;
    display: block;
    margin: 0 auto 20px;
}

.admin-login-title {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    color: var(--brand-navy);
    margin-bottom: 4px;
}

.admin-login-sub {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.alert-error {
    background: var(--brand-light);
    border: 1px solid rgba(204,41,41,0.3);
    color: var(--brand-dark);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ============================================================
   ADMIN — PANEL
   ============================================================ */
.admin-header {
    background: var(--brand-navy);
    color: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-header-logo {
    height: 44px;
    filter: brightness(0) invert(1);
}

.admin-header-title {
    font-size: 17px;
    font-weight: 800;
}

.admin-header-actions { display: flex; gap: 10px; align-items: center; }

.admin-header-actions a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.admin-header-actions a:hover { color: #fff; }

.admin-body {
    max-width: 1000px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

/* Tabs */
.admin-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 28px;
}

.admin-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

.admin-tab:hover { color: var(--text-main); }
.admin-tab.active { color: var(--brand); border-bottom-color: var(--brand); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Admin candidate grid */
.admin-candidate-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.admin-candidate-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    text-align: center;
}

.admin-cand-photo-wrap {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 12px;
}

.admin-cand-photo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
    border: 2px solid var(--border);
    display: block;
}

.admin-cand-initials {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin: 0 auto;
}

.admin-cand-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 3px;
}

.admin-cand-dept {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.photo-status {
    font-size: 11px;
    margin-bottom: 10px;
    font-weight: 600;
}

.photo-status.has-photo { color: var(--success); }
.photo-status.no-photo  { color: var(--text-muted); }

.upload-progress {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #e5e7eb;
    overflow: hidden;
    margin-top: 8px;
    display: none;
}

.upload-progress-bar {
    height: 100%;
    background: var(--brand);
    transition: width 0.3s;
}

/* Results */
.results-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.metric-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
}

.metric-val {
    font-size: 32px;
    font-weight: 800;
    color: var(--brand-navy);
    line-height: 1;
    margin-bottom: 6px;
}

.metric-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.results-table-wrap {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th {
    background: #f5f5f5;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

.results-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

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

.rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    color: #fff;
}

.rank-1 { background: #FFD700; color: #333; }
.rank-2 { background: #C0C0C0; color: #333; }
.rank-3 { background: #CD7F32; }
.rank-n { background: #e5e7eb; color: var(--text-muted); }

.vote-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vote-bar {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #f0f0f0;
    overflow: hidden;
}

.vote-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--brand);
}

.results-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Config panel */
.config-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    max-width: 520px;
}

.config-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.session-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 20px;
}

.badge-ouvert  { background: var(--success-bg);  color: var(--success); }
.badge-clos    { background: var(--brand-light);  color: var(--brand-dark); }
.badge-brouillon { background: #f0f0f0; color: var(--text-muted); }

.statut-radios {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.statut-radio {
    flex: 1;
}

.statut-radio input { display: none; }

.statut-radio label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.statut-radio input:checked + label {
    border-color: var(--brand);
    background: var(--brand-light);
    color: var(--brand-dark);
}

.statut-radio label .radio-icon { font-size: 20px; }

.flash-success {
    background: var(--success-bg);
    border: 1px solid rgba(59,109,17,0.25);
    color: var(--success);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 600;
}

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

/* Add form card */
.cand-add-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    margin-bottom: 24px;
}

.cand-add-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 18px;
}

.cand-add-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cand-lookup-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 4px;
}

.cand-add-fields {
    border-top: 1px solid var(--border);
    margin-top: 14px;
    padding-top: 18px;
}

.cand-add-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

/* Candidates list */
.cand-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cand-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-navy);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 9px;
    margin-left: 8px;
    min-width: 24px;
}

.cand-table-wrap {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.cand-table {
    width: 100%;
    border-collapse: collapse;
}

.cand-table th {
    background: #f5f5f5;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 11px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

.cand-table td {
    padding: 11px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

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

.cand-table tbody tr:hover { background: #fafafa; }

.cand-ordre {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}

.cand-row-name {
    font-weight: 600;
    color: var(--text-main);
}

.cand-row-dept {
    font-size: 13px;
    color: var(--text-muted);
}

.cand-matricule {
    font-family: monospace;
    font-size: 12px;
    background: #f0f2f5;
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--brand-navy);
    font-weight: 700;
    letter-spacing: 0.3px;
}

.btn-delete-cand {
    background: none;
    border: 1px solid rgba(204,41,41,0.25);
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    padding: 4px 8px;
    color: var(--brand);
    transition: all 0.15s;
    line-height: 1;
}

.btn-delete-cand:hover {
    background: var(--brand-light);
    border-color: var(--brand);
}

.cand-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 32px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 800px) {
    .cand-add-fields-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
    .cand-add-fields-grid { grid-template-columns: 1fr; }
    .cand-lookup-row { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
[hidden] { display: none !important; }

.text-muted  { color: var(--text-muted); }
.text-brand  { color: var(--brand); }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 8px; }
.mb-4 { margin-bottom: 16px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
    .header-inner { flex-direction: column; text-align: center; }
    .header-logo  { height: 44px; }
    .header-title { font-size: 16px; }

    .candidate-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-candidate-grid { grid-template-columns: repeat(2, 1fr); }

    .results-metrics { grid-template-columns: 1fr; }
    .modal-actions { grid-template-columns: 1fr; }
    .timer-num { font-size: 20px; }
    .timer-block { min-width: 42px; }

    #stepper { gap: 2px; }
    .step { padding: 6px 10px; font-size: 11px; }
    .step-line { max-width: 20px; }
}

@media (max-width: 440px) {
    .candidate-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .main-container { padding: 16px 12px 50px; }
}

/* ============================================================
   Employés tab
   ============================================================ */

.csv-format-hint {
    display: inline-block;
    background: #f3f4f6;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-family: monospace;
    color: var(--text-main);
    word-break: break-all;
}

/* Stats badges row */
.emp-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.emp-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.emp-stat-total {
    background: #f3f4f6;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.emp-stat-voted {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(59,109,17,.2);
}

.emp-stat-not {
    background: var(--brand-light);
    color: var(--brand-dark);
    border: 1px solid rgba(204,41,41,.2);
}

/* Toolbar (filters + search) */
.emp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.emp-filter-group {
    display: flex;
    gap: 4px;
}

.emp-filter-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fff;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}

.emp-filter-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.emp-filter-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.emp-search-wrap {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Table */
.emp-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.emp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.emp-table thead th {
    background: #f9fafb;
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
}

.emp-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}

.emp-table tbody tr:last-child { border-bottom: none; }
.emp-table tbody tr:hover { background: #fafafa; }

.emp-table td {
    padding: 10px 14px;
    vertical-align: middle;
}

/* Vote status badges */
.emp-vote-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.emp-voted {
    background: var(--success-bg);
    color: var(--success);
}

.emp-not-voted {
    background: #f3f4f6;
    color: var(--text-muted);
}

/* ── Sessions table ───────────────────────────────────────── */
.sessions-table-wrap {
    overflow-x: auto;
    margin-top: 12px;
}

.sessions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sessions-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.sessions-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.sessions-table tbody tr:last-child td { border-bottom: none; }
.sessions-table tbody tr:hover { background: #fafafa; }

.sess-row-active { background: #fff8f0 !important; }
.sess-row-active:hover { background: #fff4e8 !important; }

/* Type pill */
.sess-type-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.sess-type-annuel  { background: #e8eeff; color: #2b4fa8; }
.sess-type-mensuel { background: #edf7e8; color: #2d7a1f; }

/* Statut badge in table */
.sess-statut-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.sess-statut-ouvert   { background: var(--success-bg); color: var(--success); }
.sess-statut-brouillon { background: #f3f4f6; color: var(--text-muted); }
.sess-statut-clos     { background: var(--brand-light); color: var(--brand); }

/* Active session label */
.sess-active-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #c87500;
    white-space: nowrap;
}

/* Session action buttons */
.sess-actions { white-space: nowrap; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.btn-sess-action {
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
}
.btn-sess-action:hover { opacity: .8; }

.btn-sess-activate { background: #e8eeff; color: #2b4fa8; }
.btn-sess-open     { background: var(--success-bg); color: var(--success); }
.btn-sess-close    { background: var(--brand-light); color: var(--brand); }
.btn-sess-edit     { background: #f3f4f6; color: var(--text-main); }

/* ── Department winners grid (Results tab) ─────────────────── */
.dept-winners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}

.dept-winner-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
}

.dept-winner-dept {
    font-size: 11px;
    font-weight: 700;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
}

.dept-winner-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.dept-winner-votes {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Voter recap card (Monthly step 2) ─────────────────────── */
.voter-recap-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--success-bg);
    border: 1px solid #c3dfa0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.voter-recap-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.voter-recap-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.voter-recap-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.voter-recap-badge {
    margin-left: auto;
    background: var(--success);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* ── Nominee search input ───────────────────────────────────── */
.nominee-search-wrap {
    position: relative;
    margin-bottom: 8px;
}

.nominee-search-wrap input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-main);
    background: var(--surface);
    outline: none;
    transition: border-color .15s;
}

.nominee-search-wrap input:focus {
    border-color: var(--brand);
}

.nominee-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
}

.nominee-count {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-align: right;
}

/* ── Nominee list ───────────────────────────────────────────── */
.nominee-list {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    margin-bottom: 20px;
}

.nominee-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .12s;
}

.nominee-row:last-child {
    border-bottom: none;
}

.nominee-row:hover {
    background: #f5f5f5;
}

.nominee-row.selected {
    background: var(--brand-light);
    border-left: 3px solid var(--brand);
    padding-left: 11px;
}

.nominee-row-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.nominee-row-info {
    flex: 1;
    min-width: 0;
}

.nominee-row-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nominee-row-dept {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nominee-row-mat {
    font-family: monospace;
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.nominee-row-check {
    font-size: 16px;
    color: var(--success);
    font-weight: 700;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity .15s;
}

.nominee-row.selected .nominee-row-check {
    opacity: 1;
}

.nominee-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ── Department Groups (Admin tab) ─────────────────────────── */
.groups-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.groups-loading,
.groups-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.group-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
}

.group-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.group-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.btn-group-delete {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--brand);
    cursor: pointer;
    transition: background .12s;
}
.btn-group-delete:hover { background: var(--brand-light); }

.dept-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.dept-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--brand-light);
    color: var(--brand-dark);
    border: 1px solid rgba(204,41,41,.2);
    border-radius: 20px;
    padding: 3px 10px 3px 12px;
    font-size: 13px;
    font-weight: 500;
}

.dept-chip-remove {
    background: none;
    border: none;
    color: var(--brand);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    font-weight: 700;
    opacity: .7;
    transition: opacity .1s;
}
.dept-chip-remove:hover { opacity: 1; }

.dept-chip-add {
    background: none;
    border: 1px dashed var(--border);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color .12s, color .12s;
}
.dept-chip-add:hover { border-color: var(--brand); color: var(--brand); }

.group-add-dept-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.form-input-sm {
    padding: 5px 10px;
    font-size: 13px;
    height: auto;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background .12s;
}
.btn-secondary:hover { background: #e5e7eb; }

.group-create-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.group-create-form .form-input {
    flex: 1;
    max-width: 360px;
}
