/* --- VARIABLES GLOBALES Y RESET (NUEVA PALETA) --- */
:root {
    --primary-color: #0055ff; /* Azul vibrante */
    --secondary-color: #84cc16; /* Verde Limón */
    --pastel-blue: #a2d2ff;
    --pastel-green: #d9f99d;

    --light-color: #f8fafc; /* Fondo aún más claro */
    --dark-color: #0f172a; /* Texto (casi negro) */
    --grey-color: #64748b; /* Gris sutil */
    
    --sidebar-bg: #0f172a; /* Barra lateral muy oscura para contraste */
    --sidebar-text: #cbd5e1;
    --sidebar-hover-bg: #1e293b;
    
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.07);
    --border-radius: 12px; /* Bordes más redondeados */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

/* --- ESTILOS DE LA PÁGINA DE LOGIN (CON DEGRADADO PASTEL) --- */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--pastel-blue), var(--pastel-green));
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-box h3 { margin-bottom: 0.5rem; font-weight: 500; }
.login-box p { color: var(--grey-color); margin-bottom: 2rem; }

.input-group { text-align: left; margin-bottom: 1.5rem; }
.input-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; }
.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: #fff;
}
.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 85, 255, 0.1);
}

.btn-login {
    width: 100%;
    padding: 15px;
    border: none;
    background: linear-gradient(90deg, var(--primary-color), #0077ff);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 85, 255, 0.2);
}
.btn-login:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0, 85, 255, 0.3); }

.error-banner {
    background-color: #f8d7da;
    color: #842029;
    padding: 1rem;
    border: 1px solid #f5c2c7;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

/* --- ESTRUCTURA PRINCIPAL DE LA APP --- */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.logo {
    max-width: 150px; /* Ajusta el tamaño máximo de tu logo */
    height: auto;
}

.sidebar-nav { flex-grow: 1; }
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.9rem 1rem;
    margin-bottom: 0.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: background-color 0.2s, color 0.2s;
}
.nav-link:hover { background-color: var(--sidebar-hover-bg); color: white; }
.nav-link.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}
.nav-link i { width: 20px; margin-right: 1rem; font-size: 1.1rem; }
.sidebar-footer { padding-top: 1rem; border-top: 1px solid var(--sidebar-hover-bg); }

.main-content { background-color: var(--light-color); overflow-y: auto; }
.main-header {
    padding: 1.5rem 2rem;
    background-color: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.content-wrapper { padding: 2rem; }

/* --- COMPONENTES REUTILIZABLES --- */
.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid #f1f5f9; }
.card-header h3 { font-size: 1.25rem; font-weight: 600; }


/* --- ESTILOS PARA EL MÓDULO DE PACIENTES --- */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.page-header h1 { font-size: 2rem; font-weight: 600; }

.btn {
    padding: 10px 20px;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}
.btn-primary {
    background: linear-gradient(90deg, var(--primary-color), #0077ff);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 85, 255, 0.2);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 85, 255, 0.3); }
.btn-secondary { background-color: var(--grey-color); color: white; }
.btn-icon { background: none; border: none; cursor: pointer; padding: 5px; font-size: 1rem; }
.btn-edit { color: var(--primary-color); }
.btn-delete { color: #f43f5e; }

.alert { padding: 1rem; border-radius: var(--border-radius); margin-bottom: 1.5rem; border: 1px solid transparent; }
.alert-success { background-color: #dcfce7; color: #166534; border-color: #bbf7d0; }
.alert-danger { background-color: #fee2e2; color: #991b1b; border-color: #fecaca; }

/* --- ESTILOS DE LA VENTANA MODAL --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}
.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 700px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}
.modal-header h2 { font-size: 1.5rem; }
.close-btn { color: #aaa; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-btn:hover, .close-btn:focus { color: var(--dark-color); }
.modal-body { padding: 1.5rem; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background-color: var(--light-color);
    border-top: 1px solid #e2e8f0;
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}
.form-row { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; }
.form-row .input-group { flex: 1; margin-bottom: 0; }
select, textarea { width: 100%; padding: 12px 15px; border: 1px solid #ddd; border-radius: var(--border-radius); font-size: 1rem; font-family: 'Poppins', sans-serif;}

@keyframes fadeIn { from {opacity: 0} to {opacity: 1} }
@keyframes slideIn { from {transform: translateY(-50px)} to {transform: translateY(0)} }

/* --- ESTILOS PARA DATATABLES --- */
.dataTables_wrapper { padding-top: 1rem; }


/* --- ESTILOS PARA EL MÓDULO DE TAREAS --- */

.tasks-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.task-column {
    background-color: #f1f5f9; /* Un gris muy claro */
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
}

.column-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.column-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.column-body {
    padding: 1rem;
    flex-grow: 1;
    min-height: 200px;
}

.task-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 5px solid;
    position: relative;
}

.task-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.task-card.priority-baja { border-color: #22c55e; }
.task-card.priority-media { border-color: #f59e0b; }
.task-card.priority-alta { border-color: #ef4444; }

.task-meta {
    font-size: 0.8rem;
    color: var(--grey-color);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.task-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-card.is-completed h4,
.task-card.is-completed .task-meta {
    text-decoration: line-through;
    opacity: 0.7;
}

.task-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* --- ESTILOS PARA PROYECTOS --- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.project-card { display: flex; flex-direction: column; }
.project-card-header { display: flex; justify-content: flex-end; padding: 0.5rem 1rem 0; }
.project-card-body { padding: 0 1.5rem; flex-grow: 1; }
.project-description { color: var(--grey-color); font-size: 0.9rem; margin-top: 0.5rem; }
.project-card-footer { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-top: 1px solid #f1f5f9; font-size: 0.9rem; color: var(--grey-color); }
.status-badge.status-activo { background-color: #e0f2fe; color: #0ea5e9; }
.status-badge.status-completado { background-color: #dcfce7; color: #166534; }
.status-badge.status-en.pausa { background-color: #fef9c3; color: #a16207; }
.status-badge.status-cancelado { background-color: #fee2e2; color: #991b1b; }