/* ============================================================
   Design System 2m2 — capa de componentes
   Fuente de verdad: DESIGN.md · tokens: web/tokens.css

   Reglas de este archivo:
     · Sólo consume var(--*). NUNCA declara una custom property --c-*.
     · Se enlaza en toda página justo DESPUÉS de /tokens.css y ANTES de
       la hoja específica de la página, para que ésta pueda sobrescribir.
     · Los defaults a nivel de elemento van dentro de :where() para tener
       especificidad 0 y ceder ante cualquier regla de página existente.
   ============================================================ */

/* ---------- Fuentes (self-hosted, OFL) ----------
   Sólo se descarga el subset cuyo unicode-range hace falta: para español
   basta 'latin'. 'latin-ext' queda como red de seguridad y no se pide. */
/* latin-ext */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/barlow-condensed-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/barlow-condensed-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/barlow-condensed-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/barlow-condensed-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/inter-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/inter-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/inter-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/inter-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/inter-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/inter-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/inter-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/inter-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/inter-800-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/inter-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   1. Base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-ui);
  background: var(--c-canvas);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea, optgroup { font-family: inherit; }

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-hover); }

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* Spinner reutilizable — antes duplicado en 8 archivos */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner, .ds-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: var(--r-full);
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  opacity: 0.7;
}

/* ============================================================
   2. Layout de página
   ============================================================ */

.ds-page {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 28px 56px;
}

.ds-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-xl);
  flex-wrap: wrap;
}

.ds-page-head h1 {
  margin: 0;
  font-size: var(--fs-heading-xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
  color: var(--c-text);
}

.ds-page-sub {
  margin: 5px 0 0;
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  letter-spacing: 0;
  color: var(--c-text-muted);
}

@media (max-width: 700px) {
  .ds-page { padding: 16px 16px 48px; }
}

/* ============================================================
   3. Chrome de aplicación
   ============================================================ */

/* --- App bar --- */
.ds-appbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--sh-1);
}

.ds-appbar-row {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-xxl);
}

.ds-appbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.ds-appbar-logo { height: 20px; width: auto; display: block; flex: none; }

.ds-appbar-sep {
  width: 1px;
  height: 20px;
  background: var(--c-border);
  flex: none;
}

.ds-appbar-context {
  font-size: 0.68rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Pill de usuario --- */
.ds-user-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  border-radius: var(--r-full);
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  flex: none;
  white-space: nowrap;
  transition: background 0.2s;
}

.ds-user-pill:hover { background: var(--c-surface-alt); }

.ds-user-pill-avatar {
  width: 28px; height: 28px;
  border-radius: var(--r-full);
  background: var(--c-primary);
  color: var(--c-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  flex: none;
  overflow: hidden;
}

.ds-user-pill-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ds-user-pill-avatar svg { width: 16px; height: 16px; }

.ds-user-pill-name {
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: 0;
  color: var(--c-text-secondary);
  white-space: nowrap;
}

.ds-user-pill-caret { font-size: 0.55rem; color: var(--c-text-disabled); }

/* --- Tabs principales --- */
.ds-navtabs {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-xl);
}

.ds-navtabs nav { display: flex; gap: 2px; flex-wrap: wrap; }

.ds-navtab {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0 15px;
  height: 42px;
  font-size: 0.76rem;
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--c-text-disabled);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.ds-navtab:hover { color: var(--c-text-secondary); }
.ds-navtab.active { color: var(--c-text); border-bottom-color: var(--c-primary); }

.ds-navtabs-aside {
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: 0;
  text-transform: none;
  color: var(--c-text-muted);
  padding-bottom: 11px;
  white-space: nowrap;
}

/* --- Sub-tabs (dentro de un panel) --- */
.ds-subtabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--c-border);
  flex-wrap: wrap;
}

.ds-subtab {
  border: none;
  background: none;
  cursor: pointer;
  padding: 11px 15px;
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  color: var(--c-text-disabled);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}

.ds-subtab:hover { color: var(--c-text-secondary); }
.ds-subtab.active { color: var(--c-text); border-bottom-color: var(--c-primary); }

/* --- Nav lateral vertical --- */
.ds-sidenav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ds-sidenav-item {
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  color: var(--c-text-muted);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.ds-sidenav-item:hover { background: var(--c-surface-alt); color: var(--c-text); }

.ds-sidenav-item.active {
  background: var(--c-surface-alt);
  color: var(--c-text);
  font-weight: var(--fw-bold);
}

/* --- Barra de "volver + título" --- */
.ds-backbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 42px;
}

.ds-backbar-link {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: var(--fw-bold);
  color: var(--c-text-muted);
  padding: 0;
  white-space: nowrap;
  transition: color 0.2s;
}

.ds-backbar-link:hover { color: var(--c-text); }

.ds-backbar-title {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  letter-spacing: 0;
  color: var(--c-text);
  white-space: nowrap;
}

/* ============================================================
   4. Botones
   ============================================================ */

.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-md);
  height: var(--tap-target);
  padding: 12px 18px;
  border: none;
  border-radius: var(--r-md);
  background: var(--c-primary);
  color: var(--c-on-primary);
  font-size: var(--fs-button-lg);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
}

/* El primario ACLARA al hover, nunca oscurece (regla de DESIGN.md) */
.ds-btn:hover:not(:disabled) { background: var(--c-primary-hover); color: var(--c-on-primary); }
.ds-btn:active:not(:disabled) { background: var(--c-primary-dark); transform: scale(0.97); }
.ds-btn:disabled { opacity: 0.5; cursor: default; }

.ds-btn--secondary {
  background: var(--c-surface-alt);
  color: var(--c-text-secondary);
  font-size: var(--fs-button-md);
  font-weight: var(--fw-semibold);
  letter-spacing: 0;
}
.ds-btn--secondary:hover:not(:disabled) { background: var(--c-border); color: var(--c-text-secondary); }
.ds-btn--secondary:active:not(:disabled) { background: var(--c-border-strong); }

.ds-btn--danger {
  background: var(--c-error);
  color: var(--c-on-primary);
  font-size: var(--fs-button-md);
  font-weight: var(--fw-semibold);
  letter-spacing: 0;
}
.ds-btn--danger:hover:not(:disabled) { background: var(--c-error-deep); color: var(--c-on-primary); }

.ds-btn--ghost {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-text-secondary);
  font-size: var(--fs-button-md);
  font-weight: var(--fw-semibold);
  letter-spacing: 0;
}
.ds-btn--ghost:hover:not(:disabled) { background: var(--c-surface-alt); color: var(--c-text); }

.ds-btn--sm { height: 36px; padding: 8px 14px; font-size: var(--fs-button-md); }
.ds-btn--block { width: 100%; }

/* Botón circular sólo-icono */
.ds-icon-btn {
  width: var(--tap-target);
  height: var(--tap-target);
  border-radius: var(--r-full);
  border: none;
  background: var(--c-surface-alt);
  color: var(--c-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.15s;
}
.ds-icon-btn:hover:not(:disabled) { background: var(--c-border); }
.ds-icon-btn:disabled { opacity: 0.3; cursor: default; }

/* Pill de baja jerarquía */
.ds-pill {
  padding: 5px 14px;
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  color: var(--c-text);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}
.ds-pill:hover { background: var(--c-border); border-color: var(--c-border-strong); }
.ds-pill.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: var(--c-on-primary);
}

/* Score button — el único botón cuyo color persiste como DATO, no como
   estado de interacción */
.ds-score-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  min-height: var(--tap-target);
  background: var(--c-border);
  color: var(--c-text);
  border: none;
  border-radius: var(--r-full);
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.ds-score-btn:hover { background: var(--c-border-strong); }
.ds-score-btn.scored  { background: var(--c-success-bg); color: var(--c-success); }
.ds-score-btn.partial { background: var(--c-warning-bg); color: var(--c-warning-deep); }

/* ============================================================
   5. Formularios
   ============================================================ */

.ds-field { display: flex; flex-direction: column; gap: 5px; }

.ds-label {
  display: block;
  font-size: var(--fs-label-md);
  font-weight: var(--fw-semibold);
  letter-spacing: 0;
  text-transform: none;
  color: var(--c-text-secondary);
}

/* Especificidad 0 vía :where() — cualquier regla de página gana */
:where(
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="search"], input[type="tel"],
  input[type="url"], input[type="date"], input[type="time"],
  input[type="month"], input[type="datetime-local"],
  select, textarea
) {
  /* Sólo propiedades visuales: nada de width ni height. El tamaño lo
     decide la página — un min-height global de 44px reventaría las
     rejillas densas del panel de coach. Para el spec completo del DS
     (44px de alto, ancho 100%) está la clase .ds-input. */
  padding: 9px 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  color: var(--c-text);
  font-family: var(--font-ui);
  font-size: var(--fs-body-md);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

:where(
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="search"], input[type="tel"],
  input[type="url"], input[type="date"], input[type="time"],
  input[type="month"], input[type="datetime-local"],
  select, textarea
):focus {
  border-color: var(--c-primary);
  box-shadow: var(--sh-focus);
}

:where(textarea) { resize: vertical; line-height: var(--lh-body); }
:where(select) { cursor: pointer; }

::placeholder { color: var(--c-text-disabled); opacity: 1; }

/* Clase explícita — ésta sí gana sobre las hojas de página */
.ds-input {
  width: 100%;
  height: var(--tap-target);
  padding: 9px 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  color: var(--c-text);
  font-family: var(--font-ui);
  font-size: var(--fs-body-md);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ds-input:focus { border-color: var(--c-primary); box-shadow: var(--sh-focus); }
.ds-input:disabled, .ds-input[readonly] { opacity: 0.6; cursor: default; }
textarea.ds-input { height: auto; min-height: 80px; resize: vertical; }

/* ============================================================
   6. Superficies
   ============================================================ */

/* Si no flota, no tiene sombra: se delimita con 1px solid var(--c-border) */
.ds-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--s-xl);
  color: var(--c-text);
}

.ds-card--flush { padding: 0; overflow: hidden; }

.ds-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-lg);
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
}

.ds-card-title {
  font-size: 0.68rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.ds-card-body { padding: 14px 16px; }

/* ============================================================
   7. Feedback
   ============================================================ */

/* Badge — dos ejes: categoría de contenido o estado. El color ES el dato. */
.ds-badge {
  display: inline-block;
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  border-radius: var(--r-xs);
  padding: 1px 5px;
  white-space: nowrap;
}

/* Eje 1 — tipo de bloque */
.ds-badge--exercise     { background: var(--c-cat-exercise-bg);     color: var(--c-cat-exercise); }
.ds-badge--conditioning { background: var(--c-cat-conditioning-bg); color: var(--c-cat-conditioning); }
.ds-badge--superset     { background: var(--c-cat-superset-bg);     color: var(--c-cat-superset-deep); }
/* Eje 2 — origen del bloque */
.ds-badge--program      { background: var(--c-cat-program-bg);      color: var(--c-cat-program); }
.ds-badge--personal     { background: var(--c-cat-personal-bg);     color: var(--c-success-deep); }

/* Estado — padding mayor */
.ds-badge--success, .ds-badge--error,
.ds-badge--warning, .ds-badge--info { padding: 2px 8px; }
.ds-badge--success { background: var(--c-success-bg); color: var(--c-success-deep); }
.ds-badge--error   { background: var(--c-error-bg);   color: var(--c-error-deep); }
.ds-badge--warning { background: var(--c-warning-bg); color: var(--c-warning-deep); }
.ds-badge--info    { background: var(--c-info-bg);    color: var(--c-info); }

/* Alert inline */
.ds-alert {
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body);
  background: var(--c-warning-bg);
  color: var(--c-warning-deep);
}
.ds-alert--error   { background: var(--c-error-bg);   color: var(--c-error-deep); }
.ds-alert--success { background: var(--c-success-bg); color: var(--c-success-deep); }
.ds-alert--info    { background: var(--c-info-bg);    color: var(--c-info); }

/* Modal — debe montarse a nivel body: un ancestro con display:none
   oculta incluso a sus hijos position:fixed */
.ds-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-xl);
}

.ds-modal {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

.ds-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-lg);
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
}

.ds-modal-title {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  letter-spacing: 0;
  color: var(--c-text);
}

.ds-modal-close {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--c-text-disabled);
  padding: 0 4px;
  transition: color 0.15s;
}
.ds-modal-close:hover { color: var(--c-text); }

.ds-modal-body { padding: 18px; }

.ds-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-md);
  padding: 0 18px 18px;
}

/* Dropdown — la única superficie en página con sombra (nivel 2) */
.ds-dropdown {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
  min-width: 150px;
  overflow: hidden;
  z-index: 200;
}

.ds-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  background: none;
  border: none;
  border-top: 1px solid var(--c-surface-sunken);
  font-size: var(--fs-body-sm);
  color: var(--c-text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.ds-dropdown-item:first-child { border-top: none; }
.ds-dropdown-item:hover { background: var(--c-canvas); color: var(--c-text); }

/* ============================================================
   8. Datos
   ============================================================ */

.ds-table { width: 100%; border-collapse: collapse; }

.ds-table th {
  text-align: left;
  background: var(--c-canvas);
  color: var(--c-text-secondary);
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 1px solid var(--c-border);
}

.ds-table td {
  padding: 10px 12px;
  font-size: var(--fs-body-sm);
  color: var(--c-text);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}

.ds-table tbody tr:hover td { background: var(--c-canvas); }

/* Cabecera de tabla construida con grid (patrón del panel de coach) */
.ds-thead-grid {
  padding: 10px 18px;
  background: var(--c-canvas);
  border-bottom: 1px solid var(--c-border);
}
.ds-thead-grid > * {
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--c-text-secondary);
}

/* Estado vacío */
.ds-empty {
  color: var(--c-text-muted);
  font-size: var(--fs-body-sm);
  text-align: center;
  padding: var(--s-xxl);
}
