/* ═══════════════════════════════════════════════════════════
   IAFISCAL ERP - DISEÑO PROFESIONAL PARA ASESORÍAS
   Colores: Azul corporativo, grises, blancos
   ═══════════════════════════════════════════════════════════ */

:root {
    /* PALETA CORPORATIVA IAFISCAL - NO MODIFICAR */
    --primary: #2c5282;           /* Azul principal - cabeceras, botones */
    --primary-dark: #2c5282;      /* Azul oscuro - hover profundo */
    --primary-hover: #1e3a5f;     /* Azul secundario - hover, acentos */
    --primary-light: #e8f0f8;     /* Azul claro - fondos tarjetas, highlights */

    /* Grises corporativos */
    --text-primary: #2d3748;      /* Gris oscuro - texto principal */
    --text-secondary: #718096;    /* Gris medio - texto secundario, bordes */
    --border-color: #e2e8f0;      /* Gris claro - separadores, fondos alternos */
    --bg-main: #f8f9fa;           /* Blanco roto - fondo general */
    --bg-card: #ffffff;           /* Blanco puro - tarjetas */
    --bg-alt: #f1f5f9;            /* Fondo alternativo */

    /* Estados - SOLO para su proposito especifico */
    --success: #38a169;           /* Verde - SOLO confirmaciones */
    --error: #c53030;             /* Rojo - SOLO errores/urgente */
    --warning: #d69e2e;           /* Amarillo - SOLO warnings */

    /* Grises escala */
    --gray-50: #f8f9fa;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --gray-900: #171923;

    /* Sombras sutiles */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);

    /* Bordes */
    --border-radius-sm: 4px;
    --border-radius-md: 6px;
    --border-radius-lg: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: var(--gray-900);
    background: var(--gray-50);
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════ */

.layout-pro {
    display: flex;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR PROFESIONAL
   ═══════════════════════════════════════════════════════════ */

.sidebar-pro {
    width: 260px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.sidebar-pro-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(44, 82, 130, 0.2);
}

.sidebar-pro-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
}

.sidebar-pro-header .subtitle {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    margin-top: 0.25rem;
}

/* Navegación */
.nav-pro {
    flex: 1;
    padding: 1rem 0.75rem;
}

.nav-group-pro {
    margin-bottom: 1.5rem;
}

.nav-group-title-pro {
    font-size: 0.6875rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    padding: 0 0.75rem;
}

.nav-link-pro {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.nav-link-pro:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-link-pro.active {
    background: var(--primary);
    color: white;
}

.nav-link-pro svg {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

/* Badge NUEVO */
.badge-nuevo {
    background: #ef4444;
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════ */

.main-pro {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    background: var(--gray-50);
}

/* Header */
.header-pro {
    margin-bottom: 2rem;
}

.header-pro h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.header-pro .subtitle {
    color: var(--gray-500);
    font-size: 0.9375rem;
}

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */

.card-pro {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-pro-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.card-pro-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* ═══════════════════════════════════════════════════════════
   BOTONES
   ═══════════════════════════════════════════════════════════ */

.btn-pro {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-pro-primary,
.btn-pro-primary:link,
.btn-pro-primary:visited,
a.btn-pro-primary {
    background: var(--primary) !important;
    color: #ffffff !important;
}

.btn-pro-primary:hover,
a.btn-pro-primary:hover {
    background: var(--primary-hover) !important;
    color: #ffffff !important;
}

.btn-pro-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-pro-secondary:hover {
    background: var(--gray-300);
}

/* ═══════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════ */

.form-control-pro {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-control-pro:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ═══════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════ */

.table-pro {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table-pro thead {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}

.table-pro th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-pro td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

.table-pro tbody tr:hover {
    background: var(--gray-50);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .sidebar-pro {
        width: 100%;
        position: relative;
        height: auto;
    }

    .main-pro {
        margin-left: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   COMPONENTES ADICIONALES - SISTEMA UNIFICADO
   ═══════════════════════════════════════════════════════════ */

/* ALERTAS */
.alert-pro {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-pro-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.alert-pro-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.alert-pro-warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.alert-pro-info {
    background: var(--primary-light);
    border: 1px solid #93c5fd;
    color: var(--primary);
}

/* BADGES / ETIQUETAS */
.badge-pro {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-pro-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-pro-success {
    background: #dcfce7;
    color: #166534;
}

.badge-pro-error {
    background: #fee2e2;
    color: #991b1b;
}

.badge-pro-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-pro-gray {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* STATS CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card-icon-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-card-icon-success {
    background: #dcfce7;
    color: var(--success);
}

.stat-card-icon-warning {
    background: #fef3c7;
    color: var(--warning);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-card-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-card-change-up {
    color: var(--success);
}

.stat-card-change-down {
    color: var(--error);
}

/* TABS */
.tabs-pro {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 1.5rem;
}

.tab-pro {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.tab-pro:hover {
    color: var(--primary);
}

.tab-pro.active {
    color: var(--primary);
}

.tab-pro.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

/* PROGRESS BAR */
.progress-pro {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-pro-bar {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.progress-pro-bar-primary {
    background: var(--primary);
}

.progress-pro-bar-success {
    background: var(--success);
}

.progress-pro-bar-warning {
    background: var(--warning);
}

/* DROPDOWNS */
.dropdown-pro {
    position: relative;
    display: inline-block;
}

.dropdown-pro-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 200px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    display: none;
}

.dropdown-pro-menu.show {
    display: block;
}

.dropdown-pro-item {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-pro-item:hover {
    background: var(--gray-100);
    color: var(--primary);
}

/* MODAL */
.modal-pro-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
}

.modal-pro-backdrop.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-pro {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.modal-pro-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-pro-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-pro-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
}

.modal-pro-close:hover {
    color: var(--gray-600);
}

.modal-pro-body {
    padding: 1.5rem;
}

.modal-pro-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* FORM GROUPS */
.form-group-pro {
    margin-bottom: 1.25rem;
}

.form-label-pro {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-label-pro .required {
    color: var(--error);
}

.form-hint-pro {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
}

.form-error-pro {
    font-size: 0.75rem;
    color: var(--error);
    margin-top: 0.375rem;
}

.form-control-pro.is-error {
    border-color: var(--error);
}

.form-control-pro.is-error:focus {
    box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.1);
}

/* SELECT MEJORADO */
.select-pro {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* CHECKBOX Y RADIO */
.checkbox-pro,
.radio-pro {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-pro input,
.radio-pro input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* TEXTAREA */
.textarea-pro {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-md);
    font-size: 0.875rem;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.textarea-pro:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* LISTAS */
.list-pro {
    list-style: none;
}

.list-pro-item {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.list-pro-item:hover {
    background: var(--gray-50);
}

/* AVATAR */
.avatar-pro {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.avatar-pro-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.avatar-pro-lg {
    width: 56px;
    height: 56px;
    font-size: 1.125rem;
}

.avatar-pro-primary {
    background: var(--primary-light);
    color: var(--primary);
}

/* TOOLTIPS */
.tooltip-pro {
    position: relative;
}

.tooltip-pro::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.375rem 0.75rem;
    background: var(--gray-800);
    color: white;
    font-size: 0.75rem;
    border-radius: var(--border-radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.tooltip-pro:hover::after {
    opacity: 1;
    visibility: visible;
}

/* LOADING / SPINNER */
.spinner-pro {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--gray-400);
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* BREADCRUMBS */
.breadcrumb-pro {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.breadcrumb-pro-item {
    color: var(--gray-500);
    text-decoration: none;
}

.breadcrumb-pro-item:hover {
    color: var(--primary);
}

.breadcrumb-pro-item.active {
    color: var(--gray-700);
    font-weight: 500;
}

.breadcrumb-pro-separator {
    color: var(--gray-400);
}

/* PAGINATION */
.pagination-pro {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-pro-item {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    color: var(--gray-700);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.pagination-pro-item:hover {
    background: var(--gray-100);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-pro-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination-pro-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* GRID UTILS */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* FLEX UTILS */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* SPACING UTILS */
.m-0 { margin: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

/* TEXT UTILS */
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-gray { color: var(--gray-500); }
.text-dark { color: var(--gray-700); }

/* BG UTILS */
.bg-white { background: white; }
.bg-gray { background: var(--gray-100); }
.bg-primary-light { background: var(--primary-light); }

/* BORDER UTILS */
.border { border: 1px solid var(--gray-200); }
.border-t { border-top: 1px solid var(--gray-200); }
.border-b { border-bottom: 1px solid var(--gray-200); }
.rounded { border-radius: var(--border-radius-md); }
.rounded-lg { border-radius: var(--border-radius-lg); }

/* SHADOW UTILS */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* VISIBILITY */
.hidden { display: none; }
.visible { display: block; }

/* CURSOR */
.cursor-pointer { cursor: pointer; }

/* ═══════════════════════════════════════════════════════════
   ESTILOS GLOBALES PROFESIONALES - PRIORIDAD ALTA
   Asegura diseño limpio en TODA la aplicacion
   ═══════════════════════════════════════════════════════════ */

/* FONDOS - Solo blanco roto, nunca oscuros */
body,
.bg-dark,
.bg-primary,
.bg-secondary {
    background: #f8f9fa !important;
    color: #2d3748 !important;
}

/* EXCEPCIONES: Headers y navbars SI son azules */
.navbar,
.navbar-dark,
nav.navbar,
.top-bar,
.header-bar,
.sidebar,
.sidebar-pro {
    background: #1e3a5f !important;
    color: white !important;
}

.navbar a,
.navbar .nav-link,
.navbar .navbar-brand,
.top-bar a,
.sidebar a {
    color: white !important;
}

/* TARJETAS - Siempre blancas con borde gris */
.card,
.module-card,
.stat-card,
.panel,
.box,
.widget {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
}

.card:hover,
.module-card:hover {
    border-color: #2c5282 !important;
    box-shadow: 0 4px 12px rgba(30,58,95,0.12) !important;
}

/* CARD HEADERS - Azul corporativo */
.card-header {
    background: #1e3a5f !important;
    color: white !important;
    border-bottom: none !important;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
    color: white !important;
}

/* TEXTOS */
h1, h2, h3, h4, h5, h6,
.title,
.heading {
    color: #2d3748 !important;
}

.text-muted,
.text-secondary,
small,
.description {
    color: #718096 !important;
}

/* ICONOS - Solo azul corporativo */
.module-icon,
.stat-icon,
.card-icon,
.icon,
.fa,
.fas,
.far,
.fab {
    color: #1e3a5f;
}

/* Iconos dentro de headers/navbars SI son blancos */
.navbar .fa,
.navbar .fas,
.top-bar .fa,
.top-bar .fas,
.card-header .fa,
.card-header .fas,
.sidebar .fa,
.sidebar .fas {
    color: white !important;
}

/* BOTONES */
.btn-primary {
    background: #1e3a5f !important;
    border-color: #1e3a5f !important;
    color: white !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background: #2c5282 !important;
    border-color: #2c5282 !important;
}

.btn-secondary,
.btn-outline-primary {
    background: white !important;
    border: 1px solid #1e3a5f !important;
    color: #1e3a5f !important;
}

.btn-secondary:hover,
.btn-outline-primary:hover {
    background: #e8f0f8 !important;
}

.btn-danger {
    background: #c53030 !important;
    border-color: #c53030 !important;
    color: white !important;
}

.btn-success {
    background: #38a169 !important;
    border-color: #38a169 !important;
    color: white !important;
}

/* TABLAS */
.table {
    background: white !important;
}

.table thead th {
    background: #f1f5f9 !important;
    color: #2d3748 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

.table tbody tr:hover {
    background: #f8f9fa !important;
}

/* FORMULARIOS */
.form-control,
.form-select,
input,
select,
textarea {
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    color: #2d3748 !important;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: #2c5282 !important;
    box-shadow: 0 0 0 3px rgba(44,82,130,0.1) !important;
}

/* ALERTAS */
.alert-info {
    background: #e8f0f8 !important;
    border-color: #93c5fd !important;
    color: #1e3a5f !important;
}

.alert-success {
    background: #f0fdf4 !important;
    border-color: #86efac !important;
    color: #166534 !important;
}

.alert-warning {
    background: #fffbeb !important;
    border-color: #fcd34d !important;
    color: #92400e !important;
}

.alert-danger {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #991b1b !important;
}

/* ELIMINAR DEGRADADOS Y EFECTOS NO PROFESIONALES */
*:not(.navbar):not(.sidebar):not(.sidebar-pro):not(.top-bar) {
    background-image: none !important;
}

/* BADGES */
.badge {
    font-weight: 500 !important;
}

.badge-primary,
.bg-primary.badge {
    background: #1e3a5f !important;
}

/* LINKS */
a {
    color: #1e3a5f;
}

a:hover {
    color: #2c5282;
}

/* Excepción: botones deben tener texto blanco */
a.btn-pro-primary,
a.btn-pro-primary:link,
a.btn-pro-primary:visited,
a.btn-pro-primary:hover,
a.btn-pro-primary:active {
    color: #ffffff !important;
}

/* MODALES */
.modal-content {
    background: white !important;
    border: 1px solid #e2e8f0 !important;
}

.modal-header {
    background: #1e3a5f !important;
    color: white !important;
    border-bottom: none !important;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* DROPDOWNS */
.dropdown-menu {
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.dropdown-item:hover {
    background: #f1f5f9 !important;
}

/* PAGINATION */
.page-link {
    color: #1e3a5f !important;
    background: white !important;
    border-color: #e2e8f0 !important;
}

.page-item.active .page-link {
    background: #1e3a5f !important;
    border-color: #1e3a5f !important;
    color: white !important;
}

/* PROGRESS BARS */
.progress {
    background: #e2e8f0 !important;
}

.progress-bar {
    background: #1e3a5f !important;
}

/* BREADCRUMBS */
.breadcrumb {
    background: transparent !important;
}

.breadcrumb-item a {
    color: #1e3a5f !important;
}

.breadcrumb-item.active {
    color: #718096 !important;
}

/* ═══════════════════════════════════════════════════════════
   REGLAS CRITICAS DE CONTRASTE - PRIORIDAD MAXIMA
   REGLA DE ORO:
   - Fondo claro = texto oscuro (#2d3748)
   - Fondo oscuro = texto blanco
   ═══════════════════════════════════════════════════════════ */

/* FORZAR CONTRASTE EN TODO TEXTO SOBRE FONDO CLARO */
body,
.container,
.container-fluid,
main,
section,
article,
div:not(.navbar):not(.sidebar):not(.sidebar-pro):not(.card-header):not(.modal-header):not(.btn):not(.badge):not(.alert) {
    color: #2d3748;
}

/* Texto en tarjetas y contenido principal */
.card-body,
.card-body *:not(.btn):not(.badge):not(.alert),
.card-text,
.card-title:not(.card-header .card-title),
.module-card p,
.module-card span,
.widget-body,
.panel-body {
    color: #2d3748 !important;
}

/* Titulos siempre oscuros fuera de headers */
.card-body h1, .card-body h2, .card-body h3, .card-body h4, .card-body h5, .card-body h6,
.module-title,
.widget-title {
    color: #2d3748 !important;
}

/* ICONOS - Siempre azul corporativo, NUNCA cyan/turquesa */
i.fa, i.fas, i.far, i.fab, i.fal, i.fad,
.icon,
svg.icon,
[class*="icon"] {
    color: #1e3a5f !important;
}

/* Excepcion: iconos en fondos oscuros */
.navbar i, .navbar .fa, .navbar .fas,
.sidebar i, .sidebar .fa, .sidebar .fas,
.sidebar-pro i, .sidebar-pro .fa, .sidebar-pro .fas,
.card-header i, .card-header .fa, .card-header .fas,
.modal-header i, .modal-header .fa, .modal-header .fas,
.btn-primary i, .btn-primary .fa, .btn-primary .fas,
.btn-danger i, .btn-danger .fa, .btn-danger .fas,
.btn-success i, .btn-success .fa, .btn-success .fas,
.bg-primary i, .bg-primary .fa, .bg-primary .fas,
[style*="background: #1e3a5f"] i,
[style*="background:#1e3a5f"] i {
    color: white !important;
}

/* SIDEBAR PRO - Asegurar texto blanco en fondo oscuro */
.sidebar-pro,
.sidebar-pro *,
.sidebar-pro .nav-link-pro,
.sidebar-pro .nav-link-pro span,
.sidebar-pro .nav-group-title-pro,
.sidebar-pro a,
.sidebar-pro h2,
.sidebar-pro .subtitle {
    color: rgba(255,255,255,0.9) !important;
}

.sidebar-pro .nav-link-pro:hover,
.sidebar-pro .nav-link-pro:hover span {
    color: white !important;
}

.sidebar-pro svg,
.sidebar-pro .nav-link-pro svg {
    stroke: rgba(255,255,255,0.8) !important;
    color: rgba(255,255,255,0.8) !important;
}

.sidebar-pro .nav-group-title-pro {
    color: rgba(255,255,255,0.5) !important;
}

/* ELIMINAR TODOS LOS COLORES CYAN/TURQUESA */
[style*="color: #2c5282"],
[style*="color:#2c5282"],
[style*="color: #5de2e7"],
[style*="color:#5de2e7"],
[style*="color: cyan"],
[style*="color: turquoise"],
.text-cyan,
.text-turquoise,
.text-info:not(.alert-info) {
    color: #1e3a5f !important;
}

/* BOTONES - Asegurar visibilidad del texto */
.btn, button {
    font-weight: 500;
}

.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #1e3a5f !important;
    border-color: #1e3a5f !important;
    color: white !important;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-light,
.btn-default {
    background-color: white !important;
    color: #1e3a5f !important;
    border-color: #1e3a5f !important;
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover {
    background-color: #e8f0f8 !important;
    color: #1e3a5f !important;
}

/* LISTAS Y SELECTS */
.list-group-item,
.dropdown-item,
select option {
    color: #2d3748 !important;
    background-color: white !important;
}

.list-group-item:hover,
.dropdown-item:hover {
    background-color: #f1f5f9 !important;
}

/* EMPRESA SELECTOR / NOMBRES */
.empresa-nombre,
.empresa-name,
.company-name,
.client-name,
.nombre-empresa,
.select-empresa option,
#empresa_selector option,
select[name="empresa"] option,
select[name="empresa_id"] option {
    color: #2d3748 !important;
    font-weight: 500;
}

/* INPUTS PLACEHOLDER */
input::placeholder,
textarea::placeholder,
select::placeholder {
    color: #a0aec0 !important;
}

/* TABLAS - Texto siempre visible */
.table td,
.table th,
table td,
table th,
.table-responsive td,
.table-responsive th {
    color: #2d3748 !important;
}

.table thead th,
table thead th {
    color: #2d3748 !important;
    background-color: #f1f5f9 !important;
}

/* ELIMINAR EFECTOS BLUR */
*:not(.modal-backdrop) {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* METRIC VALUES - Numeros grandes siempre visibles */
.metric-value,
.stat-value,
.stat-number,
.big-number,
.counter,
.count {
    color: #1e3a5f !important;
    font-weight: 700;
}

/* LABELS Y CAPTIONS */
label,
.form-label,
.label,
caption,
figcaption {
    color: #2d3748 !important;
}

/* TEXTO SECUNDARIO */
.text-muted,
.text-secondary,
.small,
small,
.caption,
.subtitle,
.subheading {
    color: #718096 !important;
}

/* LINKS SIEMPRE AZUL CORPORATIVO */
a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item):not(.brand):not(.list-group-item):not(.sidebar-heading a) {
    color: #1e3a5f !important;
}

a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item):not(.brand):hover {
    color: #2c5282 !important;
}

/* NAVEGACION EN NAVBAR BLANCA */
.navbar-light .nav-link,
.navbar-light .navbar-brand {
    color: #2d3748 !important;
}

/* CARDS CON ICONOS GRANDES */
.module-card .module-icon,
.stat-card .stat-icon,
.feature-icon {
    color: #1e3a5f !important;
    background-color: #e8f0f8 !important;
}

/* TABS Y NAV-PILLS */
.nav-tabs .nav-link,
.nav-pills .nav-link {
    color: #2d3748 !important;
}

.nav-tabs .nav-link.active,
.nav-pills .nav-link.active {
    color: white !important;
    background-color: #1e3a5f !important;
}

/* FOOTERS */
footer,
.footer {
    background-color: #1e3a5f !important;
    color: white !important;
}

footer a,
.footer a {
    color: white !important;
}

/* TOOLTIPS */
.tooltip-inner {
    background-color: #1e3a5f !important;
    color: white !important;
}

/* POPOVERS */
.popover-header {
    background-color: #1e3a5f !important;
    color: white !important;
}

.popover-body {
    color: #2d3748 !important;
}

/* ACCORDION */
.accordion-button {
    color: #2d3748 !important;
    background-color: white !important;
}

.accordion-button:not(.collapsed) {
    color: #1e3a5f !important;
    background-color: #e8f0f8 !important;
}

/* OFFCANVAS */
.offcanvas-header {
    background-color: #1e3a5f !important;
    color: white !important;
}

.offcanvas-body {
    color: #2d3748 !important;
}

/* ═══════════════════════════════════════════════════════════
   CORRECCIÓN GLOBAL - TEXTOS EN TARJETAS Y BOTONES
   ═══════════════════════════════════════════════════════════ */

/* Títulos de tarjetas - SIEMPRE texto oscuro */
.card-title,
.card h5,
.card h4,
.card h3,
.card h2,
.card-header h5,
.card-header h4,
.card-header h3 {
    color: #2d3748 !important;
}

/* Texto en card-body */
.card-body,
.card-body p,
.card-body span,
.card-body label {
    color: #2d3748 !important;
}

/* Headers con fondo oscuro - texto blanco */
.card-header {
    background-color: #1e3a5f !important;
    color: white !important;
}

.card-header h5,
.card-header h4,
.card-header h3,
.card-header .card-title {
    color: white !important;
}

/* Botones - asegurar visibilidad */
.btn {
    color: #2d3748 !important;
}

.btn-primary {
    background-color: #1e3a5f !important;
    border-color: #1e3a5f !important;
    color: white !important;
}

.btn-primary:hover {
    background-color: #2c5282 !important;
    border-color: #2c5282 !important;
    color: white !important;
}

.btn-outline-primary {
    background-color: transparent !important;
    border-color: #1e3a5f !important;
    color: #1e3a5f !important;
}

.btn-outline-primary:hover {
    background-color: #1e3a5f !important;
    color: white !important;
}

.btn-success {
    background-color: #38a169 !important;
    border-color: #38a169 !important;
    color: white !important;
}

.btn-danger {
    background-color: #c53030 !important;
    border-color: #c53030 !important;
    color: white !important;
}

.btn-warning {
    background-color: #d69e2e !important;
    border-color: #d69e2e !important;
    color: white !important;
}

.btn-secondary {
    background-color: #718096 !important;
    border-color: #718096 !important;
    color: white !important;
}

.btn-outline-secondary {
    background-color: transparent !important;
    border-color: #718096 !important;
    color: #718096 !important;
}

.btn-outline-secondary:hover {
    background-color: #718096 !important;
    color: white !important;
}

.btn-light {
    background-color: #f8f9fa !important;
    border-color: #e2e8f0 !important;
    color: #2d3748 !important;
}

/* Links en tarjetas */
.card a:not(.btn) {
    color: #1e3a5f !important;
}

.card a:not(.btn):hover {
    color: #2c5282 !important;
}

/* Brand en top-bar siempre blanco */
.top-bar .brand,
.top-bar a.brand {
    color: #ffffff !important;
}

/* Todo el texto en top-bar debe ser blanco */
.top-bar,
.top-bar a,
.top-bar span,
.top-bar .user-info,
.top-bar .btn-logout {
    color: #ffffff !important;
}

/* FIX: Texto blanco en headers con fondo oscuro */
.sidebar-heading,
.sidebar-heading *,
.sidebar-heading a,
.sidebar-heading strong,
.sidebar-heading small,
.sidebar-heading i {
    color: white !important;
}

/* FIX: Navbar con fondo claro - texto oscuro */
.navbar.navbar-light,
.navbar.navbar-light .nav-link,
.navbar.navbar-light .navbar-text {
    color: #2d3748 !important;
}

/* FIX: Top-bar siempre texto blanco */
.top-bar *,
.top-bar a,
.top-bar span,
.top-bar i {
    color: white !important;
}

/* FIX: base_layout.html - Sidebar y Topbar */
.sidebar {
    background: #1e3a5f !important;
}

.sidebar-logo,
.sidebar-logo *,
.sidebar-menu,
.sidebar-menu *,
.sidebar .menu-item,
.sidebar .menu-item span,
.sidebar .menu-item i,
.sidebar .menu-section-title,
.sidebar a,
.sidebar span {
    color: white !important;
}

.sidebar .menu-item:hover {
    background: rgba(255,255,255,0.1) !important;
}

.sidebar .menu-item.active {
    background: rgba(255,255,255,0.2) !important;
}

.topbar {
    background: #1e3a5f !important;
}

.topbar,
.topbar *,
.topbar h5,
.topbar span,
.topbar a,
.topbar i {
    color: white !important;
}

.topbar .btn-outline-danger {
    border-color: white !important;
    color: white !important;
}

.topbar .btn-outline-danger:hover {
    background: rgba(255,255,255,0.2) !important;
}

/* FIX: base_asesor.html - Navbar y Sidebar */
.navbar-asesor {
    background: #1e3a5f !important;
}

.navbar-asesor,
.navbar-asesor *,
.navbar-asesor .navbar-brand,
.navbar-asesor .nav-link,
.navbar-asesor a,
.navbar-asesor span,
.navbar-asesor i {
    color: white !important;
}

.sidebar-section-title {
    color: rgba(255,255,255,0.7) !important;
}

.sidebar-link,
.sidebar-link span,
.sidebar-link i {
    color: rgba(255,255,255,0.9) !important;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255,255,255,0.1) !important;
    color: white !important;
}

/* FIX: Dropdown menu - texto visible */
.dropdown-menu {
    background: white !important;
}

.dropdown-menu .dropdown-item {
    color: #2d3748 !important;
    background: white !important;
}

.dropdown-menu .dropdown-item:hover {
    background: #f1f5f9 !important;
    color: #1e3a5f !important;
}

/* FIX: Navbar links en fondo claro */
.navbar-light .nav-link,
.navbar .nav-link {
    color: #2d3748 !important;
}

/* FIX: Sidebar heading - texto blanco */
#sidebar-wrapper .sidebar-heading,
#sidebar-wrapper .sidebar-heading a,
#sidebar-wrapper .sidebar-heading strong,
#sidebar-wrapper .sidebar-heading small,
#sidebar-wrapper .sidebar-heading i {
    color: white !important;
}

/* === FIX BOTONES CATEGORIA MODELOS === */
.cat-btn.activo,
.cat-btn.activo:link,
.cat-btn.activo:visited,
.cat-btn.activo:hover,
.cat-btn.activo:active,
a.cat-btn.activo,
a.cat-btn.activo:link,
a.cat-btn.activo:visited {
    background: #2c5282 !important;
    border-color: #1e3a5f !important;
    color: #ffffff !important;
}

.cat-btn.activo *,
.cat-btn.activo i,
a.cat-btn.activo *,
a.cat-btn.activo i {
    color: #ffffff !important;
}

.btn-primario,
.btn-primario:link,
.btn-primario:visited,
.btn-primario:hover,
.btn-primario:active,
a.btn-primario,
a.btn-primario:link,
a.btn-primario:visited {
    background: #2c5282 !important;
    color: #ffffff !important;
    border: none !important;
}

.btn-primario:hover,
a.btn-primario:hover {
    background: #1e3a5f !important;
}

.btn-primario *,
.btn-primario i,
a.btn-primario *,
a.btn-primario i {
    color: #ffffff !important;
}

/* === FIX TARJETAS DE MODELOS === */
.modelo-card,
a.modelo-card,
a.modelo-card:link,
a.modelo-card:visited {
    background: #ffffff !important;
    color: #1e3a5f !important;
    border: 1px solid #e2e8f0 !important;
}

.modelo-card:hover,
a.modelo-card:hover {
    background: #ffffff !important;
    border-color: #1e3a5f !important;
}

.modelo-card .codigo {
    color: #1e3a5f !important;
}

.modelo-card .nombre {
    color: #4a5568 !important;
}

.modelo-card .badge-modelo {
    background: #e8f4fc !important;
    color: #1e3a5f !important;
}

.modelo-card .btn-abrir {
    color: #1e3a5f !important;
}

.modelo-card .btn-abrir i {
    color: #1e3a5f !important;
}
