
:root {
  --spartan-accent: #295391;
  --spartan-accent-2: #3e78d4;
}

body {
  background: #f5f7fb;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.sidebar-brand {
  background: linear-gradient(135deg, var(--spartan-accent), var(--spartan-accent-2));
}

.sidebar [data-feather] {
  width: 16px;
  height: 16px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: linear-gradient(180deg, #eef3fb, #f7f9fc);
}

.auth-card {
  width: min(520px, 96vw);
  border-radius: 1rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.12);
}

.stat-tile {
  border: 1px solid rgba(43, 54, 67, 0.08);
  border-radius: 0.75rem;
  padding: 1rem;
  background: linear-gradient(180deg, #fff, #f9fbff);
  height: 100%;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  color: #6c757d;
  margin-top: 0.35rem;
  font-size: 0.875rem;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.raw-editor {
  min-height: 460px;
  resize: vertical;
}

.spartan-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1080;
}

.spartan-modal.show {
  display: flex;
}

.spartan-modal-card {
  width: min(760px, 96vw);
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.2);
  padding: 1.25rem;
}

#modalBody .field label,
.form-label {
  font-weight: 600;
}

.chip-multiselect {
  display: grid;
  gap: 0.5rem;
}

.chip-selected-field {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-height: 1.75rem;
}

.chip-selected-label {
  flex: 0 0 auto;
  color: #495057;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.75rem;
}

.chip-selected-list {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
}

.chip-selected-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.75rem;
  max-width: 100%;
  padding: 0 0.55rem;
  border: 1px solid rgba(62, 120, 212, 0.68);
  border-radius: 0.3rem;
  background: rgba(59, 125, 221, 0.12);
  color: var(--spartan-accent);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 700;
}

.chip-selected-pill span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-selected-pill:hover {
  border-color: rgba(62, 120, 212, 0.9);
  background: rgba(59, 125, 221, 0.18);
  color: #1f467b;
}

.chip-selected-empty {
  color: #6c757d;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.75rem;
}

.badge-soft-ok {
  color: #146c43;
  background: rgba(25, 135, 84, 0.12);
  border: 1px solid rgba(25, 135, 84, 0.2);
}

.badge-soft-muted {
  color: #495057;
  background: rgba(108, 117, 125, 0.1);
  border: 1px solid rgba(108, 117, 125, 0.15);
}

.table td .btn {
  margin-left: 0.35rem;
}

.alert {
  word-break: break-word;
}

.admin-list {
  display: grid;
  gap: 0.75rem;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(43, 54, 67, 0.08);
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: #fff;
}

@media (max-width: 767.98px) {
  .content {
    padding: 1rem 0.75rem;
  }

  .spartan-modal-card {
    padding: 1rem;
  }

  .admin-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.stack-list {
  display: grid;
  gap: .65rem;
}

.stack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem .85rem;
  border: 1px solid rgba(43,54,67,.08);
  border-radius: .75rem;
  background: #fff;
}

.code-wrap {
  white-space: pre-wrap;
  word-break: break-word;
}

.network-panel { display:none; }
.network-panel.active { display:block; }


.network-feed-table-wrap {
  max-height: 72vh;
  overflow: auto;
}

.network-feed-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}

.network-feed-table tbody tr.feed-good {
  color: #146c43;
}

.network-feed-table tbody tr.feed-low {
  background: rgba(108, 117, 125, 0.06);
}

.network-feed-table tbody tr.feed-medium {
  background: rgba(255, 193, 7, 0.12);
}

.network-feed-table tbody tr.feed-high {
  background: rgba(220, 53, 69, 0.12);
}


.network-feed-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.network-feed-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
}

.network-feed-table th,
.network-feed-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.network-feed-table th:nth-child(1),
.network-feed-table td:nth-child(1) { width: 15%; }
.network-feed-table th:nth-child(2),
.network-feed-table td:nth-child(2) { width: 15%; }
.network-feed-table th:nth-child(3),
.network-feed-table td:nth-child(3) { width: 10%; }
.network-feed-table th:nth-child(4),
.network-feed-table td:nth-child(4) { width: 12%; }
.network-feed-table th:nth-child(5),
.network-feed-table td:nth-child(5) { width: 12%; }
.network-feed-table th:nth-child(6),
.network-feed-table td:nth-child(6) { width: 22%; }
.network-feed-table th:nth-child(7),
.network-feed-table td:nth-child(7) { width: 14%; }

.compact-activity-table {
  min-width: 860px;
}

.compact-activity-table th:nth-child(1),
.compact-activity-table td:nth-child(1) { width: 16%; }
.compact-activity-table th:nth-child(2),
.compact-activity-table td:nth-child(2) { width: 18%; }
.compact-activity-table th:nth-child(3),
.compact-activity-table td:nth-child(3) { width: 14%; }
.compact-activity-table th:nth-child(4),
.compact-activity-table td:nth-child(4) { width: 16%; }
.compact-activity-table th:nth-child(5),
.compact-activity-table td:nth-child(5) { width: 12%; }
.compact-activity-table th:nth-child(6),
.compact-activity-table td:nth-child(6) { width: 24%; }

.stack-list {
  min-width: 0;
}

@media (max-width: 991.98px) {
  .network-feed-table,
  .compact-activity-table {
    min-width: 780px;
  }
}

/* SpartanCAD Community Admin Panel visual alignment */
:root {
  --page: #101418;
  --sidebar: #0f1418;
  --surface: #151a1f;
  --surface-raised: #181f25;
  --surface-soft: #1c232a;
  --line: rgba(142, 171, 205, 0.14);
  --line-bright: rgba(142, 171, 205, 0.28);
  --text: #f6f8fb;
  --muted: #9aa8b8;
  --dim: #738191;
  --blue: #4d8dff;
  --blue-dark: #27577c;
  --teal: #20c6b3;
  --amber: #d89b2b;
  --red: #dc4c4c;
  --green: #38a169;
  --topbar: rgb(16, 22, 27);
  --shadow: 0 24px 56px rgba(0, 0, 0, 0.34);
  --bs-body-bg: var(--page);
  --bs-body-color: var(--text);
  --bs-border-color: var(--line);
  --bs-primary: #2e6ba1;
  --bs-primary-rgb: 46, 107, 161;
}

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

body {
  color: var(--text);
  background: var(--page);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.wrapper,
.main {
  background: var(--page);
}

.sidebar,
.sidebar-content {
  background: var(--sidebar) !important;
}

.sidebar {
  border-right: 1px solid var(--line);
  box-shadow: none;
}

.sidebar-brand {
  min-height: 65px;
  display: flex;
  align-items: center;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.sidebar-header {
  color: #7d8b9b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-link,
a.sidebar-link {
  min-height: 40px;
  margin: 0 8px 4px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border-left: 2px solid transparent;
  border-radius: 6px;
  font-size: 14px;
}

.sidebar-link:hover,
.sidebar-link:focus,
.sidebar-item.active .sidebar-link,
.sidebar-link.active {
  color: #fff;
  background: rgba(77, 141, 255, 0.1);
}

.sidebar-item.active .sidebar-link,
.sidebar-link.active {
  border-left-color: var(--blue);
}

.sidebar-link i,
.sidebar-link svg {
  color: #8994a3;
}

.sidebar-item.active .sidebar-link i,
.sidebar-item.active .sidebar-link svg,
.sidebar-link.active i,
.sidebar-link.active svg {
  color: var(--teal);
}

.navbar-bg,
.navbar {
  min-height: 65px;
  background: var(--topbar) !important;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

.content {
  background: var(--page);
  padding: 22px 28px 30px;
}

h1,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
h2,
h3,
h4,
h5,
h6,
.card-title,
.fw-semibold {
  color: var(--text);
}

.text-muted,
small.text-muted,
.small.text-muted {
  color: var(--muted) !important;
}

.card,
.stat-tile,
.admin-row,
.stack-row,
.spartan-modal-card,
.border,
.rounded {
  background: var(--surface) !important;
  border-color: var(--line) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

.card-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.stat-tile {
  background: var(--surface) !important;
}

.stat-value {
  color: #fff;
  font-size: 1.75rem;
  font-weight: 700;
}

.stat-label {
  color: var(--muted);
}

.form-control,
.form-select,
textarea.form-control {
  color: #fff;
  background-color: #10151a;
  border-color: var(--line);
  border-radius: 6px;
}

.form-control:focus,
.form-select:focus {
  color: #fff;
  background-color: #10151a;
  border-color: #5d91d6;
  box-shadow: none;
}

.form-control::placeholder {
  color: var(--dim);
}

.form-label,
.form-check-label,
#modalBody .field label {
  color: #d6e0ea;
  font-size: 13px;
  font-weight: 650;
}

.btn {
  border-radius: 6px;
  font-weight: 700;
  box-shadow: none !important;
}

.btn-primary,
.btn-outline-primary:hover {
  color: #fff;
  background-color: #2e6ba1;
  border-color: #2e6ba1;
}

.btn-outline-primary {
  color: #7fb0f2;
  border-color: var(--line-bright);
}

.btn-outline-secondary {
  color: #dce5ef;
  border-color: var(--line);
}

.btn-outline-secondary:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line-bright);
}

.btn-outline-danger {
  color: #ff7777;
  border-color: rgba(255, 119, 119, 0.28);
}

.btn-outline-danger:hover,
.btn-danger {
  color: #fff;
  background: #743232;
  border-color: #743232;
}

.alert {
  color: #dce5ef;
  background: rgba(30, 47, 59, 0.46);
  border-color: var(--line);
  border-radius: 8px;
}

.auth-shell {
  background: var(--page);
}

.auth-card {
  background: linear-gradient(180deg, rgba(20, 28, 34, 0.98), rgba(13, 18, 22, 0.98)) !important;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.table {
  --bs-table-color: var(--text);
  --bs-table-bg: var(--surface);
  --bs-table-border-color: var(--line);
  --bs-table-striped-bg: #171d22;
  --bs-table-striped-color: var(--text);
  --bs-table-hover-bg: #1b232b;
  --bs-table-hover-color: #fff;
  color: var(--text);
}

.table thead th,
.network-feed-table thead th {
  color: #aebdcc;
  background: #171d23 !important;
  border-bottom-color: var(--line);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.table td,
.table th {
  border-color: var(--line);
}

.badge,
.chip-selected-pill {
  border-radius: 999px;
  font-weight: 700;
}

.text-bg-success,
.badge-soft-ok {
  color: #7ad8ad !important;
  background: rgba(38, 159, 104, 0.12) !important;
  border-color: rgba(77, 192, 136, 0.32) !important;
}

.text-bg-secondary,
.text-bg-dark,
.text-bg-light,
.badge-soft-muted {
  color: #aebdcc !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--line) !important;
}

.bg-primary-subtle,
.text-bg-primary {
  color: #d6e8ff !important;
  background: rgba(77, 141, 255, 0.1) !important;
  border-color: rgba(77, 141, 255, 0.28) !important;
}

.spartan-modal {
  background: rgba(0, 0, 0, 0.54);
}

.chip-selected-pill {
  color: #d9f5f1;
  background: rgba(32, 198, 179, 0.08);
  border-color: rgba(32, 198, 179, 0.22);
}

.nexus-content .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.nexus-heading,
.nexus-card-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.nexus-stat .stat-value {
  min-height: 2.15rem;
  font-size: 1.15rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.nexus-command-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.nexus-command-grid .btn {
  min-height: 44px;
}

.nexus-command-state,
.nexus-empty {
  min-height: 42px;
  padding: 0.75rem 0.85rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.nexus-kv {
  display: grid;
  gap: 0.65rem;
}

.nexus-kv > div,
.nexus-mini-stat,
.nexus-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.026);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.nexus-kv span,
.nexus-mini-stat span {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
}

.nexus-kv strong,
.nexus-mini-stat strong {
  color: var(--text);
  font-weight: 800;
  text-align: right;
}

.nexus-list,
.nexus-scanner-list,
.nexus-log-list {
  display: grid;
  gap: 0.65rem;
}

.nexus-list-row {
  align-items: flex-start;
}

.nexus-list-row > div:first-child {
  min-width: 0;
}

.nexus-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.nexus-scanner-audio-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.nexus-scanner-audio-bar > div {
  min-width: 0;
  padding: 0.75rem 0.85rem;
  background: rgba(32, 198, 179, 0.055);
  border: 1px solid rgba(32, 198, 179, 0.16);
  border-radius: 8px;
}

.nexus-scanner-audio-bar span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.nexus-scanner-audio-bar strong {
  display: block;
  margin-top: 0.3rem;
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.nexus-scanner-row {
  cursor: default;
}

.nexus-scanner-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.nexus-scanner-title .form-check-input {
  flex: 0 0 auto;
  margin: 0;
}

.nexus-scanner-title label {
  cursor: pointer;
}

.nexus-scanner-row [data-scanner-toggle] {
  min-width: 5.5rem;
}

.nexus-log-list {
  max-height: 68vh;
  overflow: auto;
  padding-right: 0.25rem;
}

.nexus-log-entry {
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.026);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.nexus-log-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

.nexus-log-top strong,
.nexus-log-top time {
  min-width: 0;
}

.nexus-log-top time {
  color: var(--muted);
  font-size: 0.75rem;
  text-align: right;
}

.nexus-log-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.nexus-log-meta span {
  min-width: 0;
  padding: 0.35rem 0.45rem;
  color: #b8c7d8;
  background: rgba(77, 141, 255, 0.06);
  border: 1px solid rgba(77, 141, 255, 0.13);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.nexus-log-entry p {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.nexus-limit {
  width: 5.5rem;
}

.nexus-table {
  min-width: 620px;
  table-layout: fixed;
}

.nexus-table td,
.nexus-table th {
  overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
  .nexus-content {
    padding: 1rem 0.75rem 1.25rem;
  }

  .nexus-heading .text-muted {
    display: block;
    margin-left: 0 !important;
    margin-top: 0.25rem;
  }

  .nexus-card-tools {
    align-items: stretch;
  }

  .nexus-card-tools > .btn-group,
  .nexus-card-tools > .btn,
  .nexus-card-tools > .form-select {
    width: 100%;
  }

  .nexus-log-top {
    display: grid;
    gap: 0.35rem;
  }

  .nexus-log-top time {
    text-align: left;
  }

  .nexus-log-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nexus-scanner-audio-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .nexus-command-grid {
    grid-template-columns: 1fr;
  }

  .nexus-list-row {
    display: grid;
  }

  .nexus-list-row .text-end {
    text-align: left !important;
  }

  .nexus-log-meta {
    grid-template-columns: 1fr;
  }
}

/* Full SpartanCAD Admin Panel layout pass for RMS */
:root {
  --rms-sidebar-width: 248px;
  --rms-topbar-height: 65px;
  --rms-workspace-header-height: 72px;
}

#appShell:not(.d-none) {
  display: block;
}

#appShell .wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--rms-sidebar-width) minmax(0, 1fr);
  align-items: stretch;
  background: var(--page);
}

#appShell .main {
  min-width: 0;
  display: grid;
  grid-template-rows: var(--rms-topbar-height) minmax(0, 1fr);
  background: var(--page);
}

#appShell .sidebar {
  width: var(--rms-sidebar-width);
  min-width: var(--rms-sidebar-width);
  max-width: var(--rms-sidebar-width);
  margin-left: 0 !important;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 45;
  background: var(--sidebar) !important;
  border-right: 1px solid var(--line);
  box-shadow: none;
}

#appShell .sidebar.collapsed {
  margin-left: 0 !important;
}

#appShell .sidebar-content,
#appShell [data-simplebar] {
  width: 100%;
  height: 100%;
  position: static;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: var(--sidebar) !important;
}

#appShell .sidebar-content::-webkit-scrollbar,
#appShell [data-simplebar]::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

#appShell .sidebar .simplebar-track {
  display: none !important;
}

#appShell .simplebar-wrapper,
#appShell .simplebar-mask,
#appShell .simplebar-offset,
#appShell .simplebar-content-wrapper {
  position: static !important;
  width: 100% !important;
  height: 100% !important;
  overflow: visible !important;
}

#appShell .simplebar-content {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
}

#appShell .sidebar-brand {
  min-height: var(--rms-topbar-height);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 0 18px;
  color: #fff;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

#appShell .sidebar-brand:hover,
#appShell .sidebar-brand:focus {
  color: #fff;
  text-decoration: none;
}

.rms-brand-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  object-fit: contain;
}

#appShell .sidebar-nav {
  display: grid;
  gap: 0;
  align-content: start;
  flex: 1 1 auto;
  margin: 0;
  padding: 20px 12px;
}

#appShell .sidebar-header {
  margin: 0 10px 7px;
  padding: 0;
}

#appShell .sidebar-item {
  margin: 0;
}

#appShell .sidebar-link,
#appShell a.sidebar-link {
  width: calc(100% - 16px);
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 8px 4px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  text-align: left;
}

#appShell .sidebar-link:hover,
#appShell .sidebar-link:focus,
#appShell .sidebar-item.active .sidebar-link,
#appShell .sidebar-link.active {
  color: #fff;
  background: rgba(77, 141, 255, 0.1);
  text-decoration: none;
  outline: 0;
}

#appShell .sidebar-item.active .sidebar-link,
#appShell .sidebar-link.active {
  border-left-color: var(--blue);
}

#appShell .sidebar-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #8994a3;
  stroke-width: 2;
}

#appShell .sidebar-item.active .sidebar-link svg,
#appShell .sidebar-link.active svg {
  color: var(--teal);
}

#appShell .navbar {
  min-height: var(--rms-topbar-height);
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 0 clamp(18px, 4vw, 64px);
  background: var(--topbar) !important;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

#appShell .navbar-collapse {
  min-width: 0;
}

#appShell .navbar-nav {
  min-width: 0;
}

#appShell .navbar .badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  max-width: min(44vw, 430px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#appShell .sidebar-toggle {
  width: 36px;
  height: 36px;
  display: none;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  color: #dce5ef;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
}

#appShell .hamburger,
#appShell .hamburger::before,
#appShell .hamburger::after {
  background: #dce5ef;
}

#appShell .content {
  min-width: 0;
  overflow: visible;
  background: var(--page);
  padding: 0;
}

#appShell .content > .container-fluid {
  max-width: none;
  min-height: calc(100vh - var(--rms-topbar-height));
  padding: 22px 28px 30px !important;
}

#appShell .content > .container-fluid > .mb-3:first-child,
#appShell .content > .container-fluid > .nexus-heading:first-child {
  min-height: var(--rms-workspace-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin: -22px -28px 22px !important;
  padding: 14px 28px 12px;
  background: var(--page);
  border-bottom: 1px solid var(--line);
}

#appShell .content > .container-fluid > .mb-3:first-child h1,
#appShell .content > .container-fluid > .nexus-heading:first-child h1 {
  display: block !important;
  margin: 3px 0 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 650;
  line-height: 1.1;
}

#appShell .content > .container-fluid > .mb-3:first-child h1::before,
#appShell .content > .container-fluid > .nexus-heading:first-child h1::before {
  content: "Administration";
  display: block;
  margin: 0 0 4px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

#appShell .content > .container-fluid > .mb-3:first-child .text-muted,
#appShell .content > .container-fluid > .nexus-heading:first-child .text-muted {
  display: block;
  margin: 5px 0 0 !important;
  font-size: 13px;
}

#appShell .content > .container-fluid > .mb-3:first-child > h1:first-child + .text-muted {
  flex-basis: 100%;
  margin-top: -9px !important;
}

#appShell .card {
  background: var(--surface) !important;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

#appShell .card-header {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0 !important;
}

#appShell .card-body {
  padding: 16px;
}

#appShell .stat-tile {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  background: var(--surface) !important;
  border: 1px solid var(--line);
  border-radius: 8px !important;
}

#appShell .border.rounded,
#appShell .stack-row,
#appShell .admin-row,
#appShell .nexus-kv > div,
#appShell .nexus-mini-stat,
#appShell .nexus-list-row,
#appShell .nexus-log-entry {
  background: rgba(255, 255, 255, 0.026) !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
}

#appShell .table-responsive {
  border: 1px solid var(--line);
  border-radius: 8px;
}

#appShell .table-responsive .table {
  margin-bottom: 0;
}

#appShell .table th,
#appShell .table td {
  padding: 12px 15px;
  vertical-align: middle;
  font-size: 13px;
}

#appShell .table tbody tr {
  background: #151a1f;
}

#appShell .table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-bg-type: #171d22;
}

#appShell .form-check-input {
  background-color: #39414a;
  border-color: #526170;
  box-shadow: none;
}

#appShell .form-check-input:checked {
  background-color: var(--teal);
  border-color: var(--teal);
}

#appShell .form-switch .form-check-input {
  width: 42px;
  height: 24px;
  margin-top: 0;
}

.text-bg-danger {
  color: #ffd5d5 !important;
  background: #431e21 !important;
  border: 1px solid #7a2b32 !important;
}

.text-bg-warning {
  color: #ffe6ac !important;
  background: #453311 !important;
  border: 1px solid #6b4e16 !important;
}

.btn-outline-success {
  color: #7ad8ad;
  border-color: rgba(77, 192, 136, 0.32);
}

.btn-outline-success:hover {
  color: #fff;
  background: #286a59;
  border-color: #286a59;
}

#appShell .btn-sm {
  min-height: 32px;
}

#appShell .btn-lg {
  min-height: 44px;
}

.spartan-modal {
  align-items: stretch;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.54);
}

.spartan-modal-card {
  width: min(760px, 100vw);
  min-height: 100vh;
  overflow: auto;
  padding: 22px;
  background: #12171c !important;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 !important;
  box-shadow: var(--shadow) !important;
}

body.sidebar-open {
  overflow: hidden;
}

@media (max-width: 1080px) {
  #appShell .wrapper {
    grid-template-columns: 1fr;
  }

  #appShell .sidebar {
    position: fixed;
    inset: var(--rms-topbar-height) auto 0 0;
    z-index: 70;
    height: calc(100vh - var(--rms-topbar-height));
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  body.sidebar-open #appShell .sidebar {
    transform: translateX(0);
  }

  #appShell .main {
    grid-template-rows: var(--rms-topbar-height) minmax(0, 1fr);
  }

  #appShell .sidebar-brand {
    display: none;
  }

  #appShell .sidebar-toggle {
    display: inline-flex;
  }

  #appShell .navbar {
    padding-inline: 16px;
  }
}

@media (max-width: 760px) {
  :root {
    --rms-topbar-height: 68px;
  }

  #appShell .navbar {
    min-height: var(--rms-topbar-height);
  }

  #appShell .navbar-nav {
    justify-content: flex-end;
    gap: 6px !important;
  }

  #appShell .navbar .btn {
    min-height: 34px;
    padding-inline: 9px;
    font-size: 12px;
  }

  #appShell .content > .container-fluid {
    padding: 18px 16px 24px !important;
  }

  #appShell .content > .container-fluid > .mb-3:first-child,
  #appShell .content > .container-fluid > .nexus-heading:first-child {
    align-items: flex-start;
    margin: -18px -16px 18px !important;
    padding: 14px 16px 12px;
  }

  #appShell .content > .container-fluid > .mb-3:first-child h1,
  #appShell .content > .container-fluid > .nexus-heading:first-child h1 {
    font-size: 21px;
  }

  #appShell .content > .container-fluid > .mb-3:first-child > div:last-child,
  #appShell .content > .container-fluid > .nexus-heading:first-child > span:last-child {
    width: 100%;
  }

  #appShell .content > .container-fluid > .mb-3:first-child .btn,
  #appShell .nexus-card-tools > .btn-group,
  #appShell .nexus-card-tools > .btn,
  #appShell .nexus-card-tools > .form-select {
    width: 100%;
  }

  #appShell .table th,
  #appShell .table td {
    padding: 11px 12px;
  }

  .spartan-modal {
    justify-content: stretch;
  }
}
