/* ============================================================
   Facturas OCR · sistema de diseño
   Neutros slate + azul de acción; verde / ámbar / rojo / violeta para estados.
   Claro y oscuro automáticos. Mismos nombres de clase que usa el JS.
   ============================================================ */
:root {
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f8fafc;
  --text: #0f172a; --text-2: #334155; --muted: #64748b; --line: #e2e8f0; --line-strong: #cbd5e1;
  --accent: #2563eb; --accent-hover: #1d4ed8; --accent-soft: #eaf1ff; --accent-ink: #1e40af;
  --green: #047857; --green-soft: #e6f6ef; --amber: #b45309; --amber-soft: #fef3e2;
  --red: #b91c1c; --red-soft: #fdecec; --violet: #6d28d9; --violet-soft: #f1eafe; --gray-soft: #eef1f5;
  --blue-soft: #eaf1ff;
  --hl: rgba(250, 204, 21, .5); --hover: rgba(37, 99, 235, .16);
  --side: #0f172a; --side-hover: #1e293b; --side-text: #cbd5e1; --side-muted: #64748b;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, .35);
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220; --surface: #111a2b; --surface-2: #15203a;
    --text: #e8edf5; --text-2: #c3ccdb; --muted: #8b97ab; --line: #223049; --line-strong: #2f4263;
    --accent: #6ea0ff; --accent-hover: #8bb4ff; --accent-soft: #17274a; --accent-ink: #a9c7ff;
    --green: #4ade9f; --green-soft: #11302a; --amber: #fbbf5a; --amber-soft: #36270f;
    --red: #ff8a80; --red-soft: #3a1b1b; --violet: #c4a6f5; --violet-soft: #2a2145; --gray-soft: #1c2740;
    --blue-soft: #17274a; --hl: rgba(250, 204, 21, .32); --hover: rgba(110, 160, 255, .22);
    --side: #070d19; --side-hover: #131d31;
    --shadow-sm: none; --shadow: none; --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14.5px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Tipografía ---------- */
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
#app > h2:first-child, .page-head h2, .page-title { font-size: 24px; font-weight: 700; line-height: 1.2; margin-bottom: 4px; }
h3 { font-size: 15px; font-weight: 650; margin-bottom: 8px; }
.lead { margin: 0 0 18px; color: var(--muted); font-size: 14.5px; max-width: 78ch; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
b, strong { font-weight: 650; }

/* ---------- Botones y campos ---------- */
button { font: inherit; color: var(--text); cursor: pointer; background: var(--surface); border: 1px solid var(--line-strong);
  padding: 7px 14px; min-height: 36px; border-radius: var(--r-sm); font-weight: 550; line-height: 1.2; transition: background .12s, border-color .12s, box-shadow .12s; box-shadow: var(--shadow-sm); }
button:hover:not(:disabled) { border-color: var(--accent); background: var(--surface-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .35); }
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
@media (prefers-color-scheme: dark) { button.primary { color: #0b1220; } }
button.danger { color: var(--red); }
button.danger:hover:not(:disabled) { border-color: var(--red); background: var(--red-soft); }
button.small { padding: 4px 10px; min-height: 28px; font-size: 12.5px; }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
button.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
button.ghost:hover:not(:disabled) { background: var(--gray-soft); border-color: transparent; color: var(--text); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 8px 10px; width: 100%; min-height: 36px; transition: border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:hover:not(:disabled), select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--hover); }
input:disabled { background: var(--surface-2); color: var(--muted); }
input[type=checkbox] { width: 16px; min-height: 0; accent-color: var(--accent); }
kbd { font: 11px ui-monospace, Menlo, monospace; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); background: var(--surface-2); margin-left: 4px; }
button.primary kbd { color: rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .35); }
@media (prefers-color-scheme: dark) { button.primary kbd { color: rgba(11, 18, 32, .8); background: rgba(11, 18, 32, .12); border-color: rgba(11, 18, 32, .35); } }

/* ---------- Estructura: menú lateral + contenido ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px 14px; z-index: 40; }
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 18px; text-decoration: none; color: #fff; }
.brand svg { flex: none; }
.brand b { display: block; font-size: 15.5px; letter-spacing: -.01em; color: #fff; }
.brand small { display: block; color: var(--side-muted); font-size: 12px; margin-top: 1px; }
#nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 14px 10px 6px; font-weight: 650; }
#nav a { display: flex; gap: 11px; align-items: center; padding: 9px 10px; border-radius: 9px; color: var(--side-text); text-decoration: none; font-weight: 520; }
#nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; opacity: .85; }
#nav a:hover { background: var(--side-hover); color: #fff; }
#nav a.active { background: var(--accent); color: #fff; }
#nav a.active svg { opacity: 1; }
.side-foot { border-top: 1px solid rgba(148, 163, 184, .18); padding: 12px 6px 0; display: flex; gap: 10px; align-items: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 13px; flex: none; }
.me { min-width: 0; flex: 1; line-height: 1.25; }
.me b { display: block; color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--side-muted); font-size: 12px; }
.side-foot button { background: transparent; color: var(--side-text); border-color: rgba(148, 163, 184, .3); box-shadow: none; }
.side-foot button:hover:not(:disabled) { background: var(--side-hover); border-color: var(--side-text); }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 32px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar .ctx { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar .ctx label { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
#clientSel { width: auto; min-width: 260px; max-width: 46vw; font-weight: 600; }
#burger { display: none; padding: 6px 10px; }
.topbar .brand-mini { display: none; }
main { padding: 28px 32px 56px; width: 100%; max-width: 1320px; margin: 0 auto; }
.spacer { flex: 1; }
.scrim { display: none; }

/* ---------- Tarjetas, filas y utilidades ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.warn-txt { color: var(--amber); font-size: 12.5px; line-height: 1.35; }
.ai-txt { color: var(--violet); font-size: 12.5px; line-height: 1.35; }
td.why { min-width: 210px; max-width: 340px; }
.cell-file { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 10px; }
details > summary { cursor: pointer; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .lead { margin: 0; }

/* ---------- Guía de 4 pasos ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 4px 0 22px; counter-reset: s; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 14px 56px; position: relative; font-size: 13.5px; color: var(--text-2); box-shadow: var(--shadow-sm); }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 16px; top: 14px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; display: grid; place-items: center; }
.step b { display: block; color: var(--text); margin-bottom: 2px; font-size: 14px; }

/* ---------- Cifras (resumen) ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 0 0 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-sm); border-top: 3px solid var(--line-strong); }
.kpi b { display: block; font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi span { display: block; font-weight: 600; margin-top: 4px; }
.kpi small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.kpi.warn { border-top-color: var(--amber); } .kpi.warn b { color: var(--amber); }
.kpi.good { border-top-color: var(--green); } .kpi.good b { color: var(--green); }
.kpi.ai { border-top-color: var(--violet); } .kpi.ai b { color: var(--violet); }
.kpi.info { border-top-color: var(--accent); } .kpi.info b { color: var(--accent); }

/* ---------- Filtros por estado ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.stat { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-strong); cursor: pointer; font-size: 13.5px; font-weight: 550; color: var(--text-2); transition: background .12s, border-color .12s; user-select: none; }
.stat:hover { border-color: var(--accent); }
.stat b { font-size: 13px; font-weight: 700; color: var(--text); background: var(--gray-soft); border-radius: 99px; padding: 0 8px; min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.stat.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .stat.sel { color: #0b1220; } }
.stat.sel b { background: rgba(255, 255, 255, .22); color: inherit; }
.stat > span { display: inline-flex; align-items: center; gap: 6px; }
.stat > span.muted { color: inherit; font-size: inherit; }
.stat > span.small { font-size: inherit; }

/* ---------- Estados (semáforo) ---------- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; flex: none; }
.dot.listo { background: var(--green); } .dot.revisar { background: var(--amber); } .dot.aprobada { background: var(--accent); }
.dot.procesando { background: var(--accent); animation: pulse 1s infinite; } .dot.ia { background: var(--violet); }
.dot.exportada { background: var(--muted); } .dot.error, .dot.duplicada { background: var(--red); } .dot.descartada, .dot.dividida { background: var(--line-strong); }
@keyframes pulse { 50% { opacity: .3; } }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.b-listo { background: var(--green-soft); color: var(--green); } .b-revisar { background: var(--amber-soft); color: var(--amber); }
.b-procesando, .b-aprobada { background: var(--blue-soft); color: var(--accent-ink); } .b-ia { background: var(--violet-soft); color: var(--violet); }
.b-exportada, .b-descartada, .b-dividida { background: var(--gray-soft); color: var(--muted); } .b-error, .b-duplicada { background: var(--red-soft); color: var(--red); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--gray-soft); color: var(--text-2); margin: 0 3px 3px 0; }
.spin { display: inline-block; width: 11px; height: 11px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: rot .8s linear infinite; vertical-align: middle; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Subida ---------- */
#drop { border: 2px dashed var(--line-strong); border-radius: var(--r); padding: 22px; text-align: center; background: var(--surface); margin-bottom: 18px; transition: .15s; color: var(--text-2); }
#drop.over { border-color: var(--accent); background: var(--accent-soft); }
.progress { height: 8px; background: var(--gray-soft); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }

/* ---------- Tablas ---------- */
.tablewrap { overflow-x: auto; border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; position: sticky; top: 0; background: var(--surface-2); border-bottom: 1px solid var(--line-strong); z-index: 1; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr[data-id]:hover, tbody tr[data-id]:focus-visible { background: var(--accent-soft); cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.small th, table.small td { padding: 7px 10px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 10px; }
.chip { border-radius: 99px; padding: 4px 12px; }
.chip.sel { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Revisión ---------- */
.review { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(380px, .8fr); gap: 20px; align-items: start; }
.viewer { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; background: var(--gray-soft); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.page { position: relative; margin: 0 auto 12px; background: #fff; box-shadow: 0 2px 10px rgba(15, 23, 42, .18); border-radius: 2px; }
.page img { width: 100%; display: block; user-select: none; }
.w { position: absolute; border-radius: 2px; cursor: pointer; }
.w:hover { background: var(--hover); outline: 1px solid var(--accent); }
.w.hl { background: var(--hl); outline: 1px solid #ca8a04; }
.w.client { cursor: not-allowed; }
.viewer.picking .w { background: rgba(37, 99, 235, .06); }
.form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.form label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.form .f { position: relative; }
.form .f.active input { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--hover); }
.form .f.warn input { border-color: var(--amber); background: var(--amber-soft); }
.form h3 { text-transform: uppercase; font-size: 11.5px; letter-spacing: .07em; color: var(--muted); margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.form h3:first-of-type { border-top: none; padding-top: 0; margin-top: 4px; }
.amounts { margin-top: 2px; }
.amounts td, .amounts th { padding: 4px 6px; border: none; background: transparent; position: static; }
.amounts th { font-size: 11.5px; }
.amounts input { text-align: right; font-variant-numeric: tabular-nums; }
.cuadre { padding: 10px 12px; border-radius: var(--r-sm); margin: 10px 0 14px; font-variant-numeric: tabular-nums; font-size: 13.5px; border: 1px solid transparent; }
.cuadre.ok { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.cuadre.ko { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.alerts { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.alerts li { background: var(--amber-soft); color: var(--amber); border-radius: var(--r-sm); padding: 8px 12px; cursor: pointer; font-size: 13.5px; border: 1px solid color-mix(in srgb, var(--amber) 22%, transparent); }
.alerts li.ok { background: var(--green-soft); color: var(--green); cursor: default; border-color: color-mix(in srgb, var(--green) 22%, transparent); }
.ia-banner { background: var(--violet-soft); color: var(--violet); border-radius: var(--r-sm); padding: 8px 12px; margin-bottom: 10px; font-size: 13.5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; position: sticky; bottom: 0; background: var(--surface); padding: 14px 0 4px; border-top: 1px solid var(--line); }
.actions .primary { min-width: 200px; }

/* ---------- Ventanas, avisos ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--r-lg); padding: 24px; width: min(720px, 100%); max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.modal h2 { font-size: 20px; margin-bottom: 8px; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(8px); background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 10px; opacity: 0; transition: .2s; pointer-events: none; z-index: 80; max-width: 90vw; font-weight: 520; box-shadow: var(--shadow-lg); }
#toast.show { opacity: 1; transform: translateX(-50%); }
@media (prefers-color-scheme: dark) { #toast { background: #e8edf5; color: #0b1220; } }
.copy { display: flex; gap: 6px; }
.copy input { font-family: ui-monospace, monospace; font-size: 12.5px; }

/* ---------- Resumen por cliente ---------- */
.cl-card { margin-bottom: 14px; padding: 0; overflow: hidden; }
.cl-head { display: flex; gap: 14px; align-items: center; padding: 16px 20px 0; }
.cl-head .avatar { width: 42px; height: 42px; font-size: 15px; border-radius: 12px; }
.cl-head h3 { margin: 0; font-size: 17px; }
.cl-head > div { min-width: 0; flex: 1; }
.cl-state { margin-left: auto; font-size: 13px; font-weight: 600; }
.cl-nums { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 20px; }
.num-chip { padding: 8px 14px; border-radius: 10px; background: var(--gray-soft); min-width: 104px; font-size: 12.5px; color: var(--text-2); }
.num-chip b { display: block; font-size: 22px; line-height: 1.15; color: var(--text); font-variant-numeric: tabular-nums; }
.num-chip.warn { background: var(--amber-soft); color: var(--amber); } .num-chip.warn b { color: var(--amber); }
.num-chip.good { background: var(--green-soft); color: var(--green); } .num-chip.good b { color: var(--green); }
.num-chip.ai { background: var(--violet-soft); color: var(--violet); } .num-chip.ai b { color: var(--violet); }
.cl-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px 16px; background: var(--surface-2); border-top: 1px solid var(--line); }

@media (max-width: 1100px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .review { grid-template-columns: 1fr; }
  .viewer { position: static; max-height: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 272px; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 35; }
  #burger { display: inline-flex; }
  .topbar { padding: 10px 14px; }
  .topbar .brand-mini { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
  .topbar .ctx label { display: none; }
  .topbar .ctx { min-width: 0; }
  #clientSel { min-width: 0; max-width: 50vw; }
  main { padding: 18px 14px 48px; }
  .split { grid-template-columns: 1fr; }
  #app > h2:first-child, .page-head h2, .page-title { font-size: 21px; }
  .steps { grid-template-columns: 1fr; }
  .actions .primary { min-width: 0; flex: 1 1 100%; }
}
@media print { .side, .topbar, #toast { display: none !important; } .shell { display: block; } }

/* ---------- Detalles ---------- */
td label.small { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
input[type=file] { width: auto; max-width: 100%; padding: 5px; min-height: 0; color: var(--muted); font-size: 13px; }
input[type=file]::file-selector-button { font: inherit; font-weight: 550; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); padding: 6px 12px; margin-right: 10px; cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--accent); background: var(--surface-2); }
input[type=search] { background-image: none; }
.card h3 + .small.muted, .card h3 + p.muted { margin-top: -2px; }

/* Guía de funciones */
.guia-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.guia-step { flex: 1 1 110px; min-width: 110px; display: flex; flex-direction: column; gap: 2px; align-items: center; text-align: center; padding: 10px 6px; border-radius: var(--r-lg, 12px); background: var(--bg-soft, rgba(127,127,127,.08)); }
.guia-ico { font-size: 26px; line-height: 1.2; }
.guia-arrow { display: none; }
.guia-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.guia-toc a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: inherit; font-size: 13px; }
.guia-toc a:hover { border-color: var(--accent); color: var(--accent); }
.guia-sec { margin-top: 16px; scroll-margin-top: 12px; }
.guia-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.guia-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.guia-item p { margin: 0; flex: 1; }
.guia-list li { margin: 6px 0; }
@media (max-width: 700px) { .guia-arrow { display: none; } }
.pq { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 12px; }
.pq-t { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.pq-opts { display: flex; flex-direction: column; gap: 6px; }
.pq-opt { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.pq textarea, .pq input[type=text] { width: 100%; }
.pq-opt { justify-content: flex-start; text-align: left; }
.pq-opt input { width: auto; flex: none; margin: 0; }
.lotes th, .lotes td { white-space: nowrap; }
.lotes td:nth-child(4) { white-space: normal; min-width: 120px; }
