/* The Overview. A compact greeting, four counts, Quick launch and the catalogue by
   category, on the shell's light ground with white cards. Tokens come from shell.v3.css;
   nothing here is inline, and nothing depends on a script. */

/* Visual refinement. The same layout as before, with a little more colour and depth: a blue tint
   behind the page and the greeting, softly coloured count cards, Quick launch tiles that take
   their colour from the category accents, and a marker for each category. The navy and
   Haresign blue lead; teal, violet, mint and amber are accents. No heavy gradient: the two
   gradients here are a few percent apart in lightness. */

.home {
  --home-line: #d3ddeb;
  --home-shadow: 0 1px 2px rgba(17, 24, 39, 0.06), 0 3px 10px rgba(17, 24, 39, 0.05);
  --home-shadow-lift: 0 10px 24px rgba(17, 24, 39, 0.13);
}
/* The page behind it. `:has()` is a progressive enhancement: without it the shell's plain
   ground shows, which is the previous look. */
.main:has(.home) {
  background:
    linear-gradient(180deg, #e6eefa 0, #f4f6fa 380px) no-repeat,
    var(--hs-ground);
}

.home-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 0 0 18px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #e7f0fc 0%, #f4f8fe 100%);
  border: 1px solid #c9dbf5;
  border-left: 4px solid var(--hs-aqua);
  border-radius: var(--hs-radius);
  box-shadow: var(--home-shadow);
}
.home-head-copy { min-width: 0; flex: 1 1 360px; }
.home-head h1 { margin: 0 0 4px; font-size: 24px; line-height: 1.25; color: var(--hs-navy); }
.home-lead { margin: 0; max-width: 70ch; font-size: 14.5px; color: #3f4f68; }

.home-workspace {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin: 0;
  padding: 8px 14px;
  background: var(--hs-surface);
  border: 1px solid #c9dbf5;
  border-radius: 999px;
  font-size: 13.5px;
}
.home-workspace.is-unset { border-style: dashed; }
.home-workspace-label {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--hs-ink-muted);
}
.home-workspace-value { min-width: 0; overflow-wrap: anywhere; color: var(--hs-navy); font-weight: 700; }
.home-signin { margin: 0; }

/* Counts: a soft tint of the card's colour, a solid icon tile. */
.kpis {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 14px;
}
.kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--kpi-tint);
  border: 1px solid var(--kpi-line);
  border-radius: var(--hs-radius);
  box-shadow: var(--home-shadow);
}
.kpi-icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--kpi);
  color: #fff;
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.18);
}
.kpi-icon .nav-icon { width: 21px; height: 21px; }
.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-value { font-size: 22px; font-weight: 800; line-height: 1.15; color: var(--hs-navy); font-variant-numeric: tabular-nums; }
.kpi-value.kpi-text { font-size: 15px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.kpi-label { margin-top: 2px; font-size: 12.5px; font-weight: 600; color: #3f4f68; }
.kpi-blue   { --kpi: #0d5bb8; --kpi-tint: #e9f1fc; --kpi-line: #c7dbf5; }
.kpi-violet { --kpi: #5b4fc4; --kpi-tint: #f0eefc; --kpi-line: #d9d4f5; }
.kpi-green  { --kpi: #0b7d6b; --kpi-tint: #e4f6f0; --kpi-line: #bde3d6; }
.kpi-amber  { --kpi: #9a5608; --kpi-tint: #fcf2e2; --kpi-line: #efd9b3; }

/* Section heads */
.home-section { margin-top: 28px; }
.home-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.home-section-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 17px; color: var(--hs-navy); }
/* A coloured marker: the category's accent, or the brand blue where there is none. */
.home-section-head h2::before {
  content: '';
  flex: none;
  width: 10px;
  height: 22px;
  border-radius: 3px;
  background: var(--accent, var(--hs-aqua));
}
.home-more, .home-count { font-size: 13px; }
.home-count {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-bg, var(--hs-info-bg));
  color: #26364f;
  font-weight: 600;
  white-space: nowrap;
}

/* Quick launch: a tinted tile per tool, a solid icon, and a lift on hover. */
.quick-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 12px;
}
.quick-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  min-width: 0;
  padding: 13px 14px;
  background: var(--accent-bg);
  border: 1px solid var(--home-line);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, #fff);
  border-radius: var(--hs-radius);
  box-shadow: var(--home-shadow);
  color: var(--hs-ink);
  text-decoration: none;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.quick-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--home-shadow-lift);
}
.quick-tile:focus-visible { outline: 3px solid var(--hs-aqua); outline-offset: 2px; }
.quick-tile .nav-icon {
  flex: none;
  width: 20px;
  height: 20px;
  padding: 10px;
  box-sizing: content-box;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.2);
  transition: transform .14s ease;
}
.quick-tile:hover .nav-icon { transform: scale(1.07); }
.quick-copy { display: flex; flex-direction: column; min-width: 0; }
.quick-title { font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--hs-navy); }
.quick-desc { margin-top: 2px; font-size: 12.5px; line-height: 1.35; color: #3f4f68; }
@media (prefers-reduced-motion: reduce) {
  .quick-tile, .quick-tile .nav-icon { transition: none; }
  .quick-tile:hover, .quick-tile:hover .nav-icon { transform: none; }
}

.catalogue-section { margin-top: 28px; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; }

/* Category colour, inherited by every card in the section — one declaration
   per accent rather than a rule repeated per colour per property. */
.accent-aqua   { --accent: #0d5bb8; --accent-bg: #eaf2fd; }
.accent-teal   { --accent: #0b7d7d; --accent-bg: #e6f5f3; }
.accent-green  { --accent: #1a7f4b; --accent-bg: #e8f6ee; }
.accent-purple { --accent: #5b4fc4; --accent-bg: #eeecfb; }
.accent-amber  { --accent: #b5650d; --accent-bg: #fbf0e2; }
.accent-navy   { --accent: #1b3054; --accent-bg: #e9edf4; }

.module-tile {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--home-line);
  border-left: 4px solid var(--accent, var(--hs-aqua, #0d5bb8));
  border-radius: var(--hs-radius);
  background: #fff;
  color: #202e38;
  text-decoration: none;
  min-width: 0;
  box-shadow: var(--home-shadow);
}
/* Unavailable stays neutral regardless of category — availability should read
   at a glance, and a locked module keeping its category colour would blur
   that. A card, not a dead one: still readable, still describes itself. */
.module-tile.is-unavailable {
  border-left-color: var(--hs-border-strong, #c8d0dd);
  background: #f7f9fc;
  box-shadow: none;
}
a.module-tile { transition: transform .14s ease, box-shadow .14s ease; }
a.module-tile:hover { border-color: var(--accent, #157d80); box-shadow: var(--home-shadow-lift); transform: translateY(-1px); }
@media (prefers-reduced-motion: reduce) { a.module-tile { transition: none; } a.module-tile:hover { transform: none; } }
a.module-tile:focus-visible { outline: 3px solid var(--hs-aqua, #157d80); outline-offset: 2px; }
.module-tile .nav-icon {
  color: var(--accent, var(--hs-aqua, #0d5bb8));
  width: 20px;
  height: 20px;
  flex: none;
  padding: 8px;
  box-sizing: content-box;
  border-radius: 10px;
  background: var(--accent-bg, var(--hs-info-bg, #eef4fd));
}
.module-tile.is-unavailable .nav-icon { color: var(--hs-ink-faint, #7b8798); background: #eef1f4; }
.module-copy { min-width: 0; overflow-wrap: anywhere; }
.module-copy h3 { margin: 0 0 2px; font-size: 14px; line-height: 1.4; color: var(--hs-navy); }
.module-copy p { margin: 0 0 4px; font-size: 12.5px; color: var(--hs-ink-muted); }
.module-status { display: block; font-size: 12px; font-weight: 600; color: var(--hs-ink-muted); }
.module-tile.is-unavailable .module-copy h3 { color: var(--hs-ink-muted); }
a.module-tile .module-status { color: #186d51; }

@media (max-width: 991px) {
  .home-head { padding: 12px 14px; gap: 8px 16px; }
  .home-head h1 { font-size: 20px; }
  .home-lead { font-size: 13.5px; line-height: 1.4; }
  .home-workspace { padding: 6px 12px; font-size: 13px; }
  .kpis { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
  .kpi { padding: 12px; gap: 10px; }
  .kpi-icon { width: 36px; height: 36px; }
  .kpi-icon .nav-icon { width: 18px; height: 18px; }
}
.catalogue-organisations {
  margin-top: 32px;
  padding: 18px 20px;
  background: var(--hs-surface);
  border: 1px solid var(--home-line);
  border-radius: var(--hs-radius);
  box-shadow: var(--home-shadow);
}
.catalogue-organisations h2 { margin-top: 0; }
