/* ===================== 设计变量 ===================== */
:root {
  --bg: #f6f6fb;
  --card: #ffffff;
  --primary: #7c5cff;
  --primary-600: #6a45f5;
  --primary-soft: #f1edff;
  --primary-soft-2: #e8e2ff;
  --text: #1c1c2a;
  --text-2: #6b6b80;
  --text-3: #9d9db0;
  --line: #ededf5;
  --line-strong: #e3e3ef;
  --green: #16a34a;
  --green-soft: #e8f8ee;
  --orange: #f59e0b;
  --orange-soft: #fff4e2;
  --red: #ef4444;
  --red-soft: #feeceb;
  --blue: #38bdf8;
  --blue-soft: #e7f6fe;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(28, 28, 42, .04), 0 8px 24px -12px rgba(28, 28, 42, .12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ===================== 布局 ===================== */
.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 208px;
  flex: 0 0 208px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 14px 12px 12px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 16px; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #8b6cff, #6a45f5);
  display: grid; place-items: center;
  box-shadow: 0 6px 14px -6px rgba(124, 92, 255, .9);
}
.brand-logo svg { width: 19px; height: 19px; stroke: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 13.5px; letter-spacing: .2px; }
.brand-text span { font-size: 11px; color: var(--text-3); }

.nav { flex: 1; overflow-y: auto; padding-right: 2px; }
.nav::-webkit-scrollbar { width: 0; }
.nav-group { margin-bottom: 14px; }
.nav-title {
  font-size: 11px; color: var(--text-3);
  padding: 6px 10px; letter-spacing: .4px;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; margin-bottom: 2px;
  border-radius: 9px;
  color: #4c4c60; font-size: 12.8px;
  transition: background .16s, color .16s;
}
.nav-item svg { width: 16px; height: 16px; flex: 0 0 16px; stroke-width: 1.5; color: #8c8ca3; }
.nav-item:hover { background: #f7f7fc; color: var(--text); }
.nav-item:hover svg { color: #6a6a85; }
.nav-item.is-active {
  background: var(--primary-soft);
  color: var(--primary-600);
  font-weight: 600;
}
.nav-item.is-active svg { color: var(--primary); }
.nav-item .chev { width: 13px; height: 13px; margin-left: auto; color: #c3c3d2; }
.nav-badge {
  margin-left: auto;
  font-size: 9px; font-weight: 700; letter-spacing: .5px;
  padding: 2px 5px; border-radius: 5px;
  color: #fff; background: linear-gradient(135deg, #a78bfa, #7c5cff);
}

.sidebar-foot { border-top: 1px solid var(--line); padding-top: 10px; }
.user { display: flex; align-items: center; gap: 9px; padding: 6px; border-radius: 10px; }
.user:hover { background: #f7f7fc; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #c4b5fd, #8b5cf6);
  color: #fff; font-weight: 700; font-size: 12px;
  display: grid; place-items: center;
}
.user-text { display: flex; flex-direction: column; line-height: 1.3; }
.user-text strong { font-size: 12.5px; }
.user-text span { font-size: 10.5px; color: var(--text-3); }
.user .chev { width: 13px; height: 13px; margin-left: auto; color: #c3c3d2; }

/* ===================== 顶栏 ===================== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 52px; flex: 0 0 52px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
}
.crumb { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 7px; }
.crumb .sep { color: #d5d5e2; }
.crumb strong { color: var(--text); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative;
  width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid transparent; background: transparent;
  color: #7a7a90; display: grid; place-items: center;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: #f5f5fb; border-color: var(--line); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red); border: 1.5px solid #fff;
}

.scroll { flex: 1; overflow-y: auto; }
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: #dcdce8; border-radius: 8px; }
.page { max-width: 1240px; margin: 0 auto; padding: 20px 22px 40px; }

/* ===================== 页面标题 ===================== */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.page-head h1 { margin: 0 0 5px; font-size: 19px; font-weight: 650; letter-spacing: -.2px; }
.page-head p { margin: 0; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-link { color: var(--primary); border-bottom: 1px dashed rgba(124, 92, 255, .4); }
.dot-sep { color: #d5d5e2; }
.tag-soft {
  display: inline-block; padding: 1px 6px; border-radius: 5px;
  background: #f4f4fa; color: #6b6b80; font-size: 11px;
}
.page-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.segmented {
  display: flex; background: #fff; border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 2px;
}
.segmented button {
  border: 0; background: transparent; color: var(--text-2);
  font-size: 12px; padding: 5px 11px; border-radius: 8px;
}
.segmented button.is-active { background: var(--primary-soft); color: var(--primary-600); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 31px; padding: 0 12px; border-radius: 9px;
  font-size: 12.3px; border: 1px solid var(--line-strong);
  background: #fff; color: #4c4c60;
  transition: .16s;
}
.btn svg { width: 14px; height: 14px; }
.btn:hover { border-color: #cfcfdd; background: #fbfbfe; }
.btn.primary {
  background: linear-gradient(135deg, #8b6cff, #6a45f5);
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 8px 16px -10px rgba(106, 69, 245, .95);
}
.btn.primary:hover { filter: brightness(1.04); }
.btn.primary.is-loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== 卡片 ===================== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  min-width: 0;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 650;
}
.bar-mark {
  width: 3px; height: 13px; border-radius: 3px;
  background: linear-gradient(180deg, #a78bfa, #7c5cff);
}
.chip-mini {
  font-size: 10.5px; font-weight: 500; color: var(--primary-600);
  background: var(--primary-soft); padding: 2px 6px; border-radius: 5px;
}
.muted { color: var(--text-3); font-size: 11.5px; }
.muted b { color: var(--text-2); font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-2 > .card { display: flex; flex-direction: column; }
.grid-2 > .card .mini-stats,
.grid-2 > .card .card-foot-note { margin-top: auto; }

/* ===================== 指标卡 ===================== */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; margin-bottom: 14px;
}
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px 10px;
  position: relative; overflow: hidden;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 11.8px; color: var(--text-2); }
.delta {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 650; padding: 2px 5px; border-radius: 5px;
  background: var(--green-soft); color: var(--green);
}
.delta.down { background: var(--red-soft); color: var(--red); }
.delta.flat { background: #f2f2f8; color: var(--text-3); }
.kpi-value {
  display: flex; align-items: baseline; gap: 4px;
  margin-top: 8px; font-size: 25px; font-weight: 680; letter-spacing: -.6px;
}
.kpi-value small { font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.kpi-sub {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px; font-size: 11px; color: var(--text-3);
}
.kpi-sub b { color: var(--text-2); font-weight: 600; }
.spark { width: 88px; height: 30px; flex: 0 0 88px; }
.kpi-spark-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }

/* ===================== 趋势图 ===================== */
.chart-wrap { position: relative; }
.chart-box { width: 100%; height: 196px; }
.chart-box svg { display: block; overflow: visible; }
.chart-box text { stroke: none; }
.chart-box rect { stroke: none; }
.chart-tip {
  position: absolute; pointer-events: none; opacity: 0; transform: translate(-50%, -112%);
  background: rgba(28, 28, 42, .93); color: #fff;
  border-radius: 9px; padding: 8px 10px; font-size: 11.5px;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5);
  transition: opacity .12s; white-space: nowrap; z-index: 5;
}
.chart-tip .t-date { color: #b9b9c9; font-size: 10.5px; margin-bottom: 4px; }
.chart-tip .t-row { display: flex; align-items: center; gap: 6px; }
.chart-tip .t-row i { width: 6px; height: 6px; border-radius: 2px; }
.chart-tip .t-row b { margin-left: auto; padding-left: 12px; }

.legend { display: flex; align-items: center; gap: 14px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); }
.legend-item i { width: 8px; height: 8px; border-radius: 3px; }

.mini-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}
.mini-stat span { display: block; font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.mini-stat strong { font-size: 13.5px; font-weight: 650; }
.mini-stat strong.up { color: var(--green); }
.mini-stat strong.down { color: var(--red); }

/* ===================== 环形图 ===================== */
.donut-wrap { display: flex; align-items: center; gap: 14px; }
.donut { position: relative; width: 148px; height: 148px; flex: 0 0 148px; }
.donut svg { transform: rotate(-90deg); }
.donut-center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.donut-center strong { display: block; font-size: 19px; font-weight: 680; letter-spacing: -.4px; }
.donut-center span { font-size: 10.5px; color: var(--text-3); }
.donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.donut-legend li { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.donut-legend i { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 8px; }
.donut-legend .dl-name { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-legend .dl-val { margin-left: auto; font-weight: 650; font-size: 12px; }
.donut-legend .dl-pct { color: var(--text-3); font-size: 11px; width: 38px; text-align: right; }
.card-foot-note {
  display: flex; align-items: center; gap: 6px;
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-strong);
  font-size: 11.5px; color: var(--text-3);
}
.card-foot-note b { color: var(--text); }
.ico-info { width: 13px; height: 13px; color: var(--text-3); }
.up { color: var(--green); font-weight: 600; }
.down { color: var(--red); font-weight: 600; }

/* ===================== 排行 ===================== */
.tabs-inline { display: flex; gap: 2px; background: #f6f6fb; padding: 3px; border-radius: 8px; }
.tabs-inline button {
  border: 0; background: transparent; color: var(--text-2);
  font-size: 11.5px; padding: 4px 9px; border-radius: 6px;
}
.tabs-inline button.is-active { background: #fff; color: var(--primary-600); font-weight: 600; box-shadow: 0 1px 3px rgba(28, 28, 42, .08); }

.rank-list { display: flex; flex-direction: column; gap: 11px; flex: 1; justify-content: space-between; }
.rank-row { display: grid; grid-template-columns: 132px 1fr 78px; align-items: center; gap: 10px; }
.rank-name { display: flex; align-items: center; gap: 7px; font-size: 12px; min-width: 0; }
.rank-name .idx {
  width: 16px; height: 16px; flex: 0 0 16px; border-radius: 5px;
  background: #f4f4fa; color: var(--text-3);
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
}
.rank-row:nth-child(1) .rank-name .idx { background: var(--primary-soft); color: var(--primary-600); }
.rank-name span.txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-track { height: 8px; border-radius: 6px; background: #f4f4fa; overflow: hidden; }
.rank-fill { height: 100%; border-radius: 6px; transition: width .5s cubic-bezier(.3,.9,.3,1); }
.rank-val { text-align: right; font-size: 12px; font-weight: 620; }
.rank-val small { display: block; font-size: 10.5px; font-weight: 400; color: var(--text-3); }

/* ===================== 告警 ===================== */
.alert-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.alert-num {
  border-radius: 11px; padding: 9px 10px; border: 1px solid transparent;
}
.alert-num strong { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.4px; }
.alert-num span { font-size: 10.5px; }
.alert-num.lv1 { background: var(--red-soft); border-color: #fbdcd9; color: #d13b32; }
.alert-num.lv2 { background: var(--orange-soft); border-color: #fbe6c2; color: #b4780d; }
.alert-num.lv3 { background: var(--blue-soft); border-color: #d3edfb; color: #0a7ea4; }

.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item { display: flex; gap: 9px; align-items: flex-start; }
.alert-item .lv-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; flex: 0 0 6px; }
.alert-item.lv1 .lv-dot { background: var(--red); }
.alert-item.lv2 .lv-dot { background: var(--orange); }
.alert-item.lv3 .lv-dot { background: #0ea5e9; }
.alert-item .a-body { min-width: 0; }
.alert-item .a-title { font-size: 12px; line-height: 1.45; }
.alert-item .a-title b { font-weight: 650; }
.alert-item .a-meta { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }

/* ===================== 表格 ===================== */
.table-tools { display: flex; align-items: center; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 0 9px; height: 28px; background: #fbfbfe;
}
.search svg { width: 13px; height: 13px; color: var(--text-3); }
.search input {
  border: 0; background: transparent; outline: none;
  font-size: 11.8px; width: 168px; color: var(--text);
}
.search input::placeholder { color: #b4b4c4; }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  text-align: left; font-weight: 500; color: var(--text-3);
  font-size: 11px; padding: 0 10px 9px; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--primary-600); }
.sort-ico { font-style: normal; opacity: .45; }
.data-table th.is-sorted .sort-ico { opacity: 1; color: var(--primary-600); }
.data-table td { padding: 10px; border-bottom: 1px solid #f6f6fb; vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfaff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.th-name { min-width: 190px; }
.cw-name { display: flex; align-items: center; gap: 9px; }
.cw-logo {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 26px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: #f4f4fa; color: #5b5b72;
}
.cw-main { min-width: 0; }
.cw-main strong { display: block; font-size: 12.2px; font-weight: 620; }
.cw-main span { display: block; font-size: 10.5px; color: var(--text-3); max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; padding: 2.5px 7px; border-radius: 20px; font-weight: 600;
  white-space: nowrap;
}
.pill.ai { background: var(--primary-soft); color: var(--primary-600); }
.pill.search { background: var(--blue-soft); color: #0a7ea4; }
.pill.referral { background: var(--green-soft); color: #15803d; }
.pill.other { background: #f2f2f8; color: #75758c; }

.pct-cell { display: flex; align-items: center; gap: 8px; min-width: 96px; }
.pct-track { flex: 1; height: 5px; border-radius: 4px; background: #f2f2f8; overflow: hidden; }
.pct-track i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #a78bfa, #7c5cff); }
.pct-num { font-size: 11.5px; font-variant-numeric: tabular-nums; width: 40px; text-align: right; }

.trend-mini { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.trend-mini svg { width: 11px; height: 11px; stroke-width: 2; }

.status-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; }
.status-chip i { width: 6px; height: 6px; border-radius: 50%; }
.status-chip.ok { color: var(--green); }
.status-chip.ok i { background: var(--green); }
.status-chip.warn { color: #b4780d; }
.status-chip.warn i { background: var(--orange); }
.status-chip.bad { color: var(--red); }
.status-chip.bad i { background: var(--red); }

.table-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 11px; margin-top: 4px; border-top: 1px dashed var(--line-strong);
  font-size: 11px;
}

/* ===================== 状态码 / robots / 日志 ===================== */
.status-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; gap: 2px; margin-bottom: 14px; }
.status-bar i { display: block; height: 100%; transition: width .4s; }
.status-list { display: flex; flex-direction: column; gap: 9px; }
.status-list li { display: flex; align-items: center; gap: 8px; font-size: 11.8px; color: var(--text-2); }
.status-list i { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 8px; }
.status-list code { font-size: 11.5px; color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.status-list b { margin-left: auto; color: var(--text); font-weight: 620; font-variant-numeric: tabular-nums; }
.status-list span.pct { width: 46px; text-align: right; color: var(--text-3); font-size: 11px; }

.robots-list { display: flex; flex-direction: column; }
.robots-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px dashed #f2f2f8; font-size: 12px;
}
.robots-list li:last-child { border-bottom: 0; }
.robots-list .rb-name { font-weight: 560; }
.robots-list .rb-type { font-size: 10.5px; color: var(--text-3); }
.rb-flag {
  margin-left: auto; font-size: 10.5px; font-weight: 600;
  padding: 2.5px 8px; border-radius: 20px; white-space: nowrap;
}
.rb-flag.allow { background: var(--green-soft); color: var(--green); }
.rb-flag.block { background: var(--red-soft); color: var(--red); }
.rb-flag.limit { background: var(--orange-soft); color: #b4780d; }

.live { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--red); font-weight: 700; letter-spacing: .5px; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, .35); } 50% { opacity: .55; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); } }

.log-list { display: flex; flex-direction: column; font-size: 11.5px; }
.log-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px dashed #f4f4fa;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.log-list li:last-child { border-bottom: 0; }
.log-list .l-time { color: var(--text-3); flex: 0 0 52px; }
.log-list .l-ua { color: var(--primary-600); flex: 0 0 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-list .l-path { color: #4c4c60; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-list .l-code { font-weight: 700; flex: 0 0 30px; text-align: right; }
.l-code.s2 { color: var(--green); }
.l-code.s3 { color: var(--orange); }
.l-code.s4, .l-code.s5 { color: var(--red); }

.page-foot {
  text-align: center; color: #b4b4c4; font-size: 11px;
  margin: 22px 0 4px;
}

/* ===================== Toast ===================== */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 12px);
  background: rgba(28, 28, 42, .94); color: #fff;
  padding: 9px 16px; border-radius: 10px; font-size: 12.3px;
  box-shadow: 0 14px 32px -12px rgba(0, 0, 0, .55);
  opacity: 0; pointer-events: none; transition: .22s ease; z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===================== 响应式 ===================== */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
}
@media (max-width: 720px) {
  .kpi-grid, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 16px 14px 30px; }
  .table-tools { flex-wrap: wrap; }
}
