/* CarCheckin — diseño 2.0
   Menú lateral en escritorio, barra de pestañas en el celular, tema claro y oscuro.
   Todo el color sale de las variables de :root; los colores de estado (OK / sugerida / urgente) son semánticos. */

/* ===================== Variables ===================== */
:root {
  --bg: #F5F6FB;
  --surface: #FFFFFF;
  --surface-2: #F0F2F9;
  --ink: #0B1020;
  --ink-2: #4A5468;
  --ink-3: #8691A6;
  --line: #E4E7F0;
  --line-2: #D3D8E6;

  --brand: #4F46E5;
  --brand-2: #06B6D4;
  --brand-ink: #4338CA;
  --brand-soft: #EEF0FF;
  --brand-grad: linear-gradient(135deg, #4F46E5 0%, #7C3AED 55%, #06B6D4 130%);

  --ok: #12A150;       --ok-soft: #DDF6E7;
  --sug: #D97706;      --sug-soft: #FFF1D6;
  --urg: #DC2626;      --urg-soft: #FEE4E2;
  --na: #98A2B3;
  --placa: #1D4ED8;

  --lateral-bg: #0B1020;
  --lateral-ink: #C7CEE0;
  --lateral-activo: rgba(124,131,255,0.16);

  --sombra-1: 0 1px 2px rgba(11,16,32,0.05), 0 2px 8px rgba(11,16,32,0.04);
  --sombra-2: 0 2px 4px rgba(11,16,32,0.05), 0 12px 32px rgba(11,16,32,0.09);
  --foco: 0 0 0 4px rgba(79,70,229,0.2);

  --letra: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --lateral-w: 268px;
  color-scheme: light;
}

:root[data-tema="oscuro"] {
  --bg: #090D19;
  --surface: #121829;
  --surface-2: #1A2136;
  --ink: #E9EDF7;
  --ink-2: #A7B0C6;
  --ink-3: #6F7B95;
  --line: #232B44;
  --line-2: #2F3958;

  --brand: #7C83FF;
  --brand-ink: #A9AEFF;
  --brand-soft: #1B2050;

  --ok: #34D27B;   --ok-soft: #0F2E20;
  --sug: #F5A524;  --sug-soft: #33260B;
  --urg: #F87171;  --urg-soft: #3A1517;
  --na: #6F7B95;
  --placa: #3B82F6;

  --lateral-bg: #060913;
  --lateral-activo: rgba(124,131,255,0.2);

  --sombra-1: 0 1px 2px rgba(0,0,0,0.4);
  --sombra-2: 0 2px 4px rgba(0,0,0,0.4), 0 12px 32px rgba(0,0,0,0.5);
  --foco: 0 0 0 4px rgba(124,131,255,0.3);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --bg: #090D19;
    --surface: #121829;
    --surface-2: #1A2136;
    --ink: #E9EDF7;
    --ink-2: #A7B0C6;
    --ink-3: #6F7B95;
    --line: #232B44;
    --line-2: #2F3958;
    --brand: #7C83FF;
    --brand-ink: #A9AEFF;
    --brand-soft: #1B2050;
    --ok: #34D27B;   --ok-soft: #0F2E20;
    --sug: #F5A524;  --sug-soft: #33260B;
    --urg: #F87171;  --urg-soft: #3A1517;
    --na: #6F7B95;
    --placa: #3B82F6;
    --lateral-bg: #060913;
    --lateral-activo: rgba(124,131,255,0.2);
    --sombra-1: 0 1px 2px rgba(0,0,0,0.4);
    --sombra-2: 0 2px 4px rgba(0,0,0,0.4), 0 12px 32px rgba(0,0,0,0.5);
    --foco: 0 0 0 4px rgba(124,131,255,0.3);
    color-scheme: dark;
  }
}

/* ===================== Base ===================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--letra); font-size: 1rem; line-height: 1.55;
  color: var(--ink); background: var(--bg); letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-ink); }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.025em; }
h1 { font-size: 1.85rem; font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 0.75rem; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.tenue { color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
.ico { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.contenedor > * { animation: entrar 0.35s ease both; }
.contenedor > *:nth-child(2) { animation-delay: 0.04s; }
.contenedor > *:nth-child(3) { animation-delay: 0.08s; }
.contenedor > *:nth-child(n+4) { animation-delay: 0.12s; }

/* ===================== Estructura: menú lateral + contenido ===================== */
body:has(> .lateral) { display: grid; grid-template-columns: var(--lateral-w) minmax(0, 1fr); min-height: 100vh; }
.lateral {
  position: sticky; top: 0; height: 100vh; z-index: 30;
  display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem 1rem;
  background: var(--lateral-bg); color: var(--lateral-ink);
  border-right: 1px solid rgba(255,255,255,0.05);
}
.lateral-cab { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.marca { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: #fff; min-width: 0; }
.marca:hover { color: #fff; }
.marca-logo {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto;
  background: var(--brand-grad); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,0.5);
}
.marca-logo .ico { width: 22px; height: 22px; }
.marca-texto { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.marca-texto b { font-weight: 800; font-size: 1rem; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marca-texto small { color: var(--lateral-ink); font-size: 0.75rem; opacity: 0.75; }
.lateral-movil { display: none; gap: 0.25rem; }
.btn-nuevo { width: 100%; }

.menu { display: flex; flex-direction: column; gap: 0.2rem; margin-top: 0.25rem; }
.menu-item {
  position: relative; display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.85rem;
  border-radius: 12px; color: var(--lateral-ink); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  transition: background-color 0.15s, color 0.15s;
}
.menu-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.menu-item.activo { background: var(--lateral-activo); color: #fff; }
.menu-item.activo::before {
  content: ""; position: absolute; left: -1rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0;
  background: var(--brand-grad);
}
.menu-item.activo .ico { color: #A9AEFF; }

.lateral-pie { margin-top: auto; display: flex; flex-direction: column; gap: 0.75rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.08); }
.usuario { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.avatar {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  font-weight: 800; color: #fff; background: var(--brand-grad);
}
.usuario-datos { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.usuario-datos b { color: #fff; font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usuario-datos small { color: var(--lateral-ink); opacity: 0.7; font-size: 0.78rem; }
.lateral-acciones { display: flex; gap: 0.4rem; }
.lateral-acciones form { margin: 0; }
.icono-btn {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; text-decoration: none;
  color: var(--lateral-ink); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  transition: background-color 0.15s, color 0.15s;
}
.icono-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
.ico-luna { display: none; }
:root[data-tema="oscuro"] .ico-sol { display: none; }
:root[data-tema="oscuro"] .ico-luna { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) .ico-sol { display: none; }
  :root:not([data-tema="claro"]) .ico-luna { display: block; }
}

.tabbar { display: none; }

/* ===================== Contenedores ===================== */
.contenedor { width: 100%; max-width: 1140px; margin: 0 auto; padding: 2rem 2rem 3.5rem; }
.contenedor-angosto { max-width: 680px; }
.contenedor-reporte { max-width: 900px; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 1.5rem; margin-bottom: 1rem; box-shadow: var(--sombra-1);
}
.bloque {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 1.5rem; margin-bottom: 1rem; box-shadow: var(--sombra-1);
}
.encabezado {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.5rem;
}
.encabezado h1 { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.encabezado p { margin: 0.35rem 0 0; }
.encabezado-acciones, .acciones-fila { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.acciones-fila form { margin: 0; }
.sobretitulo { margin: 0 0 0.3rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); }
.enlace-accion { display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.5rem; font-weight: 600; text-decoration: none; }
.enlace-accion:hover { text-decoration: underline; }

/* Barra pública (reporte del cliente) */
.barra {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.barra-interior { max-width: 900px; margin: 0 auto; padding: 0.75rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.barra-taller { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.barra-taller::before { content: ""; width: 30px; height: 30px; border-radius: 9px; background: var(--brand-grad); box-shadow: 0 4px 12px rgba(99,102,241,0.4); }
.barra-nav { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.barra-nav a:not(.btn) { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.barra-nav a:not(.btn):hover { color: var(--brand); }
.enlace { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* ===================== Botones ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0.55rem 1.1rem;
  font: 600 0.95rem/1.2 var(--letra); text-decoration: none; cursor: pointer; letter-spacing: -0.005em;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m);
  box-shadow: var(--sombra-1);
  transition: background-color 0.15s, border-color 0.15s, transform 0.08s, box-shadow 0.15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-primario {
  background: var(--brand-grad); border-color: transparent; color: #fff;
  box-shadow: 0 6px 18px rgba(79,70,229,0.35);
}
.btn-primario:hover { background: var(--brand-grad); filter: brightness(1.08); border-color: transparent; color: #fff; }
.btn-claro { background: transparent; color: var(--ink); border-color: var(--line-2); box-shadow: none; }
.btn-whatsapp { background: #16A34A; border-color: #16A34A; color: #fff; box-shadow: 0 4px 14px rgba(22,163,74,0.3); }
.btn-whatsapp:hover { background: #15803D; border-color: #15803D; color: #fff; }
.btn-bloque { width: 100%; }
.btn-icono { width: 34px; height: 34px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); color: var(--urg); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.btn-icono:hover { background: var(--urg-soft); }

/* ===================== Mensajes ===================== */
.mensajes { margin-bottom: 1rem; display: grid; gap: 0.5rem; }
.mensaje {
  display: flex; align-items: center; gap: 0.6rem; margin: 0; padding: 0.85rem 1.1rem;
  border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line);
  border-left: 5px solid var(--ink-3); box-shadow: var(--sombra-1); font-weight: 500;
  transition: opacity 0.4s, transform 0.4s;
}
.mensaje.se-va { opacity: 0; transform: translateY(-6px); }
.mensaje-success { border-left-color: var(--ok); background: var(--ok-soft); }
.mensaje-info { border-left-color: var(--brand); background: var(--brand-soft); }
.mensaje-warning { border-left-color: var(--sug); background: var(--sug-soft); }
.mensaje-error { border-left-color: var(--urg); background: var(--urg-soft); }

/* ===================== Formularios ===================== */
.formulario fieldset { margin: 0 0 1rem; }
.formulario legend, fieldset.panel > legend { font-weight: 700; font-size: 1.1rem; padding: 0 0.35rem; letter-spacing: -0.02em; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 1.1rem; }
.campo { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1.05rem; }
.campo-doble { grid-column: span 2; }
.campo > label, .campo > span, .etiqueta { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.opcional { font-weight: 400; color: var(--ink-3); }
input[type=text], input[type=search], input[type=email], input[type=number], input[type=password],
input[type=date], input[type=datetime-local], input:not([type]), select, textarea {
  width: 100%; min-height: 46px; padding: 0.6rem 0.85rem;
  font: 1rem/1.4 var(--letra); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: var(--foco); }
.campo-error input, .campo-error select { border-color: var(--urg); }
.error { color: var(--urg); font-weight: 500; }
.campo-placa input { font-family: var(--mono); font-weight: 700; font-size: 1.3rem; letter-spacing: 0.1em; text-transform: uppercase; }
.aviso-placa { margin: -0.25rem 0 0; color: var(--brand); font-weight: 500; }
.casillas { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.casilla {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0.35rem 0.9rem;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; font-weight: 500;
  transition: border-color 0.15s, background-color 0.15s;
}
.casilla:hover { border-color: var(--ink-3); }
.casilla:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.casilla input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.acciones { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.formulario .acciones { padding-top: 0.5rem; }

/* Control segmentado */
.segmentado { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.3rem; background: var(--surface-2); border-radius: var(--r-m); width: fit-content; max-width: 100%; }
.segmento { position: relative; }
.segmento input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmento span {
  display: flex; align-items: center; min-height: 40px; padding: 0.35rem 1rem; border-radius: 9px;
  font-weight: 600; font-size: 0.92rem; color: var(--ink-2); transition: background-color 0.15s, color 0.15s;
}
.segmento:hover span { color: var(--ink); }
.segmento input:checked + span { background: var(--surface); color: var(--brand-ink); box-shadow: var(--sombra-1); }
.segmento input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ===================== Panel de inicio ===================== */
.hero {
  position: relative; overflow: hidden; margin-bottom: 1.25rem; padding: 1.75rem 2rem; border-radius: var(--r-l);
  color: #fff; background: var(--brand-grad); box-shadow: 0 14px 40px rgba(79,70,229,0.3);
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,0.1); pointer-events: none; }
.hero::before { width: 260px; height: 260px; right: -60px; top: -110px; }
.hero::after { width: 160px; height: 160px; right: 150px; bottom: -90px; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: 1.9rem; color: #fff; }
.hero p { margin: 0.4rem 0 0; color: rgba(255,255,255,0.85); }
.hero .btn { background: #fff; color: var(--brand-ink); border-color: transparent; box-shadow: 0 6px 18px rgba(0,0,0,0.2); }
.hero .btn:hover { background: #fff; filter: brightness(0.96); color: var(--brand-ink); }

.tablero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; margin-bottom: 1rem; }
.tablero-celda {
  --color: var(--ink-3);
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 0 0.85rem; align-items: center;
  padding: 1rem 1.1rem; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sombra-1);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.tablero-celda:hover { transform: translateY(-3px); box-shadow: var(--sombra-2); color: var(--ink); }
.tablero-celda.activa { border-color: var(--color); box-shadow: 0 0 0 2px var(--color), var(--sombra-1); }
.tablero-celda .ico {
  grid-row: 1 / 3; width: 44px; height: 44px; padding: 11px; border-radius: 13px;
  color: var(--color); background: color-mix(in srgb, var(--color) 14%, transparent);
}
.tablero-n { font-weight: 800; font-size: 2rem; line-height: 1; letter-spacing: -0.04em; }
.tablero-celda > span:last-child { font-size: 0.85rem; color: var(--ink-2); font-weight: 500; }
.estado-borde-recibido { --color: #64748B; }
.estado-borde-inspeccion { --color: var(--brand); }
.estado-borde-reparacion { --color: var(--sug); }
.estado-borde-listo { --color: var(--ok); }

.insights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; margin-bottom: 1.25rem; }
.insight {
  display: flex; align-items: center; gap: 0.85rem; padding: 0.9rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--sombra-1);
}
.insight .ico { width: 38px; height: 38px; padding: 9px; border-radius: 11px; color: var(--brand); background: var(--brand-soft); }
.insight-urg .ico { color: var(--urg); background: var(--urg-soft); }
.insight-ok .ico { color: var(--ok); background: var(--ok-soft); }
.insight b { display: block; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.insight span { font-size: 0.82rem; color: var(--ink-2); }

.barra-busqueda { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.9rem; }
.buscador { position: relative; flex: 1 1 280px; }
.buscador .ico { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.buscador input { padding-left: 2.7rem; }
.pildoras { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.25rem; margin-bottom: 1rem; scrollbar-width: none; }
.pildoras::-webkit-scrollbar { display: none; }
.pildora {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.95rem; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: 0.88rem; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); transition: all 0.15s;
}
.pildora:hover { border-color: var(--brand); color: var(--brand); }
.pildora.activa { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* Filtros clásicos (búsqueda de clientes y nueva inspección) */
.filtros { display: flex; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filtros input { flex: 1 1 260px; }
.filtros select { flex: 0 0 150px; width: auto; }

/* ===================== Listas ===================== */
.tabla-inspecciones { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.fila-insp {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.95rem 1.15rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-m); color: inherit; text-decoration: none; box-shadow: var(--sombra-1);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.fila-insp:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--sombra-2); color: inherit; }
.fila-insp::after {
  content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-top: 2px solid var(--ink-3);
  transform: rotate(45deg); transition: transform 0.15s, border-color 0.15s; margin-left: -0.25rem;
}
.fila-insp:hover::after { border-color: var(--brand); transform: translateX(3px) rotate(45deg); }
.fila-principal { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.fila-insp .fila-meta, .fila-insp .fila-hallazgos, .fila-insp .estado-insp { flex: 0 0 auto; }
.fila-principal strong { font-weight: 700; }
.fila-meta { display: flex; flex-direction: column; font-size: 0.85rem; color: var(--ink-2); text-align: right; }
.fila-hallazgos { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.placa-mini {
  display: inline-block; padding: 0.15rem 0.6rem 0.1rem; border-radius: 6px; white-space: nowrap;
  font-family: var(--mono); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.06em;
  color: #0B1020; background: #fff; border: 2px solid #0B1020; border-top: 6px solid var(--placa);
}
.encabezado h1 .placa-mini { font-size: 1.15rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.18rem 0.65rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap;
}
.chip-urgente { background: var(--urg-soft); color: var(--urg); }
.chip-sugerida { background: var(--sug-soft); color: var(--sug); }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.estado-insp {
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 700;
  padding: 0.25rem 0.75rem; border-radius: 999px; white-space: nowrap;
}
.estado-insp::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.estado-recibido { background: var(--surface-2); color: var(--ink-2); }
.estado-inspeccion { background: var(--brand-soft); color: var(--brand-ink); }
.estado-reparacion { background: var(--sug-soft); color: var(--sug); }
.estado-listo { background: var(--ok-soft); color: var(--ok); }
.estado-entregado { background: var(--surface-2); color: var(--ink-3); }
.paginacion { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.vacio {
  text-align: center; padding: 3.5rem 1.5rem; background: var(--surface); color: var(--ink-2);
  border: 2px dashed var(--line-2); border-radius: var(--r-l);
}
.vacio p { font-size: 1.05rem; }

/* ===================== Clientes y vehículos ===================== */
.tipo-cliente {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; font-weight: 800;
  background: var(--brand-soft); color: var(--brand-ink);
}
.tipo-empresarial { background: var(--ink); color: var(--bg); }
.tarjetas-vehiculo { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.tarjeta-vehiculo, .resumen-vehiculo {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 0.9rem 1.1rem;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
}
.tarjeta-vehiculo { box-shadow: var(--sombra-1); }
.tv-texto { flex: 1 1 200px; display: flex; flex-direction: column; min-width: 0; }
.tv-acciones { display: flex; gap: 0.5rem; }
.resultado-cliente { padding: 1rem 0; border-top: 1px solid var(--line); }
.resultado-cliente:first-of-type { border-top: 0; padding-top: 0; }
.resultado-cliente header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.resultado-cliente header > div { display: flex; flex-direction: column; }
.resultado-cliente header .enlace-accion { margin: 0; }
.buscador-grande input { font-size: 1.15rem; min-height: 56px; border-radius: 14px; }
.proximo-servicio { color: var(--brand-ink); font-size: 0.92rem; }
.lista-simple { list-style: none; padding: 0; margin: 0.75rem 0; }
.lista-simple li { padding: 0.3rem 0; }

.ficha { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.1rem 1.5rem; margin: 0; }
.ficha dt { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.ficha dd { margin: 0.2rem 0 0; font-weight: 600; }
.ficha-ancha { grid-column: 1 / -1; }
.ficha-ancha dd { font-weight: 400; }

/* ===================== Avisos de WhatsApp ===================== */
.avisos { margin-bottom: 1.25rem; }
.avisos-titulo { font-size: 1.05rem; margin-bottom: 0.6rem; }
.aviso {
  display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 0.95rem 1.1rem; margin-bottom: 0.6rem; background: var(--ok-soft);
  border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); border-left: 5px solid var(--ok); border-radius: var(--r-m);
}
.aviso-error { background: var(--urg-soft); border-color: color-mix(in srgb, var(--urg) 30%, transparent); border-left-color: var(--urg); }
.aviso-texto { flex: 1 1 320px; display: flex; flex-direction: column; }
.aviso-texto p { margin: 0.3rem 0 0; font-size: 0.92rem; }
.aviso-acciones { display: flex; gap: 0.5rem; align-items: center; font-weight: 600; color: var(--ok); flex-wrap: wrap; }
.aviso-acciones form { margin: 0; }
.aviso-enviado { opacity: 0.55; }

/* ===================== Checklist del técnico ===================== */
.con-barra-inferior main { padding-bottom: 9rem; }
.indice {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 0.4rem; overflow-x: auto; margin: 0 -2rem 1.25rem; padding: 0.7rem 2rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); scrollbar-width: none;
}
.indice::-webkit-scrollbar { display: none; }
.indice a {
  flex: 0 0 auto; padding: 0.45rem 0.9rem; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 0.9rem;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); transition: all 0.15s;
}
.indice a:hover { border-color: var(--brand); color: var(--brand); }
.grupo { margin-bottom: 0.85rem; scroll-margin-top: 4.5rem; }
.item {
  margin: 0 0 0.7rem; padding: 1rem 1.1rem; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--ok); border-radius: var(--r-m);
  transition: border-color 0.2s, background-color 0.2s;
}
.item.estado-sugerida { border-left-color: var(--sug); }
.item.estado-urgente { border-left-color: var(--urg); background: color-mix(in srgb, var(--urg) 5%, var(--surface)); }
.item.estado-na { border-left-color: var(--na); }
.item.estado-na .item-nombre { color: var(--ink-3); }
.item-nombre { float: left; width: 100%; padding: 0; margin-bottom: 0.7rem; font-weight: 700; font-size: 1.05rem; }
.item-nombre + * { clear: both; }
.selector { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; padding: 0.3rem; background: var(--surface-2); border-radius: var(--r-m); }
.opcion { position: relative; }
.opcion input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opcion span {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0.25rem;
  border: 1px solid transparent; border-radius: 9px; font-weight: 700; font-size: 0.9rem;
  color: var(--ink-2); text-align: center; transition: all 0.12s;
}
.opcion:hover span { background: var(--surface); }
.opcion input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.opcion-ok input:checked + span { background: var(--ok); color: #fff; box-shadow: 0 4px 12px rgba(18,161,80,0.35); }
.opcion-sugerida input:checked + span { background: var(--sug); color: #fff; box-shadow: 0 4px 12px rgba(217,119,6,0.35); }
.opcion-urgente input:checked + span { background: var(--urg); color: #fff; box-shadow: 0 4px 12px rgba(220,38,38,0.35); }
.opcion-na input:checked + span { background: var(--na); color: #fff; }
.datos-extra { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0 0.7rem; margin-top: 0.85rem; }
.datos-extra .campo { margin-bottom: 0.25rem; }
.datos-extra .campo span { font-size: 0.8rem; color: var(--ink-2); }
.notas { margin-top: 0.7rem; }
.notas summary { cursor: pointer; color: var(--brand); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.notas[open] summary { margin-bottom: 0.5rem; }
.notas .campo { margin-bottom: 0.5rem; }
.miniaturas { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.6rem; }
.miniatura { margin: 0; width: 96px; }
.miniatura img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r-s); border: 1px solid var(--line); }
.miniatura .borrar { display: flex; gap: 0.25rem; align-items: center; font-size: 0.82rem; color: var(--urg); margin-top: 0.25rem; cursor: pointer; }
.subir {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.7rem 0.9rem;
  border: 2px dashed var(--line-2); border-radius: var(--r-m); cursor: pointer; background: var(--surface-2);
  transition: border-color 0.15s, background-color 0.15s;
}
.subir:hover { border-color: var(--brand); background: var(--brand-soft); }
.subir input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.subir span { font-weight: 600; color: var(--brand); }
.subir:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }
.subir-grande { padding: 1.6rem; justify-content: center; }
.subir-grande span { font-size: 1.1rem; }
.barra-inferior {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.8rem 1.25rem calc(0.8rem + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); box-shadow: 0 -10px 30px rgba(11,16,32,0.1);
}
body:has(> .lateral) .barra-inferior { left: var(--lateral-w); }
.resumen-vivo { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0; }
.barra-inferior-acciones { display: flex; gap: 0.5rem; margin-left: auto; }

/* Acordeones del checklist */
.acordeon { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); margin-bottom: 0.85rem; scroll-margin-top: 4.5rem; box-shadow: var(--sombra-1); overflow: hidden; }
.acordeon > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; cursor: pointer; list-style: none; min-height: 60px; }
.acordeon > summary:hover { background: var(--surface-2); }
.acordeon > summary::-webkit-details-marker { display: none; }
.acordeon > summary::after {
  content: ""; flex: 0 0 auto; width: 9px; height: 9px; margin-left: 0.25rem;
  border-right: 2.5px solid var(--ink-3); border-bottom: 2.5px solid var(--ink-3); transform: rotate(45deg); transition: transform 0.2s;
}
.acordeon[open] > summary::after { transform: rotate(-135deg); }
.acordeon[open] > summary { border-bottom: 1px solid var(--line); }
.acordeon-titulo { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; flex: 1; }
.acordeon-chips { display: flex; align-items: center; gap: 0.4rem; }
.acordeon-cuerpo { padding: 1rem; }
.acordeon .item:last-child { margin-bottom: 0; }

/* ===================== Reporte (cliente e interno) ===================== */
.ficha-orden {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 0.75rem 1.75rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--sombra-1); overflow: hidden;
}
.ficha-orden::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--brand-grad); }
.ficha-orden h3 { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin: 0 0 0.2rem; }
.ficha-orden p { margin: 0; font-weight: 600; }
.fo-fila { display: grid; gap: 1rem; padding: 1.15rem 0; border-bottom: 1px solid var(--line); }
.fo-tres { grid-template-columns: 2fr 1fr 1fr; }
.fo-dos { grid-template-columns: 1fr 1fr; border-bottom: 0; padding-bottom: 0; }
.fo-vehiculo { display: grid; grid-template-columns: 280px 1fr; gap: 1.75rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.fo-estado { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; }
.fo-estado .placa { min-width: 0; width: 100%; }
.fo-estado .placa-numero { font-size: 2.3rem; }
.fo-estado-titulo { margin: 0.3rem 0 0 !important; font-size: 0.75rem !important; font-weight: 700 !important; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3) !important; }
.fo-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; align-content: start; }
.fo-datos > div { padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.fo-datos h3 { text-transform: none; letter-spacing: 0; font-size: 0.8rem; }
.fo-galeria-motivos { grid-template-columns: 3fr 2fr; align-items: start; }
.fo-galeria-motivos .fotos-galeria { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.tabla-motivos { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.tabla-motivos th { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); padding: 0.6rem 0.85rem; text-align: left; background: var(--surface-2); }
.tabla-motivos td { padding: 0.55rem 0.85rem; border-top: 1px solid var(--line); }
.estado-grande { display: inline-block; min-width: 70%; padding: 0.4rem 1rem; border-radius: 999px; font-weight: 700; font-size: 0.92rem; }
.estado-grande.estado-entregado { background: var(--brand-soft); color: var(--brand-ink); }
.estado-grande::before { display: none; }

.placa {
  display: flex; flex-direction: column; align-items: stretch; overflow: hidden;
  background: #fff; border: 3px solid #0B1020; border-radius: 12px; min-width: 13.5rem;
  box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px #D3D8E6, var(--sombra-1);
}
.placa-pais {
  background: var(--placa); color: #fff; text-align: center; font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.35em; padding: 0.2rem 0 0.15rem 0.35em;
}
.placa-numero {
  font-family: var(--mono); font-weight: 700; font-size: 3rem; line-height: 1; letter-spacing: 0.06em;
  text-align: center; padding: 0.4rem 0.8rem 0.5rem; color: #0B1020;
}
.tanque { display: inline-flex; gap: 3px; vertical-align: middle; }
.tanque i { width: 12px; height: 18px; border-radius: 3px; background: var(--line-2); }
.tanque i.lleno { background: var(--brand); }

/* Pasos del estado */
.pasos { list-style: none; margin: 0; padding: 0; display: flex; width: 100%; }
.paso { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; min-width: 0; }
.paso::before { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 4px; border-radius: 4px; background: var(--line-2); z-index: 0; }
.paso:first-child::before { display: none; }
.paso-hecho::before, .paso-actual::before { background: var(--brand); }
.paso-punto {
  position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--line-2);
}
.paso-hecho .paso-punto { background: var(--brand); border-color: var(--brand); }
.paso-hecho .paso-punto::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 9px; border-right: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(40deg); }
.paso-actual .paso-punto { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 25%, transparent); }
.paso-actual .paso-punto::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--brand); }
.paso-etiqueta { font-size: 0.72rem; line-height: 1.15; color: var(--ink-3); text-align: center; font-weight: 500; }
.paso-actual .paso-etiqueta { color: var(--ink); font-weight: 700; }

/* Conteo y acordeones de color */
.conteo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; margin: 1.25rem 0 1rem; text-align: center; }
.conteo div { display: flex; flex-direction: column; padding: 1rem 0.5rem; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sombra-1); border-top: 5px solid; }
.conteo strong { font-weight: 800; font-size: 2.4rem; line-height: 1.1; letter-spacing: -0.04em; }
.conteo span { font-size: 0.85rem; color: var(--ink-2); }
.conteo-ok { border-top-color: var(--ok) !important; } .conteo-ok strong { color: var(--ok); }
.conteo-sugerida { border-top-color: var(--sug) !important; } .conteo-sugerida strong { color: var(--sug); }
.conteo-urgente { border-top-color: var(--urg) !important; } .conteo-urgente strong { color: var(--urg); }
.acordeon-reporte { margin-bottom: 0.6rem; border-radius: var(--r-m); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sombra-1); }
.acordeon-reporte > summary {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1.1rem; cursor: pointer; list-style: none;
  font-weight: 700; font-size: 1.02rem; min-height: 52px; border-left: 6px solid var(--ink-3);
}
.acordeon-reporte > summary b { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 0.4rem; border-radius: 999px; font-size: 0.82rem; color: #fff; background: var(--ink-3); }
.acordeon-reporte > summary::-webkit-details-marker { display: none; }
.acordeon-reporte > summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2.5px solid var(--ink-3); border-bottom: 2.5px solid var(--ink-3); transform: rotate(45deg); transition: transform 0.2s; }
.acordeon-reporte[open] > summary::after { transform: rotate(-135deg); }
.ar-ok > summary { border-left-color: var(--ok); } .ar-ok > summary b { background: var(--ok); }
.ar-sugerida > summary { border-left-color: var(--sug); } .ar-sugerida > summary b { background: var(--sug); }
.ar-urgente > summary { border-left-color: var(--urg); } .ar-urgente > summary b { background: var(--urg); }
.ar-neutro > summary { border-left-color: var(--brand); }
.acordeon-reporte .acordeon-cuerpo { padding: 1.1rem; border-top: 1px solid var(--line); }

.hallazgo { border: 1px solid var(--line); border-left: 6px solid var(--urg); border-radius: var(--r-m); padding: 1rem 1.1rem; margin-bottom: 0.75rem; background: var(--surface); }
.hallazgo-sugerida { border-left-color: var(--sug); }
.hallazgo header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.45rem; flex-wrap: wrap; }
.hallazgo-estado { font-size: 0.75rem; font-weight: 700; color: #fff; background: var(--urg); padding: 0.15rem 0.65rem; border-radius: 999px; }
.hallazgo-sugerida .hallazgo-estado { background: var(--sug); }
.hallazgo p { margin: 0 0 0.5rem; }
.datos-item { display: block; color: var(--ink-2); font-size: 0.92rem; }
.sin-hallazgos { color: var(--ok); font-weight: 600; margin: 0; }
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.5rem; }
.fotos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-s); background: var(--surface-2); border: 1px solid var(--line); transition: transform 0.15s; }
.fotos a:hover img { transform: scale(1.03); }
.fotos-galeria { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.fotos-mini { display: flex; gap: 0.35rem; margin-top: 0.35rem; }
.fotos-mini img { width: 64px; height: 48px; aspect-ratio: auto; }

.llantas { display: grid; grid-template-columns: 180px 1fr; gap: 1.5rem; align-items: center; }
.auto { width: 100%; max-width: 220px; height: auto; }
.auto .carroceria { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 2; }
.auto .vidrio { fill: var(--line-2); }
.auto text { font: 600 12px var(--letra); fill: var(--ink); }
.auto .auto-frente { font-size: 11px; fill: var(--ink-3); font-weight: 500; }
.llanta { stroke: var(--ink); stroke-width: 1.5; }
.llanta-ok { fill: var(--ok); } .llanta-sugerida { fill: var(--sug); } .llanta-urgente { fill: var(--urg); } .llanta-na { fill: var(--na); }
.tabla-desplazable { overflow-x: auto; }
.tabla-llantas { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.tabla-llantas th, .tabla-llantas td { padding: 0.6rem 0.5rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabla-llantas thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 700; }
.tabla-llantas tbody th { font-weight: 600; }
.punto { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.5rem; vertical-align: 0.05em; background: var(--na); }
.punto-ok { background: var(--ok); } .punto-sugerida { background: var(--sug); } .punto-urgente { background: var(--urg); }

.correctos { columns: 2 260px; column-gap: 2rem; }
.correctos-grupo { break-inside: avoid; margin-bottom: 1.1rem; }
.correctos-grupo h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 0.35rem; }
.correctos ul { list-style: none; margin: 0; padding: 0; }
.correctos li { padding: 0.35rem 0 0.35rem 1.7rem; position: relative; border-bottom: 1px solid var(--line); }
.correctos li::before { content: ""; position: absolute; left: 0.2rem; top: 0.72rem; width: 0.75rem; height: 0.4rem; border-left: 2.5px solid var(--ok); border-bottom: 2.5px solid var(--ok); transform: rotate(-45deg); }
.correctos li small { display: block; color: var(--ink-2); }
.proxima { margin-top: 1.25rem; padding: 1.1rem 1.25rem; border-radius: var(--r-m); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); }
.proxima p { margin: 0; color: var(--ink-2); font-size: 0.92rem; }
.proxima strong { display: block; font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.proxima small { color: var(--ink-2); }
.pie-reporte { text-align: center; color: var(--ink-3); font-size: 0.88rem; padding: 1.25rem; }

/* Línea de tiempo */
.linea-tiempo { list-style: none; margin: 0; padding: 0 0 0 1.25rem; border-left: 3px solid var(--line); }
.linea-tiempo li { position: relative; padding: 0 0 1.1rem 0.6rem; }
.linea-tiempo li::before { content: ""; position: absolute; left: -1.25rem; top: 0.3rem; width: 13px; height: 13px; margin-left: -8px; border-radius: 50%; background: var(--na); border: 3px solid var(--surface); }
.linea-tiempo li:first-child::before { background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent); }
.linea-tiempo time { display: block; font-size: 0.82rem; color: var(--ink-3); }
.linea-tiempo p { margin: 0.15rem 0 0; color: var(--ink-2); }

/* Panel de estado (interno) */
.panel-estado h1 { margin-bottom: 0.75rem; }
.pe-cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.panel-estado .pasos { margin: 0.75rem 0 1.5rem; }
.pe-form { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.pe-pie { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.pe-pie form { margin: 0; }
.compartir { border-top: 1px solid var(--line); margin-top: 1.25rem; padding-top: 1.25rem; }
.compartir p { margin-bottom: 0.75rem; }
.compartir-fila { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.35rem; }
.compartir-fila input { flex: 1 1 260px; margin: 0; font-family: var(--mono); font-size: 0.85rem; }
.enlace-vigencia { margin: 0.6rem 0; font-size: 0.88rem; }
.compartir form { margin: 0; }
.enlace-publico { color: var(--ink-2); }

/* Orden de trabajo */
.tabla-lineas { width: 100%; border-collapse: collapse; font-size: 0.93rem; margin-bottom: 1rem; }
.tabla-lineas th, .tabla-lineas td { padding: 0.65rem 0.55rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabla-lineas thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); font-weight: 700; white-space: nowrap; }
.tabla-lineas td small { display: block; }
.tabla-lineas .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabla-lineas tfoot th { text-align: right; font-weight: 500; color: var(--ink-2); border-bottom: 0; padding: 0.3rem 0.55rem; }
.tabla-lineas tfoot td { border-bottom: 0; padding: 0.3rem 0.55rem; }
.tabla-lineas .fila-total th, .tabla-lineas .fila-total td { font-weight: 800; color: var(--ink); font-size: 1.15rem; border-top: 2px solid var(--ink); padding-top: 0.6rem; }
.form-linea { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.form-linea .campo { margin-bottom: 0.8rem; }
.documento { background: #fff; color: #0B1020; border: 1px solid var(--line); border-radius: var(--r-l); padding: 2rem; box-shadow: var(--sombra-1); }
.documento h2 { font-size: 1.2rem; margin: 1.25rem 0 0.5rem; }
.documento .tenue, .documento .tabla-lineas thead th { color: #4A5468; }
.documento .tabla-lineas th, .documento .tabla-lineas td { border-color: #E4E7F0; }
.doc-cabecera { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 2px solid #0B1020; }
.doc-cabecera p { margin: 0.25rem 0 0; }
.doc-numero { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.doc-numero strong { font-size: 2rem; line-height: 1; font-weight: 800; }
.doc-nota { margin-top: 1rem; font-size: 0.85rem; color: #4A5468; }
.firmas { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 4rem; }
.firmas div { border-top: 1px solid #0B1020; padding-top: 0.3rem; text-align: center; font-size: 0.9rem; color: #4A5468; }

/* ===================== Estadísticas ===================== */
.est-fechas { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1.25rem; }
.est-fechas .campo { margin-bottom: 0; }
.est-fechas input { min-height: 42px; }
.kpis-est { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.85rem; margin-bottom: 1.25rem; }
.kpi { display: flex; flex-direction: column; gap: 0.2rem; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sombra-1); }
.kpi-titulo { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.kpi-valor { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.15; }
.kpi-valor small { font-size: 0.9rem; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.kpi-delta { font-size: 0.82rem; font-weight: 700; color: var(--ink-3); }
.kpi-delta small { font-weight: 500; color: var(--ink-3); }
.kpi-delta.sube { color: var(--ok); }
.kpi-delta.baja { color: var(--urg); }
.est-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.75rem 2rem; }
.est-ancho { grid-column: 1 / -1; }
.est-sub { font-size: 0.95rem; margin-bottom: 0.6rem; display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.est-sub .enlace-accion, .bloque h2 .enlace-accion { margin: 0 0 0 0.6rem; font-size: 0.82rem; font-weight: 600; letter-spacing: 0; }
.est-nota { font-size: 0.85rem; margin-bottom: 0.75rem; }
.est-bien { color: var(--ok); font-weight: 600; }
.est-inline { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.9rem; }
.est-inline label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; }
.est-inline input[type=number] { width: 5rem; min-height: 38px; padding: 0.3rem 0.5rem; }

.grafica { --barra: var(--brand); display: flex; align-items: flex-end; gap: 4px; height: 190px; padding-top: 0.5rem; border-bottom: 1px solid var(--line-2); }
.grafica.verde { --barra: var(--ok); }
.grafica.morada { --barra: #7C3AED; }
.grafica-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.grafica-barra { display: block; width: 100%; max-width: 38px; min-height: 0; border-radius: 6px 6px 0 0; background: var(--barra); opacity: 0.88; transition: opacity 0.15s; }
.grafica-col:hover .grafica-barra { opacity: 1; }
.grafica-col small { position: absolute; top: 100%; margin-top: 4px; font-size: 0.68rem; color: var(--ink-3); white-space: nowrap; }
.grafica { margin-bottom: 1.5rem; }

.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.rank li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; font-size: 0.92rem; }
.rank-nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-barra { display: block; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.rank-barra i { display: block; height: 100%; border-radius: 999px; background: var(--brand-grad); }
.rank b { font-variant-numeric: tabular-nums; min-width: 2.5rem; text-align: right; }
.conv { margin-bottom: 1rem; }
.conv-cab { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.35rem; font-size: 0.92rem; }
.conv-urgente { background: var(--urg) !important; }
.conv-sugerida { background: var(--sug) !important; }
.etapas { list-style: none; margin: 0; padding: 0; }
.etapas li { display: flex; justify-content: space-between; padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.etapas li:last-child { border-bottom: 0; }
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.85rem; margin-bottom: 1.25rem; }
.mini-kpis div { padding: 0.9rem 1rem; background: var(--surface-2); border-radius: var(--r-m); display: flex; flex-direction: column; }
.mini-kpis b { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.mini-kpis b.rojo { color: var(--urg); }
.mini-kpis span { font-size: 0.82rem; color: var(--ink-2); }

/* ===================== Logo del taller ===================== */
.marca-logo-img { object-fit: contain; background: #fff; padding: 4px; box-shadow: none; }
.barra-logo { height: 30px; width: auto; max-width: 140px; object-fit: contain; border-radius: 6px; }
.barra-taller.con-logo::before { display: none; }
.doc-logo { display: block; max-height: 64px; max-width: 220px; object-fit: contain; margin-bottom: 0.5rem; }
.logo-actual { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.logo-vista { width: 96px; height: 96px; flex: 0 0 auto; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); padding: 6px; }
.logo-vacio { display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); }
.logo-vacio .ico { width: 36px; height: 36px; }
.logo-actual > div { flex: 1 1 260px; }

/* ===================== WhatsApp ===================== */
.wa-estado { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.qr-caja { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; }
.qr-img { background: #fff; padding: 12px; border-radius: var(--r-m); border: 1px solid var(--line); width: 260px; height: 260px; image-rendering: pixelated; }
.separador { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); padding: 0.1em 0.4em; border-radius: 6px; }

/* ===================== Visor de fotos ===================== */
.visor { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0; border: 0; background: rgba(8,11,22,0.95); color: #fff; }
.visor::backdrop { background: rgba(8,11,22,0.95); backdrop-filter: blur(6px); }
.visor[open] { display: flex; align-items: center; justify-content: center; }
.visor-marco { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 3.5rem 4rem calc(1rem + env(safe-area-inset-bottom, 0px)); }
.visor-img { max-width: 100%; max-height: calc(100% - 2.5rem); object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.visor-pie { margin-top: 0.7rem; color: #CBD2E4; font-size: 0.95rem; text-align: center; }
.visor-btn { position: absolute; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.14); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; transition: background-color 0.15s; }
.visor-btn:hover { background: rgba(255,255,255,0.28); }
.visor-cerrar { top: calc(0.75rem + env(safe-area-inset-top, 0px)); right: 0.75rem; }
.visor-ant { left: 0.75rem; top: 50%; transform: translateY(-50%); }
.visor-sig { right: 0.75rem; top: 50%; transform: translateY(-50%); }
a[data-visor] { cursor: zoom-in; }

/* ===================== Inicio de sesión ===================== */
body:has(.login-grid) { background: var(--bg); }
.login-pagina { padding: 0; max-width: none; }
.login-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 3rem; color: #fff; background: var(--brand-grad);
}
.login-hero::before, .login-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,0.1); pointer-events: none; }
.login-hero::before { width: 480px; height: 480px; right: -160px; top: -160px; }
.login-hero::after { width: 320px; height: 320px; left: -100px; bottom: -120px; }
.login-hero > * { position: relative; z-index: 1; }
.login-marca { display: flex; align-items: center; gap: 0.8rem; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.login-marca .marca-logo { background: rgba(255,255,255,0.2); box-shadow: none; backdrop-filter: blur(8px); }
.login-hero h2 { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.08; margin-bottom: 1rem; }
.login-hero p { font-size: 1.1rem; opacity: 0.9; max-width: 30rem; }
.login-puntos { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; gap: 0.85rem; }
.login-puntos li { display: flex; align-items: center; gap: 0.75rem; font-weight: 500; }
.login-puntos .ico { width: 36px; height: 36px; padding: 8px; border-radius: 11px; background: rgba(255,255,255,0.18); }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-caja { width: 100%; max-width: 400px; }
.login-caja h1 { font-size: 2rem; margin-bottom: 0.4rem; }
.login-caja .campo { margin-bottom: 1.15rem; }
.login-caja .btn-primario { min-height: 50px; font-size: 1.02rem; }
.login-pie { margin-top: 1.5rem; text-align: center; color: var(--ink-3); font-size: 0.85rem; }

/* ===================== Móvil y tablet ===================== */
@media (max-width: 1100px) {
  .tablero { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 959px) {
  body:has(> .lateral) { display: block; }
  .lateral {
    position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; gap: 0.5rem;
    padding: calc(0.6rem + env(safe-area-inset-top, 0px)) 1rem 0.6rem; border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .lateral-cab { flex: 1; }
  .lateral-movil { display: flex; }
  .lateral .btn-nuevo, .lateral .menu, .lateral .lateral-pie { display: none; }
  .marca-logo { width: 34px; height: 34px; border-radius: 10px; }
  .marca-texto small { display: none; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr); align-items: end;
    padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(11,16,32,0.08);
  }
  .tab, .tab-form button.tab {
    display: flex; flex-direction: column; align-items: center; gap: 0.15rem; padding: 0.45rem 0.25rem; border: 0; background: none;
    color: var(--ink-3); text-decoration: none; font: 600 0.7rem/1.1 var(--letra); cursor: pointer; width: 100%;
  }
  .tab .ico { width: 23px; height: 23px; }
  .tab.activo { color: var(--brand); }
  .tab-form { margin: 0; }
  .tabbar-simple { grid-template-columns: repeat(2, 1fr); }
  .tab-nuevo { margin-top: -1.35rem; color: var(--ink-2); }
  .tab-fab {
    display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; color: #fff;
    background: var(--brand-grad); box-shadow: 0 8px 22px rgba(79,70,229,0.5); border: 4px solid var(--bg);
  }
  .tab-fab .ico { width: 26px; height: 26px; }
  .tab-nuevo.activo { color: var(--brand); }
  body:has(> .lateral) main { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px)); }
  .con-barra-inferior .tabbar { display: none; }
  .con-barra-inferior main { padding-bottom: 9rem; }
  body:has(> .lateral) .barra-inferior { left: 0; }

  .contenedor { padding: 1.25rem 1rem 3rem; }
  .indice { margin: 0 -1rem 1rem; padding: 0.6rem 1rem; top: calc(58px + env(safe-area-inset-top, 0px)); }
  .login-grid { grid-template-columns: 1fr; }
  .login-hero { padding: 2rem 1.5rem; min-height: 0; gap: 1.5rem; }
  .login-hero h2 { font-size: 1.8rem; }
  .login-puntos { display: none; }
}
@media (max-width: 720px) {
  h1 { font-size: 1.55rem; }
  .hero { padding: 1.25rem; }
  .hero h1 { font-size: 1.5rem; }
  .tablero { gap: 0.6rem; }
  .tablero-celda { padding: 0.8rem; gap: 0 0.6rem; }
  .tablero-celda .ico { width: 38px; height: 38px; padding: 9px; }
  .tablero-n { font-size: 1.65rem; }
  .kpis-est, .mini-kpis { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .kpi { padding: 0.85rem 0.9rem; }
  .kpi-valor { font-size: 1.45rem; }
  .est-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .rank li { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) auto; gap: 0.5rem; }
  .insights { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .insight { flex-direction: column; align-items: flex-start; gap: 0.35rem; padding: 0.75rem; }
  .insight .ico { width: 30px; height: 30px; padding: 7px; }
  .insight b { font-size: 1.3rem; }
  .insight span { font-size: 0.72rem; line-height: 1.25; display: block; }
  .fila-insp { flex-wrap: wrap; gap: 0.4rem 0.75rem; }
  .fila-insp::after { display: none; }
  .fila-insp .fila-meta { flex-direction: row; gap: 0.75rem; text-align: left; flex: 1 1 100%; order: 5; }
  .fila-insp .fila-hallazgos { justify-content: flex-start; flex: 1 1 100%; order: 6; }
  .fila-insp .fila-hallazgos:empty { display: none; }
  .campo-doble { grid-column: auto; }
  .panel, .bloque { padding: 1.1rem; border-radius: var(--r-m); }
  .ficha-orden { padding: 0.5rem 1.1rem 1rem; }
  .fo-tres { grid-template-columns: 1fr 1fr; }
  .fo-tres > div:first-child { grid-column: 1 / -1; }
  .fo-vehiculo { grid-template-columns: 1fr; }
  .fo-galeria-motivos, .fo-dos { grid-template-columns: 1fr; }
  .placa-numero { font-size: 2.5rem; }
  .paso-etiqueta { font-size: 0.66rem; }
  .conteo { gap: 0.5rem; }
  .conteo strong { font-size: 1.9rem; }
  .conteo span { font-size: 0.75rem; }
  .barra-inferior .resumen-vivo { width: 100%; }
  .barra-inferior-acciones { width: 100%; }
  .barra-inferior-acciones .btn { flex: 1; }
  .ficha { grid-template-columns: 1fr 1fr; gap: 0.85rem 1rem; }
  .encabezado-acciones .btn { flex: 1; }
  .visor-marco { padding: 3.5rem 0.5rem 1rem; }
  .visor-ant, .visor-sig { top: auto; bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)); transform: none; }
  .tv-acciones { width: 100%; }
  .tv-acciones .btn { flex: 1; }
  .login-form { padding: 1.5rem 1.25rem 2.5rem; }
}
@media (max-width: 900px) {
  .llantas { grid-template-columns: 1fr; justify-items: center; }
  .llantas .tabla-desplazable { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ===================== Impresión (siempre en claro) ===================== */
@media print {
  :root, :root[data-tema="oscuro"] {
    --bg: #fff; --surface: #fff; --surface-2: #F4F5F9; --ink: #0B1020; --ink-2: #4A5468; --ink-3: #6B7488;
    --line: #D9DDE8; --line-2: #BFC5D4; --brand: #4F46E5; --brand-soft: #EEF0FF; --brand-ink: #4338CA;
    --ok: #12A150; --ok-soft: #DDF6E7; --sug: #D97706; --sug-soft: #FFF1D6; --urg: #DC2626; --urg-soft: #FEE4E2;
    color-scheme: light;
  }
  body, body:has(> .lateral) { display: block; background: #fff; font-size: 11pt; }
  .lateral, .tabbar, .barra .barra-nav, .no-imprimir, .mensajes, .barra-inferior { display: none !important; }
  .barra { position: static; backdrop-filter: none; background: #fff; border-bottom: 2px solid #0B1020; }
  .contenedor { padding: 0.5rem 0; max-width: none; }
  .contenedor > * { animation: none; }
  .panel, .bloque, .ficha-orden, .hallazgo, .acordeon-reporte, .conteo div, .documento { box-shadow: none; break-inside: avoid; border-color: #ccc; }
  .acordeon-reporte > .acordeon-cuerpo { display: block !important; }
  .visor { display: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
  .documento { border: 0; padding: 0; }
}
