/* ==========================================================================
   PRESTYMAS /ADMIN - SISTEMA EJECUTIVO DE GESTIÓN DE CRÉDITOS Y NÓMINA
   Arquitectura Visual High-End Homologada con Prestymás V2 & Calculadora:
   - Tipografía: 'Plus Jakarta Sans' & 'Inter' con números tabulares financieros
   - Double-Bezel (Doppelrand) Chrome Shell & Tarjetas Ejecutivas
   - Cero desbordamiento horizontal (min-width: 0 en todos los contenedores Grid/Flex)
   - Header de 1 sola línea idéntico a /calculadora y adaptación móvil perfecta
   ========================================================================== */

:root {
    /* Paleta Institucional Exacta Prestymás */
    --color-primary: #20c25c;
    --color-primary-hover: #1aa64e;
    --color-primary-dark: #15803d;
    --color-primary-light: #eaf8f0;
    --color-primary-bg: #eaf8f0;
    --color-primary-border: #a4e6be;

    --color-navy: #032a61;
    --color-navy-deep: #071527;
    --color-navy-dark: #071527;
    --color-navy-card: #0b1e3b;
    --color-navy-border: rgba(255, 255, 255, 0.1);

    /* Escala Slate de Alta Precisión */
    --color-slate-950: #090d16;
    --color-slate-900: #0f172a;
    --color-slate-800: #1e293b;
    --color-slate-700: #334155;
    --color-slate-600: #475569;
    --color-slate-500: #64748b;
    --color-slate-400: #94a3b8;
    --color-slate-300: #cbd5e1;
    --color-slate-200: #e2e8f0;
    --color-slate-100: #f1f5f9;
    --color-slate-50: #f8fafc;

    --color-bg: #f6f8fb;
    --color-card: #ffffff;
    --color-border: #e2e8f0;

    /* Semánticos Financieros */
    --color-danger: #dc2626;
    --color-danger-bg: #fef2f2;
    --color-danger-border: #fecaca;
    --color-warning: #d97706;
    --color-warning-bg: #fffbeb;
    --color-warning-border: #fde68a;
    --color-info: #0284c7;
    --color-info-bg: #f0f9ff;
    --color-info-border: #bae6fd;

    /* Tipografía Oficial */
    --font-family-sans: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-family: var(--font-family-sans);

    /* Curvas Concéntricas (Double-Bezel) */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 26px;
    --radius-full: 9999px;

    /* Sombras Ambientales Difusas (Zero Harsh Shadows) */
    --shadow-xs: 0 1px 2px rgba(7, 21, 39, 0.03);
    --shadow-sm: 0 2px 8px -2px rgba(3, 42, 97, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
    --shadow-card: 0 12px 32px -8px rgba(3, 42, 97, 0.06), 0 2px 6px -1px rgba(3, 42, 97, 0.03);
    --shadow-elevated: 0 24px 48px -12px rgba(7, 21, 39, 0.14), 0 4px 12px -2px rgba(7, 21, 39, 0.05);
    --shadow-navy: 0 20px 40px -12px rgba(7, 21, 39, 0.42);
    --shadow-primary: 0 8px 22px -4px rgba(32, 194, 92, 0.38);

    /* Física de Transición */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   1. RESET Y PREVENCION ABSOLUTA DE DESBORDAMIENTO HORIZONTAL
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
    font-family: var(--font-family-sans);
    color: var(--color-slate-900);
    background-color: var(--color-bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(32, 194, 92, 0.07), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(3, 42, 97, 0.04), transparent);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Regla Crítica Anti-Desborde en CSS Grid y Flexbox */
.chrome-shell-wrapper,
.chrome-workspace-container,
.tab-pane,
.kpi-grid,
.kpi-card,
.dossier-grid-2col,
.section-card,
.data-table-container,
.filters-toolbar,
.form-field {
    min-width: 0;
    max-width: 100%;
}

.container {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 20;
    font-size: 19px;
    line-height: 1;
    vertical-align: middle;
    user-select: none;
    flex-shrink: 0;
}

/* ==========================================================================
   2. TOPBAR INSTITUCIONAL Y HEADER DE 1 SOLA LÍNEA (IDÉNTICO A CALCULADORA)
   ========================================================================== */
.topbar {
    background-color: var(--color-navy-deep);
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-dot {
    width: 7px;
    height: 7px;
    background-color: var(--color-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color-primary);
    flex-shrink: 0;
}

.topbar-left strong,
.topbar-right strong {
    color: #ffffff;
    font-weight: 700;
}

.topbar-contact-trigger {
    color: #34d16e;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.topbar-contact-trigger:hover {
    opacity: 0.85;
    text-decoration: underline;
}

/* Header Sticky Limpio en 1 Sola Fila */
.calculator-header {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 20px -4px rgba(3, 42, 97, 0.04);
}

.header-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: nowrap;
}

.brand-cluster {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.brand-logo-slot {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.brand-img-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}

.brand-divider {
    width: 1px;
    height: 26px;
    background: var(--color-slate-200);
}

.brand-pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    background: var(--color-slate-50);
    border: 1px solid var(--color-slate-200);
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--color-navy);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand-pill-tag .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
}

.header-right-side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.btn-return-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--color-slate-200);
    background: #ffffff;
    color: var(--color-navy);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s var(--ease-out-expo);
    white-space: nowrap;
    cursor: pointer;
}

.btn-return-link:hover {
    border-color: var(--color-primary-border);
    color: var(--color-primary-dark);
    background: var(--color-primary-light);
    transform: translateY(-1px);
}

.session-trigger-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 14px;
    border-radius: var(--radius-full);
    background: var(--color-navy-deep);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s var(--ease-out-expo);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(7, 21, 39, 0.15);
}

.session-trigger-pill:hover {
    background: var(--color-navy);
    transform: translateY(-1px);
}

.session-trigger-pill .session-icon-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(32, 194, 92, 0.22);
    color: #34d16e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Widget de Contacto en Header (Idéntico a Calculadora) */
.header-contact-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 14px 5px 6px;
    border-radius: var(--radius-full);
    transition: all 0.2s var(--ease-out-expo);
    border: 1.5px solid var(--color-slate-200);
    background: #ffffff;
    flex-shrink: 0;
}

.header-contact-widget:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-border);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(32, 194, 92, 0.14);
}

.contact-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--color-primary-light);
    border: 1.5px solid var(--color-primary);
    flex-shrink: 0;
}

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

.contact-info {
    display: flex;
    flex-direction: column;
    text-align: right;
    line-height: 1.15;
}

.contact-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--color-slate-500);
}

.contact-phone-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.wa-icon {
    width: 14px;
    height: 14px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.contact-number {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--color-navy);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.contact-subtitle {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

/* Botón Menú Móvil */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1.5px solid var(--color-slate-200);
    background: #ffffff;
    color: var(--color-navy);
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-drawer {
    display: none;
    background: #ffffff;
    border-bottom: 1px solid var(--color-slate-200);
    padding: 16px 20px;
    box-shadow: var(--shadow-elevated);
}

.mobile-drawer.open {
    display: block;
}

.mobile-drawer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ==========================================================================
   3. CABECERA EJECUTIVA COMPACTA (COMMAND BAR)
   ========================================================================== */
.admin-command-header {
    max-width: 1360px;
    margin: 0 auto;
    padding: 28px 24px 18px;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.command-title-group {
    max-width: 720px;
}

.badge-transparent {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px;
    background: var(--color-primary-light);
    border: 1px solid var(--color-primary-border);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--color-primary-dark);
    letter-spacing: 0.02em;
    margin-bottom: 10px;
}

.calculator-title {
    font-size: clamp(1.6rem, 2.5vw, 2.15rem);
    font-weight: 900;
    color: var(--color-navy);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 6px;
}

.calculator-subtitle {
    font-size: 0.92rem;
    color: var(--color-slate-600);
    font-weight: 500;
    line-height: 1.5;
}

.command-actions-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==========================================================================
   4. DOUBLE-BEZEL CHROME SHELL & PESTANAS (.chrome-tabbar)
   ========================================================================== */
.chrome-shell-wrapper {
    max-width: 1360px;
    margin: 0 auto 48px;
    padding: 0 24px;
    width: 100%;
    flex: 1;
}

/* Outer Shell (Doppelrand / Bandeja Maquinada) */
.chrome-bezel-tray {
    background: rgba(226, 232, 240, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: var(--radius-xl);
    padding: 8px;
    box-shadow: var(--shadow-card);
}

.chrome-tabbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.chrome-tabbar::-webkit-scrollbar {
    display: none;
}

.chrome-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: transparent;
    color: var(--color-slate-600);
    border: 1px solid transparent;
    border-radius: 14px;
    font-family: var(--font-family-sans);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s var(--ease-out-expo);
    white-space: nowrap;
    position: relative;
    min-height: 42px;
    flex-shrink: 0;
}

.chrome-tab:hover {
    background: rgba(255, 255, 255, 0.65);
    color: var(--color-navy);
}

.chrome-tab.active {
    background: #ffffff;
    color: var(--color-navy);
    border-color: rgba(203, 213, 225, 0.85);
    box-shadow: 0 4px 14px -2px rgba(3, 42, 97, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    font-weight: 800;
}

.chrome-tab.active::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 8px rgba(32, 194, 92, 0.6);
}

.chrome-tab .material-symbols-outlined {
    font-size: 18px;
    color: var(--color-slate-500);
    transition: color 0.2s ease;
}

.chrome-tab.active .material-symbols-outlined {
    color: var(--color-primary);
}

.tab-title {
    line-height: 1.2;
}

.tab-badge-count {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    border: 1px solid var(--color-primary-border);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-variant-numeric: tabular-nums;
}

.chrome-tab.active .tab-badge-count {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: var(--color-slate-400);
    margin-left: 4px;
    transition: all 0.15s ease;
}

.tab-close:hover {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

/* Inner Core Workspace */
.chrome-workspace-container {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: calc(var(--radius-xl) - 6px);
    padding: 28px;
    min-height: 68vh;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 24px -4px rgba(3, 42, 97, 0.04);
}

.tab-pane {
    display: none;
    width: 100%;
}

.tab-pane.active {
    display: block;
    animation: workspaceFadeIn 0.28s var(--ease-out-expo);
}

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

/* ==========================================================================
   5. BENTO FINANCIERO DE KPIS (ESTILO SUMMARY PANEL DE /CALCULADORA)
   ========================================================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}

.kpi-card {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
    border: 1px solid var(--color-slate-200);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s var(--ease-out-expo), box-shadow 0.22s var(--ease-out-expo), border-color 0.22s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
    border-color: var(--color-primary-border);
}

.kpi-card.highlight {
    background: radial-gradient(circle at 90% 10%, rgba(32, 194, 92, 0.22) 0%, transparent 55%),
                linear-gradient(145deg, var(--color-navy-deep) 0%, var(--color-navy) 100%);
    color: #ffffff;
    border-color: var(--color-navy);
    box-shadow: var(--shadow-navy);
}

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.kpi-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-slate-500);
    white-space: nowrap;
}

.kpi-card.highlight .kpi-label {
    color: #34d16e;
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--color-primary-light);
    border: 1px solid var(--color-primary-border);
    color: var(--color-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-card.highlight .kpi-icon {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: #34d16e;
}

.kpi-value {
    font-size: clamp(1.5rem, 2.1vw, 1.85rem);
    font-weight: 900;
    color: var(--color-navy);
    letter-spacing: -0.03em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.kpi-card.highlight .kpi-value {
    color: #ffffff;
}

.kpi-sub {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-slate-500);
    padding-top: 8px;
    border-top: 1px solid var(--color-slate-100);
    display: flex;
    align-items: center;
    gap: 6px;
}

.kpi-card.highlight .kpi-sub {
    color: #cbd5e1;
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   6. SECCIONES, CARDS Y TABLAS EJECUTIVAS (CERO RECORTES DE TEXTO)
   ========================================================================== */
.section-card {
    background: #ffffff;
    border: 1px solid var(--color-slate-200);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
}

.section-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-slate-100);
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--color-navy);
    letter-spacing: -0.015em;
}

.section-heading .heading-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.section-heading .material-symbols-outlined {
    color: var(--color-primary-dark);
    font-size: 19px;
}

/* Barra de Filtros Estilo Bandeja */
.filters-toolbar {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 14px;
    margin-bottom: 20px;
    align-items: end;
    background: var(--color-slate-50);
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-slate-200);
}

/* Tablas Financieras de Precisión */
.data-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-slate-200);
    border-radius: var(--radius-md);
    background: #ffffff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    font-variant-numeric: tabular-nums;
}

.data-table th {
    background: #f8fafc;
    color: var(--color-slate-500);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.69rem;
    letter-spacing: 0.06em;
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-slate-200);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-slate-100);
    color: var(--color-slate-800);
    vertical-align: middle;
}

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

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.folio-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Plus Jakarta Sans', monospace;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--color-navy);
    background: var(--color-slate-100);
    border: 1px solid var(--color-slate-300);
    padding: 5px 11px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s var(--ease-out-expo);
    white-space: nowrap;
}

.folio-pill:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
    transform: translateY(-1px);
}

/* Badges de Estado y Acción */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-SOLICITADO {
    background: var(--color-info-bg);
    color: var(--color-info);
    border: 1px solid var(--color-info-border);
}

.status-EN_REVISION {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
}

.status-APROBADO {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.status-ACTIVO {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    border: 1px solid var(--color-primary-border);
}

.status-LIQUIDADO {
    background: var(--color-navy);
    color: #ffffff;
    border: 1px solid var(--color-navy);
}

.status-RECHAZADO,
.status-CANCELADO {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
}

.status-PROGRAMADO {
    background: var(--color-slate-100);
    color: var(--color-slate-600);
    border: 1px solid var(--color-slate-300);
}

.status-DESCONTADO_NOMINA,
.status-LIQUIDADO_ANTICIPADO {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    border: 1px solid var(--color-primary-border);
}

/* ==========================================================================
   7. FORMULARIOS Y BOTONES EJECUTIVOS
   ========================================================================== */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.form-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-slate-700);
}

.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon-wrap > .material-symbols-outlined {
    position: absolute;
    left: 13px;
    color: var(--color-slate-400);
    pointer-events: none;
    font-size: 18px;
}

.styled-input,
.styled-select,
.styled-textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    font-family: var(--font-family-sans);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--color-slate-900);
    background-color: #ffffff;
    border: 1.5px solid var(--color-slate-200);
    border-radius: 10px;
    transition: all 0.2s ease;
    outline: none;
}

.input-icon-wrap .styled-input,
.input-icon-wrap .styled-select {
    padding-left: 40px;
}

.styled-input:focus,
.styled-select:focus,
.styled-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3.5px rgba(32, 194, 92, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 9px 18px;
    font-family: var(--font-family-sans);
    font-size: 0.84rem;
    font-weight: 700;
    border-radius: 10px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.2s var(--ease-out-expo);
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn-sm {
    min-height: 34px;
    padding: 5px 12px;
    font-size: 0.78rem;
    border-radius: 8px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -4px rgba(32, 194, 92, 0.48);
}

.btn-navy {
    background-color: var(--color-navy-deep);
    color: #ffffff;
}

.btn-navy:hover {
    background-color: var(--color-navy);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: #ffffff;
    color: var(--color-slate-700);
    border-color: var(--color-slate-200);
}

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

.btn-danger {
    background-color: var(--color-danger-bg);
    color: var(--color-danger);
    border-color: var(--color-danger-border);
}

.btn-danger:hover {
    background-color: var(--color-danger);
    color: #ffffff;
}

/* ==========================================================================
   8. EXPEDIENTE DETALLADO DE CRÉDITO (DOSSIER EJECUTIVO)
   ========================================================================== */
.dossier-header-banner {
    background: radial-gradient(circle at 90% 20%, rgba(32, 194, 92, 0.22) 0%, transparent 50%),
                linear-gradient(145deg, var(--color-navy-deep) 0%, var(--color-navy) 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-navy);
}

.dossier-title-block h2 {
    color: #ffffff;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 800;
    margin-bottom: 4px;
}

.dossier-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.84rem;
    color: #cbd5e1;
}

.dossier-actions-cluster {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dossier-grid-2col {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 20px;
    margin-bottom: 22px;
}

.info-pairs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 12px;
}

.info-pair-box {
    background: var(--color-slate-50);
    border: 1px solid var(--color-slate-200);
    border-radius: 12px;
    padding: 12px 14px;
}

.info-pair-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-slate-500);
    display: block;
    margin-bottom: 3px;
}

.info-pair-val {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--color-slate-900);
    word-break: break-word;
    font-variant-numeric: tabular-nums;
}

/* Checklist Documental */
.doc-checklist-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.doc-item-card {
    border: 1.5px solid var(--color-slate-200);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: #ffffff;
    transition: all 0.2s ease;
}

.doc-item-card:hover {
    border-color: var(--color-slate-300);
}

.doc-item-card.uploaded {
    border-color: var(--color-primary-border);
    background: linear-gradient(90deg, #f8fefb 0%, #ffffff 100%);
}

.doc-item-info {
    flex: 1;
    min-width: 200px;
}

.doc-item-title {
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--color-slate-900);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.doc-item-desc {
    font-size: 0.76rem;
    color: var(--color-slate-500);
    margin-top: 2px;
}

.doc-ai-note {
    margin-top: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    background: var(--color-primary-light);
    border: 1px solid var(--color-primary-border);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
}

/* Panel Dictamen IA */
.ai-score-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, var(--color-navy-deep) 0%, var(--color-navy) 100%);
    color: #ffffff;
    padding: 18px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.ai-score-circle {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(32, 194, 92, 0.5);
}

.ai-score-circle span {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.ai-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8rem;
    margin-top: 6px;
}

.ai-list li {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.progress-track {
    width: 100%;
    height: 9px;
    background: var(--color-slate-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 6px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, #34d16e 100%);
    border-radius: var(--radius-full);
    transition: width 0.35s var(--ease-out-expo);
}

/* ==========================================================================
   9. MODALES Y HOJAS OFICIALES IMPRIMIBLES PDF
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 21, 39, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 680px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-elevated);
    border: 1px solid var(--color-slate-200);
}

.modal-card.modal-wide {
    max-width: 880px;
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 10;
}

.modal-body {
    padding: 22px 24px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.modal-sheet-content-wrap {
    padding: 24px;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #cbd5e1;
    display: flex;
    justify-content: center;
}

.printable-sheet {
    background: #ffffff;
    color: #0f172a;
    width: 100%;
    max-width: 780px;
    min-width: 720px;
    margin: 0 auto;
    padding: 24px 28px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
}

.print-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--color-primary);
    padding-bottom: 14px;
    margin-bottom: 16px;
    gap: 14px;
}

.print-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
}

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

.print-title-center h1 {
    font-size: 17px;
    font-weight: 900;
    color: var(--color-navy);
    letter-spacing: 0.02em;
}

.print-title-center p {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--color-primary-dark);
    text-transform: uppercase;
    margin-top: 2px;
}

.print-folio-box {
    text-align: right;
    background: var(--color-primary-light);
    border: 1.5px solid var(--color-primary-border);
    padding: 6px 12px;
    border-radius: 8px;
}

.print-folio-box span {
    display: block;
    font-size: 9px;
    font-weight: 800;
    color: var(--color-slate-500);
    text-transform: uppercase;
}

.print-folio-box strong {
    font-size: 13px;
    font-weight: 900;
    color: var(--color-navy);
    font-family: 'Plus Jakarta Sans', monospace;
}

.print-section-bar {
    background: #20c25c;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    margin: 14px 0 10px;
    border-radius: 4px;
    text-align: center;
}

.print-summary-boxes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.print-stat-cell {
    border: 1px solid #94a3b8;
    border-radius: 6px;
    padding: 8px 10px;
    background: #f8fafc;
}

.print-stat-cell.highlight {
    background: #eaf8f0;
    border-color: #20c25c;
}

.print-stat-cell span {
    display: block;
    font-size: 9px;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
}

.print-stat-cell strong {
    font-size: 12.5px;
    font-weight: 900;
    color: #0f172a;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    margin-top: 6px;
}

.print-table th {
    background: #20c25c;
    color: #ffffff;
    font-weight: 800;
    padding: 6px 8px;
    text-align: left;
    border: 1px solid #16a34a;
}

.print-table td {
    padding: 5px 8px;
    border: 1px solid #cbd5e1;
}

.print-table tr:nth-child(even) {
    background: #f8fafc;
}

.print-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 32px;
    padding-top: 16px;
    text-align: center;
}

.print-sig-line {
    border-top: 1.5px solid #0f172a;
    margin-top: 36px;
    padding-top: 6px;
    font-size: 10.5px;
    font-weight: 700;
    color: #334155;
}

/* ==========================================================================
   10. FOOTER OFICIAL Y MODAL DE CONTACTO
   ========================================================================== */
.footer {
    background-color: var(--color-navy-deep);
    color: #94a3b8;
    padding: 44px 0 26px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-logo-img {
    height: 42px;
    width: auto;
    background: #ffffff;
    padding: 6px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 0.84rem;
    line-height: 1.6;
    color: #94a3b8;
    max-width: 400px;
}

.footer-links h4 {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.84rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.78rem;
    color: #64748b;
}

.contact-choice-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 21, 39, 0.72);
    backdrop-filter: blur(5px);
    z-index: 2200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.contact-choice-overlay.active {
    display: flex;
}

.contact-choice-card {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    border-radius: 22px;
    padding: 28px 24px;
    box-shadow: var(--shadow-elevated);
    text-align: center;
    position: relative;
    border: 1px solid var(--color-slate-200);
}

.contact-choice-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--color-slate-200);
    background: var(--color-slate-50);
    color: var(--color-slate-600);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-choice-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 12px;
    padding: 3px;
    background: linear-gradient(135deg, var(--color-primary), #159a46);
}

.contact-choice-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background: #fff;
}

.contact-choice-badge {
    display: inline-block;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.contact-choice-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-navy);
    margin-bottom: 6px;
}

.contact-choice-desc {
    font-size: 0.84rem;
    color: var(--color-slate-600);
    margin-bottom: 20px;
}

.contact-choice-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-choice-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 14px;
    text-decoration: none;
    text-align: left;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
}

.contact-choice-btn.whatsapp {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: var(--shadow-primary);
}

.contact-choice-btn.call {
    background: var(--color-slate-50);
    color: var(--color-navy);
    border-color: var(--color-slate-300);
}

.contact-choice-btn strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 800;
}

.contact-choice-btn span {
    display: block;
    font-size: 0.76rem;
    opacity: 0.9;
}

.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--color-navy-deep);
    color: #ffffff;
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-elevated);
    border-left: 4px solid var(--color-primary);
    font-size: 0.84rem;
    font-weight: 700;
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 2500;
    max-width: calc(100vw - 32px);
}

.toast-notification.show {
    display: inline-flex;
}

/* ==========================================================================
   11. RESPONSIVE MOBILE-FIRST SIN DESBORDES
   ========================================================================== */
@media (max-width: 1120px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dossier-grid-2col {
        grid-template-columns: 1fr;
    }
    .filters-toolbar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .brand-divider,
    .brand-pill-tag {
        display: none;
    }
    .header-right-side .btn-return-link,
    .header-right-side .session-trigger-pill {
        display: none;
    }
    .mobile-menu-toggle {
        display: inline-flex;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 640px) {
    .topbar {
        font-size: 0.7rem;
    }
    .topbar-content {
        flex-direction: column;
        gap: 2px;
        text-align: center;
    }
    .header-container {
        padding: 10px 14px;
    }
    .brand-img-logo {
        height: 32px;
    }
    .contact-title,
    .contact-subtitle {
        display: none;
    }
    .header-contact-widget {
        padding: 4px 10px 4px 4px;
        gap: 6px;
    }
    .contact-avatar {
        width: 30px;
        height: 30px;
    }
    .contact-number {
        font-size: 0.78rem;
    }

    .admin-command-header {
        padding: 18px 14px 12px;
        flex-direction: column;
        align-items: stretch;
    }
    .command-actions-group {
        width: 100%;
    }
    .command-actions-group .btn {
        width: 100%;
    }

    .chrome-shell-wrapper {
        padding: 0 10px;
        margin-bottom: 32px;
    }
    .chrome-bezel-tray {
        padding: 5px;
        border-radius: 18px;
    }
    .chrome-workspace-container {
        padding: 14px 12px;
        border-radius: 14px;
    }
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .filters-toolbar {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    .styled-input,
    .styled-select,
    .styled-textarea {
        font-size: 16px;
    }
    .section-card {
        padding: 16px 14px;
    }
    .section-header-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .section-header-bar .btn {
        width: 100%;
    }
    .dossier-header-banner {
        padding: 18px 16px;
    }
    .dossier-actions-cluster {
        width: 100%;
        flex-direction: column;
    }
    .dossier-actions-cluster .btn {
        width: 100%;
    }
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media print {
    .no-print {
        display: none !important;
    }
    body {
        background: #ffffff !important;
    }
}
