/* Drawer global de agenda (navbar) — digiturno + calendario */

.navbar-agenda-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 39, 74, 0.35);
    z-index: 1045;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.navbar-agenda-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.navbar-agenda-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(380px, 100vw);
    height: 100vh;
    background: #fff;
    z-index: 1055;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(18, 39, 74, 0.18);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-agenda-drawer.is-open {
    transform: translateX(0);
}

/* Drawer de detalle (acciones) — encima del de agenda */
.navbar-agenda-detail-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(380px, 100vw);
    height: 100vh;
    background: #fff;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(18, 39, 74, 0.22);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/*
 * Historia clínica y calendario por especialidad deben quedar POR ENCIMA
 * del stack de agenda (overlay 1045 / lista 1055 / detalle 1060).
 */
#verExpedienteDrawer.offcanvas,
#verExpedienteDrawer {
    z-index: 1110 !important;
}

#drawer-backdrop-historial,
body:has(#verExpedienteDrawer.show) > .offcanvas-backdrop.show,
body:has(#verExpedienteDrawer.show) > .offcanvas-backdrop {
    z-index: 1105 !important;
}

#drawerOverlayCalendarioEspecialidad.drawer-overlay-cita,
#drawerOverlayCalendarioEspecialidad {
    z-index: 1105 !important;
}

#drawerOverlayCalendarioEspecialidad .drawer-cita,
#drawerCalendarioEspecialidad {
    z-index: 1110 !important;
}

.navbar-agenda-detail-drawer.is-open {
    transform: translateX(0);
}

.navbar-agenda-detail-header {
    gap: 0.5rem;
}

.navbar-agenda-detail-header .navbar-agenda-title {
    flex: 1;
    font-size: 0.95rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-agenda-back {
    background: transparent;
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.9;
}

.navbar-agenda-back:hover {
    background: rgba(255, 255, 255, 0.12);
    opacity: 1;
}

.navbar-agenda-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    background: #1e3a5f;
    color: #fff;
    flex-shrink: 0;
}

.navbar-agenda-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-agenda-close {
    background: transparent;
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.9;
}

.navbar-agenda-close:hover {
    background: rgba(255, 255, 255, 0.12);
    opacity: 1;
}

.navbar-agenda-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.1rem 1.5rem;
    background: #fafbfc;
}

/* Selector de médico */
.navbar-agenda-medico-wrap {
    margin-bottom: 0.85rem;
}

.navbar-agenda-medico-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.35rem;
}

.navbar-agenda-medico-select {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    color: #374151;
    background: #fff;
    outline: none;
}

.navbar-agenda-medico-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Select2 dentro de los drawers de agenda */
.navbar-agenda-drawer .select2-container,
.navbar-agenda-detail-drawer .select2-container {
    width: 100% !important;
    font-size: 0.66rem; /* ~25% más pequeño que 0.875rem */
}

.navbar-agenda-drawer .select2-container--default .select2-selection--single,
.navbar-agenda-detail-drawer .select2-container--default .select2-selection--single {
    height: 34px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    text-align: left;
}

.navbar-agenda-drawer .select2-container--default .select2-selection--single .select2-selection__rendered,
.navbar-agenda-detail-drawer .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 32px;
    padding-left: 0.65rem;
    padding-right: 1.75rem;
    color: #374151;
    font-size: 0.66rem;
    text-align: left;
}

.navbar-agenda-drawer .select2-container--default .select2-selection--single .select2-selection__placeholder,
.navbar-agenda-detail-drawer .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9ca3af;
    text-align: left;
}

.navbar-agenda-drawer .select2-container--default .select2-selection--single .select2-selection__arrow,
.navbar-agenda-detail-drawer .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 32px;
}

.navbar-agenda-drawer .select2-container--default.select2-container--focus .select2-selection--single,
.navbar-agenda-detail-drawer .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.select2-container--open {
    z-index: 1080;
}

.select2-dropdown.navbar-agenda-select2-dropdown {
    border-color: #e5e7eb;
    border-radius: 8px;
    z-index: 1080;
    font-size: 0.66rem;
    text-align: left;
}

.select2-dropdown.navbar-agenda-select2-dropdown .select2-search__field {
    border-radius: 6px;
    border-color: #e5e7eb;
    padding: 0.35rem 0.5rem;
    font-size: 0.66rem;
    text-align: left;
}

.select2-dropdown.navbar-agenda-select2-dropdown .select2-results__option {
    font-size: 0.66rem;
    text-align: left;
    padding: 0.4rem 0.65rem;
}

.select2-dropdown.navbar-agenda-select2-dropdown .select2-results__option[aria-selected=true] {
    background: #1e3a5f;
    color: #fff;
}

.select2-dropdown.navbar-agenda-select2-dropdown .select2-results__option--highlighted[aria-selected],
.select2-dropdown.navbar-agenda-select2-dropdown .select2-results__option--highlighted {
    background: #1e3a5f;
    color: #fff;
}

/* Mini calendario */
.navbar-agenda-mini-cal {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.navbar-agenda-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.navbar-agenda-cal-month {
    background: none;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1e3a5f;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.navbar-agenda-cal-month:hover {
    background: #f3f4f6;
}

.navbar-agenda-cal-btn {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: #374151;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.navbar-agenda-cal-btn:hover {
    background: #f3f4f6;
    color: #1e3a5f;
}

.navbar-agenda-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
}

.navbar-agenda-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.navbar-agenda-day {
    position: relative;
    background: transparent;
    border: none;
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #374151;
    font-size: 0.8rem;
    padding: 0;
}

.navbar-agenda-day.is-empty {
    cursor: default;
    visibility: hidden;
}

.navbar-agenda-day:not(.is-empty):hover {
    background: #f3f4f6;
}

.navbar-agenda-day.is-today .navbar-agenda-day-num {
    font-weight: 700;
    color: #2563eb;
}

.navbar-agenda-day.is-selected {
    background: #1e3a5f;
    color: #fff;
}

.navbar-agenda-day.is-selected .navbar-agenda-day-num {
    color: #fff;
    font-weight: 600;
}

.navbar-agenda-day-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: transparent;
    margin-top: 1px;
}

.navbar-agenda-day.has-events .navbar-agenda-day-dot {
    background: #2563eb;
}

.navbar-agenda-day.is-selected.has-events .navbar-agenda-day-dot {
    background: #93c5fd;
}

.navbar-agenda-day-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e3a5f;
    margin-bottom: 0.75rem;
    padding: 0 0.15rem;
}

.navbar-agenda-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.navbar-agenda-loading,
.navbar-agenda-empty {
    text-align: center;
    color: #6b7280;
    padding: 2rem 1rem;
    font-size: 0.9rem;
}

.navbar-agenda-empty i {
    font-size: 1.75rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
    display: block;
}

/* ===== Cards de cita (compactas; clic abre drawer de acciones) ===== */
.navbar-agenda-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    border-left: 3px solid #2563eb;
    box-shadow: 0 1px 2px rgba(18, 39, 74, 0.04);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.navbar-agenda-card.is-focused {
    outline: 2px solid #0e7490;
    outline-offset: 1px;
    box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.18);
    background: #ecfeff;
}

.navbar-agenda-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(18, 39, 74, 0.08);
}

.navbar-agenda-card.is-tele {
    border-left-color: #0e7490;
}

.navbar-agenda-card.is-blocked {
    border-left-color: #9ca3af;
    opacity: 0.78;
}

.navbar-agenda-card.is-pendiente {
    border-left-color: #2563eb;
    background: #f8fbff;
}

.navbar-agenda-card.is-anunciada {
    border-left-color: #059669;
    background: #ecfdf5;
    box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.18);
}

.navbar-agenda-card.is-anunciada .navbar-agenda-card-hora {
    color: #047857;
}

.navbar-agenda-card.is-finalizada {
    border-left-color: #7c3aed;
    background: #f5f3ff;
}

.navbar-agenda-card.is-inasistencia {
    border-left-color: #9ca3af;
    background: #f3f4f6;
}

.navbar-agenda-leyenda {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    padding: 0 0.15rem 0.65rem;
    font-size: 0.72rem;
    color: #4b5563;
}

.navbar-agenda-leyenda-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

.navbar-agenda-leyenda-item i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    background: #94a3b8;
}

.navbar-agenda-leyenda-item.is-pendiente i { background: #2563eb; }
.navbar-agenda-leyenda-item.is-anunciada i { background: #059669; }
.navbar-agenda-leyenda-item.is-finalizada i { background: #7c3aed; }
.navbar-agenda-leyenda-item.is-inasistencia i { background: #9ca3af; }

.navbar-agenda-pill-anunciada {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.navbar-agenda-pill-pendiente {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.navbar-agenda-pill-finalizada {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
}

.navbar-agenda-pill-inasistencia {
    background: #e5e7eb;
    color: #374151;
    border: 1px solid #d1d5db;
}

.navbar-agenda-card-main {
    display: flex;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    align-items: flex-start;
}

.navbar-agenda-card-time {
    flex-shrink: 0;
    width: 44px;
    text-align: left;
}

.navbar-agenda-card-hora {
    display: block;
    font-weight: 700;
    font-size: 0.88rem;
    color: #1e3a5f;
}

.navbar-agenda-card-dur {
    display: block;
    font-size: 0.65rem;
    color: #9ca3af;
    margin-top: 1px;
}

.navbar-agenda-card-body {
    flex: 1;
    min-width: 0;
}

.navbar-agenda-card-title {
    font-weight: 600;
    font-size: 0.84rem;
    color: #1f2937;
    line-height: 1.3;
    word-break: break-word;
}

.navbar-agenda-card-meta {
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 0.15rem;
}

.navbar-agenda-card-meta i {
    font-size: 0.65rem;
    margin-right: 3px;
    width: 12px;
    text-align: center;
}

.navbar-agenda-card-chevron {
    flex-shrink: 0;
    color: #9ca3af;
    font-size: 0.75rem;
    margin-top: 0.35rem;
}

.navbar-agenda-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.navbar-agenda-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.64rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.14rem 0.45rem;
    line-height: 1.2;
}

.navbar-agenda-pill-tele {
    background: #cffafe;
    color: #0e7490;
}

.navbar-agenda-pill-presencial {
    background: #dcfce7;
    color: #166534;
}

.navbar-agenda-pill-estado {
    background: #eef2f7;
    color: #1e3a5f;
}

.navbar-agenda-pill-bloqueo {
    background: #fef3c7;
    color: #92400e;
}

.navbar-agenda-tele-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0e7490;
    text-decoration: none;
    background: #ecfeff;
    border: 1px solid #a5f3fc;
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
}

.navbar-agenda-tele-link:hover {
    background: #cffafe;
    color: #155e75;
    text-decoration: none;
}

/* Accesos rápidos + teleconsulta + consultorio (paridad con dashboard) */
.navbar-agenda-tele-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 0.7rem 0.75rem;
    margin-bottom: 0.75rem;
}

.navbar-agenda-tele-box-muted {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.navbar-agenda-tele-box-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1d4ed8;
    margin-bottom: 0.45rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.navbar-agenda-tele-box-muted .navbar-agenda-tele-box-label {
    color: #64748b;
}

.navbar-agenda-btn-tele {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1e40af;
    text-decoration: none;
    background: #dbeafe;
    border: 1px solid #93c5fd;
}

.navbar-agenda-btn-tele:hover {
    background: #bfdbfe;
    color: #1e3a8a;
    text-decoration: none;
}

.navbar-agenda-tele-acciones {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.navbar-agenda-btn-tele-reenviar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    background: #fff;
    border: 1px solid #cbd5e1;
    cursor: pointer;
}

.navbar-agenda-btn-tele-reenviar:hover {
    background: #f8fafc;
    color: #0f172a;
}

.navbar-agenda-tele-sin-url {
    display: block;
    font-size: 0.78rem;
    color: #94a3b8;
}

.navbar-agenda-accesos {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.navbar-agenda-btn-acceso {
    width: 100%;
    border: 1px solid #f1ddc2;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    background: #fdf6ec;
    color: #92600a;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    text-align: left;
}

.navbar-agenda-btn-acceso i {
    color: #c2870a;
    width: 1rem;
    text-align: center;
}

.navbar-agenda-btn-acceso:hover {
    background: #fbecd4;
    border-color: #e6c79a;
    color: #7a5008;
}

.navbar-agenda-consultorio-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: #f9fafb;
    border: 1px solid #eef0f3;
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.85rem;
}

.navbar-agenda-consultorio-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.navbar-agenda-consultorio-label i {
    color: #2563eb;
}

.navbar-agenda-consultorio-row .navbar-agenda-consultorio-select {
    flex: 1;
    margin: 0;
}

/* Detalle: resumen + acciones */
.navbar-agenda-detail-summary {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
}

.navbar-agenda-detail-summary .navbar-agenda-card-title {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.navbar-agenda-detail-actions {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.85rem;
}

.navbar-agenda-detail-actions-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.navbar-agenda-lock-msg {
    font-size: 0.78rem;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    margin-bottom: 0.65rem;
    line-height: 1.35;
}

.navbar-agenda-lock-msg i {
    margin-right: 0.25rem;
}

/* Acciones digiturno */
.navbar-agenda-acciones {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.navbar-agenda-btn-accion {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    line-height: 1.2;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.navbar-agenda-btn-accion.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.navbar-agenda-btn-llamar {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.navbar-agenda-btn-llamar:hover {
    background: #bfdbfe;
}

.navbar-agenda-btn-llamar.is-cancelar,
.navbar-agenda-btn-llamar.active.is-cancelar {
    background: #fef3c7;
    color: #b45309;
    border-color: #f59e0b;
}

.navbar-agenda-btn-llego {
    background: #d1fae5;
    color: #047857;
    border-color: #a7f3d0;
}

.navbar-agenda-btn-llego:hover {
    background: #a7f3d0;
}

.navbar-agenda-btn-llego.active {
    background: #a7f3d0;
    border-color: #10b981;
}

.navbar-agenda-btn-nollego {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

.navbar-agenda-btn-nollego:hover {
    background: #fecaca;
}

.navbar-agenda-btn-nollego.active {
    background: #fecaca;
    border-color: #ef4444;
}

.navbar-agenda-subpanel {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #e5e7eb;
}

.navbar-agenda-subpanel[hidden] {
    display: none !important;
}

.navbar-agenda-subpanel-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.4rem;
}

.navbar-agenda-plantilla-row {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.navbar-agenda-plantilla-select,
.navbar-agenda-consultorio-select,
.navbar-agenda-input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    font-size: 0.82rem;
    background: #fff;
    color: #374151;
}

.navbar-agenda-btn-iniciar {
    width: 100%;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    background: #1e3a5f;
    color: #fff;
    cursor: pointer;
}

.navbar-agenda-btn-iniciar:hover {
    background: #16294a;
}

.navbar-agenda-btn-iniciar.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.navbar-agenda-btn-finalizar {
    width: 100%;
    border: 1px solid #7c3aed;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    background: #f5f3ff;
    color: #5b21b6;
    cursor: pointer;
    margin-top: 0.35rem;
}

.navbar-agenda-btn-finalizar:hover {
    background: #ede9fe;
}

.navbar-agenda-remision {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px solid #e5e7eb;
}

.navbar-agenda-remision-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.navbar-agenda-remision-chip {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    font-size: 0.72rem;
    cursor: pointer;
}

.navbar-agenda-remision-chip.active {
    border-color: #1e3a5f;
    background: #1e3a5f;
    color: #fff;
}

.navbar-agenda-pera-sub {
    margin: 0.4rem 0 0.55rem;
}

.navbar-agenda-btn-terminar {
    width: 100%;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    font-size: 0.84rem;
    font-weight: 700;
    background: #7c3aed;
    color: #fff;
    cursor: pointer;
}

.navbar-agenda-btn-terminar:hover:not(:disabled):not(.is-disabled) {
    background: #6d28d9;
}

.navbar-agenda-btn-terminar:disabled,
.navbar-agenda-btn-terminar.is-disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.navbar-agenda-btn-inasist {
    width: 100%;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    background: #fff;
    color: #b91c1c;
    cursor: pointer;
}

.navbar-agenda-btn-inasist:hover {
    background: #fef2f2;
}

/* Modal inasistencia */
.navbar-agenda-modal {
    position: fixed;
    inset: 0;
    z-index: 1070;
    background: rgba(18, 39, 74, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.navbar-agenda-modal[hidden] {
    display: none !important;
}

.navbar-agenda-modal-dialog {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(18, 39, 74, 0.25);
}

.navbar-agenda-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: #1e3a5f;
    color: #fff;
}

.navbar-agenda-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.navbar-agenda-modal-close {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.navbar-agenda-modal-body {
    padding: 1rem;
}

.navbar-agenda-modal-paciente {
    font-weight: 600;
    color: #1e3a5f;
    margin-bottom: 0.85rem;
}

.navbar-agenda-field {
    margin-bottom: 0.75rem;
}

.navbar-agenda-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.3rem;
}

.navbar-agenda-field input,
.navbar-agenda-field textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    font-size: 0.875rem;
    color: #374151;
}

.navbar-agenda-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem 1rem;
}

.navbar-agenda-btn-secondary {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    border-radius: 8px;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.navbar-agenda-btn-danger {
    border: none;
    background: #b91c1c;
    color: #fff;
    border-radius: 8px;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.navbar-agenda-btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

body.navbar-agenda-open {
    overflow: hidden;
}

@media (max-width: 576px) {
    .navbar-agenda-drawer,
    .navbar-agenda-detail-drawer {
        width: 100vw;
    }
}
