:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --blue: #2563eb;
  --blue-2: #1d4ed8;
  --indigo: #4f46e5;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, #0f172a, #111827);
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(255,255,255,0.08);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #cfe0ff;
}

.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { color: rgba(255,255,255,0.68); font-size: 12px; margin-top: 2px; }

.nav { display: grid; gap: 8px; }
.nav-item {
  color: rgba(255,255,255,0.86);
  text-decoration: none;
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.nav-item.active, .nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-logout {
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(254, 202, 202, 0.88);
}
.sidebar-foot {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}
.sidebar-count { font-size: 28px; font-weight: 700; margin-top: 6px; }

.main { padding: 16px; min-width: 0; }
.asset-warning {
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.page-title { font-size: 22px; font-weight: 700; }
.page-subtitle { color: var(--muted); margin-top: 4px; }
.topbar-actions { display: flex; gap: 10px; }

.btn, .input, .icon-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  height: 38px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.btn { cursor: pointer; }
.btn-primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover { background: var(--blue-2); }
.btn-secondary:hover, .input:focus {
  border-color: #bfd0ff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

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

.view { display: none; }
.view.active { display: block; }
.overview-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.05fr) minmax(420px, 0.95fr);
  gap: 12px;
}
.view > .panel,
.view > .detail-panel {
  min-height: min(620px, calc(100vh - 120px));
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 3px; }
.stat-value.ok { color: var(--green); }
.stat-value.bad { color: var(--red); }

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(560px, 1.05fr) minmax(420px, 0.95fr);
  gap: 12px;
  margin-bottom: 12px;
}
.bottom-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(560px, 1.05fr);
  gap: 12px;
  margin-bottom: 12px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel-head {
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.panel-list, .detail-panel { overflow: hidden; }
.panel-list {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
}
.detail-panel {
  align-self: start;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
}
.panel-list .table-wrap,
.detail-panel #detailPane {
  overflow: auto;
}

.table-wrap { overflow: auto; }
#changes .table-wrap {
  max-height: calc(100vh - 190px);
}
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}
.site-table { min-width: 840px; }
.change-table { min-width: 760px; }
.table th, .table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table th {
  position: sticky;
  top: 0;
  background: #fafbff;
  font-size: 12px;
  color: var(--muted);
  z-index: 1;
}
.table tr:hover td { background: #fbfcff; }
.table tr.selected td {
  background: #f3f6ff;
  border-bottom-color: #dbe5ff;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
}
.badge.ok { background: rgba(22,163,74,0.10); color: var(--green); border-color: rgba(22,163,74,0.18); }
.badge.bad { background: rgba(220,38,38,0.10); color: var(--red); border-color: rgba(220,38,38,0.18); }
.badge.warn { background: rgba(217,119,6,0.10); color: var(--amber); border-color: rgba(217,119,6,0.18); }
.badge.neutral { background: rgba(37,99,235,0.10); color: var(--blue); border-color: rgba(37,99,235,0.18); }

.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  margin: 2px 4px 2px 0;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--indigo);
  border: 1px solid #dfe4ff;
  font-size: 12px;
  font-weight: 600;
}
.tag.strong { background: #ecfdf5; color: #047857; border-color: #cdeedd; }
.tag.login { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.tag.report-off { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

.link-cell {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.link-cell strong { font-size: 14px; }
.link-cell span {
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.upstream-link {
  color: var(--blue);
  text-decoration: none;
  word-break: break-all;
}
.upstream-link:hover,
.upstream-link:focus-visible { text-decoration: underline; }

.report-layout-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 0;
}
.report-layout-actions .error { color: var(--red); }
.report-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
  padding: 12px 18px 18px;
}
.report-group-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}
.report-group-card.ungrouped { border-style: dashed; }
.report-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.report-site-list { display: grid; gap: 6px; }
.report-site-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.report-site-order { color: var(--muted); font-size: 12px; text-align: center; }
.report-site-name strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.report-site-name span { color: var(--muted); font-size: 12px; }
.input-small { height: 30px; padding: 0 6px; font-size: 12px; max-width: 110px; }

.bot-settings-body { display: grid; gap: 14px; padding: 12px 18px 18px; }
#botSettingsStatus.error { color: var(--red); }
.bot-alias-list { display: grid; gap: 6px; }
#addBotAliasBtn { flex-shrink: 0; white-space: nowrap; }
.bot-alias-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 2fr) auto;
  align-items: center;
  gap: 8px;
}
.bot-template-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 10px;
}
.bot-template-label label { font-size: 12px; color: var(--muted); }
.bot-template-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bot-template-input {
  height: auto;
  min-height: 38px;
  padding: 8px 10px;
  font-family: inherit;
  resize: vertical;
  white-space: pre;
}

.group-list { display: grid; gap: 6px; }
.group-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}
.group-row strong { display: block; font-size: 14px; }
.group-row span { color: var(--muted); font-size: 12px; }
.group-ratio { font-weight: 700; color: var(--blue); }

.detail-empty {
  padding: 18px;
  color: var(--muted);
}
.detail-box {
  padding: 18px;
  display: grid;
  gap: 12px;
}
.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.detail-title { font-size: 18px; font-weight: 700; }
.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.meta-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}
.meta-card .k { color: var(--muted); font-size: 12px; }
.meta-card .v { margin-top: 4px; font-weight: 700; word-break: break-word; }
.balance-low { color: #b45309; font-weight: 800; }
.meta-card.wide { grid-column: 1 / -1; }

.detail-section {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}
.notify-scope-editor {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}
.notify-scope-head { margin-top: 0; }
.notify-scope-head .muted { margin-top: 3px; }
#detailNotifyStatus.error { color: var(--red); }
.section-title {
  font-size: 13px;
  font-weight: 800;
  color: #374151;
}
.info-list, .history-list {
  display: grid;
  gap: 6px;
}
.info-row, .history-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.info-row strong, .info-row span { display: block; }
.info-row span { color: var(--muted); font-size: 12px; }
.history-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.history-row strong { margin-left: 6px; }
.history-row p { margin: 6px 0 0; color: #374151; }
.history-row time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.empty-inline {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fafafa;
}
.error-box {
  border: 1px solid rgba(220,38,38,0.18);
  background: rgba(220,38,38,0.06);
  color: #991b1b;
  border-radius: 8px;
  padding: 10px 12px;
  word-break: break-word;
}
.mode-note {
  border: 1px solid #dbe5ff;
  background: #f8fbff;
  color: #374151;
  border-radius: 8px;
  padding: 10px 12px;
}
.mode-note.enabled {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.settings-list {
  padding: 18px;
  display: grid;
  gap: 12px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.muted { color: var(--muted); }
.input { width: 100%; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 12px; color: var(--muted); }
.switch-row { display: flex; align-items: center; justify-content: space-between; }
.form-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin: 12px 0;
  background: var(--panel-2);
}
.form-section .field { margin-bottom: 8px; }
.group-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
}
.btn-small { height: 30px; padding: 0 9px; font-size: 12px; }
.group-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 190px;
  overflow: auto;
}
.group-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.group-picker-item span { overflow-wrap: anywhere; }
.field-help {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}
.login-fields {
  display: grid;
  gap: 4px;
  padding-top: 4px;
}
.notify-form {
  padding: 12px 14px 14px;
  display: grid;
  gap: 12px;
}
.notify-form .field {
  margin-bottom: 0;
}
.notify-compact-head {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.notify-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}
.notify-grid .field:nth-child(n+3) {
  grid-column: span 1;
}
.notify-grid .field:nth-child(3),
.notify-grid .field:nth-child(4),
.notify-grid .field:nth-child(5),
.notify-grid .field:nth-child(6) {
  grid-column: span 1;
}
.notify-grid .field.notify-wide-field {
  grid-column: 1 / -1;
}
.qq-notify-grid {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.35fr);
}
.qq-notify-grid .qq-token-field {
  grid-column: 1 / -1;
}
.notify-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  margin-top: 4px;
}
.notify-footer .field-help {
  margin-bottom: 6px;
}
.notify-status {
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #374151;
  background: var(--panel-2);
  word-break: break-word;
}
.notify-status.error {
  border-color: rgba(220,38,38,0.18);
  color: #991b1b;
  background: rgba(220,38,38,0.06);
}
.notify-form .form-section {
  margin: 0;
}
.notify-form .dialog-head {
  margin-bottom: 10px;
}
.hidden { display: none !important; }
.dialog {
  border: none;
  padding: 0;
  border-radius: 8px;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
}
.dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.dialog-card {
  background: #fff;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 32px);
  min-height: 460px;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 16px 20px 12px;
}
.dialog-head h3 { margin: 0; font-size: 18px; }
.icon-btn {
  width: 38px;
  padding: 0;
  cursor: pointer;
  border-radius: 999px;
}
.site-dialog-tabs {
  display: flex;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.site-dialog-tab {
  min-width: 104px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.site-dialog-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 700;
}
.site-dialog-body { overflow: auto; min-height: 0; }
.site-dialog-panel { display: none; padding: 18px 20px; }
.site-dialog-panel.active { display: block; }
.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.dialog-grid .field { margin: 0; }
.dialog-grid .span-2, .span-2 { grid-column: 1 / -1; }
.usage-ratio-input {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.usage-ratio-prefix {
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: #374151;
  font-weight: 700;
}
.switch-field {
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.switch-field > span { color: #374151; font-size: 13px; }
.dialog-section + .dialog-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.balance-dialog-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.balance-dialog-section .switch-field,
.balance-threshold-field { min-height: 62px; margin: 0; }
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 0; }
.dialog-actions .btn { min-width: 94px; }
.account-section { display: grid; gap: 12px; justify-items: start; }
.account-list { display: grid; gap: 12px; width: 100%; }
.account-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.account-card.primary { border-color: #cdeedd; background: #f8fdfa; }
.account-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.account-card-head .account-name-input { flex: 1; min-width: 160px; }
.account-card-head .action-row { flex-wrap: wrap; }
.account-status { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.account-msg { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.account-msg:empty { display: none; }
.account-msg.error, .account-error { color: var(--red); }
.account-balances { display: grid; gap: 2px; font-size: 12px; white-space: nowrap; }
.account-info-row .account-error { color: var(--red); }
.dialog-msg { flex: 1; min-width: 0; min-height: 20px; color: var(--muted); overflow-wrap: anywhere; }
.dialog-msg.error { color: var(--red); }

.toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10000;
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: min(380px, calc(100vw - 36px));
  padding: 11px 14px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.toast.error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.toast.visible { opacity: 1; transform: translateY(0); }

.login-page {
  min-height: 100vh;
  background: #eef2f7;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-panel {
  width: min(420px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.login-brand .brand-mark {
  flex: 0 0 auto;
  background: #172554;
}
.login-brand h1 { margin: 0; font-size: 19px; }
.login-brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.login-form { display: grid; gap: 14px; }
.login-form .field { margin: 0; }
.login-submit { width: 100%; margin-top: 2px; }
.login-message { min-height: 20px; color: var(--muted); text-align: center; }
.login-message.error { color: var(--red); }

.action-row { display: flex; gap: 8px; flex-wrap: wrap; }

.panel-head-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.report-scope-dialog { width: min(640px, calc(100vw - 32px)); }
.report-scope-card {
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: min(560px, calc(100vh - 48px));
}
.dialog-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.report-scope-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 20px 14px;
  min-height: 0;
}
.report-scope-body .field-help { margin: 0; }
.report-scope-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.report-scope-toolbar .input { flex: 1; min-width: 180px; }
.report-scope-list { display: grid; gap: 12px; overflow: auto; min-height: 0; padding-right: 4px; }
.report-scope-group { display: grid; gap: 4px; }
.report-scope-group-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.report-scope-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.report-scope-row:hover { background: #fbfcff; }
.report-scope-row.off { background: var(--panel-2); border-style: dashed; }
.report-scope-row.disabled { background: var(--panel-2); color: var(--muted); cursor: default; }
.report-scope-row.disabled:hover { background: var(--panel-2); }
.report-scope-row input[type="checkbox"] { margin-top: 3px; flex: 0 0 auto; }
.report-scope-name { display: grid; gap: 1px; min-width: 0; flex: 1; }
.report-scope-name strong { font-size: 13px; line-height: 1.45; }
.report-scope-name span { color: var(--muted); font-size: 12px; line-height: 1.4; word-break: break-all; }
.report-scope-flag { display: flex; gap: 4px; flex-wrap: wrap; }
.report-scope-empty { padding: 20px; text-align: center; color: var(--muted); }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    padding: 12px 14px;
    gap: 12px;
  }
  .brand-mark { width: 36px; height: 36px; border-radius: 8px; }
  .nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .nav-item { flex: 0 0 auto; padding: 8px 10px; }
  .nav-logout { margin-top: 0; border-top: 0; }
  .sidebar-foot { display: none; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-grid, .bottom-grid, .overview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .main { padding: 14px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .stats-grid { grid-template-columns: 1fr; }
  .toolbar { width: 100%; }
  .group-picker { grid-template-columns: 1fr; }
  .dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .dialog-card { max-height: calc(100vh - 16px); min-height: min(600px, calc(100vh - 16px)); }
  .site-dialog-tabs { overflow-x: auto; padding: 0 12px; }
  .site-dialog-panel { padding: 14px; }
  .dialog-grid, .balance-dialog-section { grid-template-columns: 1fr; }
  .notify-grid, .qq-notify-grid { grid-template-columns: 1fr; }
  .notify-grid .field, .qq-notify-grid .qq-token-field { grid-column: auto; }
  .notify-footer { grid-template-columns: 1fr; align-items: stretch; }
  .dialog-grid .span-2, .span-2 { grid-column: auto; }
  .dialog-footer { align-items: stretch; flex-direction: column; padding: 10px 14px; }
  .dialog-actions { width: 100%; flex-wrap: wrap; }
  .dialog-actions .btn,
  #queryTodayUsageBtn { flex: 1 1 calc(50% - 5px); min-width: 0; padding: 0 8px; }
}
