:root {
  color-scheme: light;
  --ink: #0b1d3a;
  --muted: #52627a;
  --soft: #eef4fb;
  --line: #d8e2ef;
  --panel: #ffffff;
  --blue: #0a63d8;
  --cyan: #09a7c2;
  --green: #16895f;
  --amber: #b86c00;
  --danger: #b42318;
  --shadow: 0 18px 42px rgba(15, 35, 60, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #e8f0fa;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  background: #071323;
  color: #eef7ff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #4bc4ff, #0062d8 55%, #00a3a7);
  color: #00131d;
  font-weight: 900;
}

.brand strong, .brand small { display: block; }
.brand small { color: #9cb1c9; margin-top: 2px; }

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  color: #c8d8e9;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.nav a:hover, .nav a.is-active {
  color: #ffffff;
  background: rgba(62, 178, 255, 0.12);
  border-color: rgba(82, 190, 255, 0.26);
}

.test-badge {
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
}

.test-badge span, .test-badge strong, .test-badge small { display: block; }
.test-badge span { color: #4fc3ff; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.test-badge strong { margin: 6px 0; }
.test-badge small { color: #a9bbcf; line-height: 1.45; }

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(30px, 4vw, 52px); letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: 22px; }

.top-actions, .panel-head, .control-grid {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 0 18px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.btn.primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 12px 26px rgba(10, 99, 216, .18);
}

.btn.ghost { background: #f6f9fd; }
.btn.compact { min-height: 36px; padding: 0 12px; }

.view { display: none; }
.view.is-visible { display: grid; gap: 22px; }

.notice, .panel, .client-hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.notice {
  padding: 14px 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
}

.notice strong { color: var(--ink); }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metrics article {
  min-height: 126px;
  padding: 20px;
  background: #f7faff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics span, .metrics small {
  display: block;
  color: var(--muted);
}

.metrics strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 38px;
  line-height: 1;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.panel {
  padding: 20px;
  overflow: hidden;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e7f7f4;
  border: 1px solid #ace6dc;
  color: #006f6f;
  font-weight: 800;
  font-size: 13px;
}

.pill.muted { background: #eef4fb; border-color: #d4e0ef; color: #43546d; }
.pill.danger { background: #fff0ed; border-color: #ffd0c7; color: var(--danger); }

.form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

input, select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.node-list, .bars, .connector-list {
  display: grid;
  gap: 12px;
}

.node-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.node-card header, .node-card footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe6f3;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
td { color: #182b49; }

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e9f9f1;
  color: var(--green);
  font-weight: 800;
}

.status.pending, .status.running { background: #fff7e6; color: var(--amber); }
.status.failed { background: #fff0ed; color: var(--danger); }

.client-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 22px;
}

.client-hero p { color: var(--muted); max-width: 720px; margin-bottom: 0; }
.client-hero select { max-width: 360px; }

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.credential-box, .support-grid article, .connector-list article {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8fbff;
}

.credential-box span, .credential-box small,
.support-grid span, .connector-list span {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.credential-box strong, .support-grid strong, .connector-list strong {
  display: block;
  margin-bottom: 5px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-row header {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.job {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.job strong, .job span { display: block; }
.job span { color: var(--muted); margin-top: 3px; }

.ip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 10px;
}

.ip-cell {
  min-height: 78px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8fbff;
}

.ip-cell strong, .ip-cell span { display: block; }
.ip-cell span { color: var(--muted); font-size: 13px; margin-top: 5px; }
.ip-cell.used { background: #edf8ff; border-color: #9fd7ff; }

.plan-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.plan-card h2 { margin-bottom: 10px; }
.plan-card .price { font-size: 34px; font-weight: 900; margin: 12px 0; }
.plan-card ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.8; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 8px;
  color: #fff;
  background: #071323;
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 10;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }
  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .test-badge { margin-top: 0; }
  .metrics, .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .workspace { padding: 16px; }
  .topbar, .client-hero, .node-card header, .node-card footer {
    align-items: stretch;
    flex-direction: column;
  }
  .top-actions, .panel-head { align-items: stretch; flex-direction: column; }
  .nav, .metrics, .grid.two, .grid.three, .support-grid {
    grid-template-columns: 1fr;
  }
  .client-hero select { max-width: none; }
  .control-grid { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; }
  h1 { font-size: 34px; }
}
