/* Cotizá 3D — estilos
 * Layout: una columna en celular con barra de pestañas abajo; en pantallas
 * anchas, formulario a la izquierda y "placa" de precio fija a la derecha.
 * Paleta: grafito frío (cama de impresión) + cobalto para acciones + ámbar
 * "hotend" solo para el precio final.
 */
:root {
  --bg: #F1F3F7;
  --surface: #FFFFFF;
  --surface-2: #F7F8FB;
  --ink: #131926;
  --muted: #586174;
  --line: #DCE0E8;
  --accent: #2346E0;
  --accent-ink: #FFFFFF;
  --accent-soft: #E6EBFD;
  --plate: #161B26;
  --plate-ink: #EEF1F7;
  --plate-muted: #9AA3B5;
  --hot: #FFB224;
  --ok: #17784C;
  --ok-soft: #E3F4EB;
  --warn: #9A5B00;
  --warn-soft: #FFF3D9;
  --bad: #B42318;
  --bad-soft: #FDE8E6;
  --seg-1: #2346E0; --seg-2: #FFB224; --seg-3: #6B7A99; --seg-4: #C2410C; --seg-5: #17784C; --seg-6: #9B5DE5;

  --f-display: "Bricolage Grotesque", "Archivo", system-ui, sans-serif;
  --f-body: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --r: 12px;
  --r-sm: 8px;
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1017; --surface: #161A24; --surface-2: #1B2030; --ink: #E7EAF1; --muted: #9BA3B4;
    --line: #2A3142; --accent: #7F95FF; --accent-ink: #0D1017; --accent-soft: #1F2747;
    --plate: #1E2433; --plate-ink: #EEF1F7; --plate-muted: #A3ABBC; --hot: #FFBE4A;
    --ok: #4CC38A; --ok-soft: #12291F; --warn: #F0B54A; --warn-soft: #2A2110; --bad: #FF7A6B; --bad-soft: #2E1614;
    --seg-1: #7F95FF; --seg-2: #FFBE4A; --seg-3: #8A97B3; --seg-4: #F07A3E; --seg-5: #4CC38A; --seg-6: #B98CF0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1017; --surface: #161A24; --surface-2: #1B2030; --ink: #E7EAF1; --muted: #9BA3B4;
  --line: #2A3142; --accent: #7F95FF; --accent-ink: #0D1017; --accent-soft: #1F2747;
  --plate: #1E2433; --plate-ink: #EEF1F7; --plate-muted: #A3ABBC; --hot: #FFBE4A;
  --ok: #4CC38A; --ok-soft: #12291F; --warn: #F0B54A; --warn-soft: #2A2110; --bad: #FF7A6B; --bad-soft: #2E1614;
  --seg-1: #7F95FF; --seg-2: #FFBE4A; --seg-3: #8A97B3; --seg-4: #F07A3E; --seg-5: #4CC38A; --seg-6: #B98CF0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2 { font-family: var(--f-display); text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.app { min-height: 100%; }
.main {
  max-width: 1120px; margin: 0 auto;
  padding-inline: 16px;
  padding-block: 16px calc(var(--tabbar-h) + 96px + env(safe-area-inset-bottom, 0px));
}

/* ---------- Barra superior y pestañas ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 16px; background: var(--plate); color: var(--plate-ink);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 28px; height: 28px; color: var(--plate-ink); }
.brand-name { font-family: var(--f-display); font-size: 1.25rem; font-weight: 600; }
.brand-name b { color: var(--hot); font-weight: 800; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabbar-h); border: 0; background: none; color: var(--muted);
  font: 600 .78rem var(--f-body); cursor: pointer;
}
.tab svg { width: 24px; height: 24px; }
.tab { position: relative; }
.tab-badge {
  position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--bad); color: #fff; font: 700 .7rem/18px var(--f-body); text-align: center;
}
.tab[aria-current="page"] { color: var(--accent); }

@media (min-width: 900px) {
  .tabs { position: static; display: flex; gap: 4px; background: none; border: 0; padding: 0; }
  .tab { flex-direction: row; height: 40px; padding: 0 14px; border-radius: 999px; color: var(--plate-muted); font-size: .92rem; gap: 8px; }
  .tab svg { width: 20px; height: 20px; }
  .tab-badge { position: static; margin-left: 2px; }
  .tab:hover { color: var(--plate-ink); }
  .tab[aria-current="page"] { background: rgba(255,255,255,.1); color: var(--plate-ink); }
  .main { padding-block: 24px 48px; }
}

/* ---------- Estructura de vistas ---------- */
.view { display: flex; flex-direction: column; gap: 16px; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.cotizar-grid { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .cotizar-grid { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; gap: 24px; }
  .result { position: sticky; top: 80px; }
}

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; margin: 0; min-width: 0;
}
fieldset.card { display: flex; flex-direction: column; gap: 12px; }
legend, .card-legend {
  display: block; width: 100%; padding: 0; margin-bottom: 12px;
  font: 600 .78rem var(--f-body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
legend i { text-transform: none; letter-spacing: 0; font-style: normal; font-weight: 400; }
legend { float: left; }
legend + * { clear: both; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

.grid-2, .grid-3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: .88rem; font-weight: 600; }
.field > span i { font-style: normal; font-weight: 400; color: var(--muted); margin-left: 4px; }
.field small { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.field small.err { color: var(--bad); font-weight: 600; }
input[type="text"], input[type="tel"], input[type="search"], select {
  width: 100%; min-height: 46px; padding: 10px 12px;
  font: 500 1rem var(--f-body); color: var(--ink);
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  appearance: none; -webkit-appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px;
}
input[inputmode="decimal"], input[inputmode="numeric"] { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
input:focus, select:focus { outline: none; border-color: var(--accent); background: var(--surface); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-soft); }
input::placeholder { color: var(--muted); opacity: .7; }
.time-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.time-pair .unit { position: relative; }
.time-pair .unit input { padding-right: 40px; }
.time-pair .unit::after { content: attr(data-unit); position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; pointer-events: none; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: .92rem; }
.switch input { width: 22px; height: 22px; accent-color: var(--accent); }
.iva-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-top: 4px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline input { width: 90px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 .95rem var(--f-body); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.danger.solid { background: var(--bad); color: var(--surface); }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: .88rem; }
.btn.add { border-style: dashed; color: var(--accent); background: transparent; }
.btn.icon { min-height: 38px; width: 38px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Avisos ---------- */
.notice {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: var(--r);
  background: var(--accent-soft); border: 1px solid var(--line);
}
.notice.warn { background: var(--warn-soft); border-color: transparent; }
.notice.warn strong { color: var(--warn); }
.notice .btn { align-self: flex-start; }

/* ---------- Pieza (renglón) ---------- */
.item { position: relative; }
.item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.item-num {
  font: 600 .78rem var(--f-mono); color: var(--muted); letter-spacing: .04em; text-transform: uppercase;
}
.item-head .spacer { flex: 1; }
.item-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.item-grid .full { grid-column: 1 / -1; }
@media (min-width: 560px) { .item-grid { grid-template-columns: repeat(4, 1fr); } .item-grid .half { grid-column: span 2; } }

details.more summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; font: 600 1.2rem var(--f-mono); color: var(--accent); }
details.more[open] summary::after { content: "−"; }
details.more[open] summary { margin-bottom: 12px; }
.sum-hint { color: var(--muted); font-weight: 400; font-size: .88rem; margin-left: auto; font-family: var(--f-mono); }

/* ---------- Resultado (placa) ---------- */
.result { display: flex; flex-direction: column; gap: 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.plate {
  padding: 20px; color: var(--plate-ink);
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 2px, transparent 2px 6px),
    var(--plate);
}
.plate-label { font: 600 .74rem var(--f-body); text-transform: uppercase; letter-spacing: .1em; color: var(--plate-muted); }
.plate-total {
  font: 800 clamp(2.2rem, 9vw, 2.8rem)/1.1 var(--f-display); color: var(--hot);
  font-variant-numeric: tabular-nums; margin-top: 4px; overflow-wrap: anywhere;
}
.plate-sub { color: var(--plate-muted); font-size: .9rem; margin-top: 4px; }
.result-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.kv div { background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; min-width: 0; }
.kv dt { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kv dd { margin: 0; font: 600 .98rem var(--f-mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv dd.ok { color: var(--ok); }
.kv dd.bad { color: var(--bad); }
.bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.bar span { display: block; height: 100%; }
.breakdown { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: .92rem; }
.breakdown dt { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; }
.breakdown dt .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.breakdown dd { margin: 0; text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.breakdown .sep { grid-column: 1 / -1; height: 1px; background: var(--line); margin: 4px 0; }
.breakdown .strong { color: var(--ink); font-weight: 700; }
.errors { margin: 0; padding: 12px 16px 12px 32px; background: var(--bad-soft); color: var(--bad); font-size: .9rem; display: flex; flex-direction: column; gap: 4px; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px; border-top: 1px solid var(--line); }

/* Barra con total fija sobre las pestañas (solo celular) */
.minibar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); z-index: 25;
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  background: var(--plate); color: var(--plate-ink);
}
.minibar > div { flex: 1; display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.minibar small { color: var(--plate-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.minibar strong { font: 800 1.3rem var(--f-display); color: var(--hot); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.minibar .btn.ghost { color: var(--plate-ink); }
@media (min-width: 900px) { .minibar { display: none; } }
#view-cotizar[hidden] + .minibar, .minibar.off { display: none; }

/* ---------- Lista de presupuestos ---------- */
.filters { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font: 600 .85rem var(--f-body); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.count { color: var(--muted); font-family: var(--f-mono); font-size: .9rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; min-width: 0; }
.stats small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.stats strong { font: 600 1rem var(--f-mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.qlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qitem {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  width: 100%; text-align: left; padding: 14px 16px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); font: inherit; cursor: pointer;
}
.qitem:hover { border-color: var(--muted); }
.qitem .qn { font: 600 .78rem var(--f-mono); color: var(--muted); }
.qitem .qc { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.qitem .qt { font: 600 1.05rem var(--f-mono); text-align: right; font-variant-numeric: tabular-nums; }
.qitem .qd { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pill { justify-self: end; display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.pendiente { background: var(--warn-soft); color: var(--warn); }
.pill.aceptado { background: var(--ok-soft); color: var(--ok); }
.pill.rechazado { background: var(--bad-soft); color: var(--bad); }
.empty { text-align: center; padding: 32px 16px; display: flex; flex-direction: column; gap: 8px; align-items: center; color: var(--muted); }

/* ---------- Detalle ---------- */
.detail-head { display: flex; flex-direction: column; gap: 4px; }
.detail-head .qn { font: 600 .85rem var(--f-mono); color: var(--muted); }
.status-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.status-pick .chip[aria-pressed="true"].pendiente { background: var(--warn); border-color: var(--warn); color: var(--surface); }
.status-pick .chip[aria-pressed="true"].aceptado { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.status-pick .chip[aria-pressed="true"].rechazado { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.table-wrap { overflow-x: auto; }
table.items { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.items th, table.items td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.items th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
table.items td.n { text-align: right; font-family: var(--f-mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.items th.n { text-align: right; }

/* ---------- Ajustes: filas ---------- */
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.rows .info { flex: 1; min-width: 0; }
.rows .info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .info small { color: var(--muted); font-family: var(--f-mono); font-size: .8rem; }
.rows.parts .info small { display: block; font-family: var(--f-body); }
.rows.parts .info small + small { font-family: var(--f-mono); }
.rows .cost { font: 600 .95rem var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rows .empty-row { color: var(--muted); font-size: .9rem; }
.about { text-align: center; padding-top: 8px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 10, 16, .55); }
.modal-card {
  position: relative; width: 100%; max-width: 520px; max-height: 92%; overflow-y: auto;
  background: var(--surface); border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 14px;
}
@media (min-width: 600px) { .modal { align-items: center; } .modal-card { border-radius: 18px; padding: 24px; } }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.modal-actions .btn { flex: 1 1 auto; }
.share-text {
  width: 100%; min-height: 200px; padding: 12px; border-radius: var(--r-sm); border: 1.5px solid var(--line);
  background: var(--surface-2); color: var(--ink); font: .9rem/1.45 var(--f-mono); resize: vertical;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  bottom: calc(var(--tabbar-h) + 80px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: .92rem; box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
@media (min-width: 900px) { .toast { bottom: 32px; } }

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

/* ---------- v1.1: campos extra ---------- */
@media (min-width: 560px) { .grid-2 .full2 { grid-column: 1 / -1; } }
textarea, input[type="email"], input[type="date"] {
  width: 100%; min-height: 46px; padding: 10px 12px;
  font: 500 1rem/1.4 var(--f-body); color: var(--ink);
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--r-sm);
}
textarea { resize: vertical; }
textarea:focus, input[type="email"]:focus, input[type="date"]:focus { outline: none; border-color: var(--accent); background: var(--surface); }
input[type="date"] { font-family: var(--f-mono); }
input:disabled { opacity: .6; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Lectura de archivos */
.ico { width: 18px; height: 18px; flex: none; }
.file-btn { color: var(--accent); }
.file-btn.cargando { opacity: .7; pointer-events: none; }
.item-head { flex-wrap: wrap; }
.origen {
  display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--ok-soft); color: var(--ok); font-size: .84rem; overflow-wrap: anywhere;
}
.origen::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.origen.editado { background: var(--warn-soft); color: var(--warn); }
.lista-avisos { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--warn); }

/* Marca */
.logo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-box {
  width: 140px; height: 80px; border-radius: var(--r-sm); border: 1.5px dashed var(--line);
  display: flex; align-items: center; justify-content: center; padding: 8px; background: #fff; flex: none;
}
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.color-field { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.color-field input { width: 44px; height: 36px; padding: 0; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: none; cursor: pointer; }

/* Enviar */
.pdf-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px; border-radius: var(--r); background: var(--accent-soft);
}
.pdf-card > div:first-child { display: flex; flex-direction: column; min-width: 0; }

/* Órdenes */
.hint-ot { padding: 0 4px; }
.ot-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ot-link .info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ot-link .info .card-legend { margin: 0; }
.ot-link .pill { justify-self: start; width: max-content; }
.pill.ot-cola { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.ot-imprimiendo { background: var(--accent-soft); color: var(--accent); }
.pill.ot-postproceso { background: var(--warn-soft); color: var(--warn); }
.pill.ot-lista { background: var(--ok-soft); color: var(--ok); }
.pill.ot-entregada { background: var(--ink); color: var(--bg); }
.pill.ot-anulada { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
.row-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.row-pills .pill { justify-self: start; }
.stats .alerta { border-color: var(--bad); background: var(--bad-soft); }
.stats .alerta strong { color: var(--bad); }
.ot-item .pill:last-of-type { justify-self: end; }
.progress { grid-column: 1 / -1; display: block; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.progress > span { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.progress.big { height: 10px; margin: 0 0 8px; }
.pasos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
@media (min-width: 560px) { .paso { font-size: .8rem; } .pasos { gap: 8px; } }
.paso {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); font: 600 .68rem/1.15 var(--f-body);
  letter-spacing: -.01em; cursor: pointer; text-align: center; min-width: 0; overflow-wrap: normal; word-break: normal;
}
.paso-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font: 700 .78rem var(--f-mono); }
.paso.hecho { color: var(--ok); border-color: transparent; background: var(--ok-soft); }
.paso.hecho .paso-n { background: var(--ok); color: var(--surface); }
.paso.actual { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.paso.actual .paso-n { background: var(--accent-ink); color: var(--accent); }
.paso[disabled] { cursor: not-allowed; opacity: .55; }
.counter { display: flex; align-items: center; gap: 8px; flex: none; }
.counter .mono { min-width: 52px; text-align: center; }
.counter .btn.icon { font-size: 1.2rem; }
