/* Gestión Club — estilo de la referencia local aportada por el usuario. */
:root {
  color-scheme: light;
  --bg: #eef4f6;
  --bg-elevated: #f7fafb;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface2: #edf4f5;
  --text: #15323d;
  --muted: #637982;
  --line: rgba(25, 103, 122, 0.12);
  --primary: #19677a;
  --primary-strong: #174354;
  --primary-soft: #dceef1;
  --primary-glow: rgba(25, 103, 122, 0.22);
  --accent: #e9a64d;
  --accent-soft: rgba(233, 166, 77, 0.18);
  --success: #17865d;
  --success-soft: rgba(23, 134, 93, 0.12);
  --danger: #b54a4a;
  --danger-soft: rgba(181, 74, 74, 0.12);
  --shadow: 0 24px 60px rgba(17, 45, 55, 0.12);
  --shadow-sm: 0 8px 24px rgba(17, 45, 55, 0.08);
  --radius: 14px;
  --radius-lg: 22px;
  --tap: 44px;
  --glass: blur(18px) saturate(1.2);
  --sidebar-w: 232px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

:root[data-theme="oscuro"] {
  color-scheme: dark;
  --bg: #0d171d;
  --bg-elevated: #121f26;
  --surface: rgba(23, 40, 49, 0.82);
  --surface-solid: #172831;
  --surface2: #1f3742;
  --text: #f3f8f9;
  --muted: #a8bbc1;
  --line: rgba(88, 183, 197, 0.14);
  --primary: #58b7c5;
  --primary-strong: #a6e2e8;
  --primary-soft: #213f49;
  --primary-glow: rgba(88, 183, 197, 0.2);
  --accent: #f2b966;
  --accent-soft: rgba(242, 185, 102, 0.16);
  --success: #5dd39b;
  --success-soft: rgba(93, 211, 155, 0.14);
  --danger: #ff8a8a;
  --danger-soft: rgba(255, 138, 138, 0.14);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.25);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height:100%; min-height:100%; overflow:hidden; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.65; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.75rem, 3.5vw, 2.6rem); letter-spacing: -0.04em; line-height: 1.1; }
h2 { letter-spacing: -0.03em; line-height: 1.15; }
a { color: var(--primary); }
img, svg { display: block; max-width: 100%; }
.srOnly {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.boot {
  min-height: 100vh; display: grid; place-items: center; color: var(--muted);
}

/* —— Icons —— */
.appIcon, .navIcon, .buttonIcon, .metricIcon, .recordIcon, .toastIcon {
  width: 18px; height: 18px; flex: 0 0 auto;
}
.buttonIcon { width: 17px; height: 17px; }
.metricIcon { width: 16px; height: 16px; color: var(--primary); }
.navIcon { width: 20px; height: 20px; }

/* —— Focus —— */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* —— Eyebrow / muted —— */
.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow.light { color: #c9edf0; }
.muted { color: var(--muted); margin: 0; }

/* ===================== ACCESS / LOGIN ===================== */
.accessScreen {
  height:100vh;
  height:100dvh;
  display: grid;
  place-items: center;
  padding:0;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 60%),
    radial-gradient(ellipse 70% 50% at 90% 80%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%),
    var(--bg);
}
.accessMesh {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
}
.accessMesh span {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55;
  animation: meshFloat 18s var(--ease) infinite alternate;
}
.accessMesh span:nth-child(1) {
  width: 42vmax; height: 42vmax; left: -12vmax; top: -10vmax;
  background: color-mix(in srgb, var(--primary) 28%, transparent);
}
.accessMesh span:nth-child(2) {
  width: 36vmax; height: 36vmax; right: -8vmax; bottom: -12vmax;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  animation-delay: -6s;
}
.accessMesh span:nth-child(3) {
  width: 28vmax; height: 28vmax; left: 40%; top: 50%;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  animation-delay: -12s;
}
@keyframes meshFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(4%, -3%) scale(1.08); }
}

.themeCorner {
  position: absolute; z-index: 5;
  right: max(16px, 2.5vw); top: max(16px, 2.5vw);
  min-height: var(--tap);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  backdrop-filter: var(--glass);
  color: var(--text);
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 0.8125rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.themeCorner:hover {
  border-color: var(--primary); color: var(--primary); transform: translateY(-1px);
}

.accessSplit {
  position: relative; z-index: 1;
  width:100%; height:100%; min-height:0;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
  backdrop-filter: var(--glass);
  border:0; border-radius:0;
  overflow: hidden;
  box-shadow:none;
  animation: accessIn 0.5s var(--ease);
}
@keyframes accessIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.accessBrand {
  position: relative; overflow: hidden;
  padding:clamp(24px, 4vw, 56px);
  color: #f7fbfb;
  background: linear-gradient(155deg, #123a48 0%, #174354 40%, #1a7180 100%);
  display:flex; flex-direction:column; justify-content:center; gap:14px;
}
.accessBrand::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(233, 166, 77, 0.18), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(88, 183, 197, 0.2), transparent 45%);
  pointer-events: none;
}
.accessBrand::after {
  content: "";
  width: 280px; height: 280px;
  position: absolute; right: -120px; bottom: -140px;
  border: 36px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
}
.accessBrand > * { position: relative; z-index: 1; }

.brandLockup {
  display: flex; align-items: center; gap: 12px;
}
.brandMark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.8125rem; font-weight: 900; letter-spacing: 0.04em;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.brandLockup strong {
  font-size: 0.75rem; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: #e8f6f8;
}

.accessBrand h1 {
  font-size: clamp(2rem, 3.8vw, 2.85rem);
  max-width: 10ch; margin: 0; color: #fff;
}
.accessBrand .brandLead {
  max-width: 34ch; margin: 0;
  color: rgba(247, 251, 251, 0.82); font-size: 0.9375rem;
}
.accessBrand ul {
  list-style: none; padding: 4px 0 0; margin: 0;
  display: grid; gap: 10px; font-size: 0.875rem; font-weight: 650;
}
.accessBrand li {
  display: flex; align-items: flex-start; gap: 10px;
}
.accessBrand li .check {
  width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px;
  color: var(--accent);
}

/* Mini dashboard preview on brand panel */
.brandPreview {
  margin-top:16px; max-width:440px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}
.brandPreviewHeader {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; font-size: 0.6875rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.7);
}
.brandPreviewHeader span {
  padding: 3px 8px; border-radius: 999px;
  background: rgba(233, 166, 77, 0.25); color: #f7d9a8; font-size: 0.625rem;
}
.brandPreviewMetrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.brandPreviewMetrics article {
  padding: 10px 8px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  display: grid; gap: 4px;
}
.brandPreviewMetrics small {
  font-size: 0.625rem; color: rgba(255,255,255,0.55); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.brandPreviewMetrics strong {
  font-size: 1rem; letter-spacing: -0.03em; color: #fff;
}
.brandPreviewChart {
  margin-top: 10px; height: 36px;
  display: flex; align-items: flex-end; gap: 4px;
}
.brandPreviewChart i {
  flex: 1; border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #58b7c5, rgba(88, 183, 197, 0.35));
  opacity: 0.85;
}

.accessPanel {
  min-height:0; overflow-y:auto;
  padding:clamp(20px, 3vw, 40px);
  display:grid; align-content:safe center; gap:10px;
  background: var(--surface-solid);
}
.accessPanel > * { width:100%; max-width:440px; justify-self:center; }
.accessPanel h2 { font-size: 1.75rem; margin: 0 0 4px; }
.accessPanel .lead { color: var(--muted); margin: 0; font-size: 0.9375rem; }

.formStatus {
  min-height: 0; padding: 10px 12px; border-radius: 10px;
  color: var(--danger); background: var(--danger-soft);
  font-size: 0.8125rem; font-weight: 650;
}
.formStatus:empty { display: none; padding: 0; }

.field {
  display: grid; gap: 7px;
  color: var(--text);
  font-size: 0.6875rem; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.field .labelRow {
  display: flex; align-items: baseline; gap: 4px;
}
.field .req { color: var(--danger); font-weight: 800; }
.field small.hint {
  font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0; text-transform: none; color: var(--muted);
}
.field small.hint.fieldSuccess { color: var(--success); }

input, select, textarea {
  width: 100%; min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--bg-elevated);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  text-transform: none; letter-spacing: normal; font-weight: 500;
}
textarea { min-height: auto; resize: vertical; }
input:hover, select:hover, textarea:hover {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  background: var(--surface-solid);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.passwordField { display: flex; position: relative; }
.passwordField input { padding-right: 48px; }
.passwordToggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 9px;
  color: var(--muted); background: transparent;
  transition: color 0.15s, background 0.15s;
}
.passwordToggle:hover { color: var(--primary); background: var(--primary-soft); }
.passwordToggle .appIcon { width: 18px; height: 18px; }

.formGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.formGrid .wide { grid-column: 1 / -1; }
.checkLabel {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--tap);
  font-size: 0.875rem; font-weight: 650;
  text-transform: none; letter-spacing: 0;
  cursor: pointer;
}
.checkLabel input {
  width: 18px; min-height: 18px; accent-color: var(--primary);
}

.primaryButton {
  min-height: var(--tap);
  padding: 0 18px;
  border: 1px solid var(--primary);
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 92%, #fff), var(--primary));
  font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 20px var(--primary-glow);
  transition: transform 0.16s var(--ease), box-shadow 0.16s, filter 0.16s;
}
.primaryButton:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px var(--primary-glow);
}
.primaryButton:active:not(:disabled) { transform: translateY(0); }
:root[data-theme="oscuro"] .primaryButton {
  color: #0d171d;
  background: linear-gradient(180deg, #6bc5d2, var(--primary));
}

.secondaryButton {
  min-height: var(--tap);
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--primary);
  background: transparent;
  font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.secondaryButton:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.textButton {
  min-height: 36px; padding: 0; border: 0;
  color: var(--primary); background: transparent;
  text-align: left; font-weight: 800;
}
.textButton:hover { text-decoration: underline; }

.progressButton { position: relative; overflow: hidden; }
.progressButton .progressBar {
  position: absolute; inset: auto 0 0; height: 2px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
}
.progressButton.is-loading .progressBar {
  animation: progress 1.1s ease-in-out infinite;
}
@keyframes progress {
  0% { transform: scaleX(0.1); }
  65% { transform: scaleX(0.85); }
  100% { transform: scaleX(1); }
}

.accessActions { display: grid; gap: 10px; margin-top: 4px; }

.accessHelp {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--line);
}
.accessHelp strong { display: block; font-size: 0.8125rem; margin-bottom: 2px; }
.accessHelp span { font-size: 0.75rem; color: var(--muted); }

.helpLine {
  font-size: 0.75rem; color: var(--muted); text-align: center; margin: 0;
}
.helpLine button {
  border: 0; background: none; color: var(--primary);
  font-weight: 700; padding: 0; min-height: auto;
}
.helpLine button:hover { text-decoration: underline; }

/* ===================== APP SHELL ===================== */
.appShell {
  height:100vh; height:100dvh; overflow:hidden;
  display: flex;
  background:
    radial-gradient(ellipse 50% 40% at 100% 0%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 50%),
    var(--bg);
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  min-height: 100vh; min-height: 100dvh;
  position: sticky; top: 0;
  padding:10px 8px;
  display:flex; flex-direction:column; gap:12px;
  transition:width .18s var(--ease), flex-basis .18s var(--ease);
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
  backdrop-filter: var(--glass);
  border-right: 1px solid var(--line);
  z-index: 10;
}
.sidebar .brand {
  display: grid;
  grid-template-columns:40px minmax(0, 1fr);
  min-width:0; flex:1;
  column-gap:8px; align-items:center;
  color: var(--text); text-decoration: none;
  padding:4px; border-radius:10px;
  transition: background 0.15s;
}
.sidebar .brand:hover { background: var(--primary-soft); }
.sidebar .brand .brandMark {
  width:40px; height:40px; grid-row:span 2;
  background: linear-gradient(145deg, var(--primary-strong), var(--primary));
  border: 0; color: #fff; font-size: 0.75rem;
}
:root[data-theme="oscuro"] .sidebar .brand .brandMark {
  color: #0d171d;
  background: linear-gradient(145deg, var(--primary), #7fd0db);
}
.sidebar .brand strong { font-size:.8125rem; white-space:nowrap; }
.sidebar .brand small {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.6875rem; color: var(--muted);
}

.sidebar nav { display: grid; gap: 4px; }
.navItem {
  width: 100%; min-height: 44px;
  padding: 0 12px;
  border: 0; border-radius: 11px;
  color: var(--muted); background: transparent;
  text-align: left; font-weight: 700;
  display: inline-flex; align-items: center; gap: 10px;
  position: relative;
  transition: background 0.16s, color 0.16s, transform 0.16s;
}
.navItem:hover { color: var(--primary); background: var(--primary-soft); transform: translateX(2px); }
.navItem.active {
  color: var(--primary-strong);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}
.navItem.active::before {
  content: "";
  position: absolute; left: 0; top: 12px;
  width: 3px; height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.sidebarFooter { margin-top: auto; display: grid; gap: 4px; }
.iconTextButton {
  min-height: 40px; width: 100%;
  padding: 0 10px; border: 0; border-radius: 10px;
  color: var(--muted); background: transparent;
  text-align: left; font-weight: 700;
  display: inline-flex; align-items: center; gap: 9px;
  justify-content: flex-start;
  transition: color 0.15s, background 0.15s;
}
.iconTextButton:hover { color: var(--primary); background: var(--surface2); }
.iconTextButton.dangerText:hover { color: var(--danger); background: var(--danger-soft); }

.mainContent {
  flex: 1; min-width: 0;
  width:auto; height:100%; margin:0;
  padding:14px 16px;
  display:flex; flex-direction:column; overflow:hidden;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap:12px; margin-bottom:12px; padding-bottom:10px; flex-shrink:0;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  margin-left: -4px; margin-right: -4px; padding-left: 4px; padding-right: 4px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
}
.topbar .eyebrow { margin-bottom: 2px; }
.topbarActions { display: flex; align-items: center; gap: 10px; }
.userChip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.userChip > span {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 0.6875rem; font-weight: 900;
}
.userChip div { display: grid; line-height: 1.2; }
.userChip strong { font-size: 0.8125rem; }
.userChip small { font-size: 0.6875rem; text-transform: capitalize; color: var(--muted); }

.themeChip, .logoutChip {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-solid);
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.themeChip:hover, .logoutChip:hover {
  color: var(--primary); border-color: var(--primary); background: var(--primary-soft);
}
.logoutChip:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

.mobileMenuButton { display: none; }

/* ===================== DASHBOARD ===================== */
.metricGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px; margin:12px 0;
}
.metricCard {
  position: relative; overflow: hidden;
  min-height:100px; padding:12px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
  backdrop-filter: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: grid; align-content: space-between; gap: 10px;
  animation: reveal 0.5s var(--ease) both;
}
.metricCard:nth-child(1) { animation-delay: 0.05s; }
.metricCard:nth-child(2) { animation-delay: 0.1s; }
.metricCard:nth-child(3) { animation-delay: 0.15s; }
.metricCard:nth-child(4) { animation-delay: 0.2s; }
.metricCard::after {
  content: "";
  position: absolute; right: -20px; top: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  pointer-events: none;
}
.metricLabel {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 0.75rem; font-weight: 700;
}
.metricCard strong {
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
}
.trendChip {
  display: inline-flex; align-items: center; gap: 4px;
  width: max-content;
  padding: 3px 8px; border-radius: 999px;
  font-size: 0.6875rem; font-weight: 750;
  background: var(--success-soft); color: var(--success);
}
.trendChip.down { background: var(--danger-soft); color: var(--danger); }
.trendChip.neutral { background: var(--surface2); color: var(--muted); }
.sparkline { width: 72px; height: 28px; margin-left: auto; color: var(--primary); opacity: 0.7; }
.metricTop { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }

.chartRow {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap:12px; margin-bottom:0; align-items:start;
}
.glassCard {
  padding:14px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
  backdrop-filter: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  animation: reveal 0.5s var(--ease) 0.22s both;
}
.glassCard h2, .glassCard h3 {
  margin: 0 0 4px; font-size: 1rem; letter-spacing: -0.02em;
}
.glassCard .cardMeta {
  margin:0 0 10px; font-size:.8125rem; color:var(--muted);
}
.chartSvg { width:100%; height:auto; max-height:240px; overflow:visible; }
.chartSvg .bar { fill: var(--primary); opacity: 0.85; transition: opacity 0.15s; }
.chartSvg .bar:hover { opacity: 1; }
.chartSvg .bar.accent { fill: var(--accent); }
.chartSvg .axis { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chartSvg .gridLine { stroke: var(--line); stroke-width: 1; }

.quickActions {
  display:grid; gap:6px;
}
.quickActions button {
  min-height:44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.quickActions button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
  transform: translateX(2px);
}

/* ===================== SECTIONS / TABLES ===================== */
.sectionHeader {
  display: flex; justify-content: space-between; align-items: center;
  gap:10px; margin-bottom:10px; flex-shrink:0;
  animation: reveal 0.4s var(--ease) both;
}
.sectionHeader .muted { max-width: 52ch; }

.tabs {
  display: flex; gap: 4px;
  padding: 4px;
  width: max-content; max-width: 100%;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--line);
  margin-bottom:10px; flex-shrink:0;
}
.tabs button {
  min-height: 38px; padding: 0 16px;
  border: 0; border-radius: 9px;
  color: var(--muted); background: transparent;
  font-weight: 800; font-size: 0.8125rem;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.tabs button.active {
  color: var(--primary-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}
.tabs button:hover:not(.active) { color: var(--primary); }

.searchBar {
  width: min(100%, 420px);
  display:flex; gap:8px; margin:0 0 10px; flex-shrink:0;
  position: relative;
}
.searchBar .searchIcon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; width: 16px; height: 16px;
}
.searchBar input { padding-left: 38px; }
.searchBar button {
  min-width: 96px; min-height: var(--tap);
  border: 1px solid var(--line); border-radius: 11px;
  color: var(--text); background: var(--surface-solid);
  font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.searchBar button:hover { color: var(--primary); border-color: var(--primary); }

.dataTableWrap {
  flex:1; min-height:0; position:relative; overflow:auto; overscroll-behavior:contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
  scrollbar-color: color-mix(in srgb, var(--muted) 50%, transparent) transparent;
  scrollbar-width: thin;
  animation: reveal 0.45s var(--ease) 0.08s both;
}
.dataTableWrap table { min-width:720px; width:100%; border-collapse:separate; border-spacing:0; margin:0; }
.dataTableWrap th {
  padding:10px;
  color: var(--muted); background: var(--surface2);
  text-align: left; text-transform: uppercase;
  letter-spacing: 0.07em; font-size: 0.625rem;
  border-bottom: 1px solid var(--line);
  position:sticky; top:0; z-index:2;
}
.dataTableWrap td {
  padding:8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.dataTableWrap tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface2) 45%, transparent); }
.dataTableWrap tbody tr { transition: background 0.14s; }
.dataTableWrap tbody tr:hover { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.dataTableWrap tbody tr:last-child td { border-bottom: 0; }
.dataTableWrap td strong, .dataTableWrap td small { display: block; }
.dataTableWrap td small { margin-top: 2px; font-size: 0.6875rem; color: var(--muted); }
.amount { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

.typeBadge, .status {
  display: inline-flex; align-items: center;
  min-height: 24px; padding: 2px 9px;
  border-radius: 999px;
  color: var(--muted); background: var(--surface2);
  font-size: 0.6875rem; font-weight: 800; text-transform: capitalize;
}
.status.ok { color: var(--success); background: var(--success-soft); }
.status.warn { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, #000); }
:root[data-theme="oscuro"] .status.warn { color: var(--accent); }
.typeBadge.vitalicio { color: color-mix(in srgb, var(--accent) 80%, #000); background: var(--accent-soft); }
:root[data-theme="oscuro"] .typeBadge.vitalicio { color: var(--accent); }
.typeBadge.honorario { color: var(--primary); background: var(--primary-soft); }

.tableAction {
  min-height: 34px; padding: 0 8px; border: 0;
  color: var(--primary); background: transparent;
  font-weight: 800;
  display: inline-flex; align-items: center; gap: 5px;
}
.tableAction:hover { text-decoration: underline; }

.tableScrollCue {
  display: none; align-items: center; justify-content: flex-end; gap: 6px;
  flex-shrink:0; padding:0 2px 5px; color:var(--muted); font-size:.6875rem; font-weight:750;
}

.simpleList {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
  overflow: hidden;
}
.simpleList > div {
  display: flex; gap: 12px; align-items: center;
  min-height: 56px; padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.simpleList > div:last-child { border-bottom: 0; }
.simpleList .tableAction { margin-left: auto; }

.emptyState, .pageState, .pageError {
  min-height: 220px;
  display: grid; place-content: center; justify-items: center;
  gap: 8px; color: var(--muted); text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-solid) 60%, transparent);
  padding: 32px;
}
.emptyState strong { color: var(--text); font-size: 1rem; }
.pageError { min-height: 100px; color: var(--danger); border-style: solid; background: var(--danger-soft); }

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeletons */
.skeletonGrid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 24px 0;
}
.skeleton {
  height: 120px; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface2) 25%, color-mix(in srgb, var(--surface2) 60%, #fff) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}
:root[data-theme="oscuro"] .skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, color-mix(in srgb, var(--surface2) 70%, #fff) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ===================== REPORTS ===================== */
.reportIntro {
  max-width: 640px; margin-bottom: 20px;
  animation: reveal 0.4s var(--ease) both;
}
.reportIntro h2 { margin-bottom: 8px; font-size: 1.5rem; }
.reportIntro p:last-child { color: var(--muted); margin: 0; }
.reportStats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px;
}
.reportStats article {
  padding: 16px; border-radius: 12px;
  background: var(--surface-solid); border: 1px solid var(--line);
}
.reportStats small { color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.reportStats strong { display: block; margin-top: 6px; font-size: 1.35rem; letter-spacing: -0.03em; }

/* Informe mensual: controles estables y resultados desplazables. */
.reportHeading { font-size:1.15rem; margin:0 0 4px; }
#informePanel > .sectionHeader { flex-shrink:0; margin-bottom:10px; }
#informePanel > .sectionHeader .muted { margin-bottom:0; }
.monthlyReport { flex:1; min-height:0; display:flex; flex-direction:column; overflow:auto; }
.monthlyReport > .tableRegion { flex:1 0 300px; min-height:300px; }
.reportFilterPanel { flex-shrink:0; margin-bottom:10px; border-bottom:1px solid var(--line); }
.reportFilterPanel > summary { min-height:44px; padding:10px 0; cursor:pointer; font-weight:700; font-size:13px; }
.reportFilterPanel > summary span { margin-left:8px; color:var(--muted); font-weight:500; font-size:12px; }
.reportFilterPanel .reportFilters { margin:8px 0; }
.reportActions, .reportExports { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.reportFilters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; flex-shrink:0; }
.reportFilters > label { display:grid; gap:5px; font-size:12px; font-weight:700; color:var(--muted); min-width:0; }
.reportFilters select { min-width:0; min-height:44px; width:100%; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:var(--surface-solid); color:var(--text); }
.reportCheck { display:flex; align-items:center; gap:8px; min-height:44px; font-size:12px; font-weight:650; color:var(--muted); }
.reportCheck input { width:18px; height:18px; accent-color:var(--primary); }
.reportScope, .reportCount { font-size:12px; color:var(--muted); margin:4px 0 10px; flex-shrink:0; }
.monthlyReport .reportStats { margin-bottom:10px; flex-shrink:0; }
.monthlyReport .reportStats article { padding:10px 14px; }
.monthlyReport .reportStats strong { font-size:1.25rem; margin-top:3px; }
.reportStats strong { overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.reportAmountCompact { display:none; }
.negativeAmount { color:var(--danger); }
.reportToolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; flex-shrink:0; flex-wrap:wrap; }
.reportView { display:flex; gap:4px; padding:4px; background:var(--surface2); border-radius:11px; }
.reportView button { min-height:44px; padding:8px 12px; border:0; border-radius:8px; background:transparent; color:var(--muted); font-weight:700; font-size:13px; }
.reportView button.active { background:var(--surface-solid); color:var(--primary-strong); box-shadow:var(--shadow-sm); }
.reportWarnings { flex-shrink:0; font-size:12px; padding:8px 12px; margin-bottom:8px; border:1px solid color-mix(in srgb,var(--accent) 60%,var(--line)); border-radius:10px; background:var(--accent-soft); }
.reportWarnings summary { min-height:44px; display:list-item; cursor:pointer; font-weight:700; padding:12px 0; }
.reportWarnings[open] { max-height:160px; overflow:auto; }
.reportWarnings ul { padding-left:18px; margin-bottom:4px; }
.reportWarnings li { margin-bottom:6px; }
.informeTable { min-width:620px; }
.dataTableWrap .informeTable th { padding:2px 10px; font-size:12px; letter-spacing:.04em; }
.informeTable thead button { min-height:44px; width:100%; padding:0; border:0; background:transparent; color:inherit; font-weight:inherit; text-align:inherit; white-space:nowrap; }
.informeTable tfoot th, .informeTable tfoot td { position:sticky; bottom:0; background:var(--surface2); border-top:1px solid var(--line); font-weight:700; z-index:1; }
.pageError .secondaryButton { margin-left:12px; }
@media(max-width:900px) {
  .monthlyReport .reportStats { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .monthlyReport .reportStats article { padding:10px; }
  .monthlyReport .reportStats strong { font-size:1.1rem; }
  .reportFilters { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
}
@media(max-width:560px) {
  #informePanel > .sectionHeader { flex-wrap:wrap; }
  .reportActions { width:100%; justify-content:flex-end; }
  .reportActions .secondaryButton, .reportActions .primaryButton { padding:0 10px; font-size:13px; }
  .reportActions .reportExports { margin-left:0; }
  .reportActions .reportExports .secondaryButton { padding:0 10px; }
  .reportScope { margin-bottom:6px; }
  .monthlyReport .reportStats article { padding:8px; }
  .monthlyReport .reportStats strong { font-size:.9rem; }
  .reportAmountFull { display:none; }
  .reportAmountCompact { display:inline; }
  .reportToolbar { gap:6px; }
  .reportView { width:100%; }
  .reportView button { flex:1; }
  .reportExports { margin-left:auto; }
  .reportExports .secondaryButton { padding:0 12px; }
  .reportCount { margin-bottom:6px; }
  .informeTable th, .informeTable td { padding:8px 10px; }
  .monthlyReport { overflow:auto; }
  .monthlyReport > .tableRegion { flex:1 0 300px; min-height:300px; }
  .reportFilters select { font-size:16px; }
  .reportWarnings summary { min-height:44px; }
}

/* ===================== MODALS ===================== */
.appModal {
  position: fixed; z-index: 50; inset: 0;
  display: grid; place-items: center;
  padding: 18px;
  background: rgba(12, 27, 33, 0.55);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.18s ease-out;
}
.appModalPanel {
  width: min(100%, 720px);
  max-height: calc(100vh - 36px); max-height: calc(100dvh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  animation: modalIn 0.25s var(--ease);
}
.appModalPanel header {
  min-height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface-solid); z-index: 1;
}
.appModalPanel h2 { margin: 0; font-size: 1.25rem; }
.modalClose {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--muted); background: var(--surface2);
  transition: color 0.15s, background 0.15s;
}
.modalClose:hover { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
.modalBody { padding: 22px; }
.modalForm { display: grid; gap: 16px; }
.modalForm input::placeholder, .proveedorSearch input::placeholder { color:var(--muted); opacity:1; }
.optionalLabel { color:var(--muted); text-transform:none; letter-spacing:0; font-weight:600; }
.lookupField { display:flex; align-items:center; gap:6px; min-width:0; }
.lookupField input:not([type="hidden"]) { flex:1; min-width:0; text-overflow:ellipsis; }
.lookupButton { flex:0 0 44px; display:grid; place-items:center; width:44px; min-height:44px; border:1px solid var(--line); border-radius:11px; background:var(--surface2); color:var(--primary); }
.lookupButton:hover { background:var(--primary-soft); border-color:var(--primary); }
.lookupButton[hidden] { display:none; }
.proveedorSelector { z-index:60; }
.gastoAdjuntoDialog { z-index:60; }
.gastoAdjuntoDialog .appModalPanel { display:flex; flex-direction:column; }
.gastoAdjuntoDialog .modalBody { min-height:0; overflow:auto; }
.adjuntoResults { min-height:120px; }
.adjuntoList { display:grid; }
.adjuntoRow { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 0; border-bottom:1px solid var(--line); }
.adjuntoRow:last-child { border-bottom:0; }
.adjuntoRow > div:first-child { min-width:0; }
.adjuntoRow strong { display:block; overflow-wrap:anywhere; font-size:14px; }
.adjuntoRow small { display:block; margin-top:5px; color:var(--muted); }
.adjuntoActions { display:flex; flex-shrink:0; gap:8px; flex-wrap:wrap; }
.adjuntoActions a { display:inline-flex; align-items:center; text-decoration:none; }
.field input[type="file"] { max-width:100%; overflow:hidden; }
.comprobanteControl { display:flex; flex-wrap:wrap; align-items:center; gap:8px; min-width:0; }
.comprobanteControl input[type="file"] { flex:1 1 220px; min-width:0; }
.comprobanteControl .secondaryButton { flex:0 0 auto; font-size:.875rem; text-transform:none; letter-spacing:0; }
.field input[type="file"]::file-selector-button { min-height:44px; margin-right:8px; border:1px solid var(--line); border-radius:8px; background:var(--surface2); color:var(--text); cursor:pointer; }
@media (max-width:600px) {
  .adjuntoRow { flex-direction:column; align-items:stretch; }
  .adjuntoActions { justify-content:flex-start; }
}
.proveedorSelector .appModalPanel { display:flex; flex-direction:column; }
.proveedorSelector .modalBody { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.proveedorSearch { flex-shrink:0; padding-bottom:14px; }
.proveedorResults { overflow:auto; min-height:120px; }
.selectorStatus { margin:0; padding:22px 0; color:var(--muted); display:grid; gap:12px; }
.selectorCount { margin:0 0 10px; font-size:12px; color:var(--muted); }
.proveedorList { display:grid; }
.proveedorOption { width:100%; min-height:64px; padding:12px 8px; display:flex; justify-content:space-between; align-items:center; gap:12px; border:0; border-bottom:1px solid var(--line); background:transparent; text-align:left; }
.proveedorOption:hover, .proveedorOption[aria-pressed="true"] { background:var(--primary-soft); }
.proveedorOption > span { min-width:0; display:grid; gap:4px; overflow-wrap:anywhere; }
.proveedorOption strong { font-size:14px; }
.proveedorOption small { color:var(--muted); font-size:12px; }
.proveedorOption .appIcon { color:var(--primary); }
.modalForm .formActions {
  display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  padding-top: 4px;
}
.successMessage { display: grid; gap: 14px; }
.successMessage p { margin: 0; }
.successCode {
  padding: 14px; border-radius: 12px; background: var(--surface2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.875rem;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ===================== TOASTS ===================== */
.toastHost {
  position: fixed; z-index: 60;
  right: 16px; bottom: 16px;
  display: grid; gap: 8px;
  width: min(calc(100% - 32px), 360px);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: toastIn 0.3s var(--ease);
  font-size: 0.875rem; font-weight: 650;
}
.toast.success { border-color: color-mix(in srgb, var(--success) 40%, var(--line)); }
.toast.success .toastIcon { color: var(--success); }
.toast.error { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.toast.error .toastIcon { color: var(--danger); }
.toast.info .toastIcon { color: var(--primary); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ===================== MOBILE NAV ===================== */
.mobileNav { display: none; }
.mobileMenuLayer { display: none; }
.compatibilityNotice { display: none; }

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

@media (max-width: 900px) {
  .accessSplit { grid-template-columns:1fr; width:100%; min-height:0; }
  .accessBrand { display: none; }
  .sidebar { display: none; }
  .mainContent { padding:12px 12px calc(78px + env(safe-area-inset-bottom)); }
  .mobileMenuButton {
    min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 0 10px;
    border: 1px solid var(--line); border-radius: 11px;
    color: var(--text); background: var(--surface-solid);
    font-size: 0.6875rem; font-weight: 800;
  }
  .mobileNav {
    position: fixed; z-index: 30;
    inset: auto 0 0;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(68px + env(safe-area-inset-bottom));
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
    backdrop-filter: blur(16px);
  }
  .mobileNavItem {
    min-width: 0; min-height: 56px !important;
    display: grid !important;
    grid-template-rows: 22px auto;
    align-content: center; justify-items: center; gap: 2px;
    padding: 3px 2px !important;
    border: 0; border-radius: 10px;
    color: var(--muted); background: transparent;
    font-size: 0.6875rem !important; font-weight: 750; line-height: 1.15;
  }
  .mobileNavItem .navIcon { width: 20px; height: 20px; }
  .mobileNavItem.active {
    color: var(--primary);
    background: var(--primary-soft);
    box-shadow: inset 0 -2px 0 var(--accent);
  }
  .userChip div { display: none; }
  .themeChip, .logoutChip { display: none; }
  .toastHost { bottom: calc(80px + env(safe-area-inset-bottom)); right: 12px; left: 12px; width: auto; }
  .reportStats { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .tableScrollCue { display: flex; }
}

@media (max-width: 560px) {
  .accessScreen { padding: 0; }
  .accessSplit {
    min-height:0; height:100%;
    border: 0; border-radius: 0; width: 100%;
  }
  .accessPanel { padding:62px 18px 14px; gap:8px; }
  .themeCorner { top: 14px; right: 14px; }
  .themeCorner span { display: none; }
  .formGrid { grid-template-columns: 1fr; }
  .formGrid .wide { grid-column: auto; }
  .topbar { gap: 12px; }
  .sectionHeader {
    flex-direction: column; align-items: stretch;
  }
  .sectionHeader .primaryButton { width: 100%; justify-content: center; }
  .metricGrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metricCard { min-height:96px; padding:10px; }
  .skeletonGrid { grid-template-columns: 1fr 1fr; }
  .searchBar { width: 100%; }
  .accessHelp { flex-direction:row; align-items:center; padding:8px 10px; gap:8px; }
  .appModal { padding: 0; place-items: end center; }
  .appModalPanel {
    width: 100%; max-height: 92vh; max-height: 92dvh;
    border-radius: 18px 18px 0 0;
  }
  .tabs { width: 100%; }
  .tabs button { flex: 1; justify-content: center; }
}

@media (max-width: 374px) {
  .metricGrid { grid-template-columns: 1fr; }
  .compatibilityNotice {
    display: block; margin: 0 0 16px; padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line));
    border-radius: 10px;
    background: var(--accent-soft); font-size: 0.75rem;
  }
}

/* Mobile menu sheet */
@media (max-width: 900px) {
  .mobileMenuLayer {
    position: fixed; z-index: 40; inset: 0;
    display: grid; align-items: end;
    animation: fadeIn 0.16s ease-out;
  }
  .mobileMenuBackdrop {
    position: absolute; inset: 0; width: 100%;
    border: 0; background: rgba(12, 27, 33, 0.5);
  }
  .mobileMenuPanel {
    position: relative; z-index: 1;
    max-height: min(82dvh, 680px);
    display: grid; gap: 14px; overflow: auto;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    border: 1px solid var(--line); border-bottom: 0;
    border-radius: 18px 18px 0 0;
    background: var(--surface-solid);
    box-shadow: 0 -18px 44px rgba(6, 23, 30, 0.22);
    animation: mobileSheetIn 0.22s var(--ease);
  }
  .mobileMenuPanel header {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
  }
  .mobileMenuPanel header strong { font-size: 1.15rem; letter-spacing: -0.02em; }
  .mobileMenuClose {
    width: 44px; min-height: 44px; display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 10px;
    color: var(--text); background: var(--surface2);
  }
  .mobileMenuPanel nav { display: grid; gap: 4px; }
  .mobileMenuItem {
    min-height: 48px; width: 100%;
    display: flex; align-items: center; gap: 12px;
    padding: 0 12px; border: 0; border-radius: 10px;
    color: var(--muted); background: transparent;
    font-weight: 750; text-align: left;
  }
  .mobileMenuItem.active { color: var(--primary-strong); background: var(--primary-soft); }
  .mobileMenuFooter {
    display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line);
  }
}

@keyframes mobileSheetIn {
  from { opacity: 0.4; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  .accessMesh span { animation: none; }
}

/* Adaptación a la SPA y sus controles operativos. */
.sidebarHeader { display:flex; align-items:center; gap:6px; }
.sidebarToggle {
  width:44px; height:44px; flex:0 0 44px; display:grid; place-items:center;
  border:1px solid var(--line); border-radius:10px;
  color:var(--muted); background:var(--surface2);
}
.sidebarToggle:hover { color:var(--primary); border-color:var(--primary); }
.sidebarCollapsed { --sidebar-w:72px; }
.sidebarCollapsed .sidebarHeader { flex-direction:column; gap:4px; }
.sidebarCollapsed .brand { grid-template-columns:40px; flex:none; padding:2px; }
.sidebarCollapsed .brand strong, .sidebarCollapsed .brand small,
.sidebarCollapsed .navItem span, .sidebarCollapsed .sidebarFooter span { display:none; }
.sidebarCollapsed .navItem, .sidebarCollapsed .sidebarFooter .iconTextButton { justify-content:center; padding:0; }
.sidebarCollapsed .navItem:hover { transform:none; }
.topbar h1 { font-size:1.65rem; }
.workspaceBody { flex:1; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
.workspaceBody > [role="tabpanel"] { flex:1; min-height:0; display:flex; flex-direction:column; }
.workspaceBody.dashboardBody { display:block; overflow:auto; overscroll-behavior:contain; }
.tableRegion { flex:1; min-height:0; display:flex; flex-direction:column; }
.workspaceBody .simpleList { flex:1; min-height:0; overflow:auto; align-content:start; }
.simpleList > div { padding:6px 10px; }
.workspaceBody .emptyState { flex:1; min-height:0; padding:20px; }
.workspaceBody .loadingView { min-height:0; overflow:auto; }
.reportIntro { flex-shrink:0; padding:0 0 10px; margin:0; }
.reportIntro h2 { margin:0 0 4px; font-size:1.15rem; }
.reportIntro p:last-child { margin:0; }
.formGrid { gap:10px; }
.field { gap:5px; }
.modalBody { padding:16px; }
.appModalPanel header { padding:14px 16px; }
.accessPanel { position:relative; }
#accessHelp {
  max-height:180px; overflow:auto; box-shadow:var(--shadow-sm);
}
@media(max-width:900px) {
  .accessPanel { padding:60px max(18px, calc((100% - 440px) / 2)) 14px; }
  .themeCorner { top:10px; right:14px; }
}
@media(max-width:560px) {
  .mainContent { padding:10px 10px calc(78px + env(safe-area-inset-bottom)); }
  .topbar { margin-bottom:10px; padding-bottom:8px; }
  .sectionHeader { gap:8px; }
  .sectionHeader { flex-direction:row; align-items:center; }
  .sectionHeader > div, .sectionHeader > .muted { min-width:0; flex:1; }
  .sectionHeader .muted { font-size:.8125rem; overflow-wrap:anywhere; }
  .sectionHeader .primaryButton { width:auto; flex-shrink:0; padding:0 12px; font-size:.8125rem; }
  .accessPanel { padding:60px 18px 12px; }
  .accessPanel input, .accessPanel select, .accessPanel textarea { font-size:16px; }
  .accessPanel .lead { font-size:14px; }
}
@media(max-height:700px) {
  .accessPanel[data-form="login"] { gap:6px; }
  .accessPanel[data-form="login"] .lead { display:none; }
  .accessPanel[data-form="login"] .accessHelp { padding:6px 10px; }
  .brandPreview { display:none; }
}
@media(min-width:561px) and (max-height:540px) {
  .accessPanel[data-form="login"] { padding:12px 20px; grid-template-columns:repeat(3, minmax(0, 1fr)); }
  .accessPanel[data-form="login"] > :not(.field) { grid-column:1 / -1; max-width:660px; }
  .accessPanel[data-form="login"] .accessHeading { padding-right:54px; }
  .accessPanel[data-form="login"] .accessActions { grid-template-columns:1fr 1fr; gap:8px; }
  .themeCorner { top:8px; right:12px; }
  .themeCorner span { display:none; }
  .accessBrand ul { display:none; }
}
[hidden] { display:none !important; }
.is-loading:disabled { cursor:wait; }
#app { min-height:100dvh; }
.sidebar { height:100dvh; overflow:auto; }
.topbar > div:first-child { min-width:0; }
.topbar .eyebrow { overflow-wrap:anywhere; }
.topbarActions { flex-shrink:0; }
.appIcon, .mobileMenuIcon, .mobileMenuCloseIcon, .tableCueIcon { width:18px; height:18px; flex:0 0 auto; }
.themeChip, .logoutChip, .passwordToggle, .modalClose { width:44px; height:44px; min-height:44px; }
.textButton, .iconTextButton, .tableAction { min-height:44px; }
.helpLine button { min-width:44px; min-height:44px; padding:0 6px; }
.tabs button { min-height:44px; }
.searchBar input { min-width:0; }
.simpleList > div { flex-wrap:wrap; }
.requiredAttention { border-color:color-mix(in srgb,var(--accent) 65%,var(--line)); }
.formFeedback { margin:0; font-size:12px; color:var(--muted); }
.formFeedback.error { color:var(--danger); }
.primaryButton.is-error { background:var(--danger); border-color:var(--danger); color:white; }
.primaryButton.is-success { background:var(--success); border-color:var(--success); color:white; }
.chartSummary { margin:12px 0 0; color:var(--muted); font-size:12px; }
.recentChart { margin-top:20px; }
.recentChart h3 { font-size:14px; margin-bottom:8px; }
.chartSvg .axis { font-size:11px; }
.loadingView { position:relative; }
.loadingView .pageState { min-height:110px; }
.versionNotice {
  position:fixed; z-index:45; left:50%; bottom:20px; transform:translateX(-50%);
  width:min(calc(100% - 32px),510px); min-height:56px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:8px 9px 8px 16px; border:1px solid var(--line); border-radius:12px;
  color:var(--text); background:var(--surface-solid); box-shadow:var(--shadow);
}
.versionNotice button {
  min-height:44px; padding:0 12px; flex:0 0 auto;
  border:0; border-radius:9px; color:var(--surface-solid);
  background:var(--primary); font-weight:800;
}
@media(max-width:900px) {
  .sidebar { display:none; }
  .versionNotice { bottom:calc(80px + env(safe-area-inset-bottom)); }
  .mobileMenuFooter .iconTextButton { min-height:44px; }
}
@media(max-width:560px) {
  .topbar { align-items:flex-start; }
  .topbarActions { gap:6px; }
  .userChip { padding:4px; }
  .metricCard strong { font-size:clamp(20px,5.8vw,27px); overflow-wrap:anywhere; }
  .metricLabel { align-items:flex-start; font-size:11px; }
  .metricLabel .metricIcon { flex-shrink:0; }
  .glassCard { padding:12px; }
  .appModalPanel { max-height:100dvh; border-radius:16px 16px 0 0; }
  .modalBody { padding:18px; }
  .formActions > button { flex:1; }
  .modalForm input, .modalForm select, .modalForm textarea, .proveedorSearch input { font-size:16px; }
  .versionNotice { font-size:12px; }
  .workspaceBody #informePanel > .sectionHeader { display:block; }
  .workspaceBody #informePanel > .sectionHeader .muted { display:none; }
  .workspaceBody #informePanel > .sectionHeader .reportActions { display:flex; width:100%; margin-top:8px; }
  .monthlyReport .reportWarnings { padding:0 12px; }
}

.iconTextButton.active { color:var(--primary-strong); background:var(--primary-soft); }
.vinculoBadge {
  display:inline-flex; align-items:center; min-height:24px; padding:2px 9px;
  border-radius:999px; color:var(--primary-strong); background:var(--primary-soft);
  font-size:.6875rem; font-weight:800; white-space:nowrap;
}
.field.vinculoPanel {
  gap:8px; padding:12px 14px; border:1px solid var(--line); border-radius:12px;
  background:var(--surface2); font-size:.875rem; font-weight:500;
  text-transform:none; letter-spacing:0;
}
.vinculoPanel strong { font-size:.875rem; font-weight:800; overflow-wrap:anywhere; }
.vinculoPanel p { margin:0; color:var(--text); font-size:.8125rem; line-height:1.5; }
.vinculoAcciones { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.referenciaNombre {
  margin:0; color:var(--muted); font-size:.8125rem; font-weight:500; line-height:1.5;
  text-transform:none; letter-spacing:0; overflow-wrap:anywhere;
}
.referenciaNombre strong { color:var(--text); }
.clienteOpciones {
  display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px;
}
.modalForm[data-form="cliente"] .formGrid > .field { align-content:start; }
.modalForm[data-form="movimiento"] .formGrid > .field { align-content:start; }
.clienteOpciones .checkLabel { min-width:0; }
.clienteOpciones input { flex:0 0 18px; }
.altaSocioPanel {
  min-width:0; margin:0; padding:12px 14px 14px; display:grid; gap:10px;
  border:1px solid var(--line); border-radius:12px; background:var(--surface-solid);
}
.altaSocioPanel legend { padding:0 6px; font-size:.8125rem; font-weight:800; }
.altaSocioPanel > .hint { font-size:.75rem; font-weight:600; color:var(--muted); }
.clienteSelector { z-index:60; }
.clienteSelector .appModalPanel { width:min(100%, 880px); display:flex; flex-direction:column; }
.clienteSelector th { color:var(--text); }
.clienteSelector .modalBody { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.clienteSearch { flex-shrink:0; padding-bottom:14px; display:grid; gap:8px; }
.clienteSearch .muted { font-size:.8125rem; }
.clienteSearch input::placeholder { color:var(--muted); opacity:1; }
.clienteResults { flex:1 1 auto; min-height:120px; display:flex; flex-direction:column; overflow:auto; }
.yaSocioLabel { display:block; font-size:.75rem; font-weight:700; color:var(--muted); white-space:nowrap; }
.tablePagoAction { min-width:44px; min-height:44px; padding:0; justify-content:center; border-radius:10px; }
.tablePagoAction:hover { text-decoration:none; background:var(--primary-soft); }
.tablePagoAction[aria-disabled="true"] { opacity:.55; cursor:not-allowed; }
.tablePagoAction[aria-disabled="true"]:hover { background:transparent; }
.padronTable .padronIngresoCol { width:1%; text-align:center; white-space:nowrap; }
.socioFichaDialog { z-index:70; }
.socioFichaDialog .appModalPanel { width:min(100%, 560px); }
.socioFichaResult { min-height:120px; }
.socioFichaDatos { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px 16px; margin:0 0 14px; }
.socioFichaDatos div { min-width:0; }
.socioFichaDatos dt { font-size:.6875rem; font-weight:800; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.socioFichaDatos dd { margin:2px 0 0; overflow-wrap:anywhere; }
.socioFichaDialog .muted { font-size:.8125rem; }
.ayudaLayout {
  flex:1; min-height:0; display:grid;
  grid-template-columns:minmax(220px, 270px) minmax(0, 1fr); gap:16px;
}
.ayudaIndice {
  min-height:0; overflow:auto; overscroll-behavior:contain; padding:6px;
  border:1px solid var(--line); border-radius:var(--radius); background:var(--surface-solid);
}
.ayudaGrupo + .ayudaGrupo { border-top:1px solid var(--line); }
.ayudaGrupo > summary { min-height:44px; padding:12px 10px; cursor:pointer; font-size:.8125rem; font-weight:800; border-radius:9px; }
.ayudaGrupo > summary:hover { color:var(--primary); }
.ayudaGrupo ul { list-style:none; margin:0 0 6px; padding:0; display:grid; gap:2px; }
.ayudaIndiceItem {
  width:100%; min-height:44px; padding:8px 12px; border:0; border-radius:9px;
  color:var(--muted); background:transparent; text-align:left; font-size:.875rem; font-weight:650;
}
.ayudaIndiceItem:hover { color:var(--primary); background:var(--surface2); }
.ayudaIndiceItem.active { color:var(--primary-strong); background:var(--primary-soft); box-shadow:inset 3px 0 0 var(--accent); }
.ayudaContenido { min-height:0; overflow:auto; overscroll-behavior:contain; padding:4px 4px 24px; }
.ayudaGuia { max-width:72ch; display:grid; gap:12px; }
.ayudaGuia h2 { margin:0; font-size:1.35rem; }
.ayudaGuia h3 { margin:8px 0 0; font-size:1rem; letter-spacing:-0.01em; }
.ayudaGuia p { margin:0; line-height:1.6; }
.ayudaPasos { margin:0; padding-left:1.5em; display:grid; gap:8px; line-height:1.6; }
.ayudaPasos li { padding-left:4px; }
.ayudaPasos li::marker { color:var(--primary); font-weight:800; }
.ayudaDetalles { display:grid; gap:6px; }
.ayudaDetalle { border:1px solid var(--line); border-radius:11px; background:var(--surface-solid); }
.ayudaDetalle > summary { min-height:44px; padding:11px 14px; cursor:pointer; font-weight:700; }
.ayudaDetalle > p { padding:0 14px 12px; color:var(--muted); }
.ayudaFigura { margin:4px 0 0; display:grid; gap:8px; max-width:480px; }
.ayudaFigura img { width:100%; height:auto; border:1px solid var(--line); border-radius:14px; background:#fff; }
.ayudaFigura figcaption { display:flex; flex-wrap:wrap; align-items:center; gap:0 12px; color:var(--text); font-size:.8125rem; }
.ayudaFigura figcaption a { min-height:44px; display:inline-flex; align-items:center; font-weight:700; }
.ayudaNota { padding:10px 12px; border-radius:10px; background:var(--surface2); color:var(--text); font-size:.875rem; }
.ayudaAcciones { display:flex; flex-wrap:wrap; gap:8px; }
@media(max-width:900px) {
  .ayudaLayout { display:block; overflow:auto; overscroll-behavior:contain; }
  .ayudaIndice { overflow:visible; margin-bottom:16px; }
  .ayudaContenido { overflow:visible; padding:0 0 16px; }
}
@media(max-width:560px) {
  .socioFichaDatos { grid-template-columns:1fr; }
  .vinculoAcciones > button, .ayudaAcciones > button { flex:1; }
  .clienteSearch input { font-size:16px; }
}

/* Selector de socio para pagos: modal hijo 90vw con búsqueda, encabezado y paginador fijos. */
.fieldError { margin:0; color:var(--danger); font-size:.75rem; font-weight:700; letter-spacing:0; text-transform:none; }
.socioPagoField .lookupField input:not([type="hidden"]) { cursor:default; }
.appModal.socioSelector {
  --socioSelectorTop:max(5vh, calc(env(safe-area-inset-top) + 12px));
  --socioSelectorBottom:max(16px, calc(env(safe-area-inset-bottom) + 12px));
  z-index:60; display:flex; align-items:flex-start; justify-content:center;
  padding:var(--socioSelectorTop) 0 var(--socioSelectorBottom);
}
.appModal.socioSelector .appModalPanel {
  width:90vw; max-width:none;
  height:calc(100vh - var(--socioSelectorTop) - var(--socioSelectorBottom)); max-height:none;
  display:flex; flex-direction:column; overflow:hidden; border-radius:16px;
}
@supports (height:100dvh) {
  .appModal.socioSelector { --socioSelectorTop:max(5dvh, calc(env(safe-area-inset-top) + 12px)); }
  .appModal.socioSelector .appModalPanel { height:calc(100dvh - var(--socioSelectorTop) - var(--socioSelectorBottom)); }
}
.socioSelector .appModalPanel > header { flex-shrink:0; }
.socioSelector .modalBody { flex:1; min-height:0; display:flex; flex-direction:column; gap:10px; overflow:hidden; }
.socioSelectorSearch { flex-shrink:0; display:grid; gap:6px; }
.socioSelectorSearch .muted { font-size:.8125rem; }
.socioSelectorSearch input::placeholder { color:var(--muted); opacity:1; }
.socioSelectorResults { flex:1; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
.socioSelectorResults > .selectorStatus { min-height:0; overflow:auto; }
.socioSelector th { color:var(--text); }
.socioSelector .dataTableWrap { scroll-padding-top:48px; }
.socioSelector .dataTableWrap table { min-width:560px; }
.socioSelector tbody tr[data-socio-id] { cursor:pointer; }
.socioSelector tbody tr.isSelected { background:var(--primary-soft); }
.socioSelector tbody tr.isSelected td:first-child { box-shadow:inset 3px 0 0 var(--accent); }
.socioSelector td:first-child { font-variant-numeric:tabular-nums; white-space:nowrap; }
.socioSelectorPager { flex-shrink:0; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.socioSelectorPagina { flex:1; min-width:0; text-align:center; color:var(--muted); font-size:.75rem; font-weight:650; }
.socioSelectorPager [aria-disabled="true"] { opacity:.55; cursor:not-allowed; }
.socioSelectorPager [aria-disabled="true"]:hover { border-color:var(--line); background:transparent; transform:none; }
@media(max-width:560px) {
  .socioSelectorSearch input { font-size:16px; }
  .socioSelectorPager .secondaryButton { padding:0 12px; }
}
@media(max-height:560px) {
  #socioSelectorAyuda { display:none; }
}

/* Padrones de Socios y Clientes: encabezados ordenables en el servidor. */
.dataTableWrap .padronTable th[aria-sort] { padding:0 4px; }
.padronSortButton {
  width:100%; min-height:44px; padding:0 6px;
  display:inline-flex; align-items:center; gap:6px;
  border:0; border-radius:8px; background:transparent; color:inherit;
  font:inherit; font-weight:inherit; letter-spacing:inherit; text-transform:inherit;
  text-align:left; white-space:nowrap;
  transition:color 0.15s, background 0.15s;
}
.padronSortButton:hover { color:var(--primary); background:var(--primary-soft); }
.padronSortButton:focus-visible { outline:2px solid var(--primary); outline-offset:-2px; }
.padronSortIcon { flex:0 0 auto; font-size:.75rem; letter-spacing:0; opacity:.55; }
.padronTable th[aria-sort="ascending"] .padronSortButton,
.padronTable th[aria-sort="descending"] .padronSortButton { color:var(--primary-strong); }
.padronTable th[aria-sort="ascending"] .padronSortIcon,
.padronTable th[aria-sort="descending"] .padronSortIcon { color:var(--primary); opacity:1; }

/* Movimientos operativos: ingresos, pagos a proveedores, selector de entidades y envíos sin confirmar. */
.filaAcciones { display:inline-flex; align-items:center; gap:4px; }
.movimientoPager { margin-top:10px; }
.operativoFilters { margin-bottom:10px; }
.operativoFilters input { min-width:0; min-height:44px; padding:8px 10px; border-radius:10px; background:var(--surface-solid); }
.operativoBusquedaCampo { display:grid; gap:5px; min-width:0; font-size:12px; font-weight:700; color:var(--muted); }
.operativoBusqueda { display:flex; gap:6px; min-width:0; }
.operativoBusqueda input { flex:1; }
.operativoBusqueda input::placeholder { color:var(--muted); opacity:1; }
.operativoBusqueda .secondaryButton { flex:0 0 44px; width:44px; padding:0; }
.dataTableWrap .operativoTable { min-width:1020px; }
.operativoTable td:nth-child(4) { min-width:200px; overflow-wrap:anywhere; }
.operativoTable td:nth-child(5) { min-width:140px; overflow-wrap:anywhere; }
.dataTableWrap .operativoTable tfoot th, .dataTableWrap .operativoTable tfoot td {
  position:sticky; top:auto; bottom:0; z-index:1; padding:8px 10px;
  background:var(--surface2); border-top:1px solid var(--line); border-bottom:0; font-weight:700;
}
.dataTableWrap .operativoTable tfoot th { color:var(--text); font-size:.75rem; letter-spacing:0; text-transform:none; }
.appModal.entidadSelector { z-index:60; }
.entidadSelector .appModalPanel { width:min(100%, 880px); height:calc(100vh - 36px); max-height:720px; display:flex; flex-direction:column; overflow:hidden; }
@supports (height:100dvh) {
  .entidadSelector .appModalPanel { height:calc(100dvh - 36px); }
}
.entidadSelector .appModalPanel > header { flex-shrink:0; }
.entidadSelector .modalBody { flex:1; min-height:0; display:flex; flex-direction:column; gap:10px; overflow:hidden; }
.entidadSelector th { color:var(--text); }
.entidadSelector .dataTableWrap table { min-width:560px; }
.entidadSelector tbody tr[data-entidad-id] { cursor:pointer; }
.entidadSelector tbody tr.isSelected { background:var(--primary-soft); }
.entidadSelector tbody tr.isSelected td:first-child { box-shadow:inset 3px 0 0 var(--accent); }
.envioInciertoAviso {
  display:grid; gap:6px; padding:12px 14px;
  border:1px solid color-mix(in srgb, var(--accent) 60%, var(--line)); border-radius:12px;
  background:var(--accent-soft);
}
.envioInciertoAviso p { margin:0; font-size:.8125rem; line-height:1.5; }
.envioPendienteNotice {
  position:fixed; right:20px; bottom:88px; z-index:30;
  display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; max-width:min(460px, calc(100vw - 40px));
  padding:10px 10px 10px 16px; border:1px solid color-mix(in srgb, var(--accent) 60%, var(--line)); border-radius:var(--radius);
  background:var(--surface-solid); color:var(--text); box-shadow:inset 3px 0 0 var(--accent), var(--shadow-sm);
}
.envioPendienteNotice strong { flex:1 1 180px; min-width:0; font-size:.875rem; }
.envioPendienteNotice .secondaryButton { flex-shrink:0; min-height:var(--tap); }
.mainContent:has(.mobileMenuButton[aria-expanded="true"]) .envioPendienteNotice,
body:has(.appModal) .envioPendienteNotice { display:none; }
@media(max-width:900px) {
  .envioPendienteNotice { left:12px; right:12px; max-width:none; bottom:calc(148px + env(safe-area-inset-bottom)); }
}
@media(max-width:560px) {
  .operativoFilters > :nth-child(n+3) { grid-column:1 / -1; }
  .operativoFilters input, .operativoFilters select { font-size:16px; }
  .entidadSelector .appModalPanel { height:100vh; height:100dvh; max-height:100dvh; }
  .movimientoPager .secondaryButton { padding:0 12px; }
}

/* Pago de socio: varios períodos abonados en un único pago, con agregar y quitar accesibles. */
.socioPagoPeriodosField { align-content:start; min-width:0; }
.periodoResumen { margin:0; color:var(--muted); font-size:.8125rem; font-weight:600; letter-spacing:0; text-transform:none; overflow-wrap:anywhere; }
.periodoResumen:empty { display:none; }
.periodoLista { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:6px; min-width:0; }
.periodoItem {
  display:inline-flex; align-items:center; gap:6px; max-width:100%; min-height:var(--tap); padding:0 0 0 12px;
  border:1px solid var(--line); border-radius:11px; background:var(--surface2); color:var(--text);
  font-size:.875rem; font-weight:650; letter-spacing:0; text-transform:none;
}
.periodoNombre { display:inline-block; min-width:0; overflow-wrap:anywhere; }
.periodoNombre::first-letter { text-transform:uppercase; }
.periodoItem small { color:var(--muted); font-size:.6875rem; font-weight:600; font-variant-numeric:tabular-nums; }
.periodoQuitar {
  flex:0 0 var(--tap); width:var(--tap); min-height:var(--tap); display:grid; place-items:center;
  border:0; border-left:1px solid var(--line); border-radius:0 10px 10px 0; background:transparent; color:var(--muted);
}
.periodoQuitar:hover { color:var(--danger); background:var(--danger-soft); }
.periodoQuitar:focus-visible { outline-offset:-2px; }
.periodoVacio {
  display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; padding:10px 12px;
  border:1px dashed color-mix(in srgb,var(--accent) 65%,var(--line)); border-radius:11px; background:var(--accent-soft);
  color:var(--text); font-size:.8125rem; font-weight:600; letter-spacing:0; text-transform:none;
}
.periodoVacio span { flex:1 1 180px; min-width:0; overflow-wrap:anywhere; }
.periodoAgregar { display:flex; flex-wrap:wrap; gap:8px; min-width:0; }
.periodoAgregar input { flex:1 1 180px; min-width:0; }
.periodoAgregar .secondaryButton, .periodoVacio .secondaryButton { flex:0 0 auto; font-size:.875rem; letter-spacing:0; text-transform:none; }
.dataTableWrap td .periodoTexto { display:block; min-width:9ch; max-width:24ch; overflow-wrap:anywhere; }
.dataTableWrap .operativoTable td:nth-child(2) { min-width:160px; }
.operativoTable td:nth-child(2) small { overflow-wrap:anywhere; }
@media(max-width:560px) {
  .periodoAgregar .secondaryButton, .periodoVacio .secondaryButton { flex:1 1 100%; }
}

/* Recibo PDF por comprobante: acción de texto con carga local, sin icono nuevo ni cambios de layout. */
.reciboPdfAction { display:inline-grid; grid-template-areas:"reciboPdf"; align-items:center; justify-items:start; min-width:44px; min-height:44px; white-space:nowrap; border-radius:10px; }
.reciboPdfAction > span, .reciboPdfAction::before, .reciboPdfAction::after { grid-area:reciboPdf; }
.reciboPdfAction::before { content:"Descargar recibo PDF"; visibility:hidden; pointer-events:none; }
.reciboPdfAction::after { content:"Preparando PDF\2026"; visibility:hidden; pointer-events:none; }
.reciboPdfAction[aria-busy="true"] { cursor:progress; opacity:.7; text-decoration:none; }
.dataTableWrap .operativoTable { min-width:1180px; }

/* Sistema 1/2: selector global junto a la identidad, filtro del informe operativo y etiquetas por fila. */
.topbar { flex-wrap:wrap; row-gap:8px; }
.topbar > div:first-child { flex:1 1 220px; }
.topbarActions { flex-wrap:wrap; justify-content:flex-end; max-width:100%; min-width:0; }
.sistemaSelector { display:flex; align-items:center; gap:8px; min-width:0; }
.sistemaSelector label { color:var(--muted); font-size:.75rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; white-space:nowrap; cursor:pointer; }
.sistemaSelector select { width:auto; min-width:8.5rem; min-height:var(--tap); padding:8px 10px; border-radius:11px; background:var(--surface-solid); font-weight:750; cursor:pointer; }
.sistemaSelector select:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.sistemaBadge {
  display:inline-flex; align-items:center; width:max-content; min-height:22px; margin-top:4px; padding:1px 8px;
  border:1px solid transparent; border-radius:999px; color:var(--primary-strong); background:var(--primary-soft);
  font-size:.6875rem; font-weight:800; letter-spacing:0; text-transform:none; white-space:nowrap;
}
.sistemaBadge[data-sistema="2"] { color:color-mix(in srgb, var(--accent) 50%, #000); background:var(--accent-soft); }
:root[data-theme="oscuro"] .sistemaBadge[data-sistema="2"] { color:var(--accent); }
.sistemaBadge[data-sistema="sin-clasificar"] { color:color-mix(in srgb, var(--muted) 70%, var(--text)); background:var(--surface2); border-color:var(--line); border-style:dashed; }
:root[data-theme="oscuro"] .sistemaBadge[data-sistema="sin-clasificar"] { color:var(--muted); }
.dataTableWrap td .sistemaBadge { display:flex; }
.field.sistemaComprobante { gap:6px; }
.sistemaComprobanteValor { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; margin:0; font-size:.875rem; font-weight:600; letter-spacing:0; text-transform:none; }
.sistemaComprobanteValor .sistemaBadge { margin-top:0; min-height:28px; padding:2px 10px; font-size:.8125rem; }
.sistemaComprobanteValor .hint { flex:1 1 220px; min-width:0; }
.operativoFilters .operativoTipoCampo, .operativoFilters .operativoSistemaCampo, .operativoFilters .operativoBusquedaCampo { grid-column:span 2; }
.operativoSistemaCampo { display:grid; gap:5px; min-width:0; font-size:12px; font-weight:700; color:var(--muted); }
.operativoSistemaControles { display:flex; flex-wrap:wrap; gap:6px; min-width:0; }
.operativoSistemaControles select { flex:1 1 150px; min-width:0; min-height:44px; padding:8px 10px; border-radius:10px; background:var(--surface-solid); }
.operativoSistemaControles select:disabled { opacity:.6; cursor:not-allowed; }
.operativoSinClasificar { flex:0 0 auto; padding:0 12px; font-size:.8125rem; }
.operativoSinClasificar[aria-pressed="true"] { color:var(--primary-strong); border-color:var(--primary); background:var(--primary-soft); box-shadow:inset 0 0 0 1px var(--primary); }
.operativoSistemaAyuda { font-size:.75rem; font-weight:600; color:var(--muted); overflow-wrap:anywhere; }
.operativoAlcance { margin:0 0 8px; }
.operativoAlcance strong { color:var(--text); }
/* Movimientos operativos: cabecera compacta con ayuda en diálogo y filtros plegables. */
.reportHeadingRow { display:flex; align-items:center; gap:8px; min-width:0; }
.reportHeadingRow .reportHeading { margin:0; min-width:0; overflow-wrap:anywhere; }
.sectionHeader .reportHelpButton { flex:0 0 44px; width:44px; min-width:44px; height:44px; min-height:44px; padding:0; display:inline-grid; place-items:center; font-size:1rem; font-weight:700; line-height:1; }
.operativoFilterPanel > summary:focus-visible, .sectionHeader .reportHelpButton:focus-visible { outline:2px solid var(--primary); outline-offset:2px; border-radius:8px; }
.operativoFiltrosEstado { overflow-wrap:anywhere; }
.reportHelpDialog .appModalPanel { width:min(100%, 560px); }
.reportHelpDialog .modalClose { width:44px; height:44px; }
.reportHelpBody { display:grid; gap:10px; }
.reportHelpBody p { margin:0; }
@media(max-width:560px) {
  .topbar .topbarActions [data-conexion-indicador] { flex:1 1 100%; }
  .sistemaSelector { flex:1 1 auto; }
  .sistemaSelector select { flex:1; min-width:0; font-size:16px; }
  .operativoSistemaControles select { font-size:16px; }
  .operativoSinClasificar { flex:1 1 auto; }
}

/* Cuenta corriente por ficha y sistema: ficha elegida, saldos por sistema, filtros, historial y altas sin caja. */
.ccVista { flex:1; min-height:0; display:flex; flex-direction:column; gap:10px; overflow:auto; overscroll-behavior:contain; padding-bottom:4px; }
.ccVista > .tableRegion { flex:1 0 280px; min-height:280px; }
.ccVista > .emptyState, .ccVista > .pageError, .ccVista > .selectorStatus { flex:0 0 auto; }
.ccVista > .emptyState { min-height:160px; }
.ccVista .pageError { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:10px; }
.ccVista .pageError .secondaryButton { margin-left:0; }
.ccTitulo { margin:0; font-size:1.15rem; }
.ccTitulo:focus-visible { outline:2px solid var(--primary); outline-offset:2px; border-radius:6px; }
.ccFicha { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface-solid); }
.ccFichaDato { flex:1 1 220px; min-width:0; display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; }
.ccFichaEtiqueta { flex:0 0 100%; color:var(--muted); font-size:.6875rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.ccFichaDato strong { min-width:0; font-size:1rem; overflow-wrap:anywhere; }
.ccFichaNota { color:var(--muted); font-size:.75rem; font-weight:650; }
.ccSaldos { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
.ccSaldoCard { min-width:0; display:grid; align-content:start; gap:4px; padding:12px 14px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface-solid); }
.ccSaldoCard.isActive { border-color:var(--primary); box-shadow:inset 3px 0 0 var(--accent); }
.ccSaldoCard header { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px; }
.ccSaldoCard header .sistemaBadge { margin-top:0; }
.ccSaldoVista { color:var(--muted); font-size:.75rem; font-weight:800; }
.ccSaldoCard.isActive .ccSaldoVista { color:var(--primary-strong); }
.ccSaldoEtiqueta { color:var(--muted); font-size:.75rem; font-weight:700; }
.ccSaldoCard strong { font-size:clamp(1.2rem, 2vw, 1.6rem); letter-spacing:-0.03em; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.ccSaldoSignoTexto { color:var(--text); font-size:.8125rem; font-weight:700; }
.ccSaldoCard small { color:var(--muted); font-size:.75rem; overflow-wrap:anywhere; }
.ccNota, .ccAviso, .ccSinCaja { margin:0; padding:10px 12px; border-radius:10px; background:var(--surface2); color:var(--text); font-size:.8125rem; line-height:1.5; }
.ccAviso { border:1px solid color-mix(in srgb, var(--accent) 60%, var(--line)); background:var(--accent-soft); }
.ccAcciones { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.ccExportes { display:flex; flex-wrap:wrap; gap:8px; margin-left:auto; }
.ccFiltros { display:flex; flex-wrap:wrap; align-items:flex-end; gap:8px 10px; }
.ccFiltroCampo { flex:1 1 160px; max-width:220px; min-width:0; display:grid; gap:5px; color:var(--muted); font-size:12px; font-weight:700; }
.ccFiltroCampo input { min-height:44px; padding:8px 10px; border-radius:10px; background:var(--surface-solid); }
.ccFiltroAcciones { display:flex; flex-wrap:wrap; gap:8px; }
.ccVista .reportCount { margin:0; }
.dataTableWrap .ccTable { min-width:760px; }
.ccTable td:nth-child(2) { min-width:200px; overflow-wrap:anywhere; }
.ccTable thead th:first-child, .ccTable tbody td:first-child { white-space:nowrap; }
.dataTableWrap .ccTable tbody tr.ccArrastre { background:var(--surface2); }
.dataTableWrap .ccTable tfoot th, .dataTableWrap .ccTable tfoot td { position:sticky; top:auto; bottom:0; z-index:1; padding:8px 10px; background:var(--surface2); border-top:1px solid var(--line); border-bottom:0; color:var(--text); font-size:.8125rem; font-weight:700; letter-spacing:0; text-transform:none; }
.ccPager { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.ccPager span { flex:1; min-width:0; text-align:center; color:var(--muted); font-size:.75rem; font-weight:650; }
:root:not([data-theme="oscuro"]) .ccFiltroCampo, :root:not([data-theme="oscuro"]) .ccVista .reportCount, :root:not([data-theme="oscuro"]) .ccPager span, :root:not([data-theme="oscuro"]) .dataTableWrap .ccTable thead th, :root:not([data-theme="oscuro"]) .dataTableWrap .ccTable .ccArrastre small { color:color-mix(in srgb, var(--muted) 65%, var(--text)); }
.ccFichaFijaValor { display:grid; gap:2px; margin:0; font-size:.9375rem; font-weight:600; letter-spacing:0; text-transform:none; }
.ccFichaFijaValor strong { overflow-wrap:anywhere; }
.ccFichaFijaValor small { color:var(--muted); font-size:.75rem; }
.ccSaldoSigno { margin:0; color:var(--text); font-size:.8125rem; font-weight:700; }
.ccSaldoSigno:empty { display:none; }
.ccMovimientoContexto input[readonly] { cursor:default; }
.tabs:has([data-tab="cuentaCorriente"]) { overflow-x:auto; scrollbar-width:thin; }
.ccRangoSaldos { flex:0 0 auto; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; margin:0; }
.ccVista > .emptyState:has(+ .ccRangoSaldos) { min-height:0; }
.ccRangoSaldo { min-width:0; display:grid; align-content:start; gap:4px; padding:12px 14px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface-solid); }
.ccRangoSaldo dt { color:var(--muted); font-size:.75rem; font-weight:700; }
.ccRangoSaldo dd { min-width:0; display:grid; gap:4px; margin:0; }
.ccRangoSaldo strong { color:var(--text); font-size:clamp(1.1rem, 2vw, 1.4rem); letter-spacing:-0.02em; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.ccRangoSaldo span { color:var(--text); font-size:.8125rem; font-weight:700; }
.ccRangoSaldo small { color:var(--muted); font-size:.75rem; overflow-wrap:anywhere; }
:root:not([data-theme="oscuro"]) .ccRangoSaldo dt, :root:not([data-theme="oscuro"]) .ccRangoSaldo small { color:color-mix(in srgb, var(--muted) 65%, var(--text)); }
@media(max-width:720px) {
  .ccSaldos { grid-template-columns:1fr; }
}
@media(max-width:560px) {
  .ccRangoSaldos { grid-template-columns:1fr; }
}
@media(max-width:560px) {
  .tabs:has([data-tab="cuentaCorriente"]) button { flex:1 0 auto; padding:0 10px; }
  .ccFiltroCampo { max-width:none; flex-basis:140px; }
  .ccFiltroCampo input { font-size:16px; }
  .ccFiltroAcciones, .ccExportes { flex:1 1 100%; margin-left:0; }
  .ccFiltroAcciones .secondaryButton, .ccExportes .secondaryButton, .ccAcciones > button { flex:1 1 auto; padding:0 12px; }
  .ccPager .secondaryButton { padding:0 12px; }
}
