.cd-dashboard {
  --cd-accent: var(--accent, #397fe5);
  --cd-ink: var(--ink, #1b2437);
  --cd-muted: var(--muted, #64748b);
  --cd-line: var(--line, #e8eaf3);
  color: var(--cd-ink);
  max-width: 1450px;
  margin: 0 auto;
  padding: 5px 0 12px;
}
.cd-dashboard button, .cd-dashboard select { font: inherit; }
.cd-dashboard button { cursor: pointer; }
.cd-dashboard button:focus-visible, .cd-dashboard select:focus-visible { outline: 2px solid var(--cd-accent); outline-offset: 2px; }
.cd-dashboard svg { flex-shrink: 0; }
.cd-header { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 15px; }
.cd-header h1 { font-size: clamp(24px, 2.7vw, 34px); line-height: 1.2; margin: 0 0 6px; letter-spacing: -.035em; font-weight: 740; }
.cd-header p { color: var(--cd-muted); margin: 0; font-size: 13px; }
.cd-period {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
  color: var(--cd-muted);
}
.cd-period svg { width: 15px; height: 15px; }
.cd-period select {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cd-ink);
  padding: 5px 0;
  font-size: 12px;
  font-weight: 650;
  outline: none;
}
.cd-period:focus-within { border-color: var(--cd-accent); }
.cd-period select:focus-visible { outline: none; }
.cd-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.cd-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 19px; }
.cd-shortcuts button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--cd-line);
  border-radius: 8px;
  background: white;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 650;
}
.cd-shortcuts button:hover { background: var(--accent-soft); border-color: #d9d1f4; }
.cd-shortcuts svg { width: 15px; height: 15px; }
.cd-shortcuts svg:last-child { margin-left: 2px; opacity: .8; }
.cd-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.cd-card { border: 1px solid var(--cd-line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); min-width: 0; }
.cd-stat { display: flex; gap: 12px; align-items: start; padding: 16px 15px; }
.cd-stat > div { display: grid; gap: 5px; min-width: 0; }
.cd-stat-icon { display: inline-grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 9px; }
.cd-blue { background: #e8f2ff; color: #347edc; }
.cd-green { background: #e5f7ee; color: #20835e; }
.cd-purple { background: #f0ebff; color: #7857cf; }
.cd-amber { background: #fff4e2; color: #a86c13; }
.cd-stat-label { font-size: 12px; font-weight: 650; color: var(--cd-muted); line-height: 1.3; }
.cd-stat strong { font-size: 31px; letter-spacing: -.04em; line-height: 1.1; }
.cd-stat-detail { color: var(--cd-muted); font-size: 11px; line-height: 1.4; }
.cd-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(230px, 1fr); gap: 15px; align-items: stretch; }
.cd-card-header { display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.cd-card-header h2 { margin: 0 0 4px; font-size: 16px; line-height: 1.35; font-weight: 730; letter-spacing: -.01em; }
.cd-card-header p { margin: 0; color: var(--cd-muted); font-size: 11px; line-height: 1.4; }
.cd-lifecycle, .cd-chart-card, .cd-channel, .cd-recent { padding: 18px; }
.cd-bars { display: grid; gap: 18px; margin-top: 22px; }
.cd-bar-row > div:first-child { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; align-items: baseline; font-size: 12px; font-weight: 650; }
.cd-bar-row strong { font-size: 14px; }
.cd-bar-row small { margin-left: 5px; color: #277756; background: #e6f7ee; padding: 3px 5px; border-radius: 4px; font-size: 10px; }
.cd-track { height: 11px; border-radius: 4px; overflow: hidden; background: #eaf0f8; }
.cd-track > span { display: block; width: var(--cd-bar); height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--cd-accent), #a396ef); }
.cd-bar-bot .cd-track > span { background: linear-gradient(90deg, #32a876, #75cf9f); }
.cd-lifecycle-foot {
  margin-top: 17px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--cd-line);
  padding-top: 13px;
  color: var(--cd-muted);
  font-size: 11px;
}
.cd-lifecycle-foot > span, .cd-chart-legend > span { display: flex; align-items: center; gap: 6px; }
.cd-lifecycle-foot i, .cd-chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cd-accent); }
.cd-lifecycle-foot > span:nth-of-type(2) i { background: #9aabc2; }
.cd-lifecycle-foot button { margin-left: auto; padding: 0; color: var(--accent-dark); background: transparent; border: 0; display: flex; gap: 5px; align-items: center; font-size: 11px; font-weight: 720; }
.cd-lifecycle-foot button:hover { text-decoration: underline; }
.cd-lifecycle-foot button svg { width: 13px; height: 13px; }
.cd-channel-line { display: flex; align-items: center; gap: 9px; margin-top: 23px; border: 1px solid var(--cd-line); border-radius: 9px; padding: 9px; }
.cd-channel-line > div { flex: 1; min-width: 0; display: grid; gap: 3px; }
.cd-channel-line strong { font-size: 12px; }
.cd-channel-line > div span { color: var(--cd-muted); font-size: 10px; }
.cd-status { color: #526784; font-size: 9px; background: #eef2f8; border-radius: 99px; padding: 4px 7px; font-weight: 690; }
.cd-status.cd-connected { background: #e4f7ed; color: #247a53; }
.cd-channel-action {
  margin-top: 12px;
  width: 100%;
  min-height: 37px;
  border: 0;
  border-radius: 7px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 8px 10px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px !important;
  font-weight: 700 !important;
}
.cd-channel-action:hover { background: #e4ddff; }
.cd-channel-action svg { width: 14px; height: 14px; }
.cd-channel-action svg:last-child { margin-left: auto; }
.cd-chart-legend { display: flex; gap: 16px; font-size: 11px; color: var(--cd-muted); margin-top: 15px; }
.cd-chart-legend > span:nth-child(2) i { background: #208661; }
.cd-chart { display: block; width: 100%; height: auto; margin-top: 8px; overflow: visible; }
.cd-chart text { font: 11px system-ui, sans-serif; fill: #71829a; }
.cd-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cd-line.cd-in { stroke: var(--cd-accent); }
.cd-line.cd-out { stroke: #208661; }
.cd-dot { stroke: #fff; stroke-width: 1.25; }
.cd-dot.cd-in { fill: var(--cd-accent); }
.cd-dot.cd-out { fill: #208661; }
.cd-events { margin-top: 11px; }
.cd-event {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--cd-line);
  color: var(--cd-ink);
  text-align: left;
}
.cd-event:last-child { border-bottom: 0; }
.cd-event:hover { background: #f6f9fd; }
.cd-avatar { width: 28px; height: 28px; border-radius: 50%; background: #e9f2ff; color: #3976c5; font-size: 9px; font-weight: 750; display: grid; place-items: center; flex: 0 0 auto; }
.cd-event-person { min-width: 0; flex: 1; display: grid; gap: 2px; }
.cd-event-person strong { font-size: 11px; }
.cd-event-person > span, .cd-event time { color: var(--cd-muted); font-size: 10px; }
.cd-event-person > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-event time { white-space: nowrap; }
.cd-empty { margin: 22px 0; color: var(--cd-muted); font-size: 12px; }
@media (max-width: 1060px) {
  .cd-dashboard { padding: 12px 0 22px; }
  .cd-stat { display: grid; gap: 8px; }
  .cd-stat-icon { width: 32px; height: 32px; }
  .cd-grid { grid-template-columns: minmax(0, 1.5fr) minmax(205px, 1fr); }
}
@media (max-width: 760px) {
  .cd-dashboard { padding: 0; }
  .cd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .cd-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .cd-stat { display: flex; }
  .cd-header { align-items: start; }
  .cd-header p { font-size: 11px; }
  .cd-period { gap: 5px; padding: 0 7px; }
  .cd-period select { font-size: 11px; }
  .cd-period svg:last-child { display: none; }
}

@media (max-width: 430px) {
  .cd-header { flex-wrap: wrap; }
  .cd-shortcuts button { min-height: 40px; }
  .cd-stat { padding: 11px 9px; gap: 7px; }
  .cd-stat-icon { width: 27px; height: 27px; }
  .cd-stat-icon svg { width: 15px; height: 15px; }
  .cd-stat strong { font-size: 26px; }
  .cd-stat-detail { font-size: 10px; }
  .cd-card:not(.cd-stat) { padding: 13px; }
}
