/* ==========================================================================
   DASHBOARD.CSS
   Pantalla de inicio: puerta de entrada de pantalla completa, sin
   cabecera ni navegación propia. Cuatro accesos, cada uno ocupando
   una cuarta parte real de la pantalla (grid 2x2), que llevan a
   Bitácora, Proyectos, Documentos y Asistente.
   ========================================================================== */

html,
body.hub-body {
  height: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

.hub-body {
  overflow: hidden;
  margin: 0;
}

.hub-fullscreen {
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  width: 100%;
  margin: 0;
  padding: 10px;
  background-color: #08090C;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  counter-reset: quad;
}

.hub-quad {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: var(--space-4);
  overflow: hidden;
  color: var(--color-on-primary);
  isolation: isolate;
  transform-origin: center;
  counter-increment: quad;
  animation: hub-quad-in 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.15s ease, box-shadow 0.25s ease;
}

.hub-quad-bitacora {
  animation-delay: 0s;
}

.hub-quad-proyectos {
  animation-delay: 0.08s;
}

.hub-quad-documentos {
  animation-delay: 0.16s;
}

.hub-quad-asistente {
  animation-delay: 0.24s;
}

@keyframes hub-quad-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hub-quad:hover,
.hub-quad:focus-visible {
  transform: scale(1.035);
  z-index: 2;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.hub-quad:active {
  transform: scale(0.97);
  filter: brightness(0.88);
}

@media (prefers-reduced-motion: reduce) {
  .hub-quad {
    animation: none;
    transition: filter 0.15s ease;
  }

  .hub-quad:hover,
  .hub-quad:focus-visible,
  .hub-quad:active {
    transform: none;
  }
}

.hub-quad-bitacora {
  background: linear-gradient(155deg, #24487F 0%, #12294F 100%);
}

.hub-quad-proyectos {
  background: linear-gradient(155deg, #2C3446 0%, #10151F 100%);
}

.hub-quad-documentos {
  background: linear-gradient(155deg, #B85E29 0%, #7A3B16 100%);
}

.hub-quad-asistente {
  background: linear-gradient(155deg, #12294F 0%, #A8501F 130%);
}

/* Numeración tipo bitácora, esquina superior izquierda de cada cuadrante. */
.hub-quad::before {
  content: counter(quad, decimal-leading-zero);
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: rgba(247, 247, 244, 0.55);
}

.hub-quad::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(8, 10, 16, 0.72) 0%, rgba(8, 10, 16, 0.15) 55%, transparent 80%);
}

.hub-quad-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  z-index: 0;
  animation: hub-quad-kenburns 22s ease-in-out infinite alternate;
}

@keyframes hub-quad-kenburns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-quad-photo {
    animation: none;
  }
}

.hub-quad-icon {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0.7rem;
  box-sizing: content-box;
  border-radius: 50%;
  background-color: rgba(8, 9, 12, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--color-on-primary);
  opacity: 1;
}

.hub-quad-text {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 14rem;
}

.hub-quad-title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-on-primary);
}

.hub-quad-desc {
  font-size: 0.75rem;
  line-height: var(--leading-snug);
  color: rgba(247, 247, 244, 0.8);
  display: none;
}

.hub-empty-state {
  display: none;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6);
}

.hub-empty-state:not([hidden]) {
  display: flex;
}

.hub-empty-state h3 {
  margin-bottom: var(--space-2);
}

.hub-empty-state p:not(.eyebrow) {
  color: var(--color-ink-soft);
  max-width: 24rem;
  margin-bottom: var(--space-5);
}

/* --------------------------------------------------------------------------
   MÓVIL GRANDE (380px en adelante) — ya cabe la descripción corta
   -------------------------------------------------------------------------- */
@media (min-width: 380px) {
  .hub-quad-desc {
    display: block;
  }
}

/* --------------------------------------------------------------------------
   TABLET / IPAD (768px en adelante)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .hub-quad {
    padding: var(--space-7);
  }

  .hub-quad-icon {
    top: var(--space-6);
    right: var(--space-6);
    width: 2rem;
    height: 2rem;
    padding: 0.85rem;
  }

  .hub-quad-title {
    font-size: var(--text-xl);
  }

  .hub-quad-desc {
    font-size: var(--text-sm);
    max-width: 18rem;
  }
}

/* --------------------------------------------------------------------------
   ESCRITORIO (1024px en adelante)
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .hub-quad-title {
    font-size: var(--text-2xl);
  }
}

/* --------------------------------------------------------------------------
   BOTÓN FLOTANTE, SOLO EN ESTA PANTALLA: AL CENTRO EXACTO DE LOS 4
   CUADRANTES, CON UN ANILLO QUE RESPIRA PARA QUE SE NOTE QUE ES TOCABLE.
   -------------------------------------------------------------------------- */
body.hub-body .global-fab {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  z-index: 95;
}

body.hub-body .global-fab::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(247, 247, 244, 0.35);
  animation: hub-fab-breathe 2.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hub-fab-breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.18);
    opacity: 0;
  }
}

body.hub-body .global-fab:hover,
body.hub-body .global-fab:active {
  transform: translate(-50%, -50%) scale(0.95);
}

@media (prefers-reduced-motion: reduce) {
  body.hub-body .global-fab::before {
    animation: none;
  }
}