:root {
  --violet: #6d28d9; --violet-2: #7c3aed; --violet-d: #4c1d95; --violet-l: #ede9fe; --violet-ll: #f5f3ff;
  --bg: #f5f3fb; --card: #ffffff; --ink: #1b1530; --ink-2: #5b5470; --line: #e7e3f2; --shadow: 0 1px 2px rgba(60,30,120,.06), 0 8px 24px rgba(60,30,120,.08);
  --ok: #15803d; --ok-bg: #dcfce7; --warn: #b45309; --bad: #b91c1c; --bad-bg: #fee2e2;
  --b0: #16a34a; --b1: #eab308; --b2: #f97316; --b3: #dc2626; --b4: #b91c1c; --b5: #450a0a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 64px; --hdr-h: 0px; --r: 20px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #120e1f; --card: #1c162e; --ink: #f1edfb; --ink-2: #a89fc4; --line: #2c2444; --violet-l: #2b1f4d; --violet-ll: #221a3d;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); --ok-bg: #12301d; --bad-bg: #3a1620; --b4: #ef4444; --b5: #fca5a5; color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font: 16px/1.4 var(--sans); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.muted { color: var(--ink-2); } .small { font-size: 13px; } .center { text-align: center; } .right { text-align: right; }
.serif, .num { font-family: var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--violet-2); outline-offset: 2px; border-radius: 8px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--violet-l); border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Estructura ---------- */
#app { min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.topbar { background: linear-gradient(135deg, var(--violet-d), var(--violet) 60%, var(--violet-2)); color: #fff; padding: calc(env(safe-area-inset-top) + 14px) 18px 16px; position: relative; }
.topbar .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar h1 { font: 700 20px/1.1 var(--serif); letter-spacing: .2px; }
.topbar .sub { opacity: .8; font-size: 13px; margin-top: 2px; }
.topbar .icon-btn { color: #fff; background: rgba(255,255,255,.14); }
.content { flex: 1; padding: 16px 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 20px); max-width: 920px; width: 100%; margin: 0 auto; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); display: flex; z-index: 30; }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--ink-2); font-size: 11.5px; font-weight: 600; position: relative; min-width: 0; }
.bottom-nav a.on { color: var(--violet); }
.bottom-nav a.on::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--violet); }
.dot { position: absolute; top: 8px; right: calc(50% - 20px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--b3); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
.side { display: none; }
@media (min-width: 900px) {
  #app.has-side { padding-left: 250px; }
  .side { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 250px; background: var(--card); border-right: 1px solid var(--line); padding: 22px 14px; gap: 4px; z-index: 30; overflow-y: auto; }
  .side .brand { font: 700 24px var(--serif); color: var(--violet); padding: 0 10px 18px; }
  .side a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
  .side a:hover { background: var(--violet-ll); } .side a.on { background: var(--violet-l); color: var(--violet); }
  .side .sp { flex: 1; } .side .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-2); padding: 14px 12px 4px; }
  .has-side .bottom-nav { display: none; }
  .has-side .content { padding-bottom: 40px; }
}

/* ---------- Componentes ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; border: 1px solid var(--line); }
.card + .card, .stack > * + * { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 700px) { .grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; } }
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.sec-title { font: 700 13px var(--sans); text-transform: uppercase; letter-spacing: .8px; color: var(--ink-2); margin: 22px 4px 10px; }
.page-title { font: 700 26px var(--serif); margin: 4px 2px 14px; }
.big-num { font: 700 34px/1 var(--serif); letter-spacing: -.5px; }
.kpi { padding: 14px 16px; } .kpi .k { font-size: 12.5px; color: var(--ink-2); font-weight: 600; } .kpi .v { font: 700 24px/1.15 var(--serif); margin-top: 6px; word-break: break-word; }
.kpi.accent { background: linear-gradient(135deg, var(--violet-d), var(--violet)); color: #fff; border: 0; } .kpi.accent .k { color: rgba(255,255,255,.8); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; border: 0; font-weight: 700; cursor: pointer; transition: transform .08s, opacity .15s; text-decoration: none; }
.btn:active { transform: scale(.97); } .btn:disabled { opacity: .55; cursor: default; } .btn.loading { opacity: .7; pointer-events: none; }
.btn.primary { background: var(--violet); color: #fff; box-shadow: 0 6px 16px rgba(109,40,217,.35); }
.btn.soft { background: var(--violet-l); color: var(--violet); } .btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn.danger { background: var(--b3); color: #fff; } .btn.ok { background: var(--ok); color: #fff; } .btn.block { width: 100%; } .btn.sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--violet-ll); color: var(--violet); display: inline-grid; place-items: center; cursor: pointer; flex: none; text-decoration: none; }
.input, select.input, textarea.input { width: 100%; min-height: 50px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); outline: none; }
textarea.input { padding: 12px 14px; min-height: 80px; } .input:focus { border-color: var(--violet-2); box-shadow: 0 0 0 4px var(--violet-l); } .input.bad { border-color: var(--b3); }
.input.money { font: 700 22px var(--serif); text-align: right; }
.field { display: block; } .field + .field, .field + .row, .row + .field { margin-top: 14px; } .field .lbl { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; } .field .hint { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 5px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; } .chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); }
.chip.on { background: var(--violet); border-color: var(--violet); color: #fff; } .chip .n { font-size: 12px; opacity: .8; }
.seg { display: flex; background: var(--violet-l); border-radius: 14px; padding: 4px; gap: 4px; } .seg button { flex: 1; border: 0; background: transparent; border-radius: 11px; min-height: 40px; font-weight: 700; color: var(--violet); cursor: pointer; font-size: 14px; } .seg button.on { background: var(--card); box-shadow: 0 2px 8px rgba(60,30,120,.15); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--violet-l); color: var(--violet); white-space: nowrap; }
.badge.b0 { background: var(--ok-bg); color: var(--ok); } .badge.b1 { background: #fef3c7; color: #92400e; } .badge.b2 { background: #ffedd5; color: #9a3412; } .badge.b3 { background: var(--bad-bg); color: var(--bad); } .badge.b4 { background: #7f1d1d; color: #fff; }
.badge.gray { background: var(--line); color: var(--ink-2); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); } .list-row:last-child { border-bottom: 0; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--violet-l); color: var(--violet); display: grid; place-items: center; font: 700 16px var(--serif); flex: none; }
.empty { text-align: center; color: var(--ink-2); padding: 40px 20px; } .empty svg { opacity: .5; } .empty.err { color: var(--bad); } .empty p { margin: 10px 0 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; } .tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-2); padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; } .tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; } .tbl .r { text-align: right; } .tbl tr.void td { opacity: .5; text-decoration: line-through; }
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
.bar { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; } .bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--violet-2)); border-radius: 6px; }
.status-ok { color: var(--ok); } .status-bad { color: var(--bad); }

/* ---------- Ruta de cobro: exactamente 3 clientes por pantalla ---------- */
.route-screen { height: 100dvh; display: flex; flex-direction: column; }
.route-screen .topbar { padding-bottom: 12px; flex: none; }
.route-tools { padding: 10px 12px 4px; flex: none; background: var(--bg); }
.route-list { flex: 1; min-height: 0; overflow-y: auto; scroll-snap-type: y mandatory; padding: 4px 12px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; margin-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.rcard { flex: 0 0 var(--card-h, 190px); scroll-snap-align: start; background: var(--card); border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; padding: 12px 14px 12px 20px; position: relative; overflow: hidden; }
.rcard::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; background: var(--b0); }
.rcard.b1::before { background: var(--b1); } .rcard.b2::before { background: var(--b2); } .rcard.b3::before { background: var(--b3); } .rcard.b4::before { background: var(--b4); }
.rcard.paid { background: var(--ok-bg); } .rcard.paid::before { background: var(--ok); }
.rcard .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rcard .nm { font: 700 18px/1.15 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rcard .addr { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.rcard .amts { display: flex; gap: 18px; margin: 8px 0 auto; } .rcard .amts .lb { font-size: 11.5px; color: var(--ink-2); font-weight: 600; } .rcard .amts .vl { font: 700 20px/1.1 var(--serif); }
.rcard .btns { display: grid; grid-template-columns: 2.1fr 1fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.rcard .btns .btn { min-height: 46px; padding: 0 6px; font-size: 14px; border-radius: 13px; white-space: nowrap; }
.rcard .btns .btn.primary { gap: 6px; padding: 0 4px; } .rcard .btns .btn.tool { background: var(--violet-ll); color: var(--violet); }
.rcard .btns .btn.tool.wa { background: #dcfce7; color: #166534; } :root[data-theme="dark"] .rcard .btns .btn.tool.wa { background: #12301d; color: #86efac; }
.progress-pill { background: rgba(255,255,255,.16); border-radius: 14px; padding: 10px 12px; margin-top: 12px; }
.progress-pill .bar { background: rgba(255,255,255,.25); height: 8px; } .progress-pill .bar > i { background: #fff; }
.queue-banner { background: #fef3c7; color: #78350f; padding: 10px 14px; border-radius: 14px; margin: 6px 12px 0; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }

/* ---------- Hojas / ventanas ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(20,10,40,.55); z-index: 100; display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; backdrop-filter: blur(2px); }
.backdrop.open { opacity: 1; } .sheet { background: var(--card); width: 100%; max-width: 520px; border-radius: 26px 26px 0 0; max-height: 92dvh; display: flex; flex-direction: column; transform: translateY(40px); transition: transform .25s cubic-bezier(.2,.9,.3,1); padding-bottom: env(safe-area-inset-bottom); }
.backdrop.open .sheet { transform: none; } .sheet.tall { height: 92dvh; }
.grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px 6px 20px; } .sheet-head h2 { font: 700 20px var(--serif); }
.sheet-body { padding: 8px 20px 22px; overflow-y: auto; } @media (min-width: 700px) { .backdrop { align-items: center; } .sheet { border-radius: 26px; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); transform: translate(-50%, 20px); background: #1b1530; color: #fff; padding: 12px 18px; border-radius: 14px; display: flex; gap: 10px; align-items: center; opacity: 0; transition: .25s; z-index: 200; max-width: 92vw; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.35); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.err { background: var(--b3); }

/* ---------- Pago ---------- */
.pay-head { background: var(--violet-ll); border-radius: 18px; padding: 14px; margin-bottom: 14px; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0; } .stepper button { width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--violet-l); color: var(--violet); display: grid; place-items: center; cursor: pointer; } .stepper .q { font: 700 44px var(--serif); min-width: 70px; text-align: center; }
.pay-total { text-align: center; margin: 12px 0 16px; } .pay-total .big-num { color: var(--violet); }
.receipt-ok { text-align: center; padding: 8px 0 4px; } .receipt-ok .tick { width: 76px; height: 76px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; margin: 4px auto 12px; }

/* ---------- Cierre ---------- */
.cuadre { display: grid; gap: 0; } .cuadre .ln { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; border-bottom: 1px dashed var(--line); } .cuadre .ln .nm { font-weight: 600; color: var(--ink-2); } .cuadre .ln .vl { font: 700 22px var(--serif); }
.cuadre .ln.total { border-bottom: 0; padding-top: 18px; } .cuadre .ln.total .nm { color: var(--ink); font-weight: 800; } .cuadre .ln.total .vl { font-size: 34px; color: var(--violet); }
.diff { text-align: center; padding: 14px; border-radius: 16px; font-weight: 700; margin-top: 12px; } .diff.ok { background: var(--ok-bg); color: var(--ok); } .diff.bad { background: var(--bad-bg); color: var(--bad); } .diff .big-num { font-size: 28px; display: block; margin-top: 4px; }

/* ---------- Ingreso ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px; background: radial-gradient(circle at 20% 0%, var(--violet-2), transparent 55%), linear-gradient(160deg, var(--violet-d), #1b0b3d); }
.login .logo { color: #fff; text-align: center; margin-bottom: 26px; } .login .logo .mark { width: 74px; height: 74px; border-radius: 22px; background: rgba(255,255,255,.14); display: grid; place-items: center; margin: 0 auto 14px; font: 700 38px var(--serif); border: 1px solid rgba(255,255,255,.3); } .login .logo h1 { font: 700 32px var(--serif); } .login .logo p { opacity: .75; margin: 6px 0 0; }
.login .card { max-width: 420px; width: 100%; margin: 0 auto; padding: 22px; } .login .err { color: var(--bad); font-weight: 600; font-size: 14px; margin-top: 12px; text-align: center; }
.code-box { background: var(--violet-ll); border: 1.5px dashed var(--violet-2); border-radius: 14px; padding: 14px; font: 700 18px/1.5 ui-monospace, Menlo, monospace; text-align: center; letter-spacing: 2px; word-break: break-all; user-select: all; }
.otp { letter-spacing: 8px; text-align: center; font: 700 26px var(--serif); }
.detail summary { cursor: pointer; font-weight: 700; color: var(--violet); padding: 12px 0; list-style: none; display: flex; align-items: center; gap: 8px; } .detail summary::-webkit-details-marker { display: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.grid2 > *, .grid3 > *, .grid4 > * { margin-top: 0 !important; }
.list-row { flex-wrap: nowrap; } .list-row > b:last-child, .list-row > .badge { flex: none; }

/* ---- Segunda versión: etiquetas, calificación, proyección ---- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--violet-l); color: var(--violet); margin: 2px 4px 2px 0; }
.tag button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
.rating { border-left: 6px solid var(--line); }
.rating.b0 { border-left-color: var(--ok); } .rating.b1 { border-left-color: #eab308; } .rating.b2 { border-left-color: #f97316; } .rating.b4 { border-left-color: var(--b4); }
.note { padding: 10px 0; border-bottom: 1px solid var(--line); } .note:last-child { border-bottom: 0; } .note .meta { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.proj-day { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); } .proj-day:last-child { border-bottom: 0; }
.proj-day .dn { width: 92px; font-weight: 700; } .proj-day.off { opacity: .55; }
.statement { white-space: pre-wrap; background: var(--violet-l); border-radius: 14px; padding: 14px; font-size: 14px; line-height: 1.45; margin: 12px 0; }
.rtable { width: 100%; border-collapse: collapse; font-size: 14px; } .rtable th { text-align: right; font-size: 12px; color: var(--ink-2); padding: 8px 6px; border-bottom: 1px solid var(--line); } .rtable td { text-align: right; padding: 11px 6px; border-bottom: 1px solid var(--line); } .rtable th:first-child, .rtable td:first-child { text-align: left; font-weight: 700; }
.table-scroll { overflow-x: auto; }

/* Cuadros de acceso de la pantalla de inicio */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 8px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 112px; padding: 14px; border-radius: 18px; color: #fff; text-decoration: none; box-shadow: 0 4px 12px rgba(30, 20, 60, .16); position: relative; overflow: hidden; }
button.tile { border: 0; text-align: left; font: inherit; cursor: pointer; align-items: flex-start; width: 100%; }
.tile:active { transform: scale(.97); }
.tile .ti { width: 46px; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, .22); display: grid; place-items: center; }
.tile .tl { font-weight: 700; font-size: 16px; line-height: 1.15; }
.tile .th { font-size: 12.5px; opacity: .92; font-weight: 600; margin-top: -6px; white-space: nowrap; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(4, 1fr); } }

.ord-row { gap: 8px; background: var(--card); } .ord-row .icon-btn { width: 36px; height: 36px; } .ord-row.dragging, .ord-row.dragging * { user-select: none; -webkit-user-select: none; }
.ord-grip { flex: none; width: 22px; height: 34px; cursor: grab; touch-action: none; color: var(--ink-2); background: radial-gradient(circle, currentColor 1.7px, transparent 2.2px) 0 0 / 8px 9px; opacity: .7; border-radius: 6px; }
.ord-num { flex: none; width: 46px; height: 40px; text-align: center; font: 700 18px var(--serif); color: var(--violet); border: 1.5px solid var(--line); border-radius: 12px; background: var(--violet-ll); padding: 0; }
.ord-num:focus { outline: 2px solid var(--violet-2); background: var(--card); }
.ord-row.dragging { box-shadow: var(--shadow); border-radius: 14px; outline: 2px solid var(--violet-2); position: relative; z-index: 5; }

.rtable tr.row-link { cursor: pointer; } .rtable tr.row-link:hover td, .rtable tr.row-link:focus td { background: var(--violet-ll); } .rtable tr.row-link:focus { outline: 2px solid var(--violet-2); outline-offset: -2px; }
.tbl tr.row-link { cursor: pointer; }
.tbl td.r, .tbl th.r { white-space: nowrap; }

/* Filas "etiqueta: valor": el valor largo (dirección, condiciones, notas) baja de renglón en vez de montarse sobre la etiqueta. */
.list-row.kv { align-items: flex-start; }
.list-row.kv > span { flex: none; max-width: 45%; }
.list-row.kv > b { flex: 1 1 0; min-width: 0; text-align: right; overflow-wrap: anywhere; word-break: break-word; }
.list-row > .grow { min-width: 0; overflow-wrap: anywhere; }
.card .ln .nm { min-width: 0; overflow-wrap: anywhere; }


.content.wide { max-width: none; }
.tbl th.sortable { cursor: pointer; user-select: none; white-space: nowrap; } .tbl th.sortable:hover { color: var(--violet); }
.tbl th.sortable .sort-arrow { opacity: .35; font-size: 11px; } .tbl th.sortable.sorted { color: var(--violet); } .tbl th.sortable.sorted .sort-arrow { opacity: 1; }
.rcard .amts.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.rcard .strip { margin: 2px 0 10px; padding: 8px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.rcard .strip.bad { background: var(--bad-bg); color: var(--bad); } .rcard .strip.ok { background: rgba(124,58,237,.12); color: var(--violet); } .rcard .strip.warn { background: #fef3c7; color: #92400e; }

/* Ruta de cobro: cuatro cifras en dos filas y una franja con el estado de la cuota */
.rcard .amts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 10px 0 12px; }
.rcard .amts .vl .of { font: 600 14px var(--sans); color: var(--ink-2); }
.rcard .strip { padding: 8px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.rcard .strip > span:last-child { flex: none; }
.rcard .strip.bad { background: var(--bad-bg); color: var(--bad); }
.rcard .strip.ok { background: rgba(124,58,237,.12); color: var(--violet); }
.rcard .strip.warn { background: #fef3c7; color: #92400e; }
.rcard { flex: 0 0 auto; min-height: 0; }

/* Ruta de cobro compacta: caben 3 clientes por pantalla con la misma información */
.rcard { padding: 8px 12px 9px 18px; border-radius: 18px; }
.rcard .nm { font-size: 16px; line-height: 1.2; }
.rcard .addr { font-size: 11.5px; margin-top: 1px; }
.rcard .head .badge { font-size: 11px; padding: 3px 8px; }
.rcard .amts { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 6px; margin: 6px 0 6px; }
.rcard .amts .lb { font-size: 10px; line-height: 1.2; }
.rcard .amts .vl { font-size: 15px; line-height: 1.15; white-space: nowrap; }
.rcard .amts .vl .of { font-size: 11.5px; }
.rcard .strip { padding: 3px 8px; font-size: 11.5px; margin-bottom: 6px; border-radius: 9px; line-height: 1.3; }
.rcard .btns { margin-top: 0; gap: 6px; }
.rcard .btns .btn { min-height: 36px; font-size: 13px; border-radius: 11px; }

/* Ruta: cabecera más baja para que quepa más lista */
.route-screen .topbar { padding-top: calc(env(safe-area-inset-top) + 4px); padding-bottom: 8px; }
.route-screen .progress-pill { margin-top: 6px; padding: 8px 12px; }

/* Arqueo de caja por denominaciones */
.arq { display: grid; gap: 0; }
.arq .hd { display: grid; grid-template-columns: 76px 1fr 84px; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink-2); padding: 0 0 6px; text-transform: uppercase; letter-spacing: .03em; }
.arq .hd span:last-child, .arq .rw .sub { text-align: right; }
.arq .rw { display: grid; grid-template-columns: 76px 1fr 84px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.arq .rw .dn { font: 700 16px var(--serif); }
.arq .rw .st { display: flex; align-items: center; gap: 6px; min-width: 0; }
.arq .rw .st button { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--violet-2); color: #fff; font-size: 22px; font-weight: 700; line-height: 1; }
.arq .rw .st input { flex: 1; min-width: 0; width: 100%; max-width: 90px; height: 40px; text-align: center; font-size: 18px; font-weight: 700; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: #111827; -webkit-text-fill-color: #111827; opacity: 1; }
.arq .rw .st input::placeholder { color: #6b7280; opacity: 1; -webkit-text-fill-color: #6b7280; }
.arq .rw .st button:disabled, .arq .rw .st input:disabled { opacity: 1; }
.arq input.money { color: #111827; -webkit-text-fill-color: #111827; background: #fff; }
.arq input.money::placeholder { color: #6b7280; opacity: 1; -webkit-text-fill-color: #6b7280; }
.arq .rw .sub { font-weight: 700; font-size: 14px; }
.arq .rw .sub.zero { color: var(--ink-3, #9ca3af); font-weight: 500; }
.arq .tot { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 1px dashed var(--line); font-weight: 600; color: var(--ink-2); }
.arq .tot b { font: 700 18px var(--serif); color: var(--ink); }
.arq .tot.big { border-bottom: 0; } .arq .tot.big b { font-size: 26px; color: var(--violet); }
.arq .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.badge.b5 { background: #450a0a; color: #fecaca; } .rcard.b5::before { background: var(--b5); } .rating.b5 { border-left-color: var(--b5); }
