/* Header */

.header {
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.logo {
    font-size: 1.75rem;
    font-weight: 300;
    letter-spacing: -0.5px;
}

.logo strong {
    font-weight: 700;
}

.header-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.header-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: opacity 0.2s;
}

.header-nav a:hover {
    opacity: 0.8;
}

.notification-icon {
    position: relative;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Main Layout */

.main-container {
    display: flex;
    height: calc(100vh - 65px);
}

/* Panel asistente: subcabecera + fila agenda (el header tiene barra de herramientas extra) */
.main-panel-asistente {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--asistente-chrome-h));
    min-height: 0;
}

.main-panel-asistente > .main-container {
    flex: 1;
    min-height: 0;
    height: auto;
}

/* Agenda Section */

.agenda-section {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: white;
}

.agenda-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--gray-100);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
}

.date-selector button {
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    transition: color 0.2s;
}

.date-selector button:hover {
    color: var(--primary);
}

.date-display {
    font-weight: 500;
    color: var(--gray-800);
    min-width: 200px;
    text-align: center;
    font-size: 1.25rem;
}

.agenda-controls {
    display: flex;
    gap: 1rem;
}

/* Calendar Sidebar */

.calendar-sidebar {
    width: 380px;
    background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 2rem;
    border-left: 1px solid var(--gray-200);
    overflow-y: auto;
    transition: width 0.28s ease, padding 0.28s ease, opacity 0.22s ease, transform 0.28s ease;
}

.main-container.multimedico-activo .calendar-sidebar {
    width: 320px;
    min-width: 320px;
    padding: 1.25rem;
    border-left: 1px solid var(--gray-200);
    opacity: 1;
    transform: translateX(0);
    overflow-y: auto;
    pointer-events: auto;
}

.main-container.multimedico-activo .agenda-section {
    flex: 1 1 100%;
}

.doctor-selector {
    margin-bottom: 2rem;
}

.doctor-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

/* Vista de Pacientes */

/* Debe coincidir con .main-panel-asistente (chrome del asistente) */
:root {
    /* Valor inicial; JS (syncAsistenteChromeHeight) lo ajusta al alto real del #main-header */
    --asistente-chrome-h: 168px;
}

/* Panel asistente: header (acciones) + barra nav; no tapar herramientas */
.vista-seccion {
    position: absolute;
    top: var(--asistente-chrome-h);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--asistente-chrome-h));
    background: white;
    z-index: 10;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Vista del panel médico */

.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--gray-50);
    z-index: 100;
}
