﻿:root {
  --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-heading: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;

  --p-bg: #0e1015;
  --p-bg-2: #12141a;
  --p-surface: #1a1d26;
  --p-surface-2: #1e222c;
  --p-surface-raised: #222632;
  --p-border: #2a2e3a;
  --p-border-strong: #3a4050;
  --p-border-glass: #2a2e3a;
  --p-text: #e8eaee;
  --p-muted: #a8adb8;
  --p-faint: #8b919e;
  --p-accent: #c56a3a;
  --p-accent-hover: #d4784a;
  --p-accent-2: #d4784a;
  --p-accent-soft: rgba(197, 106, 58, 0.12);
  --p-accent-ring: rgba(197, 106, 58, 0.28);
  --p-danger: #c45c5c;
  --p-danger-soft: rgba(196, 92, 92, 0.12);
  --p-ok: #6b9e78;
  --p-ok-soft: rgba(107, 158, 120, 0.12);
  --p-warn: #c9a227;
  --p-warn-soft: rgba(201, 162, 39, 0.1);
  --p-radius: 6px;
  --p-radius-sm: 4px;
  --p-radius-xs: 4px;
  --p-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 4px 16px rgba(0, 0, 0, 0.28);
  --p-sidebar: 240px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --p-space-1: 4px;
  --p-space-2: 8px;
  --p-space-3: 12px;
  --p-space-4: 16px;
  --p-space-5: 24px;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  min-height: 100%;
}

html {
  scrollbar-gutter: stable;
}

body {
  background: var(--p-bg);
  color: var(--p-text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  color-scheme: dark;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--p-bg);
}

/* brand */
.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.brand-mark .logo {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  background: transparent;
}
.brand-mark .name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand-mark .name b {
  color: var(--p-text);
  font-weight: 700;
}
.brand-mark.compact .name {
  display: none;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
.lang-switch .segmented {
  margin-bottom: 0;
}

/* auth */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 18px;
}
.auth-langs {
  margin-bottom: 4px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 32px 28px 28px;
  box-shadow: var(--p-shadow);
}
.auth-card h1 {
  margin: 12px 0 4px;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.02em;
}
.auth-sub {
  margin: 0 0 22px;
  text-align: center;
  color: var(--p-muted);
  font-size: 14px;
}

.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--p-muted);
  margin-bottom: 7px;
}
.field input,
.field textarea,
.select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border-strong);
  background: rgba(0, 0, 0, 0.32);
  color: var(--p-text);
  font-size: 14px;
  font-family: inherit;
  color-scheme: dark;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--p-faint);
}
.field input:focus,
.field textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--p-accent);
  box-shadow: 0 0 0 3px var(--p-accent-ring);
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--p-muted);
  cursor: pointer;
}
.check input {
  accent-color: var(--p-accent);
}
.link {
  color: var(--p-accent-2);
  font-size: 13px;
  font-weight: 600;
}
.link:hover {
  text-decoration: underline;
}

.btn,
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--p-radius-xs);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  color: #fff;
  background: var(--p-accent);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.btn-primary:hover:not(:disabled) {
  background: var(--p-accent-hover);
}
.btn-secondary {
  color: var(--p-text);
  background: var(--p-surface-2);
  border-color: var(--p-border-strong);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--p-surface-raised);
}
.btn-ghost {
  color: var(--p-muted);
  background: transparent;
  border-color: var(--p-border);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--p-text);
  background: var(--p-surface);
  border-color: var(--p-border-strong);
}
.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
}
.btn-xs {
  padding: 5px 9px;
  font-size: 11px;
  min-width: 32px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--p-faint);
  font-size: 12px;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--p-border);
}

.auth-foot {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--p-muted);
}
.auth-foot a {
  color: var(--p-accent-2);
  font-weight: 700;
}

.alert {
  padding: 11px 14px;
  border-radius: var(--p-radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-error {
  background: var(--p-danger-soft);
  border-color: rgba(248, 113, 113, 0.28);
  color: #fca5a5;
}
.alert-ok {
  background: var(--p-ok-soft);
  border-color: rgba(52, 211, 153, 0.28);
  color: #6ee7b7;
}
.alert-warn {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.28);
  color: #fcd34d;
}

/* app shell */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--p-sidebar);
  flex-shrink: 0;
  border-right: 1px solid var(--p-border);
  background: var(--p-bg-2);
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 6px 12px;
  border-bottom: 1px solid var(--p-border);
  margin-bottom: 6px;
}
.beta-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p-faint);
  border: 1px solid var(--p-border);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--p-surface);
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
  margin-right: -2px;
}
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--p-border-strong);
  border-radius: 4px;
}

.nav-group {
  margin-top: 12px;
}
.nav-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--p-faint);
  padding: 0 8px 5px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: var(--p-radius-xs);
  border: 1px solid transparent;
  color: var(--p-muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 1px;
  transition: background 0.12s var(--ease), color 0.12s var(--ease), border-color 0.12s var(--ease);
  position: relative;
}
.nav-svg {
  flex-shrink: 0;
  opacity: 0.75;
}
.nav-label {
  flex: 1;
  min-width: 0;
}
.nav-item:hover {
  background: var(--p-surface);
  color: var(--p-text);
}
.nav-item:hover .nav-svg {
  opacity: 1;
}
.nav-item.active {
  color: var(--p-text);
  background: var(--p-accent-soft);
  border-color: rgba(197, 106, 58, 0.2);
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: var(--p-accent);
}
.nav-item.active .nav-svg {
  opacity: 1;
  color: var(--p-accent-hover);
}
.nav-tag {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--p-surface-2);
  color: var(--p-faint);
}
.nav-item.active .nav-tag {
  background: rgba(197, 106, 58, 0.18);
  color: var(--p-accent-2);
}

.sidebar-user {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--p-radius-sm);
  border: 1px solid var(--p-border);
  background: var(--p-surface);
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  background: var(--p-accent);
}
.avatar.lg {
  width: 40px;
  height: 40px;
  font-size: 15px;
  border-radius: 10px;
}
.sidebar-user .meta {
  overflow: hidden;
  min-width: 0;
}
.sidebar-user .meta .n {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .meta .r {
  font-size: 10px;
  color: var(--p-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sidebar-user .logout {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--p-radius-xs);
  background: transparent;
  border: 1px solid transparent;
  color: var(--p-faint);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.sidebar-user .logout:hover {
  color: var(--p-danger);
  background: var(--p-danger-soft);
  border-color: rgba(248, 113, 113, 0.2);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
}
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--p-border);
  background: var(--p-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.topbar h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}
.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
  padding: 4px;
  border-radius: var(--p-radius-sm);
  border: 1px solid var(--p-border);
  background: var(--p-surface);
}
.topbar-actions > form {
  margin: 0;
}
.topbar-actions .btn-sm {
  height: 30px;
}
.topbar-actions .segmented {
  margin-bottom: 0;
}
.topbar-actions .btn-ghost {
  border-color: transparent;
}
.topbar-docs {
  flex-shrink: 0;
}

.role-preview-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.role-preview-switch-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--p-faint);
  white-space: nowrap;
}
.role-preview-switch .segmented {
  margin-bottom: 0;
}
.role-preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}
.role-preview-banner form {
  margin: 0;
}
.role-preview-banner .btn-ghost {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.1);
}
.role-preview-banner .btn-ghost:hover:not(:disabled) {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.45);
}

.content {
  padding: 14px 20px 36px;
  max-width: 1360px;
  width: 100%;
}
.content:has(.hub-head),
.content:has(.mon-page),
.content:has(.ops-page) {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.content:has(.hwid-catalog-page),
.content:has(.detection-process-page) {
  max-width: none;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card,
.panel {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 16px 18px;
  box-shadow: var(--p-shadow);
}
.panel:has(.panel-head),
.panel:has(.panel-body),
.card.panel-flush,
.card.data-table-wrap {
  padding: 0;
  overflow: hidden;
}
.panel-flush .panel-body {
  padding: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--p-border);
}
.panel-head-start {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.panel-hint {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--p-muted);
}
.panel-body {
  padding: 18px 22px;
}
.panel-compact .panel-head {
  padding: 10px 14px;
}
.panel-compact .panel-body {
  padding: 10px 14px;
}
.panel-compact .panel-title {
  font-size: 13px;
}
.panel-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.page-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}
.page-intro-sub {
  margin: 0;
  font-size: 14px;
  color: var(--p-muted);
  max-width: 640px;
  line-height: 1.55;
}
.page-intro-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.stat-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stat-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .stat-grid-4,
  .stat-grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.stat-card {
  padding: 10px 12px;
  border-radius: var(--p-radius);
  border: 1px solid var(--p-border);
  background: var(--p-surface);
  box-shadow: var(--p-shadow);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--p-border-strong);
}
.stat-card:hover {
  border-color: var(--p-border-strong);
  background: var(--p-surface-2);
}
.stat-card-label,
.stat-card .stat-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--p-faint);
}
.stat-card-value,
.stat-card .stat-value {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--p-text);
  font-variant-numeric: tabular-nums;
}
.stat-card.tone-accent::before {
  background: var(--p-accent);
}
.stat-card.tone-accent .stat-card-value {
  color: var(--p-accent-hover);
}
.stat-card.tone-warn::before {
  background: var(--p-warn);
}
.stat-card.tone-warn .stat-card-value {
  color: var(--p-warn);
}
.stat-card.tone-danger::before {
  background: var(--p-danger);
}
.stat-card.tone-danger .stat-card-value {
  color: var(--p-danger);
}
.stat-card.tone-ok::before {
  background: var(--p-ok);
}
.stat-card.tone-ok .stat-card-value {
  color: var(--p-ok);
}
.card.pad-lg {
  padding: 20px 22px;
}
.card h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}
.card .muted {
  color: var(--p-muted);
  font-size: 14px;
  margin: 0 0 14px;
}

.welcome,
.welcome-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--p-surface);
  border: 1px solid var(--p-border);
}
.welcome .w-text h2,
.welcome-card .w-text h2,
.welcome-card h2 {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.welcome .w-text .email,
.welcome-card .email {
  color: var(--p-muted);
  font-size: 12.5px;
}
.welcome .w-text p,
.welcome-card .w-text p,
.welcome-card .muted {
  margin: 4px 0 0;
  color: var(--p-muted);
  font-size: 13px;
}
.role-tag {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--p-radius-sm);
  background: var(--p-accent-soft);
  color: var(--p-accent-2);
  border: 1px solid rgba(197, 106, 58, 0.28);
  white-space: nowrap;
}

.grid {
  display: grid;
  gap: 18px;
}
.grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.stat {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 18px 20px;
}
.stat .label {
  font-size: 12.5px;
  color: var(--p-muted);
  font-weight: 600;
}
.stat .value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 6px;
}
.stat .value.accent {
  color: var(--p-accent);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 20px;
  gap: 12px;
}
.empty .ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: var(--p-accent-soft);
  border: 1px solid rgba(124, 92, 255, 0.3);
}
.empty .t {
  font-size: 16px;
  font-weight: 700;
}
.empty .s {
  color: var(--p-muted);
  font-size: 14px;
  max-width: 380px;
}

.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.quick a {
  display: inline-flex;
  padding: 10px 15px;
  border-radius: var(--p-radius-sm);
  border: 1px solid var(--p-border-strong);
  background: var(--p-surface-2);
  font-size: 14px;
  font-weight: 600;
}
.quick a:hover {
  border-color: var(--p-accent);
}

.list-row {
  display: flex;
  gap: 13px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--p-border);
}
.list-row:last-child {
  border-bottom: none;
}
.list-row .ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--p-accent-soft);
  color: var(--p-accent);
}
.list-row .t {
  font-weight: 700;
  font-size: 14.5px;
}
.list-row .d {
  color: var(--p-muted);
  font-size: 13.5px;
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.plan {
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 22px;
  background: var(--p-surface);
  position: relative;
}
.plan.featured {
  border-color: var(--p-accent);
}
.plan .pname {
  font-weight: 700;
  font-size: 16px;
}
.plan .price {
  font-size: 30px;
  font-weight: 700;
  margin: 8px 0;
}
.plan .price span {
  font-size: 14px;
  color: var(--p-muted);
  font-weight: 600;
}
.plan ul {
  list-style: none;
  padding: 0;
  margin: 14px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.plan li {
  font-size: 13.5px;
  color: var(--p-muted);
  display: flex;
  gap: 8px;
}
.plan li::before {
  content: "\2713";
  color: var(--p-ok);
  font-weight: 700;
}
.plan-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--p-radius-sm);
  color: #fff;
  background: var(--p-accent);
}

.cl-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--p-border);
}
.cl-item:last-child {
  border-bottom: none;
}
.cl-item .ver {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 13px;
  color: var(--p-accent);
  width: 70px;
}
.cl-item .body .t {
  font-weight: 700;
}
.cl-item .body .date {
  color: var(--p-faint);
  font-size: 12px;
  margin-bottom: 4px;
}
.cl-item .body ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--p-muted);
  font-size: 13.5px;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 16px 0;
}
.step {
  display: flex;
  gap: 14px;
}
.step .num {
  counter-increment: step;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: var(--p-accent);
}
.steps {
  counter-reset: step;
}
.step .num::before {
  content: counter(step);
}
.step .body .t {
  font-weight: 700;
}
.step .body .d {
  color: var(--p-muted);
  font-size: 13.5px;
}

.form-card {
  max-width: 560px;
}
.form-actions {
  display: flex;
  gap: 10px;
}
.note {
  color: var(--p-faint);
  font-size: 12.5px;
  margin-top: 12px;
}

.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--p-accent-soft);
}
.card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.limit-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--p-radius-sm);
  border: 1px solid var(--p-border-strong);
  background: var(--p-surface-2);
  white-space: nowrap;
}

.tabs,
.segmented,
.seg-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--p-radius-sm);
  border: 1px solid var(--p-border);
  background: rgba(0, 0, 0, 0.22);
  margin-bottom: 18px;
}
.tabs button,
.segmented button,
.seg-tabs button {
  flex: 1;
  padding: 8px 14px;
  border-radius: var(--p-radius-xs);
  border: none;
  background: transparent;
  color: var(--p-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.tabs button:hover,
.segmented button:hover,
.seg-tabs button:hover {
  color: var(--p-text);
}
.tabs button.active,
.segmented button.active,
.seg-tabs button.active {
  color: #fff;
  background: var(--p-accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.segmented.segmented-sm {
  margin-bottom: 0;
  padding: 3px;
  gap: 2px;
  height: 32px;
  align-items: stretch;
}
.segmented.segmented-sm button {
  flex: 0 1 auto;
  padding: 0 11px;
  font-size: 11px;
  height: 100%;
}

.select {
  width: 100%;
  appearance: none;
  background-color: rgba(0, 0, 0, 0.32);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  color-scheme: dark;
}
.select option {
  background: #18181b;
  color: var(--p-text);
}

.server-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.server-card {
  transition: border-color 0.15s var(--ease);
}
.server-card:hover {
  border-color: var(--p-border-strong);
}
.server-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.server-card .mono {
  font-family: var(--font-mono);
  font-size: 12px;
}
.server-card.status-online {
  border-color: rgba(52, 211, 153, 0.25);
}
.server-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.server-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.server-id {
  font-size: 12px;
  color: var(--p-faint);
  font-family: ui-monospace, monospace;
}
.server-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--p-muted);
  margin-bottom: 10px;
}
.server-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.chip {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--p-radius-sm);
  background: var(--p-surface-2);
  border: 1px solid var(--p-border);
}
.server-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--p-radius-sm);
  border: 1px solid var(--p-border-strong);
  background: var(--p-surface-2);
}
.status-pill.online {
  color: #95ecc8;
  border-color: rgba(54, 211, 153, 0.35);
}
.status-pill.offline {
  color: var(--p-faint);
}
.btn.danger:hover {
  color: var(--p-danger);
  border-color: rgba(255, 93, 108, 0.4);
}

.mini-server-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mini-server-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--p-radius);
  border: 1px solid var(--p-border);
  background: var(--p-surface-2);
}
.mini-server-row:hover {
  border-color: var(--p-accent);
}
.mini-server-row .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--p-faint);
  flex-shrink: 0;
}
.mini-server-row .dot.on {
  background: var(--p-ok);
  box-shadow: 0 0 8px rgba(54, 211, 153, 0.6);
}
.mini-server-row .n {
  font-weight: 700;
}
.mini-server-row .id {
  margin-left: auto;
  font-size: 12px;
  color: var(--p-faint);
  font-family: ui-monospace, monospace;
}

.empty.compact {
  padding: 24px 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--p-bg-2);
  border: 1px solid var(--p-border-strong);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--p-shadow);
  min-width: 0;
}
.modal-wide {
  width: min(880px, 100%);
}
.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: 16px;
}
.detection-layers {
  margin: 4px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  background: rgba(0, 0, 0, 0.18);
  gap: 10px;
}
.detection-layers-head {
  display: grid;
  gap: 4px;
  margin-bottom: 4px;
}
.detection-layer-row {
  display: grid;
  gap: 2px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.detection-layer-row:first-of-type {
  border-top: none;
  padding-top: 0;
}
.content:has(.detection-responses-page) {
  max-width: 1280px;
}
.detection-responses-page {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 1080px;
}
.detection-server-picker {
  display: grid;
  grid-template-columns: 110px minmax(240px, 420px);
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: none;
  padding: 14px 18px;
}
.detection-server-picker label {
  color: var(--p-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.detection-server-picker .select {
  min-width: 0;
}
.detection-response-form {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 18px;
  overflow: hidden;
}
.detection-response-default,
.detection-category-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.7fr);
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  background: rgba(0, 0, 0, 0.18);
}
.detection-category-copy {
  min-width: 0;
}
.detection-response-default h3,
.detection-category-card h4 {
  margin: 0 0 6px;
}
.detection-response-default p,
.detection-category-card p {
  margin: 0;
}
.detection-rule-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px);
  gap: 12px;
  align-items: end;
  justify-content: start;
  min-width: 0;
}
.detection-rule-grid.is-ban {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.detection-rule-grid .field {
  min-width: 0;
  margin: 0;
}
.detection-rule-grid .select {
  min-width: 0;
}
.detection-overrides-toggle {
  align-items: flex-start;
  margin: 0 !important;
  padding: 14px 16px;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  background: rgba(0, 0, 0, 0.12);
}
.detection-overrides-toggle span {
  display: grid;
  gap: 3px;
}
.detection-overrides-toggle small {
  color: var(--p-muted);
  font-weight: 400;
}
.detection-category-list {
  display: grid;
  gap: 10px;
}
.detection-category-list[hidden] {
  display: none;
}
.detection-response-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}
.detection-response-actions .btn {
  min-width: 180px;
  margin: 0;
}
@media (max-width: 900px) {
  .detection-response-default,
  .detection-category-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}
@media (max-width: 640px) {
  .detection-server-picker {
    grid-template-columns: 1fr;
  }
  .detection-rule-grid {
    grid-template-columns: 1fr;
  }
  .detection-rule-grid.is-ban {
    grid-template-columns: 1fr;
  }
  .detection-response-actions .btn {
    width: 100%;
  }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.icon-btn {
  background: none;
  border: none;
  color: var(--p-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.secret-block {
  margin: 14px 0;
  padding: 14px;
  border-radius: var(--p-radius);
  border: 1px solid var(--p-border);
  background: rgba(0, 0, 0, 0.22);
}
.secret-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--p-muted);
  margin-bottom: 8px;
}
.secret-value {
  display: block;
  word-break: break-all;
  font-size: 12px;
  margin-bottom: 10px;
}
.code-block {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border);
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--font-mono);
  font-size: 12px;
  color: #d4d4d8;
  overflow: auto;
  white-space: pre-wrap;
}

.monitor-stats {
  margin-top: 16px;
}
.monitor-head {
  margin-top: 8px;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.boot-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--p-border);
  border-top-color: var(--p-accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--p-border);
  vertical-align: middle;
}

.admin-table th {
  color: var(--p-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--p-radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
}

.role-pill.role-admin {
  background: rgba(251, 191, 36, 0.15);
  color: #c9a227;
}

.role-pill.role-client {
  background: rgba(56, 189, 248, 0.12);
  color: #d4784a;
}

.role-pill.role-user {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.limit-input {
  width: 4.5rem;
}

.input-sm {
  padding: 0.35rem 0.5rem;
  font-size: 0.88rem;
}

.alert.error {
  padding: 0.75rem 1rem;
  border-radius: var(--p-radius);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

@media (max-width: 880px) {
  .app-shell {
    flex-direction: row;
  }
  .grid.cols-3,
  .grid.cols-2,
  .plans {
    grid-template-columns: 1fr;
  }
  .welcome {
    flex-wrap: wrap;
  }
  .role-tag {
    margin-left: 0;
  }
  .content,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Account / license UI */
.mono {
  font-family: var(--font-mono);
}
.small {
  font-size: 12px;
}
.field > span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--p-muted);
  margin-bottom: 7px;
}
.field textarea.input {
  resize: vertical;
  line-height: 1.5;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}
.license-servers {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--p-muted);
}
.license-servers li {
  padding: 8px 10px;
  border: 1px solid var(--p-border-glass);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.account-grid.compact {
  margin-top: 10px;
  gap: 8px;
}
.account-item {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--p-border-glass);
  background: rgba(0, 0, 0, 0.25);
}
.account-label {
  display: block;
  font-size: 11px;
  color: var(--p-muted);
  margin-bottom: 2px;
  line-height: 1.3;
}
.account-value {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}
.account-value.ok {
  color: var(--p-ok, #6ee7a0);
}
.account-value.warn {
  color: var(--p-warn, #c9a227);
}
.plan-current-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  font-family: var(--font-heading);
}
.feature-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--p-muted);
  line-height: 1.7;
}
@media (max-width: 560px) {
  .grid-2,
  .account-grid {
    grid-template-columns: 1fr;
  }
}

.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}
.filter-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  flex: 1;
  align-items: flex-end;
}
.filter-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 140px;
  flex: 1;
  max-width: 220px;
}
.filter-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--p-muted);
  line-height: 1;
}
.filter-field input,
.filter-field select,
.filter-field .select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border-strong);
  background: rgba(0, 0, 0, 0.32);
  color: var(--p-text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
  color-scheme: dark;
}
.filter-field input::placeholder {
  color: var(--p-faint);
}
.filter-field input:hover,
.filter-field select:hover,
.filter-field .select:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.38);
}
.filter-field input:focus,
.filter-field select:focus,
.filter-field .select:focus {
  outline: none;
  border-color: var(--p-accent);
  box-shadow: 0 0 0 3px var(--p-accent-ring);
  background: rgba(0, 0, 0, 0.4);
}
.filter-field select option,
.filter-field .select option {
  background: #18181b;
  color: var(--p-text);
}
.filter-toolbar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  padding-bottom: 1px;
}

.data-table-wrap {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--p-muted);
  background: rgba(0, 0, 0, 0.22);
  border-bottom: 1px solid var(--p-border-strong);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--p-border);
  vertical-align: top;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.data-table code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #d4d4d8;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
}
.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--p-border);
  font-size: 12px;
  color: var(--p-muted);
}
.table-foot-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ui-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  border: 1px solid transparent;
}
.ui-badge.tone-neutral {
  background: var(--p-surface-2);
  color: var(--p-muted);
  border-color: var(--p-border);
}
.ui-badge.tone-ok {
  background: var(--p-ok-soft);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.2);
}
.ui-badge.tone-warn {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
}
.ui-badge.tone-bad {
  background: var(--p-danger-soft);
  color: #fca5a5;
}
.ui-badge.tone-blue {
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
}
.ui-badge.tone-live {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  animation: pulse-live 2s ease infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.event-cell .event-title {
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.4;
}
.event-cell .event-detail {
  line-height: 1.45;
}
.event-raw {
  margin-top: 8px;
}
.event-raw summary {
  cursor: pointer;
  color: var(--p-muted);
  font-size: 12px;
  user-select: none;
  list-style: none;
}
.event-raw summary::-webkit-details-marker {
  display: none;
}
.event-raw summary::before {
  content: "▸ ";
  color: var(--p-faint);
}
.event-raw[open] summary::before {
  content: "▾ ";
}
.event-raw pre {
  margin: 8px 0 0;
  padding: 12px 14px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border);
  background: rgba(0, 0, 0, 0.4);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  color: #d4d4d8;
  overflow-x: auto;
  max-height: 240px;
}

.log-line {
  display: grid;
  grid-template-columns: minmax(0, 150px) minmax(0, 120px) minmax(0, 100px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 14px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border);
  background: rgba(0, 0, 0, 0.28);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  min-width: 0;
}
.log-line > * {
  min-width: 0;
}
.log-line.log-blue { border-color: rgba(96, 165, 250, 0.25); color: #93c5fd; }
.log-line.log-warn { border-color: rgba(251, 191, 36, 0.25); color: #fcd34d; }
.log-line.log-bad { border-color: rgba(248, 113, 113, 0.25); color: #fca5a5; }
.log-line.log-ok { border-color: rgba(52, 211, 153, 0.25); color: #6ee7b7; }
.log-ts { color: var(--p-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-ip { color: var(--p-muted); overflow: hidden; text-overflow: ellipsis; }
.log-account { color: var(--p-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.log-msg { color: inherit; word-break: break-word; overflow-wrap: anywhere; }

.log-console {
  margin: 0;
  padding: 12px 16px 16px;
  background: rgba(0, 0, 0, 0.28);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  max-height: min(72vh, 820px);
  overflow: auto;
}
.log-console .log-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 10px;
  padding: 4px 0;
  border: none;
  background: transparent;
  border-radius: 0;
  grid-template-columns: unset;
}
.log-console .log-line + .log-line {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}
.log-console .log-line[role="button"] {
  cursor: pointer;
}
.log-console .log-line[role="button"]:hover {
  background: rgba(255, 255, 255, 0.03);
}
.log-console-empty {
  padding: 48px 20px;
  text-align: center;
}
.event-log-card {
  padding: 12px 14px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border);
  background: rgba(0, 0, 0, 0.28);
  min-width: 0;
}
.event-log-card.log-blue { border-color: rgba(96, 165, 250, 0.25); color: #93c5fd; }
.event-log-card.log-warn { border-color: rgba(251, 191, 36, 0.25); color: #fcd34d; }
.event-log-card.log-bad { border-color: rgba(248, 113, 113, 0.25); color: #fca5a5; }
.event-log-card.log-ok { border-color: rgba(52, 211, 153, 0.25); color: #6ee7b7; }
.event-log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.event-log-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--p-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-log-chip.account {
  color: var(--p-text);
  font-weight: 600;
}
.event-log-message {
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
  overflow-wrap: anywhere;
  color: inherit;
}

.event-detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px 16px;
  margin-bottom: 16px;
  min-width: 0;
}
.event-detail-meta > div {
  min-width: 0;
}
.event-detail-meta code {
  display: block;
  word-break: break-all;
  overflow-wrap: anywhere;
}
.event-detail-meta .meta-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--p-faint);
  margin-bottom: 4px;
}
.event-console-block,
.event-detail-block {
  margin-bottom: 16px;
}
.event-console-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--p-muted);
  margin-bottom: 8px;
}
.event-json {
  max-height: 320px;
  margin: 0;
  overflow-x: auto;
  overflow-y: auto;
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
}
.process-snapshot-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.process-snapshot-count {
  font-size: 12px;
  color: var(--p-muted);
}
.process-hit-card {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--p-radius);
  border: 1px solid rgba(255, 120, 120, 0.35);
  background: rgba(255, 80, 80, 0.08);
}
.process-hit-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ff9a9a;
  margin-bottom: 6px;
}
.process-hit-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.process-hit-name {
  font-size: 16px;
  font-weight: 700;
}
.process-hit-pid {
  font-size: 12px;
  color: var(--p-muted);
}
.process-hit-path {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  word-break: break-all;
  color: var(--p-muted);
}
.process-snapshot-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.process-search {
  flex: 1 1 220px;
  min-width: 180px;
}
.process-filter-check {
  font-size: 13px;
  white-space: nowrap;
}
.process-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  background: rgba(0, 0, 0, 0.15);
}
.process-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.process-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 8px 10px;
  background: var(--p-bg-3);
  border-bottom: 1px solid var(--p-border);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--p-muted);
}
.process-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: top;
}
.process-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}
.process-row-hit {
  background: rgba(255, 90, 90, 0.1) !important;
}
.process-row-hit:hover {
  background: rgba(255, 90, 90, 0.14) !important;
}
.process-col-pid {
  width: 72px;
  white-space: nowrap;
}
.process-name-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 140px;
}
.process-hit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6b6b;
  flex-shrink: 0;
}
.process-name {
  font-weight: 600;
}
.process-path-cell code {
  display: block;
  font-size: 11px;
  word-break: break-all;
  color: var(--p-muted);
}
.process-path-file {
  display: block;
  margin-top: 2px;
}
.process-empty {
  text-align: center;
  padding: 24px !important;
}
.process-raw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.process-raw-hint {
  margin: 0;
}
.event-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.event-action-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--p-muted);
  margin-bottom: 6px;
}
.event-action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.event-action-btn {
  max-width: 100%;
  white-space: normal;
  text-align: left;
  height: auto;
  line-height: 1.35;
}
.event-action-btn.allow {
  border-color: rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
}
.event-action-btn.block {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}
.event-action-btn.moderation {
  border-color: rgba(251, 191, 36, 0.35);
  color: #fcd34d;
}
.event-action-msg {
  margin-top: 8px;
}
.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--p-border-glass);
  background: rgba(197, 106, 58, 0.08);
}
.bulk-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.col-check {
  width: 36px;
  text-align: center;
}
.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}
.check-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--p-accent, #d4784a);
}
tr.row-selected td {
  background: rgba(197, 106, 58, 0.06);
}
tr.row-banned td {
  opacity: 0.72;
}
.filter-field-wide {
  flex: 1 1 280px;
  min-width: 200px;
  max-width: 360px;
}

.admin-users-table-wrap {
  overflow-x: auto;
}
.admin-users-table {
  width: 100%;
  table-layout: auto;
  min-width: 960px;
}
.data-table.admin-users-table tbody td {
  vertical-align: middle;
}
.admin-users-table th,
.admin-users-table td {
  vertical-align: middle;
}
.admin-users-table .col-no {
  width: 72px;
  white-space: nowrap;
}
.admin-users-table .col-user {
  min-width: 200px;
  max-width: 280px;
}
.admin-users-table .col-meta {
  width: 1%;
  white-space: nowrap;
}
.admin-users-table .col-license {
  width: 1%;
  white-space: nowrap;
}
.admin-users-table .col-servers {
  width: 56px;
  text-align: center;
}
.admin-users-table .col-access {
  width: 150px;
}
.admin-users-table .col-actions {
  width: 1%;
  white-space: nowrap;
}
.admin-client-no {
  font-size: 12px;
}
.admin-user-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.admin-user-email {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-user-name {
  font-size: 12px;
  color: var(--p-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-meta-stack {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.admin-server-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  font-variant-numeric: tabular-nums;
}
.admin-access-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.admin-access-cell .check-inline {
  flex-shrink: 1;
  min-width: 0;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-access-cell .limit-input {
  width: 52px;
  min-width: 52px;
  text-align: center;
}
.admin-access-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 32px;
  font-size: 16px;
  line-height: 1;
}
.admin-access-admin {
  grid-template-columns: 1fr 52px;
  justify-items: end;
}
.admin-license-cell {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.admin-license-date {
  font-size: 11px;
  color: var(--p-muted);
  white-space: nowrap;
}
.admin-users-table .col-actions .table-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.admin-users-table .col-actions .table-actions .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.admin-grant-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.grant-days-input {
  width: 64px;
}
.admin-license-grant .panel-body {
  padding: 10px 12px;
}
.compact-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}
.compact-field span {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--p-faint);
}
.form-field.span-full {
  grid-column: 1 / -1;
}

.baseline-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 20px;
  align-items: start;
}
.baseline-tool-section {
  min-width: 0;
}
.baseline-tool-section.baseline-tool-import {
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid var(--p-border-glass);
}
.baseline-tool-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--p-faint);
  margin-bottom: 8px;
}
.baseline-add-form,
.baseline-scan-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.baseline-add-actions,
.baseline-scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.baseline-add-actions .btn,
.baseline-scan-actions .btn {
  margin-left: auto;
}
.baseline-import-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: end;
}
.baseline-import-form textarea {
  min-height: 56px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.45;
}
.baseline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border-glass);
  background: rgba(0, 0, 0, 0.18);
  font-size: 12px;
  color: var(--p-muted);
  white-space: nowrap;
  cursor: pointer;
  height: 32px;
}
.baseline-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--p-accent, #d4784a);
}
.baseline-add-form .form-field input,
.baseline-scan-form .form-field input {
  padding: 7px 10px;
  font-size: 12px;
}
.baseline-add-form .form-field-label,
.baseline-scan-form .form-field-label {
  font-size: 10px;
  margin-bottom: 0;
}
.baseline-add-form .form-field,
.baseline-scan-form .form-field {
  gap: 4px;
}
.baseline-import-form .btn {
  min-width: 0;
  white-space: nowrap;
  height: 32px;
}
.baseline-add-actions .btn,
.baseline-scan-actions .btn {
  min-width: 0;
  white-space: nowrap;
  height: 32px;
}
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--p-border-glass);
}
.pagination-meta {
  font-size: 12px;
  color: var(--p-muted);
}
.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pagination-page {
  font-size: 12px;
  color: var(--p-muted);
}
.seg-tabs {
  margin-top: 12px;
  margin-bottom: 0;
}
.auth-card .btn-primary {
  width: 100%;
}
.form-card .btn-primary {
  width: auto;
}

.badge,
.badge-ok,
.badge.warn,
.badge.bad,
.badge.blue,
.badge.ok {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--p-radius-xs);
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 600;
  background: var(--p-surface-2);
  color: var(--p-muted);
}
.badge-ok, .badge.ok {
  background: var(--p-ok-soft);
  border-color: rgba(52, 211, 153, 0.22);
  color: #6ee7b7;
}
.badge.warn {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.22);
  color: #fcd34d;
}
.badge.bad {
  background: var(--p-danger-soft);
  border-color: rgba(248, 113, 113, 0.22);
  color: #fca5a5;
}
.badge.blue {
  background: var(--p-accent-soft);
  border-color: rgba(197, 106, 58, 0.22);
  color: var(--p-accent-2);
}
.badge.muted {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--p-border);
  color: var(--p-faint);
}
.data-table .nowrap { white-space: nowrap; }
.data-table .cut {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}
.empty-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  gap: 10px;
}
.empty-block-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--p-radius);
  display: grid;
  place-items: center;
  font-size: 20px;
  background: var(--p-accent-soft);
  border: 1px solid var(--p-border);
}
.empty-block-title {
  font-size: 15px;
  font-weight: 700;
}
.empty-block-hint {
  margin: 0;
  color: var(--p-muted);
  font-size: 13px;
  max-width: 360px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.settings-grid .full-width {
  grid-column: 1 / -1;
}
.btn-ghost.danger {
  color: #fca5a5;
}
.btn-ghost.danger:hover:not(:disabled) {
  background: var(--p-danger-soft);
  border-color: rgba(248, 113, 113, 0.25);
}

/* ── Premium forms ── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.form-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--p-faint);
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border-strong);
  background: rgba(0, 0, 0, 0.22);
  color: var(--p-text);
  font-size: 13px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--p-accent);
  box-shadow: 0 0 0 3px var(--p-accent-ring);
}
.form-inline {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(160px, 1.2fr) minmax(160px, 1.2fr) auto;
  gap: 12px;
  align-items: end;
}
.form-inline.cols-2 {
  grid-template-columns: minmax(120px, 0.8fr) minmax(200px, 1.5fr) auto;
}
.form-inline.cols-4 {
  grid-template-columns: minmax(100px, 0.55fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(88px, 0.45fr) auto;
}
.form-inline-submit {
  display: flex;
  align-items: flex-end;
  padding-bottom: 1px;
}
.form-inline-submit .btn {
  min-width: 120px;
}
.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 16px;
  margin-top: 4px;
  border-top: 1px solid var(--p-border);
}
.form-footer .btn {
  min-width: 120px;
}

.kpi-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.kpi-strip-compact {
  gap: 8px;
}
.kpi-strip-compact .kpi-item {
  flex: 0 1 auto;
  min-width: 0;
  padding: 8px 14px;
}
.kpi-strip-compact .kpi-label {
  font-size: 10px;
  margin-bottom: 2px;
}
.kpi-strip-compact .kpi-value {
  font-size: 17px;
}
.kpi-item {
  flex: 1;
  min-width: 140px;
  padding: 16px 20px;
  border-radius: var(--p-radius-sm);
  border: 1px solid var(--p-border);
  background: var(--p-surface);
  transition: border-color 0.2s var(--ease);
}
.kpi-item:hover {
  border-color: var(--p-border-strong);
}
.kpi-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--p-faint);
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.kpi-item.tone-accent .kpi-value {
  color: var(--p-accent-hover);
}
.kpi-item.tone-warn .kpi-value {
  color: var(--p-warn);
}

.code-editor {
  width: 100%;
  min-height: 120px;
  max-height: 200px;
  padding: 12px 14px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border-strong);
  background: rgba(0, 0, 0, 0.35);
  color: #d4d4d8;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
}
.code-editor:focus {
  outline: none;
  border-color: var(--p-accent);
  box-shadow: 0 0 0 3px var(--p-accent-ring);
}

.table-actions {
  display: inline-flex;
  gap: 4px;
  flex-wrap: nowrap;
}
.table-actions .btn {
  padding: 5px 10px;
  font-size: 11px;
}

.welcome-card .role-tag {
  margin-left: auto;
  flex-shrink: 0;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.quick-tile {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--p-radius-sm);
  border: 1px solid var(--p-border);
  background: rgba(0, 0, 0, 0.15);
  font-size: 13px;
  font-weight: 600;
  color: var(--p-muted);
  transition: all 0.18s var(--ease);
}
.quick-tile:hover {
  color: var(--p-text);
  border-color: var(--p-border-strong);
  background: var(--p-accent-soft);
  transform: translateY(-1px);
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}
.panel-body > .segmented {
  margin-bottom: 16px;
}
.panel-body > .panel-hint {
  margin: 0 0 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 16px;
}
.settings-grid .field {
  margin-bottom: 0;
}
.settings-grid .field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--p-faint);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: end;
}
.grid-2 .form-actions {
  align-self: end;
  margin-bottom: 0;
}

.servers-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 16px;
  align-items: start;
}

.profile-forms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.server-row-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--p-radius-sm);
  border: 1px solid var(--p-border);
  background: rgba(0, 0, 0, 0.18);
  transition: border-color 0.2s var(--ease);
}
.server-row-card:hover {
  border-color: var(--p-border-strong);
}
.server-row-main {
  flex: 1;
  min-width: 0;
}
.server-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.server-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.server-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--p-muted);
}
.server-row-meta .link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--p-accent-hover);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.server-row-meta .link-btn:hover {
  text-decoration: underline;
}
.server-row-config {
  margin-top: 10px;
  font-size: 11px;
  max-height: 80px;
  overflow: auto;
}
.server-row-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .form-inline,
  .form-inline.cols-2,
  .form-inline.cols-4 {
    grid-template-columns: 1fr 1fr;
  }
  .form-inline-submit {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .servers-layout {
    grid-template-columns: 1fr;
  }
  .profile-forms-grid {
    grid-template-columns: 1fr;
  }
  .baseline-tools {
    grid-template-columns: 1fr;
  }
  .baseline-tool-section.baseline-tool-import {
    grid-column: auto;
  }
  .baseline-add-actions .btn,
  .baseline-scan-actions .btn {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .form-inline,
  .form-inline.cols-2,
  .form-inline.cols-4,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .baseline-import-form {
    grid-template-columns: 1fr;
  }
  .baseline-import-form .btn {
    justify-self: stretch;
  }
  .baseline-add-actions,
  .baseline-scan-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .baseline-add-actions .btn,
  .baseline-scan-actions .btn {
    width: 100%;
  }
  .content {
    padding: 20px 16px 48px;
  }
}

/* =========================================================================
   FastHTML portal compatibility layer.
   The server-rendered /app pages use a few class names that the base sheet
   above (written for the React panel markup) did not define. Map them onto
   the same design tokens so the whole portal renders cohesively.
   ========================================================================= */

.muted {
  color: var(--p-muted);
}
.faint {
  color: var(--p-faint);
}
.page-sub {
  margin: 0 0 4px;
  color: var(--p-muted);
  font-size: 14px;
  line-height: 1.55;
}

.card > h2:first-child,
.card > h3:first-child,
.panel > h2:first-child,
.panel > h3:first-child,
.form-card > h3:first-child {
  margin-top: 0;
}
.card > h2,
.card > h3,
.panel > h2,
.panel > h3,
.form-card > h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.card .field:last-of-type,
.panel .field:last-of-type,
.form-card .field:last-of-type {
  margin-bottom: 18px;
}
.form-card .check {
  display: flex;
  margin-bottom: 10px;
}
.form-card .btn-primary {
  margin-top: 6px;
}
.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.inline-form input {
  width: 140px;
  padding: 4px 8px;
  font-size: 12px;
}
.form-inline {
  display: inline-block;
  margin-right: 8px;
}
.form-ok {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--p-radius-sm);
  border: 1px solid rgba(52, 211, 153, 0.25);
  background: var(--p-ok-soft);
  color: #6ee7b7;
  font-size: 13px;
  font-weight: 600;
}
.doc-card .doc-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--p-muted);
}
.doc-card .doc-list li {
  margin-bottom: 8px;
}

/* Legacy stat class names map onto stat-card tokens. */
.stat-card .stat-value.warn,
.stat-card.tone-warn .stat-card-value {
  color: var(--p-warn);
}
.stat-card .stat-value.bad,
.stat-card.tone-danger .stat-card-value {
  color: var(--p-danger);
}
.stat-card .stat-value.ok,
.stat-card.tone-accent .stat-card-value {
  color: var(--p-accent-hover);
}

/* Risk score meter (monitoring). */
.score {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}
.score-bar {
  height: 6px;
  border-radius: var(--p-radius-sm);
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.score-fill {
  height: 100%;
  border-radius: var(--p-radius-sm);
  background: linear-gradient(90deg, var(--p-ok), var(--p-warn) 60%, var(--p-danger));
  transition: width 0.3s var(--ease);
}

/* Event / reason detail blocks (events + monitoring tables). */
.event-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.event-title {
  font-weight: 600;
  color: var(--p-text);
  word-break: break-word;
}
.event-detail {
  font-size: 12.5px;
  color: var(--p-muted);
  word-break: break-word;
}
.event-raw pre.payload,
pre.payload {
  margin: 8px 0 0;
  padding: 12px 14px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border);
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--p-muted);
  overflow-x: auto;
}

/* Server cards (servers page). */
.server-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.server-card-meta {
  font-size: 12.5px;
  color: var(--p-muted);
  margin: 0 0 12px;
}
.server-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Admin desk (compact client card) ── */
.admin-desk {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-toast {
  font-size: 12px;
  color: var(--p-ok);
  font-weight: 600;
}
.admin-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--p-radius);
  border: 1px solid var(--p-border);
  background: var(--p-surface);
}
.admin-hero-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.admin-hero-meta {
  font-size: 12px;
  color: var(--p-muted);
  margin-top: 2px;
}
.admin-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.admin-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--p-border);
  background: var(--p-surface);
  font-size: 11px;
  font-weight: 600;
  color: var(--p-muted);
}
.admin-chip.accent {
  color: var(--p-accent-2);
  border-color: rgba(197, 106, 58, 0.35);
  background: var(--p-accent-soft);
}
.admin-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--p-radius-sm);
  border: 1px solid var(--p-border);
  background: rgba(0, 0, 0, 0.18);
}
.admin-quick-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--p-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
}
.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 960px) {
  .admin-grid-2 {
    grid-template-columns: 1fr;
  }
}
.admin-card {
  padding: 12px 14px;
  border-radius: var(--p-radius);
  border: 1px solid var(--p-border);
  background: var(--p-surface);
}
.admin-users-list .admin-user-email {
  font-weight: 600;
  color: var(--p-text);
}
.admin-users-list .admin-user-email:hover {
  color: var(--p-accent-hover);
}
.admin-users-list .admin-user-name {
  font-size: 12px;
  margin-top: 1px;
}
.admin-users-list td {
  vertical-align: middle;
}
.admin-card-flush {
  padding: 0;
  overflow: hidden;
}
.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--p-border);
}
.admin-card:not(.admin-card-flush) .admin-card-head {
  padding: 0 0 8px;
  margin-bottom: 8px;
}
.admin-card-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--p-faint);
}
.admin-fields-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.admin-fields-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.admin-hint {
  font-size: 11px;
  margin: 0 0 8px;
}
.admin-pad {
  padding: 0 14px 10px;
}
.admin-slot-add {
  padding: 10px 14px;
  border-bottom: 1px solid var(--p-border);
}
.admin-card .field {
  margin-bottom: 8px;
}
.admin-card .field label {
  font-size: 10px;
  margin-bottom: 3px;
}
.admin-card .field input,
.admin-card .field select,
.admin-card .select {
  padding: 6px 8px;
  font-size: 12px;
}
.admin-inline-add {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.admin-inline-add.wrap {
  flex-wrap: wrap;
}
.admin-inline-add input,
.admin-inline-add select,
.admin-inline-add .select {
  flex: 1 1 90px;
  min-width: 70px;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border-strong);
  background: rgba(0, 0, 0, 0.32);
  color: var(--p-text);
}
.admin-inline-add button {
  flex: 0 0 auto;
}
.admin-table-wrap {
  overflow-x: auto;
}
.data-table-compact thead th {
  padding: 8px 10px;
  font-size: 10px;
}
.data-table-compact tbody td {
  padding: 8px 10px;
  font-size: 12px;
  vertical-align: middle;
}
.admin-log {
  margin: 0;
  padding: 0 14px 12px 28px;
  font-size: 12px;
  color: var(--p-muted);
  max-height: 200px;
  overflow: auto;
}
.admin-log li {
  margin-bottom: 4px;
}

/* Compact ops toolbar (monitoring / events) — full-width card, dense controls */
.ops-toolbar {
  width: 100%;
  max-width: 100%;
  padding: 14px 16px;
  margin: 0;
}
.ops-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
}
.ops-toolbar__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  flex: 1 1 auto;
  min-width: 0;
}
.ops-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 150px;
  flex: 0 0 auto;
  margin: 0;
}
.ops-field--grow {
  flex: 1 1 280px;
  width: auto;
  min-width: 220px;
  max-width: none;
}
.ops-field--wide {
  width: 180px;
  flex: 0 0 180px;
}
.ops-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--p-faint);
  line-height: 1.2;
  margin: 0;
}
.ops-input,
.ops-select.select,
.ops-field .select,
.ops-field input {
  width: 100%;
  height: 34px;
  padding: 6px 10px;
  font-size: 13px;
  margin: 0;
  box-sizing: border-box;
}
.ops-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
  height: 34px;
}
@media (max-width: 720px) {
  .ops-field,
  .ops-field--wide,
  .ops-field--grow {
    width: 100%;
    max-width: none;
    flex: 1 1 100%;
  }
  .ops-toolbar__actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    height: auto;
  }
}

.mon-page {
  display: grid;
  gap: 12px;
  padding: 0;
  width: 100%;
}
.mon-page > .monitoring-live,
.mon-page > .monitoring-live-body,
.monitoring-live,
.monitoring-live-body {
  width: 100%;
  min-width: 0;
}
.mon-page .mon-table-card {
  width: 100%;
}
.mon-summary {
  width: 100%;
}
.mon-kpi {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}
.mon-kpi__item {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  background: var(--p-surface);
  border-left: 3px solid var(--p-border-strong);
}
.mon-kpi__item.tone-ok,
.mon-kpi__item.tone-accent {
  border-left-color: var(--p-ok);
}
.mon-kpi__item.tone-danger {
  border-left-color: var(--p-danger);
}
.mon-kpi__item.tone-warn {
  border-left-color: var(--p-warn);
}
.mon-kpi__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--p-faint);
}
.mon-kpi__value {
  display: block;
  margin-top: 6px;
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--p-text);
}
.mon-kpi__item.tone-ok .mon-kpi__value,
.mon-kpi__item.tone-accent .mon-kpi__value {
  color: var(--p-ok);
}
.mon-kpi__item.tone-danger .mon-kpi__value {
  color: var(--p-danger);
}
.mon-live-status,
.mon-online-badge {
  display: none;
}
@media (max-width: 700px) {
  .mon-kpi {
    grid-template-columns: 1fr;
  }
}
.mon-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.mon-page-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.mon-online-badge {
  flex-shrink: 0;
}
.mon-live-head {
  display: none;
}
.mon-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.mon-ban-btn {
  color: #ff8f9a !important;
  border-color: rgba(255, 90, 110, 0.35) !important;
}
.mon-ban-btn:hover {
  background: rgba(255, 70, 90, 0.12) !important;
}
.mon-action-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 250px;
}
.mon-action-buttons form {
  margin: 0;
}
.mon-ban-hwid-btn {
  color: #ffb07a !important;
  border-color: rgba(255, 154, 90, 0.35) !important;
}
.mon-ban-state {
  color: #ff8995;
  font-size: 12px;
  white-space: nowrap;
}
.mon-ban-state--hwid {
  color: #ffb07a;
}
.mon-flag {
  margin-right: 4px;
}
.mon-hwid {
  font-size: 11px;
  word-break: break-all;
}
.mon-account {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.mon-account-name {
  font-weight: 600;
}
.mon-seen {
  font-size: 11px;
}
.mon-filter-toolbar {
  padding: 14px 16px;
  margin-bottom: 0;
  display: grid;
  gap: 12px;
}
.mon-filter-search {
  max-width: none;
  min-width: 0;
}
.mon-filter-search input {
  width: 100%;
  height: 36px;
  padding: 8px 12px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border-strong);
  background: rgba(0, 0, 0, 0.32);
  color: var(--p-text);
  font-size: 13px;
}
.mon-filter-search input:focus {
  outline: none;
  border-color: var(--p-accent);
  box-shadow: 0 0 0 3px var(--p-accent-ring);
}
.mon-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}
@media (max-width: 1100px) {
  .mon-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .mon-filter-grid {
    grid-template-columns: 1fr;
  }
}
.mon-filter-field {
  min-width: 0;
  max-width: none;
  margin-bottom: 0;
}
.mon-filter-field label {
  margin-bottom: 5px;
  font-size: 11px;
  line-height: 1.2;
}
.mon-filter-field .select,
.mon-filter-field input,
.mon-filter-field select {
  height: 36px;
  padding: 6px 10px;
  font-size: 13px;
  box-sizing: border-box;
}
.mon-filter-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--p-border);
}
.mon-filter-footer .mon-filter-field {
  flex: 0 1 220px;
  min-width: 160px;
}
.mon-filter-footer .mon-check {
  margin-right: auto;
  padding-bottom: 0;
}
.mon-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--p-muted);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.mon-find-btn {
  min-width: 96px;
}
.mon-table-card {
  overflow: hidden;
}
.mon-table-card .data-table-wrap,
.mon-table-card.data-table-wrap {
  overflow-x: auto;
}
.mon-clients-table thead th {
  padding: 8px 12px;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--p-faint);
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.22);
  border-bottom: 1px solid var(--p-border);
}
.mon-clients-table tbody td {
  padding: 8px 12px;
  vertical-align: middle;
  font-size: 12.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.mon-clients-table tbody tr:last-child td {
  border-bottom: none;
}
.mon-clients-table tbody tr:hover td {
  background: var(--p-surface);
}

.events-filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .events-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .events-filter-grid {
    grid-template-columns: 1fr;
  }
}
.events-filter-toolbar.mon-filter-toolbar {
  gap: 12px;
}
.ops-page {
  display: grid;
  gap: 12px;
  width: 100%;
}
.audit-details {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.ops-page > .ops-toolbar,
.ops-page > .card,
.ops-page > .events-feed-card {
  width: 100%;
  min-width: 0;
}
.events-feed-card {
  margin-top: 0;
  width: 100%;
}
.events-console {
  overflow: auto;
}
.events-console .log-line {
  display: grid;
  grid-template-columns: 76px 112px 122px 100px minmax(110px, 150px) minmax(12rem, 1fr);
  column-gap: 14px;
  align-items: center;
  padding: 8px 14px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--p-border);
}
.events-console .log-line:last-child {
  border-bottom: none;
}
.events-console .log-ts {
  color: var(--p-faint);
  font-size: 11px;
}
.events-console .log-ip {
  color: var(--p-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.events-console .log-hwid {
  color: var(--p-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.events-console .log-account {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.events-console .log-msg {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
  line-height: 1.35;
}
.events-console .key-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.events-pager {
  margin: 8px 2px 0;
  font-size: 12px;
}
.detection-feed {
  display: grid;
}
.detection-row {
  display: grid;
  grid-template-columns: 130px 180px minmax(320px, 1fr) 170px;
  gap: 16px;
  align-items: start;
  padding: 13px 16px;
  border-bottom: 1px solid var(--p-border);
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.035), transparent 22%);
}
.detection-row--error {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.05), transparent 22%);
}
.detection-row--error .detection-title-line strong {
  color: #f0b27a;
}
.detection-row:last-child {
  border-bottom: 0;
}
.detection-row:hover {
  background-color: rgba(255, 255, 255, 0.018);
}
.detection-when,
.detection-player,
.detection-origin {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.detection-when time,
.detection-player span,
.detection-origin span {
  color: var(--p-faint);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detection-when .badge {
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detection-player strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detection-main {
  min-width: 0;
}
.detection-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.detection-title-line strong {
  color: #ff9da3;
}
.detection-title-line code {
  color: var(--p-faint);
  font-size: 10px;
}
.detection-main > p {
  margin: 5px 0 0;
  color: var(--p-muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.detection-details {
  margin-top: 7px;
}
.detection-details summary {
  width: fit-content;
  color: var(--p-accent);
  cursor: pointer;
  font-size: 11px;
}
.detection-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 2px;
}
.detection-jump__link {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid rgba(197, 106, 58, 0.35);
  border-radius: 6px;
  background: rgba(197, 106, 58, 0.08);
  color: #e0a070;
  font-size: 11px;
  line-height: 1.2;
  text-decoration: none;
}
.detection-jump__link:hover {
  border-color: rgba(197, 106, 58, 0.65);
  background: rgba(197, 106, 58, 0.16);
  color: #f0c09a;
}
.detection-details pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--p-border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--p-muted);
  font: 11px/1.55 var(--font-mono, monospace);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 1050px) {
  .detection-row {
    grid-template-columns: 120px 160px minmax(0, 1fr);
  }
  .detection-origin {
    grid-column: 2 / -1;
    display: flex;
    gap: 12px;
  }
}
@media (max-width: 900px) {
  .events-console .log-line {
    grid-template-columns: 76px minmax(100px, 0.7fr) minmax(0, 1fr);
    grid-template-areas:
      "ts ip account"
      "hwid hwid chip"
      "msg msg msg";
    gap: 5px 10px;
  }
  .events-console .log-ts { grid-area: ts; }
  .events-console .log-ip { grid-area: ip; }
  .events-console .log-hwid { grid-area: hwid; }
  .events-console .log-account { grid-area: account; text-align: right; }
  .events-console .key-chip { grid-area: chip; justify-self: end; }
  .events-console .log-msg { grid-area: msg; }
  .detection-row {
    grid-template-columns: 110px minmax(0, 1fr);
  }
  .detection-main,
  .detection-origin {
    grid-column: 1 / -1;
  }
}

.bans-hub-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}
@media (min-width: 1100px) {
  .bans-hub-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}
.bans-create-card {
  position: sticky;
  top: 72px;
}
.bans-table-card .dash-empty {
  margin: 12px;
}
.mon-clients-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}
.mon-gsid {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--p-accent-2);
  text-align: center;
}
.mon-country-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.mon-flag {
  font-size: 16px;
  line-height: 1;
}
.mon-country-name {
  color: var(--p-text);
}
.mon-pagination {
  border-top: 1px solid var(--p-border-glass);
  background: rgba(0, 0, 0, 0.12);
}
.mon-pagination .pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin: 0;
  border: none;
}
.mon-pagination .pagination-meta {
  font-size: 13px;
  color: var(--p-muted);
  white-space: nowrap;
}
.mon-pagination .pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.mon-pagination .page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--p-muted);
  font-size: 13px;
  text-decoration: none;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}
.mon-pagination .page-btn:hover:not(.disabled) {
  border-color: var(--p-accent);
  color: var(--p-text);
  background: rgba(255, 255, 255, 0.08);
}
.mon-pagination .page-btn.active {
  background: var(--p-accent);
  border-color: var(--p-accent);
  color: #fff;
}
.mon-pagination .page-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}
.mon-pagination .page-ellipsis {
  color: var(--p-faint);
  padding: 0 4px;
}
.mon-pagination .per-page-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.mon-pagination .per-page-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--p-muted);
  white-space: nowrap;
}
.mon-pagination .per-page-select {
  padding: 6px 10px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border-strong);
  background: rgba(0, 0, 0, 0.32);
  color: var(--p-text);
  font-size: 12px;
}
.mon-account {
  font-weight: 600;
}
.mon-hwid {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--p-muted);
  background: transparent;
  border: none;
  padding: 0;
}
.mon-ip {
  font-family: var(--font-mono);
  font-size: 12px;
}
.mon-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
}
.mon-status-ok {
  color: var(--p-ok);
}
.mon-status-bad {
  color: var(--p-danger);
}
.mon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.mon-dot-ok {
  background: var(--p-ok);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.45);
}
.mon-dot-bad {
  background: var(--p-danger);
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.45);
}
.mon-row-offline td {
  opacity: 0.82;
}
.mon-windows-plus {
  color: var(--p-accent-2);
  font-weight: 700;
}
.mon-ban-btn {
  color: var(--p-danger) !important;
  border-color: rgba(248, 113, 113, 0.25) !important;
}
.mon-ban-btn:hover {
  background: var(--p-danger-soft) !important;
}
.mon-muted-action {
  font-size: 12px;
}
.mon-empty {
  text-align: center;
  padding: 28px 12px !important;
}
.stat-card.tone-ok .stat-card-value {
  color: var(--p-ok);
}

/* ── Hub navigation (consolidated portal sections) ── */
.nav-icon {
  width: 22px;
  flex-shrink: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.55;
  line-height: 1;
  color: var(--p-faint);
}
.nav-item.active .nav-icon {
  opacity: 1;
  color: var(--p-accent);
}
.nav-item {
  gap: 10px;
}

.hub-head {
  margin-bottom: 12px;
  width: 100%;
}
.hub-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: var(--p-radius-sm);
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  width: 100%;
  box-sizing: border-box;
}
.hub-tab {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: var(--p-radius-xs);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--p-muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  border: 1px solid transparent;
}
.hub-tab:hover {
  color: var(--p-text);
  background: var(--p-surface-2);
}
.hub-tab.active {
  color: var(--p-text);
  background: var(--p-accent-soft);
  border-color: rgba(197, 106, 58, 0.25);
  box-shadow: none;
}
.hub-hint {
  margin: 8px 2px 0;
  font-size: 12px;
  line-height: 1.4;
  max-width: 42ch;
}
.hub-content-card {
  margin-top: 0;
}
.doc-card {
  padding: 20px 22px;
}
.doc-title {
  margin: 0 0 14px;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.doc-list,
.doc-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--p-border);
  background: var(--p-bg);
}
.doc-list li,
.doc-steps li {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--p-border);
}
.doc-list li:last-child,
.doc-steps li:last-child {
  border-bottom: none;
}
.doc-steps {
  counter-reset: doc-step;
}
.doc-steps li {
  counter-increment: doc-step;
  grid-template-columns: 28px 1fr;
  column-gap: 12px;
}
.doc-steps li::before {
  content: counter(doc-step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--p-accent);
  padding-top: 2px;
}
.doc-steps li strong,
.doc-list li strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--p-text);
}
.doc-steps li span,
.doc-list li span {
  display: block;
  font-size: 13px;
  color: var(--p-muted);
  line-height: 1.45;
}
.doc-steps li strong {
  grid-column: 2;
}
.doc-steps li span {
  grid-column: 2;
}
.doc-extra {
  margin: 14px 0 0;
  font-size: 13px;
}
.doc-releases {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.doc-release {
  border: 1px solid var(--p-border);
  background: var(--p-bg);
  padding: 14px 16px;
}
.doc-release__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.doc-release__ver {
  font-size: 12px;
  color: var(--p-accent-2);
  font-weight: 500;
}
.doc-release__date {
  font-size: 12px;
}
.doc-release__head h3 {
  margin: 0;
  flex: 1 1 100%;
  font-size: 14px;
  font-weight: 600;
}
.doc-release__points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.doc-release__points li {
  font-size: 13px;
  color: var(--p-muted);
  padding-left: 12px;
  position: relative;
}
.doc-release__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 1px;
  background: var(--p-accent);
}
.hub-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.hub-tiles-card {
  padding: 16px 18px;
}
.hub-tiles-heading {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--p-faint);
}
.hub-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.hub-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--p-radius-sm);
  border: 1px solid var(--p-border);
  background: rgba(255, 255, 255, 0.015);
  text-decoration: none;
  transition: border-color 0.12s, background 0.12s;
}
.hub-tile:hover {
  border-color: var(--p-border-strong);
  background: var(--p-surface-2);
  transform: none;
}
.hub-tile.tone-accent {
  border-color: rgba(197, 106, 58, 0.28);
  background: var(--p-accent-soft);
}
.hub-tile.tone-accent:hover {
  border-color: rgba(56, 189, 248, 0.45);
}
.hub-tile-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--p-text);
}
.hub-tile-desc {
  font-size: 12px;
  color: var(--p-muted);
  line-height: 1.35;
}
.hub-tile-sm {
  padding: 12px 14px;
  gap: 4px;
}
.hub-tile-sm .hub-tile-title {
  font-size: 13px;
}
.hub-tile-sm .hub-tile-desc {
  font-size: 11px;
}
.hub-module {
  padding: 18px 20px;
}
.hub-module-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.hub-module-hint {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
}

/* Infra hub layout */
.infra-stat-grid {
  margin-bottom: 8px;
}
.infra-hub-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}
@media (min-width: 1100px) {
  .infra-hub-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .infra-hub-layout-single {
    grid-template-columns: 1fr;
  }
}
.infra-hub-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.infra-create-card {
  position: sticky;
  top: 72px;
}
.infra-limit-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
}
.infra-limit-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.infra-action-tiles {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.infra-project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 900px) {
  .infra-project-grid {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  }
}
.infra-project-card {
  padding: 0;
  overflow: hidden;
}
.infra-project-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
}
.infra-project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.infra-project-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.infra-project-name {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.infra-project-ip {
  font-size: 11.5px;
  color: var(--p-faint);
}
.infra-project-kpis {
  margin-top: 0;
}
.infra-project-table-wrap {
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-xs);
  overflow: hidden;
}
.infra-project-table-wrap .data-table {
  margin: 0;
}
.infra-empty-card {
  text-align: center;
  padding: 24px 20px;
}

/* Account hub modules */
.account-profile-split {
  margin-top: 0;
}
.account-summary-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.account-role-row {
  margin-bottom: 4px;
}
.account-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border);
  background: rgba(255, 255, 255, 0.02);
}
.account-field-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--p-faint);
}
.account-field-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--p-text);
  word-break: break-word;
}
.account-profile-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.account-payments-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  overflow: hidden;
}
.account-payments-list li {
  display: grid;
  grid-template-columns: 110px 72px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 10px 12px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--p-border);
  background: rgba(255, 255, 255, 0.015);
}
.account-payments-list li:last-child {
  border-bottom: none;
}
.account-pay-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--p-faint);
}
.account-pay-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--p-ok);
}
.account-pay-desc {
  color: var(--p-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Admin project scope */
.admin-scope-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.scope-select-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--p-faint);
  white-space: nowrap;
}
.scope-select {
  min-width: 140px;
  max-width: 200px;
  height: 30px;
  font-size: 12px;
  padding: 4px 8px;
}
.admin-scope-placeholder {
  visibility: hidden;
  pointer-events: none;
}
.scope-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 0;
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
}
.scope-banner-text {
  font-size: 13px;
  font-weight: 500;
}
.alert-info {
  background: rgba(197, 106, 58, 0.08);
  border: 1px solid rgba(197, 106, 58, 0.22);
  color: #7dd3fc;
}

/* Dashboard recent events */
.dash-events-card {
  padding: 14px 16px;
}
.dash-events-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.dash-events-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--p-faint);
}
.dash-events-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  overflow: hidden;
}
.dash-event-row {
  display: grid;
  grid-template-columns: 72px 96px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  font-size: 12px;
  border-bottom: 1px solid var(--p-border);
  background: transparent;
  transition: background 0.12s;
}
.dash-event-row:hover {
  background: var(--p-surface);
}
.dash-event-row:last-child {
  border-bottom: none;
}
.dash-event-ts {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--p-faint);
  white-space: nowrap;
}
.dash-event-account {
  font-weight: 600;
  color: var(--p-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-event-msg {
  color: var(--p-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-event-chip,
.key-chip {
  display: inline-flex;
  align-items: center;
  max-width: 180px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--p-accent-hover);
  background: var(--p-accent-soft);
  border: 1px solid rgba(197, 106, 58, 0.22);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
  position: relative;
}
.key-chip-text {
  font-family: inherit;
  max-width: 280px;
  color: var(--p-text);
  background: var(--p-surface-2);
  border-color: var(--p-border-strong);
}
.key-chip[data-tip],
.has-tip[data-tip] {
  cursor: help;
  position: relative;
}
/* CSS-псевдотултипы отключены: обрезаются overflow-родителями. См. #sg-floating-tip */
.key-chip[data-tip]:hover::after,
.key-chip[data-tip]:focus::after,
.has-tip[data-tip]:hover::after,
.has-tip[data-tip]:focus::after,
.key-chip[data-tip]:hover::before,
.key-chip[data-tip]:focus::before,
.has-tip[data-tip]:hover::before,
.has-tip[data-tip]:focus::before {
  content: none !important;
  display: none !important;
}
#sg-floating-tip {
  position: fixed;
  z-index: 100000;
  min-width: 200px;
  max-width: min(480px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--p-border-strong);
  background: #12151c;
  color: var(--p-text);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-sans, "IBM Plex Sans", system-ui, sans-serif);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.08s ease;
}
#sg-floating-tip.is-visible {
  opacity: 1;
  visibility: visible;
}
.dash-empty {
  padding: 28px 16px;
  text-align: center;
  border: 1px dashed var(--p-border);
  border-radius: var(--p-radius-sm);
  color: var(--p-muted);
  font-size: 13px;
}
.dash-empty--compact {
  padding: 48px 20px;
  border: none;
  border-radius: 0;
  min-height: 160px;
  display: grid;
  place-items: center;
}

/* Infra server cards (admin-style) */
.infra-server-grid {
  grid-template-columns: 1fr;
}
.infra-server-card {
  padding: 0;
  overflow: hidden;
  transition: border-color 0.15s var(--ease);
  width: 100%;
}
.infra-server-card.is-online {
  border-color: rgba(52, 211, 153, 0.28);
}
.infra-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
}
.infra-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.infra-card-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.infra-card-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.infra-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--p-faint);
  box-shadow: none;
}
.infra-status-dot.is-on {
  background: var(--p-ok);
  box-shadow: 0 0 0 3px var(--p-ok-soft);
}
.infra-card-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.infra-card-id {
  font-size: 11px;
  color: var(--p-faint);
  margin-left: 16px;
}
.infra-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
  max-width: 100%;
}
.infra-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.infra-kpi {
  padding: 8px 10px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border);
  background: rgba(255, 255, 255, 0.015);
}
.infra-kpi.tone-ok {
  border-color: rgba(52, 211, 153, 0.22);
  background: var(--p-ok-soft);
}
.infra-kpi.tone-warn {
  border-color: rgba(251, 191, 36, 0.22);
  background: var(--p-warn-soft);
}
.infra-kpi.tone-ok .infra-kpi-value {
  color: var(--p-ok);
}
.infra-kpi.tone-warn .infra-kpi-value {
  color: var(--p-warn);
}
.infra-kpi-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--p-faint);
  margin-bottom: 3px;
}
.infra-kpi-value {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--p-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.infra-details-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 720px) {
  .infra-details-row {
    grid-template-columns: 1fr 1fr;
  }
}
.infra-details {
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-xs);
  background: rgba(0, 0, 0, 0.18);
  min-width: 0;
}
.infra-details-summary {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--p-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.infra-details-summary::-webkit-details-marker {
  display: none;
}
.infra-details[open] .infra-details-summary {
  color: var(--p-text);
  border-bottom: 1px solid var(--p-border);
}
.infra-snippet {
  margin: 0;
  max-height: 180px;
  overflow: auto;
  font-size: 11px;
  border: none;
  border-radius: 0;
  background: transparent;
}
.infra-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 2px;
}
.infra-action-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 11px;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border);
  background: rgba(255, 255, 255, 0.015);
  text-decoration: none;
  transition: border-color 0.12s, background 0.12s;
  min-width: 0;
}
.infra-action-link:hover {
  border-color: var(--p-border-strong);
  background: var(--p-surface-2);
}
.infra-action-link.is-primary {
  border-color: rgba(197, 106, 58, 0.3);
  background: var(--p-accent-soft);
}
.infra-action-link.is-primary:hover {
  border-color: rgba(56, 189, 248, 0.45);
}
.infra-action-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--p-text);
}
.infra-action-desc {
  font-size: 11px;
  color: var(--p-muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.infra-card-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
  border-top: 1px solid var(--p-border);
}
.infra-delete-form {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}
.infra-delete-btn {
  color: #ff8f9a !important;
}
@media (max-width: 720px) {
  .infra-card-actions {
    grid-template-columns: 1fr;
  }
}

/* Mobile sidebar (burger) */
.portal-nav-toggle {
  position: fixed;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  margin: -4px 8px -4px 0;
  border-radius: var(--p-radius-xs);
  border: 1px solid var(--p-border);
  background: var(--p-surface);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-burger-bar {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--p-text);
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
.sidebar-backdrop {
  display: none;
}
@media (max-width: 1024px) {
  .nav-burger {
    display: flex;
  }
  .topbar {
    gap: 10px;
    display: flex;
    align-items: center;
  }
  .topbar-head {
    flex: 1;
    min-width: 0;
  }
  .topbar-actions {
    flex-wrap: wrap;
  }
  .admin-scope-placeholder {
    display: none;
  }
  .topbar h1 {
    font-size: 17px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 120;
    width: min(var(--p-sidebar), 88vw);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.25s var(--ease);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
  }
  .portal-nav-toggle:checked ~ .app-shell .sidebar {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
  }
  .portal-nav-toggle:checked ~ .app-shell .sidebar-backdrop {
    display: block;
  }
  .main {
    width: 100%;
    min-width: 0;
  }
  .dash-event-row {
    grid-template-columns: 64px 1fr auto;
    grid-template-rows: auto auto;
  }
  .dash-event-ts {
    grid-column: 1;
    grid-row: 1;
  }
  .dash-event-account {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }
  .dash-event-chip {
    grid-column: 3;
    grid-row: 1;
  }
  .dash-event-msg {
    grid-column: 1 / -1;
    grid-row: 2;
    white-space: normal;
  }
  .account-payments-list li {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .account-pay-date {
    grid-column: 1;
  }
  .account-pay-amount {
    grid-column: 2;
  }
  .account-pay-desc {
    grid-column: 1 / -1;
    white-space: normal;
  }
  .infra-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.form-separator {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 8px 0 2px;
}

/* HWID reputation */
.device-page,
.device-detail-page {
  display: grid;
  gap: 16px;
}
.device-kpi {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}
.device-list-card {
  overflow: hidden;
}
.device-table {
  min-width: 980px;
}
.device-row--blocked td,
.device-row--danger td {
  background: linear-gradient(90deg, rgba(196, 92, 92, 0.045), transparent 55%);
}
.device-reputation-cell {
  min-width: 128px;
  display: grid;
  gap: 7px;
}
.device-status {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--p-border);
  border-radius: 999px;
  color: var(--p-muted);
  background: var(--p-surface-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.device-status--trusted,
.device-status--clean {
  color: #9bc8a6;
  border-color: rgba(107, 158, 120, 0.38);
  background: var(--p-ok-soft);
}
.device-status--low {
  color: #9bb7d2;
  border-color: rgba(127, 157, 183, 0.4);
  background: rgba(127, 157, 183, 0.1);
}
.device-status--watch {
  color: #dfc35c;
  border-color: rgba(201, 162, 39, 0.42);
  background: var(--p-warn-soft);
}
.device-status--danger,
.device-status--blocked {
  color: #e58c8c;
  border-color: rgba(196, 92, 92, 0.44);
  background: var(--p-danger-soft);
}
.device-score-line {
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.device-score-line strong {
  font-family: var(--font-heading);
  font-size: 22px;
  line-height: 1;
}
.device-score-track {
  width: 112px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--p-border);
}
.device-score-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--p-ok);
}
.device-score-fill--low {
  background: #7f9db7;
}
.device-score-fill--watch {
  background: var(--p-warn);
}
.device-score-fill--danger,
.device-score-fill--blocked {
  background: var(--p-danger);
}
.device-hwid-link code,
.mon-hwid-link code {
  color: #d6a17f;
  transition: color 0.15s ease;
}
.device-hwid-link:hover code,
.mon-hwid-link:hover code {
  color: var(--p-accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.device-note-preview,
.device-samples {
  max-width: 310px;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.device-link-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
}
.device-link-counts span {
  color: var(--p-muted);
  white-space: nowrap;
}
.device-link-counts b {
  color: var(--p-text);
}
.device-detections {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}
.device-list-foot {
  padding: 0 2px;
  font-size: 12px;
}
.device-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.device-anchor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.device-anchor-nav a {
  padding: 4px 8px;
  border-radius: var(--p-radius-sm);
  color: var(--p-muted);
  font-size: 12px;
}
.device-anchor-nav a:hover {
  color: var(--p-text);
  background: var(--p-surface-2);
}
.device-hero {
  display: grid;
  gap: 22px;
  padding: 22px;
}
.device-hero-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.device-hero-label {
  margin-bottom: 5px;
  color: var(--p-muted);
  font-size: 12px;
  font-weight: 600;
}
.device-full-hwid {
  display: flex;
  align-items: center;
  gap: 8px;
}
.device-full-hwid code {
  display: inline-block;
  max-width: min(720px, 70vw);
  overflow-wrap: anywhere;
  color: #e3b394;
  font-size: 14px;
}
.device-server-list {
  margin-top: 8px;
  font-size: 12px;
}
.device-hero-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  background: var(--p-border);
}
.device-hero-metrics > div {
  min-width: 0;
  padding: 13px 14px;
  background: var(--p-surface-2);
}
.device-hero-metrics span {
  display: block;
  margin-bottom: 5px;
  color: var(--p-muted);
  font-size: 11px;
  font-weight: 600;
}
.device-hero-metrics strong {
  font-family: var(--font-heading);
  font-size: 21px;
  line-height: 1.2;
}
.device-hero-metrics strong.device-date {
  font-family: var(--font-mono);
  font-size: 12px;
}
.device-hero-metrics small {
  color: var(--p-muted);
}
.device-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
}
.device-signals-card,
.device-review-card {
  padding: 20px;
}
.device-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.device-section-head--padded {
  padding: 17px 18px 14px;
}
.device-section-head h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 16px;
}
.device-section-head p {
  margin: 3px 0 0;
  font-size: 12px;
}
.device-signals {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}
.device-signal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid var(--p-border);
  border-left: 3px solid var(--p-warn);
  border-radius: var(--p-radius-sm);
  background: var(--p-surface-2);
}
.device-signal--bad {
  border-left-color: var(--p-danger);
}
.device-signal--ok {
  border-left-color: var(--p-ok);
}
.device-signal-points {
  color: var(--p-warn);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}
.device-signal--bad .device-signal-points {
  color: #e58c8c;
}
.device-signal-points.is-zero {
  color: var(--p-ok);
}
.device-no-autoban {
  margin: 12px 0 0;
  font-size: 12px;
}
.device-review-form {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.device-review-form label {
  color: var(--p-muted);
  font-size: 12px;
  font-weight: 600;
}
.device-review-form textarea {
  width: 100%;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  outline: none;
  color: var(--p-text);
  background: var(--p-bg-2);
  font: inherit;
}
.device-review-form textarea:focus {
  border-color: var(--p-accent);
  box-shadow: 0 0 0 3px var(--p-accent-ring);
}
.device-review-form .btn {
  justify-self: start;
  margin-top: 4px;
}
.device-ban-zone {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--p-border);
}
.btn-danger {
  border-color: rgba(196, 92, 92, 0.5);
  color: #f1b0b0;
  background: var(--p-danger-soft);
}
.btn-danger:hover {
  border-color: var(--p-danger);
  color: #fff;
  background: rgba(196, 92, 92, 0.22);
}
.device-related-card {
  overflow: hidden;
  scroll-margin-top: 18px;
}
.device-details-block {
  padding: 0;
  overflow: hidden;
  scroll-margin-top: 18px;
}
.device-details-block > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 15px 18px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  list-style: none;
}
.device-details-block > summary::-webkit-details-marker {
  display: none;
}
.device-details-block > summary::after {
  content: "⌄";
  margin-left: auto;
  color: var(--p-muted);
  transition: transform 0.18s ease;
}
.device-details-block[open] > summary::after {
  transform: rotate(180deg);
}
.device-details-block[open] > summary {
  border-bottom: 1px solid var(--p-border);
}
.device-event-console {
  max-height: 420px;
  border: 0;
  border-radius: 0;
}
.device-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 18px 18px;
}
.device-identity-chip {
  display: grid;
  gap: 2px;
  padding: 7px 10px;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  background: var(--p-surface-2);
}
.device-identity-chip small {
  color: var(--p-muted);
}

@media (max-width: 1180px) {
  .device-kpi {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
  .device-hero-metrics {
    grid-template-columns: repeat(3, minmax(110px, 1fr));
  }
}
@media (max-width: 820px) {
  .device-overview-grid {
    grid-template-columns: 1fr;
  }
  .device-detail-actions,
  .device-hero-main {
    align-items: flex-start;
    flex-direction: column;
  }
  .device-anchor-nav {
    display: none;
  }
  .device-kpi,
  .device-hero-metrics {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }
  .device-full-hwid {
    align-items: flex-start;
    flex-direction: column;
  }
  .device-full-hwid code {
    max-width: 82vw;
  }
  .device-list-card {
    padding: 10px;
    background: transparent;
    border: 0;
  }
  .device-list-card .data-table-wrap {
    overflow: visible;
  }
  .device-table {
    min-width: 0;
  }
  .device-table thead {
    display: none;
  }
  .device-table,
  .device-table tbody {
    display: block;
  }
  .device-table tbody {
    display: grid;
    gap: 10px;
  }
  .device-table tbody tr {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
    overflow: hidden;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius);
    background: var(--p-surface);
  }
  .device-table tbody td {
    display: block;
    min-width: 0;
    padding: 12px;
    border: 0;
    background: transparent;
  }
  .device-table tbody td:nth-child(1),
  .device-table tbody td:nth-child(2) {
    border-bottom: 1px solid var(--p-border);
  }
  .device-table tbody td:nth-child(1) {
    border-right: 1px solid var(--p-border);
  }
  .device-table tbody td:nth-child(n+3) {
    grid-column: 1 / -1;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .device-table tbody td:nth-child(3),
  .device-table tbody td:nth-child(4) {
    border-bottom: 1px solid var(--p-border);
  }
  .device-table tbody td:last-child {
    padding-top: 4px;
    padding-bottom: 12px;
  }
  .device-table tbody td:last-child .btn {
    width: 100%;
  }
  .device-note-preview,
  .device-samples {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 10px 12px;
  }
  .topbar-head {
    width: 100%;
  }
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .admin-scope-form {
    flex: 1 1 100%;
  }
  .admin-scope-form .scope-select {
    max-width: none;
  }
}

/* Protection policy administration */
.policy-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.policy-list-card {
  min-width: 0;
}

.policy-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--p-border);
}

.policy-card-head h3,
.policy-card-head p {
  margin: 0;
}

.policy-card-head p {
  margin-top: 4px;
}

.policy-create-card {
  position: sticky;
  top: 16px;
}

.policy-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.policy-row-actions form {
  margin: 0;
}

.policy-value {
  max-width: 460px;
  overflow-wrap: anywhere;
}

.data-table tr.row-disabled td {
  opacity: .58;
}

/* Per-server, per-client baselines */
.baseline-server-picker {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  align-items: end;
  gap: 18px;
}

.baseline-server-picker p {
  margin: 0 0 9px;
}

.baseline-clients-card {
  padding: 0;
}

.baseline-profile-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 16px 20px;
}

.baseline-profile-tab {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 13px 14px;
  color: var(--p-text);
  text-decoration: none;
  background: var(--p-surface-2);
  border: 1px solid var(--p-border);
  border-radius: 10px;
}

.baseline-profile-tab:hover {
  border-color: var(--p-border-strong);
}

.baseline-profile-tab.active {
  background: var(--p-accent-soft);
  border-color: var(--p-accent);
}

.baseline-profile-tab span,
.baseline-profile-tab small {
  color: var(--p-muted);
}

.baseline-profile-add {
  margin: 0 20px 18px;
  border-top: 1px solid var(--p-border);
  padding-top: 12px;
}

.baseline-profile-add summary {
  cursor: pointer;
  color: var(--p-accent);
  font-weight: 600;
}

.baseline-profile-form {
  display: grid;
  grid-template-columns: 1fr 1fr 180px auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.baseline-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .72fr);
  gap: 16px;
}

.baseline-steps {
  margin: 10px 0 18px;
  padding-left: 22px;
}

.baseline-profile-settings > form + form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--p-border);
}

@media (max-width: 980px) {
  .policy-admin-layout,
  .baseline-workspace {
    grid-template-columns: 1fr;
  }

  .policy-create-card {
    position: static;
    order: -1;
  }

  .baseline-profile-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .baseline-server-picker,
  .baseline-profile-form {
    grid-template-columns: 1fr;
  }

  .policy-row-actions {
    flex-direction: column;
  }
}

/* Administrator-only PC diagnostics */
.diagnostics-section {
  display: grid;
  gap: 14px;
}

.hwid-catalog-page {
  width: 100%;
  min-width: 0;
}

.detection-view-tabs {
  display: inline-flex;
  width: fit-content;
  padding: 3px;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  background: var(--p-bg-2);
}

.detection-view-tabs a {
  padding: 7px 12px;
  border-radius: calc(var(--p-radius) - 3px);
  color: var(--p-muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.detection-view-tabs a:hover {
  color: var(--p-text);
}

.detection-view-tabs a.active {
  color: var(--p-text);
  background: rgba(204, 101, 53, 0.16);
  box-shadow: inset 0 0 0 1px rgba(204, 101, 53, 0.35);
}

.diagnostics-head {
  padding: 0 0 10px;
  border-bottom: 0;
}

.diagnostic-device-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
}

.diagnostic-device-wrap {
  max-height: 660px;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
}

.diagnostic-device-table {
  min-width: 1120px;
}

.diagnostic-device-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--p-bg-3);
}

.diagnostic-device-table th:nth-child(1) { width: 145px; }
.diagnostic-device-table th:nth-child(2) { width: 240px; }
.diagnostic-device-table th:nth-child(4) { width: 150px; }
.diagnostic-device-table th:nth-child(5) { width: 180px; }
.diagnostic-device-table th:nth-child(6) { width: 145px; }

.diagnostic-device-row > td {
  vertical-align: middle;
}

.diagnostic-device-row > td:not(.diagnostic-device-actions) {
  display: table-cell;
}

.diagnostic-device-row td > strong,
.diagnostic-device-row td > span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnostic-device-row td > span {
  margin-top: 4px;
  color: var(--p-faint);
  font-size: 10px;
}

.diagnostic-device-seen {
  color: #84e7ae;
  font-size: 11px;
}

.diagnostic-device-actions {
  white-space: nowrap;
}

.diagnostic-device-actions .btn + .btn {
  margin-left: 4px;
}

.diagnostic-device-detail > td {
  padding: 0;
  background: rgba(0, 0, 0, 0.12);
}

.diagnostic-device-row[hidden],
.diagnostic-device-detail[hidden] {
  display: none;
}

.diagnostic-specs {
  display: grid;
  gap: 8px;
  margin: 0;
}

.diagnostic-specs > div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--p-border);
}

.diagnostic-specs dt {
  color: var(--p-faint);
}

.diagnostic-specs dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.diagnostic-specs--inline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 13px 16px 15px;
}

.diagnostic-specs--inline > div {
  grid-template-columns: 100px minmax(0, 1fr);
  padding: 7px 14px;
  border-bottom: 0;
  border-right: 1px solid var(--p-border);
}

.diagnostic-specs--inline > div:nth-child(3n) {
  border-right: 0;
}

.diagnostic-snapshot-list {
  display: grid;
  gap: 10px;
}

.process-trust-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--p-muted);
  font-size: 12px;
}

.process-trust-legend > span,
.process-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.process-trust-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #d9dee8;
  box-shadow: 0 0 0 3px rgba(217, 222, 232, 0.08);
}

.process-trust-dot.is-trusted {
  background: #69d69a;
  box-shadow: 0 0 0 3px rgba(105, 214, 154, 0.1);
}

.process-trust-dot.is-suspicious {
  background: #ff6f78;
  box-shadow: 0 0 0 3px rgba(255, 111, 120, 0.1);
}

.diagnostic-snapshot {
  padding: 0;
  overflow: hidden;
}

.diagnostic-snapshot summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 15px 18px;
  cursor: pointer;
}

.diagnostic-snapshot-event {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.diagnostic-snapshot-event code {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnostic-snapshot-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--p-muted);
  font-size: 12px;
}

.diagnostic-snapshot-counts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.process-count {
  display: inline-grid;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  place-items: center;
  border: 1px solid var(--p-border);
  border-radius: 999px;
  color: #d9dee8;
  font-size: 11px;
}

.process-count.is-suspicious {
  border-color: rgba(255, 111, 120, 0.35);
  color: #ff949b;
}

.process-count.is-trusted {
  border-color: rgba(105, 214, 154, 0.3);
  color: #84e7ae;
}

.diagnostic-process-body {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--p-border);
  background: rgba(0, 0, 0, 0.08);
}

.diagnostic-process-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.process-search-field {
  flex: 1 1 320px;
  max-width: 560px;
}

.process-trust-filter {
  flex: 0 0 190px;
  width: 190px;
}

.diagnostic-process-visible {
  white-space: nowrap;
}

.diagnostic-process-duration {
  margin-left: auto;
  white-space: nowrap;
}

.diagnostic-process-wrap {
  max-height: 560px;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
}

.diagnostic-process-table {
  min-width: 1180px;
}

.diagnostic-process-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--p-bg-3);
}

.diagnostic-process-table th:nth-child(1) { width: 165px; }
.diagnostic-process-table th:nth-child(2) { width: 100px; }
.diagnostic-process-table th:nth-child(3) { width: 190px; }
.diagnostic-process-table th:nth-child(4) { width: 230px; }
.diagnostic-process-table th:nth-child(6) { width: 200px; }

.diagnostic-process-row td:first-child {
  border-left: 3px solid transparent;
}

.diagnostic-process-row.is-suspicious {
  background: rgba(255, 83, 93, 0.045);
}

.diagnostic-process-row.is-suspicious td:first-child {
  border-left-color: #ff6f78;
}

.diagnostic-process-row.is-trusted {
  background: rgba(63, 190, 117, 0.025);
}

.diagnostic-process-row.is-detected {
  background: rgba(255, 83, 93, 0.1);
}

.diagnostic-process-row[hidden],
.diagnostic-process-empty[hidden] {
  display: none;
}

.process-trust-badge {
  color: #d9dee8;
  font-size: 12px;
  white-space: nowrap;
}

.process-trust-badge.is-trusted {
  color: #84e7ae;
}

.process-trust-badge.is-suspicious {
  color: #ff949b;
}

.process-detected-badge {
  display: block;
  width: fit-content;
  margin-top: 5px;
  font-size: 9px;
}

.process-pids {
  display: grid;
  gap: 3px;
}

.process-pids span,
.process-signature-cell small {
  color: var(--p-faint);
  font-size: 10px;
}

.process-executable {
  overflow-wrap: anywhere;
}

.process-signature-cell {
  display: grid;
  gap: 4px;
}

.process-signature-cell small {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-signature.is-valid {
  color: #84e7ae;
}

.process-signature.is-invalid {
  color: #ff949b;
}

.diagnostic-process-path {
  max-width: 420px;
  overflow-wrap: anywhere;
}

.diagnostic-process-hash {
  max-width: 210px;
  overflow-wrap: anywhere;
  font-size: 10px;
}

.diagnostic-process-empty {
  text-align: center;
  color: var(--p-muted);
}

@media (max-width: 700px) {
  .detection-view-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .detection-view-tabs a {
    text-align: center;
  }

  .diagnostic-snapshot summary,
  .diagnostic-specs > div {
    grid-template-columns: 1fr;
  }

  .diagnostic-snapshot-meta {
    justify-items: start;
  }

  .process-search-field,
  .process-trust-filter {
    flex-basis: 100%;
    width: 100%;
    max-width: none;
  }

  .diagnostic-process-duration {
    margin-left: 0;
  }

  .diagnostic-device-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}

/* —— Admin project edit (release profile) —— */
.proj-edit {
  max-width: 1180px;
  display: grid;
  gap: 14px;
}
.proj-edit-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.proj-edit-form {
  display: grid;
  gap: 14px;
}
.proj-edit-card {
  padding: 14px 16px 16px;
  min-width: 0;
}
.proj-edit-card .admin-card-head {
  align-items: flex-start;
}
.proj-edit-body {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.35fr);
  gap: 20px 24px;
  align-items: start;
}
.proj-edit-col {
  min-width: 0;
}
.proj-edit-col .admin-fields-2 {
  grid-template-columns: 1fr 1fr;
}
.proj-edit-keys {
  display: grid;
  gap: 8px;
  margin: 10px 0 8px;
}
.proj-edit-key {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  background: rgba(0, 0, 0, 0.22);
  min-width: 0;
}
.proj-edit-key-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--p-faint);
}
.proj-edit-key-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--p-accent-2);
  overflow-wrap: anywhere;
  user-select: all;
}
.proj-edit-block {
  margin-top: 12px;
}
.proj-edit-block-label {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--p-faint);
}
.proj-edit-split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 14px 18px;
  margin-top: 4px;
}
.proj-edit-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--p-border);
}
.opt-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.opt-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.opt-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.opt-chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--p-border-strong);
  border-radius: var(--p-radius);
  background: var(--p-surface-2);
  color: var(--p-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.opt-chip span em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--p-faint);
}
.opt-chip:hover span {
  border-color: var(--p-border-strong);
  color: var(--p-text);
  background: var(--p-surface-raised);
}
.opt-chip input:checked + span {
  border-color: var(--p-accent);
  background: var(--p-accent-soft);
  color: var(--p-text);
  box-shadow: 0 0 0 1px var(--p-accent-ring);
}
.opt-chip input:focus-visible + span {
  outline: none;
  box-shadow: 0 0 0 3px var(--p-accent-ring);
}
.opt-chip.is-soon {
  cursor: not-allowed;
}
.opt-chip.is-soon span {
  opacity: 0.45;
  background: transparent;
}
.opt-chip.is-soon:hover span {
  color: var(--p-muted);
  background: transparent;
  border-color: var(--p-border);
}
@media (max-width: 980px) {
  .proj-edit-body {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .proj-edit-col .admin-fields-2,
  .proj-edit-split {
    grid-template-columns: 1fr;
  }
}
