:root {
  --paper: #f4f1e8;
  --paper-2: #eeeade;
  --surface: #fffdf8;
  --surface-2: #faf7ef;
  --surface-3: #f3efe4;
  --ink: #14221c;
  --ink-2: #34433b;
  --muted: #748077;
  --faint: #9aa49c;
  --line: #e5dece;
  --line-2: #d8d0bd;
  --jade: #0f7a5a;
  --jade-2: #16a077;
  --jade-3: #1cc08d;
  --jade-soft: #e7f3ec;
  --jade-mist: #f0f7f3;
  --cinnabar: #b64a30;
  --cinnabar-soft: #f8e9e3;
  --amber: #a46e1b;
  --amber-soft: #f8efda;
  --blue: #2c6e8f;
  --blue-soft: #e8f1f5;
  --sidebar: #0d1f18;
  --sidebar-2: #12291f;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(24, 38, 30, 0.04), 0 14px 34px rgba(24, 38, 30, 0.045);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(720px 420px at 78% -10%, rgba(214, 232, 220, 0.5), transparent 70%),
    radial-gradient(600px 380px at 4% 4%, rgba(244, 232, 207, 0.55), transparent 72%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
svg { display: block; }
::selection { background: rgba(15, 122, 90, 0.18); }

/* ---------- shell ---------- */
.app-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: var(--sidebar);
  color: #cdd9d2;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  overflow-y: auto;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(260px 180px at 10% 0%, rgba(28, 192, 141, 0.12), transparent 70%),
    radial-gradient(300px 220px at 100% 100%, rgba(120, 150, 90, 0.07), transparent 70%);
}
.sidebar > * { position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 24px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(145deg, #173f31, #0a241b);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { color: #f2ede0; font-size: 17px; font-weight: 600; letter-spacing: 2px; line-height: 1.1; }
.brand-sub { color: #7f9389; font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 4px; white-space: nowrap; }
.nav-group { margin-bottom: 20px; }
.nav-label { font-size: 9.5px; letter-spacing: 0.16em; color: #63766c; padding: 0 10px 8px; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; margin: 2px 0; border-radius: 9px;
  font-size: 13px; color: #a9b9b0; position: relative;
  transition: background 0.14s ease, color 0.14s ease;
}
.nav-item svg { width: 17px; height: 17px; opacity: 0.78; flex: 0 0 auto; }
.nav-item:hover { background: rgba(255, 255, 255, 0.045); color: #e6efe9; }
.nav-item.active { background: linear-gradient(90deg, rgba(28, 192, 141, 0.18), rgba(28, 192, 141, 0.05)); color: #e8fff5; }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 2px;
  background: #1cc08d; border-radius: 0 2px 2px 0;
}
.nav-item.active svg { opacity: 1; color: #52d6ac; }
.nav-item .nav-badge {
  margin-left: auto; font-size: 10px; padding: 1px 6px; border-radius: 999px;
  background: rgba(182, 74, 48, 0.9); color: #fff; font-weight: 500;
}
.sidebar-foot { margin-top: auto; padding-top: 18px; }
.env-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 11px; padding: 11px 12px; display: flex; align-items: center; gap: 9px;
}
.env-dot { width: 7px; height: 7px; border-radius: 50%; background: #2bd39b; box-shadow: 0 0 0 4px rgba(43, 211, 155, 0.12); }
.env-title { font-size: 11.5px; color: #d9e5de; }
.env-sub { font-size: 9.5px; color: #73867b; margin-top: 1px; }
.sidebar-version { display: flex; justify-content: space-between; color: #52655b; font-size: 9.5px; padding: 12px 6px 0; letter-spacing: 0.04em; }

.main-shell { flex: 1; min-width: 0; margin-left: 236px; display: flex; flex-direction: column; }
.topbar {
  height: 62px; position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 28px;
  background: rgba(244, 241, 232, 0.82);
  border-bottom: 1px solid rgba(213, 205, 187, 0.65);
  backdrop-filter: blur(14px);
}
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--faint); }
.crumbs b { color: var(--ink-2); font-weight: 500; }
.crumb-sep { color: #c3bbaa; }
.topbar-right { display: flex; align-items: center; gap: 9px; }
.icon-btn {
  width: 34px; height: 34px; border: 1px solid var(--line); background: rgba(255, 253, 248, 0.6);
  border-radius: 9px; display: grid; place-items: center; color: var(--muted); position: relative;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--surface); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--cinnabar); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 5px 4px 4px; border-radius: 999px; }
.user-chip:hover { background: rgba(255, 253, 248, 0.7); }
.avatar-sm {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, #1c4a39, #0f2c22); color: #eaf6ef; font-size: 12px; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.user-meta { line-height: 1.25; }
.user-meta b { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink); }
.user-meta span { display: block; font-size: 9.5px; color: var(--faint); }
.live-pill { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); padding: 0 4px; }
.live-pill i { width: 6px; height: 6px; background: var(--jade-2); border-radius: 50%; box-shadow: 0 0 0 4px rgba(22, 160, 119, 0.1); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.view { padding: 26px 28px 60px; max-width: 1560px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; flex-wrap: wrap; }
.page-eyebrow { font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--jade); font-weight: 600; margin-bottom: 7px; display: flex; align-items: center; gap: 7px; }
.page-eyebrow::before { content: ""; width: 14px; height: 1px; background: var(--jade); opacity: 0.6; }
.page-title { font-size: 27px; font-weight: 600; letter-spacing: -0.6px; line-height: 1.25; color: var(--ink); }
.page-desc { font-size: 12.5px; color: var(--muted); margin-top: 5px; max-width: 680px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ---------- primitives ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 500;
  transition: all 0.14s ease; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: #c3baa5; background: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--jade); border-color: var(--jade); color: #fff; box-shadow: 0 8px 18px rgba(15, 122, 90, 0.2); }
.btn.primary:hover { background: #0c6b4f; border-color: #0c6b4f; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #f3eee0; }
.btn.danger { color: var(--cinnabar); border-color: rgba(182, 74, 48, 0.3); background: #fff9f6; }
.btn.danger:hover { background: var(--cinnabar-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; }
.btn.sm svg { width: 13px; height: 13px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn.link { background: none; border: 0; color: var(--jade); padding: 0; height: auto; font-weight: 500; }
.btn.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.segmented { display: inline-flex; background: #eae5d8; border-radius: 9px; padding: 3px; gap: 2px; }
.segmented button {
  border: 0; background: transparent; color: var(--muted); font-size: 11.5px;
  padding: 5px 11px; border-radius: 7px; font-weight: 500;
}
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(30, 40, 32, 0.1); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 500; line-height: 1.6; white-space: nowrap;
  background: var(--surface-3); color: var(--muted);
}
.badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge.plain::before { display: none; }
.badge.green { background: var(--jade-soft); color: #0b6b4e; }
.badge.red { background: var(--cinnabar-soft); color: var(--cinnabar); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.gray { background: #eeeae0; color: #7d837a; }
.badge.dark { background: #20322a; color: #dcefe5; }
.badge.outline { background: transparent; border: 1px solid var(--line-2); color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 19px 12px; }
.card-title { font-size: 13.5px; font-weight: 600; letter-spacing: -0.1px; }
.card-title small { font-size: 10.5px; color: var(--faint); font-weight: 400; margin-left: 6px; }
.card-body { padding: 0 19px 18px; }
.card-actions { display: flex; align-items: center; gap: 8px; }
.divider { height: 1px; background: var(--line); margin: 0; border: 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: 15px;
  padding: 15px 17px 14px; position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.kpi::after { content: ""; position: absolute; right: -30px; top: -40px; width: 100px; height: 100px; border-radius: 50%; background: var(--jade-mist); opacity: 0.7; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11.5px; position: relative; z-index: 1; }
.kpi-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.kpi-ico svg { width: 14px; height: 14px; }
.kpi-value { font-size: 29px; font-weight: 600; letter-spacing: -1.2px; line-height: 1.2; margin: 7px 0 4px; color: var(--ink); font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.kpi-value .unit { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.kpi-value .cur { font-size: 16px; font-weight: 500; color: var(--muted); margin-right: 2px; letter-spacing: 0; }
.kpi-foot { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--faint); position: relative; z-index: 1; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; color: var(--jade); }
.delta.down { color: var(--cinnabar); }
.delta.flat { color: var(--faint); }
.delta svg { width: 10px; height: 10px; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr); }
.grid.two-rev { grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.6fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mb-16 { margin-bottom: 16px; }

/* ---------- charts ---------- */
.chart { width: 100%; position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; background: #17271f; color: #eef6f0;
  border-radius: 9px; padding: 9px 11px; font-size: 10.5px; line-height: 1.7; min-width: 132px;
  box-shadow: 0 12px 28px rgba(10, 25, 18, 0.28); opacity: 0; transform: translate(-50%, -110%);
  transition: opacity 0.1s ease;
}
.chart-tip b { font-weight: 600; font-size: 11px; display: block; color: #fff; margin-bottom: 3px; }
.chart-tip .tip-row { display: flex; justify-content: space-between; gap: 14px; color: #a9c4b6; }
.chart-tip .tip-row span:last-child { color: #e8f4ed; font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; align-items: center; gap: 14px; font-size: 10.5px; color: var(--muted); }
.chart-legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-right: 5px; }
.chart-legend .line-mark { width: 12px; height: 2px; border-radius: 2px; }

/* ---------- funnel ---------- */
.chain-card { background: linear-gradient(155deg, #12281f, #0b1c15); border: 1px solid #1e392d; color: #dbe9e1; border-radius: var(--radius); box-shadow: 0 20px 40px rgba(9, 24, 17, 0.16); overflow: hidden; position: relative; }
.chain-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(300px 200px at 90% 0%, rgba(28, 192, 141, 0.14), transparent 70%); pointer-events: none; }
.chain-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 19px 10px; position: relative; }
.chain-head h3 { font-size: 13.5px; font-weight: 600; color: #eef7f1; }
.chain-head p { font-size: 10.5px; color: #7f9b8c; margin-top: 3px; }
.chain-live { font-size: 9.5px; color: #67d9b2; border: 1px solid rgba(103, 217, 178, 0.25); border-radius: 999px; padding: 3px 8px; display: flex; gap: 5px; align-items: center; }
.chain-live i { width: 4px; height: 4px; background: #2bd39b; border-radius: 50%; }
.chain-body { padding: 8px 19px 20px; position: relative; }
.chain-row { display: grid; grid-template-columns: 62px 1fr 54px; align-items: center; gap: 10px; padding: 6px 0; }
.chain-label { font-size: 11px; color: #9bb2a6; }
.chain-bar { height: 8px; border-radius: 5px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.chain-bar span { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #1a8f6b, #2bd39b); box-shadow: 0 0 12px rgba(43, 211, 155, 0.2); }
.chain-val { text-align: right; font-size: 12.5px; font-weight: 600; color: #eff8f2; font-variant-numeric: tabular-nums; }
.chain-rate { font-size: 10px; color: #6f8b7d; padding: 0 0 8px 72px; margin-top: -6px; }
.chain-foot { display: flex; justify-content: space-between; border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 12px 0 0; margin-top: 8px; font-size: 10px; color: #7c9789; }
.chain-foot b { color: #d8eee3; font-weight: 500; }

/* ---------- tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th {
  text-align: left; font-size: 9.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid #f0ebdf; vertical-align: middle; color: var(--ink-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background 0.12s ease; }
table.data tbody tr:hover { background: #fbf8f1; }
table.data tbody tr.clickable { cursor: pointer; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data th.num { text-align: right; }
table.data .strong { font-weight: 600; color: var(--ink); }
table.data .muted { color: var(--muted); }
table.data .tiny { font-size: 10.5px; color: var(--faint); }
.cell-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cell-title { font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.cell-sub { font-size: 10px; color: var(--faint); margin-top: 2px; white-space: nowrap; }
.avatar-xs { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 10.5px; font-weight: 600; flex: 0 0 auto; }
.avatar-round { border-radius: 50%; }
.dot-channel { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 100px; }
.bar-cell .track { flex: 1; height: 5px; border-radius: 4px; background: var(--surface-3); overflow: hidden; min-width: 44px; }
.bar-cell .track span { display: block; height: 100%; border-radius: 4px; background: var(--jade-2); }
.bar-cell .val { font-size: 10.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.row-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.row-actions .icon-btn { width: 27px; height: 27px; border-radius: 7px; background: transparent; border-color: transparent; }
.row-actions .icon-btn:hover { background: var(--surface-3); }

/* ---------- alerts / lists ---------- */
.alert-list { display: flex; flex-direction: column; }
.alert-item { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px dashed #ece6d8; cursor: pointer; }
.alert-item:last-child { border-bottom: 0; padding-bottom: 4px; }
.alert-ico { width: 27px; height: 27px; flex: 0 0 auto; border-radius: 8px; display: grid; place-items: center; }
.alert-ico svg { width: 13px; height: 13px; }
.alert-item.danger .alert-ico { background: var(--cinnabar-soft); color: var(--cinnabar); }
.alert-item.warning .alert-ico { background: var(--amber-soft); color: var(--amber); }
.alert-item.info .alert-ico { background: var(--blue-soft); color: var(--blue); }
.alert-title { font-size: 11.5px; font-weight: 500; color: var(--ink); line-height: 1.5; }
.alert-desc { font-size: 10px; color: var(--faint); margin-top: 2px; line-height: 1.6; }
.alert-item:hover .alert-title { color: var(--jade); }

.staff-load-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; }
.staff-load-row .load-track { flex: 1; height: 5px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.staff-load-row .load-track span { display: block; height: 100%; border-radius: 4px; background: var(--jade-2); }
.staff-load-row.hot .load-track span { background: var(--cinnabar); }
.staff-load-row .load-name { font-size: 11px; width: 54px; color: var(--ink-2); }
.staff-load-row .load-num { font-size: 10px; color: var(--faint); width: 48px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- filters / forms ---------- */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; margin-bottom: 14px; }
.filter-bar .spacer { flex: 1; }
.search-box { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; min-width: 228px; }
.search-box svg { width: 14px; height: 14px; color: var(--faint); }
.search-box input { border: 0; background: transparent; outline: none; font-size: 11.5px; width: 100%; }
.select {
  height: 34px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px;
  padding: 0 28px 0 10px; font-size: 11.5px; color: var(--ink-2); outline: none;
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa49c' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.select:focus, .search-box:focus-within { border-color: rgba(15, 122, 90, 0.5); box-shadow: 0 0 0 3px rgba(15, 122, 90, 0.08); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 10px; color: var(--faint); line-height: 1.6; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 9px 11px; font-size: 12.5px; outline: none; transition: border 0.14s ease, box-shadow 0.14s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(15, 122, 90, 0.55); box-shadow: 0 0 0 3px rgba(15, 122, 90, 0.08); }
.field input::placeholder, .field textarea::placeholder { color: #b3b9b1; }
.field textarea { resize: vertical; min-height: 76px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section-title { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin: 20px 0 10px; display: flex; align-items: center; gap: 8px; }
.form-section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.check-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.check-chip { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 9px; font-size: 11.5px; cursor: pointer; user-select: none; white-space: nowrap; flex: 0 0 auto; }
.check-chip input { accent-color: var(--jade); margin: 0; }
.check-chip.checked { border-color: rgba(15, 122, 90, 0.4); background: var(--jade-mist); color: var(--jade); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-2); cursor: pointer; }
.switch input { display: none; }
.switch .track { width: 34px; height: 19px; border-radius: 999px; background: #d9d2c1; position: relative; transition: background 0.16s ease; }
.switch .track::after { content: ""; position: absolute; width: 15px; height: 15px; background: #fff; border-radius: 50%; top: 2px; left: 2px; transition: transform 0.16s ease; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); }
.switch input:checked + .track { background: var(--jade); }
.switch input:checked + .track::after { transform: translateX(15px); }

/* ---------- drawer / modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(12, 24, 18, 0.34); z-index: 100; opacity: 0; transition: opacity 0.18s ease; backdrop-filter: blur(2px); }
.overlay.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 94vw; z-index: 101;
  background: var(--surface); box-shadow: -24px 0 60px rgba(15, 30, 22, 0.18);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.22s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.drawer.show { transform: translateX(0); }
.drawer.wide { width: 660px; }
.drawer-head { padding: 20px 22px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.drawer-head h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; }
.drawer-head p { font-size: 11px; color: var(--faint); margin-top: 3px; }
.drawer-body { padding: 18px 22px 26px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 13px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -48%) scale(0.98); z-index: 101;
  width: 560px; max-width: calc(100vw - 32px); max-height: calc(100vh - 60px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 18px; box-shadow: 0 40px 100px rgba(10, 25, 17, 0.3);
  opacity: 0; transition: all 0.18s ease; overflow: hidden;
}
.modal.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.modal.wide { width: 720px; }
.modal-head { padding: 18px 22px 13px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-head h3 { font-size: 15.5px; font-weight: 600; }
.modal-head p { font-size: 10.5px; color: var(--faint); margin-top: 3px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { padding: 13px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }

.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 9px; background: #17271f; color: #eef6f0;
  border-radius: 10px; padding: 10px 14px; font-size: 12px; box-shadow: 0 16px 40px rgba(10, 25, 17, 0.26);
  animation: toastIn 0.22s ease both;
}
.toast.error { background: #6b2a20; }
.toast.success { background: #103f2e; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- pagination / empty ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 13px 4px 0; font-size: 11px; color: var(--faint); }
.page-btns { display: flex; gap: 4px; align-items: center; }
.page-btns button { min-width: 28px; height: 28px; border: 1px solid var(--line); background: var(--surface); border-radius: 7px; font-size: 11px; color: var(--muted); padding: 0 7px; }
.page-btns button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.page-btns button:disabled { opacity: 0.45; }
.empty { padding: 54px 20px; text-align: center; color: var(--faint); }
.empty-mark { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; border: 1px dashed var(--line-2); display: grid; place-items: center; color: #b4b0a2; background: var(--surface-2); }
.empty-mark svg { width: 22px; height: 22px; }
.empty b { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; font-weight: 500; }
.empty p { font-size: 11px; }
.skeleton { background: linear-gradient(90deg, #efeadd 25%, #f7f3e9 50%, #efeadd 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- misc ---------- */
.mono { font-family: var(--mono); font-size: 10.5px; }
.code-block {
  font-family: var(--mono); font-size: 10.5px; line-height: 1.7; background: #14251d; color: #c7ded2;
  border-radius: 10px; padding: 12px 14px; overflow: auto; white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere;
}
.copy-line { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); }
.copy-line span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mini-stat { padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.mini-stat span { font-size: 9.5px; color: var(--faint); display: block; }
.mini-stat b { font-size: 16px; font-weight: 600; letter-spacing: -0.4px; display: block; margin-top: 3px; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 5px; background: var(--surface-3); font-size: 9.5px; color: var(--muted); }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .strong { font-weight: 600; }
.flex { display: flex; align-items: center; } .between { justify-content: space-between; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.text-right { text-align: right; } .text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.w-100 { width: 100%; }
.hidden { display: none !important; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- links page ---------- */
.link-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.link-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 17px; display: flex; flex-direction: column; gap: 13px; position: relative; overflow: hidden; }
.link-card.paused { background: #faf7ef; }
.link-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.link-card h3 { font-size: 13px; font-weight: 600; line-height: 1.45; }
.link-card .sub { font-size: 10px; color: var(--faint); margin-top: 3px; }
.link-main { display: flex; gap: 14px; align-items: center; }
.qr-thumb { width: 78px; height: 78px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 5px; flex: 0 0 auto; }
.qr-thumb img { width: 100%; height: 100%; display: block; }
.link-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; flex: 1; }
.link-stats span { font-size: 9.5px; color: var(--faint); display: block; }
.link-stats b { font-size: 16px; font-weight: 600; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.link-url { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 10px; color: var(--muted); font-family: var(--mono); }
.link-url span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-url button { border: 0; background: none; color: var(--jade); font-size: 10px; padding: 0; }
.link-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px dashed #ece6d8; padding-top: 11px; }
.staff-stack { display: flex; }
.staff-stack .avatar-xs { margin-left: -7px; border: 2px solid var(--surface); width: 24px; height: 24px; font-size: 9px; }
.staff-stack .avatar-xs:first-child { margin-left: 0; }
.staff-more { font-size: 9.5px; color: var(--faint); margin-left: 5px; align-self: center; }

/* ---------- staff / channels ---------- */
.staff-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.staff-card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 16px; box-shadow: var(--shadow); }
.staff-card-head { display: flex; align-items: center; gap: 11px; }
.staff-card-head .avatar { width: 44px; height: 44px; border-radius: 13px; font-size: 16px; }
.staff-card h3 { font-size: 13.5px; }
.staff-card .role { font-size: 10px; color: var(--faint); margin-top: 2px; }
.staff-card .head-right { margin-left: auto; }
.staff-card-metrics { display: flex; justify-content: space-between; gap: 8px; padding: 13px 0; margin-top: 12px; border-top: 1px dashed #ece6d8; border-bottom: 1px dashed #ece6d8; }
.staff-card-metrics div { text-align: center; flex: 1; }
.staff-card-metrics span { display: block; font-size: 9px; color: var(--faint); }
.staff-card-metrics b { display: block; font-size: 14px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.load-line { margin-top: 12px; }
.load-line .load-top { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--faint); margin-bottom: 5px; }
.load-line .track { height: 5px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.load-line .track span { display: block; height: 100%; background: var(--jade-2); border-radius: 4px; min-width: 2px; }
.load-line.hot .track span { background: var(--cinnabar); }
.channel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.channel-card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 17px; box-shadow: var(--shadow); }
.channel-head { display: flex; align-items: center; gap: 10px; }
.platform-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; }
.channel-head h3 { font-size: 13.5px; }
.channel-head p { font-size: 9.5px; color: var(--faint); margin-top: 2px; font-family: var(--mono); }
.channel-head .head-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.channel-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 12px; padding: 11px 0; border-top: 1px dashed #ece6d8; border-bottom: 1px dashed #ece6d8; }
.channel-metrics span { font-size: 9px; color: var(--faint); display: block; }
.channel-metrics b { font-size: 14px; font-weight: 600; display: block; margin-top: 1px; font-variant-numeric: tabular-nums; }
.channel-config-row { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; color: var(--faint); padding: 3px 0; }
.channel-config-row code { font-family: var(--mono); color: var(--ink-2); font-size: 9.5px; max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-actions { display: flex; gap: 7px; margin-top: 12px; }

/* ---------- postbacks ---------- */
.status-tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 13px; overflow-x: auto; }
.status-tab { padding: 9px 13px; border: 0; background: none; font-size: 11.5px; color: var(--muted); border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.status-tab b { font-size: 10px; background: var(--surface-3); color: var(--muted); border-radius: 999px; padding: 0 5px; font-weight: 500; }
.status-tab.active { color: var(--ink); border-bottom-color: var(--jade); font-weight: 600; }
.status-tab.active b { background: var(--jade-soft); color: var(--jade); }
.pb-error { font-size: 10px; color: var(--cinnabar); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checkbox { width: 14px; height: 14px; accent-color: var(--jade); cursor: pointer; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr); gap: 16px; align-items: start; }
.settings-section { padding: 18px 19px; }
.settings-section h3 { font-size: 13px; font-weight: 600; }
.settings-section .desc { font-size: 10.5px; color: var(--faint); margin-top: 3px; line-height: 1.7; }
.settings-section .body { margin-top: 16px; }
.log-list { max-height: 360px; overflow-y: auto; }
.log-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #ece6d8; font-size: 11px; }
.log-row:last-child { border-bottom: 0; }
.log-time { color: var(--faint); font-size: 9.5px; width: 78px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.log-main { flex: 1; min-width: 0; }
.log-main b { font-weight: 500; color: var(--ink-2); display: block; }
.log-main span { color: var(--faint); font-size: 9.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- login ---------- */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; position: relative; z-index: 1; }
.login-art { background: #0d1f18; color: #e8f3ec; padding: 48px 54px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::before { content: ""; position: absolute; width: 560px; height: 560px; border-radius: 50%; border: 1px solid rgba(43, 211, 155, 0.14); right: -180px; top: -140px; }
.login-art::after { content: ""; position: absolute; width: 760px; height: 760px; border-radius: 50%; border: 1px solid rgba(43, 211, 155, 0.08); right: -280px; top: -240px; }
.login-art > * { position: relative; z-index: 1; }
.login-kicker { font-size: 10px; letter-spacing: 0.22em; color: #6f9785; text-transform: uppercase; }
.login-headline { font-family: "Songti SC", "STSong", Georgia, serif; font-size: clamp(36px, 4.2vw, 56px); line-height: 1.18; letter-spacing: -1.5px; margin-top: 22px; color: #f3efe2; }
.login-headline em { font-style: normal; color: #5fe0b6; }
.login-copy { color: #8aa798; font-size: 13px; max-width: 360px; margin-top: 18px; line-height: 1.9; }
.login-metrics { display: flex; gap: 34px; margin-top: 44px; }
.login-metrics b { display: block; font-size: 24px; font-weight: 600; color: #e9f7f0; letter-spacing: -0.6px; }
.login-metrics span { font-size: 10px; color: #749385; letter-spacing: 0.04em; }
.login-flow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; max-width: 420px; }
.login-flow span { font-size: 10.5px; color: #9ab5a6; border: 1px solid rgba(255, 255, 255, 0.11); border-radius: 999px; padding: 5px 10px; }
.login-flow i { font-style: normal; color: #4f7564; align-self: center; font-size: 10px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--paper); }
.login-box { width: 100%; max-width: 380px; }
.login-box .brand { padding: 0 0 26px; }
.login-box .brand-name { color: var(--ink); }
.login-box .brand-sub { color: var(--faint); }
.login-box h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.6px; }
.login-box .hello { font-size: 12px; color: var(--muted); margin-top: 6px; margin-bottom: 26px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .field input { height: 44px; background: #fff; }
.login-submit { height: 44px; margin-top: 4px; font-size: 13px; }
.login-error { background: var(--cinnabar-soft); color: var(--cinnabar); border-radius: 8px; font-size: 11.5px; padding: 9px 11px; }
.login-hint { margin-top: 22px; padding: 12px 13px; border: 1px dashed var(--line-2); border-radius: 10px; font-size: 10.5px; color: var(--faint); line-height: 1.8; background: rgba(255, 253, 248, 0.55); }
.login-hint b { color: var(--ink-2); font-weight: 500; }
.login-hint button { border: 0; background: none; color: var(--jade); padding: 0; font-size: 10.5px; margin-left: 4px; text-decoration: underline; text-underline-offset: 2px; }
.login-foot { margin-top: 28px; font-size: 9.5px; color: #b0b4a9; letter-spacing: 0.03em; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(4), .kpi:nth-child(5) { grid-column: span 1; }
  .link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .staff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .sidebar { width: 72px; flex-basis: 72px; padding: 20px 10px 14px; }
  .brand { padding: 0 0 22px; justify-content: center; }
  .brand > div:not(.brand-mark) { display: none; }
  .nav-label { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-item span { display: none; }
  .nav-item .nav-badge { position: absolute; top: 5px; right: 10px; }
  .nav-item.active::before { left: -10px; }
  .env-card, .sidebar-version { display: none; }
  .main-shell { margin-left: 72px; }
  .grid.two, .grid.two-rev { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .channel-grid { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { min-height: 100vh; }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); width: 236px; flex-basis: 236px; padding: 22px 14px 16px; transition: transform 0.22s ease; }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar.mobile-open .brand > div:not(.brand-mark), .sidebar.mobile-open .nav-item span { display: block; }
  .sidebar.mobile-open .nav-item { justify-content: flex-start; padding: 10px; }
  .sidebar.mobile-open .nav-label { display: block; }
  .main-shell { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .view { padding: 18px 16px 50px; }
  .menu-btn { display: grid !important; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid .kpi:last-child { grid-column: 1 / -1; }
  .kpi-value { font-size: 24px; }
  .link-grid, .staff-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .user-meta { display: none; }
  .crumbs { font-size: 10.5px; }
  .page-title { font-size: 23px; }
}
.menu-btn { display: none; }
.mobile-backdrop { display: none; }
@media (max-width: 820px) {
  .mobile-backdrop.show { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10, 22, 16, 0.42); backdrop-filter: blur(2px); }
}

/* ---------- timeline ---------- */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; }
.tl-rail { width: 26px; flex: 0 0 26px; display: flex; flex-direction: column; align-items: center; }
.tl-dot {
  width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--jade); border: 1px solid var(--line);
}
.tl-dot svg { width: 13px; height: 13px; }
.tl-line { width: 1px; flex: 1; min-height: 14px; background: linear-gradient(var(--line), transparent); margin: 3px 0; }
.tl-content { flex: 1; min-width: 0; padding: 2px 0 18px; }
.tl-title { font-size: 12px; font-weight: 500; color: var(--ink); display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tl-time { font-size: 9.5px; font-weight: 400; color: var(--faint); white-space: nowrap; }
.tl-desc { font-size: 10.5px; color: var(--muted); margin-top: 3px; line-height: 1.7; word-break: break-all; }

/* ---------- misc refinements ---------- */
.view > * { animation: viewIn .28s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.card-title { display: flex; align-items: baseline; gap: 6px; }
.badge + .badge { margin-left: 2px; }
.settings-section .body { margin-top: 14px; }
.settings-section .form-grid .field.full { grid-column: 1 / -1; }
.modal .field.full, .drawer .field.full { grid-column: 1 / -1; }
@media (max-width: 820px) {
  .tl-title { flex-direction: column; gap: 2px; }
  .tl-time { font-size: 9px; }
}

.total-row td { background: var(--surface-2); font-weight: 500; color: var(--ink-2); border-top: 1px solid var(--line); border-bottom: 0 !important; }
.demo-inline { font-size: 9.5px; color: #7a6a3f; background: #f6ecd4; border: 1px solid #ead9b4; border-radius: 999px; padding: 3px 9px; letter-spacing: .04em; }
.demo-note { margin-top: 9px; font-size: 10px; color: #8a7b52; background: #faf3e2; border: 1px dashed #e8d6ae; border-radius: 8px; padding: 7px 9px; line-height: 1.6; text-align: left; }
.account-select{height:32px;min-width:120px;max-width:160px;font-size:11px;background:rgba(255,253,248,.7)}
.account-tag{display:inline-flex;align-items:center;gap:4px;font-size:9.5px;color:var(--jade);background:var(--jade-soft);border-radius:5px;padding:1px 6px;white-space:nowrap}
.account-tag::before{content:"";width:4px;height:4px;border-radius:50%;background:currentColor}
@media (max-width:820px){.account-select{max-width:104px;min-width:90px}}
