/* ==========================================================================
   Sesio — UI del rediseño "profesional" (panel del coach / SPA).
   Vocabulario compartido por todas las páginas Vue. Solo variables del
   tema — nunca colores hardcodeados (los 8 temas deben funcionar).
   Breakpoint único: 768px (sidebar ↔ tab bar, drawers → full-screen).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Shell: sidebar desktop 224px + tab bar móvil
   -------------------------------------------------------------------------- */

.shell { min-height: 100vh; padding-top: env(safe-area-inset-top, 0px); }
/* En la app instalada (viewport-fit=cover) el contenido no se mete
   bajo el reloj/notch; en navegador env() = 0 y no cambia nada */

.sidebar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 224px;
  height: 100vh;
  background: var(--color-bg-card);
  border-right: 1px solid var(--color-border);
  z-index: var(--z-sticky);
  flex-direction: column;
  padding: 20px 12px 0;
  gap: 2px;
}
.sidebar__brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: var(--weight-bold);
  color: var(--color-text);
  padding: 4px 12px 20px;
}
.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--color-text-muted);
  font-size: 14px;
  font-family: var(--font-body);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.side-link:hover { background: var(--color-bg-subtle); }
.side-link--active {
  background: var(--color-bg-subtle);
  color: var(--color-text);
  font-weight: var(--weight-semibold);
}
.side-link .nav-icon { line-height: 0; display: inline-flex; }
.side-link .nav-icon svg { width: 18px; height: 18px; display: block; }

.sidebar__user {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--color-border);
  background: none;
  border-left: none; border-right: none; border-bottom: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
}
.sidebar__user-name {
  font-size: 13px;
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar__user-plan {
  font-size: 12px;
  color: var(--color-text-muted);
  display: block;
}

/* Contenido principal */
.main { padding-bottom: 76px; /* espacio para el tab bar móvil */ }

.page {
  padding: 20px 16px 32px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Tab bar inferior (móvil) */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0));
  z-index: var(--z-sticky);
}
.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  font-size: 11px;
  font-family: var(--font-body);
  color: var(--color-text-muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.tabbar__item--active {
  color: var(--color-primary-dark);
  font-weight: var(--weight-bold);
}
.tabbar__item .nav-icon svg { width: 18px; height: 18px; display: block; }

/* Hoja "Más" del tab bar */
.more-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg-card);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: calc(var(--z-modal) + 1);
  padding: var(--space-3) var(--space-3) calc(var(--space-6) + env(safe-area-inset-bottom, 0));
  animation: ui-sheet-in 200ms ease;
}
.more-sheet__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 12px;
  border: none;
  background: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}
.more-sheet__item:hover { background: var(--color-bg-subtle); }
.more-sheet__item--danger { color: var(--color-danger); }
.more-sheet__item .nav-icon svg { width: 18px; height: 18px; display: block; }

/* Menú del usuario (sidebar, abre hacia arriba) */
.user-pop {
  position: fixed;
  left: 12px;
  bottom: 64px;
  width: 200px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2) 0;
  z-index: calc(var(--z-sticky) + 2);
}
.user-pop__item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--color-text);
  text-decoration: none;
}
.user-pop__item:hover { background: var(--color-bg-subtle); }
.user-pop__item--danger { color: var(--color-danger); }

@media (min-width: 768px) {
  .sidebar { display: flex; }
  .tabbar { display: none; }
  .main { margin-left: 224px; padding-bottom: 0; }
  .page { padding: 32px 36px 48px; }
}

/* --------------------------------------------------------------------------
   Iconos inline (icons.js) — siempre acompañan texto, nunca lo reemplazan
   -------------------------------------------------------------------------- */

.ic {
  display: inline-flex;
  line-height: 0;
  flex-shrink: 0;
  vertical-align: middle;
}
.ic svg { width: 16px; height: 16px; }
.ic--18 svg { width: 18px; height: 18px; }
.ic--40 svg { width: 40px; height: 40px; }

/* --------------------------------------------------------------------------
   Encabezado de página: H1 + subtítulo + UNA acción primaria
   -------------------------------------------------------------------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.page-head__title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: var(--weight-bold);
  margin: 0;
  color: var(--color-text);
}
.page-head__sub {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--color-text-muted);
}
.page-head__crumb {
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
  display: inline-block;
}
a.page-head__crumb:hover { color: var(--color-primary-dark); }
@media (min-width: 768px) {
  .page-head__title { font-size: 28px; }
}

/* --------------------------------------------------------------------------
   Botones del rediseño (complementan .btn de themes.css)
   -------------------------------------------------------------------------- */

.btn--outline {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}
.btn--outline:hover {
  background: var(--color-bg-subtle);
  border-color: var(--color-border);
}
.btn--link {
  background: none;
  border: none;
  color: var(--color-primary-dark);
  padding: 0;
  min-height: 0;
  font-weight: var(--weight-semibold);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn--link:hover { text-decoration: underline; }

@media (max-width: 767px) {
  .btn--m-full { width: 100%; }
}

/* --------------------------------------------------------------------------
   Badges de estado — SIEMPRE texto, nunca símbolos
   -------------------------------------------------------------------------- */

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: var(--weight-bold);
  font-family: var(--font-body);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  line-height: 1.3;
}
.badge--ok {
  background: color-mix(in srgb, var(--color-success) 14%, transparent);
  color: var(--color-success-text, var(--color-success));
}
.badge--warn {
  background: color-mix(in srgb, var(--color-warning) 14%, transparent);
  color: var(--color-warning-text, var(--color-warning));
}
.badge--danger {
  background: color-mix(in srgb, var(--color-danger) 12%, transparent);
  color: var(--color-danger-text, var(--color-danger));
}
.badge--neutral {
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
}
.badge--primary {
  background: color-mix(in srgb, var(--color-primary) 14%, transparent);
  color: var(--color-primary-dark);
}
.badge--sm { font-size: 11px; padding: 3px 9px; }

/* Contador sólido (p. ej. pagos vencidos en el sidebar) */
.badge--count {
  background: var(--color-danger);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
}

/* --------------------------------------------------------------------------
   Cards contenedoras: listas y tablas viven DENTRO de una card
   -------------------------------------------------------------------------- */

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.card--pad { padding: 18px 20px; }
.card--hover { transition: box-shadow var(--transition-fast); }
.card--hover:hover { box-shadow: var(--shadow-md); }

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 15px 20px;
  border-bottom: 1px solid var(--color-border);
}
.card__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: var(--weight-bold);
  margin: 0;
  color: var(--color-text);
}

/* Filas tipo tabla: grid con columnas fijas (cada página define
   --cols con su grid-template-columns). En móvil colapsan a bloque. */
.thead {
  display: grid;
  grid-template-columns: var(--cols);
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border);
  font-size: 11px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-family: var(--font-body);
}
.trow {
  display: grid;
  grid-template-columns: var(--cols);
  gap: 16px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-bg-subtle);
  transition: background var(--transition-fast);
}
.trow:last-child { border-bottom: none; }
.trow--hover:hover { background: var(--color-bg-subtle); }

@media (max-width: 767px) {
  .thead { display: none; }
  .trow {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px 16px;
  }
  .trow > [data-align="right"] { text-align: left; }
  /* Celdas que solo aportan en la vista de tabla (duplican info
     al apilarse en móvil) */
  .trow > .m-hide { display: none; }
}

/* En desktops angostos (768–1150px) la tabla no cabe con sus columnas
   fijas: la card scrollea horizontal en vez de cortar la última columna. */
@media (min-width: 768px) {
  .card:has(> .thead) { overflow-x: auto; }
  .card:has(> .thead) > .thead,
  .card:has(> .thead) > .trow { min-width: 680px; }
}

/* Celdas comunes */
.cell-main { font-size: 14px; font-weight: var(--weight-semibold); color: var(--color-text); }
.cell-sub { font-size: 12px; color: var(--color-text-muted); }
.cell-muted { font-size: 13px; color: var(--color-text-muted); }
.cell-num {
  font-size: 14px;
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Avatar de iniciales */
.avatar-ini {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg-subtle);
  color: var(--color-primary-dark);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: var(--weight-bold);
  font-family: var(--font-body);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-ini img { width: 100%; height: 100%; object-fit: cover; }
.avatar-ini--sm { width: 32px; height: 32px; font-size: 11px; }
.avatar-ini--lg { width: 64px; height: 64px; font-size: 20px; font-family: var(--font-display); }
.avatar-ini--solid { background: var(--color-primary); color: #fff; }

/* --------------------------------------------------------------------------
   Stats
   -------------------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: var(--space-5);
}
@media (min-width: 768px) {
  .stats { gap: 16px; }
  .stats--4 { grid-template-columns: repeat(4, 1fr); }
  .stats--3 { grid-template-columns: repeat(3, 1fr); }
}
.stat-box {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  min-width: 0;
}
.stat-box__label {
  margin: 0;
  font-size: 12px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-family: var(--font-body);
}
.stat-box__value {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: var(--weight-bold);
  color: var(--color-text);
  line-height: 1.1;
}
.stat-box__value small { font-size: 17px; color: var(--color-text-muted); font-weight: var(--weight-bold); }
/* Cifras largas ($300.000 y más) se encogen para no desbordar la card */
.stat-box__value--long { font-size: 22px; }
.stat-box__hint { margin: 4px 0 0; font-size: 12px; color: var(--color-text-muted); }
.stat-box__hint--ok { color: var(--color-success-text, var(--color-success)); }
.stat-box__hint--danger { color: var(--color-danger-text, var(--color-danger)); }
.stat-box--danger { border-color: color-mix(in srgb, var(--color-danger) 35%, var(--color-border)); }
.stat-box--danger .stat-box__label,
.stat-box--danger .stat-box__value { color: var(--color-danger-text, var(--color-danger)); }
@media (min-width: 768px) {
  .stat-box__value { font-size: 32px; }
  .stat-box__value--long { font-size: 24px; }
}

/* --------------------------------------------------------------------------
   Chips de filtro y toggle segmentado
   -------------------------------------------------------------------------- */

.chip {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  font-family: var(--font-body);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  min-height: 32px;
}
.chip:hover { border-color: var(--color-primary-light); }
.chip--on {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: var(--weight-bold);
}
.chip-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
@media (max-width: 767px) {
  .chip-row { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
}

.seg {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-card);
}
.seg__opt {
  /* Reparten el ancho del control por igual: dentro de un .field
     (columna flex) el contenedor se estira y sin esto quedaba un
     vacío feo a la derecha en móvil */
  flex: 1 1 0;
  text-align: center;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: var(--weight-semibold);
  font-family: var(--font-body);
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  min-height: 38px;
}
.seg__opt--on { background: var(--color-primary); color: #fff; }

/* --------------------------------------------------------------------------
   Barras de progreso y gráficas con divs
   -------------------------------------------------------------------------- */

.meter {
  display: block;
  height: 6px;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.meter--thin { height: 5px; }
.meter__fill {
  display: block;
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}
.meter__fill--danger { background: var(--color-danger); }

/* Gráfica de barras: columnas flex con alturas % */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-height: 64px;
}
.bars__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}
.bars__bar {
  width: 100%;
  max-width: 48px;
  background: color-mix(in srgb, var(--color-primary) 45%, var(--color-bg-subtle));
  border-radius: 6px 6px 0 0;
}
.bars__bar--hi { background: var(--color-primary); }
.bars__top {
  font-size: 11px;
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.bars__lbl { font-size: 11px; color: var(--color-text-muted); white-space: nowrap; }
.bars__lbl--hi { font-weight: var(--weight-bold); color: var(--color-text); }

/* --------------------------------------------------------------------------
   Formularios: campos con label + ayuda de consecuencia
   -------------------------------------------------------------------------- */

/* min-width: 0 — dentro de grids de 2-3 columnas, los inputs con ancho
   intrínseco (datetime-local/select en iOS) desbordan la columna y
   desplazan todo el formulario; esto los obliga a encogerse. */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label {
  font-size: 13px;
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  font-family: var(--font-body);
}
.field__label .req { color: var(--color-danger); }
.field__help { font-size: 12px; color: var(--color-text-muted); line-height: 1.5; }
.field__error { font-size: 12px; color: var(--color-danger-text, var(--color-danger)); }
.field__input {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font: 400 14px var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  outline: none;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
/* iOS renderiza datetime-local como flex centrado con ancho propio */
input.field__input[type="datetime-local"],
input.field__input[type="date"],
input.field__input[type="time"],
input.field__input[type="month"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
}

/* Cinturón de seguridad: nada dentro del cuerpo de un drawer/modal
   puede desbordar horizontalmente. */
.dlg__body { overflow-x: hidden; }
.dlg__body input,
.dlg__body select,
.dlg__body textarea {
  max-width: 100%;
  min-width: 0;
}
.field__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}
.field__input--invalid { border-color: var(--color-danger); }
textarea.field__input { min-height: 88px; resize: vertical; }
select.field__input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Opción tipo card seleccionable (planes, temas) */
.pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  background: var(--color-bg-card);
  transition: border-color var(--transition-fast), background var(--transition-fast);
  font-family: var(--font-body);
  text-align: left;
  width: 100%;
  min-height: 44px;
}
.pick:hover { border-color: var(--color-primary-light); }
.pick--on {
  border: 2px solid var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 6%, transparent);
  padding: 11px 13px; /* compensa el borde de 2px */
}

/* Nota informativa dentro de formularios */
.form-note {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  line-height: 1.5;
}

/* Toggle switch 44×26, thumb 20 */
.switch {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition-fast);
  padding: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-fast);
}
.switch--on { background: var(--color-primary); }
.switch--on::after { transform: translateX(18px); }

/* --------------------------------------------------------------------------
   Drawer lateral 420px + modal centrado 560px (full-screen en móvil)
   -------------------------------------------------------------------------- */

.ui-scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 18, 0.28);
  z-index: var(--z-modal);
  animation: ui-fade-in 200ms ease;
}
.ui-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--color-bg-card);
  border-left: 1px solid var(--color-border);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  z-index: calc(var(--z-modal) + 1);
  animation: ui-drawer-in 250ms ease;
}

/* Formularios largos (p.ej. evento, producto) en escritorio:
   crece con la pantalla, ~55% del viewport con piso y techo */
@media (min-width: 768px) {
  .ui-drawer--wide { width: clamp(680px, 55vw, 1040px); }
}
.ui-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 1);
  display: grid;
  place-items: center;
  padding: var(--space-4);
  pointer-events: none;
}
.ui-modal {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 2 * var(--space-4));
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  animation: ui-modal-in 150ms ease;
}

.dlg__header {
  padding: 22px 28px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-shrink: 0;
}
.dlg__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: var(--weight-bold);
  margin: 0;
  color: var(--color-text);
}
.dlg__sub { margin: 4px 0 0; font-size: 13px; color: var(--color-text-muted); line-height: 1.5; }
.dlg__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  line-height: 0;
  flex-shrink: 0;
}
.dlg__close:hover { background: var(--color-bg-subtle); color: var(--color-text); }
.dlg__body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.dlg__footer {
  padding: 18px 28px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--color-bg-card);
}

@media (max-width: 767px) {
  .ui-drawer {
    width: 100vw;
    border-left: none;
  }
  .ui-modal-wrap { padding: 0; align-items: end; }
  .ui-modal {
    max-width: none;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    animation: ui-drawer-up 250ms ease;
  }
  .dlg__header { padding: 18px 20px; }
  .dlg__body { padding: 20px; }
  .dlg__footer { padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0)); }
  .dlg__footer .btn { flex: 1; }
}

@keyframes ui-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ui-drawer-up { from { transform: translateY(48px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ui-modal-in { from { transform: scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ui-sheet-in { from { transform: translateY(100%); } to { transform: none; } }

/* --------------------------------------------------------------------------
   Utilidades varias del rediseño
   -------------------------------------------------------------------------- */

/* Card oscura (p. ej. "Tu link público" del dashboard) */
.card-dark {
  background: var(--color-primary-dark);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.card-dark .stat-box__label { color: #fff; opacity: 0.7; }

/* Fecha "eyebrow" en accent (eventos) */
.eyebrow-accent {
  font-size: 12px;
  font-weight: var(--weight-bold);
  color: var(--color-accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-body);
}

/* Banner de una línea (solicitudes pendientes) */
.banner {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.banner__text { flex: 1; font-size: 14px; min-width: 200px; color: var(--color-text); }

/* Bloque de nota privada */
.note-block {
  background: var(--color-bg-subtle);
  border-radius: 8px;
  padding: 12px 14px;
}
.note-block__date {
  display: block;
  font-size: 11px;
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.note-block__text { margin: 4px 0 0; font-size: 13px; line-height: 1.55; color: var(--color-text); }

/* --- Combobox buscable (UiCombobox) --- */
.ui-combo { position: relative; }
.ui-combo__caret {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 1.8px solid var(--color-text-muted);
  border-bottom: 1.8px solid var(--color-text-muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.ui-combo__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: var(--z-dropdown, 100);
  max-height: 280px;
  overflow-y: auto;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
}
.ui-combo__opt {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
}
.ui-combo__opt--active { background: var(--color-bg-subtle); }
.ui-combo__name { display: block; font-size: 14px; color: var(--color-text); }
.ui-combo__sub { display: block; font-size: 12px; color: var(--color-text-muted); margin-top: 1px; }
.ui-combo__empty { margin: 0; padding: 10px; font-size: 13px; color: var(--color-text-muted); }
