/* 🏠 Inicio del panel del veterinario (public/panel-veterinario.html), Etapa V2 del rediseño de Veterinarios. Prefijo `pvi-`. Usa los tokens de /css/petia-tokens.css; cada var() trae su valor de respaldo.
   Las tarjetas solo muestran datos que el producto ya calcula. */

.pvi-cuerpo { background: var(--petia-surface, #FCFBFF); color: var(--petia-text, #151A37); }
.pvi-cuerpo h1, .pvi-cuerpo h2, .pvi-cuerpo h3 { font-family: var(--petia-fuente-titulo, 'Poppins', sans-serif); }

/* ───────────── Encabezado de la página ───────────── */
.pvi-ojo { margin: 0 0 6px 0; color: var(--petia-primary-hover, #5A36E0); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pvi-h1 { margin: 0; font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; color: var(--petia-text, #151A37); }
.pvi-sub { margin: 8px 0 0 0; color: var(--petia-text-muted, #5C6078); font-size: 16px; }
.pvi-fecha { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 10px 16px; border: 1px solid var(--petia-border, #E6E2F3); border-radius: 14px; background: #fff; color: var(--petia-text-muted, #5C6078); font-size: 14px; font-weight: 600; }

/* ───────────── Tarjetas ───────────── */
.pvi-tarjeta { padding: 22px; border: 1px solid var(--petia-border, #E6E2F3); border-radius: 20px; background: #fff; box-shadow: var(--petia-sombra-tarjeta, 0 10px 30px rgba(21, 26, 55, .06)); min-width: 0; }
.pvi-cabeza { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.pvi-h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 18px; font-weight: 700; color: var(--petia-text, #151A37); }
.pvi-ico-card { flex: none; color: var(--petia-primary-hover, #5A36E0); }
.pvi-ico-alerta { color: var(--petia-error-text, #C8242B); }
.pvi-enlace { display: inline-flex; align-items: center; min-height: 44px; color: var(--petia-primary-hover, #5A36E0); font-size: 14px; font-weight: 600; text-decoration: none; }
.pvi-enlace:hover { text-decoration: underline; }
.pvi-estado { margin: 0; padding: 18px 0; color: var(--petia-text-muted, #5C6078); font-size: 15px; }
.pvi-vacio { margin: 0; padding: 22px 0; color: var(--petia-text-muted, #5C6078); font-size: 15px; text-align: center; }
.pvi-error { color: var(--petia-error-text, #C8242B); }
.pvi-aviso { margin: 0; padding: 14px 16px; border: 1px solid #F3D9A0; border-radius: 12px; background: #FFF8E6; color: #7A4B00; font-size: 14px; font-weight: 600; }
.pvi-reintentar { min-height: 44px; padding: 0 18px; border: 1.5px solid var(--petia-primary, #6E49F6); border-radius: 12px; background: #fff; color: var(--petia-primary-hover, #5A36E0); font-size: 14px; font-weight: 600; cursor: pointer; }
.pvi-reintentar:hover { background: var(--petia-selected, #F7F4FF); }
.pvi-boton-linea { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1.5px solid var(--petia-primary, #6E49F6); border-radius: 12px; background: #fff; color: var(--petia-primary-hover, #5A36E0); font-size: 14px; font-weight: 600; text-decoration: none; }
.pvi-boton-linea:hover { background: var(--petia-selected, #F7F4FF); }
.pvi-cuerpo :focus-visible { outline: 3px solid var(--petia-primary, #6E49F6); outline-offset: 2px; }

.pvi-chip { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.pvi-chip-ok { background: #E6F6EC; color: #146C3E; }
.pvi-chip-espera { background: #FFF1D6; color: #7A4B00; }
.pvi-chip-alerta { background: #FDE8E8; color: #A41E22; }

/* ───────────── Agenda de hoy ───────────── */
.pvi-citas { margin: 0; padding: 0; list-style: none; }
.pvi-cita { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--petia-border, #E6E2F3); }
.pvi-cita:first-child { border-top: 0; }
.pvi-cita-hora { color: var(--petia-text-muted, #5C6078); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pvi-cita-quien { display: flex; flex-direction: column; min-width: 0; }
.pvi-cita-quien strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.pvi-cita-detalle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--petia-text-muted, #5C6078); font-size: 13px; }
.pvi-atender { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border-radius: 10px; background: var(--petia-surface-tint, #EDE7FF); color: var(--petia-primary-hover, #5A36E0); font-size: 13px; font-weight: 700; text-decoration: none; }
.pvi-atender:hover { background: var(--petia-primary, #6E49F6); color: #fff; }
.pvi-mas { margin-top: 4px; }

/* ───────────── Emergencias ───────────── */
.pvi-emerg-resumen { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 14px 0; text-align: center; }
.pvi-emerg-cifra { margin: 6px 0 0 0; font-family: var(--petia-fuente-titulo, 'Poppins', sans-serif); font-size: 44px; font-weight: 800; line-height: 1; }
.pvi-emerg-r { margin: 0; color: var(--petia-text-muted, #5C6078); font-size: 14px; }
.pvi-emerg-acciones { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding-top: 12px; border-top: 1px solid var(--petia-border, #E6E2F3); text-align: center; }
.pvi-emerg-acciones .pvi-enlace { justify-content: center; }

/* ───────────── Asistente IA ───────────── */
.pvi-ia-r { margin: 0; color: var(--petia-text-muted, #5C6078); font-size: 14px; font-weight: 600; }
.pvi-ia-cifra { margin: 4px 0 12px 0; color: var(--petia-text-muted, #5C6078); font-size: 16px; }
.pvi-ia-cifra strong { color: var(--petia-text, #151A37); font-family: var(--petia-fuente-titulo, 'Poppins', sans-serif); font-size: 34px; font-weight: 800; }
.pvi-progreso { height: 10px; border-radius: 999px; background: var(--petia-surface-tint, #EDE7FF); overflow: hidden; }
.pvi-progreso-relleno { height: 100%; border-radius: 999px; background: var(--petia-primary, #6E49F6); transition: width .6s ease; }
.pvi-progreso-alto { background: var(--petia-error, #E5484D); }
.pvi-ia-nota { margin: 8px 0 0 0; color: var(--petia-text-muted, #5C6078); font-size: 13px; }
.pvi-ia > .pvi-boton-linea { margin-top: 12px; }   /* plan sin asistente IA: «Ver planes» separado del texto */
.pvi-ia-escalados { margin: 10px 0 0 0; padding-top: 6px; border-top: 1px solid var(--petia-border, #E6E2F3); }

/* ───────────── Seguimientos ───────────── */
.pvi-seg { margin: 0 0 14px 0; padding: 0; list-style: none; }
.pvi-seg-fila { display: flex; flex-direction: column; padding: 10px 0; border-top: 1px solid var(--petia-border, #E6E2F3); min-width: 0; }
.pvi-seg-fila:first-child { border-top: 0; }
.pvi-seg-fila strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.pvi-seg-detalle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--petia-text-muted, #5C6078); font-size: 13px; }
#cuerpoSeguimientos .pvi-boton-linea { width: 100%; }

/* ───────────── Tu actividad ───────────── */
.pvi-metrica { padding: 16px; border: 1px solid var(--petia-border, #E6E2F3); border-radius: 16px; background: var(--petia-selected, #F7F4FF); }
.pvi-metrica-r { overflow-wrap: anywhere; margin: 0 0 4px 0; color: var(--petia-text-muted, #5C6078); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pvi-metrica-v { margin: 0; font-family: var(--petia-fuente-titulo, 'Poppins', sans-serif); font-size: 30px; font-weight: 800; line-height: 1.1; }
.pvi-metrica-acento .pvi-metrica-v { color: var(--petia-primary-hover, #5A36E0); }
.pvi-grafico { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 160px; padding-top: 8px; }
.pvi-barra-col { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.pvi-barra { width: 100%; max-width: 56px; border-radius: 8px 8px 0 0; background: var(--petia-primary, #6E49F6); }
.pvi-barra-fin { background: #8A87A6; }   /* 3,4:1 sobre blanco (WCAG 1.4.11) */
.barra-grafico { transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1); }
.pvi-barra-valor { color: var(--petia-text-muted, #5C6078); font-size: 12px; font-weight: 700; opacity: 0; }
.pvi-barra-valor-visible { opacity: 1; }
.pvi-barra-dia { color: var(--petia-text-muted, #5C6078); font-size: 12px; font-weight: 600; }

/* ───────────── Radar de Emergencias ───────────── */
.pvi-radar { padding: 22px; border: 1px solid #F3C9C9; border-radius: 20px; background: #FFF5F5; }
.pvi-h2-alerta { color: #A41E22; }
.pvi-h2-alerta .pvi-ico-card { color: #A41E22; }
.pvi-envivo { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: #C8242B; color: #fff; font-size: 12px; font-weight: 700; }
.pvi-envivo[hidden] { display: none; }
.pvi-envivo-punto { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pvi-latido 1.4s ease-in-out infinite; }
@keyframes pvi-latido { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.pvi-radar .pvi-estado { color: #8A2A2D; }
.pvi-radar .pvi-error { color: #A41E22; }
.pvi-emerg { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid #F3C9C9; border-radius: 14px; background: #fff; }
.pvi-etiqueta-urgencia { display: inline-block; margin-bottom: 8px; padding: 3px 10px; border-radius: 6px; background: #FDE8E8; color: #A41E22; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.pvi-emerg-titulo { margin: 0; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.pvi-emerg-texto { margin: 6px 0 0 0; color: var(--petia-text-muted, #5C6078); font-size: 13.5px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pvi-tomar { min-height: 44px; border: 0; border-radius: 10px; background: #C8242B; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.pvi-tomar:hover { background: #A41E22; }

@media (max-width: 640px) {
    .pvi-tarjeta { padding: 18px 16px; }
    .pvi-cita { grid-template-columns: 52px minmax(0, 1fr) auto; }
    .pvi-cita .pvi-atender { grid-column: 2 / -1; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
    .pvi-envivo-punto { animation: none; }
    .barra-grafico, .pvi-progreso-relleno { transition: none; }
}
@media (forced-colors: active) {
    .pvi-tarjeta, .pvi-radar, .pvi-metrica, .pvi-emerg { border-color: CanvasText; }
    .pvi-progreso-relleno, .pvi-barra { background: Highlight; forced-color-adjust: none; }
}
