/* ==========================================================================
   SMR Hub — FASE 7: capa de rediseño visual (identidad y composición)
   Se carga DESPUÉS de style.css y app.css: evoluciona el sistema sin
   reescribirlo. Consumo exclusivo de tokens; solo define los que cambian.
   ========================================================================== */

/* ----- Identidad: acento cian técnico (light) ----- */
:root {
  --accent: #0b7285;
  --accent-hover: #095e6e;
  --accent-soft: rgba(11, 114, 133, 0.09);
  --accent-border: rgba(11, 114, 133, 0.28);
  --accent-contrast: #ffffff;
  --focus-ring: rgba(11, 114, 133, 0.4);

  /* Jerarquía tipográfica display para headers de página/hero */
  --fs-hero: 2.1rem;
  --sidebar-group-gap: 14px;
}

html[data-theme='dark'] {
  --accent: #3bc9db;
  --accent-hover: #66d9e8;
  --accent-soft: rgba(59, 201, 219, 0.12);
  --accent-border: rgba(59, 201, 219, 0.32);
  --accent-contrast: #08252b;
  --focus-ring: rgba(59, 201, 219, 0.5);
}

/* ----- Marca: logo oficial + wordmark (Fase C) -----
   assets/brand/SMR.png es el asset oficial del propietario. Si el archivo
   aún no está en el repo, el <img> permanece oculto y el wordmark mantiene
   la identidad (el logo no se sustituye ni se reinventa). */
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: none; /* JS la muestra solo si el asset oficial existe y carga */
}
.brand-logo.is-loaded { display: block; }
/* app.css pinta un cuadrado decorativo en ::before del brand (markup antiguo
   pre-fase 7): se anula para que el wordmark y el logo oficial no compitan. */
.brand-link::before { content: none; }
.brand-link:hover .brand-word { color: var(--accent); }

/* ----- Sidebar: jerarquía por áreas (Fase D) ----- */
.sidebar-nav { display: flex; flex-direction: column; gap: var(--sidebar-group-gap); }
.sidebar-nav .nav-group {
  margin: 0;
  padding: 0 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
}
.sidebar-nav ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; }
.nav-link { border-radius: 8px; position: relative; overflow: hidden; }
.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  transition: height var(--dur-base) var(--ease);
}
.nav-link.active::before { height: 16px; }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ----- Topbar y foco ----- */
.topbar-title h1 { letter-spacing: -0.025em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ----- Hero del dashboard: retícula técnica sutil (Fase E) ----- */
.hero { position: relative; }
.hero::before {
  content: '';
  position: absolute;
  inset: 0 0 14px;
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.3;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
  mask-image: linear-gradient(180deg, #000, transparent 85%);
  pointer-events: none;
}
.hero-main { position: relative; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 4px 11px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.hero h2 { font-size: var(--fs-hero); letter-spacing: -0.03em; font-weight: 700; }

/* ----- Composición: paneles y ritmo ----- */
.panel { border-radius: var(--radius-lg); animation: p7-rise 200ms var(--ease) both; }
@keyframes p7-rise { from { opacity: 0; transform: translateY(6px); } }
.home-grid > .panel { transition: box-shadow var(--dur-base) var(--ease); }
.home-grid > .panel:hover { box-shadow: var(--shadow-md); }

.continue-panel {
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md) var(--radius-lg) var(--radius-lg) var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* Botones primarios: elevación mínima con feedback */
.btn-primary { box-shadow: 0 1px 2px rgba(8, 37, 43, 0.2); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-primary:active { transform: translateY(0); }

/* Stat pills: dígitos tabulares + micro-lift */
.stat-pill { transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.stat-pill:hover { transform: translateY(-1px); border-color: var(--accent-border); }
.stat-pill-value { font-variant-numeric: tabular-nums; }

/* Barras de progreso: relleno con transición suave */
.progress-bar-fill, [class*='progress'] > * { transition: width 300ms var(--ease); }

/* Tablas: cabecera tipo panel de datos + filas legibles */
table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
table tbody tr { transition: background var(--dur-fast) var(--ease); }
table tbody tr:hover { background: var(--hover); }
.count-note { font-variant-numeric: tabular-nums; }

/* ----- Timeline de actividad (composición distinta a las cards) ----- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--border);
}
.timeline li { position: relative; padding: 0 0 14px 26px; }
.timeline li:last-child { padding-bottom: 2px; }
.timeline li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
}
.timeline-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.timeline-text { margin-top: 1px; font-size: 13px; color: var(--text-2); }

/* ----- Estados vacíos: explicativos y con chip de icono ----- */
.empty {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 30px 22px;
}
.empty .icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  opacity: 1;
}

/* Búsqueda: anillo de foco coherente con la identidad */
.search-input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Navegación móvil: activo en acento */
.mobile-nav-link.active { color: var(--accent); }

/* ==========================================================================
   FASE 7 — Rutas de aprendizaje (pantalla mapa): componente sin estilos
   previos en app.css. Se cubre aqui para integrarlo en el sistema visual.
   ========================================================================== */

.learning-path { --path-accent: var(--accent); }

.path-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  flex-shrink: 0;
}

.path-step.done .path-num {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.path-title {
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  color: var(--text-1);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.path-title:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.path-title:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.path-meta {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-2);
}

.path-step.done .path-title { color: var(--text-2); }

.path-arrow {
  display: block;
  margin: 2px 0 6px 13px;
  color: var(--text-2);
  opacity: 0.6;
  font-size: 13px;
}

.path-step {
  display: flex;
  gap: 10px;
  list-style: none;
  padding: 8px 0;
}

.path-steps { margin: 14px 0 0; padding: 0; }
