/* Salesgem dashboard mock — analytics overview */
.dash {
  display: flex; flex-direction: column;
  height: 540px;
  background: #FAFAF7;
  font-size: 12px;
  color: var(--ink);
  overflow: hidden;
}

/* dark top bar */
.dash-bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 44px; padding: 0 16px;
  background: #0E1A1E;
  color: white;
  flex-shrink: 0;
}
.dash-bar-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px; letter-spacing: -0.01em;
}
.dash-logo-mark { display: grid; place-items: center; }
.dash-bar-icons { display: flex; align-items: center; gap: 14px; color: rgba(255,255,255,0.85); }
.dbi { display: grid; place-items: center; cursor: pointer; }
.dbi-wa { color: #25D366; }
.dbi-av {
  width: 26px; height: 26px; border-radius: 999px;
  background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
  border: 1px solid rgba(255,255,255,0.2);
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700; color: white; letter-spacing: 0.02em;
  cursor: pointer;
}

/* secondary tabs */
.dash-tabs2 {
  display: flex; align-items: center; gap: 4px;
  padding: 0 16px;
  height: 38px;
  background: white;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.dt2-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  font-size: 12px; font-weight: 500;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.dt2-tab .dt2-ic {
  width: 12px; height: 12px; border-radius: 3px;
  background: currentColor; opacity: 0.4;
}
.dt2-tab.active {
  color: var(--teal-600);
  font-weight: 600;
}
.dt2-tab.active::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: -8px;
  height: 2px; background: var(--teal-500); border-radius: 2px;
}
.dt2-tab.active .dt2-ic { background: var(--teal-500); opacity: 1; }

/* body grid */
.dash-body { display: grid; grid-template-columns: 168px 1fr; flex: 1; min-height: 0; }

/* left rail */
.dash-rail {
  background: white;
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  display: flex; flex-direction: column; gap: 18px;
}
.dr-group { display: flex; flex-direction: column; gap: 2px; }
.dr-title {
  font-size: 10px; font-weight: 600;
  color: var(--muted-2);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 8px 6px;
}
.dr-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px;
  font-size: 12px; font-weight: 500;
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.dr-item.active {
  background: #E6F4F1;
  color: var(--teal-600);
  font-weight: 600;
}
.dr-dot {
  width: 14px; height: 14px; border-radius: 4px;
  flex-shrink: 0;
}
.dr-dot.teal { background: var(--teal-500); }
.dr-dot.peach { background: #F6A089; }
.dr-dot.mute { background: #C9CFC9; }
.dr-dot.warn { background: #F6A089; opacity: 0.85; }
.dr-badge {
  margin-left: auto;
  background: #FF7B5C; color: white;
  font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px;
  min-width: 22px; text-align: center;
}
.dr-badge.mute {
  background: #FFE6DE; color: #B25500;
}

/* main */
.dash-main {
  padding: 16px 18px;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 14px;
  min-width: 0;
}
.dm-head h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 2px; }
.dm-head p { font-size: 12px; color: var(--muted); }

/* kpi tiles */
.dm-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.kpi {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.kpi-l {
  font-size: 9px; font-weight: 600;
  color: var(--muted-2);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.kpi-v { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.kpi-v.accent { color: var(--teal-600); }
.kpi-s { font-size: 10px; color: var(--muted); }

/* row of cards */
.dm-row {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px;
  flex: 1; min-height: 0;
}
.dm-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0; min-height: 0;
}
.dm-card-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}
.dm-card-h b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.dm-toggle {
  display: flex;
  background: #F4F4EE;
  border-radius: 6px; padding: 2px;
  flex-shrink: 0;
}
.dm-toggle span {
  font-size: 10px; font-weight: 500;
  padding: 3px 8px; border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.dm-toggle span.active {
  background: white; color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* chart fills available height */
.dm-chart .dash-chart {
  width: 100%; flex: 1;
  display: block;
}

/* sales activities */
.dm-acts { gap: 6px; }
.act-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.act-row:last-child { border-bottom: none; }
.act-ic {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: #E6F4F1;
  flex-shrink: 0;
  position: relative;
}
.act-ic::after {
  content: ""; position: absolute; inset: 7px;
  border: 1.6px solid var(--teal-600); border-radius: 3px;
}
.act-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.act-text b { font-size: 12px; font-weight: 600; }
.act-text span { font-size: 10px; color: var(--muted); }
.act-end { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.act-end b { font-size: 14px; font-weight: 700; color: #C9CFC9; }
.act-end span { font-size: 10px; color: var(--muted-2); }

@media (max-width: 800px) {
  .dash { height: 480px; }
  .dash-rail { display: none; }
  .dash-body { grid-template-columns: 1fr; }
  .dm-kpis { grid-template-columns: repeat(2, 1fr); }
  .dm-row { grid-template-columns: 1fr; }
  .dt2-tab:nth-child(n+5) { display: none; }
}
