/* ===== MENTALFAM - SISTEMA DE GESTIÓN CLÍNICA ===== */
/* Paleta de colores extraída del logo */
:root {
    /* Colores principales del logo */
    --primary-purple: #7B4397;
    --primary-teal: #1E9A8A;
    --secondary-purple: #9C5AA6;
    --secondary-teal: #14B8A6;
    
    /* Gradientes inspirados en el logo */
    --gradient-main: linear-gradient(135deg, #7B4397 0%, #1E9A8A 100%);
    --gradient-soft: linear-gradient(135deg, rgba(123, 67, 151, 0.1) 0%, rgba(30, 154, 138, 0.1) 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    
    /* Colores complementarios */
    --white: #FFFFFF;
    --light-gray: #F8FAFC;
    --medium-gray: #64748B;
    --dark-gray: #334155;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    
    /* Sombras y efectos */
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-large: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-purple: 0 10px 25px rgba(123, 67, 151, 0.3);
    --shadow-teal: 0 10px 25px rgba(30, 154, 138, 0.3);
    
    /* Tipografía */
    --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-normal);
    line-height: 1.6;
    color: var(--dark-gray);
    background: var(--light-gray);
    overflow-x: hidden;
}

/* Fondo animado con gradiente */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-main);
    opacity: 0.03;
    z-index: -2;
    animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-5px) translateY(-5px); }
    50% { transform: translateX(5px) translateY(5px); }
    75% { transform: translateX(-3px) translateY(3px); }
}

/* ===== PÁGINA DE LOGIN ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--gradient-main);
    position: relative;
    overflow: hidden;
}

/* Efectos de fondo animados */
.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: float 20s linear infinite;
}

.login-container::after {
    content: '';
    position: absolute;
    top: 20%;
    right: 10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(30, 154, 138, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 4s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50px, -50px) rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.1; }
}

.login-box {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-large);
    position: relative;
    z-index: 1;
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo {
    width: 200px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-section h2 {
    color: var(--primary-purple);
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0.5rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== FORMULARIOS ===== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: var(--font-weight-medium);
    color: var(--dark-gray);
    font-size: 0.9rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 1rem;
    color: var(--medium-gray);
    z-index: 2;
    transition: color 0.3s ease;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid rgba(123, 67, 151, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    font-family: var(--font-primary);
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(30, 154, 138, 0.1);
    background: var(--white);
}

.input-group input:focus + i,
.input-group select:focus + i {
    color: var(--primary-teal);
}

.toggle-password {
    position: absolute;
    right: 1rem;
    left: auto !important;
    cursor: pointer;
    color: var(--medium-gray);
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary-teal);
}

.login-btn {
    background: var(--gradient-main);
    color: var(--white);
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-large);
}

.login-btn:active {
    transform: translateY(0);
}

/* ===== DASHBOARD ===== */
.dashboard {
    display: flex;
    min-height: 100vh;
    background: var(--light-gray);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 280px;
    background: var(--white);
    box-shadow: var(--shadow-medium);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    border-right: 1px solid rgba(123, 67, 151, 0.1);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: center;
    background: var(--gradient-soft);
    border-bottom: 1px solid rgba(123, 67, 151, 0.1);
}

.sidebar-logo {
    width: 120px;
    height: auto;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.sidebar-header h2 {
    color: var(--primary-purple);
    font-size: 1.3rem;
    font-weight: var(--font-weight-bold);
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
}

.nav-menu li {
    margin: 0.25rem 0;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--dark-gray);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 0 25px 25px 0;
    margin-right: 1rem;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--gradient-main);
    transform: scaleY(0);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: bottom;
    box-shadow: 0 0 8px rgba(123, 67, 151, 0.4);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(123, 67, 151, 0.1) 0%, rgba(30, 154, 138, 0.15) 100%);
    transition: left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: -1;
}

.nav-menu a:hover {
    color: var(--primary-purple);
    transform: translateX(12px) scale(1.03) rotateY(2deg);
    box-shadow: 0 6px 20px rgba(123, 67, 151, 0.25), 0 0 0 1px rgba(123, 67, 151, 0.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
}

.nav-menu a:hover::before {
    transform: scaleY(1);
    transform-origin: top;
}

.nav-menu a:hover::after {
    left: 0;
}

.nav-menu a:active {
    transform: translateX(8px) scale(1.01) rotateY(1deg);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-menu a:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 154, 138, 0.3);
}

.nav-menu a i {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center;
}

.nav-menu a:hover i {
    transform: scale(1.1) rotate(5deg);
    color: var(--primary-teal);
}

.nav-menu a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* ===== CONTENIDO PRINCIPAL ===== */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    background: var(--light-gray);
    min-height: 100vh;
}

.top-bar {
    background: var(--white);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(123, 67, 151, 0.05);
}

.top-bar h1 {
    color: var(--primary-purple);
    font-size: 1.8rem;
    font-weight: var(--font-weight-bold);
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--medium-gray);
    font-weight: var(--font-weight-medium);
}

/* ===== SECCIONES ===== */
.section {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(123, 67, 151, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-gray);
}

.section-header h2 {
    color: var(--primary-purple);
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
}

/* ===== PÁGINA DE INICIO ===== */
.welcome-section {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--gradient-soft);
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 1px solid rgba(123, 67, 151, 0.1);
}

.welcome-section h2 {
    color: var(--primary-purple);
    font-size: 2.2rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: 1rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-section p {
    color: var(--medium-gray);
    font-size: 1.1rem;
    font-weight: var(--font-weight-medium);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(123, 67, 151, 0.05);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    animation: cardSlideUp 0.8s ease-out;
    animation-fill-mode: both;
    cursor: pointer;
    transform-style: preserve-3d;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-main);
    transform: scaleX(0);
    transform-origin: left;
    animation: barGrow 1.2s ease-out 0.8s forwards;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(123, 67, 151, 0.15) 0%, rgba(30, 154, 138, 0.1) 50%, transparent 70%);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: -1;
    transform: scale(0) rotate(0deg);
}

.stat-card:hover {
    transform: translateY(-15px) scale(1.05) rotateX(8deg) rotateY(2deg);
    box-shadow: var(--shadow-large), 0 30px 60px rgba(123, 67, 151, 0.2), 0 0 0 1px rgba(123, 67, 151, 0.1);
    border-color: rgba(123, 67, 151, 0.3);
}

.stat-card:hover::after {
    opacity: 1;
    transform: scale(1.2) rotate(360deg);
}

.stat-card:active {
    transform: translateY(-10px) scale(1.02) rotateX(4deg);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.stat-card:focus {
    outline: none;
    box-shadow: var(--shadow-large), 0 0 0 3px rgba(30, 154, 138, 0.3);
}

@keyframes cardSlideUp {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes barGrow {
    0% {
        transform: scaleX(0);
    }
    100% {
        transform: scaleX(1);
    }
}

.stat-card i {
    font-size: 2.5rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-purple);
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--medium-gray);
    font-weight: var(--font-weight-medium);
}

/* ===== BOTONES ===== */
.btn-primary {
    background: var(--gradient-main);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: var(--shadow-soft);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 0;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover::after {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.03) rotateX(5deg);
    box-shadow: var(--shadow-large), 0 15px 35px rgba(123, 67, 151, 0.4);
}

.btn-primary:active {
    transform: translateY(-2px) scale(1.01) rotateX(2deg);
    transition: all 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn-primary:focus {
    outline: none;
    box-shadow: var(--shadow-large), 0 0 0 3px rgba(30, 154, 138, 0.3);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-purple);
    border: 2px solid var(--primary-purple);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--primary-purple);
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-secondary:hover::before {
    width: 100%;
}

.btn-secondary:hover {
    color: var(--white);
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-medium);
}

.btn-secondary:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

/* ===== BARRA DE BÚSQUEDA ===== */
.search-bar {
    margin-bottom: 1.5rem;
}

.search-bar input,
.search-bar select {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(123, 67, 151, 0.1);
    border-radius: 10px;
    font-size: 1rem;
    font-family: var(--font-primary);
    background: var(--white);
    transition: all 0.3s ease;
    outline: none;
}

.search-bar input:focus,
.search-bar select:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(30, 154, 138, 0.1);
}

/* ===== TABLAS ===== */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(123, 67, 151, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

table thead {
    background: var(--gradient-soft);
}

table th {
    padding: 1rem;
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--primary-purple);
    border-bottom: 2px solid rgba(123, 67, 151, 0.1);
}

table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(123, 67, 151, 0.05);
    color: var(--dark-gray);
}

table tbody tr {
    transition: background-color 0.3s ease;
}

table tbody tr:hover {
    background: var(--gradient-soft);
}

table button {
    background: var(--primary-teal);
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
}

table button:hover {
    background: var(--primary-purple);
    transform: translateY(-1px);
}

table button:last-child {
    margin-right: 0;
}

/* ===== MODALES ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    animation: modalFadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalFadeIn {
    0% { 
        opacity: 0; 
        backdrop-filter: blur(0px);
    }
    100% { 
        opacity: 1; 
        backdrop-filter: blur(10px);
    }
}

.modal-content {
    background: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-large), 0 25px 50px rgba(0, 0, 0, 0.15);
    position: relative;
    animation: modalSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.9) rotateX(10deg);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-10px) scale(1.02) rotateX(5deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
    }
}

.modal-content h2 {
    color: var(--primary-purple);
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: 1.5rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--medium-gray);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--primary-purple);
}

.modal .form-group {
    margin-bottom: 1.5rem;
}

.modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: var(--font-weight-medium);
    color: var(--dark-gray);
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(123, 67, 151, 0.1);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-primary);
    background: var(--white);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    outline: none;
    position: relative;
    z-index: 1;
}

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(30, 154, 138, 0.1), 0 8px 25px rgba(30, 154, 138, 0.15);
    transform: translateY(-2px) scale(1.01);
    background: linear-gradient(135deg, #ffffff 0%, #f8fffe 100%);
}

.modal .form-group input:hover,
.modal .form-group select:hover,
.modal .form-group textarea:hover {
    border-color: rgba(123, 67, 151, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.modal .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ===== CONTABILIDAD ===== */
.resumen-contabilidad {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.resumen-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(123, 67, 151, 0.05);
    position: relative;
    overflow: hidden;
}

.resumen-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-main);
}

.resumen-card h3 {
    color: var(--primary-purple);
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0.5rem;
}

.resumen-card p {
    color: var(--primary-teal);
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
}

/* ===== RESPONSIVE DESIGN MEJORADO ===== */

/* Tablets y pantallas medianas */
@media (max-width: 1024px) {
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        order: 1;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
        order: 2;
    }
    
    .sidebar-header {
        padding: 1rem;
        text-align: center;
    }
    
    .nav-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .nav-menu li {
        flex: 1;
        min-width: 120px;
    }
    
    .nav-menu a {
        display: block;
        text-align: center;
        padding: 0.8rem 0.5rem;
        font-size: 0.9rem;
        border-radius: 8px;
        margin-right: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Móviles y tablets pequeñas */
@media (max-width: 768px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-box {
        padding: 2rem;
        margin: 1rem;
        max-width: 400px;
    }
    
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        box-shadow: var(--shadow-soft);
    }
    
    table {
        min-width: 700px;
        font-size: 0.9rem;
    }
    
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        width: 95%;
        max-width: 500px;
        margin: 2rem auto;
        padding: 1.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .resumen-contabilidad {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .nav-menu {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .nav-menu li:last-child {
        grid-column: span 3;
    }
    
    .top-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }
    
    .top-bar h1 {
        font-size: 1.5rem;
    }
    
    .search-bar input,
    .search-bar select {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .welcome-section {
        padding: 2rem 1rem;
    }
    
    .welcome-section h2 {
        font-size: 1.8rem;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .login-container {
        padding: 0.5rem;
    }
    
    .login-box {
        width: 100%;
        max-width: 350px;
        padding: 1.5rem;
        margin: 0.5rem auto;
    }
    
    .logo {
        width: 150px;
        height: auto;
    }
    
    .logo-section h2 {
        font-size: 1.2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 1rem auto;
        padding: 1rem;
        max-height: 95vh;
    }
    
    .btn-primary, 
    .btn-secondary {
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 0.8rem;
        font-size: 0.9rem;
        justify-content: center;
    }
    
    table {
        font-size: 0.8rem;
        min-width: 600px;
    }
    
    table th, 
    table td {
        padding: 0.5rem 0.3rem;
    }
    
    .sidebar-header h2 {
        font-size: 1.2rem;
    }
    
    .sidebar-header p {
        font-size: 0.8rem;
    }
    
    .nav-menu {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.3rem;
        padding: 0.5rem;
    }
    
    .nav-menu li:last-child {
        grid-column: span 2;
    }
    
    .nav-menu a {
        font-size: 0.8rem;
        padding: 0.6rem 0.3rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.3rem;
    }
    
    .nav-menu i {
        font-size: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .stat-card p {
        font-size: 0.8rem;
    }
    
    .welcome-section h2 {
        font-size: 1.5rem;
    }
    
    .welcome-section p {
        font-size: 0.9rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        font-weight: var(--font-weight-semibold);
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Previene zoom en iOS */
        padding: 0.7rem;
    }
    
    .input-group i {
        font-size: 0.9rem;
    }
    
    .resumen-card {
        padding: 1rem;
        text-align: center;
    }
    
    .resumen-card h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .resumen-card p {
        font-size: 1.2rem;
        font-weight: var(--font-weight-bold);
    }
    
    .section {
        padding: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.3rem;
    }
    
    .top-bar h1 {
        font-size: 1.3rem;
    }
    
    .user-info {
        font-size: 0.8rem;
    }
}

/* Mejoras para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .btn-primary,
    .btn-secondary,
    button,
    .nav-menu a {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .nav-menu a {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 0.2rem;
    }
    
    .table-container {
        -webkit-overflow-scrolling: touch;
    }
    
    input, 
    select, 
    textarea {
        font-size: 16px; /* Previene zoom automático en iOS */
    }
    
    .modal-content {
        -webkit-overflow-scrolling: touch;
    }
}

/* Orientación horizontal en móviles */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        height: auto;
    }
    
    .nav-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.5rem;
    }
    
    .nav-menu li {
        flex: 1;
        min-width: 100px;
        max-width: 150px;
    }
    
    .modal-content {
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .login-box {
        max-width: 500px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
}

/* Pantallas muy pequeñas */
@media (max-width: 320px) {
    .login-box {
        padding: 1rem;
    }
    
    .logo {
        width: 120px;
    }
    
    .nav-menu {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
    
    .nav-menu li:last-child {
        grid-column: span 1;
    }
    
    .modal-content {
        padding: 0.5rem;
    }
    
    .section {
        padding: 0.5rem;
    }
    
    .welcome-section {
        padding: 1rem 0.5rem;
    }
    
    .welcome-section h2 {
        font-size: 1.3rem;
    }
}

/* ===== ANIMACIONES ADICIONALES ===== */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* ===== UTILIDADES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* ===== EFECTOS ESPECIALES ===== */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

/* ===== SCROLLBAR PERSONALIZADA ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-main);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-purple);
}

/* ===== CREDENCIALES Y ALERTAS ===== */
.credentials-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--gradient-soft);
    border-radius: 12px;
    border: 1px solid rgba(123, 67, 151, 0.1);
}

.credentials-info h4 {
    color: var(--primary-purple);
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 1rem;
    text-align: center;
}

.credential-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    font-size: 0.85rem;
}

.credential-item strong {
    color: var(--primary-purple);
    font-weight: var(--font-weight-semibold);
}

.credential-item span {
    color: var(--primary-teal);
    font-family: 'Courier New', monospace;
    font-weight: var(--font-weight-medium);
}

/* Alertas personalizadas */
.custom-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-large);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.custom-alert.show {
    transform: translateX(0);
    opacity: 1;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: var(--font-weight-medium);
}

.alert-content i {
    font-size: 1.2rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.9);
    color: white;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.9);
    color: white;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-info {
    background: rgba(59, 130, 246, 0.9);
    color: white;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ===== ESTILOS PARA SESIONES Y HORARIOS ===== */
.modal-large .modal-content {
    max-width: 800px;
    width: 90%;
}

.modal-extra-large .modal-content {
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.admin-only {
    border-top: 2px solid #e9ecef;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.admin-only::before {
    content: "Campos de Administrador";
    display: block;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Estilos para el grid de sesiones */
.sesion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.sesion-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.sesiones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.sesion-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sesion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sesion-card.pendiente {
    border-color: #dee2e6;
    background: #ffffff;
}

.sesion-card.asistio {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
}

.sesion-card.no-asistio {
    border-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
}

.sesion-card.permiso {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
}

.sesion-card.actual {
    border-color: #007bff;
    background: linear-gradient(135deg, #cce7ff, #b3d9ff);
    color: #004085;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.3);
}

.sesion-numero {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.sesion-fecha {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.sesion-estado {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sesion-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e9ecef;
}

/* Modal para editar sesión individual */
.sesion-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

.sesion-edit-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
}

.sesion-edit-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.sesion-edit-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sesion-option {
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.sesion-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sesion-option.selected {
    border-color: #007bff;
    background: #e7f3ff;
    color: #004085;
}

.sesion-option i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* ===== ESTILOS MODERNOS PARA HISTORIA CLÍNICA CON EFECTOS AVANZADOS ===== */
#historiaModal .modal-content {
    max-width: 1200px;
    width: 95%;
    max-height: 95vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(123, 67, 151, 0.1);
    box-shadow: var(--shadow-large);
    animation: modalSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.historia-header-professional {
    background: var(--gradient-main);
    color: white;
    padding: 2rem;
    margin: -2rem -2rem 2rem -2rem;
    border-radius: 16px 16px 0 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.historia-header-professional::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: float 15s linear infinite;
}

.historia-header-professional h2 {
    color: white !important;
    background: none !important;
    -webkit-text-fill-color: white !important;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.historia-header-professional p {
    opacity: 0.9;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

.historia-section-modern {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(123, 67, 151, 0.1);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    animation: sectionFadeIn 0.8s ease-out;
    animation-fill-mode: both;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.historia-section-modern:nth-child(even) {
    animation-delay: 0.1s;
}

.historia-section-modern:nth-child(odd) {
    animation-delay: 0.2s;
}

.historia-section-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-main);
    transform: scaleY(0);
    transform-origin: top;
    animation: lineGrow 1s ease-out 0.5s forwards;
}

.historia-section-modern:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

@keyframes sectionFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes lineGrow {
    0% {
        transform: scaleY(0);
    }
    100% {
        transform: scaleY(1);
    }
}

.historia-section-modern h3 {
    color: var(--primary-purple);
    font-size: 1.3rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.historia-section-modern h3 i {
    color: var(--primary-teal);
    background: rgba(30, 154, 138, 0.1);
    padding: 0.75rem;
    border-radius: 50%;
    font-size: 1.2rem;
}

.historia-grid-modern {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.historia-grid-modern .form-group {
    margin-bottom: 0;
}

.historia-grid-modern .form-group label {
    color: var(--primary-purple);
    font-weight: var(--font-weight-semibold);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.historia-grid-modern .form-group label i {
    color: var(--primary-teal);
    font-size: 0.9rem;
}

.historia-textarea-modern {
    min-height: 140px;
    resize: vertical;
    font-family: 'Poppins', sans-serif;
    line-height: 1.7;
    border: 2px solid rgba(123, 67, 151, 0.1);
    border-radius: 10px;
    padding: 1rem;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.historia-textarea-modern:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(30, 154, 138, 0.1);
    transform: translateY(-1px);
}

.historia-actions-modern {
    background: var(--gradient-soft);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    border: 1px solid rgba(123, 67, 151, 0.1);
}

.historia-btn-modern {
    background: var(--gradient-main);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    justify-content: center;
}

.historia-btn-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.historia-btn-modern.secondary {
    background: white;
    color: var(--primary-purple);
    border: 2px solid var(--primary-purple);
}

.historia-btn-modern.secondary:hover {
    background: var(--primary-purple);
    color: white;
}

.historia-status-modern {
    background: linear-gradient(135deg, #e7f3ff 0%, #cce7ff 100%);
    border: 1px solid var(--primary-teal);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    display: none;
    box-shadow: var(--shadow-soft);
}

.historia-status-modern.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.historia-status-modern i {
    color: var(--primary-teal);
    margin-right: 0.5rem;
}

/* Estilos para campos de información del paciente */
.paciente-info-modern {
    background: var(--gradient-soft);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(123, 67, 151, 0.1);
}

.paciente-info-modern .historia-grid-modern {
    margin-bottom: 0;
}

/* ===== MEJORAS DE RESPONSIVIDAD AVANZADA ===== */

/* Responsive para historia clínica moderna */
@media (max-width: 768px) {
    .historia-grid-modern {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .historia-actions-modern {
        flex-direction: column;
        align-items: stretch;
    }
    
    .historia-btn-modern {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .historia-header-professional {
        padding: 1.5rem;
        margin: -2rem -1.5rem 2rem -1.5rem;
    }
    
    .historia-header-professional h2 {
        font-size: 1.5rem;
    }
}

/* ===== MEJORAS RESPONSIVAS ADICIONALES ===== */

/* Tablets grandes (1024px - 1200px) */
@media (min-width: 1024px) and (max-width: 1200px) {
    .sidebar {
        width: 260px;
    }
    
    .main-content {
        margin-left: 260px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .modal-content {
        max-width: 700px;
    }
}

/* Tablets medianas (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
    
    .table-container {
        font-size: 0.9rem;
    }
    
    .modal-content {
        max-width: 600px;
        padding: 1.5rem;
    }
    
    .historia-grid-modern {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Tablets pequeñas y móviles grandes (480px - 768px) */
@media (min-width: 480px) and (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        order: 1;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
        order: 2;
    }
    
    .nav-menu {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .nav-menu li:last-child {
        grid-column: span 3;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        max-width: 500px;
        margin: 3rem auto;
        padding: 1.5rem;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
        font-size: 0.85rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .historia-grid-modern {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .historia-actions-modern {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .historia-btn-modern {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }
}

/* Móviles medianos (375px - 480px) */
@media (min-width: 375px) and (max-width: 480px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-box {
        padding: 1.5rem;
        max-width: 350px;
    }
    
    .logo {
        width: 140px;
    }
    
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0.75rem;
    }
    
    .nav-menu {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.3rem;
        padding: 0.75rem;
    }
    
    .nav-menu li:last-child {
        grid-column: span 2;
    }
    
    .nav-menu a {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1.25rem;
        text-align: center;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 2rem auto;
        padding: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    
    table {
        min-width: 550px;
        font-size: 0.8rem;
    }
    
    table th,
    table td {
        padding: 0.5rem 0.25rem;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 0.875rem;
        font-size: 0.9rem;
        justify-content: center;
    }
    
    .top-bar {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        padding: 1rem;
    }
    
    .top-bar h1 {
        font-size: 1.4rem;
    }
    
    .welcome-section {
        padding: 1.5rem 1rem;
    }
    
    .welcome-section h2 {
        font-size: 1.6rem;
    }
    
    .welcome-section p {
        font-size: 0.95rem;
    }
    
    .historia-header-professional {
        padding: 1.25rem;
        margin: -1rem -1rem 1.5rem -1rem;
    }
    
    .historia-header-professional h2 {
        font-size: 1.4rem;
    }
    
    .historia-section-modern {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .historia-textarea-modern {
        min-height: 100px;
        font-size: 0.9rem;
    }
    
    .resumen-contabilidad {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Móviles pequeños (320px - 375px) */
@media (max-width: 375px) {
    .login-container {
        padding: 0.5rem;
    }
    
    .login-box {
        width: 100%;
        max-width: 320px;
        padding: 1.25rem;
        margin: 0.5rem auto;
    }
    
    .logo {
        width: 120px;
    }
    
    .logo-section h2 {
        font-size: 1.1rem;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .sidebar-header h2 {
        font-size: 1.1rem;
    }
    
    .nav-menu {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.25rem;
        padding: 0.5rem;
    }
    
    .nav-menu li:last-child {
        grid-column: span 1;
    }
    
    .nav-menu a {
        padding: 0.75rem;
        font-size: 0.8rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }
    
    .main-content {
        padding: 0.5rem;
    }
    
    .section {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.3rem;
    }
    
    .stat-card p {
        font-size: 0.8rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 1rem auto;
        padding: 0.75rem;
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .modal-content h2 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Previene zoom en iOS */
        padding: 0.75rem;
        border-radius: 6px;
    }
    
    table {
        min-width: 500px;
        font-size: 0.75rem;
    }
    
    table th,
    table td {
        padding: 0.4rem 0.2rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.75rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }
    
    .top-bar {
        padding: 0.75rem;
    }
    
    .top-bar h1 {
        font-size: 1.2rem;
    }
    
    .user-info {
        font-size: 0.75rem;
    }
    
    .welcome-section {
        padding: 1rem 0.75rem;
    }
    
    .welcome-section h2 {
        font-size: 1.4rem;
        line-height: 1.3;
    }
    
    .welcome-section p {
        font-size: 0.85rem;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    .search-bar input {
        width: 100%;
        font-size: 16px; /* Previene zoom en iOS */
        padding: 0.75rem;
    }
    
    .historia-header-professional {
        padding: 1rem;
        margin: -0.75rem -0.75rem 1rem -0.75rem;
    }
    
    .historia-header-professional h2 {
        font-size: 1.2rem;
        line-height: 1.3;
    }
    
    .historia-header-professional p {
        font-size: 0.85rem;
    }
    
    .historia-section-modern {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .historia-section-modern h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .historia-textarea-modern {
        min-height: 80px;
        font-size: 16px; /* Previene zoom en iOS */
        padding: 0.75rem;
    }
    
    .historia-actions-modern {
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .historia-btn-modern {
        padding: 0.75rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }
    
    .resumen-card {
        padding: 0.75rem;
    }
    
    .resumen-card h3 {
        font-size: 0.9rem;
    }
    
    .resumen-card p {
        font-size: 1.1rem;
    }
}

/* Orientación horizontal en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        height: auto;
    }
    
    .nav-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.5rem;
    }
    
    .nav-menu li {
        flex: 1;
        min-width: 80px;
        max-width: 120px;
    }
    
    .nav-menu a {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .modal-content {
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .login-box {
        max-width: 450px;
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-card h3 {
        font-size: 1.2rem;
    }
    
    .stat-card p {
        font-size: 0.75rem;
    }
}

/* Mejoras para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .btn-primary,
    .btn-secondary,
    button,
    .nav-menu a,
    .stat-card,
    .resumen-card {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .nav-menu a {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.75rem 0.5rem;
    }
    
    .table-container {
        -webkit-overflow-scrolling: touch;
    }
    
    input,
    select,
    textarea {
        font-size: 16px; /* Previene zoom automático en iOS */
        -webkit-appearance: none;
        border-radius: 8px;
    }
    
    .modal-content {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mejoras para botones táctiles */
    .historia-btn-modern,
    .btn-primary,
    .btn-secondary {
        min-height: 48px;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
    }
    
    /* Espaciado mejorado para táctil */
    .historia-actions-modern {
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .nav-menu {
        gap: 0.5rem;
    }
}

/* Pantallas muy anchas (1400px+) */
@media (min-width: 1400px) {
    .sidebar {
        width: 300px;
    }
    
    .main-content {
        margin-left: 300px;
        padding: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    .modal-content {
        max-width: 900px;
    }
    
    .historia-grid-modern {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .table-container {
        font-size: 1rem;
    }
}

/* Mejoras para impresión */
@media print {
    .sidebar,
    .top-bar,
    .section-header button,
    table button,
    .modal,
    .credentials-info,
    .custom-alert,
    .historia-actions-modern,
    .nav-menu {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    body {
        background: white;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .section,
    .historia-section-modern {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .historia-header-professional {
        background: #f0f0f0 !important;
        color: #333 !important;
        -webkit-print-color-adjust: exact;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    table {
        font-size: 10pt;
    }
    
    .historia-textarea-modern {
        border: 1px solid #ccc;
        background: white;
    }
}

/* Accesibilidad mejorada */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Modo oscuro (si el usuario lo prefiere) */
@media (prefers-color-scheme: dark) {
    :root {
        --light-gray: #1a1a1a;
        --white: #2d2d2d;
        --dark-gray: #e0e0e0;
        --medium-gray: #b0b0b0;
    }
    
    body {
        background: var(--light-gray);
        color: var(--dark-gray);
    }
    
    .modal-content,
    .section,
    .sidebar {
        background: var(--white);
        color: var(--dark-gray);
    }
    
    input,
    select,
    textarea {
        background: #3a3a3a;
        color: var(--dark-gray);
        border-color: #555;
    }
    
    table {
        background: var(--white);
    }
    
    table tbody tr:hover {
        background: rgba(123, 67, 151, 0.1);
    }
}

/* Progreso de sesiones */
.progreso-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progreso-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progreso-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s ease;
}

.progreso-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    min-width: 60px;
    text-align: right;
}

/* Estados de pago para administradores */
.pago-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.pago-status.pendiente {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.pago-status.parcial {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.pago-status.completo {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Responsive para sesiones */
@media (max-width: 768px) {
    .sesiones-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    
    .sesion-card {
        padding: 0.75rem;
        min-height: 80px;
    }
    
    .sesion-numero {
        font-size: 1rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .historia-grid {
        grid-template-columns: 1fr;
    }
    
    .historia-actions {
        flex-direction: column;
    }
}

/* Animaciones para las sesiones */
@keyframes sesionPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.sesion-card.nueva-sesion {
    animation: sesionPulse 2s infinite;
}

/* Tooltips para sesiones */
.sesion-card[data-tooltip] {
    position: relative;
}

.sesion-card[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.sesion-card[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

/* ===== ESTILOS MODERNOS PARA FECHA EN SESIONES ===== */
.fecha-section-modern {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.fecha-header-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--primary-purple);
    font-weight: 600;
    font-size: 1.1rem;
}

.fecha-header-modern i {
    font-size: 1.2rem;
    color: var(--primary-purple);
    background: rgba(123, 67, 151, 0.1);
    padding: 0.5rem;
    border-radius: 50%;
}

.fecha-input-container-modern {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fecha-input-professional {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    color: var(--dark-gray);
}

.fecha-input-professional:focus {
    outline: none;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(30, 154, 138, 0.1);
    transform: translateY(-1px);
}

.fecha-display-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.fecha-display-modern:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.fecha-display-modern i {
    color: var(--primary-teal);
    font-size: 1.1rem;
    background: rgba(30, 154, 138, 0.1);
    padding: 0.5rem;
    border-radius: 50%;
}

.fecha-display-modern span {
    font-weight: 700;
    color: #495057;
    font-size: 0.95rem;
    text-transform: capitalize;
    flex: 1;
}

/* Animación para el cambio de fecha */
@keyframes fechaUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.fecha-display-modern.updated {
    animation: fechaUpdate 0.5s ease;
}

/* Responsive para fecha moderna */
@media (max-width: 768px) {
    .fecha-section-modern {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .fecha-header-modern {
        font-size: 1rem;
    }
    
    .fecha-input-professional {
        padding: 0.75rem;
        font-size: 16px; /* Previene zoom en iOS */
    }
    
    .fecha-display-modern {
        padding: 0.75rem;
    }
    
    .fecha-display-modern span {
        font-size: 0.9rem;
    }
}

/* ===== ESTILOS PROFESIONALES PARA BOTONES DE NAVEGACIÓN SEMANAL ===== */
.btn-nav-professional {
    background: linear-gradient(135deg, #7B4397 0%, #1E9A8A 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 15px rgba(123, 67, 151, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    min-width: 180px;
    justify-content: center;
}

.btn-nav-professional::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

.btn-nav-professional::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 0;
}

.btn-nav-professional:hover::before {
    left: 100%;
}

.btn-nav-professional:hover::after {
    width: 300px;
    height: 300px;
}

.btn-nav-professional:hover {
    transform: translateY(-3px) scale(1.02) rotateX(5deg);
    box-shadow: 0 8px 25px rgba(123, 67, 151, 0.4), 0 15px 35px rgba(30, 154, 138, 0.2);
}

.btn-nav-professional:active {
    transform: translateY(-1px) scale(1.01) rotateX(2deg);
    transition: all 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn-nav-professional:focus {
    outline: none;
    box-shadow: 0 8px 25px rgba(123, 67, 151, 0.4), 0 0 0 3px rgba(30, 154, 138, 0.3);
}

.btn-nav-professional i {
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
}

.btn-nav-professional span {
    z-index: 2;
    position: relative;
    font-weight: 600;
}

.btn-nav-professional:hover i {
    transform: scale(1.1);
}

/* Estilos específicos para cada botón */
.btn-nav-professional:first-child {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-nav-professional:first-child:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4), 0 15px 35px rgba(118, 75, 162, 0.2);
}

.btn-nav-professional:last-child {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.btn-nav-professional:last-child:hover {
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4), 0 15px 35px rgba(245, 87, 108, 0.2);
}

/* ===== ESTILOS PARA HORAS EDITABLES ===== */
.editable-hora {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid rgba(123, 67, 151, 0.1);
}

.editable-hora:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(30, 154, 138, 0.2);
    border-color: var(--primary-teal);
}

.editable-hora::after {
    content: '✏️';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.editable-hora:hover::after {
    opacity: 1;
}

.editable-hora.editing {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-color: var(--warning);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

/* ===== ESTILOS PARA LEYENDA EDITABLE ===== */
.leyenda-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.leyenda-header h4 {
    color: var(--primary-purple);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.btn-agregar-resena {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-agregar-resena:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.leyenda-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(123, 67, 151, 0.1);
    margin-bottom: 0.5rem;
}

.leyenda-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.leyenda-texto {
    cursor: pointer;
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.leyenda-texto:hover {
    background: rgba(123, 67, 151, 0.1);
    color: var(--primary-purple);
}

.leyenda-texto.editing {
    background: white;
    border: 2px solid var(--primary-teal);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 154, 138, 0.1);
}

.btn-eliminar-leyenda {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.leyenda-item:hover .btn-eliminar-leyenda {
    opacity: 1;
    transform: scale(1);
}

.btn-eliminar-leyenda:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

/* Colores específicos para cada tipo de terapia */
.leyenda-item.estimulacion .color-box {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.leyenda-item.terapia-lenguaje .color-box {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.leyenda-item.terapia-ocupacional .color-box {
    background: linear-gradient(135deg, #45b7d1 0%, #96c93d 100%);
}

.leyenda-item.taller .color-box {
    background: linear-gradient(135deg, #f9ca24 0%, #f0932b 100%);
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.leyenda-item:hover .color-box {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* ===== ESTILOS PARA SELECTOR DE SEMANA MEJORADO ===== */
.semana-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 1px solid rgba(123, 67, 151, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

#semanaActual {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-purple);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 1rem 2rem;
    border-radius: 12px;
    border: 2px solid rgba(123, 67, 151, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    min-width: 300px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== RESPONSIVE PARA NUEVOS ELEMENTOS ===== */
@media (max-width: 768px) {
    .btn-nav-professional {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        min-width: 150px;
    }
    
    .semana-selector {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    #semanaActual {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
        min-width: auto;
        width: 100%;
    }
    
    .leyenda-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .btn-agregar-resena {
        width: 100%;
        justify-content: center;
    }
    
    .leyenda-item {
        padding: 0.5rem;
    }
    
    .leyenda-texto {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .btn-nav-professional {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        min-width: 120px;
    }
    
    .btn-nav-professional span {
        display: none;
    }
    
    .btn-nav-professional i {
        font-size: 1.2rem;
    }
    
    .semana-selector {
        padding: 0.75rem;
    }
    
    #semanaActual {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .leyenda-header h4 {
        font-size: 1rem;
    }
    
    .btn-agregar-resena {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* ===== ANIMACIONES PARA EDICIÓN ===== */
@keyframes editPulse {
    0% { box-shadow: 0 0 0 0 rgba(30, 154, 138, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(30, 154, 138, 0); }
    100% { box-shadow: 0 0 0 0 rgba(30, 154, 138, 0); }
}

.editing {
    animation: editPulse 1.5s infinite;
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.leyenda-item.nueva {
    animation: slideInRight 0.5s ease-out;
}

/* ===== TOOLTIPS PARA ELEMENTOS EDITABLES ===== */
.editable-hora[title]:hover::before,
.leyenda-texto[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.editable-hora[title]:hover::after,
.leyenda-texto[title]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

/* ===== ESTILOS PARA TRABAJADORES CON HORARIOS ===== */
.trabajadores-horarios-section {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 1px solid rgba(123, 67, 151, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    animation: sectionFadeIn 0.8s ease-out;
}

.trabajadores-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.trabajadores-header h4 {
    color: var(--primary-purple);
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trabajadores-header h4 i {
    color: var(--primary-teal);
    background: rgba(30, 154, 138, 0.1);
    padding: 0.75rem;
    border-radius: 50%;
    font-size: 1.2rem;
    animation: iconPulse 2s infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.trabajadores-horarios-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    min-height: 60px;
    position: relative;
}

.trabajadores-horarios-container:empty::before {
    content: 'No hay trabajadores con horarios registrados aún. Los trabajadores aparecerán aquí cuando se guarden horarios.';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--medium-gray);
    font-style: italic;
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.7;
    width: 100%;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 2px dashed rgba(123, 67, 151, 0.2);
}

.trabajador-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    animation: cardSlideUp 0.6s ease-out;
    animation-fill-mode: both;
}

.trabajador-card:nth-child(even) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.3);
    animation-delay: 0.1s;
}

.trabajador-card:nth-child(3n) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.3);
    animation-delay: 0.2s;
}

.trabajador-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: float 15s linear infinite;
    opacity: 0.3;
}

.trabajador-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

.trabajador-card:hover::after {
    left: 100%;
}

.trabajador-card:hover {
    transform: translateY(-8px) scale(1.03) rotateX(5deg) rotateY(2deg);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4), 0 5px 15px rgba(0, 0, 0, 0.1);
}

.trabajador-card:active {
    transform: translateY(-4px) scale(1.01) rotateX(2deg);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.trabajador-info {
    position: relative;
    z-index: 2;
}

.trabajador-nombre {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trabajador-nombre i {
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.trabajador-semanas {
    font-size: 0.9rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.trabajador-semanas i {
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem;
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.trabajador-accion {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.trabajador-card:hover .trabajador-accion {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ===== MODAL PARA HORARIO COMPLETO ===== */
#horarioCompletoModal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    animation: modalFadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#horarioCompletoModal .modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    margin: 3% auto;
    padding: 0;
    border-radius: 20px;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: modalSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.horario-completo-header {
    background: var(--gradient-main);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.horario-completo-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: float 20s linear infinite;
}

.horario-completo-header h2 {
    color: white !important;
    background: none !important;
    -webkit-text-fill-color: white !important;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.horario-completo-header p {
    opacity: 0.9;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

.horario-completo-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.semana-horario {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(123, 67, 151, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    animation: sectionFadeIn 0.6s ease-out;
    animation-fill-mode: both;
}

.semana-horario:nth-child(even) {
    animation-delay: 0.1s;
}

.semana-horario:nth-child(odd) {
    animation-delay: 0.2s;
}

.semana-titulo {
    color: var(--primary-purple);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.semana-titulo i {
    color: var(--primary-teal);
    background: rgba(30, 154, 138, 0.1);
    padding: 0.5rem;
    border-radius: 50%;
    font-size: 1rem;
}

.semana-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(123, 67, 151, 0.05);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--medium-gray);
}

.semana-fecha {
    font-weight: 600;
    color: var(--primary-purple);
}

.semana-pacientes {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary-teal);
}

.horario-tabla {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.horario-tabla th {
    background: var(--gradient-soft);
    color: var(--primary-purple);
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid rgba(123, 67, 151, 0.1);
}

.horario-tabla td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid rgba(123, 67, 151, 0.05);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.horario-tabla td.hora-col {
    background: rgba(123, 67, 151, 0.05);
    font-weight: 600;
    color: var(--primary-purple);
    font-size: 0.8rem;
}

.horario-tabla td.paciente-ocupado {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    font-weight: 600;
    position: relative;
}

.horario-tabla td.paciente-ocupado::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--success);
}

.horario-tabla tbody tr:hover td {
    background: rgba(30, 154, 138, 0.05);
}

.horario-completo-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.horario-completo-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ===== RESPONSIVE PARA TRABAJADORES CON HORARIOS ===== */
@media (max-width: 768px) {
    .trabajadores-horarios-section {
        margin-top: 2rem;
        padding: 1.5rem;
    }
    
    .trabajadores-header h4 {
        font-size: 1.1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .trabajadores-horarios-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .trabajador-card {
        padding: 1.25rem;
    }
    
    .trabajador-nombre {
        font-size: 1.1rem;
    }
    
    .trabajador-semanas {
        font-size: 0.85rem;
    }
    
    .trabajador-accion {
        font-size: 0.75rem;
    }
    
    #horarioCompletoModal .modal-content {
        width: 98%;
        margin: 2% auto;
        max-height: 95vh;
    }
    
    .horario-completo-header {
        padding: 1.5rem;
    }
    
    .horario-completo-header h2 {
        font-size: 1.5rem;
    }
    
    .horario-completo-body {
        padding: 1rem;
        max-height: 75vh;
    }
    
    .semana-horario {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .semana-titulo {
        font-size: 1.1rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .semana-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .horario-tabla {
        font-size: 0.8rem;
    }
    
    .horario-tabla th,
    .horario-tabla td {
        padding: 0.5rem 0.25rem;
    }
    
    .horario-tabla td.hora-col {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .trabajadores-horarios-section {
        margin-top: 1.5rem;
        padding: 1rem;
    }
    
    .trabajadores-header h4 {
        font-size: 1rem;
    }
    
    .trabajador-card {
        padding: 1rem;
    }
    
    .trabajador-nombre {
        font-size: 1rem;
    }
    
    .trabajador-semanas {
        font-size: 0.8rem;
    }
    
    .trabajador-accion {
        font-size: 0.7rem;
        padding: 0.4rem;
    }
    
    .horario-completo-header {
        padding: 1rem;
    }
    
    .horario-completo-header h2 {
        font-size: 1.3rem;
    }
    
    .horario-completo-body {
        padding: 0.75rem;
    }
    
    .semana-horario {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .semana-titulo {
        font-size: 1rem;
    }
    
    .horario-tabla {
        font-size: 0.75rem;
    }
    
    .horario-tabla th,
    .horario-tabla td {
        padding: 0.4rem 0.2rem;
    }
    
    .horario-tabla td.hora-col {
        font-size: 0.65rem;
    }
    
    .horario-completo-close {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
        right: 1rem;
        top: 1rem;
    }
}

/* ===== ANIMACIONES ADICIONALES ===== */
@keyframes cardSlideUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes sectionFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== EFECTOS ESPECIALES PARA TRABAJADORES ===== */
.trabajador-card.nuevo {
    animation: cardSlideUp 0.8s ease-out, newCardGlow 2s ease-in-out;
}

@keyframes newCardGlow {
    0%, 100% { box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3); }
    50% { box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6), 0 0 20px rgba(102, 126, 234, 0.4); }
}

/* ===== ESTILOS PARA ARCHIVOS DEL PACIENTE EN HISTORIA CLÍNICA ===== */
.archivos-paciente-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(123, 67, 151, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: sectionFadeIn 0.6s ease-out;
}

.subir-archivo-paciente {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 2px dashed rgba(123, 67, 151, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.subir-archivo-paciente:hover {
    border-color: var(--primary-teal);
    background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 154, 138, 0.1);
}

.subir-archivo-paciente .form-group {
    margin-bottom: 1rem;
}

.subir-archivo-paciente .form-group label {
    color: var(--primary-purple);
    font-weight: var(--font-weight-semibold);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.subir-archivo-paciente .form-group label i {
    color: var(--primary-teal);
    font-size: 1.1rem;
    background: rgba(30, 154, 138, 0.1);
    padding: 0.5rem;
    border-radius: 50%;
}

#historiaArchivoFile {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(123, 67, 151, 0.1);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: var(--font-primary);
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

#historiaArchivoFile:hover {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(30, 154, 138, 0.1);
}

#historiaArchivoFile:focus {
    outline: none;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(30, 154, 138, 0.2);
}

.subir-archivo-paciente small {
    color: var(--medium-gray);
    font-size: 0.85rem;
    font-style: italic;
    display: block;
    margin-top: 0.5rem;
    text-align: center;
}

.btn-upload-historia {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
}

.btn-upload-historia::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

.btn-upload-historia::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 0;
}

.btn-upload-historia:hover::before {
    left: 100%;
}

.btn-upload-historia:hover::after {
    width: 300px;
    height: 300px;
}

.btn-upload-historia:hover {
    transform: translateY(-3px) scale(1.02) rotateX(5deg);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4), 0 15px 35px rgba(32, 201, 151, 0.2);
}

.btn-upload-historia:active {
    transform: translateY(-1px) scale(1.01) rotateX(2deg);
    transition: all 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn-upload-historia:focus {
    outline: none;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4), 0 0 0 3px rgba(32, 201, 151, 0.3);
}

.btn-upload-historia i {
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
}

.btn-upload-historia span {
    z-index: 2;
    position: relative;
    font-weight: 600;
}

.btn-upload-historia:hover i {
    transform: scale(1.1) rotate(5deg);
}

.archivos-lista-paciente {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid rgba(123, 67, 151, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.archivos-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.archivos-header h4 {
    color: var(--primary-purple);
    font-size: 1.1rem;
    font-weight: var(--font-weight-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.archivos-header h4 i {
    color: var(--primary-teal);
    background: rgba(30, 154, 138, 0.1);
    padding: 0.75rem;
    border-radius: 50%;
    font-size: 1.1rem;
    animation: iconPulse 2s infinite;
}

.archivos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    min-height: 100px;
    position: relative;
}

.no-archivos-mensaje {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    color: var(--medium-gray);
    font-style: italic;
    background: rgba(123, 67, 151, 0.05);
    border-radius: 12px;
    border: 2px dashed rgba(123, 67, 151, 0.2);
    animation: fadeIn 0.5s ease-out;
}

.no-archivos-mensaje i {
    font-size: 3rem;
    color: rgba(123, 67, 151, 0.3);
    margin-bottom: 1rem;
    display: block;
}

.no-archivos-mensaje p {
    font-size: 1rem;
    margin: 0;
    color: var(--medium-gray);
}

.archivo-paciente-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(123, 67, 151, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    animation: cardSlideUp 0.6s ease-out;
    animation-fill-mode: both;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.archivo-paciente-card:nth-child(even) {
    animation-delay: 0.1s;
}

.archivo-paciente-card:nth-child(odd) {
    animation-delay: 0.2s;
}

.archivo-paciente-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-main);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease;
}

.archivo-paciente-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(30, 154, 138, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: -1;
    transform: scale(0) rotate(0deg);
}

.archivo-paciente-card:hover::before {
    transform: scaleY(1);
}

.archivo-paciente-card:hover::after {
    opacity: 1;
    transform: scale(1.2) rotate(360deg);
}

.archivo-paciente-card:hover {
    transform: translateY(-5px) scale(1.02) rotateX(5deg) rotateY(2deg);
    box-shadow: 0 8px 25px rgba(123, 67, 151, 0.2), 0 15px 35px rgba(30, 154, 138, 0.1);
    border-color: rgba(30, 154, 138, 0.3);
}

.archivo-paciente-card:active {
    transform: translateY(-2px) scale(1.01) rotateX(2deg);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.archivo-paciente-card:focus {
    outline: none;
    box-shadow: 0 8px 25px rgba(123, 67, 151, 0.2), 0 0 0 3px rgba(30, 154, 138, 0.3);
}

.archivo-paciente-info {
    position: relative;
    z-index: 2;
}

.archivo-paciente-icon {
    text-align: center;
    margin-bottom: 1rem;
}

.archivo-paciente-icon i {
    font-size: 2.5rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.archivo-paciente-card:hover .archivo-paciente-icon i {
    transform: scale(1.1) rotate(5deg);
}

.archivo-paciente-nombre {
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    color: var(--primary-purple);
    margin-bottom: 0.5rem;
    text-align: center;
    word-break: break-word;
    line-height: 1.3;
}

.archivo-paciente-tipo {
    font-size: 0.85rem;
    color: var(--primary-teal);
    text-align: center;
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.archivo-paciente-fecha {
    font-size: 0.8rem;
    color: var(--medium-gray);
    text-align: center;
    font-style: italic;
    margin-bottom: 1rem;
}

.archivo-paciente-acciones {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.btn-archivo-accion {
    background: var(--gradient-main);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 70px;
    justify-content: center;
}

.btn-archivo-accion:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(123, 67, 151, 0.3);
}

.btn-archivo-accion.descargar {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.btn-archivo-accion.descargar:hover {
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-archivo-accion.eliminar {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.btn-archivo-accion.eliminar:hover {
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-archivo-accion i {
    font-size: 0.9rem;
}

/* Iconos específicos por tipo de archivo */
.archivo-paciente-card[data-tipo="pdf"] .archivo-paciente-icon i {
    color: #dc3545;
}

.archivo-paciente-card[data-tipo="doc"] .archivo-paciente-icon i,
.archivo-paciente-card[data-tipo="docx"] .archivo-paciente-icon i {
    color: #2b579a;
}

.archivo-paciente-card[data-tipo="jpg"] .archivo-paciente-icon i,
.archivo-paciente-card[data-tipo="jpeg"] .archivo-paciente-icon i,
.archivo-paciente-card[data-tipo="png"] .archivo-paciente-icon i,
.archivo-paciente-card[data-tipo="gif"] .archivo-paciente-icon i {
    color: #28a745;
}

.archivo-paciente-card[data-tipo="xlsx"] .archivo-paciente-icon i,
.archivo-paciente-card[data-tipo="xls"] .archivo-paciente-icon i {
    color: #217346;
}

.archivo-paciente-card[data-tipo="ppt"] .archivo-paciente-icon i,
.archivo-paciente-card[data-tipo="pptx"] .archivo-paciente-icon i {
    color: #d24726;
}

.archivo-paciente-card[data-tipo="txt"] .archivo-paciente-icon i {
    color: #6c757d;
}

/* Estados de carga */
.archivo-paciente-card.cargando {
    opacity: 0.7;
    pointer-events: none;
}

.archivo-paciente-card.cargando::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: shimmer 1.5s infinite;
    z-index: 3;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.archivo-paciente-card.nuevo {
    animation: cardSlideUp 0.8s ease-out, newFileGlow 2s ease-in-out;
}

@keyframes newFileGlow {
    0%, 100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); }
    50% { box-shadow: 0 8px 25px rgba(30, 154, 138, 0.3), 0 0 20px rgba(30, 154, 138, 0.2); }
}

/* ===== RESPONSIVE PARA ARCHIVOS DEL PACIENTE ===== */
@media (max-width: 768px) {
    .archivos-paciente-container {
        padding: 1rem;
    }
    
    .subir-archivo-paciente {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .subir-archivo-paciente .form-group label {
        font-size: 0.9rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    #historiaArchivoFile {
        padding: 0.6rem;
        font-size: 16px; /* Previene zoom en iOS */
    }
    
    .btn-upload-historia {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .archivos-lista-paciente {
        padding: 1rem;
    }
    
    .archivos-header h4 {
        font-size: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .archivos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 0.75rem;
    }
    
    .archivo-paciente-card {
        padding: 1.25rem;
    }
    
    .archivo-paciente-icon i {
        font-size: 2rem;
    }
    
    .archivo-paciente-nombre {
        font-size: 0.9rem;
    }
    
    .archivo-paciente-tipo {
        font-size: 0.8rem;
    }
    
    .archivo-paciente-fecha {
        font-size: 0.75rem;
    }
    
    .archivo-paciente-acciones {
        flex-direction: column;
        gap: 0.4rem;
    }
    
    .btn-archivo-accion {
        width: 100%;
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    
    .no-archivos-mensaje {
        padding: 2rem 1rem;
    }
    
    .no-archivos-mensaje i {
        font-size: 2.5rem;
    }
    
    .no-archivos-mensaje p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .archivos-paciente-container {
        padding: 0.75rem;
    }
    
    .subir-archivo-paciente {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .subir-archivo-paciente .form-group label {
        font-size: 0.85rem;
    }
    
    .btn-upload-historia {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }
    
    .archivos-lista-paciente {
        padding: 0.75rem;
    }
    
    .archivos-header h4 {
        font-size: 0.9rem;
    }
    
    .archivos-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .archivo-paciente-card {
        padding: 1rem;
    }
    
    .archivo-paciente-icon i {
        font-size: 1.8rem;
    }
    
    .archivo-paciente-nombre {
        font-size: 0.85rem;
    }
    
    .archivo-paciente-tipo {
        font-size: 0.75rem;
    }
    
    .archivo-paciente-fecha {
        font-size: 0.7rem;
    }
    
    .btn-archivo-accion {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .no-archivos-mensaje {
        padding: 1.5rem 0.75rem;
    }
    
    .no-archivos-mensaje i {
        font-size: 2rem;
    }
    
    .no-archivos-mensaje p {
        font-size: 0.85rem;
    }
}

/* ===== ANIMACIONES ADICIONALES PARA ARCHIVOS ===== */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardSlideUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== TOOLTIPS PARA ARCHIVOS ===== */
.archivo-paciente-card[data-tooltip] {
    position: relative;
}

.archivo-paciente-card[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.archivo-paciente-card[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

/* ===== DRAG AND DROP STYLES ===== */
.subir-archivo-paciente.drag-over {
    border-color: var(--primary-teal);
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(30, 154, 138, 0.2);
}

.subir-archivo-paciente.drag-over::before {
    content: '📁 Suelta los archivos aquí';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-teal);
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 2rem;
    border-radius: 8px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar,
    .top-bar,
    .section-header button,
    table button,
    .modal,
    .credentials-info,
    .custom-alert,
    .btn-eliminar-leyenda,
    .btn-agregar-resena,
    .trabajador-accion,
    .horario-completo-close,
    .btn-upload-historia,
    .archivo-paciente-acciones,
    .subir-archivo-paciente {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    body {
        background: white;
    }
    
    .section,
    .trabajadores-horarios-section,
    .semana-horario,
    .archivos-paciente-container,
    .archivo-paciente-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .btn-nav-professional {
        background: #f0f0f0 !important;
        color: #333 !important;
        box-shadow: none !important;
    }
    
    .leyenda-item,
    .trabajador-card {
        background: white !important;
        border: 1px solid #ccc !important;
        color: #333 !important;
    }
    
    .horario-completo-header {
        background: #f0f0f0 !important;
        color: #333 !important;
    }
    
    .horario-tabla {
        border: 1px solid #ccc;
    }
    
    .horario-tabla th {
        background: #f0f0f0 !important;
        color: #333 !important;
    }
    
    .archivos-lista-paciente {
        background: white !important;
    }
    
    .archivo-paciente-card {
        background: white !important;
        color: #333 !important;
        break-inside: avoid;
    }
    
    .archivos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

/* ===== ESTILOS PARA HORARIOS PROFESIONALES ===== */

/* Contenedor principal de horarios */
.trabajador-selector-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.trabajador-selector-container .form-group {
    margin-bottom: 0;
}

.trabajador-selector-container label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.trabajador-selector-container select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
}

.trabajador-selector-container select:focus {
    border-color: #7B4397;
    box-shadow: 0 0 0 3px rgba(123, 67, 151, 0.1);
    outline: none;
}

/* Contenedor de horario profesional */
.horario-profesional-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid rgba(123, 67, 151, 0.1);
}

.horario-header-info {
    background: linear-gradient(135deg, #7B4397 0%, #DC2430 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.horario-header-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.horario-actions .btn-edit {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.horario-actions .btn-edit:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Tabla de horarios profesional */
.tabla-horario-profesional {
    overflow-x: auto;
}

.tabla-horario-semanal-pro {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tabla-horario-semanal-pro th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #dee2e6;
    font-size: 12px;
}

.tabla-horario-semanal-pro td {
    padding: 10px 8px;
    border: 1px solid #dee2e6;
    text-align: center;
    vertical-align: middle;
    min-height: 45px;
    font-size: 11px;
}

.turno-col-pro {
    width: 80px;
    background: linear-gradient(135deg, #7B4397 0%, #DC2430 100%);
    color: white !important;
    writing-mode: vertical-lr;
    text-orientation: mixed;
    font-weight: 700;
    font-size: 11px;
}

.hora-col-pro {
    width: 120px;
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 10px;
}

.dia-col-pro {
    width: 100px;
    font-weight: 500;
    color: #495057;
}

/* Celdas de pacientes */
.paciente-cell-pro {
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.paciente-cell-pro:hover {
    background: #e3f2fd;
    transform: scale(1.02);
}

.paciente-cell-pro.ocupado {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    font-weight: 600;
}

.paciente-cell-pro.estimulacion {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    font-weight: 600;
}

.paciente-cell-pro.terapia-lenguaje {
    background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
    color: #00695c;
    font-weight: 600;
}

.paciente-cell-pro.terapia-ocupacional {
    background: linear-gradient(135deg, #e1f5fe 0%, #b3e5fc 100%);
    color: #0277bd;
    font-weight: 600;
}

.paciente-cell-pro.taller {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    color: #f57f17;
    font-weight: 600;
}

/* Lista de Horarios Creados */
.horarios-creados-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid rgba(123, 67, 151, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.horarios-creados-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    text-align: center;
}

.horarios-creados-header h4 {
    color: var(--primary-purple);
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.horarios-creados-header h4 i {
    color: var(--primary-teal);
    background: rgba(30, 154, 138, 0.1);
    padding: 0.75rem;
    border-radius: 50%;
    font-size: 1.2rem;
}

.horarios-count {
    background: var(--gradient-main);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(123, 67, 151, 0.3);
}

.horarios-creados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    min-height: 100px;
    position: relative;
}

.horarios-creados-grid:empty::before {
    content: 'No hay horarios creados aún. Los horarios aparecerán aquí cuando se guarden.';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--medium-gray);
    font-style: italic;
    text-align: center;
    font-size: 1rem;
    opacity: 0.7;
    width: 100%;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 2px dashed rgba(123, 67, 151, 0.2);
}

.horario-creado-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    animation: cardSlideUp 0.6s ease-out;
    animation-fill-mode: both;
}

.horario-creado-card:nth-child(even) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.3);
    animation-delay: 0.1s;
}

.horario-creado-card:nth-child(3n) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.3);
    animation-delay: 0.2s;
}

.horario-creado-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: float 15s linear infinite;
    opacity: 0.3;
}

.horario-creado-card:hover {
    transform: translateY(-8px) scale(1.03) rotateX(5deg) rotateY(2deg);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4), 0 5px 15px rgba(0, 0, 0, 0.1);
}

.horario-creado-info {
    position: relative;
    z-index: 2;
}

.horario-creado-trabajador {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.horario-creado-trabajador i {
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.horario-creado-semana {
    font-size: 0.9rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.horario-creado-semana i {
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem;
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.horario-creado-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.horario-stat {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1;
    margin: 0 0.25rem;
}

.horario-stat-number {
    font-size: 1.2rem;
    font-weight: 700;
    display: block;
}

.horario-stat-label {
    font-size: 0.7rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.horario-creado-acciones {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-horario-accion {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-horario-accion:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-horario-accion.ver {
    background: rgba(40, 167, 69, 0.3);
    border-color: rgba(40, 167, 69, 0.5);
}

.btn-horario-accion.editar {
    background: rgba(255, 193, 7, 0.3);
    border-color: rgba(255, 193, 7, 0.5);
}

.btn-horario-accion.eliminar {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.5);
}

/* Modal para crear horario profesional */
#crearHorarioModal .modal-content {
    max-width: 1400px;
    width: 95%;
    max-height: 95vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(123, 67, 151, 0.1);
    box-shadow: var(--shadow-large);
}

.horario-form-header {
    background: var(--gradient-soft);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid rgba(123, 67, 151, 0.1);
}

.horario-form-header .form-row {
    display: flex;
    gap: 2rem;
    align-items: end;
}

.horario-form-header .form-group {
    flex: 1;
    margin-bottom: 0;
}

.horario-form-header label {
    color: var(--primary-purple);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#nombreTrabajador {
    background: rgba(123, 67, 151, 0.1);
    border: 2px solid rgba(123, 67, 151, 0.2);
    color: var(--primary-purple);
    font-weight: 600;
}

#semanaHorario {
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

#semanaHorario:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(30, 154, 138, 0.1);
}

/* Editor de horario profesional */
.horario-editor-profesional {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(123, 67, 151, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.horario-editor-profesional h3 {
    color: var(--primary-purple);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.horario-editor-profesional h3 i {
    color: var(--primary-teal);
    background: rgba(30, 154, 138, 0.1);
    padding: 0.75rem;
    border-radius: 50%;
    font-size: 1.2rem;
}

.turno-section-pro {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(123, 67, 151, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.turno-title {
    color: var(--primary-purple);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.turno-title i {
    color: var(--primary-teal);
    background: rgba(30, 154, 138, 0.1);
    padding: 0.5rem;
    border-radius: 50%;
    font-size: 1rem;
}

.horario-slots-pro {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.slot-row-pro {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(123, 67, 151, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.slot-row-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 67, 151, 0.1);
}

.hora-label-pro {
    margin-bottom: 1rem;
}

.hora-input-pro {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(123, 67, 151, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-purple);
    background: rgba(123, 67, 151, 0.05);
    text-align: center;
    transition: all 0.3s ease;
}

.hora-input-pro:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(30, 154, 138, 0.1);
    outline: none;
}

.dias-row-pro {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
}

.paciente-input-pro {
    padding: 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
}

.paciente-input-pro:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(30, 154, 138, 0.1);
    outline: none;
    transform: scale(1.02);
}

.paciente-input-pro:not(:placeholder-shown) {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    font-weight: 600;
    border-color: #28a745;
}

.btn-add-slot {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-add-slot:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Acciones del modal */
.modal-actions-pro {
    background: var(--gradient-soft);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    border: 1px solid rgba(123, 67, 151, 0.1);
}

.btn-primary-pro {
    background: var(--gradient-main);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(123, 67, 151, 0.3);
    min-width: 180px;
    justify-content: center;
}

.btn-primary-pro:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(123, 67, 151, 0.4);
}

.btn-secondary-pro {
    background: white;
    color: var(--primary-purple);
    border: 2px solid var(--primary-purple);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 150px;
    justify-content: center;
}

.btn-secondary-pro:hover {
    background: var(--primary-purple);
    color: white;
    transform: translateY(-2px);
}

.btn-cancel-pro {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    min-width: 120px;
    justify-content: center;
}

.btn-cancel-pro:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

/* ===== RESPONSIVE PARA HORARIOS PROFESIONALES ===== */
@media (max-width: 1200px) {
    .dias-row-pro {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .horarios-creados-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .trabajador-selector-container {
        padding: 15px;
    }
    
    .horario-header-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 15px;
    }
    
    .tabla-horario-profesional {
        font-size: 11px;
    }
    
    .tabla-horario-semanal-pro th,
    .tabla-horario-semanal-pro td {
        padding: 6px 4px;
        font-size: 10px;
    }
    
    .turno-col-pro {
        width: 60px;
        font-size: 9px;
    }
    
    .hora-col-pro {
        width: 90px;
        font-size: 9px;
    }
    
    .dia-col-pro {
        width: 70px;
    }
    
    .horarios-creados-section {
        padding: 1.5rem;
    }
    
    .horarios-creados-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .horarios-creados-header h4 {
        font-size: 1.1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .horarios-creados-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .horario-creado-card {
        padding: 1.25rem;
    }
    
    .horario-creado-trabajador {
        font-size: 1.1rem;
    }
    
    .horario-creado-semana {
        font-size: 0.85rem;
    }
    
    .horario-creado-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .horario-stat {
        margin: 0;
    }
    
    .horario-creado-acciones {
        flex-direction: column;
        gap: 0.4rem;
    }
    
    .btn-horario-accion {
        width: 100%;
        justify-content: center;
    }
    
    /* Modal responsive */
    #crearHorarioModal .modal-content {
        width: 98%;
        margin: 2% auto;
        max-height: 95vh;
    }
    
    .horario-form-header {
        padding: 1rem;
    }
    
    .horario-form-header .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .horario-editor-profesional {
        padding: 1.5rem;
    }
    
    .horario-editor-profesional h3 {
        font-size: 1.2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .turno-section-pro {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .turno-title {
        font-size: 1.1rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .slot-row-pro {
        padding: 0.75rem;
    }
    
    .dias-row-pro {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .paciente-input-pro {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    
    .hora-input-pro {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .btn-add-slot {
        padding: 0.6rem 1.25rem;
        font-size: 0.85rem;
    }
    
    .modal-actions-pro {
        padding: 1.5rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-primary-pro,
    .btn-secondary-pro,
    .btn-cancel-pro {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .trabajador-selector-container {
        padding: 10px;
    }
    
    .trabajador-selector-container label {
        font-size: 0.9rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .horario-header-info {
        padding: 10px;
    }
    
