/* ==========================================================================
   Landing dashboard
   Built on the theme tokens in theme.css so both [data-theme="light"] and
   [data-theme="dark"] are handled by variable indirection rather than by
   duplicating rules.
   ========================================================================== */

.erp-dash {
  --dash-hero-from: var(--color-primary-80);
  --dash-hero-to: var(--color-primary-40);
  --dash-hero-fg: var(--color-white, #fff);
  --dash-hero-muted: var(--color-primary-20);
}

/* Time-of-day tint, running DARK -> LIGHT across the card.
   The dark end sits under the greeting (left) so white text has a solid floor;
   the light end sits under the artwork (right) so the illustration is not
   buried. The scrim below holds that dark floor steady across the text column —
   without it, white text would drift onto the pale right half and fail.
   Each daypart shifts the pair while keeping that dark-left/light-right shape. */
.erp-dash-hero[data-daypart="morning"] {
  --dash-hero-from: var(--color-primary-80);
  --dash-hero-to: var(--color-warning-40);
}
.erp-dash-hero[data-daypart="afternoon"] {
  --dash-hero-from: var(--color-primary-80);
  --dash-hero-to: var(--color-primary-40);
}
.erp-dash-hero[data-daypart="evening"] {
  --dash-hero-from: var(--color-primary-100);
  --dash-hero-to: var(--color-warning-40);
}

/* Dark theme keeps the same idea in reverse: a soft elevated surface rather than
   a saturated wash, so the artwork is still the brightest thing on the card. */
[data-theme="dark"] .erp-dash {
  --dash-hero-fg: var(--color-neutral-90);
  --dash-hero-muted: var(--color-neutral-70);
}
[data-theme="dark"] .erp-dash-hero[data-daypart="morning"],
[data-theme="dark"] .erp-dash-hero[data-daypart="afternoon"],
[data-theme="dark"] .erp-dash-hero[data-daypart="evening"] {
  --dash-hero-from: var(--color-bg-elevated);
  --dash-hero-to: var(--color-bg-surface);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.erp-dash-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-8);
  margin-bottom: var(--space-6);
  color: var(--dash-hero-fg);
  background-image: linear-gradient(
    135deg,
    var(--dash-hero-from) 0%,
    var(--dash-hero-to) 100%
  );
  box-shadow: var(--shadow-sm);
  /* Taller than the original 148px: the illustrations carry real detail and are
     unreadable when crushed into a thin strip. */
  min-height: 200px;
  display: flex;
  align-items: center;
}

.erp-dash-hero__content {
  position: relative;
  z-index: 3;
  max-width: 46ch;
  /* Keeps the greeting clear of the artwork on mid-width screens. */
  padding-right: var(--space-4);
}

.erp-dash-hero__eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dash-hero-muted);
  margin-bottom: var(--space-2);
}

.erp-dash-hero__title {
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 600;
  margin-bottom: var(--space-2);
  line-height: 1.25;
}

.erp-dash-hero__meta {
  font-size: 0.875rem;
  color: var(--dash-hero-muted);
  margin-bottom: 0;
}

/* Decorative scenery, right-aligned. Hidden on small screens where the text
   needs the whole width. */
.erp-dash-hero__art {
  position: absolute;
  /* Bleeds to the card edges rather than floating inset: the artwork supplies
     the hero's atmosphere, so it should meet the border, not sit on top of a
     visible band of gradient. */
  right: 0;
  bottom: 0;
  height: 100%;
  width: min(62%, 760px);
  z-index: 1;
  pointer-events: none;
  opacity: 1;
  /* Keep the aspect ratio and sit the artwork on the hero's bottom edge rather
     than stretching it to fill the slot. */
  object-fit: contain;
  object-position: right bottom;
}

/* Scrim: the illustrations are detailed and light-toned toward their left edge,
   so white text needs a guaranteed floor of contrast underneath it. A gradient
   from the hero's own base colour fades out before it reaches the artwork's
   focal area, so it reads as depth rather than a visible panel. */
.erp-dash-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: linear-gradient(
    90deg,
    var(--dash-hero-from) 0%,
    var(--dash-hero-from) 24%,
    color-mix(in srgb, var(--dash-hero-from) 75%, transparent) 40%,
    color-mix(in srgb, var(--dash-hero-from) 30%, transparent) 54%,
    transparent 68%
  );
}

@media (max-width: 991.98px) {
  .erp-dash-hero__art { display: none; }
  .erp-dash-hero::after { display: none; }
  .erp-dash-hero { padding: var(--space-5) var(--space-5); min-height: 0; }
}

/* --------------------------------------------------------------------------
   Section heads
   -------------------------------------------------------------------------- */
.erp-dash-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bs-secondary-color, var(--color-neutral-70));
  margin-bottom: var(--space-3);
}

/* --------------------------------------------------------------------------
   Module cards
   Header links into the module; body is a compact list of its inner pages.
   Hover is signalled by border colour only — no shadow, no lift.
   -------------------------------------------------------------------------- */
.erp-dash-mod {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--bs-border-color);
  background-color: var(--color-bg-elevated);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.erp-dash-mod:hover {
  border-color: var(--color-primary-60);
}

.erp-dash-mod__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--bs-border-color);
}

.erp-dash-mod__head:hover,
.erp-dash-mod__head:focus-visible {
  background-color: var(--theme-hover);
  color: inherit;
}

.erp-dash-mod__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background-image: linear-gradient(
    135deg,
    var(--color-primary-50) 0%,
    var(--color-primary-70) 100%
  );
  color: var(--color-white, #fff);
}

.erp-dash-mod__icon .material-symbols-outlined { font-size: 19px; }

.erp-dash-mod__name {
  flex: 1 1 auto;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  min-width: 0;
}

.erp-dash-mod__body {
  flex: 1 1 auto;
  padding: var(--space-2) 0;
}

/* Compact link row: leading chevron marks it as clickable without needing an
   underline, and the whole row is the hit area. */
.erp-dash-mod__link {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.3125rem var(--space-4) 0.3125rem var(--space-2);
  font-size: 0.8125rem;
  line-height: 1.35;
  text-decoration: none;
  color: inherit;
}

.erp-dash-mod__link:hover,
.erp-dash-mod__link:focus-visible {
  background-color: var(--theme-hover);
  color: var(--color-primary-60);
}

.erp-dash-mod__arrow {
  flex: 0 0 auto;
  font-size: 16px;
  color: var(--color-primary-60);
  opacity: 0.65;
}

.erp-dash-mod__link:hover .erp-dash-mod__arrow { opacity: 1; }

.erp-dash-mod__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.erp-dash-mod__link--more .erp-dash-mod__text {
  color: var(--bs-secondary-color, var(--color-neutral-70));
  font-size: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  .erp-dash-mod { transition: none; }
}
