:root {
  --bg: #e8ece9;
  --panel: #ffffff;
  --surface: #f7f9f7;
  --ink: #1c2420;
  --muted: #6b746e;
  --line: #d5dbd6;
  --line-strong: #c3cbc5;
  --brand: #1a5c4d;
  --brand-dark: #134438;
  --brand-soft: #eef5f2;
  --warn: #a16207;
  --danger: #b42318;
  --ok: #1f7a4d;
  --shadow: 0 18px 40px rgba(18, 28, 22, 0.08);
  --shadow-soft: 0 10px 28px rgba(18, 28, 22, 0.06);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  --radius: 18px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

/* —— App shell (premium) —— */
.app-body { position: relative; min-height: 100vh; overflow-x: hidden; }
.app-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(120deg, rgba(237,241,238,0.88) 0%, rgba(237,241,238,0.72) 42%, rgba(237,241,238,0.55) 100%),
    url("/assets/img/app-atmosphere.jpg") center / cover no-repeat;
  filter: saturate(1.05);
}
.sandbox-banner {
  position: relative;
  z-index: 45;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 14px;
  background: #f6e2a8;
  color: #5c4308;
  text-align: center;
  font-size: 13.5px;
  font-weight: 500;
  padding: 11px 20px;
  border-bottom: 1px solid #d4a82e;
}
.sandbox-banner__tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: #3d2e00;
  color: #ffe9a3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: help;
}
.impersonate-banner {
  position: relative;
  z-index: 45;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 14px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  text-align: center;
  font-size: 13.5px;
  font-weight: 500;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
}
.impersonate-banner__tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--brand-dark);
  color: var(--panel);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.impersonate-banner__form {
  margin: 0;
}
.impersonate-banner__back {
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.impersonate-banner__back:hover {
  color: var(--brand-dark);
}
.tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05em;
  height: 1.05em;
  margin-inline-start: 4px;
  border-radius: 999px;
  background: var(--brand-soft, #e7efe8);
  color: var(--brand, #2f5d3a);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
}
.sandbox-banner__text { color: #5c4308; }
.sandbox-banner__link {
  color: #3d2e00;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sandbox-banner__link:hover { color: var(--brand-dark); }
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  gap: 12px;
  padding: 12px 12px 12px 0;
}
.app-shell--sandbox { min-height: calc(100vh - 44px); }
.app-shell--impersonating { min-height: calc(100vh - 44px); }
.app-shell--topnav {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  gap: 0;
  padding: 0;
}
.app-shell--topnav > .sidebar {
  display: none;
}
.app-shell--topnav .topnav,
.app-shell--topnav .workspace {
  grid-column: 1 / -1;
}
.app-shell--topnav .workspace {
  background: transparent;
  padding: 0 0 28px;
}
.app-shell--topnav .workspace__panel {
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  min-height: calc(100vh - 52px);
}
.app-shell--topnav.app-shell--sandbox .workspace__panel {
  min-height: calc(100vh - 96px);
}
.app-shell--topnav .content {
  padding: 28px 32px 48px;
  max-width: none;
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 52px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topnav .nav-open { display: none; }
.topnav__brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.topnav__logo {
  display: block;
  width: 86px;
  height: auto;
}
.topnav__nav {
  display: flex;
  align-items: stretch;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.topnav__link {
  display: inline-flex;
  align-items: center;
  height: 52px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.topnav__link:hover,
.topnav__link.is-active,
.topnav__item.is-active > .topnav__link {
  color: var(--brand-dark);
  border-bottom-color: var(--brand);
}
.topnav__item {
  position: relative;
  display: flex;
  align-items: stretch;
}
.topnav__item > .topnav__link::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.45;
}
.topnav__sub {
  display: none;
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  min-width: 200px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  z-index: 50;
}
.topnav__sub a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 450;
}
.topnav__sub a:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.topnav__item:hover > .topnav__sub,
.topnav__item:focus-within > .topnav__sub {
  display: block;
}
.topnav__aside {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  margin-left: auto;
}
.topnav__who {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  color: var(--muted);
}
.topnav__quiet {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
}
.topnav__quiet:hover { color: var(--brand-dark); }
.topnav__logout {
  display: inline;
  margin: 0;
}
.topnav__logout button {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-dark);
  cursor: pointer;
}
.topnav__logout button:hover { text-decoration: underline; }
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 16, 0.4);
  z-index: 30;
}
.nav-backdrop[hidden] { display: none !important; }
.nav-open, .nav-close {
  display: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
}
.sidebar {
  background: rgba(244, 247, 245, 0.94);
  backdrop-filter: blur(18px) saturate(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
  border-right: 1px solid rgba(20, 40, 30, 0.07);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sidebar__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 8px;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  padding: 2px 4px 4px;
  opacity: 0.95;
}
.sidebar__logo {
  display: block;
  width: min(128px, 100%);
  height: auto;
}
.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  overflow-y: auto;
  padding-inline: 2px;
}
.sidebar__group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar__label {
  margin: 0 10px 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
}
.sidebar__group + .sidebar__group {
  padding-top: 16px;
  border-top: 1px solid rgba(20, 40, 30, 0.06);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  color: #4a554f;
  font-weight: 450;
  font-size: 14.5px;
  line-height: 1.2;
  transition: background .15s ease, color .15s ease;
}
.nav-link__icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: #7a8680;
  transition: color .15s ease;
}
.nav-link__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.nav-link__label { min-width: 0; }
.nav-link:hover {
  background: rgba(26, 92, 77, 0.05);
  color: var(--ink);
}
.nav-link:hover .nav-link__icon { color: var(--brand); }
.nav-link.is-active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 550;
}
.nav-link.is-active .nav-link__icon { color: var(--brand-dark); }
.sidebar__footer {
  border-top: 1px solid rgba(20, 40, 30, 0.06);
  padding-top: 14px;
  display: grid;
  gap: 8px;
}
.sidebar__user {
  padding: 0 6px;
}
.sidebar__user span { display: block; font-weight: 500; font-size: 13.5px; }
.sidebar__user small {
  color: var(--muted);
  text-transform: capitalize;
  font-weight: 400;
  font-size: 12px;
}

.workspace { min-width: 0; display: flex; }
.workspace__panel {
  flex: 1;
  background: transparent;
  overflow: visible;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 24px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.app-shell--sandbox .workspace__panel { min-height: calc(100vh - 60px); }
.topbar {
  padding: 14px 28px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 12px;
}
.topbar--minimal { padding-top: 10px; }
.topbar h1 {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.content {
  padding: 20px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 22px 24px;
}
.home-banner {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  min-height: 220px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.home-banner__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-banner__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(8,30,24,0.78) 0%, rgba(8,30,24,0.45) 55%, rgba(8,30,24,0.2) 100%);
}
.home-banner__copy {
  position: relative;
  z-index: 1;
  padding: 34px 32px;
  max-width: 560px;
}
.eyebrow { margin: 0 0 6px; color: #7d8a83; font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; }
.eyebrow--on-dark { color: rgba(255,255,255,0.72); }
.display {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.display--on-dark { color: #fff; font-weight: 500; }
.lede { margin: 0; color: var(--muted); max-width: 54ch; line-height: 1.55; font-weight: 400; font-size: 14.5px; }
.lede--on-dark { color: rgba(255,255,255,0.82); }
.display--page { font-size: clamp(24px, 3vw, 30px); font-weight: 500; }
.soft-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 22px 24px;
}
.soft-card__title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 500;
}
.inbox-list { display: grid; gap: 18px; margin-top: 14px; }
.inbox-item {
  padding: 16px 0;
  border-top: 1px solid rgba(20,40,30,0.06);
  display: grid;
  gap: 12px;
}
.inbox-item__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.inbox-item__email { font-weight: 500; }
.multi-select {
  width: 100%;
  min-height: 140px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: #fff;
}
.check-row--inline { margin-top: 0 !important; }

.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kpi-grid--dash {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.soft-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-soft);
}
.soft-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
.soft-panel__head a {
  color: var(--brand);
  font-size: 13.5px;
  font-weight: 500;
}
.soft-panel__title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 550;
}
.soft-panel__head .soft-panel__title { margin: 0; }
.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.dash-list li {
  display: grid;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(20, 40, 30, 0.06);
}
.dash-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dash-actions__hint {
  flex: 1 0 100%;
  margin: 0;
}
.dash-chart-panel { margin-bottom: 0; }
.dash-bars { display: grid; gap: 10px; }
.dash-bars__row {
  display: grid;
  grid-template-columns: 72px 1fr 40px;
  align-items: center;
  gap: 10px;
}
.dash-bars__label { font-size: 13px; color: var(--muted, #5c655f); }
.dash-bars__track {
  height: 10px;
  border-radius: 999px;
  background: rgba(20, 40, 30, 0.08);
  overflow: hidden;
}
.dash-bars__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  min-width: 0;
  transition: width 0.35s ease;
}
.dash-bars__fill--ok { background: #2f6b4f; }
.dash-bars__fill--warn { background: #b8860b; }
.dash-bars__fill--debt { background: #9a4a3a; }
.dash-bars__n { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
}

.month-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.month-tabs__item {
  display: grid;
  gap: 2px;
  min-width: 88px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
}
.month-tabs__item:hover { border-color: rgba(26, 92, 77, 0.35); }
.month-tabs__item.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px rgba(26, 92, 77, 0.25);
}
.month-tabs__item.is-abierto {
  background: #fff8e8;
  border-color: rgba(161, 98, 7, 0.28);
}
.month-tabs__item.is-cerrado {
  background: var(--brand-soft);
  border-color: rgba(26, 92, 77, 0.18);
}
.month-tabs__label { font-weight: 550; font-size: 14px; }
.month-tabs__meta {
  font-size: 11px;
  color: var(--muted);
  text-transform: capitalize;
}

/* Finance month desk — minimal ops surface */
.month-desk { margin-bottom: 8px; }
.month-desk__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.month-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.month-switcher__nav {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  font-weight: 500;
}
.month-switcher__nav:hover { background: var(--brand-soft); color: var(--brand-dark); }
.month-switcher__nav.is-disabled {
  opacity: 0.28;
  pointer-events: none;
}
.month-switcher__select select {
  min-width: 168px;
  border: 0;
  background: transparent;
  font-weight: 600;
  font-size: 16px;
  padding: 6px 4px;
  box-shadow: none;
}
.month-desk__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.month-desk__fact {
  font-size: 13.5px;
  color: var(--muted);
}
.month-desk__fact.is-warn { color: #8a5a00; font-weight: 550; }
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.kpi-strip--soft { margin: 12px 0 0; }
.kpi-strip__item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  gap: 2px;
}
.kpi-strip__item span {
  font-size: 12px;
  color: var(--muted);
}
.kpi-strip__item strong {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.kpi-strip__item em {
  font-style: normal;
  font-size: 12.5px;
  color: var(--muted);
}
.kpi-strip__item.is-warn {
  border-color: rgba(161, 98, 7, 0.3);
  background: #fff9ef;
}
.month-desk__tabs { margin-bottom: 0; }
.month-desk__panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.month-desk__panel[hidden] { display: none !important; }
.month-desk__more {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--muted);
}
.month-desk__more summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 500;
}
.table-toolbar--desk {
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.status-filters__btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}
.status-filters__btn span {
  margin-left: 4px;
  color: var(--ink);
  font-weight: 550;
}
.status-filters__btn.is-active {
  border-color: rgba(26, 92, 77, 0.4);
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.data-table--month .col-muted { opacity: 0.72; }

/* Client-style gastos comunes desk */
.gc-desk {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gc-desk__hero {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  justify-content: space-between;
  align-items: flex-start;
}
.gc-desk__title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.gc-desk__lede {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 52ch;
}
.gc-desk__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.gc-desk__tabs { margin-bottom: 0; }
.gc-desk__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.gc-month-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.gc-month-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 72px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.2;
}
.gc-month-pill span {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: lowercase;
}
.gc-month-pill.is-closed { border-color: rgba(26, 92, 77, 0.35); background: #eef8f3; }
.gc-month-pill.is-open { border-color: rgba(180, 120, 20, 0.4); background: #fff8eb; }
.gc-month-pill.is-active {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.gc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.gc-kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 84px;
  box-shadow: var(--shadow-soft);
}
.gc-kpi__lbl {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
  margin-bottom: 6px;
}
.gc-kpi__val {
  display: block;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.gc-kpi__sm {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
  font-style: normal;
}
.gc-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  box-shadow: var(--shadow-soft);
}
.gc-panel__title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
}
.gc-panel__subtitle {
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 600;
}
.gc-panel__hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.gc-panel__hint.is-warn { color: #8a5a00; }
.gc-panel__head { margin-bottom: 8px; }
.gc-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.gc-pill-input {
  width: 120px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 14px;
}
.gc-recon {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.gc-recon__item {
  background: var(--bg-soft, #f6f7f5);
  border-radius: 10px;
  padding: 10px 12px;
}
.gc-recon__item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.gc-recon__item strong {
  font-size: 15px;
  font-weight: 600;
}
.link-btn {
  border: 0;
  background: none;
  padding: 0 4px;
  color: var(--brand);
  font: inherit;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.data-table--dense td,
.data-table--dense th {
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 13px;
}
@media (max-width: 1100px) {
  .gc-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gc-recon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .gc-desk__toolbar { flex-direction: column; align-items: stretch; }
  .gc-desk__toolbar .month-switcher { width: 100%; }
}
@media (max-width: 640px) {
  .gc-kpi-grid { grid-template-columns: 1fr; }
  .gc-recon { grid-template-columns: 1fr; }
}

.linkish {
  border: 0;
  background: none;
  padding: 0;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font: inherit;
}
@media (max-width: 900px) {
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .month-switcher__select select { min-width: 140px; font-size: 15px; }
  .kpi-strip { grid-template-columns: 1fr 1fr; }
}
.inline-agua {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.inline-agua input {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
}

.parcel-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.parcel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 12px;
}
.parcel-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.parcel-card__num {
  margin: 0;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 550;
  letter-spacing: -0.02em;
}
.parcel-card__meta {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  text-transform: capitalize;
}
.parcel-card__stats {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.parcel-card__stats dt {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.parcel-card__stats dd {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 550;
}
.gc-egresos {
  margin-top: 16px;
}
.gc-confirm-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff8e8;
  border: 1px solid #e8c56a;
}
.gc-confirm-banner p {
  margin: 0;
  flex: 1 1 16rem;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
}
.cobro-lines {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}
.cobro-lines dt {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.cobro-lines dd {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 550;
}
.cobro-lines dd.is-debt,
.parcel-card__stats dd.is-debt,
td.is-debt { color: #9a3412; font-weight: 600; }
.cobro-lines dd.is-ok,
.parcel-card__stats dd.is-ok,
td.is-ok { color: var(--ok); }
.kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}
.kpi-card__label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.kpi-card__value { font-size: 22px; text-transform: capitalize; }
.kpi-card__value--plain { text-transform: none; }
.kpi-card__meta { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }

.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 10px 14px; cursor: pointer; color: var(--ink);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn { font-weight: 450; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ghost { background: transparent; }
.btn--block { width: 100%; }
.btn--lg { padding: 12px 16px; font-weight: 500; border-radius: 14px; }
.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn--primary:disabled,
.btn--primary[disabled]:hover {
  background: var(--brand);
}

.flash { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.flash--error { background: #fee4e2; color: var(--danger); }
.flash--success { background: #dcfae6; color: var(--ok); }

/* —— Login —— */
.auth-body { min-height: 100vh; margin: 0; }
.auth-stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: hidden;
}
.auth-hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.auth-hero__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(115deg, rgba(6,24,20,0.72) 0%, rgba(6,24,20,0.42) 48%, rgba(6,24,20,0.28) 100%),
    radial-gradient(900px 500px at 80% 20%, rgba(255,210,140,0.18), transparent 60%);
}
.auth-card {
  position: relative;
  z-index: 2;
  width: min(440px, 100%);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: 28px;
  padding: 34px 30px 30px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.28);
  animation: auth-rise .55s ease both;
}
@keyframes auth-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.auth-card__brand { margin-bottom: 18px; }
.auth-logo {
  display: block;
  width: min(220px, 70%);
  height: auto;
  margin-bottom: 0;
}
.auth-brand {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 34px);
  line-height: 1.12;
}
.auth-sub { margin: 0 0 22px; color: var(--muted); line-height: 1.55; }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.auth-form input {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(255,255,255,0.95);
}
.auth-form input:focus {
  outline: none;
  border-color: rgba(13,79,66,0.45);
  box-shadow: 0 0 0 4px rgba(13,79,66,0.12);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 22px 24px;
}
.panel--narrow { max-width: 640px; }
.panel__title { margin: 0 0 14px; font-size: 16px; }
.muted { color: var(--muted); margin: 0; }
.form-row {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: end;
}
.form-row label {
  display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600;
}
.form-row select {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  min-width: 220px; background: #fff; color: var(--ink);
}
.mail-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}
.mail-filters label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.mail-filters input,
.mail-filters select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  min-width: 0;
}
.mail-filters__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.mail-pager {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  font-size: 13.5px;
}
.mail-read {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.mail-read__frame {
  display: block;
  width: 100%;
  min-height: 640px;
  border: 0;
  background: #f3f6f4;
}
.panel__head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.display--sm { font-size: clamp(24px, 3vw, 32px); }

.filter-bar {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin: 0 0 16px;
  padding: 0 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.filter-bar__field { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.filter-bar__field input,
.filter-bar__field select,
.stack-form input,
.stack-form select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fff;
  width: 100%;
}
.filter-bar__actions { display: flex; gap: 8px; }

.stack-form { display: grid; gap: 14px; }
.stack-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.stack-form__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.field-hint { font-size: 12px; color: var(--muted); font-weight: 500; }
.is-hidden { display: none !important; }

.table-wrap { overflow-x: auto; }
.panel .table-wrap,
.table-shell .table-wrap { border: 0; border-radius: 0; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #f7faf8;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table strong { display: block; }
.data-table .meta { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.data-table__actions { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.inline-form { display: inline; margin: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.badge--privado_parcela { background: #fff4e5; color: var(--warn); }
.badge--interno_admin { background: #fee4e2; color: var(--danger); }

.btn--sm, .btn--small { padding: 7px 10px; border-radius: 10px; font-size: 13px; }
.btn--danger { background: #fff; border-color: #f3b0ab; color: var(--danger); }
.btn--danger:hover { background: #fee4e2; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  overflow: visible;
}
.page-head .display { margin-bottom: 6px; }
.page-head .lede { margin: 0; }
.page-head .eyebrow a { color: var(--brand); }
.page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.check-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--ink) !important;
  font-weight: 500 !important;
}
.check-row input { width: auto; }
.stack-form textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  resize: vertical;
  min-height: 90px;
  width: 100%;
}
.inline-form.inline-form--grid,
.inline-form--compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, max-content));
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.inline-form--compact .check-row { margin-top: 0; }
.inline-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.inline-form select,
.inline-form input[type="text"],
.inline-form input[type="email"],
.inline-form input[type="password"],
.inline-form input[type="number"] {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}
.badge--ok { background: #dcfae6; color: var(--ok); }
.badge--muted { background: #eef1ef; color: var(--muted); }
.badge--warn { background: #fff4e5; color: var(--warn); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-grid__full { grid-column: 1 / -1; }
.form-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.form-inline--compact input { width: 96px; padding: 8px 10px; }
.data-table--dense th, .data-table--dense td { padding: 8px 10px; }
.data-table input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  max-width: 110px;
}
.text-right { text-align: right !important; }
.muted { color: var(--muted); font-size: 13px; }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--muted);
  text-align: center;
}
.table-shell .empty-state {
  border: 0;
  padding: 18px 4px 10px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }
  .nav-open { display: inline-grid; place-items: center; }
  .nav-close { display: inline-grid; place-items: center; }
  .nav-backdrop { display: block; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 86vw);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: var(--shadow);
    border-right: 0;
  }
  .app-shell.is-nav-open .sidebar { transform: translateX(0); }
  .app-shell--topnav > .sidebar { display: flex; }
  .app-shell--topnav .topnav .nav-open { display: inline-grid; }
  .app-shell--topnav .topnav__nav { display: none; }
  .app-shell--topnav .topnav__who { display: none; }
  .app-shell--topnav .topnav__quiet { display: none; }
  .workspace__panel {
    min-height: 100vh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }
  .kpi-grid { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .home-banner { min-height: 200px; }
  .home-banner__copy { padding: 26px 22px; }
  .filter-bar { grid-template-columns: 1fr; }
  .panel__head { flex-direction: column; }
  .page-head { flex-direction: column; align-items: stretch; }
  .form-grid { grid-template-columns: 1fr; }
  .auth-stage { padding: 16px; align-items: end; }
  .auth-card { margin-bottom: 8px; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .table-search { max-width: none; }
  .data-table--air thead { display: none; }
  .data-table--air,
  .data-table--air tbody,
  .data-table--air tr,
  .data-table--air td { display: block; width: 100%; }
  .data-table--air tr {
    padding: 14px 0;
    border-bottom: 1px solid rgba(15,30,24,0.08);
  }
  .data-table--air td {
    border: 0;
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }
  .data-table--air td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .data-table--air td.actions-cell {
    justify-content: flex-end;
    padding-top: 10px;
  }
  .data-table--air td.actions-cell::before { content: none; }
  body.is-nav-open { overflow: hidden; }
}

/* —— Minimal tables —— */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.section-label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.card-stack {
  display: grid;
  gap: 12px;
}
.owner-month { margin-top: 0; }
.owner-month .soft-card__title { margin-bottom: 16px; }
.table-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 12px;
  box-shadow: var(--shadow-soft);
}
.table-shell > .soft-card__title { margin: 0 0 12px; }
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.table-toolbar .soft-card__title { margin: 0; }
.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 360px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0 12px;
  box-shadow: 0 1px 2px rgba(18, 28, 22, 0.04);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.table-search:hover {
  border-color: #aeb8b2;
}
.table-search:focus-within {
  border-color: rgba(26, 92, 77, 0.45);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 92, 77, 0.12);
}
.table-search input {
  border: 0;
  background: transparent;
  padding: 11px 0;
  width: 100%;
  color: var(--ink);
  outline: none;
}
.table-search input::placeholder { color: #8a948e; }
.table-meta { margin: 0; color: var(--muted); font-size: 13px; white-space: nowrap; }
.table-scroll {
  overflow-x: auto;
  background: #fff;
  border: 1px solid rgba(20, 40, 30, 0.06);
  border-radius: 12px;
}
.data-table--air {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
}
.data-table--air th,
.data-table--air td {
  padding: 15px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 30, 24, 0.07);
  vertical-align: middle;
  background: transparent;
  font-size: 14px;
}
.data-table--air th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7f8983;
  font-weight: 500;
  padding-top: 12px;
  padding-bottom: 12px;
  background: rgba(243, 246, 244, 0.95);
}
.data-table--air th.is-sortable { cursor: pointer; user-select: none; }
.data-table--air th.is-sortable:hover { color: var(--brand); }
.data-table--air th[data-dir="asc"]::after { content: " ↑"; font-weight: 400; }
.data-table--air th[data-dir="desc"]::after { content: " ↓"; font-weight: 400; }
.data-table--air tbody tr:hover td { background: rgba(26, 92, 77, 0.035); }
.data-table--air tbody tr:last-child td { border-bottom: 0; }
.data-table--air tfoot th {
  text-align: start;
  font-weight: 600;
  border-top: 1px solid var(--line-strong);
}
.data-table--air strong { font-weight: 500; }
.cell-muted { color: var(--muted); font-weight: 400; font-size: 13.5px; }
.cell-name { font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(26,92,77,0.07);
  color: #3d5c52;
  border: 0;
  white-space: nowrap;
}
.chip--muted { background: rgba(20,30,24,0.035); color: var(--muted); border-color: transparent; }
.chip.chip--sin-pago { background: #fee2e2; color: #dc2626; }
.chip.chip--parcial { background: #fef3c7; color: #d97706; }
.chip.chip--pagado { background: #dcfce7; color: #16a34a; }
.chip.chip--a-favor { background: #dbeafe; color: #1d4ed8; }
.chip.chip--tipo-con { background: #dbeafe; color: #1d4ed8; }
.chip.chip--tipo-sin { background: #f1f5f9; color: #475569; }

.data-table--gc th,
.data-table--gc td {
  padding: 6px 8px;
  font-size: 12.5px;
  white-space: nowrap;
}
.data-table--gc th {
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 10.5px;
}
.data-table--air th.num,
.data-table--air td.num,
.data-table--dense th.num,
.data-table--dense td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.data-table--gc td.num,
.data-table--gc th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.data-table--gc .cell-muted { font-size: 12px; }
.data-table--gc .chip { font-size: 11px; }
@media (max-width: 900px) {
  .data-table--gc td { white-space: normal; }
}

.icon-btn {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover,
.icon-btn:focus-visible {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.icon-btn svg { display: block; }
.soft-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 450;
  color: var(--muted);
}
.soft-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}
.soft-status.is-on { color: var(--ok); }
.soft-status.is-on::before { opacity: 1; }
.soft-status.is-off { color: var(--muted); }
.actions-cell { width: 1%; white-space: nowrap; }
.actions-cell form { display: inline; }
.row-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: #7d8a82;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover {
  background: rgba(13, 79, 66, 0.07);
  color: var(--brand-dark);
}
.row-actions .inline-form { display: inline-flex; margin: 0; }
.empty-cell { color: var(--muted); padding: 28px 10px !important; }

/* —— Cartola —— */
.cartola-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.cartola-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface, #fff);
}
.cartola-stat__label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.cartola-stat strong { font-size: 22px; font-weight: 600; }
.cartola-stat__ok { color: var(--ok); }
.cartola-stat__warn { color: var(--warn); }
.cartola-desc {
  display: inline-block;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.cartola-assign {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.cartola-assign--stack {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.cartola-assign select {
  min-width: 110px;
  padding: 6px 8px;
  font-size: 13px;
}
.cartola-assign--stack select { min-width: 100%; width: 100%; }
.cartola-assign__other {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1 1 12rem;
}
.cartola-assign__other[hidden] { display: none; }
.cartola-assign__other input {
  flex: 1 1 8rem;
  min-width: 0;
  padding: 6px 8px;
  font-size: 13px;
}
.cartola-ignore { display: inline-flex; margin-top: 4px; }
.cartola-monto-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cartola-monto {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 140px;
}
.cartola-monto__prefix {
  color: var(--muted, #5c655f);
  font-size: 13px;
}
.cartola-monto input {
  width: 100%;
  min-width: 88px;
  padding: 6px 8px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line, rgba(20,40,30,0.14));
  border-radius: 8px;
  background: #fff;
}
.cartola-monto input:focus {
  outline: 2px solid rgba(47, 107, 79, 0.25);
  border-color: #2f6b4f;
}
.cartola-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.cartola-pq-owner { font-weight: 550; }
#parcela-quick-dialog .stack-form { gap: 12px; }
#parcela-quick-dialog textarea { width: 100%; }
.cartola-pending-block {
  border-color: rgba(180, 110, 20, 0.35);
  background: rgba(184, 134, 11, 0.06);
}
.cartola-pending-block .panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.panel--warn.cartola-pending-block .panel__head h2 { margin: 0; }
.cartola-row--ignored { opacity: 0.65; }
.cartola-upload input[type="file"] { margin-top: 6px; }

@media (max-width: 900px) {
  .cartola-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cartola-desc { max-width: 180px; }
}

/* —— Tabs / config / notices —— */
.seg-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 4px 0 18px;
  background: rgba(20, 40, 30, 0.04);
  border-radius: 12px;
}
.seg-tabs__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 450;
  text-decoration: none;
}
.seg-tabs__item:hover { color: var(--ink); }
.seg-tabs__item.is-active {
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(15, 30, 24, 0.06);
}
.seg-tabs__count {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.seg-tabs__count.is-warn {
  color: #8a5a00;
  background: #fff3d6;
  padding: 2px 6px;
  border-radius: 999px;
}
.seg-tabs__item.is-active .seg-tabs__count { color: var(--brand); }
.seg-tabs__item.is-active .seg-tabs__count.is-warn { color: #8a5a00; }

.config-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px 20px;
  box-shadow: var(--shadow-soft);
}
.config-panel__intro { margin-bottom: 16px; }
.config-panel__title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 550;
}
.config-add {
  margin: 0 0 18px;
  padding: 0 0 18px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.field-label {
  display: block;
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 450;
}
.field-hint {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.field-hint a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

.smtp-probe {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.smtp-probe__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.smtp-probe__title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 550;
}
.smtp-probe__lede {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  max-width: 52ch;
}
.smtp-probe__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}
.smtp-probe__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  min-width: 0;
}
.smtp-probe__field input {
  width: 100%;
  min-width: 0;
}
.smtp-probe__result {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fafafa;
}
.smtp-probe__result.is-ok {
  border-color: rgba(26, 92, 77, 0.28);
  background: #f3faf6;
}
.smtp-probe__result.is-fail {
  border-color: rgba(180, 50, 40, 0.28);
  background: #fff5f4;
}
.smtp-probe__result-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.smtp-probe__meta {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.smtp-probe__result-msg {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.45;
}
.smtp-probe__facts {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px 14px;
  font-size: 13px;
}
.smtp-probe__facts span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 1px;
}
.smtp-probe__debug {
  margin-top: 8px;
  font-size: 13px;
}
.smtp-probe__debug summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 500;
}
.smtp-probe__debug pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #1c2420;
  color: #e8efe9;
  font-size: 11.5px;
  line-height: 1.4;
  overflow: auto;
  max-height: 220px;
  white-space: pre-wrap;
  word-break: break-word;
}
@media (max-width: 640px) {
  .smtp-probe__form { grid-template-columns: 1fr; }
  .smtp-probe__form .btn { width: 100%; }
}

.inline-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff8e8;
  color: #6d5320;
  font-size: 13.5px;
}
.is-hidden { display: none !important; }
.btn--sm { padding: 6px 10px; font-size: 13px; border-radius: 9px; }

.sandbox-callout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  align-items: stretch;
  padding: 18px 18px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  margin-bottom: 4px;
}
.sandbox-callout.is-on {
  border-color: rgba(161, 98, 7, 0.35);
  background: linear-gradient(135deg, #fff9ef 0%, #fff 55%);
}
.sandbox-callout.is-off {
  border-color: var(--line);
  background: #fff;
}
.sandbox-callout__eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.sandbox-callout.is-on .sandbox-callout__eyebrow { color: #8a5a00; }
.sandbox-callout__title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 550;
}
.sandbox-callout__text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 46ch;
}
.sandbox-callout__form {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(20, 40, 30, 0.08);
}
.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch__ui {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #c5cdc8;
  position: relative;
  flex: 0 0 auto;
  transition: background .15s ease;
}
.switch__ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: transform .15s ease;
}
.switch input:checked + .switch__ui {
  background: var(--brand);
}
.switch input:checked + .switch__ui::after {
  transform: translateX(20px);
}
.switch__label {
  font-weight: 600;
  font-size: 14.5px;
}

.parcela-picker {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
}
.parcela-picker__selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  margin-bottom: 8px;
}
.parcela-picker__empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.parcela-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12.5px;
  font-weight: 500;
}
.parcela-picker__panel {
  border-top: 1px solid rgba(20, 40, 30, 0.06);
  padding-top: 8px;
}
.parcela-picker__summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--brand-dark);
  user-select: none;
}
.parcela-picker__summary::-webkit-details-marker { display: none; }
.parcela-picker__count {
  min-width: 22px;
  text-align: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(20, 40, 30, 0.06);
  font-size: 12px;
  color: var(--muted);
}
.parcela-picker__body { margin-top: 10px; }
.parcela-picker__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.parcela-picker__search {
  flex: 1;
  min-width: 140px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}
.parcela-picker__list {
  display: grid;
  gap: 2px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  background: var(--surface);
}
.parcela-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13.5px;
  cursor: pointer;
}
.parcela-option:hover { background: rgba(26, 92, 77, 0.06); }
.parcela-option input { margin: 0; }
.inbox-card {
  padding: 16px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  display: grid;
  gap: 10px;
  margin-bottom: 0;
}
.inbox-list .inbox-card:first-child {
  border-top: 0;
  padding-top: 0;
}
.inbox-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
@media (max-width: 900px) {
  .sandbox-callout { grid-template-columns: 1fr; }
}

.notice-list { display: grid; gap: 14px; margin-top: 8px; }
.notice-item {
  padding: 14px 0;
  border-top: 1px solid rgba(20, 40, 30, 0.06);
}
.notice-item:first-child { border-top: 0; padding-top: 0; }
.notice-item__meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}
.notice-item__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 550;
}
.notice-item__body {
  margin: 0 0 8px;
  color: #3f4a44;
  line-height: 1.55;
  white-space: pre-wrap;
}
.notice-item__files {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.notice-item__files a {
  color: var(--brand);
  font-weight: 550;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.notice-item__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

/* —— Cobranza composer + confirm dialog —— */
.compose-page__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.compose-page__eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
}
.compose-page__eyebrow a { color: var(--brand); text-decoration: none; font-weight: 500; }
.compose-page__eyebrow a:hover { text-decoration: underline; }
.compose-form { display: grid; gap: 4px; }
.compose-tabs { margin: 0 0 14px; }
.compose-tabs .seg-tabs__item {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.compose-panel { margin-bottom: 14px; }
.compose-banner {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
}
.compose-banner--ok {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.compose-banner--warn {
  background: #fff3d6;
  color: #8a5a00;
}
.compose-preview__empty {
  margin: 0;
  padding: 18px 4px 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.compose-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: start;
}
.compose-preview {
  position: sticky;
  top: 16px;
}
.compose-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
}
.compose-pager__nav {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.compose-pager__nav:hover:not(:disabled) {
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.compose-pager__nav:disabled {
  opacity: 0.28;
  cursor: default;
}
.compose-pager__jump {
  flex: 1 1 140px;
  min-width: 0;
}
.compose-pager__jump select {
  width: 100%;
  margin: 0;
}
.compose-pager__pos {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.compose-preview__hint { margin-top: 0; }
.informe {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
}
.informe__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.informe__top .display--page {
  margin: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.informe__top .month-switcher {
  width: auto;
  max-width: 100%;
}
.informe-stack {
  display: grid;
  gap: 14px;
  width: 100%;
}
.informe-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-soft);
}
.informe-card--intro {
  padding-block: 20px;
}
.informe-card__h {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.informe-doc__period {
  margin: 0;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 560;
  letter-spacing: -0.02em;
  text-transform: capitalize;
  color: var(--ink);
}
.informe-doc__source {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.informe-doc__kv {
  margin: 0;
  display: grid;
}
.informe-doc__kv > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.informe-doc__kv > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.informe-doc__kv > div:first-child {
  padding-top: 0;
}
.informe-doc__kv dt {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
}
.informe-doc__kv dd {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 12px;
}
.informe-doc__nota {
  font-weight: 400;
  font-size: 15px;
  color: var(--ink);
}
.informe-doc__quiet {
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}
.informe-doc__empty {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}
.informe-doc__empty--after-title {
  margin-top: 10px;
}
.informe-doc__table {
  width: 100%;
  border-collapse: collapse;
}
.informe-doc__table th,
.informe-doc__table td {
  padding: 12px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.informe-doc__table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
}
.informe-doc__table th.num,
.informe-doc__table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-inline-start: 16px;
}
.informe-doc__item {
  display: block;
  font-weight: 550;
}
.informe-doc__bank {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}
.informe-doc__table tfoot th,
.informe-doc__table tfoot td {
  border-bottom: 0;
  padding-top: 14px;
  font-weight: 650;
}
@media (max-width: 900px) {
  .informe-card { padding: 18px 16px; }
  .informe-doc__table thead { display: none; }
  .informe-doc__table,
  .informe-doc__table tbody,
  .informe-doc__table tfoot,
  .informe-doc__table tr,
  .informe-doc__table td,
  .informe-doc__table th { display: block; width: 100%; }
  .informe-doc__table td,
  .informe-doc__table tfoot th {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 0;
    padding: 4px 0;
  }
  .informe-doc__table tbody tr,
  .informe-doc__table tfoot tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .informe-doc__table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .informe-doc__table td.num { padding-inline-start: 0; }
}
.cartola-nota {
  display: grid;
  gap: 6px;
}
.cartola-nota input {
  min-width: 0;
  font-size: 13px;
}
.compose-field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13.5px;
}
.compose-field input,
.compose-field select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fff;
  width: 100%;
  font: inherit;
}
.compose-field .field-hint {
  font-weight: 400;
}
.compose-field textarea {
  min-height: 280px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}
.compose-vars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}
.compose-vars__chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--brand-dark);
  cursor: pointer;
}
.compose-vars__chip:hover {
  border-color: rgba(26, 92, 77, 0.4);
  background: var(--brand-soft);
}
.compose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.compose-recipients {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}
.compose-recipients li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(20, 40, 30, 0.06);
}
.compose-recipients em {
  font-style: normal;
  color: var(--muted);
  white-space: nowrap;
}
.mail-preview {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #f3f6f4;
}
.mail-preview__chrome {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.mail-preview__brand {
  background: var(--brand);
  padding: 14px 18px;
}
.mail-preview__brand img {
  display: block;
  height: 40px;
  width: auto;
  object-fit: contain;
}
.mail-preview__body {
  background: #fff;
  padding: 18px 18px 8px;
}
.mail-preview__eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.mail-preview__subject {
  margin: 0 0 14px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.25;
}
.mail-preview__content p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.mail-preview__cta {
  display: inline-block;
  margin: 4px 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
}
.mail-preview__foot {
  padding: 12px 18px;
  background: var(--brand-soft);
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.app-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: calc(100vw - 32px);
}
.app-dialog::backdrop {
  background: rgba(18, 28, 22, 0.45);
  backdrop-filter: blur(2px);
}
.app-dialog__card {
  width: min(420px, 100%);
  margin: auto;
  padding: 22px 22px 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 48px rgba(18, 28, 22, 0.18);
}
.app-dialog__card--wide {
  width: min(36rem, 100%);
  max-height: min(90vh, 44rem);
  overflow: auto;
}
#cartola-confirm-dialog .app-dialog__card {
  width: min(28rem, 100%);
}
.app-dialog__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}
.app-dialog__text {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}
.app-dialog__text--body {
  color: var(--ink);
  white-space: pre-wrap;
}
.btn-with-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.help-tip {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  cursor: help;
}
.help-tip:hover,
.help-tip:focus-visible {
  color: var(--brand-dark);
  border-color: var(--brand);
}
.tip-bubble {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: max-content;
  max-width: min(18rem, calc(100vw - 32px));
  padding: 10px 12px;
  border-radius: 10px;
  background: #1c2a24;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 12px 28px rgba(18, 28, 22, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
}
.btn-with-tip:nth-child(2) .tip-bubble {
  left: auto;
  right: 0;
}
.btn-with-tip:hover .tip-bubble,
.btn-with-tip:focus-within .tip-bubble {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.cell-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  letter-spacing: -0.01em;
}
.cell-link:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.app-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
@media (max-width: 960px) {
  .compose-grid { grid-template-columns: 1fr; }
  .compose-preview { position: static; }
}

/* —— Owner pay / debt —— */
.owner-debt-list {
  display: grid;
  gap: 18px;
}
.owner-debt-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px 24px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}
.owner-debt-card__main {
  flex: 1 1 16rem;
  min-width: 0;
}
.owner-debt-card__title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.owner-debt-card__meta {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
}
.owner-debt-card__saldo {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 650;
}
.owner-debt-card__saldo.is-debt { color: #9a3412; }
.owner-debt-card__saldo.is-ok { color: var(--ok); }
.pay-dialog__card { width: min(520px, 100%); }
.stack-form input[type="file"] {
  font-weight: 500;
  padding: 6px 0;
}
.pay-bank {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--brand-soft);
  border: 1px solid rgba(26, 92, 77, 0.18);
}
.pay-bank div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  font-size: 14px;
}
.pay-bank span { color: var(--muted); }
.pay-bank strong { font-weight: 600; word-break: break-word; }
.pay-bank__notes {
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f8f7;
  border: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  font-family: inherit;
  color: var(--muted);
}

/* —— Mobile polish (phones / small tablets) —— */
@media (max-width: 900px) {
  .content {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .topbar--minimal {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(247, 249, 247, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin: 0 -16px;
    padding-left: 12px;
    padding-right: 12px;
    border-bottom: 1px solid rgba(20, 40, 30, 0.06);
  }
  .display--page { font-size: clamp(22px, 6vw, 28px); }
  .lede { font-size: 14.5px; }
  .dash-actions,
  .stack-form__actions,
  .compose-actions,
  .app-dialog__actions {
    width: 100%;
  }
  .dash-actions .btn,
  .stack-form__actions .btn,
  .compose-actions .btn,
  .page-head .btn {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }
  .seg-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: -4px;
    margin-right: -4px;
    padding: 0 4px 4px;
  }
  .seg-tabs::-webkit-scrollbar { display: none; }
  .seg-tabs__item {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .status-filters {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .status-filters__btn { flex: 0 0 auto; white-space: nowrap; }
  .month-desk__top {
    flex-direction: column;
    align-items: stretch;
  }
  .month-switcher { width: 100%; justify-content: space-between; }
  .month-switcher__select { flex: 1; min-width: 0; }
  .month-switcher__select select { width: 100%; min-width: 0; }
  .month-desk__meta { justify-content: flex-start; }
  .kpi-strip__item strong { font-size: 17px; }
  .sandbox-callout {
    grid-template-columns: 1fr;
  }
  .sandbox-callout__form {
    display: grid;
    gap: 10px;
  }
  .parcel-cards {
    grid-template-columns: 1fr !important;
  }
  .owner-debt-card {
    flex-direction: column;
    align-items: stretch;
  }
  .owner-debt-card .btn { width: 100%; }
  .inline-agua {
    width: 100%;
    flex-wrap: wrap;
  }
  .inline-agua input {
    flex: 1 1 90px;
    max-width: none;
    min-width: 0;
  }
  .table-shell { padding: 12px 12px 6px; border-radius: 14px; }
  .table-scroll {
    border: 0;
    background: transparent;
    overflow: visible;
  }
  /* Card layout for any labeled data table */
  .data-table thead { display: none; }
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td { display: block; width: 100%; }
  .data-table tr {
    padding: 12px 0;
    border-bottom: 1px solid rgba(15, 30, 24, 0.08);
  }
  .data-table td {
    border: 0;
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
  }
  .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex: 0 0 auto;
    max-width: 42%;
  }
  .data-table td.actions-cell,
  .data-table td:not([data-label]) {
    justify-content: flex-end;
  }
  .data-table td.actions-cell::before,
  .data-table td:not([data-label])::before { content: none; }
  .pay-dialog__card,
  .app-dialog__card {
    width: min(100vw - 24px, 480px);
    max-height: calc(100vh - 32px);
    overflow: auto;
  }
  .pay-bank div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .form-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px;
  }
  .form-row .btn { width: 100%; }
  .config-panel,
  .soft-panel { padding: 14px; }
  .btn { min-height: 44px; }
  .nav-open, .nav-close { min-width: 44px; min-height: 44px; }
}

@media (max-width: 640px) {
  .auth-stage {
    align-items: end;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .auth-card {
    padding: 22px 18px 18px;
    border-radius: 22px;
    width: 100%;
  }
  .auth-brand { font-size: 26px; }
  .auth-logo { width: min(180px, 64%); }
  .kpi-strip { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-strip__item { padding: 10px 12px; }
  .month-tabs { display: none; } /* desk uses select switcher */
  .workspace__panel { border-radius: 0; }
  .flash { font-size: 14px; }
  input, select, textarea { font-size: 16px !important; } /* avoid iOS zoom */
}

@media (max-width: 380px) {
  .kpi-strip { grid-template-columns: 1fr; }
  .chip { font-size: 11px; }
}
