:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --line: #e5e8ef;
  --line-strong: #d6dbe7;
  --text: #182033;
  --muted: #687083;
  --soft: #f0f3f8;
  --primary: #1677ff;
  --primary-dark: #075cc8;
  --green: #15a06e;
  --orange: #e88b20;
  --red: #e64a4a;
  --purple: #7552cc;
  --cyan: #0f9bb3;
  --sidebar: #ffffff;
  --sidebar-soft: #eef4ff;
  --shadow: 0 10px 30px rgba(18, 27, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  color: #2b3648;
  min-height: 100vh;
  padding: 16px 10px;
  position: sticky;
  top: 0;
  align-self: start;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #1677ff;
  color: #fff;
  font-weight: 800;
}

.brand-title {
  font-weight: 700;
  font-size: 15px;
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav-group {
  margin: 12px 0 18px;
}

.nav-group-title {
  color: #7a8495;
  font-size: 12px;
  padding: 0 10px 8px;
}

.nav-item {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #334155;
  background: transparent;
  border-radius: 7px;
  padding: 8px 10px;
  text-align: left;
  margin: 2px 0;
}

.nav-item:hover {
  background: #eef4ff;
  color: var(--primary);
}

.nav-item.active {
  background: #e8f1ff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-icon {
  width: 18px;
  text-align: center;
  color: currentColor;
  flex: 0 0 18px;
}

.main {
  min-width: 0;
}

.topbar {
  min-height: 64px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px);
}

.topbar-left {
  min-width: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.top-nav {
  flex: 1 1 auto;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0;
}

.top-nav-item {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 7px;
  padding: 0 12px;
  color: #405068;
  background: transparent;
  white-space: nowrap;
}

.top-nav-item:hover {
  color: var(--primary);
  background: #eef4ff;
}

.top-nav-item.active {
  color: #fff;
  background: var(--primary);
  font-weight: 700;
}

.topbar-title {
  min-width: 92px;
  flex: 0 0 auto;
}

.crumb {
  font-size: 12px;
  color: var(--muted);
}

.top-title {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.source-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  padding: 0 9px;
  font-size: 12px;
  border: 1px solid var(--line-strong);
  white-space: nowrap;
}

.source-badge.online {
  color: #08764f;
  background: #e8f7f1;
  border-color: #c9edde;
}

.source-badge.local {
  color: #9a5a08;
  background: #fff2df;
  border-color: #f6d7ac;
}

.account-select {
  width: 240px;
}

.content {
  padding: 18px 24px 36px;
}

.monitor-shell .topbar {
  display: none;
}

.monitor-shell .content {
  max-width: none;
  margin: 0;
  padding: 0;
}

.ad-dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  background: #f6f8fc;
  color: #111827;
}

.ad-sidebar {
  min-height: 100vh;
  padding: 28px 20px;
  background: rgba(255, 255, 255, 0.82);
  border-right: 1px solid #e7ebf3;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 26px;
}

.ad-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.ad-brand strong {
  display: block;
  font-size: 24px;
  letter-spacing: 0;
}

.ad-brand small {
  display: block;
  color: #7b8497;
  margin-top: 2px;
}

.ad-logo {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: end;
  gap: 4px;
}

.ad-logo span {
  width: 10px;
  border-radius: 4px;
  background: linear-gradient(180deg, #11c5ff, #315df6);
}

.ad-logo span:nth-child(1) {
  height: 22px;
}

.ad-logo span:nth-child(2) {
  height: 34px;
}

.ad-logo span:nth-child(3) {
  height: 44px;
}

.ad-side-nav {
  display: grid;
  align-content: start;
  gap: 10px;
}

.ad-side-nav button {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border-radius: 9px;
  background: transparent;
  color: #344054;
  font-size: 16px;
  font-weight: 650;
  text-align: left;
}

.ad-side-nav button.active,
.ad-side-nav button:hover {
  color: #2563eb;
  background: #edf3ff;
}

.ad-notice {
  border: 1px solid #e4e9f2;
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.ad-notice div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ad-notice span {
  color: #fff;
  background: #3167f6;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 11px;
}

.ad-notice p {
  display: flex;
  justify-content: space-between;
  color: #667085;
  margin: 10px 0;
  font-size: 13px;
}

.ad-notice em {
  font-style: normal;
  color: #98a2b3;
}

.ad-notice a {
  display: block;
  margin-top: 14px;
  color: #2563eb;
  text-align: center;
  font-size: 13px;
}

.ad-main {
  min-width: 0;
  padding: 24px 34px 36px;
}

.ad-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.ad-page-head h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
}

.ad-page-head span {
  margin-left: 22px;
  color: #7b8497;
  font-size: 14px;
}

.ad-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ad-btn {
  min-height: 48px;
  border: 1px solid #dbe2ee;
  border-radius: 8px;
  background: #fff;
  color: #101828;
  padding: 0 18px;
  font-weight: 700;
}

.ad-btn.primary {
  background: #2f65f6;
  border-color: #2f65f6;
  color: #fff;
}

.ad-filter-card {
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 22px 26px;
  border: 1px solid #e5eaf3;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(16, 24, 40, 0.06);
  margin-bottom: 24px;
}

.ad-filter,
.ad-search {
  min-height: 50px;
  border: 1px solid #d8dfeb;
  border-radius: 8px;
  background: #fff;
  padding: 0 16px;
  color: #1f2937;
}

.ad-search {
  width: 280px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.ad-search input {
  border: 0;
  outline: 0;
  background: transparent;
}

.ad-chip {
  min-height: 50px;
  border-radius: 8px;
  padding: 0 20px;
  font-weight: 800;
  border: 1px solid transparent;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.ad-chip.active {
  border-color: currentColor;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.12);
  transform: translateY(-1px);
}

.ad-chip.red {
  color: #e7333f;
  background: #ffecee;
}

.ad-chip.orange {
  color: #ef7d00;
  background: #fff2dc;
}

.ad-chip.green {
  color: #14924a;
  background: #e9f8ee;
}

.ad-chip.purple {
  color: #6a4de2;
  background: #f0edff;
}

.ad-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.ad-metric-card {
  min-height: 156px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 24px;
  border: 1px solid #e4e9f2;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.05);
}

.ad-metric-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
}

.ad-metric-icon.blue {
  background: linear-gradient(135deg, #2ea3ff, #3268f6);
}

.ad-metric-icon.purple {
  background: linear-gradient(135deg, #b796ff, #7a55e8);
}

.ad-metric-icon.green {
  background: linear-gradient(135deg, #7be08b, #23ad55);
}

.ad-metric-icon.orange {
  background: linear-gradient(135deg, #ffc96a, #ff8d18);
}

.ad-metric-label {
  color: #667085;
  font-size: 15px;
}

.ad-metric-value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 800;
}

.ad-metric-value.is-green {
  color: #20b94d;
}

.ad-metric-delta {
  margin-top: 14px;
  color: #667085;
  font-size: 14px;
}

.ad-metric-delta .green,
.green {
  color: #17a34a;
}

.ad-metric-delta .red,
.red {
  color: #f04438;
}

.ad-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 18px;
}

.ad-table-card,
.ad-side-card {
  border: 1px solid #e4e9f2;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
}

.ad-card-head {
  min-height: 74px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 26px;
  border-bottom: 1px solid #eef1f6;
}

.ad-card-head b {
  font-size: 20px;
}

.ad-card-head span {
  margin-left: 14px;
  color: #8a93a5;
}

.ad-table-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ad-table-tools button,
.ad-table-tools select,
.ad-pagination select,
.ad-pagination button {
  min-height: 40px;
  border: 1px solid #dbe2ee;
  border-radius: 7px;
  background: #fff;
  color: #344054;
  padding: 0 13px;
}

.ad-table-wrap table {
  min-width: 930px;
}

.ad-table-wrap th {
  height: 54px;
  background: #fbfcfe;
  color: #344054;
}

.ad-table-wrap td {
  height: 72px;
}

.ad-account-cell {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.ad-account-cell strong {
  display: block;
  font-weight: 800;
}

.ad-account-cell span {
  display: block;
  color: #8a93a5;
  font-size: 12px;
  margin-top: 4px;
}

.ad-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
}

.ad-avatar.blue {
  background: #2f80ed;
}

.ad-avatar.purple {
  background: #8b5cf6;
}

.ad-avatar.orange {
  background: #ff9416;
}

.ad-avatar.teal {
  background: #14b8a6;
}

.ad-roi-pill {
  min-width: 44px;
  display: inline-flex;
  justify-content: center;
  border-radius: 6px;
  background: #e8f8e8;
  color: #21a845;
  font-weight: 800;
  padding: 4px 8px;
}

.ad-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ad-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ad-status i.green {
  background: #16a34a;
}

.ad-status i.orange {
  background: #f59e0b;
}

.ad-status i.red {
  background: #ef4444;
}

.ad-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ad-row-actions button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #f3f6ff;
  color: #355ff4;
}

.ad-pagination {
  min-height: 78px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #eef1f6;
  color: #667085;
}

.ad-pagination button.active {
  background: #2f65f6;
  color: #fff;
}

.ad-right-rail {
  display: grid;
  gap: 14px;
  align-content: start;
}

.ad-side-card {
  padding: 20px;
}

.ad-side-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.ad-side-head b {
  font-size: 18px;
}

.ad-side-head span {
  color: #667085;
}

.ad-side-head a {
  margin-left: auto;
  color: #667085;
}

.ad-side-head button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #667085;
  font: inherit;
  cursor: pointer;
}

.ad-tabs {
  display: flex;
  gap: 18px;
  color: #667085;
  margin-bottom: 10px;
}

.ad-tabs button {
  border: 0;
  background: transparent;
  color: #667085;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ad-tabs b,
.ad-tabs button.active {
  color: #2f65f6;
}

.ad-line-chart {
  width: 100%;
  height: 150px;
}

.ad-chart-empty {
  min-height: 150px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: #667085;
  border: 1px dashed #d8e0ee;
  border-radius: 8px;
  background: #f8fbff;
}

.ad-chart-empty b {
  color: #172033;
}

.ad-chart-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #667085;
  font-size: 13px;
  margin-top: 6px;
}

.ad-chart-meta b {
  color: #172033;
}

.ad-donut-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.ad-donut {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#16a34a 0 32%, #2f65f6 32% 78%, #f59e0b 78% 100%);
  position: relative;
}

.ad-donut::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: #fff;
}

.ad-donut span {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  font-weight: 800;
}

.ad-donut small {
  color: #667085;
  font-size: 12px;
}

.ad-legend p,
.ad-alert-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #667085;
  margin: 10px 0;
}

.ad-legend i {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 7px;
}

.ad-legend i.green {
  background: #16a34a;
}

.ad-legend i.blue {
  background: #2f65f6;
}

.ad-legend i.orange {
  background: #f59e0b;
}

.ad-alert-row b {
  color: #101828;
}

.monitor-page {
  color: #101828;
}

.monitor-clean {
  display: grid;
  gap: 16px;
}

.monitor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.monitor-title {
  display: flex;
  align-items: center;
  min-height: 32px;
  font-size: 24px;
  font-weight: 800;
}

.monitor-subtitle {
  color: #667085;
  font-size: 13px;
  margin-top: 4px;
}

.monitor-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.monitor-toolbar-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.monitor-select {
  width: 92px;
  min-height: 36px;
  border: 2px solid #111827;
  color: #111827;
  background: #fff;
}

.monitor-action {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 7px;
  padding: 0 14px;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

.monitor-action.blue {
  background: #2f96f3;
}

.monitor-action.purple {
  background: #8952d9;
}

.monitor-action.orange {
  background: #ef9b28;
}

.monitor-action.red {
  background: #f45d62;
}

.monitor-action.green {
  background: #49bd19;
}

.monitor-action.light,
.monitor-action.plain {
  background: #fff;
  border: 1px solid var(--line-strong);
  color: #344054;
}

.monitor-action.active {
  outline: 2px solid #111827;
  outline-offset: 1px;
}

.monitor-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.monitor-card {
  min-height: 90px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.monitor-card-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #667085;
  font-size: 14px;
}

.monitor-card-value {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.monitor-card-value.green {
  color: #2bbf33;
}

.monitor-filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.monitor-search {
  width: min(300px, 100%);
  min-height: 38px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
  padding: 0 8px;
}

.monitor-search span,
.monitor-count {
  color: #667085;
  font-size: 13px;
}

.monitor-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #344054;
}

.monitor-sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sort-btn {
  min-height: 34px;
  border: 1px solid #d0d5dd;
  border-radius: 5px;
  background: #fff;
  color: #111827;
  padding: 0 12px;
}

.sort-btn.active {
  color: #1677ff;
  border-color: #8dc1ff;
  background: #f5faff;
}

.monitor-table {
  overflow: hidden;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
}

.monitor-section-title {
  font-size: 18px;
  font-weight: 800;
  margin: 2px 0 10px;
}

.monitor-config-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.monitor-config-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
  color: #101828;
  text-align: left;
}

.monitor-config-card b {
  font-size: 15px;
}

.monitor-config-card span {
  color: #667085;
  font-size: 13px;
  line-height: 1.5;
}

.monitor-table table {
  min-width: 860px;
}

.monitor-table th {
  height: 44px;
  background: #fff;
  color: #344054;
  font-weight: 500;
}

.monitor-table td {
  height: 70px;
}

.monitor-account-cell {
  display: grid;
  gap: 5px;
}

.monitor-account-cell strong {
  font-weight: 700;
}

.monitor-account-cell span {
  color: #667085;
  font-size: 12px;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
}

.money-red {
  color: #ff4d4f;
}

.roi-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 22px;
  border-radius: 5px;
  background: #eaf8e7;
  color: #35b735;
  font-weight: 800;
  padding: 2px 8px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
}

.page-sub {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
}

.toolbar,
.panel,
.table-panel,
.split-panel,
.metric-strip,
.rule-row,
.drawer,
.modal-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  margin-bottom: 14px;
}

.toolbar-left,
.toolbar-right,
.filter-row,
.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  overflow: visible;
  margin-bottom: 14px;
  background: transparent;
  border: 0;
}

.metric {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 86px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  font-size: 24px;
  font-weight: 800;
  margin-top: 8px;
}

.metric-foot {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

.metric.good .metric-value {
  color: var(--green);
}

.metric.warn .metric-value {
  color: var(--orange);
}

.metric.bad .metric-value {
  color: var(--red);
}

.layout-grid {
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  gap: 14px;
}

.split-panel {
  min-width: 0;
  overflow: hidden;
}

.side-list {
  min-height: 530px;
  padding: 12px;
}

.side-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.side-list-title {
  font-weight: 700;
}

.side-list-scroll {
  max-height: 480px;
  overflow: auto;
  padding-right: 2px;
}

.list-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fff;
  cursor: pointer;
}

.list-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

.thumb {
  width: 46px;
  height: 46px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #1677ff, #15a06e);
  overflow: hidden;
}

.thumb.alt {
  background: linear-gradient(135deg, #7552cc, #0f9bb3);
}

.thumb.warn {
  background: linear-gradient(135deg, #e88b20, #e64a4a);
}

.list-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 650;
}

.list-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.table-panel {
  overflow: hidden;
}

.table-head {
  min-height: 48px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}

.table-title {
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  background: #fafbfe;
  color: #4d586c;
  font-weight: 700;
  white-space: nowrap;
}

tr:hover td {
  background: #fcfdff;
}

.cell-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.cell-title {
  font-weight: 650;
  max-width: 260px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cell-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 12px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tag.blue {
  color: #075cc8;
  background: #eaf3ff;
  border-color: #cfe4ff;
}

.tag.green {
  color: #08764f;
  background: #e8f7f1;
  border-color: #c9edde;
}

.tag.orange {
  color: #9a5a08;
  background: #fff2df;
  border-color: #f6d7ac;
}

.tag.red {
  color: #b72a2a;
  background: #fff0f0;
  border-color: #f4caca;
}

.tag.purple {
  color: #5839a5;
  background: #f1ecff;
  border-color: #ddcffb;
}

.tag.gray {
  color: #596274;
  background: #eff2f6;
  border-color: #dde2ea;
}

.btn {
  min-height: 32px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn.danger {
  background: #fff;
  border-color: #f0c8c8;
  color: var(--red);
}

.btn.danger-text {
  color: var(--red);
}

.btn.danger-text:hover {
  border-color: #f0c8c8;
  background: #fff7f7;
  color: var(--red);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--primary);
  padding-inline: 6px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

code {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  color: #23304a;
}

.visually-hidden {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  opacity: 0;
  pointer-events: none;
}

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
}

.field,
.select,
.textarea {
  min-height: 34px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  outline: 0;
}

.field:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

.textarea {
  padding: 10px;
  min-height: 104px;
  resize: vertical;
  width: 100%;
}

.field.small {
  width: 92px;
}

.field.medium,
.select.medium {
  width: 180px;
}

.select {
  padding-right: 28px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tab {
  min-height: 32px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--muted);
  padding: 0 12px;
}

.tab.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field-group label {
  color: #4d586c;
  font-size: 13px;
}

.field-group .field,
.field-group .select {
  width: 100%;
}

.panel {
  padding: 16px;
  margin-bottom: 14px;
}

.panel-title {
  font-weight: 750;
  margin-bottom: 12px;
}

.account-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: 112px;
  margin-bottom: 14px;
  padding: 22px 24px;
  border: 1px solid #cfe4ff;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(22, 119, 255, 0.1), rgba(21, 160, 110, 0.07)),
    #fff;
}

.account-hero-title {
  font-size: 18px;
  font-weight: 800;
}

.account-hero-sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 6px;
  max-width: 720px;
}

.auth-modal {
  width: min(760px, 100%);
}

.auth-guide {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.8fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 14px;
}

.auth-guide-visual,
.auth-guide-text {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfe;
}

.auth-guide-visual {
  padding: 14px;
}

.auth-guide-text {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 14px;
}

.auth-step {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: #405068;
  font-size: 13px;
  line-height: 1.55;
}

.auth-step b {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f1ff;
  color: var(--primary);
  font-size: 13px;
}

.mini-browser {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(18, 27, 43, 0.08);
}

.mini-browser-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: #f5f7fb;
}

.mini-browser-bar span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c4ccd9;
}

.mini-browser-body {
  min-height: 220px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
}

.mini-sidebar {
  background: #eef4ff;
  border-right: 1px solid var(--line);
}

.mini-content {
  padding: 18px;
}

.mini-line {
  width: 62%;
  height: 10px;
  border-radius: 999px;
  background: #d7deea;
  margin-bottom: 14px;
}

.mini-line.wide {
  width: 82%;
}

.mini-choice,
.mini-check,
.mini-submit {
  min-height: 32px;
  display: flex;
  align-items: center;
  border-radius: 7px;
  padding: 0 10px;
  font-size: 12px;
  margin-bottom: 8px;
}

.mini-choice {
  border: 1px solid var(--line);
  background: #fff;
  color: #4d586c;
}

.mini-choice.active {
  border-color: var(--primary);
  background: #eaf3ff;
  color: var(--primary);
  font-weight: 700;
}

.mini-check {
  color: #08764f;
  background: #e8f7f1;
}

.mini-submit {
  justify-content: center;
  width: 96px;
  margin: 12px 0 0 auto;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.integration-actions {
  margin-top: 14px;
}

.compact-actions {
  gap: 6px;
  margin: 0;
}

.integration-note {
  margin-top: 12px;
}

.integration-table {
  margin-top: 14px;
}

.text-area {
  min-height: 118px;
  resize: vertical;
  line-height: 1.55;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.token-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.response-box {
  min-height: 128px;
  max-height: 280px;
  margin-top: 14px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.code-line {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfe;
}

.code-line code {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.switch {
  width: 42px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: #c8cfda;
  vertical-align: middle;
  transition: background 0.18s ease;
}

.switch::after {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}

.switch.on {
  background: var(--green);
}

.switch.on::after {
  transform: translateX(18px);
}

.progress {
  height: 8px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
  min-width: 96px;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--green));
}

.chart {
  height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: repeating-linear-gradient(
    to bottom,
    #fff 0,
    #fff 47px,
    #eef1f6 48px
  );
  padding: 18px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  overflow: hidden;
}

.bar {
  flex: 1;
  min-width: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.bar-fill {
  width: 100%;
  max-width: 42px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, #1677ff, #15a06e);
}

.bar-label {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.day {
  min-height: 86px;
  background: #fff;
  padding: 8px;
}

.day-num {
  font-weight: 700;
  font-size: 12px;
  color: #4d586c;
}

.day-note {
  color: var(--green);
  font-size: 11px;
  margin-top: 8px;
  line-height: 1.35;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 17, 29, 0.42);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 20px;
}

.modal-box {
  width: min(920px, 100%);
  max-height: 88vh;
  overflow: auto;
  box-shadow: var(--shadow);
}

.modal-head,
.drawer-head {
  min-height: 54px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-title,
.drawer-title {
  font-weight: 750;
}

.modal-body {
  padding: 16px;
}

.modal-foot,
.drawer-foot {
  padding: 12px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 17, 29, 0.2);
  z-index: 15;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(940px, 92vw);
  height: 100vh;
  z-index: 16;
  border-radius: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  box-shadow: var(--shadow);
}

.drawer-body {
  overflow: auto;
  padding: 16px;
}

.notice {
  border: 1px solid #cfe4ff;
  background: #f0f7ff;
  color: #164f91;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

.danger-zone {
  border-color: #f0c8c8;
  background: #fff7f7;
}

.empty {
  padding: 40px 12px;
  text-align: center;
  color: var(--muted);
}

.kpi-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.rule-row {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.rule-title {
  font-weight: 700;
}

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

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 7px 9px;
  background: #fff;
  font-size: 13px;
}

.check-pill input {
  margin: 0;
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.mobile-menu {
  display: none;
}

@media (max-width: 1100px) {
  .ad-dashboard {
    grid-template-columns: 1fr;
  }

  .ad-sidebar {
    min-height: auto;
    grid-template-rows: auto;
  }

  .ad-side-nav {
    display: flex;
    overflow-x: auto;
  }

  .ad-side-nav button {
    flex: 0 0 auto;
  }

  .ad-notice {
    display: none;
  }

  .ad-main {
    padding: 18px 14px 28px;
  }

  .ad-page-head,
  .ad-filter-card,
  .ad-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .ad-metrics,
  .ad-content-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex;
  }

  .layout-grid,
  .integration-grid,
  .auth-guide,
  .form-grid,
  .form-grid.two,
  .metric-strip,
  .monitor-card-grid,
  .monitor-config-grid,
  .kpi-list {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0 14px;
  }

  .content {
    padding: 16px 14px 28px;
  }

  .page-head,
  .toolbar,
  .account-hero,
  .monitor-filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .account-hero {
    display: flex;
  }

  .account-select {
    width: 100%;
  }

  .monitor-search {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .ad-brand strong,
  .ad-page-head h1 {
    font-size: 22px;
  }

  .ad-head-actions,
  .ad-table-tools,
  .ad-pagination {
    justify-content: flex-start;
  }

  .ad-search {
    width: 100%;
  }

  .ad-metric-card,
  .ad-donut-row {
    grid-template-columns: 1fr;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .topbar {
    align-items: flex-start;
    gap: 10px;
    padding-block: 10px;
    flex-direction: column;
  }

  .field.medium,
  .select.medium {
    width: 100%;
  }

  .toolbar-left,
  .toolbar-right,
  .filter-row,
  .button-row {
    width: 100%;
  }

  .btn {
    flex: 1 1 auto;
  }
}
