
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;450;500;600;700;800&display=swap");

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    background: #F8FAFC !important;
    color: #1E293B !important;
    letter-spacing: -0.01em;
    line-height: 1.6;
    font-size: 26px;
}
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

                      * { 
                margin: 0; 
                padding: 0; 
                box-sizing: border-box; 
            }
            
            body { 
                font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
                background: #F8FAFC;
                min-height: 100vh;
                padding: 20px;
                margin: 0;
            }
            
            /* ========== NAVBAR PROFESIONAL ========== */
            .navbar { 
                background: linear-gradient(180deg, #0F0A2E 0%, #0891B2 60%, #2D1B69 100%);
                color: white; border-bottom: 2px solid #e2e8f0;
                padding: 16px 30px;
                margin-bottom: 30px;
                display: flex;
                flex-wrap: wrap;
                justify-content: space-between;
                align-items: center;
                gap: 20px;
                border-radius: 16px;
                box-shadow: 0 8px 20px rgba(13, 59, 102, 0.2);
                border-bottom: 3px solid #3b82f6;
            }
            
            .navbar span { 
                font-size: 24px;
                font-weight: 600;
                letter-spacing: 0.5px;
            }
            
            .navbar span strong { 
                background: white;
                color: #1e293b;
                padding: 6px 14px;
                border-radius: 8px;
                margin-right: 10px;
                font-size: 24px;
            }
            
            .navbar a { 
                color: white;
                margin: 0 3px;
                text-decoration: none;
                font-size: 24px;
                font-weight: 500;
                white-space: nowrap;
                padding: 8px 14px;
                border-radius: 8px;
                transition: all 0.25s ease;
                background: rgba(255, 255, 255, 0.05);
                border: 1px solid rgba(255, 255, 255, 0.1);
            }
            
            .navbar a:hover { 
                background: rgba(255, 255, 255, 0.2);
                border-color: rgba(255, 255, 255, 0.3);
                transform: translateY(-2px);
            }
            
            .navbar div { 
                display: flex;
                flex-wrap: wrap;
                gap: 5px;
                align-items: center;
            }
            
            /* ========== CONTENEDOR PRINCIPAL ========== */
            .container { 
                max-width: 1400px;
                margin: 0 auto;
                background: rgba(255, 255, 255, 0.98);
                backdrop-filter: blur(10px);
                padding: 35px;
                border-radius: 24px;
                box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
                width: 100%;
                overflow-x: auto;
                word-wrap: break-word;
                border: 1px solid #e2e8f0;
            }
            
            /* ========== TIPOGRAFÍA ========== */
            h1, h2, h3, h4, h5, h6 {
                font-weight: 600;
                letter-spacing: -0.02em;
                color: #1e293b;
            }
            
            h2 { 
                font-size: 32px;
                margin-bottom: 10px;
                position: relative;
                display: inline-block;
            }
            
            /* h2 limpio sin subrayado */
            
            /* ========== TABLAS PROFESIONALES ========== */
            table {
                border-radius: 12px;
                overflow: hidden; 
                width: 100%;
                border-collapse: separate;
                border-spacing: 0;
                margin: 25px 0;
                border-radius: 16px;
                overflow: hidden;
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
            }
            
            th, td { 
                padding: 16px 18px; 
                text-align: left; 
                border-bottom: 1px solid #e9ecef;
            }
            
            th { 
                background: linear-gradient(180deg, #0F0A2E 0%, #0891B2 60%, #2D1B69 100%);
                color: white;
                border-bottom: 2px solid #e2e8f0;
                font-weight: 600;
                font-size: 23px;
                padding: 12px 10px;
                text-transform: uppercase;
                letter-spacing: 0.5px;
            }
            
            tr { 
                background: white;
                transition: background 0.2s ease;
            }
            
            tr:hover { 
                background: #f0f9f4;
            }
            
            tr:last-child td { 
                border-bottom: none;
            }
            
            /* ========== BOTONES ========== */
            .btn {
                border-radius: 10px;
                font-weight: 600;
                letter-spacing: 0.3px; 
                padding: 11px 22px; 
                border: none; 
                border-radius: 12px; 
                cursor: pointer; 
                text-decoration: none; 
                display: inline-block; 
                margin: 3px; 
                font-size: 24px; 
                font-weight: 600;
                transition: all 0.25s ease;
                box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
                letter-spacing: 0.3px;
                border: 1px solid transparent;
            }
            
            .btn:hover { 
                transform: translateY(-2px);
                box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
            }
            
            .btn-primary { 
                background: linear-gradient(135deg, #06B6D4 0%, #1e293b 100%);
                color: white;
                border: 1px solid rgba(255, 255, 255, 0.1);
            }
            
            .btn-primary:hover {
                background: linear-gradient(135deg, #1e293b 0%, #092a4a 100%);
            }
            
            .btn-success { 
                background: linear-gradient(135deg, #3b82f6 0%, #1e8c4c 100%);
                color: white;
            }
            
            .btn-success:hover {
                background: linear-gradient(135deg, #1e8c4c 0%, #166b3a 100%);
            }
            
            .btn-warning { 
                background: linear-gradient(135deg, #f39c12 0%, #e08e0b 100%);
                color: white;
            }
            
            .btn-danger { 
                background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
                color: white;
            }
            
            .btn-sm { 
                padding: 7px 14px; 
                font-size: 24px;
                border-radius: 8px;
            }
            
            /* ========== FORMULARIOS ========== */
            .form-group { 
                margin-bottom: 22px; 
            }
            
            .form-group label { font-size: 20px;
                font-weight: 600;
                color: #1e293b;
                margin-bottom: 8px;
                display: block;
                font-size: 24px;
                letter-spacing: 0.3px;
            }
            
            .form-control { font-size: 18px;
                border-radius: 10px;
                border: 2px solid #E5E7EB;
                transition: all 0.2s ease; 
                width: 100%; 
                padding: 14px 16px; 
                border: 2px solid #e0e7ef;
                border-radius: 14px; 
                font-size: 23px;
                transition: all 0.25s ease;
                background: white;
                color: #2c3e50;
            }
            
            .form-control:focus { 
                border-color: #06B6D4;
                outline: none;
                box-shadow: 0 0 0 4px rgba(26, 82, 118, 0.1);
            }
            
            select.form-control { font-size: 18px;
                border-radius: 10px;
                border: 2px solid #E5E7EB;
                transition: all 0.2s ease;
                cursor: pointer;
                background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230d3b66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
                background-repeat: no-repeat;
                background-position: right 16px center;
                appearance: none;
                padding-right: 45px;
            }
            
            /* ========== TARJETAS (CARDS) ========== */
            .card {
                transition: all 0.3s ease;
                background: white;
                border-radius: 12px;
                padding: 20px;
                margin-bottom: 16px;
                box-shadow: 0 1px 2px rgba(0,0,0,0.04);
                border: 1px solid #f1f5f9;
                transition: all 0.15s ease;
            }
            .card:hover {
                box-shadow: 0 4px 16px rgba(0,0,0,0.08);
            }
            
            .card-old { 
                background: white;
                border-radius: 8px; font-size: 24px; padding: 2px 8px;
                padding: 28px;
                box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
                margin-bottom: 25px;
                border: 1px solid #eef2f6;
                transition: all 0.25s ease;
            }
            
            .card:hover {
                box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
                border-color: #d1e0e8;
            }
            
            .card h3 { 
                margin-bottom: 20px;
                color: #1e293b;
                border-bottom: 2px solid #e8f4f8;
                padding-bottom: 14px;
                font-size: 24px;
            }
            
            /* ========== BADGES ========== */
            .badge { 
                padding: 5px 12px; 
                border-radius: 8px; 
                font-size: 24px; 
                font-weight: 600;
                letter-spacing: 0.3px;
            }
            
            .badge-admin { 
                background: linear-gradient(135deg, #e74c3c, #c0392b);
                color: white;
            }
            
            .badge-medico { 
                background: linear-gradient(135deg, #06B6D4, #1e293b);
                color: white;
            }
            
            .badge-alta { 
                background: #fdf0ed;
                color: #e74c3c;
                border: 1px solid #f5c6cb;
            }
            
            .badge-media { 
                background: #fef9e7;
                color: #f39c12;
                border: 1px solid #fdebd0;
            }
            
            .badge-baja { 
                background: #eafaf1;
                color: #3b82f6;
                border: 1px solid #d5f5e3;
            }
            
            /* ========== ESTADÍSTICAS ========== */
            .stats { 
                display: grid; 
                grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
                gap: 25px; 
                margin-bottom: 35px; 
            }
            
            .stat-card { 
                background: linear-gradient(135deg, #06B6D4 0%, #1e293b 100%);
                padding: 28px 20px;
                border-radius: 8px; font-size: 24px; padding: 2px 8px;
                text-align: center;
                color: white;
                box-shadow: 0 10px 20px rgba(13, 59, 102, 0.25);
                transition: all 0.3s ease;
                border: 1px solid rgba(255, 255, 255, 0.1);
            }
            
            .stat-card:hover {
                transform: translateY(-5px);
                box-shadow: 0 15px 30px rgba(13, 59, 102, 0.35);
            }
            
            .stat-number { 
                font-size: 42px; 
                font-weight: 700;
                line-height: 1.2;
            }
            
            .stat-label { 
                opacity: 0.9; 
                font-size: 23px;
                margin-top: 8px;
                font-weight: 500;
            }
            
            /* ========== TABS ========== */
            .tabs { 
                display: flex; 
                gap: 8px; 
                margin-bottom: 30px; 
                border-bottom: 2px solid #e0e7ef;
                padding-bottom: 5px;
            }
            
            .tab { 
                padding: 14px 28px; 
                cursor: pointer; 
                border: none; 
                background: transparent;
                font-size: 24px; 
                font-weight: 600;
                color: #6c7a89;
                transition: all 0.25s ease;
                border-radius: 30px 30px 0 0;
                position: relative;
            }
            
            .tab:hover { 
                color: #06B6D4;
                background: rgba(26, 82, 118, 0.05);
            }
            
            .tab.active { 
                color: #06B6D4;
                font-weight: 700;
            }
            
            .tab.active:after {
                content: '';
                position: absolute;
                bottom: -7px;
                left: 0;
                right: 0;
                height: 4px;
                background: linear-gradient(90deg, #3b82f6, #06B6D4);
                border-radius: 4px 4px 0 0;
            }
            
            .tab-content { 
                display: none;
                animation: fadeIn 0.4s ease;
            }
            
            .tab-content.active { 
                display: block;
            }
            
                        /* ========== CHAT - VERSIÓN CORREGIDA ========== */
            .chat-container {
                display: flex;
                height: 550px;
                border-radius: 12px;
                overflow: hidden;
                background: #fff;
                box-shadow: 0 2px 12px rgba(0,0,0,0.06);
                border: 1px solid #e8ecf0;
            }
            
            .chat-sidebar {
                width: 320px;
                background: #fff;
                border-right: 1px solid #e8ecf0;
                overflow-y: auto;
            }
            
            .chat-sidebar-header {
                padding: 16px;
                background: #00a884;
                color: white;
                font-weight: 600;
                font-size: 24px;
                display: flex;
                align-items: center;
                gap: 10px;
                position: sticky;
                top: 0;
                z-index: 1;
            }
            
            .chat-sidebar-item {
                display: flex;
                align-items: center;
                gap: 12px;
                padding: 12px 16px;
                cursor: pointer;
                transition: 0.15s;
                border-bottom: 1px solid #f0f2f5;
            }
            .chat-sidebar-item:hover { background: #f0f2f5; }
            
            .chat-avatar {
                width: 44px;
                height: 44px;
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 24px;
                flex-shrink: 0;
            }
            .chat-avatar.admin { background: #fef3c7; }
            .chat-avatar.medico { background: #dbeafe; }
            .chat-avatar.empleado { background: #e0e7ff; }
            .chat-avatar.secretaria { background: #fce7f3; }
            
            .chat-info {
                flex: 1;
                min-width: 0;
            }
            .chat-info-name {
                font-weight: 600;
                color: #111b21;
                font-size: 23px;
            }
            .chat-info-role {
                font-size: 24px;
                color: #667781;
            }
            .chat-info-preview {
                font-size: 24px;
                color: #667781;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }
            
            .chat-main {
                flex: 1;
                display: flex;
                flex-direction: column;
                background: #efeae2;
                background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4d4d4' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
            }
            
            .chat-header {
                padding: 14px 20px;
                background: #f0f2f5;
                border-bottom: 1px solid #e8ecf0;
                font-weight: 600;
                color: #111b21;
                font-size: 23px;
                display: flex;
                align-items: center;
                gap: 10px;
            }
            
            .chat-messages {
                flex: 1;
                padding: 20px 60px;
                overflow-y: auto;
                display: flex;
                flex-direction: column;
                gap: 4px;
            }
            
            .chat-message {
                display: flex;
                margin-bottom: 2px;
            }
            .chat-message.sent { justify-content: flex-end; }
            
            .chat-message-bubble {
                max-width: 65%;
                padding: 8px 12px;
                border-radius: 8px;
                background: #fff;
                box-shadow: 0 1px 1px rgba(0,0,0,0.06);
                font-size: 13.5px;
                line-height: 1.4;
                position: relative;
            }
            .chat-message.sent .chat-message-bubble {
                background: #d9fdd3;
                border-top-right-radius: 0;
            }
            .chat-message:not(.sent) .chat-message-bubble {
                border-top-left-radius: 0;
            }
            
            .chat-message-time {
                font-size: 14px;
                color: #667781;
                margin-top: 3px;
                text-align: right;
            }
            
            .chat-input {
                padding: 10px 16px;
                background: #f0f2f5;
                display: flex;
                gap: 10px;
                align-items: center;
            }
            
            .chat-input input {
                flex: 1;
                padding: 12px 16px;
                border: 1px solid #ddd;
                border-radius: 25px;
                font-size: 24px;
            }
            
            .chat-input input:focus {
                outline: none;
                border-color: #06B6D4;
            }
            
            .chat-input button {
                padding: 12px 24px;
                background: #06B6D4;
                color: white;
                border: none;
                border-radius: 25px;
                font-weight: 600;
                cursor: pointer;
            }
            
            .chat-input button:hover {
                background: #1e293b;
            }
            
            /* ========== PACIENTES GRID ========== */
            .pacientes-grid { 
                display: grid;
                grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
                gap: 25px;
                margin: 25px 0;
            }
            
            .paciente-card { 
                background: white;
                border-radius: 8px; font-size: 24px; padding: 2px 8px;
                padding: 0;
                box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
                border: 1px solid #eef2f6;
                transition: all 0.3s ease;
                overflow: hidden;
            }
            
            .paciente-card:hover { 
                transform: translateY(-6px);
                box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
                border-color: #3b82f6;
            }
            
            .paciente-header { 
                display: flex;
                align-items: center;
                gap: 16px;
                padding: 20px;
                background: linear-gradient(135deg, #f8fbfc, white);
                border-bottom: 1px solid #eef2f6;
            }
            
            .paciente-avatar { 
                width: 60px;
                height: 60px;
                background: linear-gradient(135deg, #06B6D4, #1e293b);
                color: white;
                border-radius: 18px;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 28px;
                font-weight: 700;
                box-shadow: 0 4px 10px rgba(13, 59, 102, 0.2);
            }
            
            .paciente-info h3 { 
                margin: 0;
                color: #1e293b;
                font-size: 24px;
            }
            
            .paciente-info p { 
                margin: 5px 0 0;
                color: #6c7a89;
                font-size: 24px;
            }
            
            .paciente-body { 
                padding: 20px;
            }
            
            .paciente-contacto { 
                display: flex;
                flex-direction: column;
                gap: 8px;
                margin-bottom: 15px;
            }
            
            .paciente-contacto span { 
                display: flex;
                align-items: center;
                gap: 10px;
                color: #2c3e50;
                font-size: 24px;
            }
            
            .paciente-footer { 
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 16px 20px;
                background: #fafcfd;
                border-top: 1px solid #eef2f6;
            }
            
            /* ========== HISTORIAS CLÍNICAS ========== */
            .historias-grid { 
                display: grid;
                grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
                gap: 25px;
                margin: 25px 0;
            }
            
            .historia-card { 
                background: white;
                border-radius: 8px; font-size: 24px; padding: 2px 8px;
                padding: 0;
                box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
                border-top: 5px solid #06B6D4;
                transition: all 0.3s ease;
                overflow: hidden;
            }
            
            .historia-card:hover { 
                transform: translateY(-6px);
                box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
            }
            
            .historia-header { 
                display: flex;
                justify-content: space-between;
                align-items: flex-start;
                padding: 20px 20px 10px;
            }
            
            .historia-tipo { 
                padding: 6px 16px;
                border-radius: 8px;
                font-size: 23px;
                font-weight: 600;
                color: white;
            }
            
            .historia-estado { 
                font-size: 24px;
                padding: 5px 12px;
                border-radius: 8px;
                font-weight: 600;
            }
            
            .estado-abierto { 
                background: #eafaf1;
                color: #3b82f6;
            }
            
            .estado-proceso { 
                background: #fef9e7;
                color: #f39c12;
            }
            
            .estado-cerrado { 
                background: #fdf0ed;
                color: #e74c3c;
            }
            
            /* ========== CONTROL HORARIO ========== */
            .reloj-container { 
                background: linear-gradient(135deg, #1e293b 0%, #1a2a4a 100%);
                color: white;
                padding: 45px;
                border-radius: 28px;
                text-align: center;
                margin-bottom: 30px;
                box-shadow: 0 20px 30px rgba(0, 0, 0, 0.15);
            }
            
            .reloj-tiempo { 
                font-size: 80px;
                font-weight: 700;
                font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
                margin: 25px 0;
                text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
            }
            
            .reloj-estado { 
                font-size: 24px;
                opacity: 0.95;
                margin-bottom: 20px;
                font-weight: 500;
            }
            
            .fichaje-buttons { 
                display: flex;
                gap: 20px;
                justify-content: center;
                flex-wrap: wrap;
            }
            
            .btn-fichaje { 
                padding: 18px 40px;
                font-size: 24px;
                border: none;
                border-radius: 50px;
                cursor: pointer;
                font-weight: 700;
                transition: all 0.25s ease;
                box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
            }
            
            .btn-fichaje:hover {
                transform: translateY(-3px);
                box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
            }
            
            .btn-entrada { 
                background: linear-gradient(135deg, #3b82f6, #1e8c4c);
                color: white;
            }
            
            .btn-salida { 
                background: linear-gradient(135deg, #e74c3c, #c0392b);
                color: white;
            }
            
            .btn-pausa { 
                background: linear-gradient(135deg, #f39c12, #e08e0b);
                color: white;
            }
            
            .btn-fichaje:disabled { 
                opacity: 0.5;
                cursor: not-allowed;
                transform: none;
                box-shadow: none;
            }
            
            /* ========== FLASH MESSAGES ========== */
            .flash { 
                padding: 18px 22px;
                margin: 20px 0;
                border-radius: 16px;
                animation: slideDown 0.4s ease;
                font-weight: 500;
            }
            
            .flash-success { 
                background: linear-gradient(135deg, #eafaf1, #d5f5e3);
                color: #166b3a;
                border-left: 6px solid #3b82f6;
            }
            
            /* ========== ANIMACIONES ========== */
            @keyframes fadeIn { 
                from { opacity: 0; transform: translateY(10px); }
                to { opacity: 1; transform: translateY(0); }
            }
            
            @keyframes slideDown {
                from { opacity: 0; transform: translateY(-20px); }
                to { opacity: 1; transform: translateY(0); }
            }


                    /* ========== CALENDARIO MEJORADO ========== */
            .calendario-semana {
                display: grid;
                grid-template-columns: repeat(7, 1fr);
                gap: 0;
                border: 2px solid #cbd5e1;
                border-radius: 8px;
                overflow: hidden;
                margin: 15px 0;
            }
            .calendario-dia {
                background: white;
                padding: 4px 3px;
                border: 1px solid #e2e8f0;
                min-height: 65px;
                cursor: pointer;
            }
            .calendario-dia:hover { background: #F8FAFC; }
            .calendario-dia.otro-mes { background: #F8FAFC; }
            .calendario-dia.hoy { background: #eff6ff; box-shadow: inset 0 0 0 2px #3b82f6; }
            .calendario-dia-header { text-align: center; font-size: 12px; color: #64748b; font-weight: 600; }
            .calendario-dia-header span { font-size: 24px; font-weight: 700; color: #0f172a; }
            .calendario-dia.hoy .calendario-dia-header span {
                background: #3b82f6; color: white; border-radius: 50%;
                width: 18px; height: 18px; display: inline-flex;
                align-items: center; justify-content: center; font-size: 15px;
            }
            .calendario-tareas { display: flex; flex-direction: column; gap: 1px; margin-top: 1px; }
            .calendario-tarea {
                font-size: 11px; padding: 1px 2px; border-radius: 2px; font-weight: 600;
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
            }
            .calendario-tarea.alta { background: #fee2e2; color: #dc2626; }
            .calendario-tarea.media { background: #fef9c3; color: #ca8a04; }
            .calendario-tarea.baja { background: #dcfce7; color: #16a34a; }
      /* ========== RESPONSIVE ========== */
            @media (max-width: 768px) { 
                body { padding: 10px; }
                
                .container { 
                    padding: 20px;
                    border-radius: 8px; font-size: 24px; padding: 2px 8px;
                }
                
                .navbar { 
                    flex-direction: column;
                    gap: 15px;
                    text-align: center;
                    padding: 15px 20px;
                }
                
                .navbar div { 
                    justify-content: center;
                }
                
                .stats { 
                    grid-template-columns: 1fr 1fr;
                }
                
                .reloj-tiempo { 
                    font-size: 50px;
                }
                
                .btn-fichaje { 
                    padding: 14px 24px;
                    font-size: 24px;
                }
            }
            
            @media (max-width: 480px) { 
                h1 { font-size: 28px; }
                h2 { font-size: 26px; }
                
                .stats { 
                    grid-template-columns: 1fr;
                }
                
                .navbar a { 
                    padding: 6px 10px;
                    font-size: 23px;
                }
                
                .stat-number { 
                    font-size: 32px;
                }
            }
                        /* ========== SIDEBAR LATERAL ========== */
            .sidebar { width: 300px; background: #0891B2 !important;
                position: fixed;
                top: 0;
                left: 0;
                width: 250px;
                height: 100vh;
                background: #1e293b;
                color: white;
                overflow-y: auto;
                z-index: 1000;
                box-shadow: 4px 0 20px rgba(0,0,0,0.1);
            }
            
            .sidebar-header { background: linear-gradient(135deg, #047857, #10B981) !important;
                padding: 20px;
                background: {color_negocio};
                display: flex;
                align-items: center;
                gap: 12px;
                border-bottom: 1px solid rgba(255,255,255,0.1);
            }
            
            .sidebar-logo {
                font-size: 32px;
            }
            
            .sidebar-brand strong {
                display: block;
                font-size: 24px;
            }
            
            .sidebar-brand small {
                font-size: 15px;
                opacity: 0.7;
            }
            
            .sidebar-menu {
                padding: 10px 0;
            }
            
            .sidebar-item {
                transition: all 0.3s ease;
                display: block;
                padding: 12px 20px;
                color: rgba(255,255,255,0.8);
                text-decoration: none;
                font-size: 24px;
                transition: all 0.2s;
                border-left: 3px solid transparent;
            }
            
            .sidebar-item:hover { background: rgba(124,58,237,0.2) !important; border-left: 4px solid #6EE7B7 !important;
                background: rgba(255,255,255,0.15);
                color: white;
                border-left: 4px solid #047857;
                padding-left: 24px;
                border-left-color: {color_negocio};
            }
            
            .sidebar-group {
                margin-top: 15px;
                border-top: 1px solid rgba(255,255,255,0.1);
                padding-top: 10px;
            }
            
            .sidebar-title {
                font-size: 22px !important;
                font-weight: 800 !important;
                letter-spacing: 0.8px;
                padding: 16px 22px;
                margin-bottom: 4px;
                text-transform: uppercase;
                color: #FFFFFF !important;
                background: rgba(255, 255, 255, 0.05);
                border-radius: 10px;
                cursor: pointer;
                transition: all 0.2s;
                display: block;
                width: 100%;
                box-sizing: border-box;
            }
            
            .sidebar-title:hover {
                background: rgba(255, 255, 255, 0.15);
                color: #93C5FD !important;
            }
            
            .sidebar-group a {
                display: block;
                padding: 10px 30px;
                color: rgba(255,255,255,0.7);
                text-decoration: none;
                font-size: 22px;
                transition: all 0.2s;
                border-left: 3px solid transparent;
            }
            
            .sidebar-group a:hover {
                background: rgba(255,255,255,0.1);
                color: white;
                border-left-color: #3b82f6;
            }
            
            .sidebar-logout {
                margin-top: 20px;
                border-top: 1px solid rgba(255,255,255,0.1);
                color: #e74c3c !important;
            }
            
            .badge-notif {
                background: #e74c3c;
                color: white;
                padding: 2px 7px;
                border-radius: 10px;
                font-size: 15px;
                margin-left: 5px;
            }
            
            /* Ajustar contenido principal */
            .container {
                margin-left: 270px;
                max-width: calc(100% - 290px);
            }
            
            @media (max-width: 768px) {
                .sidebar {
                    width: 100% !important;
                    background: #1E1B4B !important;
                    position: relative !important;
                    border-radius: 12px !important;
                    margin-bottom: 10px !important;
                }
                .container {
                    margin-left: 0 !important;
                    max-width: 100% !important;
                }
                .sidebar-menu {
                    display: block !important;
                }
                .sidebar-submenu {
                    display: block !important;
                }
            }

                        .sidebar-submenu {
                display: none;
                background: rgba(0,0,0,0.2);
            }
            
            .sidebar-submenu.open {
                display: block;
            }
            
            .sidebar-title { font-size: 30px; white-space: nowrap; overflow: visible;
                font-weight: 600;
                letter-spacing: 0.5px;
                font-size: 24px;
                cursor: pointer;
                user-select: none;
                transition: all 0.2s;
            }
            
            .sidebar-title:hover {
                color: white !important;
            }
            
            .sidebar-title.open {
                color: white !important;
            }
            
            .sidebar-title::after {
                content: '▸';
                float: right;
                transition: transform 0.2s;
            }
            
            .sidebar-title.open::after {
                transform: rotate(90deg);
            }

    
            tbody tr:hover { background: #EEF2FF !important; transition: 0.2s; }
            tbody tr:nth-child(even) { background: #F8FAFC; }
        .card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.1); }
        .kpi-card {
            background: white;
            border-radius: 16px;
            padding: 24px;
            text-align: center;
            box-shadow: 0 4px 20px rgba(0,0,0,0.06);
            border-top: 4px solid #047857;
            transition: all 0.3s ease;
        }
        .kpi-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 12px 35px rgba(0,0,0,0.12);
        }
        .kpi-value {
            font-size: 32px;
            font-weight: 700;
            margin: 8px 0;
        }
        .kpi-label {
            font-size: 23px;
            color: #64748B;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

    .btn-primary {
        background: linear-gradient(135deg, #047857, #10B981) !important;
        border: none !important;
        box-shadow: 0 4px 15px rgba(124,58,237,0.3) !important;
    }
    .btn-primary:hover {
        box-shadow: 0 8px 25px rgba(124,58,237,0.4) !important;
        transform: translateY(-2px);
    }
    .sidebar-header { background: linear-gradient(135deg, #047857, #10B981) !important;
        border-bottom: 2px solid rgba(255,255,255,0.08) !important;
    }
    body {
        font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    }

    .btn-success {
        background: linear-gradient(135deg, #047857, #10B981) !important;
        box-shadow: 0 4px 15px rgba(5,150,105,0.3) !important;
    }
    .btn-primary {
        background: linear-gradient(135deg, #047857, #10B981) !important;
        box-shadow: 0 4px 15px rgba(124,58,237,0.3) !important;
    }
    .btn-warning {
        background: linear-gradient(135deg, #D97706, #F59E0B) !important;
    }
    .btn-danger {
        background: linear-gradient(135deg, #DC2626, #EF4444) !important;
    }

    table {
        border-radius: 12px !important;
        overflow: hidden !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
    }
    thead tr {
        background: linear-gradient(135deg, #0D9488, #06B6D4) !important;
    }
    thead th {
        color: white !important;
        font-weight: 600 !important;
        font-size: 12px !important;
        letter-spacing: 0.5px !important;
        text-transform: uppercase !important;
        padding: 14px 16px !important;
    }
    tbody td {
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
    tbody tr:hover {
        background: #EEF2FF !important;
    }

    .card {
        border-left: 4px solid #047857 !important;
        border-radius: 12px !important;
    }

    h2 {
        font-size: 24px !important;
        font-weight: 700 !important;
        color: #0D9488 !important;
        letter-spacing: -0.5px !important;
    }
    h3 {
        font-size: 18px !important;
        font-weight: 600 !important;
        color: #06B6D4 !important;
    }

    .badge-notif {
        background: #EF4444 !important;
        color: white !important;
        font-weight: 700 !important;
        font-size: 11px !important;
        padding: 3px 8px !important;
        border-radius: 10px !important;
        animation: pulse 2s infinite;
    }
    @keyframes pulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.1); }
    }

    .form-control:focus {
        border-color: #047857 !important;
        box-shadow: 0 0 0 3px rgba(124,58,237,0.15) !important;
    }
    label {
        font-weight: 600 !important;
        font-size: 13px !important;
        color: #374151 !important;
        margin-bottom: 6px !important;
    }

    .btn-success, .btn-primary {
        background: linear-gradient(135deg, #047857, #10B981) !important;
        box-shadow: 0 4px 15px rgba(5,150,105,0.3) !important;
    }
    .btn-warning {
        background: linear-gradient(135deg, #D97706, #F59E0B) !important;
    }

    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    body {
        letter-spacing: -0.01em;
        line-height: 1.6;
    }
    .card {
        border-radius: 16px !important;
        padding: 28px !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06) !important;
        border: 1px solid rgba(0,0,0,0.04) !important;
        border-left: none !important;
        transition: all 0.2s ease !important;
    }
    .card:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
        transform: translateY(-1px) !important;
    }

    .btn {
        border-radius: 8px !important;
        font-weight: 500 !important;
        font-size: 14px !important;
        padding: 10px 20px !important;
        transition: all 0.15s ease !important;
        letter-spacing: 0.01em !important;
        border: none !important;
    }
    .btn:hover {
        filter: brightness(1.08);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    }
    .btn:active {
        transform: translateY(0);
        filter: brightness(0.95);
    }

    .sidebar {
        border-right: 1px solid rgba(0,0,0,0.06) !important;
        box-shadow: none !important;
    }
    .sidebar-item {
        border-radius: 8px !important;
        margin: 2px 8px !important;
        padding: 10px 16px !important;
        font-size: 14px !important;
        font-weight: 450 !important;
    }
    .sidebar-item:hover {
        background: rgba(255,255,255,0.08) !important;
        border-radius: 8px !important;
    }
    .sidebar-title { font-size: 30px; white-space: nowrap; overflow: visible;
        font-size: 11px !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        opacity: 0.5 !important;
        padding: 8px 20px !important;
    }

    table {
        border-radius: 12px !important;
        border: 1px solid #E5E7EB !important;
        overflow: hidden !important;
    }
    thead th {
        font-size: 11px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        padding: 12px 20px !important;
    }
    tbody td {
        padding: 14px 20px !important;
        border-bottom: 1px solid #F3F4F6 !important;
    }

    .form-control { font-size: 18px;
        border-radius: 8px !important;
        padding: 12px 16px !important;
        border: 1.5px solid #E5E7EB !important;
        font-size: 15px !important;
        background: #FAFAFA !important;
        transition: all 0.15s ease !important;
    }
    .form-control:focus {
        background: white !important;
        border-color: #06B6D4 !important;
        box-shadow: 0 0 0 3px rgba(59,122,181,0.1) !important;
    }

.sidebar {
    background: linear-gradient(180deg, #1E293B 0%, #115E59 50%, #0891B2 100%) !important;
    border-right: none !important;
    box-shadow: 2px 0 20px rgba(0,0,0,0.08) !important;
}
.sidebar-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    padding: 24px 20px !important;
}
.sidebar-logo {
    width: 44px !important;
    height: 44px !important;
    background: rgba(255,255,255,0.12) !important;
    border-radius: 12px !important;
    font-size: 22px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.sidebar-brand strong {
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: -0.3px !important;
}
.sidebar-brand small {
    font-size: 11px !important;
    opacity: 0.6 !important;
    font-weight: 450 !important;
}
.sidebar-title { font-size: 30px; white-space: nowrap; overflow: visible;
    font-size: 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 1.2px !important;
    font-weight: 600 !important;
    opacity: 0.45 !important;
    padding: 16px 20px 8px !important;
}
.sidebar-item {
    border-radius: 8px !important;
    margin: 1px 8px !important;
    padding: 10px 14px !important;
    font-size: 13.5px !important;
    font-weight: 450 !important;
    color: rgba(255,255,255,0.75) !important;
}
.sidebar-item:hover {
    background: rgba(255,255,255,0.1) !important;
    color: white !important;
    border-radius: 8px !important;
}
.sidebar-submenu {
    padding: 4px 8px !important;
}
.sidebar-submenu a {
    font-size: 13px !important;
    padding: 7px 14px !important;
    border-radius: 6px !important;
    color: rgba(255,255,255,0.6) !important;
    font-weight: 400 !important;
}
.sidebar-submenu a:hover {
    background: rgba(255,255,255,0.08) !important;
    color: white !important;
}

.card {
    background: white !important;
    border-radius: 16px !important;
    padding: 24px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.04) !important;
    border: 1px solid #F1F5F9 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06) !important;
    transform: translateY(-1px) !important;
}

.btn {
    border-radius: 8px !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    padding: 10px 18px !important;
    letter-spacing: 0.01em !important;
    border: none !important;
    cursor: pointer !important;
}
.btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
}
.btn:active {
    transform: scale(0.98);
    filter: brightness(0.95);
}
.btn-success {
    background: linear-gradient(135deg, #059669, #10B981) !important;
    box-shadow: 0 2px 8px rgba(5,150,105,0.2) !important;
}
.btn-primary {
    background: linear-gradient(135deg, #0891B2, #06B6D4) !important;
    box-shadow: 0 2px 8px rgba(15,118,110,0.2) !important;
}
.btn-warning {
    background: linear-gradient(135deg, #D97706, #F59E0B) !important;
}
.btn-danger {
    background: linear-gradient(135deg, #DC2626, #EF4444) !important;
}

.form-control { font-size: 18px;
    border-radius: 8px !important;
    padding: 11px 15px !important;
    border: 1.5px solid #E2E8F0 !important;
    font-size: 14px !important;
    background: #FAFBFC !important;
    color: #1E293B !important;
    width: 100% !important;
}
.form-control:focus {
    outline: none !important;
    background: white !important;
    border-color: #0891B2 !important;
    box-shadow: 0 0 0 4px rgba(15,118,110,0.08) !important;
}
.form-group {
    margin-bottom: 16px !important;
}
label {
    font-weight: 500 !important;
    font-size: 13px !important;
    color: #475569 !important;
    margin-bottom: 5px !important;
    display: block !important;
    letter-spacing: -0.01em !important;
}

table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 1px solid #E5E7EB !important;
    font-size: 14px !important;
}
thead tr {
    background: #F8FAFC !important;
}
thead th {
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    font-weight: 600 !important;
    color: #64748B !important;
    padding: 12px 18px !important;
    text-align: left !important;
    border-bottom: 1px solid #E5E7EB !important;
}
tbody td {
    padding: 12px 18px !important;
    border-bottom: 1px solid #F1F5F9 !important;
    color: #334155 !important;
}
tbody tr:last-child td {
    border-bottom: none !important;
}
tbody tr:hover {
    background: #F8FAFC !important;
}

h1 {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #1E293B !important;
    letter-spacing: -0.5px !important;
}
h2 {
    font-size: 22px !important;
    font-weight: 650 !important;
    color: #1E293B !important;
    letter-spacing: -0.3px !important;
}
h3 {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #334155 !important;
}
h4 {
    font-size: 15px !important;
    font-weight: 550 !important;
    color: #475569 !important;
}

.badge-notif {
    background: #EF4444 !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 10px !important;
    padding: 3px 7px !important;
    border-radius: 10px !important;
    letter-spacing: 0.3px !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.card, .fade-in {
    animation: fadeIn 0.3s ease-out;
}
.pulse {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.sidebar-item {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500 !important;
}
.sidebar-submenu a {
    color: rgba(255,255,255,0.8) !important;
    font-weight: 450 !important;
}
.sidebar-title { font-size: 30px; white-space: nowrap; overflow: visible;
    color: rgba(255,255,255,0.7) !important;
    opacity: 1 !important;
    font-weight: 600 !important;
}

thead tr {
    background: #1E293B !important;
}
thead th {
    color: white !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    font-weight: 600 !important;
    padding: 12px 18px !important;
    text-align: left !important;
    border-bottom: none !important;
}

/* KPI Cards */
.stat-card {
    background: white !important;
    border-radius: 16px !important;
    padding: 24px !important;
    text-align: center !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
    border: 1px solid #F1F5F9 !important;
    transition: all 0.2s ease !important;
}
.stat-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08) !important;
}
.stat-number {
    font-size: 36px !important;
    font-weight: 800 !important;
    color: #1E293B !important;
    line-height: 1.2 !important;
    letter-spacing: -1px !important;
}
.stat-label {
    font-size: 13px !important;
    color: #64748B !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-top: 4px !important;
}

/* Dashboard header */
.dash-header h1 {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #1E293B !important;
}

/* Activity bars */
.activity-bar {
    border-radius: 6px 6px 0 0 !important;
    transition: all 0.2s ease !important;
}
.activity-bar:hover {
    opacity: 0.8 !important;
    transform: scaleY(1.1) !important;
}

/* Today's patients */
.today-patient {
    transition: all 0.15s ease !important;
    border-radius: 8px !important;
}
.today-patient:hover {
    background: #F8FAFC !important;
    transform: translateX(4px) !important;
}

/* Section titles in dashboard */
.dash-section-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    margin-bottom: 16px !important;
    letter-spacing: -0.2px !important;
}

/* Quick actions */
.quick-action {
    background: white !important;
    border-radius: 14px !important;
    padding: 20px !important;
    text-align: center !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    border: 1px solid #F1F5F9 !important;
    display: block !important;
}
.quick-action:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08) !important;
}
.quick-action-icon {
    font-size: 32px !important;
    margin-bottom: 8px !important;
}
.quick-action-title {
    font-weight: 600 !important;
    color: #1E293B !important;
    font-size: 14px !important;
}

    .shadow-soft { box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06); }
    .shadow-medium { box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.06); }
    
    /* Animación de entrada */
    @keyframes slideUp {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .card, .stat-card { animation: slideUp 0.3s ease-out; }
    
    /* Badge de notificación con pulso */
    .badge-notif {
        animation: pulse 2s infinite;
    }
    @keyframes pulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.15); }
    }


/* ========== DASHBOARD - Solo CSS ========== */

/* KPIs más grandes y con sombra */
div[style*="background:linear-gradient"] {
    border-radius: 20px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    transition: all 0.3s ease !important;
}
div[style*="background:linear-gradient"]:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2) !important;
}

/* Tarjetas del dashboard */
div[style*="border-radius:16px"] {
    border-radius: 20px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
    border: 1px solid #F1F5F9 !important;
    transition: all 0.3s ease !important;
}
div[style*="border-radius:16px"]:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
    transform: translateY(-2px) !important;
}

/* Números KPIs más grandes */
div[style*="font-size:24px"][style*="font-weight:700"] {
    font-size: 36px !important;
    font-weight: 800 !important;
}

/* Barras del gráfico más animadas */
div[style*="width:28px"][style*="height:"] {
    border-radius: 8px 8px 0 0 !important;
    transition: all 0.3s ease !important;
    min-width: 32px !important;
}
div[style*="width:28px"][style*="height:"]:hover {
    filter: brightness(1.2) !important;
    transform: scaleY(1.1) !important;
}

/* Cabecera del dashboard */
h1[style*="font-size:26px"] {
    font-size: 32px !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px !important;
}

/* Pacientes del día */
div[style*="width:40px"][style*="height:40px"][style*="border-radius:50%"] {
    width: 48px !important;
    height: 48px !important;
    font-size: 22px !important;
}

/* Secciones */
h3[style*="font-size:15px"] {
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: -0.3px !important;
}

/* ========== DASHBOARD IMPACTO VISUAL ========== */

/* Fondo del dashboard */
body {
    background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%) !important;
}

/* KPIs - Borde de color animado */
div[style*="background:linear-gradient"] {
    position: relative !important;
    overflow: hidden !important;
}
div[style*="background:linear-gradient"]::after {
    content: "" !important;
    position: absolute !important;
    top: -50% !important;
    left: -50% !important;
    width: 200% !important;
    height: 200% !important;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%) !important;
    animation: shine 3s infinite !important;
}
@keyframes shine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tarjetas con borde izquierdo de color */
div[style*="border-radius:16px"] {
    border-left: 4px solid #0891B2 !important;
    padding-left: 24px !important;
}

/* Tablas - Cabecera con gradiente */
thead tr {
    background: linear-gradient(135deg, #1E293B, #0891B2) !important;
}
thead th {
    color: white !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

/* Botones con brillo */
.btn {
    position: relative !important;
    overflow: hidden !important;
}
.btn::after {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent) !important;
    transition: left 0.5s !important;
}
.btn:hover::after {
    left: 100% !important;
}

/* Inputs con glow */
.form-control:focus {
    box-shadow: 0 0 20px rgba(8,145,178,0.2) !important;
    border-color: #0891B2 !important;
}

/* Sidebar items con indicador */
.sidebar-item {
    position: relative !important;
}
.sidebar-item::before {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 0 !important;
    height: 70% !important;
    background: #0891B2 !important;
    border-radius: 0 4px 4px 0 !important;
    transition: width 0.3s !important;
}
.sidebar-item:hover::before {
    width: 4px !important;
}

/* Títulos con subrayado animado */
h2 {
    position: relative !important;
    display: inline-block !important;
}
h2::after {
    content: "" !important;
    position: absolute !important;
    bottom: -4px !important;
    left: 0 !important;
    width: 0 !important;
    height: 3px !important;
    background: linear-gradient(90deg, #0891B2, #06B6D4) !important;
    border-radius: 2px !important;
    transition: width 0.5s ease !important;
}
h2:hover::after {
    width: 100% !important;
}

/* Cards con elevación */
.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1) !important;
}

/* Badges con latido */
.badge-notif {
    animation: heartbeat 1.5s infinite !important;
}
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.3); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    60% { transform: scale(1); }
}

/* ========== MAS COLOR Y CONTRASTE ========== */

/* Fondo general con textura sutil */
body {
    background: #F1F5F9 !important;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(8,145,178,0.03) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(124,58,237,0.03) 0%, transparent 50%) !important;
}

/* KPIs con colores vivos */
div[style*="background:linear-gradient"] {
    border: none !important;
}
/* Primer KPI - cyan */
div[style*="background:linear-gradient"]:nth-of-type(1) {
    background: linear-gradient(135deg, #0891B2, #06B6D4) !important;
}
/* Segundo - verde */
div[style*="background:linear-gradient"]:nth-of-type(2) {
    background: linear-gradient(135deg, #059669, #10B981) !important;
}
/* Tercero - naranja */
div[style*="background:linear-gradient"]:nth-of-type(3) {
    background: linear-gradient(135deg, #D97706, #F59E0B) !important;
}
/* Cuarto - púrpura */
div[style*="background:linear-gradient"]:nth-of-type(4) {
    background: linear-gradient(135deg, #7C3AED, #8B5CF6) !important;
}

/* Tarjetas con fondo gris muy claro */
.card {
    background: #FFFFFF !important;
    border: 1px solid #E5E7EB !important;
}

/* Tablas con rayas de cebra */
tbody tr:nth-child(odd) {
    background: #F8FAFC !important;
}
tbody tr:nth-child(even) {
    background: #FFFFFF !important;
}
tbody tr:hover {
    background: #E0F2FE !important;
}

/* Labels en negrita */
label {
    font-weight: 700 !important;
    color: #1E293B !important;
}

/* Select y inputs con borde más oscuro */
select, input, textarea {
    border: 2px solid #CBD5E1 !important;
}
select:focus, input:focus, textarea:focus {
    border-color: #0891B2 !important;
    background: #F0FDFA !important;
}

/* Sidebar más oscuro */
.sidebar {
    background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%) !important;
}

/* Separadores más visibles */
hr, div[style*="border-bottom"] {
    border-color: #CBD5E1 !important;
}

/* ========== FICHA PACIENTE PROFESIONAL ========== */

/* Cabecera del paciente */
div[style*="font-size:70px"] ~ div h2 {
    font-size: 28px !important;
    font-weight: 800 !important;
    color: #1E293B !important;
}

/* KPIs de paciente - más grandes */
div[style*="border-top:3px"] {
    border-radius: 16px !important;
    padding: 20px !important;
    transition: all 0.3s ease !important;
}
div[style*="border-top:3px"]:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 30px rgba(0,0,0,0.1) !important;
}
div[style*="font-size:22px"][style*="font-weight:700"] {
    font-size: 32px !important;
    font-weight: 800 !important;
}

/* Pestañas más elegantes */
a[href*="?tab="] {
    padding: 14px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 12px 12px 0 0 !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
}
a[href*="?tab="]:hover {
    background: #E0F2FE !important;
    color: #0891B2 !important;
}

/* Sección Información Personal */
div[style*="border-bottom:2px"] {
    border-bottom: 3px solid #0891B2 !important;
    padding-bottom: 12px !important;
    margin-bottom: 20px !important;
}

/* Líneas de datos */
div[style*="justify-content:space-between"][style*="padding:10px"] {
    padding: 14px 0 !important;
    border-bottom: 1px solid #F1F5F9 !important;
    transition: background 0.2s !important;
}
div[style*="justify-content:space-between"][style*="padding:10px"]:hover {
    background: #F8FAFC !important;
    padding-left: 8px !important;
}

/* Acciones rápidas - botones compactos */
div[style*="display:grid;gap:8px"] a.btn {
    border-radius: 10px !important;
    padding: 12px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
}
div[style*="display:grid;gap:8px"] a.btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15) !important;
}

/* Avatar del paciente */
div[style*="width:70px"][style*="height:70px"][style*="border-radius:50%"] {
    width: 80px !important;
    height: 80px !important;
    font-size: 32px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}

/* Alertas */
div[style*="border-left:4px"] {
    border-radius: 10px !important;
    padding: 14px 18px !important;
    font-size: 14px !important;
}

.sidebar {
    background: linear-gradient(180deg, #164E63 0%, #0891B2 50%, #06B6D4 100%) !important;
}
.sidebar-item {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500 !important;
}
.sidebar-item:hover {
    background: rgba(255,255,255,0.15) !important;
}
.sidebar-title { font-size: 30px; white-space: nowrap; overflow: visible;
    color: rgba(255,255,255,0.7) !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
}
.sidebar-header {
    background: rgba(0,0,0,0.1) !important;
}

/* Texto del sidebar más blanco e intenso */
.sidebar-item {
    color: white !important;
    font-weight: 550 !important;
    font-size: 22px !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
}
.sidebar-submenu a {
    color: rgba(255,255,255,0.95) !important;
    font-weight: 500 !important;
    font-size: 18px !important;
}
.sidebar-title { font-size: 30px; white-space: nowrap; overflow: visible;
    color: white !important;
    font-weight: 700 !important;
    letter-spacing: 1.5px !important;
    opacity: 0.9 !important;
}
.sidebar-brand strong {
    color: white !important;
    font-weight: 700 !important;
}
.sidebar-brand small {
    color: rgba(255,255,255,0.85) !important;
}

/* ========== DASHBOARD - MEJOR VISIBILIDAD ========== */

/* Fondo con ligero tono */
body {
    background: #F0F4F8 !important;
}

/* KPIs - fondos de colores suaves */
div[style*="border-radius:16px"][style*="padding:20px"][style*="box-shadow"] {
    border: none !important;
    border-radius: 20px !important;
}

/* Primer KPI - cyan suave */
div[style*="background:linear-gradient"]:first-of-type {
    background: linear-gradient(135deg, #0891B2, #06B6D4) !important;
}

/* Tarjetas blancas con sombra visible */
.card {
    background: white !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
}

/* Números grandes en negrita */
div[style*="font-size:24px"][style*="font-weight:700"],
div[style*="font-size:28px"][style*="font-weight"] {
    color: #0F172A !important;
    font-weight: 800 !important;
}

/* Etiquetas más visibles */
div[style*="font-size:11px"][style*="color:#64748B"],
div[style*="font-size:12px"][style*="color:#64748B"] {
    color: #475569 !important;
    font-weight: 600 !important;
}

/* Tablas - líneas más marcadas */
tbody td {
    border-bottom: 1px solid #E2E8F0 !important;
    padding: 14px 16px !important;
}

/* Secciones con título visible */
h3 {
    color: #0F172A !important;
    font-weight: 700 !important;
}

/* Datos de pacientes - más legibles */
div[style*="padding:10px 0;border-bottom"] strong {
    color: #0F172A !important;
    font-size: 14px !important;
}
div[style*="padding:10px 0;border-bottom"] span {
    color: #475569 !important;
    font-size: 12px !important;
}

/* Sidebar cyan */
.sidebar {
    background: linear-gradient(180deg, #164E63 0%, #0891B2 50%, #06B6D4 100%) !important;
}
.sidebar-item { color: white !important; font-weight: 500 !important; }
.sidebar-item:hover { background: rgba(255,255,255,0.15) !important; }

/* KPIs con iconos de colores */
div[style*="width:48px"][style*="height:48px"] { color: white !important; }

/* Botones Actualizar y Cancelar alineados */
form[style*="max-width: 700px"] button[type="submit"],
form[style*="max-width: 500px"] button[type="submit"] {
    display: inline-block !important;
    vertical-align: middle !important;
    margin-right: 10px !important;
}
form[style*="max-width: 700px"] a.btn,
form[style*="max-width: 500px"] a.btn {
    display: inline-block !important;
    vertical-align: middle !important;
}

/* ========== MENSAJES DEL PACIENTE ========== */

/* Bandeja de mensajes */
div[style*="Mis Mensajes"] {
    background: linear-gradient(135deg, #F0FDF4, #ECFDF5) !important;
    border-radius: 16px !important;
    padding: 24px !important;
}

/* Cada mensaje */
div[style*="padding:15px"][style*="background"] {
    border-radius: 12px !important;
    border-left: 4px solid #0891B2 !important;
    margin-bottom: 10px !important;
    transition: all 0.2s ease !important;
}
div[style*="padding:15px"][style*="background"]:hover {
    transform: translateX(4px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
}

/* Botón volver */
a[href*="portal-paciente"] {
    background: #0891B2 !important;
    color: white !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    display: inline-block !important;
    margin-top: 20px !important;
}

/* Alinear botones Volver, Imprimir, Descargar */
a[href*="mi-equipo"],
a[href*="medicos"],
button[onclick*="print"] {
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 5px !important;
}

/* ========== CABECERA FICHA PACIENTE ========== */

/* Avatar más grande y con sombra */
div[style*="width:70px"][style*="height:70px"][style*="border-radius:50%"] {
    width: 80px !important;
    height: 80px !important;
    font-size: 34px !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12) !important;
}

/* Nombre del paciente más grande */
h2:has(+ p) {
    font-size: 26px !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px !important;
}

/* Línea de datos del paciente */
div[style*="font-size:70px"] ~ div p,
p:has(+ p) {
    font-size: 13px !important;
    color: #475569 !important;
}

/* Alertas más visibles */
div[style*="border-left:4px"][style*="background"] {
    border-radius: 12px !important;
    padding: 12px 18px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

/* Botones Editar/Volver más elegantes */
a[href*="editar"] {
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 8px 18px !important;
}

/* ========== CALENDARIO MEJORADO ========== */
.calendario-moderno {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
}
.calendario-moderno th {
    background: linear-gradient(135deg, #1E1B4B, #312E81);
    color: white;
    padding: 12px 8px;
    border-radius: 12px;
    font-size: 13px;
    text-align: center;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(30, 27, 75, 0.2);
}
.calendario-moderno td {
    background: white;
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    vertical-align: top;
    min-height: 100px;
    border: 2px solid transparent;
}
.calendario-moderno td:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    border-color: #6366F1;
    cursor: pointer;
}
.calendario-moderno td.hoy {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
}
.calendario-moderno td.otro-mes {
    background: #f8fafc;
    opacity: 0.5;
}
.calendario-dia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #f1f5f9;
}
.calendario-dia-numero {
    font-size: 22px;
    font-weight: 800;
    color: #1E1B4B;
    background: #f1f5f9;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.calendario-dia.hoy .calendario-dia-numero {
    background: #3b82f6;
    color: white;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}
.calendario-badge-disponibles {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.calendario-badge-verde { background: linear-gradient(135deg, #10B981, #059669); }
.calendario-badge-ambar { background: linear-gradient(135deg, #F59E0B, #D97706); }
.calendario-badge-rojo { background: linear-gradient(135deg, #EF4444, #DC2626); }
.calendario-cita-item {
    background: white;
    border-left: 3px solid #3b82f6;
    padding: 5px 8px;
    margin: 4px 0;
    border-radius: 6px;
    font-size: 11px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: all 0.2s;
}
.calendario-cita-item:hover {
    background: #f0f9ff;
    transform: translateX(3px);
}
.calendario-cita-hora {
    font-weight: 700;
    color: #1E1B4B;
    font-size: 10px;
}
.calendario-cita-paciente {
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.calendario-vacio {
    text-align: center;
    color: #bdc3c7;
    font-size: 11px;
    padding: 20px 5px;
}

/* ========== RESPONSIVE MEJORADO PARA MÓVIL ========== */
@media (max-width: 768px) {
    body {
        padding: 8px !important;
        font-size: 16px !important;
    }
    
    .navbar {
        padding: 12px 15px !important;
        border-radius: 12px !important;
    }
    
    .navbar span {
        font-size: 16px !important;
    }
    
    .sidebar {
        width: 100% !important;
        position: relative !important;
        border-radius: 12px !important;
        margin-bottom: 15px !important;
    }
    
    .sidebar-title {
        font-size: 22px !important;
        padding: 12px 15px !important;
    }
    
    .sidebar-group a {
        font-size: 18px !important;
        padding: 10px 20px !important;
    }
    
    .container, .content {
        padding: 15px !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    
    table {
        font-size: 14px !important;
    }
    
    .calendario-moderno th {
        padding: 8px 4px !important;
        font-size: 11px !important;
    }
    
    .calendario-moderno td {
        padding: 6px !important;
        min-height: 60px !important;
    }
    
    .calendario-dia-numero {
        font-size: 16px !important;
        width: 28px !important;
        height: 28px !important;
    }
    
    .calendario-badge-disponibles {
        font-size: 8px !important;
        padding: 2px 6px !important;
    }
    
    .reloj-tiempo {
        font-size: 40px !important;
    }
    
    .btn-fichaje {
        padding: 12px 18px !important;
        font-size: 18px !important;
    }
    
    h1 { font-size: 24px !important; }
    h2 { font-size: 22px !important; }
    h3 { font-size: 17px !important; }
}

@media (max-width: 480px) {
    .navbar {
        flex-direction: column !important;
        text-align: center !important;
    }
    
    .stats, .grid-4, .grid-3, .grid-2 {
        grid-template-columns: 1fr !important;
    }
    
    .calendario-moderno th {
        font-size: 9px !important;
        padding: 4px 2px !important;
    }
    
    .calendario-moderno td {
        padding: 4px !important;
        font-size: 10px !important;
    }
    
    .calendario-cita-item {
        font-size: 8px !important;
        padding: 2px 4px !important;
    }
    
    .sidebar-group a {
        font-size: 16px !important;
    }
    
    .btn {
        padding: 10px 16px !important;
        font-size: 14px !important;
    }
}

/* ========== MENÚ HAMBURGUESA PARA MÓVIL ========== */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 10000;
    background: #1E1B4B;
    color: white;
    border: none;
    font-size: 28px;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block !important;
    }
    
    .sidebar {
        display: none;
        position: fixed !important;
        top: 0;
        left: 0;
        width: 85% !important;
        max-width: 350px;
        height: 100vh !important;
        overflow-y: auto !important;
        z-index: 9999;
        background: #1E1B4B !important;
        border-radius: 0 !important;
        box-shadow: 0 0 30px rgba(0,0,0,0.5);
    }
    
    .sidebar.open {
        display: block !important;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
    }
    
    .sidebar-overlay.open {
        display: block;
    }
}

@media (min-width: 769px) {
    .menu-toggle {
        display: none !important;
    }
    
    .sidebar {
        display: block !important;
    }
}

/* ========== MODO MÓVIL SIMPLIFICADO ========== */
@media (max-width: 768px) {
    /* Ocultar elementos de gestión en móvil */
    .solo-escritorio,
    .btn-nuevo,
    .formulario-crear,
    .acciones-rapidas,
    .btn-editar,
    .btn-eliminar,
    .btn-factura,
    .btn-receta,
    .btn-seguimiento,
    .btn-constantes,
    .btn-certificado,
    .btn-derivacion,
    .btn-analitica,
    .btn-vacunas,
    .btn-exportar,
    .btn-anonimizar,
    .btn-baja {
        display: none !important;
    }
    
    /* Ocultar sidebar groups que no sean básicos */
    .sidebar-group:nth-child(n+3) {
        display: none !important;
    }
    
    /* Mostrar solo Dashboard, Mi Espacio, Citas y Pacientes */
    body {
        font-size: 16px !important;
        padding: 10px !important;
    }
    
    /* Botones grandes para dedo */
    .btn, button, a.btn {
        padding: 14px 20px !important;
        font-size: 16px !important;
        border-radius: 12px !important;
    }
    
    /* Tablas responsive */
    table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }
    
    /* Ocultar sidebar en móvil */
    .sidebar {
        display: none !important;
        position: fixed !important;
        top: 0;
        left: 0;
        width: 85% !important;
        max-width: 320px;
        height: 100vh !important;
        overflow-y: auto !important;
        z-index: 9999;
        background: #1E1B4B !important;
        border-radius: 0 !important;
    }
    
    .sidebar.open {
        display: block !important;
    }
    
    .menu-toggle {
        display: block !important;
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 10000;
        background: #1E1B4B;
        color: white;
        border: none;
        font-size: 28px;
        padding: 10px 15px;
        border-radius: 10px;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
    }
    
    .sidebar-overlay.open {
        display: block;
    }
}

@media (min-width: 769px) {
    .menu-toggle {
        display: none !important;
    }
    
    .sidebar {
        display: block !important;
    }
}

/* ========== FIX PANTALLA BLANCA MÓVIL ========== */
@media (max-width: 768px) {
    body {
        display: block !important;
        visibility: visible !important;
    }
    
    .container, .content, main {
        display: block !important;
        visibility: visible !important;
    }
}

/* ========== MI ESPACIO - PESTAÑAS PROFESIONALES ========== */
.mi-espacio-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    background: white;
    border-radius: 14px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.mi-espacio-tabs .tab-btn {
    flex: 1;
    padding: 12px 18px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #64748B;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mi-espacio-tabs .tab-btn.active {
    background: linear-gradient(135deg, #1E1B4B, #312E81);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 27, 75, 0.3);
}

.mi-espacio-tabs .tab-btn:hover:not(.active) {
    background: #f1f5f9;
    color: #1E1B4B;
}

/* Tarjetas de notas */
.notas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.nota-card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border-left: 4px solid #f39c12;
}

.nota-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

/* Tabla de tareas mejorada */
.tareas-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.tareas-table th {
    background: linear-gradient(135deg, #1E1B4B, #312E81);
    color: white;
    padding: 14px 16px;
    font-size: 13px;
    text-align: left;
    letter-spacing: 0.5px;
}

.tareas-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.tareas-table tr:hover td {
    background: #f8fafc;
}


/* ============================================
   RESPONSIVE MEJORADO - CLINICA DIGITAL
   ============================================ */

/* TABLETS */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    .main-content {
        margin-left: 240px;
    }
}

/* MOVILES GRANDES */
@media (max-width: 768px) {
    /* Body */
    body {
        padding: 8px !important;
        font-size: 14px;
    }
    
    /* Sidebar colapsable */
    .sidebar {
        position: fixed !important;
        left: -100% !important;
        top: 0 !important;
        width: 80% !important;
        max-width: 320px !important;
        height: 100vh !important;
        z-index: 9999 !important;
        transition: left 0.3s ease !important;
        overflow-y: auto !important;
        border-radius: 0 !important;
    }
    .sidebar.open {
        left: 0 !important;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3) !important;
    }
    
    /* Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
    }
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Main content */
    .main-content, .content {
        margin-left: 0 !important;
        padding: 10px !important;
        width: 100% !important;
    }
    
    /* Cards */
    .card {
        padding: 15px !important;
        border-radius: 12px !important;
    }
    
    /* Grids */
    .stats, .grid-4, .grid-3, .grid-2,
    [style*="grid-template-columns:repeat(4"],
    [style*="grid-template-columns: repeat(4"],
    [style*="grid-template-columns:repeat(3"],
    [style*="grid-template-columns: repeat(3"],
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Tablas - scroll horizontal */
    table {
        font-size: 12px !important;
        min-width: 100% !important;
    }
    table th, table td {
        padding: 6px 8px !important;
    }
    
    /* Botones */
    .btn {
        padding: 12px 16px !important;
        font-size: 14px !important;
        min-height: 44px;
    }
    button {
        min-height: 44px;
    }
    
    /* Login */
    .login-box, .portal-box {
        width: 95% !important;
        max-width: 100% !important;
        margin: 20px auto !important;
        padding: 25px 20px !important;
    }
    
    /* Titulos */
    h1 { font-size: 22px !important; }
    h2 { font-size: 18px !important; }
    h3 { font-size: 16px !important; }
    
    /* Tabs */
    .acc-tab, .cert-tab, .deriv-tab, .form-tab, .seg-tab, .dsp-tab, .tab-historia, .tab-btn-config, .tab {
        font-size: 12px !important;
        padding: 8px 12px !important;
    }
    
    /* Formularios */
    input, select, textarea {
        font-size: 16px !important; /* Evita zoom en iOS */
    }
    
    /* Header */
    .navbar {
        padding: 12px 15px !important;
        border-radius: 12px !important;
    }
    
    /* Header responsive */
    .header-responsive {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
    }
    
    /* Ocultar en movil */
    .hide-mobile {
        display: none !important;
    }
    
    /* Mostrar solo en movil */
    .show-mobile {
        display: block !important;
    }
}

/* MOVILES PEQUENOS */
@media (max-width: 480px) {
    body {
        padding: 5px !important;
        font-size: 13px;
    }
    
    .card {
        padding: 12px !important;
    }
    
    .sidebar {
        width: 90% !important;
    }
    
    h1 { font-size: 20px !important; }
    h2 { font-size: 16px !important; }
    
    .btn {
        padding: 10px 14px !important;
        font-size: 13px !important;
    }
    
    table {
        font-size: 11px !important;
    }
    table th, table td {
        padding: 4px 6px !important;
    }
}

/* BOTON MENU MOVIL (solo visible en movil) */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 9997;
    background: #1E1B4B;
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}
