/* =====================================================================
   VOA Capital · estilos
   ===================================================================== */
/* Lenguaje visual según las guías de Apple: base neutra (grises del sistema), UN solo
   acento (azul) para lo interactivo, y color de estado solo donde comunica algo
   (atraso, pagado). Fuente del sistema, materiales translúcidos y resortes. */
:root {
  --bg: #F5F5F7;
  --bg-2: #EDEDF0;
  --surface: #FFFFFF;
  --surface-2: #FAFAFA;
  --line: rgba(60, 60, 67, .12);
  --line-2: rgba(60, 60, 67, .2);
  --text: #1D1D1F;
  --text-2: #6E6E73;
  --text-3: #86868B;
  --brand: #0071E3;
  --brand-2: #0077ED;
  --brand-soft: rgba(0, 113, 227, .08);
  --ink: #1D1D1F;
  --ok: #1D7F37;
  --ok-soft: rgba(36, 138, 61, .09);
  --warn: #A35200;
  --warn-soft: rgba(201, 107, 0, .09);
  --bad: #C4001A;
  --bad-soft: rgba(215, 0, 21, .07);
  --info: #0071E3;
  --info-soft: rgba(0, 113, 227, .08);
  --violet: #6E6E73;
  /* Gráficos: el acento y grises; los colores de estado solo en la antigüedad de deuda */
  --chart-1: #0071E3; --chart-2: #8FB8EE; --chart-3: #C7C7CC; --chart-4: #48484A; --chart-line: #1D1D1F;
  --age-0: #A1C9A9; --age-1: #E8C27A; --age-2: #DE9A5B; --age-3: #D0614F; --age-4: #9E2A2B;
  /* Materiales: el más pesado separa regiones (barra lateral), el ligero flota sobre el contenido */
  --mat-thick: rgba(246, 246, 248, .78);
  --mat-thin: rgba(255, 255, 255, .72);
  --mat-edge: rgba(255, 255, 255, .6);
  --scrim: rgba(0, 0, 0, .32);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow: 0 1px 1px rgba(0, 0, 0, .03), 0 4px 18px -6px rgba(0, 0, 0, .07);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .06), 0 30px 70px -12px rgba(0, 0, 0, .28);
  --ease: cubic-bezier(.32, .72, 0, 1);
  --r: 18px;
  --r-sm: 12px;
  --side: 260px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --bg-2: #1C1C1E; --surface: #161618; --surface-2: #1C1C1E; --line: rgba(84, 84, 88, .4); --line-2: rgba(84, 84, 88, .65);
    --text: #F5F5F7; --text-2: #A1A1A6; --text-3: #7C7C80; --brand: #2997FF; --brand-2: #47A6FF; --brand-soft: rgba(41, 151, 255, .12);
    --ink: #F5F5F7; --ok: #6CC27F; --ok-soft: rgba(108, 194, 127, .1); --warn: #E3A35A; --warn-soft: rgba(227, 163, 90, .1);
    --bad: #F07A72; --bad-soft: rgba(240, 122, 114, .1); --info: #2997FF; --info-soft: rgba(41, 151, 255, .12); --violet: #A1A1A6;
    --chart-1: #2997FF; --chart-2: #1F5A99; --chart-3: #48484A; --chart-4: #A1A1A6; --chart-line: #F5F5F7;
    --age-0: #5E8F69; --age-1: #B8975A; --age-2: #B97A46; --age-3: #B4554A; --age-4: #8A3333;
    --mat-thick: rgba(22, 22, 24, .78); --mat-thin: rgba(30, 30, 32, .72); --mat-edge: rgba(255, 255, 255, .08); --scrim: rgba(0, 0, 0, .55);
    --shadow: 0 0 0 1px rgba(255, 255, 255, .05); --shadow-lg: 0 30px 70px -12px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --bg-2: #1C1C1E; --surface: #161618; --surface-2: #1C1C1E; --line: rgba(84, 84, 88, .4); --line-2: rgba(84, 84, 88, .65);
  --text: #F5F5F7; --text-2: #A1A1A6; --text-3: #7C7C80; --brand: #2997FF; --brand-2: #47A6FF; --brand-soft: rgba(41, 151, 255, .12);
  --ink: #F5F5F7; --ok: #6CC27F; --ok-soft: rgba(108, 194, 127, .1); --warn: #E3A35A; --warn-soft: rgba(227, 163, 90, .1);
  --bad: #F07A72; --bad-soft: rgba(240, 122, 114, .1); --info: #2997FF; --info-soft: rgba(41, 151, 255, .12); --violet: #A1A1A6;
  --chart-1: #2997FF; --chart-2: #1F5A99; --chart-3: #48484A; --chart-4: #A1A1A6; --chart-line: #F5F5F7;
  --age-0: #5E8F69; --age-1: #B8975A; --age-2: #B97A46; --age-3: #B4554A; --age-4: #8A3333;
  --mat-thick: rgba(22, 22, 24, .78); --mat-thin: rgba(30, 30, 32, .72); --mat-edge: rgba(255, 255, 255, .08); --scrim: rgba(0, 0, 0, .55);
  --shadow: 0 0 0 1px rgba(255, 255, 255, .05); --shadow-lg: 0 30px 70px -12px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  letter-spacing: -.01em; -webkit-font-smoothing: antialiased; font-optical-sizing: auto;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .35s ease, color .35s ease;
}
/* Tracking según tamaño: los títulos se cierran, el texto pequeño se abre */
h1, h2, h3, h4 { margin: 0; letter-spacing: -.022em; line-height: 1.2; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif; }
small, .sm { letter-spacing: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.ic { width: 18px; height: 18px; flex: none; }
.ic.xs { width: 13px; height: 13px; vertical-align: -2px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .92em; color: var(--text-2); }
.muted { color: var(--text-2); }
.sm { font-size: 13px; }
.b { font-weight: 700; }
.block { display: block; }
.grow { flex: 1; }
.r { text-align: right !important; }
.mt, .dl.mt { margin-top: 18px; }
.ok-txt { color: var(--ok); } .bad-txt { color: var(--bad); } .warn-txt { color: var(--warn); } .danger-txt { color: var(--bad) !important; }
.self-end { align-self: flex-end; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; white-space: nowrap; user-select: none;
  transition: background .2s var(--ease), border-color .2s, transform 100ms ease-out, box-shadow .2s;
}
/* Respuesta en el instante del toque (pointer-down), no al soltar */
.btn:active, .chip:active, .pill:active, .icon-btn:active, .avatar-btn:active { transform: scale(.96); transition-duration: 60ms; }
a.row-card:active, button.row-card:active, .table tr[data-href]:active td { background: var(--bg-2); transition-duration: 0s; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { background: var(--bg-2); color: var(--text); }
.btn.ghost:hover { background: color-mix(in srgb, var(--bg-2) 88%, var(--text)); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.danger.ghost { background: transparent; color: var(--bad); border-color: var(--bad-soft); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn.lg { height: 50px; font-size: 16px; font-weight: 600; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; pointer-events: none; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.ghost.loading::after { border-color: var(--text); border-right-color: transparent; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 2px; }
.link .ic { width: 15px; height: 15px; }
.block-link { display: flex; justify-content: center; padding: 12px 0 2px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--text-2);
  display: inline-grid; place-items: center; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-2); color: var(--text); }
.icon-btn.soft { background: var(--bg-2); }
.icon-btn.soft:hover { background: var(--brand-soft); color: var(--brand); }
.icon-btn:disabled { opacity: .35; pointer-events: none; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid transparent;
  background: var(--bg-2); outline: none; transition: border-color .15s, box-shadow .15s; font-size: 15px;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
input[readonly] { background: var(--surface-2); color: var(--text-2); }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238592A6' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-xl { height: 56px !important; font-size: 26px !important; font-weight: 700; letter-spacing: -.02em; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-err { color: var(--bad); font-size: 13px; font-weight: 500; min-height: 0; }
.form-err:empty { display: none; }
.hint { font-size: 13px; color: var(--text-2); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-2, .row-3 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row-2 .grow { min-width: 0; }
.fs { border: 1px dashed var(--line-2); border-radius: 12px; padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.fs legend { font-size: 12.5px; font-weight: 700; color: var(--text-2); padding: 0 6px; }
.search { position: relative; display: flex; align-items: center; min-width: 220px; }
.search .ic { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.search input { padding-left: 38px !important; }
.search.lg input { height: 48px; font-size: 16px; }
.select-inline { position: relative; display: flex; align-items: center; }
.select-inline .ic { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.select-inline select { padding-left: 38px; min-width: 220px; }
.switch { position: relative; width: 40px; height: 24px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:disabled + i { opacity: .5; }

/* ---------- Segmentos / pestañas / chips ---------- */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); }
.seg > button, .seg > label > span {
  border: 0; background: transparent; height: 34px; padding: 0 14px; border-radius: 8px; font-weight: 600; font-size: 13px;
  color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s;
}
.seg > button span { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--line); color: var(--text-2); }
.seg > button.on, .seg > label > input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg > button.on span { background: var(--brand-soft); color: var(--brand); }
.seg.full { display: flex; }
.seg.full > label { flex: 1; }
.seg.full > label > span { width: 100%; justify-content: center; }
.seg > label > input { position: absolute; opacity: 0; pointer-events: none; }
.seg.scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 14px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 14px 12px; font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs button.on { color: var(--text); border-color: var(--brand); }
.tabs button span { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--bg-2); }
.tabs.boxed { background: var(--surface); border-radius: var(--r); margin-bottom: 16px; box-shadow: var(--shadow); border-bottom: 0; }
.dot-new { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -4px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.chip:hover { border-color: var(--text-3); color: var(--text); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; letter-spacing: .01em; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.mute { background: var(--bg-2); color: var(--text-3); }
.method { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--bg-2); }
.method { color: var(--text-2); font-weight: 600; }

/* ---------- Avatares ---------- */
.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13.5px; background: linear-gradient(180deg, #A1A1A6, #8A8A8F); color: #fff; letter-spacing: .02em; }
.avatar.soft { background: var(--bg-2); color: var(--text-2); }

/* ---------- Estructura ---------- */
.shell { min-height: 100vh; }
/* Barra lateral: material grueso translúcido, separa la estructura sin robar atención */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side); color: var(--text);
  background: var(--mat-thick); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 14px 16px; z-index: 20;
}
.brandmark { display: flex; align-items: center; gap: 11px; }
.brandmark b { font-size: 17px; color: inherit; letter-spacing: -.022em; font-weight: 700; }
.side .brandmark { padding: 0 8px 22px; }
.side .brandmark span { display: flex; flex-direction: column; line-height: 1.2; }
.side .brandmark small { color: var(--text-3); font-size: 12px; font-weight: 500; }
.side-cta { margin-bottom: 18px; }
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; font-weight: 500; color: var(--text); transition: background .2s var(--ease), color .2s; }
.side-nav a .ic { color: var(--text-2); }
.side-nav a:hover { background: var(--line); }
.side-nav a:active { background: var(--line-2); }
.side-nav a.active { background: var(--line-2); color: var(--text); font-weight: 600; }
.side-nav a.active .ic { color: var(--text); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.demo-chip { font-size: 12px; color: var(--text-2); background: var(--line); border-radius: 10px; padding: 8px 10px; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.demo-chip .ic { width: 15px; height: 15px; }
.demo-chip .link { margin-left: auto; color: var(--brand); text-decoration: underline; font-size: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--mat-thin); box-shadow: 0 0 0 1px var(--line); }
.me .avatar { width: 34px; height: 34px; font-size: 12px; }
.me-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.me-txt b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-txt small { color: var(--text-3); font-size: 11.5px; }
.me .icon-btn { width: 30px; height: 30px; }
.main { margin-left: var(--side); min-width: 0; }
.topbar { display: none; }
.demo-bar { display: none; }
.view { padding: 28px 32px 48px; max-width: 1360px; margin: 0 auto; }
.bottom-nav { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -.028em; }
.page-head p { color: var(--text-2); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-weight: 600; font-size: 13px; margin-bottom: 12px; }
.crumb:hover { color: var(--text); }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 640px; }
.card + .card, section + section, .card + section, section + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head.pad { padding: 16px 18px; margin: 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h3, .card-title { font-size: 15px; font-weight: 700; }
.card-title { margin: 4px 0 14px; }
.card-title:not(:first-child) { margin-top: 26px; }
.sub-title { font-size: 13px; font-weight: 700; margin: 18px 0 8px; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.grid-2, .grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.grid-2 > .card + .card, .grid-3 > .card + .card { margin-top: 0; }

.kpis { display: grid; gap: 14px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--surface); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; min-width: 0; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.kpi-top i { display: grid; place-items: center; color: var(--text-3); }
.kpi.bad .kpi-val { color: var(--bad); }
.kpi-top .ic { width: 16px; height: 16px; }
.kpi-val { font-size: 25px; font-weight: 700; letter-spacing: -.028em; margin-top: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.kpi-sub .bar { margin: 6px 0 4px; }
.methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; margin-top: 10px; }
.methods div { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; }
.methods small { color: var(--text-2); }

.bar { height: 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; margin-top: 8px; }
.bar.thin { height: 5px; margin: 0; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 320px; }

.aging { display: flex; flex-direction: column; gap: 14px; }
.aging-row { display: grid; grid-template-columns: auto 92px 1fr auto auto; align-items: center; gap: 10px; font-size: 13.5px; }
.aging-row:not(:has(.dot)) { grid-template-columns: 92px 1fr auto auto; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.al_dia, .bar i.al_dia { background: var(--age-0); }
.dot.d1_7, .bar i.d1_7 { background: var(--age-1); }
.dot.d8_30, .bar i.d8_30 { background: var(--age-2); }
.dot.d31_60, .bar i.d31_60 { background: var(--age-3); }
.dot.d60, .bar i.d60 { background: var(--age-4); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; margin-top: 12px; }
.alert .ic { margin-top: 1px; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.info { background: var(--bg-2); color: var(--text-2); }
.view > .alert { margin: 0 0 16px; }

/* ---------- Listas tipo fila ---------- */
.list { display: flex; flex-direction: column; }
.card:not(.flush) .list { margin: 0 -18px -18px; }
.row-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 0; border-top: 1px solid var(--line);
  background: none; width: 100%; text-align: left; transition: background .12s; flex-wrap: wrap;
}
.list > .row-card:first-child { border-top: 0; }
.card:not(.flush) .list > .row-card:first-child { border-top: 1px solid var(--line); }
a.row-card:hover, button.row-card:hover, .row-card:has(.rc-link:hover) { background: var(--surface-2); }
.row-card.static:hover { background: none; }
.rc-link { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.rc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rc-main b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-main small { color: var(--text-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-main small.addr { color: var(--text-3); display: flex; gap: 4px; align-items: center; }
.rc-main small.addr .ic { width: 13px; height: 13px; }
.rc-main .bar { max-width: 260px; }
.rc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.rc-side b { font-size: 15px; font-weight: 750; }
.rc-side small { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.rc-actions { display: flex; align-items: center; gap: 8px; }
.rc-actions select { height: 34px; width: auto; font-size: 13px; }
.contact-btns { display: flex; gap: 6px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 700; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tfoot td { background: var(--surface-2); font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; }
.table small { font-size: 12px; }
.table .bar { max-width: 110px; margin: 6px 0 0 auto; }
.table.compact td, .table.compact th { padding: 7px 10px; }
.row-bad td { background: var(--bad-soft); }
.row-warn td { background: var(--warn-soft); }
.voided td { opacity: .5; text-decoration: line-through; }
.voided td small.bad-txt { text-decoration: none; opacity: 1; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .avatar { width: 34px; height: 34px; font-size: 12px; }
.cell-user > span:not(.avatar) { display: flex; flex-direction: column; line-height: 1.3; }
.cell-user small { color: var(--text-3); }

/* ---------- Barra de herramientas ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.toolbar.wrap { flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters select { width: auto; min-width: 160px; }

/* ---------- Detalle ---------- */
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.dh-main { display: flex; gap: 14px; align-items: center; min-width: 0; }
.dh-main .avatar { width: 56px; height: 56px; font-size: 17px; }
.dh-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dh-title h1 { font-size: 24px; font-weight: 700; }
.dh-main p { margin-top: 4px; font-size: 13px; }
.dh-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; text-align: right; font-weight: 550; }
.dni-thumb { display: inline-flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 10px; border: 1px dashed var(--line-2); background: var(--surface-2); font-weight: 600; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--bad-soft); }
.danger-zone div { display: flex; flex-direction: column; }
.danger-zone small { color: var(--text-3); font-size: 12px; }

/* ---------- Nuevo préstamo ---------- */
.grid-form { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.grid-form .card > .field, .grid-form .card > .row-2, .grid-form .card > .row-3, .grid-form .card > .check { margin-bottom: 14px; }
.sticky { position: sticky; top: 20px; }
.plan-pills { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 16px; }
.pill { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s; }
.pill b { font-size: 13.5px; }
.pill small { color: var(--text-3); font-size: 12px; }
.pill:hover { border-color: var(--text-3); }
.pill.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.pill.on small { color: var(--brand); }
.summary > div:first-child { display: flex; flex-direction: column; padding: 18px; border-radius: 16px; background: var(--bg-2); margin-bottom: 16px; }
.summary > div:first-child small { color: var(--text-2); }
.big { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin: 2px 0; }
.sched-mini { margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; }
.sched-mini summary { padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.sched-mini .table-wrap { max-height: 280px; overflow: auto; border-top: 1px solid var(--line); }
#preview .form-err { margin-bottom: 10px; }

/* ---------- Pago ---------- */
.pay-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pay-head div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pay-head small { color: var(--text-2); font-size: 12.5px; }
.pay-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border-radius: 12px; overflow: hidden; background: var(--line); border: 1px solid var(--line); margin-bottom: 16px; }
.pay-facts div { background: var(--surface-2); padding: 10px 12px; display: flex; flex-direction: column; }
.pay-facts small { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.pay-facts b { font-size: 15px; }
.upload { display: block; border: 1.5px dashed var(--line-2); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; overflow: hidden; }
.upload:hover { border-color: var(--text-3); background: var(--surface-2); }
.up-empty { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 18px; text-align: center; }
.up-empty .ic { width: 26px; height: 26px; color: var(--text-2); margin-bottom: 4px; }
.up-empty small { color: var(--text-3); font-size: 12.5px; }
.upload.sm .up-empty { padding: 12px; }
.up-prev { display: block; position: relative; }
.up-prev img { display: block; width: 100%; max-height: 240px; object-fit: contain; background: var(--bg-2); }
.up-prev .icon-btn { position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, .55); color: #fff; }
[hidden] { display: none !important; }
.lightbox { display: grid; place-items: center; background: var(--bg-2); border-radius: 12px; overflow: hidden; }
.lightbox img { max-height: 70vh; object-fit: contain; }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: var(--scrim); opacity: 0; transition: opacity .3s var(--ease); }
.modal-wrap.in { opacity: 1; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); transform: scale(.94); opacity: 0; transition: transform .4s var(--ease), opacity .25s ease; will-change: transform; }
.modal.wide { width: min(760px, 100%); }
.modal-wrap.in .modal { transform: none; opacity: 1; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px 20px; }
.modal-head h3 { font-size: 17px; font-weight: 750; }
.modal-body { padding: 4px 20px 18px; overflow-y: auto; overscroll-behavior: contain; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.menu-list { display: flex; flex-direction: column; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 12px; padding: 14px 6px; border: 0; background: none; border-bottom: 1px solid var(--line); font-weight: 600; text-align: left; }
.menu-list > :last-child { border-bottom: 0; }

/* ---------- Avisos ---------- */
#toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; background: rgba(30, 30, 32, .86); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); color: #fff; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(16px) scale(.96); transition: opacity .3s ease, transform .45s var(--ease); max-width: calc(100vw - 32px); }
.toast.in { opacity: 1; transform: none; }
.toast.bad .ic { color: #FF8A80; }

/* ---------- Vacío / carga ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 36px 20px; color: var(--text-2); gap: 6px; }
.empty > .ic { width: 34px; height: 34px; color: var(--text-3); padding: 8px; box-sizing: content-box; background: var(--bg-2); border-radius: 14px; margin-bottom: 6px; }
.empty h3 { font-size: 15px; color: var(--text); }
.empty p { font-size: 13.5px; max-width: 340px; }
.empty .btn { margin-top: 10px; }
.splash { min-height: 100vh; display: flex; flex-direction: column; gap: 22px; align-items: center; justify-content: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line-2); border-top-color: var(--text-2); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* ---------- Acceso ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.auth.single { grid-template-columns: 1fr; }
.auth-art { position: relative; overflow: hidden; background: var(--bg); color: var(--text); display: flex; align-items: center; padding: 64px; border-right: 1px solid var(--line); }
.auth-art-in { position: relative; z-index: 1; max-width: 520px; }
.brandmark.lg b { font-size: 22px; }
.auth-art h1 { font-size: 48px; font-weight: 700; letter-spacing: -.035em; line-height: 1.05; margin: 44px 0 32px; }
.auth-art h1 span { color: var(--text-3); }
.auth-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; color: var(--text-2); }
.auth-points li { display: flex; gap: 12px; align-items: center; }
.auth-points .ic { color: var(--text); width: 20px; height: 20px; }
.auth-form { background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; gap: 18px; }
.auth-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; }
.auth-card.center { text-align: center; align-items: stretch; }
.auth-card.center .brandmark { justify-content: center; }
.auth-card h2 { font-size: 28px; font-weight: 700; letter-spacing: -.028em; }
.auth-card .note { background: var(--bg-2); color: var(--text-2); padding: 12px 14px; border-radius: 12px; font-size: 13.5px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; flex-wrap: wrap; }
.auth-links a { color: var(--brand); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.auth-foot { color: var(--text-3); font-size: 12px; }
.demo-logins { display: flex; flex-direction: column; gap: 10px; }
.only-mobile { display: none !important; }
.pending-ic { display: grid; place-items: center; }
.pending-ic .ic { width: 34px; height: 34px; padding: 16px; box-sizing: content-box; border-radius: 50%; background: var(--bg-2); color: var(--text-2); }

.month-nav { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 2px; }
.month-nav input { border: 0 !important; box-shadow: none !important; height: 36px; width: 160px; text-align: center; font-weight: 600; background: transparent; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 1080px) {
  .grid-form { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .grid-2, .grid-2.wide-left { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --side: 0px; }
  .side { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; background: var(--mat-thin); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border-bottom: 1px solid var(--line); }
  .avatar-btn { width: 36px; height: 36px; border-radius: 50%; transition: transform 100ms ease-out; border: 0; background: linear-gradient(180deg, #A1A1A6, #8A8A8F); color: #fff; font-weight: 600; font-size: 12.5px; }
  .demo-bar { display: block; text-align: center; font-size: 12px; padding: 6px 16px; background: var(--bg-2); color: var(--text-2); font-weight: 500; }
  .view { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--mat-thin); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border-top: 1px solid var(--line);
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--text-3); }
  .bottom-nav a .ic { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--brand); }
  .fab { justify-self: center; width: 56px; height: 56px; margin-bottom: 8px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px -6px rgba(0, 0, 0, .3); transition: transform .12s; }
  .fab:active { transform: scale(.9); transition-duration: 60ms; }
  .fab .ic { width: 26px; height: 26px; }
  .page-head { margin-bottom: 16px; align-items: flex-start; }
  .page-head h1 { font-size: 28px; }
  .page-actions { width: 100%; }
  .page-actions > .btn, .page-actions > .select-inline { flex: 1; }
  .select-inline select { min-width: 0; }
  .kpis, .kpis.three { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpis.three > :last-child { grid-column: 1 / -1; }
  .kpi { padding: 13px; }
  .kpi-val { font-size: 19px; }
  .kpi-top i { display: none; }
  .grid-3 { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { min-width: 0; }
  .filters select { flex: 1; min-width: 0; }
  .filters .search { flex-basis: 100%; }
  .seg:not(.full) { overflow-x: auto; }

  /* Tablas como tarjetas */
  .table thead { display: none; }
  .table, .table tbody, .table tfoot { display: block; }
  .table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table td { display: block; padding: 0; border: 0; background: none !important; }
  .table td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
  .table td.r { text-align: left !important; }
  .table td:not([data-l]) { grid-column: 1 / -1; }
  .table td:not([data-l]):has(.badge), .table td:not([data-l]):has(.icon-btn) { grid-column: auto; }
  .table .bar { margin: 4px 0 0; }
  .table tfoot tr { display: flex; justify-content: space-between; flex-wrap: wrap; }
  .table tfoot td:empty { display: none; }
  .table.compact tr { grid-template-columns: 40px 1fr auto; padding: 8px 14px; }

  .row-card { padding: 13px 16px; gap: 12px; }
  .row-card .avatar { width: 38px; height: 38px; }
  .rc-actions { width: 100%; justify-content: space-between; padding-left: 50px; }
  .rc-actions .btn { flex: 1; max-width: 160px; }
  .card:not(.flush) .list { margin: 0 -16px -16px; }
  .card { padding: 16px; }
  .detail-head { padding: 16px; }
  .dh-actions { width: 100%; }
  .dh-actions .btn.primary { flex: 1 0 100%; height: 46px; order: -1; }
  .dh-title h1 { font-size: 19px; }
  .row-3 { grid-template-columns: 1fr 1fr; }
  .chart-box { height: 220px; }
  .chart-box.tall { height: 260px; }

  .modal-wrap { place-items: end center; padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; transform: translateY(100%); opacity: 1; transition: transform .5s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
  .modal-head::before { content: ""; position: absolute; left: 50%; top: 7px; width: 38px; height: 4px; margin-left: -19px; border-radius: 9px; background: var(--line-2); }
  .modal-head { position: relative; padding-top: 22px; cursor: grab; touch-action: none; }
  .modal-foot .btn { flex: 1; }
  .modal-foot .grow { display: none; }
  .modal-foot .btn.danger.ghost { flex: 0 0 48px; }
  #toasts { bottom: calc(92px + env(safe-area-inset-bottom)); }
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px; }

  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .only-mobile { display: flex !important; }
  .month-nav { flex: 1; justify-content: space-between; }
  .month-nav input { flex: 1; width: auto; }
}
@media (max-width: 420px) {
  .row-2 { grid-template-columns: 1fr; }
  .row-3 { grid-template-columns: 1fr; }
  .pay-facts b { font-size: 13.5px; }
  .aging-row { grid-template-columns: auto 74px 1fr auto; }
  .aging-row small { display: none; }
}
/* Accesibilidad: menos movimiento = fundidos; menos transparencia = superficies sólidas; más contraste = bordes definidos */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .modal, .modal-wrap.in .modal { transform: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .side, .topbar, .bottom-nav, .toast { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .side { background: var(--bg); } .topbar, .bottom-nav { background: var(--surface); } .toast { background: #1D1D1F; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(0, 0, 0, .4); --line-2: rgba(0, 0, 0, .6); --text-2: #3A3A3C; --text-3: #5A5A5E; }
  .card, .kpi, input, select, textarea, .btn.ghost { border: 1px solid var(--line-2) !important; }
}

/* ---------- Impresión (cronograma) ---------- */
@media print {
  .side, .topbar, .bottom-nav, .demo-bar, .dh-actions, .crumb, .tabs, #toasts { display: none !important; }
  .main { margin: 0; }
  .view { padding: 0; }
  body { background: #fff; }
  .card, .kpi { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
}

/* Filas de cobranza: en tarjetas angostas las acciones bajan a su propia línea */
.list { container-type: inline-size; }
.rc-link { flex: 1 1 200px; }
@container (max-width: 680px) {
  .row-card .rc-actions { flex-basis: 100%; justify-content: space-between; padding-left: 54px; }
  .row-card .rc-actions .btn { flex: 0 1 160px; }
}

/* Aviso de cobros del día (Inicio) */
.today-banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin: -6px 0 18px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-decoration: none; transition: transform .1s ease-out; }
.today-banner:active { transform: scale(.99); }
.today-banner .tb-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.today-banner.quiet .tb-ic { background: var(--ok-soft); color: var(--ok); }
.today-banner .tb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.today-banner .tb-txt b { font-size: 15px; letter-spacing: -.01em; }
.today-banner .tb-names { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-2); }
.today-banner .tb-names i { font-style: normal; color: var(--text-3); }
.today-banner .tb-names .late, .today-banner .tb-names .late i { color: var(--bad); }
.today-banner .tb-go { flex: none; display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; color: var(--brand); }
@media (max-width: 600px) { .today-banner .tb-go { display: none; } }

.today-banner.pending .tb-ic { background: var(--warn-soft); color: var(--warn); }
.today-banner .tb-acts { flex: none; display: flex; gap: 8px; }
@media (max-width: 600px) { .today-banner.pending { flex-wrap: wrap; } .today-banner .tb-acts { width: 100%; justify-content: flex-end; } }
.side-nav a .nav-dot { margin-left: auto; }
.avatar-btn { position: relative; }
.avatar-btn .nav-dot { position: absolute; top: 0; right: 0; box-shadow: 0 0 0 2px var(--bg); }

/* Notificaciones */
.bell-btn { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--text); transition: transform 100ms ease-out; }
.bell-btn:active, .side-notif:active { transform: scale(.94); }
.bell-btn svg { width: 22px; height: 22px; }
.bell-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.bell-btn .bell-count { position: absolute; top: -1px; right: -3px; box-shadow: 0 0 0 2px var(--bg); }
.topbar-acts { display: flex; align-items: center; gap: 8px; }
.side-notif { display: flex; align-items: center; gap: 12px; width: 100%; margin: -8px 0 14px; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--text-2); font: inherit; font-size: 14.5px; font-weight: 500; text-align: left; transition: transform 100ms ease-out, background .15s; }
.side-notif:hover { background: var(--bg-2); color: var(--text); }
.side-notif svg { width: 20px; height: 20px; }
.side-notif .bell-count { margin-left: auto; }
.nt-sec + .nt-sec { margin-top: 18px; }
.nt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.nt-head h4 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.nt-head b { margin-left: auto; font-size: 14px; }
.nt-list { display: flex; flex-direction: column; border-radius: 12px; background: var(--bg-2); overflow: hidden; }
.nt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; color: var(--text); text-decoration: none; }
.nt-row + .nt-row { box-shadow: inset 0 1px 0 var(--line); }
.nt-row:active { background: var(--line); }
.nt-name { display: flex; flex-direction: column; min-width: 0; }
.nt-name b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-name small { color: var(--text-2); font-size: 12.5px; }
.nt-empty { padding: 4px 2px; }
.nt-device { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--text); font-size: 13.5px; }
.nt-device > span { flex: 1; min-width: 180px; }

/* Mostrar / ocultar contraseña */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 46px; }
.pw-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); cursor: pointer; transition: color .15s; }
.pw-eye:hover { color: var(--text); }
.pw-eye:active { transform: translateY(-50%) scale(.92); }
.pw-eye svg { width: 20px; height: 20px; }

.opt-zone { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); }
.opt-zone div { display: flex; flex-direction: column; }
.opt-zone small { color: var(--text-3); font-size: 12px; }
.opt-zone + .danger-zone { margin-top: 10px; }
.void-note { align-items: center; margin: 0 0 16px; }
.void-note span { flex: 1; }

/* Cochera */
.toolbar.pad { padding: 14px 18px 4px; margin: 0; }
.pk-row { cursor: pointer; }
.pk-row:hover { background: var(--surface-2); }
.pk-row > .btn { flex: none; }
.pk-foot { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 13.5px; }
.pk-foot b { color: var(--text); margin-left: 4px; }
.pk-h { font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
.pay-head .big { margin-left: auto; font-size: 20px; }
@media (max-width: 600px) {
  .pk-row > .btn { flex-basis: calc(100% - 54px); margin-left: 54px; justify-content: center; }
}

/* Cochera: planilla tipo Excel */
.pk-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; padding: 2px 18px 12px; font-size: 12.5px; color: var(--text-2); }
.pk-legend .pk-chk { width: 22px; height: 22px; margin-left: 6px; pointer-events: none; }
.pk-chip-done { width: 22px; height: 22px; margin-left: 6px; border-radius: 7px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2); display: inline-block; }
.pk-nav button { min-width: 40px; }
.pk-nav button:disabled { opacity: .35; }
.pk-grid-wrap { overflow-x: auto; border-top: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.pk-grid { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 13px; }
.pk-grid th, .pk-grid td { padding: 6px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.pk-grid thead th { font-weight: 600; padding: 8px 6px; }
.pk-grid thead th small { display: block; color: var(--text-3); font-size: 11px; font-weight: 500; text-transform: capitalize; }
.pk-grid thead th b { font-size: 15px; }
.pk-grid .today { background: var(--brand-soft); }
.pk-grid thead th.today b, .pk-grid thead th.today small { color: var(--brand); }
.pk-name { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left !important; min-width: 150px; max-width: 190px; }
.pk-grid thead .pk-name, .pk-grid tfoot .pk-name { z-index: 3; font-weight: 600; }
.pk-debt { position: sticky; right: 0; z-index: 2; background: var(--surface); min-width: 86px; text-align: right !important; font-weight: 650; border-left: 1px solid var(--line); }
.pk-user { display: flex; flex-direction: column; width: 100%; padding: 2px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pk-user b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.pk-user small { color: var(--text-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.pk-user:hover b { color: var(--brand); }
.pk-cell { min-width: 78px; }
.pk-chk { display: inline-grid; place-items: center; width: 30px; height: 30px; margin: 0 2px; padding: 0; border: 0; border-radius: 9px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-2); color: transparent; font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; transition: transform 100ms ease-out, background .15s, color .15s; }
.pk-chk:active { transform: scale(.9); }
.pk-chk svg { width: 17px; height: 17px; stroke-width: 2.4; }
.pk-chk.w:hover { box-shadow: inset 0 0 0 1.5px var(--brand); }
.pk-chk.w.on { background: var(--brand); box-shadow: none; color: #fff; }
.pk-chk.p { color: var(--text-3); }
.pk-chk.p:not(:disabled) { box-shadow: inset 0 0 0 1.5px var(--ok); color: var(--ok); }
.pk-chk.p:not(:disabled):hover, .pk-chk.p.on { background: var(--ok); color: #fff; }
.pk-chk.p:disabled { opacity: .3; cursor: default; }
.pk-cell.done { background: var(--bg-2); }
.pk-cell.done.today { background: var(--bg-2); }
.pk-cell.done button { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 100%; border: 0; background: none; color: var(--text-3); font: inherit; cursor: pointer; }
.pk-cell.done svg { width: 17px; height: 17px; stroke-width: 2.4; }
.pk-cell.done small { font-size: 11px; }
.pk-grid tfoot td, .pk-grid tfoot th { background: var(--surface); border-bottom: 0; }
.pk-grid tfoot td b { display: block; font-size: 13px; }
.pk-grid tfoot td small { color: var(--text-3); font-size: 11px; }
.nt-list button.nt-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.nt-row .num svg { width: 14px; height: 14px; margin-left: 4px; vertical-align: -2px; color: var(--text-3); }
@media (max-width: 600px) {
  .pk-name { min-width: 104px; max-width: 112px; }
  .pk-debt { position: static; min-width: 70px; border-left: 0; }
  .pk-cell { min-width: 68px; padding: 5px 3px !important; }
  .pk-chk { width: 28px; height: 28px; margin: 0 1px; }
}

.pk-range { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.pk-grid th.future, .pk-cell.future { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--bg-2) 6px 7px); }
.pk-grid th.future b, .pk-grid th.future small { color: var(--text-3); }
.pk-day-total { display: flex; align-items: baseline; justify-content: space-between; margin: 14px 0 8px; color: var(--text-2); }
.pk-day-total b { font-size: 24px; color: var(--text); letter-spacing: -.02em; }
.pk-methods { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pk-methods span { padding: 5px 10px; border-radius: 999px; background: var(--bg-2); font-size: 12.5px; color: var(--text-2); }
.pk-methods b { color: var(--text); margin-left: 4px; }

/* Administrador de solo lectura: se ocultan las acciones (la base de datos también las bloquea) */
body.ro #qp-side, body.ro a[href="#/prestamos/nuevo"], body.ro #new-c, body.ro #edit, body.ro #del, body.ro #more, body.ro #settle, body.ro #pay,
body.ro [data-full], body.ro [data-pay], body.ro [data-ok], body.ro [data-deny], body.ro [data-void], body.ro [data-approve], body.ro [data-quick],
body.ro #pk-nu, body.ro #ud-edit, body.ro #ud-pay, body.ro #ud-in, body.ro #np, body.ro #reactivate,
body.ro #lo-save, body.ro #pay-save, body.ro #st-save, body.ro #cf-save, body.ro #pu-save, body.ro #pu-del, body.ro #pv-save, body.ro #pv-del, body.ro #pv-newu, body.ro #pf-save, body.ro #pf-del { display: none !important; }
body.ro .fab { visibility: hidden; }
body.ro .pk-chk { pointer-events: none; }
body.ro .pk-chk.p:not(.on) { opacity: .3; }
.ro-bar { display: flex; align-items: center; justify-content: center; gap: 6px; }
.ro-bar svg { width: 14px; height: 14px; }
.demo-bar.ro-bar { display: flex; font-size: 12.5px; padding: 7px 16px; background: var(--bg-2); color: var(--text-2); font-weight: 500; }
body.ro [data-role], body.ro [data-active], body.ro .switch { pointer-events: none; opacity: .55; }
