:root {
  color-scheme: light;
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #f8fafb;
  --border: #e1e6eb;
  --text: #1e2933;
  --muted: #697684;
  --primary: #5b55d6;
  --primary-hover: #4942c2;
  --success: #16845b;
  --warning: #b66a16;
  --danger: #c23c45;
  --shadow: 0 12px 30px rgba(35, 47, 62, 0.07);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--text); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; background: #f9fafb; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 28px; font-size: 17px; font-weight: 750; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: white; background: var(--primary); }
nav { display: grid; gap: 5px; }
.nav-item { width: 100%; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; }
.nav-item:hover { background: #eff1f5; color: var(--text); }
.nav-item.active { background: #ebeafd; color: var(--primary); font-weight: 650; }
.sidebar-note { margin-top: auto; padding: 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: 12px; }
.main { min-width: 0; }
.topbar { height: 92px; padding: 20px 30px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.86); border-bottom: 1px solid var(--border); }
h1, h2, p { margin: 0; }
h1 { font-size: 21px; }
h2 { font-size: 16px; }
.topbar p, .panel-heading p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.connection { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warning); }
.status-dot.online { background: var(--success); }
.view { display: none; padding: 28px 30px 48px; }
.view.active { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow); }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { margin-top: 8px; font-size: 27px; font-weight: 760; letter-spacing: -0.03em; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.inline-form { display: flex; align-items: end; gap: 12px; padding: 20px; }
label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
input { height: 40px; padding: 0 11px; border: 1px solid #cfd6dd; border-radius: 8px; background: white; color: var(--text); outline: none; }
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,85,214,.14); }
.primary-button, .secondary-button, .danger-button { min-height: 39px; padding: 0 15px; border-radius: 8px; font-weight: 650; }
.primary-button { border: 1px solid var(--primary); background: var(--primary); color: white; }
.primary-button:hover { background: var(--primary-hover); }
.secondary-button { border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.secondary-button:hover { background: var(--surface-muted); }
.danger-button { border: 1px solid var(--danger); background: var(--danger); color: white; }
button:disabled { cursor: not-allowed; opacity: .55; }
.feedback { min-height: 20px; margin: -8px 20px 18px; color: var(--success); font-size: 13px; }
.feedback.error { color: var(--danger); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { background: var(--surface-muted); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
td.ip { max-width: 285px; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: #edf0f3; color: var(--muted); font-size: 11px; font-weight: 700; }
.badge.ready { background: #e4f5ed; color: var(--success); }
.badge.unhealthy { background: #fce8e9; color: var(--danger); }
.badge.registering, .badge.pending { background: #fff1dd; color: var(--warning); }
.row-action { border: 0; background: transparent; color: var(--primary); font-weight: 650; }
.empty-state { padding: 44px; color: var(--muted); text-align: center; }
.job-list { display: grid; }
.job-row { display: grid; grid-template-columns: 140px 120px 110px 1fr 170px; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.job-progress { width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 999px; background: #e8ecf0; }
.job-progress::-webkit-progress-bar { background: #e8ecf0; }
.job-progress::-webkit-progress-value { background: var(--primary); }
.job-progress::-moz-progress-bar { background: var(--primary); }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(31,41,51,.45); backdrop-filter: blur(3px); }
.modal { width: min(430px, calc(100vw - 40px)); padding: 24px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); box-shadow: 0 24px 70px rgba(20,30,40,.22); }
.modal > p { margin: 7px 0 20px; color: var(--muted); }
.modal input { width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal .feedback { margin: 12px 0 0; }
.hidden { display: none !important; }
@media (max-width: 1180px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0 0 12px; }
  nav { display: flex; overflow-x: auto; }
  .nav-item { width: auto; white-space: nowrap; }
  .sidebar-note { display: none; }
  .topbar { height: auto; padding: 16px 18px; }
  .view { padding: 18px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .job-row { grid-template-columns: 1fr 1fr; }
  .job-progress, .job-row time { grid-column: 1 / -1; }
}
