* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   CORRECCIÓN CRÍTICA GLOBAL - VIEWPORT
   ============================================ */

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* Prevenir desbordamiento de cualquier elemento */
* {
    box-sizing: border-box;
    max-width: 100%;
}

/* Excepciones necesarias */
html, body, 
.modal, .modal-content, 
.login-container, .login-background,
svg, img,
.sidebar,
.topbar {
    max-width: none;
}

/* Asegurar contenedores principales */
.app-container,
.main-content,
.content,
.section,
.card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Inputs y formularios */
input, textarea, select,
.form-group, .input-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

:root {
    --primary: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b945;
    --btntrasnp: #2564eb00;
    --warning: #f59e0b;
    --danger: #ef4444de;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}


/* Tema Oscuro */

[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

@font-face {
    font-family: "fonto";
    src: url("sans.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: "Poppins", sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
}


/* Login */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
}

.login-box {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-new {
    background: #2563eb;
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.1rem 1rem;
    font-size: 0.875rem;
}


/* App Layout */

.app-container {
    display: none;
    min-height: 100vh;
}

.app-container.active {
    display: flex;
}


/* Sidebar */

.sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.3s;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    display: flex; /* NUEVO */
    flex-direction: column; /* NUEVO */
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0; /* NUEVO */
}

.sidebar-header h2 {
    font-size: 1.25rem;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    flex: 1; /* NUEVO - Ocupa el espacio disponible */
    display: flex; /* NUEVO */
    flex-direction: column; /* NUEVO */
}

/* Separador antes de los botones del footer */
.sidebar-menu-footer {
    margin-top: auto; /* NUEVO - Empuja hacia abajo */
    border-top: 2px solid var(--border); /* Línea más gruesa */
    padding-top: 1rem; /* Espacio después de la línea */
}

.sidebar-menu li {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-menu li:hover {
    background: var(--bg-main);
}

.sidebar-menu li.active {
    background: var(--bg-main);
    border-left: 3px solid var(--primary);
    color: var(--primary);
}


/* Main Content */

.main-content {
    flex: 1;
    margin-left: 0;
    transition: margin-left 0.3s;
}

.topbar {
    background: var(--bg-card);
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1001;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    position: relative;
    z-index: 1002;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.notification-badge {
    position: relative;
    cursor: pointer;
}

.notification-badge .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}


/* Cards */

.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h3 {
    font-size: 1.25rem;
}


/* Grid */

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}


/* Stats */

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}


/* Table */

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-main);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

tr:hover {
    background: var(--bg-main);
}


/* Modal */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}


/* Badge */

.badge-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}


/* User Card */

.user-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.user-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.user-card img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.user-card-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b8c92 0%, #4d4e4e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.user-card-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-card-info h4 {
    margin-bottom: 0.25rem;
}

.user-card-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.notification-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    background: var(--danger);
    border-radius: 50%;
}

.search-box {
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9375rem;
}

.hidden {
    display: none !important;
}

.comunicados-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comunicado-item {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
}

.comunicado-item h4 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.comunicado-item .fecha {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.notificacion-item {
    padding: 1rem;
    border-left: 3px solid var(--primary);
    background: var(--bg-main);
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.notificacion-item.leida {
    opacity: 0.6;
    border-left-color: var(--secondary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.info-item {
    padding: 1rem;
    background: var(--bg-main);
    border-radius: 8px;
}

.info-item label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.25rem;
}

.info-item .value {
    font-weight: 600;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        max-width: 100vw;
    }
    
    .content {
        padding: 1rem;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
    }
    
    /* Forzar inputs al 100% */
    input, textarea, select,
    .form-group input,
    .form-group textarea,
    .form-group select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .card {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
        margin-left: 0;
        margin-right: 0;
    }
}


/* Widget de carga de imagen */

.upload-widget {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-main);
}

.upload-widget:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-widget.uploading {
    opacity: 0.6;
    pointer-events: none;
}

.preview-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 1rem auto;
    display: block;
    border: 3px solid var(--primary);
}


/* Pestañas */

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn .badge {
    background: var(--danger);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}


/* Tarjeta de solicitud */

.solicitud-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: var(--bg-card);
    transition: all 0.2s;
}

.solicitud-card:hover {
    box-shadow: var(--shadow);
}

.solicitud-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.solicitud-info {
    flex: 1;
}

.solicitud-actions {
    display: flex;
    gap: 0.5rem;
}

.empleado-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.empleado-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.empleado-avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
}


/* Botón PDF */

.btn-pdf {
    background: var(--danger);
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-pdf:hover {
    background: #dc2626;
}


/*============================================================*/

.body {
    font-family: "tuente", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@font-face {
    font-family: "tuente";
    src: url("sans.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}


/* Si tienes variantes (bold, italic, etc.) */

@font-face {
    font-family: "tuente";
    src: url("sans.ttf") format("truetype");
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: "tuente";
    src: url("sans.ttf") format("truetype");
    font-weight: normal;
    font-style: italic;
}


/* Estilos para el login mejorado */

.login-container {
    min-height: 100vh;
    display: flex;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);
}

@keyframes gradientShift {
    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(-5%, -5%) rotate(120deg);
    }
    66% {
        transform: translate(5%, 5%) rotate(240deg);
    }
}

@keyframes float {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}


/* Panel lateral informativo */

.login-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    color: white;
    position: relative;
    z-index: 2;
}

.login-sidebar h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.login-sidebar p {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.features-list {
    list-style: none;
    margin-top: 2rem;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    opacity: 0.9;
}

.features-list li::before {
    content: "✓";
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}


/* Caja de login mejorada */

.login-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 100px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 450px;
    animation: slideIn 0.6s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-box .logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-box .logo h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.login-box .logo p {
    color: #64748b;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}

.input-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.25rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9375rem;
    transition: all 0.3s;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
    color: #cbd5e1;
}

.btn-primary {
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    color: white;
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
}

.remember-me input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.forgot-password {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    color: #94a3b8;
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.help-text {
    text-align: center;
    margin-top: 1.5rem;
    color: #64748b;
    font-size: 0.875rem;
}

.help-text a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.help-text a:hover {
    text-decoration: underline;
}


/* Responsive */

@media (max-width: 1024px) {
    .login-sidebar {
        display: none;
    }
}

@media (max-width: 640px) {
    .login-box {
        padding: 2rem;
    }
    .login-sidebar h1 {
        font-size: 2rem;
    }
}

.input-icon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}


/*============================*/


/* ============================================
   LOGIN SCREEN 
   ============================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.login-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: float 20s infinite ease-in-out;
}

.login-shape.shape-1 {
    width: 500px;
    height: 500px;
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.login-shape.shape-2 {
    width: 400px;
    height: 400px;
    bottom: -100px;
    right: -100px;
    animation-delay: 5s;
}

.login-shape.shape-3 {
    width: 300px;
    height: 300px;
    top: 50%;
    right: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

.login-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    padding: 0.1rem;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem 1.3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-circle {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(234, 102, 102, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
    }
}

.logo-circle svg {
    width: 40px;
    height: 40px;
    color: white;
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.5px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.login-header p {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

.login-box .form-group {
    margin-bottom: 1.5rem;
}

.login-box .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    letter-spacing: 0.3px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    pointer-events: none;
    z-index: 1;
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

.input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    color: #1e293b;
    background: white;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-wrapper input::placeholder {
    color: #cbd5e1;
}

.btn-login {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-top: 2rem;
}

.btn-login svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-login:hover svg {
    transform: translateX(4px);
}

.btn-login:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.login-footer p {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}


/* Responsive */

@media (max-width: 480px) {
    .login-content {
        padding: 1rem;
    }
    .login-box {
        padding: 3rem 1.3rem;
    }
    .logo-circle {
        width: 120px;
        height: 120px;
    }
    .logo-circle svg {
        width: 32px;
        height: 32px;
    }
    .login-logo h1 {
        font-size: 1.5rem;
    }
    .login-header h2 {
        font-size: 1.25rem;
    }
}


/* Modal de cambio de contraseña */
#modalCambioPassword{
    background: linear-gradient(135deg, #041562 0%, #0079b1 100%);
}

#modalCambioPassword .modal-content {
    max-width: 500px;
    
}

#modalCambioPassword .modal-header {
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

#modalCambioPassword .modal-header h3 {
    margin: 0;
    color: white;
}


/* Indicador de fortaleza de contraseña */

.password-strength {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s;
    border-radius: 2px;
}

.strength-weak {
    width: 33%;
    background: var(--danger);
}

.strength-medium {
    width: 66%;
    background: var(--warning);
}

.strength-strong {
    width: 100%;
    background: var(--success);
}


/* Estilos para modal de comunicados */

#modalNuevoComunicado .modal-content {
    max-width: 600px;
}

.preview-comunicado {
    border: 2px solid var(--border);
    padding: 0.5rem;
}


/* Mejorar visualización de comunicados con imagen */

.comunicado-item {
    position: relative;
}

.comunicado-imagen {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid var(--border);
}

.comunicado-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}


/* Botón de cambio de tema */

.theme-toggle {
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle div {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.theme-toggle animated-icons {
    display: block;
}


/* Ajustes para modo oscuro en componentes específicos */

[data-theme="dark"] .login-box {
    background: rgba(30, 41, 59, 0.95);
    color: var(--text-primary);
}

[data-theme="dark"] .login-header h2,
[data-theme="dark"] .login-logo h1 {
    color: var(--text-primary);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: var(--bg-main);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] .form-group input::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] .upload-widget {
    background: var(--bg-main);
    border-color: var(--border);
}

[data-theme="dark"] .upload-widget:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

[data-theme="dark"] table tr:hover {
    background: var(--bg-main);
}

[data-theme="dark"] .modal {
    background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .user-card:hover {
    background: var(--bg-main);
}

[data-theme="dark"] .tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

[data-theme="dark"] .input-wrapper input {
    background: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] .comunicado-item,
[data-theme="dark"] .notificacion-item {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] .solicitud-card {
    background: var(--bg-card);
    border-color: var(--border);
}


/* Forzar tema claro en la pantalla de login */

#loginScreen {
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%) !important;
}

#loginScreen * {
    color-scheme: light;
}

#loginScreen .login-box {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1e293b !important;
}

#loginScreen .login-header h2,
#loginScreen .login-header p,
#loginScreen .login-logo h1 {
    color: #1e293b !important;
}

#loginScreen .form-group label {
    color: #334155 !important;
}

#loginScreen .form-group input {
    background: white !important;
    color: #1e293b !important;
    border-color: #e2e8f0 !important;
}

#loginScreen .form-group input::placeholder {
    color: #cbd5e1 !important;
}

#loginScreen .input-icon {
    color: #94a3b8 !important;
}

#loginScreen .remember-me,
#loginScreen .help-text {
    color: #64748b !important;
}

#loginScreen .forgot-password,
#loginScreen .help-text a {
    color: #3b82f6 !important;
}


/* ============================================
   MEJORAS PARA MÓVIL
   ============================================ */


/* Ocultar nombre de usuario en móvil */

@media (max-width: 768px) {
    .user-name-desktop {
        display: none;
    }
    .user-avatar {
        margin-right: 0;
    }
}

@media (min-width: 769px) {
    .user-name-desktop {
        display: inline;
    }
}


/* ============================================
   COMUNICADOS - GRID 
   ============================================ */

.comunicados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

@media (max-width: 640px) {
    .comunicados-grid {
        grid-template-columns: 1fr; /* UNA COLUMNA en móvil */
        gap: 1rem;
    }
}

.comunicado-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.comunicado-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.comunicado-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-main);
}

@media (max-width: 640px) {
    .comunicado-card-image {
         height: 250px; /* AUMENTADO de 150px a 250px */
    }
}

.comunicado-card-content {
    padding: 1rem;
}

.comunicado-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 640px) {
    .comunicado-card-title {
        font-size: 0.875rem;
        -webkit-line-clamp: 1;
    }
}

.comunicado-card-fecha {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.comunicado-card-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
}


/* Modal Vista Comunicado */

#modalVistaComunicado .modal-comunicado-content {
    background: var(--bg-card);
    border-radius: 16px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    position: relative;
    padding: 0;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 640px) {
    #modalVistaComunicado .modal-comunicado-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }
}

.close-comunicado-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s;
    color: white;
}

.close-comunicado-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.comunicado-modal-imagen {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    background: var(--bg-main);
}

.comunicado-modal-info {
    padding: 2rem;
}

@media (max-width: 640px) {
    .comunicado-modal-info {
        padding: 1.5rem;
    }
}

.comunicado-modal-titulo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
    .comunicado-modal-titulo {
        font-size: 1.25rem;
    }
}

.comunicado-modal-fecha {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comunicado-modal-contenido {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.comunicado-modal-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}


/* ============================================
   MI INFORMACIÓN - LAYOUT CON FOTO
   ============================================ */

.mi-info-container {
    display: flex;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 768px) {
    .mi-info-container {
        flex-direction: column;
        align-items: center;
    }
}

.mi-info-foto {
    flex-shrink: 0;
}

.mi-info-foto-wrapper {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .mi-info-foto-wrapper {
        width: 150px;
        height: 150px;
    }
}

.mi-info-foto-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mi-info-foto-placeholder {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    font-weight: bold;
    border: 4px solid var(--primary);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .mi-info-foto-placeholder {
        width: 150px;
        height: 150px;
        font-size: 3rem;
    }
}

.mi-info-datos {
    flex: 1;
}

@media (max-width: 768px) {
    .mi-info-datos {
        width: 100%;
    }
}


/* Ajuste para grid de info en móvil */

@media (max-width: 640px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================
   AJUSTES DE TAMAÑOS - COMUNICADOS Y USUARIOS
   ============================================ */


/* Título "Comunicados Recientes"*/

#section-comunicados .card-header h3 {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
}

@media (max-width: 640px) {
    #section-comunicados .card-header h3 {
        font-size: 1.5rem !important;
    }
}


/* Botón "Nuevo Comunicado"*/

#section-comunicados .card-header .btn-primary.btn-sm {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.75rem !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
}


/* Botón "Crear Usuario" verde */

.btn-crear-usuario {
    background: #00aeff00;
    color: white;
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-crear-usuario:hover {
    background: #244cff00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-crear-usuario:active {
    transform: translateY(0);
}


/* Ajuste en modo oscuro */

[data-theme="dark"] .btn-crear-usuario {
    background: #00aeff00;
}

[data-theme="dark"] .btn-crear-usuario:hover {
    background: #00adff;
}


/* Forzar tamaños específicos */

.card-header h3 {
    font-size: 1.25rem;
}

#section-comunicados>.card>.card-header>h3 {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    line-height: 1.2;
}

#section-comunicados>.card>.card-header>button.btn-sm {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.75rem !important;
    min-width: auto !important;
    height: auto !important;
}

@media (max-width: 640px) {
    #section-comunicados>.card>.card-header>h3 {
        font-size: 1.4rem !important;
    }
    #section-comunicados>.card>.card-header>button.btn-sm {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.7rem !important;
    }
}


/* ============================================
   BOTÓN ICONO ANIMADO - NUEVO COMUNICADO
   ============================================ */

.btn-icon-comunicado {
    background: #0097dd00;
    border: none;
    border-radius: 12px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.btn-icon-comunicado:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(36, 76, 255, 0.4);
}

.btn-icon-comunicado:active {
    transform: translateY(0);
}

@media (max-width: 640px) {
    .btn-icon-comunicado {
        min-width: 40px;
        min-height: 40px;
        padding: 0.4rem;
    }
    .btn-icon-comunicado lord-icon {
        width: 28px !important;
        height: 28px !important;
    }
}


/* Modo oscuro */

[data-theme="dark"] .btn-icon-comunicado {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .btn-icon-comunicado:hover {
    background: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* Control de colores SVG según tema */
.svg-theme-stroke {
    stroke: #000000;
}

[data-theme="dark"] .svg-theme-stroke {
    stroke: #ffffff;
}

/* Para SVGs que usan fill en lugar de stroke */
.svg-theme-fill {
    fill: #000000;
}

[data-theme="dark"] .svg-theme-fill {
    fill: #ffffff;
}

:root {
    --primary: #2563eb;
    --svg-stroke: #000000;
    --svg-fill: #000000;
}

[data-theme="dark"] {
    --primary: #3b82f6;
    --svg-stroke: #ffffff;
    --svg-fill: #ffffff;
}

/* ============================================
   NOTIFICACIONES TOAST FLOTANTES
   ============================================ */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: color-mix(in srgb, var(--bg-card) 90%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: translateX(400px);
    opacity: 0;
    animation: slideInToast 0.4s ease-out forwards;
    pointer-events: all;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.toast:hover {
    transform: translateX(0) scale(1.02);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.toast.toast-success {
    border-left-color: #34c759; 
}

.toast.toast-error {
   border-left-color: #ff3b30; 
}

.toast.toast-warning {
    border-left-color: #ff9500; 
}

.toast.toast-info {
    border-left-color: #0a84ff; 
}

.toast-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-icon lord-icon {
    width: 24px;
    height: 24px;
    display: block;
}

/*MAYBE*/

.toast-icon {
    overflow: hidden;
}


.toast-success .toast-icon {
    background: rgba(16, 185, 69, 0.1);
    color: var(--success);
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.toast-info .toast-icon {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 0 12px;
    animation: progressBar 5s linear forwards;
}

.toast-success .toast-progress {
    background: var(--success);
}

.toast-error .toast-progress {
    background: var(--danger);
}

.toast-warning .toast-progress {
    background: var(--warning);
}

@keyframes slideInToast {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInToast {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mejorar la animación de salida */
@keyframes slideOutToast {
    to {
        transform: translateX(400px) scale(0.9);
        opacity: 0;
    }
}

/* Agregar un efecto de rebote al aparecer */
.toast {
    animation: slideInToast 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.toast.toast-exit {
    animation: slideOutToast 0.3s ease-out forwards;
}

@keyframes slideOutToast {
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .toast-container {
        top: 60px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
}

/* Tema oscuro */
[data-theme="dark"] .toast {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .toast:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7);
}

/* Estilos para foto en detalle de usuario */
.user-detail-foto-wrapper {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary);
    box-shadow: var(--shadow-lg);
}

.user-detail-foto {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-detail-foto-placeholder {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    font-weight: bold;
    border: 4px solid var(--primary);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .user-detail-foto-wrapper,
    .user-detail-foto-placeholder {
        width: 150px;
        height: 150px;
        font-size: 3rem;
    }
}

/* ============================================
   RESPONSIVIDAD MEJORADA - VACACIONES Y PERMISOS
   ============================================ */

/* Stats cards en vacaciones */
@media (max-width: 768px) {
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-card .stat-label {
        font-size: 0.8rem;
    }
}

/* Formularios de vacaciones y permisos */
@media (max-width: 640px) {
    .form-group input[type="date"],
    .form-group input[type="time"],
    .form-group textarea {
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
        /*padding: 1rem;*/
        font-size: 1rem;
    }
}

/* Historial de solicitudes */
@media (max-width: 640px) {
    #historialVacaciones > div,
    #historialPermisos > div {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    #historialVacaciones strong,
    #historialPermisos strong {
        font-size: 0.9rem;
    }
    
    #historialVacaciones p,
    #historialPermisos p {
        font-size: 0.8rem;
    }
    
    .badge-status {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Tabs responsivos */
@media (max-width: 640px) {
    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        flex: 1;
        min-width: 0;
    }
    
    .tab-btn .badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.35rem;
        margin-left: 0.25rem;
    }
}

/* Solicitudes en admin vacaciones */
@media (max-width: 640px) {
    .solicitud-card {
        padding: 1rem;
    }
    
    .solicitud-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .empleado-info {
        gap: 0.75rem;
    }
    
    .empleado-avatar,
    .empleado-avatar-placeholder {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .empleado-info h4 {
        font-size: 0.9rem;
    }
    
    .empleado-info p {
        font-size: 0.75rem;
    }
    
    .solicitud-info > div {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .solicitud-info label {
        font-size: 0.75rem !important;
    }
    
    .solicitud-info p {
        font-size: 0.85rem !important;
    }
    
    .solicitud-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .solicitud-actions .btn {
        width: 100%;
    }
}

/* Search box responsivo */
@media (max-width: 640px) {
    .search-box input {
        font-size: 16px; /* Evita zoom en iOS */
        padding: 0.625rem 0.875rem;
    }
}

/* ============================================
   MODAL DE CONFIRMACIÓN
   ============================================ */

.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-overlay.active {
    opacity: 1;
}

.confirm-dialog {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-align: center;
}

.confirm-overlay.active .confirm-dialog {
    transform: scale(1);
}

.confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
}

.confirm-icon svg {
    width: 36px;
    height: 36px;
}

.confirm-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.confirm-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 2rem;
}

.confirm-actions {
    display: flex;
    gap: 0.75rem;
}

.confirm-actions .btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-cancel {
    background: var(--bg-main);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.confirm-cancel:hover {
    background: var(--border);
    transform: translateY(-1px);
}

.confirm-confirm {
    background: var(--danger);
    color: white;
    border: none;
}

.confirm-confirm:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Responsive */
@media (max-width: 640px) {
    .confirm-dialog {
        padding: 1.5rem;
        max-width: 90%;
    }
    
    .confirm-title {
        font-size: 1.25rem;
    }
    
    .confirm-message {
        font-size: 0.875rem;
    }
    
    .confirm-actions {
        flex-direction: column-reverse;
    }
    
    .confirm-actions .btn {
        width: 100%;
    }
}

/* Tema oscuro */
[data-theme="dark"] .confirm-overlay {
    background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .confirm-dialog {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* ============================================
   RESPONSIVIDAD - SOLICITUD DE VACACIONES (COLABORADOR)
   ============================================ */

/* Sección de vacaciones del colaborador */
@media (max-width: 768px) {
    #section-vacaciones .grid-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    #section-vacaciones .stat-card {
        padding: 1rem;
        text-align: center;
    }
    
    #section-vacaciones .stat-value {
        font-size: 1.75rem;
    }
    
    #section-vacaciones .stat-label {
        font-size: 0.85rem;
    }
}

@media (max-width: 640px) {
    #section-vacaciones .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    #section-vacaciones .card-header h3 {
        font-size: 1.1rem;
    }
    
    #section-vacaciones .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.4rem;
    }
    
    #section-vacaciones .form-group input[type="date"] {
        font-size: 16px; /* Evita zoom en iOS */
        padding: 0.75rem;
    }
    
    #section-vacaciones .btn-primary {
        padding: 1rem;
        font-size: 1rem;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* Historial de vacaciones */
    #historialVacaciones {
        margin-top: 1rem;
    }
    
    #historialVacaciones > div {
        padding: 0.875rem;
        margin-bottom: 0.75rem;
        border-radius: 8px;
    }
    
    #historialVacaciones strong {
        font-size: 0.9rem;
        display: block;
        margin-bottom: 0.25rem;
    }
    
    #historialVacaciones p {
        font-size: 0.8rem;
        margin: 0.25rem 0;
    }
    
    #historialVacaciones .badge-status {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        margin-top: 0.5rem;
        display: inline-block;
    }
}

/* ============================================
   RESPONSIVIDAD - SOLICITUD DE PERMISOS (COLABORADOR)
   ============================================ */

@media (max-width: 640px) {
    #section-permisos .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    #section-permisos .card-header h3 {
        font-size: 1.1rem;
    }
    
    #section-permisos .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.4rem;
    }
    
    #section-permisos .form-group input[type="date"],
    #section-permisos .form-group input[type="time"] {
        font-size: 16px; /* Evita zoom en iOS */
        padding: 0.75rem;
    }
    
    #section-permisos .form-group textarea {
        font-size: 16px; /* Evita zoom en iOS */
        padding: 0.75rem;
        min-height: 100px;
    }
    
    #section-permisos .grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    #section-permisos .btn-primary {
        padding: 1rem;
        font-size: 1rem;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* Historial de permisos */
    #historialPermisos {
        margin-top: 1rem;
    }
    
    #historialPermisos > div {
        padding: 0.875rem;
        margin-bottom: 0.75rem;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #historialPermisos strong {
        font-size: 0.9rem;
    }
    
    #historialPermisos p {
        font-size: 0.8rem;
        margin: 0.15rem 0;
    }
    
    #historialPermisos .badge-status {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        align-self: flex-start;
    }
    
    #historialPermisos > div > div {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ============================================
   MEJORAS ADICIONALES PARA TABLETS
   ============================================ */

@media (min-width: 641px) and (max-width: 1024px) {
    #section-vacaciones .grid-3,
    #section-permisos .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #section-vacaciones .stat-card,
    #section-permisos .card {
        padding: 1.25rem;
    }
}

/* ============================================
   OPTIMIZACIÓN DE INPUTS EN MOBILE
   ============================================ */

@media (max-width: 640px) {
    /* Evitar zoom en inputs en iOS */
    input[type="date"],
    input[type="time"],
    input[type="text"],
    input[type="email"],
    textarea,
    select {
        font-size: 16px !important;
    }
    
    /* Mejorar espaciado táctil */
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    /* Botones más grandes para táctil */
    .btn {
        min-height: 44px; /* Tamaño mínimo recomendado para touch */
    }
    
    /* Labels más legibles */
    .form-group label {
        font-weight: 600;
        color: var(--text-primary);
    }
}

/* ============================================
   MODO PAISAJE EN MÓVIL
   ============================================ */

@media (max-width: 896px) and (orientation: landscape) {
    #section-vacaciones .grid-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    #section-vacaciones .stat-card,
    #section-permisos .card {
        padding: 0.75rem;
    }
    
    #section-vacaciones .stat-value {
        font-size: 1.5rem;
    }
    
    .modal-content {
        max-height: 85vh;
    }
}

/* ============================================
   ACCESIBILIDAD Y CONTRASTE
   ============================================ */

@media (max-width: 640px) {
    /* Mejorar contraste de texto secundario */
    .stat-label,
    .form-group label,
    p {
        opacity: 1;
    }
    
    /* Hacer badges más visibles */
    .badge-status {
        font-weight: 700;
        letter-spacing: 0.3px;
    }
}

/* ============================================
   ANIMACIONES SUAVES PARA MÓVIL
   ============================================ */

@media (max-width: 640px) {
    .card,
    .stat-card,
    .btn {
        transition: all 0.2s ease;
    }
    
    /* Feedback visual al tocar */
    .btn:active {
        transform: scale(0.98);
    }
    
    .card:active {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
}

/* ============================================
   MEJORAS DE SCROLL EN MÓVIL
   ============================================ */

@media (max-width: 640px) {
    #historialVacaciones,
    #historialPermisos {
        -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
    }
    
    /* Ocultar scrollbar pero mantener funcionalidad */
    #historialVacaciones::-webkit-scrollbar,
    #historialPermisos::-webkit-scrollbar {
        width: 4px;
    }
    
    #historialVacaciones::-webkit-scrollbar-thumb,
    #historialPermisos::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 2px;
    }
}

/* ============================================
   MEJORAS PARA INPUTS DE FECHA/HORA
   ============================================ */

@media (max-width: 640px) {
    /* Estilizar mejor los date pickers en móvil */
    input[type="date"]::-webkit-calendar-picker-indicator,
    input[type="time"]::-webkit-calendar-picker-indicator {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
        width: 24px;
        height: 24px;
        cursor: pointer;
    }
    
    /* Hacer el área del calendario más grande */
    input[type="date"],
    input[type="time"] {
        padding-right: 3rem;
    }
}

/* ============================================
   DARK MODE - MEJORAS MÓVIL
   ============================================ */

@media (max-width: 640px) {
    [data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
    [data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator {
        filter: invert(1);
    }
    
    [data-theme="dark"] .stat-card,
    [data-theme="dark"] .card {
        border: 1px solid var(--border);
    }
}












/* ============================================
   CORRECCIÓN CRÍTICA - INPUTS EN MÓVIL
   ============================================ */

/* Asegurar que ningún input se salga del viewport */
@media (max-width: 640px) {
    /* Contenedor de formularios */
    .form-group,
    .input-wrapper {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Todos los inputs */
    input[type="date"],
    input[type="time"],
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important; /* Evita zoom en iOS */
        padding: 0.75rem 1rem !important;
        margin: 0 !important;
    }
    
    /* Input wrapper con icono */
    .input-wrapper input {
        padding-left: 3rem !important;
        padding-right: 1rem !important;
    }
    
    /* Cards y contenedores */
    .card {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }
    
    /* Content principal */
    .content {
        padding: 1rem;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    /* Secciones */
    .section {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Stats cards */
    .stat-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 1rem;
    }
    
    /* Grids */
    .grid {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
        width: 100%;
    }
}

/* ============================================
   CORRECCIÓN ESPECÍFICA - VACACIONES Y PERMISOS
   ============================================ */

@media (max-width: 640px) {
    /* Sección de vacaciones */
    #section-vacaciones,
    #section-permisos {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        padding: 0;
    }
    
    #section-vacaciones .card,
    #section-permisos .card {
        width: 100%;
        max-width: 100%;
        margin: 0 0 1rem 0;
        padding: 1rem;
        box-sizing: border-box;
    }
    
    #section-vacaciones .form-group,
    #section-permisos .form-group {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    #section-vacaciones input,
    #section-permisos input,
    #section-permisos textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Botones */
    #section-vacaciones .btn,
    #section-permisos .btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0.5rem 0 0 0 !important;
    }
    
    /* Historial */
    #historialVacaciones,
    #historialPermisos {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    #historialVacaciones > div,
    #historialPermisos > div {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0.875rem;
        margin-bottom: 0.75rem;
    }
}

/* ============================================
   CORRECCIÓN - ADMIN VACACIONES
   ============================================ */

@media (max-width: 640px) {
    #section-admin-vacaciones {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        padding: 0;
    }
    
    #section-admin-vacaciones .card {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
        box-sizing: border-box;
        margin: 0 0 1rem 0;
    }
    
    #section-admin-vacaciones .search-box {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    #section-admin-vacaciones .search-box input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Tabs */
    #section-admin-vacaciones > .card > div:first-of-type {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        flex: 1 1 auto;
        min-width: fit-content;
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Contenido de tabs */
    .tab-content {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Solicitudes */
    .solicitud-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 1rem;
        margin-bottom: 1rem;
    }
}

/* ============================================
   PREVENCIÓN DE OVERFLOW GLOBAL
   ============================================ */

@media (max-width: 640px) {
    /* Prevenir scroll horizontal en toda la app */
    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    .app-container {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .main-content {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Asegurar que todos los elementos respeten el ancho */
    * {
        max-width: 100%;
    }
    
    /* Excepciones necesarias */
    .modal,
    .modal-content,
    .login-container,
    svg,
    img {
        max-width: none;
    }
}

/* ============================================
   CORRECCIÓN - LABELS Y TEXTOS
   ============================================ */

@media (max-width: 640px) {
    .form-group label {
        width: 100%;
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.875rem;
        word-wrap: break-word;
    }
    
    .card-header {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .card-header h3 {
        flex: 1 1 100%;
        margin-bottom: 0.5rem;
        font-size: 1.25rem;
    }
    
    .card-header button {
        flex-shrink: 0;
    }
}

/* ============================================
   CORRECCIÓN - STAT CARDS
   ============================================ */

@media (max-width: 640px) {
    .stat-card {
        text-align: center;
        padding: 1.25rem 1rem;
    }
    
    .stat-value {
        font-size: 2rem !important;
        word-break: break-word;
    }
    
    .stat-label {
        font-size: 0.875rem;
        word-wrap: break-word;
    }
}









/* ============================================
   RESET DE BOX-SIZING UNIVERSAL
   ============================================ */

* {
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

/* ============================================
   CORRECCIÓN - VIEWPORT META TAG HELPER
   ============================================ */

@media (max-width: 640px) {
    /* Asegurar que el contenido nunca exceda el viewport */
    html {
        overflow-x: hidden;
        width: 100%;
    }
    
    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
    
    /* Prevenir que elementos fixed/absolute causen scroll */
    .topbar {
        width: 100%;
        max-width: 100vw;
        left: 0;
        right: 0;
    }
    
    .sidebar {
        max-width: 100vw;
    }
}

/* ============================================
   DEBUGGING - QUITAR DESPUÉS DE VERIFICAR
   ============================================ */

/* Descomenta estas líneas temporalmente para identificar elementos que causan overflow:

@media (max-width: 640px) {
    * {
        outline: 1px solid red !important;
    }
}

*/


















/* ============================================
   CORRECCIÓN NUCLEAR - ÚLTIMO RECURSO
   ============================================ */

@media (max-width: 640px) {
    /* Forzar todo input al 100% sin excepciones */
    #section-vacaciones input[type="date"],
    #section-vacaciones input[type="time"],
    #section-permisos input[type="date"],
    #section-permisos input[type="time"],
    #section-permisos textarea,
    input[type="date"],
    input[type="time"],
    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        padding: 0.75rem 1rem !important;
        margin: 0 !important;
        font-size: 16px !important;
    }
    
    /* Forzar contenedores */
    #section-vacaciones,
    #section-permisos,
    #section-admin-vacaciones {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        padding: 0 !important;
    }
    
    #section-vacaciones .card,
    #section-permisos .card,
    #section-admin-vacaciones .card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 1rem !important;
        margin: 0 0 1rem 0 !important;
    }
    
    #section-vacaciones .form-group,
    #section-permisos .form-group {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        margin: 0 0 1rem 0 !important;
    }
    
    /* Grid sin excepciones */
    .grid,
    .grid-2,
    .grid-3 {
        width: 100% !important;
        max-width: 100% !important;
        grid-template-columns: 1fr !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Stat cards */
    .stat-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Botones */
    .btn,
    #section-vacaciones .btn,
    #section-permisos .btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* ============================================
   CORRECCIÓN ESPECÍFICA PARA INPUT WRAPPER
   ============================================ */

@media (max-width: 640px) {
    .input-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        position: relative !important;
    }
    
    .input-wrapper input {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 3rem !important;
    }
}

/* ============================================
   CORRECCIÓN - INPUT DE FECHA EN CORTESÍAS MÓVIL
   ============================================ */

@media (max-width: 640px) {
    /* Sección de cortesías */
    #section-cortesias {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        padding: 0;
    }
    
    #section-cortesias .card {
        width: 100%;
        max-width: 100%;
        margin: 0 0 1rem 0;
        padding: 1rem;
        box-sizing: border-box;
    }
    
    #section-cortesias .form-group {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
        box-sizing: border-box;
    }
    
    #section-cortesias input,
    #section-cortesias select,
    #section-cortesias textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important; /* Evita zoom en iOS */
        padding: 0.75rem 1rem !important;
        margin: 0 !important;
    }
    
    #section-cortesias .btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0.5rem 0 0 0 !important;
    }
    
    /* Input de fecha específico */
    #cortesiaFecha {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0.75rem 1rem !important;
        padding-right: 3rem !important; /* Espacio para el ícono del calendario */
    }
    
    /* Historial de cortesías */
    #historialCortesias {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    #historialCortesias > div {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0.875rem;
        margin-bottom: 0.75rem;
    }
    
    /* Admin cortesías */
    #section-admin-cortesias {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        padding: 0;
    }
    
    #section-admin-cortesias .card {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
        box-sizing: border-box;
        margin: 0 0 1rem 0;
    }
    
    #section-admin-cortesias .search-box {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    #section-admin-cortesias .search-box input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Tabs de cortesías */
    #section-admin-cortesias > .card > div:first-of-type {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   CORRECCIÓN ADICIONAL - TODOS LOS SELECTS
   ============================================ */

@media (max-width: 640px) {
    select,
    #cortesiaTipo,
    #nuevoRol,
    .form-group select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important;
        padding: 0.75rem 2.5rem 0.75rem 1rem !important; /* Espacio para la flecha */
        margin: 0 !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 1rem center;
        background-size: 12px;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
}

/* ============================================
   MODO OSCURO - CORTESÍAS
   ============================================ */

[data-theme="dark"] #section-cortesias input,
[data-theme="dark"] #section-cortesias select,
[data-theme="dark"] #section-cortesias textarea {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] #section-cortesias input::placeholder,
[data-theme="dark"] #section-cortesias textarea::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}/* ============================================
   CORRECCIÓN - INPUT DE FECHA EN CORTESÍAS MÓVIL
   ============================================ */

@media (max-width: 640px) {
    /* Sección de cortesías */
    #section-cortesias {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        padding: 0;
    }
    
    #section-cortesias .card {
        width: 100%;
        max-width: 100%;
        margin: 0 0 1rem 0;
        padding: 1rem;
        box-sizing: border-box;
    }
    
    #section-cortesias .form-group {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
        box-sizing: border-box;
    }
    
    #section-cortesias input,
    #section-cortesias select,
    #section-cortesias textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important; /* Evita zoom en iOS */
        padding: 0.75rem 1rem !important;
        margin: 0 !important;
    }
    
    #section-cortesias .btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0.5rem 0 0 0 !important;
    }
    
    /* Input de fecha específico */
    #cortesiaFecha {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0.75rem 1rem !important;
        padding-right: 3rem !important; /* Espacio para el ícono del calendario */
    }
    
    /* Historial de cortesías */
    #historialCortesias {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    #historialCortesias > div {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0.875rem;
        margin-bottom: 0.75rem;
    }
    
    /* Admin cortesías */
    #section-admin-cortesias {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        padding: 0;
    }
    
    #section-admin-cortesias .card {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
        box-sizing: border-box;
        margin: 0 0 1rem 0;
    }
    
    #section-admin-cortesias .search-box {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    #section-admin-cortesias .search-box input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Tabs de cortesías */
    #section-admin-cortesias > .card > div:first-of-type {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   CORRECCIÓN ADICIONAL - TODOS LOS SELECTS
   ============================================ */

@media (max-width: 640px) {
    select,
    #cortesiaTipo,
    #nuevoRol,
    .form-group select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important;
        padding: 0.75rem 2.5rem 0.75rem 1rem !important; /* Espacio para la flecha */
        margin: 0 !important;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 1rem center;
        background-size: 12px;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
}

/* ============================================
   MODO OSCURO - CORTESÍAS
   ============================================ */

[data-theme="dark"] #section-cortesias input,
[data-theme="dark"] #section-cortesias select,
[data-theme="dark"] #section-cortesias textarea {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border);
}

[data-theme="dark"] #section-cortesias input::placeholder,
[data-theme="dark"] #section-cortesias textarea::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}













/* ============================================
   FIX CRÍTICO - INPUTS DE FECHA EN iOS
   ============================================ */

@media (max-width: 640px) {
    /* Forzar inputs de fecha al 100% en iOS */
    input[type="date"],
    #vacFechaInicio,
    #vacFechaFin,
    #permisoFecha,
    #cortesiaFecha,
    #nuevoFechaIngreso {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        padding: 1rem 1rem !important; /* Aumentado de 0.75rem a 1rem */
        min-height: 50px !important; /* NUEVO: Altura mínima */
        height: auto !important; /* NUEVO: Altura automática */
        margin: 0 !important;
        font-size: 16px !important;
        line-height: 1.5 !important; /* NUEVO: Espaciado de línea */
        border: 2px solid var(--border) !important;
        border-radius: 8px !important;
        background-color: var(--bg-card) !important;
        color: var(--text-primary) !important;
        display: flex !important; /* NUEVO: Mejor alineación vertical */
        align-items: center !important; /* NUEVO: Centrar contenido */
    }
    
    /* Asegurar que el contenedor no tenga padding extra */
    .form-group {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Forzar que el card tampoco tenga overflow */
    .card,
    #section-vacaciones .card,
    #section-permisos .card,
    #section-cortesias .card {
        overflow: hidden !important;
    }
}

/* Específico para iOS */
@supports (-webkit-touch-callout: none) {
    input[type="date"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 1rem 1rem !important;
        min-height: 50px !important; /* NUEVO */
        height: auto !important; /* NUEVO */
        line-height: 1.5 !important; /* NUEVO */
    }
}

/* ============================================
   MEJORAS VISUALES - SECCIÓN USUARIOS
   ============================================ */

/* Grid de usuarios mejorado */
#usuariosList.grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

@media (max-width: 768px) {
    #usuariosList.grid-3 {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    #usuariosList.grid-3 {
        grid-template-columns: 1fr;
    }
}

/* User card mejorada */
.user-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
}

.user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    z-index: 0;
}

.user-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: var(--primary);
}

.user-card-header {
    position: relative;
    z-index: 1;
    padding: 1.5rem 1rem 0.5rem;
    display: flex;
    justify-content: center;
}

.user-card-avatar-wrapper {
    position: relative;
    display: inline-block;
}

.user-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b8c92 0%, #4d4e4e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    border: 4px solid var(--bg-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.user-card:hover .user-card-avatar {
    transform: scale(1.05);
}

.user-card-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-card-body {
    padding: 1rem 1.25rem 1.25rem;
    text-align: center;
    background: var(--bg-card);
    position: relative;
    z-index: 1;
}

.user-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-card-info h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.user-card-meta p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.user-card-meta svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.user-card-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.75rem;
    background: var(--bg-main);
    color: var(--text-secondary);
}

.user-card-badge.role-administrador {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.user-card-badge.role-staff {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.user-card-badge.role-colaborador {
    background: rgba(16, 185, 69, 0.1);
    color: #059669;
}

/* Notification dot mejorado */
.user-card .notification-dot {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 16px;
    height: 16px;
    background: #ef4444;
    border-radius: 50%;
    border: 3px solid white;
    z-index: 2;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* Header de sección usuarios mejorado */
#section-admin-usuarios .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

#section-admin-usuarios .card-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#section-admin-usuarios .card-header h3::before {
    font-size: 1.5rem;
}

/* Search box mejorado */
#section-admin-usuarios .search-box {
    position: relative;
    margin-bottom: 2rem;
}

#section-admin-usuarios .search-box::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.35-4.35'%3E%3C/path%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

#section-admin-usuarios .search-box input {
    padding-left: 3rem;
    font-size: 0.95rem;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

#section-admin-usuarios .search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Estado vacío */
.users-empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.users-empty-state svg {
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.users-empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.users-empty-state p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Tema oscuro */
[data-theme="dark"] .user-card::before {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
}

[data-theme="dark"] .user-card .notification-dot {
    border-color: var(--bg-card);
}

[data-theme="dark"] #section-admin-usuarios .search-box::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.35-4.35'%3E%3C/path%3E%3C/svg%3E");
}

/* Responsive */
@media (max-width: 640px) {
    .user-card-avatar {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }
    
    .user-card-body {
        padding: 0.875rem 1rem 1rem;
    }
    
    .user-card-info h4 {
        font-size: 1rem;
    }
    
    .user-card-meta p {
        font-size: 0.8rem;
    }
    
    #section-admin-usuarios .card-header h3 {
        font-size: 1.5rem;
    }
}


/* ============================================
   GESTIÓN DE PRIMA VACACIONAL
   ============================================ */

.prima-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: var(--bg-card);
    transition: all 0.2s;
}

.prima-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.prima-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.prima-info {
    flex: 1;
}

.prima-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 640px) {
    #section-admin-prima-vacacional {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        padding: 0;
    }
    
    #section-admin-prima-vacacional .card {
        width: 100%;
        max-width: 100%;
        padding: 1rem;
        box-sizing: border-box;
        margin: 0 0 1rem 0;
    }
    
    #section-admin-prima-vacacional .search-box {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    #section-admin-prima-vacacional .search-box input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .prima-card {
        padding: 1rem;
    }
    
    .prima-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .prima-info > div {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .prima-info label {
        font-size: 0.75rem !important;
    }
    
    .prima-info p {
        font-size: 0.85rem !important;
    }
    
    .prima-actions {
        flex-direction: column;
    }
    
    .prima-actions .btn {
        width: 100%;
    }
}

/* Tema oscuro */
[data-theme="dark"] .prima-card {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] .prima-card:hover {
    background: var(--bg-main);
}



/* ============================================
   MEJORAS PARA MODAL DE COMUNICADOS EN MÓVIL
   ============================================ */

/* SOLO MÓVIL - No afecta escritorio */
@media (max-width: 768px) {
  .modal-comunicado-content {
    width: 100%; /* Ancho completo */
    max-width: 100vw;
    max-height: 95vh; /* Altura casi completa */
    border-radius: 0; /* Sin bordes redondeados para aprovechar espacio */
    margin: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Imagen MUCHO MÁS GRANDE en móvil */
  .comunicado-modal-imagen {
    max-height: none; /* Sin límite de altura */
    height: auto; /* Altura automática según proporción */
    min-height: 70vh; /* Mínimo 70% de la pantalla */
    max-width: 100%;
    object-fit: contain; /* Mantener proporción 9:16 */
    border-radius: 0;
    width: 100%;
    background: #000; /* Fondo negro para imágenes verticales */
  }

  /* Info más compacta */
  .comunicado-modal-info {
    padding: 1.5rem 1.25rem;
    background: var(--bg-card);
  }

  .comunicado-modal-titulo {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
  }

  .comunicado-modal-fecha {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
  }

  .comunicado-modal-fecha img {
    width: 22px !important;
    height: 22px !important;
    margin-right: 6px !important;
  }

  .comunicado-modal-contenido {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-primary);
  }

  .comunicado-modal-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    flex-direction: column;
    gap: 0.75rem;
  }

  .comunicado-modal-actions .btn {
    width: 100%;
    padding: 0.875rem;
  }

  .close-comunicado-btn {
    position: fixed; /* Fijo en la pantalla */
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 9999;
  }

  .close-comunicado-btn:active {
    transform: scale(0.95);
  }

  .close-comunicado-btn svg {
    width: 24px;
    height: 24px;
  }

  /* Centrar el modal verticalmente SOLO cuando está activo */
  #modalVistaComunicado.active {
    display: flex !important;
    align-items: flex-start; /* Alineación superior */
    justify-content: center;
    padding: 16px;
  }

  /* Scroll suave */
  #modalVistaComunicado {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .modal-comunicado-content {
    width: 98%;
    max-height: 92vh;
  }

  /* Para pantallas MUY pequeñas, seguir con imagen grande pero ajustada */
  .comunicado-modal-imagen {
    min-height: 65vh; /* Un poco menos en pantallas muy pequeñas */
  }

  .comunicado-modal-info {
    padding: 1.25rem 1rem;
  }

  .comunicado-modal-titulo {
    font-size: 1.25rem;
  }

  .comunicado-modal-contenido {
    font-size: 0.95rem;
  }

  .close-comunicado-btn {
    top: 0.75rem;
    right: 0.75rem;
    width: 42px;
    height: 42px;
  }
}

/* ESCRITORIO - Mantener tamaño original */
@media (min-width: 769px) {
  .comunicado-modal-imagen {
    max-height: 60vh; /* Tamaño original en escritorio */
  }
}

/* ============================================
   MEJORAS PARA GRID DE COMUNICADOS EN MÓVIL
   ============================================ */

@media (max-width: 768px) {
  .comunicados-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem; /* Más espacio entre cards */
  }

  .comunicado-card {
    margin-bottom: 0;
  }

  .comunicado-card-image {
    height: 280px;
  }

  .comunicado-card-title {
    font-size: 1.1rem;
  }

  .comunicado-card-fecha {
    font-size: 0.875rem;
  }

  .comunicado-card-fecha img {
    width: 20px !important;
    height: 20px !important;
  }
}

@media (max-width: 480px) {
  .comunicado-card-image {
   height: 220px; 
  }

  .comunicado-card-title {
    font-size: 1rem;
  }

  .comunicado-card-content {
    padding: 1rem;
  }
}

.topbar {
    background: var(--bg-card);
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* NUEVO */
    backdrop-filter: blur(10px); /* NUEVO - efecto de cristal */
    -webkit-backdrop-filter: blur(10px); /* NUEVO - Safari */
}

/* NUEVO - Tema oscuro */
[data-theme="dark"] .topbar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   FOOTER
   ============================================ */

.app-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    padding: 2.5rem 0 1.5rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-section p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.footer-section p svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-links a:hover {
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(36, 76, 255, 0.3);
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.footer-trademark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .app-footer {
        padding: 2rem 0 1rem;
        margin-top: 2rem;
    }
    
    .footer-content {
        padding: 0 1rem;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-section p {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-bottom {
        padding: 1rem 1rem 0;
    }
    
    .footer-trademark {
        font-size: 0.8rem;
    }
}

/* Tema oscuro */
[data-theme="dark"] .app-footer {
    background: var(--bg-card);
}

[data-theme="dark"] .social-links a {
    background: var(--bg-main);
}

[data-theme="dark"] .social-links a:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
}


/* ============================================
   MODAL CAMBIO DE CONTRASEÑA USUARIO
   ============================================ */

#modalCambioPasswordUsuario .modal-content {
    max-width: 500px;
}

#modalCambioPasswordUsuario .modal-header {
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

#modalCambioPasswordUsuario .modal-header h3 {
    margin: 0;
    color: white;
    display: flex;
    align-items: center;
}

#modalCambioPasswordUsuario .modal-header .close-modal {
    color: white;
}

#modalCambioPasswordUsuario .form-group {
    margin-bottom: 1.25rem;
}

/* Responsive */
@media (max-width: 640px) {
    #modalCambioPasswordUsuario .modal-content {
        width: 95%;
    }
    
    #modalCambioPasswordUsuario .modal-body {
        padding: 1.25rem;
    }
    
    #modalCambioPasswordUsuario .form-group input {
        font-size: 16px !important;
    }
    
    #modalCambioPasswordUsuario button {
        font-size: 0.95rem;
        padding: 0.875rem;
    }
}

/* Tema oscuro */
[data-theme="dark"] #modalCambioPasswordUsuario .modal-header {
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
}

/* ============================================
   MODAL RECUPERAR CONTRASEÑA
   ============================================ */

#modalRecuperarPassword .modal-content {
    max-width: 500px;
}

#modalRecuperarPassword .modal-header {
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

#modalRecuperarPassword .modal-header h3 {
    margin: 0;
    color: white;
    display: flex;
    align-items: center;
}

#modalRecuperarPassword .modal-header .close-modal {
    color: white;
}

#modalRecuperarPassword .form-group {
    margin-bottom: 1.25rem;
}

#modalRecuperarPassword #nombreEmpleadoRecuperar {
    color: var(--primary);
    font-size: 1.1rem;
}

/* Animación de transición entre pasos */
#paso1Recuperar,
#paso2Recuperar {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 640px) {
    #modalRecuperarPassword .modal-content {
        width: 95%;
    }
    
    #modalRecuperarPassword .modal-body {
        padding: 1.25rem;
    }
    
    #modalRecuperarPassword .form-group input {
        font-size: 16px !important;
    }
    
    #modalRecuperarPassword button {
        font-size: 0.95rem;
        padding: 0.875rem;
    }
    
    #modalRecuperarPassword #nombreEmpleadoRecuperar {
        font-size: 1rem;
    }
}

/* Tema oscuro */
[data-theme="dark"] #modalRecuperarPassword .modal-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

[data-theme="dark"] #modalRecuperarPassword #nombreEmpleadoRecuperar {
    color: #3b82f6;
}




/* ============================================
   MODAL RESTABLECER CONTRASEÑA
   ============================================ */

#modalRestablecerPassword .modal-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

#modalRestablecerPassword .modal-header h3 {
    margin: 0;
    color: white;
}

#modalRestablecerPassword .modal-header .close-modal {
    color: white;
}

#passwordTemporal {
    user-select: all;
    cursor: pointer;
}

#passwordTemporal:hover {
    background: rgba(37, 99, 235, 0.05) !important;
}

/* Tema oscuro */
[data-theme="dark"] #modalRestablecerPassword .modal-header {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

[data-theme="dark"] #passwordTemporal {
    background: var(--bg-card) !important;
    color: var(--primary) !important;
}



/* ============================================
   FOOTER DEL LOGIN
   ============================================ */

.login-footer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1rem 2rem;
    z-index: 10;
}

.login-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.login-footer-social {
    display: flex;
    gap: 1rem;
}

.login-footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-footer-social a:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.login-footer-text {
    text-align: right;
}

.login-footer-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    margin: 0.15rem 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.login-footer-dev {
    font-size: 0.7rem !important;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .login-footer-bar {
        padding: 0.875rem 1rem;
    }
    
    .login-footer-content {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .login-footer-social {
        justify-content: center;
    }
    
    .login-footer-text {
        text-align: center;
    }
    
    .login-footer-text p {
        font-size: 0.75rem;
    }
    
    .login-footer-dev {
        font-size: 0.65rem !important;
    }
}

@media (max-width: 480px) {
    .login-footer-text p {
        font-size: 0.7rem;
    }
    
    .login-footer-dev {
        font-size: 0.6rem !important;
    }
    
    .login-footer-social a {
        width: 32px;
        height: 32px;
    }
    
    .login-footer-social a svg {
        width: 16px;
        height: 16px;
    }
}

/* ============================================
   BOTÓN DE TEMA EN SIDEBAR
   ============================================ */

/* Estilos para los botones del footer del sidebar */
.sidebar-menu li[onclick="toggleTheme()"],
.sidebar-menu li[onclick="logout()"] {
    margin-top: 0; /* Resetear margin */
}

.sidebar-menu li[onclick="toggleTheme()"] {
    border-top: none; /* Quitar borde individual */
    border-top: 1px solid var(--border);
    padding-top: 0.75rem; /* Padding normal */
}

.sidebar-menu li[onclick="toggleTheme()"]:hover {
    background: var(--bg-main);
}

#themeIconSidebar {
    transition: all 0.3s ease;
}

#themeIconSidebar svg {
    transition: transform 0.3s ease;
}

.sidebar-menu li[onclick="toggleTheme()"]:hover #themeIconSidebar svg {
    transform: rotate(15deg);
}

/* ============================================
   BOTONES MI INFORMACIÓN - RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    /* Botones de Mi Información más accesibles en móvil */
    #miInfoContent > div:last-child {
        margin-top: 1.5rem !important;
        max-width: 100% !important;
    }
    
    #miInfoContent .btn {
        width: 100%;
        padding: 1rem 1.25rem !important;
        font-size: 0.95rem;
    }
    
    #miInfoContent .btn img,
    #miInfoContent .btn svg {
        width: 18px !important;
        height: 18px !important;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    /* Tablets */
    #miInfoContent > div:last-child {
        max-width: 400px !important;
    }
}

/* ============================================
   CORRECCIÓN FOOTER LOGIN EN MÓVIL
   ============================================ */

@media (max-width: 768px) {
    .login-container {
        padding-bottom: 120px; /* Espacio para el footer */
    }
    
    .login-content {
        padding: 1rem;
        margin-bottom: 0; /* Asegurar que no haya margen extra */
    }
    
    .login-box {
        margin-bottom: 0;
    }
    
    .login-footer-bar {
        position: fixed; /* Cambiar de absolute a fixed */
        padding: 0.75rem 1rem;
    }
    
    .login-footer-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .login-footer-text p {
        font-size: 0.7rem;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding-bottom: 140px;
    }
    
    .login-footer-bar {
        padding: 0.65rem 0.75rem;
    }
    
    .login-footer-social a {
        width: 30px;
        height: 30px;
    }
    
    .login-footer-social a svg {
        width: 14px;
        height: 14px;
    }
}


/* ============================================
   MODAL CAMBIO DE ROL
   ============================================ */

#modalCambioRol .modal-content {
    max-width: 500px;
    animation: slideUp 0.3s ease-out;
}

#nuevoRolSelect {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    margin: 1rem 0;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

#nuevoRolSelect:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

@media (max-width: 640px) {
    #modalCambioRol .modal-content {
        width: 95%;
        padding: 1rem;
    }
    
    #nuevoRolSelect {
        font-size: 16px !important; /* Evita zoom en iOS */
    }
}

/* Tema oscuro */
[data-theme="dark"] #nuevoRolSelect {
    background: var(--bg-main);
    border-color: var(--border);
}

/* ============================================
   BOTÓN MOSTRAR/OCULTAR CONTRASEÑA
   ============================================ */

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

.toggle-password:hover {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.95);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

/* Ajustar padding del input para dar espacio al botón */
.input-wrapper input[type="password"],
.input-wrapper input[type="text"] {
    padding-right: 3.5rem !important;
}

/* Modo oscuro */
[data-theme="dark"] .toggle-password {
    color: #cbd5e1;
}

[data-theme="dark"] .toggle-password:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

/* Responsive */
@media (max-width: 640px) {
    .toggle-password {
        width: 36px;
        height: 36px;
    }
    
    .toggle-password svg {
        width: 22px;
        height: 22px;
    }
}

/* ============================================
   BOTÓN FLOTANTE Y PANEL DE ESTADO
   ============================================ */

.btn-floating-status {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    border: none;
    box-shadow: 0 4px 20px rgba(36, 76, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.btn-floating-status:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(36, 76, 255, 0.6);
}

.btn-floating-status:active {
    transform: scale(0.95);
}

.btn-floating-status svg {
    color: white;
}
.badge-floating {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 3px solid white;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}
/* ============================================
   PANEL FLOTANTE
   ============================================ */
.panel-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 420px; /* ANCHO FIJO */
    height: 600px; /* ALTURA FIJA */
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 998;
    display: none;
    flex-direction: column;
    overflow: hidden; /* CRÍTICO: previene expansión */
    animation: slideUpPanel 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.panel-floating.active {
    display: flex;
}

@keyframes slideUpPanel {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   HEADER - ALTURA FIJA
   ============================================ */

.panel-floating-header {
    flex-shrink: 0; /* NO se encoge */
    height: 64px; /* ALTURA FIJA */
    padding: 0 1.5rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    color: white;
}
.panel-floating-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap; /* Evita saltos de línea */
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-close-panel {
    flex-shrink: 0; /* NO se encoge */
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: white;
    transition: all 0.2s;
}

.btn-close-panel:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ============================================
   TABS - ALTURA FIJA
   ============================================ */

.panel-floating-tabs {
     flex-shrink: 0; /* NO se encoge */
    height: 56px; /* ALTURA FIJA */
    display: flex;
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border);
    overflow-x: auto; /* Scroll horizontal si es necesario */
    overflow-y: hidden;
}

/* Ocultar scrollbar pero mantener funcionalidad */
.panel-floating-tabs::-webkit-scrollbar {
    height: 3px;
}

.panel-floating-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.panel-floating-tabs::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.tab-panel-btn {
    flex-shrink: 0; /* NO se encoge */
    background: transparent;
    border: none;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-panel-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.tab-panel-btn.active {
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    color: white;
}

.badge-tab {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
}

.tab-panel-btn.active .badge-tab {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   CONTENIDO - ALTURA FLEXIBLE CON SCROLL
   ============================================ */

.panel-floating-content {
    flex: 1; /* Ocupa el espacio restante */
    min-height: 0; /* CRÍTICO: permite scroll correcto */
    overflow-y: auto; /* Scroll vertical */
    overflow-x: hidden; /* Sin scroll horizontal */
    padding: 1rem;
}


/* Scrollbar personalizada */
.panel-floating-content::-webkit-scrollbar {
    width: 6px;
}

.panel-floating-content::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 3px;
}

.panel-floating-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.panel-floating-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============================================
   TABS DE CONTENIDO
   ============================================ */

.tab-estado-content {
    display: none;
    width: 100%;
    height: 100%; /* Ocupa todo el alto disponible */
}

.tab-estado-content.active {
    display: block;
}

/* ============================================
   ITEMS
   ============================================ */

.estado-item,
.notif-item {
    flex-shrink: 0; /* NO se encogen */
    background: var(--bg-main);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
}

.estado-item:hover,
.notif-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.estado-item:last-child,
.notif-item:last-child {
    margin-bottom: 0; /* Quitar margen del último item */
}

/* Estados de color */
.estado-item.pendiente_jefe {
    border-left-color: #f59e0b;
}

.estado-item.pendiente_staff {
    border-left-color: #3b82f6;
}

.estado-item.aprobado {
    border-left-color: #10b981;
}

.estado-item.rechazado {
    border-left-color: #ef4444;
}

.notif-item.leida {
    opacity: 0.6;
}

.notif-item:hover {
    border-left-color: var(--primary);
}

/* ============================================
   ESTADO VACÍO
   ============================================ */

.estado-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.estado-item-tipo {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.estado-item-estado {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
}

.estado-pendiente_jefe {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.estado-pendiente_staff {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.estado-aprobado {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.estado-rechazado {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.estado-item-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.estado-item-info p {
    margin: 0.25rem 0;
}

.estado-item-info strong {
    color: var(--text-primary);
}

.estado-timeline {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
}

.estado-timeline-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.estado-timeline-step.completado {
    color: #10b981;
}

.estado-timeline-step.actual {
    color: var(--primary);
    font-weight: 600;
}

.estado-timeline-step svg {
    width: 16px;
    height: 16px;
}

.estado-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    height: 100%; /* Ocupa todo el espacio disponible */
}

.estado-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.estado-empty p {
    margin: 0;
    font-size: 0.95rem;
}

/* ============================================
   RESPONSIVE - TAMAÑOS AJUSTADOS
   ============================================ */

/* Responsive */
@media (max-width: 768px) {
    .btn-floating-status {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 56px;
        height: 56px;
    }
    
    .panel-floating {
        bottom: 1.5rem;
        right: 1.5rem;
        left: 1.5rem;
        width: auto; /* Ancho flexible en móvil */
        height: 70vh; /* ALTURA FIJA como porcentaje */
    }
    
    .panel-floating-header {
        height: 56px;
        padding: 0 1rem;
    }
    
    .panel-floating-tabs {
        height: 52px;
        padding: 0.5rem;
    }
    
    .tab-panel-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.625rem;
    }
}

@media (max-width: 768px) {
    .btn-floating-status {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 56px;
        height: 56px;
    }
    
    .panel-floating {
        bottom: 1.5rem;
        right: 1.5rem;
        left: 1.5rem;
        width: auto; /* Ancho flexible en móvil */
        height: 70vh; /* ALTURA FIJA como porcentaje */
    }
    
    .panel-floating-header {
        height: 56px;
        padding: 0 1rem;
    }
    
    .panel-floating-tabs {
        height: 52px;
        padding: 0.5rem;
    }
    
    .tab-panel-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.625rem;
    }
}

/* ============================================
   TEMA OSCURO
   ============================================ */

[data-theme="dark"] .panel-floating {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .btn-close-panel:hover {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .estado-item,
[data-theme="dark"] .notif-item {
    background: var(--bg-card);
}

[data-theme="dark"] .estado-item:hover,
[data-theme="dark"] .notif-item:hover {
    background: var(--bg-main);
}

/* ============================================
   ITEMS DE NOTIFICACIONES EN PANEL
   ============================================ */

.notif-item {
    background: var(--bg-main);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.notif-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary);
}

.notif-item.leida {
    opacity: 0.6;
}

.notif-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(36, 76, 255, 0.1);
    border-radius: 10px;
    color: var(--primary); /* Color del SVG */
}

.notif-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor; /* Hereda el color del contenedor */
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.notif-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.notif-unread-dot {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-dot 2s infinite;
}

.notif-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.25rem 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Tema oscuro */
[data-theme="dark"] .notif-item {
    background: var(--bg-card);
}

[data-theme="dark"] .notif-item:hover {
    background: var(--bg-main);
}

[data-theme="dark"] .notif-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

/* Responsive */
@media (max-width: 640px) {
    .notif-icon {
        width: 36px;
        height: 36px;
    }
    
    .notif-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .notif-title {
        font-size: 0.85rem;
    }
    
    .notif-message {
        font-size: 0.8rem;
    }
}

/* Mejorar tabs del panel */
.tab-panel-btn svg {
    opacity: 0.7;
}

.tab-panel-btn.active svg {
    opacity: 1;
}

/* Cursor pointer en items de estado */
.estado-item {
    cursor: pointer;
}


/* ============================================
   MEJORAR ESPACIADO GENERAL DEL PANEL
   ============================================ */

.panel-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 400px; /* Reducido de 420px */
    max-height: 550px; /* Reducido de 600px */
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUpPanel 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.panel-floating-header {
    padding: 1rem 1.25rem; /* Reducido de 1.25rem 1.5rem */
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    color: white;
}

.panel-floating-header h3 {
    margin: 0;
    font-size: 1rem; /* Reducido de 1.1rem */
    font-weight: 600;
}

.panel-floating-tabs {
    display: flex;
    padding: 0.5rem 0.625rem; /* Reducido de 0.5rem 0.75rem */
    gap: 0.375rem; /* Reducido de 0.5rem */
    background: var(--bg-main);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.panel-floating-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.875rem; /* Reducido de 1rem */
    max-height: calc(550px - 110px);
}

/* Aplicar en móvil */
@media (max-width: 768px) {
    .panel-floating-content {
        padding: 0.75rem;
        max-height: calc(75vh - 115px);
    }
}


/* ============================================
   OCULTAR BOTÓN DE NOTIFICACIONES ANTIGUO
   ============================================ */

/* Ocultar el badge de notificaciones del navbar para colaboradores */
.notification-badge {
    display: none !important;
}

/* Alternativa: Si quieres mantenerlo solo para admin/staff, usa esto en su lugar:
.notification-badge.menu-colaborador {
    display: none !important;
}
*/  

/* ============================================
   FIX - ALTURA DEL PANEL Y SCROLL
   ============================================ */

.panel-floating-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    max-height: calc(600px - 120px); /* Altura total - header - tabs */
}

/* Fix específico para notificaciones */
#listaEstadoNotificaciones,
#listaEstadoVacaciones,
#listaEstadoPermisos,
#listaEstadoCortesias {
    max-height: 100%;
    overflow-y: visible; /* El scroll lo maneja el contenedor padre */
}

/* Mejorar scroll */
.panel-floating-content::-webkit-scrollbar {
    width: 6px;
}

.panel-floating-content::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 3px;
}

.panel-floating-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.panel-floating-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive - ajustar alturas */
@media (max-width: 768px) {
    .panel-floating {
        bottom: 1.5rem;
        right: 1.5rem;
        left: 1.5rem;
        width: auto;
        max-height: 75vh;
    }
    
    .panel-floating-content {
        max-height: calc(75vh - 120px);
    }
}

@media (max-width: 480px) {
    .panel-floating {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-height: 70vh;
    }
    
    .panel-floating-content {
        max-height: calc(70vh - 130px); /* Más espacio para tabs en móvil */
    }
    
    .panel-floating-header h3 {
        font-size: 0.95rem;
    }
}

/* Asegurar que el header sea sticky si el contenido es largo */
.panel-floating-header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #244cff 0%, #00adff 100%);
    color: white;
}

.panel-floating-tabs {
    position: sticky;
    top: 0;
    z-index: 9;
    display: flex;
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

/* Mejorar espaciado de items */
.notif-item,
.estado-item {
    margin-bottom: 0.75rem;
}

.notif-item:last-child,
.estado-item:last-child {
    margin-bottom: 0;
}

#btnEstadoSolicitudes {
    display: none; /* Oculto por defecto, se muestra via JS */
}


/* Colores específicos por tipo de notificación */
.notif-item[data-tipo="vacaciones"],
.notif-item[data-tipo="vacaciones_jefe"],
.notif-item[data-tipo="vacaciones_staff"] {
    border-left-color: #06b6d4;
}

.notif-item[data-tipo="vacaciones"] .notif-icon,
.notif-item[data-tipo="vacaciones_jefe"] .notif-icon,
.notif-item[data-tipo="vacaciones_staff"] .notif-icon {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

.notif-item[data-tipo="permiso"],
.notif-item[data-tipo="permiso_jefe"],
.notif-item[data-tipo="permiso_staff"] {
    border-left-color: #8b5cf6;
}

.notif-item[data-tipo="permiso"] .notif-icon,
.notif-item[data-tipo="permiso_jefe"] .notif-icon,
.notif-item[data-tipo="permiso_staff"] .notif-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.notif-item[data-tipo="cortesia"],
.notif-item[data-tipo="cortesia_jefe"],
.notif-item[data-tipo="cortesia_staff"] {
    border-left-color: #ec4899;
}

.notif-item[data-tipo="cortesia"] .notif-icon,
.notif-item[data-tipo="cortesia_jefe"] .notif-icon,
.notif-item[data-tipo="cortesia_staff"] .notif-icon {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.notif-item[data-tipo="prima_vacacional"] {
    border-left-color: #10b981;
}

.notif-item[data-tipo="prima_vacacional"] .notif-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.notif-item[data-tipo="cambio_rol"] {
    border-left-color: #f59e0b;
}

.notif-item[data-tipo="cambio_rol"] .notif-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.notif-item[data-tipo="seguridad"] {
    border-left-color: #ef4444;
}

.notif-item[data-tipo="seguridad"] .notif-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ============================================
   NAVBAR STICKY - FIX 
   ============================================ */

.topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 1001 !important;
    width: 100%;
}

@media (max-width: 640px) {
    .topbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 1001 !important;
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    /* Asegurar que el contenedor padre no bloquee el sticky */
    .main-content {
        overflow-x: hidden !important;
        overflow-y: visible !important; /* ← CRÍTICO para sticky en móvil */
    }
}

/* ============================================
   TOPBAR FIJA - FIX DEFINITIVO
   ============================================ */

.topbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1001 !important;
    background: var(--bg-card) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Compensar el espacio que ocupa la topbar fija */
.main-content {
    padding-top: 65px !important; /* Altura de la topbar */
}

/* Tema oscuro */
[data-theme="dark"] .topbar {
    background: var(--bg-card) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* Móvil */
@media (max-width: 768px) {
    .topbar {
        padding: 0.6rem 1rem !important;
    }

    .main-content {
        padding-top: 60px !important;
    }
}