/* Sistema visual Sensor.camp Regants: claro, compacto y orientado a tareas. */
:root {
  color-scheme: light;
  --sc-ink: #18181b;
  --sc-ink-soft: #3f3f46;
  --sc-muted: #71717a;
  --sc-paper: #ffffff;
  --sc-surface: #fafafa;
  --sc-surface-strong: #f4f4f5;
  --sc-line: #e4e4e7;
  --sc-line-strong: #d4d4d8;
  --sc-brand: #f3a15f;
  --sc-brand-dark: #e8873d;
  --sc-brand-deep: #a94a13;
  --sc-brand-ink: #ad5119;
  --sc-on-brand: #2f1b0e;
  --sc-brand-soft: #fff4eb;
  --sc-source-al-start: #f9e0cb;
  --sc-source-al: #f0b17e;
  --sc-source-al-line: #ee9550;
  --sc-source-vi-start: #d6f7f1;
  --sc-source-vi: #72d8c7;
  --sc-source-vi-line: #199b88;
  --sc-combined-start: #faf9f8;
  --sc-combined: #edeae7;
  --sc-combined-line: #c9c6c3;
  --sc-combined-ink: #353230;
  --sc-water: #28718a;
  --sc-accent: #f3a15f;
  --sc-warning-bg: #fffbeb;
  --sc-warning-ink: #713f12;
  --sc-danger: #b42318;
  --sc-danger-bg: #fff1f0;
  --sc-success: #166534;
  --sc-success-bg: #ecfdf3;
  --sc-info-bg: #eff8ff;
  --sc-shadow-sm: 0 1px 2px rgb(24 24 27 / 6%), 0 1px 3px rgb(24 24 27 / 4%);
  --sc-shadow-md: 0 12px 32px rgb(24 24 27 / 8%), 0 2px 8px rgb(24 24 27 / 4%);
  --sc-radius-sm: .5rem;
  --sc-radius-md: .75rem;
  --sc-radius-lg: .9rem;
  --sc-space-1: .25rem;
  --sc-space-2: .5rem;
  --sc-space-3: .75rem;
  --sc-space-4: 1rem;
  --sc-space-5: 1.5rem;
  --sc-space-6: 2rem;
  --sc-space-7: 3rem;
  --sc-content: 112rem;
  --sc-reading: 45rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--sc-ink);
  background: var(--sc-surface);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 20rem; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, #fff 0, #fff 12rem, var(--sc-surface) 32rem),
    var(--sc-surface);
  color: var(--sc-ink);
  font-size: 1rem;
  line-height: 1.5;
}
img, svg { max-width: 100%; }
a { color: var(--sc-brand-ink); text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { color: var(--sc-brand-deep); }
p { margin-top: 0; }
h1, h2, h3 { color: var(--sc-ink); text-wrap: balance; }
h1 { margin: 0; font-size: clamp(1.9rem, 3vw, 2.35rem); line-height: 1.12; letter-spacing: -.035em; font-weight: 760; }
h2 { margin: 2.25rem 0 1rem; font-size: clamp(1.35rem, 2vw, 1.6rem); line-height: 1.25; letter-spacing: -.018em; font-weight: 740; }
h3 { margin: 1.5rem 0 .7rem; font-size: 1.08rem; line-height: 1.3; font-weight: 720; }
small { color: var(--sc-muted); }
code { white-space: pre-wrap; word-break: break-word; font-size: .82rem; }

.visually-hidden {
  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;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  z-index: 1000;
  left: 1rem;
  top: -10rem;
  padding: .75rem 1rem;
  border-radius: var(--sc-radius-sm);
  background: var(--sc-paper);
  box-shadow: var(--sc-shadow-md);
  font-weight: 750;
}
.skip-link:focus { top: 1rem; }

/* Shell */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgb(228 228 231 / 86%);
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 1px 0 rgb(24 24 27 / 2%);
  backdrop-filter: blur(16px) saturate(150%);
}
.site-header-inner {
  width: min(var(--sc-content), calc(100% - 2rem));
  min-height: 4rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.brand { min-height: 2.75rem; display: inline-flex; align-items: center; gap: .62rem; flex: 0 0 auto; color: var(--sc-ink); text-decoration: none; }
.brand:hover { color: var(--sc-ink); }
.brand-copy { display: flex; align-items: baseline; gap: .38rem; line-height: 1; }
.brand-copy strong { font-size: 1rem; font-weight: 800; letter-spacing: -.025em; }
.brand-copy strong span { color: var(--sc-brand); }
.brand-copy small { padding: .2rem .38rem; border: 1px solid var(--sc-line); border-radius: .35rem; background: var(--sc-surface); color: var(--sc-muted); font-size: .66rem; font-weight: 760; letter-spacing: .035em; text-transform: uppercase; }
.brand-logo {
  width: 2.55rem;
  height: 2.55rem;
  flex: 0 0 auto;
  object-fit: contain;
}
.header-brand-lockup, .auth-mobile-brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .72rem;
  flex: 0 1 auto;
}
.co-brand-divider { width: 1px; height: 2rem; flex: 0 0 auto; background: var(--sc-line-strong); }
.community-brand-logo { display: block; flex: 0 0 auto; object-fit: contain; }
.community-brand-logo-header, .community-brand-logo-mobile { width: 2.75rem; height: 2.75rem; }
.nav-toggle { display: none; margin-left: auto; gap: .55rem; }
.nav-toggle-lines, .nav-toggle-lines::before, .nav-toggle-lines::after { width: 1rem; height: 1.5px; display: block; border-radius: 999px; background: currentColor; }
.nav-toggle-lines { position: relative; }
.nav-toggle-lines::before, .nav-toggle-lines::after { content: ""; position: absolute; left: 0; }
.nav-toggle-lines::before { top: -.3rem; }
.nav-toggle-lines::after { top: .3rem; }
.main-nav { min-width: 0; flex: 1; display: flex; align-items: center; gap: .1rem; }
.main-nav a, .nav-logout {
  min-height: 2.45rem;
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .45rem .58rem;
  border-radius: var(--sc-radius-sm);
  color: var(--sc-ink-soft);
  font-size: .84rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.nav-icon { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-utility .nav-icon { display: none; }
.main-nav a:hover, .main-nav a:focus-visible, .main-nav a.is-active {
  background: var(--sc-surface-strong);
  color: var(--sc-ink);
}
.main-nav a.is-active { box-shadow: inset 0 -2px var(--sc-brand); }
.nav-spacer { flex: 1; }
.nav-divider { width: 1px; height: 1.4rem; margin: 0 .2rem; background: var(--sc-line); }
.nav-logout-form { margin: 0; }
.nav-logout { border: 0; background: transparent; color: var(--sc-muted); }
.nav-logout:hover { background: var(--sc-danger-bg); color: var(--sc-danger); }
.language-switcher { display: flex; align-items: center; gap: .22rem; margin: 0; padding: .2rem; border: 1px solid var(--sc-line); border-radius: .65rem; background: rgb(255 255 255 / 82%); }
.language-switcher .language-option {
  width: 2.25rem;
  min-height: 2rem;
  padding: .28rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  background: transparent;
  color: var(--sc-ink);
  box-shadow: none;
}
.language-switcher .language-option img { width: 1.5rem; height: 1rem; display: block; border-radius: .14rem; object-fit: cover; box-shadow: 0 0 0 1px rgb(24 24 27 / 10%); }
.language-switcher .language-option:hover { border-color: color-mix(in srgb, var(--sc-brand) 45%, var(--sc-line)); background: var(--sc-brand-soft); box-shadow: none; }
.language-switcher .language-option.is-active { border-color: var(--sc-brand); background: var(--sc-paper); box-shadow: 0 1px 4px rgb(24 24 27 / 9%); }
.tenant-bar {
  border-bottom: 1px solid var(--sc-line);
  background: var(--sc-paper);
  color: var(--sc-ink-soft);
}
.tenant-bar-inner {
  width: min(var(--sc-content), calc(100% - 2rem));
  min-height: 2.35rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: .5rem;
  overflow: hidden;
  font-size: .78rem;
}
.tenant-indicator { width: 1.45rem; height: 1.45rem; display: grid; place-items: center; flex: 0 0 auto; border-radius: .4rem; background: var(--sc-brand-soft); color: var(--sc-brand-ink); }
.tenant-indicator .icon { width: .85rem; height: .85rem; }
.tenant-label { flex: 0 0 auto; color: var(--sc-muted); font-weight: 680; }
.tenant-name { min-width: 0; overflow: hidden; color: var(--sc-ink-soft); font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.setup-banner { background: var(--sc-warning-bg); color: var(--sc-warning-ink); border-bottom: 1px solid #fde68a; }
.setup-banner-inner {
  width: min(var(--sc-content), calc(100% - 2rem));
  margin: 0 auto;
  padding: .55rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: .84rem;
}
.setup-banner p { margin: 0; }
.page-shell { width: min(var(--sc-content), calc(100% - 2rem)); margin: 0 auto; padding: clamp(2rem, 4vw, 3.25rem) 0 5rem; flex: 1 0 auto; }
.site-footer { flex: 0 0 auto; padding: 1.25rem 1.5rem; border-top: 1px solid var(--sc-line); background: var(--sc-paper); color: var(--sc-muted); font-size: .78rem; }
.site-footer-inner { width: min(var(--sc-content), 100%); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-footer strong { color: var(--sc-ink-soft); }

/* Iconografía */
.icon { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 1.7rem; height: 1.7rem; }

/* Encabezados y composición */
.page-heading { margin-bottom: 1.75rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; }
.page-heading-copy { max-width: 48rem; }
.checksum { display: block; overflow-wrap: anywhere; }
.page-heading p:last-child, .page-intro { margin: .5rem 0 0; color: var(--sc-muted); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .65rem; }
.eyebrow { margin: 0 0 .4rem; color: var(--sc-brand-ink); font-size: .7rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 2.25rem 0 1rem; }
.section-heading h2 { margin: 0; }
.section-supporting-copy { max-width: 28rem; margin: 0; color: var(--sc-muted); font-size: .88rem; text-align: right; }
.stack { display: grid; gap: 1rem; }
.stack > * { min-width: 0; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.account-meta { margin-top: 1.25rem; }
.card, .surface-card {
  padding: clamp(1.15rem, 3vw, 1.5rem);
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-radius-md);
  background: var(--sc-paper);
  box-shadow: var(--sc-shadow-sm);
}
.card h2, .surface-card h2 { margin-top: 0; }
dl { margin-bottom: 0; }
dt { color: var(--sc-muted); font-size: .8rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
dd { margin: .15rem 0 1rem; overflow-wrap: anywhere; }

/* Botones y foco */
button, .button {
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .58rem .9rem;
  border: 1px solid var(--sc-brand);
  border-radius: var(--sc-radius-sm);
  background: var(--sc-brand);
  color: var(--sc-on-brand);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(154 61 11 / 10%);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
button:hover, .button:hover { border-color: var(--sc-brand-dark); background: var(--sc-brand-dark); color: var(--sc-on-brand); box-shadow: 0 3px 8px rgb(232 135 61 / 18%); }
button:active, .button:active { transform: translateY(1px); }
button:disabled { opacity: .65; cursor: wait; }
.button-secondary { border-color: var(--sc-line-strong); background: var(--sc-paper); color: var(--sc-ink-soft); box-shadow: var(--sc-shadow-sm); }
.button-secondary:hover { border-color: #a1a1aa; background: var(--sc-surface-strong); color: var(--sc-ink); box-shadow: var(--sc-shadow-sm); }
.button-danger { border-color: var(--sc-danger); background: var(--sc-danger); color: white; }
.button-danger:hover { border-color: #762323; background: #762323; }
.button-quiet, .link-button {
  border-color: transparent;
  background: transparent;
  color: var(--sc-brand-ink);
  box-shadow: none;
}
.button-quiet:hover, .link-button:hover { background: var(--sc-brand-soft); color: var(--sc-brand-deep); }
.link-button { min-height: 2.5rem; padding: .4rem .55rem; text-decoration: underline; }
.button-row, .form-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--sc-brand) 62%, white);
  outline-offset: 2px;
}

/* Dashboard */
.dashboard-heading { min-height: 5.5rem; align-items: center; }
.dashboard-status { min-height: 2rem; display: inline-flex; align-items: center; gap: .5rem; padding: .38rem .7rem; border: 1px solid var(--sc-line); border-radius: 999px; background: var(--sc-paper); color: var(--sc-muted); font-size: .75rem; font-weight: 680; box-shadow: var(--sc-shadow-sm); white-space: nowrap; }
.dashboard-status > span { width: .48rem; height: .48rem; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }
.now-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(13rem, .6fr) 1.4fr;
  gap: 2rem;
  padding: clamp(1.35rem, 3vw, 2rem);
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-radius-lg);
  background:
    radial-gradient(circle at 90% -15%, rgb(230 129 47 / 13%), transparent 32%),
    linear-gradient(135deg, #fff, #fffaf6);
  color: var(--sc-ink);
  box-shadow: var(--sc-shadow-sm);
}
.now-panel::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .28; background-image: radial-gradient(circle, rgb(24 24 27 / 16%) .7px, transparent .8px); background-size: 16px 16px; mask-image: linear-gradient(90deg, transparent 35%, black); }
.now-panel > * { position: relative; z-index: 1; }
.now-panel h2 { margin: .15rem 0 0; color: var(--sc-ink); font-size: clamp(1.7rem, 3vw, 2.25rem); }
.now-panel .eyebrow { color: var(--sc-brand-ink); }
.now-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .8rem; }
.now-source { min-height: 6.7rem; padding: 1rem; border: 1px solid var(--sc-line); border-radius: .7rem; background: rgb(255 255 255 / 90%); box-shadow: var(--sc-shadow-sm); }
.now-source strong, .now-source span, .now-source small { display: block; }
.now-source strong { margin-bottom: .15rem; }
.now-source small { color: var(--sc-muted); }
.now-unconfigured { display: flex; align-items: flex-start; gap: .8rem; padding: 1rem; border: 1px solid var(--sc-line); border-radius: .7rem; background: rgb(255 255 255 / 90%); }
.now-unconfigured strong, .now-unconfigured span { display: block; }
.now-unconfigured span { color: var(--sc-muted); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .85rem; }
.action-card {
  position: relative;
  min-height: 7.4rem;
  padding: 1.05rem 2.2rem 1.05rem 1.05rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: .12rem .8rem;
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-radius-md);
  background: var(--sc-paper);
  color: var(--sc-ink);
  box-shadow: var(--sc-shadow-sm);
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.action-card::after { content: ""; position: absolute; top: 50%; right: 1.05rem; width: .48rem; height: .48rem; border-top: 2px solid var(--sc-line-strong); border-right: 2px solid var(--sc-line-strong); transform: translateY(-50%) rotate(45deg); transition: border-color .15s ease, transform .15s ease; }
.action-card:hover { border-color: #f1b788; background: #fffdfa; color: var(--sc-ink); box-shadow: 0 4px 14px rgb(24 24 27 / 6%); transform: translateY(-1px); }
.action-card:hover::after { border-color: var(--sc-brand-dark); transform: translate(.15rem, -50%) rotate(45deg); }
.action-card strong, .action-card small { grid-column: 2; }
.action-card strong { font-weight: 720; }
.action-card small { align-self: start; line-height: 1.35; }
.action-icon { grid-row: 1 / 3; width: 2.65rem; height: 2.65rem; display: grid; place-items: center; border: 1px solid #fed7b6; border-radius: .68rem; background: var(--sc-brand-soft); color: var(--sc-brand-ink); }

/* Mensajes, estados y vacíos */
.messages { position: fixed; z-index: 60; top: 4.75rem; right: 1rem; width: min(26rem, calc(100% - 2rem)); }
.message { margin-bottom: .5rem; padding: .85rem 1rem; border: 1px solid var(--sc-line); border-left-width: 3px; border-radius: var(--sc-radius-md); background: var(--sc-paper); box-shadow: var(--sc-shadow-md); }
.message-success { border-left-color: var(--sc-success); }
.message-error { border-left-color: var(--sc-danger); }
.message-warning { border-left-color: var(--sc-accent); }
.notice { margin: 1rem 0; padding: 1rem; border: 1px solid #ead695; border-left: 4px solid var(--sc-accent); border-radius: 0 var(--sc-radius-sm) var(--sc-radius-sm) 0; background: var(--sc-warning-bg); color: var(--sc-warning-ink); }
.notice-info { border-color: #b8d9df; border-left-color: var(--sc-water); background: var(--sc-info-bg); color: var(--sc-ink); }
.notice-danger { border-color: #e9b6b1; border-left-color: var(--sc-danger); background: var(--sc-danger-bg); color: #6f2323; }
.empty-state { padding: clamp(1.5rem, 4vw, 2.5rem); display: grid; justify-items: start; gap: .65rem; border: 1px dashed var(--sc-line-strong); border-radius: var(--sc-radius-md); background: var(--sc-paper); }
.empty-state .icon { width: 2rem; height: 2rem; color: var(--sc-brand-ink); }
.empty-state h2, .empty-state h3, .empty-state p { margin: 0; }
.empty-state p { max-width: 40rem; color: var(--sc-muted); }
.empty-state-compact { padding: 1.25rem; }
.badge { display: inline-flex; align-items: center; min-height: 1.55rem; padding: .16rem .55rem; border: 1px solid var(--sc-line); border-radius: 999px; background: var(--sc-surface); color: var(--sc-ink-soft); font-size: .72rem; font-weight: 720; white-space: nowrap; }
.badge-paid, .badge-success { border-color: #bbf7d0; background: var(--sc-success-bg); color: var(--sc-success); }
.badge-pending, .badge-warning { border-color: #fde68a; background: var(--sc-warning-bg); color: #765000; }
.badge-error { border-color: #fecaca; background: var(--sc-danger-bg); color: var(--sc-danger); }
.issue { margin-bottom: .4rem; padding: .45rem .6rem; border-radius: .35rem; font-size: .86rem; }
.issue-error { background: var(--sc-danger-bg); color: #712323; }
.issue-warning { background: var(--sc-warning-bg); color: #654600; }

/* Listas y tablas */
.list-grid { display: grid; gap: .6rem; }
.list-card { min-height: 4.4rem; padding: .9rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-md); background: var(--sc-paper); color: var(--sc-ink); text-decoration: none; box-shadow: var(--sc-shadow-sm); transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.list-card:hover { border-color: #f1b788; background: #fffdfa; color: var(--sc-ink); box-shadow: 0 4px 14px rgb(24 24 27 / 5%); }
.list-card > div:first-child { min-width: 0; display: grid; }
.list-card small { color: var(--sc-muted); }
.table-hint { display: none; margin: 0 0 .45rem; color: var(--sc-muted); font-size: .85rem; }
.table-wrap, .table-responsive { overflow: auto; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-md); background: var(--sc-paper); box-shadow: var(--sc-shadow-sm); scrollbar-color: var(--sc-line-strong) transparent; }
.table-wrap:focus-visible, .table-responsive:focus-visible { outline-offset: 2px; }
.pagination-bar { margin-top: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--sc-muted); font-size: .85rem; }
.pagination-bar .button-row { margin-top: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .78rem .9rem; border-bottom: 1px solid var(--sc-line); text-align: left; vertical-align: middle; }
th { background: #fcfcfc; color: var(--sc-muted); font-size: .7rem; font-weight: 760; letter-spacing: .055em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover:not(:has(.empty)) { background: #fffaf6; }
.clickable-row { cursor: pointer; }
.clickable-row:focus-visible { outline: 3px solid color-mix(in srgb, var(--sc-brand) 55%, white); outline-offset: -3px; }
.number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.table-actions form { margin: 0; }
.table-actions > a, td > a, .section-heading > a, .file-list a { min-height: 2.75rem; display: inline-flex; align-items: center; }
.empty { color: var(--sc-muted); }
.member-mobile-list { display: none; }
.member-mobile-card { padding: 1rem; display: grid; gap: .85rem; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-md); background: var(--sc-paper); box-shadow: var(--sc-shadow-sm); }
.member-mobile-card > div:first-child { display: grid; }
.member-mobile-card dl { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: .3rem .65rem; }
.member-mobile-card dt { font-size: .68rem; }
.member-mobile-card dd { margin: 0; font-size: .84rem; }
.member-mobile-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; padding-top: .75rem; border-top: 1px solid var(--sc-line); }

/* Filtros */
.filter-bar {
  margin-bottom: 1rem;
  padding: .85rem;
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) auto auto;
  align-items: end;
  gap: .7rem;
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-radius-md);
  background: var(--sc-paper);
  box-shadow: var(--sc-shadow-sm);
}
.filter-bar-wide { grid-template-columns: minmax(15rem, 1fr) repeat(3, minmax(7rem, auto)) auto; }
.import-filter-bar { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.import-filter-bar .filter-actions { grid-column: 1 / -1; }
.filter-field { min-width: 0; }
.filter-field label { margin-bottom: .25rem; font-size: .78rem; }
.filter-check { min-height: 2.75rem; display: inline-flex; align-items: center; gap: .55rem; margin: 0; padding: .5rem .2rem; white-space: nowrap; }
.filter-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }

/* Formularios */
.form-card { width: min(100%, 40rem); margin: 0 auto; padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid var(--sc-line); border-radius: var(--sc-radius-lg); background: var(--sc-paper); box-shadow: 0 10px 30px rgb(24 24 27 / 6%); }
.form-card.form-wide { width: min(100%, 56rem); }
.form-card.member-profile-form { width: min(100%, 72rem); }
.form-card > h1, .form-card > .page-heading h1 { margin-bottom: .75rem; }
.form-card > p:not(.eyebrow) { color: var(--sc-muted); }
.form-card form > div, form > .field { margin-bottom: 1rem; }
.form-errors, .errorlist { color: var(--sc-danger); }
.form-errors { margin-bottom: 1rem; padding: .8rem 1rem; border-radius: var(--sc-radius-sm); background: var(--sc-danger-bg); }
.errorlist { margin: .35rem 0 0; padding-left: 1.2rem; font-size: .9rem; }
label { display: block; margin-bottom: .3rem; color: var(--sc-ink-soft); font-size: .88rem; font-weight: 680; }
.required-mark { color: var(--sc-danger); }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  max-width: 100%;
  min-height: 2.5rem;
  padding: .58rem .7rem;
  border: 1px solid var(--sc-line-strong);
  border-radius: var(--sc-radius-sm);
  background: white;
  color: var(--sc-ink);
  font: inherit;
  box-shadow: inset 0 1px 1px rgb(24 24 27 / 2%);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:not([type="checkbox"]):not([type="radio"]):hover, select:hover, textarea:hover { border-color: #a1a1aa; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { border-color: var(--sc-brand); box-shadow: 0 0 0 3px rgb(230 129 47 / 13%); outline: 0; }
textarea { min-height: 6.5rem; resize: vertical; }
select[multiple] { min-height: 8rem; }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; accent-color: var(--sc-brand-dark); }
input[type="file"] { padding: .48rem; }
input:disabled, select:disabled, textarea:disabled { background: var(--sc-surface-strong); color: var(--sc-muted); cursor: not-allowed; }
.helptext, .field-help { display: block; margin-top: .3rem; color: var(--sc-muted); font-size: .84rem; }
.form-section, .settings-layout { display: grid; gap: 1.25rem; }
.form-section { padding: clamp(1.2rem, 3vw, 1.65rem); border: 1px solid var(--sc-line); border-radius: var(--sc-radius-md); background: #fcfcfc; box-shadow: none; }
.form-section-heading h2 { margin: 0; }
.form-section-heading p:last-child { margin: .4rem 0 0; color: var(--sc-muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.amount-field-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .6rem; }
.amount-field-control > span { color: var(--sc-muted); font-size: .9rem; font-weight: 650; white-space: nowrap; }
.field-checkbox { display: flex; align-items: center; gap: .55rem; }
.field-checkbox label { margin: 0; }
.check-row { min-height: 2.75rem; display: flex; align-items: flex-start; gap: .75rem; margin: 0; cursor: pointer; }
.check-row > input { margin-top: .2rem; }
.check-row span { display: grid; }
.confirmation-card { padding: 1rem; border: 1px solid #ead695; border-radius: var(--sc-radius-md); background: var(--sc-warning-bg); }
.form-actions { justify-content: flex-end; }
.floating-form-actions {
  position: fixed;
  z-index: 850;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  max-width: calc(100vw - 2rem);
  padding: .55rem;
  border: 1px solid rgb(212 212 216 / 85%);
  border-radius: calc(var(--sc-radius-md) + .15rem);
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 14px 36px rgb(24 24 27 / 20%), 0 2px 8px rgb(24 24 27 / 10%);
  backdrop-filter: blur(10px);
}
.floating-form-actions button { min-width: 9rem; }
body.has-floating-form-actions { padding-bottom: 5.25rem; }
.clock-select { display: inline-grid; grid-template-columns: minmax(4.5rem, 1fr) auto minmax(4.5rem, 1fr); align-items: center; gap: .35rem; }
.clock-select .clock-part { min-width: 4.5rem; }
.clock-separator { color: var(--sc-muted); font-weight: 800; }
.danger-zone { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--sc-line); }
.is-contextual { display: none; }
[hidden] { display: none !important; }

/* Ficha agregada de comuneros */
.contextual-fields { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--sc-line-strong); }
.member-first-plot > [data-context-fields="first-plot"] { margin-top: 1.25rem; display: grid; gap: 1rem; }
.member-first-plot .form-section { background: var(--sc-paper); }
.derived-fields-note { padding: 1rem; display: grid; gap: .25rem; border: 1px solid #fed7b6; border-radius: var(--sc-radius-md); background: var(--sc-brand-soft); color: var(--sc-ink-soft); }
.derived-fields-note strong { color: var(--sc-brand-deep); }
.derived-preview-grid { margin-top: .65rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.derived-preview-grid > span { padding: .6rem .7rem; display: grid; border: 1px solid rgb(230 129 47 / 20%); border-radius: var(--sc-radius-sm); background: rgb(255 255 255 / 65%); }
.derived-preview-grid small { font-size: .65rem; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
.derived-preview-grid strong { color: var(--sc-ink-soft); font-size: .82rem; }
.member-plots-section { margin-top: 3rem; }
.member-plot-list, .member-plots-section { display: grid; gap: 1rem; }
.member-plot-editor, .member-plot-card { overflow: hidden; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-lg); background: var(--sc-paper); box-shadow: var(--sc-shadow-sm); }
.member-plot-editor > header, .member-plot-card > header { padding: 1.15rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--sc-line); background: linear-gradient(135deg, #fff, #fffaf6); }
.member-plot-editor > header h3, .member-plot-card > header h3 { margin: 0; font-size: 1.25rem; }
.member-plot-editor > form { padding: 1.25rem; display: grid; gap: 1rem; }
.member-plot-editor .form-section { background: var(--sc-surface); }
.derived-domain-section { border-style: dashed; }
.profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.profile-data-grid { padding: 1.25rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.profile-data-grid > section { min-width: 0; padding-right: 1.25rem; border-right: 1px solid var(--sc-line); }
.profile-data-grid > section:last-child { padding-right: 0; border-right: 0; }
.profile-data-grid h4, .member-schedule-summary h4 { margin: 0 0 1rem; font-size: 1rem; }
.member-schedule-summary { padding: 0 1.25rem 1.25rem; }
.member-schedule-summary .compact-heading { margin-top: 0; }
.empty-inline { margin: 0; padding: .85rem 1rem; border: 1px dashed var(--sc-line-strong); border-radius: var(--sc-radius-sm); background: var(--sc-surface); color: var(--sc-muted); }

/* Directorio de comuneros, fincas y turnos */
.member-directory-filter { grid-template-columns: minmax(15rem, 1fr) auto auto auto; }
.member-directory-view { display: grid; gap: .75rem; }
.member-directory-toolbar { position: relative; z-index: 3; display: flex; align-items: center; justify-content: flex-end; gap: .55rem; }
.member-view-switcher { display: inline-flex; padding: .2rem; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-sm); background: var(--sc-surface); }
.member-view-switcher .button { min-height: 2.1rem; padding: .38rem .72rem; border-color: transparent; background: transparent; box-shadow: none; font-size: .8rem; }
.member-view-switcher .button.is-active { border-color: #f1b788; background: var(--sc-brand-soft); color: var(--sc-brand-deep); }
.member-column-picker { position: relative; }
.member-column-picker > summary { min-height: 2.5rem; list-style: none; }
.member-column-picker > summary::-webkit-details-marker { display: none; }
.member-column-picker > summary::after { content: "⌄"; margin-left: .15rem; color: var(--sc-muted); }
.member-column-picker[open] > summary::after { transform: rotate(180deg); }
.member-column-picker fieldset { position: absolute; top: calc(100% + .45rem); right: 0; width: 18rem; padding: .8rem; display: grid; gap: .2rem; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-md); background: var(--sc-paper); box-shadow: var(--sc-shadow-md); }
.member-column-picker legend { margin: 0 0 .35rem; color: var(--sc-muted); font-size: .7rem; font-weight: 760; letter-spacing: .045em; text-transform: uppercase; }
.member-column-option { display: flex; align-items: center; gap: .35rem; border-radius: .35rem; }
.member-column-option:hover { background: var(--sc-surface); }
.member-column-picker label { min-width: 0; margin: 0; padding: .35rem .4rem; display: flex; flex: 1 1 auto; align-items: center; gap: .55rem; color: var(--sc-ink-soft); font-size: .82rem; font-weight: 620; cursor: pointer; }
.member-column-order { padding-right: .25rem; display: inline-flex; gap: .15rem; }
.member-column-order button { width: 1.65rem; min-height: 1.65rem; padding: 0; border-color: transparent; background: transparent; color: var(--sc-muted); box-shadow: none; font-size: .85rem; }
.member-column-order button:hover { border-color: var(--sc-line); background: var(--sc-paper); color: var(--sc-ink); box-shadow: var(--sc-shadow-sm); }
.member-column-order button:disabled { opacity: .28; cursor: default; }
.member-directory-help { width: 1.8rem; height: 1.8rem; display: inline-grid; place-items: center; border: 1px solid var(--sc-line-strong); border-radius: 50%; background: var(--sc-paper); color: var(--sc-muted); font-size: .76rem; font-weight: 800; cursor: help; }
.member-directory-table-wrap { overflow: auto; }
.member-directory-table { width: max-content; min-width: 100%; }
.member-directory-table th { position: sticky; z-index: 1; top: 0; white-space: nowrap; }
.member-directory-table td { padding-block: .55rem; vertical-align: middle; white-space: nowrap; }
.member-directory-table tbody tr { transition: background-color .15s ease; }
.member-directory-table tbody tr:hover { background: #fffaf6; }
.member-directory-table tbody tr.is-inactive,
table tbody tr.is-inactive { background: #f3f2f1; color: var(--sc-muted); }
.member-directory-table tbody tr.is-inactive:hover,
table tbody tr.is-inactive:hover { background: #eceae8; }
.member-directory-card.is-inactive { background: #f3f2f1; filter: grayscale(.55); opacity: .82; }
.management-list { margin: 0; padding: 0; display: grid; list-style: none; }
.management-list li { padding: .7rem 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--sc-line); }
.management-list li:last-child { border-bottom: 0; }
.member-sort-link, .table-sort-link { display: inline-flex; align-items: center; gap: .3rem; color: inherit; text-decoration: none; }
.member-sort-link::after, .table-sort-link::after { content: "↕"; color: var(--sc-line-strong); font-size: .78rem; }
.member-directory-table th[aria-sort="ascending"] .member-sort-link::after { content: "↑"; color: var(--sc-brand-ink); }
.member-directory-table th[aria-sort="descending"] .member-sort-link::after { content: "↓"; color: var(--sc-brand-ink); }
.member-number-cell { width: 5rem; font-variant-numeric: tabular-nums; }
.member-name-cell { min-width: 13rem; }
.member-name-cell > a { display: inline; color: var(--sc-ink); text-decoration: none; }
.member-name-cell > a:hover { color: var(--sc-brand-deep); text-decoration: underline; }
.member-name-cell .badge { margin-left: .4rem; }
.member-phone-cell { min-width: 9rem; font-variant-numeric: tabular-nums; }
.member-email-cell { min-width: 15rem; }
.member-phone-cell, .member-email-cell { font-size: .8rem; }
.member-plots-cell { width: 12rem; max-width: 12rem; white-space: normal; }
.member-plots-cell > * { width: fit-content; max-width: 12rem; min-height: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-plots-cell > * + * { margin-top: .18rem; }
.member-plots-cell a { font-size: .8rem; }
.member-duration-cell { width: 7rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.member-schedule-cell { min-width: 8rem; }
.member-schedule-total { font-size: .8rem; font-variant-numeric: tabular-nums; }
.member-payment-cell { min-width: 10rem; }
.member-payment-overdue { margin-top: .28rem; display: block; color: var(--sc-danger); font-size: .68rem; font-weight: 720; }
.member-turn-cell { min-width: 29rem; }
.member-sources-cell { min-width: 10rem; }
.member-sources-cell > * { display: inline-block; }
.member-turn-list { display: grid; grid-template-columns: repeat(3, max-content); align-items: center; gap: .22rem; }
.member-table-turn { padding: .25rem .42rem; border-left: 2px solid var(--sc-line-strong); border-radius: 0 .35rem .35rem 0; background: var(--sc-surface); color: var(--sc-ink-soft); font-size: .74rem; line-height: 1.35; }
.member-table-turn.is-available { border-left-color: #55bcb2; background: #f1fffc; }
.member-table-turn.is-assigned { border-left-color: var(--sc-brand); background: var(--sc-brand-soft); }
.member-table-turn.is-received { border-left-color: var(--sc-water); background: var(--sc-info-bg); }
.member-table-turn small { color: var(--sc-muted); font-size: .68rem; }
.member-table-source { margin-right: .22rem; padding: .25rem .42rem; border-radius: .35rem; background: var(--sc-surface-strong); color: var(--sc-ink-soft); font-size: .74rem; }
.member-empty-value { color: var(--sc-muted); font-size: .78rem; }
.member-available-cell { width: 6rem; text-align: center; }
.member-table-actions { width: 6rem; white-space: nowrap; }
.member-table-actions a { display: inline; margin: 0; font-size: .8rem; }
.member-table-actions a + a::before { content: " · "; color: var(--sc-line-strong); }
.member-availability-overview { margin-bottom: 1rem; padding: 1.15rem; border: 1px solid #9bded7; border-radius: var(--sc-radius-lg); background: linear-gradient(135deg, #f7fffd 0%, #fffaf6 100%); box-shadow: var(--sc-shadow-sm); }
.member-availability-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.member-availability-heading h2 { margin: 0; font-size: 1.25rem; }
.member-availability-heading p:last-child { margin: .3rem 0 0; color: var(--sc-muted); }
.member-available-grid { margin-top: 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .7rem; }
.member-available-turn { min-width: 0; padding: .85rem; display: grid; gap: .55rem; border: 1px solid rgb(31 157 147 / 22%); border-radius: var(--sc-radius-md); background: rgb(255 255 255 / 82%); }
.member-available-turn > div { min-width: 0; display: grid; }
.member-available-turn span, .member-available-turn p { color: var(--sc-muted); font-size: .82rem; }
.member-available-turn p { margin: 0; padding-top: .45rem; border-top: 1px solid var(--sc-line); }
.member-available-turn > a { width: fit-content; min-height: 2.25rem; display: inline-flex; align-items: center; }
.member-directory-list { display: grid; gap: 1rem; }
.member-directory-card { overflow: hidden; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-lg); background: var(--sc-paper); box-shadow: var(--sc-shadow-sm); }
.member-directory-card-heading { padding: 1rem 1.15rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--sc-line); background: linear-gradient(135deg, #fff 0%, #fffaf6 100%); }
.member-directory-person { min-width: 0; }
.member-directory-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.member-directory-title-row h2 { margin: 0; overflow-wrap: anywhere; font-size: 1.25rem; }
.member-directory-person > p { margin: .25rem 0 0; color: var(--sc-muted); font-size: .84rem; overflow-wrap: anywhere; }
.member-directory-actions { display: flex; flex: 0 0 auto; gap: .5rem; }
.member-directory-stats { padding: .75rem 1.15rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: .55rem; border-bottom: 1px solid var(--sc-line); background: var(--sc-surface); }
.member-directory-stats > div { min-width: 0; padding: .5rem .65rem; display: grid; border-radius: var(--sc-radius-sm); background: var(--sc-paper); }
.member-directory-stats > div.is-available { border: 1px solid rgb(31 157 147 / 22%); background: #f1fffc; }
.member-directory-stats > div.is-overdue { border: 1px solid #fecaca; background: var(--sc-danger-bg); }
.member-directory-stats span { color: var(--sc-muted); font-size: .67rem; font-weight: 760; letter-spacing: .045em; text-transform: uppercase; }
.member-directory-stats strong { margin-top: .08rem; font-size: .95rem; font-variant-numeric: tabular-nums; }
.member-directory-stats small { margin-top: .15rem; color: var(--sc-danger); font-size: .68rem; font-weight: 700; }
.member-directory-plots { display: grid; }
.member-directory-plot { min-width: 0; padding: .9rem 1.15rem; display: grid; grid-template-columns: minmax(12rem, .72fr) minmax(22rem, 2fr); align-items: start; gap: 1rem; border-bottom: 1px solid var(--sc-line); }
.member-directory-plot:last-child { border-bottom: 0; }
.member-directory-plot-heading { min-width: 0; display: grid; gap: .55rem; }
.member-directory-plot-heading h3 { margin: 0; overflow-wrap: anywhere; font-size: 1rem; }
.member-directory-plot-totals { display: flex; flex-wrap: wrap; gap: .35rem .7rem; color: var(--sc-muted); font-size: .75rem; }
.member-directory-plot-totals strong { color: var(--sc-ink-soft); font-variant-numeric: tabular-nums; }
.member-directory-turns { min-width: 0; display: grid; gap: .4rem; }
.member-directory-turn { min-width: 0; padding: .55rem .65rem; display: grid; grid-template-columns: minmax(9.5rem, 1fr) minmax(8rem, .8fr) minmax(10rem, 1fr); align-items: center; gap: .65rem; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-sm); background: var(--sc-surface); }
.member-directory-turn.is-available { border-color: #9bded7; background: #f1fffc; }
.member-directory-turn.is-assigned { border-color: #fed7b6; background: var(--sc-brand-soft); }
.member-directory-turn.is-received { border-color: #b8d9df; background: var(--sc-info-bg); }
.member-turn-time, .member-turn-state { min-width: 0; display: grid; }
.member-turn-time strong { font-size: .83rem; font-variant-numeric: tabular-nums; }
.member-turn-time span, .member-turn-state small { color: var(--sc-muted); font-size: .72rem; }
.member-turn-source { min-width: 0; overflow-wrap: anywhere; color: var(--sc-ink-soft); font-size: .8rem; }
.member-turn-state { justify-items: start; gap: .15rem; }
.member-turn-state small { overflow-wrap: anywhere; }
.badge-available { border-color: #9bded7; background: #e7fbf8; color: #116b63; }
.badge-assigned { border-color: #fed7b6; background: #fff4e9; color: var(--sc-brand-deep); }
.badge-received { border-color: #b8d9df; background: #ecf9fb; color: #176773; }
.member-turn-note { grid-column: 1 / -1; margin: 0; padding-top: .45rem; border-top: 1px dashed var(--sc-line-strong); color: var(--sc-muted); font-size: .75rem; }
.member-directory-no-turns { margin: 0; padding: .7rem .8rem; border: 1px dashed var(--sc-line-strong); border-radius: var(--sc-radius-sm); background: var(--sc-surface); color: var(--sc-muted); font-size: .82rem; }
.member-directory-plot > .member-directory-no-turns { grid-column: 2; }

/* Estados, métricas y acciones de dominio */
.stat-card {
  min-width: 0;
  padding: .9rem 1rem;
  display: grid;
  align-content: center;
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-radius-sm);
  background: var(--sc-surface);
}
.stat-card span { color: var(--sc-muted); font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.stat-card strong { margin-top: .1rem; font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.preview-summary, .source-usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; margin: 1rem 0 1.5rem; }
.policy-card h2 { margin: 0; }
.policy-summary { display: grid; grid-template-columns: minmax(7rem, .6fr) repeat(3, minmax(8rem, 1fr)); gap: .75rem; }
.compact-heading { margin-top: 1.5rem; }
.compact-heading h3 { margin: 0; }
.policy-summary-fees { grid-template-columns: minmax(6rem, .55fr) repeat(4, minmax(7.5rem, 1fr)); }
.policy-note, .receipt-note {
  margin-top: 1rem;
  padding: .9rem 1rem;
  border: 1px solid #fed7b6;
  border-radius: var(--sc-radius-sm);
  background: var(--sc-brand-soft);
  color: var(--sc-ink-soft);
}
.policy-note p, .receipt-note p { margin: .35rem 0 0; }
.billing-concepts { margin-top: 1.5rem; }
.billing-account-preview { margin-top: 2rem; }
.billing-concepts .section-heading { margin-top: 0; }
.billing-concept-list {
  overflow: hidden;
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-radius-md);
  background: var(--sc-paper);
  box-shadow: var(--sc-shadow-sm);
}
.billing-concept-list > div {
  min-height: 3rem;
  padding: .7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--sc-line);
}
.billing-concept-list > div:last-child { border-bottom: 0; }
.billing-concept-list dt { color: var(--sc-ink-soft); font-size: .84rem; letter-spacing: 0; text-transform: none; }
.billing-concept-list dd { margin: 0; font-weight: 760; font-variant-numeric: tabular-nums; white-space: nowrap; }
.billing-concept-list .billing-concept-total { background: linear-gradient(135deg, #fffaf6, var(--sc-brand-soft)); }
.billing-concept-total dt, .billing-concept-total dd { color: var(--sc-ink); font-size: 1rem; font-weight: 820; }
.account-state-pair { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
.billing-status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.delivery-history, .member-receipts-section { margin-top: 2.25rem; }
.member-payment-history .member-payment-row-overdue { background: var(--sc-danger-bg); }
.billing-bulk-form { display: grid; gap: .65rem; }
.billing-bulk-toolbar { padding: .7rem .8rem; display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-md); background: var(--sc-paper); box-shadow: var(--sc-shadow-sm); }
.billing-bulk-toolbar > strong { min-width: 6.8rem; font-size: .86rem; }
.billing-bulk-toolbar > small { flex: 1 1 18rem; color: var(--sc-muted); }
.billing-bulk-date { display: flex; align-items: center; gap: .45rem; }
.billing-bulk-date label { margin: 0; white-space: nowrap; }
.billing-bulk-date input { width: 10rem; }
.billing-selection-cell { width: 3rem; text-align: center; }
.billing-selection-cell input { margin: 0 auto; display: block; }
.billing-account-table th { white-space: nowrap; }
.billing-account-table th[aria-sort="ascending"] .table-sort-link::after { content: "↑"; color: var(--sc-brand-ink); }
.billing-account-table th[aria-sort="descending"] .table-sort-link::after { content: "↓"; color: var(--sc-brand-ink); }
.billing-receipt-cell { display: flex; flex-wrap: nowrap; align-items: center; gap: .4rem; white-space: nowrap; }
.billing-bulk-toolbar [data-requires-selection]:disabled { cursor: not-allowed; }
.billing-quick-actions { min-width: 15rem; }
.badge-sent { border-color: #bbf7d0; background: var(--sc-success-bg); color: var(--sc-success); }
.publication-panel, .document-finalize {
  margin: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.publication-panel h2, .document-finalize h2 { margin: 0 0 .25rem; }
.publication-panel p, .document-finalize p { margin: 0; color: var(--sc-muted); }
.publication-panel form, .document-finalize form { flex: 0 0 auto; margin: 0; }
.source-swatch { width: .8rem; height: .8rem; display: inline-block; margin-right: .4rem; border: 1px solid rgb(0 0 0 / 18%); border-radius: 50%; background: var(--source-color, var(--sc-water)); vertical-align: .02rem; }

/* Documentos y seguridad */
.document-sheet { padding: clamp(1.2rem, 4vw, 3rem); border: 1px solid var(--sc-line); border-radius: var(--sc-radius-sm); background: var(--sc-paper); box-shadow: var(--sc-shadow-sm); }
.document-sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.document-sheet-heading h2 { margin-top: 0; }
.revision-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0 1.5rem; }
.preserve-lines { white-space: pre-line; }
.file-list { margin: 0; padding: 0; list-style: none; }
.file-list li { min-height: 3rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--sc-line); }
.security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.security-card { padding: 1.25rem; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-md); background: var(--sc-paper); box-shadow: var(--sc-shadow-sm); }
.security-card h2 { margin-top: 0; }

/* Auditoría operativa */
.audit-heading { align-items: center; }
.audit-button-count { min-width: 1.35rem; min-height: 1.35rem; display: inline-grid; place-items: center; padding: 0 .28rem; border-radius: 999px; background: var(--sc-danger-bg); color: var(--sc-danger); font-size: .7rem; }
.audit-metrics { margin-bottom: 1rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.audit-metrics article { min-height: 6rem; padding: 1rem; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-md); background: linear-gradient(145deg, #fff, var(--sc-surface)); box-shadow: var(--sc-shadow-sm); }
.audit-metrics article.is-alert { border-color: #fecaca; background: linear-gradient(145deg, #fff, var(--sc-danger-bg)); }
.audit-metrics span { color: var(--sc-muted); font-size: .76rem; font-weight: 740; }
.audit-metrics strong { font-size: 1.75rem; line-height: 1; letter-spacing: -.035em; }
.audit-filter-bar { grid-template-columns: minmax(12rem, 1.35fr) repeat(4, minmax(9rem, 1fr)); }
.audit-filter-bar .filter-actions { grid-column: auto; }
.audit-table { min-width: 88rem; }
.audit-table td { vertical-align: top; }
.audit-row-link { color: var(--sc-ink); font-weight: 720; white-space: nowrap; }
.audit-action-link { color: var(--sc-ink); text-decoration-color: rgb(195 82 0 / 28%); text-underline-offset: .18em; }
.audit-changes-cell { min-width: 21rem; }
.audit-change-summary { margin: 0; display: grid; gap: .45rem; }
.audit-change-summary > div { display: grid; grid-template-columns: minmax(6.5rem, .65fr) minmax(12rem, 1.35fr); gap: .65rem; align-items: baseline; }
.audit-change-summary dt { color: var(--sc-muted); font-size: .72rem; font-weight: 760; letter-spacing: .02em; }
.audit-change-summary dd { min-width: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .4rem; align-items: baseline; font-size: .78rem; }
.audit-change-summary dd > span:not(.audit-change-arrow) { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.audit-change-arrow { color: var(--sc-brand-ink); font-weight: 800; }
.audit-detail-link { display: inline-block; margin-top: .55rem; font-size: .75rem; font-weight: 720; }
.audit-system-user, .audit-no-change { color: var(--sc-muted); }
.audit-object-context { margin-top: .3rem; display: grid; gap: .08rem; }
.audit-object-context strong { font-size: .8rem; }
.audit-object-context small { color: var(--sc-muted); }
.audit-object-id { max-width: 13rem; display: inline-block; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap; }
.audit-detail-hero { padding: 1.25rem; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.1rem; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-lg); background: linear-gradient(145deg, #fff, #fff9f4); box-shadow: var(--sc-shadow-sm); }
.audit-detail-icon { width: 3rem; height: 3rem; display: grid; place-items: center; border: 1px solid #fed7b6; border-radius: .75rem; background: var(--sc-brand-soft); color: var(--sc-brand-ink); }
.audit-detail-hero dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem 1.25rem; }
.audit-detail-hero dd { margin-bottom: 0; }
.audit-change-table table { min-width: 42rem; }
.audit-change-table th:first-child { width: 22%; }
.audit-change-table td { width: 39%; white-space: pre-wrap; }
.audit-protected-value { color: var(--sc-muted); font-style: italic; }
.audit-metadata-card { padding: 1rem 1.15rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .85rem 1.25rem; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-md); background: var(--sc-paper); box-shadow: var(--sc-shadow-sm); }
.audit-metadata-card dd { margin-bottom: 0; }
.blocked-ip-table table { min-width: 52rem; }
.blocked-ip-table form { margin: 0; }
.blocked-ip-table button { min-height: 2.25rem; padding-block: .42rem; }
.secret-value { padding: .75rem; border-radius: var(--sc-radius-sm); background: var(--sc-surface-strong); overflow-wrap: anywhere; user-select: all; }

/* Autenticación */
.auth-body { min-height: 100vh; display: block; overflow-x: hidden; background: #fff; }
.auth-shell { --auth-glow-x: 50%; --auth-glow-y: 38%; --auth-shift-x: 0px; --auth-shift-y: 0px; min-height: 100vh; display: grid; grid-template-columns: minmax(34rem, 1.15fr) minmax(28rem, .85fr); background: #fff; }
.auth-brand-panel { position: relative; min-height: 100vh; padding: clamp(1.8rem, 4vw, 4rem); display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid rgb(230 129 47 / 14%); isolation: isolate; background: linear-gradient(145deg, #fff 0%, #fffaf6 60%, #fff1e3 100%); }
.auth-brand-panel::before { content: ""; position: absolute; inset: 0; opacity: .25; pointer-events: none; background-image: radial-gradient(circle, rgb(24 24 27 / 18%) .7px, transparent .8px); background-size: 20px 20px; mask-image: linear-gradient(145deg, black, transparent 72%); }
.auth-brand-panel::after { content: ""; position: absolute; width: 32rem; height: 32rem; right: -15rem; bottom: -17rem; border: 1px solid rgb(230 129 47 / 18%); border-radius: 50%; box-shadow: 0 0 0 5rem rgb(230 129 47 / 3%), 0 0 0 10rem rgb(25 155 136 / 2%); }
.auth-brand-panel > * { position: relative; z-index: 1; }
.auth-brand-ambient { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.auth-brand-ambient span { position: absolute; border-radius: 50%; filter: blur(1px); animation: auth-orbit-drift 14s ease-in-out infinite alternate; }
.auth-brand-ambient span:nth-child(1) { width: 14rem; height: 14rem; top: 20%; left: -8rem; border: 1px solid rgb(230 129 47 / 18%); }
.auth-brand-ambient span:nth-child(2) { width: 9rem; height: 9rem; top: 56%; right: 6%; border: 1px solid rgb(25 155 136 / 13%); animation-delay: -5s; }
.auth-brand-ambient span:nth-child(3) { width: .55rem; height: .55rem; top: 18%; right: 16%; background: var(--sc-source-vi); box-shadow: 0 0 0 .55rem rgb(114 216 199 / 12%), 0 0 2.5rem rgb(25 155 136 / 28%); animation-delay: -9s; }
.auth-brand-lockup { width: min(18rem, 100%); min-height: 4.75rem; display: flex; align-items: center; }
.auth-wordmark-frame { width: min(18rem, 100%); height: 4.75rem; min-width: 0; display: block; overflow: hidden; background: transparent; text-decoration: none; }
.auth-wordmark-frame img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }
.auth-community-identity { position: relative; width: min(36rem, 100%); min-height: clamp(17rem, 31vh, 20rem); margin: clamp(.8rem, 2vh, 1.5rem) auto 0; }
.auth-water-map { position: absolute; inset: 2.6rem 0 0; width: 100%; height: calc(100% - 2.6rem); overflow: visible; }
.auth-water-route { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 2 5; vector-effect: non-scaling-stroke; animation: auth-water-flow 5s linear infinite; }
.auth-water-route-al { stroke: var(--sc-source-al-line); }
.auth-water-route-vi { stroke: var(--sc-source-vi-line); animation-duration: 6s; }
.auth-water-route-out { stroke: rgb(113 113 122 / 28%); stroke-dasharray: 1 6; animation-duration: 7s; }
.auth-water-node { stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.auth-water-node-al { fill: var(--sc-source-al-line); }
.auth-water-node-vi { fill: var(--sc-source-vi-line); }
.auth-water-node-center { fill: #fff; stroke: var(--sc-brand); animation: auth-beacon 2.8s ease-out infinite; }
.auth-community-logo-frame { position: absolute; left: 50%; top: 54%; width: clamp(8.8rem, 12vw, 10.75rem); aspect-ratio: 1; padding: .7rem; border: 1px solid rgb(230 129 47 / 28%); border-radius: 50%; background: rgb(255 255 255 / 94%); box-shadow: 0 28px 65px rgb(230 129 47 / 17%), 0 8px 24px rgb(24 24 27 / 8%), inset 0 1px 0 #fff; display: grid; place-items: center; transform: translate3d(calc(-50% + var(--auth-shift-x)), calc(-50% + var(--auth-shift-y)), 0); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.auth-community-logo-frame::before, .auth-community-logo-frame::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.auth-community-logo-frame::before { inset: -1rem; border: 1px solid rgb(230 129 47 / 24%); animation: auth-ring-pulse 4s ease-out infinite; }
.auth-community-logo-frame::after { inset: -2.15rem; border: 1px solid rgb(25 155 136 / 14%); animation: auth-ring-pulse 4s 1.4s ease-out infinite; }
.community-brand-logo-auth { width: 100%; height: 100%; }
.auth-community-identity-copy { position: absolute; inset: 0 0 auto; z-index: 3; min-width: 0; text-align: center; }
.auth-community-identity-copy .eyebrow { margin-bottom: .2rem; }
.auth-community-identity-copy > p:last-child { margin: 0; color: var(--sc-muted); font-size: .82rem; font-weight: 720; letter-spacing: .01em; }
.auth-source-marker { position: absolute; z-index: 4; min-height: 2rem; display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .62rem; border: 1px solid rgb(255 255 255 / 82%); border-radius: 999px; background: rgb(255 255 255 / 72%); color: var(--sc-ink-soft); font-size: .7rem; font-weight: 790; box-shadow: 0 8px 22px rgb(24 24 27 / 7%); backdrop-filter: blur(12px); white-space: nowrap; }
.auth-source-marker i { width: .5rem; height: .5rem; border-radius: 50%; }
.auth-source-marker-al { left: 0; top: 46%; }
.auth-source-marker-al i { background: var(--sc-source-al-line); box-shadow: 0 0 0 .25rem rgb(230 129 47 / 12%); }
.auth-source-marker-vi { right: 0; top: 46%; }
.auth-source-marker-vi i { background: var(--sc-source-vi-line); box-shadow: 0 0 0 .25rem rgb(25 155 136 / 12%); }
.auth-brand-message { max-width: 36rem; margin: clamp(.5rem, 1vh, 1rem) auto 1.5rem; text-align: center; }
.auth-brand-message h2 { margin: 0 0 .85rem; font-size: clamp(2.35rem, 4.1vw, 3.8rem); line-height: 1.01; letter-spacing: -.055em; }
.auth-brand-message > p:last-child { max-width: 30rem; margin: 0; color: var(--sc-muted); font-size: 1.02rem; }
.auth-brand-message > p:last-child { margin-inline: auto; }
.auth-trust-list { max-width: 38rem; margin: 0 auto auto; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: .45rem 1rem; list-style: none; }
.auth-trust-list li { display: flex; align-items: center; gap: .45rem; color: var(--sc-ink-soft); font-size: .75rem; }
.auth-trust-list .icon { width: 1rem; height: 1rem; padding: .1rem; border-radius: 50%; background: var(--sc-brand-soft); color: var(--sc-brand-ink); }
.auth-brand-footnote { margin: 1.5rem 0 0; color: var(--sc-muted); font-size: .72rem; text-align: center; }
.auth-access-panel { position: relative; min-width: 0; min-height: 100vh; display: grid; grid-template-rows: auto auto 1fr auto; overflow: hidden; isolation: isolate; background: linear-gradient(150deg, #fff 0%, #fff 62%, #f7fffd 100%); }
.auth-access-panel::before { content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none; background: radial-gradient(circle at var(--auth-glow-x) var(--auth-glow-y), rgb(230 129 47 / 11%), transparent 17rem); }
.auth-access-panel::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .24; pointer-events: none; background-image: linear-gradient(rgb(24 24 27 / 5%) 1px, transparent 1px), linear-gradient(90deg, rgb(24 24 27 / 5%) 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(circle at 70% 34%, black, transparent 66%); }
.auth-access-ambient { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.auth-access-orbit { position: absolute; display: block; border-radius: 50%; animation: auth-orbit-drift 12s ease-in-out infinite alternate; }
.auth-access-orbit-one { width: 22rem; height: 22rem; top: 12%; right: -14rem; border: 1px solid rgb(25 155 136 / 14%); box-shadow: 0 0 0 4rem rgb(25 155 136 / 2%); }
.auth-access-orbit-two { width: 13rem; height: 13rem; left: -7rem; bottom: 10%; border: 1px solid rgb(230 129 47 / 13%); animation-delay: -4s; }
.auth-access-beacon { position: absolute; width: .55rem; height: .55rem; right: 13%; bottom: 20%; border-radius: 50%; background: var(--sc-source-vi-line); box-shadow: 0 0 0 .65rem rgb(25 155 136 / 9%), 0 0 2rem rgb(25 155 136 / 22%); animation: auth-beacon 3s ease-out infinite; }
.auth-language-switcher { position: relative; z-index: 2; justify-self: end; margin: 1rem 1.25rem 0; }
.auth-mobile-brand { display: none; }
.auth-mobile-community { position: relative; min-height: 9.5rem; margin-top: .25rem; padding: .75rem 1rem; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1.2rem; overflow: hidden; }
.auth-mobile-community::before { content: ""; position: absolute; width: 10rem; height: 10rem; left: -3rem; top: -.5rem; border: 1px solid rgb(230 129 47 / 18%); border-radius: 50%; box-shadow: 0 0 0 2rem rgb(230 129 47 / 3%); }
.auth-mobile-water-line { position: absolute; left: 5.5rem; right: 15%; top: 50%; height: 1px; background: linear-gradient(90deg, var(--sc-source-al-line), var(--sc-source-vi-line)); opacity: .38; }
.auth-mobile-community-logo-frame { position: relative; width: clamp(6rem, 20vw, 7.5rem); aspect-ratio: 1; padding: .4rem; border: 1px solid rgb(230 129 47 / 24%); border-radius: 50%; background: rgb(255 255 255 / 92%); box-shadow: 0 18px 38px rgb(230 129 47 / 13%); display: grid; place-items: center; }
.auth-mobile-community-logo-frame::after { content: ""; position: absolute; inset: -.65rem; border: 1px solid rgb(25 155 136 / 15%); border-radius: 50%; animation: auth-ring-pulse 4s ease-out infinite; }
.community-brand-logo-mobile { width: 100%; height: 100%; }
.auth-mobile-community-copy { position: relative; min-width: 0; }
.auth-mobile-community-copy p { margin: 0 0 .35rem; color: var(--sc-text); font-size: 1rem; font-weight: 820; line-height: 1.16; letter-spacing: -.025em; }
.auth-mobile-community-copy span { color: var(--sc-muted); font-size: .78rem; font-weight: 720; line-height: 1.25; }
.auth-main { position: relative; z-index: 1; width: min(100%, 33rem); margin: auto; padding: 3rem 2rem; }
.auth-card { position: relative; padding: clamp(2rem, 5vw, 3rem); border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.auth-card::before, .auth-card::after { content: ""; position: absolute; width: 5rem; height: 5rem; pointer-events: none; }
.auth-card::before { left: 0; top: 0; border-top: 1px solid rgb(230 129 47 / 48%); border-left: 1px solid rgb(230 129 47 / 48%); }
.auth-card::after { right: 0; bottom: 0; border-right: 1px solid rgb(25 155 136 / 34%); border-bottom: 1px solid rgb(25 155 136 / 34%); }
.auth-panel-status { width: fit-content; min-height: 1.8rem; display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.4rem; padding: .25rem .62rem; border: 1px solid rgb(25 155 136 / 18%); border-radius: 999px; background: rgb(241 252 249 / 72%); color: #117565; font-size: .7rem; font-weight: 790; letter-spacing: .04em; text-transform: uppercase; }
.auth-panel-status span { width: .45rem; height: .45rem; border-radius: 50%; background: var(--sc-source-vi-line); box-shadow: 0 0 0 .25rem rgb(25 155 136 / 11%); animation: auth-status-pulse 2.4s ease-in-out infinite; }
.auth-card h1 { margin: 0; font-size: clamp(2.15rem, 5vw, 2.8rem); letter-spacing: -.045em; }
.auth-community { max-width: 27rem; margin: .8rem 0 2rem; color: var(--sc-muted); line-height: 1.45; }
.auth-card form > div, .auth-field { margin-bottom: 1rem; }
.auth-card .auth-field label { margin-bottom: .42rem; font-size: .75rem; letter-spacing: .03em; text-transform: uppercase; }
.auth-card .auth-field input { min-height: 3.35rem; padding: .8rem .9rem; border: 0; border-bottom: 1.5px solid var(--sc-line-strong); border-radius: .35rem .35rem 0 0; background: rgb(250 250 250 / 72%); box-shadow: none; }
.auth-card .auth-field input:hover { border-bottom-color: var(--sc-brand); background: rgb(255 250 246 / 84%); }
.auth-card .auth-field input:focus { border-bottom-color: var(--sc-brand); background: #fff; box-shadow: 0 5px 0 -3px rgb(230 129 47 / 28%); }
.auth-card button[type="submit"] { position: relative; width: 100%; min-height: 3.35rem; margin-top: .35rem; overflow: hidden; border: 0; border-radius: .45rem; background: linear-gradient(112deg, #f7b779, var(--sc-brand), #ec8f48); box-shadow: 0 15px 32px rgb(232 135 61 / 20%); }
.auth-card button[type="submit"]::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 25%, rgb(255 255 255 / 24%) 48%, transparent 70%); transform: translateX(-120%); transition: transform .55s ease; }
.auth-card button[type="submit"]:hover::before { transform: translateX(120%); }
.auth-help { margin: 1.15rem 0 0; color: var(--sc-muted); font-size: .86rem; text-align: left; }
.auth-help a { min-height: 2.75rem; display: inline-flex; align-items: center; }
.auth-footer { position: relative; z-index: 1; padding: 1.25rem 1.5rem; display: flex; justify-content: center; gap: .45rem; color: var(--sc-muted); font-size: .72rem; text-align: center; }

@keyframes auth-water-flow { to { stroke-dashoffset: -100; } }
@keyframes auth-ring-pulse { 0%, 35% { opacity: .65; transform: scale(.96); } 80%, 100% { opacity: 0; transform: scale(1.12); } }
@keyframes auth-status-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.82); } }
@keyframes auth-beacon { 0% { opacity: .9; filter: drop-shadow(0 0 0 rgb(25 155 136 / 30%)); } 70%, 100% { opacity: .35; filter: drop-shadow(0 0 1rem rgb(25 155 136 / 0%)); } }
@keyframes auth-orbit-drift { from { transform: translate3d(-.5rem, -.4rem, 0) scale(.98); } to { transform: translate3d(.65rem, .8rem, 0) scale(1.03); } }

.community-logo-preview { width: 10rem; height: 10rem; margin: .15rem 0 .75rem; display: grid; place-items: center; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-md); background: linear-gradient(145deg, #fff, var(--sc-brand-soft)); box-shadow: var(--sc-shadow-sm); }
.community-logo-preview img { width: 8.5rem; height: 8.5rem; display: block; object-fit: contain; }

/* Calendario */
.schedule-page-heading { margin-bottom: 1.25rem; }
.schedule-now-panel { padding: .72rem .85rem; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .85rem; }
.schedule-now-heading h2 { margin: 0; font-size: clamp(.92rem, 1.5vw, 1.05rem); white-space: nowrap; }
.schedule-now-source { position: relative; min-height: 0; padding: .58rem .72rem; display: grid; grid-template-columns: minmax(8rem, .8fr) minmax(9rem, 1.2fr) auto; align-items: center; gap: .55rem; overflow: hidden; background: rgb(255 255 255 / 84%); }
.schedule-now-source::before { content: ""; position: absolute; inset: 0 auto 0 0; width: .28rem; background: var(--source-color, var(--sc-water)); }
.schedule-now-source.schedule-source-al { border-color: color-mix(in srgb, var(--sc-source-al-line) 34%, var(--sc-line)); background: linear-gradient(135deg, #fffdfa, #fff4e8); }
.schedule-now-source.schedule-source-vi { border-color: color-mix(in srgb, var(--sc-source-vi-line) 34%, var(--sc-line)); background: linear-gradient(135deg, #fcfffe, #eafaf7); }
.schedule-now-source.schedule-source-al::before, .schedule-now-source.schedule-source-al .schedule-source-dot { background: linear-gradient(180deg, var(--sc-source-al-start), var(--sc-source-al)); }
.schedule-now-source.schedule-source-vi::before, .schedule-now-source.schedule-source-vi .schedule-source-dot { background: linear-gradient(180deg, var(--sc-source-vi-start), var(--sc-source-vi)); }
.schedule-source-heading { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .5rem; }
.schedule-source-heading strong { margin: 0; overflow-wrap: anywhere; font-size: .88rem; }
.schedule-source-dot { width: .72rem; height: .72rem; border: 2px solid rgb(41 37 36 / 12%); border-radius: 50%; background: var(--source-color, var(--sc-water)); }
.schedule-now-holder { min-width: 0; overflow-wrap: anywhere; font-weight: 720; }
.schedule-occupancy { width: fit-content; min-height: 1.45rem; display: inline-flex; align-items: center; padding: .1rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 820; }
.schedule-occupancy.is-busy { background: var(--sc-brand-soft); color: var(--sc-brand-deep); }
.schedule-occupancy.is-free { background: var(--sc-success-bg); color: var(--sc-success); }

.schedule-calendar-shell { margin-top: 1.25rem; padding: clamp(1rem, 2.5vw, 1.5rem); border: 1px solid var(--sc-line); border-radius: var(--sc-radius-lg); background: var(--sc-paper); box-shadow: var(--sc-shadow-sm); }
.schedule-section-heading { margin-bottom: 1rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.schedule-section-heading h2 { margin: .15rem 0 .25rem; }
.schedule-section-heading p:last-child { margin: 0; color: var(--sc-muted); }
.schedule-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
.schedule-legend span { min-height: 1.85rem; display: inline-flex; align-items: center; gap: .4rem; padding: .24rem .58rem; border: 1px solid var(--sc-line); border-radius: 999px; background: var(--sc-surface); color: var(--sc-ink-soft); font-size: .72rem; font-weight: 720; white-space: nowrap; }
.schedule-legend i { width: .68rem; height: .68rem; border-radius: .22rem; background: var(--source-color, var(--sc-water)); }
.schedule-legend .schedule-source-al { border-color: color-mix(in srgb, var(--sc-source-al-line) 32%, var(--sc-line)); background: linear-gradient(135deg, #fffdfa, #fff2e3); }
.schedule-legend .schedule-source-vi { border-color: color-mix(in srgb, var(--sc-source-vi-line) 32%, var(--sc-line)); background: linear-gradient(135deg, #fcfffe, #e7faf6); }
.schedule-legend .schedule-source-al i { background: linear-gradient(135deg, var(--sc-source-al-start), var(--sc-source-al)); }
.schedule-legend .schedule-source-vi i { background: linear-gradient(135deg, var(--sc-source-vi-start), var(--sc-source-vi)); }
.schedule-legend .is-combined { border-color: var(--sc-combined-line); background: linear-gradient(135deg, var(--sc-combined-start), var(--sc-combined)); }
.schedule-legend .is-combined i { border: 1px solid var(--sc-combined-line); background: linear-gradient(135deg, var(--sc-combined-start), var(--sc-combined)); }
.weekly-calendar { min-height: 34rem; padding-top: .5rem; border-top: 1px solid var(--sc-line); background: var(--sc-paper); }
.weekly-calendar.fc { --fc-border-color: var(--sc-line); --fc-page-bg-color: var(--sc-paper); --fc-neutral-bg-color: var(--sc-surface); --fc-today-bg-color: color-mix(in srgb, var(--sc-brand-soft) 52%, transparent); --fc-now-indicator-color: var(--sc-accent); }
.weekly-calendar .fc-toolbar { margin: .9rem 0 1.1rem; gap: .75rem; }
.weekly-calendar .fc-toolbar-title { color: var(--sc-ink); font-size: clamp(1.05rem, 2vw, 1.35rem); font-weight: 820; }
.weekly-calendar .fc-button-primary { border-color: var(--sc-brand); background: var(--sc-brand); color: var(--sc-on-brand); box-shadow: 0 1px 2px rgb(154 61 11 / 10%); }
.weekly-calendar .fc-button-primary:hover, .weekly-calendar .fc-button-primary:focus { border-color: var(--sc-brand-dark); background: var(--sc-brand-dark); color: var(--sc-on-brand); }
.weekly-calendar .fc-button-primary:not(:disabled).fc-button-active, .weekly-calendar .fc-button-primary:not(:disabled).fc-button-active:hover, .weekly-calendar .fc-button-primary:not(:disabled).fc-button-active:focus { border-color: var(--sc-brand-dark) !important; background: var(--sc-brand-dark) !important; color: var(--sc-on-brand) !important; }
.weekly-calendar .fc-button-primary:disabled { border-color: var(--sc-line-strong); background: var(--sc-line-strong); }
.weekly-calendar .fc-button { min-height: 2.6rem; padding: .5rem .75rem; font-weight: 760; }
.weekly-calendar .fc-timegrid-now-indicator-line { z-index: 6; border-top-width: 3px; filter: drop-shadow(0 1px 2px rgb(201 107 44 / 30%)); }
.weekly-calendar .fc-timegrid-now-indicator-arrow { z-index: 7; margin-top: -8px; border-top-width: 8px; border-bottom-width: 8px; border-left-width: 14px; filter: drop-shadow(0 2px 2px rgb(201 107 44 / 36%)); }
.weekly-calendar .fc-scrollgrid { overflow: hidden; border-radius: .65rem; }
.weekly-calendar .fc-timegrid-event-harness, .weekly-calendar .fc-timegrid-event, .weekly-calendar .fc-event-main, .schedule-event-content { min-width: 0; overflow: hidden; }
.weekly-calendar .fc-event { padding: 0; border: 0; border-left: 3px solid color-mix(in srgb, currentColor 28%, transparent); border-radius: .35rem; box-shadow: 0 2px 5px rgb(41 37 36 / 13%); cursor: default; }
.weekly-calendar .fc-event.schedule-source-al { border-left-color: var(--sc-source-al-line); background-image: linear-gradient(135deg, var(--sc-source-al-start), var(--sc-source-al)); }
.weekly-calendar .fc-event.schedule-source-vi { border-left-color: var(--sc-source-vi-line); background-image: linear-gradient(135deg, var(--sc-source-vi-start), var(--sc-source-vi)); }
.weekly-calendar .fc-event.schedule-source-combined { border-left-color: var(--sc-combined-line); background-image: linear-gradient(135deg, var(--sc-combined-start), var(--sc-combined)); }
.weekly-calendar .fc-event.schedule-event-available { border: 2px dashed #d99051; background-image: linear-gradient(135deg, #fffaf5, #ffe9d5); color: #81400f; box-shadow: none; }
.weekly-calendar .fc-event.schedule-event-assigned { box-shadow: inset 0 0 0 2px rgb(255 255 255 / 58%), 0 2px 6px rgb(41 37 36 / 12%); }
.weekly-calendar .fc-event:focus { outline: 3px solid var(--sc-brand-deep); outline-offset: 2px; }
.weekly-calendar .fc-event-main { padding: .18rem .28rem; font-weight: 720; }
.schedule-event-content { display: flex; flex-direction: column; gap: .08rem; line-height: 1.12; }
.schedule-event-time, .schedule-event-title { min-width: 0; overflow: hidden; }
.schedule-event-time { flex: 0 0 auto; font-size: .66rem; font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.schedule-event-title { display: -webkit-box; font-size: .72rem; font-weight: 760; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.weekly-calendar .schedule-event-compact .schedule-event-title { -webkit-line-clamp: 1; }
.weekly-calendar .schedule-event-tiny .fc-event-main { padding: 0 .18rem; }
.weekly-calendar .schedule-event-tiny .schedule-event-content { display: block; line-height: 1; }
.weekly-calendar .schedule-event-tiny .schedule-event-time { font-size: .64rem; line-height: .95; }
.weekly-calendar .schedule-event-tiny .schedule-event-title { display: none; }
.weekly-calendar .schedule-event-micro .fc-event-main { padding: 0; }
.weekly-calendar .schedule-event-micro .schedule-event-content { display: none; }
.weekly-calendar .fc-timegrid-slot { height: 2.4rem; }
.weekly-calendar .fc-timegrid-axis-cushion, .weekly-calendar .fc-timegrid-slot-label-cushion { color: var(--sc-muted); font-size: .72rem; }
.weekly-calendar .fc-col-header-cell { background: var(--sc-surface); }
.weekly-calendar .fc-col-header-cell-cushion { min-height: 2.7rem; display: inline-flex; align-items: center; padding: .55rem .25rem; color: var(--sc-ink-soft); font-size: .82rem; font-weight: 800; text-decoration: none; text-transform: capitalize; }

.schedule-agenda { margin-top: 2rem; }
.schedule-day-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .8rem; }
.schedule-day-card { min-width: 0; overflow: hidden; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-md); background: var(--sc-paper); box-shadow: var(--sc-shadow-sm); transition: border-color .15s ease, box-shadow .15s ease; }
.schedule-day-card:hover { border-color: var(--sc-line-strong); box-shadow: 0 4px 14px rgb(24 24 27 / 5%); }
.schedule-day-card > header { padding: .75rem .9rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; border-bottom: 1px solid var(--sc-line); background: var(--sc-surface); }
.schedule-day-card h3 { margin: 0; font-size: 1rem; }
.schedule-day-card header > span { color: var(--sc-muted); font-size: .75rem; font-weight: 760; }
.schedule-day-slots { display: grid; }
.schedule-day-slots > .schedule-day-slot { min-height: 3.8rem; padding: .65rem .8rem; display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); align-items: start; gap: .6rem; border-bottom: 1px solid var(--sc-line); color: var(--sc-ink); }
.schedule-day-slots > .schedule-day-slot:last-child { border-bottom: 0; }
.schedule-day-slots time { padding-top: .08rem; color: var(--sc-brand-ink); font-size: .82rem; font-weight: 820; font-variant-numeric: tabular-nums; }
.schedule-day-slots .schedule-day-slot > span, .schedule-day-slots strong, .schedule-day-slots small { min-width: 0; display: block; }
.schedule-day-slots strong { overflow-wrap: anywhere; font-size: .86rem; }
.schedule-day-slots small { margin-top: .08rem; }
.schedule-day-slots > p { margin: 0; padding: .8rem; color: var(--sc-muted); font-size: .85rem; }
.schedule-empty-state { min-height: 18rem; align-content: center; }
.plot-schedule-workspace { margin-bottom: 1.5rem; padding: 1rem 1.15rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.plot-schedule-workspace h2 { margin: 0 0 .3rem; font-size: 1.05rem; }
.plot-schedule-workspace p { max-width: 52rem; margin: 0; color: var(--sc-muted); }
.plot-schedule-workspace form { flex: 0 0 auto; }
.schedule-effective-note { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; padding: .85rem 1rem; border: 1px solid #f0c6a4; border-radius: var(--sc-radius-md); background: linear-gradient(105deg, #fffaf5, #fff); color: var(--sc-ink); }
.schedule-effective-note .icon { flex: 0 0 auto; color: var(--sc-accent); }
.schedule-effective-note p { margin: 0; }
.simple-schedule-editor { display: grid; gap: 1rem; }
.schedule-editor-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.schedule-editor-heading h2 { margin: 0; }
.simple-schedule-rows { display: grid; gap: .85rem; }
.simple-schedule-row { overflow: hidden; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-lg); background: var(--sc-paper); box-shadow: var(--sc-shadow-sm); transition: opacity .2s ease, border-color .2s ease; }
.simple-schedule-row > header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border-bottom: 1px solid var(--sc-line); background: linear-gradient(115deg, #fff7f0, #fff); }
.simple-schedule-row > header > div { display: flex; align-items: baseline; gap: .75rem; }
.simple-schedule-row > header strong { color: var(--sc-accent-strong); font-size: .9rem; }
.schedule-row-number { font-weight: 800; }
.schedule-row-grid { display: grid; grid-template-columns: minmax(9rem, 1fr) minmax(7.5rem, .75fr) minmax(7.5rem, .75fr) minmax(15rem, 1.5fr); gap: .85rem; padding: 1rem; align-items: start; }
.schedule-source-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.schedule-source-field legend { margin-bottom: .42rem; font-weight: 700; }
.schedule-source-options { display: flex; flex-wrap: wrap; gap: .45rem; }
.schedule-source-option { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.schedule-source-option input { position: absolute; opacity: 0; pointer-events: none; }
.schedule-source-option span { display: inline-flex; min-height: 2.65rem; align-items: center; padding: .5rem .75rem; border: 1px solid var(--sc-line-strong); border-radius: 999px; background: var(--sc-paper); color: var(--sc-muted); font-size: .88rem; font-weight: 750; transition: all .18s ease; }
.schedule-source-option input:checked + span { border-color: var(--sc-accent); background: #fff0e4; color: #8c3e09; box-shadow: inset 0 0 0 1px var(--sc-accent); }
.schedule-source-option input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--sc-accent) 30%, transparent); outline-offset: 2px; }
.schedule-note-field { grid-column: 1 / -1; }
.schedule-note-field textarea { min-height: 4rem; }
.schedule-delete-toggle { display: inline-flex; align-items: center; gap: .4rem; margin: 0; color: var(--sc-muted); font-size: .88rem; cursor: pointer; }
.schedule-delete-toggle input { width: 1.05rem; height: 1.05rem; accent-color: var(--sc-danger); }
.simple-schedule-row.is-removed { border-color: #e5b6b2; opacity: .5; }
.simple-schedule-row.is-removed .schedule-row-grid { text-decoration: line-through; }
.schedule-conflict { border-left: 4px solid var(--sc-danger); }
.schedule-conflict p { margin: .35rem 0 0; }
.schedule-editor-actions { position: sticky; z-index: 5; bottom: .75rem; margin-top: .25rem; padding: .75rem; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-lg); background: color-mix(in srgb, #fff 94%, transparent); box-shadow: var(--sc-shadow-md); backdrop-filter: blur(12px); }
.slot-dispositions { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--sc-line); }
.slot-dispositions .schedule-editor-heading { align-items: center; margin-bottom: 1rem; }
.slot-dispositions .schedule-editor-heading p:last-child { max-width: 46rem; margin: .3rem 0 0; color: var(--sc-muted); }
.slot-year-filter { display: flex; align-items: end; gap: .45rem; }
.slot-year-filter label { align-self: center; margin: 0; font-weight: 750; }
.slot-year-filter input { width: 7rem; }
.slot-disposition-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: .85rem; }
.slot-disposition-card { padding: 1rem; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-lg); background: var(--sc-paper); box-shadow: var(--sc-shadow-sm); }
.slot-disposition-card > header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--sc-line); }
.slot-disposition-card > header > div, .slot-disposition-card > header span { display: grid; gap: .15rem; }
.slot-disposition-card > header small, .slot-disposition-card > header span { color: var(--sc-muted); }
.slot-disposition-card > p { color: var(--sc-muted); }
.slot-disposition-card .slot-disposition-note { padding: .65rem .75rem; border-radius: var(--sc-radius-sm); background: var(--sc-surface); color: var(--sc-ink-soft); }
.slot-disposition-actions { display: flex; flex-wrap: wrap; align-items: start; gap: .6rem; }
.slot-disposition-card details { flex: 1 1 13rem; }
.slot-disposition-card summary { width: fit-content; list-style: none; cursor: pointer; }
.slot-disposition-card summary::-webkit-details-marker { display: none; }
.slot-disposition-form { margin-top: .65rem; padding: .8rem; display: grid; gap: .7rem; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-md); background: var(--sc-surface); }
.badge-available { background: #fff0df; color: #9b470d; }
.badge-assigned { background: #e6f8f4; color: #166b62; }

/* Centro de ayuda */
.help-heading .page-actions .icon { width: 1rem; height: 1rem; }
.help-search-panel { margin-bottom: 1.5rem; padding: clamp(1.2rem, 3vw, 1.8rem); display: grid; grid-template-columns: minmax(18rem, .8fr) minmax(22rem, 1.2fr); align-items: center; gap: 1rem 2rem; border: 1px solid #f0c6a4; border-radius: var(--sc-radius-lg); background: linear-gradient(120deg, #fff8f2, #fff); box-shadow: var(--sc-shadow-sm); }
.help-search-panel h2 { margin: 0 0 .35rem; }
.help-search-panel p { margin-bottom: 0; color: var(--sc-muted); }
.help-search-field { position: relative; margin: 0; }
.help-search-field .icon { position: absolute; z-index: 1; left: .9rem; top: 50%; width: 1.15rem; height: 1.15rem; color: var(--sc-brand-ink); transform: translateY(-50%); }
.help-search-field input { min-height: 3.4rem; padding-left: 2.75rem; border-color: #e3ad82; border-radius: var(--sc-radius-md); background: var(--sc-paper); font-size: 1.05rem; box-shadow: var(--sc-shadow-sm); }
.help-results-status { grid-column: 2; font-size: .84rem; }
.help-layout { display: grid; grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr); align-items: start; gap: 1.5rem; }
.help-index { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; padding: 1rem; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-lg); background: var(--sc-paper); box-shadow: var(--sc-shadow-sm); }
.help-index > strong { display: block; margin-bottom: .65rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.help-index nav { display: grid; gap: .12rem; }
.help-index nav a { padding: .48rem .55rem; border-radius: var(--sc-radius-sm); color: var(--sc-ink-soft); font-size: .83rem; font-weight: 650; line-height: 1.3; text-decoration: none; }
.help-index nav a:hover, .help-index nav a:focus-visible { background: var(--sc-brand-soft); color: var(--sc-brand-deep); }
.help-pdf-link { margin-top: .8rem; padding-top: .8rem; display: block; border-top: 1px solid var(--sc-line); font-size: .84rem; font-weight: 750; }
.help-content { min-width: 0; display: grid; gap: 1.25rem; }
.help-section { scroll-margin-top: 1rem; overflow: hidden; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-lg); background: var(--sc-paper); box-shadow: var(--sc-shadow-sm); }
.help-section-heading { padding: 1.15rem 1.25rem; display: flex; align-items: center; gap: 1rem; background: linear-gradient(120deg, #fff7f0, #fff); cursor: pointer; list-style: none; }
.help-section-heading::-webkit-details-marker { display: none; }
.help-section[open] > .help-section-heading { border-bottom: 1px solid var(--sc-line); }
.help-section-heading > span { width: 2.75rem; height: 2.75rem; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--sc-brand); color: var(--sc-on-brand); font-size: .82rem; font-weight: 850; }
.help-section-heading h2 { margin: 0; }
.help-section-toggle { position: relative; width: 1.75rem !important; height: 1.75rem !important; margin-left: auto; background: var(--sc-paper) !important; color: var(--sc-brand-deep) !important; border: 1px solid var(--sc-line-strong); }
.help-section-toggle::before, .help-section-toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: .7rem; height: 1.5px; border-radius: 1rem; background: currentColor; transform: translate(-50%, -50%); }
.help-section-toggle::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .15s ease; }
.help-section[open] .help-section-toggle::after { transform: translate(-50%, -50%) rotate(0); }
.help-topic-list { display: grid; }
.help-topic { scroll-margin-top: 1rem; border-bottom: 1px solid var(--sc-line); }
.help-topic:last-child { border-bottom: 0; }
.help-topic > summary { min-height: 3.5rem; padding: .85rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--sc-ink); font-weight: 740; cursor: pointer; list-style: none; }
.help-topic > summary::-webkit-details-marker { display: none; }
.help-topic > summary:hover { background: var(--sc-surface); }
.help-topic[open] > summary { color: var(--sc-brand-deep); background: #fffaf6; }
.help-topic-toggle { position: relative; width: 1.5rem; height: 1.5rem; flex: 0 0 auto; border: 1px solid var(--sc-line-strong); border-radius: 50%; background: var(--sc-paper); }
.help-topic-toggle::before, .help-topic-toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: .65rem; height: 1.5px; border-radius: 1rem; background: currentColor; transform: translate(-50%, -50%); }
.help-topic-toggle::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .15s ease; }
.help-topic[open] .help-topic-toggle::after { transform: translate(-50%, -50%) rotate(0); }
.help-topic-body { padding: .25rem clamp(1.15rem, 3vw, 2rem) 1.5rem; color: var(--sc-ink-soft); }
.help-topic-body > p, .help-topic-body > ul, .help-topic-body > ol { max-width: 54rem; }
.help-topic-body h3 { margin-top: 1.4rem; }
.help-topic-body li { margin-bottom: .42rem; }
.help-topic-body code { padding: .08rem .28rem; border-radius: .25rem; background: var(--sc-surface-strong); }
.help-notice { max-width: 54rem; margin: 1rem 0; }
.help-steps { padding-left: 2.3rem; counter-reset: help-step; list-style: none; }
.help-steps li { position: relative; min-height: 1.75rem; counter-increment: help-step; }
.help-steps li::before { content: counter(help-step); position: absolute; left: -2.3rem; top: -.05rem; width: 1.55rem; height: 1.55rem; display: grid; place-items: center; border-radius: 50%; background: var(--sc-brand-soft); color: var(--sc-brand-deep); font-size: .72rem; font-weight: 850; }
.help-figure { max-width: 58rem; margin: 1.25rem 0; }
.help-figure button { width: 100%; padding: 0; overflow: hidden; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-md); background: var(--sc-paper); cursor: zoom-in; box-shadow: var(--sc-shadow-sm); }
.help-figure button:hover, .help-figure button:focus-visible { border-color: var(--sc-brand); box-shadow: var(--sc-shadow-md); }
.help-figure img { width: 100%; max-height: 42rem; display: block; object-fit: contain; background: var(--sc-surface); }
.help-figure figcaption { margin-top: .5rem; color: var(--sc-muted); font-size: .84rem; }
.help-empty { margin: 0; }
.help-image-dialog { width: min(76rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 1rem; border: 0; border-radius: var(--sc-radius-lg); background: var(--sc-paper); box-shadow: 0 24px 80px rgb(0 0 0 / 30%); }
.help-image-dialog::backdrop { background: rgb(24 24 27 / 72%); backdrop-filter: blur(3px); }
.help-image-dialog img { width: 100%; max-height: calc(100vh - 8rem); object-fit: contain; }
.help-image-dialog p { margin: .7rem 0 0; color: var(--sc-muted); }
.help-dialog-close { position: sticky; z-index: 2; top: 0; margin: 0 0 .6rem auto; display: flex; }
.policy-concept-summary { margin: 1rem 0; padding: 1rem; border: 1px solid var(--sc-line); border-radius: var(--sc-radius-md); background: var(--sc-surface); }
.policy-concept-summary .section-heading { margin-bottom: .75rem; }
.policy-concept-summary .section-heading h3 { margin: 0; }
.policy-concept-list { margin-bottom: 0; }

@media (max-width: 68rem) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-access-panel { min-height: 100vh; background: linear-gradient(165deg, #fff 0, #fffaf6 62%, #f5fffc 100%); }
  .auth-mobile-brand { width: min(100% - 2rem, 34rem); margin: 0 auto; padding: .65rem 0 .75rem; display: block; }
  .auth-main { padding-top: .75rem; }
  .member-directory-filter { grid-template-columns: 1fr 1fr; }
  .member-directory-filter .filter-field, .member-directory-filter .filter-actions { grid-column: 1 / -1; }
  .member-directory-filter .filter-actions > * { flex: 1 1 auto; }
}

@media (max-width: 82rem) {
  .site-header-inner { flex-wrap: wrap; padding: .45rem 0; }
  .nav-toggle { display: inline-flex; }
  .main-nav { display: none; flex: 1 0 100%; padding: .5rem 0 .65rem; flex-direction: column; align-items: stretch; border-top: 1px solid var(--sc-line); }
  .main-nav.is-open { display: flex; }
  .main-nav a, .nav-logout { width: 100%; min-height: 2.75rem; justify-content: flex-start; padding-inline: .8rem; }
  .main-nav a.is-active { box-shadow: inset 3px 0 var(--sc-brand); }
  .nav-utility .nav-icon { display: block; }
  .nav-spacer { display: none; }
  .nav-divider { width: 100%; height: 1px; margin: .35rem 0; }
  .nav-logout-form { width: 100%; }
  .language-switcher-nav { width: 100%; padding: .45rem .8rem; }
  .language-switcher-nav { justify-content: flex-start; }
  .help-layout { grid-template-columns: 1fr; }
  .help-index { position: static; max-height: none; }
  .help-index nav { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
}

@media (max-width: 47.99rem) {
  .page-shell { width: min(100% - 2rem, var(--sc-content)); padding-top: 1.5rem; }
  .site-header-inner, .tenant-bar-inner, .setup-banner-inner { width: min(100% - 2rem, var(--sc-content)); }
  .auth-language-switcher { margin: .8rem 1rem 0; }
  .page-heading { flex-direction: column; align-items: stretch; }
  .help-search-panel { grid-template-columns: 1fr; }
  .help-results-status { grid-column: 1; }
  .help-index nav { grid-template-columns: 1fr 1fr; }
  .help-section-heading { align-items: flex-start; }
  .dashboard-heading { min-height: 0; }
  .dashboard-status { width: fit-content; }
  .page-actions, .page-heading > .button { width: 100%; }
  .page-actions .button { flex: 1 1 auto; }
  .setup-banner-inner { align-items: flex-start; flex-direction: column; }
  .setup-banner .button { width: 100%; }
  .now-panel { grid-template-columns: 1fr; gap: 1rem; }
  .card-grid, .detail-grid, .security-grid, .form-grid, .revision-meta { grid-template-columns: 1fr; }
  .audit-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-detail-hero { grid-template-columns: 1fr; }
  .audit-detail-hero dl { grid-template-columns: 1fr; }
  .profile-data-grid, .profile-stats { grid-template-columns: 1fr; }
  .derived-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-data-grid > section { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--sc-line); }
  .profile-data-grid > section:last-child { border-bottom: 0; }
  .member-plot-editor > header, .member-plot-card > header { align-items: flex-start; flex-direction: column; }
  .member-plot-editor > form, .profile-data-grid, .member-schedule-summary { padding: 1rem; }
  .field-wide { grid-column: auto; }
  .filter-bar { grid-template-columns: 1fr; align-items: stretch; }
  .member-directory-filter { grid-template-columns: 1fr; }
  .member-directory-toolbar { justify-content: flex-start; flex-wrap: wrap; }
  .member-view-switcher { flex: 1 1 auto; }
  .member-view-switcher .button { flex: 1 1 50%; }
  .member-column-picker { flex: 1 1 auto; }
  .member-column-picker > summary { width: 100%; }
  .member-column-picker fieldset { right: auto; left: 0; width: min(17rem, calc(100vw - 2rem)); }
  .member-directory-table { min-width: 68rem; }
  .filter-actions { align-items: stretch; }
  .filter-actions > * { flex: 1 1 auto; }
  .table-hint { display: block; }
  .table-wrap table, .table-responsive table { min-width: 42rem; }
  .member-table-wrap, .member-list-hint { display: none; }
  .member-mobile-list { display: grid; gap: .7rem; }
  .table-wrap.table-compact table { min-width: 32rem; }
  th, td { padding: .72rem; }
  .list-card { align-items: flex-start; }
  .form-card { padding: 1.2rem; }
  .form-actions { justify-content: stretch; }
  .form-actions > * { flex: 1 1 auto; }
  .floating-form-actions { right: 1rem; left: 1rem; bottom: max(.75rem, env(safe-area-inset-bottom)); }
  .floating-form-actions button { width: 100%; }
  .weekly-calendar { padding: .35rem; font-size: .82rem; }
  .weekly-calendar .fc-toolbar { align-items: stretch; gap: .45rem; flex-direction: column; }
  .weekly-calendar .fc-toolbar-chunk { display: flex; justify-content: center; }
  .schedule-section-heading { align-items: flex-start; flex-direction: column; }
  .schedule-legend { justify-content: flex-start; }
  .schedule-calendar-shell { padding: .75rem; }
  .weekly-calendar { min-height: 31rem; padding: 0; }
  .weekly-calendar .fc-toolbar { margin-top: .75rem; }
  .weekly-calendar .fc-toolbar-chunk { width: 100%; }
  .weekly-calendar .fc-toolbar-chunk > * { flex: 1 1 auto; }
  .schedule-day-grid { grid-template-columns: 1fr; }
  .file-list li { align-items: flex-start; flex-direction: column; gap: .2rem; }
  .policy-summary { grid-template-columns: 1fr 1fr; }
  .billing-status-grid { grid-template-columns: 1fr; }
  .pagination-bar { align-items: flex-start; flex-direction: column; }
  .account-state-pair { justify-content: flex-start; }
  .billing-concept-list > div { align-items: flex-start; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .member-availability-heading, .member-directory-card-heading { align-items: stretch; flex-direction: column; }
  .member-availability-heading .button, .member-directory-actions { width: 100%; }
  .member-directory-actions .button { flex: 1 1 auto; }
  .member-directory-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-directory-plot { grid-template-columns: 1fr; gap: .7rem; }
  .member-directory-turn { grid-template-columns: minmax(0, 1fr) auto; }
  .member-turn-state, .member-turn-note { grid-column: 1 / -1; }
  .member-directory-plot > .member-directory-no-turns { grid-column: auto; }
  .plot-schedule-workspace { align-items: stretch; flex-direction: column; }
  .plot-schedule-workspace form, .plot-schedule-workspace button { width: 100%; }
  .schedule-editor-heading { align-items: stretch; flex-direction: column; }
  .schedule-editor-heading .button { width: 100%; }
  .schedule-row-grid { grid-template-columns: 1fr 1fr; }
  .schedule-source-field, .schedule-note-field { grid-column: 1 / -1; }
  .simple-schedule-row > header { align-items: flex-start; }
  .simple-schedule-row > header > div { align-items: flex-start; flex-direction: column; gap: .15rem; }
  .schedule-editor-actions { position: static; }
  .slot-year-filter { width: 100%; align-items: stretch; }
  .slot-year-filter label { align-self: center; }
  .slot-year-filter input { min-width: 0; width: 100%; }
  .slot-disposition-actions, .slot-disposition-actions > *, .slot-disposition-card details, .slot-disposition-card summary { width: 100%; }
  .section-supporting-copy { text-align: left; }
  .site-footer-inner { align-items: flex-start; flex-direction: column; gap: .2rem; }
  .auth-main { padding: .5rem 1rem 2.5rem; }
  .auth-card { padding: 1.6rem 1.35rem; }
  .auth-card::before, .auth-card::after { width: 3.5rem; height: 3.5rem; }
  .auth-panel-status { margin-bottom: 1.1rem; }
  .publication-panel, .document-finalize { align-items: stretch; flex-direction: column; }
  .publication-panel form, .publication-panel button, .document-finalize form, .document-finalize button { width: 100%; }
}

@media (max-width: 31rem) {
  .site-header .brand-copy { display: none; }
  .auth-mobile-brand .brand-copy { display: flex; }
  .tenant-label { display: none; }
  .policy-summary { grid-template-columns: 1fr; }
  .audit-metrics { grid-template-columns: 1fr; }
  .help-index nav { grid-template-columns: 1fr; }
  .schedule-now-panel { grid-template-columns: 1fr; }
  .schedule-now-heading h2 { white-space: normal; }
  .schedule-now-source { grid-template-columns: minmax(0, 1fr) auto; }
  .schedule-now-source .schedule-now-holder { grid-column: 1 / -1; grid-row: 2; }
}

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

@media print {
  .site-header, .tenant-bar, .setup-banner, .site-footer, .button-row, .form-actions, .floating-form-actions, .messages, .table-hint { display: none !important; }
  .page-shell { width: 100%; padding: 0; }
  body { display: block; background: white; }
  .document-sheet, .card, .surface-card { border: 0; box-shadow: none; }
}
