:root {
  --bg: #0c1117;
  --surface: #141b23;
  --surface-raised: #19222c;
  --surface-soft: #10171e;
  --border: #293440;
  --border-strong: #3b4b5a;
  --text: #f3f6f8;
  --muted: #9aa9b7;
  --subtle: #728292;
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, .12);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, .12);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, .11);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .11);
  --ok: #34d399;
  --shadow: 0 10px 28px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; }
html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}
button, input, select { font: inherit; }
button, select { -webkit-tap-highlight-color: transparent; }
h1, h2, p { margin: 0; letter-spacing: 0; }
h1 { font-size: 25px; line-height: 1.1; }
h2 { margin-top: 3px; font-size: 18px; line-height: 1.25; }
code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  color: #c9d9e5;
}
.hidden { display: none !important; }

.topbar,
.shell {
  position: relative;
  width: min(1440px, calc(100% - 32px));
  max-width: calc(100vw - 32px);
  margin: 0 auto;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.brand-lockup { min-width: 0; }
.eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}
.topbar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.live-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ok);
  font-weight: 700;
}
.live-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .10);
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.primary-btn,
.ghost-btn {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
}
.primary-btn {
  border: 1px solid #1f9f91;
  color: #042f2e;
  background: var(--accent);
}
.ghost-btn {
  border: 1px solid var(--border-strong);
  color: var(--muted);
  background: var(--surface-soft);
}
.primary-btn:hover { background: #5eead4; }
.ghost-btn:hover { color: var(--text); border-color: #526575; }
.primary-btn:focus-visible,
.ghost-btn:focus-visible,
.client-row:focus-visible,
.online-user-row:focus-visible,
.access-tab:focus-visible,
.access-user-select-label select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.shell { padding-bottom: 28px; }
.setup-hint,
.summary-card,
.server-card,
.panel-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.setup-hint {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}
.setup-hint strong { color: var(--accent); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.summary-card {
  min-width: 0;
  min-height: 82px;
  padding: 12px 13px;
}
.summary-card span,
.metric-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}
.summary-card strong {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  font-size: 26px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-card small {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--subtle);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-card.hot {
  border-color: rgba(45, 212, 191, .48);
  background: #132721;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin: 16px 0 9px;
}
.section-title.compact { margin: 0 0 12px; }
.section-title small,
.inline-section-head small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.section-actions { display: flex; align-items: center; gap: 8px; }
.ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}
.ghost-link:hover { color: var(--text); }

.server-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.server-card {
  min-width: 0;
  padding: 12px;
}
.server-card:hover { border-color: var(--border-strong); }
.server-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.server-name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.server-note {
  min-height: 15px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #202b35;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge.ok { color: var(--ok); }
.badge.bad { color: var(--danger); }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.metric {
  min-width: 0;
  padding: 8px;
  border: 1px solid #25303a;
  border-radius: 6px;
  background: var(--surface-soft);
}
.metric-value {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}
.progress,
.traffic-bar,
.client-usage-bar {
  overflow: hidden;
  border-radius: 999px;
  background: #26323d;
}
.progress { height: 4px; margin-top: 7px; }
.progress i,
.traffic-bar i,
.client-usage-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}
.traffic-plan {
  margin-top: 9px;
  padding: 9px;
  border: 1px solid #25303a;
  border-radius: 6px;
  background: var(--surface-soft);
}
.traffic-plan-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.traffic-plan-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.traffic-plan-head strong {
  color: var(--accent);
  font: 700 12px/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.traffic-bar { height: 6px; margin-top: 7px; }
.traffic-bar i { background: var(--accent); }
.traffic-plan.warn .traffic-bar i { background: var(--warn); }
.traffic-plan.bad .traffic-bar i { background: var(--danger); }
.traffic-plan.warn .traffic-plan-head strong { color: var(--warn); }
.traffic-plan.bad .traffic-plan-head strong { color: var(--danger); }
.traffic-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.traffic-plan-grid div {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
}
.traffic-plan-grid strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text);
  font: 600 10px/1.3 ui-monospace, "SFMono-Regular", Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.traffic-breakdown {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.server-footer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.kv {
  min-width: 0;
  padding: 7px;
  border-radius: 6px;
  color: var(--muted);
  background: #1b252f;
  font-size: 10px;
}
.kv strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text);
  font: 600 10px/1.3 ui-monospace, "SFMono-Regular", Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.error {
  margin-top: 10px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-areas:
    "online online online online clients clients clients clients clients clients clients clients"
    "access access access access access access access access access access access access"
    "trends trends trends trends trends trends trends trends probe probe probe probe"
    "domains domains domains domains health health health health alerting alerting alerting alerting"
    "recent recent recent recent recent recent recent recent recent recent recent recent";
  gap: 12px;
  margin-top: 14px;
  align-items: stretch;
}
.panel-card {
  min-width: 0;
  padding: 14px;
}
.workspace-grid > .panel-card { align-self: stretch; }
.online-panel { grid-area: online; }
.clients-panel { grid-area: clients; }
.access-panel { grid-area: access; }
.trend-panel { grid-area: trends; }
.client-probe-panel { grid-area: probe; }
.domains-panel { grid-area: domains; }
.health-panel { grid-area: health; }
.alerting-panel { grid-area: alerting; }
.recent-panel { grid-area: recent; }

.online-server-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}
.online-server-chip {
  min-width: 0;
  padding: 8px;
  border: 1px solid #25303a;
  border-radius: 6px;
  background: var(--surface-soft);
}
.online-server-chip span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.online-server-chip strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}
.online-users-list {
  display: grid;
  gap: 7px;
  max-height: 360px;
  overflow: auto;
  padding-right: 3px;
}
.online-user-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 9px;
  border: 1px solid #29423f;
  border-radius: 7px;
  color: inherit;
  background: #13231f;
  text-align: left;
  cursor: pointer;
}
.online-user-row:hover,
.online-user-row.selected { border-color: rgba(45, 212, 191, .60); }
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.online-dot.ok { background: var(--ok); }
.online-dot.bad { background: var(--danger); }
.online-user-row strong {
  display: block;
  overflow: hidden;
  color: #e9fff9;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.online-user-row span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.online-user-row em {
  color: var(--accent);
  font: normal 600 11px/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
  white-space: nowrap;
}

.client-table-head,
.client-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) minmax(150px, 1fr) minmax(130px, .85fr) 64px;
  gap: 10px;
  align-items: center;
}
.client-table-head {
  padding: 0 9px 7px;
  color: var(--subtle);
  font-size: 10px;
}
.clients-list {
  max-height: 430px;
  overflow: auto;
  padding-right: 3px;
}
.client-row {
  width: 100%;
  min-height: 54px;
  padding: 8px 9px;
  border: 0;
  border-top: 1px solid #25303a;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.client-row:hover,
.client-row.selected { background: #182a29; }
.client-row.disabled { opacity: .58; }
.client-identity {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.client-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--accent);
  background: var(--accent-soft);
  font: 700 11px/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.client-identity strong,
.client-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-identity strong { font-size: 12px; }
.client-identity small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}
.client-direction {
  color: var(--muted);
  font: 500 10px/1.4 ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.client-usage strong {
  display: block;
  color: var(--text);
  font: 650 11px/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.client-usage-bar {
  height: 4px;
  margin-top: 7px;
}
.client-usage-bar i { background: var(--blue); }
.client-state {
  justify-self: end;
  padding: 5px 7px;
  border-radius: 999px;
  color: var(--subtle);
  background: #202a34;
  font-size: 10px;
  font-weight: 700;
}
.client-state.online { color: var(--ok); background: rgba(52, 211, 153, .10); }
.client-state.disabled { color: var(--danger); background: var(--danger-soft); }

.access-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}
.access-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 4px;
  width: min(340px, 100%);
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-soft);
}
.access-tab {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.access-tab.active {
  color: #042f2e;
  background: var(--accent);
}
.access-user-select-label {
  display: grid;
  grid-template-columns: auto minmax(180px, 260px);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.access-user-select-label select {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-soft);
}
.access-user-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.access-summary-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid #25303a;
  border-radius: 6px;
  background: var(--surface-soft);
}
.access-summary-item span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.access-summary-item strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.access-summary-item strong.good { color: var(--ok); }
.access-monitor-grid {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  gap: 12px;
}
.access-ranking-pane,
.access-live-pane {
  min-width: 0;
  padding: 11px;
  border: 1px solid #25303a;
  border-radius: 7px;
  background: var(--surface-soft);
}
.inline-section-title {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0;
}
.inline-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.access-rank {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}
.access-rank-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid #29423f;
  border-radius: 6px;
  background: #13231f;
}
.rank-index {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  color: var(--accent);
  background: var(--accent-soft);
  font: 700 10px/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.access-rank-row strong,
.access-rank-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.access-rank-row strong { color: #a7f3d0; font-size: 12px; }
.access-rank-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.access-count {
  color: var(--text);
  font: 650 11px/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
  white-space: nowrap;
}
.access-events-list {
  display: grid;
  max-height: 432px;
  overflow: auto;
  margin-top: 9px;
  padding-right: 3px;
}
.access-event-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px 2px;
  border-top: 1px solid #25303a;
}
.access-event-row:first-child { border-top: 0; }
.access-event-row strong,
.access-event-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.access-event-row strong { color: #a7f3d0; font-size: 12px; }
.access-event-row span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.access-event-row time {
  color: var(--subtle);
  font: 500 10px/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
  white-space: nowrap;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.trend-card {
  min-width: 0;
  padding: 9px;
  border: 1px solid #25303a;
  border-radius: 6px;
  background: var(--surface-soft);
}
.trend-card div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.trend-card span { color: var(--muted); font-size: 10px; font-weight: 700; }
.trend-card strong { font: 650 13px/1 ui-monospace, "SFMono-Regular", Menlo, monospace; }
.trend-card svg { display: block; width: 100%; height: 56px; margin-top: 8px; }
.trend-card polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.client-probe-list { display: grid; gap: 7px; }
.client-probe-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #25303a;
  border-radius: 6px;
  background: var(--surface-soft);
}
.client-probe-row strong,
.client-probe-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-probe-row strong { font-size: 12px; }
.client-probe-row span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.client-probe-row em {
  color: var(--muted);
  font: normal 600 11px/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
  white-space: nowrap;
}
.client-probe-row.good strong,
.client-probe-row.good em { color: var(--ok); }
.client-probe-row.warn strong,
.client-probe-row.warn em { color: var(--warn); }
.client-probe-row.bad strong,
.client-probe-row.bad em { color: var(--danger); }

.domain-monitor-list { max-height: 320px; overflow: auto; padding-right: 3px; }
.domain-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #25303a;
}
.domain-row:first-child { border-top: 0; }
.domain-row strong,
.domain-row span { display: block; }
.domain-row strong { font-size: 12px; }
.domain-row span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.domain-row em {
  color: var(--muted);
  font: normal 600 10px/1.3 ui-monospace, "SFMono-Regular", Menlo, monospace;
  text-align: right;
}
.domain-row.good strong { color: var(--ok); }
.domain-row.warn strong { color: var(--warn); }
.domain-row.bad strong { color: var(--danger); }

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #25303a;
  color: var(--muted);
  font-size: 11px;
}
.status-row:first-child { border-top: 0; }
.status-row strong {
  color: var(--text);
  font: 650 11px/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.alert-row {
  padding: 9px 0;
  border-top: 1px solid #25303a;
}
.alert-row:first-child { border-top: 0; }
.alert-row strong { font-size: 12px; }
.alert-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.alert-row.good strong { color: var(--ok); }
.alert-row.warn strong { color: var(--warn); }
.alert-row.bad strong { color: var(--danger); }

.logs-list { max-height: 360px; overflow: auto; padding-right: 3px; }
.compact-logs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  max-height: 320px;
}
.log-row {
  min-width: 0;
  padding: 9px 0;
  border-top: 1px solid #25303a;
}
.log-row div {
  display: flex;
  justify-content: space-between;
  gap: 9px;
  align-items: baseline;
}
.log-row strong { color: var(--blue); font-size: 11px; }
.log-row.error strong { color: var(--danger); }
.log-row.warn strong { color: var(--warn); }
.log-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-row code {
  display: block;
  margin-top: 5px;
  color: #c9d9e5;
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}
.empty {
  padding: 14px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.empty.small { padding: 10px 0 0; font-size: 11px; }

.login-body { display: grid; place-items: center; padding: 18px; }
.login-shell { position: relative; width: min(420px, 100%); }
.login-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.login-card h1 { margin-top: 6px; font-size: 28px; }
.login-form { display: grid; gap: 13px; margin-top: 18px; }
.login-form label { color: var(--muted); font-size: 12px; font-weight: 700; }
.login-form input {
  width: 100%;
  margin-top: 7px;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  outline: none;
  color: var(--text);
  background: var(--surface-soft);
}
.login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(96, 165, 250, .12); }
.remember-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text) !important;
  font-size: 13px !important;
}
.remember-row input { width: auto; margin: 0; accent-color: var(--accent); }
.login-msg { min-height: 18px; color: var(--danger); font-size: 12px; }

@media (max-width: 1120px) {
  .workspace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "online clients"
      "access access"
      "trends trends"
      "probe domains"
      "health alerting"
      "recent recent";
  }
  .history-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .topbar-status { display: none; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .server-grid { grid-template-columns: 1fr; }
  .workspace-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "online"
      "clients"
      "access"
      "trends"
      "probe"
      "domains"
      "health"
      "alerting"
      "recent";
  }
  .access-monitor-grid { grid-template-columns: 1fr; }
  .compact-logs { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar,
  .shell {
    width: calc(100% - 20px);
    max-width: calc(100vw - 20px);
  }
  .topbar {
    min-height: 62px;
    margin-top: 8px;
    padding: 10px;
    gap: 10px;
  }
  h1 { font-size: 20px; }
  h2 { font-size: 17px; }
  .eyebrow { font-size: 9px; }
  .top-actions { margin-left: auto; }
  .primary-btn,
  .ghost-btn {
    min-height: 38px;
    padding: 0 10px;
  }
  .summary-grid { gap: 7px; margin-bottom: 10px; }
  .summary-card { min-height: 74px; padding: 10px; }
  .summary-card strong { font-size: 20px; }
  .summary-card span,
  .summary-card small { font-size: 9px; }
  .section-title { margin-top: 13px; }
  .server-card,
  .panel-card { padding: 11px; }
  .traffic-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .server-footer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-grid { gap: 8px; margin-top: 10px; }
  .online-server-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .online-server-chip { padding: 7px 6px; }
  .online-users-list,
  .clients-list,
  .domain-monitor-list { max-height: none; overflow: visible; padding-right: 0; }
  .client-table-head { display: none; }
  .client-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "identity state"
      "direction usage";
    gap: 7px 10px;
    min-height: 66px;
    padding: 9px 4px;
  }
  .client-identity { grid-area: identity; }
  .client-direction { grid-area: direction; }
  .client-usage { grid-area: usage; min-width: 96px; text-align: right; }
  .client-state { grid-area: state; }
  .access-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .access-tabs { width: 100%; }
  .access-user-select-label {
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
  }
  .access-user-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-monitor-grid { gap: 8px; }
  .access-ranking-pane,
  .access-live-pane { padding: 9px; }
  .access-events-list { max-height: 390px; }
  .history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-probe-row,
  .domain-row { align-items: flex-start; }
  .domain-row { flex-direction: column; gap: 6px; }
  .domain-row em { text-align: left; }
  .compact-logs { max-height: 420px; }
  .log-row div { display: block; }
  .log-row span { display: block; margin-top: 4px; white-space: normal; }
}
