/* Gomariz Comerciales
 * App de empresa estándar con la marca Gomariz.
 * Radios: controles 10px, paneles 14px, chips en píldora. Sin excepciones.
 * Naranja: solo la acción de crear/enviar (una por pantalla), con tinta oscura.
 */

:root {
  --brand: #0033aa;
  --brand-strong: #00267f;
  --brand-ink: #ffffff;
  --brand-tint: #e7ecf8;
  --brand-tint-strong: #cfd9f2;
  --link: #0033aa;

  --accent: #ec7025;
  --accent-strong: #d55f17;
  --accent-ink: #1a1206;

  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --line: #dce1eb;
  --line-strong: #c3cad9;
  --ink: #121a2e;
  --ink-2: #4a556d;
  --ink-3: #5f6a84;

  --ok: #1d7a4b;
  --ok-tint: #e3f3ea;
  --warn: #9a5800;
  --warn-tint: #fdf1dc;
  --danger: #b42318;
  --danger-tint: #fdeceb;

  --r-control: 10px;
  --r-panel: 14px;
  --shadow-bar: 0 -1px 0 var(--line), 0 -6px 18px rgb(18 26 46 / 0.06);
  --shadow-pop: 0 8px 28px rgb(18 26 46 / 0.16), 0 1px 3px rgb(18 26 46 / 0.08);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --appbar-h: 56px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #1f4fc8;
    --brand-strong: #183f9f;
    --brand-tint: #1b2643;
    --brand-tint-strong: #253463;
    --link: #9db4ff;
    --accent: #f07f3a;
    --accent-strong: #e46e26;
    --bg: #0d1220;
    --surface: #151c2e;
    --surface-2: #1b2338;
    --line: #283250;
    --line-strong: #3a4566;
    --ink: #e9edf6;
    --ink-2: #b4bdd1;
    --ink-3: #98a2ba;
    --ok: #5fcf95;
    --ok-tint: #12301f;
    --warn: #f0b45c;
    --warn-tint: #352710;
    --danger: #ff8a80;
    --danger-tint: #3a1716;
    --shadow-bar: 0 -1px 0 var(--line);
    --shadow-pop: 0 10px 30px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
::selection { background: var(--brand-tint-strong); color: var(--ink); }
a { color: var(--link); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; margin: 0; text-wrap: balance; }
h1 { font-size: 1.5rem; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 1.0625rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
.num, .ref { font-variant-numeric: tabular-nums; }
.ref { letter-spacing: 0.01em; }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.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(--brand); outline-offset: 2px; border-radius: 4px; }
.icon {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 28px; height: 28px; }

/* ---------- shell ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: calc(var(--appbar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: var(--brand); color: var(--brand-ink);
}
.appbar a { color: inherit; }
.appbar-title { flex: 1; min-width: 0; font-size: 1.125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.appbar-brand strong { font-weight: 750; letter-spacing: 0.02em; }
.appbar-brand span { opacity: 0.85; font-weight: 500; }
.appbar-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin: 0 -10px;
  border-radius: 50%; background: none; border: 0; color: inherit; cursor: pointer;
}
.avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: rgb(255 255 255 / 0.18); color: #fff; font-size: 0.8125rem; font-weight: 650;
  text-decoration: none;
}

.layout { min-height: 100dvh; }
.main {
  width: 100%; max-width: 760px; margin: 0 auto;
  padding: 20px 16px calc(var(--tabbar-h) + var(--safe-b) + 28px);
}
.main.wide { max-width: 1120px; }
.main.has-actionbar { padding-bottom: calc(96px + var(--safe-b)); }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--surface); box-shadow: var(--shadow-bar);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-2); text-decoration: none; font-size: 0.75rem; font-weight: 550;
  -webkit-user-select: none; user-select: none;
}
.tab .tab-pill {
  display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px;
  transition: background-color 150ms ease;
}
.tab[aria-current="page"] { color: var(--brand); }
.tab[aria-current="page"] .tab-pill { background: var(--brand-tint); }
@media (prefers-color-scheme: dark) { .tab[aria-current="page"] { color: var(--link); } }

.sidebar { display: none; }

@media (min-width: 1024px) {
  .layout { display: grid; grid-template-columns: 248px 1fr; }
  .tabbar { display: none; }
  .appbar-menu-only { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: var(--appbar-h); height: calc(100dvh - var(--appbar-h));
    padding: 20px 12px; border-right: 1px solid var(--line); background: var(--surface);
  }
  .sidebar .side-new { margin-bottom: 12px; }
  .side-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: var(--r-control); color: var(--ink-2); text-decoration: none; font-weight: 550;
  }
  .side-link:hover { background: var(--surface-2); color: var(--ink); }
  .side-link[aria-current="page"] { background: var(--brand-tint); color: var(--brand); }
  @media (prefers-color-scheme: dark) { .side-link[aria-current="page"] { color: var(--link); } }
  .side-sep { height: 1px; margin: 10px 4px; background: var(--line); }
  .layout > .appbar { grid-column: 1 / -1; }
  .main { padding-bottom: 48px; }
  .main.has-actionbar { padding-bottom: 120px; }
}

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.page-head > div { flex: 1; min-width: 0; }
.page-head p { margin-top: 4px; color: var(--ink-2); }
.back {
  display: inline-flex; align-items: center; gap: 6px; margin: -4px 0 12px -6px; padding: 6px;
  color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: 0.9375rem;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--r-control);
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 140ms var(--ease-out), background-color 150ms ease, border-color 150ms ease;
  -webkit-user-select: none; user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-create { background: var(--accent); color: var(--accent-ink); }
.btn-create:hover { background: var(--accent-strong); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: none; color: var(--link); padding: 0 10px; min-height: 44px; }
.btn-ghost:hover { background: var(--brand-tint); }
.btn-danger-ghost { background: none; color: var(--danger); min-height: 44px; padding: 0 10px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-label-idle { display: none; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin 600ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.form-section {
  padding: 18px 16px 20px; margin: 0 -16px 12px;
  background: var(--surface); border-block: 1px solid var(--line);
}
@media (min-width: 600px) {
  .form-section { margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px 22px 22px; }
}
.form-section > h2 { margin-bottom: 14px; }
.form-section > h2 + .section-help { margin: -10px 0 14px; color: var(--ink-2); font-size: 0.9375rem; }
.field { display: grid; gap: 6px; margin-bottom: 16px; align-content: start; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field-row { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.field-row > .field:last-child { margin-bottom: 16px; }
.form-section .field-row:last-child > .field { margin-bottom: 0; }
.label { font-weight: 600; font-size: 0.9375rem; }
.label .opt { font-weight: 450; color: var(--ink-3); }
.help { font-size: 0.875rem; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-control);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
.select {
  appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint-strong);
}
input[type="date"].input, input[type="time"].input { min-width: 0; -webkit-appearance: none; appearance: none; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.error-text { display: flex; gap: 6px; align-items: flex-start; color: var(--danger); font-size: 0.875rem; font-weight: 550; }
.error-text .icon { width: 18px; height: 18px; margin-top: 1px; }

/* Chips de sugerencia y opciones tipo píldora */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
  font: inherit; font-size: 0.9375rem; font-weight: 520; cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 120ms var(--ease-out);
  -webkit-user-select: none; user-select: none;
}
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] { background: var(--brand-tint); border-color: var(--brand); color: var(--ink); }

/* Radios y checkboxes como píldoras (opciones de respuesta rápida) */
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.choices > div { display: contents; }
.choices label, .choice {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-strong);
  font-weight: 550; cursor: pointer; -webkit-user-select: none; user-select: none;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.choices input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choices label:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }
.choices label:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
.choices.multi label:has(input:checked) { background: var(--brand-tint); border-color: var(--brand); color: var(--ink); }
.choices.multi label:has(input:checked)::before {
  content: ""; width: 7px; height: 12px; margin: -3px 2px 0 0;
  border: solid var(--brand); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
@media (prefers-color-scheme: dark) { .choices.multi label:has(input:checked)::before { border-color: var(--link); } }

/* Barra de acción fija */
.actionbar {
  position: fixed; inset: auto 0 0 0; z-index: 25;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: var(--surface); box-shadow: var(--shadow-bar);
}
.actionbar-inner { max-width: 760px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.actionbar-inner .btn-create { flex: 1; min-height: 52px; font-size: 1.0625rem; }
@media (min-width: 1024px) { .actionbar { left: 248px; } }

/* ---------- avisos / banners ---------- */
.banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 16px;
  border-radius: var(--r-control); background: var(--brand-tint); color: var(--ink);
}
.banner .icon { margin-top: 1px; }
.banner > div { flex: 1; min-width: 0; }
.banner strong { display: block; }
.banner-ok { background: var(--ok-tint); }
.banner-ok > .icon { color: var(--ok); }
.banner-warn { background: var(--warn-tint); }
.banner-warn > .icon { color: var(--warn); }
.banner-error { background: var(--danger-tint); }
.banner-error > .icon { color: var(--danger); }
.banner .btn-ghost { margin: -10px -8px -10px 0; }

/* Ubicación */
.geo { display: flex; gap: 12px; align-items: center; padding: 12px 14px; margin-bottom: 16px;
  border-radius: var(--r-control); border: 1px solid var(--line); background: var(--surface); }
.geo > div { flex: 1; min-width: 0; }
.geo .geo-title { font-weight: 600; }
.geo .geo-help { font-size: 0.875rem; color: var(--ink-2); }
.geo[data-estado="buscando"] > .icon { color: var(--ink-3); animation: pulse 1.2s ease-in-out infinite; }
.geo[data-estado="ok"] { border-color: transparent; background: var(--ok-tint); }
.geo[data-estado="ok"] > .icon { color: var(--ok); }
.geo[data-estado="error"] { border-color: transparent; background: var(--danger-tint); }
.geo[data-estado="error"] > .icon { color: var(--danger); }
.geo .btn-ghost { display: none; }
.geo[data-estado="error"] .btn-ghost { display: inline-flex; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- inicio ---------- */
.hello { margin-bottom: 18px; }
.hello p { color: var(--ink-2); margin-top: 2px; }
.primary-create {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px 18px; margin-bottom: 10px; border-radius: var(--r-panel);
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  transition: transform 140ms var(--ease-out), background-color 150ms ease;
}
.primary-create:hover { background: var(--accent-strong); }
.primary-create:active { transform: scale(0.98); }
.primary-create .pc-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgb(255 255 255 / 0.28); }
.primary-create strong { display: block; font-size: 1.125rem; }
.primary-create span { font-size: 0.9375rem; opacity: 0.85; }
.primary-create > div { flex: 1; }

.list {
  margin: 0 -16px 24px; padding: 0; list-style: none;
  background: var(--surface); border-block: 1px solid var(--line);
}
@media (min-width: 600px) { .list { margin: 0 0 24px; border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; } }
.list > li + li { border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 16px;
  color: var(--ink); text-decoration: none;
}
a.row:hover { background: var(--surface-2); }
a.row:active { background: var(--brand-tint); }
.row-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-tint); color: var(--brand); flex: none; }
@media (prefers-color-scheme: dark) { .row-icon { color: var(--link); } }
.row-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.row-title, .row-sub, .row-meta > * { display: block; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 0.875rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { display: grid; justify-items: end; gap: 2px; max-width: 42%; text-align: right; font-size: 0.8125rem; color: var(--ink-2); flex: none; }
.row-meta .ref { display: block; color: var(--ink-3); }
.row > .icon:last-child { color: var(--ink-3); }
@media (max-width: 599px) { .row-meta .ref { display: none; } .row-meta { max-width: 34%; } }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 10px; }
.section-title a { font-weight: 600; font-size: 0.9375rem; text-decoration: none; }

.empty {
  display: grid; justify-items: center; gap: 8px; padding: 32px 20px; margin-bottom: 24px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--r-panel); color: var(--ink-2);
}
.empty .icon { width: 32px; height: 32px; color: var(--ink-3); }
.empty strong { color: var(--ink); }

/* Panel de dirección */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0 -16px 24px;
  background: var(--line); border-block: 1px solid var(--line);
}
@media (min-width: 600px) { .stats { margin: 0 0 24px; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; } }
.stat { display: grid; gap: 2px; padding: 14px 14px 12px; background: var(--surface); text-decoration: none; color: var(--ink); }
a.stat:hover { background: var(--surface-2); }
.stat-n { font-size: 1.5rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-l { font-size: 0.8125rem; color: var(--ink-2); }

.table-wrap { margin: 0 -16px 24px; overflow-x: auto; background: var(--surface); border-block: 1px solid var(--line); }
@media (min-width: 600px) { .table-wrap { margin: 0 0 24px; border: 1px solid var(--line); border-radius: var(--r-panel); } }
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th, .table td { padding: 10px 14px; text-align: left; white-space: nowrap; }
.table th { font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; }
.table tbody tr + tr td { border-top: 1px solid var(--line); }

/* ---------- historial ---------- */
.tabs {
  display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs .chip { flex: none; text-decoration: none; }
.filters { display: grid; gap: 10px; margin-bottom: 16px; }
.filters-more { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.filters-more .span-2 { grid-column: 1 / -1; }
@media (min-width: 900px) { .filters { grid-template-columns: 2fr 1fr 1fr 1.4fr 1.4fr auto; align-items: end; } .filters-more { display: contents; } .filters-more .span-2 { grid-column: auto; } }
.filters .field { margin: 0; }
.filters .label { font-size: 0.8125rem; color: var(--ink-2); font-weight: 550; }
.filters-actions { display: flex; gap: 8px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }
.htmx-request .list, .htmx-request.list { opacity: 0.55; transition: opacity 150ms ease; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2);
}
.badge-warn { background: var(--warn-tint); color: var(--warn); }
.badge-error { background: var(--danger-tint); color: var(--danger); }

/* ---------- detalle ---------- */
.dl { display: grid; margin: 0; }
.dl > div { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 12px; padding: 10px 0; }
.dl > div + div { border-top: 1px solid var(--line); }
.dl dt { color: var(--ink-2); font-size: 0.9375rem; }
.dl dd { margin: 0; font-weight: 520; overflow-wrap: anywhere; }
.lines { margin: 0; padding: 0; list-style: none; }
.lines li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; }
.lines li + li { border-top: 1px solid var(--line); }
.lines .price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.status-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.status-list li { display: flex; gap: 10px; align-items: flex-start; }
.status-list .ok { color: var(--ok); }
.status-list .err { color: var(--danger); }
.status-list .pend { color: var(--warn); }
.pre-error { margin-top: 4px; font-size: 0.8125rem; color: var(--ink-2); overflow-wrap: anywhere; }

/* ---------- máquinas (alquiler / presupuesto) ---------- */
.machines { margin: 0 0 16px; padding: 0; list-style: none; }
.machines li {
  display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 14px; margin-bottom: 8px;
  border-radius: var(--r-control); background: var(--surface-2);
}
.machines li > div { flex: 1; min-width: 0; }
.machines .m-desc { font-weight: 600; }
.machines .m-price { font-size: 0.9375rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.machines-empty { padding: 14px; margin-bottom: 16px; border-radius: var(--r-control); border: 1px dashed var(--line-strong); color: var(--ink-2); font-size: 0.9375rem; text-align: center; }
.builder { display: grid; gap: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.builder-step[hidden] { display: none; }
.builder .label { display: block; margin-bottom: 8px; }
.price-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 36px; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 550; cursor: pointer; }
.switch input { width: 22px; height: 22px; accent-color: var(--brand); }

/* ---------- confirmación ---------- */
.done { display: grid; justify-items: start; gap: 6px; padding: 8px 0 24px; }
.done-mark { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 10px; border-radius: 50%; background: var(--ok-tint); color: var(--ok); }
.done-mark .icon { width: 30px; height: 30px; stroke-width: 2.4; }
.done-ref { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.done-actions { display: grid; gap: 10px; margin-top: 8px; }
@media (min-width: 600px) { .done-actions { grid-template-columns: auto auto; justify-content: start; } }
@media (prefers-reduced-motion: no-preference) {
  .done-mark { animation: pop 320ms var(--ease-out) both; }
  .done-ref { animation: rise 360ms var(--ease-out) 60ms both; }
}
@keyframes pop { from { transform: scale(0.8); opacity: 0; } }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 40; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); display: grid; gap: 8px; pointer-events: none; }
@media (min-width: 1024px) { .toasts { left: auto; right: 24px; bottom: 96px; width: 380px; } }
.toast {
  display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-control);
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-pop); pointer-events: auto;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
@starting-style { .toast { opacity: 0; transform: translateY(8px); } }
.toast.is-leaving { opacity: 0; transform: translateY(8px); }
.toast-error { background: var(--danger); color: #fff; }

.offline-bar { display: none; padding: 8px 16px; background: var(--warn-tint); color: var(--ink); font-size: 0.875rem; font-weight: 550; text-align: center; }
body.is-offline .offline-bar { display: block; }

/* ---------- login ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; background: var(--bg); }
.auth-top { padding: calc(env(safe-area-inset-top, 0px) + 28px) 24px 56px; background: var(--brand); color: #fff; }
.auth-top .appbar-brand { color: #fff; font-size: 1.25rem; }
.auth-card {
  width: min(420px, calc(100% - 32px)); margin: -36px auto 32px; padding: 24px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); align-self: start;
}
.auth-card h1 { margin-bottom: 18px; }
.auth-card .btn { width: 100%; margin-top: 4px; }
.auth-foot { margin-top: 16px; text-align: center; font-size: 0.9375rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
@media (hover: none) {
  a.row:hover { background: transparent; }
}
