:root {
  --bg: #f3f1ec;
  --surface: rgba(255, 253, 249, 0.82);
  --surface-strong: #fffdfa;
  --ink: #18161a;
  --muted: #6c645f;
  --line: rgba(24, 22, 26, 0.08);
  --red: #c8102e;
  --red-dark: #9e0b22;
  --gold: #f5a800;
  --blue: #174d7a;
  --shadow: 0 24px 60px rgba(49, 31, 18, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 0 0, rgba(200, 16, 46, 0.12), transparent 22%),
    radial-gradient(circle at 100% 0, rgba(23, 77, 122, 0.12), transparent 20%),
    linear-gradient(180deg, #fcfaf6 0%, var(--bg) 100%);
}

.catalog-shell {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero {
  margin-bottom: 22px;
}

.completion-notice,
.hero__copy,
.catalog-panel,
.app-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  border-radius: 30px;
}

.completion-notice {
  margin-bottom: 22px;
  padding: 24px 28px;
  background: linear-gradient(180deg, rgba(255, 249, 233, 0.98), rgba(255, 255, 255, 0.96));
  border-color: rgba(245, 168, 0, 0.34);
}

.completion-notice h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--blue);
}

.completion-notice p:last-child {
  margin: 10px 0 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.hero__copy,
.catalog-panel {
  padding: 34px;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--red);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Montserrat", sans-serif;
}

h1 {
  max-width: 12ch;
  font-size: clamp(3rem, 6vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.hero__copy > p:last-of-type {
  max-width: 52ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.catalog-panel__heading {
  margin-bottom: 20px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 250, 244, 0.96));
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.app-card--completed {
  border-color: rgba(245, 168, 0, 0.34);
  box-shadow: 0 30px 70px rgba(245, 168, 0, 0.16);
}

.app-card--report {
  border-color: rgba(23, 77, 122, 0.18);
  background: linear-gradient(180deg, rgba(239, 247, 255, 0.9), rgba(255, 251, 247, 0.98));
}

.app-card--report .app-card__tag {
  color: var(--blue);
}

.app-card--report .app-card__link {
  background: linear-gradient(135deg, var(--blue), #0b74d1);
  box-shadow: 0 14px 24px rgba(23, 77, 122, 0.22);
}

.app-card--report .app-card__link:hover {
  box-shadow: 0 18px 28px rgba(23, 77, 122, 0.26);
}

.app-card__completion {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f5a800, #ffd061);
  color: #5d4100;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 12px 24px rgba(245, 168, 0, 0.18);
}

.app-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(200, 16, 46, 0.14);
  box-shadow: 0 30px 70px rgba(49, 31, 18, 0.12);
}

.app-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.1), rgba(0, 69, 124, 0.16));
}

.app-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}

.app-card__text {
  flex: 1;
}

.app-card__tag {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.app-card__title {
  font-size: 1.12rem;
  line-height: 1.14;
  letter-spacing: -0.02em;
}

.app-card__description {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.app-card__footer {
  margin-top: auto;
  padding-top: 4px;
}

.app-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  width: 100%;
  padding: 0 16px;
  border-radius: 16px;
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  box-shadow: 0 14px 24px rgba(158, 11, 34, 0.18);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.app-card__link:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 28px rgba(158, 11, 34, 0.22);
}

/* ─── Hero con acciones ──────────────────────────────────────── */
.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  flex-shrink: 0;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 12px 14px 12px 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(17, 28, 44, 0.92), rgba(26, 45, 68, 0.9));
  color: #fff;
  box-shadow: 0 18px 40px rgba(18, 21, 29, 0.18);
  border: 1px solid rgba(255,255,255,0.12);
  flex-wrap: wrap;
}

.user-chip__identity {
  display: grid;
  gap: 2px;
}

.user-chip__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.user-chip__name {
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.user-chip__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-chip__username {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.86);
  font-size: 0.85rem;
  font-weight: 700;
}

.user-chip__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  color: #f8fafc;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.user-chip__action:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.22);
}

.user-chip__action--logout {
  background: linear-gradient(135deg, rgba(200, 16, 46, 0.96), rgba(158, 11, 34, 0.96));
  border-color: rgba(255,255,255,0.1);
}

.welcome-overlay {
  position: fixed;
  inset: 24px 24px auto auto;
  z-index: 120;
  opacity: 0;
  transform: translateY(-14px) scale(0.98);
  transition: opacity 280ms ease, transform 280ms ease;
  pointer-events: none;
}

.welcome-overlay.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.welcome-overlay__card {
  width: min(420px, calc(100vw - 32px));
  padding: 18px 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(16, 24, 40, 0.96), rgba(18, 55, 86, 0.94));
  color: #fff;
  border: 1px solid rgba(125, 211, 252, 0.16);
  box-shadow: 0 28px 60px rgba(14, 20, 31, 0.22);
  backdrop-filter: blur(16px);
}

.welcome-overlay__eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 800;
  color: #93c5fd;
}

.welcome-overlay__title {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.05;
}

.welcome-overlay__text {
  margin: 10px 0 0;
  color: rgba(241,245,249,0.82);
  font-size: 0.95rem;
  line-height: 1.55;
}

.pendientes-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(24, 22, 26, 0.1);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 140ms, box-shadow 140ms;
}

.pendientes-link:hover {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(24, 22, 26, 0.08);
}

.pendientes-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
}

/* ─── Empty state ────────────────────────────────────────────── */
.catalog-empty {
  padding: 28px;
  border: 1px dashed rgba(31, 36, 48, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

@media (max-width: 900px) {
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .catalog-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 20px;
  }

  .hero__copy,
  .catalog-panel {
    padding: 20px;
    border-radius: 22px;
  }

  .user-chip {
    width: 100%;
    justify-content: space-between;
  }

  .welcome-overlay {
    inset: auto 10px 10px 10px;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.4rem, 10vw, 3.5rem);
  }
}