@charset "UTF-8";

:root {
  color-scheme: light;
  --paper: #fbfaf6;
  --canvas: #f1f0e9;
  --ink: #24313a;
  --muted: #69736f;
  --accounting-green: #58745e;
  --accounting-green-dark: #3f5c48;
  --sheet-head: #e9e9e4;
  --grid: #c9cbc5;
  --grid-strong: #aeb2aa;
  --total-bg: #edf1e9;
  --overdue: #9a493d;
  --warning-bg: #f5edda;
  --white: #ffffff;
  --nav-bg: #26353a;
  --nav-text: #e1e7e0;
  --nav-muted: #aebbb2;
  --nav-brand: #f7f7f1;
  --nav-subtle: #b7c3ba;
  --nav-ink: #e0eadc;
  --nav-selected: #3d5748;
  --nav-selected-rail: #c1d0bc;
  --nav-icon: #b7c8b8;
  --profile-ring: #9aaf9f;
  --nav-role: #bdc8bf;
  --sheet-title-muted: #343e3d;
  --sheet-title-strong: #222c2b;
  --subtle-success-border: #c4d0c1;
  --action-hover-bg: #f5f7f1;
  --neutral-panel-bg: #f6f5ef;
  --row-saldo-bg: #f2f4ed;
  --scroll-thumb: #b9beb4;
  --scroll-track: #eeede7;
  --print-grid: #999;
  --print-head: #e6e6e6;
  --print-total: #eee;
  --print-border: #777;
  --demo-bg: #f5f6f1;
  --black: #000;
  --transparent: transparent;
  --header-ink: #3f4846;
  --heading-ink: #222c2b;
  --alternate-row: #f8f7f2;
  --hover-row: #f0f2eb;
  --input-paper: #fffef8;
  --soft-button: #f5f4ee;
  --soft-neutral: #f2f1eb;
  --positive-border: #b6c5b5;
  --positive-bg: #edf1e9;
  --negative-border: #d7b7b0;
  --negative-bg: #f7eeeb;
  --warning-border: #d7c89f;
  --warning-ink: #684c1d;
  --badge-warning-border: #dacba8;
  --badge-warning-ink: #805b1e;
  --accent-gold: #b89a57;
  --dark-green: #3e5947;
  --dark-green-border: #415a49;
  --focus-ring: rgba(88, 116, 94, .3);
  --focus-shadow: rgba(88, 116, 94, .15);
  --nav-transparent-border: rgba(255,255,255,.15);
  --nav-transparent-border-strong: rgba(255,255,255,.45);
  --nav-transparent-hover: rgba(255,255,255,.08);
  --scrim: rgba(18, 27, 31, .42);
  --topbar-paper: rgba(251,250,246,.97);
  --font-body: Arial, Helvetica, sans-serif;
  --font-mono: "Courier New", monospace;
  --radius-sm: 4px;
  --tap-target: 48px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --shadow-nav: 2px 0 12px rgba(36, 49, 58, .08);
  --bs-primary: #58745e;
  --bs-primary-rgb: 88, 116, 94;
  --bs-success: #58745e;
  --bs-success-rgb: 88, 116, 94;
  --bs-danger: #9a493d;
  --bs-danger-rgb: 154, 73, 61;
  --bs-warning: #a87524;
  --bs-warning-rgb: 168, 117, 36;
  --bs-body-font-family: var(--font-body);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--canvas);
  --bs-heading-color: var(--ink);
  --bs-link-color: var(--accounting-green-dark);
  --bs-link-hover-color: var(--accounting-green);
  --bs-border-color: var(--grid);
  --bs-border-radius: var(--radius-sm);
  --bs-focus-ring-color: rgba(88, 116, 94, .28);
  --bs-btn-border-radius: var(--radius-sm);
  --bs-form-select-focus-border-color: var(--accounting-green);
  --bs-form-control-focus-border-color: var(--accounting-green);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body.app-body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.45 var(--font-body);
  overflow-x: hidden;
}
a { color: var(--accounting-green-dark); }
button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; display: flex; }
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: 252px;
  overflow: auto;
  padding: 18px 12px 24px;
  color: var(--nav-brand);
  background: var(--nav-bg);
  box-shadow: var(--shadow-nav);
}
.brand-lockup { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; border-bottom: 1px solid var(--nav-transparent-border); color: var(--white); text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; flex: none; border: 1px solid var(--nav-transparent-border-strong); border-radius: 50%; color: var(--nav-ink); font-size: 19px; }
.brand-name { display: block; font-size: 11px; font-weight: 700; line-height: 1.25; letter-spacing: .045em; }
.brand-subtitle { display: block; margin-top: 3px; color: var(--nav-subtle); font-size: 10px; letter-spacing: .04em; }
.nav-group { margin-top: 17px; }
.nav-group-label { margin: 0 8px 5px; color: var(--nav-muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.app-nav { display: grid; gap: 2px; }
.app-nav-link { display: flex; min-height: 38px; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 3px; color: var(--nav-text); font-size: 13px; text-decoration: none; }
.app-nav-link .bi { width: 17px; color: var(--nav-icon); font-size: 15px; text-align: center; }
.app-nav-link:hover { color: var(--white); background: var(--nav-transparent-hover); }
.app-nav-link.active { color: var(--white); background: var(--nav-selected); box-shadow: inset 3px 0 var(--nav-selected-rail); }
.sidebar-profile { display: flex; gap: 10px; align-items: center; margin: 18px 4px 0; padding: 13px 7px 0; border-top: 1px solid var(--nav-transparent-border); }
.profile-initial { display: grid; width: 30px; height: 30px; flex: none; place-items: center; border: 1px solid var(--profile-ring); border-radius: 50%; color: var(--white); font-weight: 700; }
.profile-name { color: var(--white); font-size: 12px; font-weight: 700; }
.profile-role { color: var(--nav-role); font-size: 10px; }
.sidebar-scrim { position: fixed; inset: 0; z-index: 1030; display: none; background: var(--scrim); }
.main-frame { width: calc(100% - 252px); min-width: 0; margin-left: 252px; }
.app-topbar { position: sticky; top: 0; z-index: 1020; display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 24px; border-bottom: 1px solid var(--grid); background: var(--topbar-paper); }
.topbar-start { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-context { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-context strong { color: var(--ink); font-weight: 700; }
.topbar-user { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sidebar-toggle { display: none; width: var(--tap-target); height: var(--tap-target); border: 1px solid var(--grid); border-radius: var(--radius-sm); color: var(--ink); background: var(--paper); }
.page-content { width: min(100%, 1680px); margin: 0 auto; padding: 24px; }

.page-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.page-heading-copy { min-width: 0; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.page-title { margin: 0; color: var(--ink); font-size: clamp(22px, 2vw, 28px); font-weight: 700; line-height: 1.2; }
.page-description { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.sheet-heading { margin: 14px 0 12px; padding: 10px 12px 9px; border: 1px solid var(--grid-strong); background: var(--paper); text-align: center; }
.sheet-program { color: var(--sheet-title-muted); font-size: 12px; font-weight: 700; letter-spacing: .035em; }
.sheet-name { margin-top: 3px; color: var(--sheet-title-strong); font-size: 14px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.sheet-code { margin-top: 2px; color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.sheet-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 16px; margin-top: 7px; color: var(--muted); font-size: 11px; text-align: left; }

.panel { border: 1px solid var(--grid); border-radius: var(--radius-sm); background: var(--paper); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; padding: 11px 13px; border-bottom: 1px solid var(--grid); }
.panel-title { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.panel-body { padding: 13px; }
.panel-body-flush { padding: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { min-width: 0; padding: 12px 14px; border: 1px solid var(--grid); background: var(--paper); }
.kpi-label { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.kpi-value { display: block; margin-top: 6px; color: var(--ink); font-family: var(--font-mono); font-size: clamp(16px, 2vw, 21px); font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-note { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.sheet-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; margin: 12px 0; }
.filter-field { min-width: 140px; flex: 1 1 150px; }
.filter-field label, .form-label { margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.form-control, .form-select { min-height: 38px; border-color: var(--grid); border-radius: var(--radius-sm); background-color: var(--white); font-size: 13px; }
.form-control:focus, .form-select:focus { border-color: var(--accounting-green); box-shadow: 0 0 0 .2rem var(--focus-shadow); }
.btn { min-height: 38px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; }
.btn-primary, .btn-success { --bs-btn-color: var(--white); --bs-btn-bg: var(--accounting-green); --bs-btn-border-color: var(--accounting-green); --bs-btn-hover-color: var(--white); --bs-btn-hover-bg: var(--accounting-green-dark); --bs-btn-hover-border-color: var(--accounting-green-dark); --bs-btn-active-bg: var(--accounting-green-dark); --bs-btn-active-border-color: var(--accounting-green-dark); }
.btn-outline-primary, .btn-outline-success { --bs-btn-color: var(--accounting-green-dark); --bs-btn-border-color: var(--accounting-green); --bs-btn-hover-bg: var(--accounting-green); --bs-btn-hover-border-color: var(--accounting-green); }
.btn-light { --bs-btn-bg: var(--soft-button); --bs-btn-border-color: var(--grid); }
.btn-danger { --bs-btn-bg: var(--overdue); --bs-btn-border-color: var(--overdue); }
.btn-touch { min-height: var(--tap-target); padding: 11px 15px; font-size: 14px; }
.badge-soft { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border: 1px solid var(--grid); border-radius: 3px; color: var(--ink); background: var(--soft-neutral); font-size: 10px; font-weight: 700; }
.badge-soft-green { border-color: var(--positive-border); color: var(--accounting-green-dark); background: var(--positive-bg); }
.badge-soft-red { border-color: var(--negative-border); color: var(--overdue); background: var(--negative-bg); }
.badge-soft-amber { border-color: var(--badge-warning-border); color: var(--badge-warning-ink); background: var(--warning-bg); }
.notice { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--warning-border); color: var(--warning-ink); background: var(--warning-bg); font-size: 12px; }
.demo-note { padding: 8px 10px; border-left: 3px solid var(--accounting-green); color: var(--muted); background: var(--demo-bg); font-size: 11px; }

.table-scroll { max-width: 100%; max-height: 68vh; overflow: auto; border: 1px solid var(--grid); background: var(--paper); scrollbar-color: var(--scroll-thumb) var(--scroll-track); scrollbar-width: thin; }
.sheet-table { width: 100%; min-width: 650px; margin: 0; border-collapse: separate; border-spacing: 0; color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.sheet-table > :not(caption) > * > * { padding: 6px 8px; border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); box-shadow: none; vertical-align: middle; }
.sheet-table > :not(caption) > * > *:last-child { border-right: 0; }
.sheet-table thead th { position: sticky; top: 0; z-index: 3; min-height: 32px; color: var(--header-ink); background: var(--sheet-head); font-size: 10px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; white-space: nowrap; }
.sheet-table tbody tr:nth-child(even) > * { background-color: var(--alternate-row); }
.sheet-table tbody tr:hover > * { background-color: var(--hover-row); }
.sheet-table .numeric { min-width: 112px; text-align: right; white-space: nowrap; }
.sheet-table .text-nowrap { white-space: nowrap; }
.sheet-table .sticky-col { position: sticky; left: 0; z-index: 2; min-width: 100px; background: var(--paper); box-shadow: 1px 0 0 var(--grid); }
.sheet-table thead .sticky-col { z-index: 4; background: var(--sheet-head); }
.sheet-table tbody tr:nth-child(even) .sticky-col { background: var(--alternate-row); }
.sheet-table tbody tr:hover .sticky-col { background: var(--hover-row); }
.sheet-table .row-total > * { border-top: 2px solid var(--grid-strong); background: var(--total-bg) !important; font-weight: 700; }
.sheet-table .row-saldo > * { background: var(--row-saldo-bg) !important; font-weight: 700; }
.sheet-table .input-cell { min-width: 115px; padding: 3px; }
.sheet-table .input-cell input, .sheet-table .input-cell select { width: 100%; min-width: 90px; height: 31px; padding: 4px 6px; border: 1px solid var(--grid); background: var(--input-paper); font-size: 11px; }
.sheet-table .new-row-label { color: var(--accounting-green-dark); font-weight: 700; white-space: nowrap; }
.sheet-table .positive { color: var(--accounting-green-dark); }
.sheet-table .negative { color: var(--overdue); }
.sheet-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin: 7px 0; }
.sheet-actions .btn { min-height: 31px; padding: 4px 8px; font-size: 10px; }
.table-footnote { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 10px; }

.balance-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 14px; align-items: start; }
.balance-card { position: sticky; top: 75px; }
.balance-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.balance-table th, .balance-table td { padding: 7px 8px; border: 1px solid var(--grid); }
.balance-table th { background: var(--sheet-head); font-size: 10px; text-align: left; text-transform: uppercase; }
.balance-table td:last-child, .balance-table th:last-child { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.balance-table tfoot td { border-top: 2px solid var(--grid-strong); background: var(--total-bg); font-weight: 700; }
.currency { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.split-details { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.catalog-sheet { width: 100%; border-collapse: collapse; font-size: 12px; }
.catalog-sheet th, .catalog-sheet td { padding: 7px 9px; border: 1px solid var(--grid); }
.catalog-sheet th { background: var(--sheet-head); font-size: 10px; text-align: left; text-transform: uppercase; }
.catalog-sheet td:last-child, .catalog-sheet th:last-child { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.catalog-sheet tfoot td { background: var(--total-bg); font-weight: 700; }
.catalog-sheet { min-width: 430px; }
.catalog-sheet thead th { position: sticky; top: 0; z-index: 3; }
.catalog-sheet th:first-child, .catalog-sheet td:first-child { position: sticky; left: 0; z-index: 2; background: var(--paper); box-shadow: 1px 0 0 var(--grid); }
.catalog-sheet thead th:first-child { z-index: 4; background: var(--sheet-head); }
.catalog-sheet tbody tr:nth-child(even) td:first-child { background: var(--alternate-row); }
.catalog-sheet tfoot td:first-child { background: var(--total-bg); }
.balance-table { min-width: 260px; }
.balance-table thead th { position: sticky; top: 0; z-index: 3; }
.balance-table th:first-child, .balance-table td:first-child { position: sticky; left: 0; z-index: 2; background: var(--paper); box-shadow: 1px 0 0 var(--grid); }
.balance-table thead th:first-child { z-index: 4; background: var(--sheet-head); }
.balance-table tfoot td:first-child { background: var(--total-bg); }
.panel-body-flush { max-width: 100%; overflow: auto; }

.quick-action-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.quick-action { display: flex; min-height: 78px; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--grid); border-radius: var(--radius-sm); color: var(--ink); background: var(--paper); text-align: left; text-decoration: none; }
.quick-action:hover { border-color: var(--accounting-green); background: var(--action-hover-bg); }
.quick-action-icon { display: grid; width: 38px; height: 38px; flex: none; place-items: center; border: 1px solid var(--subtle-success-border); border-radius: 50%; color: var(--accounting-green-dark); background: var(--positive-bg); font-size: 17px; }
.quick-action-label { font-size: 12px; font-weight: 700; }
.quick-action-note { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; }
.collector-hero { padding: 17px; border: 1px solid var(--dark-green-border); color: var(--white); background: var(--dark-green); }
.collector-hero-label { display: block; color: var(--nav-ink); font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.collector-hero-amount { display: block; margin-top: 5px; font-family: var(--font-mono); font-size: clamp(26px,7vw,34px); font-weight: 700; font-variant-numeric: tabular-nums; }
.collector-hero-meta { margin-top: 7px; color: var(--nav-subtle); font-size: 11px; }
.collection-list { display: grid; gap: 9px; }
.collection-card { padding: 13px; border: 1px solid var(--grid); border-left: 4px solid var(--accent-gold); border-radius: var(--radius-sm); background: var(--paper); }
.collection-card.is-paid { border-left-color: var(--accounting-green); opacity: .72; }
.collection-top { display: flex; justify-content: space-between; gap: 9px; align-items: flex-start; }
.collection-name { font-size: 14px; font-weight: 700; }
.collection-meta { margin-top: 3px; color: var(--muted); font-size: 11px; }
.collection-amount { margin: 9px 0; font-family: var(--font-mono); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.collection-card .btn { width: 100%; }

.period-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border: 1px solid var(--grid); background: var(--neutral-panel-bg); }
.period-switch button { min-height: 33px; padding: 5px 10px; border: 0; color: var(--muted); background: var(--transparent); font-size: 11px; font-weight: 700; }
.period-switch button[aria-pressed="true"] { color: var(--white); background: var(--accounting-green); }
.calendar-week { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); border-top: 1px solid var(--grid); border-left: 1px solid var(--grid); }
.calendar-day { min-height: 112px; padding: 8px; border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); background: var(--paper); }
.calendar-day-name { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.calendar-date { margin: 4px 0 7px; font-size: 17px; font-weight: 700; }
.calendar-client { display: block; margin: 4px 0; padding: 3px 5px; border-left: 2px solid var(--accounting-green); background: var(--positive-bg); font-size: 10px; }
.calendar-month { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); border-top: 1px solid var(--grid); border-left: 1px solid var(--grid); }
.calendar-cell { min-height: 57px; padding: 5px; border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); background: var(--paper); font-size: 10px; }
.calendar-cell.is-payment { background: var(--positive-bg); }
.calendar-cell strong { display: block; margin-bottom: 4px; font-size: 11px; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--grid); font-size: 12px; }
.summary-line:last-child { border-bottom: 0; }
.summary-line strong { font-family: var(--font-mono); white-space: nowrap; }
.summary-total { margin-top: 5px; padding: 11px 0; border-top: 2px solid var(--grid-strong); font-size: 14px; font-weight: 700; }
.summary-total strong { color: var(--accounting-green-dark); font-size: 16px; }
.logo-placeholder { display: grid; width: 78px; height: 78px; place-items: center; border: 1px solid var(--grid-strong); border-radius: 50%; color: var(--accounting-green-dark); background: var(--total-bg); font-size: 30px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 15px; background: var(--canvas); }
.login-paper { width: min(100%, 430px); padding: 26px; border: 1px solid var(--grid-strong); background: var(--paper); }
.login-brand { margin-bottom: 22px; text-align: center; }
.login-brand .brand-mark { width: 54px; height: 54px; margin: 0 auto 10px; border-color: var(--subtle-success-border); color: var(--accounting-green-dark); font-size: 24px; }
.login-brand .brand-name { color: var(--ink); font-size: 13px; }
.login-brand .brand-subtitle { color: var(--muted); }
.login-title { margin: 0 0 6px; font-size: 21px; font-weight: 700; text-align: center; }
.login-copy { margin: 0 0 18px; color: var(--muted); font-size: 12px; text-align: center; }

.modal-content { border: 1px solid var(--grid-strong); border-radius: var(--radius-sm); background: var(--paper); }
.modal-header, .modal-footer { border-color: var(--grid); }
.modal-title { font-size: 15px; font-weight: 700; }
.toast-container { z-index: 1090; }
.app-bottom-nav { display: none; }
.d-none-demo { display: none !important; }

@media (max-width: 1199.98px) {
  .app-sidebar { width: 220px; }
  .main-frame { width: calc(100% - 220px); margin-left: 220px; }
  .page-content { padding: 20px; }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 767.98px) {
  .app-sidebar { width: min(290px, 86vw); transform: translateX(-105%); transition: transform .18s ease; }
  .menu-open .app-sidebar { transform: translateX(0); }
  .menu-open .sidebar-scrim { display: block; }
  .main-frame { width: 100%; margin-left: 0; }
  .app-topbar { min-height: 55px; padding: 5px 12px; }
  .sidebar-toggle { display: inline-grid; flex: none; place-items: center; }
  .topbar-user { font-size: 10px; }
  .page-content { padding: 14px 12px calc(86px + env(safe-area-inset-bottom)); }
  .page-heading { align-items: flex-start; margin-bottom: 12px; }
  .page-heading > .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .sheet-heading { margin: 9px 0 10px; padding: 9px 6px; }
  .sheet-program { font-size: 10px; }
  .sheet-name { font-size: 12px; }
  .sheet-meta { font-size: 10px; }
  .kpi-grid { gap: 7px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .kpi { padding: 10px; }
  .kpi-label { font-size: 9px; }
  .kpi-value { font-size: 15px; }
  .kpi-note { font-size: 9px; }
  .balance-layout { grid-template-columns: minmax(0,1fr); }
  .balance-card { position: static; }
  .split-details { grid-template-columns: minmax(0,1fr); }
  .quick-action-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .quick-action { min-height: 72px; gap: 8px; padding: 9px; }
  .quick-action-icon { width: 33px; height: 33px; font-size: 15px; }
  .quick-action-label { font-size: 11px; }
  .sheet-table { min-width: 680px; font-size: 11px; }
  .sheet-table > :not(caption) > * > * { padding: 6px; }
  .sheet-table .sticky-col { min-width: 92px; }
  .sheet-actions { justify-content: flex-start; }
  .calendar-week { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .calendar-day { min-height: 92px; }
  .calendar-month { min-width: 490px; }
  .app-bottom-nav { position: fixed; inset: auto 0 0; z-index: 1025; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 5px 4px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid var(--grid); background: var(--paper); }
  .bottom-nav-link { display: grid; min-height: 47px; place-content: center; justify-items: center; gap: 1px; color: var(--muted); font-size: 9px; text-decoration: none; }
  .bottom-nav-link .bi { font-size: 17px; }
  .bottom-nav-link.active { color: var(--accounting-green-dark); font-weight: 700; }
  .login-paper { padding: 22px 18px; }
}
@media (max-width: 380px) {
  .page-content { padding-right: 9px; padding-left: 9px; }
  .topbar-context { font-size: 10px; }
  .collection-top { gap: 5px; }
  .collection-amount { font-size: 18px; }
  .quick-action { align-items: flex-start; }
  .quick-action-icon { width: 29px; height: 29px; }
}
@media print {
  :root { --canvas: var(--white); --paper: var(--white); --grid: var(--print-grid); --sheet-head: var(--print-head); --total-bg: var(--print-total); }
  body.app-body { background: var(--white); font-size: 10pt; }
  .app-sidebar, .app-topbar, .app-bottom-nav, .sheet-actions, .sheet-toolbar, .page-actions, .sidebar-scrim, .btn, .demo-note { display: none !important; }
  .main-frame { width: 100%; margin: 0; }
  .page-content { width: 100%; padding: 0; }
  .panel, .sheet-heading { break-inside: avoid; box-shadow: none; }
  .table-scroll, .panel-body-flush { overflow: visible; border-color: var(--print-border); }
  .sheet-table, .catalog-sheet, .balance-table { min-width: 0; font-size: 8pt; }
  .sheet-table thead th { position: static; }
  .sheet-table .sticky-col, .catalog-sheet th:first-child, .catalog-sheet td:first-child { position: static; }
  .balance-card { position: static; }
  a { color: var(--black); text-decoration: none; }
}

.flash { margin-bottom: var(--space-4); }
.cliente-buscador { position: relative; }
.cliente-resultados {
  position: absolute; z-index: 1060; left: 0; right: 0; top: 100%;
  max-height: 280px; overflow-y: auto; margin: 2px 0 0; padding: 0; list-style: none;
  background: var(--paper); border: 1px solid var(--grid-strong); box-shadow: 0 6px 18px rgba(36,49,58,.12);
}
.cliente-resultados li { padding: 10px 12px; border-bottom: 1px solid var(--grid); cursor: pointer; min-height: var(--tap-target); }
.cliente-resultados li:last-child { border-bottom: 0; }
.cliente-resultados li[aria-selected="true"], .cliente-resultados li:hover { background: var(--hover-row); }
.cliente-resultados .meta { display: block; color: var(--muted); font-size: 12px; }
.cliente-elegido { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 1px solid var(--positive-border); background: var(--positive-bg); }
.cedula-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 575.98px) { .cedula-grid { grid-template-columns: 1fr; } }
.cedula-slot { border: 1px dashed var(--grid-strong); background: var(--paper); padding: var(--space-3); text-align: center; }
.cedula-slot img { display: block; width: 100%; max-height: 220px; object-fit: contain; margin: 0 auto var(--space-2); background: var(--soft-neutral); }
.cedula-slot .placeholder-icon { font-size: 42px; color: var(--muted); display: block; margin: var(--space-3) 0; }
.cedula-slot .btn { width: 100%; }
.btn-link-danger { color: var(--overdue); }
.sheet-table form { display: inline; }
.table-empty { padding: var(--space-5); text-align: center; color: var(--muted); }
.monto-grande { font-size: 1.35rem; font-weight: 700; }
.sheet-table .col-texto { min-width: 220px; }
.sheet-table .col-nombre { min-width: 170px; }
@media (max-width: 1499.98px) { .balance-layout.tabla-primero { grid-template-columns: minmax(0, 1fr); } }
.logo-oval { display: block; flex: none; object-fit: cover; border-radius: 50%; }
.logo-propio { display: block; flex: none; object-fit: contain; }
.brand-lockup { flex-direction: column; justify-content: center; text-align: center; gap: 8px; }
.logo-menu { width: 84px; height: 64px; }
.logo-login { width: 110px; height: 85px; margin: 0 auto 10px; }
.sheet-heading { position: relative; }
.logo-hoja { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 52px; height: 40px; }
@media (max-width: 1199.98px) { .logo-hoja { display: none; } }
.paginacion { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--grid); }
.paginacion .btn { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 575.98px) {
  .tabla-tarjetas thead { display: none; }
  .tabla-tarjetas, .tabla-tarjetas tbody, .tabla-tarjetas tr { display: block; width: 100%; }
  .tabla-tarjetas.sheet-table { min-width: 0; }
  .tabla-tarjetas tr { margin: 0 0 8px; border: 1px solid var(--grid-strong); background: var(--paper); }
  .tabla-tarjetas tbody tr:nth-child(even) > * { background: transparent; }
  .table-scroll:has(> .tabla-tarjetas) { max-height: none; overflow: visible; border: 0; }
  .tabla-tarjetas.sheet-table > :not(caption) > * > * { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; min-width: 0; padding: 6px 10px; border: 0; border-bottom: 1px solid var(--grid); text-align: right; position: static; white-space: normal; }
  .tabla-tarjetas.sheet-table > :not(caption) > * > *:last-child { border-bottom: 0; }
  .tabla-tarjetas td::before, .tabla-tarjetas th::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; }
  .tabla-tarjetas td:not([data-label])::before, .tabla-tarjetas th:not([data-label])::before { content: none; }
  .tabla-tarjetas .ocultar-tarjeta, .tabla-tarjetas .table-empty::before { display: none !important; }
  .tabla-tarjetas td[colspan] { justify-content: center; }
  .tabla-tarjetas form { display: inline-flex; }
  .paginacion-texto { order: -1; flex-basis: 100%; text-align: center; }
}
