.insights-active .content {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 24px clamp(16px, 2vw, 32px) 40px;
}

.insights-active .app-message:empty {
  display: none;
}

.main-nav {
  min-height: 0;
  overflow-y: auto;
  scrollbar-color: #d8e0ea transparent;
  scrollbar-width: thin;
}

.insights-view {
  width: min(100%, 1450px);
  margin: 0 auto;
  color: #1b2b3f;
}

.insights-view[hidden] {
  display: none;
}

.trends-view {
  max-width: 1480px;
}

.trend-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 6px 0 22px;
}

.trend-page-heading h1 {
  margin-bottom: 8px;
  color: #1b2b3f;
  font-size: clamp(25px, 3vw, 34px);
}

.trend-page-heading .page-description {
  max-width: 660px;
  font-size: 12px;
}

.trend-refresh,
.trend-open-productivity {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #dce5f0;
  border-radius: 9px;
  color: #36577b;
  background: #fff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  transition: background 150ms ease, border-color 150ms ease;
}

.trend-refresh:hover,
.trend-open-productivity:hover {
  border-color: #b7cbe5;
  background: #f5f9ff;
}

.trend-refresh:disabled { cursor: progress; opacity: 0.65; }
.trend-refresh span { font-size: 17px; }

.trend-status {
  min-height: 18px;
  margin: 0 0 14px;
  color: #718196;
  font-size: 10px;
}

.trend-status.is-error { color: #b43c4d; }
.trend-dashboard[hidden],
.trend-empty[hidden] { display: none; }

.trend-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 13px;
}

.trend-kpi {
  display: flex;
  min-height: 126px;
  flex-direction: column;
  justify-content: center;
  padding: 17px;
  border: 1px solid #e8edf3;
  border-radius: 12px;
  background: #fff;
}

.trend-kpi > span {
  margin-bottom: 12px;
  color: #8997a8;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.8px;
}

.trend-kpi > strong {
  overflow: hidden;
  color: #243a55;
  font-family: "Manrope", sans-serif;
  font-size: clamp(18px, 2vw, 25px);
  letter-spacing: -0.8px;
  text-overflow: ellipsis;
}

.trend-kpi > small {
  margin-top: 6px;
  color: #92a0af;
  font-size: 9px;
}

.trend-kpi-dark {
  border-color: #213d60;
  color: #fff;
  background: linear-gradient(135deg, #1c314d, #2c5278);
}

.trend-kpi-dark > span { color: #aec3dc; }
.trend-kpi-dark > strong { color: #fff; }
.trend-kpi-dark > small { color: #c2d3e6; }

.trend-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.trend-chart-card,
.trend-history {
  min-width: 0;
  padding: 18px 19px 14px;
  border: 1px solid #e8edf3;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 6px 20px #253d5806;
}

.trend-card-heading {
  display: flex;
  align-items: center;
  gap: 11px;
}

.trend-index {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: #3872d4;
  background: #edf4ff;
  font-size: 10px;
  font-weight: 800;
}

.trend-index-violet { color: #7864c9; background: #f1eeff; }
.trend-index-green { color: #328666; background: #eaf6f0; }

.trend-card-heading h2 {
  margin: 0 0 4px;
  color: #2b4058;
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.trend-card-heading p {
  margin: 0;
  color: #92a0af;
  font-size: 9px;
}

.trend-chart {
  min-height: 225px;
  margin-top: 14px;
}

.trend-line-svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.trend-grid-line {
  stroke: #e9eef4;
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

.trend-axis-label {
  fill: #92a0af;
  font-family: "DM Sans", sans-serif;
  font-size: 9px;
}

.trend-month-label { font-size: 8px; }

.trend-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.7;
}

.trend-area { opacity: 0.08; }

.trend-point {
  stroke: #fff;
  stroke-width: 2;
}

.trend-no-chart {
  padding: 50px 10px;
  color: #8997a8;
  font-size: 10px;
  text-align: center;
}

.trend-reading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  margin: 13px 0;
  padding: 16px 18px;
  border: 1px solid #e8edf3;
  border-radius: 12px;
  background: linear-gradient(100deg, #fff, #f7faff);
}

.trend-reading-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: #3471ce;
  background: #eaf2ff;
  font-size: 19px;
}

.trend-reading .eyebrow {
  margin-bottom: 5px;
  font-size: 8px;
}

.trend-reading p:last-child {
  margin: 0;
  color: #52677f;
  font-size: 10px;
  line-height: 1.55;
}

.trend-history { padding-bottom: 5px; }
.trend-history > .trend-card-heading { margin-bottom: 14px; }

.trend-table-wrap { overflow-x: auto; }

.trend-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.trend-table th,
.trend-table td {
  padding: 11px 10px;
  border-top: 1px solid #edf1f5;
  font-size: 9px;
  white-space: nowrap;
}

.trend-table th {
  color: #94a0ae;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.trend-table td {
  color: #566b82;
}

.trend-table td:first-child {
  color: #273d57;
  font-weight: 700;
}

.trend-method {
  margin: 13px 2px 0;
  color: #8d9bad;
  font-size: 9px;
  line-height: 1.65;
}

.trend-empty {
  display: grid;
  max-width: 520px;
  justify-items: center;
  margin: 32px auto;
  padding: 36px 30px;
  border: 1px solid #e6edf5;
  border-radius: 17px;
  background: #fff;
  text-align: center;
}

.trend-empty-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 16px;
  color: #3972dc;
  background: #edf4ff;
  font-size: 25px;
}

.trend-empty .eyebrow { margin-bottom: 8px; }
.trend-empty h2 {
  margin: 0 0 9px;
  color: #253950;
  font-family: "Manrope", sans-serif;
  font-size: 19px;
}

.trend-empty > p:not(.eyebrow) {
  max-width: 390px;
  margin-bottom: 19px;
  color: #7e8da0;
  font-size: 11px;
  line-height: 1.65;
}

.trend-open-productivity {
  border-color: #3169cb;
  color: #fff;
  background: #3972dc;
}

.trend-open-productivity:hover {
  border-color: #285cb8;
  background: #3169cb;
}

.flow-radar-dashboard[hidden] {
  display: none;
}

.flow-radar-panel {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid #e7edf4;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 7px 20px #253d5806;
}

.flow-radar-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.flow-radar-panel-heading h2 {
  margin: 0 0 5px;
  color: #253950;
  font-family: "Manrope", sans-serif;
  font-size: 15px;
}

.flow-radar-panel-heading p {
  margin: 0;
  color: #8190a2;
  font-size: 10px;
}

.flow-area-filter {
  display: grid;
  gap: 5px;
  color: #738196;
  font-size: 9px;
  font-weight: 700;
}

.flow-area-filter select {
  max-width: 260px;
  min-height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
  color: #405873;
  background: #fff;
  font: inherit;
}

.flow-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 17px 0 9px;
}

.flow-filter {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #e2e9f1;
  border-radius: 999px;
  color: #728197;
  background: #fff;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.flow-filter:hover,
.flow-filter.is-active {
  border-color: #c6d8f0;
  color: #2c62b7;
  background: #f1f6ff;
}

.flow-table-wrap {
  max-height: 680px;
}

.flow-table th:first-child,
.flow-table td:first-child {
  width: 80px;
}

.flow-table td:nth-child(2) {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flow-item-link {
  color: #3169c5;
  text-decoration: none;
}

.flow-item-link:hover {
  text-decoration: underline;
}

.flow-state {
  color: #405873 !important;
}

.flow-age {
  font-variant-numeric: tabular-nums;
}

.flow-age-critical {
  color: #a34c2f !important;
  font-weight: 700;
}

.flow-list-empty {
  margin: 18px 0 4px;
  color: #8290a1;
  font-size: 10px;
  text-align: center;
}

.flow-more {
  display: block;
  min-height: 34px;
  margin: 12px auto 0;
  padding: 0 14px;
  border: 1px solid #dce5f0;
  border-radius: 8px;
  color: #36577b;
  background: #fff;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.flow-more:hover {
  border-color: #b7cbe5;
  background: #f5f9ff;
}

.flow-more[hidden] {
  display: none;
}

.flow-method {
  margin: 12px 2px 0;
  color: #8d9bad;
  font-size: 9px;
  line-height: 1.65;
}

@media (max-width: 1120px) {
  .trend-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .insights-active .content { padding: 20px 18px 30px; }
  .trend-page-heading { align-items: flex-start; flex-direction: column; }
  .trend-refresh { min-height: 38px; }
  .trend-chart-grid { grid-template-columns: minmax(0, 1fr); }
  .trend-reading { grid-template-columns: auto minmax(0, 1fr); }
  .trend-reading > a { grid-column: 2; }
  .flow-radar-panel-heading { align-items: flex-start; flex-direction: column; }
  .flow-area-filter,
  .flow-area-filter select { width: 100%; max-width: none; }
}

@media (max-width: 430px) {
  .insights-active .content { padding-right: 14px; padding-left: 14px; }
  .trend-kpis { gap: 8px; }
  .trend-kpi { min-height: 112px; padding: 12px; }
  .trend-kpi > span { font-size: 7px; letter-spacing: 0.45px; }
  .trend-kpi > strong { font-size: 17px; }
  .trend-chart-card,
  .trend-history { padding-right: 12px; padding-left: 12px; }
  .trend-chart { min-height: 190px; }
  .trend-reading { gap: 10px; padding: 13px; }
  .flow-radar-panel { padding: 13px; }
  .flow-table td:nth-child(2) { max-width: 160px; }
}
