/* Cotizador FLETODO
   Concepto: una guía de despacho de bolsillo. La ruta se dibuja como carretera (lo memorable);
   el precio sale en un ticket troquelado; todo lo demás, sobrio y rápido de tocar. */
:root {
  --marino: #0B1633;
  --azul: #2F6BFF;
  --azul-osc: #1747C9;
  --naranja: #F2762E;
  --verde: #17915A;
  --rojo: #D9343B;

  --bg: #ECEFF5;
  --surface: #FFFFFF;
  --surface-2: #F3F5FA;
  --line: #D6DCE8;
  --ink: #0B1633;
  --muted: #5A6483;
  --soft: #E3E8F3;
  --on-azul: #FFFFFF;
  --chip-ok-bg: #DDF3E8; --chip-ok: #0F6B41;
  --chip-no-bg: #FBE3E4; --chip-no: #A51F26;
  --chip-pen-bg: #FFEBDC; --chip-pen: #9A4510;
  --road: #0B1633; --road-2: #18264D; --road-line: #F7F2E7;
  --shadow: 0 1px 2px rgba(11, 22, 51, .06), 0 8px 24px rgba(11, 22, 51, .07);

  --f-display: "Montserrat", "Arial Black", system-ui, sans-serif;
  --f-body: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-s: 8px; --r-m: 12px; --r-l: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070C1C; --surface: #0F1731; --surface-2: #142043; --line: #24305A; --ink: #E9EDF8; --muted: #9BA6C8; --soft: #1A2650;
    --azul: #5B8BFF; --azul-osc: #3E70F2;
    --chip-ok-bg: #0F3424; --chip-ok: #7FE0AE; --chip-no-bg: #3B171B; --chip-no: #FF9EA3; --chip-pen-bg: #3A2514; --chip-pen: #FFB98A;
    --road: #050A18; --road-2: #0E1834;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--naranja); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Barra superior ---------- */
.top {
  position: sticky; top: 0; z-index: 30; background: var(--marino); color: #fff;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
}
.top-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { font-family: var(--f-display); font-weight: 900; font-size: 22px; letter-spacing: .01em; color: #fff; }
.brand-mark b { color: var(--naranja); font-weight: 900; }
.brand-sub { font-size: 13px; color: #AFC0EC; }
.top .yo { margin-left: auto; font-size: 13px; color: #AFC0EC; }

/* Navegación: abajo en teléfono, arriba en escritorio */
.nav {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
}
.nav button {
  background: none; border: 0; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: var(--r-s);
  font-size: 11.5px; font-weight: 600; color: var(--muted); position: relative;
}
.nav svg { width: 22px; height: 22px; }
.nav button[aria-current="page"] { color: var(--azul); }
.nav .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--naranja); color: #fff; font-size: 11px; line-height: 18px; }
@media (min-width: 960px) {
  .nav { position: static; display: flex; gap: 4px; background: none; border: 0; padding: 0; margin-left: 24px; }
  .nav button { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 14px; color: #AFC0EC; }
  .nav svg { width: 18px; height: 18px; }
  .nav button[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .1); }
  .nav .badge { position: static; }
}

/* ---------- Contenedor ---------- */
.wrap {
  max-width: 1180px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 18px calc(150px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 960px) { .wrap { padding-block: 28px 60px; } }
.view { display: grid; gap: 18px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h2.view-title { font-family: var(--f-display); font-weight: 800; font-size: 24px; }

/* ---------- Cotizar: grilla ---------- */
.cotizar { display: grid; gap: 18px; align-items: start; }
@media (min-width: 960px) { .cotizar { grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; } .ticket-col { position: sticky; top: 84px; } }

.paso { background: var(--surface); border-radius: var(--r-l); padding: 18px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.paso-h { display: flex; align-items: center; gap: 10px; }
.paso-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--marino); color: #fff; font: 800 14px var(--f-display); flex: none; }
.paso-h h3 { font-family: var(--f-display); font-weight: 800; font-size: 18px; }
.paso-h .aux { margin-left: auto; }

.link { background: none; border: 0; padding: 4px 0; color: var(--azul); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Direcciones ---------- */
.dirs { display: grid; gap: 10px; position: relative; }
.dir { position: relative; }
.dir-field {
  display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--r-m); padding: 4px 12px;
}
.dir-field:focus-within { border-color: var(--azul); background: var(--surface); }
.pin { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.pin.o { background: var(--naranja); }
.pin.d { background: var(--azul); }
.dir-field input { border: 0; background: none; padding: 10px 0; width: 100%; min-width: 0; font-size: 16px; outline: none; }
.dir-field input::placeholder { color: var(--muted); }
.dir-clear { border: 0; background: none; color: var(--muted); padding: 6px; font-size: 18px; line-height: 1; }
.swap {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%); z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--ink);
}
.swap svg { width: 18px; height: 18px; }
.sug {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-m); box-shadow: var(--shadow); overflow: hidden; max-height: 320px; overflow-y: auto;
}
.sug button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.sug button:last-child { border-bottom: 0; }
.sug button[aria-selected="true"], .sug button:hover { background: var(--surface-2); }
.sug b { display: block; font-weight: 600; }
.sug span { font-size: 13px; color: var(--muted); }
.sug .sug-msg { padding: 12px 14px; font-size: 14px; color: var(--muted); }

.lugar-sel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 2px 52px 0 34px; font-size: 13px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; }
.tag.ok { background: var(--chip-ok-bg); color: var(--chip-ok); }
.tag.fuera { background: var(--soft); color: var(--muted); }
.tag.warn { background: var(--chip-no-bg); color: var(--chip-no); }

.manual { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.manual .full { grid-column: 1 / -1; }
.field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 0; }
.field input, .field select, .field textarea {
  background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--r-s); padding: 10px 12px; font-size: 16px; font-weight: 500; color: var(--ink); width: 100%; min-width: 0;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--azul); background: var(--surface); outline: none; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--azul); }

/* ---------- La carretera ---------- */
.road {
  position: relative; border-radius: var(--r-m); background: var(--road); color: #fff; overflow: hidden; padding: 14px 16px 16px;
  background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1px); background-size: 6px 6px;
}
.road-cities { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: #B8C4E6; }
.road-cities b { display: block; color: #fff; font: 800 16px var(--f-display); }
.road-cities .r { text-align: right; }
.road-track { position: relative; height: 46px; margin-top: 8px; }
.road-asphalt { position: absolute; left: 0; right: 0; top: 13px; height: 20px; border-radius: 10px; background: var(--road-2); display: flex; overflow: hidden; }
.road-extra { height: 100%; background: repeating-linear-gradient(135deg, rgba(242,118,46,.28) 0 6px, transparent 6px 12px); }
.road-main { height: 100%; flex: 1; position: relative; }
.road-main::after { content: ""; position: absolute; left: 10px; right: 10px; top: 9px; height: 2px; background: repeating-linear-gradient(90deg, var(--road-line) 0 14px, transparent 14px 26px); opacity: .55; }
.road-dot { position: absolute; top: 15px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--road); transform: translateX(-50%); }
.road-dot.o { background: var(--naranja); }
.road-dot.d { background: var(--azul); left: calc(100% - 8px); transform: none; }
.road-truck { position: absolute; top: 0; width: 34px; height: 22px; transform: translateX(-50%); color: #fff; transition: left 1.1s cubic-bezier(.3,.7,.2,1); }
.road-km {
  position: absolute; left: 50%; top: 13px; transform: translateX(-50%); background: var(--road); padding: 0 10px; height: 20px; border-radius: 10px;
  font: 800 13px/20px var(--f-display); white-space: nowrap;
}
.road-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 12.5px; color: #B8C4E6; }
.road-foot .ex { color: #FFB98A; }
.road.empty .road-cities b { color: #6F7FAE; }
.road.loading .road-km { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }

.alert { border-radius: var(--r-m); padding: 12px 14px; font-size: 14px; font-weight: 600; background: var(--chip-no-bg); color: var(--chip-no); }
.alert.info { background: var(--chip-pen-bg); color: var(--chip-pen); }

/* ---------- Unidades ---------- */
.units { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .units { grid-template-columns: repeat(4, 1fr); } }
.unit {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-m); padding: 12px 10px 12px; text-align: left; display: grid; gap: 2px; align-content: end; min-height: 128px; position: relative;
}
.unit svg { height: 40px; width: auto; color: var(--marino); margin-bottom: 6px; }
.unit .u-name { font: 800 14px var(--f-display); }
.unit .u-kg { font: 900 22px/1.05 var(--f-display); letter-spacing: -.01em; }
.unit .u-kg small { font-size: 13px; font-weight: 800; }
.unit .u-cap { font-size: 12px; color: var(--muted); }
.unit[aria-pressed="true"] { background: var(--azul); border-color: var(--azul); color: var(--on-azul); }
.unit[aria-pressed="true"] svg { color: #fff; }
.unit[aria-pressed="true"] .u-cap { color: #DDE6FF; }
@media (prefers-color-scheme: dark) { .unit svg { color: var(--ink); } }

/* ---------- Chips, steppers ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--marino); border-color: var(--marino); color: #fff; }
@media (prefers-color-scheme: dark) { .chip[aria-pressed="true"] { background: var(--azul); border-color: var(--azul); } }
.sub-h { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }

.extras { display: grid; gap: 2px; }
.extra { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.extra:last-child { border-bottom: 0; }
.extra .e-txt { flex: 1; min-width: 0; }
.extra .e-txt b { display: block; font-weight: 600; }
.extra .e-txt span { font-size: 13px; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface); font-size: 20px; font-weight: 600; line-height: 1; box-shadow: 0 1px 2px rgba(11,22,51,.1); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper output { min-width: 22px; text-align: center; font: 800 16px var(--f-display); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 15px; background: var(--line); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--azul); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--naranja); outline-offset: 2px; }

details.cliente summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); list-style: none; }
details.cliente summary::before { content: "+ "; }
details.cliente[open] summary::before { content: "− "; }
details.cliente .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }

/* ---------- Ticket ---------- */
.ticket { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.ticket-head { background: var(--marino); color: #fff; padding: 16px 18px 22px; position: relative; }
.ticket-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 14px;
  background: radial-gradient(circle at 7px 7px, var(--surface) 6px, transparent 6.5px) 0 0 / 18px 14px repeat-x;
}
.ticket-head .t-lbl { font-size: 13px; color: #AFC0EC; }
.ticket-total { font: 900 54px/1 var(--f-display); letter-spacing: -.02em; margin-top: 4px; display: flex; align-items: baseline; gap: 6px; }
.ticket-total small { font-size: 22px; color: #AFC0EC; font-weight: 800; }
.ticket-head .t-ruta { margin-top: 8px; font-size: 14px; color: #DCE4FA; }
.ticket-body { padding: 18px; display: grid; gap: 14px; }
.lines { display: grid; gap: 6px; font-size: 14px; }
.line { display: flex; justify-content: space-between; gap: 10px; }
.line span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.line.mut { color: var(--muted); font-size: 13px; }
.line.tot { border-top: 1.5px dashed var(--line); padding-top: 8px; font-weight: 800; font-size: 15px; }
.ajuste { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: var(--r-m); padding: 8px 12px; }
.ajuste label { font-size: 13px; font-weight: 700; color: var(--muted); flex: 1; }
.ajuste input { width: 110px; border: 1.5px solid var(--line); border-radius: var(--r-s); padding: 8px 10px; font: 800 18px var(--f-display); text-align: right; background: var(--surface); }
.ajuste .dif { font-size: 12px; color: var(--muted); }
.bubble {
  background: #DCF8C6; color: #13301A; border-radius: 12px 12px 4px 12px; padding: 12px 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
  max-height: 340px; overflow: auto;
}
@media (prefers-color-scheme: dark) { .bubble { background: #1D3B27; color: #DFF5E4; } }
.btn { border: 0; border-radius: var(--r-m); padding: 14px 18px; font: 800 15px var(--f-display); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--azul); color: var(--on-azul); }
.btn-primary:hover { background: var(--azul-osc); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ok { background: var(--verde); color: #fff; }
.btn-no { background: var(--surface-2); color: var(--chip-no); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: var(--r-s); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btns .btn { flex: 1 1 auto; }

/* Barra fija en teléfono con el total */
.mini {
  position: fixed; z-index: 35; left: 0; right: 0; bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: var(--marino); color: #fff; display: flex; align-items: center; gap: 12px;
}
.mini .m-tot { font: 900 26px/1 var(--f-display); }
.mini .m-sub { font-size: 12px; color: #AFC0EC; }
.mini .btn { margin-left: auto; padding: 11px 16px; }
@media (min-width: 960px) { .mini { display: none !important; } }

/* ---------- Listas ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .field { flex: 1 1 200px; }
.list { display: grid; gap: 10px; }
.item { background: var(--surface); border-radius: var(--r-m); padding: 14px; box-shadow: var(--shadow); display: grid; gap: 8px; border-left: 4px solid var(--line); }
.item.pendiente { border-left-color: var(--naranja); }
.item.cerrada { border-left-color: var(--verde); }
.item.perdida { border-left-color: var(--rojo); }
.item-1 { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.item-ruta { font: 800 16px var(--f-display); min-width: 0; overflow-wrap: anywhere; }
.item-monto { font: 900 20px var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); align-items: center; }
.st { font-weight: 700; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; }
.st.pendiente { background: var(--chip-pen-bg); color: var(--chip-pen); }
.st.cerrada { background: var(--chip-ok-bg); color: var(--chip-ok); }
.st.perdida { background: var(--chip-no-bg); color: var(--chip-no); }
.st.sin { background: var(--soft); color: var(--muted); }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--r-l); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- Mes ---------- */
.monthnav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.monthnav b { font: 800 20px var(--f-display); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border-radius: var(--r-m); padding: 14px; box-shadow: var(--shadow); }
.kpi small { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi b { display: block; font: 900 28px/1.15 var(--f-display); font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.panel { background: var(--surface); border-radius: var(--r-l); padding: 18px; box-shadow: var(--shadow); display: grid; gap: 12px; min-width: 0; }
.panel h3 { font: 800 17px var(--f-display); }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 92px 1fr 70px; gap: 10px; align-items: center; font-size: 14px; }
.track { height: 14px; background: var(--surface-2); border-radius: 7px; position: relative; overflow: hidden; }
.track .a { position: absolute; inset: 0 auto 0 0; background: var(--azul); opacity: .28; border-radius: 7px; }
.track .c { position: absolute; inset: 0 auto 0 0; background: var(--verde); border-radius: 7px; }
.bar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Tablas ---------- */
.scroll { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 8px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.t td:first-child { white-space: normal; min-width: 150px; }
table.t td { white-space: nowrap; padding: 9px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; vertical-align: middle; }
table.t input { width: 86px; padding: 6px 8px; border-radius: var(--r-s); border: 1.5px solid var(--line); background: var(--surface); }
.dif-pos { color: var(--chip-pen); font-weight: 700; }
.dif-neg { color: var(--azul); font-weight: 700; }
.meter { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--azul); border-radius: 5px; }

/* ---------- Entrar / configurar ---------- */
.login, body.setup { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--marino); }
.login-card, .setup-card { width: 100%; max-width: 420px; background: var(--surface); color: var(--ink); border-radius: var(--r-l); padding: 26px 22px; display: grid; gap: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.setup-card { max-width: 560px; }
.login-card .brand-mark, .setup-card .brand-mark { color: var(--ink); }
.login-card .brand-sub, .setup-card .brand-sub { color: var(--muted); }
.login-card h1, .setup-card h1 { font: 800 24px var(--f-display); }
.login-card label, .setup-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.login-card input, .setup-form input { background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--r-s); padding: 11px 12px; font-size: 16px; color: var(--ink); }
.login-card input:focus, .setup-form input:focus { border-color: var(--azul); outline: none; }
.setup-form { display: grid; gap: 18px; }
.setup-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.setup-form legend { font: 800 16px var(--f-display); margin-bottom: 4px; }
.setup-form .row2 { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }

.toast {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(140px + env(safe-area-inset-bottom, 0px));
  background: var(--marino); color: #fff; padding: 11px 18px; border-radius: var(--r-m); font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.3); max-width: calc(100% - 32px);
}
@media (min-width: 960px) { .toast { bottom: 28px; } }

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

/* ---------- Peso y medidas ---------- */
.medidas { display: grid; gap: 8px; margin-bottom: 12px; }
.med-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.med-grid.tres { grid-template-columns: repeat(3, 1fr); }
#unitAviso { display: grid; gap: 8px; margin-top: 10px; }
#unitAviso:empty { display: none; }
.sugiere { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; border-radius: var(--r-m); padding: 10px 12px; font-size: 14px; background: var(--chip-pen-bg); color: var(--chip-pen); }
.sugiere.ok { background: var(--surface-2); color: var(--ink); }
.sugiere .btn { padding: 8px 14px; font-size: 14px; }

/* Usuarios y vista por vendedor (22 nov 2026) */
.tag.pen { background: var(--chip-pen-bg); color: var(--chip-pen); }
.chips.ver { margin: 2px 0 4px; }
.panel .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .panel .grid2 { grid-template-columns: 1fr; } }
.aviso-seg { margin-bottom: 14px; }
.aviso-seg .link { font: inherit; text-decoration: underline; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
