:root {
  color-scheme: light;
  --sidebar: #20242a;
  --sidebar-raised: #2a2f36;
  --sidebar-muted: #8f98a6;
  --canvas: #f3f5f8;
  --surface: #ffffff;
  --surface-subtle: #f8f9fb;
  --line: #dfe3e8;
  --line-strong: #cbd2da;
  --text: #17202c;
  --muted: #697586;
  --faint: #96a0ad;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-soft: #eaf1ff;
  --teal: #0f8a75;
  --teal-soft: #e5f6f2;
  --amber: #b66a0a;
  --amber-soft: #fff3dd;
  --violet: #7455c7;
  --violet-soft: #f1edff;
  --red: #c13939;
  --red-soft: #fff0f0;
  --green: #218650;
  --green-soft: #e9f7ef;
  --shadow-popover: 0 12px 32px rgba(16, 24, 40, .14);
  --sidebar-width: 252px;
  --topbar-height: 70px;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .62; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 18px; height: 18px; stroke-width: 1.8; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .28);
  outline-offset: 2px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.brand-lockup > span:last-child { display: grid; min-width: 0; }
.brand-lockup strong { color: #fff; font-size: 16px; line-height: 1.1; }
.brand-lockup small { margin-top: 3px; color: #9ca5b2; font-size: 11px; }

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: #20242a;
}

.brand-mark svg { width: 20px; height: 20px; stroke-width: 2.2; }
.brand-lockup--large { gap: 14px; }
.brand-lockup--large .brand-mark { width: 44px; height: 44px; flex-basis: 44px; }
.brand-lockup--large strong { font-size: 19px; }

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: #4e5a6a;
}

.icon-button:hover { border-color: var(--line-strong); background: var(--surface-subtle); color: var(--text); }
.icon-button--dark { border-color: #394049; background: transparent; color: #aeb6c1; }
.icon-button--dark:hover { border-color: #4b535e; background: #30353d; color: #fff; }

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 600;
}

.button svg { width: 16px; height: 16px; }
.button--primary { border-color: var(--blue); background: var(--blue); color: #fff; }
.button--primary:hover { border-color: var(--blue-hover); background: var(--blue-hover); }
.button--ghost { border-color: var(--line); background: var(--surface); color: #526071; }
.button--ghost:hover { border-color: var(--line-strong); background: var(--surface-subtle); color: var(--text); }
.button--wide { width: 100%; min-height: 44px; }

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--faint);
}

.status-dot--success { background: #39b86b; box-shadow: 0 0 0 3px rgba(57, 184, 107, .14); }

/* Login */
.auth-page { background: #fff; }

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 42%) 1fr;
}

.auth-brand {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 620px;
  padding: clamp(34px, 5vw, 72px);
  background: var(--sidebar);
  color: #fff;
}

.auth-brand::before, .auth-brand::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.auth-brand::before {
  top: 23%;
  right: -50px;
  width: 240px;
  height: 1px;
  background: #3c434d;
  box-shadow: 0 72px 0 #3c434d, 0 144px 0 #3c434d;
  transform: rotate(-34deg);
}

.auth-brand::after {
  right: 13%;
  bottom: 13%;
  width: 114px;
  height: 114px;
  border: 1px solid #3c434d;
  border-radius: 50%;
  box-shadow: 0 0 0 30px rgba(60, 67, 77, .28), 0 0 0 62px rgba(60, 67, 77, .14);
}

.auth-brand-inner { position: relative; z-index: 1; display: flex; width: 100%; flex-direction: column; }
.auth-brand-copy { max-width: 430px; margin: auto 0; }
.auth-brand-copy .eyebrow { color: #79a5ff; }
.auth-brand-copy h1 { margin: 0; font-size: clamp(40px, 4.8vw, 68px); font-weight: 650; line-height: 1.08; }
.auth-brand-copy > p:last-child { max-width: 390px; margin: 24px 0 0; color: #afb7c2; font-size: 16px; line-height: 1.75; }
.auth-server-line { display: flex; align-items: center; gap: 10px; color: #b9c1cb; font-size: 13px; }

.auth-form-side { display: grid; min-height: 620px; padding: 48px 8vw; place-items: center; background: #fff; }
.auth-card { width: min(100%, 400px); }
.auth-card header h2 { margin: 0; font-size: 28px; line-height: 1.3; }
.auth-card header > p:last-child { margin: 10px 0 0; color: var(--muted); }
.mobile-brand { display: none; }
.auth-form { display: grid; gap: 20px; margin-top: 34px; }
.auth-footer { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 28px; color: var(--faint); font-size: 12px; }
.auth-footer svg { width: 15px; height: 15px; }

.field { display: grid; gap: 8px; color: #485465; font-size: 13px; font-weight: 600; }
.field > small { color: var(--faint); font-size: 12px; font-weight: 400; }
.field > small:last-child { text-align: right; }
.field .field-error { min-height: 0; color: var(--red); text-align: left; }
.input-wrap { position: relative; display: block; }
.input-wrap > svg { position: absolute; top: 50%; left: 13px; width: 17px; height: 17px; color: #8993a1; transform: translateY(-50%); }
.input-wrap input { width: 100%; min-height: 44px; padding: 9px 44px 9px 42px; }
.input-action { position: absolute; top: 3px; right: 3px; border: 0; }
.field input, .field select, .field textarea, .compact-field input, .compact-field select {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  outline: none;
}
.field > input, .field > select, .field > textarea { width: 100%; min-height: 42px; padding: 9px 11px; }
.field textarea { resize: vertical; line-height: 1.55; }
.field input:hover, .field select:hover, .field textarea:hover, .compact-field input:hover, .compact-field select:hover { border-color: #aeb7c3; }
.field input:focus, .field select:focus, .field textarea:focus, .compact-field input:focus, .compact-field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }

.inline-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.45;
}
.inline-alert svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.inline-alert--error { margin-top: 20px; border-color: #f4caca; background: var(--red-soft); color: #a72c2c; }

/* Application shell */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 40;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  background: var(--sidebar);
  color: #d7dce3;
}
.sidebar-head { display: flex; min-height: var(--topbar-height); align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid #30353d; }
.sidebar-close { display: none; border-color: #3a414a; background: transparent; color: #b5bec9; }
.server-card {
  display: flex;
  min-height: 66px;
  align-items: center;
  gap: 10px;
  margin: 17px 14px 13px;
  padding: 10px;
  border: 1px solid #3b424c;
  border-radius: 8px;
  background: #292e35;
}
.server-card > svg { width: 16px; height: 16px; color: #7f8996; }
.server-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 6px; background: #353b44; color: #e6eaf0; }
.server-icon svg { width: 18px; height: 18px; }
.server-copy { display: grid; min-width: 0; flex: 1; gap: 5px; }
.server-copy strong { overflow: hidden; color: #f4f6f8; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.server-copy small { display: flex; align-items: center; gap: 7px; color: #98a2af; font-size: 11px; }

.sidebar-nav { overflow: auto; flex: 1; padding: 0 12px 18px; scrollbar-width: thin; }
.nav-label { margin: 19px 12px 7px; color: #717b88; font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.nav-item { display: flex; min-height: 42px; align-items: center; gap: 11px; margin: 2px 0; padding: 8px 11px; border-radius: 7px; color: #aeb6c1; font-size: 13px; }
.nav-item > svg { width: 17px; height: 17px; }
.nav-item > span:nth-child(2) { flex: 1; }
.nav-item:hover { background: #2b3037; color: #fff; }
.nav-item.is-active { background: #f6f7f9; color: #1d2734; font-weight: 600; }
.nav-count { min-width: 22px; padding: 2px 6px; border-radius: 10px; background: #343a43; color: #aeb6c1; font-size: 10px; text-align: center; }
.nav-item.is-active .nav-count { background: #e1e5ea; color: #66717f; }
.nav-count--accent { background: #284b43; color: #74d7bd; }
.nav-item.is-active .nav-count--accent { background: var(--teal-soft); color: var(--teal); }

.sidebar-foot { display: flex; min-height: 74px; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid #30353d; }
.sidebar-user { display: flex; min-width: 0; flex: 1; align-items: center; gap: 10px; }
.sidebar-user > span:last-child { display: grid; min-width: 0; gap: 2px; }
.sidebar-user strong { overflow: hidden; color: #edf0f4; font-size: 13px; text-overflow: ellipsis; }
.sidebar-user small { color: #838d9a; font-size: 11px; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%; background: #3f75df; color: #fff; font-size: 11px; font-weight: 700; }
.avatar--small { width: 30px; height: 30px; flex-basis: 30px; font-size: 10px; }

.main-column { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
}
.topbar-left { display: flex; min-width: 0; align-items: center; gap: 12px; }
.topbar-left h1 { overflow: hidden; margin: 2px 0 0; font-size: 17px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb { display: flex; align-items: center; gap: 4px; margin: 0; color: var(--faint); font-size: 11px; }
.breadcrumb svg { width: 12px; height: 12px; }
.breadcrumb strong { color: #718094; font-weight: 500; }
.menu-button { display: none; }
.topbar-actions { position: relative; display: flex; min-width: 0; align-items: center; gap: 10px; }
.topbar-divider { width: 1px; height: 24px; margin: 0 2px; background: var(--line); }
.last-updated { color: var(--faint); font-size: 11px; white-space: nowrap; }
.auto-refresh-control { display: flex; align-items: center; gap: 7px; color: #5d6978; font-size: 12px; cursor: pointer; white-space: nowrap; }
.switch { position: relative; display: inline-block; width: 32px; height: 18px; flex: 0 0 32px; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch > span { position: absolute; inset: 0; border-radius: 10px; background: #c5cbd3; transition: background .18s; }
.switch > span::after { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; content: ""; box-shadow: 0 1px 2px rgba(0,0,0,.18); transition: transform .18s; }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 3px solid rgba(37, 99, 235, .24); outline-offset: 2px; }
.user-menu-button { display: flex; min-height: 40px; align-items: center; gap: 8px; padding: 4px 7px 4px 4px; border: 0; border-radius: 7px; background: transparent; color: #3e4a59; }
.user-menu-button:hover { background: var(--surface-subtle); }
.user-menu-button > svg { width: 15px; height: 15px; color: #8b95a3; }
.user-menu-name { font-size: 12px; font-weight: 600; }
.user-popover { position: absolute; top: 50px; right: 0; width: 190px; padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow-popover); }
.user-popover > div { display: grid; gap: 3px; padding: 9px 10px 10px; border-bottom: 1px solid var(--line); }
.user-popover small { color: var(--muted); font-size: 11px; }
.user-popover button { display: flex; width: 100%; align-items: center; gap: 8px; margin-top: 5px; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: #ac3030; font-size: 12px; text-align: left; }
.user-popover button:hover { background: var(--red-soft); }
.user-popover button svg { width: 15px; height: 15px; }

.workspace { width: 100%; max-width: 1680px; margin: 0 auto; padding: 24px 28px 44px; }
.page-status:empty { display: none; }
.status-banner { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; padding: 11px 13px; border: 1px solid; border-radius: 7px; line-height: 1.45; }
.status-banner svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.status-banner--warning { border-color: #efd59f; background: #fff8ea; color: #80520c; }
.status-banner--error { border-color: #f0c3c3; background: var(--red-soft); color: #9f2c2c; }
.status-banner--info { border-color: #c8d7f4; background: #f1f6ff; color: #315a9c; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.metric-card { position: relative; display: grid; min-height: 126px; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 13px; padding: 22px; border-right: 1px solid var(--line); }
.metric-card:last-child { border-right: 0; }
.metric-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 7px; }
.metric-icon svg { width: 20px; height: 20px; }
.metric-icon--blue { background: var(--blue-soft); color: var(--blue); }
.metric-icon--teal { background: var(--teal-soft); color: var(--teal); }
.metric-icon--amber { background: var(--amber-soft); color: var(--amber); }
.metric-icon--violet { background: var(--violet-soft); color: var(--violet); }
.metric-card p { margin: 0 0 3px; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric-card small { display: block; overflow: hidden; max-width: 130px; margin-top: 5px; color: var(--faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.metric-trend { position: absolute; right: 14px; bottom: 11px; display: flex; align-items: center; gap: 4px; color: #8b95a3; font-size: 10px; }
.metric-trend svg { width: 12px; height: 12px; }
.metric-trend--ok { color: var(--green); }

.filter-bar { display: flex; min-height: 60px; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.search-box { position: relative; display: block; min-width: 210px; flex: 1; }
.search-box > svg { position: absolute; top: 50%; left: 11px; width: 16px; height: 16px; color: #8994a2; transform: translateY(-50%); }
.search-box input { width: 100%; height: 38px; padding: 7px 38px 7px 36px; border: 1px solid var(--line-strong); border-radius: 7px; outline: none; }
.search-box input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.search-box kbd { position: absolute; top: 50%; right: 10px; min-width: 20px; padding: 2px 5px; border: 1px solid var(--line); border-bottom-color: #bac1ca; border-radius: 4px; background: #f8f9fa; color: #8c96a3; font: 10px/1.2 inherit; text-align: center; transform: translateY(-50%); }
.compact-field { display: flex; height: 38px; align-items: center; gap: 7px; padding-left: 10px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--faint); font-size: 11px; }
.compact-field select, .compact-field input { height: 36px; max-width: 112px; padding: 0 25px 0 2px; border: 0; background: #fff; color: #3e4a59; font-size: 12px; outline: none; }
.compact-field--range input { width: 105px; padding-right: 8px; }
.aggregate-control { display: flex; align-items: center; gap: 7px; padding: 0 4px; color: #536071; font-size: 12px; white-space: nowrap; cursor: pointer; }
.filter-reset { white-space: nowrap; }

.view-content { margin-top: 16px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr); gap: 16px; }
.content-grid--spaced { margin-top: 16px; }
.content-stack { display: grid; align-content: start; gap: 16px; }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.panel-head { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.panel-head > div:first-child { min-width: 0; }
.panel-head h2 { margin: 0; font-size: 14px; line-height: 1.35; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.panel-head-actions { display: flex; align-items: center; gap: 8px; }
.panel-count { padding: 3px 8px; border-radius: 10px; background: #edf0f3; color: #596677; font-size: 10px; white-space: nowrap; }
.panel-link { display: flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--blue); font-size: 11px; font-weight: 600; }
.panel-link svg { width: 13px; height: 13px; }
.panel-body { padding: 16px; }
.panel-body--flush { padding: 0; }

.table-scroll { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { height: 40px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-subtle); color: #7c8796; font-size: 10px; font-weight: 700; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { height: 51px; padding: 8px 12px; border-bottom: 1px solid #edf0f3; color: #344150; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafbfd; }
.data-table .cell-actions { width: 1%; text-align: right; white-space: nowrap; }
.data-table .cell-actions .icon-button { width: 31px; height: 31px; display: inline-grid; }
.data-table .cell-muted { color: var(--muted); }
.data-table .cell-strong { color: var(--text); font-weight: 650; }
.data-table .cell-mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; font-variant-numeric: tabular-nums; }
.data-table .empty-cell { padding: 0; }
.port-cell { display: flex; min-width: 105px; align-items: center; gap: 9px; }
.protocol-pill { min-width: 34px; padding: 3px 5px; border-radius: 4px; background: #edf1f5; color: #516173; font-size: 9px; font-weight: 800; text-align: center; text-transform: uppercase; }
.protocol-pill--udp { background: var(--violet-soft); color: var(--violet); }
.protocol-pill--range { background: var(--amber-soft); color: var(--amber); }
.port-number { color: #142033; font-family: "Cascadia Code", Consolas, monospace; font-weight: 700; font-variant-numeric: tabular-nums; }
.process-cell { display: grid; max-width: 190px; gap: 2px; }
.process-cell strong, .process-cell small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.process-cell strong { font-size: 12px; font-weight: 600; }
.process-cell small { color: var(--faint); font-size: 10px; }
.tag-row { display: flex; max-width: 260px; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-flex; min-height: 21px; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 4px; background: #eef1f4; color: #596777; font-size: 10px; white-space: nowrap; }
.tag svg { width: 11px; height: 11px; }
.tag--proxy { background: var(--teal-soft); color: #08715f; font-weight: 700; }
.tag--public { background: var(--amber-soft); color: #975c0e; }
.tag--success { background: var(--green-soft); color: var(--green); }
.tag--danger { background: var(--red-soft); color: var(--red); }
.tag--blue { background: var(--blue-soft); color: #285ab9; }
.tag--outline { border: 1px solid var(--line); background: #fff; }
.note-preview { display: block; overflow: hidden; max-width: 200px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

.empty-state, .loading-state, .error-state { display: grid; min-height: 250px; padding: 34px; place-items: center; text-align: center; }
.empty-state > div, .loading-state > div, .error-state > div { display: grid; max-width: 390px; justify-items: center; }
.state-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 8px; background: #eef1f5; color: #718094; }
.state-icon svg { width: 22px; height: 22px; }
.error-state .state-icon { background: var(--red-soft); color: var(--red); }
.empty-state h3, .loading-state h3, .error-state h3 { margin: 14px 0 6px; font-size: 14px; }
.empty-state p, .loading-state p, .error-state p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.error-state .button { margin-top: 16px; }
.loading-spinner { width: 26px; height: 26px; border: 3px solid #dbe3ee; border-top-color: var(--blue); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.is-spinning svg { animation: spin .8s linear infinite; }

.health-list { display: grid; gap: 0; }
.health-row { display: flex; min-height: 51px; align-items: center; gap: 10px; border-bottom: 1px solid #edf0f3; }
.health-row:last-child { border-bottom: 0; }
.health-icon { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 6px; background: #eef2f6; color: #596879; }
.health-icon svg { width: 15px; height: 15px; }
.health-copy { display: grid; min-width: 0; flex: 1; gap: 2px; }
.health-copy strong { font-size: 11px; }
.health-copy small { overflow: hidden; color: var(--faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.health-value { color: #4f5d6d; font: 10px "Cascadia Code", Consolas, monospace; white-space: nowrap; }

.relationship-list { display: grid; gap: 9px; }
.relationship-item { display: grid; min-width: 0; grid-template-columns: minmax(120px, 1fr) 90px minmax(120px, 1fr); align-items: center; gap: 10px; padding: 12px; border: 1px solid #e6e9ed; border-radius: 7px; background: #fbfcfd; }
.endpoint { display: flex; min-width: 0; align-items: center; gap: 9px; }
.endpoint-icon { display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; border-radius: 6px; background: var(--blue-soft); color: var(--blue); }
.endpoint--target .endpoint-icon { background: var(--teal-soft); color: var(--teal); }
.endpoint-icon svg { width: 15px; height: 15px; }
.endpoint-copy { display: grid; min-width: 0; gap: 2px; }
.endpoint-copy strong { overflow: hidden; color: #263344; font: 600 11px "Cascadia Code", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.endpoint-copy small { overflow: hidden; color: var(--faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.relationship-arrow { display: grid; justify-items: center; gap: 3px; color: #8290a1; font-size: 9px; text-align: center; }
.relationship-arrow > span:first-child { display: flex; width: 100%; align-items: center; gap: 3px; }
.relationship-arrow > span:first-child::before, .relationship-arrow > span:first-child::after { height: 1px; flex: 1; background: #cdd4dc; content: ""; }
.relationship-arrow svg { width: 13px; height: 13px; flex: 0 0 13px; }

.proxy-hero { display: grid; grid-template-columns: minmax(0, 1fr) repeat(2, minmax(120px, 180px)); gap: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.proxy-hero > div { min-height: 105px; padding: 20px; border-right: 1px solid var(--line); }
.proxy-hero > div:last-child { border-right: 0; }
.proxy-hero-main { display: flex; align-items: center; gap: 15px; }
.proxy-hero-icon { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: 8px; background: var(--teal-soft); color: var(--teal); }
.proxy-hero-icon svg { width: 22px; height: 22px; }
.proxy-hero h2 { margin: 0 0 5px; font-size: 15px; }
.proxy-hero p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.proxy-stat { display: grid; align-content: center; gap: 5px; }
.proxy-stat span { color: var(--muted); font-size: 11px; }
.proxy-stat strong { font-size: 22px; font-variant-numeric: tabular-nums; }

.audit-list { display: grid; }
.audit-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #edf0f3; }
.audit-item:last-child { border-bottom: 0; }
.audit-marker { width: 8px; height: 8px; margin-top: 5px; border: 2px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px #9bb8ef; }
.audit-copy { display: grid; min-width: 0; gap: 4px; }
.audit-copy strong { font-size: 11px; font-weight: 650; }
.audit-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.audit-time { color: var(--faint); font-size: 10px; white-space: nowrap; }

.pagination { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination-actions { display: flex; gap: 6px; }
.pagination .button { min-height: 32px; padding: 5px 9px; font-size: 11px; }

.modal { width: min(520px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(18, 27, 40, .28); }
.modal::backdrop { background: rgba(20, 28, 38, .55); }
.modal form { display: flex; max-height: calc(100vh - 28px); flex-direction: column; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 19px 20px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head p:last-child { margin: 5px 0 0; color: var(--muted); font: 11px "Cascadia Code", Consolas, monospace; }
.modal-body { display: grid; overflow: auto; gap: 17px; padding: 20px; }
.modal-body .inline-alert { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 13px 20px; border-top: 1px solid var(--line); background: #fafbfc; }

.toast-region { position: fixed; z-index: 80; right: 20px; bottom: 20px; display: grid; width: min(350px, calc(100vw - 30px)); gap: 8px; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 7px; background: #fff; box-shadow: var(--shadow-popover); color: #3d4b5a; font-size: 12px; line-height: 1.5; animation: toast-in .2s ease-out; }
.toast--error { border-left-color: var(--red); }
.toast svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--green); }
.toast--error svg { color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.sidebar-scrim { position: fixed; z-index: 35; inset: 0; background: rgba(14, 20, 28, .48); }
.noscript { position: fixed; z-index: 100; inset: auto 20px 20px; padding: 12px; border-radius: 7px; background: var(--red); color: #fff; text-align: center; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card:nth-child(2) { border-right: 0; }
  .metric-card:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .filter-bar { flex-wrap: wrap; }
  .search-box { flex-basis: calc(100% - 20px); }
  .compact-field { flex: 1; }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  :root { --topbar-height: 62px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.is-open { transform: translateX(0); box-shadow: 12px 0 35px rgba(13, 20, 29, .22); }
  .sidebar-close, .menu-button { display: inline-grid; }
  .main-column { margin-left: 0; }
  .topbar { padding: 0 18px; }
  .workspace { padding: 18px 18px 34px; }
  .last-updated, .auto-refresh-control > span:last-child { display: none; }
}

@media (max-width: 680px) {
  .auth-shell { display: block; }
  .auth-brand { display: none; }
  .auth-form-side { min-height: 100vh; padding: 30px 22px; }
  .mobile-brand { display: flex; margin-bottom: 52px; }
  .mobile-brand .brand-mark { background: var(--sidebar); color: #fff; }
  .mobile-brand strong { color: var(--text); }
  .mobile-brand small { color: var(--muted); }
  .auth-card header h2 { font-size: 24px; }

  .topbar { gap: 8px; padding: 0 12px; }
  .topbar-actions { gap: 6px; }
  .auto-refresh-control, .topbar-divider, .user-menu-name, .user-menu-button > svg { display: none; }
  .user-menu-button { padding: 4px; }
  .topbar-left h1 { font-size: 15px; }
  .breadcrumb { display: none; }
  .workspace { padding: 12px 10px 28px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 112px; grid-template-columns: 34px minmax(0, 1fr); gap: 9px; padding: 16px 12px; }
  .metric-icon { width: 34px; height: 34px; }
  .metric-icon svg { width: 17px; height: 17px; }
  .metric-card strong { font-size: 22px; }
  .metric-card small { max-width: 92px; }
  .metric-trend { display: none; }
  .filter-bar { align-items: stretch; padding: 9px; }
  .search-box { min-width: 100%; flex-basis: 100%; }
  .compact-field { min-width: calc(50% - 5px); padding-left: 8px; }
  .compact-field select, .compact-field input { min-width: 0; max-width: none; flex: 1; }
  .compact-field--range { width: 100%; }
  .aggregate-control { min-height: 38px; flex: 1; }
  .filter-reset { padding: 7px 10px; }
  .panel-head { padding: 12px; }
  .panel-head p { max-width: 240px; }
  .panel-body { padding: 12px; }
  .data-table { min-width: 670px; }
  .relationship-item { grid-template-columns: 1fr; gap: 8px; }
  .relationship-arrow { grid-template-columns: 25px 1fr; justify-items: start; padding-left: 3px; text-align: left; }
  .relationship-arrow > span:first-child { width: auto; transform: rotate(90deg); }
  .relationship-arrow > span:first-child::before, .relationship-arrow > span:first-child::after { display: none; }
  .proxy-hero { grid-template-columns: repeat(2, 1fr); }
  .proxy-hero-main { grid-column: 1 / -1; }
  .proxy-hero > div { min-height: 90px; }
  .proxy-hero-main { border-right: 0 !important; border-bottom: 1px solid var(--line); }
  .audit-item { grid-template-columns: 10px minmax(0, 1fr); }
  .audit-time { grid-column: 2; }
  .modal-head, .modal-body, .modal-actions { padding-right: 15px; padding-left: 15px; }
  .toast-region { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
}

@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric-card:nth-child(3) { border-bottom: 1px solid var(--line); }
  .metric-card:last-child { border-bottom: 0; }
  .compact-field { min-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
