/* eeVote console theme -- fixed dark sidebar + light topbar/content admin
   layout, in the same general family as commercial Bootstrap admin
   dashboards (categorized sidebar, card-based stat widgets, soft-tinted
   badges). Original styling built for this app's own palette/typography,
   not copied from any third-party theme's files. */

:root {
    --ev-sidebar-width: 260px;
    --ev-sidebar-bg: #17203a;
    --ev-sidebar-bg-active: #232f52;
    --ev-sidebar-text: #aab4d4;
    --ev-sidebar-text-active: #ffffff;
    --ev-accent: #5b6ee8;
    --ev-accent-dark: #4655c4;
    --ev-body-bg: #f3f5fb;
    --ev-card-bg: #ffffff;
    --ev-card-border: #e8ebf5;
    --ev-text-muted: #6b7280;
    --ev-radius: 0.75rem;
    --ev-topbar-height: 64px;
    --ev-shadow: 0 1px 3px rgba(23, 32, 58, 0.06), 0 1px 2px rgba(23, 32, 58, 0.08);
}

body {
    background: var(--ev-body-bg);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1f2433;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

/* ---------- Sidebar ---------- */
.ev-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--ev-sidebar-width);
    background: var(--ev-sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1030;
    transition: transform 0.2s ease;
}

.ev-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    height: var(--ev-topbar-height);
    padding: 0 1.25rem;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
    flex-shrink: 0;
}

.ev-sidebar-brand:hover {
    color: #ffffff;
}

.ev-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--ev-accent);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.ev-sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.75rem 0.75rem 1.5rem;
}

.ev-sidebar-section {
    color: #616f96;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 1rem 0.75rem 0.4rem;
}

.ev-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    color: var(--ev-sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.ev-sidebar-nav a i {
    font-size: 1.05rem;
    width: 1.25rem;
    text-align: center;
}

.ev-sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--ev-sidebar-text-active);
}

.ev-sidebar-nav a.active {
    background: var(--ev-sidebar-bg-active);
    color: var(--ev-sidebar-text-active);
    box-shadow: inset 3px 0 0 var(--ev-accent);
}

.ev-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 35, 0.45);
    z-index: 1025;
}

/* ---------- Shell / topbar ---------- */
.ev-shell {
    margin-left: var(--ev-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ev-shell.ev-shell-full {
    margin-left: 0;
}

.ev-topbar {
    height: var(--ev-topbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--ev-card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.ev-topbar-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0;
    color: #1f2433;
}

.ev-sidebar-toggle {
    display: none;
    border: none;
    background: transparent;
    font-size: 1.35rem;
    color: #1f2433;
    padding: 0.25rem 0.5rem;
    margin-right: 0.75rem;
}

.ev-content {
    flex: 1 1 auto;
    padding: 1.75rem;
}

/* ---------- Anonymous topbar nav (section anchors on the public homepage) ---------- */
.ev-topbar-nav {
    display: none;
    align-items: center;
    gap: 1.5rem;
    margin-left: 2rem;
}
.ev-topbar-nav a {
    color: #1f2433;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}
.ev-topbar-nav a:hover {
    color: var(--ev-accent-dark);
}

.ev-topbar-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--ev-card-border);
    border-radius: 0.5rem;
    background: #fff;
    font-size: 1.1rem;
    color: #1f2433;
}

.ev-topbar-mobile-menu {
    position: sticky;
    top: var(--ev-topbar-height);
    z-index: 1019;
    border-bottom: 1px solid var(--ev-card-border);
    background: #fff;
    padding: 0.5rem 1.5rem 1rem;
}
.ev-topbar-mobile-menu a {
    display: block;
    padding: 0.6rem 0.25rem;
    color: #1f2433;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid var(--ev-card-border);
}
.ev-topbar-mobile-menu a:last-child {
    border-bottom: none;
}

@media (min-width: 992px) {
    .ev-topbar-nav { display: flex; }
    .ev-topbar-nav-toggle { display: none !important; }
    .ev-topbar-mobile-menu { display: none !important; }
}

/* ---------- Footer ---------- */
.ev-footer-links a {
    color: var(--ev-text-muted);
    text-decoration: none;
}
.ev-footer-links a:hover {
    color: #1f2433;
    text-decoration: underline;
}

.ev-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.75rem;
    border-top: 1px solid var(--ev-card-border);
    color: var(--ev-text-muted);
    font-size: 0.82rem;
}

.ev-footer-powered strong {
    color: #1f2433;
}

/* ---------- Tooltips / info icons ---------- */
.ev-info-icon {
    color: var(--ev-text-muted);
    font-size: 0.9rem;
    margin-left: 0.35rem;
    cursor: help;
}

.ev-info-icon:hover,
.ev-info-icon:focus {
    color: var(--ev-accent);
}

/* ---------- Cards / tables / badges (applies app-wide, no per-page changes needed) ---------- */
.card {
    border: 1px solid var(--ev-card-border);
    border-radius: var(--ev-radius);
    box-shadow: var(--ev-shadow);
}

.card-title {
    font-weight: 600;
}

.table {
    --bs-table-border-color: var(--ev-card-border);
}

.table thead th {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--ev-text-muted);
    font-weight: 600;
    border-bottom-width: 1px;
}

.btn-primary {
    background-color: var(--ev-accent);
    border-color: var(--ev-accent);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--ev-accent-dark);
    border-color: var(--ev-accent-dark);
}

.btn-outline-light {
    --bs-btn-color: #1f2433;
    --bs-btn-border-color: var(--ev-card-border);
    --bs-btn-hover-bg: #f3f5fb;
    --bs-btn-hover-color: #1f2433;
    --bs-btn-hover-border-color: var(--ev-card-border);
}

.badge {
    font-weight: 600;
    padding: 0.4em 0.7em;
}

/* "Soft" tinted badge variants, common shorthand for status pills in this
   type of dashboard -- e.g. <span class="badge badge-soft-success">. */
.badge-soft-success { background: rgba(25, 135, 84, 0.12); color: #157347; }
.badge-soft-warning { background: rgba(255, 193, 7, 0.18); color: #997404; }
.badge-soft-danger  { background: rgba(220, 53, 69, 0.12); color: #b02a37; }
.badge-soft-info    { background: rgba(13, 202, 240, 0.14); color: #087990; }
.badge-soft-primary { background: rgba(91, 110, 232, 0.12); color: var(--ev-accent-dark); }
.badge-soft-secondary { background: rgba(108, 117, 125, 0.14); color: #565e64; }

/* ---------- Dashboard stat cards ---------- */
.ev-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.4rem;
}

.ev-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    background: rgba(91, 110, 232, 0.12);
    color: var(--ev-accent-dark);
}

.ev-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.ev-stat-label {
    color: var(--ev-text-muted);
    font-size: 0.82rem;
}

/* ---------- Election lifecycle pipeline ---------- */
.ev-pipeline {
    display: flex;
    overflow-x: auto;
    padding: 0.35rem 0;
}

.ev-pipeline-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    width: 88px;
}

.ev-pipeline-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 11px;
    left: 56%;
    width: 88%;
    height: 2px;
    background: #dee2e6;
    z-index: 0;
}

.ev-pipeline-step.completed:not(:last-child)::after {
    background: #198754;
}

.ev-pipeline-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    background: #fff;
    border: 2px solid #dee2e6;
    color: var(--ev-text-muted);
    z-index: 1;
}

.ev-pipeline-step.completed .ev-pipeline-dot {
    background: #198754;
    border-color: #198754;
    color: #fff;
}

.ev-pipeline-step.current .ev-pipeline-dot {
    background: var(--ev-accent-dark);
    border-color: var(--ev-accent-dark);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(91, 110, 232, 0.25);
}

.ev-pipeline-label {
    margin-top: 0.35rem;
    font-size: 0.7rem;
    line-height: 1.15;
    text-align: center;
    color: var(--ev-text-muted);
}

.ev-pipeline-step.completed .ev-pipeline-label {
    color: #198754;
}

.ev-pipeline-step.current .ev-pipeline-label {
    color: var(--ev-accent-dark);
    font-weight: 600;
}

/* ---------- Responsive: off-canvas sidebar below lg ---------- */
@media (max-width: 991.98px) {
    .ev-sidebar {
        transform: translateX(-100%);
    }

    body.ev-sidebar-open .ev-sidebar {
        transform: translateX(0);
    }

    body.ev-sidebar-open .ev-sidebar-backdrop {
        display: block;
    }

    .ev-shell {
        margin-left: 0;
    }

    .ev-sidebar-toggle {
        display: inline-block;
    }

    .ev-content {
        padding: 1.1rem;
    }

    .ev-footer {
        padding: 1rem 1.1rem;
        justify-content: center;
        text-align: center;
    }

    .ev-topbar {
        padding: 0 0.85rem;
    }
}

@media (max-width: 359.98px) {
    .ev-topbar .btn-sm {
        padding: 0.25rem 0.6rem;
        font-size: 0.8rem;
    }
}
