/* ============================================================
   components.css — Estilos de los macros de _components/ui.twig
   ------------------------------------------------------------
   Carga DESPUES de tokens.css + base.css.
   Convencion: BEM-lite (block, block__elem, block--modifier).
   Sin Tailwind. Si en algun momento se introduce, mantener esta
   capa para preservar el contrato con los macros.
   ============================================================ */

/* ============================================================
   BUTTON
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  max-width: 100%;
  min-width: 0;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  transition: background var(--transition-fast) var(--ease-out),
              border-color var(--transition-fast) var(--ease-out),
              color var(--transition-fast) var(--ease-out),
              transform var(--transition-fast) var(--ease-out);
  white-space: normal;
  text-align: center;
  user-select: none;
}

.btn > svg,
.btn__icon {
  flex: 0 0 auto;
}

.btn > span:not(.btn__icon),
.btn__label {
  min-width: 0;
}

.btn:disabled,
.btn--loading {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--full {
  width: 100%;
}

/* Sizes */
.btn--xs {
  font-size: var(--text-xs);
  padding: 4px 8px;
  min-height: 28px;
  gap: 5px;
}
.btn--sm {
  font-size: var(--text-sm);
  padding: 6px 12px;
  min-height: 32px;
}
.btn--md {
  font-size: var(--text-base);
  padding: 9px 16px;
  min-height: 40px;
}
.btn--lg {
  font-size: var(--text-md);
  padding: 12px 20px;
  min-height: 48px;
}

/* Variant: primary */
.btn--primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}
.btn--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--primary-fg);
  text-decoration: none;
}
.btn--primary:active {
  background: var(--primary-pressed);
  color: var(--primary-fg);
}

/* Variant: secondary (accent) */
.btn--secondary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.btn--secondary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  /* Re-declara el color: el botón es un <a>, y el a:hover global (azul oscuro)
     lo pisaba dejando texto azul sobre fondo azul. Mantiene el fg blanco. */
  color: var(--accent-fg);
  text-decoration: none;
}

/* Variant: tertiary (outline neutral) */
.btn--tertiary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn--tertiary:hover {
  border-color: var(--line-strong);
  background: var(--surface-alt);
  text-decoration: none;
}

/* Variant: destructive */
.btn--destructive {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn--destructive:hover {
  background: var(--danger-ink);
  text-decoration: none;
}

/* Variant: ghost (transparent text) */
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
}
.btn--ghost:hover {
  background: var(--surface-alt);
  text-decoration: none;
}

.btn__icon {
  display: inline-flex;
  align-items: center;
}

.btn--loading::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 6px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   FIELD (input / textarea / select)
   ============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-soft);
}

.field__required {
  color: var(--danger);
  font-weight: 600;
}

.field__wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.field__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  pointer-events: none;
}

.field__control {
  width: 100%;
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 9px 12px;
  transition: border-color var(--transition-fast) var(--ease-out),
              box-shadow var(--transition-fast) var(--ease-out);
  min-height: 40px;
}

.field__control--with-icon {
  padding-left: 38px;
}

.field--sm .field__control {
  font-size: var(--text-sm);
  padding: 6px 10px;
  min-height: 32px;
}

.field--lg .field__control {
  font-size: var(--text-md);
  padding: 12px 14px;
  min-height: 48px;
}

.field__control:hover:not(:focus):not(:disabled) {
  border-color: var(--line-strong);
}

.field__control:disabled {
  background: var(--surface-alt);
  color: var(--muted);
  cursor: not-allowed;
}

.field__control--textarea {
  resize: vertical;
  min-height: 96px;
  line-height: var(--leading-normal);
}

.field__control--select {
  cursor: pointer;
  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='%236E6A62' stroke-width='1.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.field--error .field__control {
  border-color: var(--danger);
}

.field__hint {
  font-size: var(--text-xs);
  color: var(--muted);
}

.field__error {
  font-size: var(--text-xs);
  color: var(--danger);
}

/* ============================================================
   DROPZONE
   ============================================================ */
.dropzone {
  position: relative;
  border: 2px dashed var(--line);
  border-radius: var(--r-lg);
  padding: var(--space-8);
  text-align: center;
  background: var(--surface-alt);
  transition: border-color var(--transition-base) var(--ease-out),
              background var(--transition-base) var(--ease-out);
  cursor: pointer;
}

.dropzone:hover,
.dropzone--active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.dropzone__title {
  font-weight: 500;
  color: var(--ink);
}

.dropzone__hint {
  font-size: var(--text-sm);
  color: var(--muted);
}

.dropzone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform var(--transition-base) var(--ease-out),
              border-color var(--transition-base) var(--ease-out),
              box-shadow var(--transition-base) var(--ease-out);
}

a.card {
  display: block;
  color: inherit;
  text-decoration: none;
}

a.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5) 0;
}

.card__heading {
  flex: 1;
}

.card__eyebrow {
  margin-bottom: 4px;
}

.card__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
  line-height: var(--leading-snug);
}

.card__subtitle {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: 4px;
}

.card__actions {
  flex-shrink: 0;
  display: flex;
  gap: var(--space-2);
}

.card__body {
  padding: var(--space-5);
}

.card__footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--line-soft);
  background: var(--surface-alt);
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: flex-end;
}

.card--elevated {
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.card--error {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.card--outline {
  background: transparent;
}

.card--destacada {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ============================================================
   CARD --linked + __overlay
   Patron stretched-link: la card es un <div> (HTML valido,
   sin <a> anidados). Un <a class="card__overlay"> absoluto cubre
   toda el area para que el click vaya al link primario. Sub-links
   internos deben tener position:relative + z-index:2 para quedar
   por encima del overlay y seguir siendo clickeables.
   ============================================================ */
.card--linked {
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card--linked:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.card__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  text-decoration: none;
  /* link invisible pero clickeable */
}

.card__overlay:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

/* Los sub-links tienen position:relative + z-index:2 inline; el
   .card__sublink class hace explicito el contrato para futuras edits. */
.card__sublink {
  position: relative;
  z-index: 2;
}

/* ============================================================
   BADGE
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--r-full);
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge--soft.badge--success { background: var(--success-bg); color: var(--success-ink); }
.badge--soft.badge--warning { background: var(--warning-bg); color: var(--warning-ink); }
.badge--soft.badge--danger  { background: var(--danger-bg);  color: var(--danger-ink); }
.badge--soft.badge--info    { background: var(--info-bg);    color: var(--info-ink); }
.badge--soft.badge--neutral { background: var(--surface-alt); color: var(--ink-soft); }
.badge--soft.badge--accent  { background: var(--accent-soft); color: var(--accent-ink); }
.badge--soft.badge--primary { background: var(--accent-soft); color: var(--primary); }

.badge--solid.badge--success { background: var(--success); color: #fff; }
.badge--solid.badge--warning { background: var(--warning); color: #fff; }
.badge--solid.badge--danger  { background: var(--danger);  color: #fff; }
.badge--solid.badge--info    { background: var(--info);    color: #fff; }
.badge--solid.badge--primary { background: var(--primary); color: var(--primary-fg); }

.badge--outline {
  background: transparent;
}
.badge--outline.badge--success { border-color: var(--success); color: var(--success-ink); }
.badge--outline.badge--warning { border-color: var(--warning); color: var(--warning-ink); }
.badge--outline.badge--danger  { border-color: var(--danger);  color: var(--danger-ink); }
.badge--outline.badge--info    { border-color: var(--info);    color: var(--info-ink); }
.badge--outline.badge--neutral { border-color: var(--line);    color: var(--ink-soft); }

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ============================================================
   STAT
   ============================================================ */
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.stat__label {
  margin: 0;
}

.stat__value {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}

.stat__unit {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}

.stat__hint {
  font-size: var(--text-xs);
  color: var(--muted);
}

.stat__delta {
  font-size: var(--text-sm);
  font-weight: 500;
  margin-top: 4px;
}
.stat__delta--up    { color: var(--success); }
.stat__delta--down  { color: var(--danger); }
.stat__delta--flat  { color: var(--muted); }

.stat--success .stat__value { color: var(--success); }
.stat--warning .stat__value { color: var(--warning); }
.stat--danger  .stat__value { color: var(--danger); }

/* Stat clickable (opts.href en el macro): tarjeta navegable. Chevron a la
   derecha (afordancia en reposo, no un acento border-left) + hover que
   levanta borde/fondo. Sin subrayado ni cambio de color del texto. */
a.stat--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  padding-right: calc(var(--space-4) + 16px);
  transition: border-color .15s ease, background .15s ease;
}
a.stat--link::after {
  content: "";
  position: absolute;
  top: 50%;
  right: var(--space-4);
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--muted);
  border-right: 2px solid var(--muted);
  transform: translateY(-50%) rotate(45deg);
  transition: border-color .15s ease, right .15s ease;
}
a.stat--link:hover {
  border-color: var(--line-strong);
  background: var(--surface-alt);
}
a.stat--link:hover::after {
  border-color: var(--primary);
  right: calc(var(--space-4) - 2px);
}
a.stat--link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: var(--text-sm);
  text-transform: uppercase;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar--xs { width: 20px; height: 20px; font-size: 9px; }
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.avatar--md { width: 36px; height: 36px; font-size: 13px; }
.avatar--lg { width: 48px; height: 48px; font-size: var(--text-base); }
.avatar--xl { width: 72px; height: 72px; font-size: var(--text-lg); }

.avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   COUNTDOWN
   ============================================================ */
.countdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.countdown__value {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}

.countdown__unit {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 400;
  margin-right: var(--space-2);
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  border-bottom: 1px solid var(--line);
}

.tabs__list {
  display: flex;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-x: auto;
}

.tabs__item {
  flex-shrink: 0;
}

.tabs__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.tabs__link:hover:not(.tabs__link--disabled) {
  color: var(--ink);
  text-decoration: none;
}

.tabs__link--active {
  color: var(--ink);
  border-color: var(--primary);
}

.tabs__link--disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.tabs__badge {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: var(--text-xs);
  padding: 1px 6px;
  border-radius: var(--r-full);
}

/* Rótulo "Pronto" en tabs deshabilitadas: neutro y legible, sin heredar
   el opacity del enlace deshabilitado (para que no parezca roto). */
.tabs__badge--soon {
  background: rgba(0, 0, 0, 0.06);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 1;
}
.tabs__link--disabled .tabs__badge--soon { opacity: 1; }

/* Variant: pill */
.tabs--pill {
  border-bottom: none;
}
.tabs--pill .tabs__list {
  gap: 4px;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: var(--r-md);
  display: inline-flex;
}
.tabs--pill .tabs__link {
  border: none;
  border-radius: var(--r-sm);
  padding: 6px 12px;
}
.tabs--pill .tabs__link--active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   MODAL
   ============================================================ */
dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-xl);
  max-width: calc(100vw - (var(--space-4) * 2));
  max-height: calc(100vh - (var(--space-4) * 2));
  overflow-x: hidden;
  overflow-y: auto;
}

dialog:not([open]) {
  display: none;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.modal[x-cloak] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(27, 27, 30, 0.5);
  backdrop-filter: blur(2px);
}

.modal__panel {
  position: relative;
  background: var(--surface-elevated);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal__panel--sm { width: 380px; }
.modal__panel--md { width: 520px; }
.modal__panel--lg { width: 720px; }
.modal__panel--xl { width: 960px; }

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5);
  border-bottom: 1px solid var(--line-soft);
  flex: 0 0 auto;
}

.modal__title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.modal__close {
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
}
.modal__close:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.modal__body {
  padding: var(--space-5);
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.modal__footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  flex: 0 0 auto;
  flex-wrap: wrap;
  background: var(--surface-alt);
}

/* Mobile fullscreen variant */
@media (max-width: 640px) {
  .modal__panel--fullscreen {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.empty__icon {
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.empty__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
}

.empty__description {
  font-size: var(--text-sm);
  color: var(--muted);
  max-width: 360px;
}

.empty__cta {
  margin-top: var(--space-2);
}

/* ============================================================
   ALERT / BANNER inline
   ------------------------------------------------------------
   La clase .alert ya se usaba en ~25 plantillas pero no tenia
   estilo: quedaba como <div> pelado. Aqui queda definida una sola
   vez para toda la plataforma.

   Regla dura del proyecto: el tono NO se codifica con un
   border-left grueso (AI tell). Se codifica con fondo tintado +
   borde 1px completo + tinta del color semantico, igual que
   .badge--soft y .toast.
   ============================================================ */
/* display:block a proposito: las ~25 plantillas que ya usaban .alert meten
   contenido inline (<strong> + texto suelto); con flex cada nodo se volvia
   un item y el texto se partia en columnas. Para el layout con icono usar
   .alert--icon + .alert__icon/.alert__body. */
.alert {
  display: block;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-alt);
  color: var(--ink);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.alert--icon {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.alert--icon > svg,
.alert__icon {
  flex: 0 0 auto;
  margin-top: 2px;
}

.alert__body {
  flex: 1;
  min-width: 0;
}

.alert__title {
  font-weight: 600;
  display: block;
}

.alert p {
  margin: 0;
  color: inherit;
}

.alert p + p {
  margin-top: var(--space-2);
}

.alert--success { background: var(--success-bg); border-color: var(--success); color: var(--success-ink); }
.alert--warning { background: var(--warning-bg); border-color: var(--warning); color: var(--warning-ink); }
.alert--danger,
.alert--error   { background: var(--danger-bg);  border-color: var(--danger);  color: var(--danger-ink); }
.alert--info    { background: var(--info-bg);    border-color: var(--info);    color: var(--info-ink); }
.alert--accent  { background: var(--accent-soft); border-color: var(--accent);  color: var(--accent-ink); }
.alert--neutral { background: var(--surface-alt); border-color: var(--line-strong); color: var(--ink); }

/* Cita / mensaje textual embebido (blockquote). Mismo criterio: caja
   tintada con borde 1px, nunca una barra lateral gruesa. */
.quote-block {
  margin: 0;
  padding: var(--space-3);
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-soft);
}

/* ============================================================
   TOAST
   ------------------------------------------------------------
   Regla dura del proyecto: el tono NUNCA se codifica con un
   border-left grueso. Se codifica con fondo tintado + borde 1px
   completo del color semantico (mismo lenguaje que .badge--soft).
   ============================================================ */
.toast {
  background: var(--info-bg);
  color: var(--info-ink);
  border: 1px solid var(--info);
  border-radius: var(--r-md);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 280px;
  max-width: 480px;
}

.toast--success { background: var(--success-bg); border-color: var(--success); color: var(--success-ink); }
.toast--warning { background: var(--warning-bg); border-color: var(--warning); color: var(--warning-ink); }
.toast--danger  { background: var(--danger-bg);  border-color: var(--danger);  color: var(--danger-ink); }
.toast--info    { background: var(--info-bg);    border-color: var(--info);    color: var(--info-ink); }

.toast__message {
  flex: 1;
  font-size: var(--text-sm);
  color: inherit;
}

.toast__close {
  font-size: 20px;
  color: inherit;
  opacity: 0.7;
  width: 24px;
  height: 24px;
  border-radius: var(--r-sm);
}

.toast__close:hover {
  opacity: 1;
}

/* ============================================================
   SKELETON
   ============================================================ */
.skel {
  background: linear-gradient(
    90deg,
    var(--surface-alt) 0%,
    var(--line-soft) 50%,
    var(--surface-alt) 100%
  );
  background-size: 200% 100%;
  border-radius: var(--r-sm);
  animation: skel-shimmer 1.4s ease-in-out infinite;
}

@keyframes skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skel--line {
  height: 12px;
  margin: 6px 0;
}

.skel--line-title {
  height: 20px;
  width: 60%;
}

.skel--line-short {
  width: 40%;
}

.skel--row {
  height: 48px;
  margin: 8px 0;
  border-radius: var(--r-md);
}

.skel--card {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  animation: none;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline--vertical .timeline__row {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: var(--space-3);
  position: relative;
  padding: var(--space-3) 0;
}

.timeline__connector {
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.timeline__row:first-child .timeline__connector { top: 50%; }
.timeline__row:last-child .timeline__connector  { bottom: 50%; }

.timeline__node {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
  align-self: center;
  z-index: 1;
}

.timeline__row--success .timeline__node { background: var(--success); border-color: var(--success); }
.timeline__row--warning .timeline__node { background: var(--warning); border-color: var(--warning); }
.timeline__row--danger  .timeline__node { background: var(--danger);  border-color: var(--danger); }
.timeline__row--next    .timeline__node { background: var(--accent);  border-color: var(--accent); }
.timeline__row--past    .timeline__node { background: var(--muted);   border-color: var(--muted); }

.timeline__content {
  padding: var(--space-1) 0;
}

.timeline__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.timeline__time {
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 500;
}

.timeline__title {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--ink);
  flex: 1;
}

.timeline__amount {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--ink);
}

.timeline__description {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: 2px;
}

/* ============================================================
   DATA TABLE (editable_table_shell)
   ============================================================ */
.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table thead th {
  text-align: left;
  font-weight: 500;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--muted);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  white-space: nowrap;
}

.data-table-wrap--sticky-header thead th {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.data-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--surface-alt);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table__col--right    { text-align: right; }
.data-table__col--center   { text-align: center; }
.data-table__col--sortable { cursor: pointer; user-select: none; }
.data-table__col--check    { width: 36px; }
.data-table__col--actions  { width: 80px; text-align: right; }

/* Header ordenable (opt-in vía col.href en editable_table_shell). */
.data-table__sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.data-table__sort-link:hover { color: var(--ink); }
.data-table__col--right .data-table__sort-link { flex-direction: row-reverse; }
.data-table__sort-arrow {
  font-size: 9px;
  line-height: 1;
  opacity: 0.35;
  transition: opacity var(--transition-fast);
}
.data-table__sort-link:hover .data-table__sort-arrow,
.data-table__sort-link.is-active .data-table__sort-arrow { opacity: 0.9; }

/* ============================================================
 * Notificaciones — campanita + dropdown + centro
 * ============================================================ */

.notif-bell { position: relative; display: inline-flex; }

.notif-bell__btn { position: relative; }

.notif-bell__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger, #d33);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.notif-bell__badge--hidden { display: none; }

.notif-bell__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e4e4e7);
  border-radius: var(--r-lg, 12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.notif-bell__dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line-soft, #efefef);
}

.notif-bell__dropdown-title {
  margin: 0;
  font-size: var(--text-sm, 14px);
  font-weight: 600;
}

.notif-bell__mark-all {
  background: none;
  border: 0;
  color: var(--accent, #1f5fbf);
  font-size: var(--text-xs, 12px);
  cursor: pointer;
  padding: 0;
}

.notif-bell__list { max-height: 420px; overflow-y: auto; }
.notif-bell__empty { padding: var(--space-6) var(--space-4); text-align: center; color: var(--muted); font-size: var(--text-sm); }

.notif-bell__items { list-style: none; margin: 0; padding: 0; }

.notif-bell__item { border-bottom: 1px solid var(--line-soft, #f1f1f1); }
.notif-bell__item:last-child { border-bottom: none; }

.notif-bell__item-link {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: inherit;
}
.notif-bell__item-link:hover { background: var(--surface-alt, #f8f8f8); }

.notif-bell__item-icon { flex-shrink: 0; color: var(--muted); }
.notif-bell__item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-bell__item-title { font-size: var(--text-sm); font-weight: 500; }
.notif-bell__item-text  { font-size: var(--text-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-bell__item-time  { font-size: 11px; color: var(--muted); margin-top: 2px; }

.notif-bell__item--unread { background: rgba(31, 95, 191, 0.04); }
.notif-bell__item--unread .notif-bell__item-title { font-weight: 600; }
.notif-bell__item--urgent .notif-bell__item-icon { color: var(--danger, #d33); }
.notif-bell__item--high   .notif-bell__item-icon { color: #b8860b; }

.notif-bell__dropdown-foot { padding: var(--space-2) var(--space-4); text-align: center; border-top: 1px solid var(--line-soft); }
.notif-bell__see-all { font-size: var(--text-xs); color: var(--accent); text-decoration: none; }
.notif-bell__see-all:hover { text-decoration: underline; }

/* Vista de pagina completa */

.notif-page__filters {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line-soft);
}

.notif-page__filter {
  font-size: var(--text-sm);
  padding: 4px 10px;
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
}
.notif-page__filter.is-active {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--ink, #111);
}

.notif-page__mark-all-form { margin-left: auto; }

.notif-page__list { list-style: none; margin: 0; padding: 0; }
.notif-page__row {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line-soft);
  align-items: flex-start;
}
.notif-page__row-icon { flex-shrink: 0; color: var(--muted); padding-top: 2px; }
.notif-page__row-body { flex: 1; min-width: 0; }
.notif-page__row-head { display: flex; justify-content: space-between; gap: var(--space-3); align-items: baseline; }
.notif-page__row-title { margin: 0; font-size: var(--text-base); font-weight: 500; }
.notif-page__row-title a { color: inherit; text-decoration: none; }
.notif-page__row-title a:hover { text-decoration: underline; }
.notif-page__row-text { margin: 4px 0 0; font-size: var(--text-sm); color: var(--muted); }
.notif-page__row-time { font-size: var(--text-xs); color: var(--muted); white-space: nowrap; }
.notif-page__row-action { flex-shrink: 0; }
.notif-page__row--unread { background: rgba(31, 95, 191, 0.04); }
.notif-page__row--unread .notif-page__row-title { font-weight: 600; }
.notif-page__row--urgent .notif-page__row-icon { color: var(--danger, #d33); }
.notif-page__row--high   .notif-page__row-icon { color: #b8860b; }

/* ─────────────────────────────────────────────────────────────────────────
   Sistema visual de eventos (consistente en toda la plataforma)
   TIPO de evento = punto de color (.evt-dot); ESPACIO = badge con letra
   (.evt-tag). Fuente de datos: WDE\Domain\Events\EventTaxonomy. Render:
   _components/event-taxonomy.twig. Tamaños: --xs (calendario compacto),
   default, --lg (vista ampliada).
   ───────────────────────────────────────────────────────────────────────── */
.evt-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.evt-dot--xs { width: 6px; height: 6px; }
.evt-dot--lg { width: 10px; height: 10px; }
.evt-tag {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-width: 14px; height: 14px; padding: 0 2px;
  font-size: 9px; font-weight: 700; line-height: 1; letter-spacing: 0;
  color: #fff; background: #8A8A8A; border-radius: 3px; flex-shrink: 0;
}
.evt-tag--lg { min-width: 16px; height: 16px; font-size: 10px; border-radius: 4px; }
.evt-tags { display: inline-flex; gap: 2px; align-items: center; }
.evt-marker { display: inline-flex; gap: 5px; align-items: center; vertical-align: middle; }
.evt-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.evt-legend__h { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #6b6257); }
.evt-legend__item { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted, #6b6257); }

/* ─────────────────────────────────────────────────────────────────────────
   AREAS DE TOQUE (>= 44x44 px) — WCAG 2.5.5 / Apple HIG
   ------------------------------------------------------------------------
   Solo en punteros gruesos (telefono/tablet, incluida la PWA de staff).
   El desktop con mouse queda intacto: la densidad del panel es deliberada.

   Dos estrategias segun el control:
   a) Controles con texto (.btn--xs/.btn--sm, campos): se dejan crecer con
      min-height/min-width, que no rompe nada.
   b) Controles icon-only chicos (cerrar modal, cerrar toast): NO se agrandan
      visualmente — se expande solo el area de toque con un ::before
      transparente centrado, para no deformar cabeceras y barras.
   ───────────────────────────────────────────────────────────────────────── */
@media (pointer: coarse) {
  .btn--xs,
  .btn--sm {
    min-height: 44px;
    min-width: 44px;
  }

  .btn--md { min-height: 44px; }

  /* El :not() excluye el textarea a proposito: su piso propio es 96px
     (.field__control--textarea) y, al tener la MISMA especificidad que
     .field__control pero venir antes en el archivo, un 44px suelto aca lo
     pisaria y ACHICARIA los textarea justo en los dispositivos tactiles. */
  .field__control:not(.field__control--textarea),
  .field--sm .field__control:not(.field__control--textarea) {
    min-height: 44px;
  }

  .tabs__link,
  .tabs--pill .tabs__link {
    min-height: 44px;
  }

  /* (b) area de toque expandida sin cambiar el tamano visual */
  .modal__close,
  .toast__close {
    position: relative;
  }

  .modal__close::before,
  .toast__close::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
  }
}
