/* Client dashboard only. Central Altiz does not render .client-dashboard. */
.client-dashboard-view:focus {
  outline: 0;
}

.client-dashboard {
  --client-purple: #6941c6;
  --client-purple-dark: #5331a6;
  --client-purple-soft: #f0ebff;
  --client-green: #167a52;
  --client-green-soft: #e8f7ef;
  --client-amber: #9a5a04;
  --client-amber-soft: #fff4df;
  --client-red: #b42336;
  --client-red-soft: #fff0f2;
  display: grid;
  gap: 20px;
  max-width: 1440px;
  min-width: 0;
  padding-bottom: 28px;
}

.client-dashboard *,
.client-dashboard *::before,
.client-dashboard *::after {
  min-width: 0;
  box-sizing: border-box;
}

.client-dashboard__hero,
.client-dashboard__status,
.client-dashboard__card,
.client-dashboard__panel,
.client-dashboard__confidence {
  border: 1px solid #e8e4f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(31, 21, 58, 0.055);
}

.client-dashboard__hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(20px, 3vw, 32px);
  overflow: hidden;
  background:
    radial-gradient(circle at 91% 5%, rgba(112, 72, 201, 0.14), transparent 32%),
    linear-gradient(124deg, #fff 0%, #fcfbff 100%);
}

.client-dashboard__eyebrow {
  margin: 0 0 7px;
  color: var(--client-purple);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.client-dashboard__hero h2 {
  margin: 0;
  color: #1d1732;
  font-size: clamp(26px, 3.2vw, 39px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.client-dashboard__hero p:not(.client-dashboard__eyebrow) {
  max-width: 650px;
  margin: 11px 0 0;
  color: #615a72;
  font-size: 15px;
}

.client-dashboard__refresh,
.client-dashboard__text-button,
.client-dashboard__range button {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #5534a1;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.client-dashboard__refresh {
  flex: 0 0 auto;
  border: 1px solid #dcd2f5;
  padding: 11px 14px;
  background: #fff;
}

.client-dashboard__refresh:hover,
.client-dashboard__text-button:hover {
  color: #3f2188;
  background: #f7f4ff;
}

.client-dashboard__status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 18px 20px;
}

.client-dashboard__status-icon,
.client-dashboard__activity-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--client-green-soft);
  color: var(--client-green);
  font-size: 19px;
  font-weight: 900;
}

.client-dashboard__status[data-state="watch"] .client-dashboard__status-icon,
.client-dashboard__activity-icon--watch {
  background: var(--client-amber-soft);
  color: var(--client-amber);
}

.client-dashboard__status[data-state="attention"] .client-dashboard__status-icon {
  background: var(--client-red-soft);
  color: var(--client-red);
}

.client-dashboard__status h3,
.client-dashboard__panel h3 {
  margin: 0;
  color: #251c3d;
  font-size: 16px;
  line-height: 1.25;
}

.client-dashboard__status p {
  margin: 4px 0 0;
  color: #6e687c;
}

.client-dashboard__metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.client-dashboard__card {
  display: grid;
  gap: 10px;
  min-height: 158px;
  padding: 19px;
}

.client-dashboard__card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #615a72;
  font-size: 13px;
  font-weight: 760;
}

.client-dashboard__card-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--client-purple-soft);
  color: var(--client-purple);
  font-size: 14px;
}

.client-dashboard__card strong {
  color: #251c3d;
  font-size: clamp(27px, 2.2vw, 36px);
  letter-spacing: -0.045em;
  line-height: 1;
}

.client-dashboard__card strong.client-dashboard__metric-unavailable {
  color: #6e687c;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.client-dashboard__card small {
  align-self: end;
  color: #777083;
  font-size: 12px;
  line-height: 1.45;
}

.client-dashboard__content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(320px, 0.86fr);
  gap: 20px;
}

.client-dashboard__panel {
  padding: clamp(18px, 2.3vw, 25px);
}

.client-dashboard__panel--wide {
  min-height: 330px;
}

.client-dashboard__panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.client-dashboard__panel-head > div > p {
  margin: 5px 0 0;
  color: #777083;
  font-size: 12px;
}

.client-dashboard__range {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: #f2eff8;
}

.client-dashboard__range button {
  min-height: 32px;
  padding: 0 10px;
  color: #6d647e;
  font-size: 12px;
}

.client-dashboard__range button[aria-pressed="true"] {
  background: #fff;
  color: #4d299f;
  box-shadow: 0 1px 4px rgba(52, 33, 104, 0.14);
}

.client-dashboard__chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  height: 217px;
  gap: clamp(3px, 0.8vw, 8px);
  padding: 16px 0 4px;
  border-bottom: 1px solid #eeeaf4;
}

.client-dashboard__chart--30 {
  grid-template-columns: repeat(30, minmax(0, 1fr));
}

.client-dashboard__chart-item {
  display: grid;
  min-width: 0;
  height: 100%;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: end;
  text-align: center;
}

.client-dashboard__chart-column {
  align-items: end;
  display: grid;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 6px 6px 1px 1px;
  background: #f1edf9;
}

.client-dashboard__chart-column::after {
  align-self: end;
  content: "";
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  border-radius: 6px 6px 1px 1px;
  background: linear-gradient(180deg, #8f69eb 0%, #6140bf 100%);
}

.client-dashboard__chart-column--level-1::after { height: 24px; }
.client-dashboard__chart-column--level-2::after { height: 48px; }
.client-dashboard__chart-column--level-3::after { height: 72px; }
.client-dashboard__chart-column--level-4::after { height: 96px; }
.client-dashboard__chart-column--level-5::after { height: 124px; }
}

.client-dashboard__chart-item b {
  color: #473c5d;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.client-dashboard__chart-item span {
  overflow: hidden;
  color: #857d93;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-dashboard__chart-description {
  margin: 12px 0 0;
  color: #777083;
  font-size: 12px;
}

.client-dashboard__pipeline {
  display: grid;
  gap: 12px;
}

.client-dashboard__pipeline-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.85fr) minmax(88px, 1.5fr) auto;
  gap: 10px;
  align-items: center;
  color: #514963;
  font-size: 13px;
}

.client-dashboard__pipeline-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-dashboard__pipeline-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #eeeaf5;
}

.client-dashboard__pipeline-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7e59d6, #ad8afa);
}

.client-dashboard__pipeline-row b {
  color: #2a2140;
  font-variant-numeric: tabular-nums;
}

.client-dashboard__list {
  display: grid;
  gap: 0;
}

.client-dashboard__list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid #f0edf4;
}

.client-dashboard__list-item:last-child {
  border-bottom: 0;
}

.client-dashboard__activity-icon {
  width: 31px;
  height: 31px;
  border-radius: 10px;
  background: var(--client-purple-soft);
  color: var(--client-purple);
  font-size: 13px;
}

.client-dashboard__list-item b,
.client-dashboard__list-item p {
  margin: 0;
  color: #3f3752;
  font-size: 13px;
}

.client-dashboard__list-item small {
  display: block;
  margin-top: 3px;
  color: #847b91;
  font-size: 12px;
}

.client-dashboard__results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.client-dashboard__result {
  padding: 15px;
  border-radius: 13px;
  background: #faf9fd;
}

.client-dashboard__result strong {
  display: block;
  color: #33264b;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.client-dashboard__result span {
  display: block;
  margin-top: 4px;
  color: #746c81;
  font-size: 12px;
  line-height: 1.35;
}

.client-dashboard__empty {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 18px;
  border: 1px dashed #dcd4e8;
  border-radius: 13px;
  color: #766d82;
  text-align: center;
}

.client-dashboard__empty p {
  max-width: 340px;
  margin: 0;
  font-size: 13px;
}

.client-dashboard__confidence {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.client-dashboard__confidence-item {
  display: grid;
  gap: 4px;
  min-height: 92px;
  align-content: center;
  padding: 16px 20px;
  border-right: 1px solid #eeeaf3;
}

.client-dashboard__confidence-item:last-child {
  border-right: 0;
}

.client-dashboard__confidence-item span {
  color: #7d748a;
  font-size: 11px;
  font-weight: 750;
}

.client-dashboard__confidence-item strong {
  color: #34274c;
  font-size: 13px;
  line-height: 1.35;
}

.client-dashboard__confidence-item strong.is-good {
  color: var(--client-green);
}

.client-dashboard__confidence-item strong.is-watch {
  color: var(--client-amber);
}

.client-dashboard__skeleton {
  display: grid;
  gap: 20px;
}

.client-dashboard__skeleton > i {
  display: block;
  min-height: 126px;
  border-radius: 18px;
  background: linear-gradient(100deg, #f4f1f8 24%, #fcfbfe 39%, #f4f1f8 57%);
  background-size: 300% 100%;
  animation: client-dashboard-shimmer 1.45s ease-in-out infinite;
}

.client-dashboard__skeleton > i:nth-child(2) {
  min-height: 184px;
}

@keyframes client-dashboard-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

.client-dashboard button:focus-visible {
  outline: 3px solid rgba(105, 65, 198, 0.34);
  outline-offset: 3px;
}

/* Clean client view additions. These selectors are never used by Central Altiz. */
.client-dashboard__hero-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.client-dashboard__agent-status {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid #eadfe9;
  border-radius: 10px;
  color: #766d82;
  background: #fff;
  font-size: 13px;
  font-weight: 760;
}

.client-dashboard__agent-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9a5a04;
}

.client-dashboard__agent-status.is-active {
  border-color: #cdecd9;
  color: var(--client-green);
  background: var(--client-green-soft);
}

.client-dashboard__agent-status.is-active i { background: var(--client-green); }

.client-dashboard__range--period {
  width: max-content;
  max-width: 100%;
}

.client-dashboard__card--button,
.client-dashboard__list-item--button {
  width: 100%;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.client-dashboard__card--button {
  border: 1px solid #e8e4f0;
  background: #fff;
}

.client-dashboard__card--button:hover {
  border-color: #cbbcf0;
  box-shadow: 0 10px 28px rgba(78, 48, 155, 0.11);
}

.client-dashboard__list-item--button {
  background: transparent;
  border-bottom: 1px solid #f0edf4;
}

.client-dashboard__list-item--button:hover { background: #fbfaff; }

.client-dashboard__ai-rate {
  margin: -6px 0 0;
  padding: 13px 16px;
  border-radius: 13px;
  color: #514963;
  background: #f8f5ff;
  font-size: 14px;
}

.client-dashboard__ai-rate b { color: var(--client-purple); }

.client-dashboard__panel--wide { grid-column: 1 / -1; }

.client-dashboard__subjects {
  display: grid;
  gap: 10px;
}

.client-dashboard__subjects > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0edf4;
  color: #514963;
  font-size: 13px;
}

.client-dashboard__subjects > div:last-child { border-bottom: 0; }
.client-dashboard__subjects b { color: #2a2140; font-variant-numeric: tabular-nums; }

@media (max-width: 1120px) {
  .client-dashboard__metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-dashboard__content-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
  .client-dashboard { gap: 14px; }
  .client-dashboard__hero { align-items: flex-start; flex-direction: column; gap: 15px; padding: 20px; }
  .client-dashboard__hero-actions { width: 100%; justify-content: stretch; }
  .client-dashboard__agent-status,
  .client-dashboard__refresh { flex: 1 1 100%; justify-content: center; }
  .client-dashboard__hero p:not(.client-dashboard__eyebrow) { font-size: 14px; }
  .client-dashboard__refresh { width: 100%; }
  .client-dashboard__metric-grid,
  .client-dashboard__results { grid-template-columns: minmax(0, 1fr); }
  .client-dashboard__card { min-height: 130px; }
  .client-dashboard__panel { padding: 18px; }
  .client-dashboard__panel-head { align-items: flex-start; flex-direction: column; }
  .client-dashboard__range { width: 100%; }
  .client-dashboard__range button { flex: 1; }
  .client-dashboard__chart { height: 190px; gap: 3px; }
  .client-dashboard__chart-item b { font-size: 9px; }
  .client-dashboard__chart-item span { font-size: 8px; }
  .client-dashboard__pipeline-row { grid-template-columns: minmax(82px, 1fr) minmax(65px, 1.25fr) auto; gap: 7px; }
  .client-dashboard__confidence { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-dashboard__confidence-item:nth-child(2) { border-right: 0; }
  .client-dashboard__confidence-item { min-height: 82px; padding: 14px; border-bottom: 1px solid #eeeaf3; }
  .client-dashboard__confidence-item:nth-child(n + 3) { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .client-dashboard__skeleton > i { animation: none; }
}
