/* modern-styles.css - Sistema de Facturación */

/* ===== RESET Y VARIABLES ===== */
:root {
    --primary-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --white-bg: #ffffff;
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #ecf0f1;
    --shadow-light: 0 2px 4px rgba(44, 62, 80, 0.1);
    --shadow-medium: 0 4px 8px rgba(44, 62, 80, 0.15);
    --shadow-heavy: 0 8px 16px rgba(44, 62, 80, 0.2);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

/* ===== LAYOUT PRINCIPAL ===== */
.main-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    background: var(--light-bg);
}

.modern-navbar {
    background: var(--primary-gradient);
    box-shadow: var(--shadow-medium);
    padding: 4px 0; /* Reducido aún más de 8px a 4px */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.modern-navbar .navbar-brand {
    color: white !important;
    font-weight: 600;
    font-size: 1rem; /* Reducido aún más de 1.1rem */
}

.brand-icon {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 4px; /* Reducido de 6px */
    color: white;
    margin-right: 8px; /* Reducido de 10px */
    font-size: 1rem; /* Reducido de 1.1rem */
}

.user-avatar {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 28px; /* Reducido de 32px */
    height: 28px; /* Reducido de 32px */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem; /* Reducido de 0.8rem */
    color: white;
}

.user-menu {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 4px 10px !important; /* Reducido de 6px 12px */
    transition: all 0.3s ease;
    color: white !important;
    font-size: 0.8rem; /* Reducido de 0.85rem */
}

.user-menu:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    text-decoration: none;
}

.user-menu-compact {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2px 8px !important;
    transition: all 0.3s ease;
    color: white !important;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.user-menu-compact:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    text-decoration: none;
}

.user-menu-compact i {
    color: white !important;
}

.user-menu-compact small {
    color: white !important;
}

.filter-toggle-btn {
    background: var(--primary-gradient);
    border: none;
    color: white;
    border-radius: var(--border-radius);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

.filter-toggle-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.filter-toggle-btn.active {
    background: var(--accent-color);
    color: white;
    box-shadow: var(--shadow-medium);
}

.filter-toggle-btn i {
    font-size: 0.8rem;
}

.modern-dropdown {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow-medium);
    margin-top: 8px;
    right: 0 !important; /* Forzar alineación a la derecha */
    left: auto !important; /* Cancelar alineación a la izquierda */
    transform: none !important; /* Cancelar transformaciones de Bootstrap */
}

.modern-dropdown .dropdown-item {
    padding: 8px 16px; /* Reducido para que sea más compacto */
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 2px 6px;
    color: var(--text-dark);
    font-size: 0.85rem; /* Reducido ligeramente */
}

.modern-dropdown .dropdown-item:hover {
    background: rgba(52, 152, 219, 0.1);
    color: var(--accent-color);
}

.modern-dropdown .dropdown-item i {
    width: 16px;
    margin-right: 8px;
    text-align: center;
}

.main-content {
    flex: 1;
    background: var(--light-bg);
    padding: 20px 0;
}

.modern-footer {
    background: var(--primary-color);
    color: white;
    padding: 20px 0;
    margin-top: auto;
    font-size: 0.85rem;
    text-align: center;
}

/* ===== ESTILOS DE LOGIN ===== */
.login-container {
    /*background: var(--primary-gradient);*/
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-heavy);
    padding: 40px;
    max-width: 450px;
    width: 100%;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.company-logo {
    max-width: 140px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.login-title {
    color: var(--text-dark) !important;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
    font-weight: 600;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form label {
    color: var(--text-dark) !important;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

.login-form .form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 14px;
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.login-form .form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.btn-submit {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 14px;
    width: 100%;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* ===== DASHBOARD Y PÁGINAS ===== */
.dashboard-page {
    color: var(--text-dark);
    padding: 0 10px; /* Súper compacto */
}

.page-header {
    background: var(--white-bg);
    border-radius: var(--border-radius);
    padding: 10px 14px; /* Súper compacto */
    box-shadow: var(--shadow-light);
    margin-bottom: 10px; /* Muy poco margen */
}

.page-header h1 {
    color: var(--text-dark) !important;
    font-size: 1.1rem; /* Mucho más pequeño */
    font-weight: 600;
    margin-bottom: 2px; /* Casi sin margen */
}

.page-header p {
    color: var(--text-muted) !important;
    font-size: 0.8rem; /* Más pequeño */
    margin-bottom: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white-bg);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    border-left: 4px solid var(--accent-color);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-card.info {
    border-left-color: var(--info-color);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.1;
    position: absolute;
    right: 20px;
    top: 20px;
}

/* ===== CARDS Y CONTENEDORES ===== */
.modern-card {
    background: var(--white-bg);
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--shadow-light);
    margin-bottom: 8px; /* Súper compacto */
    transition: all 0.3s ease;
}

.modern-card:hover {
    box-shadow: var(--shadow-medium);
}

.card-header {
    background: var(--primary-gradient) !important;
    color: white !important;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 8px 12px; /* Súper compacto */
    border: none;
}

.card-header h5 {
    color: white !important;
    font-size: 0.85rem; /* Más pequeño */
    font-weight: 600;
    margin-bottom: 0;
}

.card-body {
    padding: 12px; /* Súper compacto */
}

/* ===== FORMULARIOS ===== */
.form-label {
    margin-bottom: 3px; /* Súper compacto */
    font-size: 0.75rem; /* Más pequeño */
    font-weight: 500;
    color: var(--text-dark);
}

.form-label i {
    margin-right: 4px; /* Súper compacto */
    color: var(--accent-color);
}

.modern-input,
.modern-select,
.modern-textarea {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: var(--white-bg);
    color: var(--text-dark);
}

.modern-input:focus,
.modern-select:focus,
.modern-textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
    color: var(--text-dark);
    background: var(--white-bg);
}

/* ===== BOTONES - TAMAÑOS AJUSTADOS ===== */
.modern-btn {
    border-radius: var(--border-radius);
    padding: 8px 16px; /* Reducido de 10px 20px */
    font-weight: 500;
    font-size: 0.9rem; /* Reducido de 0.95rem */
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    line-height: 1.2;
}

.modern-btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.modern-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.modern-btn-success {
    background: var(--success-color);
    color: white;
}

.modern-btn-warning {
    background: var(--warning-color);
    color: white;
}

.modern-btn-danger {
    background: var(--danger-color);
    color: white;
}

.modern-btn-outline {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

.modern-btn-outline:hover {
    background: var(--accent-color);
    color: white;
}

/* Botones pequeños para acciones en tablas */
.modern-btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Botones grandes solo para acciones principales */
.modern-btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

/* ===== CAMPOS DE BÚSQUEDA COMPACTOS ===== */
.search-input,
.filter-input {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 6px 10px; /* Más compacto que los campos normales */
    font-size: 0.85rem;
    transition: all 0.3s ease;
    background: var(--white-bg);
    color: var(--text-dark);
    line-height: 1.2;
    height: auto;
    min-height: 36px; /* Altura mínima para mantener consistencia */
}

.search-input:focus,
.filter-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
    color: var(--text-dark);
    background: var(--white-bg);
}

/* Campos de formulario principales - tamaño estándar */
.form-input {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: var(--white-bg);
    color: var(--text-dark);
    line-height: 1.2;
    min-height: 42px;
}

.form-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
    color: var(--text-dark);
    background: var(--white-bg);
}

/* Filas de formulario súper compactas */
.compact-form-row {
    margin-bottom: 8px !important;
}

.compact-form-row .form-label {
    margin-bottom: 2px !important;
    font-size: 0.7rem !important;
}

.compact-form-row .filter-input {
    padding: 4px 8px !important;
    font-size: 0.8rem !important;
    min-height: 30px !important;
}

/* ===== CAMPOS NUMÉRICOS SIN SPINNERS ===== */
/* Ocultar spinners en campos numéricos para todos los navegadores */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type="number"] {
    -moz-appearance: textfield;
}

/* Asegurar que los campos numéricos mantengan el estilo consistente */
input[type="number"].form-control {
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

/* Deshabilitar completamente el comportamiento de incremento/decremento */
input[type="number"] {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    /* Deshabilitar el comportamiento de las flechas */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Específico para campos con ID */
#nroDireccion,
#nroDoc {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ===== TABLAS ===== */
.modern-table {
    font-size: 0.75rem; /* Más pequeño para mostrar más datos */
    background: var(--white-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.modern-table th {
    background: var(--light-bg);
    font-size: 0.7rem; /* Súper compacto */
    font-weight: 600;
    color: var(--text-dark) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 6px 8px; /* Súper compacto */
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.modern-table td {
    padding: 6px 8px; /* Súper compacto */
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark) !important;
    vertical-align: middle;
    line-height: 1.2; /* Líneas más compactas */
}

.modern-table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

/* ===== BADGES Y ESTADOS ===== */
.badge {
    font-size: 0.65rem; /* Más pequeño */
    padding: 3px 6px; /* Súper compacto */
    font-weight: 500;
    border-radius: 12px;
}

.badge.bg-success {
    background-color: var(--success-color) !important;
    color: white !important;
}

.badge.bg-warning {
    background-color: var(--warning-color) !important;
    color: white !important;
}

.badge.bg-danger {
    background-color: var(--danger-color) !important;
    color: white !important;
}

.badge.bg-info {
    background-color: var(--info-color) !important;
    color: white !important;
}

/* ===== SIDEBAR DE NAVEGACIÓN - COLAPSABLE ===== */
.sidebar {
    /* 
    OPCIONES DE COLOR PARA EL FONDO DEL SIDEBAR:
    
    1. Azul más oscuro (actual):
    background: linear-gradient(180deg, #bbdefb 0%, #e3f2fd 100%) !important;
    
    2. Azul grisáceo:
    background: linear-gradient(180deg, #cfd8dc 0%, #eceff1 100%) !important;
    
    3. Azul marino suave:
    background: linear-gradient(180deg, #b3e5fc 0%, #e1f5fe 100%) !important;
    
    4. Gris azulado:
    background: linear-gradient(180deg, #e8eaf6 0%, #f3e5f5 100%) !important;
    
    5. Azul clásico:
    background: linear-gradient(180deg, #c5cae9 0%, #e8eaf6 100%) !important;
    */
    background: linear-gradient(180deg, #5E7EFF 0%, #7B94FF 100%) !important; /* Color personalizado - forzado */
    border-right: 1px solid var(--border-color);
    min-height: calc(100vh - 40px); /* Ajustado para el navbar más pequeño */
    padding: 20px 0;
    transition: all 0.3s ease;
    width: 220px !important; /* Ancho expandido reducido - forzado */
    position: relative;
    box-shadow: var(--shadow-light);
    overflow: hidden;
}

.sidebar.collapsed {
    width: 70px !important; /* Ancho colapsado - forzado */
}

.sidebar-toggle {
    position: absolute;
    top: 15px;
    right: 5px; /* Movido más hacia la izquierda */
    background: #ffffff !important; /* Fondo blanco para contraste */
    color: #5E7EFF !important; /* Color azul para el icono */
    border: 2px solid #5E7EFF;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(94, 126, 255, 0.3);
    font-size: 0.9rem;
}

.sidebar-toggle:hover {
    background: #5E7EFF !important; /* Invertir colores en hover */
    color: white !important;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(94, 126, 255, 0.4);
}

.sidebar-toggle i {
    color: inherit !important;
    font-weight: bold;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-top: 40px; /* Espacio para el botón toggle */
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: white !important; /* Color blanco para contraste con fondo azul */
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0 25px 25px 0;
    margin-right: 20px;
    font-weight: 600; /* Aumentar peso de fuente para mejor visibilidad */
    background: transparent; /* Fondo transparente por defecto */
    position: relative;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-nav a {
    padding: 12px;
    margin-right: 0;
    border-radius: 8px;
    margin: 4px 8px;
    justify-content: center;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.2); /* Fondo blanco semitransparente en hover */
    color: white !important;
    text-decoration: none;
    transform: translateX(3px); /* Animación más sutil */
}

.sidebar.collapsed .sidebar-nav a:hover {
    transform: scale(1.05); /* Animación diferente cuando está colapsado */
}

.sidebar-nav a.active {
    background: var(--accent-color);
    color: white !important;
    box-shadow: var(--shadow-light); /* Agregar sombra para destacar */
}

.sidebar-nav i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    color: inherit; /* Heredar color del enlace padre */
    font-size: 1rem; /* Asegurar tamaño consistente */
    flex-shrink: 0; /* No permitir que el icono se encoja */
}

.sidebar.collapsed .sidebar-nav i {
    margin-right: 0;
}

.sidebar-nav .nav-text {
    transition: all 0.3s ease;
    white-space: nowrap;
    opacity: 1;
}

.sidebar.collapsed .sidebar-nav .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Tooltip para elementos colapsados */
.sidebar.collapsed .sidebar-nav a {
    position: relative;
}

.sidebar.collapsed .sidebar-nav a::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-dark);
    color: white;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar.collapsed .sidebar-nav a:hover::after {
    opacity: 1;
}

/* ===== SIDEBAR MAESTROS MENU ===== */
.maestros-menu-item {
    position: relative;
}

.maestros-toggle {
    position: relative;
}

.maestros-toggle .maestros-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
    margin-left: auto;
}

.maestros-toggle .maestros-arrow.rotated {
    transform: rotate(180deg);
}

.maestros-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0 25px 25px 0;
    margin-right: 20px;
    margin-top: 4px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.maestros-submenu.show {
    max-height: 300px;
    opacity: 1;
}

.maestros-submenu li {
    margin: 0;
}

.maestros-submenu .submenu-item {
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 50px; /* Indentado más para mostrar jerarquía */
    color: white !important;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0 25px 25px 0;
    margin-right: 20px;
    font-weight: 500;
    background: transparent;
    position: relative;
}

.maestros-submenu .submenu-item:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    text-decoration: none;
    transform: translateX(3px);
}

.maestros-submenu .submenu-item.active {
    background: var(--accent-color);
    color: white !important;
    box-shadow: var(--shadow-light);
}

.maestros-submenu .submenu-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    color: inherit;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.maestros-submenu .submenu-item .nav-text {
    transition: all 0.3s ease;
    white-space: nowrap;
    opacity: 1;
}

.submenu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 8px 20px;
}

/* Cuando el sidebar está colapsado, ocultar el submenu */
.sidebar.collapsed .maestros-submenu {
    display: none !important;
}

.sidebar.collapsed .maestros-toggle .maestros-arrow {
    display: none;
}

/* Ajustar el contenido principal */
.main-container {
    transition: all 0.3s ease;
    overflow-x: auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
    .sidebar {
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }
}

/* ===== SIDEBAR RESPONSIVE PARA MÓVIL ===== */
.mobile-menu-toggle {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 8px !important;
    color: white !important;
    padding: 8px 12px !important;
    font-size: 1.1rem !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    outline: none !important;
    box-shadow: none !important;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: white !important;
}

.mobile-menu-toggle:focus {
    outline: none !important;
    box-shadow: none !important;
}

.mobile-menu-toggle .hamburger-icon {
    color: white !important;
    font-size: 1.3rem !important;
    font-weight: bold;
    display: block;
    line-height: 1;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Sidebar móvil */
.sidebar.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    height: 100vh;
    width: 220px !important;
    z-index: 999;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.mobile-sidebar.mobile-open {
    left: 0;
}

.mobile-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.mobile-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

/* Ajustar contenido principal en móvil */
.main-container.mobile-content-shifted {
    transform: translateX(0);
}

/* En móvil, el sidebar no debe colapsar */
@media (max-width: 991px) {
    .sidebar.collapsed {
        width: 220px !important;
    }
    
    .sidebar-toggle {
        display: none !important;
    }
    
    .sidebar-nav a {
        padding: 12px 20px;
        margin-right: 20px;
        border-radius: 0 25px 25px 0;
    }
    
    .sidebar-nav .nav-text {
        opacity: 1 !important;
        width: auto !important;
        overflow: visible !important;
    }
    
    .sidebar-nav i {
        margin-right: 12px !important;
    }
    
    /* Submenu en móvil */
    .maestros-submenu {
        display: block !important;
        max-height: 0;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease;
    }
    
    .maestros-submenu.show {
        max-height: 300px;
        opacity: 1;
    }
    
    .maestros-toggle .maestros-arrow {
        display: block !important;
    }
}

/* Ajustes para pantallas muy pequeñas */
@media (max-width: 576px) {
    .sidebar.mobile-sidebar {
        width: 220px !important;
    }
    
    .brand-text {
        font-size: 0.9rem;
    }
    
    .user-menu {
        padding: 4px 8px !important;
        font-size: 0.75rem;
    }
    
    .user-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px 0;
    }
    
    .page-header {
        padding: 20px;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .modern-table {
        font-size: 0.8rem;
    }
    
    .modern-table th,
    .modern-table td {
        padding: 12px 8px;
    }
}

@media (max-width: 576px) {
    .login-box {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

/* ===== UTILIDADES ===== */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-accent { color: var(--accent-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-info { color: var(--info-color) !important; }

.bg-light { background-color: var(--light-bg) !important; }
.bg-white { background-color: var(--white-bg) !important; }

.shadow-light { box-shadow: var(--shadow-light) !important; }
.shadow-medium { box-shadow: var(--shadow-medium) !important; }
.shadow-heavy { box-shadow: var(--shadow-heavy) !important; }

.rounded { border-radius: var(--border-radius) !important; }
.rounded-lg { border-radius: var(--border-radius-lg) !important; }

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ===== ESTADOS DE CARGA ===== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(52, 152, 219, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* ===== FALLBACKS PARA ICONOS ===== */
/* Los fallbacks solo se activan cuando se agrega la clase .fa-fallback */
/* Esto evita que se muestren emojis cuando Font Awesome funciona correctamente */

/* Fallbacks específicos para iconos principales - SOLO cuando falla Font Awesome */
.fa-fallback .fa-users::before { content: "👥"; }
.fa-fallback .fa-search::before { content: "🔍"; }
.fa-fallback .fa-user::before { content: "👤"; }
.fa-fallback .fa-id-card::before { content: "🆔"; }
.fa-fallback .fa-map-marker-alt::before { content: "📍"; }
.fa-fallback .fa-list::before { content: "📋"; }
.fa-fallback .fa-edit::before { content: "✏️"; }
.fa-fallback .fa-trash::before { content: "🗑️"; }
.fa-fallback .fa-plus::before { content: "➕"; }
.fa-fallback .fa-calculator::before { content: "🧮"; }
.fa-fallback .fa-truck::before { content: "🚚"; }
.fa-fallback .fa-box::before { content: "📦"; }
.fa-fallback .fa-file-invoice-dollar::before { content: "📄"; }
.fa-fallback .fa-shopping-cart::before { content: "🛒"; }
.fa-fallback .fa-receipt::before { content: "🧾"; }
.fa-fallback .fa-tachometer-alt::before { content: "📊"; }
.fa-fallback .fa-angle-left::before { content: "◀️"; }
.fa-fallback .fa-angle-right::before { content: "▶️"; }
.fa-fallback .fa-user-cog::before { content: "⚙️"; }
.fa-fallback .fa-cog::before { content: "🔧"; }
.fa-fallback .fa-sign-out-alt::before { content: "🚪"; }

/* Estilos cuando Font Awesome falla */
.fa-fallback .fas {
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif !important;
    font-size: 1.2em;
}

.fa-fallback .brand-icon {
    font-size: 1.5em;
}

.fa-fallback .sidebar-nav .fas {
    font-size: 1.3em;
}

/* Estilos para el botón de mostrar/ocultar contraseña */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 10;
}

.password-toggle-btn:hover {
    color: #495057;
    background-color: rgba(0, 0, 0, 0.05);
}

.password-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.password-toggle-btn i {
    font-size: 16px;
}

/* Ajustar el input de contraseña para hacer espacio al botón */
.password-input-container .form-control {
    padding-right: 45px;
}

/* Estilos específicos para móvil */
@media (max-width: 768px) {
    .password-toggle-btn {
        right: 10px;
        padding: 10px;
    }
    
    .password-toggle-btn i {
        font-size: 18px;
    }
    
    .password-input-container .form-control {
        padding-right: 50px;
    }
}

