/* Estilos Generales */
:root {
    --primary-color: #0056b3;
    --primary-hover-color: #004494;
    --secondary-color: #6c757d;
    --light-gray-color: #f4f7f9;
    --text-color: #333;
    --border-color: #dee2e6;
    --success-bg: #d4edda;
    --success-text: #155724;
    --error-bg: #f8d7da;
    --error-text: #721c24;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-gray-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Estilo para la barra superior de fecha y hora */
.top-bar { background-color: #343a40; color: #ffffff; padding: 10px 20px; text-align: center; font-size: 0.9em; }

/* Menú Principal de Navegación */
.main-nav { background-color: #ffffff; border-bottom: 1px solid var(--border-color); padding: 10px 20px; }
.nav-content { max-width: 960px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.welcome-user { font-size: 0.9em; color: var(--secondary-color); }
.nav-links a { color: var(--primary-color); text-decoration: none; font-weight: bold; margin-left: 20px; font-size: 0.9em; position: relative; }
.nav-links a:hover { text-decoration: underline; }

/* Contenedor principal del contenido */
main { flex: 1; padding: 20px 15px; }
.container { max-width: 960px; margin: 0 auto; background-color: #ffffff; padding: 20px 30px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
h1, h2 { color: var(--primary-color); border-bottom: 2px solid #f0f0f0; padding-bottom: 15px; margin-top: 0; }
h2 { text-align: center; border: none; padding-bottom: 0; }

/* Estilos para Alertas y Mensajes */
.alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 5px; font-weight: 500; text-align: center; }
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
.alert-success { color: #155724; background-color: #d4edda; border-color: #c3e6cb; }

/* Estilos para formularios y botones */
.login-container { max-width: 480px; margin: 20px auto; }
.form-registro { margin-top: 20px; max-width: 800px; margin-left: auto; margin-right: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.form-group { display: flex; flex-direction: column; }
.form-group label { margin-bottom: 8px; font-weight: 600; font-size: 0.9em; color: #555; }
.form-group input, .form-group select, .form-group textarea { padding: 12px; border: 1px solid var(--border-color); border-radius: 5px; font-size: 1em; transition: all 0.3s ease; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2); }
.btn { text-decoration: none; color: #fff; padding: 12px 25px; border-radius: 5px; font-weight: bold; margin: 10px 5px; transition: all 0.3s ease; cursor: pointer; border: none; display: inline-block; }
.btn-primary { background-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-hover-color); transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.btn-secondary { background-color: var(--secondary-color); }
.btn-secondary:hover { background-color: #5a6268; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.btn-info { background-color: #17a2b8; }
.btn-info:hover { background-color: #117a8b; }
.btn-success { background-color: #28a745; }
.btn-success:hover { background-color: #218838; }
.full-width { width: 100%; font-size: 1.1em; }

/* Estilos del Panel de Administración y Admisión */
.card { border: 1px solid var(--border-color); border-radius: 8px; margin-top: 25px; }
.card-body { padding: 25px; }
.table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.table th, .table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border-color); }
.table th { background-color: #f8f9fa; font-weight: 600; }
.table tbody tr:hover { background-color: #f1f1f1; }
.btn-accion { padding: 5px 10px; border-radius: 4px; text-decoration: none; color: white !important; font-size: 0.85em; margin-right: 5px; }
.btn-editar { background-color: #ffc107; color: #212529 !important; }
.btn-eliminar { background-color: #dc3545; }
.panel-nav-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin: 25px 0; padding-bottom: 25px; border-bottom: 1px solid var(--border-color); }
.nav-card { display: block; background-color: #f8f9fa; padding: 20px; border: 1px solid var(--border-color); border-radius: 8px; text-decoration: none; color: var(--text-color); transition: all 0.3s ease; }
.nav-card:hover { transform: translateY(-5px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); border-color: var(--primary-color); }
.nav-card h4 { margin-top: 0; margin-bottom: 8px; color: var(--primary-color); border: none; padding-bottom: 0; text-align: left; }
.nav-card p { margin-bottom: 0; font-size: 0.9em; color: var(--secondary-color); }

/* --- NUEVO: Estilos para el Panel del Médico --- */
.appointment-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.appointment-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}
.appointment-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
}
.appointment-card .specialty {
    font-weight: bold;
    color: var(--primary-color);
}
.appointment-card .date {
    font-size: 0.9em;
    font-weight: 500;
}
.appointment-card .card-body {
    padding: 20px;
    flex-grow: 1;
}
.appointment-card .patient-name {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0 0 10px 0;
}
.appointment-card .patient-info {
    font-size: 0.9em;
    color: var(--secondary-color);
    line-height: 1.5;
    margin: 0;
}
.appointment-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid var(--border-color);
}
.badge {
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
}
.status-confirmada, .status-reprogramada {
    background-color: var(--success-text);
}
.btn-sm {
    padding: 8px 15px;
    font-size: 0.9em;
}

/* Estilos para Barra de Suplantación */
.impersonation-bar { background-color: #fff3cd; color: #856404; text-align: center; padding: 12px; font-weight: bold; border-bottom: 1px solid #ffeeba; position: sticky; top: 0; z-index: 1050; }
.impersonation-bar a { color: #0056b3; font-weight: bold; text-decoration: underline; margin-left: 15px; }
.impersonation-bar a:hover { color: #004494; }
body:has(.impersonation-bar) header { margin-top: 50px; }

/* Estilos para la Página de Reportes */
.report-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 25px; }
.report-card { background-color: #f8f9fa; padding: 20px; border-radius: 8px; text-align: center; border: 1px solid var(--border-color); }
.report-card h4 { margin: 0 0 10px 0; font-size: 1em; color: var(--secondary-color); border: none; padding-bottom: 0; }
.report-card span { font-size: 2.5em; font-weight: bold; color: var(--primary-color); }
.chart-container { position: relative; height: 400px; width: 100%; }

/* Estilos para Notificaciones */
.notification-badge { background-color: #dc3545; color: white; border-radius: 10px; padding: 1px 6px; font-size: 0.8em; font-weight: bold; vertical-align: super; margin-left: 4px; }

/* Estilo para el pie de página */
footer { background-color: #e9ecef; color: var(--secondary-color); text-align: center; padding: 20px; font-size: 0.9em; margin-top: auto; width: 100%; box-sizing: border-box; }
footer p { margin: 0; }

/* --- MEDIA QUERIES PARA RESPONSIVE DESIGN --- */
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .container { padding: 20px; }
    h1, h2 { font-size: 1.5em; }
    .nav-content { flex-direction: column; gap: 10px; }
}
@media (max-width: 480px) {
    .btn { width: 100%; display: block; box-sizing: border-box; }
}

/* --- Estilos para la página de Perfil --- */
.input-with-badge {
    position: relative;
    display: flex;
    align-items: center;
}
.input-with-badge input {
    flex-grow: 1;
}
.status-badge {
    margin-left: 10px;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
}
.status-badge.verified {
    background-color: #28a745; /* Verde */
}
.status-badge.not-verified {
    background-color: #dc3545; /* Rojo */
}