/* ============================================================
   hto-licensing — DASHBOARD LIGHT (dashboard-v1 + auth chrome usado por dashboard)
   Ensamblado desde chunks portados (branch light-pilot)
============================================================ */

/* ============================================================
   hto-licensing — DASHBOARD LIGHT — css/light/dashboard.css
   Port light de css/dashboard-v1.css (completo) + clases de
   css/portal-auth.css usadas por dashboard.html.
   Requiere css/light/base-light.css cargado antes (tokens :root).
   Secciones:
     1. Hero V2 (badge contrato, título, today chip, btn-continue,
        module preview)
     2. Stat cards (blancas + sombra suave, tonos green/blue/gold)
     3. Section headings
     4. Activity heatmap (escala light: #f1efe9 → #15a34a)
     5. Recent activity feed
     6. Banner contrato vencido
     7. Responsive (idéntico al origen)
     8. Atmospheric depth layer (versión light)
     9. portal-auth: loading, login card, email fallback,
        user chip sidebar, welcome banner, overrides inline
============================================================ */

/* ── Hero V2 ─────────────────────────────────────────────── */
:root {
  --hto-green-brand: #15a34a;
}

.dash-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 32px;
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border, #e6e8eb);
  margin-bottom: 32px;
}
.dash-hero-left { min-width: 0; }
.dash-hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  min-width: 280px;
}

/* Contract badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  margin-bottom: 14px;
  background: #ffffff;
  border: 1px solid var(--border, #e6e8eb);
  color: var(--text-sec, #475569);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px -4px rgba(15,23,42,.12);
}
.hero-badge-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted, #94a3b8);
  flex-shrink: 0;
}
.hero-badge[data-tone="green"] {
  background: var(--accent-tint, #ebf9ee);
  border-color: var(--accent-soft, #bfedc9);
  color: var(--accent-text, #15a34a);
}
.hero-badge[data-tone="green"] .hero-badge-dot {
  background: var(--hto-green-brand);
  box-shadow: 0 0 0 3px rgba(21,163,74,.15);
}
.hero-badge[data-tone="orange"] {
  background: #fdf6ec;
  border-color: #f2ddba;
  color: #b45309;
}
.hero-badge[data-tone="orange"] .hero-badge-dot {
  background: #b45309;
  box-shadow: 0 0 0 3px rgba(180,83,9,.15);
}
.hero-badge[data-tone="red"] {
  background: #fdf1f1;
  border-color: #f5cfcf;
  color: #dc2626;
}
.hero-badge[data-tone="red"] .hero-badge-dot {
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.15);
}
.hero-badge[data-tone="gray"] {
  background: var(--bg-soft, #f8f6f1);
  border-color: var(--border, #e6e8eb);
  color: var(--text-sec, #475569);
}
.hero-badge[data-pulse="1"] .hero-badge-dot {
  animation: hero-badge-pulse 2.4s ease-in-out infinite;
}
@keyframes hero-badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(.85); }
}

.dash-hero-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  letter-spacing: -.01em;
  line-height: 1.18;
  margin: 0 0 8px;
}
.dash-hero-sub {
  font-size: .92rem;
  color: var(--text-sec, #475569);
  line-height: 1.55;
  margin: 0;
  max-width: 42rem;
}

/* Today chip */
.hero-today {
  font-size: .72rem;
  color: var(--text-muted, #94a3b8);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  margin-bottom: 2px;
}

/* Continue CTA — versión light: botón verde degradado marca (texto blanco) */
.btn-continue {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 13px 22px;
  background: linear-gradient(180deg, #3ed47a 0%, #16a34a 60%, #0e7a3a 100%);
  border: 1px solid rgba(14,122,58,.45);
  border-radius: 11px;
  color: #ffffff;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: -.003em;
  cursor: pointer;
  text-decoration: none;
  box-shadow:
    0 4px 14px rgba(22,163,74,.30),
    inset 0 1px 0 rgba(255,255,255,.32);
  transition: border-color .25s ease-out, color .25s ease-out, box-shadow .25s ease-out, transform .25s ease-out;
}
.btn-continue::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.22) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform .6s ease-out;
  pointer-events: none;
}
.btn-continue:hover {
  border-color: rgba(14,122,58,.65);
  color: #ffffff;
  box-shadow:
    0 7px 20px rgba(22,163,74,.38),
    inset 0 1px 0 rgba(255,255,255,.36);
}
.btn-continue:hover::before { transform: translateX(100%); }
.btn-continue:active { transform: translateY(1px); }
.btn-continue > * { position: relative; z-index: 1; }
.btn-continue svg {
  width: 16px; height: 16px;
  stroke: currentColor; stroke-width: 2.4; fill: none;
}

/* Module preview */
.hero-mp {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 12px;
  max-width: 320px;
  box-shadow:
    0 2px 12px rgba(15,23,42,.06),
    0 1px 2px rgba(15,23,42,.04);
}
.hero-mp::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(15,23,42,.10) 0%, rgba(15,23,42,.05) 50%, rgba(15,23,42,.08) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.hero-mp > * { position: relative; z-index: 1; }
.hero-mp .mp-thumb {
  width: 40px; height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(21,163,74,.9), rgba(3,105,161,.75));
  border: 1px solid var(--border, #e6e8eb);
}
.hero-mp .mp-thumb-fallback svg {
  width: 16px; height: 16px;
  fill: #ffffff; /* icono sobre chip degradado sólido → blanco */
}
.hero-mp-meta { min-width: 0; text-align: right; }
.hero-mp-title {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text, #0f172a);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-mp-sub {
  font-size: .7rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .dash-hero {
    grid-template-columns: 1fr;
    padding: 32px 0 24px;
    gap: 20px;
  }
  .dash-hero-right {
    min-width: 0;
    align-items: stretch;
  }
  .hero-today { align-self: flex-start; }
  .btn-continue { justify-content: center; width: 100%; }
  .hero-mp { max-width: none; }
  .hero-mp-meta { text-align: left; }
  .dash-hero-title { font-size: 1.5rem; }
}

/* ── Stat Cards (blancas + sombra suave) ─────────────────── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.stat-card {
  position: relative;
  padding: 22px 22px 20px;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow:
    0 1px 2px rgba(15,23,42,.04),
    0 2px 12px rgba(15,23,42,.04);
}
/* NOTA: la variable local se renombra --card-accent para no colisionar
   con --accent (#6dd684) definida en base-light.css :root */
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 140px; height: 140px;
  background: radial-gradient(circle at top right, var(--card-accent, rgba(21,163,74,.10)), transparent 65%);
  pointer-events: none;
  opacity: .55;
  z-index: 1;
}
.stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(15,23,42,.12) 0%, rgba(15,23,42,.05) 50%, rgba(15,23,42,.08) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
}
.stat-card:hover {
  transform: translateY(-2px);
  background: #ffffff;
  box-shadow:
    0 2px 4px rgba(15,23,42,.05),
    0 10px 28px rgba(15,23,42,.10);
}
.stat-card:hover::after {
  background: linear-gradient(180deg, rgba(15,23,42,.16) 0%, rgba(15,23,42,.07) 100%);
}
.stat-card[data-tone="green"]    { --card-accent: rgba(21,163,74,.12); }
.stat-card[data-tone="blue"]     { --card-accent: rgba(3,105,161,.10); }
.stat-card[data-tone="gold"]     { --card-accent: rgba(180,83,9,.10); }

.stat-card .stat-icon {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--bg-soft, #f8f6f1);
  border: 1px solid var(--border, #e6e8eb);
  margin-bottom: 14px;
  position: relative; z-index: 2;
}
.stat-card .stat-icon svg { width: 18px; height: 18px; stroke-width: 1.7; fill: none; }
.stat-card[data-tone="green"] .stat-icon svg { stroke: #15a34a; }
.stat-card[data-tone="blue"]  .stat-icon svg { stroke: #0369a1; }
.stat-card[data-tone="gold"]  .stat-icon svg { stroke: #b45309; }

.stat-card .stat-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 6px;
  position: relative; z-index: 2;
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  line-height: 1;
  letter-spacing: -.015em;
  margin-bottom: 4px;
  position: relative; z-index: 2;
  font-variant-numeric: tabular-nums;
}
.stat-card .stat-value-sub {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
  margin-left: 4px;
}
.stat-card .stat-meta {
  font-size: .8rem;
  color: var(--text-sec, #475569);
  position: relative; z-index: 2;
  margin-top: 8px;
}
.stat-card .stat-meta strong { color: var(--text, #0f172a); font-weight: 600; }
.stat-card .stat-progress {
  height: 6px;
  background: var(--border, #e6e8eb);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 14px;
  position: relative; z-index: 2;
}
.stat-card .stat-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #48cb64, #15a34a);
  border-radius: 3px;
  transition: width .6s cubic-bezier(.25,1.1,.4,1);
}
.stat-card[data-tone="blue"] .stat-progress-fill {
  background: linear-gradient(90deg, #075985, #0369a1);
}
.stat-card[data-tone="gold"] .stat-progress-fill {
  background: linear-gradient(90deg, #b45309, #d97706);
}

/* ── Section Headings ────────────────────────────────────── */
.dash-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 30px 0 14px;
  gap: 18px;
}
.dash-section-head h2 {
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-sec, #475569);
  margin: 0;
}
.dash-section-head .dash-section-meta {
  font-size: .76rem;
  color: var(--text-muted, #94a3b8);
}

/* ── Activity Heatmap ────────────────────────────────────── */
.dash-heatmap-wrap {
  position: relative;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 28px;
  box-shadow:
    0 1px 2px rgba(15,23,42,.04),
    0 2px 12px rgba(15,23,42,.04);
}
.dash-heatmap-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(15,23,42,.12) 0%, rgba(15,23,42,.05) 50%, rgba(15,23,42,.08) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.dash-heatmap {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
}
.heatmap-day-labels {
  display: grid;
  grid-template-rows: repeat(7, 14px);
  gap: 3px;
  font-size: .62rem;
  color: var(--text-muted, #94a3b8);
  padding-top: 18px;
}
.heatmap-day-labels span:nth-child(2),
.heatmap-day-labels span:nth-child(4),
.heatmap-day-labels span:nth-child(6) { visibility: visible; }
.heatmap-day-labels span { visibility: hidden; }
.heatmap-day-labels span:nth-child(2),
.heatmap-day-labels span:nth-child(4),
.heatmap-day-labels span:nth-child(6) { visibility: visible; }

.heatmap-grid-wrap { overflow-x: auto; }
.heatmap-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 14px);
  gap: 3px;
  padding: 18px 0 6px;
  min-width: max-content;
}
/* Escala light de verdes: vacío #f1efe9 → intenso #15a34a */
.heatmap-cell {
  width: 14px; height: 14px;
  border-radius: 3px;
  background: #f1efe9;
  border: 1px solid rgba(15,23,42,.04);
  cursor: default;
  transition: outline .15s ease;
}
.heatmap-cell:hover { outline: 1px solid #94a3b8; outline-offset: 1px; }
.heatmap-cell[data-level="1"] { background: #d6f0dd; border-color: rgba(21,163,74,.12); }
.heatmap-cell[data-level="2"] { background: #a7dfb6; border-color: rgba(21,163,74,.22); }
.heatmap-cell[data-level="3"] { background: #5cbf7d; border-color: rgba(21,163,74,.40); }
.heatmap-cell[data-level="4"] { background: #15a34a; border-color: rgba(21,163,74,.70); box-shadow: 0 0 0 2px rgba(21,163,74,.15); }

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 14px;
  font-size: .68rem;
  color: var(--text-muted, #94a3b8);
}
.heatmap-legend-cells {
  display: inline-flex; gap: 3px; margin: 0 6px;
}
.heatmap-legend-cells .heatmap-cell { cursor: default; }
.heatmap-legend-cells .heatmap-cell:hover { outline: none; }

/* Tooltip: chip sólido oscuro sobre light (texto blanco permitido) */
.heatmap-tooltip {
  position: fixed;
  pointer-events: none;
  background: #0f172a;
  border: 1px solid #334155;
  color: #ffffff;
  font-size: .72rem;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 100;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
  box-shadow: 0 4px 12px rgba(15,23,42,.20);
}
.heatmap-tooltip.visible { opacity: 1; transform: translateY(0); }

/* ── Recent Activity Feed ────────────────────────────────── */
.dash-activity {
  position: relative;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 0;
  box-shadow:
    0 1px 2px rgba(15,23,42,.04),
    0 2px 12px rgba(15,23,42,.04);
}
.dash-activity::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(15,23,42,.12) 0%, rgba(15,23,42,.05) 50%, rgba(15,23,42,.08) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.dash-activity > .activity-row { position: relative; z-index: 1; }
.activity-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid #eceef0;
  transition: background .15s ease;
}
.activity-row:last-child { border-bottom: none; }
.activity-row:hover { background: var(--bg-soft, #f8f6f1); }
.activity-icon {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-soft, #f8f6f1);
  border: 1px solid var(--border, #e6e8eb);
  flex-shrink: 0;
}
.activity-icon svg { width: 14px; height: 14px; stroke-width: 1.8; fill: none; }
.activity-icon[data-type="lesson"] { background: var(--accent-tint, #ebf9ee); border-color: var(--accent-soft, #bfedc9); }
.activity-icon[data-type="lesson"] svg { stroke: #15a34a; }
.activity-icon[data-type="win"] { background: #fdf6ec; border-color: #f2ddba; }
.activity-icon[data-type="win"] svg { stroke: #b45309; }
.activity-icon[data-type="impl"] { background: #e0f2f7; border-color: #a5d8e6; }
.activity-icon[data-type="impl"] svg { stroke: #0369a1; }
.activity-icon[data-type="session"] { background: var(--bg-soft, #f8f6f1); }
.activity-icon[data-type="session"] svg { stroke: var(--text-muted, #94a3b8); }

.activity-body { flex: 1; min-width: 0; }
.activity-title {
  color: var(--text, #0f172a);
  font-size: .9rem;
  font-weight: 500;
  margin: 0 0 2px;
  line-height: 1.4;
}
.activity-title strong { font-weight: 600; }
.activity-title a { color: var(--accent-text, #15a34a); text-decoration: none; }
.activity-title a:hover { text-decoration: underline; }
.activity-meta {
  font-size: .76rem;
  color: var(--text-muted, #94a3b8);
}
.activity-time {
  font-size: .72rem;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.activity-empty {
  padding: 32px 22px;
  text-align: center;
  color: var(--text-muted, #94a3b8);
  font-size: .85rem;
}

/* ── Banner contrato vencido ─────────────────────────────── */
.dash-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 20px;
  padding: 14px 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fdf1f1 0%, #fef8f8 100%);
  border: 1px solid #f5cfcf;
  box-shadow: 0 4px 20px -8px rgba(220,38,38,.12);
}
.dash-banner-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 7px;
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.15);
  flex-shrink: 0;
}
.dash-banner-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: .85rem;
  line-height: 1.45;
}
.dash-banner-body strong {
  color: #dc2626;
  font-weight: 600;
  letter-spacing: -.005em;
}
.dash-banner-body span {
  color: var(--text-sec, #475569);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 880px) {
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .dash-hero-title { font-size: 1.5rem; }
}
@media (max-width: 560px) {
  .dash-stats { grid-template-columns: 1fr; }
  .dash-hero { padding: 24px 0 20px; }
  .dash-hero-right { width: 100%; align-items: flex-start; }
}

/* ───────────────────────────────────────────────────────────
   Atmospheric Depth Layer (port light del bloque 2026-04-27)
   Solo profundidad/atmósfera — no toca layout, copy ni datos.
   ─────────────────────────────────────────────────────────── */

/* 1 + 2 + 5 — Hero: ambient glow + lateral accent + green divider */
.dash-hero {
  position: relative;
  isolation: isolate;
  border-bottom: none;
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(21, 163, 74, 0.20) 20%,
    rgba(21, 163, 74, 0.38) 50%,
    rgba(21, 163, 74, 0.20) 80%,
    transparent 100%
  );
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
}
.dash-hero::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 5%;
  transform: translateY(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(109, 214, 132, 0.10) 0%,
    rgba(109, 214, 132, 0.04) 30%,
    transparent 70%
  );
  filter: blur(120px);
  pointer-events: none;
  z-index: -1;
}
.dash-hero::after {
  content: "";
  position: absolute;
  top: 48px;
  bottom: 32px;
  left: -16px;
  width: 2px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(21, 163, 74, 0.45) 20%,
    rgba(21, 163, 74, 0.60) 50%,
    rgba(21, 163, 74, 0.25) 85%,
    transparent 100%
  );
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(21, 163, 74, 0.15);
  pointer-events: none;
  z-index: 1;
}

/* 3 — La rejilla de fondo la aporta ahora .portal-main::before (shell-light.css)
   de forma unificada para todo el portal. Aquí solo el color base, sin grid
   propio (evita el grid duplicado en el dashboard). */
body {
  background-color: var(--bg, #ffffff);
}

/* 4 — Directional glow por card según tone (versión light suave) */
.stat-card[data-tone="green"] {
  box-shadow:
    inset 0 0 0 1px rgba(21, 163, 74, .05),
    0 1px 2px rgba(15, 23, 42, .04),
    0 12px 32px -8px rgba(15, 23, 42, .06),
    0 8px 28px -12px rgba(21, 163, 74, .14);
}
.stat-card[data-tone="blue"] {
  box-shadow:
    inset 0 0 0 1px rgba(3, 105, 161, .05),
    0 1px 2px rgba(15, 23, 42, .04),
    0 12px 32px -8px rgba(15, 23, 42, .06),
    0 8px 28px -12px rgba(3, 105, 161, .14);
}
.stat-card[data-tone="gold"] {
  box-shadow:
    inset 0 0 0 1px rgba(180, 83, 9, .05),
    0 1px 2px rgba(15, 23, 42, .04),
    0 12px 32px -8px rgba(15, 23, 42, .06),
    0 8px 28px -12px rgba(180, 83, 9, .13);
}
.stat-card[data-tone="green"]:hover {
  box-shadow:
    inset 0 0 0 1px rgba(21, 163, 74, .08),
    0 2px 4px rgba(15, 23, 42, .05),
    0 16px 40px -8px rgba(15, 23, 42, .10),
    0 12px 36px -10px rgba(21, 163, 74, .20);
}
.stat-card[data-tone="blue"]:hover {
  box-shadow:
    inset 0 0 0 1px rgba(3, 105, 161, .08),
    0 2px 4px rgba(15, 23, 42, .05),
    0 16px 40px -8px rgba(15, 23, 42, .10),
    0 12px 36px -10px rgba(3, 105, 161, .20);
}
.stat-card[data-tone="gold"]:hover {
  box-shadow:
    inset 0 0 0 1px rgba(180, 83, 9, .08),
    0 2px 4px rgba(15, 23, 42, .05),
    0 16px 40px -8px rgba(15, 23, 42, .10),
    0 12px 36px -10px rgba(180, 83, 9, .18);
}

/* 6 — Pulse glow en la celda "hoy" del heatmap (último cell con actividad) */
@keyframes htoTodayPulse {
  0%, 100% {
    box-shadow:
      0 0 0 0 rgba(21, 163, 74, .35),
      0 0 8px rgba(21, 163, 74, .20);
  }
  50% {
    box-shadow:
      0 0 0 4px rgba(21, 163, 74, 0),
      0 0 14px rgba(21, 163, 74, .30);
  }
}
.heatmap-grid .heatmap-cell:last-child {
  animation: htoTodayPulse 2.4s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

/* 7 — Activity card: lift atmosférico + separadores más visibles */
.dash-activity {
  box-shadow:
    0 1px 2px rgba(15, 23, 42, .04),
    0 2px 12px rgba(15, 23, 42, .05),
    0 12px 32px -8px rgba(15, 23, 42, .06);
}
.activity-row {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border, #e6e8eb);
}
.activity-row:last-child { border-bottom: none; }

/* 8 — Iconos del activity feed: todos en verde HTO (light) */
.activity-icon,
.activity-icon[data-type="lesson"],
.activity-icon[data-type="win"],
.activity-icon[data-type="impl"],
.activity-icon[data-type="session"] {
  background: var(--accent-tint, #ebf9ee);
  border: 1px solid var(--accent-soft, #bfedc9);
}
.activity-icon svg,
.activity-icon[data-type="lesson"] svg,
.activity-icon[data-type="win"] svg,
.activity-icon[data-type="impl"] svg,
.activity-icon[data-type="session"] svg {
  stroke: #15a34a;
}

/* 9 — Tipografía del activity feed: más legible y refinada */
.activity-title {
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: -.005em;
  line-height: 1.45;
  color: var(--text, #0f172a);
}
.activity-title strong { font-weight: 600; color: var(--text, #0f172a); }
.activity-meta,
.activity-time {
  font-size: .74rem;
  letter-spacing: .01em;
  color: var(--text-muted, #94a3b8);
}

/* 10 — Borde verde en cards principales (stat-cards + activity + heatmap) */
.stat-card::after,
.dash-activity::before,
.dash-heatmap-wrap::before {
  background: linear-gradient(
    180deg,
    rgba(21, 163, 74, 0.35) 0%,
    rgba(21, 163, 74, 0.14) 50%,
    rgba(21, 163, 74, 0.24) 100%
  );
}
.stat-card[data-tone="green"]:hover::after,
.stat-card[data-tone="blue"]:hover::after,
.stat-card[data-tone="gold"]:hover::after {
  background: linear-gradient(
    180deg,
    rgba(21, 163, 74, 0.50) 0%,
    rgba(21, 163, 74, 0.22) 50%,
    rgba(21, 163, 74, 0.38) 100%
  );
}

/* ════════════════════════════════════════════════════════════
   PORTAL-AUTH (port light de css/portal-auth.css — solo clases
   usadas por dashboard.html: estados auth, login card, email
   fallback, user chip del sidebar, welcome banner)
════════════════════════════════════════════════════════════ */

[hidden] { display: none !important; }

@media (max-width: 980px) {
  .auth-user-chip { padding: 8px 8px; flex-direction: column; gap: 4px; }
  .auth-user-chip .auth-user-name,
  .auth-user-chip .auth-user-role { display: none; }
}

/* Collapsed sidebar (desktop) — hide name/role/Salir text, keep only avatar */
@media (min-width: 981px) {
  html.sb-collapsed .auth-user-chip {
    flex-direction: column;
    padding: 10px 8px;
    gap: 8px;
    align-items: center;
    justify-content: center;
  }
  html.sb-collapsed .auth-user-chip .auth-user-name { display: none; }
  html.sb-collapsed .auth-user-chip .auth-user-role { display: none; }
  html.sb-collapsed .auth-user-chip img {
    width: 32px;
    height: 32px;
  }
  html.sb-collapsed .auth-signout {
    font-size: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    position: relative;
  }
  html.sb-collapsed .auth-signout::before {
    content: "\2192"; /* arrow right (logout glyph) */
    font-size: 1rem;
    line-height: 1;
    color: inherit;
  }
}

/* Welcome banner inside dashboard */
.welcome-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #ebf9ee, #f7fdf9);
  border: 1px solid var(--accent-soft, #bfedc9);
  border-radius: 10px;
  margin-bottom: 28px;
}
.welcome-banner img {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--border, #e6e8eb);
}
.welcome-banner .welcome-text { flex: 1; }
.welcome-banner .welcome-text strong { color: var(--text, #0f172a); font-weight: 600; }
.welcome-banner .welcome-text span { color: var(--text-sec, #475569); font-size: .85rem; }
.admin-badge {
  font-size: .65rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 5px;
  background: #fdf6ec; color: #b45309;
  border: 1px solid #f2ddba;
}

/* ── Overrides de estilos inline dark del HTML (regla 5) ──
   dashboard.html trae inline: #btn-signout-unauth con un
   background blanco-alpha dark (invisible sobre blanco) y el
   eyebrow de no-autorizado con un rojo neon del tema dark. */
#btn-signout-unauth {
  background: #f1efe9 !important;
  color: #334155 !important;
}
#btn-signout-unauth:hover {
  background: #e8e5dd !important;
  box-shadow: 0 6px 18px -8px rgba(15,23,42,.15);
}
#state-unauthorized .auth-login-eyebrow { color: #dc2626 !important; }

