/* DeCA Avanza · sistema de diseño.
   Tokens → base → estructura → componentes. La marca de cada cliente entra por --brand-source
   (base.html) y todo lo demás se deriva de ella. Claro y oscuro siguen al sistema. */

:root {
  --brand-source: #0b5fa5;
  --ink: #17202c;
  --muted: #5b6676;
  --line: #dde2ea;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --brand: var(--brand-source);
  --brand-ink: #ffffff;
  --brand-soft: color-mix(in oklab, var(--brand-source) 10%, #ffffff);
  --ok: #17794a;
  --ok-soft: #e0f4e9;
  --warn: #8a5a00;
  --warn-soft: #fdefcf;
  --err: #b3261e;
  --err-soft: #fde7e5;
  --info: #5b4bb7;
  --info-soft: #ebe8fb;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 4px 16px rgb(16 24 40 / 5%);
  --radius: 12px;
  --sidebar: 15rem;
  color-scheme: light dark;
  accent-color: var(--brand);

  /* Navegadores sin light-dark(): el oscuro llega por la media query. */
  @media (prefers-color-scheme: dark) {
    --ink: #e7ebf1;
    --muted: #a0abba;
    --line: #2b3441;
    --bg: #10151c;
    --surface: #171e27;
    --surface-2: #1d2530;
    --brand: color-mix(in oklab, var(--brand-source) 55%, #ffffff);
    --brand-ink: #0c1118;
    --brand-soft: color-mix(in oklab, var(--brand-source) 28%, #171e27);
    --ok: #5fd39a;
    --ok-soft: #153526;
    --warn: #f0c060;
    --warn-soft: #3a2c0c;
    --err: #ff8a80;
    --err-soft: #3d1a17;
    --info: #b3a8ff;
    --info-soft: #262048;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
  }
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .14s; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--brand); text-underline-offset: 2px; }
h1 { font-size: 1.5rem; line-height: 1.2; margin: 0 0 .3rem; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 1.02rem; margin: 0 0 .7rem; }
h3 { font-size: .9rem; margin: 1.1rem 0 .4rem; }
.card h2:not(:first-child) { margin-top: 1.6rem; }
p { margin: .4rem 0; }
code { overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--line); padding: .05rem .3rem; border-radius: 5px; font-size: .86em; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.18em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* --- Estructura ------------------------------------------------------------------------ */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; align-self: start; height: 100dvh; display: flex; flex-direction: column;
  gap: .25rem; padding: 1rem .75rem; background: var(--surface); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem 1rem; font-weight: 700; line-height: 1.2; text-decoration: none; color: var(--ink); }
.brand { min-width: 0; }
.brand img { width: auto; height: auto; max-height: 2.4rem; max-width: 100%; object-fit: contain; }
.brand-mark { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font-weight: 800; flex: none; }
.nav { display: flex; flex-direction: column; gap: .15rem; }
.nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .65rem; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.nav .count { margin-left: auto; font-size: .72rem; padding: .05rem .45rem; border-radius: 99px; background: var(--warn-soft); color: var(--warn); }
.sidebar-foot { margin-top: auto; padding: .6rem .5rem 0; border-top: 1px solid var(--line); font-size: .84rem; }
.sidebar-foot form { margin: .2rem 0 0; }
.main { min-width: 0; }
.shell { max-width: 76rem; margin: 0 auto; padding: 1.5rem 1.5rem 4rem; }
.shell.narrow { max-width: 30rem; padding-top: 3rem; }
.narrow { max-width: 28rem; margin: 3rem auto; }
.page-head { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: start; justify-content: space-between; margin-bottom: 1.1rem; }
.page-head .actions { margin: 0; }
.crumb { font-size: .84rem; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: .25rem; margin-bottom: .3rem; }
.topbar { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: .8rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar form { margin: 0; }

@media (max-width: 60rem) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: auto 0 0 0; top: auto; height: auto; z-index: 20; flex-direction: row; padding: .3rem .4rem calc(.3rem + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line);
  }
  .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .nav a { flex-direction: column; gap: .1rem; font-size: .68rem; padding: .35rem .4rem; min-width: 3.4rem; text-align: center; }
  .nav .icon { width: 1.4rem; height: 1.4rem; }
  .nav .count { position: absolute; margin: -.2rem 0 0 1.6rem; }
  .shell { padding: 1rem .9rem 6rem; }
  .mobile-top { display: flex !important; }
}
.mobile-top { display: none; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem .9rem; background: var(--surface); border-bottom: 1px solid var(--line); font-weight: 700; }
.mobile-top form { margin: 0; }

/* --- Superficies ----------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card > h2:first-child { display: flex; align-items: center; gap: .5rem; }
.card.flush { padding: 0; overflow: hidden; }
.card.accent { border-color: color-mix(in oklab, var(--brand) 35%, var(--line)); background: linear-gradient(180deg, var(--brand-soft), var(--surface) 70%); }
.columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(18rem, 1fr); gap: 1rem; align-items: start; }
.columns > aside { position: sticky; top: 1rem; }
@media (max-width: 68rem) { .columns { grid-template-columns: 1fr; } .columns > aside { position: static; } }
details.card > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: .5rem; }
details.card > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: rotate .15s; }
details.card[open] > summary::after { rotate: 180deg; }
details.card[open] > summary { margin-bottom: .8rem; }
details:not(.card) > summary { cursor: pointer; color: var(--brand); font-weight: 600; }

/* --- Botones --------------------------------------------------------------------------- */
button, .button {
  font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 2.5rem; padding: .5rem 1rem; border-radius: 9px; border: 1px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none; transition: filter .12s, background .12s;
}
button:hover, .button:hover { filter: brightness(1.08); }
button.secondary, .button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
button.secondary:hover, .button.secondary:hover { background: var(--surface-2); filter: none; }
button.danger, .button.danger { background: var(--err); border-color: var(--err); color: #fff; }
button.link { min-height: 0; background: none; border: 0; color: var(--brand); padding: 0; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
button.link.danger { color: var(--err); background: none; }
button.big, .button.big { display: flex; width: 100%; min-height: 3.1rem; font-size: 1.05rem; }
button.icon-only { min-height: 2.1rem; min-width: 2.1rem; padding: .3rem; background: var(--surface); color: var(--muted); border-color: var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
.actions form { margin: 0; }

/* --- Formularios ----------------------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local],
input[type=url], input[type=search], input[type=file], select, textarea {
  width: 100%; font: inherit; color: inherit; min-height: 2.5rem; padding: .45rem .65rem; border: 1px solid var(--line);
  border-radius: 9px; background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 22%, transparent); }
input:user-invalid, select:user-invalid, textarea:user-invalid { border-color: var(--err); background: var(--err-soft); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
input[type=color] { width: 4rem; height: 2.5rem; padding: .15rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
input[type=checkbox], input[type=radio] { width: 1.05rem; height: 1.05rem; margin-right: .45rem; vertical-align: -.15em; }
fieldset { border: 0; margin: 1.3rem 0 0; padding: 0; min-width: 0; }
legend { display: block; width: 100%; font-weight: 700; padding: 1rem 0 .7rem; border-top: 1px solid var(--line); }
fieldset:first-of-type { margin-top: .4rem; }
fieldset:first-of-type > legend { border-top: 0; padding-top: 0; }
fieldset.choices > legend { border-top: 0; padding: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .9rem 1rem; }
.field { min-width: 0; }
.field.check > label { display: flex; align-items: center; gap: .1rem; font-weight: 500; min-height: 2.5rem; cursor: pointer; }
.grid > .field.check { align-self: end; }
.field > label::after, .field legend::after { content: none; }
fieldset > .field, .stack > .field { margin-bottom: .9rem; }
.grid > .field { margin-bottom: 0; }
fieldset.choices { border: 0; margin: 0; padding: 0; }
fieldset.choices legend { font-size: .86rem; margin-bottom: .3rem; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--err); }
.helptext { display: block; color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.errorlist { list-style: none; margin: .25rem 0; padding: 0; color: var(--err); font-size: .86rem; font-weight: 600; }
div:has(> input[type=checkbox]) > label, label:has(> input[type=checkbox]) { display: inline; font-weight: 500; }
form div > div label, form ul label { font-weight: 500; display: block; }
form ul { list-style: none; margin: 0; padding: 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.inline-form > div, .inline-form > input { flex: 1 1 12rem; }
.field-copy { display: flex; gap: .4rem; align-items: center; }
.field-copy input { flex: 1; min-width: 0; font-size: .84rem; }
.savebar { position: sticky; bottom: 0; margin: 1.2rem -1.25rem -1.15rem; padding: .8rem 1.25rem; background: color-mix(in oklab, var(--surface) 92%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: .6rem; justify-content: flex-end; }
@media (max-width: 60rem) { .savebar { bottom: 3.9rem; } }

/* --- Estados, avisos y datos ------------------------------------------------------------ */
.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 700; padding: .12rem .55rem; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok, .st-issued { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn, .st-draft { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.err, .st-cancelled { background: var(--err-soft); color: var(--err); border-color: transparent; }
.st-ready { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.st-in_service { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.notice { display: flex; gap: .6rem; align-items: start; padding: .7rem .9rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); margin: .6rem 0; }
.notice.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.notice.err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.notice ul { margin: .2rem 0 0; padding-left: 1.1rem; }
.warnings { margin: .5rem 0; padding: .6rem .9rem .6rem 2rem; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: .9rem; }
p.warnings { padding-left: .9rem !important; }
dl.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .9rem 1.2rem; margin: 0; }
dl.facts dt { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .1rem; }
dl.facts dd { margin: 0; }
dl.facts.one { grid-template-columns: 1fr; }
.route { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.route .icon { color: var(--muted); }
.stop { border-left: 3px solid var(--brand); padding: .2rem 0 .2rem .8rem; margin: .8rem 0; }
.qr { display: block; margin: .6rem auto; border-radius: 10px; background: #fff; padding: .4rem; border: 1px solid var(--line); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .icon { width: 2.4rem; height: 2.4rem; opacity: .6; }

/* Recorrido del servicio */
.stepper { display: flex; gap: 0; list-style: none; margin: 0 0 1rem; padding: 0; counter-reset: step; }
.stepper.card { padding: 1rem .5rem .8rem; }
.stepper li { flex: 1; position: relative; padding-top: 1.9rem; text-align: center; font-size: .78rem; font-weight: 600; color: var(--muted); counter-increment: step; }
.stepper li::before { content: counter(step); position: absolute; top: 0; left: 50%; translate: -50%; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); font-size: .74rem; z-index: 1; }
.stepper li::after { content: ""; position: absolute; top: .7rem; left: -50%; width: 100%; height: 2px; background: var(--line); }
.stepper li:first-child::after { display: none; }
.stepper li.done { color: var(--ink); }
.stepper li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper li.done::after, .stepper li.now::after { background: var(--ok); }
.stepper li.now { color: var(--brand); }
.stepper li.now::before { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 4px var(--brand-soft); }

/* Indicadores del panel */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: border-color .12s, translate .12s; }
.stat:hover { border-color: var(--brand); translate: 0 -1px; }
.stat b { display: block; font-size: 1.9rem; line-height: 1.1; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .84rem; font-weight: 600; }
.stat.attn b { color: var(--warn); }
@media (max-width: 40rem) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .stat { padding: .6rem .8rem; }
  .stat b { font-size: 1.4rem; }
}
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; gap: .8rem; align-items: center; padding: .7rem 1.25rem; border-top: 1px solid var(--line); }
.todo li:first-child { border-top: 0; }
.todo .what { flex: 1; min-width: 0; }
.todo .what a { font-weight: 700; text-decoration: none; color: var(--ink); }
.todo .what small { display: block; color: var(--muted); }
.dot { width: 2.1rem; height: 2.1rem; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--warn-soft); color: var(--warn); }
.dot.ok { background: var(--brand-soft); color: var(--brand); }
.dot.err { background: var(--err-soft); color: var(--err); }
.dot.info { background: var(--info-soft); color: var(--info); }

/* --- Tablas y listas ------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; container-type: inline-size; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td form { display: inline; margin: 0; }
td select { width: auto; }
td.num, th.num { text-align: right; }
.card.flush .table-wrap th:first-child, .card.flush .table-wrap td:first-child { padding-left: 1.25rem; }
/* En estrecho, cada fila es una ficha y cada celda lleva su etiqueta (data-label). */
@container (width < 40rem) {
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; }
  table.stack thead { display: none; }
  table.stack tr { padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
  table.stack td { border: 0; padding: .12rem 0 !important; }
  table.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .78rem; font-weight: 600; }
  table.stack td:empty { display: none; }
}
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .8rem; border-radius: 99px; text-decoration: none; color: var(--muted); font-weight: 600; border: 1px solid var(--line); background: var(--surface); }
.tabs a.active, .tabs a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.tabs a b { font-size: .74rem; padding: 0 .35rem; border-radius: 99px; background: color-mix(in oklab, currentColor 14%, transparent); }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .9rem; }
.toolbar input[type=search] { flex: 1 1 14rem; max-width: 24rem; }
.toolbar input[type=date] { width: auto; }
.bulkbar { display: none; position: sticky; bottom: 1rem; margin: 1rem auto 0; width: fit-content; max-width: 100%; padding: .55rem .6rem .55rem 1rem; border-radius: 99px; background: var(--ink); color: var(--bg); align-items: center; gap: .9rem; box-shadow: var(--shadow); }
form:has(input[name=service]:checked) .bulkbar { display: flex; }
@media (max-width: 60rem) { .bulkbar { bottom: 4.6rem; } }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 .9rem 1.4rem; border-left: 2px solid var(--line); margin-left: .35rem; }
.timeline li:last-child { border-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -.42rem; top: .3rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.timeline time { display: block; font-size: .78rem; color: var(--muted); }

/* --- Mensajes, diálogos y copia --------------------------------------------------------- */
.messages { list-style: none; margin: 0; padding: 0; position: fixed; z-index: 40; top: 1rem; right: 1rem; display: grid; gap: .5rem; max-width: min(26rem, calc(100vw - 2rem)); }
.messages li { padding: .7rem 1rem; border-radius: 10px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-weight: 600; border-left: 4px solid var(--ok); animation: toast-in .2s ease-out; }
.messages li.error { border-left-color: var(--err); }
.messages li.warning { border-left-color: #e0a100; }
.messages li.leaving { opacity: 0; translate: 0 -6px; transition: opacity .25s, translate .25s; }
@keyframes toast-in { from { opacity: 0; translate: 0 -8px; } }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 1.3rem; max-width: min(28rem, calc(100vw - 2rem)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / 30%); }
dialog h1 { font-size: 1.15rem; margin-bottom: .5rem; }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgb(10 15 22 / 50%); overflow: hidden; overscroll-behavior: contain; }
.copy { position: relative; display: inline-flex; }
.copy .tip { position: absolute; inset: auto 0 calc(100% + 4px) auto; padding: .15rem .5rem; border-radius: 6px; background: var(--ink); color: var(--bg); font-size: .75rem; white-space: nowrap; opacity: 0; transition: opacity .15s; pointer-events: none; }
.copy button[data-copied] + .tip, .copy button[data-failed] + .tip { opacity: 1; }

/* --- Puesta en marcha ------------------------------------------------------------------ */
.wizard { display: grid; grid-template-columns: 16rem 1fr; gap: 1.25rem; align-items: start; }
.wizard > * { min-width: 0; }
@media (max-width: 52rem) {
  .wizard { grid-template-columns: 1fr; gap: .6rem; }
  /* En móvil los pasos son una tira: solo se lee el título del paso actual. */
  .wizard > nav.card { padding: .5rem .6rem; margin-bottom: 0; display: flex; align-items: center; gap: .6rem; }
  .wizard > nav p { margin: 0 0 0 auto; white-space: nowrap; font-size: .84rem; }
  .wizard .steps { display: flex; gap: .15rem; overflow-x: auto; flex: 1; min-width: 0; }
  .wizard .steps li { padding: .3rem; flex: none; white-space: nowrap; }
  .wizard .steps li:not(.current) > :not(.badge) { display: none; }
}
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: .6rem; align-items: center; padding: .5rem .6rem; border-radius: 9px; color: var(--muted); }
.steps li.current { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.steps a { color: inherit; text-decoration: none; }
.badge { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--line); color: var(--ink); }
.done .badge { background: var(--ok); color: #fff; }
.logo-preview { max-height: 3.5rem; max-width: 14rem; display: block; margin: .3rem 0; }

/* --- Páginas externas (colaborador, firma): móvil primero ------------------------------ */
.external input, .external select, .external textarea { font-size: 16px; min-height: 3rem; }
.external fieldset > div { margin-bottom: .9rem; }
.external .shell { padding-bottom: 2rem; }

/* --- Pendientes y procedencia ---------------------------------------------------------- */
.pendings { list-style: none; margin: .6rem 0; padding: 0; display: grid; gap: .5rem; }
.pendings li { padding: .7rem .9rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--err); }
.pendings li.soft { border-left-color: var(--warn); }
.pendings .head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.pendings textarea { font-size: .86rem; }
.pill.origin { font-weight: 600; font-size: .7rem; margin-top: .15rem; white-space: normal; }
dl.facts.review { margin: .7rem 0 0; padding: .8rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
