/* iConnect Facturación - same palette and style as the RIDE (#07385F + logo accents) */
:root {
  --primary: #07385F;
  --primary-2: #0B4A7C;
  --accent-1: #15A7DF;
  --accent-2: #19A486;
  --accent-3: #94BD7C;
  --ink: #1F2933;
  --muted: #5B6E7F;
  --line: #D9E2EA;
  --soft: #EEF3F7;
  --zebra: #F5F8FA;
  --bg: #F3F5F7;
  --white: #FFFFFF;
  --danger: #B42318;
  --danger-soft: #FDECEC;
  --warn: #9A6700;
  --warn-soft: #FFF6DB;
  --ok: #0F7B5F;
  --ok-soft: #E3F6EF;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .06);
  --font: "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* iOS: no automatic text inflation */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font: 15px/1.45 var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.2; }
h1 { font-size: 1.45rem; color: var(--primary); }
h2 { font-size: 1.15rem; color: var(--primary); }
h3 { font-size: .95rem; color: var(--primary); text-transform: uppercase; letter-spacing: .03em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* Signature stripe (top of every page, like the RIDE) */
.stripe { display: flex; height: 5px; position: sticky; top: 0; z-index: 30; }
.stripe span { flex: 1; }
.stripe span:nth-child(1) { background: var(--primary); }
.stripe span:nth-child(2) { background: var(--accent-1); }
.stripe span:nth-child(3) { background: var(--accent-2); }
.stripe span:nth-child(4) { background: var(--accent-3); }

/* Layout */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 5px); }
.sidebar { background: var(--primary); color: var(--white); padding: 18px 12px; position: sticky; top: 5px;
  height: calc(100vh - 5px); overflow-y: auto; }
/* iConnect logo on a white card: its navy lettering would disappear on the navy sidebar */
.brand { background: var(--white); border-radius: 12px; padding: 8px 10px; margin: 0 auto 16px; width: fit-content; }
.brand img { display: block; width: 96px; height: auto; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; padding: 9px 10px;
  border-radius: 8px; opacity: .88; font-size: .93rem; }
.nav a:hover { background: rgba(255, 255, 255, .08); opacity: 1; }
.nav a.active { background: rgba(255, 255, 255, .16); opacity: 1; font-weight: 600; }
.nav .group { margin: 14px 10px 4px; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .55; }
.nav svg { width: 18px; height: 18px; flex: none; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--white);
  border-bottom: 1px solid var(--line); position: sticky; top: 5px; z-index: 20; }
.topbar .spacer { flex: 1; }
/* Tax module (step 26) */
.big-number { display: block; font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.checks-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 14px; }
label.check { display: flex; gap: 6px; align-items: center; font-weight: 400; color: inherit; font-size: .9rem; }
label.check input { width: auto; }
tr.group-row th { text-align: left; padding-top: 14px; color: var(--primary); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.kpi.warn .value { color: var(--warn); }
/* "Llévelo en su celular" (Ed 2026-11-06): Android APK + Apple coming soon */
.app-dl { display: flex; align-items: center; gap: 6px; padding-right: 12px; border-right: 1px solid var(--line); }
.app-dl-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); color: var(--primary); cursor: pointer; text-decoration: none; line-height: 1; font: inherit; }
.app-dl-btn:hover { border-color: var(--primary); }
.app-dl-btn .brand-ico { width: 20px; height: 20px; }
.app-dl-btn .brand-ico.android { color: #3DDC84; }
.app-dl-btn .brand-ico .eye { fill: var(--white); }
.app-dl-btn.soon { color: var(--muted); }
.app-dl-btn .soon-tag { font-size: .64rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.content { padding: 22px 24px 90px; max-width: 1280px; }
.env { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; letter-spacing: .04em; }
.env.TEST { background: var(--warn-soft); color: var(--warn); }
.env.PRODUCTION { background: var(--ok-soft); color: var(--ok); }
.btn.menu-btn { display: none; }

/* Cards */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card.soft { background: var(--soft); box-shadow: none; }
.grid { display: grid; gap: 16px; }
.grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { border-radius: var(--radius); padding: 16px; background: var(--white); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--accent-1); }
.kpi.c2::before { background: var(--accent-2); }
.kpi.c3::before { background: var(--accent-3); }
.kpi.c4::before { background: var(--primary); }
.kpi .label { font-size: .8rem; color: var(--muted); }
.kpi .value { font-size: 1.6rem; font-weight: 700; color: var(--primary); margin-top: 2px; }
.kpi .sub { font-size: .8rem; color: var(--muted); }
.hero { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--white); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); }
.hero .label { opacity: .8; font-size: .85rem; }
.hero .value { font-size: 2rem; font-weight: 700; }
.alert { border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; font-size: .9rem; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.danger { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--soft); color: var(--primary); }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th { background: var(--primary); color: var(--white); text-align: left; font-weight: 600; padding: 9px 10px; white-space: nowrap; }
thead th:first-child { border-top-left-radius: 10px; }
thead th:last-child { border-top-right-radius: 10px; }
tbody td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:nth-child(even) td { background: var(--zebra); }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: #E6F2FA; }
td.num, th.num { text-align: right; white-space: nowrap; }

/* Status pills */
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.pill.DRAFT { background: #EEF0F3; color: #475467; }
.pill.SIGNED, .pill.RECEIVED { background: var(--warn-soft); color: var(--warn); }
.pill.AUTHORIZED { background: var(--ok-soft); color: var(--ok); }
.pill.RETURNED, .pill.NOT_AUTHORIZED { background: var(--danger-soft); color: var(--danger); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; grid-column: span 4; min-width: 0; }
.field.s2 { grid-column: span 2; } .field.s3 { grid-column: span 3; } .field.s6 { grid-column: span 6; }
.field.s8 { grid-column: span 8; } .field.s12 { grid-column: span 12; }
.field label { font-size: .78rem; color: var(--muted); font-weight: 600; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--white); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-1); outline-offset: 0; border-color: var(--accent-1); }
input[type=checkbox] { width: auto; }
input[type=color] { height: 40px; padding: 3px; cursor: pointer; }
textarea { min-height: 70px; resize: vertical; }
.lines td { padding: 6px; }
.lines input, .lines select { padding: 6px 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.btn { border: 0; border-radius: 9px; padding: 9px 16px; background: var(--primary); color: var(--white); cursor: pointer; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--primary-2); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.secondary { background: var(--soft); color: var(--primary); }
.btn.secondary:hover { background: #E1EAF1; }
.btn.accent { background: var(--accent-2); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: wait; }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; text-decoration: underline; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { text-decoration: none; padding: 7px 12px; border-radius: 999px; background: var(--white); color: var(--primary); font-size: .88rem;
  box-shadow: var(--shadow); }
.tabs a.active { background: var(--primary); color: var(--white); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.toolbar .field { grid-column: auto; min-width: 150px; }
/* A row of fields followed by a toolbar (Reportes: Desde/Hasta, then Este mes/Mes anterior) */
.form-grid + .toolbar { margin-top: 14px; }
/* Customer / provider search (Nueva factura and the other documents, Ed 2026-11-06) */
.combo { position: relative; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 300px; overflow: auto; }
.combo-item { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--ink); }
.combo-item small { display: block; color: var(--muted); font-size: .8rem; }
.combo-item:hover, .combo-item.active { background: var(--soft); }
.combo-item.create { color: var(--primary); font-weight: 600; border-top: 1px solid var(--line); }
.combo-empty { padding: 10px 12px; color: var(--muted); font-size: .88rem; }
.party-chosen { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.party-chosen small { display: block; color: var(--muted); }
/* Two cards side by side (Pago | Información adicional); one under the other on phones */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; margin-bottom: 16px; }
.pair > .card { margin-bottom: 0; }
@media (max-width: 900px) { .pair { grid-template-columns: 1fr; } }
/* Primeros pasos (dashboard) and the guide */
.onboarding { border-left: 4px solid #15A7DF; }
.steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; }
.steps li { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.steps .tick { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center;
  font-size: .75rem; font-weight: 700; color: var(--white); }
.steps li.done .tick { background: var(--ok); border-color: var(--ok); }
.steps li.done a { color: var(--muted); text-decoration: line-through; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }
.guide-step h2 { margin-top: 0; }
.apk-card { border-left: 4px solid #19A486; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .92rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Chart */
.chart { width: 100%; height: 220px; }
.chart text { font-size: 11px; fill: var(--muted); }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Login */
.login-wrap { min-height: calc(100vh - 5px); display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 400px; }
.login .logo { text-align: center; margin: 4px 0 18px; }
.login .logo img { width: 190px; max-width: 70%; height: auto; }
.login-subtitle { text-align: center; color: var(--primary); font-weight: 600; margin: 0 0 18px; }
.login-links { text-align: center; margin-top: 14px; font-size: .9rem; }
.register { width: 100%; max-width: 820px; }
.login-wrap:has(.register) { align-items: start; }
.register .logo { text-align: center; margin-bottom: 8px; }
.register .logo img, .login .logo img { width: 190px; max-width: 70%; height: auto; }
.register h3 { margin-top: 18px; }
.terms-box { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px;
  background: var(--zebra); font-size: .88rem; }
.terms h2 { font-size: 1.05rem; margin-top: 12px; }
.terms h3 { font-size: .9rem; margin-top: 14px; text-transform: none; letter-spacing: 0; }
.terms p, .terms li { margin: 4px 0; }
.accept { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: .92rem; }

/* Plans */
.public-page { max-width: 1180px; margin: 0 auto; padding: 24px 16px 40px; }
.plans-logo { text-align: center; margin-bottom: 6px; }
.plans-logo img { width: 160px; max-width: 60%; height: auto; }
.center { text-align: center; }
.actions.center { justify-content: center; }
.promo { display: flex; gap: 16px; align-items: center; background: var(--accent-2); color: var(--white); border-radius: var(--radius);
  padding: 14px 20px; margin: 16px 0; }
.promo > b { font-size: 1.8rem; white-space: nowrap; }
.plans { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 16px 0 8px; align-items: stretch; }
.plan { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; position: relative;
  border-top: 5px solid var(--primary); display: flex; flex-direction: column; }
.plan.featured { border: 2px solid var(--accent-1); border-top-width: 5px; }
.plan-tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent-1); color: var(--white);
  font-size: .72rem; font-weight: 700; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.plan h3 { margin: 4px 0 2px; color: var(--primary); font-size: 1.15rem; text-transform: none; letter-spacing: 0; }
.plan p { min-height: 2.6em; margin: 0 0 8px; }
.plan-price b { font-size: 2rem; color: var(--primary); }
.plan-annual { font-size: .88rem; color: var(--muted); margin-top: 2px; }
.plan-annual b { color: var(--accent-2); }
.plan-save { font-size: .78rem; color: var(--ok); background: var(--ok-soft); border-radius: 999px; padding: 2px 8px; margin-top: 6px;
  align-self: flex-start; }
.checks { list-style: none; padding: 0; margin: 12px 0 0; font-size: .88rem; }
.checks li { padding-left: 22px; position: relative; margin: 6px 0; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-2); font-weight: 700; }
.checks.two { columns: 2; column-gap: 24px; }
.free { margin-top: 14px; }
.plan-card .plan-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: end; }
.plan-use b { font-size: 1.25rem; color: var(--primary); }
.meter { height: 10px; background: var(--soft); border-radius: 999px; overflow: hidden; margin: 10px 0 8px; }
.meter-fill { height: 100%; background: var(--accent-2); border-radius: 999px; }
.meter-fill.high { background: var(--warn); }
.meter-fill.over { background: var(--danger); }
@media (max-width: 1100px) { .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 22px; } }
@media (max-width: 700px) {
  .plans { grid-template-columns: 1fr; }
  .checks.two { columns: 1; }
  .promo { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* Toasts and modal */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast { background: var(--ink); color: var(--white); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: .9rem; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
.modal-back { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--white); border-radius: var(--radius); max-width: 560px; width: 100%; padding: 20px; max-height: 90vh; overflow: auto; }
.secret { font-family: Consolas, monospace; background: var(--soft); padding: 10px; border-radius: 8px; font-size: 1.05rem; word-break: break-all; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.spinner { width: 18px; height: 18px; border: 3px solid var(--soft); border-top-color: var(--accent-1); border-radius: 50%;
  animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Inventory (step 23) */
.neg { color: var(--danger); }
a.kpi { display: block; color: inherit; text-decoration: none; }
a.kpi:hover { box-shadow: 0 0 0 2px var(--accent-1); }
.pill + .pill { margin-left: 4px; }
.stock-hint { display: block; font-size: .72rem; color: var(--muted); margin-top: 2px; }
.stock-hint.short { color: var(--danger); font-weight: 600; }
table.lines td select.lot { min-width: 160px; }

/* Phones: drawer menu and single column */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  /* height:auto so top/bottom define it: 100vh on iPhone includes the area behind the browser bars and the
     home indicator, which pushed the last items ("Salir") out of reach */
  .sidebar { position: fixed; inset: 5px auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s;
    height: auto; max-height: calc(100dvh - 5px); overscroll-behavior: contain;
    padding-top: calc(18px + env(safe-area-inset-top)); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  /* iOS zooms into any field under 16 px when it gets the focus and stays zoomed */
  input, select, textarea { font-size: 16px; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(16, 24, 40, .35); }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 10px 14px; }
  .content { padding: 16px 14px 90px; }
  .grid.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.k3, .grid.k2 { grid-template-columns: 1fr; }
  .field, .field.s2, .field.s3, .field.s6, .field.s8 { grid-column: span 12; }
  .hide-sm { display: none; }
  .app-dl { border-right: 0; padding-right: 0; gap: 4px; }
}
@media print {
  .sidebar, .topbar, .stripe, .actions, #toasts { display: none !important; }
  .shell { display: block; }
  body { background: var(--white); }
}

/* API guide, connection badge, offline outbox */
pre.code { background: #0B2540; color: #E6F1F8; border-radius: 10px; padding: 12px 14px; overflow-x: auto;
  font: 12.5px/1.5 Consolas, "Cascadia Mono", Menlo, monospace; white-space: pre; margin: 6px 0 10px; }
.net { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.net.offline { background: #FDECEC; color: #A3261D; }
.net.pending { background: #FFF4DB; color: #8A5A00; text-decoration: none; }
/* Accounting module (step 27) */
.strong { font-weight: 700; }
tr.clickable { cursor: pointer; }
tr.clickable:hover th { text-decoration: underline; }
tr.warn-row th { color: var(--warn); }
.row-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.kpi .value.small { font-size: 1rem; }
table.entry-lines select { min-width: 240px; max-width: 420px; }
table.entry-lines input[type="number"] { width: 110px; text-align: right; }
.toast.warn { background: var(--warn); }.warn-text { color: var(--warn); }

/* Spacing fixes (Ed 2026-11-07): buttons above filters, tabs, cards and KPI rows; nested toolbars; same control height */
.actions + .tabs, .actions + .toolbar, .actions + .card, .actions + .grid, .plan-head + .grid { margin-top: 16px; }
.toolbar .toolbar { margin-bottom: 0; }
.toolbar input, .toolbar select { height: 40px; }
.toolbar .check { align-self: center; }
.grow { flex: 1; }
.recover { width: 100%; max-width: 420px; }
.recover .logo { text-align: center; margin-bottom: 8px; }
.recover .logo img { max-width: 180px; width: 100%; }

/* Rating page of the 7-day follow-up email (feedback.html, step 31, Ed 2026-11-13) */
.fb-body { display: flex; flex-direction: column; align-items: center; padding: 28px 16px; }
.fb-card { width: 100%; max-width: 560px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.fb-stripe { display: flex; height: 5px; }
.fb-stripe span { flex: 1; background: var(--accent-1); }
.fb-stripe span:nth-child(2) { background: var(--accent-2); }
.fb-stripe span:nth-child(3) { background: var(--accent-3); }
.fb-inner { padding: 22px 26px 26px; }
.fb-logo { display: block; width: 100px; height: auto; margin-bottom: 14px; }
.fb-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 14px 0 20px; }
.fb-rate { border: 1px solid var(--line); border-radius: 10px; background: var(--white); padding: 10px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.fb-rate b { font-size: 1.4rem; color: var(--primary); line-height: 1.2; }
.fb-rate span { font-size: .72rem; color: var(--muted); text-align: center; }
.fb-rate:hover { border-color: var(--accent-1); }
.fb-rate.on { background: var(--primary); border-color: var(--primary); }
.fb-rate.on b, .fb-rate.on span { color: var(--white); }
.fb-label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; color: var(--ink); }
.fb-label textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px; font-weight: 400; }
.fb-foot { margin-top: 14px; }
.fb-foot a { color: var(--muted); }
/* Platform > Opiniones */
.fb-stars { font-weight: 700; color: var(--primary); white-space: nowrap; }
.fb-low { color: var(--danger); }
.fb-comment { max-width: 420px; white-space: pre-wrap; }

/* Cuentas por pagar / cobrar: payments window (2026-11-20) */
.ld { display: flex; flex-direction: column; gap: 14px; }
.ld-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ld-party { font-size: 1.05rem; font-weight: 700; color: var(--primary); line-height: 1.25; }
.ld-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ld-stat { background: var(--soft); border-radius: 10px; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ld-stat span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.ld-stat b { font-size: 1.05rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-stat small { font-size: .75rem; color: var(--muted); }
.ld-stat.hot { background: var(--warn-soft); } .ld-stat.hot b { color: var(--warn); }
.ld-stat.done { background: var(--ok-soft); } .ld-stat.done b { color: var(--ok); }
.ld-stat.late { background: var(--danger-soft); } .ld-stat.late b, .ld-stat.late small { color: var(--danger); }
.ld-rows { border: 1px solid var(--line); border-radius: 10px; }
.ld-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; }
.ld-row + .ld-row, .ld-edit + .ld-row { border-top: 1px solid var(--line); }
.ld-row-label { flex: 0 0 150px; font-size: .8rem; color: var(--muted); }
.ld-row-value { flex: 1; min-width: 0; font-size: .9rem; }
.ld-edit { padding: 4px 12px 12px; background: var(--zebra); }
.ld-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ld-inline input { width: 90px; }
.ld-sub { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: -6px; }
.ld-pays { display: flex; flex-direction: column; gap: 6px; }
.ld-pay { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); }
.ld-pay-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ld-pay.void { opacity: .6; } .ld-pay.void b { text-decoration: line-through; }
.ld-form { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 600px) {
  .ld-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ld-row { flex-wrap: wrap; } .ld-row-label { flex-basis: 100%; }
}