/* ── LANDING PAGE ─────────────────────────────────────── */
.landing-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #0a0f1e;
    color: #f1f5f9;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif
}

.landing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 40px;
    border-bottom: 1px solid rgba(255,255,255,.07)
}

.landing-logo {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: #fff
}

.landing-logo span {
    color: #3b82f6
}

.landing-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px 80px
}

.landing-hero {
    text-align: center;
    margin-bottom: 56px
}

.landing-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    letter-spacing: -.04em;
    background: linear-gradient(135deg, #fff 30%, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.landing-hero p {
    margin: 0;
    font-size: 18px;
    color: #94a3b8
}

.landing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 980px
}

.lcard {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 36px 32px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    text-decoration: none;
    color: #f1f5f9;
    cursor: pointer;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
    position: relative;
    overflow: hidden
}

.lcard::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .22s ease
}

.lcard:hover {
    transform: translateY(-6px);
    border-color: rgba(255,255,255,.18)
}

.lcard:hover::before { opacity: 1 }

.lcard-blue::before  { background: radial-gradient(circle at 20% 0%, rgba(59,130,246,.22), transparent 60%) }
.lcard-purple::before { background: radial-gradient(circle at 20% 0%, rgba(139,92,246,.22), transparent 60%) }
.lcard-green::before  { background: radial-gradient(circle at 20% 0%, rgba(16,185,129,.22), transparent 60%) }

.lcard:hover { box-shadow: 0 24px 60px rgba(0,0,0,.4) }
.lcard-blue:hover  { box-shadow: 0 24px 60px rgba(59,130,246,.2) }
.lcard-purple:hover { box-shadow: 0 24px 60px rgba(139,92,246,.2) }
.lcard-green:hover  { box-shadow: 0 24px 60px rgba(16,185,129,.2) }

.lcard-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 28px;
    flex-shrink: 0
}

.lcard-blue  .lcard-icon { background: rgba(59,130,246,.18) }
.lcard-purple .lcard-icon { background: rgba(139,92,246,.18) }
.lcard-green  .lcard-icon { background: rgba(16,185,129,.18) }

.lcard-body { flex: 1 }

.lcard-body h2 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.02em
}

.lcard-body p {
    margin: 0;
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.55
}

.lcard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px
}

.lcard-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600
}

.lcard-blue  .lcard-badge { background: rgba(59,130,246,.15);  color: #93c5fd }
.lcard-purple .lcard-badge { background: rgba(139,92,246,.15); color: #c4b5fd }
.lcard-green  .lcard-badge { background: rgba(16,185,129,.15);  color: #6ee7b7 }

.lcard-arrow {
    font-size: 20px;
    opacity: .4;
    transition: opacity .2s, transform .2s
}

.lcard:hover .lcard-arrow {
    opacity: 1;
    transform: translateX(4px)
}

.landing-footer {
    text-align: center;
    padding: 28px;
    color: #475569;
    font-size: 13px;
    border-top: 1px solid rgba(255,255,255,.05)
}

/* ── FIN LANDING ──────────────────────────────────────── */

:root {
    --bg: #eef2f7;
    --panel: rgba(255, 255, 255, .94);
    --text: #111827;
    --muted: #64748b;
    --line: #dbe3ef;
    --red: #dc2626;
    --red-dark: #991b1b;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --green: #047857;
    --shadow: 0 20px 55px rgba(15, 23, 42, .12);
    --soft-shadow: 0 12px 30px rgba(15, 23, 42, .08)
}

* {
    box-sizing: border-box
}

/* Clase utilitaria global — oculta cualquier elemento */
.hidden {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, rgba(37, 99, 235, .18), transparent 34%), radial-gradient(circle at top right, rgba(220, 38, 38, .14), transparent 30%), linear-gradient(135deg, #f8fafc 0%, var(--bg) 100%)
}

a {
    color: inherit
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #0f172a
}

.login-card {
    width: min(470px, 100%);
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: rgba(255, 255, 255, .1);
    color: white;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 30px;
    padding: 28px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .35)
}

.login-card h1 {
    margin: 6px 0 0
}

.login-card p {
    color: #cbd5e1
}

.lock {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: rgba(59, 130, 246, .22);
    display: grid;
    place-items: center;
    font-size: 32px
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px
}

.login-card input,
.admin-form input,
.admin-form select,
td input,
td select,
.grid4 input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: white;
    color: #111827
}

.login-card input {
    background: #0f172a;
    color: white;
    border-color: rgba(255, 255, 255, .12)
}

.link-light {
    color: #cbd5e1;
    text-align: center;
    text-decoration: none
}

.app-shell {
    width: min(1440px, calc(100% - 40px));
    margin: 0 auto;
    padding: 34px 0 44px
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px
}

.hero-content {
    flex: 1;
    padding: 30px;
    border-radius: 30px;
    color: white;
    background: linear-gradient(135deg, rgba(15, 23, 42, .98), rgba(30, 41, 59, .94)), radial-gradient(circle at 20% 20%, rgba(37, 99, 235, .55), transparent 32%);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden
}

.hero h1 {
    margin: 0;
    max-width: 850px;
    font-size: clamp(32px, 5vw, 58px);
    line-height: .95;
    letter-spacing: -.045em
}

.hero p {
    max-width: 760px;
    margin: 18px 0 0;
    color: #cbd5e1;
    font-size: 17px;
    line-height: 1.6
}

.hero-card {
    width: 260px;
    padding: 24px;
    border-radius: 30px;
    background: var(--panel);
    box-shadow: var(--soft-shadow);
    border: 1px solid rgba(255, 255, 255, .7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px
}

.hero-card span,
.eyebrow,
.mini-label {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #93c5fd
}

.hero-card strong {
    font-size: 23px;
    line-height: 1.1
}

.hero-card small {
    color: var(--muted);
    font-weight: 800
}

.top-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 22px;
    align-items: stretch;
    margin-bottom: 22px
}

.upload-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px
}

.panel {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 26px;
    padding: 22px;
    box-shadow: var(--soft-shadow);
    backdrop-filter: blur(14px);
    margin-bottom: 22px
}

.upload-panel {
    display: flex;
    flex-direction: column;
    gap: 18px
}

.panel-title {
    display: flex;
    gap: 14px;
    align-items: flex-start
}

.icon-circle {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    font-weight: 900;
    color: white;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .14)
}

.icon-circle.red {
    background: linear-gradient(135deg, var(--red), var(--red-dark))
}

.icon-circle.blue {
    background: linear-gradient(135deg, var(--blue), var(--blue-dark))
}

h2 {
    margin: 0 0 6px;
    font-size: 22px;
    letter-spacing: -.025em
}

p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45
}

.grid4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px
}

.file-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 20px;
    border: 1.5px dashed #b8c4d6;
    background: rgba(248, 250, 252, .84);
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
    position: relative;
    overflow: hidden;
    min-height: 88px
}

.file-box:hover {
    transform: translateY(-3px);
    border-color: var(--blue);
    background: white;
    box-shadow: 0 14px 30px rgba(37, 99, 235, .10)
}

.file-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #e0e7ff;
    font-size: 22px;
    flex: 0 0 auto
}

.file-box strong,
.file-box small {
    display: block
}

.file-name {
    margin-top: 5px;
    color: #2563eb !important;
    font-weight: 900;
    word-break: break-all
}

.file-upload input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer
}

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

.departamento-bloque {
    padding: 14px;
    border-radius: 18px;
    background: rgba(248, 250, 252, .9);
    border: 1px solid var(--line)
}

.departamento-bloque>label {
    display: block;
    margin-bottom: 8px;
    font-weight: 900
}

.btn {
    appearance: none;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 900;
    padding: 13px 18px;
    transition: transform .18s ease, filter .18s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center
}

.btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.01);
    filter: brightness(1.03)
}

.btn:active:not(:disabled) {
    transform: translateY(0) scale(.98)
}

.btn-primary {
    width: 100%;
    margin-top: 4px;
    color: white;
    background: linear-gradient(135deg, var(--red), var(--blue));
    box-shadow: 0 18px 34px rgba(37, 99, 235, .25);
    font-size: 16px
}

.btn-secondary {
    color: #0f172a;
    background: white;
    border: 1px solid var(--line);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .07)
}

.compare-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    min-height: 100%;
    background: linear-gradient(160deg, rgba(255, 255, 255, .96), rgba(239, 246, 255, .92))
}

.alert {
    padding: 14px 16px;
    border-radius: 18px;
    font-weight: 900;
    margin-bottom: 18px
}

.alert.ok {
    background: #dcfce7;
    color: #166534
}

.alert.error {
    background: #fee2e2;
    color: #991b1b
}

.acciones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px
}

.result-card {
    padding: 0;
    overflow: hidden
}

.result-header {
    padding: 22px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    border-bottom: 1px solid var(--line)
}

.tag {
    display: inline-block;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em
}

.tag.red {
    color: var(--red-dark);
    background: #fee2e2
}

.tag.blue {
    color: var(--blue-dark);
    background: #dbeafe
}

.contador {
    flex: 0 0 auto;
    padding: 10px 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid var(--line);
    font-weight: 900;
    color: #334155;
    white-space: nowrap
}

.table-wrap {
    width: 100%;
    overflow: auto
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 760px;
    background: white
}

th,
td {
    padding: 13px 12px;
    text-align: center;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: white;
    background: #0f172a;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .05em
}

tbody tr:hover {
    background: #f8fafc
}

td strong {
    display: inline-block;
    min-width: 46px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #ecfeff;
    color: #155e75
}

.admin-form {
    display: grid;
    grid-template-columns: 1.1fr 1.3fr 1.1fr 1fr .8fr .8fr;
    gap: 10px;
    margin: 12px 0 18px
}

.password-field {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 74px !important;
    gap: 8px !important;
    align-items: stretch !important;
    width: 100% !important
}

.password-field input {
    min-width: 0 !important;
    width: 100% !important
}

.password-toggle {
    height: 44px !important;
    border: none !important;
    border-radius: 14px !important;
    background: #0f172a !important;
    color: white !important;
    font-weight: 900 !important;
    cursor: pointer !important;
    padding: 0 12px !important
}

.login-card .password-toggle {
    background: #2563eb !important
}

.password-toggle:hover {
    background: #1e293b !important
}

/* ======== NUEVOS ESTILOS: Exportación y Manual ======== */

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    font-size: 24px;
    display: grid;
    place-items: center;
    background: white;
    border: 1px solid var(--line);
    box-shadow: var(--soft-shadow);
    cursor: pointer;
    transition: transform .18s ease;
}

.btn-icon:hover {
    transform: scale(1.1);
}

/* Menú Administrador */
.admin-menu-container {
    position: relative;
}

.admin-btn {
    position: relative;
}

.admin-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--soft-shadow);
    min-width: 220px;
    overflow: hidden;
    animation: slideDownFade .3s ease forwards;
    z-index: 1000;
}

.admin-menu.hidden {
    display: none;
    animation: slideUpFade .3s ease forwards;
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpFade {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.menu-item {
    width: 100%;
    padding: 14px 16px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--line);
    text-align: left;
    cursor: pointer;
    transition: background .2s ease;
    font-weight: 600;
    color: #0f172a;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: #f8fafc;
}

.menu-item:active {
    background: #f0f4f8;
}

/* Sección Gestión de Usuarios */
.admin-section {
    animation: slideInFade .4s ease forwards;
}

.admin-section.hidden {
    animation: slideOutFade .3s ease forwards;
    display: none;
}

@keyframes slideInFade {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutFade {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-15px);
    }
}

/* ======== BOTONES EXPORTACIÓN ======== */
.export-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.btn-success {
    color: white;
    background: linear-gradient(135deg, #047857, #065f46);
    box-shadow: 0 18px 34px rgba(4, 120, 87, .25);
    padding: 13px 18px;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 900;
    text-decoration: none;
    display: inline-block;
    transition: transform .18s ease, filter .18s ease;
}

.btn-success:hover {
    filter: brightness(1.06);
    transform: translateY(-3px);
}

.btn-info {
    color: white;
    background: linear-gradient(135deg, #0891b2, #0e7490);
    box-shadow: 0 18px 34px rgba(8, 145, 178, .25);
    padding: 13px 18px;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 900;
    text-decoration: none;
    display: inline-block;
    transition: transform .18s ease, filter .18s ease;
}

.btn-info:hover {
    filter: brightness(1.06);
    transform: translateY(-3px);
}

.btn-print {
    color: white;
    background: linear-gradient(135deg, #0f172a, #334155);
    box-shadow: 0 18px 34px rgba(15, 23, 42, .25);
    padding: 13px 18px;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 900;
    text-decoration: none;
    display: inline-block;
    transition: transform .18s ease, filter .18s ease;
}

.btn-print:hover {
    filter: brightness(1.18);
    transform: translateY(-3px);
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 20px;
    animation: fadeIn .3s ease;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 28px;
    padding: 32px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 40px 80px rgba(15, 23, 42, .25);
    position: relative;
    animation: modalSlideIn .4s ease;
}

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

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: 1px solid var(--line);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 20px;
    transition: transform .15s ease;
}

.modal-close:hover {
    transform: scale(1.1);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #0f172a;
    font-size: 26px;
}

.manual-body {
    color: #334155;
    line-height: 1.7;
}

.manual-body h3 {
    color: #0f172a;
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 18px;
}

.manual-body h4 {
    color: #1e293b;
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 700;
}

.manual-body p {
    margin-bottom: 12px;
    color: #334155;
}

.manual-body ol,
.manual-body ul {
    margin: 12px 0 12px 20px;
    padding: 0;
}

.manual-body li {
    margin-bottom: 8px;
}

@media(max-width:1150px) {
    .top-layout {
        grid-template-columns: 1fr
    }

    .upload-column {
        grid-template-columns: 1fr 1fr
    }

    .grid4 {
        grid-template-columns: 1fr 1fr
    }
}

@media(max-width:900px) {
    .app-shell {
        width: min(100% - 24px, 1440px);
        padding-top: 18px
    }

    .hero {
        flex-direction: column
    }

    .hero-card {
        width: 100%
    }

    .upload-column,
    .acciones,
    .admin-form,
    .grid4 {
        grid-template-columns: 1fr
    }

    .result-header {
        flex-direction: column
    }

    .contador {
        white-space: normal
    }

    .top-layout {
        grid-template-columns: 1fr
    }
}

/* =====================================================
   SIDEBAR DESLIZANTE
   ===================================================== */

.hero-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-hamburger {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    font-size: 22px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .3);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
    color: white;
}

.btn-hamburger:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .4);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
    z-index: 1990;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(300px, 88vw);
    background: #fff;
    box-shadow: 6px 0 40px rgba(15, 23, 42, .18);
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform .36s cubic-bezier(.4, 0, .2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.sidebar-header {
    padding: 26px 18px 20px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 0 0 auto;
    gap: 10px;
}

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

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(37, 99, 235, .35);
    display: grid;
    place-items: center;
    font-size: 20px;
    flex: 0 0 auto;
}

.sidebar-title {
    font-weight: 900;
    font-size: 16px;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    margin-top: 2px;
}

.sidebar-close-btn {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    color: white;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 16px;
    transition: background .2s;
    flex: 0 0 auto;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, .22);
}

.sidebar-nav {
    flex: 1;
    padding: 14px 0 20px;
    overflow-y: auto;
}

.sidebar-section-label {
    display: block;
    padding: 10px 20px 5px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #94a3b8;
}

.sidebar-item {
    width: 100%;
    padding: 13px 20px;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #334155;
    font-weight: 600;
    font-size: 14px;
    transition: background .18s, color .18s, border-color .18s;
}

.sidebar-item:hover {
    background: #f1f5f9;
    border-left-color: var(--blue);
    color: var(--blue);
}

.sidebar-item.active {
    background: #eff6ff;
    border-left-color: var(--blue);
    color: var(--blue);
}

.sidebar-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 18px;
    background: #f8fafc;
    flex: 0 0 auto;
    transition: background .18s;
}

.sidebar-item:hover .sidebar-item-icon,
.sidebar-item.active .sidebar-item-icon {
    background: #dbeafe;
}

.sidebar-divider {
    height: 1px;
    background: var(--line);
    margin: 10px 20px;
}

/* =====================================================
   SECCIONES CON TÍTULO Y BOTÓN CERRAR
   ===================================================== */

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-title-row h2 {
    margin: 0;
}

.btn-close-section {
    background: #f8fafc;
    border: 1px solid var(--line);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 15px;
    transition: background .18s, transform .2s;
    color: #64748b;
    flex: 0 0 auto;
}

.btn-close-section:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: rotate(90deg);
}

/* =====================================================
   CONFIGURACIÓN DE COLUMNAS (details/summary)
   ===================================================== */

.columnas-config {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 18px;
    margin-bottom: 18px;
    overflow: hidden;
}

.columnas-config summary {
    padding: 13px 18px;
    cursor: pointer;
    font-weight: 700;
    color: #475569;
    font-size: 14px;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.columnas-config summary::-webkit-details-marker {
    display: none;
}

/* Flecha indicadora en el extremo derecho del summary */
.columnas-config summary::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(-45deg);
    margin-left: auto;
    flex-shrink: 0;
    transition: transform .25s ease, top .25s ease;
    position: relative;
    top: -1px;
}

.columnas-config[open] summary::after {
    transform: rotate(45deg);
    top: -3px;
}

.columnas-config[open] summary {
    border-bottom: 1px solid var(--line);
}

.grid-col-config {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 16px 18px 14px;
}

/* Padding para el grid4 dentro de details.columnas-config (sección Comparar Stock) */
.columnas-config > .grid4 {
    padding: 16px 18px 14px;
}

.grid-col-config input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 14px;
    background: white;
    color: #111827;
    font-size: 13px;
}

/* =====================================================
   RESULTADOS CONTROL DE EXPOSICIÓN
   ===================================================== */

.sin-exposicion-card {
    border-radius: 26px;
    overflow: hidden;
    box-shadow: var(--soft-shadow);
    margin-top: 22px;
}

.sin-exposicion-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.sin-exposicion-header h3 {
    margin: 0 0 4px;
    font-size: 18px;
    letter-spacing: -.02em;
}

/* =====================================================
   RESULTADOS CONTROL DE STOCK — TARJETAS PRIORIDAD
   ===================================================== */

.priority-card {
    border-radius: 26px;
    overflow: hidden;
    box-shadow: var(--soft-shadow);
    margin-top: 20px;
}

.priority-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.priority-card.alta  .priority-header { background: linear-gradient(135deg, #dc2626, #991b1b); color: white; }
.priority-card.media .priority-header { background: linear-gradient(135deg, #d97706, #92400e); color: white; }
.priority-card.baja  .priority-header { background: linear-gradient(135deg, #047857, #065f46); color: white; }

.priority-header h3 {
    margin: 0 0 4px;
    font-size: 17px;
    letter-spacing: -.02em;
}

.priority-sub {
    font-size: 12px;
    opacity: .82;
    font-weight: 500;
    margin: 0;
}

.contador-blanco {
    background: rgba(255, 255, 255, .2) !important;
    border-color: rgba(255, 255, 255, .3) !important;
    color: white !important;
    white-space: nowrap;
}

/* Leyenda de prioridades */
.priority-legend {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 10px 0;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid var(--line);
}

.priority-legend > div {
    display: flex;
    align-items: center;
}

.priority-legend small {
    color: #475569;
    font-weight: 600;
    font-size: 12px;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    flex: 0 0 auto;
}

.legend-dot.alta  { background: #dc2626; }
.legend-dot.media { background: #d97706; }
.legend-dot.baja  { background: #047857; }

/* Resultado vacío */
.empty-result {
    padding: 28px 22px;
    text-align: center;
    color: #64748b;
    font-weight: 600;
    background: white;
    font-size: 15px;
}

@media(max-width:900px) {
    .section-title-row { flex-wrap: wrap; gap: 10px; }
    .grid-col-config   { grid-template-columns: 1fr 1fr; }
    .priority-header   { flex-direction: column; align-items: flex-start; }
    .sin-exposicion-header { flex-direction: column; align-items: flex-start; }
}

/* =====================================================
   PANTALLA DE BIENVENIDA
   ===================================================== */

#welcomeSection {
    padding: 8px 0 26px;
}

.welcome-hint {
    text-align: center;
    color: var(--muted);
    font-size: 15px;
    margin: 0 0 22px;
}

.welcome-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.welcome-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 20px;
    border-radius: 24px;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: transform .22s ease, box-shadow .22s ease;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .12);
    position: relative;
    overflow: hidden;
    color: white;
}

.welcome-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    transition: background .2s;
}

.welcome-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 46px rgba(15, 23, 42, .18);
}

.welcome-card:hover::after {
    background: rgba(255, 255, 255, .06);
}

.welcome-card:active {
    transform: translateY(-2px);
}

.welcome-card-icon {
    font-size: 34px;
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .2);
}

.welcome-card-body {
    flex: 1;
    min-width: 0;
}

.welcome-card-body h3 {
    margin: 0 0 6px;
    font-size: 17px;
    letter-spacing: -.02em;
    color: white;
}

.welcome-card-body p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .82);
}

.welcome-card-arrow {
    font-size: 20px;
    opacity: .55;
    flex: 0 0 auto;
    transition: transform .2s, opacity .2s;
}

.welcome-card:hover .welcome-card-arrow {
    transform: translateX(5px);
    opacity: 1;
}

/* Variantes de color */
.welcome-card.accent-blue   { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.welcome-card.accent-purple { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.welcome-card.accent-green  { background: linear-gradient(135deg, #047857, #065f46); }
.welcome-card.accent-dark   { background: linear-gradient(135deg, #0f172a, #334155); }

@media(max-width:680px) {
    .welcome-grid { grid-template-columns: 1fr; }
    .welcome-card { padding: 18px 16px; }
}