/* Lumina · Eventos. Lista y detalle como en Mail de macOS: filas de vidrio, la seleccionada se enciende; el detalle es
   una hoja de vidrio con la evidencia protagonista y la decisión siempre a mano abajo. */
.ev-raiz > * + * { margin-top: 16px; }
.ev-raiz > .ev-activos { margin-top: 10px; }
.ev-raiz .encabezado .mas { width: 40px; height: 40px; background: var(--opt-surface-raised); box-shadow: inset 0 0 0 1px var(--opt-border-strong); color: var(--opt-heading); }
.ev-raiz .encabezado .menu { min-width: 300px; }
.ev-raiz .encabezado .menu button { display: flex; align-items: center; gap: 8px; }
.ev-raiz .menu .ev-marca { margin-left: auto; visibility: hidden; color: var(--lumina); }
.ev-raiz .menu [aria-pressed=true] .ev-marca { visibility: visible; }

/* filtros */
.ev-filtros { gap: 10px; }
.ev-filtros .control select { max-width: 140px; }
.ev-filtros .control select.ev-f-sev { max-width: 150px; }
.ev-filtros .ev-f-q { flex: 1 1 150px; min-width: 150px; }
.ev-f-q input { width: 100%; }
.ev-activos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ev-act-t { color: var(--opt-text-secondary); font-size: var(--opt-text-sm); }
.ev-filtro { gap: 4px; padding-right: 4px; animation: entra-y .35s var(--llegada); }
.ev-filtro button { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--opt-text-secondary); transition: background .2s, transform .3s var(--llegada); }
.ev-filtro button:hover { background: var(--opt-surface-inset); color: var(--opt-heading); transform: rotate(90deg); }

/* lista y detalle a la vez: en ventana ancha ocupan el alto que queda (--ev-alto) y se desplazan por dentro */
.ev-cuerpo { display: grid; grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.1fr); gap: 22px; align-items: start; }
.ev-raiz:not(.angosto) .ev-lista, .ev-raiz:not(.angosto) .ev-detalle { height: var(--ev-alto, 600px); }
.ev-lista { display: flex; flex-direction: column; padding: 14px 14px 12px; }
.ev-lista .tabs { flex: none; display: flex; margin: 0 0 12px; }
#ev-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ev-scroll { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -8px; padding: 2px 8px 8px; overscroll-behavior: contain; }
.ev-lista .pager { flex: none; }
.ev-lista .tabs [role=tab] { flex: 1 1 auto; justify-content: center; padding: 0 8px; gap: 6px; font-size: var(--opt-text-sm); }
.ev-lista .tabs .contador { min-width: 22px; height: 20px; font-size: 11.5px; }
.ev-filas { list-style: none; padding: 0; display: grid; gap: 6px; }
.ev-filas:empty { display: none; }
.ev-fila { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px; border-radius: 8px; background: transparent; cursor: pointer; transition: background .25s, box-shadow .35s var(--llegada), transform .35s var(--llegada); }
.ev-fila:hover { background: var(--opt-surface-raised); box-shadow: 0 10px 24px -18px rgba(11, 19, 27, .45); }
.ev-fila:active { transform: scale(.99); }
.ev-fila[aria-selected=true] { background: var(--opt-surface-raised); box-shadow: inset 0 0 0 1.5px var(--lumina), 0 14px 30px -18px rgba(236, 109, 39, .55); }
.ev-fila .mini-ev { width: 100px; border-radius: 6px; }
.ev-fila-txt { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ev-fila-txt b { color: var(--opt-heading); font-weight: 600; font-size: var(--opt-text-md); letter-spacing: -0.012em; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ev-fila-txt small { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--opt-text-secondary); font-size: var(--opt-text-sm); }
.ev-fila-txt small span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-fila-ext { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ev-fila-ext .chip { min-height: 20px; font-size: 11.5px; padding: 0 8px; }
.ev-fila > .ic { color: var(--opt-text-muted); transition: transform .35s var(--llegada), color .2s; }
.ev-fila:hover > .ic { transform: translateX(2px); color: var(--opt-heading); }
.ev-fila[aria-selected=true] > .ic { color: var(--lumina); }
.ev-fuera { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 8px 8px 14px; border-radius: 8px; background: var(--opt-info-soft); color: var(--opt-info); font-size: var(--opt-text-sm); }
.ev-fuera span { flex: 1 1 200px; }

/* detalle */
.ev-detalle { overflow-y: auto; overscroll-behavior: contain; padding: 24px 26px 0; outline: 0; scroll-padding-bottom: 88px; }
.ev-volver { display: none; margin: -4px 0 8px -8px; }
.ev-d-titulo { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ev-d-titulo h2 { font-size: 26px; letter-spacing: -0.035em; line-height: 1.1; min-width: 0; overflow-wrap: anywhere; outline: 0; animation: entra-y .45s var(--llegada); }
.ev-d-titulo .chip { margin-top: 3px; }
.ev-d-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; color: var(--opt-text-secondary); }
.ev-media { margin-top: 18px; }
/* la evidencia conserva su relación de aspecto (--ar) y no pasa de ~45 % del alto disponible */
.ev-visor { --ar: 1.7778; aspect-ratio: var(--ar); width: min(100%, calc(var(--ev-alto, 9999px) * 0.4 * var(--ar))); margin: 0 auto; }
.ev-sin { display: grid; place-items: center; align-content: center; gap: 8px; padding: 16px; text-align: center; color: #A1A1A6; font-size: var(--opt-text-sm); }
.ev-sin .ic { width: 32px; height: 32px; }
.ev-nada { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 96px; padding: 16px; border-radius: 8px; background: var(--opt-surface-inset); color: var(--opt-text-secondary); font-weight: 500; }
.ev-cargando { position: absolute; inset: 0; display: grid; place-items: center; color: #A1A1A6; font-size: var(--opt-text-sm); }
.ev-pie { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; margin-top: 8px; color: var(--opt-text-secondary); font-size: var(--opt-text-xs); }
.ev-pie > span { flex: 1 1 260px; overflow-wrap: anywhere; }
.ev-pie .btn { margin-right: -8px; }
.ev-linea { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; }
.ev-hora { display: inline-flex; align-items: center; gap: 8px; color: var(--opt-heading); font-weight: 600; font-variant-numeric: tabular-nums; }
.ev-hora .ic { color: var(--opt-text-secondary); }
.ev-estados { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.ev-estado { display: inline-flex; align-items: center; gap: 6px; }
.ev-et { color: var(--opt-text-secondary); font-size: var(--opt-text-sm); }
.ev-ayuda { margin-top: 6px; color: var(--opt-text-secondary); font-size: var(--opt-text-xs); line-height: 1.45; }
.ev-frase { display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; padding: 14px 16px; border-radius: 8px; background: var(--opt-surface-inset); color: var(--opt-text); }
.ev-frase .ic { color: var(--lumina); margin-top: 3px; }
.ev-nota { display: grid; gap: 7px; margin-top: 16px; }
.ev-nota label { font-weight: 600; font-size: var(--opt-text-sm); color: var(--opt-text); }
.ev-nota label span { font-weight: 400; color: var(--opt-text-secondary); }
.ev-nota textarea { width: 100%; min-height: 64px; }
.ev-nota textarea[readonly] { background: var(--opt-surface-inset); box-shadow: none; }
.ev-nota-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin-top: -2px; }
.ev-nota-pie small { margin-left: auto; color: var(--opt-text-muted); font-size: var(--opt-text-xs); font-variant-numeric: tabular-nums; }
#ev-conflicto:not(:empty) { margin-bottom: 12px; }
.ev-conf { align-items: flex-start; flex-wrap: wrap; }
/* acciones: barra de vidrio pegada abajo del detalle aunque se desplace */
.ev-barra { position: sticky; bottom: 0; z-index: 2; margin: 14px -26px 0; padding: 14px 26px; background: var(--vidrio-fuerte); -webkit-backdrop-filter: var(--vidrio-blur); backdrop-filter: var(--vidrio-blur); border-top: 1px solid var(--opt-border); }
.ev-botones { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ev-botones .grow { flex: 1; }
.ev-guardado { flex: 1 1 180px; display: flex; align-items: center; justify-content: flex-end; gap: 6px; text-align: right; font-size: var(--opt-text-sm); font-weight: 500; animation: entra-y .35s var(--llegada); }
.ev-guardado .ic { flex: none; }
#ev-d-mas { padding-bottom: 24px; }
.ev-secc { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--opt-border); }
.ev-secc h3 { margin-bottom: 10px; }
.ev-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 18px; font-size: var(--opt-text-sm); }
.ev-dl dt { color: var(--opt-text-secondary); }
.ev-dl dd { margin: 0; color: var(--opt-heading); font-weight: 500; }
.ev-dl dd small { display: block; color: var(--opt-text-secondary); font-weight: 400; font-size: var(--opt-text-xs); }
.ev-vio { list-style: none; padding: 0; display: grid; gap: 6px; font-size: var(--opt-text-sm); }
.ev-vio li { position: relative; padding-left: 16px; }
.ev-vio li::before { content: ""; position: absolute; left: 2px; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--lumina); }
.ev-avisos { display: grid; gap: 8px; margin-top: 10px; }
.ev-accion { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 8px; background: var(--opt-surface-inset); font-size: var(--opt-text-sm); }
.ev-accion .ic { color: var(--opt-heading); }
.ev-accion span { flex: 1; min-width: 0; color: var(--opt-heading); font-weight: 500; }
.ev-accion small { max-width: 55%; text-align: right; overflow-wrap: anywhere; color: var(--opt-text-secondary); font-size: var(--opt-text-xs); }
.ev-accion.ok small { color: var(--opt-success); }
.ev-accion.mal small, .ev-accion.mal .ic { color: var(--opt-error); }

/* ventana angosta: lista o detalle, uno a la vez (el detalle a ancho completo, con «Volver a la lista») */
.ev-raiz.angosto .ev-cuerpo { grid-template-columns: minmax(0, 1fr); }
.ev-raiz.angosto:not(.con-detalle) .ev-detalle { display: none; }
.ev-raiz.angosto.con-detalle .ev-filtros, .ev-raiz.angosto.con-detalle .ev-activos, .ev-raiz.angosto.con-detalle .ev-lista { display: none; }
.ev-raiz.angosto .ev-detalle, .ev-raiz.angosto .ev-scroll { overflow: visible; }
.ev-raiz.angosto .ev-volver { display: inline-flex; }
.ev-raiz.angosto .ev-media { max-width: 880px; }
.ev-raiz.angosto .ev-visor { width: 100%; }
.ev-raiz.angosto .ev-barra { bottom: -32px; } /* fija al borde de la ventana (la zona de trabajo tiene 32 px de margen abajo) */
.ev-raiz.angosto.con-detalle .ev-detalle { animation: entra .55s var(--llegada); }

/* marcar eventos para «Crear acción», decisión con motivo, atención, historial, regla y zona, seguimiento */
.ev-sel { flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin: 0 -4px 0 -2px; border-radius: 6px; cursor: pointer; }
.ev-sel:hover { background: var(--opt-surface-inset); }
.ev-sel input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--lumina); }
.ev-selbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 10px; padding: 8px 8px 8px 14px; border-radius: 8px; background: var(--opt-heading); color: var(--opt-background); font-size: var(--opt-text-sm); animation: entra-y .4s var(--llegada); }
.ev-selbar > span { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; color: inherit; font-weight: 600; }
.ev-selbar .btn:not(.p) { background: rgba(255, 255, 255, .14); color: inherit; box-shadow: none; }
.ev-selbar .btn.p { background: var(--lumina); color: #0B131B; }
.ev-decidir { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-bottom: 12px; padding: 14px; border-radius: 8px; background: var(--opt-surface-inset); animation: entra-y .4s var(--llegada); }
.ev-decidir label { display: grid; gap: 5px; flex: 1 1 180px; font-weight: 600; font-size: var(--opt-text-sm); }
.ev-dec-t i { font-style: normal; font-weight: 400; color: var(--opt-text-secondary); }
.ev-decidir .campo { height: 38px; width: 100%; }
.ev-decidir .ev-dec-ancho { flex-basis: 100%; }
.ev-dec-b { display: flex; gap: 8px; margin-left: auto; }
.ev-decidir .error-campo { flex-basis: 100%; }
.ev-atender { min-height: 28px; }
/* UI-14: ir a una página */
.ev-ir-pag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--opt-text-sm); color: var(--opt-text-secondary); }
.ev-ir-pag input { width: 64px; min-height: 30px; padding: 0 8px; text-align: center; }
/* historial como línea de tiempo */
.ev-hist { list-style: none; padding: 0; display: grid; gap: 12px; position: relative; }
.ev-hist::before { content: ""; position: absolute; left: 4.5px; top: 10px; bottom: 10px; width: 1px; background: var(--opt-border-strong); }
.ev-hist li { position: relative; display: flex; gap: 12px; font-size: var(--opt-text-sm); }
.ev-h-pt { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--opt-heading); box-shadow: 0 0 0 4px var(--opt-background); }
.ev-h-sis .ev-h-pt { background: var(--revision); }
.ev-h-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ev-h-mot { color: var(--opt-heading); font-weight: 600; }
.ev-hist p { margin-top: 4px; overflow-wrap: anywhere; }
.ev-hist small { display: block; margin-top: 2px; color: var(--opt-text-secondary); font-size: var(--opt-text-xs); }
.ev-ir-regla { margin: 8px 0 0 -8px; }
.ev-segs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.ev-seg { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 14px; border-radius: var(--opt-radius-pill); background: var(--opt-surface-inset); color: var(--opt-heading); font-weight: 600; font-size: var(--opt-text-sm); transition: background .2s; }
.ev-seg:hover { background: var(--opt-accent-soft); color: var(--opt-accent-text); }
#ev-d-mas .btn.chico[data-crear-accion] { margin-top: 8px; }
.ev-raiz .encabezado-acciones { align-items: center; }
