/* =============================================================
   Avarie Growth System — Dashboard demonstration components
   Fully responsive, Avarie-branded, uses site palette
   ============================================================= */

.dash {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 40px 100px -40px rgba(0, 0, 0, 0.6),
    0 6px 24px -12px rgba(91, 216, 246, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
  font-family: var(--font-sans);
  color: var(--text);
  font-size: 0.85rem;
}
.dash::before {
  content: "Demonstration data";
  position: absolute;
  top: 0.65rem; right: 0.75rem;
  z-index: 10;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(199, 125, 235, 0.10);
  border: 1px solid rgba(199, 125, 235, 0.25);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}

/* Chrome — top bar */
.dash__chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.dash__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text);
}
.dash__brand-mark {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--brand-gradient);
  display: inline-block;
  flex-shrink: 0;
}
.dash__brand strong { font-weight: 600; }
.dash__brand-sub {
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}
.dash__nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.dash__nav-item {
  padding: 0.42rem 0.75rem;
  border-radius: 6px;
  font-size: 0.76rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 200ms, background 200ms;
  white-space: nowrap;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  background: none;
}
.dash__nav-item:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.dash__nav-item.active {
  color: var(--text);
  background: rgba(91, 216, 246, 0.08);
  border-color: rgba(91, 216, 246, 0.25);
}
.dash__nav-item.active::before {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 6px var(--cyan);
}
.dash__avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--magenta) 100%);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .dash__nav { display: none; }
}

/* Dashboard body */
.dash__body { padding: 1.15rem; }

/* Views */
.dash__view { display: none; }
.dash__view.active { display: block; }

/* Section heading inside dashboard */
.dash__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.dash__section-head h4 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  margin: 0;
}
.dash__section-head .dash-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* KPI grid (Overview) */
.dash__kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.kpi {
  padding: 0.85rem 0.95rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
}
.kpi__label {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  margin-bottom: 0.4rem;
}
.kpi__value {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.014em;
  line-height: 1.1;
}
.kpi__value.small { font-size: clamp(1.15rem, 1.9vw, 1.4rem); }
.kpi__delta {
  font-size: 0.7rem;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.kpi__delta.up { color: #6EDBAE; }
.kpi__delta.down { color: #FF7B7B; }
.kpi__delta.neutral { color: var(--text-muted); }
@media (max-width: 720px) {
  .dash__kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .dash__kpis { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
  .kpi { padding: 0.65rem 0.7rem; }
}

/* Two-column overview layout */
.dash__grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 820px) { .dash__grid { grid-template-columns: 1fr; } }

.dash__panel {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
}
.dash__panel h4 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.85rem;
  letter-spacing: 0.01em;
}

/* Bar chart (Lead sources) */
.dash-bars { display: flex; flex-direction: column; gap: 0.55rem; }
.dash-bar {
  display: grid;
  grid-template-columns: 92px 1fr 44px;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.dash-bar__label { color: var(--text); font-weight: 500; }
.dash-bar__track {
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.dash-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(91, 216, 246, 0.35);
}
.dash-bar__val {
  text-align: right;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

/* Sparkline (Conversion trend) */
.dash-spark { display: block; width: 100%; height: auto; }

/* Activity feed */
.dash__feed { display: flex; flex-direction: column; gap: 0.75rem; }
.dash-feed__item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 0.65rem;
  align-items: start;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.78rem;
}
.dash-feed__item:last-child { border-bottom: 0; }
.dash-feed__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  margin-top: 6px;
  justify-self: center;
  box-shadow: 0 0 6px rgba(91, 216, 246, 0.5);
}
.dash-feed__dot.magenta { background: var(--magenta); box-shadow: 0 0 6px rgba(199, 125, 235, 0.5); }
.dash-feed__dot.muted { background: var(--text-muted); box-shadow: none; }
.dash-feed__body strong { color: var(--text); font-weight: 500; }
.dash-feed__body { color: var(--text-dim); line-height: 1.45; }
.dash-feed__time {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  white-space: nowrap;
}

/* Task list */
.dash__tasks { display: flex; flex-direction: column; gap: 0.55rem; }
.dash-task {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.76rem;
}
.dash-task__check {
  width: 15px; height: 15px;
  border-radius: 4px;
  border: 1.5px solid var(--text-muted);
  display: inline-block;
}
.dash-task__body { color: var(--text-dim); }
.dash-task__body strong { color: var(--text); font-weight: 500; }
.dash-task__due {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.dash-task__due.urgent { color: #FFA85B; }

/* Pipeline (kanban) */
.dash__pipeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 1fr);
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.dash__pipeline::-webkit-scrollbar { height: 8px; }
.dash__pipeline::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.pipeline-col {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.65rem;
  min-height: 320px;
  display: flex; flex-direction: column;
  gap: 0.5rem;
}
.pipeline-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}
.pipeline-col__title {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.pipeline-col__count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
}
.pipeline-col__total {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.pipeline-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
  cursor: default;
  transition: border-color 200ms, transform 200ms;
}
.pipeline-card:hover { border-color: var(--cyan); transform: translateY(-1px); }
.pipeline-card__name {
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 0.2rem;
}
.pipeline-card__meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.pipeline-card__meta .value { color: var(--cyan); font-weight: 500; }
.pipeline-card__row2 {
  display: flex; justify-content: space-between; gap: 0.35rem;
  margin-top: 0.45rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border);
  font-size: 0.66rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.pipeline-card.won { border-left: 2px solid #6EDBAE; }
.pipeline-card.lost { opacity: 0.55; border-left: 2px solid #6E7691; }
.pipeline-card.hot { border-left: 2px solid #FFA85B; }

/* Conversations */
.dash__convo {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 460px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.01);
}
@media (max-width: 720px) { .dash__convo { grid-template-columns: 1fr; min-height: auto; } }

.convo__list {
  border-right: 1px solid var(--border);
  padding: 0.75rem 0.5rem;
  display: flex; flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
}
@media (max-width: 720px) { .convo__list { border-right: 0; border-bottom: 1px solid var(--border); max-height: 200px; } }

.convo__list-item {
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 0.55rem;
  align-items: center;
  transition: background 180ms;
}
.convo__list-item:hover { background: rgba(255,255,255,0.03); }
.convo__list-item.active { background: rgba(91, 216, 246, 0.08); }
.convo__list-item__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}
.convo__list-item__name {
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1.2;
}
.convo__list-item__preview {
  font-size: 0.68rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.convo__list-item__badge {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}
.convo__list-item.active .convo__list-item__badge { background: transparent; box-shadow: none; }
.convo__list-item__channel {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  margin-top: 0.15rem;
  display: inline-block;
}

.convo__thread {
  display: flex; flex-direction: column;
  min-width: 0;
}
.convo__header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.convo__header-info { min-width: 0; }
.convo__header-name {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
}
.convo__header-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.15rem;
}
.convo__header-actions { display: flex; gap: 0.35rem; }
.convo__pill {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(91, 216, 246, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(91, 216, 246, 0.28);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.convo__pill.magenta { background: rgba(199, 125, 235, 0.12); color: var(--magenta); border-color: rgba(199, 125, 235, 0.28); }

.convo__messages {
  flex: 1;
  padding: 1rem;
  display: flex; flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
}
.convo__msg {
  max-width: 78%;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.45;
}
.convo__msg--in {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  align-self: flex-start;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.convo__msg--out {
  background: linear-gradient(135deg, rgba(91, 216, 246, 0.14), rgba(199, 125, 235, 0.14));
  border: 1px solid rgba(91, 216, 246, 0.32);
  color: var(--text);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.convo__msg--system {
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-align: center;
  align-self: center;
  padding: 0.35rem 0.85rem;
  border: 1px dashed var(--border);
  border-radius: 999px;
  text-transform: uppercase;
}
.convo__meta {
  font-size: 0.66rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.25rem;
  display: block;
}
.convo__msg--out .convo__meta { text-align: right; }

.convo__compose {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: rgba(255,255,255,0.01);
}
.convo__compose input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
}
.convo__compose button {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: var(--brand-gradient);
  color: var(--bg);
  border: 0;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

/* Reputation */
.dash__rep {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1rem;
}
@media (max-width: 820px) { .dash__rep { grid-template-columns: 1fr; } }

.rep-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
}
.rep-card h4 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.85rem;
}

.rep-stars {
  color: #FFC96B;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}
.rep-review {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 0.7rem;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.78rem;
}
.rep-review:last-child { border-bottom: 0; }
.rep-review__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}
.rep-review__name { color: var(--text); font-weight: 500; }
.rep-review__body { color: var(--text-dim); margin-top: 0.35rem; line-height: 1.5; }
.rep-review__meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.35rem;
}
.rep-review__source {
  display: inline-block;
  padding: 0.14rem 0.42rem;
  background: rgba(91, 216, 246, 0.10);
  color: var(--cyan);
  border-radius: 4px;
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  margin-left: 0.5rem;
}

.rep-workflow { display: flex; flex-direction: column; gap: 0.55rem; }
.rep-flow-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.76rem;
}
.rep-flow-item__step {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--cyan);
  color: var(--cyan);
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.rep-flow-item.done .rep-flow-item__step {
  background: var(--cyan); color: var(--bg);
}
.rep-flow-item.done .rep-flow-item__step::before { content: "✓"; font-size: 0.75rem; }
.rep-flow-item.done .rep-flow-item__step-num { display: none; }
.rep-flow-item.pending { opacity: 0.65; }
.rep-flow-item.pending .rep-flow-item__step { border-color: var(--text-muted); color: var(--text-muted); }
.rep-flow-item__title { color: var(--text); font-weight: 500; font-size: 0.76rem; }
.rep-flow-item__sub { color: var(--text-muted); font-size: 0.68rem; font-family: var(--font-mono); margin-top: 0.15rem; }
.rep-flow-item__time {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-muted);
}

/* Interactive quiz cards (self-assessment for contractors) */
.quiz-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.quiz-card {
  padding: 1.5rem;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 220ms var(--ease-out);
  position: relative;
}
.quiz-card:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 0 32px -8px rgba(91, 216, 246, 0.25);
}
.quiz-card__num {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}
.quiz-card__q {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--text);
  font-weight: 500;
  margin: 0 0 0.75rem;
  letter-spacing: -0.008em;
}
.quiz-card__a {
  font-size: 0.87rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
}
.quiz-card input[type="checkbox"] {
  position: absolute;
  top: 1rem; right: 1rem;
  appearance: none;
  width: 20px; height: 20px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  transition: all 200ms;
}
.quiz-card input[type="checkbox"]:checked {
  background: var(--cyan);
  border-color: var(--cyan);
}
.quiz-card input[type="checkbox"]:checked::after {
  content: "✓";
  color: var(--bg);
  font-weight: 700;
  font-size: 0.85rem;
  display: block;
  text-align: center;
  line-height: 17px;
}
.quiz-result {
  margin-top: 2rem;
  padding: 1.5rem 1.75rem;
  background: linear-gradient(135deg, rgba(91, 216, 246, 0.10), rgba(199, 125, 235, 0.10));
  border: 1px solid rgba(91, 216, 246, 0.32);
  border-radius: 10px;
  display: none;
}
.quiz-result.visible { display: block; }
.quiz-result__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--cyan);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}
.quiz-result__title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--text);
  margin: 0 0 0.75rem;
  line-height: 1.25;
  font-weight: 500;
}
.quiz-result__body {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 1.25rem;
}
.quiz-result__cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }
