:root {
  --ink: #14223a;
  --muted: #75839b;
  --line: #e8edf5;
  --bg: #f5f7fb;
  --blue: #2d6cff;
  --cyan: #14b8c8;
  --orange: #ff9f2d;
  --red: #ec5d67;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
button,
input,
select {
  font: inherit;
}
[hidden] {
  display: none !important;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 25% 20%, #dbeafe, transparent 30%), #f7f9fd;
}
.login-card {
  width: min(440px, 100%);
  padding: 42px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 55px #1d3a6b18;
}
.mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.login-card h1,
header h1 {
  margin: 0;
  font-size: 30px;
}
.login-card p {
  color: var(--muted);
  line-height: 1.65;
}
.login-card form {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}
.login-card input,
.filterbar input,
.filterbar select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
}
.login-card button {
  border: 0;
  border-radius: 10px;
  padding: 12px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}
.login-card small {
  display: block;
  min-height: 18px;
  color: var(--red);
  margin-top: 8px;
}
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  width: 250px;
  padding: 28px 16px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 10px 24px;
}
.brand > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--blue);
  color: white;
  font-weight: 800;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
nav {
  display: grid;
  gap: 4px;
}
.nav-label {
  margin: 15px 10px 4px;
  color: #a0aabc;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.nav-label:first-child {
  margin-top: 0;
}
.nav-item {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  color: #68758c;
  font-weight: 650;
  cursor: pointer;
}
.nav-item.sub-item {
  padding-left: 27px;
  font-size: 13px;
}
.nav-item:hover {
  background: #f5f8ff;
  color: var(--blue);
}
.nav-item.active {
  color: var(--blue);
  background: #edf3ff;
}
.logout {
  margin-top: 22px;
  border: 1px solid var(--line);
  background: #fff;
  color: #617087;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
}
.workspace {
  padding: 34px;
  max-width: 1600px;
  width: 100%;
  margin: auto;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.export {
  border: 1px solid #d5e0f6;
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  color: #245ee8;
  font-weight: 700;
  cursor: pointer;
}
.page-hint {
  margin: 8px 0 0;
  color: #52627a;
  font-size: 14px;
}
.muted {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.health {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: #eafaf2;
  color: #168451;
  font-size: 12px;
  font-weight: 700;
}
.health i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1fbd75;
}
.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 18px;
}
.filterbar label {
  display: grid;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.filterbar button {
  align-self: end;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 11px 16px;
  color: #536279;
  cursor: pointer;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.metric p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 26px;
  letter-spacing: -0.04em;
}
.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}
.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.grid.two {
  grid-template-columns: 1.15fr 0.85fr;
}
.grid.one {
  grid-template-columns: 1fr;
}
.panel {
  min-height: 310px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.grid.one .panel {
  min-height: auto;
}
.panel-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
}
.panel h2 {
  margin: 0;
  font-size: 17px;
}
.panel-title > span {
  padding: 5px 8px;
  background: #f3f6fb;
  color: #637187;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
}
.trend {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 220px;
  padding: 26px 0 8px;
  border-bottom: 1px solid var(--line);
}
.trend-col {
  height: 100%;
  flex: 1;
  display: flex;
  align-items: end;
  gap: 2px;
  position: relative;
}
.trend-col span {
  flex: 1;
  border-radius: 5px 5px 0 0;
  min-height: 3px;
}
.trend-col .spend {
  background: #9cbcff;
}
.trend-col .sales {
  background: var(--blue);
}
.trend-col label {
  position: absolute;
  bottom: -22px;
  width: 100%;
  font-size: 10px;
  color: #8793a7;
  text-align: center;
}
.bar-chart {
  display: grid;
  gap: 16px;
  margin-top: 29px;
}
.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 68px;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}
.bar-row b {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inline-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #245ee8;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inline-link:hover {
  text-decoration: underline;
}
.track {
  height: 9px;
  border-radius: 99px;
  background: #edf1f7;
  overflow: hidden;
}
.fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
}
.bar-row em {
  font-style: normal;
  text-align: right;
  color: #52627a;
  font-weight: 700;
}
.alerts {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.alert {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.alert i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}
.alert.urgent i {
  background: var(--red);
}
.alert b {
  font-size: 13px;
}
.alert span {
  color: var(--muted);
  font-size: 11px;
}
.alert em {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  color: #516178;
}
.empty-state {
  margin-top: 28px;
}
.empty-card,
.scope-note {
  margin-top: 28px;
  padding: 18px;
  border-radius: 12px;
  background: #f7f9fd;
  color: #52627a;
  line-height: 1.7;
  font-size: 13px;
}
.empty-card b {
  color: var(--ink);
}
.empty-card p {
  margin: 8px 0 0;
}
.table-wrap {
  overflow: auto;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 780px;
  font-size: 12px;
}
th,
td {
  padding: 11px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
th {
  position: sticky;
  top: 0;
  background: #f7f9fd;
  color: #5c6a80;
  font-size: 11px;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.status-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.status-list > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.status-list > div:last-child {
  border-bottom: 0;
}
.status-list b {
  font-size: 13px;
}
.status-list small {
  grid-column: 1/-1;
  color: var(--muted);
  font-size: 12px;
}
.status {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  background: #fff0db;
  color: #b76d09;
}
.status.ready {
  background: #eafaf2;
  color: #168451;
}
.monitor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.monitor-card {
  min-height: 156px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.monitor-card.has-alert {
  border-color: #ffd9b7;
  background: #fffdf9;
}
.monitor-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.monitor-card strong {
  display: block;
  margin: 8px 0;
  font-size: 28px;
}
.monitor-card span {
  display: -webkit-box;
  overflow: hidden;
  min-height: 32px;
  color: #67758c;
  font-size: 11px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.monitor-link {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.query-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.query-tools label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.query-tools input,
.query-tools select {
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}
.nav-item.new-module {
  color: #315d9f;
  background: #f6f9ff;
}
.nav-item.new-module.active {
  color: #fff;
  background: linear-gradient(100deg, var(--blue), #45a8ed);
}
.bmbi-banner {
  padding: 18px 20px;
  margin-bottom: 16px;
  border-radius: 16px;
  color: #17325d;
  background: linear-gradient(110deg, #eaf5ff, #edf0ff);
  border: 1px solid #dce9fb;
}
.bmbi-banner b {
  font-size: 18px;
}
.bmbi-banner p {
  margin: 6px 0 0;
  color: #62728b;
  font-size: 12px;
}
.bmbi-warning {
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid #ffdda0;
  border-radius: 10px;
  background: #fff8e9;
  color: #8a641c;
  font-size: 12px;
}
.channel-grid,
.goal-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(165px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.channel-card,
.goal-card {
  min-height: 172px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.channel-card {
  position: relative;
  overflow: hidden;
}
.channel-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--blue);
}
.channel-card:nth-child(2)::before { background: var(--cyan); }
.channel-card:nth-child(3)::before { background: #7c72ed; }
.channel-card:nth-child(4)::before { background: var(--orange); }
.channel-card:nth-child(5)::before { background: #20b77a; }
.channel-card p,
.goal-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.channel-card strong {
  display: block;
  margin-top: 16px;
  font-size: 24px;
}
.channel-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}
.data-tag {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 7px;
  border-radius: 6px;
  background: #edf7f3;
  color: #198b60;
  font-size: 10px;
  font-weight: 800;
}
.data-tag.missing {
  background: #fff2db;
  color: #a26910;
}
.node-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12px;
}
.node-pill {
  padding: 7px 10px;
  border-radius: 8px;
  background: #f1f5fb;
  color: #53637b;
}
.node-arrow { color: #9da9ba; }
.goal-grid { grid-template-columns: repeat(4, minmax(210px, 1fr)); }
.target-section {
  padding: 18px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.target-section .goal-grid { margin-bottom: 0; }
.target-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.target-section-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}
.target-section-head span {
  color: var(--muted);
  font-size: 11px;
}
.goal-body {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
}
.goal-ring {
  --progress: 0deg;
  width: 92px;
  height: 92px;
  flex: 0 0 92px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  background: conic-gradient(#55c2ed 0deg, var(--blue) var(--progress), #edf1f5 var(--progress) 360deg);
}
.goal-ring::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: #fff;
}
.goal-ring span {
  position: relative;
  text-align: center;
  font-size: 16px;
  font-weight: 900;
}
.goal-ring small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}
.goal-card.missing .goal-ring { background: #edf1f5; }
.goal-values {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}
.goal-values strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 14px;
}
.goal-values small {
  display: block;
  max-width: 150px;
  margin-top: 2px;
  color: #8a98ac;
  font-size: 9px;
  line-height: 1.35;
}
.daily-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.daily-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.daily-toolbar input {
  min-width: 170px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.daily-toolbar span {
  padding: 10px 12px;
  color: #52627a;
  font-size: 12px;
}
.daily-report-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 9px;
  margin-bottom: 16px;
}
.daily-group {
  overflow: hidden;
  border: 1px solid #dce8f5;
  border-radius: 12px;
  background: #f8fbff;
}
.daily-group-head {
  padding: 14px 16px;
  border-bottom: 1px solid #dce8f5;
  color: #4c5d74;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.bmbi-line-chart {
  margin-top: 14px;
  min-height: 278px;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: #536987;
  font-size: 12px;
}

.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trend-legend i {
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.bmbi-line-chart svg {
  display: block;
  width: 100%;
  height: 230px;
  overflow: visible;
}

.line-grid {
  stroke: #e8eef7;
  stroke-width: 1;
}

.line-series {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.line-dates {
  position: relative;
  height: 20px;
  margin: -24px 0 0;
  color: #8292aa;
  font-size: 10px;
}

.line-dates span {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}
.daily-cell {
  min-height: 104px;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid #dce8f5;
}
.daily-cell:last-child { border-bottom: 0; }
.daily-cell p {
  margin: 0;
  color: #5e6d82;
  font-size: 11px;
}
.daily-cell strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 23px;
}
.daily-cell small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}
.daily-cell.empty strong {
  color: #9aa6b8;
  font-size: 14px;
  font-weight: 600;
}
@media (max-width: 960px) {
  .sidebar {
    display: none;
  }
  .workspace {
    padding: 20px;
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid.two {
    grid-template-columns: 1fr;
  }
  header {
    gap: 12px;
    flex-direction: column;
  }
  .bar-row {
    grid-template-columns: 100px 1fr 60px;
  }
  .monitor-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .channel-grid,
  .goal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .daily-report-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 500px) {
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .filterbar > * {
    width: 100%;
  }
  .filterbar button {
    width: 100%;
  }
  .monitor-grid {
    grid-template-columns: 1fr;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .query-tools > * {
    width: 100%;
  }
  .query-tools input,
  .query-tools select {
    width: 100%;
  }
  .channel-grid,
  .goal-grid {
    grid-template-columns: 1fr;
  }
  .daily-report-grid {
    grid-template-columns: 1fr;
  }
}
