:root {
  --bg: #f4f7fa;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --line: #dce5ed;
  --text: #172435;
  --muted: #68798a;
  --blue: #0876c2;
  --blue-dark: #075486;
  --green: #08866a;
  --red: #c93c43;
  --amber: #b96d08;
  --sidebar: #ffffff;
  --sidebar-soft: #edf6fc;
  --shadow: 0 8px 24px rgba(30, 55, 78, .065);
}

/* XS Radius Online tenant navigation and onboarding */
.sidebar-nav-group {
  margin: 3px 0;
  border-radius: 12px;
}

.sidebar-nav-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  color: #38536a;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.sidebar-nav-group > summary::-webkit-details-marker { display: none; }
.sidebar-nav-group > summary::after { content: "‹"; opacity: .7; font-size: 1.35rem; line-height: 1; }
.sidebar-nav-group[open] > summary::after { content: "⌄"; }
.sidebar-nav-group[open] { background: #f7fafc; }
.sidebar-nav-group > div { display: grid; gap: 2px; padding: 0 7px 7px; }
.sidebar-nav-group > div > a { padding: 9px 13px; font-size: .92rem; }
.owner-nav-link { border: 1px solid rgba(56, 189, 248, .25); background: rgba(14, 165, 233, .1); }
.tenant-context small b { color: #0876c2; }

.online-customer-form { max-width: 1120px; }
.online-form-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid #dbe6f0;
  border-radius: 16px;
  background: #f8fbfe;
}
.online-form-progress span { display: flex; align-items: center; gap: 9px; padding: 9px 12px; color: #496074; font-weight: 750; }
.online-form-progress b { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #0891b2, #2563eb); }
.realm-input-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; border: 1px solid #cedbe6; border-radius: 10px; overflow: hidden; background: #fff; }
.realm-input-wrap > span { padding: 0 14px; color: #1686a4; font-size: 1.1rem; font-weight: 900; }
.realm-input-wrap input { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.login-credentials-grid .full-field { grid-column: 1 / -1; }
.core-service-strip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 14px; padding: 14px; border: 1px solid #b8e6d8; border-radius: 14px; background: #effbf7; }
.core-service-strip > div { display: grid; gap: 3px; }
.core-service-strip small { color: #587066; }
.tenant-realm { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 7px 10px; border-radius: 9px; color: #0e7490; background: #ecfeff; }
.tenant-realm span { font-size: .75rem; color: #64748b; }
.tenant-login-name { font-size: .78rem; overflow-wrap: anywhere; }

.tunnel-hub-banner { margin-bottom: 18px; }
.tunnel-router-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tunnel-router-card header h2 { margin: 10px 0 3px; }
.tunnel-router-card dl { display: grid; gap: 0; margin: 14px 0; }
.tunnel-router-card dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #e8eef4; }
.tunnel-router-card dd { margin: 0; overflow-wrap: anywhere; }

.import-security-banner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-bottom: 18px; padding: 16px 18px; border: 1px solid #bce7dc; border-radius: 16px; background: linear-gradient(135deg, #effcf8, #f6fbff); }
.import-security-banner > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; background: #0f9f83; font-size: 1.3rem; }
.import-security-banner p { margin: 4px 0 0; color: #526778; }
.import-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 18px; margin-bottom: 18px; }
.import-upload-card { display: grid; gap: 16px; margin: 0; }
.file-drop-field { padding: 18px; border: 1px dashed #8ab8ca; border-radius: 14px; background: #f5fbfd; }
.file-drop-field input { padding: 10px; background: #fff; }
.import-guide-card { margin: 0; }
.import-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: import-step; }
.import-steps li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; counter-increment: import-step; }
.import-steps li::before { content: counter(import-step); grid-row: 1 / 3; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: #1686a4; font-weight: 800; }
.import-steps span { color: #627587; font-size: .88rem; }

@media (max-width: 1000px) {
  .tunnel-router-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .online-form-progress { grid-template-columns: 1fr; }
  .online-form-progress span { padding: 6px 8px; }
  .import-layout, .tunnel-router-grid { grid-template-columns: 1fr; }
  .import-security-banner { grid-template-columns: auto minmax(0, 1fr); }
  .import-security-banner > b { grid-column: 2; justify-self: start; }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 10;
  gap: 10px;
  padding: 14px 15px;
  background: var(--sidebar);
  border-left: 1px solid var(--line);
  color: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 70px;
  padding: 4px 4px 14px;
  border-bottom: 1px solid #edf1f5;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #0a7dc2;
  border: 1px solid #55acd8;
  border-radius: 8px;
  color: #fff;
  font-weight: 950;
}

.brand-mark.large {
  width: 68px;
  height: 68px;
  font-size: 1.3rem;
}

.brand-logo {
  width: 68px;
  height: 54px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: #163651;
  font-size: 1.02rem;
}

.brand small {
  margin-top: 5px;
  color: #718293;
  font-size: .72rem;
}

.main-nav {
  display: grid;
  gap: 5px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  padding-left: 3px;
}

.main-nav::-webkit-scrollbar { width: 0; height: 0; }

.tenant-context {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid #cfe3f1;
  border-radius: 8px;
  background: #f3f9fd;
}

.tenant-context span,
.tenant-context small {
  color: var(--muted);
  font-size: .7rem;
}

.tenant-context strong {
  color: #123c5b;
  font-size: .88rem;
}

.tenant-context a {
  margin-top: 5px;
  color: var(--blue-dark);
  font-size: .74rem;
  font-weight: 900;
  text-decoration: none;
}

.main-nav a {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #536779;
  font-size: .91rem;
  font-weight: 800;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--sidebar-soft);
  border-color: #d2e7f4;
  color: var(--blue-dark);
}

.main-nav a.active {
  padding-right: 18px;
  font-weight: 950;
}

.main-nav a.active::before {
  position: absolute;
  top: 11px;
  right: 5px;
  bottom: 11px;
  width: 3px;
  border-radius: 3px;
  background: var(--blue);
  content: "";
}

.sidebar-user {
  margin-top: auto;
  padding: 14px;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sidebar-user strong,
.sidebar-user span {
  display: block;
}

.sidebar-user a {
  color: inherit;
  text-decoration: none;
}

.sidebar-user a:hover {
  color: var(--blue-dark);
}

.sidebar-user strong {
  color: #193851;
  font-size: .9rem;
}

.sidebar-user span {
  margin-top: 5px;
  color: #748696;
  font-size: .78rem;
}

.sidebar-user form {
  margin-top: 12px;
}

.sidebar-user button {
  width: 100%;
  min-height: 36px;
  border: 1px solid #cddae4;
  border-radius: 6px;
  background: #fff;
  color: #36536b;
  cursor: pointer;
  font-weight: 800;
}

.main-content {
  min-width: 0;
  padding: 0 30px 34px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 86px;
  margin: 0 -30px 24px;
  padding: 16px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
}

.topbar-primary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 22px;
}

.topbar-title { min-width: 0; }

.topbar-tenant {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-right: 1px solid var(--line);
}

.topbar-tenant-label {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e9f5fb;
  color: #12749a;
  font-size: .68rem;
  font-weight: 900;
}

.topbar-tenant-value {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.topbar-tenant-value strong,
.topbar-tenant-value small { display: block; }
.topbar-tenant-value strong { overflow: hidden; color: #163b57; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.topbar-tenant-value small { color: var(--muted); direction: ltr; font-size: .7rem; text-align: right; }
.topbar-tenant a { margin-inline-start: 4px; color: var(--blue-dark); font-size: .72rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.topbar-action { flex: 0 0 auto; }

.topbar h1 {
  margin: 0;
  color: #173650;
  font-size: 1.45rem;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.refresh-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbfd;
  color: var(--blue-dark);
  font-size: .88rem;
  font-weight: 900;
  text-decoration: none;
}

.topbar-actions,
.result-actions,
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  padding: 11px 13px;
  border: 1px solid #d6e3ee;
  border-radius: 7px;
  background: #edf6fc;
  color: #15527b;
  font-weight: 800;
  line-height: 1.6;
}

.message.error {
  border-color: #efbbbb;
  background: #fff1f1;
  color: #9f2828;
}

.message.success {
  border-color: #a8d9c9;
  background: #ecf9f4;
  color: #076c52;
}

.tenant-summary-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid #bcded3;
  border-radius: 10px;
  background: linear-gradient(135deg, #effaf6, #f8fcff);
}

.tenant-summary-banner div {
  display: grid;
  gap: 6px;
}

.tenant-summary-banner strong {
  color: #0c5b49;
  font-size: 1rem;
}

.tenant-summary-banner span {
  color: var(--muted);
  font-size: .84rem;
}

.tenant-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tenant-card {
  border-top: 3px solid #b8c7d3;
}

.tenant-card.tenant-current {
  border-color: #61b99f;
  box-shadow: 0 10px 28px rgba(8, 134, 106, .10);
}

.tenant-card .state + .state {
  margin-inline-start: 5px;
}

.tenant-card dl {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-choice-grid,
.service-module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.service-choice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.service-choice.service-core {
  border-color: #9fcfe9;
  background: #f2f9fd;
}

.service-choice span,
.service-choice small {
  display: block;
}

.service-choice strong {
  color: #173b56;
}

.service-choice small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.55;
}

.service-module {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 3px solid #aebdca;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.service-module.module-enabled {
  border-top-color: var(--blue);
}

.service-module.module-disabled {
  background: #f7f9fb;
  opacity: .78;
}

.service-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.service-initial {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #e5f3fb;
  color: var(--blue-dark);
  font-weight: 950;
}

.service-module h2 {
  margin: 20px 0 8px;
  color: #173a54;
}

.service-module p {
  flex: 1;
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.disabled-button {
  cursor: default;
  opacity: .75;
}

.tenant-code {
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .75);
}

.empty-inline {
  padding: 15px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.metric {
  min-width: 0;
  padding: 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric.success {
  border-top-color: var(--green);
}

.metric.live {
  border-top-color: #d34646;
}

.metric.amber {
  border-top-color: var(--amber);
}

.metric span,
.metric small,
.metric strong {
  display: block;
}

.metric span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}

.metric strong {
  margin-top: 9px;
  color: #0d3352;
  font-size: 1.65rem;
  line-height: 1;
}

.metric small {
  margin-top: 9px;
  color: #8090a0;
  font-size: .75rem;
}

.section-band {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e8eef3;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.1rem;
}

.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .84rem;
}

.source-list {
  display: grid;
}

.source-row {
  display: grid;
  grid-template-columns: minmax(185px, 1.4fr) repeat(4, minmax(90px, .7fr)) auto;
  gap: 14px;
  align-items: center;
  min-height: 82px;
  padding: 13px 2px;
  border-bottom: 1px solid #e8eef3;
}

.source-row:last-child {
  border-bottom: 0;
}

.source-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.source-identity strong,
.source-identity small {
  display: block;
}

.source-identity strong {
  font-size: .96rem;
}

.source-identity small {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #8391a0;
  box-shadow: 0 0 0 4px #e8edf1;
}

.status-dot.online {
  background: #12a378;
  box-shadow: 0 0 0 4px #e3f5ef;
}

.status-dot.offline {
  background: #d34242;
  box-shadow: 0 0 0 4px #fae8e8;
}

.status-dot.warning {
  background: #df8a11;
  box-shadow: 0 0 0 4px #fff1d9;
}

.source-stat span,
.source-stat strong {
  display: block;
}

.source-stat span {
  color: var(--muted);
  font-size: .74rem;
}

.source-stat strong {
  margin-top: 5px;
  color: #1a344c;
  font-size: .94rem;
}

.source-links {
  display: flex;
  gap: 6px;
}

.source-links a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid #bed8e9;
  border-radius: 6px;
  background: #f0f8fd;
  color: #07598e;
  font-size: .78rem;
  font-weight: 900;
  text-decoration: none;
}

.filters {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(280px, 1.5fr) minmax(160px, .7fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.filters.accounts-filter {
  grid-template-columns: minmax(170px, .75fr) minmax(260px, 1.4fr) minmax(140px, .6fr) minmax(110px, .45fr) auto;
}

.filters.sessions-filter {
  grid-template-columns: minmax(180px, .8fr) minmax(300px, 1.5fr) minmax(110px, .45fr) auto;
}

.filters.compact-filters {
  grid-template-columns: minmax(220px, 420px) auto;
  justify-content: start;
}

.filters.audit-filters {
  grid-template-columns: minmax(220px, 1.5fr) minmax(130px, .55fr) minmax(140px, .6fr) minmax(140px, .6fr) minmax(110px, .45fr) auto;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: #33495f;
  font-size: .81rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid #c9d5df;
  border-radius: 7px;
  outline: 0;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(8, 117, 189, .12);
}

input:disabled {
  background: #eef3f7;
  color: #6c7d8c;
  cursor: not-allowed;
}

textarea {
  resize: vertical;
  line-height: 1.7;
}

.button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}

.button.primary {
  background: var(--blue);
  color: #fff;
}

.button.secondary {
  border-color: #cbd8e3;
  background: #edf3f8;
  color: #1a4769;
}

.button.danger {
  border-color: #efbaba;
  background: #fff1f1;
  color: #a62525;
}

.wide-button {
  width: 100%;
}

.button.compact {
  min-height: 34px;
  padding: 6px 10px;
  font-size: .76rem;
}

.result-toolbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 8px 2px;
}

.result-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  color: var(--muted);
}

.result-summary strong {
  color: var(--blue-dark);
  font-size: 1.15rem;
}

.table-link,
.plain-link {
  color: var(--blue-dark);
  font-weight: 900;
  text-decoration: none;
}

.table-link:hover,
.plain-link:hover {
  text-decoration: underline;
}

.account-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-right: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.account-identity h2 {
  margin: 5px 0 4px;
  font-size: 1.25rem;
}

.eyebrow {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.detail-metrics article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-metrics span,
.detail-metrics strong,
.detail-metrics small {
  display: block;
}

.detail-metrics span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
}

.detail-metrics strong {
  margin-top: 8px;
  color: #123d5e;
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

.detail-metrics .metric-date {
  direction: ltr;
  font-size: .92rem;
  text-align: right;
}

.detail-metrics small {
  margin-top: 7px;
  color: #7b8c9b;
  font-size: .73rem;
}

.detail-section {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
}

.detail-list > div {
  min-width: 0;
  padding: 14px 12px;
  border-bottom: 1px solid #e8eef3;
}

.detail-list > div:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.detail-list .detail-wide {
  grid-column: 1 / -1;
}

.detail-list dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 900;
}

.detail-list dd {
  margin: 0;
  color: #173750;
  font-size: .88rem;
  font-weight: 800;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.detail-table {
  margin-top: 14px;
  box-shadow: none;
}

.audit-summary {
  min-height: 44px;
  padding: 0 4px;
}

.table-shell {
  max-width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid #e7edf2;
  text-align: right;
  font-size: .85rem;
  line-height: 1.6;
}

th {
  background: #f5f8fb;
  color: #31516c;
  font-size: .77rem;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fbfdff;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 190px;
}

.inline-form {
  margin: 0;
}

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

.management-form {
  display: grid;
  gap: 14px;
  width: min(1180px, 100%);
}

.three-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.full-field {
  display: block;
  margin-top: 14px;
}

.toggle-field,
.check-choice,
.permission-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #d3dee7;
  border-radius: 7px;
  background: #f8fbfd;
  color: #183c58;
  font-weight: 800;
  cursor: pointer;
}

.toggle-field input,
.check-choice input,
.permission-choice input {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

.wide-toggle {
  margin: 14px 0;
}

.relation-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.relation-columns fieldset {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid #d5e0e8;
  border-radius: 8px;
}

.relation-columns legend {
  padding: 0 8px;
  color: #123e5d;
  font-weight: 900;
}

.choice-grid,
.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 310px;
  overflow: auto;
  padding: 2px;
}

.permission-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: none;
  margin-top: 14px;
}

.check-choice {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-content: center;
  min-height: 54px;
  font-size: .82rem;
}

.check-choice small {
  grid-column: 2;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.source-choice-grid {
  max-height: none;
}

.icon-action {
  min-width: 64px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border: 1px solid #bfd4e3;
  border-radius: 6px;
  background: #edf6fc;
  color: #075f98;
  font: inherit;
  font-size: .76rem;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.icon-action.danger {
  border-color: #f1c8c8;
  background: #fff1f1;
  color: #b42323;
}

.row-actions form {
  margin: 0;
}

.speed-pair {
  display: block;
  white-space: nowrap;
  color: #165b88;
  font-size: .78rem;
  font-weight: 800;
}

.management-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.management-card {
  display: grid;
  gap: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.management-card h2 {
  margin: 10px 0 5px;
  font-size: 1rem;
}

.management-card p {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
}

.management-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 10px 0;
  border-block: 1px solid #e8eef3;
}

.management-card dl div {
  padding: 0 10px;
}

.management-card dt {
  color: var(--muted);
  font-size: .72rem;
}

.management-card dd {
  margin: 4px 0 0;
  color: #123e5d;
  font-size: 1.15rem;
  font-weight: 900;
}

.form-section {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.narrow-form {
  width: min(900px, 100%);
}

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

.span-two {
  grid-column: 1 / -1;
}

.check-field {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 9px;
  align-self: end;
  padding: 8px 11px;
  border: 1px solid #c9d5df;
  border-radius: 7px;
  background: var(--surface-soft);
}

.check-field input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.check-field span {
  margin: 0;
}

.form-actions {
  display: flex;
  gap: 9px;
  padding: 4px 0 10px;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.6;
}

.mono {
  direction: ltr;
  display: inline-block;
  font-family: Consolas, "Courier New", monospace;
  font-size: .83rem;
  white-space: nowrap;
}

.state {
  min-width: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 900;
}

.source-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border: 1px solid #b9d8eb;
  border-radius: 6px;
  background: #eef8fd;
  color: #075f96;
  font-size: .73rem;
  font-weight: 900;
  white-space: nowrap;
}

.state.online,
.state.enabled {
  background: #e7f7f1;
  color: #087259;
}

.state.online::before {
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: #0ca174;
  content: "";
}

.state.disabled {
  background: #fff0f0;
  color: #ae3030;
}

.empty-cell,
.empty-state {
  padding: 30px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 17px;
}

.pager a,
.pager span,
.pager strong {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: #26445e;
  font-size: .82rem;
  text-decoration: none;
}

.pager .disabled {
  opacity: .45;
}

.user-create {
  margin-bottom: 16px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 190px)) minmax(260px, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.summary-strip div {
  min-height: 54px;
  padding-left: 14px;
  border-left: 1px solid #e2eaf0;
}

.summary-strip strong,
.summary-strip span {
  display: block;
}

.summary-strip strong {
  color: var(--blue-dark);
  font-size: 1.25rem;
}

.summary-strip span,
.summary-strip p {
  color: var(--muted);
  font-size: .8rem;
}

.summary-strip span {
  margin-top: 4px;
}

.summary-strip p {
  margin: 0;
  line-height: 1.8;
}

.detail-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.detail-strip > div {
  min-width: 0;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px;
  border-left: 1px solid var(--line);
}

.detail-strip > div:last-child {
  border-left: 0;
}

.detail-strip span,
.detail-strip strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-strip span {
  color: var(--muted);
  font-size: .76rem;
}

.detail-strip strong {
  color: #173d5c;
  font-size: .96rem;
  line-height: 1.55;
}

.secret-value {
  direction: ltr;
  unicode-bidi: plaintext;
  overflow-wrap: anywhere;
}

.current-badge {
  display: inline-flex;
  margin-right: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e8f4fb;
  color: var(--blue-dark);
  font-size: .68rem;
}

.audit-details {
  overflow-wrap: anywhere;
  color: #43596d;
  font-size: .8rem;
}

.user-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.muted {
  color: var(--muted);
  font-size: .8rem;
}

.mobile-nav {
  display: none;
}

.error-page {
  display: grid;
  place-items: center;
  padding: 20px;
  background: #eaf1f7;
}

.error-panel {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(25, 54, 80, .13);
  text-align: center;
}

.error-logo {
  width: 150px;
  height: 86px;
  object-fit: contain;
}

.error-code {
  display: block;
  margin-top: 12px;
  color: var(--blue);
  font-size: 2rem;
  font-weight: 950;
}

.error-panel h1 {
  margin: 6px 0 0;
  font-size: 1.4rem;
}

.error-panel p {
  margin: 10px 0 22px;
  color: var(--muted);
  line-height: 1.8;
}

.login-page {
  background: #eaf1f7;
}

.login-layout {
  width: min(960px, calc(100% - 32px));
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: 28px;
  margin: 0 auto;
  padding: 30px 0;
}

.login-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  padding: 30px;
  text-align: center;
}

.login-logo {
  width: min(230px, 80%);
  height: auto;
  display: block;
}

.login-brand > div {
  min-width: 0;
}

.login-brand h1 {
  margin: 0;
  color: #102d46;
  font-size: 2rem;
}

.login-brand p {
  max-width: 480px;
  margin: 12px 0 0;
  color: #5c7184;
  line-height: 1.9;
}

.login-panel {
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(25, 54, 80, .13);
}

.login-heading span {
  color: var(--blue);
  font-size: .8rem;
  font-weight: 900;
}

.login-heading h2 {
  margin: 7px 0;
  font-size: 1.35rem;
}

.login-heading p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: .86rem;
}

.form-stack {
  display: grid;
  gap: 13px;
}

[hidden] {
  display: none !important;
}

.nav-section-label {
  margin: 13px 12px 4px;
  color: #6f899f;
  font-size: .68rem;
  font-weight: 900;
}

.dashboard-status-strip {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-right: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
}

.dashboard-status-main,
.dashboard-status-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-status-main strong,
.dashboard-status-main small {
  display: block;
}

.dashboard-status-main strong {
  font-size: .9rem;
}

.dashboard-status-main small {
  margin-top: 5px;
  color: var(--muted);
  font-size: .74rem;
}

.dashboard-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-link {
  color: inherit;
  text-decoration: none;
}

.metric-link:hover {
  border-color: #b7cfdf;
  box-shadow: 0 13px 30px rgba(33, 58, 82, .12);
  transform: translateY(-1px);
}

.metric {
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.metric.primary {
  border-top-color: var(--blue);
}

.metric.danger {
  border-top-color: var(--red);
}

.metric.warning {
  border-top-color: var(--amber);
}

.metric.neutral {
  border-top-color: #758493;
}

.metric.cyan {
  border-top-color: #0c9baa;
}

.metric.violet {
  border-top-color: #7459b8;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 340px);
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-layout .section-band,
.profile-usage-panel {
  box-shadow: none;
}

.source-health-panel .source-row {
  grid-template-columns: minmax(160px, 1.2fr) minmax(170px, 1fr) repeat(3, minmax(58px, .45fr));
}

.source-health-panel .source-links {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.source-progress {
  min-width: 0;
}

.source-progress > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.source-progress span {
  color: var(--muted);
  font-size: .72rem;
}

.source-progress strong {
  color: #173b57;
  font-size: .88rem;
}

.source-progress strong small {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
}

.progress-track,
.profile-bar-track {
  height: 7px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef3;
}

.progress-track {
  margin-top: 8px;
}

.progress-track > span,
.profile-bar-track > span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--blue);
}

.attention-list {
  display: grid;
  gap: 8px;
  padding-top: 14px;
}

.attention-item {
  min-height: 48px;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid #e2e8ee;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
}

.attention-item:hover {
  background: #f8fafc;
}

.attention-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7b8b99;
}

.attention-item.warning .attention-indicator {
  background: var(--amber);
}

.attention-item.danger .attention-indicator {
  background: var(--red);
}

.attention-item strong {
  font-size: .8rem;
}

.attention-item b {
  color: #173d5a;
  font-size: .94rem;
}

.all-clear-state {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  align-items: center;
  padding: 18px 6px;
}

.all-clear-state small {
  grid-column: 2;
  color: var(--muted);
  font-size: .76rem;
}

.profile-usage-panel {
  margin-top: 0;
}

.profile-bars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
  padding-top: 16px;
}

.profile-bar-row {
  display: grid;
  grid-template-columns: minmax(130px, .8fr) minmax(120px, 1.4fr) 42px;
  gap: 12px;
  align-items: center;
}

.profile-bar-label {
  min-width: 0;
}

.profile-bar-label strong,
.profile-bar-label small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-bar-label strong {
  font-size: .79rem;
}

.profile-bar-label small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .68rem;
}

.profile-bar-track > span {
  background: linear-gradient(90deg, #0875bd, #17a08a);
}

.profile-bar-row > b {
  color: #173d5a;
  font-size: .84rem;
  text-align: left;
}

.detail-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.accounts-list-panel {
  margin-bottom: 10px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.accounts-list-toolbar,
.accounts-toolbar-primary,
.accounts-toolbar-secondary,
.accounts-page-size {
  display: flex;
  align-items: center;
}

.accounts-list-toolbar {
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.accounts-toolbar-primary,
.accounts-toolbar-secondary {
  flex-wrap: wrap;
  gap: 7px;
}

.accounts-list-toolbar .button {
  min-height: 38px;
  white-space: nowrap;
}

.accounts-add-button {
  padding-inline: 16px;
}

.accounts-page-size {
  min-height: 38px;
  gap: 7px;
  padding: 3px 9px;
  border: 1px solid #cbd8e3;
  border-radius: 7px;
  color: #476276;
  background: #f7fafc;
  font-size: .74rem;
  font-weight: 800;
  white-space: nowrap;
}

.accounts-page-size span {
  margin: 0;
}

.accounts-page-size select {
  width: 68px;
  min-height: 28px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: .74rem;
}

.accounts-filter-strip {
  display: grid;
  grid-template-columns: minmax(250px, 1.5fr) repeat(3, minmax(140px, .72fr)) minmax(145px, .6fr);
  gap: 9px;
  align-items: end;
  padding: 13px 14px;
  border-top: 1px solid #e2ebf1;
  border-bottom: 1px solid #e2ebf1;
  background: #f8fbfd;
}

.accounts-filter-strip > label {
  display: grid;
  gap: 6px;
}

.accounts-filter-strip > label > span {
  margin: 0;
  color: #526b7d;
  font-size: .72rem;
  font-weight: 900;
}

.accounts-filter-strip input,
.accounts-filter-strip select {
  min-height: 40px;
  border-color: #c6d6e1;
  border-radius: 7px;
  background: #fff;
  font-size: .8rem;
}

.accounts-live-search input {
  padding-inline: 13px;
}

.accounts-filter-strip input:focus,
.accounts-filter-strip select:focus {
  border-color: #1687bd;
  box-shadow: 0 0 0 3px rgba(22, 135, 189, .1);
}

.accounts-date-filter {
  position: relative;
}

.accounts-date-filter > summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid #c6d6e1;
  border-radius: 7px;
  color: #476276;
  background: #fff;
  font-size: .78rem;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.accounts-date-filter > summary::-webkit-details-marker {
  display: none;
}

.accounts-date-filter > summary::after {
  content: "⌄";
  color: #1687bd;
  font-size: 1rem;
}

.accounts-date-filter[open] > summary::after {
  transform: rotate(180deg);
}

.accounts-date-filter > summary small {
  padding: 2px 7px;
  border-radius: 999px;
  color: #087b69;
  background: #e4f6f0;
  font-size: .62rem;
}

.accounts-date-filter > div {
  position: absolute;
  z-index: 8;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  width: min(430px, 82vw);
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 9px;
  padding: 12px;
  border: 1px solid #cbdbe6;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(17, 55, 78, .16);
}

.accounts-date-filter > div label {
  display: grid;
  gap: 5px;
}

.accounts-date-filter > div label span {
  margin: 0;
  color: #5f7585;
  font-size: .7rem;
  font-weight: 800;
}

.accounts-date-filter > div .button {
  grid-column: 1 / -1;
}

.accounts-list-panel > .result-summary {
  min-height: 42px;
  padding: 9px 14px;
}

@media (max-width: 1180px) {
  .accounts-list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .accounts-filter-strip {
    grid-template-columns: minmax(240px, 1.4fr) repeat(2, minmax(140px, .7fr));
  }
}

@media (max-width: 720px) {
  .accounts-list-toolbar,
  .accounts-filter-strip {
    padding: 11px;
  }

  .accounts-toolbar-primary,
  .accounts-toolbar-secondary,
  .accounts-filter-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .accounts-live-search,
  .accounts-date-filter,
  .auto-refresh-control {
    grid-column: 1 / -1;
  }
}

@media (max-width: 440px) {
  .accounts-toolbar-primary,
  .accounts-toolbar-secondary,
  .accounts-filter-strip {
    grid-template-columns: 1fr;
  }

  .accounts-toolbar-primary .button,
  .accounts-toolbar-secondary .button,
  .accounts-page-size,
  .accounts-live-search,
  .accounts-date-filter,
  .auto-refresh-control {
    width: 100%;
    grid-column: 1;
  }

  .accounts-date-filter > div {
    position: static;
    width: 100%;
    grid-template-columns: 1fr;
    margin-top: 7px;
    box-shadow: none;
  }

  .accounts-date-filter > div .button {
    grid-column: 1;
  }
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.accounts-command-bar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.account-table-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.auto-refresh-control {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 7px;
  border: 1px solid #cbd8e3;
  border-radius: 7px;
  background: #f7fafc;
}

.auto-refresh-control label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.auto-refresh-control label span {
  margin: 0;
  font-size: .74rem;
}

.auto-refresh-control input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.auto-refresh-control select {
  width: auto;
  min-height: 27px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: .7rem;
}

.auto-refresh-control small {
  min-width: 62px;
  color: var(--muted);
  font-size: .67rem;
}

.accounts-table {
  min-width: 1480px;
}

.accounts-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.accounts-table .is-column-hidden {
  display: none;
}

.account-row-alert td {
  background: #fffafa;
}

.account-name-link {
  min-width: 170px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}

.account-name-link:hover strong {
  color: var(--blue-dark);
  text-decoration: underline;
}

.account-name-link > span:last-child,
.account-name-link strong,
.account-name-link small {
  min-width: 0;
  display: block;
}

.account-name-link strong {
  font-size: .84rem;
}

.account-name-link small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .69rem;
}

.account-avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid #b9d8eb;
  border-radius: 50%;
  background: #eaf6fd;
  color: var(--blue-dark);
  font-size: .82rem;
  font-weight: 950;
}

.table-subtext,
.table-warning,
.speed-pair span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .68rem;
  white-space: nowrap;
}

.table-warning {
  color: var(--amber);
  font-weight: 900;
}

.speed-pair span:first-child {
  margin-top: 0;
  color: #1a4d72;
}

.account-row-actions {
  min-width: 230px;
}

.state.expired {
  background: #fff0f0;
  color: #ae3030;
}

.state.warning {
  background: #fff4df;
  color: #9a5a00;
}

.columns-dialog {
  width: min(720px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  border: 1px solid #cbd8e3;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 26px 70px rgba(15, 35, 52, .24);
}

.columns-dialog::backdrop {
  background: rgba(13, 28, 41, .55);
}

.columns-dialog header,
.columns-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
}

.columns-dialog header {
  border-bottom: 1px solid var(--line);
}

.columns-dialog footer {
  border-top: 1px solid var(--line);
}

.columns-dialog header strong,
.columns-dialog header small {
  display: block;
}

.columns-dialog header strong {
  font-size: 1rem;
}

.columns-dialog header small {
  margin-top: 5px;
  color: var(--muted);
  font-size: .76rem;
}

.dialog-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #eef3f7;
  color: #345169;
  cursor: pointer;
  font-size: 1.35rem;
}

.column-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 18px;
}

.column-options label {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid #d7e1e9;
  border-radius: 7px;
  background: #f9fbfd;
  cursor: pointer;
}

.column-options label:has(input:checked) {
  border-color: #79b8dc;
  background: #eef8fd;
}

.column-options input {
  width: 17px;
  min-height: 17px;
  margin: 0;
}

.column-options span {
  margin: 0;
  font-size: .78rem;
}

.nav-section-label {
  color: #8a98a6;
}

.button,
.refresh-link {
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.button:hover,
.refresh-link:hover {
  transform: translateY(-1px);
}

.button.primary:hover {
  background: #0667aa;
  box-shadow: 0 7px 16px rgba(8, 118, 194, .18);
}

.button.secondary:hover,
.refresh-link:hover {
  border-color: #a9c8dc;
  background: #f3f8fb;
}

.button.danger:hover {
  border-color: #e99c9f;
  background: #ffe8e8;
}

.subscriber-layout {
  direction: ltr;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  grid-template-areas: "workspace profile";
  gap: 18px;
  align-items: start;
}

.subscriber-profile-panel,
.subscriber-workspace {
  direction: rtl;
  min-width: 0;
}

.subscriber-profile-panel {
  grid-area: profile;
  position: sticky;
  top: 108px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.subscriber-profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.subscriber-avatar {
  width: 76px;
  height: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #add2e9;
  border-radius: 50%;
  background: #eaf6fd;
  color: var(--blue-dark);
  font-size: 1.45rem;
  font-weight: 950;
}

.subscriber-profile-name {
  margin-top: 18px;
}

.subscriber-profile-name > span {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
}

.subscriber-profile-name h2 {
  margin: 7px 0 5px;
  color: #142f46;
  font-size: 1.32rem;
  line-height: 1.45;
}

.subscriber-profile-name b {
  color: #527087;
  font-weight: 800;
}

.subscriber-glance {
  margin: 20px 0 0;
  border-top: 1px solid #e9eef3;
}

.subscriber-glance > div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid #edf1f5;
}

.subscriber-glance dt,
.subscriber-glance dd {
  margin: 0;
}

.subscriber-glance dt {
  color: var(--muted);
  font-size: .73rem;
  font-weight: 800;
}

.subscriber-glance dd {
  color: #173b56;
  font-size: .82rem;
  font-weight: 850;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.subscriber-glance dd small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .68rem;
}

.subscriber-actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.subscriber-actions form,
.subscriber-actions .button {
  width: 100%;
}

.account-tabs {
  position: sticky;
  top: 86px;
  z-index: 6;
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 6px 18px rgba(30, 55, 78, .055);
}

.subscriber-workspace {
  grid-area: workspace;
}

.account-tab {
  position: relative;
  min-width: 112px;
  min-height: 43px;
  padding: 9px 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5e7182;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 900;
  white-space: nowrap;
}

.account-tab:hover {
  background: #f4f8fb;
  color: #244b68;
}

.account-tab.is-active {
  background: #eaf6fd;
  color: var(--blue-dark);
}

.account-tab.is-active::after {
  position: absolute;
  right: 20px;
  bottom: 3px;
  left: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
  content: "";
}

.account-tab:focus-visible {
  outline: 3px solid rgba(8, 118, 194, .2);
  outline-offset: 1px;
}

.account-tab-panel {
  display: grid;
  gap: 14px;
}

.workspace-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e9eef3;
}

.panel-kicker {
  display: block;
  color: var(--blue-dark);
  font-size: .72rem;
  font-weight: 900;
}

.account-panel-heading h2 {
  margin: 5px 0 0;
  color: #17334a;
  font-size: 1.08rem;
}

.subscription-state,
.panel-count {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 900;
  white-space: nowrap;
}

.subscription-state.success {
  background: #e5f6f0;
  color: #087258;
}

.subscription-state.warning {
  background: #fff3dd;
  color: #965800;
}

.subscription-state.danger {
  background: #ffeded;
  color: #ad3035;
}

.subscription-state.neutral,
.panel-count {
  background: #edf2f6;
  color: #576b7c;
}

.subscription-summary {
  display: grid;
  grid-template-columns: 1.3fr repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid #dce5ed;
  border-radius: 8px;
  background: #dce5ed;
}

.subscription-summary > div {
  min-width: 0;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 17px;
  background: #fff;
}

.subscription-summary .subscription-highlight {
  background: #f0f8fd;
}

.subscription-summary span,
.subscription-summary strong,
.subscription-summary small {
  display: block;
}

.subscription-summary span {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
}

.subscription-summary strong {
  margin-top: 8px;
  color: #123d5c;
  font-size: 1.38rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.subscription-summary .subscription-highlight strong {
  color: var(--blue-dark);
  font-size: 1.68rem;
  white-space: nowrap;
}

.subscription-summary small {
  margin-top: 7px;
  color: #7b8996;
  font-size: .69rem;
}

.subscription-dates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 15px;
}

.subscription-dates div {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  text-align: right;
}

.subscription-dates span,
.subscription-dates b {
  display: block;
}

.subscription-dates span {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
}

.subscription-dates b {
  width: 100%;
  margin-top: 0;
  color: #294861;
  direction: ltr;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.45;
  text-align: right;
  unicode-bidi: isolate;
}

.account-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.account-kpis article {
  min-width: 0;
  min-height: 116px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-kpis span,
.account-kpis strong,
.account-kpis small {
  display: block;
}

.account-kpis span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
}

.account-kpis strong {
  margin-top: 10px;
  color: #173d5a;
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}

.account-kpis small {
  margin-top: 7px;
  color: #81909e;
  font-size: .68rem;
}

.connection-summary,
.modern-detail-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.connection-summary {
  margin-top: 4px;
}

.connection-summary > div,
.modern-detail-list > div {
  min-width: 0;
  padding: 15px 13px;
  border-bottom: 1px solid #e9eef3;
}

.connection-summary dt,
.modern-detail-list dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 850;
}

.connection-summary dd,
.modern-detail-list dd {
  margin: 0;
  color: #183b55;
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.modern-detail-list .detail-wide {
  grid-column: 1 / -1;
}

.operation-security {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid #d9e6ee;
  border-radius: 999px;
  background: #f7fafc;
  color: #5b7182;
  font-size: .68rem;
  font-weight: 850;
  white-space: nowrap;
}

.subscription-operation-list {
  margin-top: 4px;
}

.subscription-operation {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 170px) auto;
  gap: 14px;
  align-items: end;
  padding: 18px 0;
  border-bottom: 1px solid #e9eef3;
}

.subscription-operation:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.subscription-operation > div:first-child {
  align-self: center;
}

.subscription-operation strong,
.subscription-operation small {
  display: block;
}

.subscription-operation strong {
  color: #183b55;
  font-size: .86rem;
}

.subscription-operation small {
  max-width: 560px;
  margin-top: 5px;
  color: var(--muted);
  font-size: .69rem;
  line-height: 1.7;
}

.compact-control {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.compact-control > span {
  color: #526d80;
  font-size: .68rem;
  font-weight: 850;
}

.compact-control input,
.compact-control select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfdde7;
  border-radius: 6px;
  background: #fff;
  color: #173b56;
  font: inherit;
}

.compact-control input {
  padding: 9px 11px;
}

.compact-control select {
  padding: 7px 10px;
}

.profile-operation {
  grid-template-columns: minmax(200px, .9fr) minmax(220px, 1.1fr) auto;
}

.segmented-action {
  display: flex;
  gap: 7px;
  align-items: center;
}

.segmented-action .button {
  min-width: 106px;
}

.panel-description {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.75;
}

.workspace-empty {
  margin: 0;
  padding: 24px 2px 4px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.8;
}

.detail-table {
  margin-top: 16px;
}

.detail-table table {
  min-width: 720px;
}

.detail-table th {
  background: #f7f9fb;
}

.usage-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid #dfe7ee;
  border-radius: 8px;
  background: #dfe7ee;
}

.usage-totals > div {
  min-width: 0;
  padding: 17px;
  background: #fff;
}

.usage-totals span,
.usage-totals strong,
.usage-totals small {
  display: block;
}

.usage-totals span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
}

.usage-totals strong {
  margin-top: 8px;
  color: #163e5d;
  font-size: 1.24rem;
  overflow-wrap: anywhere;
}

.usage-totals .usage-date {
  font-size: .82rem;
}

.usage-totals small {
  margin-top: 7px;
  color: #81909e;
  font-size: .68rem;
}

.daily-usage-chart {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e9eef3;
}

.usage-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.usage-chart-header strong,
.usage-chart-header small {
  display: block;
}

.usage-chart-header strong {
  color: #183b55;
  font-size: .86rem;
}

.usage-chart-header small {
  margin-top: 4px;
  color: var(--muted);
  font-size: .68rem;
}

.usage-chart-legend {
  display: flex;
  gap: 14px;
  color: #587083;
  font-size: .68rem;
  font-weight: 800;
}

.usage-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.usage-chart-legend i {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 2px;
  background: var(--blue);
}

.usage-chart-legend i.upload {
  background: #13a07f;
}

.usage-chart-plot {
  direction: ltr;
  min-width: 600px;
  height: 220px;
  display: grid;
  grid-template-columns: repeat(30, minmax(10px, 1fr));
  gap: 4px;
  align-items: stretch;
  margin-top: 16px;
  padding: 10px 5px 0;
  overflow: hidden;
  border-right: 1px solid #e5ebf0;
  border-bottom: 1px solid #dce5ec;
  border-left: 1px solid #e5ebf0;
  background: #fbfcfd;
}

.usage-chart-day {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 22px;
  gap: 5px;
  align-items: end;
}

.usage-chart-bar {
  height: 100%;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  overflow: hidden;
  border-radius: 3px 3px 0 0;
}

.usage-chart-bar i {
  width: 100%;
  display: block;
  background: var(--blue);
}

.usage-chart-bar i.upload {
  background: #13a07f;
}

.usage-chart-day:hover .usage-chart-bar {
  background: #eef5f9;
}

.usage-chart-day small {
  min-height: 18px;
  color: #7d8e9c;
  font-size: .58rem;
  text-align: center;
  white-space: nowrap;
}

.daily-usage-chart {
  overflow-x: auto;
  scrollbar-width: thin;
}

.usage-breakdown {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e9eef3;
}

.usage-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.usage-row > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.usage-row span {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
}

.usage-row b {
  color: #24465f;
  font-size: .78rem;
}

.usage-track {
  height: 10px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eff4;
}

.usage-track > span {
  height: 100%;
  min-width: 3px;
  display: block;
  border-radius: inherit;
  background: var(--blue);
}

.usage-row.upload .usage-track > span {
  background: var(--green);
}

.usage-note {
  color: var(--muted);
  font-size: .68rem;
}

@media (max-width: 1180px) {
  .subscriber-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "profile"
      "workspace";
  }

  .subscriber-profile-panel {
    position: static;
    display: grid;
    grid-template-columns: auto minmax(170px, .7fr) minmax(360px, 1.3fr);
    gap: 18px;
    align-items: center;
  }

  .subscriber-profile-head {
    flex-direction: column;
  }

  .subscriber-profile-name,
  .subscriber-glance {
    margin-top: 0;
  }

  .subscriber-glance {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 0;
  }

  .subscriber-glance > div {
    grid-template-columns: 92px minmax(0, 1fr);
    padding: 9px 10px;
  }

  .subscriber-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0;
  }

  .account-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modern-detail-list,
  .connection-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .accounts-workspace-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .source-row {
    grid-template-columns: minmax(190px, 1.4fr) repeat(2, minmax(90px, .7fr)) auto;
  }

  .source-stat:nth-of-type(4),
  .source-stat:nth-of-type(5) {
    display: none;
  }

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

  .detail-metrics,
  .detail-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-list > div:nth-last-child(-n + 4) {
    border-bottom: 1px solid #e8eef3;
  }

  .detail-list > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 820px) {
  .detail-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-strip > div:nth-child(2) {
    border-left: 0;
  }

  .detail-strip > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .login-brand {
    flex-direction: column;
    text-align: center;
  }

  .login-logo {
    width: min(220px, 70vw);
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    display: block;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    border-left: 0;
  }

  .brand {
    justify-content: center;
  }

  .main-nav,
  .sidebar-user {
    display: none;
  }

  .main-content {
    padding: 16px 12px 84px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    min-height: 0;
    margin: -16px -12px 18px;
    padding: 15px 12px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar h1 {
    font-size: 1.3rem;
  }

  .topbar p {
    display: none;
  }

  .refresh-link {
    flex: 0 0 auto;
    padding: 8px 10px;
    font-size: .78rem;
  }

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

  .dashboard-status-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-status-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 15px 0;
  }

  .source-stat {
    display: none;
  }

  .source-links {
    display: grid;
    grid-template-columns: 1fr;
  }

  .source-health-panel .source-row {
    grid-template-columns: 1fr;
  }

  .source-health-panel .source-progress {
    display: block;
  }

  .source-health-panel .source-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-bars {
    grid-template-columns: 1fr;
  }

  .filters,
  .filters.accounts-filter,
  .filters.accounts-workspace-filter,
  .filters.sessions-filter,
  .filters.compact-filters,
  .filters.audit-filters {
    grid-template-columns: 1fr;
  }

  .filters .button {
    width: 100%;
  }

  .accounts-workspace-filter .search-field {
    grid-column: auto;
  }

  .result-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .result-toolbar .button {
    width: 100%;
  }

  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .accounts-command-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .account-table-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-table-tools .button {
    width: 100%;
  }

  .auto-refresh-control {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .account-overview {
    align-items: stretch;
    flex-direction: column;
  }

  .account-identity {
    align-items: flex-start;
    justify-content: space-between;
  }

  .account-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .account-actions .button,
  .account-actions .inline-form {
    width: 100%;
  }

  .subscriber-profile-panel {
    display: block;
    padding: 18px;
  }

  .subscriber-profile-head {
    flex-direction: row;
  }

  .subscriber-profile-name {
    margin-top: 14px;
  }

  .subscriber-glance {
    display: block;
    margin-top: 16px;
    border-top: 1px solid #e9eef3;
  }

  .subscriber-glance > div {
    padding: 11px 0;
  }

  .subscriber-actions {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 16px;
  }

  .account-tabs {
    position: static;
    margin-right: -2px;
    margin-left: -2px;
  }

  .account-tab {
    min-width: 104px;
  }

  .workspace-panel {
    padding: 15px;
  }

  .subscription-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .subscription-summary .subscription-highlight {
    grid-column: 1 / -1;
  }

  .subscription-dates {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .usage-totals {
    grid-template-columns: 1fr;
  }

  .usage-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .subscription-operation,
  .profile-operation {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .subscription-operation .button {
    width: 100%;
  }

  .segmented-action {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segmented-action .button {
    min-width: 0;
  }

  .usage-chart-header {
    align-items: flex-start;
  }

  .detail-table table,
  .detail-table tbody {
    width: 100%;
    min-width: 0;
    display: block;
  }

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

  .span-two {
    grid-column: auto;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .row-actions {
    min-width: 0;
  }

  .row-actions .button,
  .row-actions .inline-form {
    flex: 1 1 110px;
  }

  .row-actions .button {
    width: 100%;
  }

  .table-shell {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  table,
  tbody {
    min-width: 0;
    display: block;
  }

  .accounts-table,
  .accounts-table tbody {
    width: 100%;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tr {
    display: block;
    margin-bottom: 10px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  td {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    text-align: right;
  }

  td::before {
    color: #5c7184;
    content: attr(data-label);
    font-size: .75rem;
    font-weight: 900;
  }

  .empty-cell {
    display: block;
  }

  .empty-cell::before {
    display: none;
  }

  .account-name-link {
    min-width: 0;
  }

  .column-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(20, 40, 60, .1);
  }

  .mobile-nav a {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #607489;
    font-size: .74rem;
    font-weight: 900;
    text-decoration: none;
  }

  .mobile-more {
    position: relative;
    min-width: 0;
  }

  .mobile-more summary {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #607489;
    cursor: pointer;
    font-size: .74rem;
    font-weight: 900;
    list-style: none;
  }

  .mobile-more summary::-webkit-details-marker {
    display: none;
  }

  .mobile-more summary.active,
  .mobile-more[open] summary {
    background: #eaf6fd;
    color: var(--blue-dark);
  }

  .mobile-more-menu {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    width: min(270px, calc(100vw - 24px));
    display: grid;
    gap: 5px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 -14px 34px rgba(20, 40, 60, .16);
  }

  .mobile-more-menu a,
  .mobile-more-menu button {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 9px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #29465f;
    cursor: pointer;
    font-size: .82rem;
    font-weight: 900;
    text-decoration: none;
  }

  .mobile-more-menu a:hover,
  .mobile-more-menu button:hover {
    background: #eef5fa;
  }

  .mobile-more-menu form {
    margin: 0;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-strip p {
    grid-column: 1 / -1;
  }

  .mobile-nav a.active {
    background: #eaf6fd;
    color: var(--blue-dark);
  }

  .login-layout {
    width: min(500px, calc(100% - 24px));
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 20px 0;
  }

  .login-brand {
    justify-content: center;
    padding: 14px;
    text-align: center;
  }

  .login-brand p {
    display: none;
  }

  .login-brand h1 {
    font-size: 1.35rem;
  }

  .login-panel {
    padding: 20px;
  }
}

@media (max-width: 430px) {
  .detail-strip {
    grid-template-columns: 1fr;
  }

  .detail-strip > div,
  .detail-strip > div:nth-child(2) {
    min-height: 64px;
    border-bottom: 1px solid var(--line);
    border-left: 0;
  }

  .detail-strip > div:last-child {
    border-bottom: 0;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .metric {
    padding: 13px;
  }

  .metric strong {
    font-size: 1.35rem;
  }

  .section-band {
    padding: 13px;
  }

  .dashboard-status-actions,
  .filter-actions,
  .account-table-tools,
  .column-options {
    grid-template-columns: 1fr;
  }

  .profile-bar-row {
    grid-template-columns: minmax(110px, .9fr) minmax(80px, 1fr) 36px;
    gap: 8px;
  }

  .auto-refresh-control {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .auto-refresh-control small {
    grid-column: 1 / -1;
  }

  td {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 8px;
  }

  .pager {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .summary-strip {
    padding: 12px;
  }

  .detail-metrics,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .subscriber-avatar {
    width: 58px;
    height: 58px;
    font-size: 1.12rem;
  }

  .subscriber-profile-panel {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 14px;
    padding: 15px;
  }

  .subscriber-profile-head {
    grid-column: 1;
    flex-direction: column;
    align-items: center;
  }

  .subscriber-profile-name {
    grid-column: 2;
    align-self: center;
    margin-top: 0;
  }

  .subscriber-profile-name h2 {
    margin-top: 5px;
    font-size: 1.12rem;
  }

  .subscriber-glance {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
  }

  .subscriber-glance > div {
    display: block;
    padding: 10px 8px;
  }

  .subscriber-glance dt {
    margin-bottom: 6px;
  }

  .subscriber-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
  }

  .subscriber-actions > .button:first-child {
    grid-column: 1 / -1;
  }

  .subscriber-actions .button {
    min-height: 40px;
    padding: 8px;
    font-size: .76rem;
  }

  .page-account_detail .topbar {
    gap: 10px;
  }

  .page-account_detail .topbar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2px;
    padding: 4px;
    overflow: visible;
  }

  .account-tab {
    grid-column: span 2;
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    font-size: .76rem;
  }

  .usage-chart-header {
    display: grid;
  }

  .usage-chart-legend {
    justify-content: flex-start;
  }

  .account-panel-heading {
    align-items: flex-start;
  }

  .subscription-summary,
  .account-kpis,
  .modern-detail-list,
  .connection-summary {
    grid-template-columns: 1fr;
  }

  .subscription-summary .subscription-highlight {
    grid-column: auto;
  }

  .subscription-summary > div,
  .account-kpis article {
    min-height: 96px;
  }

  .topbar-actions {
    grid-template-columns: 1fr;
  }

  .detail-list > div,
  .detail-list > div:nth-last-child(-n + 2) {
    border-bottom: 1px solid #e8eef3;
  }

  .detail-list > div:last-child {
    border-bottom: 0;
  }
}

.state.unknown {
  background: #edf2f6;
  color: #617386;
}

.bulk-selection-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #c8dbe9;
  border-radius: 8px;
  background: #f7fbfe;
}

.bulk-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #25445d;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 900;
}

.bulk-select-all input,
.selection-column input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.bulk-selection-count {
  margin-right: auto;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
}

.bulk-selection-count strong {
  min-width: 24px;
  display: inline-flex;
  justify-content: center;
  color: var(--blue-dark);
  font-size: .92rem;
}

.bulk-selection-bar .button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.selection-column {
  width: 70px;
  min-width: 70px;
  text-align: center;
}

.ssr-manager-section {
  border-color: #a9d3e9;
  background: #f8fcfe;
}

.ssr-sync-note {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 12px 14px;
  border-right: 3px solid var(--blue);
  background: #edf7fc;
  color: #365a73;
  font-size: .8rem;
  line-height: 1.7;
}

.ssr-sync-note strong {
  color: var(--blue-dark);
}

.ssr-linked-sources {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 800;
}

.script-panel {
  display: grid;
  gap: 16px;
}

.script-actions {
  display: flex;
  justify-content: flex-start;
}

.code-block {
  margin: 0;
  padding: 18px;
  overflow: auto;
  max-height: 65vh;
  border: 1px solid #214665;
  border-radius: 14px;
  background: #071a2a;
  color: #d7f2ff;
  direction: ltr;
  text-align: left;
  white-space: pre;
  font: 500 .82rem/1.8 Consolas, "Courier New", monospace;
}

@media (max-width: 1000px) {
  .three-columns,
  .permission-grid,
  .management-grid,
  .service-choice-grid,
  .service-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .bulk-selection-bar {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .bulk-select-all {
    min-height: 40px;
  }

  .bulk-selection-count {
    margin-right: 0;
  }

  .bulk-selection-bar .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .management-form,
  .management-grid,
  .three-columns,
  .relation-columns,
  .permission-grid,
  .choice-grid,
  .service-choice-grid,
  .service-module-grid {
    grid-template-columns: 1fr;
  }

  .tenant-summary-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .management-form .form-section {
    padding: 14px;
  }

  .management-form .form-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .management-form .form-actions .button {
    width: 100%;
  }

  .relation-columns fieldset {
    padding: 12px;
  }

  .choice-grid {
    max-height: 280px;
  }

  .row-actions {
    min-width: 0;
  }
}
.management-access-stack {
  display: grid;
  gap: .45rem;
  min-width: 15rem;
}

.management-access-stack > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
}

/* Network editor: compact operational flow */
.network-editor-form {
  width: min(1120px, 100%);
  gap: 18px;
}

.network-form-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #cbdce8;
  border-radius: 10px;
  background: #f7fafc;
  box-shadow: 0 5px 18px rgba(13, 55, 83, .05);
}

.network-form-progress span {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-left: 1px solid #dce7ee;
  color: #6c8191;
  font-size: .78rem;
  font-weight: 900;
}

.network-form-progress span:last-child {
  border-left: 0;
}

.network-form-progress span.active {
  color: #075f98;
  background: #edf7fd;
}

.network-form-progress b {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #8196a5;
  font-size: .7rem;
}

.network-form-progress .active b {
  background: var(--blue);
}

.network-primary-section,
.network-services-section {
  overflow: hidden;
  padding: 0;
  border-radius: 11px;
}

.network-section-heading {
  padding: 18px 20px;
  background: linear-gradient(180deg, #fff, #f9fcfe);
}

.network-section-heading .section-kicker {
  display: block;
  margin-bottom: 4px;
  color: #07867c;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .04em;
}

.network-section-heading h2 {
  font-size: 1.15rem;
}

.network-main-fields {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(360px, 1.35fr);
  gap: 16px;
  padding: 19px 20px 15px;
}

.network-main-fields label {
  min-width: 0;
}

.network-main-fields input,
.network-main-fields select {
  min-height: 47px;
  border-color: #b9cfdc;
  background: #fbfdff;
}

.network-router-field select {
  color: #123f5c;
  font-weight: 800;
}

.network-route-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 20px 16px;
}

.network-route-preview article {
  position: relative;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #d9e5ec;
  border-radius: 8px;
  background: #f6fafc;
}

.network-route-preview article > span {
  display: block;
  margin-bottom: 7px;
  color: #718494;
  font-size: .68rem;
  font-weight: 800;
}

.network-route-preview article > strong {
  display: block;
  overflow: hidden;
  color: #163f5a;
  font-size: .84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-route-preview input,
.network-route-preview select {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  opacity: 0;
}

.network-access-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin: 0 20px 16px;
  padding: 13px 14px;
  border: 1px dashed #c3d5df;
  border-radius: 9px;
  background: #fafcfd;
}

.network-access-bar.is-ready {
  border-style: solid;
  border-color: #9bd8c5;
  background: #effbf7;
}

.network-access-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: #879aa8;
  font-size: 1.15rem;
  font-weight: 900;
}

.network-access-bar.is-ready .network-access-icon {
  background: #0b8c70;
}

.network-access-copy > strong {
  display: block;
  color: #244a62;
  font-size: .83rem;
}

.network-access-addresses {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin-top: 7px;
}

.network-access-addresses span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #718494;
  font-size: .68rem;
}

.network-access-addresses code {
  overflow-wrap: anywhere;
  color: #12658f;
  font-size: .7rem;
  font-weight: 800;
}

.network-advanced-settings {
  margin: 0 20px 18px;
  border: 1px solid #d9e4eb;
  border-radius: 8px;
  background: #fff;
}

.network-advanced-settings summary {
  padding: 12px 14px;
  color: #31556c;
  font-size: .78rem;
  font-weight: 900;
  cursor: pointer;
}

.network-advanced-settings summary small {
  margin-right: 7px;
  color: #8294a1;
  font-weight: 600;
}

.network-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 14px 14px;
}

.network-service-choices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: none;
  gap: 10px;
  padding: 18px 20px 12px;
}

.network-service-choices .check-choice {
  min-height: 76px;
  border-radius: 9px;
  background: #f8fbfd;
}

.network-service-choices .check-choice:has(input:checked) {
  border-color: #77bde5;
  background: #edf8fe;
  box-shadow: 0 0 0 2px rgba(8, 117, 189, .08);
}

.network-notes-field {
  display: block;
  padding: 0 20px 19px;
}

.network-notes-field textarea {
  min-height: 68px;
}

.network-isolation-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid #bce1d5;
  border-radius: 9px;
  color: #116a56;
  background: #f2fbf8;
}

.network-isolation-strip > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #159173;
  font-weight: 900;
}

.network-isolation-strip strong,
.network-isolation-strip small {
  display: block;
}

.network-isolation-strip small {
  margin-top: 3px;
  color: #5b7f73;
  font-size: .7rem;
}

.network-isolation-strip > b {
  padding: 6px 9px;
  border-radius: 7px;
  background: #def4ec;
  font-size: .7rem;
}

.network-sticky-actions {
  position: sticky;
  z-index: 5;
  bottom: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid #bfd3df;
  border-radius: 10px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 35px rgba(10, 44, 67, .16);
  backdrop-filter: blur(8px);
}

.network-sticky-actions > div strong,
.network-sticky-actions > div small {
  display: block;
}

.network-sticky-actions > div strong {
  color: #193f59;
  font-size: .82rem;
}

.network-sticky-actions > div small {
  margin-top: 3px;
  color: #758895;
  font-size: .68rem;
}

@media (max-width: 900px) {
  .network-main-fields {
    grid-template-columns: 1fr;
  }

  .network-service-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .management-form .network-primary-section,
  .management-form .network-services-section {
    padding: 0;
  }

  .network-form-progress span {
    min-height: 42px;
    padding: 7px;
    font-size: .65rem;
    text-align: center;
  }

  .network-form-progress b {
    width: 22px;
    height: 22px;
  }

  .network-section-heading {
    align-items: flex-start;
    padding: 15px;
  }

  .network-section-heading .state {
    flex: 0 0 auto;
  }

  .network-main-fields,
  .network-route-preview,
  .network-advanced-grid,
  .network-service-choices {
    grid-template-columns: 1fr;
  }

  .network-main-fields {
    padding: 16px 15px 13px;
  }

  .network-route-preview {
    gap: 8px;
    padding: 0 15px 13px;
  }

  .network-route-preview article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .network-route-preview article > span {
    margin: 0;
  }

  .network-route-preview article > strong {
    text-align: left;
  }

  .network-access-bar {
    grid-template-columns: auto minmax(0, 1fr);
    margin: 0 15px 13px;
  }

  .network-access-bar .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .network-access-addresses {
    display: grid;
  }

  .network-advanced-settings {
    margin: 0 15px 15px;
  }

  .network-service-choices {
    max-height: none;
    padding: 15px 15px 10px;
  }

  .network-notes-field {
    padding: 0 15px 15px;
  }

  .network-isolation-strip {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .network-isolation-strip > b {
    grid-column: 2;
    justify-self: start;
  }

  .management-form .network-sticky-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    bottom: 6px;
  }

  .network-sticky-actions > div {
    grid-column: 1 / -1;
  }
}

/* Unified VPN and company router directory */
.vpn-overview {
  display: grid;
  grid-template-columns: minmax(250px, .72fr) minmax(520px, 1.28fr);
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #d8e5ed;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(28, 67, 92, .06);
}

.vpn-overview-copy { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vpn-overview-copy > div { min-width: 0; }
.vpn-overview-add { flex: 0 0 auto; margin-inline-start: auto; white-space: nowrap; }
.vpn-overview-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: #0877a5; background: #e5f5fa; font-size: 1.65rem; font-weight: 900; }
.vpn-overview h2 { margin: 0 0 4px; color: #173d55; font-size: 1.08rem; }
.vpn-overview p { margin: 0; color: #6b7f8e; font-size: .8rem; line-height: 1.65; }

.vpn-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.vpn-summary-grid span {
  min-height: 62px;
  display: grid;
  place-content: center;
  gap: 3px;
  padding: 8px;
  border: 1px solid #deeaef;
  border-radius: 10px;
  color: #536d7c;
  background: #f8fbfc;
  text-align: center;
  font-size: .68rem;
}

.vpn-summary-grid b { color: #173e56; font-size: 1.22rem; line-height: 1; }
.vpn-summary-grid small { color: inherit; font-size: .68rem; font-weight: 700; }
.vpn-summary-grid .is-success { border-color: #c8eadf; color: #17806a; background: #f1fbf7; }
.vpn-summary-grid .is-success b { color: #08775f; }
.vpn-summary-grid .is-warning { border-color: #f0dfb9; color: #986b16; background: #fffaf0; }
.vpn-summary-grid .is-warning b { color: #a26c08; }
.vpn-create-panel, .vpn-script-panel { margin-bottom: 18px; }
.vpn-create-panel { padding: 18px; border-radius: 14px; }
.vpn-section-heading { margin-bottom: 14px; }
.vpn-section-heading h2 { font-size: 1.05rem; }
.vpn-section-heading p { margin-top: 4px; color: #738695; font-size: .75rem; }

.vpn-create-form {
  display: grid;
  grid-template-columns: minmax(240px, 1.45fr) minmax(190px, .8fr) minmax(165px, .7fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}
.vpn-create-form.is-tenant { grid-template-columns: minmax(280px, 1.6fr) minmax(210px, .9fr) auto; }

.vpn-create-form label, .vpn-router-filters label { display: grid; gap: 6px; }
.vpn-create-form label > span, .vpn-router-filters label > span { color: #61778a; font-size: .72rem; font-weight: 800; }
.vpn-create-form input, .vpn-create-form select, .vpn-router-filters input, .vpn-router-filters select { min-height: 42px; }
.vpn-create-form label small { min-height: 16px; color: #81929f; font-size: .66rem; }
.vpn-create-submit { min-height: 42px; padding-inline: 18px; white-space: nowrap; }
.vpn-create-submit span { font-size: 1.15rem; line-height: 0; }
.vpn-create-actions { display: flex; align-items: center; gap: 8px; }
.vpn-create-actions .button { min-height: 42px; white-space: nowrap; }

.vpn-protocol-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 8px;
  color: #31596e;
  background: #f0f8fb;
  font-size: .76rem;
}

.vpn-protocol-note b { color: #0876a7; }
.vpn-protocol-note small { margin-inline-start: auto; color: #6d8290; }
.vpn-script-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 16px 0 12px; }
.vpn-script-actions form { margin: 0; }
.vpn-script-output { width: 100%; min-height: 340px; padding: 16px; border: 1px solid #1a4055; border-radius: 9px; color: #d9f4ff; background: #071d2b; font: 12px/1.65 Consolas, monospace; text-align: left; }
.vpn-directory { display: grid; gap: 12px; }

.vpn-router-filters {
  align-items: end;
  padding: 12px;
  border: 1px solid #dce7ed;
  border-radius: 12px;
  background: #fff;
}
.vpn-router-filters.is-owner { grid-template-columns: minmax(260px, 1.5fr) minmax(150px, .7fr) minmax(160px, .7fr); }
.vpn-router-filters.is-customer { grid-template-columns: minmax(260px, 1.5fr) minmax(160px, .7fr); }
.vpn-router-filters .button { min-height: 42px; }

.vpn-company-group {
  overflow: hidden;
  border: 1px solid #d5e3ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.vpn-company-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 15px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(135deg, #f4fafc, #eef6fb);
}

.vpn-company-group > summary::-webkit-details-marker { display: none; }
.vpn-company-group > summary span { display: grid; gap: 3px; }
.vpn-company-group > summary strong { color: #123f5b; font-size: .98rem; }
.vpn-company-group > summary small { color: #718695; }
.vpn-company-group > summary > b { padding: 6px 9px; border-radius: 7px; color: #08725d; background: #def5ee; font-size: .7rem; }
.vpn-company-group .tunnel-router-grid { padding: 12px; gap: 12px; }
.tunnel-router-card.is-online { border-top: 3px solid #0aa27f; }
.tunnel-router-card.is-waiting { border-top: 3px solid #e0a431; }
.tunnel-router-card { padding: 14px; box-shadow: none; }
.tunnel-router-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tunnel-router-card header > div { min-width: 0; }
.tunnel-router-card header h2 { margin: 0 0 3px; color: #153e56; font-size: .94rem; overflow-wrap: anywhere; }
.tunnel-router-card header small { color: #7a8d99; font-size: .67rem; }
.vpn-router-hint { min-height: 22px; margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; color: #667d8c; background: #f5f8fa; font-size: .7rem; }
.tunnel-router-card dl { grid-template-columns: 1fr; }
.tunnel-router-card dl > div { align-items: center; }
.tunnel-router-card dl dd { font-size: .78rem; }
.router-identity { color: #607787; overflow-wrap: anywhere; }
.vpn-router-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vpn-router-actions .button, .vpn-router-actions form, .vpn-router-actions button { width: 100%; }

@media (max-width: 1150px) {
  .vpn-overview { grid-template-columns: 1fr; }
  .vpn-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vpn-create-form .button { width: 100%; }
}

@media (max-width: 850px) {
  .vpn-router-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .vpn-overview { padding: 13px; }
  .vpn-overview-copy { align-items: flex-start; flex-wrap: wrap; }
  .vpn-overview-add { width: 100%; margin: 4px 0 0; }
  .vpn-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vpn-create-form, .vpn-router-filters { grid-template-columns: 1fr; }
  .vpn-create-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .vpn-create-panel { padding: 14px; }
  .vpn-directory .section-heading { align-items: flex-start; }
  .vpn-protocol-note small { width: 100%; margin: 0; }
  .vpn-script-actions > *, .vpn-script-actions .button { width: 100%; }
  .vpn-company-group > summary { align-items: flex-start; }
  .vpn-company-group > summary > b { white-space: nowrap; }
}

/* Customer-facing package wizard */
.profile-wizard { max-width: 1040px; margin-inline: auto; }
.account-wizard { width: min(1040px, 100%); margin-inline: auto; }
.profile-wizard-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}
.account-wizard .profile-wizard-steps { grid-template-columns: repeat(4, 1fr); }
.profile-wizard-steps button {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 9px;
  color: #667b8d;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}
.profile-wizard-steps b { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: #547084; background: #e8f0f5; }
.profile-wizard-steps button.is-active { color: #075486; background: #eaf5fc; }
.profile-wizard-steps button.is-active b,
.profile-wizard-steps button.is-complete b { color: #fff; background: #0876c2; }
.profile-wizard-panel[hidden] { display: none !important; }
.profile-kind-fieldset,
.profile-network-fieldset,
.profile-dependent-fields { margin: 0; padding: 0; border: 0; }
.profile-kind-fieldset { margin-top: 18px; }
.profile-kind-fieldset > legend,
.profile-network-fieldset > legend { margin-bottom: 9px; color: #38536a; font-weight: 850; }
.profile-kind-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.profile-kind-grid label { position: relative; cursor: pointer; }
.profile-kind-grid input { position: absolute; opacity: 0; pointer-events: none; }
.profile-kind-grid span { min-height: 105px; display: grid; align-content: center; gap: 6px; padding: 16px; border: 1px solid #cfdae4; border-radius: 11px; background: #fff; }
.profile-kind-grid small { color: var(--muted); line-height: 1.6; }
.profile-kind-grid input:checked + span { border-color: #1688cc; background: #edf7fd; box-shadow: 0 0 0 2px rgba(8,118,194,.1); }
.profile-enabled-toggle { margin-top: 15px; }
.profile-limit-card { display: grid; gap: 13px; margin-bottom: 11px; padding: 15px; border: 1px solid #dce5ed; border-radius: 11px; background: #fbfdff; }
.profile-dependent-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 12px; border-top: 1px solid #e5edf3; }
.profile-dependent-fields.four-columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.profile-dependent-fields.one-column { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
.profile-dependent-fields.is-disabled { opacity: .45; }
.profile-dependent-fields label,
.profile-devices-field { display: grid; gap: 6px; }
.profile-dependent-fields label > span,
.profile-devices-field > span { color: #52697c; font-size: .8rem; font-weight: 800; }
.profile-dependent-fields label > small { color: var(--muted); font-size: .72rem; }
.profile-devices-field { max-width: 420px; margin-top: 15px; }
.profile-network-fieldset { margin: 18px 0; padding: 15px; border: 1px solid #dce5ed; border-radius: 11px; }
.wizard-actions { display: flex; justify-content: space-between; gap: 9px; margin-top: 22px; padding-top: 16px; border-top: 1px solid #e6edf3; }
.account-profile-preview,
.account-review-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}
.account-profile-preview > div,
.account-review-grid > div,
.account-expiration-preview {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid #d7e4ed;
  border-radius: 11px;
  background: #f8fbfd;
}
.account-profile-preview span,
.account-review-grid span,
.account-expiration-preview span { color: #6b7f8f; font-size: .76rem; font-weight: 750; }
.account-profile-preview strong,
.account-review-grid strong,
.account-expiration-preview strong { color: #153f5e; overflow-wrap: anywhere; }
.account-expiration-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-bottom: 16px; }
.choice-card { position: relative; cursor: pointer; }
.choice-card > input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card > span { min-height: 92px; display: grid; align-content: center; gap: 5px; padding: 15px; border: 1px solid #d0dce5; border-radius: 11px; background: #fff; }
.choice-card small { color: var(--muted); line-height: 1.5; }
.choice-card input:checked + span { border-color: #1688cc; background: #edf7fd; box-shadow: 0 0 0 2px rgba(8,118,194,.1); }
.account-expiration-preview { margin-top: 14px; background: #eff9f6; border-color: #bfe5d8; }
.account-final-options { margin-top: 16px; }
.account-advanced-options { margin-top: 16px; padding: 13px; border: 1px solid #dce5ed; border-radius: 11px; background: #fbfdff; }
.account-advanced-options summary { cursor: pointer; color: #1d5275; font-weight: 850; }
.account-advanced-options[open] summary { margin-bottom: 14px; }
.source-health-panel[hidden] + .operations-panel { grid-column: 1 / -1; }
.simplified-network-form { max-width: 900px; margin-inline: auto; }
.network-purpose-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
.compact-empty { margin-top: 14px; }
.connection-file-panel { max-width: 720px; margin-inline: auto; text-align: center; }
.connection-file-panel .section-heading { justify-content: center; }

/* Unified Radius business modules */
.business-metrics .metric,
.business-shortcuts .service-module { text-decoration: none; }
.compact-modules { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.business-two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.inline-business-form { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 7px; }
.inline-business-form input,
.inline-business-form select { min-width: 105px; max-width: 190px; padding: 8px 10px; border: 1px solid #d8e2ea; border-radius: 9px; background: #fff; }
.table-note { display: block; margin-top: 4px; color: #738596; font-weight: 500; line-height: 1.5; }
.network-topology { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.topology-node { position: relative; min-height: 130px; padding: 16px; border: 1px solid #dbe6ed; border-radius: 15px; background: linear-gradient(145deg,#fff,#f7fbfd); }
.topology-node::before { content: ""; position: absolute; inset-inline-start: -8px; top: 32px; width: 8px; border-top: 2px solid #5fb3c6; }
.topology-node-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topology-node > small { display: block; color: #6c8192; margin-top: 5px; }
.topology-devices { display: grid; gap: 6px; margin-top: 12px; }
.topology-devices .state { justify-content: flex-start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 980px) {
  .business-two-columns,
  .compact-modules,
  .network-topology { grid-template-columns: 1fr; }
}
.connection-file-action { margin-top: 18px; }

@media (max-width: 900px) {
  .topbar-primary { align-items: flex-start; flex-direction: column; gap: 8px; }
  .topbar-tenant { min-width: 0; padding: 4px 0 0; border: 0; }
  .profile-dependent-fields.four-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-profile-preview,
  .account-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .profile-wizard-steps button { min-height: 46px; padding: 7px 4px; }
  .profile-wizard-steps button span { font-size: .72rem; }
  .account-wizard .profile-wizard-steps { grid-template-columns: repeat(2, 1fr); }
  .profile-kind-grid,
  .profile-dependent-fields,
  .profile-dependent-fields.four-columns,
  .account-expiration-options,
  .account-profile-preview,
  .account-review-grid { grid-template-columns: 1fr; }
  .wizard-actions .button { flex: 1; }
}

/* Simplified dashboard and network workspace */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #0b789b;
  font-size: .7rem;
  font-weight: 900;
}

.dashboard-command-bar,
.network-map-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid #cfe0eb;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f3f9fc 100%);
  box-shadow: 0 9px 28px rgba(25, 63, 91, .06);
}

.dashboard-command-status {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.status-orb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 10px solid #d9f3eb;
  border-radius: 50%;
  background: #0e9b77;
  box-shadow: 0 0 0 1px #bfe6da;
}

.status-orb.warning {
  border-color: #fff0ce;
  background: #d88c15;
  box-shadow: 0 0 0 1px #f2d69f;
}

.dashboard-command-status small,
.dashboard-command-status strong,
.dashboard-command-status span {
  display: block;
}

.dashboard-command-status small {
  color: #718493;
  font-size: .72rem;
  font-weight: 800;
}

.dashboard-command-status strong {
  margin-top: 3px;
  color: #153a55;
  font-size: 1rem;
}

.dashboard-command-status span {
  margin-top: 4px;
  color: #7b8c99;
  font-size: .72rem;
}

.dashboard-quick-actions,
.network-map-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-primary-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-primary-card {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #dbe5ec;
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 7px 22px rgba(23, 58, 82, .055);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.dashboard-primary-card::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--blue);
}

.dashboard-primary-card.success::before { background: var(--green); }
.dashboard-primary-card.danger::before { background: var(--red); }
.dashboard-primary-card.warning::before { background: #d58b17; }
.dashboard-primary-card:hover { transform: translateY(-2px); border-color: #b7cfdf; box-shadow: 0 12px 28px rgba(23, 58, 82, .1); }
.dashboard-primary-card span { color: #536b7e; font-size: .83rem; font-weight: 850; }
.dashboard-primary-card strong { color: #123b5a; font-size: 2rem; line-height: 1; }
.dashboard-primary-card small { color: #7b8b98; font-size: .72rem; }

.dashboard-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-workspace > .section-band { margin: 0; box-shadow: none; }
.compact-heading { margin-bottom: 0; }
.compact-heading h2 { margin-top: 0; }
.dashboard-attention-panel .attention-list { padding-top: 10px; }
.attention-arrow { color: #7d91a1; font-size: 1.25rem; font-weight: 900; }
.dashboard-attention-panel .attention-item { grid-template-columns: 9px minmax(0, 1fr) auto auto; }

.dashboard-summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
}

.dashboard-summary-list > a,
.dashboard-summary-list > div {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #e1e8ee;
  border-radius: 10px;
  background: #fbfdfe;
  color: inherit;
  text-decoration: none;
}

.dashboard-summary-list > a:hover { border-color: #b9d3e3; background: #f3f9fc; }
.dashboard-summary-list span { color: #647889; font-size: .77rem; font-weight: 800; }
.dashboard-summary-list b { color: #173d59; font-size: .95rem; white-space: nowrap; }
.dashboard-summary-list .backup-summary.ready b { color: var(--green); }
.dashboard-summary-list .backup-summary.pending b { color: var(--amber); }
.dashboard-empty-state { grid-column: 1 / -1; min-height: 86px; display: grid; place-items: center; }

.network-map-command-bar > div:first-child { min-width: 0; }
.network-map-command-bar h2 { margin: 0; color: #163b56; font-size: 1.25rem; }
.network-map-command-bar p { margin: 6px 0 0; color: #708291; font-size: .82rem; }
.button.quiet { border: 1px solid transparent; background: transparent; color: #28617f; }
.button.quiet:hover { border-color: #d6e3eb; background: #f8fbfd; }

.network-map-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid #dbe6ed;
  border-radius: 14px;
  background: #dbe6ed;
}

.network-map-metrics > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 68px;
  padding: 12px 18px;
  background: #fff;
}

.network-map-metrics span { color: #667b8c; font-size: .78rem; font-weight: 800; }
.network-map-metrics strong { color: #153f5d; font-size: 1.35rem; }

.network-create-workspace {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid #a9cfe2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(18, 68, 97, .09);
}

.network-create-workspace > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e4ebf0;
}

.network-create-workspace h2 { margin: 4px 0; color: #153b57; font-size: 1.15rem; }
.network-create-workspace p { margin: 0; color: #6d8190; font-size: .8rem; }
.form-step-badge { color: #087c9e; font-size: .7rem; font-weight: 900; }
.workspace-close { width: 36px; height: 36px; border: 0; border-radius: 10px; background: #eef4f8; color: #466176; cursor: pointer; font-size: 1.35rem; line-height: 1; }
.workspace-close:hover { background: #e0ebf2; }
.streamlined-network-form { max-width: 920px; }
.streamlined-network-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.streamlined-network-form .form-actions { justify-content: flex-start; }
.optional-fields { margin-top: 14px; padding: 12px 14px; border: 1px solid #dce6ed; border-radius: 11px; background: #f9fbfd; }
.optional-fields summary { color: #275a79; font-size: .8rem; font-weight: 850; cursor: pointer; }
.optional-fields[open] summary { margin-bottom: 14px; }
.optional-fields .form-grid { margin-bottom: 0; }

.network-map-panel,
.network-routers-panel { margin-bottom: 16px; }
.network-map-heading { align-items: center; }
.network-map-search { width: min(320px, 100%); }
.network-map-search input { width: 100%; min-height: 42px; padding: 9px 13px; border: 1px solid #d2e0e9; border-radius: 10px; background: #f9fbfd; }
.network-map-result { margin: -4px 0 14px; color: #78909e; font-size: .72rem; font-weight: 800; }
.simplified-topology { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.simplified-topology .topology-node { min-height: 0; padding: 0; overflow: hidden; }
.simplified-topology .topology-node::before { display: none; }
.topology-node > summary { position: relative; padding: 16px 18px; cursor: pointer; list-style: none; }
.topology-node > summary::-webkit-details-marker { display: none; }
.topology-node > summary::after { content: "‹"; position: absolute; inset-inline-end: 18px; bottom: 14px; color: #8297a6; font-size: 1.2rem; font-weight: 900; }
.topology-node[open] > summary::after { content: "⌄"; }
.topology-node > summary > small { display: block; margin-top: 5px; color: #6c8192; }
.topology-expand-label { display: block; margin-top: 12px; color: #28769a; font-size: .72rem; font-weight: 850; }
.topology-node[open] .topology-expand-label { color: #607988; }
.simplified-topology .topology-devices { margin: 0; padding: 12px 16px 16px; border-top: 1px solid #e4ebf0; background: #fbfdfe; }
.topology-device-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px 0; border-bottom: 1px solid #e9eef2; }
.topology-device-row:last-child { border-bottom: 0; }
.topology-device-row strong { min-width: 0; overflow: hidden; color: #24445b; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.topology-device-row small { color: #6b8191; font-size: .72rem; }
.topology-no-results { margin-top: 12px; }

.router-compact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-top: 12px; }
.router-compact-list > article { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 13px 14px; border: 1px solid #dfe8ee; border-radius: 11px; background: #fbfdfe; }
.router-compact-list strong,
.router-compact-list small { display: block; }
.router-compact-list strong { color: #21445c; font-size: .82rem; }
.router-compact-list small { margin-top: 3px; color: #758896; font-size: .7rem; }
.router-compact-list b { color: #4d6c7f; font-size: .72rem; font-weight: 750; }

@media (max-width: 1050px) {
  .dashboard-primary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .dashboard-command-bar,
  .network-map-command-bar { align-items: stretch; flex-direction: column; padding: 15px; }
  .dashboard-quick-actions,
  .network-map-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-quick-actions .button:first-child,
  .network-map-actions .button:first-child { grid-column: 1 / -1; }
  .dashboard-primary-card { padding: 15px; }
  .dashboard-primary-card strong { font-size: 1.65rem; }
  .network-map-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .network-map-heading { align-items: stretch; flex-direction: column; }
  .network-map-search { width: 100%; }
  .simplified-topology,
  .router-compact-list { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .dashboard-primary-metrics { gap: 8px; }
  .dashboard-primary-card { min-height: 116px; }
  .dashboard-primary-card small { line-height: 1.45; }
  .dashboard-summary-list { grid-template-columns: 1fr; }
  .network-map-metrics > div { min-height: 58px; padding: 10px 12px; }
  .network-create-workspace { padding: 15px; }
  .streamlined-network-form .form-grid { grid-template-columns: 1fr; }
  .streamlined-network-form .form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .topology-node > summary { padding: 14px; }
  .router-compact-list > article { grid-template-columns: auto minmax(0, 1fr); }
  .router-compact-list > article > b { grid-column: 2; }
}

/* The page header must never turn into a wide desktop row on phones that use
   an enlarged/desktop CSS viewport. Keep the title on its own row early. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.app-shell,
.main-content,
.topbar,
.topbar-primary,
.topbar-title {
  max-width: 100%;
}

@media (max-width: 1400px) {
  .topbar {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px 12px;
    min-height: 0;
    overflow: hidden;
  }

  .topbar-primary {
    display: contents;
  }

  .topbar-title {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
  }

  .topbar-title h1,
  .topbar-title p {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .topbar-tenant {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    width: fit-content;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    padding: 8px 11px;
    border: 0;
    border-radius: 10px;
    background: #f4f8fb;
  }

  .topbar-tenant-value,
  .topbar-tenant strong,
  .topbar-tenant small,
  .topbar-tenant a {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .topbar-action {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .topbar-title,
  .topbar-tenant,
  .topbar-action {
    grid-column: 1;
    width: 100%;
  }

  .topbar-title { grid-row: 1; }
  .topbar-tenant { grid-row: 2; }
  .topbar-action { grid-row: 3; }

  .topbar-action > .button,
  .topbar-action > .refresh-link {
    width: 100%;
  }
}

/* Final application shell: one predictable layout on desktop and mobile. */
.mobile-brand {
  display: none;
}

.sidebar-nav-group > summary::after {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  content: "";
  opacity: .65;
  transform: rotate(135deg);
  transition: transform .16s ease;
}

.sidebar-nav-group[open] > summary::after {
  content: "";
  transform: rotate(45deg);
}

.sidebar-nav-group > summary:hover {
  color: var(--blue-dark);
  background: #f3f8fb;
}

@media (min-width: 1101px) {
  .topbar {
    position: sticky;
    display: flex;
    grid-template-columns: none;
    align-items: center;
    overflow: visible;
  }

  .topbar-primary {
    display: flex;
    align-items: center;
  }

  .topbar-title,
  .topbar-tenant,
  .topbar-action {
    width: auto;
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 1100px) and (min-width: 821px) {
  .app-shell {
    grid-template-columns: 252px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 12px;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topbar-primary {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topbar-title {
    grid-column: 1 / -1;
  }

  .topbar-tenant {
    width: auto;
    grid-column: 1;
    padding: 6px 0 0;
    border: 0;
  }
}

@media (max-width: 820px) {
  .sidebar {
    display: none;
  }

  .main-content {
    padding: 14px 12px 82px;
  }

  .topbar {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    margin: -14px -12px 16px;
    padding: 9px 12px 12px;
    overflow: hidden;
  }

  .mobile-brand {
    min-width: 0;
    display: flex;
    grid-column: 1;
    grid-row: 1;
    align-items: center;
    gap: 7px;
    color: #143b57;
    font-size: .82rem;
    text-decoration: none;
  }

  .mobile-brand img {
    width: 42px;
    height: 34px;
    object-fit: contain;
  }

  .topbar-action {
    width: auto;
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }

  .topbar-action > .button,
  .topbar-action > .refresh-link {
    width: auto;
    min-height: 34px;
    padding: 6px 10px;
    font-size: .72rem;
  }

  .topbar-primary {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-column: 1 / -1;
    grid-row: 2;
    align-items: center;
    gap: 8px;
  }

  .topbar-title {
    width: auto;
    grid-column: 1;
    grid-row: 1;
  }

  .topbar h1 {
    font-size: 1.12rem;
  }

  .topbar p {
    display: none;
  }

  .topbar-tenant {
    width: auto;
    max-width: 48vw;
    grid-column: 2;
    grid-row: 1;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 5px 8px;
    border: 0;
    border-radius: 9px;
    background: #f0f6fa;
  }

  .topbar-tenant-label {
    display: none;
  }

  .topbar-tenant-value strong {
    max-width: 31vw;
    font-size: .74rem;
  }

  .topbar-tenant-value small,
  .topbar-tenant a {
    font-size: .62rem;
  }

  .accounts-list-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .accounts-toolbar-primary {
    display: flex;
    grid-column: 1;
    flex-wrap: wrap;
  }

  .accounts-toolbar-secondary {
    display: flex;
    grid-column: 2;
  }
}

@media (max-width: 520px) {
  .topbar-primary {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-title,
  .topbar-tenant {
    grid-column: 1;
  }

  .topbar-title {
    grid-row: 1;
  }

  .topbar-tenant {
    max-width: 100%;
    grid-row: 2;
    justify-self: start;
  }

  .topbar-tenant-value strong {
    max-width: 62vw;
  }

  .accounts-list-toolbar {
    grid-template-columns: 1fr;
  }

  .accounts-toolbar-primary,
  .accounts-toolbar-secondary {
    grid-column: 1;
  }
}

.sidebar-help-button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 2px;
  padding: 8px 11px;
  border: 1px solid #cfe1ec;
  border-radius: 9px;
  color: #28516b;
  background: #f3f8fb;
  cursor: pointer;
  text-align: right;
}

.sidebar-help-button span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-weight: 950;
}

.sidebar-help-button strong {
  font-size: .8rem;
}

.page-guide {
  width: min(560px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #cbdce7;
  border-radius: 18px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 24px 70px rgba(11, 39, 59, .25);
}

.page-guide::backdrop {
  background: rgba(9, 29, 43, .58);
  backdrop-filter: blur(2px);
}

.page-guide > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #dce7ee;
  background: linear-gradient(135deg, #f2f9fc, #fff);
}

.page-guide > header span {
  color: #16819e;
  font-size: .7rem;
  font-weight: 900;
}

.page-guide > header h2 {
  margin: 5px 0 0;
  color: #143a55;
  font-size: 1.2rem;
}

.page-guide > header button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  color: #4c6475;
  background: #eaf1f5;
  cursor: pointer;
  font-size: 1.3rem;
}

.page-guide-body {
  max-height: calc(100vh - 210px);
  padding: 20px;
  overflow-y: auto;
}

.page-guide-body ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: help-step;
}

.page-guide-body li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 3px 11px;
  padding: 13px;
  border: 1px solid #dfe9ef;
  border-radius: 12px;
  background: #f8fbfd;
  counter-increment: help-step;
}

.page-guide-body li::before {
  width: 32px;
  height: 32px;
  display: grid;
  grid-row: 1 / 3;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #0d91ae, #1373c6);
  content: counter(help-step);
  font-weight: 900;
}

.page-guide-body li b {
  color: #193e58;
  font-size: .9rem;
}

.page-guide-body li span {
  color: #6a7e8e;
  font-size: .78rem;
  line-height: 1.65;
}

.page-guide > footer {
  display: flex;
  justify-content: flex-end;
  padding: 13px 20px;
  border-top: 1px solid #dce7ee;
  background: #f8fafc;
}

@media (max-width: 520px) {
  .page-guide > header,
  .page-guide-body,
  .page-guide > footer {
    padding-inline: 14px;
  }

  .page-guide > footer .button {
    width: 100%;
  }
}
