/* Garantías Nuovocell. Paleta de Pagos (celeste nuovocell) + un color por estado. */
:root {
  --bg: #f2f5f9;
  --card: #fff;
  --text: #1a1f2c;
  --muted: #5c6578;
  --soft: #8a93a6;
  --line: #d8dee8;
  --line-soft: #e8edf3;
  --accent: #00a8e8;
  --accent-dark: #0077a8;
  --accent-soft: #e6f6fd;
  --navy: #0b2a45;
  --input-bg: #f7f9fc;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --ok: #0b8a5f;
  --ok-soft: #e3f6ee;
  --warn: #b26a00;
  --warn-soft: #fff4dc;
  --violet: #6d4fc4;
  --violet-soft: #f0ebfc;
  --slate: #56627a;
  --slate-soft: #eef1f6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(26, 31, 44, .05), 0 4px 14px rgba(26, 31, 44, .05);

  /* un color por estado (fondo suave, texto, línea) */
  --st-recibida: #b26a00;       --st-recibida-bg: #fff4dc;
  --st-central: #0077a8;        --st-central-bg: #e6f6fd;
  --st-devuelta: #6d4fc4;       --st-devuelta-bg: #f0ebfc;
  --st-entregada: #0b8a5f;      --st-entregada-bg: #e3f6ee;
  --st-sinsol: #c2410c;         --st-sinsol-bg: #fff0e6;
  --st-rechazada: #c0392b;      --st-rechazada-bg: #fdecea;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 1.25rem; }
.mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; letter-spacing: .02em; }
.muted { color: var(--muted); font-size: .9rem; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- barra superior ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.topbar::after { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--accent), #2bc4ff 45%, var(--navy)); }
.topbar-inner {
  max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 1rem;
  padding: .5rem 1.25rem; min-height: 58px;
}
.topbar .brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.topbar .brand img { height: 30px; width: auto; display: block; }
.topbar .brand .app-name {
  font-weight: 700; color: var(--navy); font-size: .92rem; padding-left: .7rem; border-left: 1px solid var(--line);
}
.topnav { display: flex; align-items: center; gap: .25rem; flex: 1; }
.topnav > a {
  display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .75rem; border-radius: 9px;
  color: var(--muted); font-weight: 600; font-size: .9rem; text-decoration: none;
}
.topnav > a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.topnav > a.active { background: var(--accent-soft); color: var(--accent-dark); }
.topnav > a.cta { background: var(--accent); color: #fff; }
.topnav > a.cta:hover { background: var(--accent-dark); }
.user-menu { position: relative; margin-left: auto; }
.user-menu > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem;
  padding: .25rem .5rem .25rem .25rem; border-radius: 999px; border: 1px solid var(--line);
}
.user-menu > summary::-webkit-details-marker { display: none; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .9rem; text-transform: uppercase;
}
.role-badge {
  display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 700;
  letter-spacing: .04em; background: var(--accent-soft); color: var(--accent-dark);
}
.role-badge.viewer { background: var(--slate-soft); color: var(--muted); }
.user-menu .nav-menu {
  position: absolute; top: calc(100% + .35rem); right: 0; min-width: 240px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(26, 31, 44, .16); padding: .35rem; z-index: 60;
}
.user-menu .who { padding: .5rem .65rem .6rem; border-bottom: 1px solid var(--line-soft); margin-bottom: .3rem; }
.user-menu .who .email { font-weight: 600; font-size: .88rem; word-break: break-all; }
.user-menu .nav-menu a { display: block; padding: .5rem .65rem; border-radius: 8px; color: var(--text); font-weight: 600; }
.user-menu .nav-menu a:hover { background: var(--accent-soft); color: var(--accent-dark); text-decoration: none; }

/* ---------- encabezado de página ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin: .25rem 0 1.1rem; }
.page-head h1 { margin: 0; font-size: 1.5rem; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); font-size: .92rem; margin-top: .2rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-weight: 600; font-size: .88rem; margin-bottom: .35rem; }

/* ---------- tarjetas ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.card > h2, .card-title { margin: 0 0 .85rem; font-size: 1.02rem; display: flex; align-items: center; gap: .55rem; }
.card-title .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 1rem; flex: none; }
.ico.c-accent { background: var(--accent-soft); color: var(--accent-dark); }
.ico.c-violet { background: var(--violet-soft); color: var(--violet); }
.ico.c-ok { background: var(--ok-soft); color: var(--ok); }
.ico.c-warn { background: var(--warn-soft); color: var(--warn); }
.ico.c-slate { background: var(--slate-soft); color: var(--slate); }
h1, h2 { margin: 0 0 .75rem; font-size: 1.2rem; }
h3 { margin: 0 0 .5rem; font-size: 1rem; }

/* ---------- formularios ---------- */
label, .lbl { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .3rem; font-weight: 650; }
.req { color: var(--danger); }
input, select, textarea, button {
  font: inherit; font-size: .95rem; padding: .58rem .75rem; border: 1px solid var(--line);
  border-radius: 10px; background: var(--input-bg); color: var(--text); max-width: 100%;
}
input, select, textarea { width: 100%; }
input[type="checkbox"], input[type="radio"] { width: auto; }
textarea { min-height: 5.5rem; resize: vertical; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(0, 168, 232, .22); border-color: var(--accent); background: #fff; }
.hint { color: var(--soft); font-size: .8rem; margin: .3rem 0 0; }
.field + .field { margin-top: .85rem; }
.grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-2 { display: grid; gap: .85rem; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: .85rem; grid-template-columns: 1.4fr 1fr 1fr; }
#campos-equipo { margin-top: .9rem; }
#campos-equipo:first-child { margin-top: 0; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

button, .btn {
  background: var(--accent); color: #fff; border: 1px solid transparent; cursor: pointer; width: auto;
  padding: .55rem 1rem; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-weight: 650; text-decoration: none; white-space: nowrap; line-height: 1.25;
}
button:hover, .btn:hover { background: var(--accent-dark); text-decoration: none; }
button.secondary, .btn.secondary { background: #fff; color: var(--text); border-color: var(--line); }
button.secondary:hover, .btn.secondary:hover { background: var(--bg); }
button.ghost, .btn.ghost { background: transparent; color: var(--accent-dark); border-color: transparent; padding-left: .4rem; padding-right: .4rem; }
button.ghost:hover { background: var(--accent-soft); }
button.danger, .btn.danger { background: var(--danger); }
button.danger:hover { background: #a32f23; }
button.danger-soft { background: #fff; color: var(--danger); border-color: #f0c8c8; }
button.danger-soft:hover { background: var(--danger-soft); }
button.big, .btn.big { padding: .8rem 1.3rem; font-size: 1rem; border-radius: 12px; }
button:disabled { opacity: .55; cursor: not-allowed; }

.msg, .err { padding: .7rem 1rem; border-radius: 12px; margin: 0 0 1rem; font-weight: 600; }
.msg { color: var(--ok); background: var(--ok-soft); border: 1px solid #bfe6d3; }
.err { color: var(--danger); background: var(--danger-soft); border: 1px solid #f0c8c8; }
.err ul { margin: .35rem 0 0; padding-left: 1.1rem; font-weight: 500; }

/* ---------- estados ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px;
  font-size: .76rem; font-weight: 700; background: var(--slate-soft); color: var(--muted); white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.recibida { background: var(--st-recibida-bg); color: var(--st-recibida); }
.badge.enviada_central { background: var(--st-central-bg); color: var(--st-central); }
.badge.devuelta_tienda { background: var(--st-devuelta-bg); color: var(--st-devuelta); }
.badge.entregada { background: var(--st-entregada-bg); color: var(--st-entregada); }
.badge.sin_solucion { background: var(--st-sinsol-bg); color: var(--st-sinsol); }
.badge.rechazada { background: var(--st-rechazada-bg); color: var(--st-rechazada); }
.badge.lg { font-size: .9rem; padding: .3rem .8rem; }
.pill { display: inline-block; padding: .1rem .5rem; border-radius: 6px; font-size: .72rem; font-weight: 700; background: var(--slate-soft); color: var(--slate); }
.pill.verif { background: var(--ok-soft); color: var(--ok); }
.pill.tipo-laptop { background: var(--violet-soft); color: var(--violet); }
.pill.tipo-telefono { background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- LISTA ---------- */
.kpis { display: grid; gap: .7rem; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-bottom: 1rem; }
a.kpi {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem .9rem .75rem; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block; overflow: hidden;
}
a.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--k, var(--line)); }
a.kpi:hover { border-color: var(--k, var(--accent)); text-decoration: none; transform: translateY(-1px); }
a.kpi.on { outline: 2px solid var(--k, var(--accent)); outline-offset: -1px; background: var(--kb, #fff); }
.kpi .label { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; line-height: 1.2; min-height: 1.75em; }
.kpi .value { margin-top: .15rem; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--k, var(--text)); }
a.kpi.primary { background: linear-gradient(135deg, #00a8e8, #0a6fa8); border-color: transparent; color: #fff; }
a.kpi.primary::before { display: none; }
a.kpi.primary .label, a.kpi.primary .value { color: #fff; }
a.kpi.primary.on { outline-color: var(--navy); }
.k-recibida { --k: var(--st-recibida); --kb: var(--st-recibida-bg); }
.k-enviada_central { --k: var(--st-central); --kb: var(--st-central-bg); }
.k-devuelta_tienda { --k: var(--st-devuelta); --kb: var(--st-devuelta-bg); }
.k-entregada { --k: var(--st-entregada); --kb: var(--st-entregada-bg); }
.k-sin_solucion { --k: var(--st-sinsol); --kb: var(--st-sinsol-bg); }
.k-rechazada { --k: var(--st-rechazada); --kb: var(--st-rechazada-bg); }

.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .8rem; }
.search { position: relative; flex: 1 1 260px; }
.search svg { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--soft); }
.search input { padding-left: 2.2rem; background: #fff; }
.toolbar select { width: auto; min-width: 9rem; background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chips a, .chips button {
  background: #fff; color: var(--muted); border: 1px solid var(--line); padding: .3rem .75rem; border-radius: 999px;
  font-size: .82rem; font-weight: 650; text-decoration: none; width: auto;
}
.chips a:hover, .chips button:hover { background: var(--accent-soft); color: var(--accent-dark); border-color: #b6e4f5; text-decoration: none; }
.chips a.on, .chips button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.fechas { display: flex; align-items: center; gap: .35rem; }
.fechas input { width: 9.5rem; background: #fff; padding: .45rem .55rem; }
.fechas span { color: var(--soft); font-size: .85rem; }
.result-line { color: var(--muted); font-size: .88rem; margin: 0 0 .6rem; display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.result-line strong { color: var(--text); }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .7rem .65rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { color: var(--muted); font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-card { padding: 0; overflow: hidden; }
.table-scroll { width: 100%; overflow-x: auto; }
table.lista tbody tr { cursor: pointer; transition: background .1s; }
table.lista tbody tr:hover { background: #f5fafe; }
table.lista td:first-child { box-shadow: inset 4px 0 0 var(--k, transparent); }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.thumb.vacio { display: grid; place-items: center; background: var(--slate-soft); color: var(--soft); font-size: 1.2rem; }
.eq-nombre { font-weight: 700; }
.eq-serial { font-size: .8rem; color: var(--muted); }
.sub-linea { display: block; color: var(--muted); font-size: .8rem; }
.cell-note { max-width: 15rem; color: var(--muted); font-size: .84rem; }
.lleva { font-weight: 650; }

/* ---------- NUEVA RECEPCIÓN ---------- */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
.paso-num {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--navy); color: #fff; font-size: .85rem; font-weight: 800;
}
.card.paso { scroll-margin-top: 80px; }
.card.paso.listo .paso-num { background: var(--ok); }
.card.paso.listo .paso-num::after { content: "✓"; }
.card.paso.listo .paso-num span { display: none; }
.tipos { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1rem; }
.tipo-op { position: relative; margin: 0; }
.tipo-op input { position: absolute; opacity: 0; pointer-events: none; }
.tipo-op span {
  display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .85rem .5rem; border-radius: 12px;
  border: 2px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; color: var(--text); font-size: .95rem; text-align: center;
}
.tipo-op span i { font-style: normal; font-size: 1.7rem; line-height: 1; }
.tipo-op span small { font-weight: 500; color: var(--soft); font-size: .74rem; }
.tipo-op input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(0, 168, 232, .15); }
.tipo-op input:focus-visible + span { outline: 3px solid rgba(0, 168, 232, .35); }
.serial-row { display: flex; gap: .45rem; }
.serial-row input { flex: 1; font-family: Consolas, Menlo, monospace; letter-spacing: .03em; }

.toggles { display: flex; flex-wrap: wrap; gap: .45rem; }
.toggle { margin: 0; position: relative; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span {
  display: inline-flex; align-items: center; gap: .3rem; padding: .42rem .8rem; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-weight: 600; font-size: .86rem; cursor: pointer; user-select: none;
}
.toggle input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.toggle input:checked + span::before { content: "✓"; font-size: .8rem; }
.toggle input:focus-visible + span { outline: 3px solid rgba(0, 168, 232, .35); }
.toggles input.otro { width: 11rem; padding: .4rem .7rem; border-radius: 999px; font-size: .86rem; }
.frases { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .5rem; }
.frases button { padding: .25rem .6rem; font-size: .78rem; border-radius: 999px; background: var(--slate-soft); color: var(--slate); font-weight: 650; }
.frases button:hover { background: var(--accent-soft); color: var(--accent-dark); }

/* pruebas: una fila por prueba con tres botones */
.pruebas { display: flex; flex-direction: column; gap: .5rem; }
.prueba { border: 1px solid var(--line-soft); border-radius: 12px; padding: .55rem .7rem; background: #fbfcfe; }
.prueba-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.prueba-top .nom { font-weight: 650; }
.resultado { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.resultado label { margin: 0; position: relative; }
.resultado input { position: absolute; opacity: 0; pointer-events: none; }
.resultado span { display: block; padding: .38rem .7rem; font-size: .84rem; font-weight: 700; color: var(--muted); cursor: pointer; border-left: 1px solid var(--line); user-select: none; }
.resultado label:first-child span { border-left: none; }
.resultado input:checked + span.r-ok { background: var(--ok); color: #fff; }
.resultado input:checked + span.r-falla { background: var(--danger); color: #fff; }
.resultado input:checked + span.r-no_pudo { background: var(--warn); color: #fff; }
.resultado input:checked + span.r-no_aplica { background: var(--slate); color: #fff; }
.resultado input:focus-visible + span { outline: 3px solid rgba(0, 168, 232, .35); outline-offset: -3px; }
.prueba.falla { border-color: #f3c1bb; background: #fff8f7; }
.prueba.ok { border-color: #bfe6d3; background: #f6fcf9; }
.prueba.no_pudo { border-color: #f1d9a6; background: #fffbf2; }
.prueba .nota { margin-top: .5rem; }
.todo-ok { margin: 0 0 .6rem; }

/* Verificador (laptop) */
.verif-caja { border: 2px dashed #b6e4f5; border-radius: 14px; padding: 1rem; background: var(--accent-soft); text-align: center; }
.verif-caja p { margin: .4rem 0 .8rem; color: var(--muted); font-size: .9rem; }
.verif-ok { display: flex; align-items: center; gap: .8rem; border: 2px solid #9fd9bf; border-radius: 14px; padding: .85rem 1rem; background: var(--ok-soft); text-align: left; }
.verif-ok .check { width: 40px; height: 40px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.verif-ok b { display: block; color: var(--ok); }
.verif-ok .mono { font-size: 1rem; font-weight: 700; }
.verif-ok .acc { margin-left: auto; }
.aviso { border-radius: 10px; padding: .6rem .8rem; font-size: .88rem; margin-top: .6rem; background: var(--warn-soft); color: #7a4a00; border: 1px solid #f1d9a6; }
.alterno { margin-top: .9rem; }
.alterno summary { cursor: pointer; color: var(--accent-dark); font-weight: 650; font-size: .88rem; }
.alterno .grid { margin-top: .7rem; }

/* fotos */
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .6rem; }
.foto-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.foto-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-tile .quitar {
  position: absolute; top: .3rem; right: .3rem; width: 28px; height: 28px; padding: 0; border-radius: 50%;
  background: rgba(15, 23, 32, .7); color: #fff; font-size: .9rem;
}
.foto-tile .n { position: absolute; left: .35rem; bottom: .3rem; background: rgba(15, 23, 32, .65); color: #fff; font-size: .7rem; font-weight: 700; padding: .05rem .4rem; border-radius: 6px; }
.foto-add {
  aspect-ratio: 1; border-radius: 12px; border: 2px dashed #b6e4f5; background: var(--accent-soft); color: var(--accent-dark);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; font-weight: 700; font-size: .85rem; cursor: pointer; padding: .3rem;
}
.foto-add i { font-style: normal; font-size: 1.6rem; line-height: 1; }
.foto-add:hover { background: #d6f0fb; }
.foto-add.gal { border-color: var(--line); background: #fff; color: var(--muted); }
.progreso { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; margin: .2rem 0 .8rem; }
.progreso div { height: 100%; background: var(--warn); border-radius: 999px; transition: width .2s; }
.progreso.lleno div { background: var(--ok); }
.foto-cuenta { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 650; color: var(--muted); }

/* resumen lateral / barra inferior */
.resumen { position: sticky; top: 76px; }
.resumen h2 { font-size: .95rem; margin-bottom: .6rem; }
.faltan { list-style: none; margin: 0 0 .9rem; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.faltan li { display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--muted); }
.faltan li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.faltan li.ok { color: var(--text); }
.faltan li.ok::before { content: "✓"; border-color: var(--ok); background: var(--ok); color: #fff; font-size: .7rem; display: grid; place-items: center; font-weight: 800; }
.resumen button[type="submit"] { width: 100%; }
.barra-guardar { display: none; }

/* ---------- FICHA ---------- */
.ficha-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.ficha-head h1 { margin: .1rem 0 .3rem; font-size: 1.55rem; }
.ficha-head .meta { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; color: var(--muted); font-size: .9rem; }
.ruta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 1rem 0 1.1rem; }
.ruta div { position: relative; text-align: center; font-size: .78rem; font-weight: 650; color: var(--soft); padding-top: 1.6rem; }
.ruta div::before { content: ""; position: absolute; top: .45rem; left: 50%; transform: translateX(-50%); width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--line); z-index: 1; }
.ruta div::after { content: ""; position: absolute; top: .85rem; left: -50%; right: 50%; height: 3px; background: var(--line); }
.ruta div:first-child::after { display: none; }
.ruta div.hecho { color: var(--text); }
.ruta div.hecho::before { background: var(--ok); border-color: var(--ok); }
.ruta div.hecho::after { background: var(--ok); }
.ruta div.actual { color: var(--accent-dark); }
.ruta div.saltado { color: var(--soft); text-decoration: line-through; }
.ruta div.saltado::before { background: #fff; border-style: dashed; border-color: var(--soft); }
.ruta div.saltado::after, .ruta div.saltado + div::after { background: var(--ok); }
.ruta div.actual::before { background: var(--accent); border-color: #b6e4f5; box-shadow: 0 0 0 4px rgba(0, 168, 232, .18); }
.ruta-alerta { margin: -.4rem 0 1rem; }
.ficha-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem 1.2rem; }
.dato .k { color: var(--muted); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.dato .v { font-weight: 600; margin-top: .1rem; }
.dato.ancho { grid-column: 1 / -1; }
.texto-largo { background: #fbfcfe; border: 1px solid var(--line-soft); border-radius: 10px; padding: .6rem .75rem; font-weight: 500; white-space: pre-wrap; }
.lista-pruebas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .45rem; }
.lista-pruebas div { display: flex; align-items: flex-start; gap: .5rem; padding: .45rem .6rem; border-radius: 10px; background: #fbfcfe; border: 1px solid var(--line-soft); font-size: .88rem; }
.lista-pruebas .r { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: #fff; flex: none; background: var(--soft); }
.lista-pruebas .r.ok { background: var(--ok); } .lista-pruebas .r.falla { background: var(--danger); } .lista-pruebas .r.no_pudo { background: var(--warn); }
.lista-pruebas small { display: block; color: var(--muted); }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; }
.galeria figure { margin: 0; position: relative; }
.galeria img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; display: block; }
.galeria figure form { position: absolute; top: .3rem; right: .3rem; margin: 0; }
.galeria figure form button { width: 28px; height: 28px; padding: 0; border-radius: 50%; background: rgba(15, 23, 32, .7); font-size: .85rem; }
.lado .card { margin-bottom: 1rem; }
.lleva-grande { font-size: 1.15rem; font-weight: 800; color: var(--navy); }
.siguientes { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .7rem; }
.sig { margin: 0; position: relative; }
.sig input { position: absolute; opacity: 0; pointer-events: none; }
.sig span { display: flex; align-items: center; gap: .55rem; padding: .6rem .75rem; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 650; color: var(--text); background: #fff; }
.sig span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--soft)); flex: none; }
.sig input:checked + span { border-color: var(--c, var(--accent)); background: var(--cb, var(--accent-soft)); }
.c-enviada_central { --c: var(--st-central); --cb: var(--st-central-bg); }
.c-devuelta_tienda { --c: var(--st-devuelta); --cb: var(--st-devuelta-bg); }
.c-entregada { --c: var(--st-entregada); --cb: var(--st-entregada-bg); }
.c-sin_solucion { --c: var(--st-sinsol); --cb: var(--st-sinsol-bg); }
.c-rechazada { --c: var(--st-rechazada); --cb: var(--st-rechazada-bg); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 .9rem 1.4rem; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--soft)); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 1.1rem; bottom: 0; width: 2px; background: var(--line-soft); }
.timeline li:last-child::after { display: none; }
.timeline .q { color: var(--muted); font-size: .82rem; }
.timeline .n { font-size: .88rem; margin-top: .15rem; background: #fbfcfe; border-radius: 8px; padding: .3rem .5rem; border: 1px solid var(--line-soft); }
.c-recibida { --c: var(--st-recibida); }
details.plegable > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.plegable > summary::-webkit-details-marker { display: none; }
details.plegable > summary::after { content: "▾"; color: var(--soft); }
details.plegable[open] > summary { margin-bottom: .8rem; }
.zona-peligro { text-align: right; margin-top: .5rem; }

/* ---------- escáner ---------- */
.escaner { position: fixed; inset: 0; z-index: 90; background: rgba(11, 20, 32, .8); display: flex; align-items: center; justify-content: center; padding: .8rem; }
.escaner-caja { width: min(520px, 100%); background: #fff; border-radius: 16px; padding: 1rem; }
.escaner-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.escaner-visor { position: relative; border-radius: 12px; overflow: hidden; background: #111; }
#escaner-video { width: 100%; display: block; max-height: 60vh; object-fit: cover; }
.escaner-visor .mira { position: absolute; inset: 18%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); pointer-events: none; }
.escaner-aviso { margin: .7rem 0; color: var(--muted); font-size: .9rem; text-align: center; }

/* ---------- lightbox ---------- */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(11, 20, 32, .85); z-index: 80; align-items: center; justify-content: center; padding: 1.5rem; }
.lightbox.open { display: flex; }
.lightbox img { max-width: min(1000px, 100%); max-height: 88vh; border-radius: 10px; background: #fff; }
.lightbox-close { position: absolute; top: 1rem; right: 1rem; background: #fff; color: var(--text); border-radius: 10px; }

/* ---------- login ---------- */
.login-page { min-height: calc(100vh - 2.5rem); display: grid; place-items: center; }
.login-box { width: 100%; max-width: 410px; margin: 0 auto; padding: 0; overflow: hidden; }
.login-top { background: linear-gradient(135deg, #00a8e8, #0b2a45); padding: 1.4rem 1.6rem 1.2rem; text-align: center; color: #fff; }
.login-top .logo-fondo { display: inline-block; background: #fff; border-radius: 12px; padding: .5rem .9rem; }
.login-top img { height: 36px; display: block; }
.login-top h1 { color: #fff; font-size: 1.2rem; margin: .8rem 0 .1rem; }
.login-top p { margin: 0; opacity: .85; font-size: .88rem; }
.login-cuerpo { padding: 1.3rem 1.6rem 1.4rem; }
.login-box .field { margin-bottom: .85rem; }
.login-box button[type="submit"] { width: 100%; padding: .75rem; font-size: 1rem; margin-top: .25rem; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 5rem; }
.pw-wrap .pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--accent-dark); font-size: .8rem; padding: .3rem .45rem; }
.login-foot { text-align: center; margin: 1rem 0 0; font-size: .82rem; color: var(--muted); }
.demo { margin-top: .9rem; font-size: .8rem; color: var(--muted); background: #f8fafc; border-radius: 10px; padding: .6rem .75rem; border: 1px solid var(--line-soft); }
.demo code { color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ficha-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .form-layout { grid-template-columns: 1fr; }
  .resumen { display: none; }
  .barra-guardar {
    display: flex; position: sticky; bottom: 0; z-index: 40; gap: .7rem; align-items: center; justify-content: space-between;
    margin: 0 -1.25rem; padding: .7rem 1.25rem calc(.7rem + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(26, 31, 44, .08);
  }
  .barra-guardar .txt { font-size: .85rem; color: var(--muted); font-weight: 600; }
  .barra-guardar .txt b { color: var(--danger); }
  .barra-guardar .txt.ok b { color: var(--ok); }
}
@media (max-width: 680px) {
  .wrap { padding: .85rem .75rem; }
  .barra-guardar { margin: 0 -.75rem; padding-left: .75rem; padding-right: .75rem; }
  .card { padding: 1rem .9rem; }
  .kpis { display: flex; overflow-x: auto; gap: .5rem; margin: 0 -.75rem 1rem; padding: 0 .75rem .3rem; scroll-snap-type: x proximity; }
  .kpis a.kpi { flex: 0 0 auto; min-width: 104px; max-width: 130px; padding: .55rem .7rem; scroll-snap-align: start; }
  .kpis .kpi .label { min-height: 0; font-size: .66rem; }
  .kpis .kpi .value { font-size: 1.3rem; }
  .toolbar button[type="submit"] { flex: 1 1 100%; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .tipo-op span { padding: .7rem .3rem; font-size: .88rem; }
  .role-badge, .topbar .brand .app-name { display: none; }
  .topnav > a.cta span { display: none; }
  .toolbar select, .fechas { flex: 1 1 45%; }
  .fechas input { width: 100%; }
  .page-head h1 { font-size: 1.3rem; }
  .ruta div { font-size: .68rem; }
  table.lista thead { display: none; }
  table.lista, table.lista tbody, table.lista tr, table.lista td { display: block; width: 100%; }
  table.lista tr { display: grid; grid-template-columns: 56px 1fr auto; gap: .2rem .7rem; padding: .75rem .8rem; border-bottom: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--k, transparent); }
  table.lista td { border: none; padding: 0; box-shadow: none !important; }
  table.lista td.c-foto { grid-row: span 3; }
  table.lista td.c-equipo { grid-column: 2; }
  table.lista td.c-estado { grid-column: 3; grid-row: 1; text-align: right; }
  table.lista td.c-cliente, table.lista td.c-recibida, table.lista td.c-lleva { grid-column: 2 / 4; font-size: .84rem; }
  table.lista td.c-fallo, table.lista td.c-abrir { display: none; }
}
