:root {
  --bg: #f8fafc;
  --sidebar: #0f172a;
  --sidebar-2: #1e293b;
  --panel: #ffffff;
  --text: #020617;
  --muted: #64748b;
  --line: #e2e8f0;
  --blue: #2563eb;
  --blue-2: #eff6ff;
  --green: #15803d;
  --green-2: #f0fdf4;
  --orange: #c2410c;
  --orange-2: #fff7ed;
  --red: #dc2626;
  --red-2: #fef2f2;
  --cyan: #0e7490;
  --cyan-2: #ecfeff;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-soft: 0 1px 1px rgba(15, 23, 42, .04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Arial, sans-serif;
}

button, input, select, textarea { font: inherit; }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar);
  color: #cbd5e1;
  padding: 20px 16px;
  box-shadow: 1px 0 0 rgba(255,255,255,.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
}

.brand strong {
  display: block;
  color: #fff;
  font-size: 15px;
}

.brand span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
  margin-top: 4px;
}

.nav {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  padding: 12px 13px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  cursor: pointer;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.active {
  background: var(--sidebar-2);
  color: #fff;
  box-shadow: inset 3px 0 0 #38bdf8;
}

.main { min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 26px;
  background: rgba(248, 250, 252, .9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; letter-spacing: 0; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

.topbar p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 13px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn.primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.btn.danger {
  color: var(--red);
  background: var(--red-2);
  border-color: #fecaca;
}

.btn.compact {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.view {
  display: none;
  padding: 22px 26px 34px;
}

.view.active {
  display: grid;
  gap: 18px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, .8fr);
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  border: 1px solid #cfd9e8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.hero-kicker,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}

.hero-panel h2 {
  font-size: 24px;
  line-height: 1.22;
  letter-spacing: 0;
}

.hero-panel p {
  margin-top: 10px;
  max-width: 760px;
  color: #475467;
  line-height: 1.65;
}

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

.hero-stats div {
  display: grid;
  align-content: center;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

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

.hero-stats strong {
  margin-top: 8px;
  font-size: 26px;
}

.command-center {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr);
  gap: 18px;
  align-items: stretch;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.command-copy h2 {
  max-width: 820px;
  font-size: 30px;
  line-height: 1.18;
  letter-spacing: 0;
}

.command-copy p {
  max-width: 820px;
  margin-top: 12px;
  color: #475569;
  font-size: 15px;
  line-height: 1.75;
}

.command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.summary-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.summary-board div {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.summary-board span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.summary-board strong {
  display: block;
  margin-top: 12px;
  font-size: 22px;
  line-height: 1.15;
}

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

.status-tile {
  display: grid;
  align-content: space-between;
  min-height: 130px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, .32);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow-soft);
}

.status-tile.strong {
  color: #fff;
  background: #0f172a;
  border-color: #0f172a;
}

.status-tile span,
.status-tile em {
  color: inherit;
  opacity: .72;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.status-tile strong {
  margin-top: 10px;
  font-size: 30px;
  line-height: 1;
}

.admin-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
}

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

.admin-kpi {
  min-height: 132px;
  display: grid;
  align-content: space-between;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-kpi.urgent {
  border-top: 4px solid var(--orange);
}

.admin-kpi span,
.admin-kpi em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.admin-kpi strong {
  margin-top: 8px;
  color: #020617;
  font-size: 32px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.admin-queue {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head.compact {
  padding: 14px;
}

.panel-head.compact h2 {
  font-size: 18px;
}

.queue-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.queue-note {
  margin: 0 14px 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.queue-note strong,
.queue-note span {
  display: block;
}

.queue-note strong {
  font-size: 13px;
}

.queue-note span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

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

.ops-card {
  display: grid;
  gap: 14px;
  min-height: 172px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.ops-card[data-node-group-target] {
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.ops-card[data-node-group-target]:hover,
.ops-card[data-node-group-target]:focus-visible {
  border-color: #93c5fd;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .12);
  outline: none;
  transform: translateY(-2px);
}

.ops-card.jp { border-left: 5px solid var(--blue); }
.ops-card.old-us { border-left: 5px solid var(--orange); }
.ops-card.new-us { border-left: 5px solid var(--cyan); }

.ops-card-head,
.ops-card-foot,
.asset-title,
.asset-line,
.rank-row,
.task-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.ops-card-head span,
.asset-line span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ops-card-head strong,
.asset-line strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ops-card-head em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.ops-card-body b {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.ops-card-body span,
.ops-card-foot span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.ops-card-foot strong {
  align-self: flex-start;
  border-radius: 999px;
  padding: 5px 9px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  white-space: nowrap;
}

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

.work-card {
  display: grid;
  align-content: space-between;
  gap: 14px;
  min-height: 178px;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 4px solid #64748b;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.work-card.attention { border-top-color: var(--orange); }
.work-card.warning { border-top-color: #eab308; }
.work-card.success { border-top-color: var(--green); }

.work-card div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.work-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.work-card strong {
  color: #020617;
  font-size: 34px;
  line-height: 1;
}

.work-card p {
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.backend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.backend-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.backend-card:hover,
.backend-card:focus-visible {
  border-color: #93c5fd;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .12);
  outline: none;
  transform: translateY(-2px);
}

.backend-card.jp { border-left: 5px solid var(--blue); }
.backend-card.old-us { border-left: 5px solid var(--orange); }
.backend-card.new-us { border-left: 5px solid var(--cyan); }

.backend-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.backend-top h3 {
  font-size: 20px;
}

.backend-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.backend-meta div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.backend-meta span,
.backend-section > span,
.node-clients > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.backend-meta strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

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

.backend-section div {
  display: grid;
  gap: 7px;
}

.backend-section b {
  display: block;
  font-size: 13px;
}

.backend-section em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.backend-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.region-stack {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.region-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.region-section.jp { border-left: 5px solid var(--blue); }
.region-section.new-us { border-left: 5px solid var(--cyan); }

.region-head {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(520px, 1.1fr);
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.region-head h3 {
  font-size: 22px;
}

.region-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

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

.region-capacity div,
.server-capacity-main div,
.server-meta-grid div,
.server-client-strip div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.region-capacity div {
  padding: 11px;
}

.region-capacity span,
.server-capacity-main span,
.server-meta-grid span,
.server-client-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.region-capacity strong {
  display: block;
  margin-top: 7px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.region-progress {
  display: grid;
  gap: 7px;
  padding: 12px 16px 0;
}

.server-port-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.server-port-card {
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.server-port-card:hover,
.server-port-card:focus-visible {
  border-color: #93c5fd;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .12);
  outline: none;
  transform: translateY(-2px);
}

.server-port-card.jp { border-top: 4px solid var(--blue); }
.server-port-card.new-us { border-top: 4px solid var(--cyan); }

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

.server-port-head h3 {
  font-size: 18px;
}

.server-port-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.server-capacity-main {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.server-capacity-main div {
  padding: 10px;
  background: #f8fafc;
}

.server-capacity-main strong {
  display: block;
  margin-top: 7px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.server-progress {
  display: grid;
  gap: 7px;
}

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

.server-meta-grid div,
.server-client-strip div {
  padding: 9px;
  background: #f8fafc;
}

.server-meta-grid strong,
.server-client-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.server-client-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.server-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.client-summary div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.client-summary span,
.client-summary-note span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.client-summary strong,
.client-summary-note strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.client-summary-note {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.client-summary-note em {
  display: inline-flex;
  margin-top: 7px;
  border-radius: 999px;
  padding: 4px 7px;
  background: var(--orange-2);
  color: var(--orange);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.asset-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.asset-title {
  align-items: flex-start;
}

.asset-title h3 {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.asset-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.asset-meta div {
  min-width: 0;
  padding: 10px;
  background: #f8fafc;
  border-right: 1px solid var(--line);
}

.asset-meta div:last-child { border-right: 0; }

.asset-meta span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.asset-meta strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.dashboard-grid {
  align-items: start;
}

.rank-list,
.ops-tasks,
.order-list {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.rank-row,
.task-row {
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.rank-index {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--blue);
  font-weight: 900;
}

.rank-main {
  min-width: 0;
  flex: 1;
}

.rank-main strong {
  display: block;
  font-size: 15px;
}

.rank-main em {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.rank-row b {
  font-size: 18px;
  white-space: nowrap;
}

.task-row {
  align-items: flex-start;
}

.task-row strong {
  display: block;
  margin-bottom: 6px;
}

.order-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.order-mini strong,
.order-mini b {
  display: block;
  font-size: 15px;
}

.order-mini span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.order-mini > div:last-child {
  display: grid;
  justify-items: end;
  gap: 7px;
  white-space: nowrap;
}

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

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

.card { padding: 17px; }

.label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.value {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-body { padding: 18px; }

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

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

.node-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.node-card.jp { border-top: 4px solid var(--blue); }
.node-card.us-new { border-top: 4px solid var(--cyan); }

.node-preview {
  display: grid;
  gap: 14px;
}

.node-groups {
  display: grid;
  gap: 18px;
}

.node-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.node-group.focus-pulse {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .14), var(--shadow);
}

.node-card.focus-pulse,
.server-port-card.focus-pulse {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .14), var(--shadow);
}

.node-group-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

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

.node-route {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.node-route span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.node-route strong {
  font-size: 13px;
  overflow-wrap: anywhere;
  text-align: right;
}

.node-clients {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.node-clients.compact > div {
  display: grid;
}

.node-clients em,
.backend-section em {
  color: var(--muted);
  font-size: 12px;
}

.client-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.client-chip:hover {
  border-color: #60a5fa;
  background: #eff6ff;
  color: #1d4ed8;
}

.node-client-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.node-client-hero.jp { box-shadow: inset 5px 0 0 var(--blue); }
.node-client-hero.old-us { box-shadow: inset 5px 0 0 var(--orange); }
.node-client-hero.new-us { box-shadow: inset 5px 0 0 var(--cyan); }

.node-client-hero h2 {
  font-size: 24px;
}

.node-client-hero p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.node-client-actions {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 9px;
}

.node-client-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.node-client-stats article {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.node-client-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.node-client-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
}

.node-client-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.node-client-list {
  display: grid;
  gap: 10px;
  padding: 16px 18px 18px;
}

.node-client-row {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(260px, 1.1fr) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.node-client-usage {
  min-width: 0;
}

.usage-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions {
  min-width: 124px;
}

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

.group-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 122px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.group-card.jp { border-left: 5px solid var(--blue); }
.group-card.old-us { border-left: 5px solid var(--orange); }
.group-card.new-us { border-left: 5px solid var(--cyan); }

.group-numbers {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 6px;
  text-align: right;
}

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

.group-numbers strong {
  font-size: 22px;
}

.provider-line {
  margin-top: 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 750;
}

.node-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--green-2);
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.pill.pending { background: var(--orange-2); color: var(--orange); }
.pill.danger { background: var(--red-2); color: var(--red); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

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

.kv div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.kv span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.kv strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.input, .select, .textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--text);
}

.input { width: 280px; max-width: 100%; }
.textarea { min-height: 92px; resize: vertical; width: 100%; }

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

.client-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.client-card {
  display: grid;
  grid-template-columns: minmax(190px, 1.05fr) minmax(120px, .62fr) minmax(190px, .9fr) minmax(180px, .9fr) minmax(230px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.client-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.client-card.focus-row {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.client-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.client-identity {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.client-identity strong {
  font-size: 16px;
  line-height: 1.15;
}

.client-identity span,
.client-identity em,
.section-label,
.traffic-split,
.client-note p,
.client-plan span {
  color: var(--muted);
  font-size: 12px;
}

.client-identity em {
  font-style: normal;
}

.client-plan,
.client-usage,
.client-nodes,
.client-note {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.client-plan strong,
.usage-line strong {
  font-size: 15px;
}

.usage-line,
.traffic-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.usage-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.client-note p {
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.client-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 14px;
}

tbody tr:hover {
  background: #f8fafc;
}

tr.focus-row td {
  background: #eff6ff;
  box-shadow: inset 0 1px 0 #bfdbfe, inset 0 -1px 0 #bfdbfe;
}

th, td {
  text-align: left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: #f8fafc;
}

.bar {
  width: 100%;
  height: 8px;
  background: #edf2f7;
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.bar.advanced {
  height: 9px;
  background: #e2e8f0;
}

.bar.compact {
  max-width: 280px;
  height: 6px;
}

.bar.success i { background: var(--green); }
.bar.warning i { background: #f97316; }
.bar.danger i { background: var(--red); }
.bar.muted i { background: #94a3b8; }

.link-cell {
  max-width: 390px;
  color: var(--blue);
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px;
}

.tag {
  align-self: flex-start;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--blue-2);
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.tag.orange { background: var(--orange-2); color: var(--orange); }
.tag.green { background: var(--green-2); color: var(--green); }
.tag.cyan { background: var(--cyan-2); color: var(--cyan); }
.tag.red { background: var(--red-2); color: var(--red); }

.node-badges {
  display: grid;
  gap: 6px;
  min-width: 170px;
}

.compact-badges {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
}

.node-badge {
  display: inline-grid;
  gap: 2px;
  width: fit-content;
  max-width: 260px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.node-badge em {
  color: var(--muted);
  font-style: normal;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-badge.jp { border-color: #bfdbfe; background: var(--blue-2); color: var(--blue); }
.node-badge.us-new { border-color: #a5f3fc; background: var(--cyan-2); color: var(--cyan); }

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

dialog {
  width: min(620px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(17, 24, 39, .28);
}

dialog::backdrop { background: rgba(17, 24, 39, .45); }

.dialog-card { margin: 0; }

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
}

.icon-btn {
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 980px) {
  #app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
  }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
  .top-actions { justify-content: flex-start; }
  .metrics,
  .grid-2,
  .grid-3,
  .hero-panel,
  .hero-stats,
  .group-summary,
  .node-grid,
  .command-center,
  .admin-overview,
  .admin-kpis,
  .status-matrix,
  .summary-board,
  .ops-strip,
  .work-grid,
  .asset-grid,
  .backend-grid,
  .region-head,
  .region-capacity,
  .server-port-grid,
  .server-capacity-main,
  .server-meta-grid,
  .server-client-strip,
  .node-client-stats,
  .node-client-row,
  .node-client-toolbar {
    grid-template-columns: 1fr;
  }
  .node-client-hero {
    flex-direction: column;
  }
  .node-client-actions {
    justify-content: flex-start;
  }
  .client-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .client-actions {
    justify-content: flex-start;
  }
  .asset-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-meta div:nth-child(2) { border-right: 0; }
  .asset-meta div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}
