:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6e727a;
  --line: #e2e5ea;
  --blue: #2f80ed;
  --green: #1f9d72;
  --red: #d94b4b;
  --shadow: 0 10px 24px rgba(27, 39, 66, .07);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }

.login-body { min-height: 100vh; display: grid; place-items: center; background: #eef2f7; }
.login-panel { width: min(390px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 34px; box-shadow: var(--shadow); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; background: #1d1d1f; color: #fff; border-radius: 8px; font-weight: 800; letter-spacing: .5px; }
.login-panel h1 { margin: 18px 0 6px; font-size: 26px; }
.login-panel p { margin: 0 0 24px; color: var(--muted); }
.login-panel label { display: block; margin: 14px 0 7px; color: #4d5158; font-size: 14px; }
.login-panel input { width: 100%; border: 1px solid var(--line); border-radius: 6px; height: 42px; padding: 0 12px; background: #fbfcfd; }
.login-panel button { width: 100%; height: 42px; margin-top: 22px; border: 0; border-radius: 6px; background: var(--blue); color: #fff; cursor: pointer; }
.form-error { min-height: 20px; margin-top: 12px; color: var(--red); font-size: 13px; }
.login-help { color: var(--muted); font-size: 12px; line-height: 1.7; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 28px 36px 14px; }
.eyebrow { color: var(--muted); font-size: 13px; }
h1 { margin: 4px 0 0; font-size: 28px; letter-spacing: 0; }
.top-actions { display: flex; align-items: center; gap: 10px; color: var(--muted); flex-wrap: wrap; }
.ghost { height: 34px; padding: 0 13px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; color: #333840; }
.primary { height: 36px; padding: 0 16px; border: 0; background: var(--blue); color: #fff; border-radius: 6px; cursor: pointer; }
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; font-size: 20px; line-height: 1; }

.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(20, 26, 38, .35); }
.modal[hidden] { display: none; }
.modal-panel { width: min(440px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 18px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-panel label { display: grid; gap: 6px; margin: 12px 0; color: var(--muted); font-size: 13px; }
.modal-panel input, .modal-panel select { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); padding: 0 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }

.filters { display: flex; gap: 14px; flex-wrap: wrap; padding: 12px 36px 18px; }
.filters label { display: grid; gap: 6px; min-width: 190px; color: var(--muted); font-size: 13px; }
.filters select { height: 38px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 0 10px; color: var(--text); }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px; padding: 0 36px 18px; }
.kpis article, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.kpis article { padding: 18px; }
.kpis span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.kpis strong { font-size: 24px; font-weight: 750; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 36px 14px; }
.panel { margin: 0 36px 14px; padding: 18px; }
.grid .panel { margin: 0; }
.section-block { padding-top: 2px; }
.section-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 10px 36px 12px; }
.inline-title { padding: 0 0 12px; }
.section-title h2 { margin: 0; font-size: 20px; }
.section-title span { color: var(--muted); font-size: 13px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-size: 17px; }
.panel-head span { color: var(--muted); font-size: 13px; }

.bars { display: grid; gap: 10px; min-height: 180px; align-content: start; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 96px; gap: 10px; align-items: center; font-size: 13px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3d424a; }
.bar-track { height: 10px; border-radius: 999px; background: #edf0f4; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--blue); min-width: 2px; }
.bar-value { text-align: right; color: #3d424a; font-variant-numeric: tabular-nums; }
.compact { grid-template-columns: 1fr 1fr; column-gap: 22px; }

.analysis-panel { margin: 0 36px 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.analysis-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.analysis-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fbfcfd; }
.analysis-card h3 { margin: 0 0 10px; font-size: 15px; color: #303640; }
.analysis-card ul { margin: 0; padding-left: 18px; color: #424852; line-height: 1.7; font-size: 13px; }
.analysis-card li + li { margin-top: 6px; }

.mini-table { display: grid; gap: 14px; max-height: 520px; overflow: auto; padding-right: 4px; }
.metric-group { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.metric-group h3 { margin: 0; padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid var(--line); font-size: 14px; color: #3d424a; }
.metric-group table { min-width: 720px; }
.metric-group th, .metric-group td { padding: 8px 10px; }

.table-wrap { overflow: auto; max-height: 430px; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 1080px; background: #fff; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; font-size: 13px; white-space: nowrap; }
th { position: sticky; top: 0; background: #f8fafc; color: #555b64; z-index: 1; }
td:nth-child(1), td:nth-child(2), td:nth-child(3), td:nth-child(4), td:nth-child(5), td:nth-child(6),
th:nth-child(1), th:nth-child(2), th:nth-child(3), th:nth-child(4), th:nth-child(5), th:nth-child(6) { text-align: left; }
.negative { color: var(--red); }
.positive { color: var(--green); }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.hide-profit .profit-amount-only, .hide-profit .profit-amount-col { display: none; }

@media (max-width: 980px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 22px 18px 10px; }
  .filters, .kpis, .grid { padding-left: 18px; padding-right: 18px; }
  .section-title { align-items: flex-start; flex-direction: column; padding-left: 18px; padding-right: 18px; }
  .inline-title { padding-left: 0; padding-right: 0; }
  .panel { margin-left: 18px; margin-right: 18px; }
  .analysis-panel { margin-left: 18px; margin-right: 18px; }
  .analysis-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
  .compact { grid-template-columns: 1fr; }
}

/* Data-screen refresh */
:root {
  --bg: #07111f;
  --surface: rgba(23, 48, 88, .82);
  --surface-strong: rgba(28, 63, 116, .92);
  --text: #f6f8ff;
  --muted: #9fb0ca;
  --line: rgba(132, 162, 208, .2);
  --blue: #58a6ff;
  --green: #54d2c7;
  --red: #ff6b7a;
  --accent: #ffc400;
  --pink: #ff4fa3;
  --shadow: 0 18px 50px rgba(0, 0, 0, .26);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 196, 0, .14), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(84, 210, 199, .16), transparent 28%),
    linear-gradient(180deg, #030812 0%, #07111f 42%, #09192e 100%);
  color: var(--text);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 22px 30px 14px;
  border-bottom: 1px solid rgba(255, 196, 0, .42);
  background: rgba(3, 8, 18, .88);
  backdrop-filter: blur(18px);
}

.brand-title { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1 1 auto; }
.topbar .brand-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #06101e;
  background: linear-gradient(135deg, #ffe27a, #ffc400 54%, #ff9f1a);
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 12px 30px rgba(255, 196, 0, .22);
}

.eyebrow { color: #f8c84b; letter-spacing: .04em; }
h1 {
  font-size: clamp(24px, 2.35vw, 32px);
  font-weight: 760;
  color: #fff;
  white-space: nowrap;
}

.top-actions { color: #c9d5ea; justify-content: flex-end; flex: 0 0 auto; }
.ghost, .primary, .login-panel button {
  height: 32px;
  padding-left: 10px;
  padding-right: 10px;
  border-color: rgba(255, 196, 0, .28);
  background: rgba(26, 57, 105, .72);
  color: #f6f8ff;
}
.ghost:hover, .primary:hover { background: rgba(255, 196, 0, .18); border-color: rgba(255, 196, 0, .66); }
.primary { background: linear-gradient(135deg, #ffc400, #ff9f1a); color: #07111f; font-weight: 700; }

.dashboard-band, .filters {
  margin: 14px 30px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(17, 37, 70, .58);
  box-shadow: var(--shadow);
}
.filters label { color: #f8c84b; min-width: 160px; }
.filters select,
.modal-panel input,
.modal-panel select,
.login-panel input {
  border-color: rgba(132, 162, 208, .28);
  background: rgba(8, 20, 38, .88);
  color: var(--text);
}
.filters select[multiple] {
  height: 92px;
  padding: 7px;
  overflow: auto;
}
.filters select[multiple] option {
  padding: 6px 8px;
  border-radius: 6px;
}

.kpis {
  padding: 0 30px 16px;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
}
.kpis article {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 18px 18px 16px 22px;
  border: 1px solid rgba(255, 196, 0, .22);
  background: linear-gradient(135deg, rgba(31, 70, 130, .92), rgba(18, 43, 81, .88));
}
.kpis article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 999px;
  background: var(--accent);
}
.kpis span { color: #f8c84b; font-weight: 700; }
.kpis strong { display: block; font-size: clamp(24px, 2.2vw, 34px); color: #fff; }
.kpis small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 14px;
  padding: 0 30px 14px;
}
.primary-chart-grid {
  grid-template-columns: 1fr;
}
.grid { padding-left: 30px; padding-right: 30px; }
.panel, .analysis-panel, .modal-panel, .login-panel {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.panel { margin-left: 30px; margin-right: 30px; }
.dashboard-grid .panel, .grid .panel { margin: 0; }
.panel-head h2, .section-title h2, .analysis-card h3 { color: #fff; }
.panel-head span, .section-title span { color: #aebbd3; }
.section-title { padding-left: 30px; padding-right: 30px; }

.analysis-panel { margin-left: 30px; margin-right: 30px; }
.analysis-card {
  border-color: rgba(132, 162, 208, .18);
  background: rgba(8, 20, 38, .42);
}
.analysis-card ul { color: #d8e2f4; }

.chart-svg { width: 100%; min-height: 260px; display: block; }
.chart-legend {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: 4px;
  color: #dbe7fb;
  font-size: 12px;
}
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { display: inline-block; }
.yoy-legend {
  gap: 12px;
  flex-wrap: wrap;
  row-gap: 6px;
}
.yoy-legend span {
  white-space: nowrap;
}
.legend-bar { width: 18px; height: 9px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #ff9f1a); }
.legend-line { width: 22px; height: 3px; border-radius: 999px; background: var(--green); }
.grid-line { stroke: rgba(210, 226, 255, .18); stroke-width: 1; stroke-dasharray: 3 5; }
.trend-line { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.line-area { opacity: .78; }
.line-point { fill: #fff; stroke: var(--accent); stroke-width: 3; }
.chart-label { fill: #dbe7fb; font-size: 12px; }
.value-label { fill: #fff; font-size: 9px; font-weight: 700; paint-order: stroke; stroke: rgba(11, 27, 51, .86); stroke-width: 3px; }
.rate-label { fill: #d7fff9; font-size: 9px; font-weight: 700; paint-order: stroke; stroke: rgba(11, 27, 51, .9); stroke-width: 3px; }
.axis-value { fill: #9fb0ca; font-size: 10px; }
.axis-title { fill: #f8c84b; font-size: 11px; font-weight: 700; }
.secondary-axis { fill: #54d2c7; }
.axis-label { fill: #9fb0ca; font-size: 11px; }
.column-bar { fill: var(--accent); filter: drop-shadow(0 8px 12px rgba(255, 196, 0, .18)); }
.column-bar:nth-of-type(2n) { fill: var(--green); }
.negative-fill { fill: var(--red); }
.combo-chart { min-height: 374px; }
.combo-svg { min-height: 352px; }
.combo-bar { fill: var(--accent); filter: drop-shadow(0 8px 14px rgba(255, 196, 0, .2)); }
.combo-rate-line { fill: none; stroke: var(--green); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.combo-rate-point { fill: #07111f; stroke: var(--green); stroke-width: 3; }

.donut-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: center; min-height: 240px; }
.donut-svg { width: 170px; height: 170px; }
.donut-bg { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 18; }
.donut-slice { fill: none; stroke-width: 18; pathLength: 100; stroke-linecap: round; }
.donut-total { fill: #fff; font-size: 15px; font-weight: 800; }
.donut-sub { fill: #9fb0ca; font-size: 11px; }
.donut-legend { display: grid; gap: 8px; }
.donut-legend-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; color: #dbe7fb; font-size: 12px; }
.donut-legend-item i { width: 10px; height: 10px; border-radius: 999px; }
.donut-legend-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend-item strong { color: #fff; font-variant-numeric: tabular-nums; }

.bars { min-height: 210px; }
.ranking-rest { margin-top: 14px; min-height: 84px; }
.bar-label { color: #dbe7fb; }
.bar-track { background: rgba(255, 255, 255, .1); }
.bar-fill { background: linear-gradient(90deg, var(--accent), #ff9f1a); }
.bar-value { color: #f6f8ff; }

.podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  min-height: 184px;
}
.podium-card {
  min-height: 138px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 16px 12px;
  border: 1px solid rgba(255, 196, 0, .28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 238, 187, .16), rgba(255, 255, 255, .04));
  text-align: center;
}
.podium-card.rank-1 {
  min-height: 172px;
  border-color: rgba(255, 196, 0, .66);
  background: linear-gradient(180deg, rgba(255, 196, 0, .28), rgba(255, 255, 255, .05));
  box-shadow: 0 18px 35px rgba(255, 196, 0, .14);
}
.podium-card.rank-2 { opacity: .88; }
.podium-card.rank-3 { opacity: .92; }
.podium-card h3 {
  max-width: 100%;
  margin: 0;
  color: #fff;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-card strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.podium-card span {
  color: #aebbd3;
  font-size: 12px;
}
.medal {
  min-width: 46px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #07111f;
  font-size: 11px;
  font-weight: 900;
}
.medal-1 { background: linear-gradient(135deg, #fff1a6, #ffc400); }
.medal-2 { background: linear-gradient(135deg, #eef3fb, #aebbd3); }
.medal-3 { background: linear-gradient(135deg, #ffd7b0, #ff9f5a); }

.metric-group { border-color: rgba(132, 162, 208, .18); background: rgba(8, 20, 38, .42); }
.metric-group h3 { background: rgba(255, 196, 0, .09); color: #fff; border-bottom-color: rgba(132, 162, 208, .18); }
.table-wrap { border-color: rgba(132, 162, 208, .18); }
table { background: rgba(8, 20, 38, .42); }
th { background: rgba(255, 196, 0, .1); color: #f8c84b; }
td, th { border-bottom-color: rgba(132, 162, 208, .14); }
td { color: #dbe7fb; }
.empty { color: var(--muted); }

.login-body { background: linear-gradient(180deg, #030812, #09192e); }
.login-panel p, .login-help, .modal-panel label { color: var(--muted); }

@media (max-width: 980px) {
  .topbar { padding-left: 18px; padding-right: 18px; }
  .brand-title { min-width: 0; align-items: flex-start; }
  h1 { white-space: normal; }
  .dashboard-band, .filters { margin-left: 18px; margin-right: 18px; }
  .dashboard-grid { grid-template-columns: 1fr; padding-left: 18px; padding-right: 18px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-left: 18px; padding-right: 18px; }
  .panel, .analysis-panel { margin-left: 18px; margin-right: 18px; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .podium { grid-template-columns: 1fr; align-items: stretch; }
  .podium-card, .podium-card.rank-1 { min-height: 128px; }
}

/* Light theme refresh */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #f8fafc;
  --text: #111827;
  --muted: #64748b;
  --line: #dbe3ee;
  --blue: #2563eb;
  --green: #0f9f93;
  --red: #dc2626;
  --accent: #f5b700;
  --pink: #d946ef;
  --shadow: 0 14px 34px rgba(15, 23, 42, .08);
}

body {
  background:
    linear-gradient(180deg, #ffffff 0%, #f6f8fb 42%, #eef3f9 100%);
  color: var(--text);
}

.topbar {
  border-bottom: 1px solid #e4eaf3;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

.topbar .brand-mark {
  color: #111827;
  background: linear-gradient(135deg, #ffe08a, #f5b700 60%, #ef8f00);
  box-shadow: 0 10px 22px rgba(245, 183, 0, .18);
}

.eyebrow { color: #b7791f; }
h1 { color: #111827; }
.top-actions { color: #475569; }

.ghost,
.primary,
.login-panel button {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #1f2937;
}
.ghost:hover,
.primary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.primary {
  background: #2563eb;
  color: #ffffff;
}

.dashboard-band,
.filters {
  border-color: #dbe3ee;
  background: rgba(255, 255, 255, .9);
}
.filters label { color: #334155; }
.filters select,
.modal-panel input,
.modal-panel select,
.login-panel input {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #111827;
}
.filters select[multiple] option:checked {
  color: #ffffff;
  background: #2563eb;
}

.kpis article {
  border-color: #dbe3ee;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.kpis article::before { background: var(--accent); }
.kpis span { color: #9a6700; }
.kpis strong { color: #111827; }
.kpis small { color: #64748b; }

.panel,
.analysis-panel,
.modal-panel,
.login-panel {
  border-color: #dbe3ee;
  background: #ffffff;
  box-shadow: var(--shadow);
  backdrop-filter: none;
}
.panel-head h2,
.section-title h2,
.analysis-card h3 {
  color: #111827;
}
.panel-head span,
.section-title span {
  color: #64748b;
}

.analysis-card {
  border-color: #e2e8f0;
  background: #f8fafc;
}
.analysis-card ul { color: #334155; }

.chart-legend { color: #334155; }
.grid-line { stroke: #dbe3ee; stroke-width: 1; stroke-dasharray: 3 5; }
.chart-label { fill: #334155; }
.value-label {
  fill: #111827;
  stroke: rgba(255, 255, 255, .95);
}
.rate-label {
  fill: #047a70;
  stroke: rgba(255, 255, 255, .95);
}
.axis-value { fill: #64748b; }
.axis-title { fill: #9a6700; }
.secondary-axis { fill: #0f9f93; }
.axis-label { fill: #64748b; }
.combo-rate-line { stroke: #16b8aa; }
.combo-rate-point {
  fill: #ffffff;
  stroke: #0f9f93;
}

.bar-label,
.bar-value {
  color: #334155;
}
.bar-track { background: #e2e8f0; }
.bar-fill { background: linear-gradient(90deg, #f5b700, #f59e0b); }

.podium-card {
  border-color: #dbe3ee;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.podium-card.rank-1 {
  border-color: rgba(245, 183, 0, .56);
  background: linear-gradient(180deg, #fff7d6, #ffffff);
  box-shadow: 0 16px 32px rgba(245, 183, 0, .14);
}
.podium-card h3 { color: #111827; }
.podium-card span { color: #64748b; }

.metric-group {
  border-color: #e2e8f0;
  background: #ffffff;
}
.metric-group h3 {
  background: #f8fafc;
  color: #111827;
  border-bottom-color: #e2e8f0;
}
.table-wrap { border-color: #e2e8f0; }
table { background: #ffffff; }
th {
  background: #f8fafc;
  color: #334155;
}
td,
th {
  border-bottom-color: #e2e8f0;
}
td { color: #1f2937; }
.empty { color: #64748b; }

.login-body {
  background: linear-gradient(180deg, #ffffff, #eef3f9);
}
.login-panel p,
.login-help,
.modal-panel label {
  color: #64748b;
}

.filter-field {
  position: relative;
  min-width: 170px;
}
.native-filter-select {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
}
.multi-select-ui {
  position: relative;
  width: 100%;
}
.multi-select-trigger {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.multi-select-trigger:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.multi-select-ui.open .multi-select-trigger {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.multi-select-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}
.multi-select-count {
  min-width: 36px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #e8f0ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 750;
}
.multi-select-count.is-all {
  background: #f1f5f9;
  color: #64748b;
}
.multi-select-arrow {
  color: #64748b;
  font-size: 14px;
  transition: transform .16s ease;
}
.multi-select-ui.open .multi-select-arrow {
  transform: rotate(180deg);
}
.multi-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: min(280px, max(100%, 220px));
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, .16);
  display: none;
}
.multi-select-ui.open .multi-select-menu {
  display: block;
}
.multi-select-options {
  display: grid;
  gap: 2px;
}
.multi-option {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #1f2937;
  cursor: pointer;
  text-align: left;
}
.multi-option:hover {
  background: #f1f5f9;
}
.multi-option.selected {
  background: #e8f0ff;
  color: #1d4ed8;
  font-weight: 700;
}
.multi-check {
  width: 16px;
  height: 16px;
  display: inline-block;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
  position: relative;
}
.multi-option.selected .multi-check {
  border-color: #2563eb;
  background: #2563eb;
}
.multi-option.selected .multi-check::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.multi-option-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

/* Chinese-color palette refinement, white background preserved */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: #ef7a82;
  --accent-strong: #82111f;
  --blue: #2b5b84;
  --green: #2f7f7a;
  --gold: #d6a01d;
  --shadow: 0 14px 32px rgba(31, 41, 55, .07);
}

.topbar .brand-mark {
  color: #ffffff;
  background: linear-gradient(135deg, #ef7a82, #c04851 64%, #82111f);
  box-shadow: 0 12px 24px rgba(130, 17, 31, .18);
}
.eyebrow { color: #82111f; }
.ghost {
  border-color: #d9dee8;
  color: #344054;
}
.ghost:hover {
  border-color: #ef7a82;
  background: #fff5f6;
  color: #82111f;
}

.multi-select-ui.open .multi-select-trigger {
  border-color: #ef7a82;
  box-shadow: 0 0 0 3px rgba(239, 122, 130, .16);
}
.multi-select-count {
  background: #fff0f1;
  color: #82111f;
}
.multi-option.selected {
  background: #fff0f1;
  color: #82111f;
}
.multi-option.selected .multi-check {
  border-color: #ef7a82;
  background: #ef7a82;
}

.kpis article {
  border-color: #e7e0e2;
  background:
    linear-gradient(180deg, #ffffff 0%, #fffafa 100%);
}
.kpis article::before { background: #ef7a82; }
.kpis article:nth-child(2)::before { background: #2b5b84; }
.kpis article:nth-child(3)::before { background: #2f7f7a; }
.kpis article:nth-child(4)::before { background: #d6a01d; }
.kpis article:nth-child(5)::before { background: #82111f; }
.kpis span { color: #82111f; }
.kpis article:nth-child(2) span { color: #2b5b84; }
.kpis article:nth-child(3) span { color: #2f7f7a; }
.kpis article:nth-child(4) span { color: #9a6700; }
.kpis article:nth-child(5) span { color: #82111f; }
.kpis strong { color: #1f2937; }
.kpis small { color: #667085; }

.panel,
.analysis-panel {
  border-color: #e4e7ec;
}
.analysis-card {
  border-color: #e6eaf0;
  background: #fbfcfe;
}
.analysis-card h3 { color: #1f2937; }

.legend-bar,
.bar-fill {
  background: linear-gradient(90deg, #d6a01d, #f2c94c);
}
.combo-bar {
  fill: #d6a01d;
  filter: drop-shadow(0 8px 14px rgba(214, 160, 29, .16));
}
.combo-rate-line,
.legend-line {
  stroke: #2f7f7a;
  background: #2f7f7a;
}
.combo-rate-point {
  fill: #ffffff;
  stroke: #2f7f7a;
}
.rate-label,
.secondary-axis {
  fill: #2f7f7a;
}
.axis-title { fill: #9a6700; }
.value-label {
  fill: #1f2937;
  stroke: rgba(255, 255, 255, .96);
}

.podium-card.rank-1 {
  border-color: rgba(239, 122, 130, .42);
  background: linear-gradient(180deg, #fff1f2, #ffffff);
  box-shadow: 0 16px 32px rgba(130, 17, 31, .09);
}
.medal-1 { background: linear-gradient(135deg, #ffd7da, #ef7a82); color: #82111f; }
.medal-2 { background: linear-gradient(135deg, #e9f0f6, #b8c7d9); color: #2b5b84; }
.medal-3 { background: linear-gradient(135deg, #fff1c7, #d6a01d); color: #5f4100; }

th {
  background: #f7f8fa;
  color: #344054;
}

/* Minimal operations-style dashboard theme */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-strong: #f8fafc;
  --text: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --blue: #2563eb;
  --green: #10b981;
  --red: #ef4444;
  --accent: #2563eb;
  --warning: #f59e0b;
  --shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

body {
  background: #f8fafc;
  color: #334155;
}

.topbar {
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
}
.topbar .brand-mark {
  color: #ffffff;
  background: #2563eb;
  box-shadow: 0 10px 20px rgba(37, 99, 235, .18);
}
.eyebrow {
  color: #64748b;
  font-weight: 650;
}
h1 {
  color: #0f172a;
}
.run-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}
.run-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .13);
}

.ghost,
.primary,
.login-panel button {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #334155;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.ghost:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}
.primary,
.login-panel button {
  background: #2563eb;
  color: #ffffff;
}
.primary:hover,
.login-panel button:hover {
  background: #1d4ed8;
}

.dashboard-band,
.filters,
.panel,
.analysis-panel,
.modal-panel,
.login-panel,
.kpis article {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: var(--shadow);
}
.dashboard-band,
.filters {
  border-radius: 12px;
}

.filter-field,
.filters label {
  color: #334155;
}
.multi-select-trigger,
.filters select,
.modal-panel input,
.modal-panel select,
.login-panel input {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #334155;
}
.multi-select-trigger:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.multi-select-ui.open .multi-select-trigger {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.multi-select-count {
  background: #eff6ff;
  color: #1d4ed8;
}
.multi-select-count.is-all {
  background: #f1f5f9;
  color: #64748b;
}
.multi-option.selected {
  background: #eff6ff;
  color: #1d4ed8;
}
.multi-option.selected .multi-check {
  border-color: #2563eb;
  background: #2563eb;
}

.kpis article {
  background: #ffffff;
  transition: transform .16s ease, box-shadow .16s ease;
}
.kpis article:hover,
.panel:hover,
.analysis-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .08);
}
.kpis article::before {
  background: #2563eb;
}
.kpis article:nth-child(2)::before { background: #10b981; }
.kpis article:nth-child(3)::before { background: #2563eb; }
.kpis article:nth-child(4)::before { background: #f59e0b; }
.kpis article:nth-child(5)::before { background: #10b981; }
.kpis span,
.kpis article:nth-child(2) span,
.kpis article:nth-child(3) span,
.kpis article:nth-child(4) span,
.kpis article:nth-child(5) span {
  color: #334155;
}
.kpis strong {
  color: #0f172a;
}
.kpis small {
  color: #64748b;
}

.panel-head h2,
.section-title h2,
.analysis-card h3 {
  color: #0f172a;
}
.panel-head span,
.section-title span {
  color: #64748b;
}
.analysis-card {
  border-color: #e2e8f0;
  background: #f8fafc;
}
.analysis-card ul {
  color: #334155;
}

.chart-legend {
  color: #334155;
}
.legend-bar,
.bar-fill {
  background: #2563eb;
}
.legend-line {
  background: #10b981;
}
.grid-line {
  stroke: #e2e8f0;
}
.chart-label {
  fill: #334155;
}
.axis-value,
.axis-label {
  fill: #64748b;
}
.axis-title {
  fill: #334155;
}
.secondary-axis,
.rate-label {
  fill: #047857;
}
.value-label {
  fill: #0f172a;
  stroke: rgba(255, 255, 255, .96);
}
.combo-bar {
  fill: #2563eb;
  filter: drop-shadow(0 8px 14px rgba(37, 99, 235, .14));
}
.combo-rate-line {
  stroke: #10b981;
}
.combo-rate-point {
  fill: #ffffff;
  stroke: #10b981;
}

.bar-label,
.bar-value,
td {
  color: #334155;
}
.bar-track {
  background: #e2e8f0;
}
.podium-card {
  border-color: #e2e8f0;
  background: #ffffff;
}
.podium-card.rank-1 {
  border-color: rgba(37, 99, 235, .28);
  background: linear-gradient(180deg, #eff6ff, #ffffff);
}
.podium-card h3 {
  color: #0f172a;
}
.podium-card span {
  color: #64748b;
}
.medal-1 { background: #dbeafe; color: #1d4ed8; }
.medal-2 { background: #ecfdf5; color: #047857; }
.medal-3 { background: #fffbeb; color: #b45309; }

.metric-group {
  border-color: #e2e8f0;
  background: #ffffff;
}
.metric-group h3,
th {
  background: #f8fafc;
  color: #334155;
  border-bottom-color: #e2e8f0;
}
.table-wrap {
  border-color: #e2e8f0;
}
table {
  background: #ffffff;
}
td,
th {
  border-bottom-color: #e2e8f0;
}
.empty {
  color: #64748b;
}

/* Smooth rate line using the requested orange tone */
.combo-svg .axis-value {
  font-size: 9px;
}
.combo-svg .axis-title {
  font-size: 10px;
  font-weight: 700;
}
.combo-svg .axis-label {
  font-size: 9.5px;
  font-weight: 600;
}
.combo-svg .value-label,
.combo-svg .rate-label {
  font-size: 9px;
  font-weight: 700;
  stroke-width: 2.5px;
}
.legend-line {
  background: #fbbf24;
}
.combo-rate-line {
  stroke: #fbbf24;
  stroke-width: 5;
  filter: drop-shadow(0 5px 10px rgba(245, 158, 11, .18));
}
.combo-rate-point {
  fill: #ffffff;
  stroke: #f59e0b;
}
.secondary-axis,
.rate-label {
  fill: #b45309;
}

/* Ranking layout: two panels per row under the product chart */
.business-unit-data-grid,
.platform-data-grid,
.department-data-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ranking-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}
.ranking-grid .panel {
  min-width: 0;
}
.ranking-grid .panel-head {
  align-items: flex-start;
}
.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.panel-actions span {
  white-space: nowrap;
}
.text-btn {
  height: 30px;
  padding: 0 11px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: #2563eb;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.text-btn:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  transform: translateY(-1px);
}
.ranking-grid .compact {
  grid-template-columns: 1fr;
}

@media (max-width: 980px) {
  .business-unit-data-grid,
  .platform-data-grid,
  .department-data-grid,
  .ranking-grid {
    grid-template-columns: 1fr;
  }
}

/* Channel tabs inside the filter card */
.channel-filter-row {
  flex: 1 0 100%;
  width: 100%;
  display: flex;
  align-items: center;
  padding-bottom: 4px;
}
.channel-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}
.channel-tab {
  height: 30px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.channel-tab:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  transform: translateY(-1px);
}
.channel-tab.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .2);
}

.account-modal-panel { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; }
.modal-hint { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.account-toolbar { display: grid; grid-template-columns: auto minmax(220px, 1fr) 160px 140px; gap: 10px; margin: 12px 0; }
.account-toolbar input, .account-toolbar select { height: 38px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); padding: 0 10px; }
.account-table-wrap { max-height: 58vh; }
.account-table { min-width: 900px; }
.account-table td, .account-table th { vertical-align: middle; }
.account-scope { color: var(--muted); font-size: 12px; line-height: 1.5; }
.account-actions { display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.account-actions button { padding: 6px 9px; font-size: 12px; }
.account-status-active { color: var(--green, #16815c); font-weight: 600; }
.account-status-inactive { color: var(--red, #c43d4b); font-weight: 600; }
@media (max-width: 760px) {
  .account-toolbar { grid-template-columns: 1fr; }
}
