/* ProShop Home — approved low-clutter dashboard treatment.
   This stylesheet is intentionally page-specific. It keeps the shared shell
   and design tokens intact while giving Home a calmer information hierarchy:
   one navigation rail, one compact scope bar, four figures, three work panels,
   and one system-status strip. */

.home-clean {
  --home-gap: 16px;
  max-width: 1480px;
}

.home-clean .ds-page-head {
  margin-bottom: 10px;
}
.home-clean .ds-page-head h1 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: clamp(24px, 2vw, 32px);
  letter-spacing: -.025em;
  font-weight: 720;
}
.home-clean .ds-page-sub {
  font-size: 14px;
}
.home-clean .home-role-chip {
  padding: 2px 8px;
  background: transparent;
}

.home-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.home-tabs::-webkit-scrollbar { display: none; }
.home-tab {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text-secondary);
  background: transparent;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.home-tab:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}
.home-tab.is-active {
  color: #fff;
  background: var(--brand-red);
  border-color: var(--brand-red);
}

.home-clean .ds-filterbar {
  width: fit-content;
  max-width: 100%;
  padding: 0;
  margin: 0 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  gap: 8px;
  align-items: flex-end;
}
.home-clean .ds-filter-field {
  min-width: 120px;
}
.home-clean .ds-filter-label {
  font-size: 10px;
  letter-spacing: .06em;
}
.home-clean .ds-filter-control {
  min-width: 116px;
  height: 36px;
  background: var(--surface);
  border-color: var(--border);
}
.home-clean .ds-filter-note {
  max-width: 180px;
}

.home-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.home-kpi {
  min-width: 0;
  min-height: 112px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text-primary);
}
.home-kpi:hover { border-color: var(--border-strong); }
.home-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.home-kpi-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .01em;
}
.home-kpi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  flex: 0 0 auto;
}
.home-kpi.is-alert .home-kpi-dot { background: var(--danger); }
.home-kpi.is-alert { border-left: 3px solid var(--danger); }
.home-kpi-value {
  margin-top: 8px;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.05;
  font-weight: 720;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.home-kpi.is-unknown .home-kpi-value {
  font-size: 16px;
  line-height: 1.3;
  color: var(--text-secondary);
  font-style: italic;
  font-weight: 500;
}
.home-kpi-note {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.home-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.05fr) minmax(280px, .9fr);
  gap: var(--home-gap);
  align-items: stretch;
  margin-bottom: 16px;
}
.home-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.home-panel-head {
  min-height: 52px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.home-panel-title {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -.01em;
}
.home-panel-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger-ink);
  font-size: 11px;
  font-weight: 750;
}
.home-panel-link {
  color: var(--brand-red);
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.home-panel-body { padding: 0 16px; }
.home-panel-empty {
  padding: 28px 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}
.home-list { list-style: none; margin: 0; padding: 0; }
.home-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.home-list-row:last-child { border-bottom: 0; }
.home-list-main { min-width: 0; }
.home-list-title {
  display: block;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}
.home-list-title:hover { color: var(--brand-red); }
.home-list-note {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.home-list-value {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.home-list-value.is-alert { color: var(--danger); }
.home-list-value.is-unknown {
  max-width: 120px;
  white-space: normal;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  font-style: italic;
}

.home-mywork .ds-stats {
  display: block;
  margin: 0;
}
.home-mywork .ds-stat {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 14px 0;
  background: transparent;
}
.home-mywork .ds-stat:last-child { border-bottom: 0; }
.home-mywork .ds-stat .ds-stat-value {
  font-family: inherit;
  font-size: 24px;
  font-weight: 720;
}
.home-mywork .ds-state,
.home-mywork .ds-truth { margin: 0; }
.home-mywork-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
}
.home-mywork-actions .btn {
  width: auto;
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
}

.home-system-strip {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(120px, 1fr)) auto;
  gap: 0;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}
.home-system-item {
  min-width: 0;
  padding: 13px 16px;
  border-right: 1px solid var(--border);
}
.home-system-item:last-child { border-right: 0; }
.home-system-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.home-system-value {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}
.home-system-value.is-good { color: var(--success-ink); }
.home-system-value.is-warn { color: var(--warning-ink); }
.home-system-value.is-bad { color: var(--danger-ink); }
.home-system-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: var(--brand-red);
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

/* On Home, remembered sidebar disclosures are deliberately closed by the
   page script. The dashboard is the one place where the rail should show
   only the business areas, because no child screen is active. */
.home-clean-shell .side-group-items[hidden] { display: none !important; }

@media (max-width: 1180px) {
  .home-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-overview-grid .home-panel:last-child { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .home-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-system-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-system-item { border-bottom: 1px solid var(--border); }
  .home-system-link { min-height: 48px; }
}
@media (max-width: 680px) {
  .home-clean { --home-gap: 12px; }
  .home-clean .ds-page-head h1 { font-size: 24px; }
  .home-tabs { margin-bottom: 12px; }
  .home-kpi-grid { gap: 8px; }
  .home-kpi { min-height: 96px; padding: 12px; }
  .home-kpi-value { font-size: 21px; }
  .home-overview-grid { grid-template-columns: 1fr; }
  .home-overview-grid .home-panel:last-child { grid-column: auto; }
  .home-clean .ds-filterbar { width: 100%; }
  .home-clean .ds-filter-field { flex: 1 1 calc(50% - 8px); }
  .home-system-strip { grid-template-columns: 1fr; }
  .home-system-item { border-right: 0; border-bottom: 1px solid var(--border); }
}
