/* Cooperaciones · v2. Sistema visual compartido para móvil, tablet y escritorio. */
:root {
  --bg: #f4f5f2;
  --surface: #fff;
  --ink: #202c2b;
  --muted: #6d7976;
  --line: #e2e7e2;
  --primary: #176b5b;
  --primary-dark: #105346;
  --soft: #edf5f0;
  --nav: #183c34;
  --amber: #956420;
  --amber-soft: #fbf3e5;
  --red: #b4453e;
  --red-soft: #fcf0ee;
  --radius: 18px;
  --shadow: 0 4px 20px #23372d05;
  --sidebar: 242px;
  font-family:
    "Segoe UI",
    -apple-system,
    BlinkMacSystemFont,
    Arial,
    sans-serif;
  font-size: 15px;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 95px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--primary);
  text-decoration: none;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #54a893;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.03em;
}
h2 {
  font-size: 21px;
  font-weight: 650;
  margin-bottom: 16px;
}
h3 {
  font-size: 17px;
  font-weight: 650;
}
p {
  color: var(--muted);
  margin-bottom: 18px;
}
strong,
b {
  font-weight: 650;
}
svg.icono {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  vertical-align: middle;
}
img,
svg {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  background: white;
  border: 2px solid var(--primary);
  padding: 12px;
  border-radius: 8px;
}
.skip-link:focus {
  top: 12px;
}
.eyebrow {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.15em;
  color: var(--primary);
  text-transform: uppercase;
}
.helper-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.empty-state {
  padding: 26px 10px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
/* Navigation and shared page structure */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 34px 18px 20px;
  background: var(--nav);
  color: #fff;
  z-index: 40;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 650;
  font-size: 17px;
  line-height: 1.2;
  padding: 0 12px;
}
.brand small,
.auth-mobile-brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 0.18em;
  margin-top: 7px;
  font-weight: 500;
  color: #9dbbae;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 40px;
  border-radius: 12px;
  background: #e0edcc;
  color: #183c34;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.11em;
  padding-right: 3px;
}
.brand-mark span {
  font-size: 26px;
}
.nav-caption {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #94b0a5;
  margin: 46px 14px 13px;
  font-weight: 650;
}
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 11px 14px;
  color: #c7dad1;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  transition:
    background 0.15s,
    color 0.15s;
}
.nav-link:hover {
  background: #ffffff0b;
  color: white;
}
.nav-link.active {
  background: #e0edcc;
  color: var(--nav);
  font-weight: 700;
}
.nav-link .icono {
  width: 18px;
  height: 18px;
}
.secondary-caption {
  margin-top: 27px;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 32px;
}
.family-note {
  padding: 18px 14px 24px;
  font-size: 12px;
  color: #e0edcc;
  border-bottom: 1px solid #ffffff15;
  margin-bottom: 12px;
}
.family-note span {
  display: block;
  font-size: 10px;
  color: #94b0a5;
  margin-top: 5px;
}
.logout-link {
  font-size: 12px;
}
.app-main {
  margin-left: var(--sidebar);
  min-width: 0;
}
.topbar {
  height: 76px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #f4f5f2;
  gap: 12px;
}
.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.breadcrumb {
  color: var(--muted);
  font-size: 12px;
}
.breadcrumb span {
  margin: 0 12px;
  color: #adb8b0;
}
.currency-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  border: 1px solid #d8dfd8;
  border-radius: 6px;
  padding: 4px 7px;
  color: var(--muted);
}
.profile-name {
  font-size: 12px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: #e3e9df;
  color: #365649;
}
.workspace {
  max-width: 1590px;
  margin: 0 auto;
  padding: 38px 40px 22px;
  min-width: 0;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-heading h1 {
  font-size: 32px;
  margin: 0 0 10px;
  font-weight: 650;
  letter-spacing: -0.045em;
}
.page-heading .eyebrow {
  font-size: 9px;
  margin-bottom: 11px;
}
.page-subtitle {
  font-size: 13px;
  max-width: 690px;
  margin: 0;
  line-height: 1.65;
}
.page-heading > .boton {
  white-space: nowrap;
  flex-shrink: 0;
}
.page-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}
.page-content > * {
  min-width: 0;
}
.page-footer {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #8c9690;
  font-size: 10px;
}
.bottom-nav,
.open-nav,
.close-nav,
.nav-backdrop {
  display: none;
}
.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  padding: 0;
}
/* Buttons, links, inputs and forms */
.boton,
button:where(
  :not(.icon-button, .password-toggle, .bottom-nav button, .nav-backdrop)
) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 11px 17px;
  background: var(--primary);
  color: white;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}
.boton:hover,
button:where(
    :not(.icon-button, .password-toggle, .bottom-nav button, .nav-backdrop)
  ):hover {
  background: var(--primary-dark);
  color: #fff;
}
.boton .icono {
  width: 17px;
  height: 17px;
}
.boton-secundario {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}
.boton-secundario:hover {
  color: var(--primary);
  background: var(--soft);
  border-color: #b8cfc1;
}
.boton-peligro {
  color: var(--red);
  background: var(--red-soft);
  border-color: #f1d6d2;
}
.boton-peligro:hover {
  background: var(--red);
  color: white;
}
.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}
.menu .boton,
.menu button {
  margin: 0;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 650;
}
.text-link .icono {
  width: 16px;
  height: 16px;
}
.text-link:hover {
  text-decoration: underline;
}
.tarjeta {
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.tarjeta > p {
  font-size: 13px;
}
.tarjeta > .table-scroll:last-child {
  margin-bottom: 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 20px;
}
.section-heading h2 {
  margin: 0;
  font-size: 19px;
}
.section-heading .eyebrow {
  font-size: 9px;
  margin-bottom: 7px;
}
.section-heading > .helper-text {
  max-width: 200px;
  text-align: right;
}
.section-heading .text-link {
  white-space: nowrap;
}
.form-panel {
  max-width: 1060px;
  width: 100%;
}
.data-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 24px;
  margin: 22px 0 8px;
}
.data-form > .menu,
.data-form > button,
.data-form > .dato,
.data-form > .error {
  grid-column: 1/-1;
}
.data-form > button {
  justify-self: start;
}
.data-form .menu {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.data-form > .field:has(textarea) {
  grid-column: 1/-1;
}
.field {
  min-width: 0;
}
.field p {
  font-size: 11px;
  line-height: 1.5;
  margin: 8px 0 0;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #384b43;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #d9e1d9;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input:hover,
select:hover,
textarea:hover {
  border-color: #a3b9a9;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px #176b5b12;
}
input::placeholder,
textarea::placeholder {
  color: #99a39c;
  opacity: 1;
}
input[readonly] {
  background: #f4f6f2;
  color: #627367;
  font-size: 12px;
}
input[type="checkbox"],
input[type="radio"] {
  display: inline-block;
  min-height: 0;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  accent-color: var(--primary);
  margin-right: 8px;
}
textarea {
  resize: vertical;
  min-height: 100px;
}
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
}
.filter-form > .field {
  flex: 1;
  min-width: 180px;
}
.filter-form > .menu {
  margin: 0;
}
.filter-form > .menu .boton,
.filter-form > .menu button {
  min-height: 46px;
}
.dato,
.error {
  padding: 14px 16px;
  margin: 12px 0;
  border-radius: 9px;
  font-size: 13px;
  border: 1px solid var(--line);
  background: #f6f8f4;
  color: #475a4f;
  overflow-wrap: anywhere;
}
.error {
  background: var(--red-soft);
  border-color: #efd5cf;
  color: #9c3832;
}
.error br {
  line-height: 1.8;
}
.dato strong {
  color: var(--ink);
}
.estado-corriente {
  color: var(--primary);
  background: #edf6ef;
  border-color: #d2e8d8;
}
.estado-parcial {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #ecddbc;
}
.estado-pendiente {
  color: var(--red);
  background: var(--red-soft);
  border-color: #f1d9d3;
}
.status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 650;
  border: 1px solid currentColor;
}
.favor-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #e9f3e5;
  border: 1px solid #d1e4c8;
  border-radius: 12px;
  padding: 14px 18px;
}
.favor-banner > .icono {
  color: var(--primary);
  border-radius: 50%;
  padding: 3px;
  width: 29px;
  height: 29px;
  background: #d6e8ce;
}
.favor-banner .dato {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
}
.favor-banner .dato br {
  display: none;
}
.saldo-favor-usuario span {
  margin-left: 18px;
  display: inline-block;
}
/* Dashboard */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 22px;
}
.balance-hero {
  background: var(--nav);
  color: white;
  padding: 28px 30px;
  border-radius: var(--radius);
  position: relative;
  min-width: 0;
}
.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.hero-top .eyebrow {
  margin: 0;
  color: #c5d9a8;
  font-size: 9px;
}
.hero-top > .icono {
  color: #c5d9a8;
  width: 23px;
  height: 23px;
}
.balance-hero h2 {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  margin: 0 0 5px;
  color: #d5e4db;
}
.balance-amount {
  display: block;
  font-size: clamp(32px, 3.2vw, 49px);
  letter-spacing: -0.045em;
  line-height: 1.2;
  font-weight: 600;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.balance-hero > p {
  color: #b6cfc0;
  font-size: 11px;
  margin: 12px 0 0;
}
.hero-bottom {
  border-top: 1px solid #ffffff26;
  margin-top: 24px;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 10px;
  color: #b6cfc0;
}
.hero-bottom b {
  display: block;
  font-size: 15px;
  color: #fff;
  margin-top: 3px;
}
.hero-bottom a {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #e0edcc;
  font-size: 10px;
}
.hero-bottom .icono {
  width: 15px;
  height: 15px;
}
.quick-panel {
  padding: 25px 26px;
}
.quick-panel > .eyebrow {
  font-size: 9px;
  margin-bottom: 7px;
}
.quick-panel > h2 {
  font-size: 18px;
  margin-bottom: 15px;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.quick-icon {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--soft);
  color: var(--primary);
}
.quick-icon.warm {
  background: var(--amber-soft);
  color: var(--amber);
}
.quick-action > span:nth-child(2) {
  flex: 1;
}
.quick-action strong {
  display: block;
  font-size: 12px;
}
.quick-action small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}
.quick-action > .icono {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.quick-panel > .text-link {
  margin-top: 12px;
  font-size: 11px;
}
.quick-action:hover strong {
  color: var(--primary);
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.metric-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 15px;
  padding: 21px 23px;
  min-width: 0;
}
.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.metric-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  background: #f1f5ef;
  border-radius: 9px;
  color: #65826f;
}
.metric-icon > .icono {
  width: 17px;
  height: 17px;
}
.metric-value {
  display: block;
  margin-top: 11px;
  font-size: clamp(24px, 2.1vw, 32px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.metric-note {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 9px;
}
.metric-card.positive .metric-value {
  color: var(--primary);
}
.metric-card.warm .metric-icon {
  background: var(--amber-soft);
  color: var(--amber);
}
.metric-card.danger .metric-icon {
  background: var(--red-soft);
  color: var(--red);
}
.metric-card.danger .metric-value {
  color: var(--red);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: start;
}
.expense-list {
  display: flex;
  flex-direction: column;
}
.expense-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.expense-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.expense-symbol {
  display: grid;
  place-items: center;
  width: 32px;
  height: 36px;
  flex-shrink: 0;
  background: #f6f1e9;
  color: #94714a;
  border-radius: 9px;
}
.expense-symbol > .icono {
  width: 16px;
  height: 16px;
}
.expense-item > div {
  flex: 1;
  min-width: 0;
}
.expense-item strong {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.expense-item span:not(.expense-symbol) {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  color: var(--muted);
}
.expense-item > b {
  font-size: 12px;
  white-space: nowrap;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.activity-strip {
  display: flex;
  padding: 22px 28px;
  gap: 30px;
}
.activity-strip > div {
  flex: 1;
  border-right: 1px solid var(--line);
  padding-right: 18px;
}
.activity-strip > div:last-child {
  border: 0;
  padding: 0;
}
.strip-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.activity-strip strong {
  display: block;
  margin-top: 5px;
  font-size: 23px;
  letter-spacing: -0.035em;
}
.management-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.management-card {
  display: block;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s;
}
.management-card:hover {
  border-color: #9ab9a5;
}
.management-card > .icono {
  color: var(--primary);
  width: 24px;
  height: 24px;
  margin-bottom: 20px;
}
.management-card h3 {
  font-size: 16px;
  margin-bottom: 10px;
}
.management-card p {
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.management-card > span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 650;
  color: var(--primary);
}
.management-card > span .icono {
  width: 15px;
  height: 15px;
}
.personal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: start;
}
.balance-caption {
  display: block;
  font-size: 10px;
  color: #a9c7b7;
  margin-top: 18px;
}
.family-balance h2 {
  font-size: 22px;
  color: white;
}
.family-balance .balance-amount {
  font-size: 36px;
  margin-top: 4px;
}
.balance-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 26px;
}
.balance-breakdown > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: #bfd5c7;
}
.balance-breakdown b {
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.breakdown-total {
  padding-top: 15px;
  border-top: 1px solid #ffffff26;
}
.family-balance > p {
  font-size: 10px;
  margin-top: 18px;
}
.personal-payments .section-heading {
  align-items: start;
}
/* Tables: desktop data density, scroll contained to the table on smaller widths. */
.table-scroll {
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
}
.table-scroll:focus {
  outline-offset: 2px;
}
.table-scroll table {
  min-width: 560px;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
  line-height: 1.5;
}
th {
  padding: 12px 13px;
  background: #f5f7f3;
  font-size: 10px;
  color: #6a7b70;
  font-weight: 650;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 15px 13px;
  border-bottom: 1px solid #edf0ea;
  color: #3d4c45;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
tbody tr:last-child > td {
  border-bottom: 0;
}
tbody tr:hover > td {
  background: #f8faf6;
}
td .boton {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 10px;
  border-radius: 7px;
  margin: 3px 3px 3px 0;
  white-space: nowrap;
}
td input {
  min-width: 180px;
  min-height: 37px;
}
td.acciones {
  min-width: 150px;
}
.fila-total td,
tfoot td {
  background: #f4f7f1;
  font-weight: 650;
}
.fila-sin-datos td {
  text-align: center;
  padding: 24px;
  color: var(--muted);
}
.texto-estado-verde,
.monto-cooperacion,
.caja-detalle-verde {
  color: var(--primary) !important;
}
.texto-estado-amarillo {
  color: var(--amber) !important;
}
.texto-estado-rojo,
.monto-gasto,
.caja-detalle-rojo {
  color: var(--red) !important;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.stat-card {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcf9;
  min-width: 0;
}
.stat-title {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 9px;
}
.stat-value {
  font-size: 27px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat-reference {
  margin-top: 7px;
  font-size: 10px;
  color: var(--muted);
}
.stat-verde .stat-value {
  color: var(--primary);
}
.stat-naranja .stat-value {
  color: var(--amber);
}
.stat-rojo .stat-value {
  color: var(--red);
}
.fila-desplegable {
  cursor: pointer;
}
.fila-desplegable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.fila-desplegable.abierta > td {
  background: #edf5ec;
}
.detalle-desplegable {
  padding: 12px 15px 18px;
  background: #f6f8f4;
}
.detalle-desplegable > table {
  background: #fff;
  border: 1px solid var(--line);
}
.fila-detalle-desplegable td {
  font-size: 11px;
}
.tabla-resumen-pagos {
  min-width: 490px !important;
}
.tabla-resumen-pagos th:first-child {
  width: 32px;
}
.tabla-resumen-pagos td:first-child {
  white-space: nowrap;
  padding-right: 0;
  font-size: 11px;
}
.tabla-resumen-pagos td:last-child {
  font-size: 10px;
  font-weight: 650;
}
.tabla-resumen-caja {
  min-width: 640px !important;
}
.resumen-fila-movil,
.movimiento-meta-movil,
.pago-concepto-movil,
.resumen-concepto-movil {
  display: none;
}
.movimiento-titulo {
  display: block;
}
.table-tools {
  display: flex;
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
}
.table-tools > .field:first-child {
  flex: 1;
}
.table-tools > .field {
  max-width: 330px;
}
.filter-count {
  font-size: 10px;
  color: var(--muted);
  padding-bottom: 14px;
  margin-left: auto;
}
.matrix-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 10px;
  color: var(--muted);
  margin: 0 0 14px;
}
.matrix-legend > span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.matrix-legend small {
  margin-left: auto;
  font-size: 10px;
}
.legend-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ccc;
}
.legend-dot.green {
  background: #548c65;
}
.legend-dot.amber {
  background: #c29645;
}
.legend-dot.red {
  background: #cb7770;
}
.matriz-pagos-contenedor {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tabla-matriz-pagos {
  min-width: 100%;
  width: max-content;
  border-collapse: separate;
  border-spacing: 0;
}
.tabla-matriz-pagos th,
.tabla-matriz-pagos td {
  min-width: 120px;
  text-align: center;
  border-right: 1px solid #e9eee7;
}
.tabla-matriz-pagos .columna-usuario-matriz {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 180px;
  max-width: 230px;
  text-align: left;
  background: white;
  box-shadow: 3px 0 7px #24452d08;
}
.tabla-matriz-pagos th.columna-usuario-matriz {
  background: #f5f7f3;
  z-index: 3;
}
.encabezado-pago-matriz,
.concepto-pago-matriz,
.monto-pago-matriz {
  display: block;
  font-size: 10px;
}
.concepto-pago-matriz {
  white-space: normal;
  max-width: 160px;
  margin: 4px auto;
  font-size: 11px;
  color: var(--ink);
}
.monto-pago-matriz {
  color: var(--muted);
  font-weight: 400;
}
.usuario-matriz-nombre {
  font-size: 12px;
  font-weight: 650;
}
.usuario-matriz-deuda {
  font-size: 10px;
  margin-top: 4px;
}
.usuario-matriz-saldo {
  color: var(--primary);
  font-size: 10px;
  margin-top: 4px;
}
.celda-matriz-pagado {
  background: #edf6ed;
  color: #367745;
  font-size: 11px;
}
.celda-matriz-parcial {
  background: #fcf6e8;
  color: #926d20;
  font-size: 11px;
}
.celda-matriz-pendiente {
  background: #fcf0ee;
  color: #aa5951;
  font-size: 11px;
}
.tabla-resumen-conceptos {
  min-width: 870px !important;
}
.tabla-resumen-conceptos .celda-contador {
  text-align: center;
}
.concepto-escritorio {
  font-weight: 600;
}
/* Existing SVG history, with the shared colour palette and readable day details. */
.caja-historial {
  min-width: 0;
}
.caja-historial-encabezado {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.caja-historial-encabezado h2 {
  font-size: 19px;
  margin: 0;
}
.caja-historial-leyenda {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.caja-historial-leyenda:before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}
.caja-grafica {
  position: relative;
  isolation: isolate;
  min-height: 205px;
  padding: 12px 6px 8px;
  background: #fbfcf9;
  border-radius: 8px;
  touch-action: pan-y;
}
.caja-grafica svg {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 210px;
  overflow: visible;
}
.caja-grid-linea {
  stroke: #e3e9e0;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.caja-area-saldo {
  fill: url(#gradienteCajaSaldo);
  stroke: none;
  pointer-events: none;
}
.caja-linea-saldo {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.caja-punto-movimiento {
  fill: var(--primary);
  opacity: 0;
  pointer-events: none;
}
.caja-punto-interactivo {
  fill: transparent;
  stroke: transparent;
  cursor: crosshair;
  pointer-events: all;
  outline: none;
}
.caja-punto-interactivo:focus-visible {
  fill: #176b5b20;
  stroke: var(--primary);
  stroke-width: 0.4;
}
.caja-guia {
  opacity: 0;
  stroke: #6e9680;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.caja-guia-visible {
  opacity: 1;
}
.caja-punto-activo {
  position: absolute;
  z-index: 3;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border: 2px solid white;
  box-shadow: 0 0 0 3px #176b5b20;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.caja-punto-activo-visible {
  opacity: 1;
}
.caja-tooltip {
  position: absolute;
  z-index: 5;
  width: min(230px, calc(100% - 16px));
  padding: 12px 14px;
  background: var(--nav);
  border-radius: 10px;
  color: #fff;
  box-shadow: 0 10px 32px #183c3430;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  font-size: 11px;
}
.caja-tooltip-visible {
  opacity: 1;
  visibility: visible;
}
.caja-tooltip > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
}
.caja-tooltip-fila {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  color: #c5d9cc;
  margin: 3px 0;
}
.caja-tooltip-fila b {
  color: white;
}
.caja-tooltip-cooperaciones b {
  color: #c0dfaa;
}
.caja-tooltip-gastos b {
  color: #f4b4a9;
}
.caja-tooltip-total {
  border-top: 1px solid #ffffff26;
  padding-top: 7px;
  margin-top: 7px;
}
.caja-eje-fechas {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
  margin-top: 7px;
}
.caja-rangos {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 18px;
}
.caja-rango {
  padding: 7px 14px;
  min-height: 33px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border-radius: 7px;
  color: var(--muted);
  background: #f2f5ee;
}
.caja-rango:hover,
.caja-rango-activo {
  background: var(--primary);
  color: #fff;
}
.caja-aviso-fecha {
  padding: 10px 12px;
  background: var(--amber-soft);
  color: var(--amber);
  border-radius: 8px;
  font-size: 11px;
  margin: 16px 0 0;
}
.caja-detalles-dia {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.caja-detalles-encabezado {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.caja-detalles-encabezado h3 {
  font-size: 13px;
  margin: 0;
}
.caja-detalles-encabezado > span {
  font-size: 10px;
  color: var(--muted);
}
.caja-detalles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.caja-detalle-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
  background: #fff;
}
.caja-detalle-panel > h3 {
  font-size: 10px;
  font-weight: 600;
  background: #f5f7f1;
  padding: 9px 11px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.caja-detalle-tabla {
  table-layout: fixed;
  font-size: 9px;
}
.caja-detalle-tabla td {
  font-size: 9px;
  padding: 8px;
  overflow-wrap: anywhere;
}
.caja-detalle-tabla td:last-child {
  width: 78px;
  text-align: right;
}
.caja-detalle-monto {
  white-space: nowrap;
  font-weight: 600;
}
.caja-detalle-total {
  font-weight: 700;
}
.caja-detalle-principal,
.caja-detalle-meta {
  display: block;
  overflow-wrap: anywhere;
}
.caja-detalle-meta {
  color: var(--muted);
  font-size: 8px;
  margin-top: 3px;
}
.caja-detalle-vacio {
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}
/* Access screens */
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-story {
  background: var(--nav);
  padding: 44px 54px;
  display: flex;
  flex-direction: column;
  color: #fff;
  min-height: 100vh;
}
.auth-story .brand {
  padding: 0;
}
.auth-intro {
  margin: auto 0;
  max-width: 470px;
  padding: 60px 0;
}
.auth-intro .eyebrow {
  color: #c5d9a8;
  font-size: 10px;
  margin-bottom: 25px;
}
.auth-intro h1 {
  font-size: clamp(36px, 4.2vw, 60px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.055em;
  margin-bottom: 25px;
}
.auth-intro > p {
  font-size: 14px;
  color: #b8d0c2;
  max-width: 350px;
  line-height: 1.8;
}
.auth-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 42px;
}
.auth-features > span {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #d7e4d9;
}
.auth-features .icono {
  width: 19px;
  height: 19px;
  color: #c5d9a8;
}
.auth-caption {
  font-size: 10px;
  color: #9fbdac;
}
.auth-content {
  padding: 60px 40px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.auth-card {
  width: 100%;
  max-width: 390px;
  margin: auto 0;
  padding: 30px 0;
}
.auth-card > .eyebrow {
  font-size: 9px;
}
.auth-card > h2 {
  font-size: 32px;
  margin: 10px 0 13px;
  font-weight: 600;
  letter-spacing: -0.045em;
}
.auth-card > .page-subtitle {
  font-size: 13px;
  margin-bottom: 28px;
}
.auth-card .tarjeta {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: none;
}
.auth-card .data-form {
  grid-template-columns: 1fr;
}
.auth-card > .tarjeta > p {
  font-size: 13px;
}
.auth-content > footer {
  font-size: 10px;
  color: var(--muted);
  padding-top: 28px;
}
.auth-mobile-brand {
  display: none;
}
.login-form {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.login-form input {
  min-height: 50px;
  background: #fff;
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 52px;
}
.password-toggle {
  position: absolute;
  right: 6px;
  top: 5px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--muted);
  border: 0;
  border-radius: 7px;
  background: transparent;
}
.password-toggle:hover {
  background: #f1f5ef;
}
.login-form .login-submit {
  width: 100%;
  min-height: 49px;
  margin-top: 5px;
  justify-content: space-between;
  padding: 13px 18px;
}
.login-help {
  font-size: 11px !important;
  color: var(--muted);
  line-height: 1.8;
  text-align: center;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin: 28px 0 0;
}
.toast {
  position: fixed;
  z-index: 100;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: var(--nav);
  color: #fff;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 12px;
  box-shadow: 0 8px 35px #0002;
}
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 3px;
}
.subnav > a {
  padding: 8px 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  color: var(--muted);
}
.subnav > a:hover {
  background: var(--soft);
  color: var(--primary);
}
/* Tablet: use the full canvas with a drawer and two-column forms. */
@media (min-width: 1600px) {
  .workspace {
    padding-top: 46px;
  }
  .balance-amount {
    font-size: 52px;
  }
  .metric-value {
    font-size: 34px;
  }
}
@media (max-width: 1250px) {
  :root {
    --sidebar: 218px;
  }
  .sidebar {
    padding-left: 12px;
    padding-right: 12px;
  }
  .brand {
    font-size: 15px;
    gap: 9px;
    padding: 0 10px;
  }
  .brand-mark {
    width: 34px;
    height: 37px;
    font-size: 24px;
  }
  .workspace {
    padding: 30px 26px 20px;
  }
  .topbar {
    padding: 0 26px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .recent-expenses .expense-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
  }
  .recent-expenses .expense-item {
    padding-bottom: 15px;
  }
  .personal-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr);
  }
  .balance-hero {
    padding: 25px;
  }
  .family-balance .balance-amount {
    font-size: 31px;
  }
  .quick-panel {
    padding: 24px;
  }
  .metric-card {
    padding: 18px;
  }
  .page-heading h1 {
    font-size: 29px;
  }
}
@media (max-width: 1024px) {
  :root {
    --sidebar: 242px;
  }
  .sidebar {
    transform: translateX(-100%);
    visibility: hidden;
    transition:
      transform 0.2s,
      visibility 0.2s;
    padding-top: 32px;
  }
  .app-main {
    margin-left: 0;
  }
  .open-nav {
    display: inline-flex;
  }
  .nav-open .sidebar {
    transform: translateX(0);
    visibility: visible;
  }
  .nav-open .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    background: #142e2780;
    z-index: 35;
  }
  .nav-open {
    overflow: hidden;
  }
  .close-nav {
    display: inline-flex;
    position: absolute;
    right: 12px;
    top: 88px;
    width: 30px;
    height: 30px;
    background: #ffffff0d;
    color: #fff;
    border-color: #ffffff16;
  }
  .close-nav .icono {
    width: 16px;
    height: 16px;
  }
  .workspace {
    padding: 30px 28px 20px;
  }
  .topbar {
    height: 70px;
    padding: 0 28px;
  }
  .page-heading h1 {
    font-size: 30px;
  }
  .caja-detalles-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .auth-story {
    padding: 36px;
  }
  .auth-content {
    padding-left: 32px;
    padding-right: 32px;
  }
  .auth-intro h1 {
    font-size: 42px;
  }
  .personal-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(250px, 1fr);
  }
}
/* Phone: compact navigation, stacked dashboards and usable payment details. */
@media (max-width: 767px) {
  html {
    scroll-padding-top: 26px;
  }
  .topbar {
    height: 66px;
    padding: 0 20px;
  }
  .topbar-left {
    gap: 10px;
  }
  .breadcrumb {
    font-size: 11px;
  }
  .breadcrumb span {
    margin: 0 6px;
  }
  .topbar-right {
    gap: 8px;
  }
  .profile-name,
  .currency-label {
    display: none;
  }
  .avatar {
    width: 30px;
    height: 30px;
  }
  .open-nav {
    width: 35px;
    height: 35px;
  }
  .workspace {
    padding: 25px 18px calc(95px + env(safe-area-inset-bottom));
  }
  .page-heading {
    align-items: start;
    gap: 14px;
    margin-bottom: 23px;
    flex-wrap: wrap;
  }
  .page-heading h1 {
    font-size: 27px;
    margin-bottom: 8px;
  }
  .page-heading .eyebrow {
    font-size: 8px;
    margin-bottom: 9px;
  }
  .page-subtitle {
    font-size: 12px;
    line-height: 1.65;
  }
  .page-heading > .boton {
    font-size: 11px;
    min-height: 40px;
    padding: 10px 13px;
  }
  .page-heading > .status-pill {
    font-size: 10px;
  }
  .page-content {
    gap: 17px;
  }
  .tarjeta {
    padding: 21px 18px;
    border-radius: 15px;
  }
  .section-heading {
    gap: 10px;
    margin-bottom: 18px;
  }
  .section-heading h2 {
    font-size: 18px;
  }
  .section-heading > .helper-text {
    font-size: 9px;
    max-width: 110px;
  }
  .section-heading .eyebrow {
    font-size: 8px;
  }
  .section-heading .text-link {
    font-size: 10px;
  }
  .overview-grid,
  .personal-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 17px;
  }
  .balance-hero {
    padding: 25px;
    border-radius: 15px;
  }
  .balance-amount {
    font-size: 40px;
  }
  .hero-top {
    margin-bottom: 19px;
  }
  .hero-bottom {
    gap: 14px;
    margin-top: 20px;
  }
  .hero-bottom a {
    font-size: 10px;
    max-width: 140px;
  }
  .metrics-grid {
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .metric-card {
    padding: 15px 12px;
    border-radius: 12px;
  }
  .metric-top {
    font-size: 10px;
    line-height: 1.4;
    min-height: 28px;
    align-items: start;
  }
  .metric-icon {
    display: none;
  }
  .metric-value {
    font-size: 22px;
    letter-spacing: -0.045em;
    margin-top: 9px;
  }
  .metric-note {
    font-size: 9px;
    line-height: 1.5;
    margin-top: 7px;
  }
  .personal-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .personal-metrics .metric-card:first-child {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 18px 20px;
    background: var(--soft);
    border-color: #d4e5d6;
  }
  .personal-metrics .metric-card:first-child .metric-top {
    font-size: 12px;
    min-height: 0;
  }
  .personal-metrics .metric-card:first-child .metric-value {
    font-size: 32px;
    margin: 0;
    grid-column: 2;
    grid-row: 1/3;
  }
  .personal-metrics .metric-card:first-child .metric-note {
    margin: 4px 0 0;
  }
  .personal-metrics .metric-value {
    font-size: 27px;
  }
  .quick-panel > h2 {
    font-size: 18px;
  }
  .quick-action {
    padding: 14px 0;
  }
  .quick-action strong {
    font-size: 13px;
  }
  .quick-action small {
    font-size: 11px;
  }
  .quick-panel > .text-link {
    font-size: 12px;
  }
  .activity-strip {
    gap: 16px;
    flex-wrap: wrap;
    padding: 21px;
  }
  .activity-strip > div {
    flex: 1 1 35%;
  }
  .activity-strip > div:nth-child(2) {
    border: 0;
  }
  .activity-strip > div:last-child {
    flex-basis: 100%;
    border-top: 1px solid var(--line);
    padding-top: 15px;
  }
  .strip-label {
    font-size: 10px;
  }
  .activity-strip strong {
    font-size: 22px;
  }
  .management-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .management-card {
    padding: 22px;
    display: grid;
    grid-template-columns: 32px 1fr;
    column-gap: 14px;
  }
  .management-card > .icono {
    grid-row: 1/4;
    width: 22px;
    margin: 0;
  }
  .management-card h3 {
    font-size: 15px;
  }
  .management-card p {
    font-size: 11px;
    margin-bottom: 12px;
  }
  .management-card > span {
    grid-column: 2;
    font-size: 11px;
  }
  .recent-expenses .expense-list {
    display: flex;
  }
  .expense-item {
    padding: 16px 0;
  }
  .expense-item strong {
    font-size: 13px;
  }
  .expense-item span:not(.expense-symbol) {
    font-size: 10px;
  }
  .expense-item > b {
    font-size: 12px;
  }
  .family-balance .balance-amount {
    font-size: 38px;
  }
  .family-balance .hero-top {
    margin-bottom: 18px;
  }
  .balance-breakdown > span {
    font-size: 12px;
  }
  .balance-hero > p {
    font-size: 11px;
  }
  .favor-banner {
    padding: 13px 15px;
    gap: 10px;
  }
  .saldo-favor-usuario span {
    display: block;
    margin: 3px 0 0;
  }
  .favor-banner .dato br {
    display: block;
  }
  .data-form {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 19px;
  }
  .data-form > .field:has(textarea) {
    grid-column: auto;
  }
  .data-form > .menu,
  .data-form > button,
  .data-form > .dato,
  .data-form > .error {
    grid-column: 1;
  }
  .data-form .menu {
    padding-top: 18px;
    display: flex;
    flex-wrap: wrap;
  }
  .data-form .menu > button,
  .data-form .menu > .boton {
    flex: 1;
    min-width: 120px;
    min-height: 46px;
  }
  .data-form > button {
    width: 100%;
    justify-self: stretch;
    min-height: 46px;
  }
  .data-form + .table-scroll {
    margin-top: 26px;
  }
  .filter-form {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .filter-form > .field {
    min-width: 0;
    max-width: none;
  }
  .filter-form .menu {
    display: flex;
  }
  .filter-form .menu > * {
    flex: 1;
  }
  label {
    font-size: 12px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
    min-height: 47px;
  }
  input[readonly] {
    font-size: 13px;
  }
  .menu {
    gap: 8px;
  }
  .stats {
    gap: 10px;
  }
  .stat-card {
    padding: 14px 10px;
  }
  .stat-title {
    font-size: 10px;
  }
  .stat-value {
    font-size: 21px;
  }
  .stat-reference {
    font-size: 9px;
  }
  .page-footer {
    font-size: 9px;
    flex-direction: column;
    gap: 4px;
    margin-top: 27px;
  }
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 8px calc(7px + env(safe-area-inset-bottom));
    background: #fffffff5;
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    z-index: 30;
    gap: 2px;
  }
  .bottom-nav > a,
  .bottom-nav > button {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    color: #849187;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 47px;
    padding: 4px 0;
    font-size: 9px;
    font-weight: 500;
    border-radius: 8px;
    line-height: 1.3;
  }
  .bottom-nav .icono {
    width: 20px;
    height: 20px;
  }
  .bottom-nav .active {
    color: var(--primary);
    background: var(--soft);
    font-weight: 650;
  }
  .toast {
    bottom: calc(85px + env(safe-area-inset-bottom));
    font-size: 12px;
  }
  .table-tools {
    flex-wrap: wrap;
    gap: 12px;
  }
  .table-tools > .field,
  .table-tools > .field:first-child {
    flex: 1 1 100%;
    max-width: none;
  }
  .filter-count {
    padding: 0;
    margin: 0;
  }
  .matrix-legend {
    gap: 10px;
    font-size: 9px;
  }
  .matrix-legend small {
    margin-left: 0;
    flex-basis: 100%;
    font-size: 9px;
  }
  .tabla-matriz-pagos .columna-usuario-matriz {
    min-width: 138px;
    max-width: 160px;
  }
  .tabla-matriz-pagos th,
  .tabla-matriz-pagos td {
    min-width: 110px;
    padding: 13px 10px;
  }
  .usuario-matriz-nombre {
    font-size: 11px;
  }
  .usuario-matriz-deuda,
  .usuario-matriz-saldo {
    font-size: 9px;
  }
  .tabla-resumen-pagos,
  .tabla-resumen-caja {
    min-width: 0 !important;
    table-layout: fixed;
  }
  .tabla-resumen-pagos > thead,
  .tabla-resumen-caja > thead {
    display: none;
  }
  .tabla-resumen-pagos > tbody > .fila-desplegable > td:nth-child(n + 3),
  .tabla-resumen-caja > tbody > .fila-desplegable > td:nth-child(n + 2) {
    display: none;
  }
  .tabla-resumen-pagos > tbody > .fila-desplegable > td:first-child {
    width: 28px;
    padding: 17px 0;
    vertical-align: top;
  }
  .tabla-resumen-pagos .celda-pago,
  .tabla-resumen-caja .celda-pago {
    font-size: 13px;
    font-weight: 600;
    padding: 16px 10px;
  }
  .resumen-fila-movil {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 7px;
    margin-top: 10px;
    font-size: 10px;
    font-weight: 400;
    color: var(--muted);
  }
  .resumen-fila-movil .estado-movil {
    display: block;
    flex-basis: 100%;
    color: var(--primary);
    font-size: 10px;
    margin-top: 3px;
  }
  .resumen-linea {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-basis: 100%;
    font-size: 10px;
  }
  .detalle-desplegable {
    padding: 8px 0 15px;
  }
  .detalle-desplegable > table {
    table-layout: fixed;
    min-width: 0 !important;
  }
  .tabla-movimientos-usuario th,
  .tabla-movimientos-usuario td {
    padding: 10px 7px;
    font-size: 10px;
  }
  .tabla-cooperaciones-usuario th:first-child,
  .tabla-cooperaciones-usuario td:first-child {
    width: 76px;
  }
  .tabla-gastos-usuario th:nth-child(1),
  .tabla-gastos-usuario th:nth-child(2),
  .tabla-gastos-usuario td:nth-child(1),
  .tabla-gastos-usuario td:nth-child(2) {
    display: none;
  }
  .tabla-gastos-usuario th:last-child,
  .tabla-gastos-usuario td:last-child {
    width: 90px;
  }
  .movimiento-meta-movil {
    display: block;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.6;
    margin-top: 3px;
  }
  .tabla-resumen-conceptos {
    min-width: 0 !important;
    table-layout: fixed;
  }
  .tabla-resumen-conceptos thead {
    display: none;
  }
  .tabla-resumen-conceptos .fila-resumen-concepto > td:first-child,
  .tabla-resumen-conceptos .fila-resumen-concepto > td:nth-child(n + 3) {
    display: none;
  }
  .concepto-escritorio {
    display: none;
  }
  .pago-concepto-movil {
    display: block;
    font-weight: 650;
    font-size: 13px;
  }
  .resumen-concepto-movil {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
  }
  .dato-resumen-concepto {
    font-size: 9px;
    color: var(--muted);
  }
  .dato-resumen-concepto strong {
    display: block;
    color: var(--ink);
    font-size: 11px;
    margin-top: 4px;
  }
  .contador-pagado strong {
    color: var(--primary);
  }
  .contador-parcial strong {
    color: var(--amber);
  }
  .contador-pendiente strong {
    color: var(--red);
  }
  .caja-historial-encabezado {
    gap: 10px;
    align-items: start;
  }
  .caja-historial-encabezado h2 {
    font-size: 18px;
  }
  .caja-historial-leyenda {
    font-size: 9px;
    padding-top: 4px;
  }
  .caja-grafica {
    min-height: 180px;
  }
  .caja-grafica svg {
    height: 180px;
  }
  .caja-detalles-grid {
    grid-template-columns: 1fr;
  }
  .caja-detalle-tabla td {
    font-size: 11px;
    padding: 9px 11px;
  }
  .caja-detalle-tabla td:last-child {
    width: 100px;
  }
  .caja-detalle-panel > h3 {
    font-size: 11px;
    padding: 10px 11px;
  }
  .caja-detalle-meta {
    font-size: 9px;
  }
  .caja-detalles-encabezado {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }
  .caja-detalles-encabezado > span {
    font-size: 10px;
  }
  .auth-layout {
    display: flex;
    min-height: 100dvh;
  }
  .auth-story {
    display: none;
  }
  .auth-content {
    padding: 32px 26px;
    width: 100%;
    min-height: 100dvh;
    justify-content: start;
  }
  .auth-mobile-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    align-self: start;
    font-weight: 650;
    font-size: 15px;
    line-height: 1.2;
    margin-bottom: 28px;
  }
  .auth-mobile-brand small {
    color: var(--muted);
    font-size: 7px;
  }
  .auth-mobile-brand .brand-mark {
    width: 32px;
    height: 35px;
    font-size: 23px;
  }
  .auth-card {
    padding: 28px 0;
    max-width: 420px;
  }
  .auth-card > h2 {
    font-size: 31px;
  }
  .auth-card .page-subtitle {
    font-size: 13px;
  }
  .auth-card .menu .boton {
    flex: 1;
  }
  .auth-content > footer {
    padding-top: 20px;
  }
  .login-form {
    gap: 22px;
  }
  .login-help {
    font-size: 11px !important;
  }
}
@media (max-width: 380px) {
  .workspace {
    padding-left: 14px;
    padding-right: 14px;
  }
  .metric-card {
    padding: 13px 10px;
  }
  .metric-value {
    font-size: 19px;
  }
  .metric-top {
    font-size: 9px;
  }
  .metric-note {
    font-size: 8px;
  }
  .personal-metrics .metric-value {
    font-size: 25px;
  }
  .balance-amount {
    font-size: 35px;
  }
  .tarjeta {
    padding: 19px 14px;
  }
  .bottom-nav > a,
  .bottom-nav > button {
    font-size: 8px;
  }
  .breadcrumb {
    font-size: 10px;
  }
  .caja-historial-leyenda {
    font-size: 8px;
  }
  .saldo-favor-usuario {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  .sidebar,
  .topbar,
  .bottom-nav,
  .page-heading > .boton,
  .menu,
  button,
  .page-footer {
    display: none !important;
  }
  .app-main {
    margin: 0;
  }
  .workspace {
    padding: 0;
    max-width: none;
  }
  body {
    background: #fff;
  }
  .tarjeta,
  .metric-card,
  .balance-hero {
    break-inside: avoid;
    box-shadow: none;
  }
  .balance-hero {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
  }
  .balance-hero * {
    color: var(--ink) !important;
  }
  .table-scroll,
  .matriz-pagos-contenedor {
    overflow: visible;
  }
  .page-content {
    gap: 14px;
  }
}
/* Explicit button variants also apply to submit buttons. */
.boton.boton-secundario {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}
.boton.boton-secundario:hover {
  background: var(--soft);
  color: var(--primary);
}
.boton.boton-peligro {
  background: var(--red-soft);
  color: var(--red);
  border-color: #f1d6d2;
}
.boton.boton-peligro:hover {
  background: var(--red);
  color: white;
}
@media (max-width: 767px) {
  .table-mobile-cards {
    display: block;
    min-width: 0 !important;
  }
  .table-mobile-cards > thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .table-mobile-cards > tbody {
    display: block;
  }
  .table-mobile-cards > tbody > tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
    background: #fff;
  }
  .table-mobile-cards > tbody > tr:last-child {
    margin-bottom: 0;
  }
  .table-mobile-cards > tbody > tr > td {
    display: block;
    padding: 10px 13px;
    font-size: 12px;
    min-width: 0;
    border-bottom: 1px solid #edf0ea;
  }
  .table-mobile-cards > tbody > tr > td[data-label] {
    display: grid;
    grid-template-columns: minmax(85px, 0.75fr) minmax(0, 1.4fr);
    gap: 12px;
    align-items: start;
  }
  .table-mobile-cards td[data-label]:before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    padding-top: 2px;
  }
  .table-mobile-cards td > input {
    min-width: 0;
    max-width: 100%;
  }
  .table-mobile-cards td.acciones {
    display: flex !important;
    flex-wrap: wrap;
  }
  .table-mobile-cards td.acciones:before {
    width: 100%;
    margin-bottom: 4px;
  }
  .table-mobile-cards td .boton {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 11px;
  }
  .table-mobile-cards tbody tr:hover > td {
    background: white;
  }
}

/* Vista personal compacta. Los desplegables son independientes de las tablas. */
.seccion-personal .page-content {
  gap: 16px;
}
.seccion-personal .page-heading {
  margin-bottom: 20px;
}
.seccion-personal .metric-card {
  padding: 16px 19px;
}
.seccion-personal .metric-top {
  min-height: 0;
}
.seccion-personal .metric-value {
  margin-top: 5px;
}
.seccion-personal .metric-note {
  margin-top: 5px;
}
.seccion-personal .section-heading {
  margin-bottom: 12px;
}
.seccion-personal .family-balance {
  padding: 20px 23px;
}
.seccion-personal .family-balance .hero-top {
  margin-bottom: 12px;
}
.seccion-personal .balance-caption {
  margin-top: 9px;
}
.seccion-personal .balance-breakdown {
  margin-top: 16px;
  gap: 8px;
}
.seccion-personal .balance-hero > p {
  margin-top: 10px;
}
.seccion-personal .breakdown-total {
  padding-top: 10px;
}
.payment-list {
  width: 100%;
  min-width: 0;
}
.payment-accordion {
  width: 100%;
  border-bottom: 1px solid var(--line);
}
.payment-accordion:last-child {
  border-bottom: 0;
}
.payment-accordion > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  padding: 13px 9px;
}
.payment-accordion > summary::-webkit-details-marker {
  display: none;
}
.payment-accordion > summary::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-right: 1.5px solid #668775;
  border-bottom: 1.5px solid #668775;
  transform: rotate(-45deg);
  margin-right: 3px;
}
.payment-accordion[open] > summary {
  background: #f0f6ee;
  border-radius: 8px 8px 0 0;
}
.payment-accordion[open] > summary::before {
  transform: rotate(45deg);
}
.payment-heading {
  flex: 1;
  min-width: 0;
}
.payment-heading > strong {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.payment-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 16px;
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
}
.payment-facts b {
  font-weight: 500;
  color: #43594a;
  white-space: nowrap;
}
.payment-status {
  font-size: 10px;
  font-weight: 600;
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 5px;
  background: #f2f5ed;
  color: #47634c;
}
.cooperation-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 14px;
  margin-top: 7px;
  font-size: 10px;
  color: var(--muted);
}
.cooperation-facts > span {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 5px;
}
.cooperation-facts b {
  font-weight: 500;
  color: #43594a;
}
.payment-detail {
  padding: 9px 8px 13px;
  width: 100%;
  min-width: 0;
}
.ledger-detail-table {
  min-width: 0 !important;
  width: 100%;
  font-size: 11px;
  table-layout: auto;
}
.ledger-detail-table td,
.ledger-detail-table th {
  padding: 10px 8px;
  font-size: 11px;
}
.ledger-detail-table td:nth-child(1) {
  white-space: nowrap;
}
.ledger-detail-table td:nth-child(2) {
  white-space: nowrap;
}
.ledger-detail-table td:last-child {
  overflow-wrap: anywhere;
}
.expense-detail-table td:first-child {
  white-space: normal;
}
.expense-detail-table td:last-child,
.expense-detail-table th:last-child {
  width: 96px;
  text-align: right;
  white-space: nowrap;
}
.movement-meta {
  display: block;
  font-size: 10px;
  margin-top: 3px;
  color: var(--muted);
}
@media (max-width: 767px) {
  .seccion-personal .workspace {
    padding-top: 18px;
  }
  .seccion-personal .page-heading {
    gap: 10px;
    margin-bottom: 17px;
  }
  .seccion-personal .tarjeta {
    padding: 17px 15px;
  }
  .seccion-personal .metrics-grid {
    gap: 9px;
  }
  .seccion-personal .metric-card {
    padding: 13px 15px;
  }
  .seccion-personal .personal-metrics .metric-card:first-child {
    padding: 15px 17px;
  }
  .seccion-personal .personal-metrics .metric-card:first-child .metric-top {
    font-size: 11px;
  }
  .seccion-personal .metric-top {
    line-height: 1.3;
    min-height: 0;
  }
  .seccion-personal .metric-value {
    font-size: 25px;
    margin-top: 6px;
  }
  .seccion-personal .metric-note {
    margin-top: 4px;
    font-size: 9px;
  }
  .seccion-personal .family-balance {
    padding: 19px 21px;
  }
  .seccion-personal .family-balance .balance-amount {
    font-size: 33px;
  }
  .seccion-personal .family-balance h2 {
    font-size: 19px;
  }
  .seccion-personal .balance-breakdown > span {
    font-size: 11px;
  }
  .payment-accordion > summary {
    padding: 11px 4px;
    gap: 7px;
  }
  .payment-heading > strong {
    font-size: 12px;
  }
  .payment-facts {
    font-size: 10px;
    gap: 3px 10px;
    margin-top: 4px;
  }
  .payment-status {
    font-size: 9px;
    padding: 3px 5px;
  }
  .cooperation-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 10px;
    font-size: 10px;
    margin-top: 5px;
  }
  .payment-detail {
    padding: 7px 0 10px;
  }
  .ledger-detail-table td,
  .ledger-detail-table th {
    padding: 9px 5px;
    font-size: 10px;
  }
  .ledger-detail-table:not(.expense-detail-table) td:first-child {
    width: 72px;
  }
  .ledger-detail-table:not(.expense-detail-table) td:nth-child(2) {
    width: 68px;
  }
  .expense-detail-table td:last-child,
  .expense-detail-table th:last-child {
    width: 84px;
  }
  .movement-meta {
    font-size: 9px;
  }
}
/* Resumen personal: dinero recibido separado de aplicación a cuotas. */
.personal-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr);
  gap: 16px;
  align-items: stretch;
}
.personal-money {
  background: #eaf4ee;
  border: 1px solid #d2e4d7;
  border-radius: 14px;
  padding: 20px 23px;
  min-width: 0;
}
.money-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: space-between;
}
.money-header > span {
  font-size: 12px;
  color: #406455;
}
.money-header > strong {
  font-size: 35px;
  letter-spacing: -0.045em;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.money-allocation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid #cdddce;
  margin-top: 16px;
  padding-top: 13px;
}
.money-allocation > span {
  font-size: 11px;
  color: #577361;
}
.money-allocation b {
  display: block;
  margin-top: 3px;
  color: #244e3a;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.personal-money p {
  margin: 12px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: #63806d;
}
.personal-secondary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.personal-secondary .metric-card {
  padding: 13px 18px;
}
.personal-secondary .metric-top {
  font-size: 11px;
  min-height: 0;
}
.personal-secondary .metric-value {
  font-size: 25px;
  margin: 4px 0 0;
}
.personal-secondary .metric-note {
  font-size: 10px;
  margin-top: 4px;
}
@media (max-width: 767px) {
  .personal-summary-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .personal-money {
    padding: 17px 18px;
  }
  .money-header {
    gap: 6px 12px;
  }
  .money-header > span {
    font-size: 11px;
  }
  .money-header > strong {
    font-size: 30px;
  }
  .money-allocation {
    margin-top: 12px;
    padding-top: 10px;
  }
  .money-allocation > span {
    font-size: 10px;
  }
  .money-allocation b {
    font-size: 19px;
  }
  .personal-money p {
    font-size: 9px;
    margin-top: 9px;
  }
  .personal-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .seccion-personal .personal-secondary .metric-card {
    padding: 12px 14px;
  }
  .personal-secondary .metric-value {
    font-size: 24px;
  }
  .personal-secondary .metric-note {
    font-size: 9px;
  }
}

.caja-dia-colapsable > summary {
  cursor: pointer;
  margin-bottom: 0;
  font-size: 12px;
}
.caja-dia-colapsable[open] > summary {
  margin-bottom: 12px;
}

.payment-status.pending {
  background: var(--red-soft);
  color: var(--red);
}
.payment-status.partial {
  background: var(--amber-soft);
  color: var(--amber);
}

/* v2.2: administrative density. Personal pages keep their existing layout. */
.admin-compact .page-heading {
  gap: 12px;
  margin-bottom: 16px;
}
.admin-compact .page-heading h1 {
  margin-bottom: 4px;
}
.admin-compact .page-heading .eyebrow {
  margin-bottom: 5px;
}
.admin-compact .page-subtitle {
  line-height: 1.45;
}
.admin-compact .page-content {
  gap: 14px;
}
.admin-compact .tarjeta {
  padding: 20px;
}
.admin-compact .tarjeta > p {
  margin: 0 0 10px;
}
.admin-compact .tarjeta h2 {
  margin-bottom: 12px;
}
.admin-compact .section-heading {
  margin-bottom: 12px;
}
.admin-compact .subnav {
  margin: 0;
  gap: 8px;
}
.admin-compact .data-form {
  margin: 10px 0 0;
  gap: 12px 16px;
}
.admin-compact .data-form .menu {
  margin-top: 0;
  padding-top: 10px;
  gap: 8px;
}
.admin-compact label {
  margin-bottom: 4px;
}
.admin-compact input:not([type="checkbox"]):not([type="radio"]),
.admin-compact select {
  min-height: 42px;
  padding: 8px 10px;
}
.admin-compact textarea {
  min-height: 64px;
  padding: 8px 10px;
}
.admin-compact .field-wide {
  grid-column: 1/-1;
}
.admin-compact input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 100%;
  inline-size: 100%;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  height: 44px;
}
.admin-compact input[type="date"]::-webkit-date-and-time-value {
  min-width: 0;
  text-align: left;
}
.admin-compact .filter-form {
  gap: 10px;
}
.admin-compact .filter-form .menu {
  margin: 0;
}
.admin-compact .inline-financial-note {
  margin: 0;
  line-height: 1.5;
  color: var(--muted);
}
.admin-compact .inline-financial-note strong {
  white-space: nowrap;
  color: var(--ink);
}
.admin-compact .data-form + .table-scroll {
  margin-top: 16px;
}
.admin-compact table:not(.tabla-matriz-pagos) th,
.admin-compact table:not(.tabla-matriz-pagos) td {
  padding: 8px 10px;
  line-height: 1.35;
}
.admin-compact .compact-records {
  width: 100%;
  min-width: 0;
  table-layout: auto;
}
.admin-compact .compact-records th {
  font-size: 11px;
}
.admin-compact .compact-records td {
  font-size: 12px;
}
.admin-compact .compact-records .money,
.admin-compact .compact-records .date {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
.admin-compact .compact-records .money {
  text-align: right;
  width: 1%;
}
.admin-compact .compact-records .row-number {
  width: 1%;
  white-space: nowrap;
}
.admin-compact .compact-records [data-record-url] {
  cursor: pointer;
}
.admin-compact .record-link {
  color: inherit;
  font-weight: 500;
  text-decoration: none;
}
.admin-compact .record-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.admin-compact .compact-records tbody tr:hover {
  background: #edf5ef;
}
.admin-compact .members-table .acciones {
  white-space: nowrap;
}
.admin-compact .members-table .acciones .boton {
  min-height: 32px;
  padding: 7px 9px;
  margin: 0 3px 0 0;
}
.admin-compact .payment-create-form {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.6fr) auto;
  align-items: end;
}
.admin-compact .payment-create-form > button {
  grid-column: auto;
  min-height: 42px;
}
.admin-compact .cash-totals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.admin-compact .cash-totals .stat-card {
  min-width: 0;
  padding: 12px;
}
.admin-compact .cash-totals .stat-value {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  font-size: clamp(18px, 2vw, 30px);
  margin: 6px 0 0;
}
.admin-compact .cash-totals .stat-reference {
  margin-top: 4px;
}
.admin-compact .filtered-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.admin-compact .filtered-total strong {
  color: #946422;
  font-size: 22px;
  white-space: nowrap;
}
.admin-compact .record-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin: 0 0 12px;
}
.admin-compact .record-fields > div {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.admin-compact .record-fields dt {
  color: var(--muted);
  font-size: 12px;
}
.admin-compact .record-fields dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}
.admin-compact .record-detail .menu {
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.admin-compact .allocation-detail {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.admin-compact .allocation-detail summary {
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 10px;
  justify-content: space-between;
}
.admin-compact .allocation-detail summary strong {
  white-space: nowrap;
}
.admin-compact .allocation-detail .menu {
  margin: 8px 0 0;
}
.admin-compact .caja-detalles-dia {
  margin-top: 14px;
  padding-top: 12px;
}
.admin-compact .caja-detalles-encabezado {
  margin-bottom: 8px;
}
.admin-compact .caja-detalle-panel > h3 {
  padding: 7px 9px;
}
.admin-compact .caja-detalle-tabla td {
  padding: 5px 8px !important;
  line-height: 1.3;
}
.admin-compact .caja-detalle-meta {
  margin-top: 1px;
}
.admin-compact .tabla-resumen-conceptos td,
.admin-compact .tabla-resumen-conceptos th {
  padding: 7px 9px;
}
@media (max-width: 1100px) {
  .admin-compact .payment-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-compact .payment-create-form > button {
    justify-self: stretch;
  }
}
@media (max-width: 767px) {
  .admin-compact .workspace {
    padding-left: 14px;
    padding-right: 14px;
  }
  .admin-compact .page-heading {
    gap: 10px;
    margin-bottom: 14px;
  }
  .admin-compact .page-heading .eyebrow {
    margin-bottom: 4px;
  }
  .admin-compact .page-heading h1 {
    margin-bottom: 4px;
  }
  .admin-compact .page-subtitle {
    line-height: 1.4;
  }
  .admin-compact .tarjeta {
    padding: 14px;
  }
  .admin-compact .page-content {
    gap: 12px;
  }
  .admin-compact .data-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    margin-top: 6px;
  }
  .admin-compact .data-form > .field {
    grid-column: 1/-1;
  }
  .admin-compact .data-form > .field:has(input[type="date"]),
  .admin-compact .data-form > .field:has(input[type="number"]) {
    grid-column: auto;
  }
  .admin-compact .data-form > .field:has(textarea),
  .admin-compact .data-form > .menu,
  .admin-compact .data-form > .dato,
  .admin-compact .data-form > .error,
  .admin-compact .data-form > button {
    grid-column: 1/-1;
  }
  .admin-compact .data-form .menu {
    padding-top: 8px;
  }
  .admin-compact input:not([type="checkbox"]):not([type="radio"]),
  .admin-compact select {
    min-height: 44px;
    font-size: 16px;
  }
  .admin-compact textarea {
    font-size: 16px;
    min-height: 58px;
  }
  .admin-compact .payment-create-form > button {
    min-height: 44px;
  }
  .admin-compact .compact-records th,
  .admin-compact .compact-records td {
    padding: 9px 6px !important;
    font-size: 12px;
  }
  .admin-compact .compact-records th {
    font-size: 10px;
  }
  .admin-compact .compact-records td .record-link {
    display: block;
    padding: 3px 0;
  }
  .admin-compact .compact-records td .record-link::after {
    content: " ›";
    color: var(--muted);
  }
  .admin-compact .compact-records .date {
    font-size: 11px;
  }
  .admin-compact .compact-records .money {
    font-size: 12px;
  }
  .admin-compact .compact-records td {
    overflow-wrap: break-word;
  }
  .admin-compact .members-table th:first-child,
  .admin-compact .members-table td:first-child,
  .admin-compact .members-table th:last-child,
  .admin-compact .members-table td:last-child {
    display: none;
  }
  .admin-compact .cash-totals {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .admin-compact .cash-totals .stat-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 10px;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 8px 0;
  }
  .admin-compact .cash-totals .stat-card:last-child {
    border: 0;
  }
  .admin-compact .cash-totals .stat-title {
    margin: 0;
  }
  .admin-compact .cash-totals .stat-value {
    margin: 0;
    font-size: 22px;
    grid-column: 2;
    grid-row: 1/3;
  }
  .admin-compact .cash-totals .stat-reference {
    margin: 0;
    font-size: 11px;
  }
  .admin-compact .record-fields {
    grid-template-columns: 1fr;
  }
  .admin-compact .record-fields > div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
  }
  .admin-compact .record-fields dd {
    margin: 0;
  }
  .admin-compact .tabla-matriz-pagos {
    table-layout: fixed;
    min-width: 0;
  }
  .admin-compact .tabla-matriz-pagos th,
  .admin-compact .tabla-matriz-pagos td {
    min-width: 72px;
    width: 72px;
    max-width: 72px;
    padding: 8px 4px;
    font-size: 10px;
  }
  .admin-compact .tabla-matriz-pagos .columna-usuario-matriz {
    min-width: 96px;
    width: 96px;
    max-width: 96px;
  }
  .admin-compact .concepto-pago-matriz {
    width: 64px;
    max-width: 64px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    margin: 3px auto;
  }
  .admin-compact .usuario-matriz-nombre {
    font-size: 10px;
  }
  .admin-compact .usuario-matriz-deuda,
  .admin-compact .usuario-matriz-saldo {
    font-size: 9px;
    margin-top: 2px;
  }
  .admin-compact .caja-detalle-tabla td {
    padding: 6px 8px !important;
  }
  .admin-compact .tabla-resumen-conceptos tbody tr {
    padding: 10px 0;
  }
  .admin-compact .tabla-resumen-conceptos tbody td {
    padding: 3px 0 !important;
  }
}
@media (max-width: 767px) {
  .admin-compact .data-form > .field:has(select[name="categoria"]),
  .admin-compact .data-form > .field:has(input[name="proveedor"]),
  .admin-compact .payment-create-form > .field:has(select[name="tipo_pago"]) {
    grid-column: auto;
  }
  .admin-compact .compact-records {
    table-layout: fixed;
  }
  .admin-compact .compact-records .record-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .admin-compact .payments-table th:first-child {
    width: 30px;
  }
  .admin-compact .payments-table th:last-child {
    width: 90px;
  }
  .admin-compact .contributions-table th:nth-child(2),
  .admin-compact .expenses-table th:first-child {
    width: 82px;
  }
  .admin-compact .contributions-table th:last-child,
  .admin-compact .expenses-table th:last-child {
    width: 90px;
  }
  .admin-compact .members-table th:nth-child(3) {
    width: 90px;
  }
}
@media (max-width: 767px) {
  .admin-compact .resumen-concepto-movil {
    gap: 5px 8px;
    margin-top: 7px;
  }
  .admin-compact .dato-resumen-concepto strong {
    margin-top: 2px;
  }
}

/* v2.3: compact participant matrix and shareable payment summaries. */
.admin-compact.seccion-estado .tabla-matriz-pagos th,
.admin-compact.seccion-estado .tabla-matriz-pagos td {
  padding: 5px 8px;
  line-height: 1.15;
}
.admin-compact.seccion-estado .usuario-matriz-nombre {
  line-height: 1.15;
}
.admin-compact.seccion-estado .usuario-matriz-deuda,
.admin-compact.seccion-estado .usuario-matriz-saldo {
  margin-top: 2px;
  line-height: 1.15;
}
.admin-compact.seccion-estado .concepto-pago-matriz {
  margin-top: 2px;
  margin-bottom: 2px;
  line-height: 1.2;
}
.family-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.family-actions .helper-text {
  text-align: right;
}
.admin-compact .export-note {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  margin: 8px 0 0;
}
.admin-compact .family-matrix > .export-note {
  margin: 0 0 8px;
}
.admin-compact .total-trabajos td {
  background: #e8f1e9;
  border-top: 2px solid #b3cdbb;
  color: #264b39;
  font-weight: 700;
}
@media (max-width: 767px) {
  .family-actions {
    justify-content: flex-start;
  }
  .family-actions .helper-text {
    display: none;
  }
  .admin-compact.seccion-estado .tabla-matriz-pagos th,
  .admin-compact.seccion-estado .tabla-matriz-pagos td {
    padding: 5px 4px;
  }
  .admin-compact .total-trabajos .resumen-concepto-movil {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 768px) {
  .admin-compact.seccion-estado .usuario-matriz-nombre {
    display: inline;
  }
  .admin-compact.seccion-estado .usuario-matriz-deuda {
    display: inline;
    margin-left: 6px;
    white-space: nowrap;
  }
  .admin-compact.seccion-estado .usuario-matriz-saldo {
    margin-top: 1px;
  }
}
/* Common-fund expenses: monthly history and exceptional outside funding. */
.expense-options {
  grid-column: 1/-1;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.expense-options > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}
.expense-options .field {
  margin-top: 10px;
}
.fund-month {
  border-bottom: 1px solid var(--line);
}
.fund-month > summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  font-weight: 600;
}
.fund-month > summary small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
}
.fund-month > summary strong {
  white-space: nowrap;
  color: var(--primary);
}
.fund-ledger {
  min-width: 0;
  width: 100%;
}
.fund-ledger small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.fund-ledger .date,
.fund-ledger .money {
  white-space: nowrap;
  width: 1%;
}
.fund-ledger .money {
  text-align: right;
}
.outside-expenses {
  margin-top: 16px;
}
.outside-expenses > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}
@media (max-width: 767px) {
  .fund-ledger th,
  .fund-ledger td {
    padding: 8px 5px;
    font-size: 11px;
  }
}
