/* 户眼 AdOps — design system & prototype styles */
:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e7ebf2;
  --line-strong: #d5dbe5;
  --brand: #ff5a1f;
  --brand-dark: #e94912;
  --brand-soft: #fff1eb;
  --navy: #0b1220;
  --navy-2: #111b2e;
  --green: #12b76a;
  --green-soft: #e9f9f1;
  --amber: #f79009;
  --amber-soft: #fff7e8;
  --red: #f04438;
  --red-soft: #fef0ef;
  --blue: #2e90fa;
  --blue-soft: #eef6ff;
  --teal: #0f766e;
  --purple: #7a5af8;
  --purple-soft: #f3f0ff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, .16);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --sidebar-w: 236px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
::selection { background: #ffd9c9; color: #7a2608; }

/* ---------- layout ---------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 50;
  display: flex; flex-direction: column;
  background:
    radial-gradient(620px 300px at 20% -10%, rgba(255, 90, 31, .17), transparent 62%),
    radial-gradient(500px 260px at 110% 62%, rgba(15, 118, 110, .16), transparent 60%),
    var(--navy);
  color: #fff; padding: 20px 14px 16px;
  border-right: 1px solid rgba(255, 255, 255, .04);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 22px; }
.brand-mark {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #ff7a45, #ff4d12);
  box-shadow: 0 8px 18px rgba(255, 77, 18, .28);
}
.brand-mark svg { width: 27px; height: 27px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 17px; letter-spacing: .2px; }
.brand-text strong span { font-size: 11px; font-weight: 600; color: #ffb59a; letter-spacing: .6px; margin-left: 2px; }
.brand-text small { font-size: 9px; color: #8d9bb5; margin-top: 4px; letter-spacing: .7px; }

.nav { flex: 1; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-label { font-size: 9px; color: #64748b; letter-spacing: 1.4px; padding: 15px 12px 7px; font-weight: 600; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 11px; border-radius: 9px;
  color: #aebbd0; font-size: 12.5px; font-weight: 500;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .055); }
.nav-item.active { color: #fff; background: rgba(255, 255, 255, .09); }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  background: var(--brand); border-radius: 0 3px 3px 0;
}
.nav-icon { width: 17px; height: 17px; display: inline-flex; color: currentColor; opacity: .9; }
.nav-icon svg { width: 17px; height: 17px; }
.nav-badge {
  margin-left: auto; min-width: 22px; height: 18px; padding: 0 6px; border-radius: 20px;
  background: rgba(255, 255, 255, .09); color: #d7dfec; font-size: 10px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-badge.danger { background: rgba(240, 68, 56, .18); color: #ff9b94; }
.sidebar-foot { padding-top: 14px; }
.sync-card {
  border: 1px solid rgba(255, 255, 255, .07); background: rgba(255, 255, 255, .035);
  border-radius: 11px; padding: 11px 12px;
}
.sync-top { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: #c7d2e3; }
.sync-time { margin-left: auto; color: #7f8da5; font-family: var(--mono); font-size: 9.5px; }
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #22c55e; display: inline-block;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .12);
  animation: breathe 2.8s ease-in-out infinite;
}
.sync-bar { height: 3px; background: rgba(255, 255, 255, .08); border-radius: 4px; margin: 9px 0 7px; overflow: hidden; }
.sync-bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #22c55e, #86efac); }
.sync-meta { display: flex; justify-content: space-between; font-size: 9px; color: #75839a; }
.demo-note { margin-top: 11px; display: flex; align-items: center; gap: 6px; font-size: 9px; color: #7c8aa2; padding-left: 3px; }
.demo-dot { width: 5px; height: 5px; border-radius: 50%; background: #f59e0b; }

.main-wrap { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: 66px; padding: 0 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.crumb i { font-style: normal; color: #d0d5dd; }
.crumb strong { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.global-search {
  width: 246px; height: 34px; display: flex; align-items: center; gap: 7px;
  background: #f6f8fb; border: 1px solid transparent; border-radius: 9px; padding: 0 9px;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.global-search:focus-within { background: #fff; border-color: #ffc4ad; box-shadow: 0 0 0 3px #fff1eb; }
.global-search span { color: var(--faint); display: inline-flex; }
.global-search svg { width: 15px; height: 15px; }
.global-search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 11.5px; }
.global-search input::placeholder { color: #a9b3c2; }
.global-search kbd { font-family: var(--mono); font-size: 9px; color: #98a2b3; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; }
.date-chip { font-size: 11px; color: var(--muted); white-space: nowrap; }
.fresh-chip { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); background: #f8fafc; border: 1px solid var(--line); padding: 5px 8px; border-radius: 20px; white-space: nowrap; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: 9px; color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: #f5f7fa; color: var(--ink); border-color: var(--line); }
.icon-btn svg { width: 17px; height: 17px; }
.alert-bell { position: relative; }
.bell-dot { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; background: var(--red); border: 1.5px solid #fff; border-radius: 50%; }
.avatar-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 0; color: #fff; font-size: 11px; font-weight: 600;
  background: linear-gradient(145deg, #334155, #0f172a); box-shadow: 0 2px 6px rgba(15, 23, 42, .18);
}
.menu-btn { display: none; }

.content { padding: 24px 26px 56px; max-width: 1640px; margin: 0 auto; outline: 0; }
.page-enter { animation: pageIn .28s ease both; }

/* ---------- common ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 23px; letter-spacing: -.4px; font-weight: 700; color: var(--ink); }
.page-head .sub { margin: 5px 0 0; color: var(--muted); font-size: 12px; max-width: 760px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn {
  height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-2); font-size: 11.5px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .15s ease; white-space: nowrap;
}
.btn:hover { border-color: #b9c2d0; background: #fafbfc; }
.btn svg { width: 14px; height: 14px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 10px rgba(255, 90, 31, .2); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.dark:hover { background: #17233a; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: #f4f6fa; color: var(--ink); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 10.5px; border-radius: 7px; }
.btn.danger { color: var(--red); border-color: #fecdca; background: #fff; }
.btn.danger:hover { background: var(--red-soft); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link-btn { border: 0; background: transparent; color: var(--brand); font-size: 11px; font-weight: 500; padding: 2px; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { color: var(--brand-dark); text-decoration: underline; }
.link-btn svg { width: 12px; height: 12px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.panel-head h2 { margin: 0; font-size: 13.5px; font-weight: 600; letter-spacing: -.1px; }
.panel-head .sub { margin: 3px 0 0; font-size: 10.5px; color: var(--faint); }
.panel-body { padding: 16px 18px; }
.panel-foot { padding: 0 18px 14px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-width: 0; gap: 12px; margin-bottom: 12px; }
.kpi-card {
  position: relative; min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 15px 16px 13px; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-card::after { content: ""; position: absolute; right: -28px; top: -38px; width: 90px; height: 90px; border-radius: 50%; background: var(--kpi-glow, #fff4ef); opacity: .65; }
.kpi-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10.5px; position: relative; z-index: 1; }
.kpi-label .ico { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--kpi-soft, #fff1eb); color: var(--kpi-color, var(--brand)); }
.kpi-label svg { width: 12px; height: 12px; }
.kpi-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 9px; position: relative; z-index: 1; min-width: 0; flex-wrap: wrap; }
.kpi-value { font-size: 25px; font-weight: 700; letter-spacing: -.6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-value .unit { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-trend { font-size: 9.5px; display: inline-flex; align-items: center; gap: 2px; padding: 2px 5px; border-radius: 5px; font-weight: 600; }
.kpi-trend.up { color: #027a48; background: var(--green-soft); }
.kpi-trend.down { color: #b42318; background: var(--red-soft); }
.kpi-trend.flat { color: var(--muted); background: #f2f4f7; }
.kpi-sub { margin-top: 7px; font-size: 9.5px; color: var(--faint); position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 8px; }
.kpi-spark { position: absolute; right: 12px; bottom: 12px; width: 92px; opacity: .95; }
.spark-svg { width: 100%; height: auto; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 19px; padding: 0 6px;
  border-radius: 5px; font-size: 9px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.badge svg { width: 10px; height: 10px; }
.badge.p0 { background: var(--red-soft); color: #b42318; }
.badge.p1 { background: var(--amber-soft); color: #b54708; }
.badge.p2 { background: #eef4ff; color: #175cd3; }
.badge.green { background: var(--green-soft); color: #027a48; }
.badge.gray { background: #f2f4f7; color: var(--muted); }
.badge.orange { background: var(--brand-soft); color: #c4320a; }
.badge.purple { background: var(--purple-soft); color: #5925dc; }
.badge.outline { background: #fff; border: 1px solid var(--line); color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; white-space: nowrap; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; }
.status.active { color: #027a48; } .status.active .status-dot { background: var(--green); box-shadow: 0 0 0 3px #e7f8ef; }
.status.low_balance { color: #b54708; } .status.low_balance .status-dot { background: var(--amber); box-shadow: 0 0 0 3px #fff4e5; }
.status.paused { color: #667085; } .status.paused .status-dot { background: #98a2b3; }
.status.audit { color: #175cd3; } .status.audit .status-dot { background: var(--blue); box-shadow: 0 0 0 3px #eaf3ff; }
.status.zero { color: #b42318; } .status.zero .status-dot { background: var(--red); box-shadow: 0 0 0 3px #fef0ef; }

.avatar {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 32px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; letter-spacing: -.2px;
  background: linear-gradient(145deg, var(--av-a, #334155), var(--av-b, #0f172a));
}
.avatar.sm { width: 23px; height: 23px; flex-basis: 23px; border-radius: 7px; font-size: 9px; }
.avatar.round { border-radius: 50%; }
.account-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.account-cell .meta { min-width: 0; }
.account-cell .name { font-weight: 600; font-size: 11.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-cell .sub { font-size: 9.5px; color: var(--faint); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.progress { height: 5px; border-radius: 20px; background: #edf0f5; overflow: hidden; min-width: 58px; }
.progress > span { display: block; height: 100%; border-radius: 20px; background: var(--green); transition: width .4s ease; }
.progress.warn > span { background: var(--amber); }
.progress.danger > span { background: var(--red); }
.progress.brand > span { background: var(--brand); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.tiny { font-size: 9.5px; } .small { font-size: 11px; }
.right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; }
.flex { display: flex; } .between { justify-content: space-between; } .items-center { align-items: center; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.hidden { display: none !important; }

.empty-state { padding: 54px 20px; text-align: center; color: var(--faint); }
.empty-state .big { font-size: 28px; margin-bottom: 8px; }
.empty-state strong { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 4px; }
.empty-state p { margin: 0 0 12px; font-size: 11px; }


/* ---------- platform switcher ---------- */
.platform-bar { max-width: 100%; min-width: 0; display: flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 6px; margin-bottom: 12px; overflow-x: auto; box-shadow: var(--shadow-sm); }
.platform-bar-title { font-size: 8.5px; color: var(--faint); padding: 0 7px 0 4px; letter-spacing: .8px; white-space: nowrap; }
.platform-pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 28px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; padding: 0 9px; white-space: nowrap; }
.platform-pill:hover { background: #f8fafc; color: var(--ink-2); }
.platform-pill.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.platform-pill.active .pp-count { color: #c7d2e3; }
.pp-dot { width: 6px; height: 6px; border-radius: 50%; background: #ff5a1f; }
.pp-dot.tencent_ads { background: #2e90fa; }
.pp-dot.xhs_juguang { background: #f04438; }
.pp-dot.all { background: #7a5af8; }
.pp-count { font-size: 8.5px; color: var(--faint); }
.platform-bar-note { margin-left: auto; font-size: 8.5px; color: var(--faint); padding-right: 7px; white-space: nowrap; }


.data-trust-bar { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; background: #fff; border: 1px dashed #d8dee8; border-radius: 8px; padding: 7px 11px; margin: -4px 0 12px; font-size: 9px; color: var(--faint); }
.dt-label { font-weight: 600; color: var(--ink-2); }
.dt-item b { color: var(--ink-2); font-weight: 600; }
.dt-note { color: #b54708; background: var(--amber-soft); padding: 2px 6px; border-radius: 4px; }
.data-trust-bar .link-btn { margin-left: auto; }

/* ---------- overview ---------- */
.focus-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-radius: var(--r); padding: 13px 17px; margin-bottom: 12px;
  background:
    radial-gradient(460px 160px at 4% 0%, rgba(255, 255, 255, .16), transparent 70%),
    linear-gradient(100deg, #17233a 0%, #0e1729 60%, #262016 100%);
  color: #fff; box-shadow: 0 8px 22px rgba(15, 23, 42, .13);
  position: relative; overflow: hidden;
}
.focus-banner::after {
  content: ""; position: absolute; right: 120px; top: -60px; width: 240px; height: 240px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .06); box-shadow: 0 0 0 34px rgba(255, 255, 255, .025), 0 0 0 68px rgba(255, 255, 255, .02);
}
.focus-banner .left { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; min-width: 0; }
.banner-mark { width: 37px; height: 37px; border-radius: 10px; background: rgba(255, 90, 31, .18); color: #ffb59a; display: grid; place-items: center; flex: 0 0 37px; }
.banner-mark svg { width: 19px; height: 19px; }
.focus-banner h3 { margin: 0; font-size: 13px; font-weight: 600; }
.focus-banner p { margin: 3px 0 0; color: #aebbd0; font-size: 10.5px; }
.focus-banner p b { color: #ffb59a; font-weight: 600; }
.focus-banner .right { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.focus-banner .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .16); color: #fff; }
.focus-banner .btn:hover { background: rgba(255, 255, 255, .16); }
.focus-banner .btn.primary { background: var(--brand); border-color: var(--brand); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; align-items: start; }
.overview-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.overview-grid.lower { grid-template-columns: minmax(0, 1.12fr) minmax(0, .95fr) minmax(0, 1.05fr); }
.focus-panel .panel-body { padding-top: 12px; }
.focus-tabs { display: flex; gap: 3px; background: #f5f7fa; padding: 3px; border-radius: 7px; }
.focus-tab { border: 0; background: transparent; color: var(--muted); font-size: 10px; padding: 4px 8px; border-radius: 5px; font-weight: 500; white-space: nowrap; }
.focus-tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.focus-list { display: flex; flex-direction: column; }
.focus-alert {
  display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 11px;
  padding: 11px 0; border-bottom: 1px solid #f0f2f6; align-items: start;
}
.focus-alert:last-child { border-bottom: 0; padding-bottom: 2px; }
.focus-alert:first-child { padding-top: 2px; }
.focus-rail { width: 4px; border-radius: 4px; align-self: stretch; background: var(--amber); }
.focus-rail.p0 { background: var(--red); }
.focus-rail.p2 { background: var(--blue); }
.focus-alert .top { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; flex-wrap: wrap; }
.focus-alert .acct { font-size: 11.5px; font-weight: 600; color: var(--ink); }
.focus-alert .title { font-size: 11.5px; color: var(--ink-2); line-height: 1.4; }
.focus-alert .evidence { font-size: 9.5px; color: var(--faint); margin-top: 3px; line-height: 1.45; }
.focus-alert .actions { display: flex; align-items: center; gap: 5px; margin-top: 6px; }
.focus-alert .side { text-align: right; padding-top: 2px; }
.focus-alert .money { font-size: 12px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.focus-alert .money-label { font-size: 8px; color: var(--faint); margin-top: 1px; }
.focus-alert .time { font-size: 8.5px; color: #b0b8c6; margin-top: 6px; }
.mini-action { border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 5px; height: 22px; padding: 0 7px; font-size: 9.5px; display: inline-flex; align-items: center; gap: 3px; }
.mini-action:hover { border-color: #ffc4ad; color: var(--brand); background: #fffaf8; }
.mini-action.primary { background: var(--brand-soft); border-color: #ffd9c9; color: #c4320a; }
.mini-action svg { width: 10px; height: 10px; }

.pacing-panel .panel-body { padding-top: 8px; }
.pacing-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.pacing-big { font-size: 27px; font-weight: 700; letter-spacing: -.7px; line-height: 1; font-variant-numeric: tabular-nums; }
.pacing-big small { font-size: 10px; color: var(--faint); font-weight: 500; letter-spacing: 0; margin-left: 5px; }
.pacing-delta { font-size: 10px; color: #027a48; background: var(--green-soft); padding: 3px 6px; border-radius: 5px; font-weight: 600; }
.pacing-delta.down { color: #b42318; background: var(--red-soft); }
.chart-legend { display: flex; align-items: center; gap: 12px; font-size: 9px; color: var(--faint); }
.chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend-line { width: 12px; height: 0; border-top: 2px dashed #b7c0ce; display: inline-block; }
.pacing-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); margin-top: 8px; }
.pacing-stats div { padding: 10px 8px 0; border-right: 1px solid var(--line); }
.pacing-stats div:last-child { border-right: 0; }
.pacing-stats .k { font-size: 9px; color: var(--faint); }
.pacing-stats .v { font-size: 12px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }

.health-wrap { display: flex; align-items: center; gap: 14px; }
.donut-svg { width: 142px; height: 142px; flex: 0 0 142px; }
.health-legend { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.health-row { display: flex; align-items: center; gap: 7px; font-size: 10px; }
.health-row .dot { width: 7px; height: 7px; border-radius: 50%; }
.health-row .lbl { color: var(--muted); }
.health-row .val { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.health-note { display: flex; gap: 8px; align-items: center; background: #f8fafc; border: 1px solid var(--line); padding: 8px 9px; border-radius: 8px; font-size: 9px; color: var(--muted); margin-top: 11px; }
.health-note b { color: var(--ink-2); }
.health-note svg { width: 13px; height: 13px; flex: 0 0 13px; }

.water-list { display: flex; flex-direction: column; gap: 8px; }
.water-row { display: grid; grid-template-columns: 68px minmax(0, 1fr) 44px; gap: 8px; align-items: center; font-size: 9.5px; }
.water-label { color: var(--muted); white-space: nowrap; }
.water-bar { height: 6px; background: #f0f2f6; border-radius: 10px; overflow: hidden; }
.water-bar span { display: block; height: 100%; border-radius: 10px; }
.water-count { text-align: right; color: var(--faint); font-variant-numeric: tabular-nums; }
.water-count b { color: var(--ink-2); font-weight: 600; }
.water-priority { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.water-priority-head { display: flex; justify-content: space-between; font-size: 8.5px; color: var(--faint); margin-bottom: 2px; }
.water-account { width: 100%; display: flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 6px 2px; border-radius: 6px; text-align: left; }
.water-account:hover { background: #f8fafc; }
.water-account .wa-name { font-size: 9.5px; color: var(--ink-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.water-account .wa-meta { margin-left: auto; font-size: 8.5px; color: var(--faint); white-space: nowrap; }
.water-account svg { width: 11px; height: 11px; color: var(--faint); flex: 0 0 11px; }
.city-list { display: flex; flex-direction: column; gap: 10px; }
.city-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) 62px; gap: 8px; align-items: center; font-size: 10px; }
.city-name { color: var(--ink-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-bar { height: 6px; background: #f0f2f6; border-radius: 10px; overflow: hidden; }
.city-bar span { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, #ff8a4c, #ff5a1f); }
.city-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.city-val b { color: var(--ink-2); font-weight: 600; }
.city-more { display: flex; align-items: center; justify-content: space-between; padding-top: 3px; font-size: 9px; color: var(--faint); }

.activity-list { display: flex; flex-direction: column; }
.activity-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 9px; padding: 9px 0; border-bottom: 1px solid #f2f4f7; position: relative; }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: #f4f6fa; color: var(--muted); }
.activity-icon svg { width: 11px; height: 11px; }
.activity-icon.auto { background: var(--brand-soft); color: var(--brand); }
.activity-icon.success { background: var(--green-soft); color: #027a48; }
.activity-main { font-size: 10px; color: var(--muted); line-height: 1.45; }
.activity-main b { color: var(--ink-2); font-weight: 600; }
.activity-main .act { color: var(--ink-2); }
.activity-time { font-size: 8.5px; color: #b0b8c6; white-space: nowrap; padding-top: 2px; }
.activity-result { font-size: 8.5px; margin-top: 2px; }
.activity-result.ok { color: #027a48; } .activity-result.wait { color: #b54708; }


.business-panel { margin-bottom: 12px; }
.business-panel .panel-body { padding-top: 12px; }
.business-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.business-col { border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; background: #fbfcfe; }
.business-title { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.biz-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.business-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 10px 0 8px; }
.business-metrics .k { font-size: 8.5px; color: var(--faint); }
.business-metrics .v { font-size: 16px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.business-metrics .v small { font-size: 8px; color: var(--faint); font-weight: 500; }
.business-metrics .gap-val { color: var(--amber); font-size: 13px; }
.business-note { font-size: 9px; color: var(--muted); line-height: 1.55; }
.data-gap { display: flex; align-items: flex-start; gap: 7px; background: var(--amber-soft); border: 1px solid #fedf89; color: #93370d; border-radius: 7px; padding: 8px 10px; font-size: 9.5px; line-height: 1.55; margin-top: 10px; }
.data-gap svg { width: 13px; height: 13px; flex: 0 0 13px; margin-top: 1px; }
.data-gap b { color: #7a2e0e; }

/* ---------- accounts ---------- */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-bottom: 10px;
}
.toolbar .grow { flex: 1; }
.search-field { display: flex; align-items: center; gap: 6px; height: 32px; min-width: 218px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; background: #fbfcfe; }
.search-field:focus-within { border-color: #ffc4ad; box-shadow: 0 0 0 3px #fff4ef; background: #fff; }
.search-field svg { width: 13px; height: 13px; color: var(--faint); }
.search-field input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 11px; }
.select {
  height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 0 24px 0 9px;
  font-size: 10.5px; color: var(--ink-2); outline: 0; cursor: pointer;
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center;
}
.select:focus { border-color: #ffc4ad; box-shadow: 0 0 0 3px #fff4ef; }
.chip-row { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.chip {
  height: 26px; border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 20px;
  padding: 0 10px; font-size: 10px; display: inline-flex; align-items: center; gap: 5px;
}
.chip:hover { border-color: #d0d5dd; color: var(--ink-2); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .count { font-size: 8.5px; background: rgba(0, 0, 0, .06); padding: 1px 4px; border-radius: 20px; }
.chip.active .count { background: rgba(255, 255, 255, .16); }

.table-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); overflow: hidden; }
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.data-table thead th {
  text-align: left; font-size: 9px; color: var(--faint); font-weight: 600; letter-spacing: .3px;
  padding: 10px 10px; background: #fbfcfe; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table thead th:first-child { padding-left: 14px; }
.data-table tbody td { padding: 10px 10px; border-bottom: 1px solid #f1f3f7; vertical-align: middle; font-size: 10.5px; }
.data-table tbody tr { transition: background .12s; cursor: pointer; }
.data-table tbody tr:hover { background: #fcfdff; }
.data-table tbody tr.selected { background: #fff8f5; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody td:first-child { padding-left: 14px; }
.data-table .check { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }
.table-account { max-width: 220px; }
.cell-stack { display: flex; flex-direction: column; gap: 2px; }
.cell-stack .v { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.cell-stack .k { font-size: 8.5px; color: var(--faint); }
.cpa-bad { color: #b42318; font-weight: 600; }
.cpa-good { color: #027a48; }
.health-cell { display: flex; align-items: center; gap: 6px; }
.health-mini { width: 32px; height: 4px; border-radius: 4px; background: #eef1f5; overflow: hidden; }
.health-mini span { display: block; height: 100%; border-radius: 4px; }
.health-num { font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 3px; justify-content: flex-end; }
.row-actions .icon-btn { width: 25px; height: 25px; border-radius: 6px; }
.row-actions .icon-btn svg { width: 13px; height: 13px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 10px; color: var(--faint); }
.pager { display: flex; align-items: center; gap: 4px; }
.pager button { min-width: 25px; height: 25px; border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 10px; color: var(--muted); padding: 0 7px; }
.pager button.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

.bulk-bar {
  position: fixed; left: calc(var(--sidebar-w) + 26px); right: 26px; bottom: 18px; z-index: 45;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: #101828; color: #fff; border-radius: 11px; box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease both;
}
.bulk-bar .count { font-size: 11px; font-weight: 600; }
.bulk-bar .count span { color: #ffb59a; }
.bulk-bar .grow { flex: 1; }
.bulk-bar .btn { height: 28px; font-size: 10px; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .15); color: #fff; }
.bulk-bar .btn:hover { background: rgba(255, 255, 255, .18); }
.bulk-bar .btn.primary { background: var(--brand); border-color: var(--brand); }
.bulk-bar .close { color: #98a2b3; }

/* ---------- alerts page ---------- */
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.summary-cell { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; align-items: center; gap: 11px; }
.summary-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 32px; }
.summary-ico svg { width: 15px; height: 15px; }
.summary-cell .k { font-size: 9.5px; color: var(--faint); }
.summary-cell .v { font-size: 19px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.summary-cell .v small { font-size: 9px; color: var(--faint); font-weight: 500; margin-left: 3px; }
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-full {
  display: grid; grid-template-columns: 4px minmax(0, 1fr) 180px; gap: 13px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px 13px 11px;
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
.alert-full:hover { border-color: #d6dde8; box-shadow: var(--shadow); }
.alert-full.resolved { opacity: .62; }
.alert-full .rail { width: 4px; border-radius: 4px; background: var(--amber); }
.alert-full .rail.p0 { background: var(--red); }
.alert-full .rail.p2 { background: var(--blue); }
.alert-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 3px; }
.alert-head .acct { font-size: 12px; font-weight: 600; }
.alert-head .type { font-size: 9px; color: var(--faint); background: #f5f7fa; border-radius: 4px; padding: 2px 5px; }
.alert-title { font-size: 11.5px; color: var(--ink-2); margin: 2px 0 3px; }
.alert-evidence { font-size: 9.5px; color: var(--faint); }
.alert-suggest { margin-top: 6px; display: flex; align-items: flex-start; gap: 5px; font-size: 9.5px; color: #475467; background: #f8fafc; border: 1px dashed #e4e8ef; border-radius: 6px; padding: 6px 8px; }
.alert-suggest b { color: var(--ink-2); flex-shrink: 0; }
.alert-side { border-left: 1px solid var(--line); padding-left: 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 7px; }
.alert-side .money { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.alert-side .money-label { font-size: 8.5px; color: var(--faint); }
.alert-side .meta-row { display: flex; align-items: center; justify-content: space-between; font-size: 9px; color: var(--faint); }
.alert-side .actions { display: flex; gap: 5px; }
.alert-side .actions .btn { flex: 1; height: 25px; font-size: 9px; padding: 0 5px; }


.incident-strip { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; margin-bottom: 8px; font-size: 9.5px; color: var(--faint); }
.incident-strip b { color: var(--ink-2); font-size: 11px; }
.incident-strip .tiny { margin-left: auto; }

/* ---------- automation ---------- */
.auto-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: linear-gradient(115deg, #ffffff 0%, #fff8f4 60%, #fff 100%);
  border: 1px solid #ffdfd2; border-radius: var(--r); padding: 15px 18px; margin-bottom: 12px;
}
.auto-hero .left { display: flex; align-items: center; gap: 12px; }
.auto-hero h3 { margin: 0; font-size: 13px; }
.auto-hero p { margin: 3px 0 0; font-size: 10px; color: var(--muted); }
.auto-steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.auto-step { font-size: 9px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 4px 7px; }
.auto-step b { color: var(--brand); }
.kill-switch { display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; flex-shrink: 0; }
.kill-switch .txt { font-size: 9px; color: var(--faint); line-height: 1.3; }
.kill-switch .txt b { display: block; color: var(--ink-2); font-size: 10px; }
.switch { position: relative; width: 36px; height: 20px; flex: 0 0 36px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; border-radius: 20px; background: #d0d5dd; transition: background .18s; cursor: pointer; }
.switch .track::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px #ffd9c9; }

.playbook-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.playbook {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 15px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.playbook.off { background: #fcfcfd; }
.playbook.off::after { content: "已暂停"; position: absolute; right: 12px; top: 44px; font-size: 8px; color: var(--faint); border: 1px solid var(--line); padding: 2px 5px; border-radius: 4px; }
.pb-head { display: flex; align-items: flex-start; gap: 10px; }
.pb-ico { width: 31px; height: 31px; flex: 0 0 31px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.pb-ico svg { width: 15px; height: 15px; }
.pb-title { flex: 1; min-width: 0; }
.pb-title h3 { margin: 0; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.pb-title p { margin: 2px 0 0; font-size: 9.5px; color: var(--faint); line-height: 1.45; }
.pb-desc { font-size: 10px; color: var(--muted); margin: 10px 0 9px; line-height: 1.5; }
.pb-rule { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 6px; font-size: 9.5px; margin-bottom: 4px; }
.pb-rule .k { color: var(--faint); }
.pb-rule .v { color: var(--ink-2); }
.pb-guards { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 10px; }
.guard { font-size: 8.5px; color: var(--muted); background: #f5f7fa; border-radius: 4px; padding: 2px 5px; }
.pb-foot { margin-top: auto; padding-top: 9px; border-top: 1px solid #f1f3f7; display: flex; align-items: center; gap: 8px; font-size: 8.5px; color: var(--faint); }
.pb-foot .success { color: #027a48; }
.pb-foot .grow { flex: 1; }
.lvl { font-size: 8px; font-weight: 700; padding: 2px 5px; border-radius: 4px; background: #eef4ff; color: #175cd3; }
.lvl.l2 { background: var(--amber-soft); color: #b54708; }
.lvl.l3 { background: var(--green-soft); color: #027a48; }

.two-col { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 12px; }
.list-panel .panel-body { padding-top: 10px; }
.approval-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f3f7; }
.approval-item:last-child { border-bottom: 0; }
.approval-main { flex: 1; min-width: 0; }
.approval-main .top { display: flex; align-items: center; gap: 6px; }
.approval-main .acct { font-size: 10.5px; font-weight: 600; }
.approval-main .act { font-size: 10px; color: var(--ink-2); margin-top: 2px; }
.approval-main .why { font-size: 9px; color: var(--faint); margin-top: 2px; }
.approval-main .actions { display: flex; gap: 5px; margin-top: 6px; }
.approval-meta { text-align: right; font-size: 8.5px; color: var(--faint); white-space: nowrap; }
.log-table { width: 100%; border-collapse: collapse; }
.log-table th { text-align: left; font-size: 8.5px; color: var(--faint); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.log-table td { padding: 8px 6px; border-bottom: 1px solid #f3f5f8; font-size: 9.5px; vertical-align: top; }
.log-table tr:last-child td { border-bottom: 0; }
.log-table .target { font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.log-table .act { color: var(--muted); max-width: 190px; }
.result-pill { font-size: 8px; padding: 2px 5px; border-radius: 4px; background: var(--green-soft); color: #027a48; white-space: nowrap; }
.result-pill.wait { background: var(--amber-soft); color: #b54708; }

/* ---------- materials ---------- */
.material-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.material-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s; }
.material-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.material-thumb { height: 156px; position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 12px; }
.material-thumb::before { content: ""; position: absolute; inset: 0; background: radial-gradient(180px 140px at 85% 10%, rgba(255, 255, 255, .35), transparent 60%); }
.material-thumb .phone {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%) rotate(-3deg);
  width: 82px; height: 138px; border-radius: 14px; border: 3px solid rgba(255, 255, 255, .75);
  background: rgba(0, 0, 0, .12); box-shadow: 0 12px 26px rgba(0, 0, 0, .2); overflow: hidden;
}
.material-thumb .phone::before { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255, 255, 255, .24), transparent 40%, rgba(0, 0, 0, .18)); }
.material-thumb .phone .glass { position: absolute; inset: 10px 6px 30px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 4px; }
.material-thumb .phone .caption { position: absolute; left: 6px; right: 6px; bottom: 7px; color: #fff; font-size: 7px; line-height: 1.35; text-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.material-thumb .tag { position: absolute; left: 9px; top: 9px; font-size: 8px; color: #fff; background: rgba(0, 0, 0, .26); border: 1px solid rgba(255, 255, 255, .2); border-radius: 4px; padding: 2px 5px; z-index: 1; }
.material-thumb .ratio { position: absolute; right: 9px; bottom: 9px; font-size: 8px; color: rgba(255, 255, 255, .85); z-index: 1; }
.material-body { padding: 10px 11px 11px; }
.material-title { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.material-meta { display: flex; align-items: center; gap: 5px; font-size: 8.5px; color: var(--faint); margin-top: 3px; }
.material-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 9px; padding-top: 8px; border-top: 1px solid #f1f3f7; }
.material-stats .k { font-size: 8px; color: var(--faint); }
.material-stats .v { font-size: 10.5px; font-weight: 600; margin-top: 1px; font-variant-numeric: tabular-nums; }
.material-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

/* ---------- reports ---------- */
.report-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; align-items: start; }
.report-form .panel-body { display: flex; flex-direction: column; gap: 11px; }
.field-label { font-size: 9.5px; color: var(--faint); margin-bottom: 4px; display: block; }
.field-input, .field-select {
  width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px;
  font-size: 10.5px; background: #fff; outline: 0;
}
.field-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 26px; }
.field-input:focus, .field-select:focus { border-color: #ffc4ad; box-shadow: 0 0 0 3px #fff4ef; }
.check-list { display: flex; flex-direction: column; gap: 5px; }
.check-row { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--muted); }
.check-row input { accent-color: var(--brand); }
.report-paper { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px 26px; }
.report-cover { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 16px; }
.report-cover .brandline { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--faint); }
.report-cover .logo-mini { width: 26px; height: 26px; border-radius: 7px; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 9px; font-weight: 700; }
.report-cover h2 { margin: 9px 0 3px; font-size: 19px; letter-spacing: -.3px; }
.report-cover .meta { font-size: 9.5px; color: var(--faint); }
.report-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.report-kpi { background: #f8fafc; border: 1px solid #eef1f5; border-radius: 8px; padding: 9px 10px; }
.report-kpi .k { font-size: 8.5px; color: var(--faint); }
.report-kpi .v { font-size: 17px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.report-kpi .v small { font-size: 8px; color: var(--faint); font-weight: 500; }
.report-section { margin-top: 16px; }
.report-section h4 { margin: 0 0 8px; font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.report-section h4::before { content: ""; width: 3px; height: 11px; border-radius: 3px; background: var(--brand); }
.report-section p { font-size: 10.5px; color: var(--muted); line-height: 1.75; margin: 0; }
.report-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.report-table th { font-size: 8px; color: var(--faint); text-align: left; padding: 5px 4px; border-bottom: 1px solid var(--line); }
.report-table td { font-size: 10px; padding: 6px 4px; border-bottom: 1px solid #f2f4f7; }
.report-note { margin-top: 16px; padding: 9px 11px; background: var(--brand-soft); border-radius: 7px; font-size: 9.5px; color: #9a3412; line-height: 1.6; }
.report-actions { display: flex; gap: 7px; margin-top: 14px; }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th { font-size: 8.5px; color: var(--faint); text-align: left; padding: 8px 7px; border-bottom: 1px solid var(--line); }
.history-table td { font-size: 9.5px; padding: 9px 7px; border-bottom: 1px solid #f2f4f7; }
.history-table tr:last-child td { border-bottom: 0; }


/* ---------- learning ---------- */
.learning-hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; background: radial-gradient(520px 260px at 8% 0%, rgba(255,90,31,.2), transparent 60%), linear-gradient(115deg, #111c30, #0b1220 65%, #241a14); color: #fff; border-radius: var(--r); padding: 20px 22px; margin-bottom: 12px; box-shadow: 0 10px 28px rgba(15,23,42,.14); }
.lh-left { min-width: 0; }
.lh-left h2 { margin: 9px 0 5px; font-size: 22px; letter-spacing: -.4px; }
.lh-left p { margin: 0; max-width: 650px; color: #aebbd0; font-size: 10.5px; line-height: 1.65; }
.lh-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; font-size: 9px; color: #8493aa; }
.lh-right { width: 260px; flex: 0 0 260px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); border-radius: 10px; padding: 12px 13px; }
.lh-progress-top { display: flex; justify-content: space-between; font-size: 9px; color: #aebbd0; }
.lh-progress-top strong { color: #ffb59a; font-size: 12px; }
.lh-progress { height: 6px; border-radius: 8px; background: rgba(255,255,255,.1); overflow: hidden; margin: 8px 0; }
.lh-progress span { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #ff8a4c, #ff5a1f); }
.lh-confidence { display: flex; justify-content: space-between; gap: 8px; font-size: 8.5px; color: #8493aa; }
.lh-confidence b { color: #c7d2e3; }
.learn-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.learn-stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px; box-shadow: var(--shadow-sm); }
.learn-stat .k { font-size: 9px; color: var(--faint); }
.learn-stat .v { font-size: 23px; font-weight: 700; letter-spacing: -.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.learn-stat .v small { font-size: 10px; color: var(--faint); font-weight: 500; letter-spacing: 0; }
.learn-stat .s { font-size: 8.5px; color: var(--faint); margin-top: 3px; }
.learning-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.learning-grid.two { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.learn-list { display: flex; flex-direction: column; gap: 0; }
.learn-item { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px solid #f1f3f7; }
.learn-item:last-child { border-bottom: 0; }
.learn-item b { display: block; font-size: 10.5px; color: var(--ink-2); }
.learn-item p { margin: 2px 0 0; font-size: 9px; color: var(--faint); line-height: 1.55; }
.learn-check, .learn-lock { width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; display: grid; place-items: center; }
.learn-check { background: var(--green-soft); color: #027a48; }
.learn-check svg, .learn-lock svg { width: 11px; height: 11px; }
.learn-lock { background: #f2f4f7; color: var(--faint); }
.learn-item.locked b { color: var(--muted); }
.cohort-table { width: 100%; border-collapse: collapse; }
.cohort-table th { text-align: left; font-size: 8px; color: var(--faint); font-weight: 600; padding: 7px 5px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cohort-table td { font-size: 9px; padding: 8px 5px; border-bottom: 1px solid #f2f4f7; white-space: nowrap; }
.cohort-table tr:last-child td { border-bottom: 0; }
.target-panel .panel-body { padding-top: 12px; }
.target-suggest { display: flex; align-items: center; gap: 9px; background: #fbfcfe; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; }
.target-suggest span:first-child { font-size: 9px; color: var(--faint); }
.target-suggest strong { font-size: 24px; letter-spacing: -.5px; margin-right: auto; }
.target-reason { font-size: 9px; color: var(--muted); line-height: 1.6; margin-top: 9px; }
.target-actions { display: flex; gap: 7px; margin-top: 11px; }
.target-actions .btn { flex: 1; }
.stage-list { display: flex; flex-direction: column; }
.stage-row { display: flex; gap: 9px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #f1f3f7; }
.stage-row:last-child { border-bottom: 0; }
.stage-num { width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; display: grid; place-items: center; font-size: 8.5px; font-weight: 700; background: #f2f4f7; color: var(--faint); }
.stage-row.active .stage-num { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.stage-row b { font-size: 10px; color: var(--ink-2); }
.stage-row p { margin: 1px 0 0; font-size: 8.5px; color: var(--faint); line-height: 1.5; }
.stage-badge { margin-left: auto; font-size: 8px; color: var(--faint); background: #f5f7fa; border-radius: 4px; padding: 2px 5px; white-space: nowrap; }
.stage-row.active .stage-badge { background: var(--brand-soft); color: #c4320a; }


.platform-conn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.platform-conn-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px; box-shadow: var(--shadow-sm); }
.pcc-top { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink); }
.pcc-top b { font-weight: 600; }
.pcc-top .badge { margin-left: auto; }
.pcc-sub { font-size: 9px; color: var(--faint); margin-top: 4px; }
.pcc-count { font-size: 25px; font-weight: 700; letter-spacing: -.5px; margin-top: 8px; }
.pcc-count small { font-size: 10px; color: var(--faint); font-weight: 500; }
.pcc-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; border-top: 1px solid #f1f3f7; margin-top: 8px; padding-top: 7px; font-size: 8.5px; color: var(--faint); }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-card .panel-body { display: flex; flex-direction: column; gap: 12px; }
.connection-head { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid #ffdfd2; background: #fffaf8; border-radius: 9px; }
.connection-logo { width: 36px; height: 36px; border-radius: 9px; background: #111; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: 0 0 36px; }
.connection-head .t { font-size: 11.5px; font-weight: 600; }
.connection-head .s { font-size: 9px; color: var(--faint); margin-top: 2px; }
.connection-head .badge { margin-left: auto; }
.checklist { display: flex; flex-direction: column; gap: 7px; }
.check-item { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--muted); }
.check-circle { width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 8px; color: transparent; }
.check-circle.done { background: var(--green-soft); border-color: #a6f4c5; color: #027a48; }
.check-circle.doing { background: var(--amber-soft); border-color: #fedf89; color: #b54708; }
.check-item b { color: var(--ink-2); font-weight: 500; }
.import-box { border: 1px dashed var(--line-strong); border-radius: 9px; padding: 15px; text-align: center; background: #fbfcfe; }
.import-box .big { font-size: 22px; color: var(--faint); margin-bottom: 5px; display: flex; justify-content: center; }
.import-box .big svg { width: 26px; height: 26px; }
.import-box strong { display: block; font-size: 10.5px; margin-bottom: 3px; }
.import-box p { font-size: 9px; color: var(--faint); margin: 0 0 9px; }
.file-input { display: none; }
.team-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid #f2f4f7; }
.team-row:last-child { border-bottom: 0; }
.team-row .name { font-size: 10.5px; font-weight: 500; }
.team-row .role { font-size: 8.5px; color: var(--faint); }
.team-row .scope { margin-left: auto; font-size: 8.5px; color: var(--muted); background: #f5f7fa; padding: 2px 6px; border-radius: 4px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #f3f5f8; }
.setting-row:last-child { border-bottom: 0; }
.setting-row .k { font-size: 10.5px; color: var(--ink-2); }
.setting-row .d { font-size: 8.5px; color: var(--faint); margin-top: 2px; }
.target-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.target-input { display: flex; align-items: center; gap: 6px; background: #fbfcfe; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; }
.target-input label { font-size: 9px; color: var(--muted); flex: 1; }
.target-input input { width: 48px; border: 0; background: transparent; font-size: 10.5px; font-weight: 600; text-align: right; outline: 0; }
.security-note svg { width: 13px; height: 13px; flex: 0 0 13px; vertical-align: -2px; }
.security-note { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font-size: 9px; color: var(--muted); line-height: 1.6; }
.warn-callout { background: var(--amber-soft); border: 1px solid #fedf89; color: #93370d; border-radius: 8px; padding: 9px 10px; font-size: 9px; line-height: 1.6; }

/* ---------- drawer & modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .38); backdrop-filter: blur(2px); z-index: 80; animation: fadeIn .18s ease both; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 590px; max-width: 100vw; z-index: 81;
  background: #fff; box-shadow: -20px 0 50px rgba(15, 23, 42, .18); display: flex; flex-direction: column;
  animation: drawerIn .22s cubic-bezier(.22, .8, .3, 1) both;
}
.drawer-head { padding: 16px 20px 14px; border-bottom: 1px solid var(--line); }
.drawer-top { display: flex; align-items: flex-start; gap: 10px; }
.drawer-top .account-cell { flex: 1; }
.drawer-top .account-cell .name { font-size: 15px; }
.drawer-top .account-cell .sub { font-size: 9.5px; }
.drawer-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 14px; }
.drawer-kpi { background: #f8fafc; border: 1px solid #eef1f5; border-radius: 8px; padding: 8px 9px; }
.drawer-kpi .k { font-size: 8px; color: var(--faint); white-space: nowrap; }
.drawer-kpi .v { font-size: 14px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.drawer-kpi .v small { font-size: 8px; color: var(--faint); font-weight: 500; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 20px; }
.drawer-section { margin-bottom: 18px; }
.drawer-section h4 { margin: 0 0 8px; font-size: 10.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.drawer-section h4 .hint { font-size: 8px; color: var(--faint); font-weight: 400; margin-left: auto; }
.drawer-section h4::before { content: ""; width: 3px; height: 10px; border-radius: 3px; background: var(--brand); }
.drawer-chart { border: 1px solid var(--line); border-radius: 8px; padding: 10px 8px 4px; background: #fff; }
.drawer-table { width: 100%; border-collapse: collapse; }
.drawer-table th { font-size: 8px; color: var(--faint); text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.drawer-table td { font-size: 9px; padding: 7px 4px; border-bottom: 1px solid #f4f6f9; vertical-align: middle; }
.drawer-table tr:last-child td { border-bottom: 0; }
.drawer-table .proj-name { font-weight: 500; color: var(--ink-2); max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-alert { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f4f6f9; }
.drawer-alert:last-child { border-bottom: 0; }
.drawer-alert .rail { width: 3px; border-radius: 3px; background: var(--amber); }
.drawer-alert .rail.p0 { background: var(--red); }
.drawer-alert .rail.p2 { background: var(--blue); }
.drawer-alert .t { font-size: 9.5px; color: var(--ink-2); }
.drawer-alert .e { font-size: 8.5px; color: var(--faint); margin-top: 1px; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 7px; background: #fff; }
.drawer-foot .btn { flex: 1; }
.timeline { position: relative; padding-left: 13px; }
.timeline::before { content: ""; position: absolute; left: 3px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 10px; font-size: 9px; color: var(--muted); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -13px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: #fff; border: 1.5px solid #cbd5e1; }
.timeline-item.auto::before { border-color: var(--brand); background: var(--brand-soft); }
.timeline-item b { color: var(--ink-2); font-weight: 500; }
.timeline-item .time { color: #b0b8c6; font-size: 8px; margin-left: 5px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); backdrop-filter: blur(3px); z-index: 90; display: grid; place-items: center; padding: 20px; animation: fadeIn .16s ease both; }
.modal {
  width: 560px; min-width: 0; max-width: 100%; max-height: 88vh; overflow: hidden; display: flex; flex-direction: column;
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); animation: modalIn .22s cubic-bezier(.22, .8, .3, 1) both;
}
.modal.wide { width: 760px; }
.modal-head { display: flex; align-items: flex-start; gap: 10px; padding: 17px 19px 13px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-head p { margin: 3px 0 0; font-size: 9.5px; color: var(--faint); }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 16px 19px; overflow-y: auto; min-width: 0; }
.modal-body .table-wrap { max-width: 100%; }
.modal-foot { padding: 12px 19px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 7px; background: #fbfcfe; }
.modal-note { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font-size: 9.5px; color: var(--muted); line-height: 1.6; }
.step-list { display: flex; flex-direction: column; gap: 9px; counter-reset: step; }
.step-item { display: flex; gap: 9px; font-size: 9.5px; color: var(--muted); line-height: 1.55; }
.step-num { width: 19px; height: 19px; flex: 0 0 19px; border-radius: 50%; background: var(--brand-soft); color: #c4320a; display: grid; place-items: center; font-size: 8.5px; font-weight: 700; }
.step-item b { color: var(--ink-2); }
.code-block { background: #0f172a; color: #cbd5e1; border-radius: 8px; padding: 10px 11px; font-family: var(--mono); font-size: 8.5px; line-height: 1.65; overflow-x: auto; margin-top: 7px; white-space: pre; }
.action-preview { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.action-preview .row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-bottom: 1px solid #f1f3f7; font-size: 9.5px; }
.action-preview .row:last-child { border-bottom: 0; }
.action-preview .k { color: var(--faint); }
.action-preview .v { color: var(--ink-2); font-weight: 500; text-align: right; }

.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 260px; max-width: 380px; display: flex; align-items: flex-start; gap: 9px;
  background: #101828; color: #fff; border-radius: 10px; padding: 11px 12px;
  box-shadow: var(--shadow-lg); animation: toastIn .25s cubic-bezier(.22, .8, .3, 1) both;
}
.toast.out { animation: toastOut .2s ease both; }
.toast .ico { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 6px; background: rgba(34, 197, 94, .18); color: #6ee7b7; display: grid; place-items: center; }
.toast .ico.warn { background: rgba(245, 158, 11, .2); color: #fcd34d; }
.toast .ico.error { background: rgba(239, 68, 68, .2); color: #fca5a5; }
.toast .t { font-size: 10.5px; font-weight: 600; }
.toast .d { font-size: 9px; color: #98a2b3; margin-top: 1px; line-height: 1.4; }
.toast .ico svg { width: 13px; height: 13px; }
.toast .x { margin-left: auto; color: #667085; background: transparent; border: 0; font-size: 14px; line-height: 1; padding: 0 2px; }

.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-tooltip { position: fixed; z-index: 130; background: #101828; color: #fff; font-size: 9px; padding: 5px 7px; border-radius: 5px; pointer-events: none; box-shadow: 0 4px 10px rgba(0, 0, 0, .2); }

/* ---------- responsive ---------- */
@media (max-width: 1320px) {
  .overview-grid.lower { grid-template-columns: 1fr 1fr; }
  .overview-grid.lower > .panel:last-child { grid-column: span 2; }
  .material-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1120px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .playbook-grid { grid-template-columns: 1fr; }
  .report-layout { grid-template-columns: 1fr; }
  .report-form { order: 2; }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 50px rgba(15, 23, 42, .3); }
  .main-wrap { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .content { padding: 18px 18px 60px; }
  .topbar { padding: 0 18px; }
  .global-search { width: 190px; }
  .bulk-bar { left: 18px; right: 18px; }
  .platform-bar-note { display: none; }
  .material-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .platform-conn-grid { grid-template-columns: 1fr; }
  .learning-grid, .learning-grid.two { grid-template-columns: 1fr; }
  .learn-stats { grid-template-columns: 1fr 1fr; }
  .learning-hero { flex-direction: column; align-items: flex-start; }
  .lh-right { width: 100%; flex: 0 0 auto; }
  .alert-full { grid-template-columns: 4px minmax(0, 1fr); }
  .alert-side { grid-column: 2; border-left: 0; border-top: 1px solid var(--line); padding: 9px 0 0; flex-direction: row; align-items: center; }
  .alert-side .meta-row { display: none; }
}
@media (max-width: 720px) {
  .topbar { height: 58px; gap: 8px; }
  .platform-bar { border-radius: 9px; }
  .crumb span, .crumb i { display: none; }
  .global-search { display: none; }
  .date-chip, .fresh-chip { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-head h1 { font-size: 20px; }
  .page-actions { width: 100%; flex-wrap: wrap; }
  .kpi-grid { gap: 8px; }
  .kpi-value { font-size: 21px; }
  .business-grid { grid-template-columns: 1fr; }
  .business-metrics { grid-template-columns: 1fr 1fr; }
  .kpi-spark { display: none; }
  .overview-grid.lower { grid-template-columns: 1fr; }
  .overview-grid.lower > .panel:last-child { grid-column: auto; }
  .focus-banner { align-items: flex-start; flex-direction: column; }
  .focus-banner .right { width: 100%; }
  .focus-banner .right .btn { flex: 1; }
  .summary-strip { grid-template-columns: 1fr 1fr; gap: 8px; }
  .material-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .material-thumb { height: 134px; }
  .drawer { width: 100%; }
  .drawer-kpis { grid-template-columns: 1fr 1fr; }
  .report-paper { padding: 17px; }
  .report-kpis { grid-template-columns: 1fr 1fr; }
  .report-cover { flex-direction: column; gap: 10px; }
  .auto-hero { flex-direction: column; align-items: flex-start; }
  .kill-switch { width: 100%; }
  .toolbar .search-field { min-width: 100%; }
  .toolbar .select { flex: 1; }
  .pacing-stats { grid-template-columns: 1fr 1fr; }
  .pacing-stats div:nth-child(2) { border-right: 0; }
  .pacing-stats div:last-child { grid-column: span 2; border-top: 1px solid var(--line); }
  .bulk-bar { flex-wrap: wrap; }
  .bulk-bar .grow { display: none; }
  .bulk-bar .btn { flex: 1; }
  .toast-root { left: 14px; right: 14px; bottom: 14px; }
  .toast { min-width: 0; max-width: none; }
}
@media (max-width: 460px) {
  .content { padding: 14px 12px 70px; }
  .topbar { padding: 0 12px; }
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .material-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: 1fr; }
  .focus-alert { grid-template-columns: 4px minmax(0, 1fr); }
  .focus-alert .side { grid-column: 2; display: flex; gap: 10px; align-items: center; text-align: left; padding-top: 5px; }
  .focus-alert .side .time { margin-top: 0; }
  .focus-alert .side .money-label { display: none; }
  .drawer-kpis { grid-template-columns: 1fr 1fr; }
  .modal { max-height: 92vh; }
  .modal.wide { width: 100%; }
  .modal-head, .modal-body, .modal-foot { padding-left: 14px; padding-right: 14px; }
  .focus-panel .panel-head { flex-wrap: wrap; }
  .focus-tabs { flex: 0 0 100%; justify-content: space-between; margin-top: 2px; }
}


.account-mobile-list { display: none; }
@media (max-width: 720px) {
  .accounts-table-wrap { display: none; }
  .account-mobile-list { display: flex; flex-direction: column; }
  .account-mobile-card { padding: 12px 13px; border-bottom: 1px solid #f0f2f6; }
  .account-mobile-card:last-child { border-bottom: 0; }
  .account-mobile-card.selected { background: #fff8f5; }
  .am-top { display: flex; align-items: center; gap: 8px; }
  .am-name { flex: 1; min-width: 0; }
  .am-name .name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .am-name .sub { font-size: 8.5px; color: var(--faint); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .am-metrics { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 10px 0 8px; }
  .am-metrics > div { background: #fbfcfe; border: 1px solid #f1f3f7; border-radius: 6px; padding: 6px 7px; }
  .am-metrics .k { display: block; font-size: 8px; color: var(--faint); }
  .am-metrics b { display: block; font-size: 11px; font-weight: 600; margin-top: 1px; }
  .am-metrics small { display: block; font-size: 8px; color: var(--faint); margin-top: 1px; }
  .am-bottom { display: flex; align-items: center; gap: 10px; }
  .am-bottom .progress { flex: 1; }
}
@media (max-width: 460px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 20px; }
  .kpi-label { font-size: 9.5px; }
}
@media (max-width: 360px) {
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- motion ---------- */
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes pageIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawerIn { from { transform: translateX(36px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes modalIn { from { transform: translateY(10px) scale(.985); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes slideUp { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- print ---------- */
@media print {
  .sidebar, .topbar, .page-head, .report-form, .history-panel, .report-actions, .overlay, .drawer, .bulk-bar { display: none !important; }
  .main-wrap { margin: 0; }
  .content { padding: 0; max-width: none; }
  .report-layout { display: block; }
  .report-paper { border: 0; box-shadow: none; padding: 0; }
  body { background: #fff; }
}
