/* Variables CSS para temas mejorados */
:root {
    --bs-primary: #6366f1;
    --bs-primary-rgb: 99, 102, 241;
    /* Modo Claro - Paleta suave */
    --bg-primary: #fafbff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #f8fafc;
    /* Texto - Contraste suave */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    /* Bordes y sombras - Suaves */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    /* Sidebar - Gradiente elegante */
    --sidebar-bg: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
    --sidebar-text: #e2e8f0;
    --sidebar-hover: rgba(99, 102, 241, 0.1);
    --sidebar-active: rgba(99, 102, 241, 0.2);
    /* Paleta de colores principal - Elegante */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #64748b;
    --secondary-light: #94a3b8;
    --secondary-dark: #475569;
    --success: #00ff88;
    --success-light: #4ade80;
    --success-dark: #16a34a;
    --warning: #ffb800;
    --warning-light: #fbbf24;
    --warning-dark: #d97706;
    --danger: #ff0066;
    --danger-light: #f87171;
    --danger-dark: #dc2626;
    --info: #00ffff;
    --info-light: #22d3ee;
    --info-dark: #0891b2;
    /* Componentes específicos */
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --input-focus: #4f46e5;
    --table-hover: #f8fafc;
    /* Espaciado y radio */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    /* Transiciones */
    --transition: all 0.2s ease;
}

[data-theme="dark"] {
    /* Modo Oscuro - Elegante */
    --bs-primary: #818cf8;
    --bs-primary-rgb: 129, 140, 248;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    /* Texto - Suave */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    /* Bordes y sombras - Suaves */
    --border-color: #334155;
    --border-light: #475569;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.3);
    /* Sidebar - Gradiente oscuro elegante */
    --sidebar-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    --sidebar-text: #e2e8f0;
    --sidebar-hover: rgba(129, 140, 248, 0.1);
    --sidebar-active: rgba(129, 140, 248, 0.2);
    /* Componentes específicos para modo oscuro */
    --card-bg: #151a26;
    --card-border: #2d3748;
    --input-bg: #1a1f2e;
    --input-border: #4a5568;
    --input-focus: #00d4ff;
    --table-hover: #1e2332;
    /* Colores cyberpunk refinados */
    --primary: #818cf8;
    --primary-light: #a5b4fc;
    --primary-dark: #6366f1;
    --secondary: #8b5cf6;
    --secondary-light: #a78bfa;
    --secondary-dark: #7c3aed;
    --success: #10b981;
    --success-light: #34d399;
    --success-dark: #059669;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --warning-dark: #d97706;
    --danger: #ef4444;
    --danger-light: #f87171;
    --danger-dark: #dc2626;
    --info: #06b6d4;
    --info-light: #22d3ee;
    --info-dark: #0891b2;
}

/* Estilos base mejorados */
body {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
}

/* Tipografía mejorada */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

/* Tarjetas mejoradas */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

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

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

    /* Card header específico para tema */
    .card-header.bg-white {
        background-color: var(--card-bg) !important;
        color: var(--text-primary);
    }

    .card-header.border-0 {
        border: none !important;
    }

    .card-header.py-3 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

/* Botones mejorados */
.btn {
    border-radius: 25px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary), var(--primary-light));
    color: var(--text-inverse);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

    .btn-primary:hover {
        background: linear-gradient(45deg, var(--primary-light), var(--primary));
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
    }

.btn-outline-primary {
    color: var(--primary);
    border: 1px solid var(--primary);
    background-color: transparent;
}

    .btn-outline-primary:hover {
        background-color: var(--primary);
        color: var(--text-inverse);
    }

.btn-success {
    background-color: var(--success);
    color: var(--text-inverse);
}

    .btn-success:hover {
        background-color: var(--success-dark);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

.btn-warning {
    background-color: var(--warning);
    color: var(--text-inverse);
}

    .btn-warning:hover {
        background-color: var(--warning-dark);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

.btn-danger {
    background-color: var(--danger);
    color: var(--text-inverse);
}

    .btn-danger:hover {
        background-color: var(--danger-dark);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

.btn-info {
    background-color: var(--info);
    color: var(--text-inverse);
}

    .btn-info:hover {
        background-color: var(--info-dark);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

/* Inputs mejorados */
.form-control, .form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    transition: var(--transition);
}

    .form-control:focus, .form-select:focus {
        background-color: var(--input-bg);
        border-color: var(--input-focus);
        color: var(--text-primary);
        box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.15);
        outline: none;
    }

/* Tablas mejoradas */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border-color);
    --bs-table-hover-bg: var(--table-hover);
}

    .table thead th {
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.05em;
        color: var(--text-secondary);
        border-bottom: 2px solid var(--border-color);
    }

.table-hover tbody tr:hover {
    background-color: var(--table-hover);
}

/* Sidebar mejorado */
#sidebar-wrapper {
    background: var(--sidebar-bg) !important;
    color: var(--sidebar-text);
    box-shadow: var(--shadow-lg);
}

.sidebar-heading {
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--sidebar-text);
    padding: 1.25rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.list-group-item-action {
    background-color: transparent;
    color: var(--sidebar-text);
    border-radius: 0;
    padding: 0.75rem 1.25rem;
    transition: var(--transition);
}

    .list-group-item-action:hover {
        background-color: var(--sidebar-hover);
        color: var(--sidebar-text);
    }

    .list-group-item-action.active {
        background-color: var(--sidebar-active);
        color: var(--sidebar-text);
        font-weight: 500;
    }

/* Navbar mejorado */
.navbar-light {
    background-color: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow);
}

/* Iconos mejorados */
.icon-box {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    transition: var(--transition);
}

    .icon-box:hover {
        transform: translateY(-2px);
        background-color: rgba(79, 70, 229, 0.15);
    }

/* Badges mejorados */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
    border-radius: var(--radius-md);
}

/* Clases de texto para temas */
.theme-text {
    color: var(--text-primary);
}

.theme-text-secondary {
    color: var(--text-secondary);
}

.theme-text-muted {
    color: var(--text-muted);
}

/* Sobrescribir clases Bootstrap para temas */
.text-muted {
    color: var(--text-muted) !important;
}

.form-text {
    color: var(--text-muted) !important;
}

.form-label {
    color: var(--text-primary) !important;
}

/* Code elements para temas */
code {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color);
}

/* Small text elements */
small {
    color: var(--text-muted) !important;
}

/* Alert elements para temas */
.alert {
    color: var(--text-primary);
    border-color: var(--border-color);
}

.alert-heading {
    color: var(--text-primary) !important;
}

/* Definition lists para temas */
dt {
    color: var(--text-secondary) !important;
}

dd {
    color: var(--text-primary) !important;
}

/* Paragraph elements */
p {
    color: var(--text-primary);
}

/* Div elements sin clase específica */
.info-value {
    color: var(--text-primary) !important;
}

.info-label {
    color: var(--text-muted) !important;
}

/* Contenedores d-flex */
.d-flex.align-items-center {
    color: var(--text-primary);
}

    .d-flex.align-items-center * {
        color: inherit;
    }

/* Layout específico mejorado */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

#sidebar-wrapper {
    height: 100%;
    width: 260px;
    transition: all 0.3s ease;
    z-index: 100;
    overflow-y: auto;
    position: relative;
}

#page-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-secondary);
}

.main-content-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tab-content-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.render-body-container {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
}

#wrapper.toggled #sidebar-wrapper {
    margin-left: -260px;
}

/* Modales mejorados */
.modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.25rem;
}

/* Loader mejorado */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loader-spinner {
    text-align: center;
}

/* Theme toggle button - sidebar version */
.theme-toggle-btn {
    background: rgba(0, 212, 255, 0.1) !important;
    border: 1px solid rgba(0, 212, 255, 0.3) !important;
    color: var(--sidebar-text) !important;
    transition: all 0.3s ease;
    border-radius: 8px !important;
    font-size: 0.9rem;
}

    .theme-toggle-btn:hover {
        background: rgba(0, 212, 255, 0.2) !important;
        border-color: var(--primary) !important;
        color: #ffffff !important;
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
    }

    .theme-toggle-btn i {
        transition: transform 0.3s ease;
    }

    .theme-toggle-btn:hover i {
        transform: rotate(15deg) scale(1.1);
    }

/* Theme toggle button - fixed right side (backup) */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .theme-toggle:hover {
        transform: scale(1.1);
        background: var(--primary-dark);
        box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
    }

    .theme-toggle:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
    }

    .theme-toggle i {
        font-size: 1.2rem;
        transition: transform 0.3s ease;
    }

    .theme-toggle:hover i {
        transform: rotate(15deg);
    }

/* Tarjetas de estadísticas mejoradas */
.stats-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: none;
}

    .stats-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }

    .stats-card .card-body {
        padding: 1.5rem;
    }

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Botones de acción mejorados */
.action-button {
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-primary);
    text-align: left;
}

    .action-button:hover {
        background-color: var(--bg-hover);
        border-color: var(--primary);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    .action-button i {
        font-size: 1.25rem;
        width: 30px;
        text-align: center;
    }

/* Efectos para elementos interactivos */
.interactive {
    transition: var(--transition);
}

    .interactive:hover {
        transform: translateY(-2px);
    }

/* Animaciones sutiles */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Mejoras en modo oscuro para tablas */
[data-theme="dark"] .table-light {
    --bs-table-bg: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Mejoras en el modo oscuro para inputs */
[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
}

/* Mejoras en el modo oscuro para modales */
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--border-color);
}

/* Mejoras en el modo oscuro para badges */
[data-theme="dark"] .badge.bg-light {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* Mejoras para tablas modernas */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: transparent;
    --bs-table-hover-bg: var(--table-hover);
}

    .table thead th {
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.05em;
        color: var(--text-secondary);
        border-bottom: none;
        padding: 1rem;
    }

    .table tbody td {
        padding: 1rem;
        vertical-align: middle;
        border-bottom: none;
    }

.table-hover tbody tr:hover {
    background-color: var(--table-hover);
}

.table.align-middle td {
    vertical-align: middle;
}

/* Avatar circle mejorado */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Badges de permisos */
.permission-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0 1px;
}

/* Code styling para rutas */
code {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
}

/* Badge mejorado con padding */
.badge {
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
}

    .badge.px-3 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .badge.py-1 {
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }

/* Estilos para vistas especializadas */
.user-management-card {
    border-left: 4px solid var(--primary);
}

.profile-assignment-container {
    max-height: 400px;
    overflow-y: auto;
}

.profile-item {
    padding: 0.75rem;
    border-radius: var(--radius-md);
    background-color: var(--bg-hover);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

    .profile-item:hover {
        background-color: var(--bg-tertiary);
        transform: translateX(2px);
    }

.activation-button {
    transition: all 0.3s ease;
}

    .activation-button:hover {
        transform: scale(1.05);
    }

/* JavaScript utilities - estilos para funciones JS */
.js-loading {
    opacity: 0.6;
    pointer-events: none;
}

.js-success {
    border-left: 4px solid var(--success);
    background-color: rgba(16, 185, 129, 0.05);
}

.js-error {
    border-left: 4px solid var(--danger);
    background-color: rgba(239, 68, 68, 0.05);
}

/* Efectos adicionales cyberpunk azul cian */
.cyberpunk-glow {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.cyberpunk-text {
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    color: var(--primary);
}

.neon-border {
    border: 2px solid transparent;
    background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box, linear-gradient(45deg, var(--primary), var(--secondary)) border-box;
    border-radius: var(--radius-lg);
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 212, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0);
    }
}

/* Animación para indicador en vivo */
#liveIndicator {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Estilos para matrices de permisos */
.table-container {
    max-height: 500px;
    overflow: auto;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.sticky-table {
    position: relative;
}

.sticky-column {
    position: sticky;
    left: 0;
    background-color: var(--bg-card);
    z-index: 10;
    min-width: 150px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sticky-header {
    position: sticky;
    top: 0;
    background-color: var(--bg-tertiary);
    z-index: 5;
}

.sticky-column.sticky-header {
    z-index: 15;
}

.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    min-width: 60px;
    max-width: 80px;
    height: 120px;
    padding: 0.5rem 0.25rem;
}

.permission-matrix-cell {
    min-width: 80px;
    padding: 0.5rem;
}

.permission-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

    .permission-checkbox-group label {
        margin: 0;
        font-size: 0.75rem;
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

/* Mejoras para modo oscuro en matrices */
[data-theme="dark"] .sticky-column {
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
}

[data-theme="dark"] .sticky-header {
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

/* Estilos para confirmación de eliminación */
.delete-confirmation {
    border-left: 4px solid var(--danger);
}

.info-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    background-color: var(--bg-hover);
    margin-bottom: 0.5rem;
}

    .info-item .info-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 0.75rem;
        flex-shrink: 0;
    }

    .info-item .info-content {
        flex: 1;
    }

    .info-item .info-label {
        font-size: 0.75rem;
        color: var(--text-muted);
        margin-bottom: 0.25rem;
        display: block;
    }

    .info-item .info-value {
        font-weight: 600;
        color: var(--text-primary);
    }

/* Enhanced Sidebar Styles */
#sidebar-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.sidebar-heading {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

    .sidebar-heading .fas {
        font-size: 1.5rem;
        text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
    }

    .sidebar-heading span {
        font-size: 1.2rem;
        letter-spacing: 1px;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

/* Module Links */
.list-group-item {
    background: transparent !important;
    border: none !important;
    padding: 12px 20px;
    margin: 2px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .list-group-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
        transition: left 0.5s ease;
    }

    .list-group-item:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        transform: translateX(5px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

        .list-group-item:hover::before {
            left: 100%;
        }

    .list-group-item.fw-bold {
        font-weight: 600 !important;
        color: #ffffff !important;
        font-size: 0.95rem;
    }

        .list-group-item.fw-bold i {
            width: 20px;
            text-align: center;
            color: var(--bs-primary);
            filter: drop-shadow(0 0 3px rgba(0, 212, 255, 0.5));
        }

/* Submenu Items */
.collapse .list-group-item {
    padding: 8px 20px 8px 45px;
    margin: 1px 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8) !important;
    border-left: 2px solid transparent;
}

    .collapse .list-group-item:hover {
        color: #ffffff !important;
        border-left-color: var(--bs-primary);
        background: rgba(0, 212, 255, 0.15) !important;
    }

    .collapse .list-group-item i {
        font-size: 0.7rem;
        color: rgba(255, 255, 255, 0.5);
        transition: all 0.3s ease;
    }

    .collapse .list-group-item:hover i {
        color: var(--bs-primary);
        transform: translateX(3px);
    }

/* Collapse Animation */
.collapse {
    transition: all 0.3s ease;
}

.collapsing {
    transition: height 0.3s ease;
}

/* Scrollbar Styling */
#sidebar-wrapper::-webkit-scrollbar {
    width: 6px;
}

#sidebar-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

#sidebar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

    #sidebar-wrapper::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.5);
    }

/* Theme Support */
[data-theme="dark"] #sidebar-wrapper {
    background: linear-gradient(135deg, #0a0e1a 0%, #151a26 50%, #1e2332 100%);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

[data-theme="dark"] .sidebar-heading {
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .list-group-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .theme-toggle {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

    [data-theme="dark"] .theme-toggle:hover {
        background: rgba(255, 255, 255, 0.1);
    }

/* Responsive Design Mejorado */
@media (max-width: 1200px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    .card {
        margin-bottom: 0.75rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 992px) {
    .modal-dialog {
        max-width: 90vw;
    }

    .table {
        font-size: 0.75rem;
    }

    .card-body {
        padding: 1rem;
    }

    #sidebar-wrapper {
        width: min(280px, 80vw);
    }
}

@media (max-width: 992px) {
    .modal-dialog {
        max-width: 90vw;
    }

    .table {
        font-size: 0.75rem;
    }

    .card-body {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    #wrapper {
        position: relative;
    }

    #sidebar-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        z-index: 1050;
        transition: transform 0.3s ease;
    }

    #wrapper.toggled #sidebar-wrapper {
        transform: translateX(0);
        margin-left: 0;
    }

    #page-content-wrapper {
        width: 100%;
        margin-left: 0;
    }

    /* Overlay para cerrar el menú */
    #wrapper.toggled::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

    /* Navbar responsive */
    .navbar {
        padding: 0.5rem 1rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    /* Contenido responsive */
    .tab-content {
        padding: 0.75rem;
    }

    .main-content-container {
        height: calc(100vh - 56px);
    }

    /* Cards en móvil */
    .card {
        margin-bottom: 0.5rem;
        border-radius: 8px;
    }

    .card-body {
        padding: 0.75rem;
    }

    /* Botones en móvil */
    .btn {
        min-height: 48px;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .btn-sm {
        min-height: 40px;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 8px;
        padding-right: 8px;
    }

    .modal-dialog {
        max-width: 95vw;
        margin: 0.5rem auto;
    }

    .card-body {
        padding: 0.5rem;
    }

    .btn {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }

    .table {
        font-size: 0.7rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    h4 {
        font-size: 1rem;
    }

    h5 {
        font-size: 0.9rem;
    }

    h6 {
        font-size: 0.8rem;
    }
}

@media (max-width: 400px) {
    .container-fluid {
        padding-left: 5px;
        padding-right: 5px;
    }

    .tab-content {
        padding: 0.5rem;
    }

    .card-body {
        padding: 0.4rem;
    }

    .btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.6rem;
        min-height: 44px;
    }
}

/* Delete confirmation styles */
.delete-warning-alert {
    border-left: 4px solid var(--warning);
    background-color: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
}

.delete-info-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background-color: var(--card-bg);
}

.delete-info-list dt {
    color: var(--text-secondary);
    font-weight: 600;
}

.delete-info-list dd {
    color: var(--text-primary);
}

.delete-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
}

/* Profile management styles */
.profile-management-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.profile-management-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

.profile-section-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background-color: var(--card-bg);
    height: 100%;
}

.profile-section-header {
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    font-weight: 600;
}

.profile-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md);
    background-color: var(--bg-hover);
    transition: var(--transition);
}

    .profile-item-row:hover {
        background-color: var(--bg-tertiary);
        transform: translateX(2px);
    }

.profile-assign-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

    .profile-assign-btn:hover {
        transform: scale(1.05);
    }

.profile-close-actions {
    margin-top: 1.5rem;
    text-align: center;
}

/* ===== SISTEMA 100% RESPONSIVE ===== */

/* Base responsive para todos los elementos */
* {
    box-sizing: border-box;
}

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

/* Contenedores fluidos */
.container-fluid {
    width: 100%;
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    margin: 0 auto;
}

/* Imágenes responsive */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Texto responsive */
h1, h2, h3, h4, h5, h6 {
    font-size: clamp(1rem, 2.5vw, 2rem);
    line-height: 1.2;
    word-wrap: break-word;
}

p, span, div {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    line-height: 1.5;
    word-wrap: break-word;
}

/* Botones responsive */
.btn {
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    font-size: clamp(0.875rem, 1.2vw, 1rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Inputs responsive */
.form-control, .form-select {
    min-height: 44px;
    font-size: clamp(0.875rem, 1.2vw, 1rem);
    width: 100%;
}

/* Tablas responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    min-width: 600px;
    font-size: clamp(0.75rem, 1vw, 0.875rem);
}

/* Cards responsive */
.card {
    width: 100%;
    margin-bottom: 1rem;
}

/* Modales responsive */
.modal-dialog {
    max-width: 95vw;
    margin: 1rem auto;
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* ===== MEJORAS PARA GESTOR DE PESTAÑAS MÓVIL ===== */

/* Contenedor de pestañas con scroll horizontal */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-card);
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

    /* Webkit scrollbar para pestañas */
    .nav-tabs::-webkit-scrollbar {
        height: 3px;
    }

    .nav-tabs::-webkit-scrollbar-track {
        background: transparent;
    }

    .nav-tabs::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 3px;
    }

        .nav-tabs::-webkit-scrollbar-thumb:hover {
            background: var(--text-muted);
        }

    /* Items de pestañas */
    .nav-tabs .nav-item {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .nav-tabs .nav-link {
        border: none;
        border-radius: 0;
        padding: 0.75rem 1rem;
        color: var(--text-secondary);
        background-color: transparent;
        transition: var(--transition);
        position: relative;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        min-width: 120px;
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

        .nav-tabs .nav-link:hover {
            background-color: var(--bg-hover);
            color: var(--text-primary);
            border-color: transparent;
        }

        .nav-tabs .nav-link.active {
            background-color: var(--bg-secondary);
            color: var(--primary);
            border-color: transparent;
            border-bottom: 2px solid var(--primary);
        }

/* Botón de cerrar pestaña mejorado para móvil */
.tab-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    margin-left: auto;
    flex-shrink: 0;
    border: none;
    outline: none;
}

    .tab-close-btn:hover {
        background-color: var(--danger);
        color: white;
        transform: scale(1.1);
    }

    .tab-close-btn:active {
        transform: scale(0.95);
    }

/* Texto de pestaña truncado */
.tab-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Indicador de scroll para pestañas */
.tabs-scroll-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

    .tabs-scroll-indicator:hover {
        background: var(--primary);
        color: white;
        transform: translateY(-50%) scale(1.1);
    }

.tabs-scroll-left {
    left: 5px;
}

.tabs-scroll-right {
    right: 5px;
}

/* Contenedor de pestañas con indicadores */
.tab-content-container {
    position: relative;
}

.tabs-wrapper {
    position: relative;
    overflow: hidden;
}

/* Dropdown de pestañas para móvil - OCULTO POR DEFECTO */
.tabs-dropdown {
    display: none !important;
    position: relative;
    visibility: hidden;
}

.tabs-dropdown-toggle {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition);
}

    .tabs-dropdown-toggle:hover {
        background: var(--bg-hover);
        border-color: var(--primary);
    }

.tabs-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

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

.tabs-dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
}

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

    .tabs-dropdown-item:hover {
        background: var(--bg-hover);
    }

    .tabs-dropdown-item.active {
        background: var(--primary);
        color: white;
    }

/* Estilos responsivos para pestañas */
@media (max-width: 768px) {
    /* Mantener pestañas normales visibles en móvil */
    .nav-tabs {
        display: flex !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

        .nav-tabs::-webkit-scrollbar {
            display: none;
        }

    /* Mantener dropdown oculto */
    .tabs-dropdown {
        display: none !important;
        visibility: hidden;
    }

    /* Reducir padding del contenido de pestañas */
    .tab-content {
        padding: 1rem;
    }

    /* Ajustar altura del contenedor principal */
    .main-content-container {
        height: calc(100vh - 60px); /* Ajustar según altura del navbar */
    }
}

@media (max-width: 576px) {
    /* Pestañas aún más compactas en móviles pequeños */
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        min-width: 100px;
        font-size: 0.875rem;
    }

    .tab-close-btn {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }

    .tab-content {
        padding: 0.75rem;
    }

    .tabs-dropdown-toggle {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .tabs-dropdown-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Animaciones para pestañas */
@keyframes tabSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-tabs .nav-item {
    animation: tabSlideIn 0.3s ease;
}

/* Mejoras para accesibilidad */
.nav-tabs .nav-link:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.tab-close-btn:focus {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
}

/* Estados de carga para pestañas */
.tab-loading {
    position: relative;
    overflow: hidden;
}

    .tab-loading::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 2px;
        background: linear-gradient(90deg, transparent, var(--primary), transparent);
        animation: tabLoading 1.5s infinite;
    }

@keyframes tabLoading {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Contador de pestañas para dropdown */
.tabs-counter {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Mejoras adicionales para experiencia táctil */
.touch-friendly {
    min-height: 44px;
    min-width: 44px;
}

.tab-close-btn.touch-friendly {
    width: 32px;
    height: 32px;
    font-size: 16px;
}

/* Indicadores de estado de pestañas */
.tab-status-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

/* ===== AJUSTES PRINCIPALES PARA REDUCIR ESPACIOS ===== */

/* Reducir padding general del contenedor */
.container-fluid {
    padding-left: 10px !important;
    padding-right: 10px !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

/* Reducir espaciado interno de las tarjetas */
.card-body {
    padding: 0.75rem !important;
}

.card-header {
    padding: 0.5rem 0.75rem !important;
}

/* ===== OPTIMIZACIÓN DE TARJETAS DE ESTADÍSTICAS ===== */

/* Reducir tamaño de las tarjetas de estadísticas */
.stats-card .card-body {
    padding: 0.75rem !important;
}

.stats-icon {
    width: 45px !important;
    height: 45px !important;
    font-size: 1.2rem !important;
}

/* Reducir tamaño de los números en estadísticas */
.stats-card h3 {
    font-size: 1.5rem !important;
    margin-bottom: 0.25rem !important;
}

/* ===== AJUSTES DE BOTONES ===== */

/* Reducir tamaño de los botones principales */
.btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    min-height: auto !important;
}

/* Botones de acción más compactos */
.action-button {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
}

    .action-button i {
        font-size: 1rem !important;
        width: 25px !important;
    }

/* ===== AJUSTES DE TIPOGRAFÍA ===== */

/* Reducir tamaño de títulos */
h1 {
    font-size: 1.5rem !important;
    margin-bottom: 0.5rem !important;
}

h3 {
    font-size: 1.25rem !important;
    margin-bottom: 0.5rem !important;
}

h5 {
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
}

/* Textos secundarios más pequeños */
.text-muted {
    font-size: 0.8rem !important;
}

small {
    font-size: 0.75rem !important;
}

/* ===== AJUSTES DE LAYOUT ===== */

/* Reducir espaciado entre filas */
.row.g-4 {
    --bs-gutter-y: 1rem !important;
    --bs-gutter-x: 1rem !important;
}

/* Reducir ancho del sidebar */
#sidebar-wrapper {
    width: 220px !important;
}

/* Ajustar altura del contenedor principal */
.main-content-container {
    height: calc(100vh - 60px) !important;
}

/* Reducir padding del contenido de pestañas */
.tab-content {
    padding: 1rem !important;
}

/* ===== BARRA DE NAVEGACIÓN ===== */

/* Hacer la navbar más compacta */
.navbar {
    min-height: 50px !important;
    padding: 0.5rem 1rem !important;
}

/* ===== AJUSTES DEL CONTENEDOR DE PESTAÑAS ===== */

/* Reducir altura del contenedor de pestañas */
.tab-content-container {
    height: calc(100% - 45px) !important;
}

/* Pestañas más compactas */
.nav-tabs .nav-link {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
}

/* ===== MEDIA QUERIES PARA DIFERENTES TAMAÑOS ===== */

/* Para pantallas medianas */
@media (max-width: 1200px) {
    .container-fluid {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .stats-card .card-body {
        padding: 0.5rem !important;
    }

    .stats-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }

    .stats-card h3 {
        font-size: 1.25rem !important;
    }

    .btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
}

/* Para tablets */
@media (max-width: 992px) {
    #sidebar-wrapper {
        width: 200px !important;
    }

    .container-fluid {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    .card-body {
        padding: 0.5rem !important;
    }
}

/* Para móviles */
@media (max-width: 768px) {
    .stats-card h3 {
        font-size: 1.1rem !important;
    }

    .action-button {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.8rem !important;
    }

    .card-body {
        padding: 0.5rem !important;
    }

    h1 {
        font-size: 1.25rem !important;
    }

    h3 {
        font-size: 1.1rem !important;
    }
}

/* Para móviles pequeños */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    .stats-card h3 {
        font-size: 1rem !important;
    }

    .btn {
        padding: 0.35rem 0.7rem !important;
        font-size: 0.75rem !important;
    }
}

/* ===== OPTIMIZACIONES ADICIONALES ===== */

/* Reducir altura de las filas en tablas */
.table td, .table th {
    padding: 0.5rem !important;
    vertical-align: middle !important;
}

/* Modal más compacto y distinguible */
.modal-dialog {
    max-width: 90vw !important;
}

.modal-body {
    padding: 1rem !important;
}

/* ===== ESTILOS MEJORADOS PARA MODALES ===== */

/* Overlay del modal más oscuro */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(3px);
}

/* Contenedor del modal con mejor sombra */
.modal-content {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 
                0 8px 25px rgba(0, 0, 0, 0.2) !important;
    background: var(--bg-card) !important;
    overflow: hidden;
}

/* Header del modal más distinguible */
.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark, #0056b3)) !important;
    color: white !important;
    border-bottom: none !important;
    padding: 1.25rem 1.5rem !important;
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1), rgba(255,255,255,0.3));
}

.modal-title {
    color: white !important;
    font-weight: 600 !important;
    font-size: 1.25rem !important;
}

/* Botón de cerrar mejorado */
.modal-header .btn-close {
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    opacity: 0.8 !important;
    transition: all 0.2s ease !important;
}

.modal-header .btn-close:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    opacity: 1 !important;
    transform: scale(1.1);
}

/* Cuerpo del modal */
.modal-body {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    padding: 1.5rem !important;
}

/* Footer del modal */
.modal-footer {
    background: var(--bg-secondary, #f8f9fa) !important;
    border-top: 1px solid var(--border-color, #dee2e6) !important;
    padding: 1rem 1.5rem !important;
}

/* Animación de entrada mejorada */
.modal.fade .modal-dialog {
    transform: translate(0, -50px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .modal-dialog {
    transform: translate(0, 0) scale(1);
}

/* Estilos para modo oscuro */
[data-theme="dark"] .modal-content {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .modal-footer {
    background: var(--bg-tertiary) !important;
    border-top-color: var(--border-color) !important;
}

/* Modal de confirmación con colores distintivos */
.modal-danger .modal-header {
    background: linear-gradient(135deg, var(--danger), #c82333) !important;
}

.modal-warning .modal-header {
    background: linear-gradient(135deg, var(--warning), #e0a800) !important;
}

.modal-success .modal-header {
    background: linear-gradient(135deg, var(--success), #1e7e34) !important;
}

.modal-info .modal-header {
    background: linear-gradient(135deg, var(--info), #138496) !important;
}

/* Efecto de pulsación para modales importantes */
.modal-pulse .modal-content {
    animation: modalPulse 2s infinite;
}

@keyframes modalPulse {
    0%, 100% {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 
                    0 8px 25px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4), 
                    0 12px 35px rgba(0, 0, 0, 0.3);
    }
}

/* Eliminar márgenes innecesarios */
.mb-4 {
    margin-bottom: 1rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

/* Ajustar espaciado en elementos flex */
.d-flex.gap-2 {
    gap: 0.5rem !important;
}

/* Optimizar el espacio en los grupos de botones */
.d-grid.gap-2 {
    gap: 0.5rem !important;
}

border: 2px solid var(--bg-card);
}

.tab-status-indicator.loading {
    background: var(--warning);
    animation: pulse 1s infinite;
}

.tab-status-indicator.error {
    background: var(--danger);
}

/* Mejoras para modo oscuro en pestañas */
[data-theme="dark"] .nav-tabs {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .tabs-dropdown-toggle {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

[data-theme="dark"] .tabs-dropdown-menu {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

/* Animación de carga para pestañas */
.tab-content-loading {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .tab-content-loading::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, transparent, var(--primary), transparent);
        animation: tabContentLoading 2s infinite;
    }

@keyframes tabContentLoading {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ===== ELEMENTOS OCULTOS Y OPTIMIZACIONES ===== */

/* Ocultar elementos de control innecesarios */
.tabs-dropdown,
.tabs-dropdown-toggle,
.tabs-dropdown-menu,
.tabs-dropdown-item,
.tabs-counter {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Optimizaciones responsive adicionales */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Mejorar experiencia táctil */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 48px;
        padding: 0.75rem 1rem;
    }

    .nav-link {
        min-height: 48px;
        padding: 0.75rem 1rem;
    }

    .tab-close-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* Optimizaciones para pantallas pequeñas */
@media (max-width: 320px) {
    .nav-tabs .nav-link {
        min-width: 80px;
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    .tab-title {
        max-width: 60px;
    }

    .container-fluid {
        padding-left: 3px;
        padding-right: 3px;
    }
}

/* Utilidades responsive */
.text-responsive {
    font-size: clamp(0.875rem, 1.5vw, 1.125rem);
    line-height: 1.5;
}

.p-responsive {
    padding: clamp(0.5rem, 2vw, 1.5rem);
}

.m-responsive {
    margin: clamp(0.5rem, 2vw, 1.5rem);
}

/* ===== ESTILOS PARA SCROLL DE TABLAS EN MODALES ===== */

/* Contenedor principal con scroll interno */
.resource-manager {
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

/* Wrapper de tabla con scroll */
.resource-table-wrapper {
    flex: 1;
    overflow-y: auto;
    max-height: 60vh;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* Acciones fijas en la parte inferior */
.resource-actions {
    flex-shrink: 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Contenedor genérico para tablas con scroll */
.table-scroll-container {
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
}

/* Wrapper para listas con scroll */
.list-scroll-container {
    max-height: 50vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* Acciones fijas para cualquier modal */
.modal-fixed-actions {
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    margin: -1rem -1rem 0 -1rem;
    z-index: 10;
}

/* Scrollbar personalizada para contenedores de scroll */
.table-scroll-container::-webkit-scrollbar,
.list-scroll-container::-webkit-scrollbar,
.resource-table-wrapper::-webkit-scrollbar {
    width: 8px;
}

.table-scroll-container::-webkit-scrollbar-track,
.list-scroll-container::-webkit-scrollbar-track,
.resource-table-wrapper::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-thumb,
.list-scroll-container::-webkit-scrollbar-thumb,
.resource-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.table-scroll-container::-webkit-scrollbar-thumb:hover,
.list-scroll-container::-webkit-scrollbar-thumb:hover,
.resource-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Ajustes para modo oscuro */
[data-theme="dark"] .table-scroll-container::-webkit-scrollbar-track,
[data-theme="dark"] .list-scroll-container::-webkit-scrollbar-track,
[data-theme="dark"] .resource-table-wrapper::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

[data-theme="dark"] .table-scroll-container::-webkit-scrollbar-thumb,
[data-theme="dark"] .list-scroll-container::-webkit-scrollbar-thumb,
[data-theme="dark"] .resource-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
}

/* Responsive para contenedores de scroll */
@media (max-width: 768px) {
    .table-scroll-container,
    .list-scroll-container,
    .resource-table-wrapper {
        max-height: 50vh;
    }
    
    .resource-manager {
        max-height: 85vh;
    }
}

@media (max-width: 576px) {
    .table-scroll-container,
    .list-scroll-container,
    .resource-table-wrapper {
        max-height: 45vh;
    }
    
    .resource-manager {
        max-height: 90vh;
    }
    
    .modal-fixed-actions {
        padding: 0.75rem;
    }
}
