/*
 * E-01 Dashboard for Employees (Portal::HomeController → portal/home/dashboard).
 *   .staff-dash        page column, 28px rhythm
 *   .staff-hero        Site pill + job role tag (.job-tag), the 54px greeting, the "things to finish" line
 *   .staff-section     "Required actions" / "Recently completed": 22px heading, 10px rhythm
 *   .staff-action      a required action: 46px tinted icon tile, title + meta, status chip, button;
 *                      stacked on phones with the button full width
 *   .staff-done        a "Recently completed" row: outlined capsule, check, title, what and when;
 *                      the title link covers the row
 * The all-done state reuses .home-caught-up (pages/portal-home.css).
 */
@layer pages {
  .staff-dash {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  /* Greeting ---------------------------------------------------------------------------------- */
  .staff-hero {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .staff-hero__pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .staff-hero__title {
    font-size: 54px;
    letter-spacing: -0.02em;
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .staff-hero__summary {
    color: var(--color-neutral-800);
    font-size: 16px;
  }

  /* Sections ---------------------------------------------------------------------------------- */
  .staff-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-margin-top: 16px;
  }

  .staff-section__title {
    font-size: 22px;
    letter-spacing: -0.01em;
    line-height: 1.2;
  }

  .staff-section__empty {
    color: var(--color-neutral-700);
    font-size: 15px;
  }

  /* Required actions -------------------------------------------------------------------------- */
  .staff-actions,
  .staff-completed {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .staff-action {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 72px;
    padding: 12px 16px 12px 14px;
    border-radius: 24px;
    background: var(--color-surface);
  }

  .staff-action__icon {
    width: 46px;
    height: 46px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: var(--radius-tile);
    font-size: 21px;
  }
  .staff-action__icon--err { background: var(--color-err-soft); color: var(--color-err-text); }
  .staff-action__icon--policy { background: var(--petal-policy-bg); color: var(--petal-policy-fg); }
  .staff-action__icon--training { background: var(--petal-ops-bg); color: var(--petal-ops-fg); }
  .staff-action__icon--credential { background: var(--petal-lic-bg); color: var(--petal-lic-fg); }
  .staff-action__icon--review { background: var(--petal-staff-bg); color: var(--petal-staff-fg); }

  .staff-action__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .staff-action__title {
    font-size: 15px;
    letter-spacing: normal;
    line-height: 1.55;
  }

  .staff-action__meta {
    color: var(--color-neutral-700);
    font-size: 13px;
  }

  .staff-action__end {
    display: flex;
    flex: none;
    align-items: center;
    gap: 10px;
  }

  /* Recently completed ------------------------------------------------------------------------ */
  .staff-done {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border: 1.5px solid var(--color-divider);
    border-radius: var(--radius-row);
    font-size: 14px;
  }

  .staff-done__icon {
    display: flex;
    flex: none;
    font-size: 16px;
  }

  .staff-done__title {
    color: var(--color-text);
    font-weight: 700;
  }
  a.staff-done__title:hover { color: var(--color-text); text-decoration: underline; }
  /* The link covers the whole row (a 44px target on phones too). */
  a.staff-done__title::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
  }
  a.staff-done__title:focus-visible { outline: none; }
  .staff-done:has(a.staff-done__title:hover) { background: var(--color-btn-hover); }
  .staff-done:has(a.staff-done__title:focus-visible) { box-shadow: var(--ring); }
  /* A policy the person can no longer see: a neutral label instead of its title. */
  .staff-done__title--unavailable { color: var(--color-neutral-700); font-weight: 600; }

  .staff-done__meta { color: var(--color-neutral-700); }

  /* Laptop / tablet --------------------------------------------------------------------------- */
  @media (max-width: 1199px) {
    .staff-hero__title { font-size: 46px; }
  }

  /* Phones: stacked rows, the button full width ----------------------------------------------- */
  @media (max-width: 767px) {
    .staff-dash { gap: 20px; }

    .staff-hero { gap: 8px; padding-top: 2px; }
    .staff-hero__title { font-size: 30px; line-height: 1.08; }
    .staff-hero__summary { font-size: 14px; }

    .staff-section { gap: 12px; }
    .staff-section__title { font-size: 19px; }
    .staff-section__empty { font-size: 14px; }

    .staff-action {
      flex-wrap: wrap;
      align-items: flex-start;
      gap: 12px;
      padding: 16px;
    }
    .staff-action__end {
      flex: 1 0 100%;
      flex-direction: column;
      align-items: flex-start;
      gap: 12px;
    }
    .staff-action__end .btn {
      width: 100%;
      height: 48px;
      font-size: 15px;
    }

    .staff-done {
      flex-wrap: wrap;
      gap: 2px 10px;
      padding: 12px 16px;
    }
    .staff-done__title { flex: 1; min-width: 0; }
    .staff-done__meta {
      flex: 0 0 100%;
      padding-left: 26px; /* under the title, past the check */
      font-size: 13px;
    }
  }
}
