/* Dream 数据连接器 — UI 2.0
   EcWork 风格：浅色侧栏、白色页头、1px 边框、无阴影、收敛的主色。 */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #fafbfc;
  --sidebar: #f7f8fa;
  --ink: #1f2329;
  --ink-2: #3a4048;
  --ink-3: #565e68;
  --muted: #8a919c;
  --muted-2: #a8aeb8;
  --line: #e5e7eb;
  --line-soft: #eef0f3;
  --line-strong: #d5d9e0;
  --primary: #2f6feb;
  --primary-hover: #245ed0;
  --primary-soft: #eaf1ff;
  --primary-line: #c9daf8;
  --green: #12805c;
  --green-soft: #ecf8f2;
  --green-line: #cfeadd;
  --amber: #b25e09;
  --amber-soft: #fff7e8;
  --amber-line: #f4dfba;
  --red: #c63c32;
  --red-soft: #fef3f1;
  --red-line: #f5d3ce;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --font: "OPPO Sans 4.0", "PingFang SC", "Microsoft YaHei", "微软雅黑", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font-family: inherit; }
button { color: inherit; }
button:focus-visible, .chip:focus-visible, .nav-item:focus-visible {
  outline: 2px solid #9dbcf5;
  outline-offset: 2px;
}
a { color: var(--primary); text-decoration: none; }
::selection { background: #d9e6ff; color: var(--ink); }

.app { display: flex; min-height: 100vh; }

/* ------------------------------ Sidebar ------------------------------ */

.sidebar {
  width: 224px;
  flex: 0 0 224px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 14px 10px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font-weight: 700; font-size: 15px;
  display: grid; place-items: center;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: 0.1px; }
.brand-text span { color: var(--muted); font-size: 10.5px; margin-top: 2px; }

.sidebar-new {
  height: 34px;
  margin: 0 2px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sidebar-new:hover { background: #fff; border-color: var(--primary-line); color: var(--primary); }
.sidebar-new svg { width: 15px; height: 15px; flex-shrink: 0; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  padding: 0 10px;
  margin: 2px 0 6px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.nav-label:not(:first-child) { margin-top: 8px; }
.nav-sep { height: 1px; margin: 10px 10px 12px; background: var(--line); }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 36px;
  border: 0; border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  font-size: 13px; font-weight: 500;
  padding: 0 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: #eef0f4; color: var(--ink); }
.nav-item.is-active { background: var(--primary-soft); color: var(--ink); font-weight: 600; }
.nav-item.is-active .nav-icon { color: var(--primary); }
.nav-icon { width: 17px; height: 17px; display: inline-flex; color: #7a828d; flex-shrink: 0; }
.nav-icon svg { width: 17px; height: 17px; }

.sidebar-foot {
  margin-top: auto;
  display: flex; align-items: center; gap: 9px;
  padding: 12px 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
}
.sidebar-foot:hover { background: #eef0f4; }
.sidebar-foot b { display: block; color: var(--ink-2); font-size: 12px; font-weight: 500; }
.sidebar-foot small { font-size: 10.5px; color: var(--muted); }
.foot-copy { min-width: 0; }
.foot-arrow { margin-left: auto; color: var(--muted-2); font-size: 16px; line-height: 1; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #18a06a; box-shadow: 0 0 0 3px #dcf3e8; flex-shrink: 0; }

/* ------------------------------ Main / topbar ------------------------------ */

.main {
  flex: 1; min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  min-height: 70px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-copy { min-width: 0; }
.breadcrumb {
  display: none;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
}
.breadcrumb:not(:empty) { display: block; }
.topbar-title h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: 0;
}
.topbar-title p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.page-tabs { display: flex; align-items: center; gap: 22px; }
.page-tab {
  position: relative;
  height: 40px;
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: transparent; padding: 0 2px;
  color: var(--muted);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.page-tab svg { width: 14px; height: 14px; }
.page-tab:hover { color: var(--primary); }
.page-tab.is-active { color: var(--primary); font-weight: 600; }
.page-tab.is-active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--primary);
}

.view {
  flex: 1;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 20px 24px 48px;
  animation: fade-in 0.15s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.stack { display: flex; flex-direction: column; gap: 16px; }

/* ------------------------------ Buttons ------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  padding: 0 14px;
  font-size: 13px; font-weight: 500; line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink-3); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); border-color: #b9c3d2; color: var(--primary); }
.btn.soft { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary); }
.btn.soft:hover:not(:disabled) { background: #dfeaff; }
.btn.danger { background: var(--red-soft); border-color: var(--red-line); color: var(--red); }
.btn.danger:hover:not(:disabled) { background: #fbe5e2; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.link { height: auto; padding: 0; border: 0; background: transparent; color: var(--primary); font-weight: 500; }
.btn.link:hover { text-decoration: underline; }

.icon-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 16px; line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.link-btn {
  border: 0; background: transparent; color: var(--primary);
  font-size: 12px; cursor: pointer; padding: 0;
}
.link-btn:hover { text-decoration: underline; }

/* ------------------------------ Metrics ------------------------------ */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.metric {
  position: relative;
  padding: 16px 18px 15px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.metric-action {
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.metric-action:hover { border-color: var(--primary-line); background: #fbfdff; }
.metric-head { display: flex; align-items: center; gap: 9px; }
.metric-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.metric-icon svg { width: 15px; height: 15px; }
.metric-icon.is-blue { background: #edf3ff; color: var(--primary); }
.metric-icon.is-green { background: #eaf7f0; color: var(--green); }
.metric-icon.is-red { background: #fdf0ee; color: var(--red); }
.metric-icon.is-amber { background: #fff6e6; color: var(--amber); }
.metric-arrow {
  margin-left: auto;
  color: var(--muted-2); font-size: 16px; line-height: 1;
  opacity: 0.5; transition: color 0.15s ease, opacity 0.15s ease;
}
.metric-action:hover .metric-arrow { color: var(--primary); opacity: 1; }
.metric-label,
.metric-value,
.metric-sub { display: block; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 500; }
.metric-value {
  margin-top: 13px;
  color: var(--ink);
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.6px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.metric-value span { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.metric-sub { margin-top: 7px; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-value.is-bad { color: var(--red); }
.metric-value.is-warn { color: var(--amber); }
.metric-value.is-ok { color: var(--green); }

/* ------------------------------ Overview split ------------------------------ */

.overview-split {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}
.action-center { min-width: 0; overflow: hidden; }
.action-center .card-head { justify-content: flex-start; }
.action-center .card-head .btn { margin-left: auto; }
.action-center .card-body { padding: 14px 16px; }
.action-subsection {
  padding: 12px 16px 6px;
  border-top: 1px solid var(--line-soft);
}
.action-subhead {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
  color: var(--muted); font-size: 11.5px;
}
.recent-fail-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 0;
  border-top: 1px solid var(--line-soft);
  cursor: pointer;
}
.recent-fail-row:hover .recent-fail-copy b { color: var(--primary); }
.recent-fail-row:first-of-type { border-top: 0; }
.recent-fail-flag {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--red-line);
  background: var(--red-soft);
  color: var(--red);
  font-size: 10.5px;
}
.recent-fail-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.recent-fail-copy b { font-size: 12px; font-weight: 500; color: var(--ink); }
.recent-fail-copy small {
  font-size: 10.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recent-fail-time { flex-shrink: 0; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

.node-panel { min-width: 0; }
.node-panel .card-body { padding: 14px 16px; }
.node-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.node-stat {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  text-align: center;
}
.node-stat b { display: block; font-size: 19px; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.node-stat b small { font-size: 10px; color: var(--muted); font-weight: 400; }
.node-stat span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.node-stat.is-online b,
.node-stat.is-ok b { color: var(--green); }
.node-stat.is-warn b { color: var(--amber); }
.node-stat.is-bad b { color: var(--red); }
.node-list { display: flex; flex-direction: column; }
.node-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 2px;
  border-top: 1px solid var(--line-soft);
}
.node-row:first-child { border-top: 0; }
.node-avatar {
  position: relative;
  width: 26px; height: 26px;
  border-radius: 6px;
  background: #f2f4f7;
  color: #8a919c;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.node-avatar svg { width: 13px; height: 13px; }
.node-avatar.on { background: #eef8f3; color: var(--green); }
.node-avatar i {
  position: absolute; right: -1px; bottom: -1px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #c4c9d1;
  border: 1.5px solid var(--surface);
}
.node-avatar.on i { background: #18a06a; }
.node-dot { width: 7px; height: 7px; border-radius: 50%; background: #c4c9d1; flex-shrink: 0; }
.node-dot.on { background: #18a06a; box-shadow: 0 0 0 2px #dcf3e8; }
.node-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.node-copy b { font-size: 12px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-copy small { font-size: 10.5px; color: var(--muted); }
.node-state { font-size: 11px; color: var(--green); flex-shrink: 0; }
.node-state.is-off { color: var(--red); }
.node-empty { padding: 18px 4px; color: var(--muted); font-size: 12px; text-align: center; }
.node-empty p { margin: 0 0 10px; }
.node-more { padding: 8px 2px 0; color: var(--muted); font-size: 11px; }

/* ------------------------------ Cards / sections ------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; min-height: 54px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.card-head:last-child { border-bottom: 0; }
.card-head h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.card-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.card-title { min-width: 0; }
.card-body { padding: 16px 18px; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin: 4px 0 12px;
}
.section-head h2 { margin: 0; font-size: 15px; line-height: 1.4; font-weight: 600; color: var(--ink); }
.section-head p { margin: 4px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.section-head .meta { color: var(--muted); font-size: 12px; }
.section-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.compact-head { margin: 0 0 12px; }

/* ------------------------------ Tables ------------------------------ */

.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table-card table { width: 100%; border-collapse: collapse; }
.table-card th, .table-card td {
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.table-card th {
  color: #737b86;
  font-weight: 600;
  font-size: 12px;
  background: var(--surface-3);
  white-space: nowrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.table-card tbody tr { transition: background 0.12s ease; }
.table-card tbody tr:last-child td { border-bottom: 0; }
.table-card tbody tr:hover { background: #f8faff; }

.platform-table th:nth-child(2),
.platform-table th:nth-child(3),
.platform-table th:nth-child(4),
.platform-table td:nth-child(2),
.platform-table td:nth-child(3),
.platform-table td:nth-child(4) { text-align: center; }
.platform-table th:nth-child(2),
.platform-table td:nth-child(2) { width: 100px; }
.platform-table th:nth-child(3),
.platform-table td:nth-child(3) { width: 110px; }
.platform-table th:nth-child(4),
.platform-table td:nth-child(4) { width: 100px; }
.platform-table th:nth-child(5),
.platform-table td:nth-child(5) { width: 150px; }
.platform-table th:nth-child(6),
.platform-table td:nth-child(6) { width: 110px; }
.platform-table th:last-child,
.platform-table td:last-child { width: 70px; }
.table-card .num { font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-card .strong { font-weight: 600; color: var(--ink); }
.table-card .muted-cell { color: var(--muted); font-size: 12px; }
.table-card .table-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table-card tr.is-clickable { cursor: pointer; }
.table-card tr.is-clickable:hover { background: #f5f9ff; }
.table-card tr.row-attention td { background: #fffafa; }
.table-card tbody tr.row-attention:hover td { background: #fff4f2; }

.table-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted); font-size: 12px;
  background: var(--surface);
}
.table-empty { padding: 38px 16px; text-align: center; color: var(--muted); font-size: 12px; }

.pager { display: flex; align-items: center; gap: 6px; }
.pager-btn {
  height: 26px; padding: 0 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px; cursor: pointer;
}
.pager-btn:hover:not(:disabled) { border-color: var(--primary-line); color: var(--primary); }
.pager-btn:disabled { color: var(--muted-2); cursor: default; }
.pager-now { font-size: 12px; color: var(--muted); min-width: 46px; text-align: center; }

.shop-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.shop-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--primary); font-size: 12px; font-weight: 600;
  background: var(--primary-soft);
  flex-shrink: 0;
}
.shop-cell > div:last-child { min-width: 0; }
.shop-cell-name { font-weight: 500; color: var(--ink); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-cell-id { color: var(--muted); font-size: 11px; margin-top: 1px; }

.task-name { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.task-name b { font-size: 13px; font-weight: 500; color: var(--ink); }
.task-name small { font-size: 11px; color: var(--muted); }
.task-scope { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.task-scope b { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.task-scope small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.task-count { font-weight: 500; color: var(--ink-2); }
.task-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.task-result { max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mono-cell { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.file-cell { white-space: normal; word-break: break-all; max-width: 260px; }

/* ------------------------------ Badges / status ------------------------------ */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 0; padding: 0;
  background: transparent;
  font-size: 12px; font-weight: 400; line-height: 18px;
  white-space: nowrap; color: var(--muted);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.pill.green { color: var(--green); }
.pill.amber { color: var(--amber); }
.pill.red { color: var(--red); }
.pill.blue { color: var(--primary); }
.pill.gray { color: #8b929c; }
.pill.plain::before { display: none; }

.tag {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs); padding: 1px 6px;
  font-size: 11px; color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

/* ------------------------------ Filters / inputs ------------------------------ */

.input {
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  padding: 0 10px;
  font-size: 13px; color: var(--ink-2);
  background: var(--surface);
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:hover { border-color: #b9c3d2; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47, 111, 235, 0.1); }
.input.narrow { width: 84px; }
.input.time { width: 112px; }
select.input {
  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='%238a919c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 28px;
}

.filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.filter-card { padding: 12px 14px; margin-bottom: 14px; }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-row + .filter-row { margin-top: 10px; }
.filter-label { font-size: 12px; color: var(--muted); }
.filter-sep { font-size: 12px; color: var(--muted); }
.filter-hint { font-size: 11px; color: var(--muted); }
.filter-divider { width: 1px; height: 18px; background: var(--line); margin: 0 2px; }
.filter-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-select { width: auto; min-width: 132px; height: 32px; padding-right: 28px; background: var(--surface); }
.filter-search { width: 280px; }
.search-input { width: 240px; }
.date-range { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.date-range input { width: 138px; }
.refund-export-bar .export-mode {
  height: 32px; padding: 0 3px;
  white-space: nowrap; cursor: pointer;
}
.refund-export-bar .export-mode span { font-size: 12px; color: var(--ink-3); }
.refund-export-bar .export-mode input { width: auto; height: auto; accent-color: var(--primary); }
.date-range-box {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-xs);
  background: var(--surface);
}
.date-range-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47, 111, 235, 0.1); }
.date-range-box input[type="date"] {
  width: 124px; height: 28px; padding: 0;
  border: 0; outline: 0; background: transparent;
  color: var(--ink-2); font-size: 13px;
}
.history-date-input { width: 140px; }

/* ------------------------------ Date picker ------------------------------ */

.date-picker {
  position: relative;
  display: inline-flex;
  width: 140px;
  min-width: 0;
  vertical-align: middle;
}
.date-picker.is-wide { width: 100%; }
.date-picker-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.date-picker-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.date-picker-btn:hover { border-color: #b9c3d2; background: #fbfcfe; }
.date-picker-btn:focus-visible { outline: 2px solid #9dbcf5; outline-offset: 1px; }
.date-picker-icon { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.date-picker-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.date-picker-btn.is-empty .date-picker-text { color: var(--muted-2); }
.date-picker-caret { color: var(--muted-2); font-size: 10px; line-height: 1; flex-shrink: 0; }
.form-field .date-picker,
.field .date-picker { width: 100%; }
.date-range-box .date-picker { width: 124px; }
.date-range-box .date-picker-btn {
  height: 30px;
  padding: 0 5px;
  border: 0;
  background: transparent;
}
.date-range-box .date-picker-btn:hover { background: var(--surface-2); }
.date-range .date-picker { width: 138px; }
.date-range-picker {
  position: relative;
  display: inline-flex;
  width: 250px;
  max-width: 100%;
  min-width: 0;
  vertical-align: middle;
}
.date-range .date-range-picker { width: 250px; }
.date-range-btn { width: 100%; font-size: 12.5px; }
.date-range-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.date-range-btn.is-empty .date-range-text { color: var(--muted-2); }
.date-range-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.date-pop {
  position: fixed;
  z-index: 200;
  width: min(292px, calc(100vw - 16px));
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.16);
  animation: pop-in 0.12s ease;
  user-select: none;
}
.date-pop-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 4px;
  margin-bottom: 8px;
}
.date-pop-title {
  border: 0;
  background: transparent;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: default;
}
button.date-pop-title { cursor: pointer; }
button.date-pop-title:hover { background: var(--surface-2); color: var(--primary); }
.date-pop-nav {
  width: 28px; height: 28px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.date-pop-nav:hover { background: var(--surface-2); color: var(--primary); }
.date-pop-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 3px;
}
.date-pop-week span {
  text-align: center;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 500;
}
.date-pop-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.date-pop-day {
  height: 32px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.date-pop-day:hover { background: #f2f6fd; color: var(--primary); }
.date-pop-day.is-today { color: var(--primary); font-weight: 600; box-shadow: inset 0 0 0 1px var(--primary-line); }
.date-pop-day.is-selected { background: var(--primary); color: #fff; box-shadow: none; }
.date-pop-day.in-range { background: #eef4ff; color: var(--primary); }
.date-pop-day.is-range-start,
.date-pop-day.is-range-end { background: var(--primary); color: #fff; box-shadow: none; }
.date-pop-day.is-range-start { border-radius: 4px 0 0 4px; }
.date-pop-day.is-range-end { border-radius: 0 4px 4px 0; }
.date-pop-day.is-range-start.is-range-end { border-radius: 4px; }
.date-pop-day.is-blank { cursor: default; }
.date-pop-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 2px 0 4px;
}
.date-pop-month {
  height: 42px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.date-pop-month:hover { background: var(--primary-soft); color: var(--primary); }
.date-pop-month.is-selected { background: var(--primary); color: #fff; }
.date-pop-foot {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.date-pop-foot button {
  flex: 1;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--ink-3);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.date-pop-foot button:hover { border-color: var(--primary-line); color: var(--primary); }

.chip-row {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px; border-radius: var(--radius-xs);
  background: #f3f4f6;
  flex-wrap: wrap;
}
.chip {
  height: 28px;
  border: 0; border-radius: 2px;
  background: transparent;
  color: var(--ink-3);
  font-size: 13px; font-weight: 400;
  padding: 0 11px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.chip:hover { color: var(--primary); }
.chip.is-active { background: var(--primary); color: #fff; }
.chip .chip-count { font-size: 10px; opacity: 0.72; }
.toolbar-right .chip {
  height: 28px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-xs);
  background: var(--surface);
  font-size: 12px; color: var(--ink-3);
}
.toolbar-right .chip:hover { border-color: #b9c3d2; color: var(--primary); }
.toolbar-right .chip.is-active { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary); }

.segmented {
  display: inline-flex; padding: 2px;
  border: 0; border-radius: var(--radius-xs);
  background: #f3f4f6;
}
.segmented button {
  height: 28px; padding: 0 11px;
  border: 0; border-radius: 2px;
  background: transparent; color: var(--ink-3);
  font-size: 13px; font-weight: 400;
  cursor: pointer;
}
.segmented button.is-active { background: var(--primary); color: #fff; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .meta { font-size: 12px; color: var(--muted); }

.switch {
  position: relative;
  width: 34px; height: 19px;
  border: 0; border-radius: 20px;
  background: #d5d9e0;
  cursor: pointer;
  transition: background 0.18s ease;
  flex-shrink: 0;
}
.switch::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 2px rgba(31, 35, 41, 0.2);
}
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(15px); }
.switch:disabled { opacity: 0.4; cursor: not-allowed; }

/* ------------------------------ Tabs ------------------------------ */

.tabs {
  display: flex; gap: 24px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 16px;
}
.tab {
  position: relative;
  border: 0; background: transparent;
  padding: 0 2px 11px;
  color: var(--ink-3); font-size: 13px; font-weight: 500;
  cursor: pointer;
  display: inline-flex; align-items: center;
}
.tab:hover { color: var(--primary); }
.tab.is-active { color: var(--primary); font-weight: 600; }
.tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--primary);
}
.tab .count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 16px; padding: 0 5px;
  margin-left: 6px; border-radius: 8px;
  background: #f0f2f5; color: var(--muted);
  font-size: 10px; font-weight: 500;
}
.tab.is-active .count { background: var(--primary-soft); color: var(--primary); }

/* ------------------------------ Platform ------------------------------ */

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.platform-tile {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.platform-tile:hover:not(.is-disabled) { border-color: var(--primary-line); background: #fafcff; }
.platform-tile.is-disabled { cursor: default; background: var(--surface-3); }
.platform-logo {
  width: 32px; height: 32px; border-radius: 7px;
  display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}
.platform-logo.mini { width: 22px; height: 22px; border-radius: 5px; font-size: 10px; }
.platform-logo.sm { width: 24px; height: 24px; font-size: 10px; border-radius: 6px; }
.platform-tile.is-disabled .platform-logo { filter: grayscale(1); opacity: 0.4; }
.platform-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.platform-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.platform-desc { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.platform-state { margin-left: auto; flex-shrink: 0; text-align: right; }
.platform-state .pill { font-size: 11px; color: var(--muted); }
.platform-state .pill.green { color: var(--green); }
.platform-count { font-size: 11px; color: var(--muted); margin-top: 2px; text-align: right; }
.platform-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }

.platform-head {
  display: flex; align-items: center; gap: 13px;
  padding: 0 0 16px;
}
.platform-head .platform-logo { width: 36px; height: 36px; font-size: 15px; }
.platform-head-copy { flex: 1; min-width: 0; }
.platform-head-copy h2 { margin: 0; font-size: 17px; line-height: 1.4; font-weight: 600; color: var(--ink); }
.platform-head-copy p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.platform-head-copy .pill { margin-left: 6px; font-size: 11px; vertical-align: 2px; }
.platform-head-actions { display: flex; gap: 8px; flex-shrink: 0; }

.platform-health-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px; padding: 16px 18px;
}
.platform-health {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  text-align: left; cursor: pointer; color: inherit;
}
.platform-health:hover { border-color: var(--primary-line); background: #fafcff; }
.ph-top { display: flex; align-items: center; gap: 8px; }
.ph-top .platform-logo { width: 26px; height: 26px; border-radius: 6px; font-size: 11px; }
.ph-name { font-size: 13px; font-weight: 600; color: var(--ink); flex: 1; min-width: 0; }
.ph-count { font-size: 23px; font-weight: 650; color: var(--ink); line-height: 1.1; }
.ph-count small { margin-left: 5px; font-size: 12px; font-weight: 400; color: var(--muted); }
.ph-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.ph-stats b { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.ph-stats b.is-bad { color: var(--red); }
.upcoming-line {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 4px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 12px; color: var(--muted);
}
.upcoming-line b { font-weight: 500; color: var(--ink-3); }

/* subtle platform status table used on workbench */
.platform-name-cell { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.platform-name-cell div { display: flex; flex-direction: column; line-height: 1.35; }
.platform-name-cell b { font-size: 13px; font-weight: 600; color: var(--ink); }
.platform-name-cell small { font-size: 11px; color: var(--muted); }

/* ------------------------------ Connector catalog ------------------------------ */

.catalog-filter {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.catalog-filter .input { width: 280px; }
.catalog-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 6px;
}
.catalog-group { margin-bottom: 26px; }
.catalog-group h3 { margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--ink); }
.catalog-panel .platform-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.catalog-tile { min-height: 78px; padding: 15px 17px; gap: 13px; }
.catalog-tile .platform-logo { width: 38px; height: 38px; border-radius: 8px; font-size: 15px; }
.catalog-tile .platform-name { font-size: 14px; }
.catalog-tile .platform-desc { font-size: 11px; }
.catalog-arrow { margin-left: auto; color: var(--muted-2); font-size: 18px; line-height: 1; }
.catalog-empty { padding: 44px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ------------------------------ Connector shops ------------------------------ */

.shops-head { align-items: flex-end; }
.shops-head-actions { gap: 8px; flex-wrap: wrap; }
.shop-stat {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 9px;
  border-radius: var(--radius-xs);
  font-size: 12px; color: var(--ink-3);
}
.shop-stat i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.shop-stat.online { background: var(--green-soft); color: var(--green); }
.shop-stat.offline { background: var(--red-soft); color: var(--red); }
.shop-stat.idle { background: #f2f4f7; color: var(--muted); }
.shops-table table { min-width: 1020px; }

/* ------------------------------ Overview: issues ------------------------------ */

.status-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--green-line);
  background: var(--green-soft);
  border-radius: var(--radius);
}
.status-banner.is-warn { border-color: var(--amber-line); background: var(--amber-soft); }
.status-banner-icon {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--green);
  font-size: 12px; font-weight: 700;
  flex: 0 0 24px;
}
.status-banner.is-warn .status-banner-icon { color: var(--amber); }
.status-banner-copy { flex: 1; min-width: 0; }
.status-banner-copy b { display: block; font-size: 13px; color: #146c4c; }
.status-banner.is-warn .status-banner-copy b { color: #8a5208; }
.status-banner-copy small { display: block; margin-top: 2px; font-size: 12px; color: #4d7c67; }
.status-banner.is-warn .status-banner-copy small { color: #96682a; }

.issue-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.issue-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}
.issue-head > div { flex: 1; min-width: 0; }
.issue-head h2 { margin: 0; font-size: 14px; color: var(--ink); }
.issue-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.issue-badge {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--red-soft); color: var(--red);
  border: 1px solid var(--red-line);
  font-size: 12px; font-weight: 700;
  display: inline-grid; place-items: center;
}
.issue-badge.amber { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }
.issue-count {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--red-soft); color: var(--red); font-size: 12px; font-weight: 700;
  display: inline-grid; place-items: center;
}
.issue-list { display: flex; flex-direction: column; }
.issue-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.issue-row:last-child { border-bottom: 0; }
.issue-row:hover { background: #fcfcfd; }
.issue-flag {
  flex: 0 0 auto; font-size: 11px; font-weight: 600; padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: #f2f4f7; color: var(--muted);
}
.issue-flag.red { background: var(--red-soft); color: var(--red); }
.issue-flag.amber { background: var(--amber-soft); color: var(--amber); }
.issue-kind {
  flex: 0 0 44px;
  height: 22px;
  border-radius: var(--radius-xs);
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 600;
  background: var(--red-soft); color: var(--red);
  border: 1px solid var(--red-line);
}
.issue-kind.amber { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }
.issue-copy { flex: 1; min-width: 0; }
.issue-copy b {
  display: block; font-size: 13px; font-weight: 500; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.issue-copy small {
  display: block; margin-top: 2px; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.issue-more {
  width: 100%; border: 0; background: var(--surface-3);
  padding: 9px 16px; text-align: left;
  color: var(--primary); font-size: 12px; cursor: pointer;
  border-top: 1px solid var(--line-soft);
}
.issue-more:hover { background: var(--primary-soft); }

/* ------------------------------ History ------------------------------ */

.history-card .filter-bar { gap: 10px; }
.history-table td.muted-cell { white-space: nowrap; }
.history-group-row td {
  background: var(--surface-2);
  padding: 0;
  border-bottom: 1px solid var(--line);
}
.history-group-title {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
}
.history-group-title .platform-logo.sm {
  width: 20px; height: 20px;
  border-radius: 5px; font-size: 9px;
}
.history-group-title b { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.history-group-title strong { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.history-group-sep { color: var(--muted-2); font-size: 12px; }
.history-group-count { margin-left: auto; color: var(--muted); font-size: 11px; }
.history-date-row td {
  background: var(--surface-2);
  padding: 7px 16px;
  border-bottom: 1px solid var(--line);
}
.history-date-row b { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.history-date-row span { margin-left: 8px; font-size: 11px; color: var(--muted); }
.history-time { font-family: var(--mono); }
.history-summary-table { min-width: 980px; }
.history-summary-row { cursor: pointer; }
.history-summary-row.has-fail > td:first-child { box-shadow: inset 2px 0 0 #ef9a93; }
.history-summary-row:hover td { background: #f8faff; }
.history-summary-row.is-open td { background: #f7faff; }
.history-summary-row > td:first-child { min-width: 210px; }
.history-task-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.history-task-cell .platform-logo.sm { width: 24px; height: 24px; border-radius: 6px; font-size: 10px; }
.history-task-cell > div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.history-task-cell b { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-task-cell small { font-size: 10.5px; color: var(--muted); }
.history-counts { white-space: nowrap; font-size: 12px; color: var(--muted); }
.history-counts b { font-weight: 600; }
.history-counts b.ok { color: var(--green); }
.history-counts b.bad { color: var(--red); }
.history-counts span { margin: 0 4px; color: var(--muted-2); }
.history-toggle-cell { text-align: right; color: var(--muted); font-size: 11px; white-space: nowrap; }
.history-summary-row:hover .history-toggle-cell { color: var(--primary); }
.history-toggle-cell span { margin-left: 4px; }
.history-detail-wrap td { padding: 0; background: var(--surface-3); border-bottom: 1px solid var(--line); }
.history-detail { padding: 10px 16px 12px 48px; }
.history-detail-table { width: 100%; border-collapse: collapse; }
.history-detail-table th,
.history-detail-table td {
  padding: 7px 10px;
  font-size: 11.5px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}
.history-detail-table th { color: var(--muted); font-weight: 500; background: transparent; }
.history-detail-table tbody tr:last-child td { border-bottom: 0; }
.history-detail-table tr.row-attention td { background: #fffafa; }
.history-detail-more { padding: 8px 10px 0; color: var(--muted); font-size: 11px; }
.history-message {
  max-width: 360px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 12px;
}

/* ------------------------------ Data coverage ------------------------------ */

.coverage-card { overflow: hidden; }
.coverage-platform + .coverage-platform { border-top: 1px solid var(--line); }
.coverage-platform-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  background: var(--surface-3);
}
.coverage-platform-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.coverage-platform-name b { font-size: 13px; font-weight: 600; color: var(--ink); }
.coverage-platform-name small { font-size: 11px; color: var(--muted); }
.coverage-list { display: flex; flex-direction: column; }
.coverage-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  padding: 14px 18px;
}
.coverage-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 84px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.coverage-tile:hover { border-color: #b9cdf0; }
.coverage-tile:focus-visible { outline: 2px solid #9dbcf5; outline-offset: 1px; }
.coverage-tile-name { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.coverage-tile b { margin-top: 2px; color: var(--ink); font-size: 20px; font-weight: 600; letter-spacing: -0.2px; font-variant-numeric: tabular-nums; }
.coverage-tile small { margin-top: auto; color: var(--muted); font-family: var(--mono); font-size: 10.5px; }
.coverage-tile.is-ok { background: var(--green-soft); border-color: #d5eddf; }
.coverage-tile.is-warn { background: var(--amber-soft); border-color: #f3e2c2; }
.coverage-tile.is-bad { background: var(--red-soft); border-color: #f2d4d1; }
.coverage-tile.is-idle { background: var(--surface-3); border-color: var(--line-soft); }
.coverage-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) minmax(100px, 2fr) 68px 96px 76px;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 10px 18px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
}
.coverage-name { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coverage-track {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}
.coverage-track i { display: block; height: 100%; border-radius: 3px; background: var(--green); }
.coverage-track i.is-warn { background: var(--amber); }
.coverage-track i.is-bad { background: var(--red); }
.coverage-track i.is-idle { background: #c4c9d1; }
.coverage-ratio { font-family: var(--mono); font-size: 12px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.coverage-date { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }
.coverage-row .pill { justify-self: end; }

/* ------------------------------ Data detail ------------------------------ */

.data-detail-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 16px;
}
.data-detail-copy { flex: 1; min-width: 180px; }
.data-detail-copy h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.data-detail-copy p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.data-detail-bar .toolbar-right { margin-left: auto; }

/* ------------------------------ Data center ------------------------------ */

.data-tabs {
  display: inline-flex; gap: 2px;
  padding: 2px; background: #f3f4f6;
  border: 0; border-radius: var(--radius-xs);
  margin-bottom: 16px;
  overflow-x: auto;
}
.data-tab {
  display: inline-flex; align-items: center; gap: 0;
  height: 28px; padding: 0 11px;
  border: 0; border-radius: 2px;
  background: transparent; color: var(--ink-3);
  font-size: 13px; font-weight: 400; cursor: pointer;
  white-space: nowrap;
}
.data-tab:hover { color: var(--primary); }
.data-tab.is-active { background: var(--primary); color: #fff; }
.data-tab .dot { display: none; }

.data-type-bar {
  display: flex; align-items: center; gap: 2px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}
.data-type-bar .data-tab { height: 32px; padding: 0 13px; }
.data-type-bar .data-tab.is-active { background: var(--primary); color: #fff; }

.data-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin: 0;
}
.data-toolbar h2 { margin: 0; font-size: 16px; line-height: 1.4; font-weight: 600; color: var(--ink); }
.data-toolbar p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.data-toolbar .toolbar-right { justify-content: flex-end; }

.matrix-card { margin-bottom: 4px; overflow-x: auto; }
.matrix-card .card-head { background: var(--surface); }
.matrix-table { min-width: 900px; }
.matrix-table th { white-space: nowrap; }
.matrix-platform-head { min-width: 180px; }
.matrix-platform { display: flex; align-items: center; gap: 9px; }
.matrix-platform .platform-logo.sm { width: 24px; height: 24px; font-size: 11px; border-radius: 6px; }
.matrix-platform div { display: flex; flex-direction: column; line-height: 1.35; }
.matrix-platform b { font-size: 12.5px; color: var(--ink); font-weight: 600; }
.matrix-platform small { font-size: 11px; color: var(--muted); }
.matrix-cell {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  min-width: 78px; padding: 4px 8px; border-radius: var(--radius-xs);
  border: 1px solid transparent; background: transparent;
  cursor: default; text-align: left;
}
.matrix-cell b { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.matrix-cell small { font-size: 10.5px; color: var(--muted); }
.matrix-cell.is-ok { background: var(--green-soft); border-color: #d5eddf; }
.matrix-cell.is-warn { background: var(--amber-soft); border-color: #f3e2c2; }
.matrix-cell.is-bad { background: var(--red-soft); border-color: #f2d4d1; }
.matrix-cell.is-idle,
.matrix-cell.is-empty { color: var(--muted-2); cursor: default; background: var(--surface-3); }
.matrix-cell.is-empty { display: inline-block; }
.matrix-legend { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; flex-wrap: wrap; }
.matrix-legend span { display: inline-flex; align-items: center; gap: 5px; }
.matrix-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.matrix-legend .ok { background: var(--green-soft); border: 1px solid var(--green-line); }
.matrix-legend .warn { background: var(--amber-soft); border: 1px solid var(--amber-line); }
.matrix-legend .bad { background: var(--red-soft); border: 1px solid var(--red-line); }

.data-alert {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; margin-bottom: 12px;
  border: 1px solid var(--amber-line); background: var(--amber-soft);
  border-radius: var(--radius);
}
.data-alert-flag {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 22px;
  display: grid; place-items: center;
  background: #f9e3bb; color: #8a5208; font-weight: 700; font-size: 12px;
}
.data-alert-copy { flex: 1; min-width: 0; }
.data-alert-copy b { display: block; color: #8a5208; font-size: 13px; }
.data-alert-copy small { display: block; margin-top: 2px; color: #96682a; font-size: 12px; }

.data-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 12px;
  overflow: hidden;
}
.data-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.data-card-head h4 { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink); }
.data-card-body { padding: 13px 14px; }
.data-card .result-grid { margin: 0; }
.data-card .result-tile { background: var(--surface); }
.data-meta { margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.data-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.file-link { color: var(--primary); font-weight: 500; text-decoration: none; font-size: 12px; }
.file-link:hover { text-decoration: underline; }
.qc-fee-table th, .qc-fee-table td { padding: 8px 10px; font-size: 12px; }
.qc-fee-table .mono-cell { font-size: 11px; }
.qc-fee-table td:first-child { white-space: nowrap; }

/* ------------------------------ Empty ------------------------------ */

.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-icon {
  width: 42px; height: 42px; border-radius: 50%;
  margin: 0 auto 12px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted-2);
  font-size: 16px; font-weight: 500;
}
.empty h3 { margin: 0 0 6px; font-size: 14px; font-weight: 500; color: var(--ink-3); }
.empty p { margin: 0 0 16px; font-size: 12px; line-height: 1.6; color: var(--muted); }

/* ------------------------------ Queue ------------------------------ */

.dispatch-card { margin-bottom: 16px; }
.dispatch-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.field .input,
.field select { width: 100%; }
.dispatch-submit .btn { width: 100%; height: 32px; }
.queue-hint { margin-top: 12px; font-size: 11.5px; line-height: 1.65; color: var(--muted); }
.queue-form .filter-row { gap: 8px; }
.queue-form .filter-select { min-width: 140px; }
.queue-message {
  max-width: 260px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.queue-machine { display: flex; flex-direction: column; line-height: 1.35; }
.queue-machine b { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.queue-machine small { font-size: 11px; color: var(--muted); }
.row-muted td { opacity: 0.62; }

.multi-select { position: relative; }
.multi-select summary {
  list-style: none;
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
}
.multi-select summary::-webkit-details-marker { display: none; }
.multi-select summary > span:first-child { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.multi-select[open] summary { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47, 111, 235, 0.1); }
.multi-select-panel {
  position: absolute;
  z-index: 55;
  top: calc(100% + 4px);
  left: 0;
  width: 320px;
  max-width: calc(100vw - 48px);
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.14);
}
.multi-select-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.multi-select-tools .input { flex: 1; height: 30px; }
.multi-select-list { max-height: 260px; overflow-y: auto; }
.multi-option {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 6px;
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  cursor: pointer;
}
.multi-option:hover { background: var(--surface-2); }
.multi-option input { accent-color: var(--primary); margin: 0; flex-shrink: 0; }
.multi-option span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-option small { color: var(--muted); font-size: 10.5px; flex-shrink: 0; }
.multi-select-empty { padding: 20px 8px; text-align: center; color: var(--muted); font-size: 12px; }

.policy-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.policy-check input { accent-color: var(--primary); margin: 0; }
.policy-window-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  color: var(--ink-2); font-size: 12px;
}
.policy-window-head small { margin-left: 6px; color: var(--muted); font-weight: 400; }
.policy-window-list { display: flex; flex-direction: column; gap: 8px; }
.policy-window-row { display: flex; align-items: center; gap: 8px; }
.policy-window-row input[type="time"] {
  width: 128px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
}
.policy-window-row input[type="time"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47, 111, 235, 0.1); }
.policy-window-remove { width: 26px; height: 26px; font-size: 14px; }
.policy-shop-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  color: var(--ink-2); font-size: 12px;
}
.policy-shop-head small { margin-left: 6px; color: var(--muted); font-weight: 400; }
.policy-shop-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.policy-shop-option {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 8px;
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  cursor: pointer;
}
.policy-shop-option:hover { background: var(--surface-2); }
.policy-shop-option input { accent-color: var(--primary); margin: 0; flex-shrink: 0; }
.policy-shop-option span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.policy-shop-option small { color: var(--muted); font-size: 10.5px; flex-shrink: 0; }

/* ------------------------------ Settings ------------------------------ */

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-card { padding: 18px 20px; }
.settings-card h3 { margin: 0 0 5px; font-size: 14px; font-weight: 600; color: var(--ink); }
.settings-card > p { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.settings-card.span-2 { grid-column: 1 / -1; }

.setting-line {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-soft);
}
.setting-line:first-of-type { border-top: 0; }
.setting-line .label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.setting-line .desc { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.token-box {
  flex: 1; min-width: 0;
  height: 32px; display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-xs);
  background: var(--surface-2); color: var(--ink-3);
  font-family: var(--mono); font-size: 11.5px;
  padding: 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.code-block {
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-all;
  overflow-x: auto;
}
.code-block .c { color: var(--muted); }

.notice {
  border-radius: var(--radius-xs); padding: 10px 12px;
  background: var(--amber-soft); border: 1px solid var(--amber-line);
  color: #8a5a00; font-size: 12px; line-height: 1.6;
}
.notice code {
  font-family: var(--mono);
  background: #fdf2d9; color: #7a4f00;
  padding: 1px 5px; border-radius: 3px;
  word-break: break-all;
}

/* ------------------------------ Drawer ------------------------------ */

.drawer-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(17, 24, 39, 0.42);
  display: flex; justify-content: flex-end;
  animation: fade-in 0.15s ease;
}
.drawer {
  width: min(1080px, 100%); height: 100%;
  background: var(--surface);
  box-shadow: -8px 0 30px rgba(17, 24, 39, 0.12);
  display: flex; flex-direction: column;
  animation: slide-in 0.2s ease;
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }

.drawer-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}
.drawer-head .grow { flex: 1; min-width: 0; }
.drawer-head h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; color: var(--ink); }
.drawer-head p { margin: 0; color: var(--muted); font-size: 12px; }
.drawer-tabs {
  display: flex; gap: 24px; padding: 0 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.drawer-tab {
  position: relative; border: 0; background: transparent;
  padding: 11px 0; color: var(--ink-3); font-size: 13px; font-weight: 500;
  cursor: pointer;
}
.drawer-tab:hover { color: var(--primary); }
.drawer-tab.is-active { color: var(--primary); font-weight: 600; }
.drawer-tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--primary);
}
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px 40px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.drawer-section { margin-bottom: 24px; }
.drawer-section h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink); }
.drawer-note { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 8px; }

.detail-section + .detail-section { margin-top: 28px; }
.detail-section-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 12px;
}
.detail-section-head h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.detail-section-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.task-detail-summary {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  margin-bottom: 12px;
  font-size: 12px; color: var(--ink-3);
}
.task-detail-table table { min-width: 940px; }
.task-detail-table td.muted-cell { white-space: nowrap; }
.task-detail-body .filter-card { margin-bottom: 12px; }
.task-detail-body .filter-card .input { width: 140px; }
.task-detail-body .filter-card .filter-select { width: auto; min-width: 132px; }
.task-detail-body .filter-card #shopTaskType { width: 180px; }

.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.result-tile {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
}
.result-label { display: block; color: var(--muted); font-size: 11px; }
.result-value { display: block; margin-top: 5px; font-size: 19px; font-weight: 600; letter-spacing: -0.2px; color: var(--ink); }

.kv { display: flex; flex-direction: column; gap: 9px; }
.kv-row { display: flex; align-items: flex-start; gap: 12px; font-size: 12.5px; }
.kv-row .k { width: 92px; flex-shrink: 0; color: var(--muted); }
.kv-row .v { color: var(--ink-2); word-break: break-all; }
.kv-row .v.mono { font-family: var(--mono); font-size: 11.5px; }

.cookie-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cookie-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs); padding: 2px 6px;
  font-family: var(--mono);
}
.key-dot { width: 5px; height: 5px; border-radius: 50%; background: #c4c9d1; }
.key-dot.on { background: var(--green); }

.cookie-table { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.cookie-table table { width: 100%; border-collapse: collapse; }
.cookie-table th, .cookie-table td { padding: 8px 11px; font-size: 12px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.cookie-table th { background: var(--surface-3); color: var(--muted); font-weight: 600; font-size: 11px; }
.cookie-table tr:last-child td { border-bottom: 0; }
.cookie-table .val { font-family: var(--mono); color: var(--muted); word-break: break-all; }

.proxy-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.proxy-form input {
  height: 32px; border: 1px solid var(--line-strong); border-radius: var(--radius-xs);
  padding: 0 10px; font-size: 13px; color: var(--ink-2); background: var(--surface);
}
.proxy-form input:focus { outline: none; border-color: var(--primary); }

/* ------------------------------ Modal ------------------------------ */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(17, 24, 39, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fade-in 0.15s ease;
}
.modal {
  width: min(480px, 100%);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(17, 24, 39, 0.18);
  overflow: hidden;
  animation: pop-in 0.16s ease;
}
.modal.wide { width: min(640px, 100%); }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 20px 24px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: var(--ink); }
.modal-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.modal-body { padding: 18px 24px; max-height: 62vh; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.modal-foot .spacer { margin-right: auto; color: var(--muted); font-size: 11px; }

.form-grid { display: flex; flex-direction: column; gap: 13px; }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-row > .form-field { flex: 1; min-width: 120px; }
.form-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.form-field > span { color: var(--ink-2); font-weight: 500; }
.form-field input, .form-field select {
  height: 32px; border: 1px solid var(--line-strong); border-radius: var(--radius-xs);
  padding: 0 10px; font-size: 13px; color: var(--ink-2); background: var(--surface);
  min-width: 0;
}
.form-field input:focus, .form-field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47, 111, 235, 0.1); }
.form-hint { color: var(--muted); font-size: 11px; line-height: 1.6; }

.shop-choice-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.shop-choice {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.shop-choice:hover { border-color: var(--primary-line); background: #fafcff; }
.shop-choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.shop-choice input { accent-color: var(--primary); margin: 0; flex-shrink: 0; }
.shop-choice-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.shop-choice-name { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-choice-meta { font-size: 11px; color: var(--muted); }

.login-head {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 22px 24px 14px;
}
.login-orb {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary);
  color: #fff; font-weight: 600; font-size: 16px;
  display: grid; place-items: center; flex-shrink: 0;
}
.login-orb.success { background: var(--green); }
.login-orb.failed { background: var(--red); }
.login-orb .spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-copy { flex: 1; min-width: 0; }
.login-copy h3 { margin: 1px 0 6px; font-size: 16px; font-weight: 600; color: var(--ink); }
.login-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; word-break: break-word; }
.steps { list-style: none; margin: 0; padding: 0 24px; display: flex; flex-direction: column; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 9px 0; color: var(--muted-2); font-size: 12px; }
.step-dot {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface-2); color: var(--muted-2);
  font-size: 10px; font-weight: 600;
}
.steps li.done { color: var(--ink-2); }
.steps li.done .step-dot { background: var(--green-soft); color: var(--green); }
.steps li.current { color: var(--primary); font-weight: 500; }
.steps li.current .step-dot { background: var(--primary); color: #fff; }
.steps li.failed { color: var(--red); }
.steps li.failed .step-dot { background: var(--red-soft); color: var(--red); }

/* ------------------------------ Toast ------------------------------ */

.toast-wrap {
  position: fixed; left: 50%; top: 16px; bottom: auto; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 100;
  pointer-events: none;
}
.toast {
  background: var(--surface); color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs); padding: 9px 14px;
  font-size: 13px; line-height: 1.5;
  box-shadow: 0 6px 20px rgba(17, 24, 39, 0.12);
  max-width: 560px;
  animation: toast-in 0.18s ease;
}
.toast.error { color: var(--red); background: var(--red-soft); border-color: var(--red-line); }
.toast.success { color: var(--green); background: var(--green-soft); border-color: var(--green-line); }
.toast.warn { color: var(--amber); background: var(--amber-soft); border-color: var(--amber-line); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ------------------------------ Scrollbars ------------------------------ */

* { scrollbar-width: thin; scrollbar-color: #d2d6dd transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #d2d6dd; border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: #b6bdc7; }
*::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------ Legacy helpers ------------------------------ */

.table-card .table-actions .btn.link { font-size: 12px; }

/* ------------------------------ Responsive ------------------------------ */

@media (max-width: 1320px) {
  .dispatch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dispatch-submit { grid-column: span 1; }
}

@media (max-width: 1180px) {
  .view { padding: 18px 18px 40px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .overview-split { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { width: 200px; flex-basis: 200px; }
  .view .table-card { overflow-x: auto; }
  .table-card table { min-width: 760px; }
  .topbar { padding: 12px 18px; }
  .coverage-row { grid-template-columns: minmax(110px, 1fr) minmax(70px, 1.4fr) 60px 84px 70px; gap: 10px; }
}

@media (max-width: 720px) {
  .app { flex-direction: column; }
  .sidebar {
    position: static; width: 100%; height: auto; flex-basis: auto;
    flex-direction: row; align-items: center; gap: 8px;
    overflow-x: auto; padding: 10px 12px;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .brand { padding: 0 10px 0 0; }
  .brand-text span, .sidebar-new span, .sidebar-foot, .nav-label { display: none; }
  .sidebar-new { width: 34px; padding: 0; justify-content: center; margin: 0; flex-shrink: 0; }
  .nav { flex-direction: row; }
  .nav-sep { display: none; }
  .nav-item { width: auto; padding: 0 10px; white-space: nowrap; }
  .view { padding: 14px 14px 32px; }
  .topbar { min-height: 64px; padding: 10px 14px; flex-wrap: wrap; }
  .topbar-title h1 { font-size: 17px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { padding: 14px 16px; }
  .metric-value { font-size: 22px; }
  .dispatch-grid { grid-template-columns: 1fr 1fr; }
  .coverage-track { display: none; }
  .coverage-row { grid-template-columns: minmax(100px, 1fr) 58px 64px; }
  .coverage-date { display: none; }
  .node-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer { width: 100%; }
  .issue-row { align-items: flex-start; }
  .issue-kind { flex-basis: 44px; }
  .issue-row .btn { flex-shrink: 0; }
}
