/* claro-listas.css — FROST «Claro» (14-11-2026). Dueño: un solo agente. Ver docs/diseno-14-11/BRIEF-IMPLEMENTAR.md */
/* A1 · Avisos como bandeja «Por revisar | Todos» y Cargas en grupos con modo «Elegir» (informe B, secciones 1 y 2).
   Va después de style.css: manda sobre lo de antes. */

/* =========================================================================================== Avisos */
/* Barra: pestañas a la izquierda, «Filtrar» a la derecha, en una sola línea también en el celular */
#panel-alertas .alert-filters.ev-bar { display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 12px; flex: 1 1 100%; }
#panel-alertas .alert-filters.ev-bar > .ev-seg { flex: 1 1 auto; width: auto; min-width: 0; }
#panel-alertas .alert-filters.ev-bar > #ev-more { flex: none; width: auto; margin-bottom: 4px; }
.ev-seg button { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.ev-seg button b { margin: 0; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; display: inline-grid; place-items: center;
  background: var(--warn); color: var(--bg); font: 700 13px var(--font-ui); }
.ev-seg button b:empty { display: none; }
#ev-more > summary { min-height: 44px; font-size: 15px; }
#ev-f-n { margin-left: 2px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: inline-grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font: 700 12.5px var(--font-ui); }
#ev-f-n.hidden { display: none; }
#ev-more .mo-menu { width: min(320px, calc(100vw - 32px)); }
#ev-more .mo-menu > * { flex: none !important; width: 100% !important; }
#ev-more .mo-menu input, #ev-more .mo-menu select { min-height: 48px; height: 48px; font-size: 16px; }
#ev-more #ack-all, #ev-more #ev-clear { justify-content: center; text-align: center; color: var(--accent); font-weight: 600; }
#ev-more #ack-all { border-top: 1px solid var(--border) !important; border-radius: 0; margin-top: 4px; padding-top: 6px; }

/* Filas grandes que se tocan enteras: qué pasó (grande) · carga · nivel · hace cuánto · «Ya lo revisé» */
#panel-alertas .ev-table td { padding-top: 15px; padding-bottom: 15px; vertical-align: middle; }
#panel-alertas .ev-table th:last-child, #panel-alertas td.evc-st { text-align: right; }
#panel-alertas .evc-what .ev-type { display: block; font-size: 16.5px; line-height: 1.3; }
#panel-alertas .evc-what .ev-det { display: block; margin-top: 3px; font-size: 14px; line-height: 1.4; color: var(--text-2); font-weight: 400; }
#panel-alertas .evc-what .td-sub { display: block; }
#panel-alertas .ev-urg { display: none; }
#panel-alertas .evc-asset b { font-size: 15.5px; font-weight: 600; }
#panel-alertas .evc-lvl .lvl { font-size: 13px; }
#panel-alertas .evc-when { white-space: nowrap; font-size: 15px; }
#panel-alertas .evc-when .td-sub { display: block; }
#panel-alertas .evc-st .td-sub { display: block; margin-top: 3px; }
#panel-alertas button.ev-ack { min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--accent); background: transparent;
  color: var(--accent); font: 600 15px var(--font-ui); white-space: nowrap; cursor: pointer; }
#panel-alertas button.ev-ack:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
#panel-alertas tr.ev-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#panel-alertas tr.ev-seen .evc-what .ev-type { font-weight: 600; }

/* Sin nada que mostrar, la tabla no muestra sus títulos de columna */
#panel-alertas .ev-table.is-empty thead { display: none; }

/* Título de grupo «Ya revisados, siguen pasando · 3» (igual que los grupos de Cargas) */
#panel-alertas tr.ev-grp td { padding: 26px 12px 8px; font: 700 13px var(--font-ui); letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: none !important; border-bottom: 1px solid var(--border-hi); box-shadow: none !important; cursor: default; }
#panel-alertas tr.ev-grp:hover td, #panel-alertas tr.ev-empty-row:hover td { background: none !important; }
#panel-alertas tr.ev-empty-row td { border-bottom: 0; cursor: default; }

/* Vacío que tranquiliza: «Todo revisado», grande y verde */
.ev-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 56px 16px 48px; text-align: center; }
.ev-empty .ev-empty-ico { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 12px; border-radius: 50%;
  background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.ev-empty .ev-empty-ico svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ev-empty b { font-size: 24px; letter-spacing: -.01em; }
.ev-empty span:not(.ev-empty-ico) { font-size: 17px; color: var(--text-2); }
.ev-empty .link-btn { margin-top: 14px; min-height: 44px; font-size: 16px; font-weight: 600; color: var(--accent); }
.ev-empty-f { padding: 40px 16px; }
.ev-empty-f b { font-size: 19px; color: var(--text); }

@media (max-width: 760px) {
  #panel-alertas .alert-filters.ev-bar > * { flex-basis: auto !important; }
  #panel-alertas .alert-filters.ev-bar > .ev-seg { flex: 1 1 auto !important; }
  #panel-alertas .alert-filters.ev-bar > #ev-more { flex: none !important; }
  /* Cada aviso: qué pasó / carga / hace cuánto a la izquierda; «Ya lo revisé» a la derecha, siempre a la vista */
  #panel-alertas tr.ev-row { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "what st" "asset st" "when st";
    column-gap: 12px; row-gap: 3px; align-items: center; min-height: 76px; padding: 14px 2px !important; }
  #panel-alertas tr.ev-row > td.evc-what { grid-area: what !important; font-size: 17px; color: var(--text); }
  /* Punto de color antes de lo que pasó (ámbar = revisar, rojo = urgente); el de la fecha se quitó en style.css */
  #panel-alertas tr.ev-row.unack > td.evc-what .ev-type::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%;
    background: var(--warn); margin-right: 8px; vertical-align: 2px; }
  #panel-alertas tr.ev-row.unack.lvl-crit > td.evc-what .ev-type::before { background: var(--bad); }
  #panel-alertas tr.ev-row.ev-done > td.evc-what { color: var(--muted); }
  #panel-alertas tr.ev-row > td.evc-asset { grid-area: asset !important; font-size: 15px; }
  #panel-alertas tr.ev-row > td.evc-asset b { font-weight: 500; font-size: 15px; }
  #panel-alertas tr.ev-row > td.evc-when { grid-area: when !important; font-size: 13.5px; color: var(--text-2); }
  #panel-alertas tr.ev-row > td.evc-when .td-sub { display: inline; margin-left: 6px; }
  #panel-alertas tr.ev-row > td.evc-st { grid-area: st !important; align-self: center; max-width: 136px; white-space: normal; }
  #panel-alertas tr.ev-row > td.evc-lvl, #panel-alertas tr.ev-row > td.evc-org { display: none !important; }
  #panel-alertas .evc-what .ev-type { display: inline; font-size: 17px; }
  #panel-alertas .ev-urg { display: inline-block; margin-left: 8px; font: 700 11.5px var(--font-ui); letter-spacing: .05em; text-transform: uppercase;
    color: var(--bad); vertical-align: 2px; }
  #panel-alertas .evc-what .ev-det { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #panel-alertas tr.ev-grp, #panel-alertas tr.ev-empty-row { display: block !important; padding: 0 !important; border: 0 !important; }
  #panel-alertas tr.ev-grp td, #panel-alertas tr.ev-empty-row td { display: block !important; }
  #panel-alertas tr.ev-grp td { padding: 26px 2px 8px !important; border-bottom: 1px solid var(--border-hi) !important; }
}

/* =========================================================================================== Cargas */
/* Casillas solo en el modo «Elegir»; sin él, la fila entera abre la carga */
.fleet:not(.picking) .col-sel { display: none; }
.fleet.picking .col-sel input { width: 22px; height: 22px; }
.fleet.picking tbody tr[data-eui] { cursor: pointer; }
.fleet tbody tr.picked td { background: color-mix(in srgb, var(--accent) 10%, transparent) !important; }
.fleet.picking td.col-sel { vertical-align: middle; }
/* Barra de lo marcado: en el computador fija abajo, centrada sobre la lista (la lista ya no tiene su propio desplazamiento) */
@media (min-width: 861px) {
  #panel-equipos .sel-bar { position: fixed; bottom: 20px; left: calc(232px + (100vw - 232px) / 2); transform: translateX(-50%); z-index: 30; margin: 0;
    flex-wrap: nowrap; max-width: calc(100vw - 232px - 32px); }
  #panel-equipos .sel-bar select { flex: 0 1 240px; min-width: 0; }
  #panel-equipos .sel-bar > button { white-space: nowrap; min-height: 40px; }
  /* Admin y distribuidor ven más columnas (rastreador, batería, cada cuánto reporta): la tabla se desplaza hacia el lado
     en vez de cortar «Dónde está» y el botón «Ver» (a 1366 px se salían) */
  #app-view:not(.role-user) #panel-equipos table.fleet { display: block; overflow-x: auto; }
  #app-view:not(.role-user) #panel-equipos table.fleet .col-where { min-width: 200px; }
  #panel-equipos .table-wrap:has(.fleet.picking) { padding-bottom: 110px; }
}
#fleet-pick { min-height: 48px; font-size: 15px; }
#fleet-pick.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 650; }
#fleet-new + #fleet-pick { margin-left: 0; }
.sel-bar #sel-count { font-size: 15px; }
.sel-bar #sel-done { font-weight: 650; color: var(--accent); }

/* Encabezado de grupo: el primero sin tanto aire arriba; no se resalta al pasar */
.fleet tbody tr.fleet-grp:first-child td { padding-top: 12px; }
.fleet tbody tr.fleet-grp:hover td { background: none !important; }
/* Responsable en texto (el selector vive en la ficha y en «Elegir») */
.fleet td.col-resp { font-size: 14.5px; color: var(--text-2); }

@media (max-width: 760px) {
  /* «Agregar carga» y «Elegir» lado a lado */
  #panel-equipos .alert-filters > #fleet-new, #panel-equipos .alert-filters > #fleet-pick { flex: 1 1 40% !important; }
  #panel-equipos .alert-filters > #fleet-new.hidden + #fleet-pick { flex: 1 1 100% !important; }
  .fleet.picking tbody tr:not(.fleet-grp):not(.fleet-empty) { column-gap: 12px; }
  #app-view.role-user .fleet.picking td.col-sel { display: block !important; }
  .fleet.picking td.col-sel { align-self: center; }
  /* La fila marcada se resalta entera (en el celular la fila es una grilla, no celdas de tabla) */
  .fleet tbody tr.picked { background: color-mix(in srgb, var(--accent) 10%, transparent) !important; }
  .fleet tbody tr.picked td { background: none !important; }
  /* Barra de lo marcado, compacta: «2 marcadas · Listo» / responsable / Pedir traslado · Quitar selección */
  #sel-bar { gap: 8px; padding: 10px 12px; }
  #sel-bar > #sel-count { flex: 1 1 auto; order: 0; }
  #sel-bar > #sel-done { order: 1; flex: none; }
  #sel-bar > #sel-resp { order: 2; flex: 1 1 100%; }
  #sel-bar > #sel-permit, #sel-bar > #sel-clear { order: 3; flex: 1 1 40%; min-height: 44px; }
  #sel-bar > #sel-remote { order: 4; flex: 1 1 100%; min-height: 44px; }
  #sel-bar > button { min-height: 44px; font-size: 14.5px; padding: 0 10px; white-space: nowrap; }
  .fleet tbody tr.fleet-grp:first-child td { padding-top: 10px !important; }
  .sel-bar { width: auto; left: 0; right: 0; }
}
