/* Pantalla de inicio: acabado visual sobre crudStyles.css, con la misma paleta (azul marino, azul y colores por estado).
   Los selectores llevan .home-page delante para pesar más que las hojas que se cargan después (campana). */

.home-page .home-burbuja {
  display: inline-flex;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #e8f1fd;
  color: #1a63c9;
  font-size: 15px;
}

/* ---------------------------------------------------------------- Mi día */
.home-page .home-seguimiento {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 18px 0 0;
  padding: 14px 18px;
  border: 1px solid #dce6f0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(16, 45, 72, 0.08);
}

.home-page .home-seg-titulo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  color: #0f2f4f;
  font-size: 17px;
  font-weight: 800;
}

.home-page .home-seg-titulo i {
  color: inherit;
}

.home-page .home-seg-datos {
  display: grid;
  flex: 1 1 520px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-page .home-seg-datos[hidden] {
  display: none;
}

.home-page .home-seg-dato {
  --tono: #2f80ed;
  --tono-suave: #e8f1fd;
  --tono-texto: #1a63c9;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 10px;
  box-sizing: border-box;
  min-width: 0;
  height: 58px;
  padding: 0 12px;
  border: 1px solid #e1e9f3;
  border-radius: 13px;
  background: #fff;
  color: #46587a;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-page .home-seg-dato.grave { --tono: #c0392b; --tono-suave: #fdecea; --tono-texto: #b3261e; }
.home-page .home-seg-dato.aviso { --tono: #e08a00; --tono-suave: #fff3e0; --tono-texto: #a85a00; }
.home-page .home-seg-dato.envio { --tono: #1f9254; --tono-suave: #e7f6ec; --tono-texto: #1b7a43; }

.home-page .home-seg-dato:hover {
  transform: translateY(-2px);
  border-color: var(--tono);
  box-shadow: 0 10px 20px rgba(16, 45, 72, 0.1);
}

.home-page .home-seg-icono {
  display: inline-flex;
  grid-row: span 2;
  align-self: center;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--tono-suave);
  color: var(--tono-texto);
}

.home-page .home-seg-dato strong {
  color: #0f2f4f;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.home-page .home-seg-dato > span:last-child {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-page .home-seg-abrir {
  margin-left: auto;
  padding: 8px 14px;
  border: 1px solid #cfdbea;
  border-radius: 999px;
  background: #eef4fd;
  color: #17497f;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.home-page .home-seg-abrir:hover {
  background: #e0ecfc;
}

.home-page .home-seg-aviso {
  display: flex;
  flex: 1 1 520px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  margin: 0;
  color: #5b6b80;
  font-size: 13px;
}

.home-page .home-seg-aviso[hidden] {
  display: none;
}

.home-page .home-seg-aviso button {
  width: auto;
  margin: 0;
  padding: 5px 12px;
  border: 1px solid #cfdbea;
  border-radius: 8px;
  background: #eef3f9;
  color: #17324d;
  font-weight: 700;
  cursor: pointer;
}

/* ---------------------------------------------------------------- animación de carga */
@keyframes homeBrillo {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.home-page .home-seg-dato.cargando strong,
.home-page .esqueleto {
  border-color: transparent;
  border-radius: 9px;
  background: linear-gradient(90deg, #e9eff7 25%, #f7f9fc 50%, #e9eff7 75%);
  background-size: 200% 100%;
  animation: homeBrillo 1.4s ease-in-out infinite;
}

.home-page .home-seg-dato.cargando strong {
  width: 38px;
  height: 18px;
  color: transparent;
  overflow: hidden;
}

/* ---------------------------------------------------------------- accesos principales */
.home-page .home-kpi-card {
  position: relative;
  overflow: hidden;
}

.home-page .home-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--kpi, #2f80ed);
  opacity: 0.85;
}

.home-page .home-kpi-card::after {
  content: "\2192";
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f1f6fd;
  color: #1a63c9;
  font-weight: 700;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.home-page .home-kpi-card:nth-child(1) { --kpi: #2f80ed; }
.home-page .home-kpi-card:nth-child(2) { --kpi: #f59f00; }
.home-page .home-kpi-card:nth-child(3) { --kpi: #12b886; }
.home-page .home-kpi-card:nth-child(4) { --kpi: #e03131; }

.home-page .home-kpi-card:hover::after {
  transform: translateX(3px);
  background: var(--kpi);
  color: #fff;
}

.home-page .home-kpi-icon {
  box-shadow: 0 8px 16px rgba(16, 45, 72, 0.16);
  transition: transform 0.18s ease;
}

.home-page .home-kpi-card:hover .home-kpi-icon {
  transform: scale(1.06);
}

/* ---------------------------------------------------------------- prioridades y accesos rápidos */
.home-page .home-card-header {
  padding-bottom: 12px;
  border-bottom: 1px solid #eef2f8;
}

.home-page .home-card-header > i {
  background: linear-gradient(135deg, #e8f1fd, #f4f8ff);
  border: 1px solid #dbe8fb;
}

.home-page .home-priority-item {
  position: relative;
  overflow: hidden;
}

.home-page .home-priority-item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: #2f80ed;
  transform: scaleY(0);
  transition: transform 0.2s ease;
}

.home-page .home-priority-item:hover::before,
.home-page .home-priority-item:focus-visible::before {
  transform: scaleY(1);
}

.home-page .home-priority-icon,
.home-page .home-action-icon {
  transition: transform 0.18s ease;
}

.home-page .home-priority-item:hover .home-priority-icon,
.home-page .home-actions-grid a:hover .home-action-icon {
  transform: scale(1.08);
}

.home-page .home-actions-grid a:hover {
  transform: translateY(-2px);
  border-color: #b9d3ee;
  background: #f3f8ff;
  box-shadow: 0 10px 20px rgba(16, 45, 72, 0.09);
}

/* ---------------------------------------------------------------- pantallas más angostas */
@media (max-width: 1100px) {
  .home-page .home-seg-datos {
    flex-basis: 100%;
    order: 3;
  }
}

@media (max-width: 700px) {
  .home-page .home-seg-datos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-page .home-seg-dato {
    padding: 0 8px;
  }

  .home-page .home-seg-dato > span:last-child {
    overflow: visible;
    font-size: 11.5px;
    white-space: normal;
  }

  .home-page .home-seg-aviso {
    flex-basis: 100%;
    order: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-page .home-seg-dato.cargando strong,
  .home-page .esqueleto {
    animation: none;
  }

  .home-page .home-seg-dato,
  .home-page .home-kpi-card::after,
  .home-page .home-kpi-icon,
  .home-page .home-priority-item::before,
  .home-page .home-priority-icon,
  .home-page .home-action-icon {
    transition: none;
  }
}
