:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1b1a17;
  --muted: #6c685f;
  --line: #e6e3da;
  --line-strong: #d3cfc3;
  --accent: #d94a24;
  --accent-ink: #ffffff;
  --accent-soft: #fbe9e3;
  --ok: #2b8a57;
  --ok-soft: #e3f3ea;
  --bad: #c2352b;
  --bad-soft: #fbe8e6;
  --wait: #8b6a1f;
  --wait-soft: #f6eed9;
  --shadow: 0 1px 2px rgb(27 26 23 / 6%), 0 8px 24px -12px rgb(27 26 23 / 18%);
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}

/* Tema: index.html fija data-theme (claro u oscuro) antes de pintar. Sin ese atributo, vale el del sistema. */
:root[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #121110;
    --surface: #1b1a18;
    --surface-2: #211f1c;
    --ink: #f3f0e8;
    --muted: #a09a8d;
    --line: #2d2b27;
    --line-strong: #3d3a34;
    --accent: #f0663f;
    --accent-ink: #1b0d08;
    --accent-soft: #3a211a;
    --ok: #52c488;
    --ok-soft: #173325;
    --bad: #f0786d;
    --bad-soft: #3a1e1b;
    --wait: #e0be6d;
    --wait-soft: #35291a;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px -12px rgb(0 0 0 / 60%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121110;
  --surface: #1b1a18;
  --surface-2: #211f1c;
  --ink: #f3f0e8;
  --muted: #a09a8d;
  --line: #2d2b27;
  --line-strong: #3d3a34;
  --accent: #f0663f;
  --accent-ink: #1b0d08;
  --accent-soft: #3a211a;
  --ok: #52c488;
  --ok-soft: #173325;
  --bad: #f0786d;
  --bad-soft: #3a1e1b;
  --wait: #e0be6d;
  --wait-soft: #35291a;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px -12px rgb(0 0 0 / 60%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;   /* el pie queda abajo aunque la página sea corta */
}
.top, .layout, .admin-main, .auth-wrap, .soon { width: 100%; }   /* en una columna flex, el margen auto los encogería */
h1, h2, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Cabecera */
.top {
  max-width: 1280px; margin: 0 auto; padding: 22px 28px 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; border-radius: 12px; }
.brand:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 4px; }
.brand h1 { font-size: 19px; line-height: 1.1; letter-spacing: -0.01em; font-weight: 650; }
.brand p { font-size: 13px; color: var(--muted); }
.brand .brand-name { font-size: 19px; color: var(--ink); }   /* gana a '.brand p': el nombre se ve igual en todas las páginas */
.logo { width: 38px; height: 38px; }
.logo-bg { fill: var(--ink); }
.logo-lines { stroke: var(--bg); stroke-width: 1.6; fill: none; stroke-linecap: round; }
.logo-dot { fill: var(--accent); }
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.chip b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.dot.run { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
.dot.done { background: var(--ok); }
.dot.wait { background: var(--wait); }

/* Estructura */
.layout {
  max-width: 1280px; margin: 0 auto; padding: 18px 28px 64px;
  display: grid; grid-template-columns: minmax(340px, 440px) 1fr; gap: 28px; align-items: start;
}
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px;
  box-shadow: var(--shadow);
}
.form-panel { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow-y: auto; scrollbar-width: thin; }
h2 { font-size: 17px; letter-spacing: -0.01em; font-weight: 650; }
.form-panel h2 { margin-bottom: 18px; }
.hint { font-size: 13px; color: var(--muted); }
.optional { color: var(--muted); font-weight: 400; }
.center { text-align: center; }

/* Formulario */
.field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
label, legend, .switch-title { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; padding: 0; }
.field .hint { margin-top: 6px; }
input[type="text"], input[type="number"], input[type="email"], input[type="password"], select {
  width: 100%; height: 44px; padding: 0 13px; border-radius: 11px; background: var(--surface-2);
  border: 1px solid var(--line-strong); outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23999' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:focus-visible, select:focus-visible {
  border-color: var(--accent); background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
input.invalid { border-color: var(--bad); }
#legend-custom { margin-top: 8px; }
.with-button { display: flex; gap: 8px; }
.with-button input { flex: 1; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 11px; border: 1px solid transparent; cursor: pointer; font-weight: 600; white-space: nowrap;
  text-decoration: none; transition: transform .08s, background .15s, border-color .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); width: 100%; height: 48px; font-size: 15px; }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-quiet { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); }
.btn-quiet:hover:not(:disabled) { border-color: var(--muted); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13.5px; border-radius: 9px; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: var(--muted); background: var(--surface-2); }
.btn-danger:hover:not(:disabled) { border-color: var(--bad); color: var(--bad); }
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { opacity: .88; }
.spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rot .7s linear infinite; }

/* Variantes */
.variants { display: grid; gap: 10px; }
/* Acordeón: los campos de la variante elegida se abren debajo de su tarjeta. */
.variant-item { min-width: 0; }
.variant-item > .variant { width: 100%; }
.variant-body {
  margin-top: 10px; padding: 18px 16px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface);
}
.variant-body { display: flex; flex-direction: column; }
.variant-body[hidden] { display: none; }
/* Ícono: primero la subvariante (ícono y color), después los datos del pedido. */
.variant-body[data-variant="corazon"] #icon-field { order: -2; }
.variant-body[data-variant="corazon"] #color-field { order: -1; }
.variant-body.opening { animation: body-open .22s ease-out; }
@keyframes body-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .variant-body.opening { animation: none; } }
.variant {
  position: relative; display: grid; grid-template-columns: 62px 1fr; gap: 14px; align-items: center; padding: 11px 14px 11px 11px;
  border: 1px solid var(--line-strong); border-radius: 13px; background: var(--surface-2); cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.variant:hover { border-color: var(--muted); }
.variant[aria-checked="true"] { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.variant:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.variant svg { width: 62px; height: auto; display: block; border-radius: 4px; box-shadow: 0 1px 3px rgb(0 0 0 / 22%); }
.variant strong { display: block; font-size: 15px; letter-spacing: -0.005em; }
.variant span { display: block; font-size: 13px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.variant .tick {
  position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent);
  display: none; place-items: center;
}
.variant[aria-checked="true"] .tick { display: grid; }
.tick svg { width: 10px; height: 10px; box-shadow: none; border-radius: 0; stroke: var(--accent-ink); fill: none; stroke-width: 2.4; }
.poster-paper { fill: #fff; }
.poster-line { stroke: #2b2a27; fill: none; stroke-linecap: round; }
.poster-grid { stroke: #b9b5ab; fill: none; stroke-width: .5; }
.poster-red { fill: #d94a24; }
.poster-text { fill: #2b2a27; }

/* Ícono y leyenda */
.icons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.icon-btn {
  display: grid; justify-items: center; gap: 4px; padding: 10px 4px 8px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface-2); cursor: pointer; font-size: 11.5px; line-height: 1.2; text-align: center; color: var(--muted);
  transition: border-color .15s, background .15s, box-shadow .15s, color .15s;
}
.icon-btn svg { width: 40px; height: 40px; fill: currentColor; fill-rule: evenodd; color: var(--ink); }
.icon-btn:hover { border-color: var(--muted); }
.icon-btn[aria-checked="true"] { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink); }
.icon-btn[aria-checked="true"] svg { color: var(--accent); }
.icon-btn:focus-visible, .legend-opt:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.legend-list { display: grid; gap: 6px; }
.legend-opt {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--surface-2); cursor: pointer; text-align: left; font-size: 14px; transition: border-color .15s, background .15s, box-shadow .15s;
}
.legend-opt::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); }
.legend-opt:hover { border-color: var(--muted); }
.legend-opt[aria-checked="true"] { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.legend-opt[aria-checked="true"]::before { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 45%, transparent 50%); }
.legend-opt.other { color: var(--muted); }
#legend-fields:not(:empty) { margin-top: 8px; display: grid; gap: 8px; }
#legend-fields label { font-weight: 500; color: var(--muted); margin-bottom: 4px; }
#icon-legend-custom { margin-top: 8px; }
#legend-tip { margin-top: 8px; }
#legend-tip:not(:empty)::before, #icon-tip:not(:empty)::before { content: "Ideal para: "; font-weight: 600; color: var(--ink); }
:root[lang="en"] #legend-tip:not(:empty)::before, :root[lang="en"] #icon-tip:not(:empty)::before { content: "Ideal for: "; }
#legend-preview:not(:empty) { margin-top: 4px; }

/* Aclaración al pasar el mouse o enfocar (el mismo texto queda visible bajo la lista, para el celular) */
.tip { position: relative; }
.tip::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 30;
  width: max-content; max-width: min(240px, 70vw); padding: 7px 10px; border-radius: 8px; background: var(--ink); color: var(--bg);
  font-size: 12.5px; font-weight: 400; line-height: 1.35; text-align: left; white-space: normal; opacity: 0; pointer-events: none;
  transition: opacity .12s; box-shadow: var(--shadow);
}
.tip:hover::after, .tip:focus-visible::after { opacity: 1; }
.icons .tip:nth-child(4n + 1)::after, .legend-list .tip::after { left: 0; transform: none; }
.icons .tip:nth-child(4n)::after { left: auto; right: 0; transform: none; }
@media (hover: none) { .tip::after { display: none; } }

/* Recorrido GPX */
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line-strong); margin-bottom: 10px; }
.seg button { border: 0; background: transparent; height: 34px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 14%); }
.seg button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.presets { display: grid; gap: 8px; }
.preset {
  display: grid; grid-template-columns: 54px 1fr; gap: 12px; align-items: center; padding: 9px 12px 9px 9px; text-align: left; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-2); transition: border-color .15s, box-shadow .15s, background .15s;
}
.preset:hover { border-color: var(--muted); }
.preset[aria-checked="true"] { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.preset:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.preset strong { display: block; font-size: 14px; }
.preset span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 1px; }
.route-thumb { width: 54px; height: 54px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); }
.route-line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.route-start { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.route-end { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.drop {
  display: grid; gap: 4px; justify-items: center; text-align: center; padding: 22px 16px; cursor: pointer; margin: 0; font-weight: 400;
  border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); transition: border-color .15s, background .15s;
}
.drop svg { width: 26px; height: 26px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop b { font-weight: 650; }
.drop small { font-size: 12.5px; color: var(--muted); }
.drop:hover, .drop.over, .drop:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.route-preview { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.route-preview .canvas { padding: 12px; display: grid; place-items: center; }
.route-preview svg { width: 100%; max-width: 330px; height: 170px; }
.route-preview .found { padding: 10px 13px; border-top: 1px solid var(--line); font-size: 13px; display: flex; justify-content: space-between; gap: 10px; }
.route-preview .found b { overflow-wrap: anywhere; }
.route-preview .found span { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two label { font-weight: 500; color: var(--muted); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); padding: 0; }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--ink); }
/* En oscuro el negro se pierde contra el fondo: aro más claro. */
:root[data-theme="dark"] .swatch { box-shadow: 0 0 0 1px var(--muted); }
:root[data-theme="dark"] .swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--ink); }
.swatch.custom { position: relative; overflow: hidden; background: conic-gradient(#d94a24, #b8892b, #2b8a57, #1f5fbf, #7b3fa0, #d94a24); }
.swatch.custom input { position: absolute; inset: -6px; width: 44px; height: 44px; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.swatch:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 3px; }

/* Dirección verificada */
.geo { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.geo .map { position: relative; height: 150px; overflow: hidden; background: #e8e4da; }
.geo .map img { position: absolute; width: 256px; height: 256px; user-select: none; -webkit-user-drag: none; }
.geo .pin {
  position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: #d94a24; border: 3px solid #fff; box-shadow: 0 0 0 5px rgb(217 74 36 / 28%), 0 2px 6px rgb(0 0 0 / 35%);
}
.geo .attr { position: absolute; right: 0; bottom: 0; font-size: 10px; padding: 1px 6px; background: rgb(255 255 255 / 80%); color: #333; }
.geo .found { padding: 11px 13px; font-size: 13px; display: flex; gap: 9px; align-items: flex-start; }
.geo .found svg { flex: none; width: 17px; height: 17px; margin-top: 1px; stroke: var(--ok); fill: none; stroke-width: 2.2; }
.geo .found span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.geo.error { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); background: var(--bad-soft); }
.geo.error .found { color: var(--bad); }
.geo.error .found svg { stroke: var(--bad); }

/* Interruptores */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch-row .switch-title { margin: 0 0 1px; }
.switch-row .hint { margin: 0; display: block; }
.switch { position: relative; margin: 0; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch .track { display: block; width: 44px; height: 26px; border-radius: 999px; background: var(--line-strong); transition: background .18s; position: relative; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 30%); transition: transform .18s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track .thumb { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .45; }
.switch input:disabled { cursor: not-allowed; }

.more { margin: 0 0 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.more summary { cursor: pointer; font-size: 13px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.more[open] summary::before { transform: rotate(45deg); }
.more summary:hover { color: var(--ink); }
.more-body { padding-top: 16px; }
.more-body .field:last-child { margin-bottom: 0; }
#submit-hint { margin-top: 10px; }

/* Cola */
.queue-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"], .tabs button[aria-checked="true"] { background: var(--ink); color: var(--bg); }
.tabs button:not([aria-selected="true"]):not([aria-checked="true"]):hover { color: var(--ink); }
.tabs button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.jobs { display: grid; gap: 12px; }

.job {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  display: grid; grid-template-columns: 92px 1fr; gap: 16px; box-shadow: var(--shadow); animation: rise .25s ease-out;
}
.thumb-box {
  width: 92px; aspect-ratio: 29.7 / 42; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line);
  overflow: hidden; display: grid; place-items: center; position: relative; padding: 0; cursor: default;
}
.thumb-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
button.thumb-box { cursor: zoom-in; }
button.thumb-box:hover { border-color: var(--muted); }
button.thumb-box:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.thumb-box svg { width: 34px; height: 34px; stroke: var(--line-strong); fill: none; stroke-width: 1.6; }
.job-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.job-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.job-title { font-weight: 650; font-size: 16px; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.job-address { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.badge {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.badge.queued { background: var(--wait-soft); color: var(--wait); border-color: transparent; }
.badge.running { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.failed { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }
.meta span { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 1px 8px; }
.progress { display: grid; gap: 7px; }
.bar { height: 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .6s ease;
  background-image: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 35%) 50%, transparent 70%); background-size: 200% 100%; animation: sheen 1.6s linear infinite; }
.progress-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.progress-row .stage { font-weight: 600; }
.progress-row .time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.steps { display: flex; gap: 4px; }
.steps i { flex: 1; height: 3px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--accent); }
.note { font-size: 13px; padding: 8px 11px; border-radius: 9px; overflow-wrap: anywhere; }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note.warn { background: var(--wait-soft); color: var(--wait); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions .grow { flex: 1; }
.when { font-size: 12px; color: var(--muted); }
.log { margin: 0; padding: 11px 13px; border-radius: 10px; background: #14130f; color: #d9d5c9; font: 12px/1.55 var(--mono); max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

.empty { text-align: center; padding: 56px 20px; border: 1.5px dashed var(--line-strong); border-radius: 18px; }
.empty svg { width: 96px; height: 96px; margin-bottom: 8px; }
.e-ring { fill: none; stroke: var(--line); stroke-width: 1.5; }
.e-lines { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; }
.e-dot { fill: var(--accent); }
.empty-title { font-weight: 650; font-size: 16px; margin-bottom: 2px; }

/* Vista previa y avisos */
dialog { border: 0; padding: 0; background: transparent; max-width: min(92vw, 760px); max-height: 94vh; overflow: visible; }
dialog::backdrop { background: rgb(10 9 8 / 72%); backdrop-filter: blur(3px); }
dialog img { display: block; max-width: 100%; max-height: 90vh; margin: 0 auto; border-radius: 6px; background: #fff; box-shadow: 0 20px 60px rgb(0 0 0 / 50%); }
dialog .close { position: absolute; top: -14px; right: -14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 11px; font-size: 14px; box-shadow: var(--shadow); animation: rise .2s ease-out; }
.toast.bad { background: var(--bad); color: #fff; }

@keyframes pulse { 50% { opacity: .35; } }
@keyframes rot { to { transform: rotate(360deg); } }
@keyframes sheen { to { background-position: -200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; padding: 14px 16px 48px; }
  .form-panel { position: static; max-height: none; overflow: visible; }
  .top { padding: 18px 16px 4px; }
}
@media (max-width: 520px) {
  .job { grid-template-columns: 64px 1fr; gap: 12px; padding: 12px; }
  .thumb-box { width: 64px; }
  .panel { padding: 18px; }
}

/* Pie */
.site-foot {
  width: 100%; max-width: 1280px; margin: auto auto 0; padding: 18px 28px 26px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; font-size: 12.5px; color: var(--muted);
}
.site-foot a { color: inherit; text-underline-offset: 2px; }
.site-foot a:hover { color: var(--ink); }
@media (max-width: 920px) { .site-foot { padding: 16px 16px 24px; } }

/* Cuentas: home, ingreso, cuenta y administración */
.brand-name { font-size: 19px; line-height: 1.1; letter-spacing: -0.01em; font-weight: 650; }
.user-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.user-email { font-size: 13px; color: var(--muted); margin-right: 6px; overflow-wrap: anywhere; }
.nav-link {
  display: inline-flex; align-items: center; height: 32px; padding: 0 11px; border-radius: 9px; border: 0; background: transparent;
  color: var(--ink); font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.nav-link:hover { background: var(--surface-2); }
.nav-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.soon { max-width: 560px; margin: 14vh auto 0; padding: 0 28px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.soon h2 { font-size: clamp(30px, 6vw, 44px); letter-spacing: -0.02em; line-height: 1.1; }
.soon .btn { margin-top: 14px; }

.auth-wrap { max-width: 440px; margin: 7vh auto 0; padding: 0 20px 48px; }
.auth-card { padding: 28px; }
.auth-title { font-size: 22px; letter-spacing: -0.01em; margin-bottom: 20px; }
.auth-card .note { margin-bottom: 14px; }
.auth-card form .btn-primary { margin-top: 4px; }
.auth-help { margin-top: 14px; }

.admin-main { max-width: 1100px; margin: 0 auto; padding: 18px 28px 64px; display: grid; gap: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.new-user { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 8px; }
.new-user .field { margin: 0; }
.new-user .btn { height: 44px; }
#users-error { margin-bottom: 12px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .who { font-weight: 600; overflow-wrap: break-word; }
.table .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }

.modal { position: fixed; inset: 0; margin: auto; width: min(92vw, 460px); height: fit-content; padding: 24px; border-radius: 18px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: visible; }
.modal h2 { margin-bottom: 6px; }
.modal .note { margin: 14px 0; }
.modal .btn { width: 100%; }
.secret-row { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.secret { flex: 1; min-width: 0; padding: 11px 13px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line-strong);
  font: 16px/1.2 var(--mono); letter-spacing: .04em; overflow-wrap: anywhere; user-select: all; }

@media (max-width: 720px) {
  .new-user { grid-template-columns: 1fr; }
  .admin-main { padding: 14px 16px 48px; }
}

/* Créditos */
.credits-chip { font-weight: 650; color: var(--ink); }
.credits-chip.zero { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
#no-credits { margin-bottom: 18px; }
.auth-wrap.wide { max-width: 640px; display: grid; gap: 22px; }
.credits-balance { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; margin: -6px 0 6px; font-variant-numeric: tabular-nums; }
.sub-title { font-size: 14px; margin: 18px 0 8px; }
.table .pos { color: var(--ok); font-weight: 600; }
.table .neg { color: var(--bad); font-weight: 600; }
.modal-wide { width: min(94vw, 640px); }
.modal-wide .table-wrap { max-height: 50vh; overflow-y: auto; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { width: auto; flex: 1; }
