/* ═══════════════════════════════════════════════════════════════
   css/style.css — Sistema de Diseño Apple Dark Global
   Unificado para Sistema Electoral Podemos Perú · ODPE Pasco
   100% Responsive para Móvil, Tablet y Desktop
═══════════════════════════════════════════════════════════════ */

/* ── RESET BASE ── */
*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f5f5f7 !important;
    color: #1d1d1f !important;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Glow radial superior Apple */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 520px;
    background: radial-gradient(ellipse 70% 45% at 50% -5%, rgba(0, 113, 227, 0.18) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── TOKENS DE DISEÑO APPLE DARK ── */
:root {
    --bg:            #f5f5f7;
    --surface:       #ffffff;
    --surface-h:     #f0f0f0;
    --border:        #d2d2d7;
    --border-h:      #c7c7cc;
    --accent:        #0071e3;
    --accent-glow:   rgba(0, 113, 227, 0.35);
    --accent-light:  rgba(0, 113, 227, 0.14);
    --blue-brand:    #1B4B8A;
    --text:          #1d1d1f;
    --text-2:        #86868b;
    --text-3:        #86868b;
    --ok:            #16a34a;
    --err:           #dc2626;
    --warn:          #d97706;
    --r-sm:          8px;
    --r:             14px;
    --r-lg:          20px;
    --r-xl:          24px;
    --shadow:        0 12px 40px rgba(0, 0, 0, 0.65);
    --t:             all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─────────────────────────────────────────────────────────────
   NAVBAR APPLE DARK UNIFICADO
───────────────────────────────────────────────────────────── */
.navbar {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 1.5rem !important;
    height: 56px !important;
    background: rgba(255, 255, 255, 0.84) !important;
    backdrop-filter: saturate(180%) blur(24px) !important;
    -webkit-backdrop-filter: saturate(180%) blur(24px) !important;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15) !important;
    width: 100% !important;
}

/* Brand Pill Podemista */
.navbar-brand-wrap,
.navbar-brand,
a.navbar-brand {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    background: linear-gradient(135deg, rgba(27, 75, 138, 0.6), rgba(10, 40, 90, 0.75)) !important;
    border: 1px solid rgba(59, 130, 246, 0.55) !important;
    border-radius: 22px !important;
    padding: 0.25rem 0.75rem 0.25rem 0.3rem !important;
    box-shadow: 0 0 18px rgba(27, 75, 138, 0.4), inset 0 0.5px 0 rgba(0, 0, 0, 0.15) !important;
    text-decoration: none !important;
    flex-shrink: 0 !important;
    transition: var(--t) !important;
}
.navbar-brand-wrap:hover,
.navbar-brand:hover {
    border-color: rgba(59, 130, 246, 0.85) !important;
    box-shadow: 0 0 26px rgba(27, 75, 138, 0.65), inset 0 0.5px 0 rgba(0, 0, 0, 0.25) !important;
}
.navbar-brand-wrap img,
.navbar-brand img,
.navbar-logo {
    width: 28px !important;
    height: 28px !important;
    border-radius: 7px !important;
    object-fit: cover !important;
    background: #ffffff !important;
    padding: 1px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) !important;
    flex-shrink: 0 !important;
}
.navbar-brand-text {
    display: flex !important;
    flex-direction: column !important;
    line-height: 1.15 !important;
}
.navbar-brand-main {
    font-size: 0.75rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    color: #1d1d1f !important;
    text-shadow: none !important;
    white-space: nowrap !important;
}
.navbar-brand-sub {
    font-size: 0.55rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #93c5fd !important;
    opacity: 0.9 !important;
    white-space: nowrap !important;
}

/* Links Pill Group (Centro) */
.navbar-links {
display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(255, 255, 255, 0.5) !important;
    border: 0.5px solid rgba(0, 0, 0, 0.09) !important;
    border-radius: 26px !important;
    padding: 0.2rem 0.25rem !important;
}
.navbar-links a {
    color: rgba(0, 0, 0, 0.55) !important;
    text-decoration: none !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    padding: 0.36rem 0.85rem !important;
    border-radius: 20px !important;
    border: 0.5px solid transparent !important;
    transition: var(--t) !important;
    white-space: nowrap !important;
}
.navbar-links a:hover {
    color: #1d1d1f !important;
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.35) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2) !important;
}
.navbar-links a.active {
    color: #1d1d1f !important;
    background: linear-gradient(135deg, rgba(27, 75, 138, 0.7), rgba(10, 40, 90, 0.85)) !important;
    border-color: rgba(59, 130, 246, 0.6) !important;
    box-shadow: 0 0 14px rgba(27, 75, 138, 0.5), inset 0 0.5px 0 rgba(0, 0, 0, 0.1) !important;
    font-weight: 700 !important;
}

/* User Area (Derecha) */
.navbar-user {
    display: flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    flex-shrink: 0 !important;
}
.nav-username,
.nav-user-name,
#navUsername {
    font-size: 0.78rem !important;
    color: #86868b !important;
    background: rgba(0, 0, 0, 0.04) !important;
    border: 0.5px solid rgba(0, 0, 0, 0.09) !important;
    padding: 0.28rem 0.7rem !important;
    border-radius: 20px !important;
    white-space: nowrap !important;
}
.btn-logout {
    background: transparent !important;
    border: 0.5px solid rgba(255, 69, 58, 0.4) !important;
    color: #dc2626 !important;
    padding: 0.32rem 0.8rem !important;
    border-radius: 20px !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: var(--t) !important;
    letter-spacing: 0.02em !important;
    font-family: inherit !important;
}
.btn-logout:hover {
    background: #dc2626 !important;
    color: #1d1d1f !important;
    border-color: #dc2626 !important;
    box-shadow: 0 0 12px rgba(255, 69, 58, 0.45) !important;
}

/* Botón Hamburguesa Móvil */
.nav-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: rgba(0, 0, 0, 0.05);
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    color: #1d1d1f; font-size: 1.25rem;
    cursor: pointer; transition: var(--t);
    margin-left: 0.35rem;
}
.nav-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.25);
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
    display: none;
    position: fixed;
    top: 56px; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    padding: 1rem 1.25rem 1.5rem;
    z-index: 999;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.85);
}
.mobile-nav-drawer.open {
    display: flex;
}
.mobile-nav-drawer a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    color: rgba(0, 0, 0, 0.75);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.03);
    border: 0.5px solid rgba(0, 0, 0, 0.07);
    transition: var(--t);
}
.mobile-nav-drawer a:hover,
.mobile-nav-drawer a.active {
    color: #1d1d1f;
    background: linear-gradient(135deg, rgba(27, 75, 138, 0.6), rgba(10, 40, 90, 0.8));
    border-color: rgba(59, 130, 246, 0.5);
}

/* ─────────────────────────────────────────────────────────────
   ESTRUCTURA DE PÁGINA (PAGE WRAPPER)
───────────────────────────────────────────────────────────── */
.page,
.page-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1160px;
    margin: 0 auto;
    padding: 82px 1.5rem 5rem;
}

/* Page Header */
.page-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.4rem;
}
.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
    color: #1d1d1f;
    margin-bottom: 0.35rem;
}
.page-sub {
    font-size: 0.92rem;
    color: var(--text-2);
    margin-bottom: 2rem;
    line-height: 1.45;
}

/* ─────────────────────────────────────────────────────────────
   STEPPER TABS (IDÉNTICO A PANTALLAZO 1)
───────────────────────────────────────────────────────────── */
.steps,
.tabs-stepper {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.step,
.tab-step {
    flex: 1;
    padding: 0.95rem 0.6rem;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-3);
    border-right: 0.5px solid var(--border);
    transition: var(--t);
    position: relative;
    cursor: pointer;
    background: transparent;
    border-top: none;
    border-bottom: none;
    border-left: none;
    font-family: inherit;
    text-decoration: none;
}
.step:last-child,
.tab-step:last-child {
    border-right: none;
}
.step:hover,
.tab-step:hover {
    color: #1d1d1f;
    background: rgba(0, 0, 0, 0.025);
}
.step.active,
.tab-step.active {
    background: var(--accent-light) !important;
    color: #1d1d1f !important;
    box-shadow: inset 0 0 16px rgba(0, 113, 227, 0.2);
}
.step-num {
    display: block;
    width: 22px; height: 22px;
    border-radius: 50%;
    margin: 0 auto 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.08);
    line-height: 22px;
    color: var(--text-2);
    transition: var(--t);
}
.step.active .step-num,
.tab-step.active .step-num {
    background: var(--accent) !important;
    color: #1d1d1f !important;
    box-shadow: 0 0 10px rgba(0, 113, 227, 0.5);
}

/* ─────────────────────────────────────────────────────────────
   SECTION CARD (IDÉNTICO A PANTALLAZO 1: PASO 1)
───────────────────────────────────────────────────────────── */
.section-card {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--r-xl);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    transition: var(--t);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.section-card:hover {
    border-color: var(--border-h);
}
.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.section-title {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #1d1d1f;
}
.section-title-icon {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--accent-light);
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────
   KPI STATS CARDS
───────────────────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.kpi-card {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.25rem 1.4rem;
    transition: var(--t);
    position: relative;
    overflow: hidden;
}
.kpi-card:hover {
    border-color: var(--border-h);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}
.kpi-card-title {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-2);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.kpi-card-value {
    font-size: 2.1rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #1d1d1f;
    margin-bottom: 0.2rem;
}
.kpi-card-sub {
    font-size: 0.76rem;
    color: var(--text-3);
}

/* ─────────────────────────────────────────────────────────────
   TOOLBAR (SEARCH & FILTERS)
───────────────────────────────────────────────────────────── */
.toolbar-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.search-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(0, 0, 0, 0.04);
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    padding: 0.6rem 0.95rem;
    flex: 1;
    min-width: 240px;
    max-width: 420px;
    transition: var(--t);
}
.search-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(0, 0, 0, 0.06);
}
.search-wrapper input {
    background: transparent;
    border: none;
    outline: none;
    color: #1d1d1f;
    font-size: 0.88rem;
    font-family: inherit;
    width: 100%;
}
.search-wrapper input::placeholder {
    color: var(--text-3);
}

.select-filter {
    background: rgba(0, 0, 0, 0.04);
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    padding: 0.6rem 0.95rem;
    color: #1d1d1f;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: var(--t);
}
.select-filter:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.select-filter option {
    background: #ffffff;
    color: #1d1d1f;
}

/* ─────────────────────────────────────────────────────────────
   TABLAS APPLE DARK RESPONSIVE
───────────────────────────────────────────────────────────── */
.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

th {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-2);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.85rem 1.1rem;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    text-align: left;
    white-space: nowrap;
}

td {
    padding: 0.95rem 1.1rem;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.045);
    font-size: 0.86rem;
    color: var(--text);
    vertical-align: middle;
}
tr:last-child td {
    border-bottom: none;
}
tr:hover td {
    background: rgba(0, 0, 0, 0.025);
}

/* Monospace Mesa Badge */
.mesa-tag {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88rem;
    font-weight: 800;
    color: #1d1d1f;
    letter-spacing: 0.04em;
    background: rgba(0, 0, 0, 0.06);
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    border: 0.5px solid rgba(0, 0, 0, 0.12);
}

/* Badges de Estado */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.26rem 0.72rem;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.badge.contabilizada {
    background: rgba(50, 215, 75, 0.14) !important;
    color: #16a34a !important;
    border: 0.5px solid rgba(50, 215, 75, 0.35) !important;
}
.badge.digitada {
    background: rgba(59, 130, 246, 0.14) !important;
    color: #1d4ed8 !important;
    border: 0.5px solid rgba(59, 130, 246, 0.35) !important;
}
.badge.observada {
    background: rgba(255, 69, 58, 0.14) !important;
    color: #dc2626 !important;
    border: 0.5px solid rgba(255, 69, 58, 0.35) !important;
}
.badge.falta,
.badge.faltanentregar,
.badge.faltaentregar,
.badge.pendiente {
    background: rgba(148, 163, 184, 0.12) !important;
    color: #94a3b8 !important;
    border: 0.5px solid rgba(148, 163, 184, 0.25) !important;
}

/* Progress bar inside table */
.progress-bar-wrap {
    width: 100%;
    min-width: 100px;
}
.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 0.35rem;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0071e3, #16a34a);
    border-radius: 99px;
    transition: width 0.6s ease;
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE DESIGN (MEDIA QUERIES)
───────────────────────────────────────────────────────────── */

/* Tablets y Pantallas Medianas (<= 960px) */
@media (max-width: 960px) {
    .navbar-links {
        display: none !important;
    }
    .nav-toggle-btn {
        display: inline-flex !important;
    }
    .page,
    .page-wrapper {
        padding: 72px 1rem 4rem;
    }
    .page-title {
        font-size: 1.85rem;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Móviles (<= 640px) */
@media (max-width: 640px) {
    .navbar {
        padding: 0 0.85rem !important;
    }
    .navbar-brand-sub {
        display: none !important;
    }
    .navbar-brand-wrap,
    .navbar-brand {
        padding: 0.2rem 0.5rem 0.2rem 0.25rem !important;
    }
    .navbar-brand-main {
        font-size: 0.68rem !important;
    }
    .nav-username,
    #navUsername {
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .page,
    .page-wrapper {
        padding: 68px 0.75rem 3.5rem;
    }
    .page-title {
        font-size: 1.55rem;
    }
    .page-sub {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .steps,
    .tabs-stepper {
        flex-direction: row;
        border-radius: 14px;
    }
    .step,
    .tab-step {
        padding: 0.75rem 0.35rem;
        font-size: 0.75rem;
    }
    .step-num {
        width: 20px; height: 20px;
        line-height: 20px;
        font-size: 0.68rem;
    }

    .section-card {
        padding: 1.15rem;
        border-radius: 18px;
    }
    .section-title {
        font-size: 1.05rem;
    }

    .toolbar-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-wrapper {
        max-width: 100%;
        min-width: 100%;
    }
    .select-filter {
        width: 100%;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .kpi-card {
        padding: 1rem 1.15rem;
    }
    .kpi-card-value {
        font-size: 1.75rem;
    }
}

/* Scrollbar Personalizado Apple */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.28); }
