:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --sidebar: #172033;
  --sidebar-hover: #222d44;
  --text: #172033;
  --muted: #667085;
  --muted-2: #98a2b3;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --green: #079455;
  --green-soft: #ecfdf3;
  --amber: #b54708;
  --amber-soft: #fffaeb;
  --red: #d92d20;
  --red-soft: #fef3f2;
  --shadow: 0 1px 2px rgb(16 24 40 / 5%), 0 8px 24px rgb(16 24 40 / 5%);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; max-width: 100%; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text); font-family: Inter, "Microsoft YaHei UI", "PingFang SC", "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, #e8efff, transparent 32%), var(--bg); }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: 0 22px 60px rgb(16 24 40 / 12%); }
.login-brand, .brand { display: flex; align-items: center; gap: 11px; }
.login-brand { margin-bottom: 28px; }
.login-brand strong, .brand strong { display: block; font-size: 17px; }
.login-brand small, .brand small { display: block; margin-top: 1px; color: var(--muted-2); font-size: 12px; }
.login-card h1 { margin: 0 0 5px; font-size: 28px; letter-spacing: -.02em; }
.login-card > .muted { margin: 0 0 24px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: linear-gradient(145deg, #3974f6, #1d4ed8); color: #fff; font-size: 17px; font-weight: 900; box-shadow: 0 8px 18px rgb(37 99 235 / 22%); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; min-width: 0; flex-direction: column; padding: 22px 14px 16px; background: var(--sidebar); color: #fff; }
.brand { padding: 0 8px 23px; }
.brand small { color: #98a2b3; }
.nav-list { display: grid; gap: 5px; }
.nav-item { width: 100%; min-height: 45px; display: flex; align-items: center; gap: 11px; padding: 10px 13px; border: 0; border-radius: 9px; background: transparent; color: #aeb8ca; text-align: left; cursor: pointer; transition: .15s ease; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: #2b3852; color: #fff; font-weight: 700; }
.nav-icon { width: 19px; color: #a9bbdb; text-align: center; }
.sidebar-spacer { flex: 1; }
.fleet-card { display: flex; align-items: flex-start; gap: 9px; margin: 0 6px 12px; padding: 12px; border-radius: 10px; background: rgb(255 255 255 / 5%); }
.fleet-card strong, .fleet-card small { display: block; }
.fleet-card strong { font-size: 14px; }
.fleet-card small { margin-top: 2px; color: #98a2b3; font-size: 12px; }
.live-dot { width: 8px; height: 8px; margin-top: 6px; flex: 0 0 auto; border-radius: 50%; background: #32d583; box-shadow: 0 0 0 4px rgb(50 213 131 / 12%); }
.nav-item.logout { color: #98a2b3; }

.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 18px; border-bottom: 1px solid var(--border); background: rgb(255 255 255 / 96%); backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.025em; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.switch-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.switch-label input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 34px; height: 20px; position: relative; border-radius: 999px; background: #d0d5dd; transition: .18s ease; }
.switch::after { content: ""; position: absolute; width: 16px; height: 16px; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(16 24 40 / 28%); transition: .18s ease; }
.switch-label input:checked + .switch { background: var(--primary); }
.switch-label input:checked + .switch::after { transform: translateX(14px); }

.view { display: none; width: 100%; min-width: 0; padding: 14px 18px 24px; }
.view.active { display: block; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 1px 3px rgb(16 24 40 / 5%); }
.metrics-grid { display: grid; gap: 10px; margin-bottom: 10px; }
.primary-metrics, .pool-metrics-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card { min-width: 0; padding: 12px 16px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); box-shadow: 0 1px 2px rgb(16 24 40 / 3%); }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; margin: 3px 0 1px; font-size: clamp(23px, 1.8vw, 29px); line-height: 1.08; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.metric-card small { color: var(--muted-2); font-size: 11px; }
.metric-card.attention strong { color: var(--amber); }
.secondary-stats { display: flex; align-items: center; gap: 0; overflow-x: auto; margin-bottom: 10px; padding: 7px 13px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--muted); white-space: nowrap; }
.secondary-stats span { padding: 0 18px; border-right: 1px solid var(--border); font-size: 13px; }
.secondary-stats span:first-child { padding-left: 0; }
.secondary-stats span:last-child { border-right: 0; }
.secondary-stats strong { margin-left: 5px; color: var(--text); font-size: 15px; }

.overview-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; align-items: start; }
.node-panel, .inspector, .pool-tab-panel, .settings-card { padding: 15px; }
.section-heading, .inspector-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-heading { margin-bottom: 14px; }
.section-heading h2, .inspector-heading h2, .settings-card h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.section-heading .muted { display: block; margin-top: 3px; font-size: 13px; }
.filters { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
input, select, textarea { max-width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 8px; outline: 0; background: #fff; color: var(--text); transition: .15s ease; }
input:focus, select:focus, textarea:focus { border-color: #84adff; box-shadow: 0 0 0 3px rgb(37 99 235 / 10%); }
input::placeholder, textarea::placeholder { color: #98a2b3; }
textarea { resize: vertical; }
#search-input { width: min(300px, 100%); }
.filters select { min-width: 126px; }
#sort-field { min-width: 126px; }
#sort-direction { min-width: 82px; }

.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; color: #344054; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; transition: .15s ease; }
.button:hover { background: #f9fafb; border-color: #98a2b3; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.button.primary:hover { background: #1d4ed8; }
.button.dark { border-color: #172033; background: #172033; color: #fff; }
.button.secondary { background: #fff; }
.button.danger { border-color: var(--red); background: var(--red); color: #fff; }
.button.wide { width: 100%; }
.button.compact { min-height: 38px; padding-inline: 11px; font-size: 13px; }
.text-button { padding: 4px 0; border: 0; background: transparent; color: var(--primary); font-weight: 700; cursor: pointer; }
.danger-text { color: var(--red); }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--muted); font-size: 22px; cursor: pointer; }

.progress-strip { margin-bottom: 12px; padding: 10px 12px; border-radius: 9px; background: var(--primary-soft); color: #1d4ed8; }
.progress-strip > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.progress-track { height: 5px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: #dbeafe; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--primary); transition: width .25s; }

.table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.server-table { width: 100%; min-width: 1105px; table-layout: fixed; }
.server-table col.server-column-node { width: 200px; }
.server-table col.server-column-status { width: 95px; }
.server-table col.server-column-quota { width: 90px; }
.server-table col.server-column-accounts { width: 115px; }
.server-table col.server-column-limited,
.server-table col.server-column-abnormal { width: 70px; }
.server-table col.server-column-expiry { width: 105px; }
.server-table col.server-column-note { width: 200px; }
.server-table col.server-column-checked { width: 160px; }
.pool-table { min-width: 1250px; }
.policy-table { min-width: 780px; }
.data-table th { padding: 11px 12px; border-bottom: 1px solid var(--border); background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; }
.data-table td { max-width: 250px; padding: 12px; border-bottom: 1px solid #eef0f3; color: #344054; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr.selected { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.data-table tbody tr.row-warn { background: #fffdf5; }
.data-table tbody tr.row-error { background: #fffafa; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.server-table th,
.server-table td { box-sizing: border-box; vertical-align: middle; }
.server-table th.numeric,
.server-table td.numeric { padding-right: 16px; text-align: right; }
.server-table .server-column-node { width: 200px; }
.server-table .server-column-status { width: 95px; }
.server-table .server-column-quota { width: 90px; }
.server-table .server-column-accounts { width: 115px; }
.server-table .server-column-limited,
.server-table .server-column-abnormal { width: 70px; }
.server-table .server-column-expiry { width: 105px; }
.server-table .server-column-note { width: 200px; }
.server-table .server-column-checked { width: 160px; }
.server-table .server-column-checked { font-variant-numeric: tabular-nums; }
@media (min-width: 761px) {
  .server-table .server-text-column { text-align: left; }
}
.note-cell { max-width: 220px !important; color: var(--muted) !important; }
.node-name strong { display: block; color: var(--text); }
.node-name span { color: var(--muted); font-size: 12px; }
.status-text, .plain-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.status-text::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #98a2b3; }
.status-text.ok { color: var(--green); }.status-text.ok::before { background: var(--green); }
.status-text.warn { color: var(--amber); }.status-text.warn::before { background: #f79009; }
.status-text.error { color: var(--red); }.status-text.error::before { background: var(--red); }
.status-text.pending { color: var(--muted); }
.plain-state.ok { color: var(--green); }
.plain-state.warn { color: var(--amber); }
.expiry-text { color: var(--muted); font-size: 13px; }
.expiry-text.warning, .expiry-text.critical { color: var(--amber); font-weight: 700; }
.expiry-text.expired { color: var(--red); font-weight: 700; }
.empty-state { padding: 34px 16px; color: var(--muted); text-align: center; }

.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding-top: 10px; color: var(--muted); font-size: 13px; }
.pagination-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pagination-controls { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.pagination-controls label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pagination-controls select { width: auto; min-width: 68px; min-height: 36px; padding: 5px 28px 5px 9px; }
.pagination-controls strong { min-width: 80px; color: #475467; text-align: center; font-variant-numeric: tabular-nums; }
.page-button { min-height: 36px; padding: 6px 11px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; color: #475467; font: inherit; font-weight: 700; cursor: pointer; }
.page-button:hover:not(:disabled) { background: #f9fafb; border-color: #98a2b3; }
.page-button:disabled { opacity: .42; cursor: not-allowed; }

.inspector { position: sticky; top: 76px; max-height: calc(100vh - 88px); min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable; }
.inspector-empty { min-height: 480px; display: grid; place-content: center; padding: 28px; text-align: center; }
.inspector-empty h2 { margin: 10px 0 4px; font-size: 19px; }
.inspector-empty p { max-width: 250px; margin: auto; color: var(--muted); font-size: 13px; }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: auto; border-radius: 14px; background: var(--surface-soft); color: #98a2b3; font-size: 26px; }
.inspector-heading { margin-bottom: 14px; }
.inspector-heading .muted { margin: 3px 0 0; font-size: 13px; word-break: break-word; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; margin-bottom: 14px; }
.detail-actions .button { min-width: 0; padding-inline: 7px; font-size: 12px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 0 12px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
.detail-grid > div { min-width: 0; padding: 10px 11px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.detail-grid > div:nth-child(2n) { border-right: 0; }
.detail-grid dt { color: var(--muted); font-size: 11px; }
.detail-grid dd { margin: 2px 0 0; color: var(--text); font-size: 14px; font-weight: 650; word-break: break-word; }
.note-card, .policy-card { margin-top: 12px; padding: 13px; border-radius: 10px; background: var(--surface-soft); }
.note-card span, .policy-card > div:first-child span { color: var(--muted); font-size: 12px; }
.note-card p { margin: 5px 0 0; white-space: pre-wrap; word-break: break-word; }
.inspector-footer { display: flex; justify-content: flex-end; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.field { min-width: 0; display: grid; gap: 5px; margin-bottom: 10px; }
.field > span { color: #475467; font-size: 13px; font-weight: 700; }
.checkbox-field { display: flex; align-items: center; gap: 8px; color: #475467; font-size: 13px; }
.checkbox-field input { width: 17px; height: 17px; min-height: auto; }
.policy-card > div:first-child { margin-bottom: 12px; }
.policy-card > div:first-child strong { display: block; }
.policy-fields-disabled { opacity: .48; }
.form-grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.form-grid.two > * { min-width: 0; }
.inspector input, .inspector select, .inspector textarea { width: 100%; box-sizing: border-box; }
.form-actions, .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.inline-message { margin: 10px 0; padding: 10px 12px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.inline-message.success { background: var(--green-soft); color: var(--green); }

.pool-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 14px; padding: 13px 16px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.pool-toolbar strong { display: block; font-size: 14px; }
.pool-toolbar .muted { display: block; margin-top: 2px; font-size: 12px; }
.subtabs { display: flex; gap: 4px; max-width: 100%; overflow-x: auto; margin-bottom: 12px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: #e9edf3; }
.subtab { flex: 0 0 auto; min-height: 38px; padding: 7px 15px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.subtab.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgb(16 24 40 / 12%); }
.pool-tab-panel { display: none; }
.pool-tab-panel.active { display: block; }
.pool-table-wrap { min-height: 340px; max-height: 640px; }
.content-narrow { width: min(760px, 100%); margin: 0 auto; }
.file-drop { min-height: 170px; display: grid; place-content: center; gap: 5px; margin-bottom: 15px; border: 1px dashed #98a2b3; border-radius: 12px; background: var(--surface-soft); text-align: center; cursor: pointer; }
.file-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-drop span { color: var(--muted); font-size: 13px; }
.file-drop.compact-drop { min-height: 120px; margin-top: 15px; }
.security-note { display: grid; gap: 3px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #b2ddff; border-radius: 10px; background: #eff8ff; }
.security-note strong { color: #175cd3; font-size: 13px; }
.security-note span { color: #475467; font-size: 12px; }
.selected-file-list { margin: -4px 0 14px; padding: 10px 12px; border-radius: 9px; background: var(--surface-soft); color: #475467; font-size: 13px; overflow-wrap: anywhere; }
.inspect-result { margin: 13px 0; padding: 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); }
.compact-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.compact-stats > div { min-width: 0; padding: 10px; border-radius: 8px; background: #fff; }
.compact-stats span { display: block; color: var(--muted); font-size: 11px; }
.compact-stats strong { display: block; margin-top: 2px; font-size: 20px; font-variant-numeric: tabular-nums; }
.coverage-list { display: grid; gap: 7px; margin-top: 12px; }
.coverage-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 12px; }
.coverage-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e4e7ec; }
.coverage-track span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.warning-list { display: grid; gap: 6px; margin-top: 12px; }
.warning-item { padding: 8px 10px; border-radius: 7px; background: var(--amber-soft); color: var(--amber); font-size: 12px; }
.task-progress { margin: 12px 0; padding: 12px; border-radius: 9px; background: var(--primary-soft); color: #1d4ed8; }
.task-progress > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.task-progress .progress-track span { width: 75%; animation: task-pulse 1.2s ease-in-out infinite alternate; }
@keyframes task-pulse { from { opacity: .45; transform: translateX(-20%); } to { opacity: 1; transform: translateX(25%); } }
.inline-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.inline-actions.no-margin { margin: 0; }
.pool-job-list { display: grid; gap: 9px; }
.pool-job-item { padding: 13px 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.pool-job-item.uncertain { border-color: #fedf89; background: #fffcf5; }
.pool-job-item > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pool-job-item p { margin: 6px 0 2px; color: #475467; font-size: 13px; }
.pool-job-item small { color: var(--muted); }
.api-section p { color: #475467; }
.api-section code { max-width: 100%; overflow-wrap: anywhere; color: #344054; font-family: "Cascadia Code", Consolas, monospace; }
.api-endpoint { display: flex; align-items: center; gap: 10px; max-width: 100%; margin: 18px 0; padding: 12px 14px; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.api-endpoint span { padding: 3px 7px; border-radius: 5px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 800; }
.api-endpoint code { min-width: 0; overflow-wrap: anywhere; }
.api-section pre { max-width: 100%; overflow: auto; padding: 16px; border-radius: 10px; background: #111827; color: #d1d5db; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.api-section pre code { color: inherit; }

.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.settings-card { min-height: 100%; }
.settings-heading { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 18px; }
.settings-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.settings-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 12px; border-radius: 9px; background: var(--surface-soft); }
.setting-row span strong, .setting-row span small { display: block; }
.setting-row span small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.setting-row input[type="checkbox"] { width: 36px; height: 20px; accent-color: var(--primary); }
.runtime-list { margin: 0; }
.runtime-list > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.runtime-list > div:last-child { border-bottom: 0; }
.runtime-list dt { color: var(--muted); font-size: 13px; }
.runtime-list dd { margin: 0; color: var(--text); font-weight: 700; text-align: right; }
.runtime-list .path-value { max-width: 190px; color: var(--muted); font-size: 11px; font-weight: 500; overflow-wrap: anywhere; }
.settings-actions { position: sticky; bottom: 12px; z-index: 10; display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin: 14px 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px; background: rgb(255 255 255 / 94%); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.settings-policy-panel { margin-top: 14px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgb(16 24 40 / 42%); backdrop-filter: blur(3px); }
.modal-card { width: min(430px, 100%); padding: 26px; border-radius: 15px; background: #fff; box-shadow: 0 24px 70px rgb(16 24 40 / 24%); }
.modal-card.modal-wide { width: min(780px, 100%); max-height: calc(100vh - 36px); overflow: auto; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.modal-heading h2 { margin: 0 0 4px; }
.modal-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.preview-list { max-height: 250px; overflow: auto; display: grid; gap: 6px; margin-top: 12px; }
.preview-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 8px 10px; border-radius: 7px; background: #fff; font-size: 12px; }
.preview-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-item span { color: var(--muted); }
.preview-action { font-weight: 700; }.preview-action.added { color: var(--green); }.preview-action.updated { color: var(--primary); }.preview-action.rejected { color: var(--red); }.preview-action.unchanged, .preview-action.skipped { color: var(--muted); }
.server-select-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.node-check-grid { max-height: 310px; overflow: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.node-check { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px; border: 1px solid transparent; border-radius: 8px; background: #fff; cursor: pointer; }
.node-check:hover { border-color: #b2ccff; }
.node-check input { width: 16px; height: 16px; min-height: auto; flex: 0 0 auto; }
.node-check span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.modal-card h2 { margin: 13px 0 7px; font-size: 20px; }
.modal-card p { margin: 0; color: var(--muted); line-height: 1.65; }
.modal-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; font-size: 20px; font-weight: 900; }
.modal-icon.danger { background: var(--red-soft); color: var(--red); }

.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 1100; display: grid; gap: 8px; width: min(390px, calc(100vw - 36px)); pointer-events: none; }
.toast { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); box-shadow: 0 12px 35px rgb(16 24 40 / 16%); animation: toast-in .2s ease both; }
.toast.success { border-left: 4px solid var(--green); }.toast.error { border-left: 4px solid var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1320px) {
  .overview-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .runtime-card { grid-column: span 2; }
}

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar { align-items: center; padding-inline: 10px; }
  .brand > div, .nav-item span:last-child, .fleet-card div, .logout span:last-child { display: none; }
  .brand { padding-inline: 0; }
  .nav-item { justify-content: center; padding-inline: 10px; }
  .nav-icon { width: auto; }
  .fleet-card { padding: 12px; }
  .overview-layout { grid-template-columns: 1fr; }
  .inspector { position: static; max-height: none; min-height: auto; overflow: visible; }
  .inspector-empty { min-height: 220px; }
  .primary-metrics, .pool-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; top: 0; z-index: 40; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; overflow-x: auto; }
  .brand, .sidebar-spacer, .fleet-card, .logout { display: none; }
  .nav-list { display: flex; width: 100%; gap: 4px; }
  .nav-item { flex: 1; min-width: 92px; min-height: 40px; padding: 7px 10px; }
  .nav-item span:last-child { display: inline; }
  .topbar { position: static; display: block; min-height: auto; padding: 15px; }
  .topbar h1 { font-size: 22px; }
  .topbar-actions { justify-content: flex-start; margin-top: 12px; }
  .switch-label { width: 100%; }
  .view { padding: 12px; }
  .primary-metrics, .pool-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-card { padding: 14px; }
  .metric-card strong { font-size: 25px; }
  .secondary-stats { margin-bottom: 10px; }
  .section-heading { display: block; }
  .section-heading .filters { margin-top: 11px; }
  .filters { width: 100%; justify-content: stretch; }
  #search-input, .filters select { width: 100%; min-width: 0; }
  .node-panel, .inspector, .pool-tab-panel, .settings-card { padding: 14px; }
  .node-table-wrap { overflow: visible; border: 0; background: transparent; }
  .server-table { min-width: 0; table-layout: auto; white-space: normal; }
  .server-table colgroup { display: none; }
  .server-table thead { display: none; }
  .server-table, .server-table tbody, .server-table tr, .server-table td { display: block; width: 100%; }
  .server-table tr { position: relative; margin-bottom: 9px; padding: 13px; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
  .server-table td { max-width: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border: 0; text-align: right; white-space: normal; word-break: break-word; }
  .server-table td::before { content: attr(data-label); flex: 0 0 76px; color: var(--muted); font-size: 12px; text-align: left; }
  .server-table td:first-child { display: block; padding: 0 0 9px; border-bottom: 1px solid var(--border); text-align: left; }
  .server-table td:first-child::before { display: none; }
  .server-table td:nth-child(5), .server-table td:nth-child(6), .server-table td:nth-child(8) { display: none; }
  .note-cell { max-width: none !important; }
  .pagination-bar { align-items: stretch; flex-direction: column; }
  .pagination-summary { text-align: center; }
  .pagination-controls { justify-content: center; }
  .detail-actions, .form-grid.two { grid-template-columns: 1fr; }
  .pool-toolbar { align-items: stretch; flex-direction: column; }
  .pool-toolbar .button { width: 100%; }
  .subtabs { position: sticky; top: 56px; z-index: 15; }
  .settings-grid { grid-template-columns: 1fr; }
  .runtime-card { grid-column: auto; }
  .settings-actions { align-items: stretch; flex-direction: column; bottom: 8px; }
  .settings-actions .button { width: 100%; }
  .api-section pre { font-size: 12px; }
  .compact-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coverage-row { grid-template-columns: 105px minmax(0, 1fr); }
  .coverage-row > :last-child { grid-column: 2; }
  .node-check-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .primary-metrics, .pool-metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card span { font-size: 12px; }
  .metric-card small { display: none; }
  .topbar-actions .button { flex: 1; padding-inline: 9px; font-size: 13px; }
  .pagination-controls label { width: 100%; justify-content: center; }
  .pagination-controls strong { order: -1; width: 100%; }
  .node-check-grid { grid-template-columns: 1fr; }
}
