/* =========================================
   TEMA Y VARIABLES MODERNAS
   ========================================= */
:root {
    color-scheme: light only;

    /* Paleta de Colores Profesional y Moderna */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #f0f4ff;
    --secondary: #764ba2;

    --bg-app: #f8fafc;
    --bg-panel: #ffffff;
    --bg-header: #ffffff;

    --text-dark: #1e293b;
    --text-medium: #475569;
    --text-gray: #64748b;
    --text-light: #94a3b8;

    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Sombras Modernas */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transiciones */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    background-color: var(--bg-app) !important;
    color: var(--text-dark) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100%;
    forced-color-adjust: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
    line-height: 1.6;
}

/* =========================================
   LAYOUT PRINCIPAL
   ========================================= */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* =========================================
   SIDEBAR MODERNA
   ========================================= */
.sidebar {
    width: 220px;
    background-color: var(--bg-panel) !important;
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    padding: 0;
    z-index: 50;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition-base);
}

/* Header del Sidebar */
.sidebar-header {
    padding: 0.75rem 1rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.25rem;
}

.sidebar-logo {
    width: 150px;
    height: 80px;
    margin: 0 auto 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sidebar-title {
    font-size: 0.9375rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

/* Ajuste del menú */
.sidebar .menu {
    padding: 0 1rem;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Menú Labels */
.sidebar .menu-label {
    color: var(--text-light) !important;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 1rem;
    margin-bottom: 0.375rem;
    padding: 0 0.5rem;
}

.sidebar .menu-label:first-child {
    margin-top: 0;
}

/* Enlaces del Menú */
.sidebar .menu-list {
    margin-bottom: 0.375rem;
}

.sidebar .menu-list a {
    color: var(--text-medium) !important;
    border-radius: 8px;
    padding: 0.5rem 0.625rem;
    font-weight: 500;
    font-size: 0.8125rem;
    background-color: transparent !important;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    margin-bottom: 0.125rem;
    position: relative;
    overflow: hidden;
}

.sidebar .menu-list a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--primary-gradient);
    transform: translateX(-2px);
    transition: transform var(--transition-fast);
}

.sidebar .menu-list a .icon {
    margin-right: 0.625rem;
    color: var(--text-gray);
    transition: all var(--transition-fast);
    font-size: 0.9375rem;
    width: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover Effect */
.sidebar .menu-list a:hover {
    background-color: var(--primary-light) !important;
    color: var(--primary) !important;
    transform: translateX(2px);
}

.sidebar .menu-list a:hover::before {
    transform: translateX(0);
}

.sidebar .menu-list a:hover .icon {
    color: var(--primary);
    transform: scale(1.1);
}

/* Active State */
.sidebar .menu-list a.is-active {
    background: var(--primary-gradient) !important;
    color: white !important;
    box-shadow: var(--shadow-md);
}

.sidebar .menu-list a.is-active::before {
    transform: translateX(0);
    background: white;
}

.sidebar .menu-list a.is-active .icon {
    color: white !important;
}

/* Botón de Logout */
.sidebar-footer {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
}

.sidebar-footer .button {
    width: 100%;
    justify-content: center;
    border-radius: 8px;
    padding: 0.5rem;
    font-weight: 600;
    font-size: 0.8125rem;
    transition: all var(--transition-fast);
}

/* =========================================
   CONTENIDO PRINCIPAL
   ========================================= */
.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 1.5rem;
    background-color: var(--bg-app) !important;
    min-height: 100vh;
}

/* Botón Menú Móvil */
.mobile-menu-btn {
    position: fixed !important;
    top: 1rem !important;
    left: 1rem !important;
    z-index: 101 !important;
    background: white !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-md) !important;
}

/* =========================================
   CARDS Y BOXES MODERNOS
   ========================================= */
.card,
.box {
    background-color: var(--bg-panel) !important;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    border-radius: 12px;
    color: var(--text-dark) !important;
    transition: box-shadow var(--transition-base);
}

.card:hover,
.box:hover {
    box-shadow: var(--shadow-md);
}

.card-header-title {
    color: var(--text-dark) !important;
    font-weight: 600;
}

/* =========================================
   TABLAS PROFESIONALES
   ========================================= */
.table-container {
    background: var(--bg-panel);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.table-wrapper {
    background: var(--bg-panel) !important;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.table {
    background-color: var(--bg-panel) !important;
    width: 100%;
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table thead {
    background: linear-gradient(to bottom, #f8fafc 0%, #f1f5f9 100%);
}

.table thead th {
    color: var(--text-medium) !important;
    border: none;
    border-bottom: 2px solid var(--border-color) !important;
    font-size: 0.6875rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.75rem 0.875rem;
}

.table td {
    border-bottom: 1px solid var(--border-light);
    padding: 0.75rem 0.875rem;
    vertical-align: middle;
    color: var(--text-dark) !important;
    font-size: 0.875rem;
}

.table tbody tr {
    background-color: var(--bg-panel) !important;
    transition: all var(--transition-fast);
}

.table tbody tr:hover {
    background-color: var(--primary-light) !important;
    transform: scale(1.001);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Animación de entrada para filas de tabla */
@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table tbody tr {
    animation: fadeInRow 0.3s ease-out;
}

/* Estilos para celdas de acciones */
.table td .buttons {
    gap: 0.25rem;
    flex-wrap: wrap;
}

.table td .buttons .button {
    margin: 0;
}

.table td .buttons.are-small .button {
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
    height: auto;
}

/* Badges en tablas */
.table .tag {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
}

/* =========================================
   BOTONES MODERNOS
   ========================================= */
.button {
    border-radius: 5px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.button.is-primary {
    background: var(--primary-gradient) !important;
    border-color: transparent !important;
    color: white !important;
}

.button.is-primary:hover {
    opacity: 0.9;
}

.button.is-info {
    background-color: var(--info) !important;
    border-color: var(--info) !important;
    color: white !important;
}

.button.is-success {
    background-color: var(--success) !important;
    border-color: var(--success) !important;
    color: white !important;
}

.button.is-warning {
    background-color: var(--warning) !important;
    border-color: var(--warning) !important;
    color: white !important;
}

.button.is-danger {
    background-color: var(--danger) !important;
    border-color: var(--danger) !important;
    color: white !important;
}

/* Tamaños de botones más compactos */
.button.is-small {
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
    height: auto;
    min-height: auto;
}

.buttons.are-small .button {
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
    height: auto;
    min-height: auto;
}

/* Iconos en botones pequeños */
.button.is-small .icon {
    font-size: 0.75rem;
    width: 0.875rem;
    height: 0.875rem;
}

.buttons.are-small .button .icon {
    font-size: 0.75rem;
    width: 0.875rem;
    height: 0.875rem;
}

/* =========================================
   TAGS Y BADGES
   ========================================= */
.tag {
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
    height: auto;
    border: none;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.tag:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.tag.is-primary {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
}

.tag.is-success {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
}

.tag.is-warning {
    background-color: #fef3c7 !important;
    color: #92400e !important;
}

.tag.is-danger {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

.tag.is-info {
    background-color: #dbeafe !important;
    color: #1e40af !important;
}

/* Tags con iconos */
.tag .icon {
    margin: 0;
    font-size: 0.75rem;
}

/* Variación pequeña */
.tag.is-small {
    font-size: 0.625rem;
    padding: 0.1875rem 0.375rem;
}

/* Variación mediana */
.tag.is-medium {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* =========================================
   FORMULARIOS
   ========================================= */
.input,
.textarea,
.select select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    font-size: 0.9375rem;
}

.input:focus,
.textarea:focus,
.select select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.label {
    color: var(--text-medium);
    font-weight: 600;
    font-size: 0.875rem;
}

/* =========================================
   LOGIN
   ========================================= */
.login-layout {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    max-width: 440px;
    width: 100%;
    border-radius: 16px !important;
    box-shadow: var(--shadow-xl) !important;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media screen and (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 200;
    }

    .sidebar.is-active {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .main-content {
        margin-left: 0;
        padding: 4rem 1.5rem 1.5rem;
    }
}

@media screen and (max-width: 768px) {
    .main-content {
        padding: 4rem 1rem 1rem;
    }

    .table thead th,
    .table td {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
}

/* =========================================
   DASHBOARD Y KPI CARDS
   ========================================= */
.kpi-card {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.kpi-card:hover::before {
    transform: scaleX(1);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.kpi-card .card-content {
    position: relative;
    z-index: 1;
}

.kpi-card .kpi-icon {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 3rem;
    opacity: 0.15;
    transition: all var(--transition-slow);
}

.kpi-card:hover .kpi-icon {
    opacity: 0.25;
    transform: scale(1.1) rotate(5deg);
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;

    /* Cambiamos esto para que se vea blanco siempre */
    color: #ffffff !important;
    background: none !important;
    -webkit-text-fill-color: white !important;

    animation: countUp 0.6s ease-out;
}

.kpi-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-medium);
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.kpi-trend.is-up {
    background-color: #d1fae5;
    color: #065f46;
}

.kpi-trend.is-down {
    background-color: #fee2e2;
    color: #991b1b;
}

.kpi-trend .icon {
    font-size: 0.75rem;
}

/* Variaciones de color para KPI cards */
.kpi-card.is-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.kpi-card.is-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.kpi-card.is-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.kpi-card.is-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Sparkline mini-gráficas */
.kpi-sparkline {
    margin-top: 0.75rem;
    height: 30px;
}

/* Animación de conteo para números */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kpi-value {
    animation: countUp 0.6s ease-out;
}

/* Mejoras para gráficas */
.chart-container {
    position: relative;
    height: 300px;
    padding: 1rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
}

.chart-actions {
    display: flex;
    gap: 0.5rem;
}

/* =========================================
   SISTEMA DE NOTIFICACIONES TOAST
   ========================================= */
.toast-container {
    position: fixed;
    top: 5rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 4px solid;
    animation: slideInRight 0.3s ease-out;
    min-width: 300px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast.toast-exit {
    animation: slideOutRight 0.3s ease-in;
}

.toast.is-success {
    border-left-color: var(--success);
}

.toast.is-error {
    border-left-color: var(--danger);
}

.toast.is-warning {
    border-left-color: var(--warning);
}

.toast.is-info {
    border-left-color: var(--info);
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast.is-success .toast-icon {
    color: var(--success);
}

.toast.is-error .toast-icon {
    color: var(--danger);
}

.toast.is-warning .toast-icon {
    color: var(--warning);
}

.toast.is-info .toast-icon {
    color: var(--info);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-medium);
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.125rem;
    transition: color var(--transition-fast);
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text-dark);
}

/* Responsive para toast */
@media screen and (max-width: 768px) {
    .toast-container {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .toast {
        min-width: auto;
    }
}

textarea {
    resize: none;
    /* Desactiva el tirador manual para que no interfiera */
    overflow-y: hidden;
    /* Oculta la barra de desplazamiento interna */
    transition: height 0.1s ease;
    /* Hace que el crecimiento se vea suave */
}

/* =========================================
   RESPONSIVE MEJORADO PARA MÓVILES
   ========================================= */

/* Tablas con scroll horizontal en tablet */
@media screen and (max-width: 1023px) and (min-width: 769px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }

    .table-container::before,
    .table-container::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 20px;
        pointer-events: none;
        z-index: 2;
    }

    .table-container::before {
        left: 0;
        background: linear-gradient(to right, rgba(255, 255, 255, 0.9), transparent);
    }

    .table-container::after {
        right: 0;
        background: linear-gradient(to left, rgba(255, 255, 255, 0.9), transparent);
    }

    .table {
        min-width: 900px;
    }
}

/* Tablas como cards en móvil */
@media screen and (max-width: 768px) {
    .table-container {
        background: transparent;
        border: none;
        box-shadow: none;
    }

    .table thead {
        display: none;
    }

    .table,
    .table tbody,
    .table tr {
        display: block;
        width: 100%;
    }

    .table tr {
        background: var(--bg-panel) !important;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        margin-bottom: 1rem;
        padding: 1rem;
        box-shadow: var(--shadow-sm);
    }

    .table tr:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }

    .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid var(--border-light);
    }

    .table td:last-child {
        border-bottom: none;
    }

    .table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.75rem;
        color: var(--text-medium);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        flex-shrink: 0;
        margin-right: 1rem;
    }

    .table td:last-child {
        flex-direction: column;
        align-items: stretch;
    }

    .table td:last-child::before {
        margin-bottom: 0.5rem;
    }

    .table td .buttons {
        width: 100%;
        flex-direction: column;
    }

    .table td .buttons .button {
        width: 100%;
        justify-content: center;
    }
}

/* Headers responsive */
@media screen and (max-width: 768px) {
    .level {
        display: block !important;
    }

    .level-left,
    .level-right {
        display: block !important;
        margin-bottom: 1rem;
    }

    .level-right {
        display: flex !important;
        flex-direction: column;
        gap: 0.75rem;
    }

    .level-right .field {
        margin-right: 0 !important;
        width: 100%;
    }

    .level-right .button {
        width: 100%;
        justify-content: center;
    }
}

/* Formularios responsive */
@media screen and (max-width: 768px) {
    .field .control {
        width: 100%;
    }

    .columns.is-mobile {
        display: block !important;
    }

    .columns.is-mobile>.column {
        width: 100% !important;
        margin-bottom: 0.75rem;
    }

    .file.is-fullwidth .file-label {
        width: 100%;
    }

    .box {
        padding: 1rem;
    }
}

/* Botones responsive */
@media screen and (max-width: 768px) {
    .buttons:not(.are-small) {
        flex-direction: column;
    }

    .buttons:not(.are-small) .button {
        width: 100%;
    }

    .buttons.are-small .button {
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Títulos responsive */
@media screen and (max-width: 768px) {
    .title.is-3 {
        font-size: 1.5rem;
    }

    .title.is-4 {
        font-size: 1.25rem;
    }

    .title.is-5 {
        font-size: 1.125rem;
    }
}

/* Sidebar mejorado con overlay */
@media screen and (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 200;
        box-shadow: none;
    }

    .sidebar.is-active {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    /* Overlay oscuro cuando el sidebar está abierto */
    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 199;
        animation: fadeIn 0.2s ease-out;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    .main-content {
        margin-left: 0;
        padding: 4rem 1.5rem 1.5rem;
    }
}

/* =========================================
   MENÚ DESPLEGABLE (ACORDEÓN)
   ========================================= */
.collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: color var(--transition-base);
}

.collapsible-header:hover {
    color: var(--primary) !important;
    /* Usamos la variable de tu tema */
}

.collapsible-content {
    display: none;
    margin-bottom: 0.5rem;
}

.collapsible-content.is-active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.toggle-icon {
    font-size: 0.8em;
    transition: transform var(--transition-base);
}

.toggle-icon.rotate {
    transform: rotate(180deg);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   CONTENEDOR GLOBAL DE TABLAS 
   ========================================= */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}