/* ============================================================
   CLAUT PANEL — sistema de diseño del rediseño 2026 (prefijo dph-)
   Fuente única de los componentes aprobados en dashboard-preview:
   hero con secuencia scrubbed, gauges, tarjetas, tiles de acceso,
   botones y "ensamblado" del contenido al scroll.

   Uso mínimo en una página:
     <link rel="stylesheet" href="./css/claut-panel.css?v=...">
     <script src="./js/claut-panel.js?v=..." data-eyebrow="..."
             data-title="..." data-tagline="..."></script>

   El prefijo dph- es deliberado: no colisiona con Tailwind ni con
   las clases legacy (.stat-card, .glass-card, etc.) de los HTML
   grandes. NO usar estos nombres para otra cosa.
   ============================================================ */

/* --- Hero con secuencia de rayos-X --- */
.dph-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(120deg, rgba(199, 37, 43, 0.10), rgba(9, 9, 11, 0.4) 45%);
  min-height: clamp(300px, 42vh, 430px);
  display: flex;
  align-items: stretch;
  margin-bottom: 1.5rem;
  isolation: isolate;
}
/* Variante para páginas interiores: más compacto que el del dashboard */
.dph-hero--page { min-height: clamp(230px, 30vh, 330px); }

.dph-hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  filter: saturate(0.7) brightness(0.8);
}
/* Veladura: garantiza legibilidad del texto sobre cualquier frame */
.dph-hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(100deg, rgba(9, 9, 11, 0.92) 0%, rgba(9, 9, 11, 0.72) 38%, rgba(9, 9, 11, 0.25) 70%, rgba(9, 9, 11, 0.55) 100%),
    radial-gradient(ellipse 70% 90% at 8% 100%, rgba(199, 37, 43, 0.22), transparent 60%);
}
.dph-hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
  padding: clamp(1.5rem, 4vw, 3rem);
}
.dph-hero-copy { max-width: 640px; min-width: 0; }
.dph-greet-eyebrow-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.dph-greet-rule {
  width: 34px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #C7252B, transparent);
  flex-shrink: 0;
}
.dph-greet-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: #e8969a;
}
.dph-greet-title {
  margin: 0 0 0.6rem;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.04;
  background: linear-gradient(115deg, #ffffff 30%, #fca5a5 65%, #C7252B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.dph-hero-tagline {
  margin: 0 0 1.4rem;
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  font-weight: 500;
  color: #a1a1aa;
  line-height: 1.5;
}
.dph-hero-tagline strong { color: #e4e4e7; font-weight: 700; }
.dph-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.dph-greet-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: capitalize;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}
.dph-social-row { display: flex; gap: 0.5rem; }
.dph-social-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d4d4d8;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  text-decoration: none;
  transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1), background 180ms ease, border-color 180ms ease, color 180ms ease;
}
.dph-social-btn:hover {
  transform: translateY(-2px);
  background: rgba(199, 37, 43, 0.85);
  border-color: rgba(199, 37, 43, 0.9);
  color: #fff;
}
.dph-social-btn:active { transform: scale(0.94); }

/* --- Sello de marca: logo transparente flotando sobre glow difuminado --- */
.dph-hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}
.dph-hero-logo-ring {
  position: relative;
  width: clamp(110px, 13vw, 170px);
  height: clamp(110px, 13vw, 170px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 260ms cubic-bezier(0.23, 1, 0.32, 1);
}
.dph-hero-logo-ring::before {
  content: '';
  position: absolute;
  inset: -45%;
  background:
    radial-gradient(circle at 50% 45%, rgba(199, 37, 43, 0.32) 0%, rgba(199, 37, 43, 0.14) 34%, transparent 62%),
    radial-gradient(circle at 42% 58%, rgba(255, 255, 255, 0.07) 0%, transparent 48%);
  filter: blur(14px);
  pointer-events: none;
  transition: opacity 260ms ease;
}
.dph-hero-brand:hover .dph-hero-logo-ring { transform: scale(1.05); }
.dph-hero-brand:hover .dph-hero-logo-ring::before { opacity: 1.35; }
.dph-hero-logo {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.55));
  animation: dph-logo-float 7s ease-in-out infinite;
}
@keyframes dph-logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.dph-hero-brand-caption {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: #71717a;
  white-space: nowrap;
}

/* Pista de scroll */
.dph-hero-scrollhint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: 20px;
  height: 32px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.dph-hero-scrollhint span {
  width: 3px;
  height: 7px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.6);
  animation: dph-scrollhint 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes dph-scrollhint {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* --- Gauges (métricas tipo tablero, usadas en el dashboard) --- */
.dph-gauge-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dph-gauge {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.9rem;
  padding: 1.1rem 1.25rem;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, rgba(199, 37, 43, 0.06), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
  transition: transform 220ms cubic-bezier(0.23, 1, 0.32, 1), border-color 220ms ease, background 220ms ease;
}
.dph-gauge:hover {
  transform: translateY(-3px);
  border-color: rgba(199, 37, 43, 0.35);
  background: linear-gradient(135deg, rgba(199, 37, 43, 0.12), rgba(255, 255, 255, 0.03));
}
.dph-gauge:active { transform: scale(0.985); }
.dph-gauge-ring {
  position: absolute;
  inset: 0;
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
}
.dph-gauge-track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 3; }
.dph-gauge-fill {
  fill: none;
  stroke: #C7252B;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 169.6;
  stroke-dashoffset: 169.6;
  transition: stroke-dashoffset 1100ms cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 6px rgba(199, 37, 43, 0.55));
}
.dph-gauge-icon {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: #f8fafc;
  transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.dph-gauge:hover .dph-gauge-icon { transform: scale(1.12); }
.dph-gauge:hover .dph-gauge-fill { filter: drop-shadow(0 0 10px rgba(199, 37, 43, 0.9)); }
.dph-gauge-body { display: flex; flex-direction: column; min-width: 0; }
.dph-gauge-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.dph-gauge-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Tarjetas y grid --- */
.dph-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1rem;
}
.dph-card {
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
  padding: 1.5rem;
}
.dph-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.dph-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.01em;
}
.dph-card-sub {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}
.dph-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.dph-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: dph-pulse 1.8s ease-in-out infinite;
}
@keyframes dph-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* --- Gráfico SVG (dashboard) --- */
.dph-chart-wrap { position: relative; }
.dph-chart-svg { width: 100%; height: 180px; display: block; }
.dph-chart-line {
  stroke: #C7252B;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  transition: stroke-dashoffset 1400ms cubic-bezier(0.16, 1, 0.3, 1);
}
.dph-chart-area { opacity: 0; transition: opacity 600ms ease 600ms; }
.dph-chart-months {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #52525b;
}

/* --- Tiles de acceso rápido --- */
.dph-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}
.dph-link-tile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.9rem 0.85rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1), border-color 180ms ease, background 180ms ease;
}
.dph-link-tile:hover {
  transform: translateY(-2px) scale(0.99);
  border-color: rgba(199, 37, 43, 0.4);
  background: rgba(199, 37, 43, 0.08);
  color: #fff;
}
.dph-link-tile:active { transform: scale(0.97); }
.dph-link-tile i {
  font-size: 1.1rem;
  color: #C7252B;
  transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.dph-link-tile:hover i { transform: translateX(3px) scale(1.1); }
.dph-link-tile::after {
  content: '\f061';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 0.8rem;
  top: 50%;
  translate: 6px -50%;
  font-size: 0.7rem;
  color: rgba(199, 37, 43, 0.9);
  opacity: 0;
  transition: opacity 180ms ease, translate 180ms cubic-bezier(0.23, 1, 0.32, 1);
}
.dph-link-tile:hover::after { opacity: 1; translate: 0 -50%; }

/* --- Encabezado de sección --- */
.dph-section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
  margin-bottom: 1.25rem;
}
.dph-section-title {
  margin: 0;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

/* --- Ensamblado del contenido al scroll --- */
.dph-reveal {
  opacity: 0;
  transform: translateY(34px) scale(0.98);
  filter: blur(6px);
  transition:
    opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 700ms ease;
  transition-delay: var(--dph-reveal-delay, 0ms);
  will-change: transform, opacity, filter;
}
.dph-reveal.dph-in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* --- Entrada del hero al cargar --- */
.dph-hero {
  opacity: 0;
  transform: translateY(14px);
  animation: dph-rise 640ms cubic-bezier(0.16, 1, 0.3, 1) 40ms forwards;
}
@keyframes dph-rise {
  to { opacity: 1; transform: translateY(0); }
}

/* --- Accesibilidad: reduced motion apaga todo --- */
@media (prefers-reduced-motion: reduce) {
  .dph-hero { animation: none; opacity: 1; transform: none; }
  .dph-reveal { opacity: 1; transform: none; filter: none; transition: none; }
  .dph-gauge-fill, .dph-chart-line, .dph-chart-area { transition: none; }
  .dph-hero-logo, .dph-hero-scrollhint span, .dph-chip-dot { animation: none; }
}

/* --- Responsive --- */
@media (max-width: 1180px) {
  .dph-hero-brand-caption { display: none; }
}
@media (max-width: 1024px) {
  .dph-gauge-row { grid-template-columns: repeat(2, 1fr); }
  .dph-grid { grid-template-columns: 1fr; }
  .dph-hero { min-height: clamp(280px, 38vh, 380px); }
  .dph-hero--page { min-height: clamp(220px, 28vh, 320px); }
}
@media (max-width: 768px) {
  .dph-hero-brand { display: none; }
  .dph-hero-inner { padding: 1.5rem 1.25rem; }
  .dph-hero { min-height: 260px; }
  .dph-hero--page { min-height: 220px; }
  .dph-hero-scrollhint { display: none; }
}
@media (max-width: 560px) {
  .dph-gauge-row { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .dph-gauge { padding: 0.85rem; gap: 0.6rem; }
  .dph-gauge-ring, .dph-gauge-icon { width: 42px; height: 42px; }
  .dph-gauge-value { font-size: 1.15rem; }
  .dph-gauge-label { font-size: 0.62rem; white-space: normal; line-height: 1.25; }
  .dph-links-grid { grid-template-columns: repeat(2, 1fr); }
  .dph-hero-meta { gap: 0.6rem; }
  .dph-greet-date { padding: 0.45rem 0.8rem; font-size: 0.7rem; }
  .dph-social-btn { width: 42px; height: 42px; }
  .dph-card { padding: 1.1rem; }
  .dph-chart-svg { height: 140px; }
}
@media (max-width: 380px) {
  .dph-gauge-row { grid-template-columns: 1fr; }
}

/* --- Portada de perfil (profile.html — rediseño 2026) --- */
.dph-profile-cover {
  border-radius: 1.5rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
}
.dph-profile-banner {
  position: relative;
  height: clamp(120px, 18vh, 170px);
  background:
    radial-gradient(ellipse 70% 120% at 15% 100%, rgba(199, 37, 43, 0.4), transparent 60%),
    radial-gradient(ellipse 50% 100% at 85% 0%, rgba(199, 37, 43, 0.18), transparent 55%),
    linear-gradient(120deg, #16090b, #09090b 60%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: clamp(1rem, 5vw, 3rem);
}
.dph-profile-banner-logo {
  height: 78%;
  opacity: 0.35;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.6));
  animation: dph-logo-float 8s ease-in-out infinite;
}
/* Scrim: cuando el banner lleva una foto de portada real (no solo el
   gradiente por defecto), el texto blanco pierde contraste contra zonas
   claras de la imagen — este degradado inferior garantiza legibilidad
   sin importar qué imagen haya detrás. */
.dph-profile-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 9, 11, 0) 35%, rgba(9, 9, 11, 0.55) 100%);
  pointer-events: none;
}
.dph-profile-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0 clamp(1rem, 3vw, 2rem) 1rem;
  margin-top: -42px;
}
.dph-profile-id {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  min-width: 0;
}
.dph-profile-avatar {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #e4e4e7;
  background: linear-gradient(145deg, #1c1c1f, #0d0d0f);
  border: 3px solid rgba(9, 9, 11, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(199, 37, 43, 0.35), 0 0 24px rgba(199, 37, 43, 0.2);
  transition: transform 220ms cubic-bezier(0.23, 1, 0.32, 1);
}
.dph-profile-avatar:hover { transform: scale(1.04); }
.dph-profile-status {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #22c55e;
  border: 3px solid #09090b;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}
.dph-profile-text { min-width: 0; padding-bottom: 0.35rem; }
.dph-profile-name {
  position: relative;
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #f8fafc;
  white-space: nowrap;
  overflow: visible;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 2px 12px rgba(0, 0, 0, 0.6);
}
.dph-profile-position {
  position: relative;
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #e4e4e7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.dph-profile-side {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.35rem;
}
.dph-profile-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.9rem clamp(1rem, 3vw, 2rem) 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 0.9rem;
}
.dph-profile-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.23, 1, 0.32, 1);
}
.dph-profile-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.08); transform: translateY(-1px); }
.dph-profile-tab:active { transform: scale(0.97); }
.dph-profile-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #C7252B, #a02622);
  border-color: rgba(199, 37, 43, 0.6);
  box-shadow: 0 4px 14px rgba(199, 37, 43, 0.35);
}
.dph-profile-tab i { font-size: 0.85rem; opacity: 0.85; }
@media (max-width: 640px) {
  .dph-profile-bar { justify-content: center; text-align: center; }
  .dph-profile-id { flex-direction: column; align-items: center; }
  .dph-profile-name, .dph-profile-position { white-space: normal; }
  .dph-profile-side { justify-content: center; }
  .dph-profile-tabs { justify-content: center; }
}
