:root {
    --primary-dark: #0047AB;
    --primary: #0066CC;
    --secondary: #00B4D8;
    --accent: #1E88E5;
    --light: #F8F9FA;
    --gray: #6C757D;
    --white: #FFFFFF;
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: #333;
    background-color: #f5f7fa;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--primary-dark);
    color: var(--white);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    transition: var(--transition);
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    font-size: 32px;
    margin-bottom: 10px;
}

.sidebar-header h3 {
    margin-top: 5px;
    font-size: 18px;
    font-weight: 600;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu li {
    list-style: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 16px 25px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    font-size: 15px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--secondary);
    color: var(--white);
    border-left: 4px solid var(--white);
}

.sidebar-menu i {
    margin-right: 15px;
    font-size: 20px;
    width: 25px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: absolute;
    bottom: 0;
    width: 280px;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
}

.sidebar-footer .user-info i {
    margin-right: 12px;
    font-size: 20px;
}

.sidebar-footer .user-name {
    font-weight: 600;
    font-size: 14px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    transition: var(--transition);
    min-height: 100vh;
}

.header {
    background: var(--white);
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header h1 {
    color: var(--primary-dark);
    font-size: 26px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header-right .notification {
    position: relative;
    cursor: pointer;
}

.header-right .notification i {
    font-size: 24px;
    color: var(--primary-dark);
}

.header-right .notification .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: var(--white);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
    font-weight: bold;
}

.header-right .user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 30px;
    transition: var(--transition);
}

.header-right .user-menu:hover {
    background: rgba(0, 102, 204, 0.1);
}

.header-right .user-menu img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
    font-size: 18px;
}

.header-right .user-name {
    font-weight: 600;
    color: var(--primary-dark);
    display: none;
}

.header-right .logout-btn {
    background: none;
    border: none;
    color: var(--danger);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    padding: 5px 10px;
    border-radius: 5px;
}

.header-right .logout-btn:hover {
    background: rgba(220, 53, 69, 0.1);
}

.container {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.page-title {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--secondary);
    color: var(--primary-dark);
    font-size: 28px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: var(--white);
    padding: 28px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--secondary);
}

.stat-icon {
    width: 80px;
    height: 80px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 25px;
    font-size: 36px;
    color: var(--white);
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 16px;
    color: var(--gray);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
}

.stat-info p {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.stat-info .trend {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-info .trend.positive {
    color: var(--success);
}

.stat-info .trend.negative {
    color: var(--danger);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.chart-card,
.table-card {
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    background: var(--primary);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-header h3 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header .btn {
    background: var(--white);
    color: var(--primary);
    border: none;
    padding: 8px 18px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.card-header .btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.chart-container {
    height: 320px;
    padding: 20px;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    color: var(--primary-dark);
    background: rgba(0, 102, 204, 0.05);
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    padding: 14px 20px;
    border-bottom: 1px solid #eee;
    font-size: 15px;
}

table tr:hover {
    background: rgba(0, 180, 216, 0.03);
}

.status {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status.pendiente {
    background: rgba(255, 193, 7, 0.15);
    color: #856404;
}

.status.confirmada {
    background: rgba(40, 167, 69, 0.15);
    color: #155724;
}

.status.atendida {
    background: rgba(23, 162, 184, 0.15);
    color: #0c5460;
}

.status.cancelada {
    background: rgba(220, 53, 69, 0.15);
    color: #721c24;
}

.text-center {
    text-align: center;
}

/* Botones */
.btn {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 11px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    border: 2px solid var(--primary);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    background: transparent;
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--secondary);
    border-color: var(--secondary);
}

.btn-secondary:hover {
    color: var(--secondary);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
}

.btn-success:hover {
    color: var(--success);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    color: var(--danger);
}

.btn-sm {
    padding: 7px 18px;
    font-size: 13px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 15px;
}

.form-control {
    width: 100%;
    padding: 13px 18px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    width: 95%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 22px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    font-size: 24px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 32px;
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 35px;
}

.modal-footer {
    padding: 20px 35px;
    border-top: 1px solid #eee;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .header-right .user-name {
        display: block;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-content.sidebar-active {
        margin-left: 280px;
    }
    
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 28px;
        color: var(--primary-dark);
        cursor: pointer;
        margin-right: 15px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    .header {
        padding: 15px 20px;
        flex-wrap: wrap;
    }
    
    .header h1 {
        font-size: 24px;
        width: 100%;
        margin-bottom: 15px;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        max-width: 500px;
    }
    
    .sidebar-header h3 {
        font-size: 16px;
    }
    
    .sidebar-menu a {
        font-size: 14px;
        padding: 14px 20px;
    }
    
    .sidebar-menu i {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .page-title {
        font-size: 24px;
    }
    
    .stat-card {
        padding: 22px;
    }
    
    .stat-icon {
        width: 70px;
        height: 70px;
        font-size: 30px;
    }
    
    .stat-info p {
        font-size: 28px;
    }
    
    .card-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .card-header .btn {
        width: 100%;
    }
    
    table {
        min-width: 500px;
    }
    
    .header-right .user-menu {
        gap: 8px;
    }
    
    .header-right .user-name {
        display: none;
    }
}
/* --- Variables para el Sidebar --- */
:root {
    --sidebar-width: 250px;
    --sidebar-width-collapsed: 0px; /* En móvil se oculta totalmente */
    --transition-speed: 0.3s;
}

/* --- Estilos del Botón Toggle (Hamburguesa) --- */
.sidebar-toggle {
    /* Oculto por defecto (PC) */
    display: none; 
    
    /* Estilo del botón */
    background-color: #0066cc; /* AZUL CORPORATIVO (Ajusta si usas otra variable) */
    color: white; /* Icono blanco */
    border: none;
    border-radius: 8px; /* Bordes redondeados */
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 102, 204, 0.3); /* Sombra azulada suave */
    transition: all 0.3s ease;
    
    /* Centrar icono */
    display: flex; 
    align-items: center;
    justify-content: center;
    
    /* Margen para separarlo del título */
    margin-right: 15px;
}

.sidebar-toggle:hover {
    background-color: #0052a3; /* Azul más oscuro al pasar el mouse */
    transform: translateY(-2px); /* Pequeño efecto de elevación */
    box-shadow: 0 6px 8px rgba(0, 102, 204, 0.4);
}

.sidebar-toggle:active {
    transform: translateY(0);
}

/* --- Media Query: Solo Celulares y Tablets pequeñas (< 768px) --- */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex; /* AQUÍ SE HACE VISIBLE SOLO EN MÓVIL */
    }

    .sidebar {
        transform: translateX(-100%); /* Oculto por defecto en móvil */
        width: 250px;
        z-index: 1000;
        transition: transform 0.3s ease-in-out;
    }

    .sidebar.active {
        transform: translateX(0); /* Visible cuando tiene la clase active */
        box-shadow: 4px 0 15px rgba(0,0,0,0.2);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        transition: margin-left 0.3s ease-in-out;
    }

    /* Overlay (Fondo oscuro) */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s;
        backdrop-filter: blur(2px); /* Efecto borroso opcional */
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
}

/* En PC (> 768px), aseguramos que todo esté limpio */
@media (min-width: 769px) {
    .sidebar-toggle {
        display: none !important; /* Forzar oculto en PC */
    }
    .sidebar {
        transform: translateX(0) !important; /* Sidebar siempre visible */
        position: fixed;
    }
    .sidebar-overlay {
        display: none !important;
    }
}
/* Team Section Styles */
.team-section {
    padding: 80px 0;
    background-color: #f9fbfd;
    overflow: hidden; /* Evitar scroll horizontal indeseado */
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-family: 'Montserrat', sans-serif;
    color: var(--primary, #0066cc);
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-header p {
    color: #666;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Carousel Container */
.team-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.team-carousel-track {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 20px 10px;
    width: 100%;
    max-width: 1200px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE */
}

.team-carousel-track::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Tarjeta de Profesional */
.team-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    min-width: 280px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    text-align: center;
    border: 1px solid #eee;
}

.team-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 102, 204, 0.15);
}

.team-img-wrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: #f0f0f0;
}

.team-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.team-card:hover .team-img-wrapper img {
    transform: scale(1.05);
}

.team-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.team-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    color: #333;
    margin: 0 0 5px 0;
    font-weight: 700;
}

.team-specialty {
    color: var(--primary, #0066cc);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: block;
}

.team-desc {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4; /* Limitar a 4 líneas */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Botones de Navegación */
.carousel-btn {
    background: white;
    border: 2px solid var(--primary, #0066cc);
    color: var(--primary, #0066cc);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.carousel-btn:hover {
    background: var(--primary, #0066cc);
    color: white;
}

.prev-btn { left: 10px; }
.next-btn { right: 10px; }

/* Responsive */
@media (max-width: 768px) {
    .team-card {
        min-width: 260px;
        max-width: 260px;
    }
    .section-header h2 { font-size: 2rem; }
    .carousel-btn { width: 35px; height: 35px; font-size: 14px; }
    .prev-btn { left: 0; }
    .next-btn { right: 0; }
}