/* ---------- Siguiente paso ---------- */
.next-step { display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-bottom: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.next-step::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); }
.next-step .ns-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-softer); color: var(--accent); flex: none; }
.next-step .ns-ic svg { width: 20px; height: 20px; }
.next-step .ns-body { flex: 1; min-width: 0; }
.next-step .ns-k { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.next-step .ns-t { font-weight: 650; font-size: 15.5px; margin-top: 1px; }
.next-step .ns-s { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.next-step .ns-btn { height: 42px; padding: 0 18px; }
.next-step.done::before { background: var(--ok); }
.next-step.done .ns-k { color: var(--ok); }
.next-step.done .ns-ic { color: var(--ok); background: var(--ok-soft); }
@media (max-width: 640px) { .next-step { flex-wrap: wrap; } .next-step .ns-btn { width: 100%; } }

/* ---------- Pestañas de sección ---------- */
.section-tabs { display: inline-flex; gap: 4px; padding: 3px; margin: 14px 0 -6px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; }
.section-tabs a { height: 32px; padding: 0 14px; display: inline-flex; align-items: center; gap: 7px; border-radius: 8px; color: var(--ink-2); font-weight: 560; font-size: 13.5px; white-space: nowrap; }
.section-tabs a svg { width: 15px; height: 15px; }
.section-tabs a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---------- Ayuda ---------- */
.help-steps { display: grid; gap: 14px; margin-top: 16px; }
.help-steps .hs { display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; }
.help-steps .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-softer); color: var(--accent); font-weight: 700; font-size: 13px; flex: none; }
@media (max-width: 860px) { .help-btn span { display: none; } .help-btn { width: 38px; padding: 0; } }

/* ---------- Primeros pasos ---------- */
.onb { padding: 20px 22px; margin-bottom: 16px; }
.onb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.onb-head h3 { margin: 0; font-size: 16px; }
.onb-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 14px; }
.onb-item { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 560; font-size: 13.5px; }
.onb-item .chk { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.onb-item.ok { color: var(--ink-3); }
.onb-item.ok .chk { background: var(--ok); border-color: var(--ok); color: var(--canvas); }
.onb-item .chk svg { width: 12px; height: 12px; stroke-width: 3; }
a.onb-item:not(.ok):hover { border-color: var(--gold); }

/* ---------- Marca sin logo ---------- */
.brand-mono { display: flex; align-items: center; gap: 10px; }
.brand-mono .mk { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font: 600 19px/1 var(--font-serif); flex: none; }
.brand-mono b { font: 650 16px/1.2 var(--font-display); letter-spacing: -.02em; }
.auth-art .brand-mono b { color: #fff; font-size: 22px; }
.auth-art .brand-mono .mk { background: rgba(255,255,255,.14); color: #fff; }

/* ---------- Colores de marca ---------- */
:root[data-accent="noche"] { --brand: #1F3A5F; --brand-2: #284A76; --accent: #1F3A5F; --nav-active: #1F3A5F; --brand-soft: #E3EAF3; --brand-softer: #EEF2F8; --chart: #1F3A5F; --chart-soft: #CBD7E6; }
:root[data-accent="vino"] { --brand: #5E2333; --brand-2: #722B3F; --accent: #5E2333; --nav-active: #5E2333; --brand-soft: #F3E4E8; --brand-softer: #F8EEF1; --chart: #5E2333; --chart-soft: #E5CDD4; }
:root[data-accent="grafito"] { --brand: #2B2B2B; --brand-2: #3A3A3A; --accent: #2B2B2B; --nav-active: #2B2B2B; --brand-soft: #EAE8E4; --brand-softer: #F2F0EC; --chart: #3A3A3A; --chart-soft: #D9D6D0; }
:root[data-theme="dark"][data-accent="noche"] { --brand: #2A4468; --brand-2: #33517A; --accent: #B9C9DE; --brand-soft: #1E2530; --brand-softer: #1B212A; --chart: #A9BBD3; --chart-soft: #2E3A4A; --nav-active: #232A26; }
:root[data-theme="dark"][data-accent="vino"] { --brand: #6A2B3B; --brand-2: #7A3446; --accent: #E0BEC7; --brand-soft: #2C1F23; --brand-softer: #261C1F; --chart: #D3AAB5; --chart-soft: #45303A; --nav-active: #232A26; }
:root[data-theme="dark"][data-accent="grafito"] { --brand: #3A3A3A; --brand-2: #474747; --accent: #D6D2CA; --brand-soft: #242424; --brand-softer: #202020; --chart: #C9C4BB; --chart-soft: #3A3835; --nav-active: #232A26; }
.accent-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.accent-pick label { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; font-weight: 560; font-size: 13px; }
.accent-pick input { display: none; }
.accent-pick label:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.accent-pick i { width: 18px; height: 18px; border-radius: 50%; }
.logo-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-box .pv { width: 200px; height: 72px; border-radius: 12px; border: 1px dashed var(--line-strong); display: grid; place-items: center; background: #fff; overflow: hidden; color: #888; font-size: 12px; }
.logo-box .pv img { max-width: 92%; max-height: 80%; }
.sidebar .brand img { max-height: 64px; object-fit: contain; object-position: left; }
.next-step .ns-actions { display: flex; gap: 8px; flex-wrap: wrap; } @media (max-width: 640px) { .next-step .ns-actions { width: 100%; } .next-step .ns-actions .btn { flex: 1; } }
.avatar.pend-warn { background: var(--warn-soft); color: var(--warn); }
.avatar.pend-bad { background: var(--bad-soft); color: var(--bad); }
.avatar.pend-brand { background: var(--brand-softer); color: var(--accent); }
.avatar svg { width: 16px; height: 16px; }

/* Forma de pago: tres botones grandes */
.method-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.method-pick label { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 560; font-size: 13px; color: var(--ink-2); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.method-pick label svg { width: 20px; height: 20px; }
.method-pick input { display: none; }
.method-pick label:has(input:checked) { border-color: var(--brand); color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.method-pick label:has(input:checked) svg { color: var(--accent); }
.method-pick.compact label { flex-direction: row; justify-content: center; padding: 10px 8px; }
details.more summary { cursor: pointer; font-size: 13px; font-weight: 560; color: var(--accent); list-style: none; display: flex; align-items: center; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-softer); font-size: 13px; }
details.more[open] summary::before { content: "−"; }
.method-pick.compact { grid-template-columns: repeat(4, 1fr); }
.method-pick.compact label { padding: 9px 4px; font-size: 12.5px; }

/* Solo lectura: se ocultan las acciones que modifican datos */
.readonly .page-actions .btn.primary, .readonly .page-actions a.btn[href*="/nueva"], .readonly .page-actions a.btn[href*="/nuevo"], .readonly .page-actions #new,
.readonly .next-step .ns-actions .btn.primary, .readonly [data-act="more"], .readonly [data-act="pay"], .readonly [data-act="reopen-bal"],
.readonly [data-cancel], .readonly [data-pay], .readonly #qadj, .readonly #edit, .readonly #new-cobro, .readonly #new-pago, .readonly #pay,
.readonly a.btn[href*="/nueva"], .readonly a.btn[href*="/nuevo"], .readonly a[href*="/ajuste"].btn, .readonly .empty .btn.primary,
.readonly #save, .readonly #save-m, .readonly .add-line, .readonly .mobile-bar .btn { display: none !important; }
.readonly .page-head h1::after { content: "Solo lectura"; margin-left: 10px; vertical-align: middle; font: 600 11.5px/1 var(--font); letter-spacing: .02em; padding: 5px 9px; border-radius: 99px; background: var(--surface-3); color: var(--ink-3); }
.perm-table { width: 100%; border-collapse: collapse; }
.perm-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.perm-table td:first-child { font-weight: 560; }
.perm-table .seg button { height: 28px; padding: 0 10px; font-size: 12.5px; }

/* ---------- Dinero ---------- */
.dn-h { font: 600 15px/1.3 var(--font-display); letter-spacing: -.01em; margin: 26px 0 12px; color: var(--ink-2); }
.dn-ledger { padding: 6px 22px 14px; }
.dn-ledger .r { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.dn-ledger .r > span:first-child { color: var(--ink-2); min-width: 0; }
.dn-ledger .r .num, .dn-ledger .r b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dn-ledger .r.sub > span:first-child { color: var(--ink); font-weight: 600; }
.dn-ledger .r.ind { padding: 6px 0 6px 16px; font-size: 13.5px; }
.dn-ledger .r.total { border-bottom: 0; padding-top: 12px; font-size: 15.5px; }
.dn-ledger .r.total > span:first-child { color: var(--ink); font-weight: 650; }
.dn-pending { margin-bottom: 16px; border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
.dn-pending svg { width: 18px; height: 18px; color: var(--warn); }
.dn-prow { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.dn-prow > span { flex: 1; min-width: 0; }
.dn-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.dn-facts > div > span:first-child { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.dn-facts b { font-weight: 600; }
.dn-hist { display: grid; gap: 10px; font-size: 13.5px; }
.dn-hist > div { padding-left: 12px; border-left: 2px solid var(--line); }
.dn-hist span { font-size: 12px; }
.dn-chart { width: 100%; height: auto; display: block; }
.dn-chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.dn-chart .sales { fill: var(--surface-3); }
.dn-chart .pos { fill: var(--ok); }
.dn-chart .neg { fill: var(--bad); }
.dn-chart .noexp { opacity: .45; }
.dn-chart text { fill: var(--ink-3); font-size: 12px; font-family: var(--font); }
.dn-chart g:hover .sales { fill: var(--line-strong); }
.dn-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.dn-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dn-legend i.sales { background: var(--surface-3); border: 1px solid var(--line-strong); }
.dn-legend i.pos { background: var(--ok); } .dn-legend i.neg { background: var(--bad); } .dn-legend i.noexp { background: var(--ok); opacity: .45; }
.mc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.mc-head h3 { margin: 0; }
.mc-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.mc-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mc-cell span { font-size: 12.5px; color: var(--ink-3); }
.mc-cell b { font: 600 20px/1.2 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mc-row .op { color: var(--ink-3); font-size: 18px; }
.mc-sep { flex: 1; min-width: 12px; }
@media (max-width: 640px) {
  .mc-row { display: grid; grid-template-columns: 1fr 1fr; } .mc-row .op, .mc-sep { display: none; }
  .dn-ledger { padding: 4px 16px 12px; } .dn-facts { grid-template-columns: 1fr; }
}
.dn-open { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dn-open:hover b { text-decoration: underline; text-underline-offset: 3px; }
.dn-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.dn-clip svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.dn-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.dn-tabs::-webkit-scrollbar { display: none; }
.dn-tabs button { flex: none; }

/* Teléfono: la búsqueda se encoge para que "¿Cómo funciona?" y "Nuevo" no se salgan de la pantalla. */
@media (max-width: 860px) { .topbar .search-trigger { min-width: 0; flex: 1 1 0; } .topbar .spacer { display: none; } }
.dn-guide { margin-bottom: 4px; }
.dn-step { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.dn-step .chk { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; }
.dn-step.done .chk { background: var(--ok); border-color: var(--ok); color: #fff; }
.dn-step .chk svg { width: 13px; height: 13px; }
.dn-step.done b { color: var(--ink-3); font-weight: 560; }
