/* Dashboard tab (admin) */

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.dash-panels-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

#dashPanel {
  margin-top: 10px;
}

.dash-kpi {
  border: 1px solid var(--admin-border);
  border-radius: var(--r);
  padding: 10px 10px;
  background: #fff;
  min-width: 0;
}

.dash-kpi-k {
  font-size: 12px;
  color: var(--admin-muted);
  font-weight: 650;
}

.dash-kpi-v {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-kpi-v.is-pos {
  color: #14a76c;
}

.dash-kpi-v.is-neg {
  color: #d12b2b;
}

.dash-kpi-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--admin-muted);
}

.panel-sub {
  border: 1px solid var(--admin-border);
  border-radius: var(--r);
  background: #fff;
  padding: 10px 10px;
}

.dash-chart-card {
  display: grid;
  gap: 10px;
}

.dash-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.dash-chart-copy {
  min-width: 0;
}

.dash-chart-title {
  font-weight: 800;
  font-size: 13px;
}

.dash-chart-meta {
  font-size: 12px;
  color: var(--admin-muted);
  margin-top: 4px;
}

.dash-chart-body {
  min-width: 0;
}

.dash-canvas {
  width: 100%;
  display: block;
  height: 240px;
}

.dash-series {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.dash-series-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(96, 100, 108, 0.22);
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  color: var(--admin-text);
}

.dash-series-btn.is-on[data-ads-legend="ad_spend"] {
  border-color: rgba(11, 99, 255, 0.55);
  background: rgba(11, 99, 255, 0.10);
}

.dash-series-btn:not(.is-on) {
  opacity: 0.55;
}

.dash-mode-tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: #f3f4f6;
  gap: 4px;
}

.dash-mode-tab {
  border: none;
  background: transparent;
  color: var(--admin-muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.dash-mode-tab.is-on {
  background: #fff;
  color: var(--admin-text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.dash-ads-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dash-chart-wrap {
  position: relative;
  padding-top: 2px;
}

.dash-tooltip {
  position: fixed;
  pointer-events: none;
  transform: translate(-50%, -100%);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(96, 100, 108, 0.22);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  font-size: 12px;
  color: var(--admin-text);
  white-space: nowrap;
  z-index: 4000;
}

.dash-tooltip .t-date {
  font-weight: 800;
  margin-bottom: 2px;
}

.dash-tooltip .t-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-tooltip .t-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.dash-tooltip .t-val {
  font-weight: 800;
}

.dash-empty,
.dash-loading {
  margin-top: 10px;
  color: var(--admin-muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .dash-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-ads-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .dash-chart-head {
    flex-direction: column;
    align-items: stretch;
  }

  .dash-mode-tabs {
    width: 100%;
  }

  .dash-mode-tab {
    flex: 1 1 0;
  }

  .dash-ads-kpis {
    grid-template-columns: 1fr;
  }
}
