400;500;700&display=swap');

/* Animación para dropdown del menú de usuario */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-icon {
    background: var(--gray-100);
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    color: var(--gray-600);
    font-size: 1.25rem;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--gray-200);
    color: var(--primary);
}

/* Estilos para citas con botones */

/* Estilos para slot de cita de asistentes */

/* Botones de acción en las citas */

.btn-estado {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    flex: 1;
}

.btn-confirmar {
    background: var(--primary);
    color: white;
}

.btn-confirmar:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-completar {
    background: var(--primary);
    color: white;
}

.btn-completar:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-cancelar-cita {
    background: #ef4444;
    color: white;
}

.btn-cancelar-cita:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-estado:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Estados visuales de las citas */

/* Los estilos de estados se manejan en la sección de estados actualizados más abajo */

/* Badge de estado */

.estado-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.estado-badge.pendiente {
    background: #fef3c7;
    color: #92400e;
}

.estado-badge.confirmada {
    background: #d1fae5;
    color: #065f46;
}

.estado-badge.completada {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.estado-badge.cancelada {
    background: #fee2e2;
    color: #991b1b;
}

/* Calendar */

.calendar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Día con citas que está seleccionado */

/* Día con citas que es hoy */

/* Buttons */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* Modal */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-reagendar {
    transition: background 0.3s ease;
}

.modal-reagendar .modal-content {
    transition: all 0.3s ease;
    transform: translateX(0);
}

.modal-reagendar.vista-previa {
    background: rgba(0, 0, 0, 0.3);
}

.modal-reagendar.vista-previa .modal-content {
    max-width: 400px;
    transform: translateX(calc(50vw - 220px));
}

.reagendar-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin: 0 1.5rem 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.875rem;
}

.reagendar-loading.is-visible {
    display: flex;
}

.reagendar-loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #cbd5e1;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: reagendar-spin 0.8s linear infinite;
}

@keyframes reagendar-spin {
    to { transform: rotate(360deg); }
}

/* Permitir que dropdowns salgan del modal */

#modal-nueva-cita-medico .modal-content {
    overflow: visible !important;
    position: relative !important;
}

#modal-nueva-cita-medico .modal-content form {
    overflow: visible !important;
    position: relative !important;
}

/* Permitir que el select "Tipo de servicio" abra su lista en el modal de servicio */
#modal-servicio .modal-content {
    overflow: visible !important;
    position: relative !important;
}

#modal-servicio .modal-content form {
    overflow: visible !important;
    position: relative !important;
}

#modal-servicio select {
    position: relative;
    z-index: 1;
}

/* Asegurar que el contenedor de búsqueda no tenga restricciones */

#contenedor-busqueda-paciente {
    position: relative !important;
    overflow: visible !important;
    z-index: auto !important;
}

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

.modal-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--gray-800);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--gray-600);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {

    display: block;

    font-weight: 500;

    color: var(--gray-700);

    margin-bottom: 0.5rem;

    font-size: 0.875rem;

}

input, select, textarea {

    width: 100%;

    padding: 0.75rem;

    border: 1px solid var(--gray-300);

    border-radius: 8px;

    font-size: 0.875rem;

    font-family: inherit;

}

input:focus, select:focus, textarea:focus {

    outline: none;

    border-color: var(--primary);

}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

/* Guardar.svg: blanco sobre btn-primary (paleta); en secundario se fuerza silueta oscura */
.btn-primary img[src*="Guardar.svg"],
.btn.btn-primary img[src*="Guardar.svg"] {
    opacity: 1;
}

.btn-secondary img[src*="Guardar.svg"],
.btn.btn-secondary img[src*="Guardar.svg"] {
    filter: brightness(0);
    opacity: 0.8;
}

.btn-secondary:hover img[src*="Guardar.svg"] {
    opacity: 0.95;
}

/* Plantillas (notificaciones): botón guardar primario */
#tab-notificaciones .btn-guardar img[src*="Guardar.svg"] {
    filter: none;
    opacity: 1;
}

/* Tarjetas Mis servicios (configuración médico) */
.servicio-card {
    display: flex;
    flex-direction: column;
}

.servicio-card-header-tipo {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 11px 11px 0 0;
    border-bottom: 3px solid transparent;
    position: relative;
}

.servicio-card-header-tipo__icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex-shrink: 0;
    align-self: flex-start;
}

.servicio-card-header-tipo__meta {
    min-width: 0;
    flex: 1;
    padding-right: 5.5rem;
}

.servicio-card-header-tipo__titulo {
    margin: 0;
    color: var(--gray-800);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.servicio-card-header-tipo__subtipo {
    margin: 0.35rem 0 0 0;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.3;
    opacity: 0.92;
}

.servicio-card-header-tipo__default {
    display: inline-block;
    margin-top: 0.45rem;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.servicio-card-header-tipo__activo {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.servicio-card-actions {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 0.65rem;
    width: 100%;
    margin-top: auto;
    padding-top: 0.5rem;
}

.servicio-card-btn {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    padding: 0.5rem 0.65rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: background 0.2s ease, filter 0.15s ease, transform 0.1s ease;
    color: #fff;
}

.servicio-card-btn:hover {
    filter: brightness(1.05);
}

.servicio-card-btn:active {
    transform: scale(0.98);
}

.servicio-card-btn--editar {
    background: var(--primary);
}

.servicio-card-btn--editar:hover {
    background: var(--primary-dark);
}

.servicio-card-btn--desactivar {
    background: var(--danger);
}

.servicio-card-btn--activar {
    background: var(--primary-dark);
}

.servicio-card-btn-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}


.loading {
    text-align: center;
    padding: 3rem;
    color: var(--gray-400);
}

.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status indicators */

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-confirmed {
    background: var(--success);
}

.status-pending {
    background: var(--warning);
}

.status-cancelled {
    background: var(--danger);
}

.paciente-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.paciente-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.paciente-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.paciente-nombre {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.paciente-stats {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.stat-badge {
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: var(--gray-600);
}

.paciente-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.paciente-medicos {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-style: italic;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-100);
}

/* Lista simple de pacientes */

.paciente-lista-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.paciente-lista-item:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    transform: translateX(4px);
}

.paciente-lista-nombre {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-800);
}

/* Historial de Paciente */

.historial-cita {
    border-left: 4px solid var(--gray-300);
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.historial-cita:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateX(4px);
}

.historial-fecha span[title] {
    cursor: pointer;
}

.historial-fecha span[title]:hover {
    color: var(--primary);
}

.historial-cita.confirmada {
    border-left-color: var(--success);
}

.historial-cita.completada {
    border-left-color: var(--primary);
}

.historial-cita.cancelada {
    border-left-color: var(--danger);
    opacity: 0.7;
}

.historial-cita.pendiente {
    border-left-color: var(--warning);
}

.historial-fecha {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.historial-detalle {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.historial-notas {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-style: italic;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-100);
}

.stat-box {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--gray-200);
}

.stat-box-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-box-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* Lista de citas canceladas */

/* Resultados de búsqueda de pacientes */

.resultado-paciente {
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.resultado-paciente:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    transform: translateX(4px);
}

.resultado-paciente-nombre {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.resultado-paciente-info {
    font-size: 0.875rem;
    color: var(--gray-600);
    display: flex;
    gap: 1rem;
}

.resultado-paciente-highlight {
    background: #fff3cd;
    padding: 0 0.25rem;
    border-radius: 3px;
}

.no-resultados {
    text-align: center;
    padding: 2rem;
    color: var(--gray-400);
}

.no-resultados-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Input de búsqueda con foco */

#input-buscar-paciente-modal:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(64, 224, 208, 0.1);
}

/* Estilos para selector de rol */

.btn-rol {
    padding: 2rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 200px;
}

.btn-rol:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.btn-medico:hover {
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.btn-asistente:hover {
    border-color: var(--primary);
    background: #d1fae5;
}

/* Botones de navegación principal del médico */

.nav-medico {
    display: flex;
    gap: 0.5rem;
}

.nav-btn-medico {
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.nav-btn-medico:hover {
    color: #111827;
    background: #f9fafb;
}

.nav-btn-medico.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Pestañas de configuración */

.config-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e7eb;
}

.config-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.config-tab:hover {
    color: #111827;
    background: #f9fafb;
}

.config-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

#seccion-configuracion .config-tab img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
}

#seccion-informes .config-tab img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
}

.sub-seccion-config {
    display: block;
}

.sub-seccion-config[style*="display: none"] {
    display: none !important;
}

/* Tabla semanal de horarios */

.horarios-semana-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.horarios-semana-table {
    width: 100%;
    border-collapse: collapse;
}

.horarios-semana-table thead {
    background: #f9fafb;
}

.horarios-semana-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.horarios-semana-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.horarios-semana-table tbody tr:hover {
    background: #f9fafb;
}

.horarios-semana-table tbody tr.dia-inactivo {
    opacity: 0.5;
    background: #f3f4f6;
}

.checkbox-laborable {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

/* Indicador de conflicto/empalme */

/* Citas canceladas médico - tono pálido */

/* Estilos para modal de detalles de cita */

#modal-detalles-cita {
    display: none !important;
}

.detalle-seccion {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.detalle-seccion h4 {
    margin: 0 0 1rem 0;
    color: #111827;
    font-size: 1rem;
    font-weight: 600;
}

.detalle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detalle-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detalle-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detalle-valor {
    font-size: 1rem;
    color: #111827;
    font-weight: 500;
}

.nota-box {
    background: white;
    border-left: 4px solid var(--primary);
    padding: 1rem;
    border-radius: 4px;
    color: #374151;
    line-height: 1.6;
}

/* Fecha no editable en historial */

.fecha-modificacion-readonly {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #6b7280;
    display: inline-block;
    user-select: none;
    cursor: default;
}

.estado-badge-large {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
}

.estado-badge-large.pendiente {
    background: #fef3c7;
    color: #92400e;
}

.estado-badge-large.confirmada {
    background: #d1fae5;
    color: #065f46;
}

.estado-badge-large.completada {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.estado-badge-large.cancelada {
    background: #fee2e2;
    color: #991b1b;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Estados de citas - Colores actualizados */

.estado-badge.creada,

.estado-badge-large.creada {
    border-left-color: #9ca3af;
    background: #f3f4f6;
    color: #374151;
}

.estado-badge.pendiente,

.estado-badge-large.pendiente {
    border-left-color: #f59e0b;
    background: #fef3c7;
    color: #92400e;
}

.estado-badge.confirmada,

.estado-badge-large.confirmada {
    border-left-color: var(--primary);
    background: #d1fae5;
    color: #065f46;
}

.estado-badge.reagendada,

.estado-badge-large.reagendada {
    border-left-color: var(--primary-light);
    background: #ede9fe;
    color: #5b21b6;
}

.estado-badge.en_sala_espera,

.estado-badge-large.en_sala_espera {
    border-left-color: #06b6d4;
    background: #cffafe;
    color: #164e63;
}

.estado-badge.en_consulta,

.estado-badge-large.en_consulta {
    border-left-color: var(--primary);
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.estado-badge.completada,

.estado-badge-large.completada {
    border-left-color: #059669;
    background: #a7f3d0;
    color: #064e3b;
}

.estado-badge.no_asistio,

.estado-badge-large.no_asistio {
    border-left-color: #f97316;
    background: #fed7aa;
    color: #9a3412;
}

.estado-badge.cancelada,

.estado-badge-large.cancelada {
    border-left-color: #ef4444;
    background: #fee2e2;
    color: #991b1b;
}

.historial-fecha {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.historial-estado {
    font-size: 1rem;
    color: #111827;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.historial-notas {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
}

/* Botones de acción según estado */

.acciones-estado {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.btn-estado-accion {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-estado-accion:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-confirmar { background: var(--primary); color: white; }

.btn-confirmar:hover { background: #059669; }

.btn-sala-espera { background: #06b6d4; color: white; }

.btn-sala-espera:hover { background: #0891b2; }

.btn-consulta { background: var(--primary); color: white; }

.btn-consulta:hover { background: #2563eb; }

.btn-completar { background: #059669; color: white; }

.btn-completar:hover { background: #047857; }

.btn-no-asistio { background: #f97316; color: white; }

.btn-no-asistio:hover { background: #ea580c; }

.btn-reagendar { background: var(--primary-light); color: white; }

.btn-reagendar:hover { background: var(--primary-dark); }

.btn-cancelar { background: #ef4444; color: white; }

.btn-cancelar:hover { background: #dc2626; }

/* Fecha no editable con icono */

.fecha-readonly {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.fecha-readonly-icon {
    font-size: 1.5rem;
}

.fecha-readonly-content {
    flex: 1;
}

.fecha-readonly-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.fecha-readonly-valor {
    font-size: 1.1rem;
    color: #111827;
    font-weight: 600;
}

.horario-input-time {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    width: 120px;
}

.horario-input-time:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(32, 178, 170, 0.1);
}

.intervalos-libres-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.intervalo-libre-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-agregar-intervalo {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-agregar-intervalo:hover {
    background: #c7d2fe;
}

.btn-eliminar-intervalo {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-eliminar-intervalo img,
.btn-eliminar-horario img {
    display: block;
    width: 1rem;
    height: 1rem;
    object-fit: contain;
}

.btn-eliminar-intervalo:hover {
    background: #fecaca;
}

.dia-nombre {
    font-weight: 600;
    color: #111827;
    min-width: 100px;
}

/* Grid de horarios */

.horarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.horario-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
}

.horario-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.dia-badge {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-eliminar-horario {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-eliminar-horario:hover {
    background: #fecaca;
}

/* Grid de servicios */

.servicios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.servicio-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
}

/* Container de notas */

.notas-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nota-card {
    background: white;
    border-left: 4px solid;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nota-card.blue { border-left-color: var(--primary); }

.nota-card.yellow { border-left-color: #f59e0b; }

.nota-card.red { border-left-color: #ef4444; }

.nota-card.green { border-left-color: var(--primary); }

.nota-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.prioridad-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

.prioridad-badge.URGENTE {
    background: #fee2e2;
    color: #991b1b;
}

.prioridad-badge.ALTA {
    background: #fed7aa;
    color: #92400e;
}

.prioridad-badge.NORMAL {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.prioridad-badge.BAJA {
    background: #e5e7eb;
    color: #374151;
}

/* Selector de color en el formulario */

.color-option {
    cursor: pointer;
}

.color-option input {
    display: none;
}

.color-option input:checked + span {
    border-color: #111827;
    transform: scale(1.1);
}

/* Estilos para el selector de estados */

.estado-selector-container {
    margin-top: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
}

.estado-selector {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.estado-selector:hover {
    border-color: #14b8a6;
}

.estado-selector:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.estado-selector option {
    padding: 10px;
}

.rol-badge {
    background: #14b8a6;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-automatico {
    background: var(--primary-light);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

/* Slots bloqueados en agenda */
.slot-bloqueado {
    background: repeating-linear-gradient(
        135deg,
        #f3f4f6 0px,
        #f3f4f6 6px,
        #e5e7eb 6px,
        #e5e7eb 12px
    );
    border: 1px solid #d1d5db;
    border-radius: 4px;
    min-height: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    cursor: pointer;
    pointer-events: auto;
    color: #374151;
    font-size: 0.7rem;
    width: 100%;
    box-sizing: border-box;
}

.slot-bloqueado-dia {
    border-color: #9ca3af;
}

.slot-bloqueado-slot {
    border-color: #fca5a5;
    color: #991b1b;
}

/* ==========================================
   DRAWER DE CITA - PANEL LATERAL
   ========================================== */

#cita-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#cita-drawer.open {
    transform: translateX(0);
}

#cita-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

#cita-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

.drawer-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #111827;
}

.drawer-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.drawer-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.drawer-tabs button {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.drawer-tabs button.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.drawer-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    overflow-x: auto;
}

.drawer-tab {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.drawer-tab:hover {
    background: #f3f4f6;
    color: #374151;
}

.drawer-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: white;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.drawer-tab-content {
    display: none;
}

.drawer-tab-content.active {
    display: block;
}

.drawer-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.drawer-section:last-child {
    border-bottom: none;
}

.drawer-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: #111827;
}

.drawer-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    gap: 0.75rem;
}

.detalle-grid {
    display: grid;
    gap: 0.75rem;
}

.detalle-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.detalle-label {
    font-weight: 500;
    color: #6b7280;
}

.detalle-valor {
    color: #111827;
}

.fecha-readonly {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.fecha-readonly-icon {
    font-size: 2rem;
}

.fecha-readonly-content {
    flex: 1;
}

.fecha-readonly-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.fecha-readonly-valor {
    font-size: 0.95rem;
    color: #111827;
    font-weight: 500;
}

/* Dropdown menus */
.dropdown-menu {
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cerrar dropdown al hacer click fuera */
.dropdown-menu button:hover {
    background: #f3f4f6 !important;
}

/* Opción del menú de estados */
.menu-estado-opcion {
    padding: 0.875rem 1.25rem;
    border: none;
    background: white;
    cursor: pointer;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f3f4f6;
}

.menu-estado-opcion:last-child {
    border-bottom: none;
}

.menu-estado-opcion:hover {
    background: #f9fafb;
}

.menu-estado-opcion-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.menu-estado-opcion-texto {
    flex: 1;
    font-weight: 500;
    color: #374151;
}

.menu-estado-opcion-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}
