* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0b1220;
  --bg-soft: #121b2d;
  --bg-elevated: #172338;
  --panel: rgba(18, 27, 45, 0.92);
  --panel-2: rgba(23, 35, 56, 0.92);
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e7edf7;
  --text-soft: #9eb0c7;
  --text-muted: #6d7f97;
  --accent: #5ea7ff;
  --accent-strong: #2d7ff9;
  --green: #2dd4a8;
  --red: #f87171;
  --amber: #f5b74d;
  --cyan: #4fd1ff;
  --radius: 16px;
  --shadow: 0 16px 36px rgba(2, 10, 24, 0.28);
}

html, body {
  min-height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at top right, rgba(94, 167, 255, 0.12), transparent 28%),
    radial-gradient(circle at bottom left, rgba(79, 209, 255, 0.08), transparent 26%),
    linear-gradient(180deg, #09111d 0%, #0b1220 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; border: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

.hidden { display: none !important; }
.mono { font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace; font-size: 11px; }
.mono-sm { font-size: 11px; }
.mono-xs { font-size: 10px; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background:
    linear-gradient(180deg, rgba(23, 35, 56, 0.96), rgba(12, 19, 31, 0.98));
  border-right: 1px solid var(--border);
  padding: 18px 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 10;
  overflow-y: auto;
  backdrop-filter: blur(18px);
}

.main {
  margin-left: 240px;
  flex: 1;
  padding: 26px 32px 40px;
  min-height: 100vh;
}

.logo {
  padding: 0 18px 18px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(94, 167, 255, 0.18), rgba(79, 209, 255, 0.1));
  color: var(--accent);
  border: 1px solid rgba(94, 167, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.logo-mark svg {
  width: 18px;
  height: 18px;
}

.sidebar .nav-group { margin-bottom: 10px; }

.sidebar .nav-label {
  padding: 7px 18px;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  transition: background .18s ease, color .18s ease, transform .18s ease;
  border-left: 2px solid transparent;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  color: var(--text);
  background: rgba(94, 167, 255, 0.08);
  border-left-color: var(--accent);
}

.sidebar nav a .icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.sidebar nav a .icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.18);
  color: #ffc4c4;
  border: 1px solid rgba(248, 113, 113, 0.26);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar .bottom {
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.sidebar .bottom .controls {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
}

.sidebar .bottom #lang-select {
  flex: 0 0 84px;
  width: 84px;
  min-width: 84px;
  padding-left: 10px;
  padding-right: 28px;
}

.sidebar .bottom #logout-btn {
  margin-left: auto;
  flex: 0 0 82px;
  width: 82px;
  min-width: 82px;
  justify-content: center;
}

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-box {
  background: linear-gradient(180deg, rgba(18, 27, 45, 0.96), rgba(13, 21, 34, 0.98));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow);
}

.login-box .logo-mark {
  margin: 0 auto 16px;
  width: 48px;
  height: 48px;
  border-radius: 16px;
}

.login-box h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.login-box p {
  color: var(--text-soft);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.login-box input,
.modal input,
.modal select,
.modal textarea,
.loc-selector select,
.inline-form input,
.inline-form select,
.sidebar .bottom select {
  width: 100%;
  padding: 11px 14px;
  background: rgba(9, 17, 29, 0.76);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.login-box input { margin-bottom: 12px; }

.login-box input:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus,
.loc-selector select:focus,
.inline-form input:focus,
.inline-form select:focus,
.sidebar .bottom select:focus {
  border-color: rgba(94, 167, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(94, 167, 255, 0.12);
}

.modal input.is-invalid,
.modal select.is-invalid,
.modal textarea.is-invalid {
  border-color: rgba(255, 117, 117, 0.75);
  box-shadow: 0 0 0 3px rgba(255, 117, 117, 0.14);
}

.login-box .btn-primary { width: 100%; }
.login-box .error { color: #ffb4b4; font-size: 13px; margin-top: 8px; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.page-sub,
.page-intro {
  color: var(--text-soft);
  font-size: 13px;
  margin-top: 6px;
  max-width: 720px;
  line-height: 1.55;
}

.stats,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.page > .stats,
.page > .metric-grid {
  margin-bottom: 16px;
}

.stat-card,
.metric-card {
  background: linear-gradient(180deg, rgba(20, 31, 49, 0.94), rgba(13, 21, 34, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  box-shadow: var(--shadow);
}

.stat-card::before,
.metric-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 30%);
}

.stat-card .label,
.metric-card .label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  margin-bottom: 8px;
}

.metric-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.metric-label-row .label {
  margin-bottom: 0;
}

.metric-help {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}

.metric-help[open] {
  z-index: 12;
}

.metric-help summary {
  list-style: none;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(94, 167, 255, 0.26);
  background: rgba(94, 167, 255, 0.14);
  color: #dcecff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.metric-help summary::-webkit-details-marker {
  display: none;
}

.metric-help summary:hover {
  background: rgba(94, 167, 255, 0.2);
  border-color: rgba(94, 167, 255, 0.34);
}

.metric-help[open] summary {
  color: var(--text);
  background: rgba(94, 167, 255, 0.24);
  border-color: rgba(94, 167, 255, 0.38);
}

.metric-help-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(260px, 72vw);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(11, 18, 30, 0.98);
  color: var(--text-soft);
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.5;
  z-index: 5;
}

.panel-overflow-visible,
.panel-overflow-visible .panel-pad {
  overflow: visible;
}

.system-status-panel .metric-help-popover {
  left: 0;
  right: auto;
  width: min(220px, calc(100vw - 80px));
}

.stat-card .value,
.metric-card .value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.8px;
}

.stat-card .sub,
.metric-card .sub,
.helper-text {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 6px;
  line-height: 1.5;
}

.section-gap-sm { margin-top: 14px; }
.section-gap-md { margin-top: 16px; }
.space-top-sm { margin-top: 8px; }

.cell-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cell-meta {
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.45;
}

.stat-helper {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.metric-stack {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.metric-row .name {
  font-size: 12px;
  color: var(--text-soft);
}

.metric-row .meta {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
}

.metric-row-end {
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: right;
  min-width: 132px;
}

.metric-value {
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

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

.panel-head h2 {
  font-size: 15px;
  font-weight: 700;
}

.panel-head-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.panel-head-copy .helper-text {
  margin: 0;
  max-width: 620px;
}

.panel-head .actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.section-label {
  margin-bottom: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  vertical-align: top;
}

tr:hover td {
  background: rgba(94, 167, 255, 0.04);
}

tr.expandable { cursor: pointer; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge.online,
.badge.active,
.badge.enabled {
  background: rgba(45, 212, 168, 0.14);
  color: #7df0cc;
  border-color: rgba(45, 212, 168, 0.22);
}

.badge.offline,
.badge.inactive,
.badge.disabled {
  background: rgba(248, 113, 113, 0.14);
  color: #ffb1b1;
  border-color: rgba(248, 113, 113, 0.22);
}

.badge.degraded,
.badge.warning {
  background: rgba(245, 183, 77, 0.14);
  color: #ffd89b;
  border-color: rgba(245, 183, 77, 0.22);
}

.badge.busy { background: rgba(94, 167, 255, 0.14); color: #bfdaff; border-color: rgba(94, 167, 255, 0.22); }
.badge.free { background: rgba(45, 212, 168, 0.14); color: #7df0cc; border-color: rgba(45, 212, 168, 0.22); }
.badge.info { background: rgba(79, 209, 255, 0.12); color: #bfeeff; border-color: rgba(79, 209, 255, 0.18); }

.btn-sm,
.btn-primary,
.btn-green {
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.btn-sm {
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.btn-sm:hover {
  background: rgba(94, 167, 255, 0.12);
  color: var(--text);
  border-color: rgba(94, 167, 255, 0.2);
}

.btn-sm:disabled,
.btn-green:disabled,
.cred-copy:disabled,
.btn-sm.is-busy,
.btn-primary.is-busy,
.btn-green.is-busy,
.cred-copy.is-busy {
  opacity: 0.62;
  cursor: wait;
  transform: none;
}

.btn-sm.danger {
  color: #ffc0c0;
}

.btn-sm.danger:hover {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.2);
}

.btn-primary,
.btn-green {
  padding: 9px 16px;
  color: #fff;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 24px rgba(45, 127, 249, 0.28);
}

.btn-primary.danger {
  background: linear-gradient(135deg, #d84b63, #ba2e46);
  box-shadow: 0 10px 24px rgba(216, 75, 99, 0.26);
}

.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-green {
  background: linear-gradient(135deg, #25c39a, #1ea97f);
}

.loc-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.sidebar .loc-selector {
  margin: 0 0 12px;
  padding: 0 18px 16px;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar .loc-selector select,
.sidebar .loc-selector .btn-sm {
  width: 100%;
}

.sidebar .loc-selector .btn-sm {
  justify-content: center;
}

.loc-selector label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.7px;
}

.loc-selector-copy {
  display: grid;
  gap: 4px;
  min-width: 220px;
}

.sidebar .loc-selector-copy {
  min-width: 0;
}

.loc-selector-copy .helper-text {
  margin: 0;
  max-width: 420px;
}

.sidebar .loc-selector-copy .helper-text {
  max-width: none;
}

.loc-selector .helper-text.error {
  color: #ffb4b4;
}

.page-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.page-tools-note {
  margin: -4px 0 12px;
}

.page-tools label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.page-tools input,
.page-tools select {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 12px;
}

.page-tools .field-sm { width: 72px; }
.page-tools .field-md { width: 120px; }
.page-tools .field-lg { width: 200px; }

.mono-pre {
  background: var(--bg);
  padding: 12px;
  border-radius: 10px;
  font-size: 11px;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
}

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

.compact-actions {
  gap: 5px;
}

.location-id-cell {
  width: 1%;
  white-space: nowrap;
}

.location-id-short {
  display: inline-block;
  min-width: 0;
}

.location-name-cell {
  white-space: nowrap;
}

.location-actions-cell {
  width: 1%;
  white-space: nowrap;
}

.location-actions-row {
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 4px;
}

.location-actions-row .btn-sm {
  padding: 6px 10px;
  white-space: nowrap;
}

.secret-value {
  word-break: break-all;
}

.table-loading {
  padding: 18px 12px;
  text-align: center;
  color: var(--text-soft);
}

.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(2, 10, 24, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 18px;
}

.modal {
  background: linear-gradient(180deg, rgba(18, 27, 45, 0.98), rgba(10, 16, 27, 0.98));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  width: min(540px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 14px;
}

.modal label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.modal textarea {
  min-height: 92px;
  resize: vertical;
}

.modal-intro {
  margin: 0 0 16px;
  color: var(--text-soft);
  line-height: 1.55;
}

.modal-copy {
  margin: 0 0 8px;
  color: var(--text);
  line-height: 1.55;
}

.modal-feedback {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 117, 117, 0.24);
  background: rgba(97, 21, 21, 0.24);
  color: #ffd7d7;
  font-size: 12px;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field-group.full {
  grid-column: 1 / -1;
}

.field-group .helper-text {
  margin: 0;
}

.helper-text.error {
  color: #ffb4b4;
}

.field-static {
  width: 100%;
  padding: 11px 14px;
  background: rgba(9, 17, 29, 0.76);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 13px;
}

.modal .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

.action-feedback {
  margin-top: 8px;
  width: 100%;
  font-size: 11px;
  line-height: 1.45;
}

.action-feedback.error {
  color: #ffb4b4;
}

.action-feedback.success {
  color: #9fe5c8;
}

.inline-actions .action-feedback,
.actions .action-feedback,
.page-tools .action-feedback {
  flex-basis: 100%;
}

.cred-block {
  background: rgba(9, 17, 29, 0.76);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
}

.cred-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.cred-row:last-child { border-bottom: none; }

.cred-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  min-width: 82px;
}

.cred-value {
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  font-size: 12px;
  color: var(--text);
  flex: 1;
  word-break: break-word;
}

.cred-copy {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  border: 1px solid rgba(148, 163, 184, 0.16);
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
}

.cred-copy:hover {
  background: rgba(94, 167, 255, 0.12);
  color: var(--text);
}

.port-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.port-pill { font-size: 10px; padding: 3px 7px; border-radius: 999px; font-weight: 700; font-family: monospace; }
.port-pill.busy { background: rgba(94, 167, 255, 0.16); color: #bfdaff; }
.port-pill.free { background: rgba(45, 212, 168, 0.16); color: #7df0cc; }

.expand-row { background: rgba(9, 17, 29, 0.72); border-bottom: 1px solid var(--border); }
.expand-row td { padding: 16px; }
.expand-row.flush td { padding: 0; }

.expand-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.expand-content.padded {
  padding: 16px;
}

.expand-section {
  background: rgba(18, 27, 45, 0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.expand-section h4 {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

#toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  z-index: 9999;
  max-width: min(360px, calc(100vw - 24px));
}

.toast {
  position: relative;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
  animation: slideUp .25s ease;
}

.toast.success { background: rgba(29, 107, 86, 0.96); color: #eafff8; }
.toast.error { background: rgba(126, 42, 42, 0.96); color: #fff0f0; }
.toast.info { background: rgba(22, 65, 132, 0.96); color: #eff6ff; }

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.collapsible-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  margin-bottom: 8px;
}

.collapsible-header:hover { background: rgba(94, 167, 255, 0.08); }
.collapsible-header h3 { font-size: 14px; font-weight: 700; }
.collapsible-body { padding: 0 4px 12px; }

.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.signal-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; vertical-align: middle; margin-right: 4px; }
.signal-bars .bar { width: 4px; border-radius: 1px; background: rgba(255, 255, 255, 0.1); }
.signal-bars .bar.bar-h1 { height: 4px; }
.signal-bars .bar.bar-h2 { height: 6px; }
.signal-bars .bar.bar-h3 { height: 8px; }
.signal-bars .bar.bar-h4 { height: 10px; }
.signal-bars .bar.bar-h5 { height: 13px; }
.signal-bars .bar.bar-h6 { height: 16px; }
.signal-bars.signal-weak .bar.active { background: var(--red); }
.signal-bars.signal-medium .bar.active { background: var(--amber); }
.signal-bars.signal-strong .bar.active { background: var(--green); }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(158, 176, 199, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  padding: 16px;
  color: var(--text-soft);
  line-height: 1.5;
}

.empty-state.loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.empty-state.error {
  color: #ffb4b4;
}

.text-positive {
  color: #7df0cc;
}

.text-negative {
  color: #ffb1b1;
}

.stat-card .sub.error,
.metric-card .sub.error {
  color: #ffb4b4;
}

.cred-label.cred-label-wide {
  min-width: 200px;
  text-transform: none;
}

.cell-ellipsis {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-wrap {
  display: inline-block;
  max-width: 260px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

.stack-sm { display: grid; gap: 8px; }
.panel-pad { padding: 16px; }
.service-badges { display: flex; gap: 8px; flex-wrap: wrap; }

.services-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.service-status-list {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.service-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.service-status-name {
  color: var(--text);
  font-size: 12px;
}

.service-status-value {
  font-size: 12px;
  font-weight: 700;
  text-transform: lowercase;
}

.service-status-value.is-active {
  color: #7df0cc;
}

.service-status-value.is-inactive {
  color: #ffb4b4;
}

@media (max-width: 1024px) {
  .section-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    width: 64px;
    padding: 10px 0;
  }

  .sidebar .logo > span:last-child,
  .sidebar .nav-label,
  .sidebar nav a > span:not(.icon):not(.nav-badge),
  .sidebar .bottom .controls,
  .sidebar .loc-selector-copy .helper-text {
    display: none;
  }

  .sidebar nav a {
    justify-content: center;
    padding: 12px 10px;
  }

  .sidebar .loc-selector {
    padding: 0 8px 12px;
    gap: 8px;
  }

  .sidebar .loc-selector label {
    font-size: 9px;
    letter-spacing: 0.5px;
  }

  .sidebar .loc-selector select,
  .sidebar .loc-selector .btn-sm {
    padding-left: 8px;
    padding-right: 8px;
    font-size: 11px;
  }

  .nav-badge {
    position: absolute;
    top: 8px;
    right: 8px;
  }

  .main {
    margin-left: 64px;
    padding: 18px;
  }

  .stats,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .loc-selector {
    flex-direction: column;
    align-items: stretch;
  }

  .form-grid.two-col {
    grid-template-columns: 1fr;
  }
}

/* Fix 12: utility for auto-rotate policy text */
.text-green { color: #4ade80; }

/* Fix 14: e2e utility classes */
.badge-lg { font-size: 1.1em; padding: 4px 12px; }
.panel-mt { margin-top: 16px; }
.text-muted { color: var(--text3); }
.text-xs { font-size: 0.85em; }
