/* Layout: menú lateral fijo (escritorio) / barra inferior (celular) + contenido en tarjetas blancas sobre fondo gris claro */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e7eaf3;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: #eef0ff;
  --contado: #059669;
  --contado-soft: #e6f6ef;
  --credito: #b45309;
  --credito-soft: #fdf1df;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --sombra: 0 1px 2px rgba(17, 24, 39, .04), 0 6px 20px rgba(17, 24, 39, .05);
  --radio: 16px;
  --lateral: 248px;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.45;
}
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Marca ---------- */
.marca-bloque { display: flex; align-items: center; gap: 10px; }
.marca-bloque strong { display: block; font-weight: 800; letter-spacing: -.01em; }
.marca-bloque small { display: block; font-size: .75rem; color: var(--muted); }
.logo-rp {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; font-weight: 800; font-size: .9rem; letter-spacing: .02em;
}

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: var(--lateral) minmax(0, 1fr); min-height: 100vh; }
.lateral {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 18px;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 14px 16px max(14px, env(safe-area-inset-left, 0px));
}
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-seccion { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #a0a6b8; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: #374151; text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--bg); }
.nav a.activo { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; box-shadow: 0 6px 16px rgba(79, 70, 229, .3); }
.usuario-bloque { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.chip-rol { justify-self: start; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--bg); color: var(--muted); padding: 3px 10px; border-radius: 999px; }
.usuario-fila { display: flex; align-items: center; gap: 10px; min-width: 0; }
.usuario-txt { min-width: 0; flex: 1; }
.usuario-txt strong, .usuario-txt small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usuario-txt strong { font-size: .85rem; }
.usuario-txt small { font-size: .72rem; color: var(--muted); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; font-size: .9rem;
}
.avatar.mini { width: 24px; height: 24px; border-radius: 7px; font-size: .72rem; }
.icono-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 10px; display: grid; place-items: center; }
.icono-btn:hover { background: var(--bg); color: var(--ink); }

.principal { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) 12px 24px;
  background: rgba(244, 246, 251, .88); backdrop-filter: blur(10px);
}
.top-derecha { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.en-vivo { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; color: var(--contado); }
.en-vivo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: latido 1.6s infinite; }
.usuario-pill {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 14px; box-shadow: var(--sombra);
  padding: 6px 14px 6px 6px; max-width: 280px;
}
.usuario-pill .avatar { width: 34px; height: 34px; border-radius: 10px; }
.usuario-pill-txt { display: grid; min-width: 0; line-height: 1.15; }
.usuario-pill-txt strong { font-size: .9rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usuario-pill-txt small { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empresa-sel { display: flex; align-items: center; gap: 6px; color: var(--muted); background: var(--surface); border-radius: 12px; padding: 4px 4px 4px 10px; box-shadow: var(--sombra); }
.empresa-sel select { border: 0; width: auto; max-width: 220px; padding: 6px 4px; font-size: .85rem; font-weight: 600; background: transparent; }
.campana { position: relative; color: #4b5563; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; }
.campana:hover { background: var(--surface); }
.burbuja {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg);
}
.empresa-pill {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 14px; box-shadow: var(--sombra);
  padding: 7px 12px; font-weight: 600; font-size: .9rem; max-width: 300px;
}
.empresa-pill #empresa-nombre { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empresa-pill select { border: 0; padding: 2px 4px; width: auto; max-width: 240px; font-weight: 600; background: transparent; }

.vista {
  width: 100%; max-width: 1280px; margin: 0 auto;
  padding: 8px max(24px, env(safe-area-inset-right, 0px)) 96px 24px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start;
}
.vista > * { min-width: 0; }
.vista.entra { animation: aparecer .22s ease-out; }
@keyframes aparecer { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes latido { 50% { opacity: .3; } }
.solo-movil { display: none !important; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 12px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .22);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sec { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.wa { background: #16a34a; box-shadow: 0 4px 12px rgba(22, 163, 74, .2); }
.btn.peligro { background: var(--surface); color: var(--danger); border: 1px solid var(--line); box-shadow: none; }
.btn.grande { padding: 14px 20px; font-size: 1.02rem; width: 100%; }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; font-weight: 600; }
.btn-link.centrado { justify-self: center; font-size: .9rem; }
label.btn { cursor: pointer; }

/* ---------- Pantallas de acceso ---------- */
.pantalla-centro { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 20% 0%, #e0e7ff, transparent 50%), var(--bg); }
.caja { background: var(--surface); border-radius: 20px; box-shadow: var(--sombra); padding: 28px; width: min(430px, 100%); display: grid; gap: 14px; }
.caja p { margin: 0; }
.error { color: var(--danger); margin: 0; }
.exito { margin: 0; color: var(--contado); background: var(--contado-soft); padding: 10px 12px; border-radius: 10px; }
.pila { display: grid; gap: 14px; }
.pestanas { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 12px; padding: 4px; }
.pestanas button { border: 0; background: none; padding: 9px; border-radius: 9px; cursor: pointer; font-weight: 700; color: var(--muted); }
.pestanas button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(17, 24, 39, .1); }
.empresa-encontrada { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; font-size: .9rem; }
.empresa-encontrada.ok { background: var(--contado-soft); color: var(--contado); }
.empresa-encontrada.ok strong { font-size: 1.05rem; color: var(--ink); }
.empresa-encontrada.mal { background: var(--danger-soft); color: var(--danger); }

/* ---------- Títulos y filtros ---------- */
.titulo { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 2px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.volver { text-decoration: none; font-weight: 600; }
.barra-filtros { display: flex; gap: 8px; flex-wrap: wrap; }
.barra-filtros input, .barra-filtros select { flex: 1 1 200px; }

/* ---------- Tarjetas y formularios ---------- */
.form { display: grid; gap: 16px; }
.panel, .tarjeta { background: var(--surface); border-radius: var(--radio); box-shadow: var(--sombra); padding: 20px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.panel > *, .tarjeta > * { min-width: 0; }
.tarjeta .fila { grid-template-columns: 1fr auto; padding: 10px 12px; }
.tarjeta .fila .num { grid-column: 1 / -1; font-size: .72rem; }
.tarjeta .fila .sub { grid-column: 1 / -1; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.campo { display: grid; gap: 5px; font-size: .85rem; font-weight: 600; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 1rem;
}
input:focus, select:focus, textarea:focus { border-color: #a5b4fc; outline: 3px solid var(--accent-soft); }
textarea { resize: vertical; }
.fila-campos { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.fila-campos .grow { flex: 1 1 220px; }
.fila-campos .w-cant { flex: 0 0 90px; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.dos-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }

.segmentado { display: inline-flex; background: var(--bg); border-radius: 12px; padding: 4px; width: fit-content; }
.segmentado label { cursor: pointer; }
.segmentado input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmentado span { display: block; padding: 7px 16px; font-weight: 700; color: var(--muted); border-radius: 9px; }
.segmentado input:checked + span { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(17, 24, 39, .1); }
.segmentado input:checked + span.credito { color: var(--credito); }
.segmentado input:checked + span.contado { color: var(--contado); }
.segmentado input:disabled + span { opacity: .4; cursor: not-allowed; }
.segmentado input:focus-visible + span { outline: 2px solid var(--accent); }

.nota { margin: 0; font-size: .88rem; color: var(--muted); }
.nota.aviso, .nota .aviso { color: var(--credito); font-weight: 600; }

/* ---------- Chips ---------- */
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--bg); color: var(--muted); white-space: nowrap;
}
.chip.contado { background: var(--contado-soft); color: var(--contado); }
.chip.credito { background: var(--credito-soft); color: var(--credito); }
.chip.pendiente { background: #fff4d6; color: #92600a; }
.chip.confirmado { background: var(--accent-soft); color: var(--accent); }
.chip.entregado { background: var(--contado-soft); color: var(--contado); }
.chip.anulado { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; }

/* ---------- Dashboard ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.dash-head p { margin: 4px 0 0; color: var(--muted); }
.periodo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.periodo select, .periodo input { width: auto; background: var(--surface); box-shadow: var(--sombra); border-color: transparent; font-weight: 600; }
.seg { display: inline-flex; gap: 2px; background: #eceff6; border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 9px; cursor: pointer; font-weight: 700; font-size: .85rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(17, 24, 39, .1); }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.kpi { background: var(--surface); border-radius: var(--radio); box-shadow: var(--sombra); padding: 20px; display: flex; gap: 16px; align-items: flex-start; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(17, 24, 39, .08); }
.kpi-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; }
.kpi-ico .ico { width: 22px; height: 22px; }
.g-indigo { background: linear-gradient(135deg, #6366f1, #4338ca); box-shadow: 0 6px 14px rgba(79, 70, 229, .3); }
.g-purple { background: linear-gradient(135deg, #a855f7, #6d28d9); box-shadow: 0 6px 14px rgba(124, 58, 237, .3); }
.g-blue { background: linear-gradient(135deg, #60a5fa, #2563eb); box-shadow: 0 6px 14px rgba(37, 99, 235, .28); }
.g-pink { background: linear-gradient(135deg, #f472b6, #db2777); box-shadow: 0 6px 14px rgba(219, 39, 119, .28); }
.g-orange { background: linear-gradient(135deg, #fb923c, #ea580c); box-shadow: 0 6px 14px rgba(234, 88, 12, .28); }
.g-green { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 6px 14px rgba(5, 150, 105, .28); }
.g-sky { background: linear-gradient(135deg, #38bdf8, #0284c7); box-shadow: 0 6px 14px rgba(2, 132, 199, .28); }
.kpi-txt { min-width: 0; display: grid; gap: 2px; }
.kpi-txt .etiqueta { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.kpi-txt strong { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-txt small { font-size: .82rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.delta { font-weight: 700; white-space: nowrap; }
.delta.sube { color: var(--contado); }
.delta.baja { color: var(--danger); }

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.dash-grid.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chart-head a { font-weight: 600; font-size: .88rem; text-decoration: none; }
.chart-head .acciones select { width: auto; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.chart-head p { margin: 2px 0 0; font-size: .82rem; color: var(--muted); }
.toggles { display: flex; gap: 8px; flex-wrap: wrap; }

.grafico { overflow-x: auto; }
.grafico svg { width: 100%; min-width: 300px; height: auto; display: block; }
.grafico .barra { fill: #c7d2fe; transform-box: fill-box; transform-origin: bottom; animation: crecer .5s ease-out both; animation-delay: calc(var(--i) * 30ms); }
.grafico .barra.actual { fill: url(#grad-barra); }
.grafico .barra:hover { fill: #4338ca; }
.grafico .eje { fill: var(--muted); font: 500 12px var(--font); }
.grafico .guia { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 4; }
@keyframes crecer { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.dona-wrap { display: grid; grid-template-columns: minmax(150px, 200px) 1fr; gap: 20px; align-items: center; }
.dona { position: relative; }
.dona svg { width: 100%; height: auto; display: block; transform: rotate(-90deg); }
.dona circle { fill: none; stroke-width: 18; }
.dona-centro { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dona-centro strong { font-size: 1.35rem; font-weight: 800; }
.dona-centro small { font-size: .72rem; color: var(--muted); }
.leyenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.leyenda li { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; font-size: .86rem; }
.leyenda .punto { width: 12px; height: 12px; border-radius: 4px; }
.leyenda .nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leyenda .valor { font-weight: 700; font-variant-numeric: tabular-nums; }

.resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.dato { background: var(--surface); border-radius: 14px; box-shadow: var(--sombra); padding: 14px 16px; display: grid; gap: 2px; }
.dato span { font-size: .75rem; font-weight: 600; color: var(--muted); }
.dato strong { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.dato small { font-size: .78rem; color: var(--muted); }

.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ranking li { display: grid; gap: 4px; }
.ranking-txt { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.ranking-txt span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-txt span:last-child { font-variant-numeric: tabular-nums; }
.ranking-barra { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.ranking-barra span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; animation: llenar .6s ease-out both; transform-origin: left; }
@keyframes llenar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.cargando { display: flex; justify-content: center; gap: 8px; padding: 60px 0; }
.cargando span { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: latido 1s infinite; }
.cargando span:nth-child(2) { animation-delay: .15s; }
.cargando span:nth-child(3) { animation-delay: .3s; }

/* ---------- Listas ---------- */
.lista { display: grid; gap: 8px; }
.fila {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center;
  background: var(--surface); border-radius: 14px; box-shadow: var(--sombra);
  padding: 13px 16px; text-decoration: none; color: inherit; border: 1px solid transparent;
}
.panel .fila, .tarjeta .fila { box-shadow: none; border-color: var(--line); }
.fila:hover { border-color: #c7d2fe; }
.fila .num { font-family: var(--mono); color: var(--muted); font-size: .82rem; }
.fila .nombre { font-weight: 700; }
.fila .sub { grid-column: 2; font-size: .82rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fila .sub .ok { color: var(--contado); }
.fila .monto { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.fila-cliente, .fila-empresa { grid-template-columns: 1fr auto; }
.fila-cliente .sub, .fila-empresa .sub, .fila-empresa .acciones { grid-column: 1 / -1; }
.fila-empresa .nombre { color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.vacio { text-align: center; color: var(--muted); padding: 32px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radio); }

/* ---------- Tablas ---------- */
.tabla-wrap { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tabla th { text-align: left; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); }
.tabla td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabla .der { text-align: right; }
.tabla input { padding: 6px 8px; font-size: .95rem; }
.tabla select { width: auto; padding: 6px 8px; font-size: .9rem; }
.tabla .in-cant { width: 76px; }
.tabla .in-precio { width: 104px; }
.tabla .fila-mala td { color: var(--danger); background: #fff5f5; }
.quitar { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: 1.1rem; padding: 4px 8px; }
.prod { text-transform: uppercase; font-weight: 700; }
.sub-linea { display: block; font-size: .85em; color: var(--muted); }
.sub-linea.detalle { white-space: pre-line; color: var(--ink); }
.in-detalle { display: block; margin-top: 6px; font-size: .85rem; min-width: 200px; }
.tabla-pedido td { padding-block: 12px; vertical-align: top; }
.tabla-pedido .num { white-space: nowrap; }
.tabla-pedido tfoot td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--ink); }
.tabla-pedido tfoot tr.desc td, .tabla-pedido tfoot tr.desc ~ tr td { border-top: 1px solid var(--line); }

.totales { display: grid; gap: 6px; justify-self: end; width: min(320px, 100%); }
.linea { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.linea span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.linea input { width: 90px; text-align: right; }
.linea.total { font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--line); padding-top: 8px; }

/* ---------- Documento del pedido ---------- */
.acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.estado-sel { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: .85rem; color: var(--muted); font-weight: 600; }
.estado-sel select { width: auto; }
.doc { background: var(--surface); border-radius: var(--radio); box-shadow: var(--sombra); padding: 28px; display: grid; gap: 22px; }
.doc-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 16px; }
.empresa { font-weight: 800; font-size: 1.3rem; }
.doc-num { display: grid; text-align: right; gap: 2px; }
.doc-num strong { font-family: var(--mono); font-size: 1.4rem; }
.doc-num span { font-size: .85rem; color: var(--muted); }
.doc-partes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.doc-partes > div { display: grid; gap: 4px; align-content: start; }
.doc-partes p { margin: 0; }
.doc .totales { justify-self: end; }
.doc-notas { background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.doc-notas p { margin: 4px 0 0; white-space: pre-wrap; }
.firma { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; }
.firma div { border-top: 1px solid var(--ink); padding-top: 6px; text-align: center; font-size: .8rem; color: var(--muted); }

/* ---------- Documentos (formato RIDE) ---------- */
.chip.doc-factura { background: var(--accent-soft); color: var(--accent); }
.chip.doc-nota_venta { background: var(--contado-soft); color: var(--contado); }
.chip.doc-proforma { background: #e0f2fe; color: #0369a1; }
.chip.doc-nota_credito { background: #fce7f3; color: #be185d; }
.logo-fila { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-prev { width: 180px; height: 90px; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; background: #fff; overflow: hidden; }
.logo-prev img { max-width: 100%; max-height: 100%; }

.ride {
  position: relative; background: #fff; color: #111; border-radius: var(--radio); box-shadow: var(--sombra);
  padding: 24px; display: grid; gap: 12px; font-size: 12px; line-height: 1.35; font-family: Arial, Helvetica, sans-serif;
}
.ride p, .ride dl { margin: 0; }
.ride b, .ride .fuerte { font-weight: 700; }
.ride-top { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
.ride-emisor { display: grid; grid-template-rows: auto 1fr; gap: 10px; }
.ride-logo { min-height: 90px; display: grid; place-items: center; }
.ride-logo img { max-width: 260px; max-height: 120px; }
.ride-logo span { font-size: 26px; font-weight: 800; letter-spacing: .02em; color: #1e3a8a; text-align: center; }
.ride-caja { border: 1px solid #333; border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; align-content: start; }
.ride-caja dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin-top: 6px; }
.ride-caja dt { font-weight: 700; }
.ride-comp .ruc { font-size: 16px; font-weight: 700; letter-spacing: .03em; }
.ride-tipo { font-size: 18px; font-weight: 800; letter-spacing: .04em; }
.ride-dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
.ride .peq { font-size: 10.5px; word-break: break-all; }
.ride-centro { text-align: center; }
.ride .barras { width: 100%; height: 54px; display: block; fill: #000; }
.ride-cliente { grid-template-columns: 1fr auto; border-radius: 0; border-width: 1px 0; padding: 8px 0; gap: 6px 16px; }
.ride .der { text-align: right; }
.ride .centro { text-align: center; }
.ride-tabla { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.ride-tabla th { background: #f3f4f6; font-weight: 700; padding: 6px; border: 1px solid #999; }
.ride-tabla td { padding: 5px 6px; border: 1px solid #bbb; vertical-align: top; }
.ride-pie { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.ride-izq { display: grid; gap: 12px; }
.ride-mini { width: 100%; border-collapse: collapse; }
.ride-mini caption { background: #f3f4f6; font-weight: 700; padding: 6px; border: 1px solid #999; border-bottom: 0; }
.ride-mini th, .ride-mini td { border: 1px solid #bbb; padding: 5px 6px; text-align: left; }
.ride-mini th { font-weight: 700; }
.ride-totales { width: 100%; border-collapse: collapse; }
.ride-totales td { border: 1px solid #bbb; padding: 5px 6px; }
.ride-totales .sim { width: 18px; text-align: center; }
.ride-totales .der { width: 90px; font-variant-numeric: tabular-nums; }
.ride-totales tr.total td { font-weight: 800; background: #f3f4f6; }
.ride-aviso { text-align: center; color: #b45309; font-weight: 700; border: 1px dashed #f59e0b; border-radius: 8px; padding: 6px; }
.sello-anulado {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-size: 96px; font-weight: 900; color: rgba(220, 38, 38, .16); transform: rotate(-24deg); letter-spacing: .1em;
}
@media (max-width: 700px) {
  .ride { padding: 14px; }
  .ride-top, .ride-pie { grid-template-columns: 1fr; }
  .ride-cliente { grid-template-columns: 1fr; }
  .ride-cliente .der { text-align: left; }
}

/* ---------- Personal: asistencia, actividades y metas ---------- */
.reloj-tarjeta { justify-items: center; text-align: center; }
.reloj { font-size: clamp(2.6rem, 8vw, 4rem); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.reloj-tarjeta p { margin: 0; }
.marcar { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; width: min(560px, 100%); }
.btn.marcar-entrada { background: linear-gradient(135deg, #059669, #10b981); box-shadow: 0 6px 16px rgba(5, 150, 105, .3); }
.btn.marcar-salida { background: linear-gradient(135deg, #ea580c, #f59e0b); box-shadow: 0 6px 16px rgba(234, 88, 12, .3); }
.btn.marcar-entrada:disabled, .btn.marcar-salida:disabled { background: var(--bg); color: var(--muted); box-shadow: none; opacity: 1; }
.fotos { white-space: nowrap; }
.foto-mini { display: inline-block; width: 40px; height: 40px; border-radius: 10px; overflow: hidden; background: var(--bg); vertical-align: middle; }
.foto-mini img { width: 100%; height: 100%; object-fit: cover; }
.foto-grande { max-width: min(560px, 92vw); max-height: 86vh; border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.camara { background: #111; border-radius: 14px; overflow: hidden; aspect-ratio: 3 / 4; display: grid; place-items: center; max-height: 55vh; }
.camara video, .camara img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camara img { transform: none; }
.linea-tiempo { list-style: none; margin: 0; padding: 0 0 0 8px; display: grid; gap: 0; border-left: 2px solid var(--line); }
.linea-tiempo li { display: grid; grid-template-columns: 78px 1fr; gap: 10px; padding: 8px 0 8px 12px; position: relative; }
.linea-tiempo li::before { content: ""; position: absolute; left: -7px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.linea-tiempo li.ev-asistencia::before { background: #059669; }
.linea-tiempo li.ev-pedido::before { background: #f97316; }
.linea-tiempo li.ev-cobro::before { background: #db2777; }
.linea-tiempo li.ev-oficina::before { background: #64748b; }
.ev-hora { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; }
.pin-num span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: .75rem; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.progreso { height: 14px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.progreso span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; transition: width .6s; }
.progreso span.logrado { background: linear-gradient(90deg, #059669, #10b981); }
.pct { font-size: 1.6rem; font-weight: 800; }
.tarjeta p { margin: 0; }
.metas-tabla input { width: 100px; padding: 6px 8px; font-size: .9rem; }
.rol td:first-child { font-weight: 600; }

/* ---------- Colores ---------- */
.muestras { display: flex; flex-wrap: wrap; gap: 12px; }
.muestra { display: grid; justify-items: center; gap: 4px; cursor: pointer; font-size: .78rem; color: var(--muted); }
.muestra input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.muestra-color { width: 52px; height: 52px; border-radius: 14px; border: 3px solid transparent; box-shadow: 0 2px 8px rgba(17, 24, 39, .15); display: grid; place-items: center; font-weight: 800; }
.muestra-color.empresa { background: var(--bg); color: var(--muted); }
.muestra input:checked + .muestra-color { border-color: var(--ink); transform: scale(1.06); }
.muestra input:focus-visible + .muestra-color { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Ventana de impresión y ticket ---------- */
.modal-capa { position: fixed; inset: 0; z-index: 2000; background: rgba(17, 24, 39, .45); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 18px; width: min(440px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(17, 24, 39, .3); }
.modal-cab { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-cuerpo { padding: 14px 18px; overflow-y: auto; display: grid; gap: 12px; }
.modal-pie { padding: 14px 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.modal-pie .dos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.usb { background: #15803d; box-shadow: 0 4px 12px rgba(21, 128, 61, .25); }
.info-azul { margin: 0; background: var(--accent-soft); color: #3730a3; border-radius: 10px; padding: 10px 12px; font-size: .85rem; }
.imp-fila { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.imp-fila strong { min-width: 28px; text-align: center; color: var(--ink); }
.redondo { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; }
.imp-vista { background: #e5e7eb; border-radius: 10px; padding: 14px; display: grid; justify-items: center; }
.ticket { background: #fff; color: #000; font-family: "Courier New", Courier, monospace; font-size: 12px; line-height: 1.35; padding: 10px 8px; }
.ticket.t80 { width: 72mm; }
.ticket.t58 { width: 48mm; font-size: 10.5px; }
.ticket hr { border: 0; border-top: 1px dashed #000; margin: 4px 0; }
.ticket .t-c { text-align: center; }
.ticket .t-b { font-weight: 700; }
.ticket .t-g { font-size: 1.15em; }
.ticket .t-p { font-size: .8em; word-break: break-all; }
.ticket .t-fila { display: flex; justify-content: space-between; gap: 8px; }
#zona-ticket { display: none; }

/* ---------- Compras ---------- */
.kpi.kpi-alerta { background: #fffbeb; border: 1px solid #fcd34d; }
.kpi.kpi-alerta strong { color: #b45309; }
.zona-archivos {
  display: grid; justify-items: center; gap: 6px; text-align: center; padding: 26px 16px; cursor: pointer;
  border: 2px dashed #c7d2fe; border-radius: 14px; background: var(--accent-soft); color: var(--accent); transition: background .15s, border-color .15s;
}
.zona-archivos .ico { width: 30px; height: 30px; }
.zona-archivos strong { color: var(--ink); }
.zona-archivos span { font-size: .82rem; color: var(--muted); }
.zona-archivos:hover, .zona-archivos.encima { background: #e0e7ff; border-color: var(--accent); }
.avisos { margin: 0; padding: 10px 14px 10px 30px; background: #fffbeb; border-radius: 10px; color: #92400e; font-size: .88rem; display: grid; gap: 4px; }
.fila-link { cursor: pointer; }
.cuenta-correo { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.cuenta-correo p { margin: 0 0 4px; }
.cc-titulo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 1.02rem; }
.peq { font-size: .78rem; }
.panel-interno { display: grid; gap: 12px; background: var(--bg); border-radius: 14px; padding: 16px; }
.fila-link:hover td { background: var(--accent-soft); }

/* ---------- Buscador de productos en el pedido ---------- */
.buscador { position: relative; }
.fila-campos .w-iva { flex: 0 0 96px; }
.tabla .in-iva { width: 76px; }
.resultados {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 50; margin: 4px 0 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 34px rgba(17, 24, 39, .14);
  max-height: 340px; overflow-y: auto; color: var(--ink); font-weight: 400;
}
.resultados li[role=option] {
  display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; align-items: center;
}
.resultados li[aria-selected=true], .resultados li[role=option]:hover { background: var(--accent-soft); }
.res-cod { font-size: .75rem; color: var(--muted); }
.res-nom { font-weight: 600; font-size: .9rem; }
.res-nom small { color: var(--muted); font-weight: 500; }
.res-precio { font-weight: 800; font-variant-numeric: tabular-nums; }
.res-info { grid-column: 2 / -1; font-size: .75rem; color: var(--muted); }
.res-mas { padding: 8px 10px; font-size: .82rem; color: var(--muted); }

/* ---------- Reportes, gastos y cobros ---------- */
.tabs-reporte { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tabs-reporte a { padding: 8px 14px; border-radius: 10px; text-decoration: none; color: #374151; font-weight: 600; background: var(--surface); box-shadow: var(--sombra); }
.tabs-reporte a.activo { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.tabs-reporte .espacio { flex: 1; }
.pila-reporte { display: grid; gap: 18px; }
.tabla-reporte td, .tabla-reporte th { white-space: nowrap; }
.tabla-reporte td:nth-child(-n + 2) { white-space: normal; min-width: 120px; }
.tabla-reporte tfoot td { font-weight: 800; border-top: 2px solid var(--ink); border-bottom: 0; }
.tabla .fuerte, .tabla-reporte .fuerte { font-weight: 700; }
.negativo { color: var(--danger); }
.aviso-txt { color: var(--credito); }
.btn.mini { padding: 5px 10px; font-size: .82rem; }
.form-cobro { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.solo-impresion { display: none; }
.chip.anulado-sin { background: var(--danger-soft); color: var(--danger); }
.chip.gasto-nomina, .chip.gasto-adelanto_sueldo { background: #ede9fe; color: #6d28d9; }
.chip.gasto-transporte { background: #e0f2fe; color: #0369a1; }
.chip.gasto-servicios, .chip.gasto-suministros { background: #fef3c7; color: #92400e; }
.chip.gasto-arriendo, .chip.gasto-mantenimiento { background: #fce7f3; color: #be185d; }

/* ---------- Mapas ---------- */
.mapa { height: 300px; border-radius: 14px; z-index: 0; }
.mapa.grande { height: 62vh; min-height: 360px; box-shadow: var(--sombra); }
.coords { display: flex; gap: 8px 16px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.vivo { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); font-weight: 700; }
.vivo::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: latido 1.2s infinite; }

/* ---------- Equipo ---------- */
.codigos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.codigo-card { border: 1px dashed #a5b4fc; background: var(--accent-soft); border-radius: 14px; padding: 14px; display: grid; gap: 8px; }
.codigo { font-size: 1.7rem; letter-spacing: .12em; color: var(--ink); }
.interruptor { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .85rem; }
.interruptor input { width: 38px; height: 22px; appearance: none; background: var(--line); border-radius: 999px; position: relative; cursor: pointer; padding: 0; border: 0; transition: background .2s; }
.interruptor input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.interruptor input:checked { background: var(--contado); }
.interruptor input:checked::after { transform: translateX(16px); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 1000;
  transform: translate(-50%, 180%); opacity: 0; visibility: hidden; transition: transform .25s, opacity .25s, visibility .25s;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(17, 24, 39, .25);
}
.toast.visible { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast.error { background: var(--danger); }

/* ---------- Tabletas ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .dash-grid.tres { grid-template-columns: 1fr; }
}

/* ---------- Celular: menú abajo ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .solo-movil { display: flex !important; }
  .solo-escritorio, .nav-seccion, .usuario-bloque, .lateral > .marca-bloque { display: none !important; }
  .lateral {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; z-index: 600;
    border-right: 0; border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    overflow: visible;
  }
  .nav { flex-direction: row; justify-content: flex-start; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 0 0 auto; min-width: 72px; flex-direction: column; gap: 3px; padding: 7px 4px; font-size: .68rem; border-radius: 10px; text-align: center; white-space: nowrap; }
  .nav a.activo { box-shadow: none; }
  .top { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .empresa-pill { max-width: 52vw; }
  .vista { padding: 4px max(16px, env(safe-area-inset-right, 0px)) 110px max(16px, env(safe-area-inset-left, 0px)); gap: 14px; }
  .en-vivo { display: none; }
  .kpis { gap: 12px; }
  .kpi { padding: 16px; gap: 12px; }
  .kpi-txt strong { font-size: 1.3rem; }
  .estado-sel { margin-left: 0; }
  .doc { padding: 18px; }
  .fila { grid-template-columns: 1fr auto; }
  .fila .num, .fila .sub { grid-column: 1 / -1; }
  .dona-wrap { grid-template-columns: 1fr; justify-items: center; }
  .dona { width: 190px; }
  .leyenda { width: 100%; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .periodo { width: 100%; }
  .periodo select, .periodo input { flex: 1 1 140px; }
  .usuario-pill { padding: 4px; box-shadow: none; background: transparent; }
  .usuario-pill-txt { display: none; }
  .empresa-sel select { max-width: calc(100vw - 230px); }
  .top-derecha { gap: 6px; min-width: 0; }
}

/* ---------- Suscripciones ---------- */
.aviso-plan { font-size: .78rem; font-weight: 700; color: #92600a; background: #fff4d6; padding: 6px 12px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.burbuja-nav { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 800; text-align: center; }
.acciones-titulo { display: flex; gap: 8px; flex-wrap: wrap; }
.planes-elegir { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.plan-opcion { position: relative; cursor: pointer; }
.plan-opcion input { position: absolute; opacity: 0; }
.plan-opcion span { display: grid; gap: 2px; padding: 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); }
.plan-opcion b { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.plan-opcion small { color: var(--muted); }
.plan-opcion input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.plan-opcion input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.metodos-pago { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.metodo-pago { display: grid; gap: 6px; align-content: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.metodo-pago .detalle { margin: 0; white-space: pre-line; font-size: .88rem; color: #374151; }
.metodo-pago .btn { justify-self: start; }
.qr { width: 160px; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.qr-fila { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; }
.campo-check { display: flex; gap: 8px; align-items: center; font-size: .9rem; font-weight: 600; align-self: end; padding-bottom: 10px; }
.campo-check input { width: auto; }
#bloqueo .caja:has(#bloqueo-extra:not(:empty)) { width: min(640px, 100%); }
.fila-soporte { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.fila-soporte input, .fila-soporte select { flex: 1 1 200px; width: auto; }
.clave-soporte { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); }
.clave-soporte span { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.clave-soporte strong { font-size: 1.6rem; letter-spacing: .12em; color: var(--accent); }
.clave-soporte small { color: var(--muted); }
.ok-txt { color: var(--contado); font-weight: 600; }
.codigo-mfa { font-size: 1.4rem; letter-spacing: .3em; text-align: center; }
.qr-mfa { width: 190px; height: 190px; margin-top: 8px; background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.pasos-mfa { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.pasos-mfa code { word-break: break-all; background: var(--bg); padding: 2px 6px; border-radius: 6px; }
.admin-acceso { display: flex; gap: 4px 10px; flex-wrap: wrap; align-items: baseline; font-weight: 400; }
.admin-acceso small { color: var(--muted); }
.admin-acceso .btn-link { font-size: .8rem; }
.admins-celda { display: grid; gap: 2px; margin-top: 4px; }
.fila .admins-fila { grid-column: 1 / -1; display: grid; gap: 2px; }
@media (max-width: 860px) {
  .aviso-plan { font-size: .7rem; padding: 4px 9px; white-space: normal; line-height: 1.2; max-width: 130px; }
  .burbuja-nav { position: absolute; top: 2px; right: 6px; margin: 0; }
  .nav a { position: relative; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Impresión ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .shell { display: block; }
  .no-print, .lateral, .top, .toast { display: none !important; }
  .vista { padding: 0; max-width: none; }
  .doc, .ride { box-shadow: none; padding: 0; border-radius: 0; }
  .solo-impresion { display: block; font-size: 16px; margin-bottom: 8px; }
  body.imprimiendo-ticket > *:not(#zona-ticket) { display: none !important; }
  body.imprimiendo-ticket #zona-ticket { display: block !important; }
  body.imprimiendo-ticket .ticket { padding: 0; }
  .tarjeta, .kpi, .panel { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .kpi-ico { display: none; }
  .ride { font-size: 10.5px; }
  .ride-top, .ride-pie { grid-template-columns: 1fr 1fr !important; }
  .ride-cliente { grid-template-columns: 1fr auto !important; }
  .ride-tabla th, .ride-mini caption, .ride-totales tr.total td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .chip { border: 1px solid #999; background: none !important; color: #000 !important; }
}
