:root {
  --bg: #e7f3e6;
  --bg-2: #f3faf2;
  --ink: #14301a;
  --muted: #4f6a52;
  --line: rgba(20, 48, 26, 0.12);
  --panel: #ffffff;
  --brand: #236c34;
  --brand-2: #2a7f3e;
  --brand-deep: #1a5228;
  --brand-dark: #134520;
  --brand-bright: #50b848;
  --th-bg: #2f8040;
  --th-fg: #ffffff;
  --mega: #ffe600;
  --petal-pink: #e91e8c;
  --petal-orange: #f5a623;
  --petal-cyan: #00bcd4;
  --accent: #f5a623;
  --ok: #2f8f3a;
  --warn: #d4b400;
  --err: #c62828;
  --shadow: 0 18px 40px rgba(31, 110, 50, 0.12);
  --radius: 18px;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Nunito", "Manrope", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  overflow: hidden;
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}
.app[hidden],
#site-footer[hidden],
.login-gate[hidden],
.rail-user[hidden] {
  display: none !important;
}

.rail {
  padding: 0.7rem 0.85rem 1.15rem;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--brand);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  position: sticky;
  top: 0;
}

.brand {
  margin: 0 auto;
  width: 128px;
  max-width: 100%;
  flex-shrink: 0;
  line-height: 0;
}
.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 14px;
  box-shadow:
    0 0 0 2px #fff,
    0 8px 18px rgba(0, 0, 0, 0.16);
  background: var(--brand-bright);
}
.brand-sgi {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  color: var(--mega);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}
.brand-sub {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.88;
  line-height: 1.3;
  max-width: 16ch;
  margin: 0 auto;
}

.nav { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.nav-item {
  appearance: none;
  border: 0;
  text-align: left;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  cursor: pointer;
  opacity: 0.82;
  transition: background 160ms ease, opacity 160ms ease, transform 160ms ease;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
}
.nav-icon {
  flex-shrink: 0;
  opacity: 0.92;
}
.nav-item-label {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.nav-item:hover { opacity: 1; background: rgba(255,255,255,0.12); }
.nav-item.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 3px 0 0 var(--mega);
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.nav-group[hidden] { display: none !important; }
.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}
.nav-group-toggle .nav-chevron {
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform 160ms ease;
  margin-left: auto;
}
.nav-group.is-open > .nav-group-toggle .nav-chevron {
  transform: rotate(180deg);
}
.nav-group.is-open > .nav-group-toggle,
.nav-group.has-active > .nav-group-toggle {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}
.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.15rem 0 0.15rem 0.55rem;
}
.nav-sub[hidden] { display: none !important; }
.nav-sub-item {
  padding: 0.55rem 0.75rem;
  font-size: 0.92rem;
  font-weight: 600;
  opacity: 0.78;
}
.nav-group-nested {
  gap: 0.1rem;
}
.nav-group-nested > .nav-group-toggle.nav-sub-item {
  width: 100%;
}
.nav-group-nested > .nav-sub {
  padding-left: 0.85rem;
}

.rail-foot {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.7;
  line-height: 1.4;
}

.site-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0.55rem 1.25rem;
  background: #2f8040;
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.footer-copy {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.footer-copy #footer-year {
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  color: inherit;
}

.main {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0 1.75rem 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.top {
  position: relative;
  z-index: 30;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin: 0 -1.75rem;
  padding: 1.35rem 1.75rem 1rem;
  background: #2f8040;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.top-leading {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 auto;
}
.top-leading > div {
  min-width: 0;
}
.btn-nav-toggle {
  display: none;
  flex-shrink: 0;
  margin-top: 0.05rem;
}
.rail-backdrop {
  display: none;
}

.view {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 1.15rem 0 2rem;
}
.view[hidden] {
  display: none !important;
}
.view:has(> .panel > .table-wrap) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.75rem 0 0.65rem;
  min-height: 0;
}
.view:has(> .panel > .table-wrap) > .panel {
  /* No estirar el panel: el pager queda pegado a la última fila */
  flex: 0 1 auto;
  min-height: 0;
  max-height: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.view:has(> .panel > .table-wrap) > .panel > .table-wrap {
  flex: 0 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  padding-bottom: 0;
}
.view:has(> .panel > .table-wrap) > .panel > .pager {
  flex-shrink: 0;
}
.view:has(> .panel > .table-wrap) tbody td {
  white-space: nowrap;
  vertical-align: middle;
}
.view:has(> .panel > .table-wrap) .puestos-cell {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Densidad unificada (referencia: DATOS DE SOCIOS / PUESTOS) */
.panel .table-wrap table {
  font-size: 0.86rem;
}
.panel .table-wrap table th,
.panel .table-wrap table td {
  padding: 0.38rem 0.9rem;
  line-height: 1.25;
  vertical-align: middle;
  border-right: 1px solid rgba(20, 48, 26, 0.16);
}
.panel .table-wrap table th:first-child,
.panel .table-wrap table td:first-child {
  padding-left: 1.05rem;
}
.panel .table-wrap table th:last-child,
.panel .table-wrap table td:last-child {
  padding-right: 1.05rem;
  border-right: 0;
}
.panel .table-wrap table thead th {
  font-size: 0.68rem;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
  border-right-color: rgba(255, 255, 255, 0.28);
}
#view-roles .table-wrap table thead th,
#view-areas .table-wrap table thead th,
#view-usuarios .table-wrap table thead th,
#view-sync .table-wrap table thead th {
  text-align: center;
}
#view-roles .table-wrap .th-sort-btn,
#view-areas .table-wrap .th-sort-btn,
#view-usuarios .table-wrap .th-sort-btn,
#view-sync .table-wrap .th-sort-btn {
  justify-content: center;
  width: 100%;
}
.panel .table-wrap .th-sortable {
  padding: 0;
}
.panel .table-wrap .th-sort-btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.68rem;
}
.panel .table-wrap .puesto-chip {
  margin: 0.08rem 0.18rem 0.08rem 0;
  padding: 0.14rem 0.48rem;
  font-size: 0.76rem;
  line-height: 1.25;
}
.panel .table-wrap .badge {
  padding: 0.12rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.25;
}
.view:has(> .panel > .table-wrap) .panel-head {
  padding-top: 0.7rem;
  padding-bottom: 0.85rem;
}
.view:has(> .panel > .table-wrap) > .panel > .table-wrap {
  margin-top: 0.1rem;
}
.top h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.2rem, 1.8vw, 1.55rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
.muted { margin: 0.35rem 0 0; color: var(--muted); }
.top .muted {
  color: rgba(255, 255, 255, 0.88);
}
.top-actions { display: flex; gap: 0.6rem; align-items: center; }
.top .btn-icon {
  background: #fff;
  color: var(--brand-deep);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.top .btn-icon:hover {
  background: #f4fff9;
  color: var(--brand-dark);
}

.btn {
  appearance: none;
  border: 1px solid rgba(31, 110, 50, 0.22);
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  background: rgba(31, 110, 50, 0.08);
  border-color: rgba(31, 110, 50, 0.35);
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
  box-shadow: none;
}
.btn-primary {
  background: var(--brand);
  color: #f4fff9;
  border-color: transparent;
}
.btn-primary:hover {
  background: var(--brand-2);
  color: #fff;
}
.btn-icon {
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand);
  border-color: transparent;
  color: #f4fff9;
}
.btn-icon:hover {
  background: var(--brand-2);
  color: #fff;
}
.btn-icon .icon-refresh,
.btn-icon .icon-search {
  display: block;
  flex-shrink: 0;
}
#btn-refresh.is-spinning .icon-refresh {
  animation: refresh-spin 0.7s linear;
}
@keyframes refresh-spin {
  to { transform: rotate(360deg); }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(31, 110, 50, 0.12);
  color: var(--brand);
}
.pill.ok { background: rgba(31, 110, 50, 0.12); color: var(--brand); }
.pill.warn { background: rgba(166, 124, 0, 0.14); color: var(--warn); }
.pill.err { background: rgba(163, 59, 43, 0.12); color: var(--err); }

.view { animation: rise 280ms ease; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 6px);
  padding: 0;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(61, 158, 58, 0.94) 0%, rgba(42, 122, 44, 0.9) 55%, rgba(29, 92, 34, 0.92) 100%);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  min-height: 168px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 88% 20%, rgba(255, 230, 0, 0.22), transparent 28%),
    radial-gradient(circle at 78% 78%, rgba(233, 30, 140, 0.18), transparent 26%),
    radial-gradient(circle at 92% 70%, rgba(0, 188, 212, 0.2), transparent 24%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1.35rem 1.75rem;
  padding: 1.15rem 1.4rem 1.15rem 1.15rem;
}
.hero-logo {
  width: min(148px, 34vw);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 20px;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.35),
    0 12px 28px rgba(0, 0, 0, 0.18);
}
.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.hero-sgi {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mega);
}
.hero-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.hero-title-mega {
  display: block;
  margin-top: 0.12rem;
  color: var(--mega);
  font-size: 0.72em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero-lead {
  margin: 0.45rem 0 0;
  max-width: 36ch;
  opacity: 0.92;
  line-height: 1.45;
  font-size: 0.98rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.grid.grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: 0 8px 22px rgba(31, 110, 50, 0.07);
  min-width: 0;
  overflow: hidden;
  container-type: inline-size;
  container-name: stat;
}
.stat-btn {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: #fff;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.stat-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(31, 110, 50, 0.1);
  border-color: rgba(31, 110, 50, 0.35);
  background: #fff;
}
.stat-btn.is-open {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(31, 110, 50, 0.18), 0 8px 22px rgba(31, 110, 50, 0.07);
  background: #fff;
}
.dash-detail {
  margin-top: 0.35rem;
  animation: rise 240ms ease;
  min-width: 0;
  max-width: 100%;
}
.dash-detail-panel {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.dash-detail-panel h4 {
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.dash-detail-body {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 1rem;
  padding: 0.85rem 1rem 1.1rem;
}
.dash-detail-chart {
  display: block;
  grid-template-columns: none;
  overflow-x: auto;
}
.dash-detail-chart-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1.75rem 2.5rem;
  overflow: visible;
}
.dash-socios-layout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.85rem 1rem 1.1rem;
  box-sizing: border-box;
}
.dash-socios-header {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  align-items: center;
  gap: 1rem 2.5rem;
  width: 100%;
}
.dash-socios-header .chart-title-row {
  justify-content: flex-start;
  text-align: left;
  padding: 0;
  min-width: 0;
}
.dash-socios-header .chart-actions {
  justify-self: end;
  width: auto;
  margin-left: 0;
}
.dash-socios-main {
  display: grid;
  grid-template-columns: minmax(0, 420px) max-content;
  align-items: center;
  justify-content: start;
  gap: 1.75rem 2.5rem;
}
.dash-socios-layout[data-chart="socios"] .dash-socios-main,
.dash-socios-layout[data-chart="puestos"] .dash-socios-main {
  justify-content: center;
  width: 100%;
}
.dash-socios-layout[data-chart="socios"] .dash-socios-header,
.dash-socios-layout[data-chart="puestos"] .dash-socios-header {
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: stretch;
  width: 100%;
}
.dash-socios-layout .chart-block {
  width: 100%;
  max-width: none;
}
.dash-socios-layout.no-legend .dash-socios-header {
  grid-template-columns: minmax(0, 1fr) auto;
}
.dash-socios-layout.no-legend .dash-socios-main {
  grid-template-columns: 1fr;
}
.dash-socios-layout.no-legend .chart-actions {
  justify-self: end;
  align-self: center;
}
.dash-socios-layout.no-legend .chart-block {
  width: 100%;
  max-width: none;
}
.chart-block-pie {
  width: 100%;
}
.pie-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem 2.5rem;
  padding: 0.5rem 0 0.25rem;
}
.pie-chart {
  width: min(280px, 72vw);
  height: auto;
  max-width: 100%;
  border-radius: 0;
  box-shadow: none;
  flex: 0 0 auto;
  overflow: visible;
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}
.pie-disk-bg {
  filter: drop-shadow(0 10px 22px rgba(15, 40, 28, 0.12));
}
.pie-label {
  fill: #fff;
  font-weight: 700;
  font-family: var(--font);
  paint-order: stroke fill;
  stroke: rgba(0, 0, 0, 0.4);
  stroke-width: 3;
  pointer-events: none;
}
.pie-label-pct {
  font-weight: 600;
}
.pie-wrap .chart-legend {
  width: max-content;
  max-width: 100%;
}
.dash-socios-layout[data-chart="pabellones"] .bar-chart {
  overflow-x: visible;
  flex-wrap: wrap;
  align-items: flex-end;
  align-content: flex-start;
  justify-content: flex-start;
  min-height: 0;
  height: auto;
  padding: 1.2rem 0 0.25rem;
  gap: 0.85rem 0.55rem;
}
.dash-socios-layout[data-chart="pabellones"] .bar-col {
  min-width: 52px;
  max-width: 64px;
  flex: 0 0 56px;
  height: 240px;
}
.dash-socios-layout[data-chart="pabellones"] .bar-track {
  height: 170px;
}
.dash-socios-layout[data-chart="pabellones"] .bar-label {
  font-size: 0.7rem;
}
.chart-block-hbar {
  width: 100%;
  max-width: none;
}
.hbar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.35rem 0 0.15rem;
  width: 100%;
}
.dash-socios-layout[data-chart="deudas"] .hbar-chart,
.dash-socios-layout[data-chart="saldo"] .hbar-chart {
  gap: 0.32rem;
  padding: 0.15rem 0 0;
}
.dash-socios-layout[data-chart="deudas"] .hbar-row,
.dash-socios-layout[data-chart="saldo"] .hbar-row {
  grid-template-columns: minmax(12rem, 18rem) 1fr 3.25rem;
  gap: 0.35rem 0.65rem;
}
.dash-socios-layout[data-chart="deudas"] .hbar-row-money,
.dash-socios-layout[data-chart="saldo"] .hbar-row-money {
  grid-template-columns: minmax(12rem, 18rem) 1fr minmax(5.5rem, 7.5rem);
}
.dash-socios-layout[data-chart="deudas"] .hbar-label,
.dash-socios-layout[data-chart="saldo"] .hbar-label {
  font-size: 0.8rem;
}
.dash-socios-layout[data-chart="deudas"] .hbar-track,
.dash-socios-layout[data-chart="saldo"] .hbar-track {
  height: 0.85rem;
}
.dash-socios-layout[data-chart="deudas"] .hbar-value,
.dash-socios-layout[data-chart="saldo"] .hbar-value {
  font-size: 0.8rem;
}
.hbar-row {
  display: grid;
  grid-template-columns: minmax(12rem, 18rem) 1fr 3.25rem;
  align-items: center;
  gap: 0.65rem 0.75rem;
}
.hbar-row-money {
  grid-template-columns: minmax(12rem, 18rem) 1fr minmax(5.5rem, 7.5rem);
}
.hbar-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hbar-track {
  height: 1.15rem;
  background: rgba(15, 77, 60, 0.07);
  border-radius: 999px;
  overflow: hidden;
}
.hbar-fill {
  height: 100%;
  min-width: 4px;
  border-radius: 999px;
}
.hbar-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .hbar-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "label value"
      "track track";
    gap: 0.3rem 0.6rem;
  }
  .hbar-label { grid-area: label; text-align: left; white-space: nowrap; }
  .hbar-value { grid-area: value; }
  .hbar-track { grid-area: track; }
}
.dash-socios-layout .bar-chart {
  padding-left: 0;
  padding-right: 0;
}
.dash-socios-layout .chart-legend {
  flex: 0 0 auto;
  padding-top: 0;
  align-self: center;
  width: max-content;
}
.chart-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  flex: 0 1 auto;
  max-width: 420px;
  width: min(100%, 420px);
}
.chart-title-row {
  justify-content: flex-start;
  text-align: left;
  padding: 0;
}
.chart-title-row h3 {
  margin: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dash-detail-chart-row .bar-chart {
  flex: none;
  max-width: none;
  width: 100%;
}
.dash-detail-chart-row .chart-legend {
  flex: 0 1 auto;
  max-width: none;
  width: max-content;
  padding-top: 2rem;
}
.chart-legend h4 {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.legend-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.legend-swatch {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin-top: 0.2rem;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.legend-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: max-content;
  line-height: 1.35;
}
.legend-title {
  display: block;
  white-space: nowrap;
}
.legend-title strong { font-size: 0.95rem; }
.legend-monto {
  display: block;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}
.legend-total {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.legend-total-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.legend-total-monto {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink, #1a1a1a);
  white-space: nowrap;
}
.legend-total-count {
  font-size: 0.82rem;
  color: var(--muted);
}
.legend-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand);
}
.legend-desc {
  font-size: 0.84rem;
  color: var(--muted);
  white-space: nowrap;
}
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  min-height: 260px;
  padding: 1.4rem 0.25rem 0.25rem;
}
.bar-col {
  flex: 1 1 72px;
  min-width: 64px;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.bar-track {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 77, 60, 0.06);
  border-radius: 12px 12px 4px 4px;
  position: relative;
  overflow: visible;
}
.bar-stack {
  width: 70%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
}
.bar-value {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.2rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  line-height: 1;
}
.bar-fill {
  width: 100%;
  height: 100%;
  min-height: 3px;
  border-radius: 10px 10px 2px 2px;
}
.bar-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
  line-height: 1.25;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.dash-list {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.7;
}
@media (max-width: 800px) {
  .dash-detail-body { grid-template-columns: 1fr; }
  .dash-detail-chart-row {
    flex-direction: column;
    align-items: center;
  }
  .dash-socios-layout {
    width: 100%;
  }
  .dash-socios-header {
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
  }
  .dash-socios-main {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .chart-block,
  .dash-detail-chart-row .bar-chart,
  .dash-detail-chart-row .chart-legend,
  .dash-socios-layout .chart-block,
  .dash-socios-layout .chart-legend {
    max-width: 100%;
    width: 100%;
  }
  .dash-detail-chart-row .chart-legend { padding-top: 0; }
  .bar-chart { min-height: 240px; padding-top: 1.2rem; }
  .bar-track { height: 170px; }
}
.stat .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}
.stat-value-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.45rem;
  min-width: 0;
}
.stat-icon {
  flex-shrink: 0;
  color: var(--brand);
  opacity: 0.9;
}
.stat .value {
  margin-top: 0;
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.4cqi + 0.85rem, 1.7rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  min-width: 0;
}
.stat .value-money {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(0.78rem, 5.5cqi, 1.2rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: #fff;
  position: relative;
  z-index: 3;
}
/* Evita la raya que sobresale a izquierda/derecha del thead (tabla con margen) */
.panel:has(> .table-wrap) > .panel-head {
  border-bottom: 0;
  padding-bottom: 0.85rem;
}
.panel-head-search {
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}
.panel-head-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.75rem;
}
.panel-head-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}
.panel-head h3 {
  margin: 0;
  font-size: 1rem;
}
.panel-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-transform: uppercase;
}
.panel-title-icon {
  flex-shrink: 0;
  color: var(--brand);
  display: block;
}
.view:has(> .panel > .table-wrap) .panel-head h3 {
  text-transform: uppercase;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.toolbar-filters {
  justify-content: flex-end;
  margin-left: 0;
}
.toolbar-search {
  width: auto;
  max-width: 100%;
  flex-wrap: nowrap;
  justify-content: flex-start;
}
.toolbar-search .search-input {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  field-sizing: content;
}
.toolbar-search .btn-icon {
  flex-shrink: 0;
}
input[type="search"], select {
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  border: 1px solid rgba(31, 110, 50, 0.22);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}
input[type="search"] {
  min-width: 0;
  background: #fff;
}
input[type="search"]:hover {
  border-color: rgba(31, 110, 50, 0.4);
  background: #f7fbf7;
}
input[type="search"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(35, 108, 52, 0.18);
  background: #fff;
}
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 9.5rem;
  max-width: 100%;
  height: 2.35rem;
  padding: 0 2.35rem 0 0.95rem;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--brand-deep);
  cursor: pointer;
  background-color: #fff;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23236c34' d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}
select:hover {
  border-color: rgba(31, 110, 50, 0.4);
  background-color: #f7fbf7;
}
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(35, 108, 52, 0.18);
  background-color: #fff;
}
select option {
  color: var(--ink);
  background: #fff;
  font-weight: 500;
}
.ui-select {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  min-width: 9.5rem;
  max-width: 100%;
}
.ui-select-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  width: 100%;
  min-width: 9.5rem;
  height: 2.35rem;
  padding: 0 0.85rem 0 0.95rem;
  border: 1px solid rgba(31, 110, 50, 0.22);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-deep);
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}
.ui-select-trigger:hover {
  border-color: rgba(31, 110, 50, 0.4);
  background: #f7fbf7;
}
.ui-select.is-open .ui-select-trigger,
.ui-select-trigger:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(35, 108, 52, 0.18);
  background: #fff;
}
.ui-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  text-transform: uppercase;
}
.ui-select-caret {
  flex-shrink: 0;
  color: var(--brand);
  transition: transform 140ms ease;
}
.ui-select.is-open .ui-select-caret {
  transform: rotate(180deg);
}
.ui-select-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  z-index: 40;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  min-width: 100%;
  background: #fff;
  border: 1px solid rgba(31, 110, 50, 0.18);
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(31, 110, 50, 0.16);
}
.ui-select-menu[hidden] {
  display: none !important;
}
.ui-select-option {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 120ms ease, color 120ms ease;
}
.ui-select-option:hover {
  background: rgba(35, 108, 52, 0.1);
  color: var(--brand-deep);
}
.ui-select-option.is-selected {
  background: var(--brand);
  color: #f4fff9;
}
.ui-select-option.is-selected:hover {
  background: var(--brand-2);
  color: #fff;
}
.panel.is-select-open {
  overflow: visible;
}
.view:has(> .panel.is-select-open) {
  overflow: visible;
}
.view:has(> .panel.is-select-open) > .panel {
  overflow: visible;
}
.toolbar-filters .ui-select {
  flex: 0 1 auto;
}
.panel-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem 0.75rem;
  min-width: 0;
  text-align: center;
}
.panel-subtitle {
  margin: 0 !important;
  font-size: inherit;
  line-height: 1.35;
}
.dash-detail-panel > .panel-head {
  justify-content: center;
  position: relative;
  min-height: 3.4rem;
}
.dash-detail-panel > .panel-head .panel-title-row {
  padding: 0 6.5rem;
}
.dash-detail-panel > .panel-head .toolbar {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}
.table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}
.panel > .table-wrap {
  margin: 0.25rem 1.15rem 0.45rem;
  border: 0;
  border-radius: 0;
  overflow: auto;
  background: #fff;
}
.table-wrap.is-loading {
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
td.td-creacion {
  line-height: 1.25;
  white-space: nowrap;
}
td.td-creacion .cell-sub {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.panel > .pager {
  padding-left: 1.15rem;
  padding-right: 1.15rem;
  padding-bottom: 0.55rem;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: #fff;
}
th, td {
  padding: 0.7rem 1.05rem;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid rgba(20, 48, 26, 0.16);
  border-top: 0;
  border-left: 0;
  text-align: left;
  vertical-align: top;
}
th:first-child,
td:first-child {
  padding-left: 1.2rem;
}
th:last-child,
td:last-child {
  padding-right: 1.2rem;
  border-right: 0;
}
th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--th-fg);
  background: var(--th-bg);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid rgba(0, 0, 0, 0.14);
  border-right-color: rgba(255, 255, 255, 0.28);
  box-shadow: none;
}
.th-sortable {
  padding: 0;
  vertical-align: middle;
  background: var(--th-bg);
  color: var(--th-fg);
  border-right: 1px solid rgba(255, 255, 255, 0.28);
}
.table-config-periodos th {
  text-align: left;
}
.periodo-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-start;
}
.periodo-acciones .btn {
  white-space: nowrap;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
}
.panel-subtitle-inline {
  margin: 0;
  font-size: 0.82rem;
  white-space: nowrap;
}
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
}
td.td-actions {
  width: auto;
  min-width: 6.5rem;
  text-align: center;
  white-space: nowrap;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  vertical-align: middle;
  overflow: visible;
}
td.td-actions .periodo-acciones {
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.45rem;
}
td.td-actions .btn-icon,
.td-actions .btn-icon {
  width: 2.65rem !important;
  height: 2.65rem !important;
  border-radius: 10px;
}
td.td-actions .btn-icon svg,
.td-actions .btn-icon svg {
  width: 22px !important;
  height: 22px !important;
}
th.th-acciones {
  text-align: center;
}
th.col-center,
td.col-center {
  text-align: center;
}
td.col-center.num {
  text-align: center;
}
.btn-icon-quiet {
  background: #fff;
  border: 1.5px solid rgba(35, 108, 52, 0.45);
  color: var(--brand-deep);
  box-shadow: 0 1px 2px rgba(20, 48, 26, 0.08);
}
.btn-icon-quiet:hover:not(:disabled) {
  background: rgba(35, 108, 52, 0.12);
  color: var(--brand-deep);
  border-color: var(--brand-deep);
}
.btn-icon-accent {
  background: var(--brand);
  border-color: transparent;
  color: #f4fff9;
}
.btn-icon-accent:hover:not(:disabled) {
  background: var(--brand-2);
  color: #fff;
}
.btn-icon:disabled,
.btn-icon-quiet:disabled,
.btn-icon-accent:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.dg-panel .td-actions {
  width: auto;
  min-width: 7.5rem;
}
.dg-panel .periodo-acciones {
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0.4rem;
}
.dg-panel .periodo-acciones .btn-icon {
  width: 2.65rem !important;
  height: 2.65rem !important;
  border-radius: 10px;
}
.dg-panel .periodo-acciones .btn-icon svg {
  width: 22px !important;
  height: 22px !important;
}
table tbody tr:nth-child(even) td {
  background: rgba(35, 108, 52, 0.06);
}
table tbody tr:nth-child(odd) td {
  background: #fff;
}
.th-sort-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  text-align: left;
}
.th-sort-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.th-sortable.is-sorted {
  background: #277036;
}
.th-sortable.is-sorted .th-sort-btn {
  color: var(--th-fg);
  background: transparent;
}
.th-sort-icon {
  font-size: 0.7rem;
  opacity: 0.75;
  line-height: 1;
}
.th-sortable.is-sorted .th-sort-icon {
  opacity: 1;
  color: var(--mega);
}
tr:hover td { background: rgba(35, 108, 52, 0.1) !important; }
tr.is-clickable { cursor: pointer; }
.periodo-detalle-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  min-width: 0;
}
.periodo-detalle-title h3 { margin: 0; font-size: 1rem; }
.periodo-detalle-totales {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(18,32,24,0.08);
}
.badge.PENDIENTE, .badge.PARCIAL { background: rgba(166,124,0,0.15); color: var(--warn); }
.badge.PAGADA, .badge.ACTIVO, .badge.PROCESADO { background: rgba(31,122,76,0.14); color: var(--ok); }
.badge.ANULADA, .badge.ANULADO, .badge.ERROR, .badge.INACTIVO { background: rgba(163,59,43,0.14); color: var(--err); }
.badge.MULTIPLE { background: rgba(255, 230, 0, 0.28); color: #8a6d00; }
/* Códigos de rol — colores diferenciados */
.badge.ADMIN { background: rgba(31, 110, 50, 0.2); color: #145218; }
.badge.CA,
.badge.CAJERO { background: rgba(245, 166, 35, 0.22); color: #8a5a00; }
.badge.CO { background: rgba(0, 150, 136, 0.18); color: #00695c; }
.badge.CONSULTA { background: rgba(0, 188, 212, 0.18); color: #006064; }
.badge.FISCAL { background: rgba(198, 40, 40, 0.16); color: #8b1e1e; }
.badge.IN { background: rgba(63, 81, 181, 0.16); color: #283593; }
.badge.PR,
.badge.PRESIDENTE { background: rgba(46, 125, 50, 0.18); color: #1b5e20; }
.badge.SE,
.badge.SECRETARIO { background: rgba(33, 150, 243, 0.18); color: #0d47a1; }
.badge.SO { background: rgba(233, 30, 99, 0.14); color: #880e4f; }
.badge.TE,
.badge.TESORERO { background: rgba(156, 39, 176, 0.16); color: #6a1b9a; }
.badge.VOCAL { background: rgba(121, 85, 72, 0.18); color: #4e342e; }
.badge.VP,
.badge.VICEPRESIDENTE { background: rgba(0, 137, 123, 0.18); color: #004d40; }
.badge.rol-tone-0 { background: rgba(25, 118, 210, 0.16); color: #0d47a1; }
.badge.rol-tone-1 { background: rgba(0, 151, 167, 0.16); color: #006064; }
.badge.rol-tone-2 { background: rgba(123, 31, 162, 0.14); color: #4a148c; }
.badge.rol-tone-3 { background: rgba(230, 81, 0, 0.16); color: #bf360c; }
.badge.rol-tone-4 { background: rgba(67, 160, 71, 0.16); color: #1b5e20; }
.badge.rol-tone-5 { background: rgba(194, 24, 91, 0.14); color: #880e4f; }
.badge.rol-tone-6 { background: rgba(57, 73, 171, 0.16); color: #1a237e; }
.badge.rol-tone-7 { background: rgba(141, 110, 99, 0.2); color: #3e2723; }
.puestos-cell {
  max-width: 22rem;
}
.puesto-chip {
  display: inline-block;
  margin: 0.12rem 0.2rem 0.12rem 0;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(31, 110, 50, 0.1);
  color: var(--brand-deep);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

/* â€”â€” Modal usuarios â€”â€” */
.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 48, 26, 0.45);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(92dvh, 860px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(20, 48, 26, 0.22);
  display: flex;
  flex-direction: column;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--brand-deep);
}
#junta-modal-title {
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
#user-modal-title {
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
#user-form .field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
#user-form .field-label-icon {
  width: 16px;
  height: 16px;
  display: block;
}
.btn-modal-close {
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(35, 108, 52, 0.28);
  color: var(--brand-deep);
  flex-shrink: 0;
}
.btn-modal-close:hover {
  background: rgba(35, 108, 52, 0.1);
  color: var(--brand-deep);
}
.btn-modal-close svg {
  display: block;
}
.modal-body {
  padding: 1.15rem 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}
.form-grid .login-field select {
  width: 100%;
  min-width: 0;
  height: auto;
  border-radius: 12px;
  padding: 0.7rem 2.35rem 0.7rem 0.85rem;
  font-weight: 500;
  letter-spacing: normal;
  color: var(--ink);
  background-color: #f8fcf8;
  text-align: left;
}
/* Modales: sin ícono interno (el del login); alinear texto a la izquierda */
.form-grid .login-field input {
  padding: 0.7rem 0.85rem;
  text-align: left;
  font-size: 16px;
}
.form-grid .login-field .sgi-date-face {
  padding-left: 0.85rem;
  text-align: left;
}
.form-grid .junta-puestos {
  padding-left: 0.85rem;
  padding-right: 0.85rem;
  justify-content: flex-start;
}
/* Junta: forzar misma alineación (inputs / select / fechas / puestos) */
#junta-form .login-field input,
#junta-form .login-field select,
#junta-form .sgi-date-face {
  text-align: left !important;
  padding-left: 0.85rem !important;
  padding-right: 0.85rem !important;
}
#junta-form .login-field select {
  padding-right: 2.35rem !important;
}
#junta-form .sgi-date-face {
  padding-right: 2.6rem !important;
}
#junta-form input::placeholder {
  text-align: left;
}
#junta-form input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}
#junta-form input[type="search"]::-webkit-search-decoration,
#junta-form input[type="search"]::-webkit-search-cancel-button,
#junta-form input[type="search"]::-webkit-search-results-button,
#junta-form input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  display: none;
}
#junta-form .field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
#junta-form .field-label-icon {
  width: 16px;
  height: 16px;
  display: block;
}
.check-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}
.check-field[hidden] {
  display: none !important;
}
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.4rem;
  font-weight: 600;
}
.pabe-fieldset {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 0.9rem 0.9rem;
}
.pabe-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}
.pabe-fieldset legend.field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--brand-deep);
}
.pabe-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.45rem 0.75rem;
  max-height: 180px;
  overflow: auto;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.modal-card-confirm {
  width: min(560px, 100%);
  max-height: min(90dvh, 720px);
}
.modal-card-confirm .form-grid {
  margin-top: 0.35rem;
}
.dg-panel {
  margin-top: 0.85rem;
}
.dg-panel .periodo-acciones {
  flex-wrap: nowrap;
  justify-content: center;
}
.table-config-deudas {
  table-layout: fixed;
  width: 100%;
}
.table-config-deudas .col-codigo { width: 10%; }
.table-config-deudas .col-nombre { width: 32%; }
.table-config-deudas .col-periodos { width: 36%; }
.table-config-deudas .col-estado { width: 10%; }
.table-config-deudas .col-acciones { width: 12%; }
.table-config-deudas th,
.table-config-deudas td {
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.table-config-deudas td.muted {
  white-space: nowrap;
}
.table-config-deudas th:nth-child(4),
.table-config-deudas td:nth-child(4),
.table-config-deudas th:nth-child(5),
.table-config-deudas td:nth-child(5),
.table-config-deudas .td-actions {
  text-align: center;
  overflow: visible;
}
.dg-panel .periodo-acciones {
  justify-content: center;
}
.confirm-modal-text {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.55;
}
.confirm-modal-text p {
  margin: 0 0 0.65rem;
}
.confirm-modal-text p:last-child {
  margin-bottom: 0;
}
.confirm-modal-text .confirm-lead {
  font-weight: 700;
  color: var(--brand-deep);
  font-size: 1.02rem;
}
.confirm-modal-text .confirm-meta {
  color: var(--muted);
  font-size: 0.9rem;
}
.confirm-modal-text ul {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.15rem;
}
.confirm-modal-text li {
  margin: 0.2rem 0;
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid var(--line);
}
.empty, .error-box {
  padding: 1.5rem 1rem;
  color: var(--muted);
}
.error-box { color: var(--err); }

@media (max-width: 1100px) {
  .app { grid-template-columns: 220px 1fr; }
  .main { padding: 0 1.25rem 0; }
  .top { margin: 0 -1.25rem; padding: 1.15rem 1.25rem 0.9rem; }
}

@media (max-width: 1024px) {
  html, body {
    overflow: auto;
    height: auto;
    min-height: 100%;
  }
  body.nav-open {
    overflow: hidden;
  }
  .app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
  }
  .btn-nav-toggle {
    display: inline-flex;
  }
  .rail-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(20, 48, 26, 0.45);
    border: 0;
    padding: 0;
    cursor: pointer;
  }
  .rail-backdrop[hidden] {
    display: none !important;
  }
  .rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    width: min(288px, 86vw);
    height: 100dvh;
    max-height: 100dvh;
    padding: max(0.85rem, env(safe-area-inset-top)) max(0.9rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(0.9rem, env(safe-area-inset-left));
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.75rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-105%);
    transition: transform 220ms ease;
    box-shadow: none;
  }
  body.nav-open .rail {
    transform: translateX(0);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.28);
  }
  .brand {
    width: 88px;
    margin: 0 auto;
  }
  .brand-logo { border-radius: 12px; }
  .nav {
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
    gap: 0.3rem;
  }
  .nav-group { width: 100%; }
  .rail-foot { display: none; }
  .rail-user { margin-top: auto; }
  .site-footer {
    padding: 0.45rem max(0.85rem, env(safe-area-inset-right)) max(0.45rem, env(safe-area-inset-bottom)) max(0.85rem, env(safe-area-inset-left));
    justify-content: center;
  }
  .footer-copy {
    font-size: 0.75rem;
    white-space: normal;
    text-align: center;
    width: 100%;
  }
  .main {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 0 0.85rem 1.25rem;
    width: 100%;
  }
  .view {
    overflow: auto;
    padding: 0.85rem 0 1.25rem;
  }
  .view:has(> .panel > .table-wrap) {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0.55rem 0 0.5rem;
    min-height: min(62dvh, calc(100dvh - 9rem));
  }
  .view:has(> .panel > .table-wrap) > .panel {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .view:has(> .panel > .table-wrap) > .panel > .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    max-height: none;
  }
  .table-wrap {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .top {
    flex-direction: row;
    align-items: center;
    margin: 0 -0.85rem;
    padding: max(0.85rem, env(safe-area-inset-top)) max(0.85rem, env(safe-area-inset-right)) 0.85rem max(0.85rem, env(safe-area-inset-left));
    position: sticky;
    top: 0;
    z-index: 50;
    background: #2f8040;
  }
  .top h1 {
    font-size: clamp(1rem, 3.8vw, 1.25rem);
    line-height: 1.25;
  }
  .top-actions {
    width: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }
  .hero { min-height: 0; }
  .hero-inner {
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 1.1rem;
    gap: 0.9rem;
  }
  .hero-logo { width: 112px; }
  .hero p,
  .hero-lead { margin-top: 0; max-width: none; }
  .panel-head { flex-direction: column; align-items: stretch; }
  .panel-head-top {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .panel-head-tools {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-filters {
    margin-left: 0;
    width: 100%;
    justify-content: stretch;
  }
  .toolbar-filters .btn { margin-left: 0; width: 100%; }
  .dash-detail-panel > .panel-head {
    align-items: center;
    min-height: 0;
    padding-top: 3.2rem;
  }
  .dash-detail-panel > .panel-head .panel-title-row { padding: 0; }
  .dash-detail-panel > .panel-head .toolbar {
    right: 0.75rem;
    top: 0.75rem;
    transform: none;
  }
  .toolbar { width: 100%; }
  .dash-detail-panel > .panel-head .toolbar { width: auto; }
  input[type="search"], select { min-width: 0; flex: 1; width: 100%; }
  .toolbar-filters .ui-select { flex: 1 1 auto; min-width: 0; width: 100%; }
  .ui-select-trigger { min-width: 0; width: 100%; }
  .toolbar-search {
    width: 100%;
  }
  .toolbar-search .search-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .pager {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }
  .pager .toolbar {
    width: 100%;
    justify-content: stretch;
  }
  .pager .toolbar .btn {
    flex: 1 1 auto;
  }
  table { font-size: 0.82rem; }
  th, td { padding: 0.5rem 0.55rem; }
  .panel .table-wrap table th,
  .panel .table-wrap table td {
    padding: 0.34rem 0.55rem;
  }
  .view:has(> .panel > .table-wrap) tbody td {
    white-space: normal;
  }
  .view:has(> .panel > .table-wrap) tbody td.num,
  .view:has(> .panel > .table-wrap) tbody td.td-actions {
    white-space: nowrap;
  }
  .modal {
    padding: 0.5rem;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    align-items: flex-end;
  }
  .modal-card {
    width: 100%;
    max-height: min(94dvh, 920px);
    border-radius: 16px 16px 10px 10px;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .modal-card-confirm {
    width: min(100%, 420px);
    max-height: min(90dvh, 720px);
  }
  .modal-actions {
    width: 100%;
  }
  .modal-actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }
  .grid.grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ec-panel .ec-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .ec-search-field {
    min-width: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .ec-search-field input {
    min-width: 0;
    width: 100%;
  }
  .ec-panel .ec-toolbar .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
  .bar-chart {
    overflow-x: auto;
    max-width: 100%;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
  }
  .dash-socios-layout[data-chart="pabellones"] .bar-chart {
    overflow-x: visible;
    overflow-y: visible;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
  }
  .dash-socios-layout[data-chart="pabellones"] .bar-col {
    min-width: 44px;
    max-width: 52px;
    flex: 0 0 48px;
    height: 200px;
  }
  .dash-socios-layout[data-chart="pabellones"] .bar-track {
    height: 140px;
  }
  .dash-detail,
  .dash-detail-panel,
  .dash-socios-layout,
  .dash-socios-main,
  .dash-socios-layout .chart-block {
    min-width: 0;
    max-width: 100%;
  }
  .dash-detail-panel {
    overflow-x: hidden;
  }
  .periodo-acciones .btn {
    min-height: 44px;
    padding: 0.55rem 0.85rem;
  }
  .login-field.checkbox-field input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    min-height: 1.25rem;
  }
  input[type="search"] {
    font-size: 16px;
    min-height: 44px;
  }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 0 0.65rem 1rem; }
  .top { margin: 0 -0.65rem; padding: 0.7rem 0.65rem; }
  .stat { padding: 0.85rem 0.9rem; }
  .stat .value { font-size: clamp(1.15rem, 5vw, 1.45rem); }
  .panel > .table-wrap {
    margin-left: 0.55rem;
    margin-right: 0.55rem;
  }
  .panel > .pager {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }
}

/* â€”â€” Login â€”â€” */
.login-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  background: var(--bg-2);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.login-brand {
  display: grid;
  place-items: center;
  padding: 2rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(80, 184, 72, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 90%, rgba(245, 166, 35, 0.18), transparent 50%),
    linear-gradient(160deg, #134520 0%, #1f6e32 45%, #185728 100%);
}
.login-brand-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(520px, 78%);
  aspect-ratio: 1;
}
.login-brand-map {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 130%;
  height: 130%;
  max-width: none;
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  opacity: 0.5;
  filter: blur(1.2px);
}
.login-brand-logo {
  position: relative;
  z-index: 1;
  width: min(210px, 32vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.28));
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem;
  background: var(--bg-2);
  overflow: auto;
}
.login-card {
  width: min(100%, 400px);
  margin: 0;
  padding: 2rem 1.75rem 1.75rem;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(31, 110, 50, 0.12);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
}
.login-card[hidden] {
  display: none !important;
}
.login-title {
  margin: 0 0 0.65rem;
  text-align: center;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.15rem, 3.6vw, 1.45rem);
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: var(--brand);
  text-transform: uppercase;
}
.login-sub {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
  text-transform: uppercase;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-deep);
}
.login-field.checkbox-field {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 600;
  color: var(--ink);
}
.login-field.checkbox-field input[type="checkbox"] {
  width: auto;
  margin-top: 0.15rem;
  flex: 0 0 auto;
  accent-color: var(--brand);
}
.field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.2;
}
.field-label-icon {
  flex: 0 0 auto;
  color: var(--brand);
  opacity: 0.95;
}
.login-input-wrap {
  position: relative;
  display: block;
}
.login-input-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand);
  pointer-events: none;
  opacity: 0.9;
}
.login-field input {
  display: block;
  width: 100%;
  border: 1.5px solid rgba(47, 128, 64, 0.28);
  border-radius: 12px;
  padding: 0.78rem 0.9rem;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  background: #f3faf2;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.login-input-wrap input {
  padding-left: 2.55rem;
}
.login-field input::placeholder {
  color: rgba(79, 106, 82, 0.7);
  font-weight: 500;
}
.login-field input:hover {
  border-color: rgba(47, 128, 64, 0.45);
  background: #eef8ee;
}
.login-field input:focus {
  outline: none;
  border-color: #2f8040;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 128, 64, 0.18);
}
.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: 0 0 0 1000px #f3faf2 inset;
  transition: background-color 99999s ease-out;
}
.login-field input:focus:-webkit-autofill {
  box-shadow:
    0 0 0 1000px #fff inset,
    0 0 0 3px rgba(47, 128, 64, 0.18);
  border-color: #2f8040;
}
.login-error {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(198, 40, 40, 0.08);
  color: var(--err);
  font-size: 0.86rem;
  font-weight: 600;
}
.login-ok {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(47, 128, 64, 0.1);
  color: #1f5c2c;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
}
.login-hint {
  margin: 0 0 0.35rem;
  color: rgba(26, 46, 28, 0.72);
  font-size: 0.88rem;
  line-height: 1.4;
}
.login-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  justify-content: center;
  margin: 0.15rem 0 0;
}
.login-link {
  border: 0;
  background: transparent;
  color: #2f8040;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  padding: 0.55rem 0.15rem;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.login-link:hover {
  color: #226832;
}
.login-error.login-ok-msg {
  background: rgba(47, 128, 64, 0.1);
  color: #1f5c2c;
}
.login-submit {
  margin-top: 0.35rem;
  width: 100%;
  justify-content: center;
  padding: 0.8rem 1rem;
  font-weight: 700;
  background: #2f8040;
  border-color: transparent;
}
.login-submit:hover {
  background: #277036;
  color: #fff;
}

/* Login mobile: must come AFTER base .login-gate rules (cascade) */
@media (max-width: 1024px) {
  .login-gate {
    grid-template-columns: 1fr;
    align-content: start;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .login-brand {
    min-height: 0;
    padding: max(1.25rem, env(safe-area-inset-top)) 1rem 0.85rem;
  }
  .login-brand-stage {
    width: auto;
    aspect-ratio: auto;
  }
  .login-brand-map {
    display: none;
  }
  .login-brand-logo {
    width: min(112px, 34vw);
    border-radius: 22%;
    overflow: hidden;
  }
  .login-panel {
    padding: 0.75rem 1rem max(1.5rem, env(safe-area-inset-bottom));
    place-items: start center;
  }
  .login-card {
    width: min(100%, 400px);
    padding: 1.35rem 1.15rem 1.25rem;
  }
  .login-title {
    font-size: clamp(1.15rem, 5.2vw, 1.45rem);
  }
}

@media (max-width: 1024px) and (max-height: 520px) {
  .login-brand {
    display: none;
  }
  .login-panel {
    padding-top: max(1rem, env(safe-area-inset-top));
  }
}

.rail-user {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.rail-user-name {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.25;
}
.rail-user-rol {
  margin: 0;
  font-size: 0.72rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.btn-logout {
  margin-top: 0.35rem;
  width: 100%;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}
.btn-logout:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* â€”â€” Estado de cuenta â€”â€” */
.ec-panel {
  overflow: auto;
}
.ec-panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #fff 70%, rgba(255, 255, 255, 0.92));
}
.ec-panel .ec-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}
.ec-search-field {
  min-width: 10rem;
  margin: 0;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
}
.ec-search-field > span {
  flex: 0 0 auto;
  white-space: nowrap;
}
.ec-search-field input {
  min-width: 12rem;
  width: auto;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ec-idle {
  padding: 2.5rem 1.25rem;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(80, 184, 72, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(231, 243, 230, 0.55), transparent);
  border-radius: 14px;
  margin: 0.35rem 0 0.75rem;
}
.ec-idle-title {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--brand-deep);
}
.ec-idle-text {
  margin: 0 auto;
  max-width: 28rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}
.ec-cands {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1.1rem;
}
.ec-cand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.ec-cand:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(31, 110, 50, 0.12);
}
.ec-cand-puesto {
  font-family: var(--display);
  font-weight: 800;
  color: var(--brand-deep);
}
.ec-cand-socio {
  font-size: 0.82rem;
  color: var(--muted);
}

.junta-socio-lookup {
  position: relative;
}
.junta-socio-suggest {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  max-height: 14rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(20, 60, 30, 0.14);
}
.junta-socio-suggest[hidden] {
  display: none !important;
}
.junta-socio-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.junta-socio-opt:hover,
.junta-socio-opt:focus-visible {
  background: rgba(31, 110, 50, 0.08);
  outline: none;
}
.junta-socio-opt-name {
  font-weight: 700;
  color: var(--brand-deep);
  line-height: 1.25;
}
.junta-socio-opt-meta {
  font-size: 0.8rem;
  color: var(--muted);
}
.junta-socio-empty {
  padding: 0.65rem 0.7rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.junta-puestos {
  min-height: 2.55rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(31, 110, 50, 0.04);
  color: var(--muted);
  font-size: 0.92rem;
}
.junta-puestos .puesto-chip {
  margin: 0;
}
#user-form .login-field.is-disabled {
  opacity: 0.55;
}
#user-form .login-field.is-disabled input,
#user-form .login-field.is-disabled select {
  cursor: not-allowed;
  background: #eef3ee;
}
#junta-form .junta-puestos.is-disabled {
  background: #eef3ee;
  pointer-events: none;
}

/* —— Date picker SGI —— */
.sgi-date-wrap {
  position: relative;
  width: 100%;
}
.sgi-date-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.sgi-date-face {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.75rem;
  border: 1.5px solid rgba(47, 128, 64, 0.28);
  border-radius: 12px;
  padding: 0.78rem 2.6rem 0.78rem 0.9rem;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  background: #f3faf2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23236c34'%3E%3Cpath d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11z'/%3E%3C/svg%3E") no-repeat right 0.85rem center / 1.15rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}
.sgi-date-face.is-placeholder {
  color: rgba(79, 106, 82, 0.7);
  font-weight: 500;
}
.sgi-date-face:hover:not(:disabled) {
  border-color: rgba(47, 128, 64, 0.55);
}
.sgi-date-wrap.is-open .sgi-date-face,
.sgi-date-face:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(35, 108, 52, 0.18);
  background-color: #fff;
}
.sgi-date-wrap.is-disabled .sgi-date-face,
.sgi-date-face:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  background-color: #eef3ee;
}
.sgi-date-popover {
  position: fixed;
  z-index: 1200;
  width: min(18.5rem, calc(100vw - 1.25rem));
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(20, 48, 26, 0.18);
  color: var(--ink);
  animation: sgi-date-in 0.16s ease both;
}
@keyframes sgi-date-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.sgi-date-head {
  display: grid;
  grid-template-columns: 2rem 1fr 2rem;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}
.sgi-date-title {
  text-align: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--brand-deep);
}
.sgi-date-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 10px;
  background: rgba(35, 108, 52, 0.08);
  color: var(--brand);
  cursor: pointer;
}
.sgi-date-nav:hover {
  background: rgba(35, 108, 52, 0.16);
}
.sgi-date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
}
.sgi-date-dow {
  display: grid;
  place-items: center;
  height: 1.7rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.sgi-date-day {
  display: grid;
  place-items: center;
  height: 2.05rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.sgi-date-day:hover {
  background: rgba(35, 108, 52, 0.1);
}
.sgi-date-day.is-muted {
  color: rgba(79, 106, 82, 0.45);
  font-weight: 600;
}
.sgi-date-day.is-today:not(.is-selected) {
  box-shadow: inset 0 0 0 1.5px rgba(35, 108, 52, 0.45);
  color: var(--brand-deep);
}
.sgi-date-day.is-selected {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 14px rgba(35, 108, 52, 0.28);
}
.sgi-date-day.is-selected:hover {
  background: var(--brand-2);
}
.sgi-date-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}
.sgi-date-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  border-radius: 8px;
}
.sgi-date-link:hover {
  background: rgba(35, 108, 52, 0.08);
  color: var(--brand-deep);
}
.sgi-date-link-primary {
  color: var(--brand);
}

.ec-doc {
  padding: 0.15rem 0.1rem 1.25rem;
  animation: ec-in 0.38s ease both;
}
@keyframes ec-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.ec-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.85rem 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 230, 0, 0.12), transparent 42%),
    linear-gradient(160deg, var(--brand-deep) 0%, var(--brand) 55%, #2f8f3a 100%);
  box-shadow: 0 10px 24px rgba(19, 69, 32, 0.18);
  margin-bottom: 0.75rem;
  overflow: hidden;
  position: relative;
}
.ec-hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -55% auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  pointer-events: none;
}
.ec-hero-kicker {
  margin: 0 0 0.1rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}
.ec-hero-puesto {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.ec-hero-socio {
  margin: 0.3rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.92rem;
  opacity: 0.95;
  line-height: 1.25;
}
.ec-socio-code {
  display: inline-flex;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.ec-hero-meta {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  font-size: 0.78rem;
  opacity: 0.82;
  line-height: 1.2;
}
.ec-hero-total {
  position: relative;
  z-index: 1;
  min-width: 10rem;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  text-align: right;
  animation: ec-pop 0.45s 0.08s ease both;
}
@keyframes ec-pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}
.ec-hero-total-label {
  margin: 0;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
}
.ec-hero-total-value {
  margin: 0.1rem 0 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.1;
}
.ec-hero-total-unit {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  opacity: 0.8;
}

.ec-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.15rem;
}
.ec-stat {
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fcf6, #eef7ee);
  border: 1px solid rgba(35, 108, 52, 0.1);
  animation: ec-in 0.4s ease both;
  animation-delay: 0.06s;
}
.ec-stat span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.ec-stat strong {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
}
.ec-stat-focus {
  background: linear-gradient(180deg, #fff8d6, #fff1a8);
  border-color: rgba(212, 180, 0, 0.35);
}
.ec-stat-focus strong {
  color: #7a5d00;
}

.ec-concepto {
  margin: 0 0 0.95rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  animation: ec-in 0.42s ease both;
  animation-delay: calc(0.1s + var(--ec-i, 0) * 0.05s);
}
.ec-concepto-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(35, 108, 52, 0.06), transparent 70%);
}
.ec-tone-alq .ec-concepto-head {
  background: linear-gradient(90deg, rgba(245, 166, 35, 0.14), transparent 70%);
}
.ec-tone-slv .ec-concepto-head {
  background: linear-gradient(90deg, rgba(35, 108, 52, 0.1), transparent 70%);
}
.ec-tone-luz .ec-concepto-head {
  background: linear-gradient(90deg, rgba(0, 188, 212, 0.12), transparent 70%);
}
.ec-tone-agu .ec-concepto-head {
  background: linear-gradient(90deg, rgba(33, 150, 243, 0.12), transparent 70%);
}
.ec-concepto-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.ec-concepto-title {
  margin: 0.1rem 0 0;
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--brand-deep);
}
.ec-concepto-sub {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.ec-concepto-sub strong {
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--ink);
}
.ec-table-wrap {
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.ec-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.ec-table .ec-col-desc { width: 28%; }
.ec-table .ec-col-num { width: 16%; }
.ec-table .ec-col-date { width: 24%; }
.ec-table th.num,
.ec-table td.num {
  text-align: center;
}
.ec-table th,
.ec-table td {
  border-right: 1px solid rgba(20, 48, 26, 0.14);
}
.ec-table th:last-child,
.ec-table td:last-child {
  border-right: 0;
}
.ec-table th {
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 0.7rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.9rem;
  box-shadow: none;
  position: static;
}
.ec-table td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(20, 48, 26, 0.06);
  font-size: 0.92rem;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ec-table tbody tr:last-child td {
  border-bottom: 0;
}
.ec-table tbody tr:hover td {
  background: rgba(35, 108, 52, 0.04);
}
.ec-desc-main {
  font-weight: 650;
  color: var(--ink);
}
.ec-date {
  color: var(--ink);
  white-space: nowrap;
  text-align: center;
}
.ec-date-vencida {
  color: #c62828;
  font-weight: 700;
}
.ec-saldo-cell {
  font-weight: 750;
  color: var(--brand-deep);
}
.ec-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.ec-pill-soft {
  background: rgba(245, 166, 35, 0.16);
  color: #9a6400;
}
.ec-empty {
  padding: 2rem 1rem;
  text-align: center;
}
.ec-empty-title {
  margin: 0 0 0.3rem;
  font-family: var(--display);
  font-weight: 800;
  color: var(--brand-deep);
}
.ec-empty-text {
  margin: 0;
  color: var(--muted);
}
.ec-empty-soft {
  padding: 1rem 0.5rem;
}
.ec-trunc-aviso {
  margin: 0.75rem 1.25rem 0;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid #b45309;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.86rem;
  line-height: 1.35;
}
.ecs-puestos-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(20, 48, 26, 0.08);
  border-radius: 12px;
  background: rgba(35, 108, 52, 0.04);
}
.ecs-puestos-label {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.ecs-puestos-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.ecs-puesto-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: rgba(20, 48, 26, 0.06);
  color: var(--brand-deep);
  font-size: 0.82rem;
  font-weight: 700;
}
.ecs-puesto-chip.is-activo {
  background: rgba(35, 108, 52, 0.14);
}
.ecs-puesto {
  margin: 0 0 1.1rem;
  border: 1px solid rgba(20, 48, 26, 0.1);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  animation: ec-in 0.42s ease both;
  animation-delay: calc(0.08s + var(--ec-i, 0) * 0.05s);
}
.ecs-puesto-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, rgba(20, 48, 26, 0.92), rgba(35, 108, 52, 0.88));
  color: #fff;
}
.ecs-puesto-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}
.ecs-puesto-title {
  margin: 0.15rem 0 0;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
}
.ecs-puesto-sub {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  font-size: 0.8rem;
  opacity: 0.9;
}
.ecs-puesto-sub strong {
  font-size: 1.05rem;
  font-weight: 800;
}
.ecs-bloques {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.25rem;
}
.ecs-bloque {
  border: 1px solid rgba(20, 48, 26, 0.12);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  animation: ec-in 0.42s ease both;
  animation-delay: calc(0.06s + var(--ec-i, 0) * 0.08s);
}
.ecs-bloque-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.1rem;
  color: #fff;
}
.ecs-bloque-asociacion .ecs-bloque-head {
  background: linear-gradient(135deg, #1a3a5c 0%, #2a5f8f 100%);
}
.ecs-bloque-mercado .ecs-bloque-head {
  background: linear-gradient(135deg, rgba(20, 48, 26, 0.95), rgba(35, 108, 52, 0.9));
}
.ecs-bloque-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.8;
}
.ecs-bloque-title {
  margin: 0.2rem 0 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 800;
}
.ecs-bloque-code {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  opacity: 0.9;
}
.ecs-bloque-totales {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}
.ecs-bloque-tot {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}
.ecs-bloque-tot span {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}
.ecs-bloque-tot strong {
  font-size: 1.15rem;
  font-weight: 800;
}
.ecs-bloque-body {
  padding: 0.85rem 0.85rem 0.35rem;
  background: linear-gradient(180deg, rgba(246, 248, 246, 0.9), #fff 40%);
}
.ecs-moneda {
  margin: 0 0 0.9rem;
}
.ecs-moneda-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 0.55rem;
  padding: 0.35rem 0.15rem;
  border-bottom: 1px solid rgba(20, 48, 26, 0.08);
}
.ecs-moneda-label {
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.ecs-moneda-head strong {
  font-size: 1.05rem;
  color: var(--brand-deep);
}
.ecs-moneda-meta {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
}
.ecs-bloque .ecs-puesto {
  box-shadow: none;
}
@media (max-width: 700px) {
  .ecs-bloque-head {
    flex-direction: column;
  }
  .ecs-bloque-totales {
    align-items: flex-start;
  }
}
.ecs-puesto-body {
  padding: 0.35rem 0.55rem 0.7rem;
}
.ecs-puesto-body .ec-concepto {
  margin: 0.55rem 0.35rem;
}

@media (max-width: 820px) {
  .ec-hero {
    grid-template-columns: 1fr;
  }
  .ec-hero-total {
    text-align: left;
  }
  .ec-summary {
    grid-template-columns: 1fr;
  }
}

@media print {
  body.ec-printing #login-gate,
  body.ec-printing .app-rail,
  body.ec-printing .app-top,
  body.ec-printing #site-footer,
  body.ec-printing .ec-toolbar,
  body.ec-printing .panel-head {
    display: none !important;
  }
  body.ec-printing #app-shell,
  body.ec-printing .app-main,
  body.ec-printing .view,
  body.ec-printing .panel {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }
  body.ec-printing .ec-doc,
  body.ec-printing .ec-concepto,
  body.ec-printing .ec-hero,
  body.ec-printing .ec-stat,
  body.ec-printing .ec-hero-total,
  body.ec-printing .ecs-puesto,
  body.ec-printing .ecs-puestos-bar {
    animation: none !important;
    box-shadow: none !important;
  }
  body.ec-printing .ec-hero {
    color: #000;
    background: #f3f3f3 !important;
    border: 1px solid #ccc;
  }
  body.ec-printing .ec-hero-total {
    background: #fff !important;
    border-color: #ccc;
    color: #000;
  }
}

/* â€”â€” Estado de cuenta: tipografÃ­a/espaciado mÃ¡s compacto â€”â€” */
#view-estado_cuenta,
#view-estado_cuenta_socio {
  padding: 0.55rem 0 0.45rem;
}
.ec-panel .panel-title-row h3 { font-size: 0.95rem; }
.ec-panel .panel-subtitle { font-size: 0.78rem; }
.ec-doc {
  padding: 0.05rem 0.05rem 0.55rem;
  font-size: 0.86rem;
}
.ec-hero {
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  box-shadow: 0 8px 16px rgba(19, 69, 32, 0.14);
}
.ec-hero-kicker { font-size: 0.6rem; letter-spacing: 0.08em; }
.ec-hero-puesto {
  font-size: clamp(1.02rem, 1.6vw, 1.22rem);
  line-height: 1.12;
}
.ec-hero-socio { margin-top: 0.18rem; font-size: 0.78rem; gap: 0.25rem; }
.ec-socio-code { font-size: 0.66rem; padding: 0.05rem 0.32rem; }
.ec-hero-meta { margin-top: 0.18rem; font-size: 0.68rem; gap: 0.15rem 0.55rem; }
.ec-hero-total { min-width: 8.25rem; padding: 0.35rem 0.6rem; border-radius: 10px; }
.ec-hero-total-label { font-size: 0.58rem; }
.ec-hero-total-value { font-size: clamp(1rem, 1.5vw, 1.2rem); }
.ec-hero-total-unit { font-size: 0.64rem; margin-top: 0.08rem; }
.ec-summary { gap: 0.4rem; margin-bottom: 0.55rem; }
.ec-stat { padding: 0.45rem 0.65rem; border-radius: 10px; }
.ec-stat span { font-size: 0.62rem; margin-bottom: 0.08rem; }
.ec-stat strong { font-size: 0.95rem; }
.ec-concepto { margin: 0 0 0.45rem; border-radius: 10px; }
.ec-concepto-head { padding: 0.4rem 0.65rem; gap: 0.65rem; }
.ec-concepto-kicker { font-size: 0.58rem; }
.ec-concepto-title { font-size: 0.86rem; margin-top: 0.04rem; }
.ec-concepto-sub { font-size: 0.68rem; }
.ec-concepto-sub strong { font-size: 0.86rem; }
.ec-table { font-size: 0.8rem; table-layout: fixed; }
.ec-table .ec-col-desc { width: 28%; }
.ec-table .ec-col-num { width: 16%; }
.ec-table .ec-col-date { width: 24%; }
.ec-table th,
.ec-table td {
  border-right: 1px solid rgba(20, 48, 26, 0.14);
}
.ec-table th:last-child,
.ec-table td:last-child {
  border-right: 0;
}
.ec-table th {
  font-size: 0.62rem !important;
  padding: 0.3rem 0.5rem;
  letter-spacing: 0.04em;
}
.ec-table td {
  padding: 0.32rem 0.5rem;
  font-size: 0.8rem;
}
.ec-desc-main { font-size: 0.8rem; }
.ec-date { font-size: 0.76rem; }
.ec-pill { font-size: 0.6rem; padding: 0.06rem 0.32rem; }
.ecs-puestos-bar {
  gap: 0.35rem 0.55rem;
  margin: 0 0 0.45rem;
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
}
.ecs-puestos-label { font-size: 0.62rem; }
.ecs-puesto-chip { font-size: 0.72rem; padding: 0.12rem 0.45rem; }
.ecs-puesto { margin: 0 0 0.55rem; border-radius: 12px; }
.ecs-puesto-head { padding: 0.42rem 0.7rem; gap: 0.65rem; }
.ecs-puesto-kicker { font-size: 0.58rem; }
.ecs-puesto-title { font-size: 0.98rem; margin-top: 0.06rem; }
.ecs-puesto-sub { font-size: 0.68rem; }
.ecs-puesto-sub strong { font-size: 0.86rem; }
.ecs-puesto-body { padding: 0.2rem 0.35rem 0.35rem; }
.ecs-puesto-body .ec-concepto { margin: 0.35rem 0.2rem; }
.ec-idle { padding: 1.4rem 1rem; }
.ec-idle-title { font-size: 1.02rem; }
.ec-idle-text { font-size: 0.82rem; }
/* â€”â€” Estado de cuenta: layout limpio â€”â€” */
.ec-panel {
  padding-left: 0;
  padding-right: 0;
}
.ec-panel > .ec-panel-head,
.ec-panel > #ec-body,
.ec-panel > #ecs-body {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
.ec-panel-head {
  padding-top: 0.85rem;
  padding-bottom: 0.75rem;
}
.ec-doc {
  padding: 0.4rem 0 1rem !important;
}
.ec-hero,
.ec-summary,
.ecs-puestos-bar,
.ec-sheet,
.ecs-puesto,
.ec-idle,
.ec-empty {
  margin-left: 0.15rem;
  margin-right: 0.15rem;
}
.ec-hero {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}
.ec-summary {
  gap: 0.55rem !important;
  margin-bottom: 0.75rem !important;
}
.ecs-puestos-bar {
  padding: 0.45rem 0.85rem !important;
  margin-bottom: 0.65rem !important;
}
.ecs-puesto {
  margin-bottom: 0.75rem !important;
  border-radius: 12px !important;
  overflow: hidden;
}
.ecs-puesto-head {
  padding: 0.55rem 0.85rem !important;
}
.ecs-puesto-body {
  padding: 0 !important;
}
.ec-sheet {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 0.65rem !important;
}
.ecs-puesto-body .ec-sheet {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  width: 100% !important;
}
.ec-sheet .ec-table,
.ec-sheet .ec-table.ec-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
}
.ec-sheet .ec-table col:nth-child(1) { width: 30%; }
.ec-sheet .ec-table col:nth-child(2) { width: 22%; }
.ec-sheet .ec-table col:nth-child(3),
.ec-sheet .ec-table col:nth-child(4),
.ec-sheet .ec-table col:nth-child(5) { width: 16%; }
.ec-sheet .ec-table thead th,
.ec-sheet .ec-table tbody td {
  box-sizing: border-box;
  padding: 0.34rem 0.55rem !important;
  border-right: 1px solid rgba(20, 48, 26, 0.14) !important;
  vertical-align: middle;
  white-space: nowrap;
}
.ec-sheet .ec-table thead th:last-child,
.ec-sheet .ec-table tbody td:last-child {
  border-right: 0 !important;
}
.ec-sheet .ec-table thead th.ec-date,
.ec-sheet .ec-table tbody td.ec-date {
  text-align: center !important;
}
.ec-sheet .ec-table thead th:first-child,
.ec-sheet .ec-table tbody td:first-child {
  text-align: left !important;
  white-space: normal !important;
}
.ec-sheet .ec-table td.ec-desc {
  display: table-cell !important;
  text-align: left !important;
  padding: 0.34rem 0.55rem !important;
  margin: 0 !important;
}
.ec-sheet .ec-table .ec-desc-main {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
}
.ec-group-row > td {
  padding: 0.34rem 0.55rem !important;
  border-bottom: 1px solid var(--line) !important;
  white-space: normal !important;
  vertical-align: middle !important;
}
.ec-group-row.ec-tone-alq > td { background: rgba(245, 166, 35, 0.12) !important; }
.ec-group-row.ec-tone-slv > td { background: rgba(35, 108, 52, 0.08) !important; }
.ec-group-row.ec-tone-luz > td { background: rgba(0, 188, 212, 0.1) !important; }
.ec-group-row.ec-tone-agu > td { background: rgba(33, 150, 243, 0.1) !important; }
.ec-group-row.ec-tone-otr > td { background: rgba(35, 108, 52, 0.06) !important; }
.ec-group-title {
  text-align: left !important;
}
.ec-group-title .ec-concepto-kicker {
  margin: 0;
  line-height: 1.15;
}
.ec-group-title .ec-concepto-title {
  margin: 0.02rem 0 0;
  font-size: 0.84rem;
  line-height: 1.2;
}
.ec-group-tot {
  text-align: right !important;
  white-space: nowrap !important;
}
.ec-group-tot span {
  display: block;
  font-size: 0.64rem;
  color: var(--muted);
  line-height: 1.15;
}
.ec-group-tot strong {
  display: block;
  font-family: var(--display);
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--brand-deep);
  line-height: 1.2;
}
@media (max-width: 820px) {
  .ec-panel > .ec-panel-head,
  .ec-panel > #ec-body,
  .ec-panel > #ecs-body {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }
}
