/* Redex · BDB — sistema visual (rediseño nov 2026).
   Tokens del diseño: fondo #F5F6F8, superficie #fff, borde #E6E7EA, texto #15171C / #5B616E,
   rojo de marca #C8201A (hover #9E1914). Inter para todo; JetBrains Mono para IDs de envío.
   Radios: 8 px controles, 12 px tarjetas. Objetivos táctiles de 44 px. Modo oscuro completo. */

:root {
  --fondo: #F5F6F8; --superficie: #fff; --superficie-2: #FAFAFB; --borde: #E6E7EA; --borde-2: #EEEFF1; --borde-control: #DADDE3;
  --texto: #15171C; --texto-2: #5B616E; --texto-3: #3A3F4A;
  --rojo: #C8201A; --rojo-osc: #9E1914; --rojo-suave: #FDE8E7;
  --lateral: #111318; --lateral-2: #1A1D24; --lateral-activo: #23262F; --lateral-hover: #1E2129; --lateral-texto: #C9CDD6; --lateral-texto-2: #9EA4B0;
  --gris-1: #F1F2F4; --gris-2: #E9EAED;
  /* Etiquetas de plazo y de evidencia (fondo / texto / punto) */
  --vencido-f: #FDE8E7; --vencido: #A11712; --vencido-p: #C8201A;
  --hoy-f: #FFEDD9; --hoy: #8F4400; --hoy-p: #E06A00;
  --manana-f: #FFF4CF; --manana: #6E5200; --manana-p: #D4A200;
  --tiempo-f: #E3F5EA; --tiempo: #17663A; --tiempo-p: #22A05A;
  --revisar-f: #E6EEFE; --revisar: #1D4ED8; --revisar-p: #2F66E8;
  --neutro-f: #F1F2F4; --neutro: #4A505C;
  --sombra: 0 1px 2px rgba(16, 24, 40, .04);
  --sombra-2: 0 4px 16px rgba(16, 24, 40, .08);
  --radio: 12px; --radio-c: 8px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fondo: #0E1013; --superficie: #171A1F; --superficie-2: #1B1F25; --borde: #2A2E36; --borde-2: #252930; --borde-control: #353A44;
    --texto: #ECEEF2; --texto-2: #A3A9B5; --texto-3: #C9CDD6; --rojo-suave: #3A1715;
    --gris-1: #20242B; --gris-2: #2A2E36;
    --vencido-f: #3A1715; --vencido: #FF9C93; --hoy-f: #3A2410; --hoy: #FFB56B; --manana-f: #362C0C; --manana: #F2CF5B;
    --tiempo-f: #12301F; --tiempo: #7FD9A3; --revisar-f: #17264A; --revisar: #9DB8FF; --neutro-f: #23272E; --neutro: #B5BAC4;
    --sombra: none; --sombra-2: 0 4px 16px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fondo: #0E1013; --superficie: #171A1F; --superficie-2: #1B1F25; --borde: #2A2E36; --borde-2: #252930; --borde-control: #353A44;
  --texto: #ECEEF2; --texto-2: #A3A9B5; --texto-3: #C9CDD6; --rojo-suave: #3A1715;
  --gris-1: #20242B; --gris-2: #2A2E36;
  --vencido-f: #3A1715; --vencido: #FF9C93; --hoy-f: #3A2410; --hoy: #FFB56B; --manana-f: #362C0C; --manana: #F2CF5B;
  --tiempo-f: #12301F; --tiempo: #7FD9A3; --revisar-f: #17264A; --revisar: #9DB8FF; --neutro-f: #23272E; --neutro: #B5BAC4;
  --sombra: none; --sombra-2: 0 4px 16px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--fondo); color: var(--texto);
  font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--rojo); }
a:hover { color: var(--rojo-osc); }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 16px 0 8px; }
.sub { color: var(--texto-2); margin: 0 0 20px; font-size: 14px; }
.nota, .ayuda { color: var(--texto-2); font-size: 13px; }
.mono { font-family: var(--mono); font-weight: 600; }
.error { color: var(--vencido); font-size: 14px; margin: 6px 0; }
.ok { color: var(--tiempo); font-size: 14px; margin: 6px 0; }
.error:empty, .ok:empty { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- controles ---------- */
label { display: block; font-size: 13px; font-weight: 500; color: var(--texto-3); margin: 0 0 14px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; font: inherit; font-size: 15px; color: var(--texto);
  background: var(--superficie); border: 1px solid var(--borde-control); border-radius: var(--radio-c); padding: 9px 12px; min-height: 42px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--rojo); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 84px; resize: vertical; }
.fila { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 14px;
  border-radius: var(--radio-c); min-height: 40px; padding: 0 16px; border: 1px solid var(--borde-control); background: var(--superficie);
  color: var(--texto); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--gris-1); color: var(--texto); }
.btn.primario { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.btn.primario:hover { background: var(--rojo-osc); border-color: var(--rojo-osc); color: #fff; }
.btn.fantasma { border-color: transparent; background: transparent; }
.btn.chico { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.ancho { width: 100%; }
.btn.peligro { color: var(--vencido); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { flex: none; }
.enlace { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--texto-2); text-decoration: underline; cursor: pointer; }
.enlace:hover { color: var(--rojo); }
.icono-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radio-c);
  background: transparent; border: 0; color: inherit; cursor: pointer; font-size: 17px; }
.icono-btn:hover { background: rgba(127, 127, 127, .12); }

/* ---------- etiquetas (pastillas) ---------- */
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  white-space: nowrap; background: var(--neutro-f); color: var(--neutro); }
.chip.vencido { background: var(--vencido-f); color: var(--vencido); }
.chip.limite { background: var(--hoy-f); color: var(--hoy); }
.chip.alerta { background: var(--manana-f); color: var(--manana); }
.chip.ok { background: var(--tiempo-f); color: var(--tiempo); }
.chip.entregada { background: var(--revisar-f); color: var(--revisar); }
.chip.rechazada { background: var(--vencido-f); color: var(--vencido); }
.chip.aprobada, .chip.subida_meli { background: var(--tiempo-f); color: var(--tiempo); }
.punto { width: 8px; height: 8px; border-radius: 999px; display: inline-block; flex: none; background: var(--texto-2); }
.punto.vencido { background: var(--vencido-p); } .punto.limite { background: var(--hoy-p); } .punto.alerta { background: var(--manana-p); }
.punto.ok { background: var(--tiempo-p); } .punto.revisar { background: var(--revisar-p); }

/* ---------- logo ---------- */
.logo { height: 30px; width: auto; display: block; }
.logo-oscuro { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-claro { display: none; }
  :root:not([data-theme="light"]) .logo-oscuro { display: block; }
}
:root[data-theme="dark"] .logo-claro { display: none; }
:root[data-theme="dark"] .logo-oscuro { display: block; }
:root[data-theme="light"] .logo-oscuro { display: none; }
.marca { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--texto); }
.marca-sep { width: 1px; height: 22px; background: var(--borde); }

/* ---------- pantallas de acceso ---------- */
.acceso { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.tarjeta-acceso { width: 100%; max-width: 400px; background: var(--superficie); border: 1px solid var(--borde); border-radius: 16px;
  box-shadow: var(--sombra-2); padding: 28px 24px; }
.tarjeta-acceso .logo { height: 36px; }
.cab-acceso { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 26px; }
.tarjeta-acceso h1 { font-size: 22px; }
.pie-acceso { font-size: 13px; text-align: center; margin: 16px 0 8px; }
.boton-tema { font-size: 17px; line-height: 1; min-height: 36px; padding: 0 10px; }
input.pin { font-size: 24px; letter-spacing: .6em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- estructura de la app ---------- */
.app { min-height: 100vh; display: flex; }
.contenido { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vista { width: 100%; max-width: 1320px; margin: 0 auto; padding: 28px 40px 56px; }
.cargando { color: var(--texto-2); }

/* Barra lateral oscura (LP y admin en escritorio) */
.lateral { width: 248px; flex: none; background: var(--lateral); color: #E7E9EE; display: flex; flex-direction: column; gap: 24px;
  padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.lat-marca { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.lat-marca .logo { height: 28px; }
.lat-marca b { display: block; font-size: 15px; color: #fff; }
.lat-marca span { font-size: 12px; color: var(--lateral-texto-2); }
.lat-nav { display: flex; flex-direction: column; gap: 2px; }
.lat-nav a { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 8px; color: var(--lateral-texto);
  text-decoration: none; font-size: 14px; font-weight: 500; }
.lat-nav a:hover { background: var(--lateral-hover); color: #fff; }
.lat-nav a.activo { background: var(--lateral-activo); color: #fff; }
.lat-nav a span.txt { flex: 1; }
.contador { font-size: 12px; font-weight: 600; background: var(--rojo); color: #fff; border-radius: 999px; padding: 1px 8px; }
.lat-flex { flex: 1; }
.lat-carga { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 10px; background: var(--lateral-2); font-size: 12px;
  color: var(--lateral-texto-2); text-decoration: none; }
.lat-carga:hover { color: var(--lateral-texto-2); }
.lat-carga b { font-size: 13px; color: #fff; font-weight: 500; }
.lat-carga.vieja { box-shadow: inset 3px 0 0 var(--hoy-p); }
.lat-usuario { display: flex; align-items: center; gap: 6px; padding: 6px 4px; }
.avatar { width: 34px; height: 34px; border-radius: 999px; background: #2B2F39; color: #fff; display: inline-flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
.lat-usuario .quien { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px; border-radius: 8px;
  cursor: pointer; font: inherit; text-align: left; color: inherit; }
.lat-usuario .quien:hover { background: var(--lateral-hover); }
.lat-usuario .quien div { min-width: 0; display: flex; flex-direction: column; }
.lat-usuario .quien b { font-size: 13px; color: #fff; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lat-usuario .quien span { font-size: 12px; color: var(--lateral-texto-2); }
.lat-usuario .icono-btn { color: var(--lateral-texto-2); width: 36px; height: 36px; flex: none; }
.lat-usuario .icono-btn:hover { color: #fff; background: var(--lateral-hover); }
.lateral .logo-claro { display: none !important; }
.lateral .logo-oscuro { display: block !important; }

/* Barra superior blanca (proveedor; y en el celular, todos) */
.barra { background: var(--superficie); border-bottom: 1px solid var(--borde); position: sticky; top: 0; z-index: 5;
  padding-top: env(safe-area-inset-top); }
.barra-int { max-width: 1320px; margin: 0 auto; padding: 0 32px; min-height: 64px; display: flex; align-items: center; gap: 20px; }
.barra .menu { display: flex; gap: 4px; }
.barra .menu a { padding: 8px 12px; border-radius: 8px; color: var(--texto-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.barra .menu a.activo { background: var(--gris-1); color: var(--texto); font-weight: 600; }
.barra .flex { flex: 1; }
.barra .yo { display: flex; align-items: center; gap: 4px; }
.yo-boton { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 8px 4px 4px; border-radius: 10px; cursor: pointer;
  font: inherit; color: var(--texto); text-align: left; min-height: 44px; }
.yo-boton:hover { background: var(--gris-1); }
.yo-boton .avatar { background: var(--texto); color: var(--superficie); }
.yo-boton b { display: block; font-size: 13px; }
.yo-boton span { font-size: 12px; color: var(--texto-2); }
body.es-lp .barra { display: none; }

/* Pestañas inferiores (LP y admin en el celular) */
.tabs-movil { display: none; }

/* ---------- encabezado de página ---------- */
.cab-pagina { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.cab-pagina h1 { margin: 0 0 6px; }
.cab-pagina .sub { margin: 0; }
.cab-pagina .acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.aviso-carga { display: flex; gap: 12px; align-items: center; background: var(--hoy-f); color: var(--hoy); border-radius: var(--radio);
  padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.aviso-carga a { color: inherit; font-weight: 600; }

/* ---------- indicadores ---------- */
.indicadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.ind { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: var(--radio); cursor: pointer;
  font: inherit; background: var(--superficie); border: 1px solid var(--borde); box-shadow: var(--sombra); color: var(--texto); }
.ind:hover { border-color: var(--borde-control); }
.ind.activo { border-color: var(--texto); box-shadow: 0 0 0 1px var(--texto); }
.ind .et { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--texto-2); white-space: nowrap; }
.ind .num { font-size: 32px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ind .pista { font-size: 12px; color: var(--texto-2); }

/* ---------- caja con barra de filtros + tabla ---------- */
.caja { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra); }
.caja-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--borde); }
.caja-pie { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; font-size: 13px; color: var(--texto-2); border-top: 1px solid var(--borde-2); }
.pestanas { display: flex; background: var(--gris-1); border-radius: 8px; padding: 3px; }
.pestanas button { height: 34px; padding: 0 14px; border: 0; border-radius: 6px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 500;
  color: var(--texto-2); background: transparent; white-space: nowrap; }
.pestanas button.activo { color: var(--texto); background: var(--superficie); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.pestanas .cuenta { margin-left: 6px; font-size: 12px; color: var(--revisar); font-weight: 600; }
.buscador { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--borde-control);
  border-radius: 8px; background: var(--superficie); margin: 0; }
.buscador:focus-within { outline: 2px solid var(--rojo); outline-offset: -1px; border-color: transparent; }
.buscador input { border: 0; outline: none; margin: 0; padding: 0; min-height: 0; height: 38px; background: transparent; font-size: 14px; }
.buscador input:focus { outline: none; }
.buscador svg { flex: none; color: var(--texto-2); }
.caja-barra select { width: auto; margin: 0; height: 40px; min-height: 40px; font-size: 14px; padding: 0 12px; min-width: 170px; max-width: 260px; }

.tabla-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 10px 16px; font-size: 12px; font-weight: 600; color: var(--texto-2); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--borde); background: var(--superficie-2); text-align: left; white-space: nowrap; }
td { padding: 14px 16px; vertical-align: top; border-bottom: 1px solid var(--borde-2); }
tbody tr:last-child td { border-bottom: 0; }
.tabla-casos { min-width: 980px; }
.tabla-casos tbody tr { cursor: pointer; }
.tabla-casos tbody tr:hover { background: var(--superficie-2); }
.tabla-casos .producto { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabla-casos .recorte { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabla-casos .meli { color: var(--texto-3); }
.sec { font-size: 12px; color: var(--texto-2); margin-top: 3px; }
.der { text-align: right; }
.num-t { font-variant-numeric: tabular-nums; font-weight: 500; }
.inactivo { opacity: .55; }
.vacio { text-align: center; color: var(--texto-2); padding: 48px 16px; }
/* tablas de las otras pantallas: dentro de una caja blanca */
.vista > .tabla-scroll, .bloque > .tabla-scroll, .seccion .tabla-scroll { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); }
.vista > .tabla-scroll { box-shadow: var(--sombra); }

/* Tarjetas de reclamo (celular) */
.tarjetas { display: none; }
.tarjeta-caso { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 12px 14px; display: flex;
  flex-direction: column; gap: 6px; text-decoration: none; color: var(--texto); }
.tarjeta-caso:hover { color: var(--texto); border-color: var(--borde-control); }
.tarjeta-caso .fila-t { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tarjeta-caso .prod { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tarjeta-caso .prov { font-size: 12px; color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- bloques genéricos ---------- */
.bloque { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 20px; margin-bottom: 16px; box-shadow: var(--sombra); }
.bloque > h2:first-child, .bloque > h3:first-child { margin-top: 0; }
.seccion { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); margin-bottom: 20px; }
.seccion > h2 { margin: 0; padding: 16px 20px; border-bottom: 1px solid var(--borde-2); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.seccion > h2 small { font-size: 12px; font-weight: 400; color: var(--texto-2); }
.seccion > .cuerpo { padding: 20px; }
.resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cifra { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px 16px; }
.cifra b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.cifra span { font-size: 12px; color: var(--texto-2); font-weight: 500; }
.cifra.ok { margin: 0; font-size: inherit; color: inherit; }
.cifra.ok b { color: var(--tiempo); } .cifra.alerta b { color: var(--manana); } .cifra.limite b { color: var(--hoy); }
.cifra.revisar b { color: var(--revisar); } .cifra.vencido b { color: var(--vencido); }
.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filtros input, .filtros select { width: auto; flex: 1 1 200px; margin: 0; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.enlace-copiar { display: flex; gap: 6px; margin-top: 8px; } .enlace-copiar input { margin: 0; font-size: 13px; }
.aviso-notif { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--revisar-f);
  border-color: transparent; color: var(--texto); }
.aviso-notif .nota { color: var(--texto-3); }

/* ---------- detalle (pantalla completa encima de la lista) ---------- */
.panel { position: fixed; inset: 0; z-index: 20; background: var(--fondo); overflow-y: auto; }
.panel-caja { max-width: 1240px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 32px max(56px, env(safe-area-inset-bottom)); }
.volver { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--texto-2); background: none; border: 0; padding: 8px 0;
  cursor: pointer; font: inherit; min-height: 44px; }
.volver:hover { color: var(--texto); }
.panel-cab { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 4px 0 20px; }
.panel-cab h2 { font-size: 22px; margin: 0 0 6px; }
.det-etq { font-size: 13px; color: var(--texto-2); font-weight: 500; }
.det-id { font-family: var(--mono); font-size: 30px; font-weight: 600; letter-spacing: -.01em; margin: 4px 0 10px; }
.det-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.limite-caja { display: flex; align-items: center; gap: 14px; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px 18px; }
.limite-caja span { display: block; font-size: 12px; color: var(--texto-2); }
.limite-caja b { font-size: 15px; }
.det-cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.datos { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px 24px; }
.datos div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.datos dt { font-size: 12px; color: var(--texto-2); font-weight: 500; }
.datos dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.datos .ancho { grid-column: 1 / -1; }
.comentario { margin-top: 18px; padding: 14px 16px; background: var(--superficie-2); border: 1px solid var(--borde-2); border-radius: 10px; }
.comentario span { display: block; font-size: 12px; color: var(--texto-2); font-weight: 500; }
.rechazo { border-left: 4px solid var(--vencido-p); }
.zona-soltar { border: 1.5px dashed var(--borde-control); border-radius: var(--radio); padding: 30px 20px; display: flex; flex-direction: column;
  align-items: center; gap: 10px; cursor: pointer; background: var(--superficie-2); text-align: center; margin: 0; font-weight: 400; }
.zona-soltar.encima { border-color: var(--rojo); background: var(--rojo-suave); }
.zona-soltar .ic { width: 48px; height: 48px; border-radius: 12px; background: var(--rojo-suave); color: var(--rojo); display: flex; align-items: center; justify-content: center; }
.zona-soltar b { font-size: 14px; color: var(--texto); }
.zona-soltar b em { color: var(--rojo); font-style: normal; }
.zona-soltar small { font-size: 12px; color: var(--texto-2); }
.botones-archivo { display: none; grid-template-columns: 1fr 1fr; gap: 8px; }
.botones-archivo .btn { min-height: 52px; margin: 0; }
.ev-lista { display: grid; gap: 8px; margin-top: 12px; }
.ev-lista:empty { display: none; }
.ev-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--borde-2); border-radius: 10px; padding: 8px; }
.ev-item img, .ev-pdf { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--gris-1); }
.ev-pdf { display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--rojo); }
.ev-info { min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.ev-info b:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.progreso { height: 8px; background: var(--gris-1); border-radius: 99px; overflow: hidden; margin: 12px 0; }
.progreso div { height: 100%; width: 0; background: var(--rojo); transition: width .2s; }
.enviar-fila { display: flex; justify-content: flex-end; margin-top: 4px; }
.evid-lista { display: flex; flex-direction: column; gap: 10px; }
.evid { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--borde-2); border-radius: 10px; text-decoration: none; color: var(--texto); }
.evid:hover { background: var(--superficie-2); color: var(--texto); }
.evid img, .evid .pdf { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; background: #2B2F39; }
.evid .pdf { display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; }
.evid .info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.evid .info b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evid .info span { font-size: 12px; color: var(--texto-2); }
.tiempo { list-style: none; padding: 0; margin: 0; position: relative; }
.tiempo li { position: relative; padding: 0 0 16px 22px; font-size: 14px; }
.tiempo li::before { content: ""; position: absolute; left: 4px; top: 18px; bottom: 0; width: 2px; background: var(--borde-2); }
.tiempo li:last-child::before { display: none; }
.tiempo li::after { content: ""; position: absolute; left: 0; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--texto-2); }
.tiempo li.evidencia::after { background: var(--revisar-p); } .tiempo li.rechazar::after { background: var(--vencido-p); }
.tiempo li.aprobar::after, .tiempo li.subida_meli::after { background: var(--tiempo-p); }
.tiempo li.rechazo_meli::after { background: var(--vencido-p); }
.entrega.actual.e-rechazo_meli { border-color: var(--vencido-p); box-shadow: 0 0 0 1px var(--vencido-p); } .tiempo li.meli::after { background: var(--manana-p); }
.tiempo small { display: block; color: var(--texto-2); font-size: 12px; margin-top: 2px; }

/* ---------- avisos ---------- */
.aviso { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 40; background: #15171C; color: #fff; padding: 12px 18px;
  border-radius: 10px; box-shadow: var(--sombra-2); max-width: calc(100% - 32px); font-size: 14px; }
.aviso.error { background: var(--vencido-p); }
@media (display-mode: standalone) { [data-instalar] { display: none !important; } }

/* =================================================================== celular (< 768 px) */
@media (max-width: 767px) {
  body { font-size: 15px; }
  h1 { font-size: 22px; }
  .lateral { display: none; }
  body.es-lp .barra { display: block; }
  .barra-int { padding: 0 12px; min-height: 56px; gap: 8px; }
  .barra .menu { display: none; }
  .barra .logo { height: 24px; }
  .marca { font-size: 15px; gap: 8px; }
  .yo-boton .txt { display: none; }
  .vista { padding: 16px 16px max(96px, calc(env(safe-area-inset-bottom) + 80px)); }
  body:not(.es-lp, .con-modulos) .vista { padding-bottom: max(32px, env(safe-area-inset-bottom)); }
  .cab-pagina { margin-bottom: 16px; align-items: flex-start; }
  .cab-pagina .acciones { width: 100%; }
  .cab-pagina .acciones .btn { flex: 1; min-height: 44px; }
  /* Pestañas inferiores fijas para LP y admin */
  body.es-lp .tabs-movil, body.con-modulos .tabs-movil { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    background: var(--superficie); border-top: 1px solid var(--borde); padding: 6px 4px max(8px, env(safe-area-inset-bottom)); }
  .tabs-movil a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; justify-content: center; color: var(--texto-2);
    text-decoration: none; font-size: 11px; font-weight: 500; position: relative; }
  .tabs-movil a.activo { color: var(--rojo); font-weight: 600; }
  .tabs-movil .contador { position: absolute; top: 0; left: calc(50% + 6px); font-size: 10px; padding: 0 5px; }
  /* Indicadores: fila deslizable (LP) o cuadrícula 2x2 (proveedor) */
  .indicadores { display: flex; overflow-x: auto; gap: 8px; margin: 0 -16px 16px; padding: 0 16px 2px; scrollbar-width: none; }
  .indicadores::-webkit-scrollbar { display: none; }
  .indicadores .ind { flex: 0 0 auto; min-width: 128px; padding: 12px 14px; gap: 4px; }
  .indicadores .ind .num { font-size: 22px; }
  .indicadores .ind .pista { display: none; }
  body:not(.es-lp) .indicadores { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 16px; padding: 0; }
  body:not(.es-lp) .indicadores .ind { min-width: 0; }
  /* La tabla de reclamos se vuelve tarjetas */
  .caja { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .caja-barra { padding: 0 0 12px; border: 0; gap: 8px; }
  .caja-barra .pestanas { width: 100%; }
  .caja-barra .pestanas button { flex: 1; height: 38px; }
  .buscador { flex-basis: 100%; height: 44px; }
  .caja-barra select { flex: 1 1 140px; max-width: none; min-width: 0; height: 44px; }
  .caja .tabla-scroll { display: none; }
  .tarjetas { display: flex; flex-direction: column; gap: 10px; }
  .caja-pie { padding: 12px 0; border: 0; }
  .bloque, .seccion > .cuerpo { padding: 16px; }
  .seccion > h2 { padding: 14px 16px; }
  /* Detalle */
  .panel-caja { padding: max(8px, env(safe-area-inset-top)) 16px 120px; }
  .det-id { font-size: 22px; }
  .limite-caja { width: 100%; padding: 12px 14px; }
  .det-cols { grid-template-columns: 1fr; }
  .datos { grid-template-columns: 1fr 1fr; gap: 14px 16px; }
  .zona-soltar { display: none; }
  .botones-archivo { display: grid; }
  .enviar-fila { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--superficie); border-top: 1px solid var(--borde);
    padding: 10px 16px max(12px, env(safe-area-inset-bottom)); margin: 0; }
  .enviar-fila .btn { width: 100%; min-height: 48px; }
  .acciones .btn { flex: 1 1 auto; min-height: 44px; }
  th, td { padding: 10px 12px; }
  .tarjeta-acceso { padding: 22px 18px; }
  input, select, textarea { font-size: 16px; }   /* evita el zoom automático de iPhone */
}
/* "ok" también es la clase de los mensajes de éxito: en pastillas y puntos no debe ocultarse ni moverse */
.punto.ok { display: inline-block; margin: 0; }
.chip.ok { margin: 0; font-size: 12px; }
/* La barra lateral oscura es solo del personal de LP; el proveedor usa la barra superior blanca */
body:not(.es-lp) .lateral { display: none; }
/* Caja para elegir archivo (Cargas de Excel, carga manual del padrón) */
.zona-archivo { border: 1.5px dashed var(--borde-control); border-radius: var(--radio); padding: 20px; text-align: center; color: var(--texto-2);
  background: var(--superficie-2); font-size: 14px; margin-bottom: 12px; }
.zona-archivo input { margin: 10px auto 0; max-width: 420px; background: var(--superficie); }

/* Evidencias por entrega: la actual resaltada, las anteriores en gris */
.entregas { display: flex; flex-direction: column; gap: 14px; }
.entrega { border: 1px solid var(--borde-2); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.entrega.actual { border-color: var(--revisar-p); box-shadow: 0 0 0 1px var(--revisar-p); }
.entrega.actual.e-aprobar, .entrega.actual.e-subida_meli { border-color: var(--tiempo-p); box-shadow: 0 0 0 1px var(--tiempo-p); }
.entrega.actual.e-rechazar { border-color: var(--vencido-p); box-shadow: 0 0 0 1px var(--vencido-p); }
.entrega.anterior { background: var(--superficie-2); }
.entrega.anterior .evid { opacity: .6; }
.entrega.anterior .evid:hover { opacity: 1; }
.entrega-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.entrega-cab b { font-size: 14px; }
.entrega-meta { font-size: 12px; color: var(--texto-2); }
.entrega-nota { font-size: 13px; color: var(--texto-3); font-style: italic; }
.entrega-motivo { font-size: 13px; background: var(--vencido-f); color: var(--vencido); border-radius: 8px; padding: 8px 10px; }
.entrega-motivo span { display: block; font-size: 12px; opacity: .8; margin-top: 2px; }
.entrega .evid { padding: 8px; }
.entrega .evid img, .entrega .evid .pdf { width: 48px; height: 48px; }
.revisando { margin: 0 0 14px; font-size: 14px; color: var(--texto-3); }

/* Reloj de cuenta atrás del plazo para entregar evidencia */
.reloj { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--texto-2); white-space: nowrap; }
.reloj.ok { color: var(--tiempo); } .reloj.alerta { color: var(--manana); } .reloj.limite { color: var(--hoy); }
.reloj.vencido { color: var(--vencido); }
.reloj.detenido { font-family: inherit; color: var(--texto-2); font-weight: 500; }
.reloj.grande { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin: 2px 0; }
.reloj.grande.detenido { font-size: 16px; }
.limite-caja { min-width: 260px; }
.limite-caja.revision { border-color: var(--revisar-p); }
.tarjeta-caso .reloj-fila { border-top: 1px dashed var(--borde-2); padding-top: 6px; margin-top: 2px; }
.tabla-casos .reloj { margin-top: 2px; }

/* Lista de reclamos: todas las columnas caben. Las de dato corto llevan ancho fijo y Producto / Driver
   se reparten lo que sobra. Si la caja mide menos de 1000 px, se muestran tarjetas en vez de tabla. */
.vista { max-width: 1720px; padding-left: 32px; padding-right: 32px; }
.barra-int { max-width: 1720px; }
#lista { container-type: inline-size; }
.tabla-casos { min-width: 0; table-layout: fixed; }
.tabla-casos th, .tabla-casos td { padding-left: 12px; padding-right: 12px; }
.tabla-casos th:nth-child(1) { width: 134px; }
.tabla-casos th:nth-child(3) { width: 104px; }
.tabla-casos th:nth-child(5) { width: 136px; }
.tabla-casos th:nth-child(6) { width: 208px; }
.tabla-casos th:nth-child(7) { width: 142px; }
.tabla-casos .producto, .tabla-casos .recorte { max-width: none; }
@container (max-width: 1099px) {
  .tabla-casos th, .tabla-casos td { padding-left: 9px; padding-right: 9px; }
  .tabla-casos th { letter-spacing: 0; }
  .tabla-casos th:nth-child(1) { width: 124px; }
  .tabla-casos th:nth-child(3) { width: 92px; }
  .tabla-casos th:nth-child(5) { width: 116px; }
  .tabla-casos th:nth-child(6) { width: 198px; }
  .tabla-casos th:nth-child(7) { width: 128px; }
}
@container (max-width: 929px) {
  .tabla-scroll { display: none; }
  .tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 10px; padding: 12px; }
}
@media (max-width: 767px) {
  .vista { padding-left: 16px; padding-right: 16px; }
  .tarjetas { padding: 0; }
}
/* Las demás tablas (proveedores, cargas, usuarios y detalles): compactas, y si la caja mide menos de
   820 px cada renglón se apila con el nombre de la columna a la izquierda (data-l lo pone app.js). */
.tabla-scroll:not(#lista .tabla-scroll) { container: tabla / inline-size; }
table:not(.tabla-casos) th { white-space: normal; letter-spacing: 0; }
table:not(.tabla-casos) th, table:not(.tabla-casos) td { padding-left: 12px; padding-right: 12px; }
table:not(.tabla-casos) td { overflow-wrap: anywhere; }
table:not(.tabla-casos) td:first-child { min-width: 60px; }
td .chip { white-space: nowrap; }
@container tabla (max-width: 819px) {
  table:not(.tabla-casos), table:not(.tabla-casos) tbody, table:not(.tabla-casos) tr { display: block; }
  table:not(.tabla-casos) thead { display: none; }
  table:not(.tabla-casos) tr { padding: 10px 0; border-bottom: 1px solid var(--borde); }
  table:not(.tabla-casos) tr:last-child { border-bottom: 0; }
  table:not(.tabla-casos) td { display: block; position: relative; padding: 5px 14px 5px 134px; min-height: 30px; border: 0; }
  table:not(.tabla-casos) td::before { content: attr(data-l); position: absolute; left: 14px; top: 6px; width: 110px; font-size: 12px; font-weight: 600; color: var(--texto-2); }
  table:not(.tabla-casos) td[data-l=""], table:not(.tabla-casos) td:not([data-l]) { padding-left: 14px; }
}
@container tabla (max-width: 819px) { table:not(.tabla-casos) td:empty { display: none; } }
.casilla { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 500; flex: none; }
.casilla input[type=checkbox] { width: 18px; height: 18px; min-height: 0; margin: 0; flex: none; }
/* Usuario en la barra lateral: nombre arriba, íconos en su propia fila */
.lat-usuario { flex-wrap: wrap; justify-content: flex-end; }
.lat-usuario .quien { flex: 1 0 100%; }
/* Activar a todos los proveedores */
.avance { height: 8px; border-radius: 99px; background: var(--borde); overflow: hidden; margin: 4px 0 8px; }
.avance i { display: block; height: 100%; background: var(--rojo); border-radius: 99px; transition: width .4s; }
.omitidos { margin-top: 12px; font-size: 13px; color: var(--texto-2); }
.omitidos summary { cursor: pointer; font-weight: 600; }
.omitidos ul { margin: 8px 0; padding-left: 18px; }
/* Nombre de cada módulo de Redex en el menú lateral */
.lat-modulo { padding: 0 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .03em; color: var(--lateral-texto-2); }
.lat-nav a + .lat-modulo { margin-top: 18px; }
