:root {
  color-scheme: light;
  --bg: #f2f5f7;
  --panel: #ffffff;
  --panel-soft: #f8fafb;
  --text: #1f2933;
  --muted: #64717f;
  --line: #d7e0e7;
  --soft-line: #e8eef3;
  --accent: #0f766e;
  --accent-soft: #e4f3f0;
  --warn-bg: #fff7e8;
  --warn-text: #8a4b00;
  --bad-bg: #fff0ee;
  --bad-text: #b42318;
  --module-height: calc(100vh - 250px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

.app-layout {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-content: start;
  margin: 0;
  padding: 6px 8px;
}

.workspace-bar {
  grid-column: 2;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.workspace-brand {
  min-width: 128px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.workspace-brand strong {
  font-size: 15px;
}

.workspace-brand span {
  color: var(--muted);
  font-size: 12px;
}

.workspace-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.workspace-tabs button {
  height: 26px;
  padding: 0 12px;
  border-color: transparent;
  color: #536170;
  background: transparent;
}

.workspace-tabs button.active {
  border-color: #c6ded9;
  background: var(--accent-soft);
  color: #115e59;
  font-weight: 700;
}

.workspace-tabs button:disabled {
  color: #9aa7b3;
  background: transparent;
  cursor: default;
}

.workspace-account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.workspace-account[hidden] {
  display: none;
}

.workspace-account button {
  height: 26px;
  padding: 0 9px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: stretch;
  padding: 20px;
  background: #edf2f4;
}

.login-shell {
  place-self: center;
  width: min(380px, 100%);
  border: 1px solid #cfd9df;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(31, 41, 51, 0.12);
}

.login-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--soft-line);
}

.login-head h1 {
  margin: 0;
  font-size: 19px;
}

.login-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.login-form {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: #465463;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  height: 38px;
  font-weight: 400;
}

.login-submit {
  height: 38px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.login-submit:hover {
  border-color: #0b645e;
  background: #0b645e;
}

.login-error {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #efb4ae;
  border-radius: 5px;
  background: var(--bad-bg);
  color: var(--bad-text);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  color: var(--muted);
  font-size: 12px;
}

.app-layout > .site-footer {
  grid-column: 1 / -1;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.blank-shell {
  grid-column: 2;
  width: 100%;
  min-height: calc(100vh - 12px);
  display: grid;
  gap: 6px;
  align-content: start;
}

.query-panel,
.status-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.query-panel {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 96px;
  gap: 8px;
  padding: 6px 10px;
}

.query-panel.hidden {
  display: none;
}

input,
button {
  height: 32px;
  border-radius: 5px;
  font: inherit;
}

input {
  border: 1px solid #cbd6df;
  padding: 0 10px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

button {
  border: 1px solid #cbd6df;
  background: #fff;
  cursor: pointer;
}

button:hover {
  border-color: #9fb1bf;
  background: #f8fafb;
}

button.danger {
  border-color: #f3b4ad;
  background: var(--bad-bg);
  color: var(--bad-text);
  font-weight: 700;
}

#searchBtn {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

#searchBtn:hover {
  background: #0b645e;
}

.panel-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
}

.result-toolbar,
.table-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--soft-line);
  background: #fbfcfd;
}

.result-toolbar button,
.table-tools button {
  height: 34px;
  padding: 0 12px;
}

.history-global-tools {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 10px;
}

.history-global-tools label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.history-global-tools input,
.history-global-tools select {
  width: 112px;
  height: 34px;
  border: 1px solid #cbd6df;
  border-radius: 7px;
  padding: 0 8px;
  background: #fff;
  font: inherit;
}

.history-global-tools input[type="date"] {
  width: 142px;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 16px;
}

p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.status-content {
  padding: 6px 8px 8px;
  display: grid;
  gap: 8px;
}

.machine-rail {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-height: 0;
  padding-top: 42px;
}

.machine-picker {
  position: sticky;
  top: 48px;
  max-height: calc(100vh - 56px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.machine-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--soft-line);
  background: #f4f8fa;
}

.machine-picker-title {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.machine-picker-title strong {
  font-size: 13px;
}

.machine-picker-title small {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}

.machine-picker-all {
  flex: 0 0 auto;
  height: 27px;
  padding: 0 9px;
  border-color: #c5ced3;
  background: #fff;
  color: #53616d;
  font-size: 12px;
  font-weight: 700;
}

.machine-picker-all.active {
  border-color: #8f9b9b;
  background: #e9edec;
  color: #344242;
  box-shadow: inset 0 0 0 1px rgba(84, 101, 99, 0.08);
}

.machine-picker-list {
  max-height: calc(100vh - 94px);
  overflow: auto;
  overflow-anchor: none;
  padding: 6px;
}

.machine-site-group {
  --site-accent: #88969f;
  --site-border: #cbd3d8;
  --site-soft: #f1f4f5;
  overflow: hidden;
  border: 1px solid var(--site-border);
  border-radius: 5px;
  background: #fff;
}

.machine-site-group + .machine-site-group {
  margin-top: 7px;
}

.machine-site-group.site-telecom {
  --site-accent: #71899a;
  --site-border: #bdc9d0;
  --site-soft: #edf2f4;
}

.machine-site-group.site-unicom {
  --site-accent: #788d7d;
  --site-border: #c1ccc2;
  --site-soft: #eff3ef;
}

.machine-site-head {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border-bottom: 1px solid var(--site-border);
  background: var(--site-soft);
}

.machine-site-head strong {
  color: #3f4a50;
  font-size: 12px;
}

.machine-site-head small {
  margin-left: auto;
  color: #66727a;
  font-size: 11px;
}

.machine-site-mark {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--site-accent);
}

.machine-site-list {
  padding: 3px;
}

.machine-picker-item {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  padding: 6px 7px;
  border-color: transparent;
  border-left: 3px solid transparent;
  border-radius: 4px;
  background: transparent;
  text-align: left;
}

.machine-picker-item + .machine-picker-item {
  margin-top: 2px;
}

.machine-picker-item.active {
  border-color: var(--site-border);
  border-left-color: var(--site-accent);
  background: var(--site-soft);
  box-shadow: 0 1px 2px rgba(31, 41, 51, 0.06);
}

.machine-picker-item.active b {
  color: #314047;
}

.machine-picker-item b,
.machine-picker-item small,
.machine-picker-item em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.machine-picker-item b {
  color: var(--text);
  font-size: 13px;
}

.machine-picker-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.machine-picker-item em {
  color: var(--bad-text);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.stats-page {
  display: grid;
  gap: 12px;
}

.stats-workbench {
  display: grid;
  gap: 12px;
}

.stats-function-rail {
  position: sticky;
  top: 48px;
  max-height: calc(100vh - 56px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.stats-function-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--soft-line);
  background: #f4f8fa;
}

.stats-function-head strong {
  font-size: 13px;
}

.stats-function-head span {
  color: var(--muted);
  font-size: 12px;
}

.stats-function-list {
  display: grid;
  gap: 2px;
  padding: 4px;
}

.stats-function-rail button {
  position: relative;
  width: 100%;
  min-height: 40px;
  padding: 7px 8px 7px 12px;
  border-color: transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
}

.stats-function-rail button:hover,
.stats-function-rail button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #0f5f58;
}

.stats-function-rail button.active {
  box-shadow: inset 3px 0 0 var(--accent), 0 1px 2px rgba(31, 41, 51, 0.08);
}

.stats-module-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 12px;
  align-items: start;
}

.stats-license-table-card {
  grid-column: 1 / -1;
}

.stats-license-actions,
.stats-license-source {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.stats-license-actions button {
  min-height: 28px;
  padding: 0 9px;
}

.stats-license-editor-row td {
  padding: 0;
  white-space: normal;
  background: #f7fafb;
}

.stats-license-inline-editor {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) minmax(180px, 0.8fr) minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border-top: 1px solid #cfe2df;
  border-bottom: 1px solid #cfe2df;
  box-shadow: inset 3px 0 0 var(--accent);
}

.stats-license-inline-editor label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.stats-license-inline-editor input {
  width: 100%;
  min-height: 32px;
}

.stats-license-reference {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
  align-self: stretch;
  align-content: center;
  color: #485866;
  font-size: 12px;
}

.stats-license-reference strong,
.stats-license-reference small {
  grid-column: 1 / -1;
}

.stats-license-reference small {
  color: var(--muted);
}

.stats-license-editor-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.stats-license-editor-actions button {
  min-height: 32px;
  white-space: nowrap;
}

.stats-license-editor-actions button.secondary {
  border-color: #cbd6df;
  background: #fff;
  color: #4d5d6b;
}

.stats-empty-workspace {
  display: grid;
  place-items: center;
  min-height: 96px;
  padding: 18px;
  border: 1px dashed #cbd6df;
  border-radius: 6px;
  background: #fbfcfd;
  color: #687785;
  font-size: 13px;
  text-align: center;
}

.stats-reserved-page {
  display: grid;
  min-height: 240px;
}

.stats-table-wrap {
  max-height: min(460px, calc(100vh - 260px));
}

.stats-table {
  min-width: 920px;
}

.stats-table th,
.stats-table td {
  white-space: nowrap;
}

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

.stats-summary-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.stats-summary-card strong {
  color: var(--muted);
  font-size: 12px;
}

.stats-summary-card b {
  font-size: 24px;
  line-height: 1;
}

.stats-summary-card.ok {
  background: #edf8f3;
  border-color: #b9e3ca;
  color: #146c43;
}

.stats-summary-card.warn {
  background: #fff8e8;
  border-color: #ecd59b;
  color: #8a661f;
}

.stats-summary-card.bad {
  background: #fff0ef;
  border-color: #f1b4ae;
  color: #b42318;
}

.stats-summary-card.idle {
  background: #f8fafb;
  color: #64748b;
}

.stats-duplicate-page {
  display: grid;
  gap: 12px;
}

.stats-duplicate-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-debt-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.item-log-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.item-log-toolbar {
  display: grid;
  grid-template-columns: 140px 180px minmax(260px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
  background: #fbfcfd;
}

.item-log-toolbar select,
.item-log-toolbar input {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #243746;
  font: inherit;
}

.item-log-toolbar-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.item-log-toolbar-actions button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #0f766e;
  border-radius: 6px;
  background: #0f766e;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.item-log-toolbar-actions button.secondary {
  border-color: #cbd6df;
  background: #fff;
  color: #4d5d6b;
}

.item-log-toolbar-actions button:disabled {
  border-color: #cbd6df;
  background: #eef3f6;
  color: #94a3b8;
  cursor: not-allowed;
}

.item-log-loading,
.item-log-meta {
  color: var(--muted);
  font-size: 12px;
}

.item-log-meta {
  padding: 8px 12px;
  border-bottom: 1px solid var(--soft-line);
}

.item-log-table-wrap {
  max-height: min(650px, calc(100vh - 320px));
}

.item-log-table {
  min-width: 1420px;
  table-layout: fixed;
}

.item-log-table th:nth-child(1) { width: 118px; }
.item-log-table th:nth-child(2) { width: 160px; }
.item-log-table th:nth-child(3) { width: 150px; }
.item-log-table th:nth-child(4) { width: 150px; }
.item-log-table th:nth-child(5) { width: 130px; }
.item-log-table th:nth-child(6) { width: 150px; }
.item-log-table th:nth-child(7) { width: 90px; }

.item-log-table td {
  vertical-align: top;
}

.item-log-table td.item-log-content {
  min-width: 420px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.item-log-row.copied td {
  background: #f8fafb;
  color: #71808d;
}

.item-log-state,
.item-log-category {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef3f6;
  color: #516371;
  font-size: 12px;
  white-space: nowrap;
}

.item-log-state.new,
.item-log-category.warn {
  background: #fff6dc;
  color: #8a661f;
}

.item-log-state.copied,
.item-log-category.ok {
  background: #edf8f3;
  color: #146c43;
}

.item-log-category.bad {
  background: #fff0ef;
  color: #b42318;
}

.item-log-category.info {
  background: #eaf5f4;
  color: #176b65;
}

.item-log-empty {
  height: 120px;
  color: var(--muted);
  text-align: center;
  vertical-align: middle !important;
}

.stats-duplicate-table-wrap {
  max-height: min(560px, calc(100vh - 255px));
}

.stats-duplicate-table {
  min-width: 1120px;
}

.stats-project-duplicate-table {
  min-width: 1420px;
}

.stats-duplicate-table td:last-child {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-project-duplicate-table td:first-child,
.stats-project-duplicate-table td:nth-child(7),
.stats-project-duplicate-table td:last-child {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-project-alert-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.stats-project-alert {
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.stats-project-alert[open] {
  border-color: #ecd59b;
}

.stats-project-alert summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  background: #fbfcfd;
}

.stats-project-alert[open] summary {
  border-bottom: 1px solid var(--soft-line);
  background: #fff8e8;
}

.stats-project-summary-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.stats-project-summary-main strong {
  font-size: 15px;
  color: #1f2937;
}

.stats-project-summary-main span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.stats-project-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8a661f;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stats-project-summary-meta span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #ecd59b;
}

.stats-project-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
}

.stats-project-meta-grid div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid #e8eef2;
  border-radius: 6px;
  background: #fbfcfd;
}

.stats-project-meta-grid span,
.stats-project-detail-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stats-project-meta-grid strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.stats-project-detail-list {
  display: grid;
}

.stats-project-detail-head,
.stats-project-detail-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(120px, 0.8fr) minmax(240px, 2.4fr) minmax(105px, 0.7fr);
  gap: 10px;
  align-items: start;
  padding: 8px 12px;
  border-bottom: 1px solid #eef2f5;
}

.stats-project-detail-head {
  background: #f5f9fb;
}

.stats-project-detail-row:last-child {
  border-bottom: 0;
}

.stats-project-detail-row strong,
.stats-project-detail-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stats-project-detail-row strong {
  color: #1f2937;
}

.stats-project-note {
  color: #334155;
}

.stats-project-detail-row.empty {
  display: block;
  color: var(--muted);
  text-align: center;
}

.stats-project-table {
  padding: 10px 12px 12px;
}

.stats-project-list-head,
.stats-project-summary-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(130px, 0.9fr) minmax(110px, 0.8fr) minmax(145px, 1fr) minmax(150px, 1fr) minmax(110px, 0.8fr) 96px;
  gap: 10px;
  align-items: center;
}

.stats-project-list-head {
  padding: 0 10px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stats-project-compact-alert-list {
  gap: 6px;
  padding: 0;
}

.stats-project-compact-alert {
  border-color: #d8e2e8;
}

.stats-project-compact-alert[open] {
  border-color: #c9d8df;
}

.stats-project-alert summary.stats-project-summary-row {
  padding: 7px 10px;
  background: #fff;
  grid-template-columns: minmax(180px, 1.2fr) minmax(130px, 0.9fr) minmax(110px, 0.8fr) minmax(145px, 1fr) minmax(150px, 1fr) minmax(110px, 0.8fr) 96px;
  list-style: none;
}

.stats-project-alert summary.stats-project-summary-row::-webkit-details-marker {
  display: none;
}

.stats-project-compact-alert[open] summary.stats-project-summary-row {
  border-bottom: 1px solid var(--soft-line);
  background: #f9fbfc;
}

.stats-project-cell {
  min-width: 0;
  color: #334155;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-project-cell.identity {
  display: grid;
  gap: 1px;
}

.stats-project-cell.identity strong,
.stats-project-cell.identity small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-project-cell.identity strong {
  color: #111827;
  font-size: 13px;
}

.stats-project-cell.identity small {
  color: var(--muted);
  font-size: 12px;
}

.stats-project-count {
  justify-self: end;
  padding: 2px 7px;
  border: 1px solid #ecd59b;
  border-radius: 999px;
  background: #fffaf0;
  color: #8a661f;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stats-project-compact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--soft-line);
  background: #fbfcfd;
  color: #334155;
  font-size: 12px;
}

.stats-project-compact-meta b {
  margin-right: 4px;
  color: var(--muted);
  font-weight: 700;
}

.stats-identity-detail-list {
  display: grid;
}

.stats-identity-table {
  padding: 10px 12px 12px;
}

.stats-identity-list-head,
.stats-identity-summary-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.15fr) minmax(120px, 0.9fr) minmax(140px, 1fr) minmax(160px, 1.1fr) minmax(220px, 1.45fr) 72px;
  gap: 10px;
  align-items: center;
}

.stats-identity-list-head {
  padding: 0 10px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stats-identity-alert-list {
  gap: 6px;
  padding: 0;
}

.stats-identity-alert {
  border-color: #d8e2e8;
}

.stats-identity-alert[open] {
  border-color: #c9d8df;
}

.stats-identity-alert summary.stats-identity-summary-row {
  padding: 7px 10px;
  background: #fff;
  grid-template-columns: minmax(170px, 1.15fr) minmax(120px, 0.9fr) minmax(140px, 1fr) minmax(160px, 1.1fr) minmax(220px, 1.45fr) 72px;
  list-style: none;
}

.stats-identity-alert summary.stats-identity-summary-row::-webkit-details-marker {
  display: none;
}

.stats-identity-alert[open] summary.stats-identity-summary-row {
  border-bottom: 1px solid var(--soft-line);
  background: #f9fbfc;
}

.stats-identity-cell {
  min-width: 0;
  color: #334155;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-identity-cell.identity {
  display: grid;
  gap: 1px;
}

.stats-identity-cell.identity strong,
.stats-identity-cell.identity small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-identity-cell.identity strong {
  color: #111827;
  font-size: 13px;
}

.stats-identity-cell.identity small {
  color: var(--muted);
  font-size: 12px;
}

.stats-identity-cell.note {
  color: #475569;
}

.stats-identity-count {
  justify-self: end;
  padding: 2px 7px;
  border: 1px solid #ecd59b;
  border-radius: 999px;
  background: #fffaf0;
  color: #8a661f;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stats-identity-compact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--soft-line);
  background: #fbfcfd;
  color: #334155;
  font-size: 12px;
}

.stats-identity-compact-meta b {
  margin-right: 4px;
  color: var(--muted);
  font-weight: 700;
}

.stats-identity-compact-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stats-identity-detail-head,
.stats-identity-detail-row {
  display: grid;
  grid-template-columns: minmax(80px, 0.6fr) minmax(72px, 0.5fr) minmax(180px, 1.3fr) minmax(220px, 1.7fr) minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 10px;
  align-items: start;
  padding: 6px 12px;
  border-bottom: 1px solid #eef2f5;
}

.stats-identity-detail-head {
  background: #f5f9fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stats-identity-detail-row:last-child {
  border-bottom: 0;
}

.stats-identity-detail-row strong,
.stats-identity-detail-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stats-identity-detail-row strong {
  color: #1f2937;
}

.stats-identity-detail-row.empty {
  display: block;
  color: var(--muted);
  text-align: center;
}

.stats-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
  background: #fbfcfd;
}

.stats-filter-bar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stats-filter-bar input {
  width: 96px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.stats-filter-bar span {
  color: var(--muted);
  font-size: 12px;
}

.stats-filter-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.stats-filter-actions button {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #0f766e;
  border-radius: 6px;
  background: #0f766e;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.stats-filter-actions button:disabled {
  border-color: #cbd6df;
  background: #eef3f6;
  color: #94a3b8;
  cursor: not-allowed;
}

.stats-filter-actions button.secondary {
  border-color: #cbd6df;
  background: #fff;
  color: #4d5d6b;
}

.debt-filter-note {
  padding: 0 12px 10px;
  color: var(--muted);
  font-size: 12px;
}

.debt-workspace {
  display: block;
  border-top: 1px solid var(--soft-line);
}

.debt-detail-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.debt-detail-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
}

.debt-detail-panel h3 {
  margin: 0;
  color: #1f2937;
  font-size: 14px;
}

.debt-detail-panel p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.debt-view-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f5f9fb;
}

.debt-view-tabs button {
  min-height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #4d5d6b;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.debt-view-tabs button.active {
  background: #0f766e;
  color: #fff;
  font-weight: 700;
}

.copy-fallback-panel {
  margin: 8px 0 0;
  border: 1px solid #cbd6df;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.copy-fallback-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--soft-line);
  background: #f5f9fb;
  font-size: 12px;
}

.copy-fallback-head strong {
  color: #1f2937;
}

.copy-fallback-head span {
  color: var(--muted);
}

.copy-fallback-panel textarea {
  display: block;
  width: 100%;
  height: 180px;
  padding: 10px;
  border: 0;
  resize: vertical;
  font: 12px/1.5 Consolas, "Courier New", monospace;
  color: #1f2937;
  background: #fff;
}

.copy-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.28);
}

.copy-result-dialog {
  width: min(420px, 100%);
  border: 1px solid #cbd6df;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.copy-result-dialog header {
  padding: 13px 16px 10px;
  border-bottom: 1px solid var(--soft-line);
}

.copy-result-dialog header strong {
  display: block;
  color: #1f2937;
  font-size: 17px;
}

.copy-result-overlay.ok .copy-result-dialog header {
  background: #edf8f4;
}

.copy-result-overlay.warn .copy-result-dialog header {
  background: #fff8e7;
}

.copy-result-dialog p {
  margin: 0;
  padding: 16px;
  color: #334155;
  font-size: 14px;
  line-height: 1.7;
}

.copy-result-dialog footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--soft-line);
  background: #fbfcfd;
}

.copy-result-dialog button {
  min-width: 82px;
  min-height: 34px;
  border: 1px solid #0f766e;
  border-radius: 6px;
  background: #0f766e;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.stats-debt-table-wrap {
  max-height: min(620px, calc(100vh - 300px));
}

.stats-debt-table {
  min-width: 1560px;
}

.stats-debt-table.with-password {
  min-width: 1680px;
}

.stats-debt-table th:first-child,
.stats-debt-table td:first-child {
  width: 96px;
}

.stats-debt-table th:nth-child(2),
.stats-debt-table td:nth-child(2),
.stats-debt-table th:nth-child(3),
.stats-debt-table td:nth-child(3) {
  max-width: 160px;
}

.stats-debt-table td.debt-note-cell {
  max-width: 220px;
  color: #475569;
}

.stats-debt-table th:nth-child(4),
.stats-debt-table td:nth-child(4),
.stats-debt-table th:nth-child(5),
.stats-debt-table td:nth-child(5) {
  max-width: 220px;
}

.stats-debt-table th:nth-child(8),
.stats-debt-table td:nth-child(8) {
  max-width: 320px;
}

.stats-debt-table th:nth-child(7),
.stats-debt-table td:nth-child(7) {
  max-width: 180px;
}

.stats-debt-table td.debt-detail-cell {
  max-width: none;
  overflow: visible;
  white-space: normal;
}

.debt-row-details {
  position: relative;
  display: inline-block;
  min-width: 360px;
}

.debt-row-details summary {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  color: #0f766e;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.debt-row-details[open] summary {
  margin-bottom: 0;
}

.debt-row-detail-list {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 40;
  min-width: 680px;
  max-width: min(860px, calc(100vw - 320px));
  max-height: min(320px, calc(100vh - 180px));
  overflow: auto;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.debt-row-details.drop-up .debt-row-detail-list {
  top: auto;
  bottom: calc(100% + 5px);
}

.debt-row-detail-head,
.debt-row-detail-item {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(120px, 0.9fr) minmax(135px, 1fr) minmax(135px, 1fr) minmax(120px, 0.8fr);
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid #eef2f5;
}

.debt-row-detail-head {
  background: #f5f9fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.debt-row-detail-item:last-child {
  border-bottom: 0;
}

.debt-row-detail-item strong,
.debt-row-detail-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debt-row-detail-empty {
  padding: 8px;
  color: var(--muted);
}

.stats-debt-table .debt-work-row.copied td {
  background: #fbfcfd;
  color: #64748b;
}

.stats-debt-table .debt-work-row.copied strong {
  color: #64748b;
}

.stats-debt-table .debt-work-row.new td:first-child {
  box-shadow: inset 3px 0 0 #d6a72d;
}

.stats-debt-detail-list {
  display: grid;
}

.stats-debt-detail-head,
.stats-debt-detail-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(110px, 0.8fr) minmax(150px, 1.1fr) minmax(135px, 1fr) minmax(180px, 1.3fr) minmax(105px, 0.7fr);
  gap: 10px;
  align-items: start;
  padding: 8px 12px;
  border-bottom: 1px solid #eef2f5;
}

.stats-debt-detail-head {
  background: #f5f9fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stats-debt-detail-row:last-child {
  border-bottom: 0;
}

.stats-debt-detail-row strong,
.stats-debt-detail-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stats-debt-detail-row strong {
  color: #1f2937;
}

.stats-debt-detail-row.copied {
  background: #fbfcfd;
  color: #64748b;
}

.stats-debt-detail-row.copied strong {
  color: #64748b;
}

.debt-status-cell {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.debt-copy-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.debt-copy-badge.new {
  border: 1px solid #f4d48c;
  background: #fff8e7;
  color: #8a661f;
}

.debt-copy-badge.done {
  border: 1px solid #d9e2e8;
  background: #eef3f6;
  color: #64748b;
}

.stats-debt-detail-row.empty {
  display: block;
  color: var(--muted);
  text-align: center;
}

.stats-module-card {
  min-height: 0;
}

.stats-module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
  background: #f8fafb;
}

.stats-module-head h2 {
  margin: 0;
  font-size: 15px;
}

.stats-module-head p {
  margin: 3px 0 0;
}

.stats-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.stats-state.ok {
  background: #edf8f3;
  color: #146c43;
}

.stats-state.warn {
  background: #fff8e8;
  color: #8a661f;
}

.stats-state.bad {
  background: #fff0ef;
  color: #b42318;
}

.stats-state.idle,
.stats-state.unknown {
  background: #f6f8fa;
  color: #64748b;
}

.stats-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.stats-kv {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.stats-kv span {
  color: var(--muted);
  font-size: 12px;
}

.stats-kv strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.stats-module-foot {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.stats-inline-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stats-license-logline {
  min-height: 56px;
  padding: 9px 11px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfcfd;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.stats-module-placeholder {
  min-height: 100%;
}

.stats-placeholder-body {
  padding: 16px 12px 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.system-page {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 0;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.system-metric,
.system-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.system-metric {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.system-metric span,
.system-metric small {
  color: var(--muted);
  font-size: 12px;
}

.system-metric strong {
  font-size: 22px;
  line-height: 1.1;
}

.query-node-overview {
  display: grid;
  gap: 8px;
}

.query-node-overview-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.query-node-overview-title strong {
  font-size: 14px;
}

.query-node-overview-title span {
  color: var(--muted);
  font-size: 12px;
}

.query-node-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.query-node-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 3px solid #7d97a5;
  border-radius: 6px;
  background: #fff;
}

.query-node-card.tone-green {
  border-top-color: #71988d;
}

.query-node-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--soft-line);
  background: #f5f8f9;
}

.query-node-card.tone-green > header {
  background: #f3f8f6;
}

.query-node-card > header > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.query-node-card > header strong {
  font-size: 14px;
}

.query-node-card > header div span {
  color: var(--muted);
  font-size: 12px;
}

.query-node-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.query-node-card dl > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border-left: 1px solid var(--soft-line);
}

.query-node-card dl > div:first-child {
  border-left: 0;
}

.query-node-card dt,
.query-node-card dd {
  margin: 0;
}

.query-node-card dt,
.query-node-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.query-node-card dd {
  font-size: 17px;
  font-weight: 700;
}

.system-task-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.system-task-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
  background: #fbfcfd;
}

.system-task-card h2 {
  margin: 0;
  font-size: 14px;
}

.system-task-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.system-task-card header span {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.system-task-card.warn header span {
  border-color: #facc15;
  background: #fffbeb;
  color: #9a6700;
}

.system-task-card.ok header span {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.system-task-card dl {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.system-task-card dt,
.system-task-card dd {
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--soft-line);
  font-size: 12px;
}

.system-task-card dt {
  color: var(--muted);
  background: #fbfcfd;
}

.system-task-card dd {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.system-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.system-panel {
  overflow: hidden;
}

.system-panel h2 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
  background: var(--panel-soft);
  font-size: 14px;
}

.system-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
  background: var(--panel-soft);
}

.system-panel-title h2 {
  padding: 0;
  border-bottom: 0;
  background: transparent;
}

.system-panel-title > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.system-panel-title span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.system-panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.system-panel-title button,
.sync-actions button {
  height: 28px;
  justify-self: start;
  padding: 0 8px;
  font-size: 12px;
}

.sync-actions button {
  white-space: nowrap;
}

.sync-table tr.offline button {
  border-color: #f2b8b5;
  background: #fff;
  color: #a23b36;
}

.system-panel dl {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0;
  margin: 0;
}

.system-panel dt,
.system-panel dd {
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--soft-line);
  font-size: 12px;
}

.system-panel dt {
  color: var(--muted);
  background: #fbfcfd;
}

.system-panel dd {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-diagnostics {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
}

.system-diagnostics > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  cursor: pointer;
  color: #334155;
  list-style: none;
}

.system-diagnostics > summary::-webkit-details-marker {
  display: none;
}

.system-diagnostics > summary::after {
  content: "展开";
  flex: 0 0 auto;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  padding: 3px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.system-diagnostics[open] > summary {
  border-bottom: 1px solid var(--soft-line);
}

.system-diagnostics[open] > summary::after {
  content: "收起";
}

.system-diagnostics > summary span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-diagnostics > .system-panel,
.system-diagnostics > .system-layout {
  margin: 0 10px;
}

.system-diagnostics > .system-panel:last-child {
  margin-bottom: 10px;
}

.watch-panel dl {
  grid-template-columns: 110px minmax(0, 1fr) 110px minmax(0, 1fr);
}

.watch-panel dd:nth-of-type(4),
.watch-panel dd:nth-of-type(7),
.watch-panel dd:nth-of-type(9) {
  white-space: nowrap;
}

.alert-panel {
  overflow: hidden;
}

.system-alert-list {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}

.system-alert {
  width: 100%;
  display: grid;
  grid-template-columns: 140px 140px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  border-radius: 6px;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.system-alert:hover {
  border-color: var(--accent);
}

.system-alert strong,
.system-alert span,
.system-alert small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-alert small {
  color: var(--muted);
}

.system-alert.warn {
  background: #fffaf0;
  border-color: #ecd59b;
}

.system-alert.bad {
  background: #fff4f3;
  border-color: #efb7b1;
}

.sync-table-wrap {
  overflow-x: auto;
}

.sync-table {
  width: 100%;
  min-width: 1080px;
  table-layout: fixed;
}

.sync-table th,
.sync-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
  vertical-align: middle;
}

.sync-table th {
  background: #fbfcfd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sync-table th:nth-child(1),
.sync-table td:nth-child(1) {
  width: 130px;
}

.sync-table th:nth-child(2),
.sync-table td:nth-child(2) {
  width: 82px;
}

.sync-table th:nth-child(3),
.sync-table td:nth-child(3) {
  width: 150px;
}

.sync-table th:nth-child(4),
.sync-table td:nth-child(4),
.sync-table th:nth-child(5),
.sync-table td:nth-child(5) {
  width: 110px;
}

.sync-table th:nth-child(8),
.sync-table td:nth-child(8) {
  width: 110px;
}

.sync-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-table td small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-table tr.offline {
  background: var(--bad-bg);
}

.sync-table tr.active-progress {
  background: #edf8f3;
}

.progress-table .mini-progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf1;
}

.progress-table .mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2f9b73;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 22px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.sync-pill.ok {
  background: #dff5ea;
  color: #167244;
}

.sync-pill.slow,
.sync-pill.unknown {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.sync-pill.stale,
.sync-pill.offline {
  background: var(--bad-bg);
  color: var(--bad-text);
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
}

.agent-manager {
  display: grid;
  grid-template-columns: minmax(230px, 320px) minmax(0, 1fr);
  height: calc(100vh - 330px);
  min-height: 360px;
  max-height: none;
  overflow: hidden;
}

.console-page .agent-manager {
  height: calc(100vh - 475px);
  min-height: 320px;
}

.console-page-machines .agent-manager {
  height: calc(100vh - 180px);
  min-height: 520px;
}

.console-function-rail {
  position: sticky;
  top: 48px;
  max-height: calc(100vh - 56px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.console-function-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--soft-line);
  background: #f4f8fa;
}

.console-function-head strong {
  font-size: 13px;
}

.console-function-head span {
  color: var(--muted);
  font-size: 12px;
}

.console-function-list {
  display: grid;
  gap: 2px;
  padding: 4px;
}

.console-function-list button {
  position: relative;
  width: 100%;
  min-height: 54px;
  padding: 7px 30px 7px 12px;
  border-color: transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  line-height: 1.25;
  text-align: left;
}

.console-function-list button:hover,
.console-function-list button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #0f5f58;
}

.console-function-list button.active {
  box-shadow: inset 3px 0 0 var(--accent), 0 1px 2px rgba(31, 41, 51, 0.08);
}

.console-function-list b,
.console-function-list span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-function-list b {
  font-size: 13px;
}

.console-function-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.console-function-list em {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.console-workflow {
  display: grid;
  gap: 10px;
}

.console-mode-note,
.console-lookup-summary {
  color: var(--muted);
  font-size: 12px;
}

.console-mode-note {
  padding: 8px 10px;
  border: 1px solid #f1d39a;
  border-radius: 6px;
  background: #fffaf0;
  color: #77520b;
}

.file-distribution-panel {
  display: grid;
  gap: 10px;
}

.distribution-box {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.distribution-section-head,
.distribution-submit-row,
.distribution-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.distribution-section-head div:first-child {
  display: grid;
  gap: 2px;
}

.distribution-section-head strong,
.distribution-task-head strong {
  color: #263746;
  font-size: 13px;
}

.distribution-section-head span,
.distribution-submit-row span,
.distribution-task-head span,
.distribution-task-meta,
.distribution-warning,
.distribution-file-summary,
.distribution-empty {
  color: var(--muted);
  font-size: 12px;
}

.distribution-actions,
.distribution-upload-row,
.distribution-result-grid,
.distribution-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.distribution-agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px;
  max-height: 150px;
  overflow: auto;
}

.distribution-agent-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 7px;
  align-items: center;
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid #d7e0e7;
  border-radius: 6px;
  background: #fbfcfd;
}

.distribution-agent-option input {
  grid-row: span 2;
  margin: 0;
}

.distribution-agent-option.disabled {
  opacity: 0.58;
  background: #f3f6f8;
}

.distribution-agent-option.disabled b {
  color: #647484;
}

.distribution-agent-option.disabled span {
  color: #9a6a1e;
}

.distribution-agent-option.warn span {
  color: #9a6a1e;
}

.distribution-agent-option b,
.distribution-agent-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distribution-agent-option b {
  font-size: 12px;
}

.distribution-agent-option span {
  color: var(--muted);
  font-size: 11px;
}

.distribution-form-grid {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  gap: 10px;
  align-items: end;
}

.distribution-form-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.distribution-form-grid select {
  height: 32px;
  border: 1px solid #cbd6df;
  border-radius: 5px;
  padding: 0 8px;
  color: var(--text);
  font: inherit;
}

.distribution-check {
  display: inline-flex !important;
  grid-template-columns: none !important;
  grid-auto-flow: column;
  align-items: center;
  justify-content: start;
  gap: 6px !important;
  min-height: 32px;
}

.distribution-file-picker {
  position: relative;
  display: grid;
  gap: 3px;
  min-width: 210px;
  padding: 10px;
  border: 1px dashed #b7c7d4;
  border-radius: 6px;
  background: #f8fbfc;
  cursor: pointer;
}

.distribution-file-picker:hover {
  border-color: var(--accent);
  background: #f1faf7;
}

.distribution-file-picker b {
  color: #263746;
  font-size: 13px;
}

.distribution-file-picker span {
  color: var(--muted);
  font-size: 12px;
}

.distribution-file-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.distribution-warning {
  padding: 6px 8px;
  border-radius: 5px;
  background: #fffaf0;
  color: #77520b;
}

.distribution-file-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding: 6px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: #fbfcfd;
}

.distribution-file-summary.active {
  border-color: #9ecfc7;
  background: #eefaf7;
  color: #166554;
}

.distribution-file-summary button {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid #9ecfc7;
  border-radius: 4px;
  background: #fff;
  color: #166554;
  cursor: pointer;
  font-size: 12px;
}

.distribution-task-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.distribution-task {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfcfd;
}

.distribution-task-meta {
  align-items: center;
}

.console-lookup-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.console-lookup-head {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 520px) auto;
  align-items: center;
  gap: 12px;
}

.console-lookup-head div {
  display: grid;
  gap: 3px;
}

.console-lookup-head strong {
  color: #263746;
  font-size: 14px;
}

.console-lookup-head span {
  color: var(--muted);
  font-size: 12px;
}

.console-lookup-head input {
  width: 100%;
  height: 32px;
}

.console-lookup-head button {
  height: 32px;
  padding: 0 12px;
  white-space: nowrap;
}

.console-order-panel {
  display: grid;
  gap: 10px;
}

.console-order-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfcfd;
}

.console-order-progress span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid #d7e0e7;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.console-order-progress span.done {
  border-color: #b9dfd7;
  background: #e6f6f1;
  color: #075c52;
  font-weight: 700;
}

.console-order-progress span b {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  background: #e8eef3;
  color: #4d5d6b;
  font-size: 11px;
}

.console-order-progress span.done b {
  background: var(--accent);
  color: #fff;
}

.console-order-progress em {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.console-step-card {
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.console-step-card > header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--soft-line);
  background: #fbfcfd;
}

.console-step-card > header > b {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
}

.console-step-card > header div {
  display: grid;
  gap: 2px;
}

.console-step-card > header strong {
  color: #263746;
  font-size: 13px;
  font-weight: 700;
}

.console-step-card > header span {
  color: var(--muted);
  font-size: 12px;
}

.console-step-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.console-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.console-step-actions button {
  height: 30px;
  padding: 0 10px;
}

.console-order-machine-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 94px;
  overflow: auto;
}

.console-order-machine-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid #cbd6df;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
}

.console-order-machine-option input {
  margin: 0;
}

.console-order-main-script {
  display: grid;
  gap: 8px;
}

.console-script-selected {
  min-height: 28px;
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid #d7e0e7;
  border-radius: 5px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 12px;
}

.console-script-selected strong {
  color: #075c52;
  font-size: 13px;
}

.console-order-main-script input {
  width: 100%;
  height: 32px;
  border: 1px solid #cbd6df;
  border-radius: 5px;
  padding: 0 8px;
  font: inherit;
}

.console-order-script-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 92px;
  overflow: auto;
}

.console-order-script-choices button {
  max-width: 100%;
  height: 26px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid #cbd6df;
  border-radius: 5px;
  background: #fff;
  color: #263746;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-order-script-choices button.active {
  border-color: var(--accent);
  background: #dff4ef;
  color: #075c52;
  font-weight: 700;
}

.console-order-muted {
  color: var(--muted);
  font-size: 12px;
}

.console-order-panel textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border: 1px solid #cbd6df;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  background: #fff;
}

.console-order-preview {
  display: grid;
  gap: 8px;
}

.console-order-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.console-order-preview-head div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.console-order-table-wrap {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.console-order-table {
  min-width: 1680px;
}

.console-order-table td:nth-child(4),
.console-order-table td:nth-child(8),
.console-order-table td:nth-child(13),
.console-order-table td:nth-child(14) {
  max-width: 250px;
}

.console-order-table select {
  width: 100%;
  height: 28px;
  font-size: 12px;
}

.console-order-conflicts {
  display: grid;
  gap: 3px;
}

.console-order-conflicts span,
.console-order-conflicts em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  color: var(--muted);
}

.console-task-panel {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--soft-line);
}

.console-task-panel.console-step-task {
  padding-top: 0;
  border-top: 0;
}

.console-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.console-task-head div:first-child {
  display: grid;
  gap: 3px;
}

.console-task-head strong {
  color: #263746;
  font-size: 13px;
}

.console-task-head span {
  color: var(--muted);
  font-size: 12px;
}

.console-task-actions {
  display: flex;
  gap: 8px;
}

.console-task-actions button {
  height: 30px;
  padding: 0 10px;
}

.console-task-table-wrap {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.console-task-table {
  min-width: 1800px;
}

.console-task-table select,
.console-task-table input {
  width: 100%;
  height: 28px;
  font-size: 12px;
}

.console-task-table td:nth-child(1) {
  max-width: 96px;
}

.console-task-table td:nth-child(9),
.console-task-table td:nth-child(10),
.console-task-table td:nth-child(11),
.console-task-table td:nth-child(12) {
  min-width: 130px;
  max-width: 170px;
}

.console-preflight-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfcfd;
}

.console-preflight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.console-preflight-head div:first-child {
  display: grid;
  gap: 3px;
}

.console-preflight-head strong {
  color: #263746;
  font-size: 13px;
}

.console-preflight-head span {
  color: var(--muted);
  font-size: 12px;
}

.console-preflight-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.console-preflight-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.console-preflight-badge.ok {
  background: #edf8f3;
  color: #146c43;
  border-color: #b9e3ca;
}

.console-preflight-badge.warn {
  background: #fff8e8;
  color: #8a661f;
  border-color: #ecd59b;
}

.console-preflight-badge.bad {
  background: #fff0ef;
  color: #b42318;
  border-color: #f1b4ae;
}

.console-preflight-table-wrap {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.console-preflight-table {
  min-width: 1280px;
}

.console-preflight-table td:nth-child(3),
.console-preflight-table td:nth-child(6),
.console-preflight-table td:nth-child(7) {
  max-width: 260px;
}

.console-order-result-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.console-order-result-table {
  min-width: 1320px;
  table-layout: fixed;
}

.console-order-result-table th,
.console-order-result-table td {
  vertical-align: middle;
}

.console-order-result-table th:nth-child(1),
.console-order-result-table td:nth-child(1) {
  width: 92px;
}

.console-order-result-table th:nth-child(2),
.console-order-result-table td:nth-child(2) {
  width: 230px;
}

.console-order-result-table th:nth-child(9),
.console-order-result-table td:nth-child(9) {
  width: 320px;
}

.console-order-result-row.ok {
  background: #fbfffd;
}

.console-order-result-row.warn {
  background: #fffdf8;
}

.console-order-result-row.bad {
  background: #fffafa;
}

.console-result-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
}

.console-result-pill.success {
  background: #eaf8f0;
  color: #126c43;
  border-color: #a9ddbf;
}

.console-result-pill.fail {
  background: #fff0ef;
  color: #b42318;
  border-color: #f1b4ae;
}

.console-result-pill.pending,
.console-result-pill.running {
  background: #fff8e8;
  color: #8a661f;
  border-color: #ecd59b;
}

.console-progress-cell {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.console-progress-cell strong {
  color: #20313f;
  font-size: 12px;
}

.console-progress-cell span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-sidebar {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 6px;
  border-right: 1px solid var(--soft-line);
  background: #fbfcfd;
  overflow: auto;
  overflow-anchor: none;
}

.agent-card {
  width: 100%;
  height: auto;
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid #d8e4ea;
  border-radius: 6px;
  background: #fff;
  text-align: left;
  line-height: 1.25;
}

.agent-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.agent-card b,
.agent-card span,
.agent-card small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-card-head {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.agent-card-head b {
  min-width: 0;
  color: #0f172a;
  font-size: 14px;
}

.agent-card-state {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 999px;
  background: #edf2f7;
  font-size: 11px;
  font-weight: 700;
}

.agent-card-state.ok {
  background: #e8f6ef;
  color: #146c43;
}

.agent-card-state.bad {
  background: var(--bad-bg);
  color: var(--bad-text);
}

.agent-card-state.idle {
  color: var(--muted);
}

.agent-card-line {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.agent-card-line span {
  min-width: 0;
  flex: 0 1 auto;
}

.agent-card-line span:nth-child(2) {
  flex: 1 1 auto;
}

.agent-card-line .agent-version-inline-warn {
  color: var(--warn-text);
  font-weight: 700;
}

.agent-card span,
.agent-card small,
.agent-runtime dd,
.agent-runtime dt {
  color: var(--muted);
  font-size: 12px;
}

.agent-card .agent-card-warn {
  margin-top: 2px;
  color: var(--bad-text);
  font-weight: 700;
}

.agent-card .agent-card-reset {
  color: var(--ok-text);
  font-weight: 700;
}

.agent-card .agent-card-status {
  font-weight: 700;
}

.agent-card .agent-card-status.ok {
  color: #146c43;
}

.agent-card .agent-card-status.warn {
  color: #8a661f;
}

.agent-card .agent-card-status.bad {
  color: var(--bad-text);
}

.agent-card .agent-card-status.idle {
  color: var(--muted);
}

.agent-card-disks {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  overflow: hidden;
}

.agent-card-disks span {
  min-width: 0;
  max-width: 48%;
  padding: 1px 4px;
  border-radius: 4px;
  background: #eef6f3;
  color: #276356;
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-card-disks span.warn {
  background: #fff0ef;
  color: var(--bad-text);
  font-weight: 700;
}

.agent-card-disks span.more {
  flex: 0 0 auto;
  max-width: none;
  background: #edf2f7;
  color: var(--muted);
}

.agent-card-file {
  width: 100%;
  color: #50606f;
}

.agent-editor {
  min-width: 0;
  min-height: 0;
  padding: 12px;
  overflow: auto;
}

.agent-config-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.agent-config-form.empty {
  color: var(--muted);
  font-size: 13px;
}

.agent-config-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.agent-config-head div {
  display: grid;
  gap: 2px;
}

.agent-config-head span,
.agent-config-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.agent-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-state-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.agent-state-chip.ok {
  background: #edf8f3;
  color: #146c43;
  border-color: #b9e3ca;
}

.agent-state-chip.warn {
  background: #fff8e8;
  color: #8a661f;
  border-color: #ecd59b;
}

.agent-state-chip.bad {
  background: #fff0ef;
  color: #b42318;
  border-color: #f1b4ae;
}

.agent-state-chip.idle {
  background: #f6f8fa;
  color: var(--muted);
  border-color: var(--soft-line);
}

.agent-disk-list {
  display: grid;
  gap: 8px;
}

.agent-disk {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfcfd;
}

.agent-disk.warn {
  border-color: #f1b4ae;
  background: #fff7f6;
}

.agent-disk div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.agent-disk strong,
.agent-disk span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.agent-disk span {
  color: var(--muted);
}

.agent-disk i {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf2;
}

.agent-disk i b {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: #23a36d;
}

.agent-disk.warn i b {
  background: #d92d20;
}

.agent-cleanup-targets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.agent-cleanup-targets div,
.agent-mini-empty {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfcfd;
}

.agent-cleanup-targets strong,
.agent-cleanup-targets span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.agent-cleanup-targets span,
.agent-mini-empty {
  color: var(--muted);
}

.agent-section {
  display: grid;
  gap: 8px;
}

.agent-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #51606e;
}

.console-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.console-section-head button {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.console-technical-details {
  display: grid;
  gap: 8px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.console-technical-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 8px 10px;
  cursor: pointer;
  color: #51606e;
  font-size: 12px;
  font-weight: 700;
}

.console-technical-details summary::marker {
  color: var(--muted);
}

.console-technical-details summary em {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-technical-details .agent-section,
.console-technical-details .agent-runtime {
  margin: 0 10px 10px;
}

.console-technical-details.compact {
  background: #fbfcfd;
}

.console-account-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfcfd;
  font-size: 12px;
}

.console-account-summary strong {
  color: #146c43;
}

.console-account-summary span,
.console-account-summary em {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-runtime {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  overflow: hidden;
}

.agent-runtime dt,
.agent-runtime dd {
  min-width: 0;
  margin: 0;
  padding: 7px 9px;
  border-bottom: 1px solid var(--soft-line);
}

.agent-runtime dt {
  background: #fbfcfd;
}

.agent-runtime dd {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-config-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(280px, 2fr) 110px 110px;
  gap: 8px;
}

.agent-config-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.agent-config-grid input {
  width: 100%;
  height: 32px;
  font-size: 13px;
}

.agent-config-grid-cleanup {
  grid-template-columns: minmax(280px, 2fr) 140px;
}

.agent-config-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--text);
  font-size: 13px;
}

.agent-config-switches label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.agent-candidates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-candidates button {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  background: #fff;
}

.agent-candidate-group {
  display: grid;
  gap: 6px;
}

.agent-candidate-group strong {
  font-size: 12px;
  color: #51606e;
}

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

.agent-action-row button {
  height: 32px;
}

.agent-action-status {
  color: var(--muted);
  font-size: 12px;
}

.agent-reset-status {
  padding: 7px 10px;
  border: 1px solid #f3b4ad;
  border-radius: 6px;
  background: var(--bad-bg);
  color: var(--bad-text);
}

.agent-reset-status.released,
.agent-reset-status.completed {
  border-color: #badbcc;
  background: var(--ok-bg);
  color: var(--ok-text);
}

.console-snapshot-hint {
  padding: 7px 10px;
  border: 1px solid #ecd59b;
  border-radius: 6px;
  background: #fffaf0;
  color: #8a661f;
}

.console-account-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.console-account-toolbar input {
  width: min(420px, 100%);
  height: 32px;
}

.console-account-toolbar span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.console-account-toolbar div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.console-account-toolbar button {
  height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.console-account-table-wrap {
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.console-order-started-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #b8dfd5;
  border-radius: 6px;
  background: #f2fbf8;
  font-size: 12px;
}

.console-order-started-summary strong {
  color: #087f6f;
  white-space: nowrap;
}

.console-order-started-summary span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-account-table {
  min-width: 1260px;
}

.console-account-table td:nth-child(2),
.console-account-table td:nth-child(3),
.console-account-table td:nth-child(6),
.console-account-table td:nth-child(8),
.console-account-table td:nth-child(9),
.console-account-table td:nth-child(10) {
  max-width: 180px;
}

.console-script-cell {
  display: grid;
  gap: 2px;
  min-width: 190px;
}

.console-script-cell strong {
  color: var(--text);
  font-size: 12px;
}

.console-script-cell span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.console-script-cell span.warn {
  color: var(--warn-text);
  font-weight: 700;
}

.severity {
  display: inline-block;
  min-width: 42px;
  border-radius: 999px;
  padding: 1px 7px;
  text-align: center;
}

.severity.high {
  background: var(--bad-bg);
  color: var(--bad-text);
  font-weight: 700;
}

.severity.medium {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.severity.low {
  background: var(--panel-soft);
  color: var(--muted);
}

.machine-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(31, 41, 51, 0.04);
}

.machine-card + .machine-card {
  margin-top: 2px;
}

.module-panel {
  height: var(--module-height);
  min-height: 0;
  overflow: hidden;
}

.machine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--soft-line);
}

.machine-head h2 {
  margin: 0;
  font-size: 14px;
}

.machine-head p {
  overflow-wrap: anywhere;
}

.machine-meta {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  gap: 4px;
}

.machine-meta span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #115e59;
  padding: 2px 8px;
  font-size: 12px;
}

.machine-meta small {
  color: var(--muted);
  font-size: 12px;
}

.machine-meta .latest-backup-time {
  color: var(--bad-text);
  font-weight: 700;
}

.dimension-tabs {
  display: flex;
  gap: 5px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--soft-line);
}

.dimension-tabs button {
  height: 30px;
  padding: 0 10px;
  border-radius: 5px;
  background: #fff;
}

.dimension-tabs button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #115e59;
}

.dimension-tabs button:disabled {
  color: #9aa5ae;
  background: #f6f8fa;
  cursor: default;
}

.role-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--soft-line);
  background: #fcfdfe;
}

.role-filter button {
  height: 26px;
  max-width: 260px;
  padding: 0 10px;
  border-radius: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.role-filter button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #115e59;
}

.column-picker {
  padding: 6px 10px;
  border-bottom: 1px solid var(--soft-line);
  background: var(--panel-soft);
}

.column-picker.hidden {
  display: none;
}

.column-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 6px;
}

.column-picker label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 8px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.column-picker input {
  width: 14px;
  height: 14px;
}

.table-wrap {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  border: 0;
  border-radius: 0;
}

.table-wrap.stats-debt-table-wrap {
  max-height: min(620px, calc(100vh - 300px));
  overflow: auto;
}

.table-panel {
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--soft-line);
  background: var(--panel-soft);
}

.table-tools.align-end {
  justify-content: flex-end;
}

.overview-tools {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  gap: 8px;
  border-bottom: 1px solid var(--soft-line);
  background: var(--panel-soft);
}

.overview-tools > button {
  margin: 6px 0;
  height: 34px;
  padding: 0 12px;
}

.overview-tools .table-tools {
  border-bottom: 0;
}

.overview-alerts {
  border: 1px solid #f0d8a8;
  border-radius: 6px;
  background: #fff7e6;
  color: #7a4b00;
}

.overview-alerts summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  cursor: pointer;
}

.overview-alerts summary strong {
  font-size: 13px;
}

.overview-alerts summary span {
  color: #8a661f;
  font-size: 12px;
}

.overview-alert-list {
  display: grid;
  gap: 6px;
  padding: 0 12px 10px;
}

.overview-alert {
  display: grid;
  grid-template-columns: max-content minmax(120px, 220px) minmax(220px, 1fr) max-content;
  gap: 8px;
  align-items: center;
  min-width: 0;
  border-radius: 5px;
  padding: 5px 8px;
  background: #fffdf7;
  border: 1px solid #f0d8a8;
  font-size: 12px;
}

.overview-alert b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #5c3700;
}

.overview-alert span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-alert mark {
  border-radius: 999px;
  padding: 1px 7px;
  background: #f8d485;
  color: #5c3700;
  font-weight: 700;
}

.overview-alert em {
  flex: 0 0 auto;
  font-style: normal;
  font-weight: 700;
}

.sort-head {
  width: 100%;
  height: auto;
  min-height: 24px;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  text-align: left;
  padding: 0;
}

.sort-head:hover,
.sort-head.active {
  background: transparent;
  color: var(--accent);
}

.overview-table-wrap th {
  white-space: nowrap;
}

.overview-more {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-top: 1px solid var(--soft-line);
  background: rgba(255, 255, 255, 0.96);
  color: var(--muted);
  font-size: 12px;
}

.overview-more button {
  height: 30px;
  padding: 0 12px;
}

.copy-role-cell {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.selectable-role,
.selectable-text {
  cursor: text;
  user-select: text;
  border-radius: 4px;
  padding: 1px 3px;
}

.selectable-role:hover,
.selectable-text:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.module-toolbar {
  margin-left: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--soft-line);
  background: var(--panel-soft);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.module-toolbar > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  justify-content: flex-end;
}

.toolbar-actions strong {
  min-width: 104px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.date-stepper {
  height: 34px;
  display: inline-grid;
  grid-template-columns: 74px 126px 74px;
  align-items: stretch;
  border: 1px solid #b8c7d4;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.toolbar-actions .date-stepper {
  flex: 0 0 auto;
}

.date-stepper .date-step-button {
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #f3f7fb;
  color: #334155;
  font-weight: 700;
  padding: 0;
}

.date-stepper .date-step-button:hover:not(:disabled) {
  background: #e8f1f8;
}

.date-stepper .date-step-button:disabled {
  color: #a3afba;
  background: #f6f8fa;
}

.date-stepper .date-step-current {
  display: grid;
  place-items: center;
  min-width: 0;
  width: 126px;
  height: 100%;
  border: 0;
  border-left: 1px solid #b8c7d4;
  border-right: 1px solid #b8c7d4;
  border-radius: 0;
  background: #0f766e;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.toolbar-actions button {
  height: 32px;
  padding: 0 10px;
}

.toolbar-actions label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar-actions input,
.toolbar-actions select {
  width: 112px;
  height: 32px;
  border: 1px solid #cbd6df;
  border-radius: 5px;
  padding: 0 8px;
  background: #fff;
  font: inherit;
}

.toolbar-actions input[type="date"] {
  width: 142px;
}

.toolbar-actions span {
  color: var(--muted);
  font-size: 12px;
}

.log-panel {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.log-tools,
.config-tools {
  margin-bottom: 8px;
}

.log-tools select,
.config-tools select {
  width: 112px;
  height: 32px;
  border: 1px solid #cbd6df;
  border-radius: 5px;
  padding: 0 8px;
}

.history-summary {
  padding: 7px 12px;
  border-bottom: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 12px;
  background: #fff;
}

.config-panel {
  --module-height: calc(100vh - 200px);
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.config-source-bar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px 8px;
  border-bottom: 1px solid var(--soft-line);
}

.config-source-bar > div {
  display: grid;
  gap: 2px;
}

.config-source-bar strong {
  font-size: 14px;
}

.config-source-bar span,
.config-source-bar label {
  color: var(--muted);
  font-size: 12px;
}

.config-source-bar label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-file-select {
  width: min(440px, 42vw);
  height: 32px;
  border: 1px solid #cbd6df;
  border-radius: 5px;
  padding: 0 8px;
  background: #fff;
  color: var(--text);
}

.config-source-file {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 10px;
  min-height: 0;
  flex: 1;
}

.config-files {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.config-file {
  height: auto;
  display: grid;
  justify-items: start;
  gap: 2px;
  padding: 8px 10px;
  text-align: left;
  background: #fff;
}

.config-file.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.config-file strong,
.config-file span,
.config-file small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-file small {
  color: var(--muted);
  font-size: 12px;
}

.missing-config {
  border: 1px dashed #cbd6df;
  border-radius: 6px;
  padding: 12px;
  color: var(--muted);
  background: #fbfcfd;
  font-size: 13px;
}

.missing-config strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
}

.missing-config p {
  margin-bottom: 10px;
}

.missing-config-row {
  display: grid;
  gap: 3px;
  padding: 8px 0;
  border-top: 1px solid var(--soft-line);
}

.missing-config-row b,
.missing-config-row span {
  overflow-wrap: anywhere;
}

.config-detail {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.config-detail.empty {
  display: grid;
  place-items: center;
}

.role-config-profile {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.role-config-head {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(520px, 1.7fr);
  align-items: stretch;
  gap: 8px;
  padding: 10px 0;
}

.role-config-identity {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: #edf3f6;
}

.role-config-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

.role-config-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.role-config-facts {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr);
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  overflow: hidden;
}

.role-config-facts > span {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px 10px;
  border-left: 1px solid var(--soft-line);
}

.role-config-facts > span:first-child {
  border-left: 0;
}

.role-config-facts small {
  color: var(--muted);
  font-size: 11px;
}

.role-config-facts b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.config-view-tabs {
  display: flex;
  align-items: center;
  min-height: 38px;
  border-top: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.config-view-tabs button {
  height: 37px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border: 0;
  border-right: 1px solid var(--soft-line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.config-view-tabs button.active {
  box-shadow: inset 0 -3px 0 var(--accent);
  background: #fff;
  color: var(--accent);
}

.config-view-tabs button span {
  min-width: 22px;
  padding: 1px 5px;
  border-radius: 8px;
  background: #edf2f5;
  color: #526170;
  font-size: 11px;
  text-align: center;
}

.config-view-body {
  min-height: 0;
  flex: 1;
  padding-top: 8px;
}

.config-daily-toolbar,
.config-section-intro,
.config-raw-toolbar,
.config-raw-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.config-daily-toolbar {
  min-height: 40px;
  padding: 0 2px 8px;
}

.config-daily-toolbar > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-daily-toolbar select {
  height: 32px;
  border: 1px solid #cbd6df;
  border-radius: 5px;
  padding: 0 8px;
  background: #fff;
}

.config-daily-toolbar button {
  height: 32px;
  padding: 0 10px;
}

.config-daily-toolbar > span,
.config-section-intro span,
.config-raw-toolbar span,
.config-raw-entry-head span {
  color: var(--muted);
  font-size: 12px;
}

.config-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 7px;
  margin-bottom: 8px;
}

.config-metric {
  min-height: 60px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 7px 10px;
  border: 1px solid #d3dee3;
  border-radius: 6px;
  background: #f4f6f7;
}

.config-metric span {
  color: var(--muted);
  font-size: 11px;
}

.config-metric strong {
  font-size: 21px;
}

.config-metric.good {
  border-color: #cbdcd1;
  background: #e7f0ea;
}

.config-metric.good strong {
  color: #587363;
}

.config-metric.bad {
  border-color: #dec9c6;
  background: #f3e6e4;
}

.config-metric.bad strong {
  color: #895b56;
}

.config-metric.accent {
  border-color: #cad8df;
  background: #e7eef2;
}

.config-metric.accent strong {
  color: #5d7079;
}

.config-table-wrap {
  width: 100%;
  max-height: calc(var(--module-height) - 260px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.config-data-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}

.config-data-table th,
.config-data-table td {
  height: 31px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--soft-line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.config-data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #edf4f7;
  color: #506170;
  font-weight: 700;
}

.config-data-table th:first-child,
.config-data-table td:first-child {
  width: 92px;
}

.config-data-table th:nth-child(2),
.config-data-table td:nth-child(2) {
  width: 210px;
}

.config-data-table th:last-child,
.config-data-table td:last-child {
  width: 84px;
}

.config-data-table td small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 10px;
}

.config-event-warn td {
  background: #f7efed;
}

.config-event-state {
  display: inline-block;
  min-width: 48px;
  padding: 2px 6px;
  border-radius: 8px;
  background: #e9edef;
  color: #5d6c74;
  text-align: center;
}

.config-event-state.success {
  background: #e7f0ea;
  color: #567162;
}

.config-event-state.warn {
  background: #f3e6e4;
  color: #8b5954;
}

.config-daily-group-list {
  overflow-x: auto;
  border: 1px solid #d3dee3;
  border-radius: 5px;
  background: #fff;
}

.config-daily-group > summary {
  min-width: 760px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 70px minmax(300px, 1.4fr);
  align-items: center;
  gap: 10px;
}

.config-daily-group {
  border-bottom: 1px solid #dce4e8;
  background: #fff;
}

.config-daily-group:last-child {
  border-bottom: 0;
}

.config-daily-group > summary {
  position: relative;
  min-height: 50px;
  padding: 6px 12px 6px 30px;
  background: #fff;
  cursor: pointer;
  list-style: none;
  transition: background-color 120ms ease;
}

.config-daily-group > summary::-webkit-details-marker {
  display: none;
}

.config-daily-group > summary:focus {
  outline: none;
}

.config-daily-group > summary:focus-visible {
  box-shadow: none;
}

.config-daily-group > summary::before {
  content: "›";
  position: absolute;
  left: 12px;
  top: 50%;
  color: #71838b;
  font-size: 17px;
  line-height: 1;
  transform: translateY(-50%);
  transition: transform 120ms ease;
}

.config-daily-group[open] > summary::before {
  transform: translateY(-50%) rotate(90deg);
}

.config-daily-group > summary:hover {
  background: #f2f5f6;
}

.config-daily-group[open] > summary {
  background: #e7eef2;
}

.config-daily-group > summary > b {
  color: #6f7f87;
  font-size: 11px;
}

.config-daily-project,
.config-daily-latest {
  min-width: 0;
}

.config-daily-project {
  display: grid;
  gap: 2px;
}

.config-daily-project-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-daily-project strong,
.config-daily-project small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-daily-copy-button {
  flex: 0 0 auto;
  width: 48px;
  height: 26px;
  padding: 0;
}

.config-copy-feedback {
  flex: 0 0 auto;
  color: #9a5d58;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 120ms ease;
}

.config-copy-feedback.show {
  opacity: 1;
}

.config-daily-project strong {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 13px;
}

.config-daily-project small {
  color: #718087;
  font-size: 11px;
}

.config-daily-node-meta.success {
  color: #60796c;
}

.config-daily-node-meta.warn {
  color: #91605b;
}

.config-daily-group .config-event-state {
  font-style: normal;
}

.config-daily-latest {
  overflow: hidden;
  color: #5b686d;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-daily-detail {
  max-height: 420px;
  overflow: auto;
  border-top: 1px solid #d3dee3;
  background: #fff;
}

.config-daily-detail .config-data-table {
  min-width: 760px;
}

.config-daily-detail .config-data-table thead {
  display: none;
}

.config-daily-data-table tbody tr:not(.config-daily-date-row) td {
  background: #fff;
}

.config-daily-detail .config-data-table th:first-child,
.config-daily-detail .config-data-table td:first-child {
  padding-left: 28px;
  white-space: nowrap;
}

.config-daily-data-table th:last-child,
.config-daily-data-table td:last-child {
  width: auto;
}

.config-daily-data-table .config-daily-time-col {
  width: 100px;
}

.config-daily-data-table .config-daily-item-col {
  width: 380px;
}

.config-daily-data-table .config-daily-content-col {
  width: calc(100% - 480px);
}

.config-daily-data-table .config-daily-date-row td {
  width: auto;
  padding: 6px 9px;
  border-top: 1px solid #cfd8d6;
  border-bottom-color: #dde4e2;
  background: #edf1f0;
  color: #52635f;
  white-space: normal;
}

.config-daily-data-table .config-daily-date-row:first-child td {
  border-top: 0;
}

.config-daily-date-row td strong {
  font-size: 12px;
}

.config-daily-date-row td span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 11px;
}

.config-view-note {
  padding: 7px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.config-section-intro {
  min-height: 40px;
  padding: 0 2px 8px;
}

.config-section-intro > strong {
  font-size: 14px;
}

.config-project-table th:first-child,
.config-project-table td:first-child {
  width: 180px;
}

.config-project-table th:nth-child(2),
.config-project-table td:nth-child(2),
.config-project-table th:nth-child(3),
.config-project-table td:nth-child(3) {
  width: 118px;
}

.config-project-table th:nth-child(4),
.config-project-table td:nth-child(4),
.config-project-table th:nth-child(5),
.config-project-table td:nth-child(5),
.config-project-table th:nth-child(6),
.config-project-table td:nth-child(6) {
  width: 82px;
}

.config-project-table {
  min-width: 960px;
}

.config-complete-date {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 8px;
  background: #e8f6ef;
  color: #176846;
}

.muted {
  color: var(--muted);
}

.config-script-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) minmax(220px, 1fr) 150px;
  gap: 7px;
  margin-bottom: 8px;
}

.config-script-summary > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid #d3dee3;
  border-radius: 6px;
  background: #f2f5f6;
}

.config-script-summary small {
  color: var(--muted);
}

.config-script-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-script-summary > div:first-child {
  background: #e7eef2;
}

.config-script-summary > div:nth-child(2) {
  background: #eef2f3;
}

.config-script-group-list {
  max-height: calc(var(--module-height) - 250px);
  overflow: auto;
}

.config-script-detail .config-data-table {
  min-width: 620px;
  table-layout: fixed;
}

.config-script-detail .config-data-table td:first-child {
  width: 360px;
  padding-left: 28px;
}

.config-script-detail .config-data-table td:last-child {
  width: auto;
  overflow-wrap: anywhere;
}

.config-script-data-table .config-script-key-col {
  width: 360px;
}

.config-script-data-table .config-script-value-col {
  width: calc(100% - 360px);
}

.config-raw-toolbar {
  min-height: 40px;
  padding: 0 2px 8px;
}

.config-raw-scope-note {
  margin: -2px 2px 8px;
  color: #687981;
  font-size: 11px;
}

.config-raw-toolbar input {
  width: min(420px, 50vw);
  height: 32px;
  border: 1px solid #cbd6df;
  border-radius: 5px;
  padding: 0 9px;
}

.config-raw-filter-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-raw-filter-tools select {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 28px 0 9px;
  border: 1px solid #cbd6df;
  border-radius: 5px;
  background: #fff;
  color: var(--text);
}

.config-raw-filter-tools button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 10px;
}

.config-raw-group-list {
  height: calc(var(--module-height) - 230px);
  min-height: 320px;
  overflow: auto;
  border: 1px solid #d3dee3;
  border-radius: 5px;
  background: #fff;
}

.config-raw-group {
  border-bottom: 1px solid #dce4e8;
}

.config-raw-group:last-child {
  border-bottom: 0;
}

.config-raw-group > summary {
  position: relative;
  min-width: 620px;
  min-height: 50px;
  display: grid;
  grid-template-columns: 22px minmax(280px, 1fr) 70px minmax(240px, 1.2fr);
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 30px;
  list-style: none;
  cursor: pointer;
  background: #fff;
  transition: background-color 120ms ease;
}

.config-raw-drag-handle {
  width: 22px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: #8795a1;
  font-size: 18px;
  line-height: 1;
  cursor: grab;
}

.config-raw-drag-handle:hover,
.config-raw-drag-handle:focus-visible {
  background: #edf3f6;
  color: var(--accent);
}

.config-raw-drag-handle:active {
  cursor: grabbing;
}

.config-raw-group.dragging {
  opacity: 0.58;
  background: var(--accent-soft);
}

.config-raw-group-list.is-dragging .config-raw-group > summary {
  cursor: ns-resize;
}

.config-raw-group > summary::-webkit-details-marker {
  display: none;
}

.config-raw-group > summary::before {
  content: "›";
  position: absolute;
  left: 12px;
  top: 50%;
  color: var(--muted);
  font-size: 17px;
  transform: translateY(-50%);
  transition: transform 120ms ease;
}

.config-raw-group[open] > summary::before {
  transform: translateY(-50%) rotate(90deg);
}

.config-raw-group[open] > summary {
  background: #e7eef2;
}

.config-raw-group > summary:hover {
  background: #f2f5f6;
}

.config-raw-group-identity {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.config-raw-group-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-raw-group-identity strong,
.config-raw-group-latest {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-raw-group-identity small,
.config-raw-group > summary > b {
  color: var(--muted);
  font-size: 11px;
}

.config-raw-group-latest {
  color: #5b686d;
  font-size: 12px;
}

.config-raw-group-body {
  min-width: 620px;
  max-height: 440px;
  overflow: auto;
  border-top: 1px solid #d3dee3;
  background: #fff;
}

.config-raw-group-body .config-table-wrap {
  max-height: none;
  border: 0;
  border-radius: 0;
}

.config-raw-loaded-count {
  padding: 6px 10px;
  border-bottom: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 11px;
}

.config-raw-data-table th:first-child,
.config-raw-data-table td:first-child {
  white-space: nowrap;
}

.config-raw-data-table th:last-child,
.config-raw-data-table td:last-child {
  width: auto;
}

.config-raw-data-table .config-raw-time-col {
  width: 100px;
}

.config-raw-data-table .config-raw-item-col {
  width: 380px;
}

.config-raw-data-table .config-raw-content-col {
  width: calc(100% - 480px);
}

.config-raw-data-table {
  table-layout: fixed;
}

.config-raw-data-table td:nth-child(2),
.config-raw-data-table td:nth-child(3) {
  overflow-wrap: anywhere;
}

.config-raw-data-table .config-raw-date-row td {
  width: auto;
  padding: 6px 9px;
  border-top: 1px solid #cbd9df;
  border-bottom-color: #dce6ea;
  background: #f1f6f7;
  color: #314c56;
  white-space: normal;
}

.config-raw-data-table .config-raw-date-row:first-child td {
  border-top: 0;
}

.config-raw-date-row td strong {
  font-size: 12px;
}

.config-raw-date-row td span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 11px;
}

.config-raw-layout {
  height: calc(var(--module-height) - 210px);
  min-height: 320px;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.config-raw-sections {
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #f8fafb;
}

.config-raw-sections button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border: 0;
  border-bottom: 1px solid var(--soft-line);
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.config-raw-sections button.active {
  box-shadow: inset 3px 0 0 var(--accent);
  background: var(--accent-soft);
  color: #115e59;
}

.config-raw-sections button > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.config-raw-sections button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-raw-sections button small {
  color: var(--muted);
  font-size: 10px;
}

.config-raw-sections button > b {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.config-raw-entries {
  min-width: 0;
  overflow: auto;
  background: #fff;
}

.config-raw-entries .config-table-wrap {
  max-height: none;
  border: 0;
  border-radius: 0;
}

.config-raw-entry-head {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 40px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.config-raw-entry-head > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.config-raw-entry-head > div:first-child {
  overflow: hidden;
}

.config-raw-entry-head > div:first-child strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-raw-copy-tools {
  flex: 0 0 auto;
}

.config-raw-copy-tools select,
.config-raw-copy-tools button {
  height: 30px;
}

.config-raw-copy-tools select {
  padding: 0 8px;
  border: 1px solid #cbd6df;
  border-radius: 5px;
  background: #fff;
}

.config-load-more {
  display: block;
  margin: 10px auto;
}

.loading,
.config-summary {
  padding: 9px 10px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--soft-line);
}

.config-simple-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
  background: #f6faf9;
}

.config-simple-head strong {
  font-size: 14px;
}

.config-simple-head span {
  color: var(--muted);
  font-size: 12px;
}

.project-log-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--soft-line);
}

.project-log-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-log-summary b {
  color: var(--accent);
}

.project-log-summary span {
  color: var(--muted);
  font-size: 12px;
}

.project-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.project-tabs span {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #d7e8e4;
  border-radius: 5px;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: #115e59;
  font-size: 12px;
}

.project-log-list {
  display: grid;
  gap: 5px;
}

.project-log-item {
  display: grid;
  grid-template-columns: 52px minmax(120px, 220px) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 6px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: #fff;
  font-size: 12px;
}

.project-log-item.warn {
  border-color: #f1b4ad;
  background: var(--bad-bg);
}

.project-log-item time {
  color: var(--muted);
}

.project-log-item b,
.project-log-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.config-archive {
  border-top: 1px solid var(--soft-line);
}

.config-archive > summary {
  padding: 9px 10px;
  background: #f4f8fa;
  cursor: pointer;
  font-weight: 700;
}

.config-section {
  padding: 0;
  border-bottom: 1px solid var(--soft-line);
}

.config-group {
  border-bottom: 1px solid var(--soft-line);
}

.config-group summary {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 10px;
  background: #eef4f7;
  cursor: pointer;
  font-weight: 700;
}

.config-group summary span {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}

.config-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  background: #fff;
}

.config-section summary:hover {
  background: #f6faf9;
}

.config-section summary strong,
.config-section summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.config-section summary span {
  flex: 0 0 auto;
  color: var(--muted);
}

.config-entries {
  display: grid;
  gap: 4px;
  padding: 0 10px 10px;
}

.config-entry {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 1fr;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 4px;
  background: var(--panel-soft);
  font-size: 12px;
}

.config-entry b,
.config-entry span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.config-entry small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.empty.compact {
  padding: 12px;
}

.history-table-wrap {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.history-table-wrap table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.history-table-wrap th,
.history-table-wrap td {
  max-width: none;
}

.history-table-wrap td.history-change-cell {
  background: #fff8db;
  color: #6b4e00;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(180, 124, 0, 0.18);
}

.history-table-wrap td.history-change-cell.important {
  background: var(--bad-bg);
  color: var(--bad-text);
  box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.18);
}

.history-timeline {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  background: #fff;
}

.history-timeline-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fbfcfd;
}

.history-timeline-row + .history-timeline-row {
  margin-top: 6px;
}

.history-time {
  display: grid;
  align-content: start;
  gap: 3px;
}

.history-time b {
  color: #0f5f58;
  font-size: 13px;
}

.history-time span,
.history-more {
  color: var(--muted);
  font-size: 12px;
}

.history-change-body {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.history-primary,
.history-changes {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.history-primary span {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 12px;
}

.history-chip {
  max-width: 280px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #d8e4ea;
  border-radius: 5px;
  padding: 2px 7px;
  background: #fff;
  color: #314252;
  font-size: 12px;
}

.history-chip b,
.history-chip em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.history-chip b {
  flex: 0 0 auto;
  color: var(--muted);
}

.history-chip em {
  color: var(--text);
}

.history-chip.important {
  border-color: #f1b4ad;
  background: var(--bad-bg);
}

.history-chip.important em {
  color: var(--bad-text);
  font-weight: 700;
}

.history-chip.initial {
  border-color: #b6d8d2;
  background: var(--accent-soft);
  color: #115e59;
  font-weight: 700;
}

.global-result-card .table-wrap table {
  min-width: 1460px;
}

.global-result-card th:first-child,
.global-result-card td:first-child {
  width: 92px;
  max-width: 92px;
  font-weight: 700;
  color: #334155;
}

@media (max-width: 980px) {
  .stats-license-inline-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-license-reference,
  .stats-license-editor-actions {
    grid-column: 1 / -1;
  }

  .module-toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar-actions {
    justify-content: flex-start;
  }

  .role-config-head {
    grid-template-columns: 1fr;
  }

  .role-config-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .config-raw-layout {
    grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  }

  .stats-project-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-project-list-head,
  .stats-project-alert summary.stats-project-summary-row {
    grid-template-columns: minmax(160px, 1.1fr) minmax(120px, 0.9fr) minmax(100px, 0.8fr) minmax(125px, 1fr) minmax(135px, 1fr) minmax(100px, 0.8fr) 88px;
  }

  .stats-identity-list-head,
  .stats-identity-alert summary.stats-identity-summary-row {
    grid-template-columns: minmax(150px, 1.2fr) minmax(110px, 0.9fr) minmax(130px, 1fr) minmax(150px, 1.1fr) minmax(180px, 1.3fr) 68px;
  }

  .stats-project-detail-head,
  .stats-project-detail-row {
    grid-template-columns: minmax(110px, 0.8fr) minmax(110px, 0.8fr) minmax(210px, 2fr) minmax(96px, 0.7fr);
  }

  .stats-identity-detail-head,
  .stats-identity-detail-row {
    grid-template-columns: minmax(70px, 0.6fr) minmax(60px, 0.5fr) minmax(150px, 1.2fr) minmax(190px, 1.5fr) minmax(130px, 1fr) minmax(130px, 1fr);
  }

  .stats-debt-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-debt-detail-head,
  .stats-debt-detail-row {
    grid-template-columns: minmax(95px, 0.8fr) minmax(95px, 0.8fr) minmax(135px, 1fr) minmax(125px, 1fr) minmax(160px, 1.2fr) minmax(95px, 0.7fr);
  }
}

.log-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
}

.log-table {
  min-width: 0;
  table-layout: fixed;
}

.log-table th:nth-child(1),
.log-table td:nth-child(1) {
  width: 156px;
}

.log-table th:nth-child(3),
.log-table td:nth-child(3) {
  width: 70px;
  text-align: right;
}

.log-table td {
  max-width: none;
}

.log-table td:nth-child(2) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-table tr.warn td {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.log-table tr.warn td:first-child {
  border-left: 3px solid #b45309;
}

table {
  width: 100%;
  min-width: 1380px;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  border-bottom: 1px solid var(--soft-line);
  padding: 4px 7px;
  text-align: left;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef4f7;
  color: #4d5d6b;
  font-weight: 600;
  box-shadow: inset 0 -1px 0 var(--line);
}

td {
  height: 28px;
}

tbody tr:nth-child(even) {
  background: #fbfcfd;
}

tbody tr:hover {
  background: #edf7f5;
}

.pill {
  display: inline-block;
  min-width: 44px;
  border-radius: 999px;
  padding: 1px 7px;
  text-align: center;
  font-size: 12px;
}

.pill.ok {
  background: var(--accent-soft);
  color: #115e59;
}

.pill.history-running {
  background: #c7f7d4;
  color: #0b6b35;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #79d99a;
}

.pill.bad {
  background: var(--bad-bg);
  color: var(--bad-text);
}

.muted-cell {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 7px;
  background: #edf1f4;
  color: #6b7884;
  font-size: 12px;
}

.account-status-toggle {
  max-width: 100%;
  height: auto;
  min-height: 22px;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  padding: 2px 8px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  cursor: pointer;
}

.account-status-toggle.ok {
  background: var(--accent-soft);
  color: #115e59;
}

.account-status-toggle.bad {
  background: var(--bad-bg);
  color: var(--bad-text);
}

.account-status-toggle.expanded {
  border-radius: 5px;
  white-space: normal;
  overflow: visible;
  line-height: 1.45;
}

.empty {
  border: 1px dashed #cbd6df;
  border-radius: 6px;
  padding: 18px;
  color: #687785;
  text-align: center;
  background: #fbfcfd;
  font-size: 13px;
}

@media (max-width: 760px) {
  .stats-license-inline-editor {
    grid-template-columns: 1fr;
  }

  .stats-license-reference,
  .stats-license-editor-actions {
    grid-column: auto;
  }

  .app-layout {
    width: 100%;
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .workspace-bar,
  .blank-shell,
  .machine-rail {
    grid-column: 1;
  }

  .machine-rail {
    grid-row: auto;
    padding-top: 0;
  }

  .workspace-bar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }

  .workspace-tabs {
    width: 100%;
  }

  .workspace-tabs button {
    flex: 1;
  }

  .machine-picker {
    position: static;
    max-height: none;
  }

  .machine-picker-list {
    max-height: 180px;
  }

  .stats-project-alert summary {
    grid-template-columns: 1fr;
  }

  .stats-project-summary-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .debt-detail-panel > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .debt-view-tabs {
    width: 100%;
  }

  .debt-view-tabs button {
    flex: 1;
  }

  .stats-project-meta-grid {
    grid-template-columns: 1fr;
  }

  .stats-project-list-head {
    display: none;
  }

  .stats-project-alert summary.stats-project-summary-row {
    grid-template-columns: 1fr auto;
  }

  .stats-project-cell:not(.identity) {
    grid-column: 1 / -1;
  }

  .stats-project-count {
    grid-column: 2;
    grid-row: 1;
  }

  .stats-identity-list-head {
    display: none;
  }

  .stats-identity-alert summary.stats-identity-summary-row {
    grid-template-columns: 1fr auto;
  }

  .stats-identity-cell:not(.identity) {
    grid-column: 1 / -1;
  }

  .stats-identity-count {
    grid-column: 2;
    grid-row: 1;
  }

  .stats-project-detail-head {
    display: none;
  }

  .stats-project-detail-row {
    grid-template-columns: 1fr;
  }

  .stats-identity-detail-head {
    display: none;
  }

  .stats-identity-detail-row {
    grid-template-columns: 1fr;
  }

  .stats-debt-summary {
    grid-template-columns: 1fr;
  }

  .stats-filter-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-filter-actions {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-debt-detail-head {
    display: none;
  }

  .stats-debt-detail-row {
    grid-template-columns: 1fr;
  }

  .stats-workbench {
    height: auto;
  }

  .system-grid,
  .system-layout,
  .query-node-grid,
  .system-task-card dl,
  .watch-panel dl {
    grid-template-columns: 1fr;
  }

  .query-node-card dl {
    grid-template-columns: 1fr;
  }

  .query-node-card dl > div {
    border-top: 1px solid var(--soft-line);
    border-left: 0;
  }

  .query-node-card dl > div:first-child {
    border-top: 0;
  }

  .agent-manager {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .agent-editor {
    overflow: visible;
  }

  .agent-cleanup-targets {
    grid-template-columns: 1fr;
  }

  .keyword-editor {
    grid-template-columns: 1fr;
  }

  .query-panel {
    grid-template-columns: 1fr;
  }

  .overview-alert {
    grid-template-columns: 1fr;
  }

  .config-layout {
    grid-template-columns: 1fr;
  }

  .config-source-bar,
  .config-daily-toolbar,
  .config-section-intro,
  .config-raw-toolbar,
  .config-raw-entry-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .config-raw-copy-tools {
    width: 100%;
    justify-content: flex-end;
  }

  .config-file-select,
  .config-raw-toolbar input {
    width: 100%;
  }

  .config-raw-filter-tools {
    width: 100%;
    flex-wrap: wrap;
  }

  .config-raw-filter-tools select {
    flex: 1 1 160px;
  }

  .config-raw-group-list {
    height: auto;
    max-height: 70vh;
  }

  .role-config-facts,
  .config-metrics,
  .config-script-summary {
    grid-template-columns: 1fr;
  }

  .role-config-facts > span {
    border-top: 1px solid var(--soft-line);
    border-left: 0;
  }

  .role-config-facts > span:first-child {
    border-top: 0;
  }

  .config-view-tabs {
    overflow-x: auto;
  }

  .config-view-tabs button {
    flex: 0 0 auto;
  }

  .config-raw-layout {
    height: auto;
    grid-template-columns: 1fr;
  }

  .config-raw-sections {
    max-height: 260px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .config-raw-entries {
    min-height: 320px;
  }
}
