:root {
  --background: #0b1117;
  --surface: #111a22;
  --surface-2: #15202a;
  --surface-3: #1b2a36;
  --border: #253848;
  --text: #f3f7f8;
  --muted: #91a1ad;
  --muted-2: #687986;
  --primary: #18c48f;
  --primary-2: #0ea976;
  --cyan: #37b6d8;
  --amber: #f59f36;
  --danger: #ef5b5b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  background:
    linear-gradient(90deg, rgba(24, 196, 143, 0.05), transparent 30%),
    var(--background);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--border);
  background: #0e171f;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  gap: 14px;
}

.brand-tile {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #081119;
  border: 1px solid rgba(24, 196, 143, 0.32);
  color: var(--primary);
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(24, 196, 143, 0.12);
}

.brand-tile.logo-tile {
  overflow: hidden;
  background: #121820;
}

.brand-tile.logo-tile img {
  width: 118px;
  height: 80px;
  object-fit: cover;
  transform: scale(1.25);
}

.side-nav,
.side-footer {
  display: grid;
  gap: 8px;
  width: 100%;
}

.side-nav {
  margin-top: 6px;
}

.side-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.nav-button {
  width: 100%;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-button:hover,
.nav-button.active {
  color: var(--text);
  background: var(--surface-3);
}

.nav-button.active {
  background: var(--primary);
  color: #052016;
  box-shadow: 0 10px 26px rgba(24, 196, 143, 0.24);
}

.nav-button svg,
.icon-button svg,
.button svg,
.password-toggle svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  min-height: 58px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}

.eyebrow,
.meta-label,
.card-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.08;
  margin-top: 4px;
}

.subtle {
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill,
.button,
.icon-button,
.status-pill,
.plan-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #052016;
  font-weight: 800;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

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

.metric {
  min-height: 118px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}

.metric-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.trend {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.7fr);
  gap: 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.panel-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  display: grid;
  gap: 4px;
}

.panel-title h2 {
  font-size: 18px;
}

.installations {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.tenant-card {
  position: relative;
  border: 1px solid var(--border);
  background: #0f1820;
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 18px;
}

.tenant-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--tenant-accent, var(--primary));
  border-radius: 8px 0 0 8px;
}

.tenant-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.tenant-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tenant-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--tenant-accent, var(--primary));
  font-weight: 800;
}

.tenant-title h3 {
  font-size: 22px;
}

.tenant-meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.tenant-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
  color: var(--text);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: #3a5368;
}

.button.primary {
  background: var(--primary);
  color: #052016;
  border-color: transparent;
}

.button.warning {
  color: #180f03;
  background: var(--amber);
  border-color: transparent;
}

.button.danger {
  color: #260707;
  background: var(--danger);
  border-color: transparent;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill,
.plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-active {
  color: var(--primary);
}

.status-blocked {
  color: var(--danger);
}

.status-provisioning {
  color: var(--amber);
}

.health-online {
  color: var(--cyan);
}

.health-offline {
  color: var(--muted);
}

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

.limit {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.limit-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.limit-value {
  color: var(--text);
  font-weight: 750;
  white-space: nowrap;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #0a1117;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.progress span {
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tenant-accent, var(--primary)), var(--cyan));
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.billing-box {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid rgba(24, 196, 143, 0.18);
  border-radius: 8px;
  background: rgba(24, 196, 143, 0.05);
  padding: 12px;
}

.billing-box > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.billing-box strong {
  font-size: 13px;
}

.meta-box {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.meta-value {
  font-size: 13px;
  font-weight: 750;
}

.side-panel-body {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.plan-row,
.event-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0f1820;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.plan-row strong,
.event-row strong {
  display: block;
}

.plan-row small,
.event-row small {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 15px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #101a22;
  color: var(--text);
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  align-items: stretch;
  padding: 22px 0 16px;
  gap: 18px;
  background: #020617;
  border-right: 1px solid #1e293b;
}

.sidebar-brand {
  display: grid;
  gap: 4px;
  padding: 0 22px 14px;
  color: #4edea3;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0;
}

.sidebar-brand img {
  width: 128px;
  height: 54px;
  object-fit: contain;
  object-position: left center;
}

.sidebar-brand strong {
  font-size: 20px;
  line-height: 1;
}

.side-nav,
.side-footer {
  width: 100%;
  display: grid;
  gap: 2px;
}

.side-nav {
  margin: 0;
}

.side-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 0;
}

.nav-button {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 18px;
  border-radius: 0;
  border-right: 2px solid transparent;
  color: #9ca3af;
  background: transparent;
  font-weight: 650;
  cursor: pointer;
}

.nav-button:hover,
.nav-button.active {
  color: #dde4dd;
  background: rgba(78, 222, 163, 0.08);
}

.nav-button.active {
  color: #4edea3;
  border-right-color: #4edea3;
  box-shadow: none;
}

.nav-button svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.nav-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-main {
  min-width: 0;
  padding: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 76px;
  margin: 0;
  padding: 14px 24px;
  align-items: center;
  border-bottom: 1px solid #1e293b;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
}

.topbar-title {
  min-width: 260px;
}

.topbar-title h1 {
  margin: 0;
  font-size: 22px;
}

.search-box {
  flex: 1;
  max-width: 560px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #3c4a42;
  border-radius: 8px;
  background: #09100c;
  color: #86948a;
  padding: 0 12px;
}

.search-box svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #dde4dd;
}

.button.secondary {
  color: #4edea3;
  border-color: rgba(78, 222, 163, 0.35);
  background: transparent;
}

.more-menu {
  position: relative;
}

.more-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 190px;
  display: none;
  border: 1px solid #253848;
  border-radius: 8px;
  background: #111a22;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  padding: 6px;
}

.more-menu-panel.open {
  display: grid;
}

.more-menu-panel button {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 6px;
  background: transparent;
  color: #dde4dd;
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
}

.more-menu-panel button:hover {
  background: #1b2a36;
}

.more-menu-panel svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
}

.admin-canvas {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 24px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-self: start;
}

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

.summary-compact article {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid #3c4a42;
  border-radius: 8px;
  background: #1a211d;
  padding: 12px 14px;
}

.summary-compact span {
  color: #9ca3af;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-compact strong {
  font-size: 18px;
}

.metric {
  min-height: 96px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 14px;
  background: #1a211d;
  border: 1px solid #3c4a42;
  border-radius: 8px;
  box-shadow: none;
}

.metric-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(78, 222, 163, 0.1);
  color: #4edea3;
}

.metric-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.metric-content {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.metric-value {
  font-size: 25px;
  line-height: 1;
}

.metric-red .metric-icon {
  color: #ffb4ab;
  background: rgba(255, 180, 171, 0.1);
}

.metric-blue .metric-icon {
  color: #adc6ff;
  background: rgba(173, 198, 255, 0.1);
}

.metric-amber .metric-icon {
  color: #fc7c78;
  background: rgba(252, 124, 120, 0.1);
}

.metric-neutral .metric-icon {
  color: #bbcabf;
  background: rgba(187, 202, 191, 0.1);
}

.side-card,
.mini-card {
  border: 1px solid #3c4a42;
  border-radius: 8px;
  background: #1a211d;
  padding: 18px;
}

.side-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 15px;
}

.side-card h2 svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

.integration-list {
  display: grid;
  gap: 13px;
}

.integration-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.status-chip,
.success-chip,
.danger-chip,
.warning-chip,
.info-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.success-chip {
  color: #4edea3;
  background: rgba(78, 222, 163, 0.11);
}

.danger-chip {
  color: #ff8f8f;
  background: rgba(239, 91, 91, 0.12);
}

.warning-chip {
  color: #ffb3af;
  background: rgba(252, 124, 120, 0.12);
}

.info-chip {
  color: #adc6ff;
  background: rgba(173, 198, 255, 0.11);
}

.alert-list {
  display: grid;
  gap: 10px;
}

.alert-row {
  display: grid;
  gap: 4px;
  padding: 12px 12px 12px 14px;
  border-left: 3px solid #4edea3;
  background: rgba(9, 16, 12, 0.55);
}

.alert-row strong {
  font-size: 13px;
}

.alert-row small,
.side-copy,
.mini-card small,
.clients-table small {
  color: #9ca3af;
}

.alert-danger {
  border-left-color: #ff8f8f;
}

.side-copy {
  margin: -4px 0 14px;
  font-size: 13px;
  line-height: 1.45;
}

.check-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.check-list span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4edea3;
  font-size: 13px;
}

.check-list svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}

.muted-check {
  color: #9ca3af !important;
}

.full-button {
  width: 100%;
}

.queue-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.queue-head h2 {
  margin: 0;
}

.queue-bars {
  height: 82px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.queue-bars span {
  width: 16px;
  height: var(--bar-height);
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #4edea3, rgba(78, 222, 163, 0.32));
}

.mini-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mini-card {
  display: grid;
  gap: 18px;
}

.mini-card strong {
  font-size: 24px;
}

.danger-text {
  color: #ff8f8f !important;
}

.clients-panel {
  min-width: 0;
  border: 1px solid #3c4a42;
  border-radius: 8px;
  background: #1a211d;
  overflow: hidden;
}

.status-strip {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr 1fr;
  gap: 12px;
}

.status-strip > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  border: 1px solid #3c4a42;
  border-radius: 8px;
  background: #1a211d;
  padding: 14px 16px;
}

.status-strip strong {
  font-size: 13px;
}

.clients-panel .panel-header {
  min-height: 76px;
  padding: 18px 22px;
  border-bottom: 1px solid #3c4a42;
}

.clients-panel .panel-header h2 {
  margin: 0;
  font-size: 20px;
}

.client-cards {
  display: none;
  padding: 12px;
  gap: 10px;
}

.mobile-client-card {
  display: grid;
  gap: 10px;
  border: 1px solid #3c4a42;
  border-radius: 8px;
  background: rgba(9, 16, 12, 0.45);
  padding: 12px;
}

.mobile-client-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.mobile-client-meta {
  display: grid;
  gap: 5px;
  color: #bbcabf;
  font-size: 13px;
}

.panel-tools {
  display: flex;
  gap: 8px;
}

.icon-button.compact {
  width: 36px;
  height: 36px;
  border-radius: 6px;
}

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

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

.clients-table th,
.clients-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(60, 74, 66, 0.68);
  vertical-align: middle;
}

.clients-table th {
  color: #9ca3af;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.clients-table td {
  font-size: 13px;
}

.client-row {
  cursor: pointer;
}

.client-row:hover {
  background: rgba(78, 222, 163, 0.045);
}

.client-row:focus-visible {
  outline: 2px solid rgba(78, 222, 163, 0.7);
  outline-offset: -2px;
}

.clients-table td > strong,
.client-cell strong {
  display: block;
  font-size: 14px;
}

.client-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(78, 222, 163, 0.12);
  color: var(--tenant-accent, #4edea3);
  font-weight: 900;
}

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

.details-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  background: rgba(2, 6, 23, 0.62);
}

.client-drawer {
  width: min(480px, 100vw);
  min-height: 100vh;
  overflow-y: auto;
  border-left: 1px solid #3c4a42;
  background: #111a22;
  box-shadow: -24px 0 50px rgba(0, 0, 0, 0.36);
  padding: 22px;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid #253848;
}

.drawer-header h2 {
  margin: 0;
  font-size: 20px;
}

.drawer-section {
  padding: 18px 0;
  border-bottom: 1px solid #253848;
}

.drawer-section h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.drawer-grid {
  display: grid;
  gap: 12px;
}

.drawer-grid.two-cols {
  grid-template-columns: 1fr 1fr;
}

.drawer-grid label {
  display: grid;
  gap: 6px;
  color: #91a1ad;
  font-size: 12px;
  font-weight: 750;
}

.drawer-grid input {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #253848;
  background: #0b131a;
  color: #f3f7f8;
  padding: 0 10px;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 18px;
}

.table-footer {
  min-height: 58px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  color: #9ca3af;
  font-size: 12px;
}

.pagination {
  display: flex;
  gap: 6px;
}

.pagination button {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid #3c4a42;
  background: transparent;
  color: #dde4dd;
}

.pagination button.active {
  border-color: #4edea3;
  background: #4edea3;
  color: #002113;
  font-weight: 850;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(24, 196, 143, 0.08), transparent 42%),
    var(--background);
}

.login-panel {
  width: 100%;
  display: grid;
  place-items: center;
}

.login-card {
  width: 100%;
  max-width: 414px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 30px;
}

.login-logo {
  width: 100%;
  height: 150px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 0;
  background: transparent;
}

.login-logo img {
  width: min(340px, 100%);
  height: auto;
  object-fit: contain;
  object-position: center;
  transform: none;
}

.login-card h1 {
  max-width: 520px;
  font-size: 30px;
  line-height: 1.15;
}

.login-card form {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.field input {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0b131a;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--text);
  background: var(--surface-3);
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 196, 143, 0.14);
}

.form-error {
  min-height: 18px;
  color: #ff8f8f;
  font-size: 13px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

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

  .status-strip {
    grid-template-columns: 1fr;
  }

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

  .dashboard-grid .panel:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 20;
    height: 66px;
    flex-direction: row;
    padding: 8px 12px;
    border-right: 0;
    border-top: 1px solid var(--border);
  }

  .sidebar-brand {
    display: none;
  }

  .brand-tile,
  .side-footer {
    display: none;
  }

  .side-nav {
    margin: 0;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    overflow-x: auto;
  }

  .nav-button {
    height: 48px;
    justify-content: center;
    padding: 0 12px;
    border-right: 0;
    border-top: 2px solid transparent;
  }

  .nav-button.active {
    border-right-color: transparent;
    border-top-color: #4edea3;
  }

  .nav-button span {
    display: none;
  }

  .main {
    padding: 18px 14px 88px;
  }

  .admin-main {
    padding: 0 0 76px;
  }

  .admin-topbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

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

  .search-box {
    max-width: none;
  }

  .admin-canvas {
    padding: 16px;
  }

  .topbar,
  .tenant-head {
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions,
  .tenant-actions {
    justify-content: flex-start;
  }

  .summary-grid,
  .dashboard-grid,
  .metrics-grid,
  .mini-card-grid,
  .summary-compact,
  .status-strip,
  .limits-grid,
  .billing-box,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .client-cards {
    display: grid;
  }

  .table-wrap,
  .table-footer {
    display: none;
  }

  .clients-panel .panel-header {
    min-height: auto;
    padding: 14px 16px;
  }

  .login-screen {
    padding: 16px;
  }
}

.ops-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.ops-filters label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.ops-filters select {
  width: 100%;
  height: 38px;
  border: 1px solid #314238;
  border-radius: 8px;
  background: #0a110d;
  color: #dde4dd;
  padding: 0 10px;
  outline: none;
}

.ops-hero,
.ops-panel,
.ops-alerts,
.ops-metric {
  border: 1px solid #314238;
  border-radius: 8px;
  background: #161f19;
}

.ops-hero {
  min-height: 122px;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  padding: 20px;
  overflow: hidden;
  position: relative;
}

.ops-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #4edea3;
}

.ops-hero.hero-attention::before {
  background: #f7b955;
}

.ops-hero h2 {
  margin: 4px 0 6px;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.05;
}

.ops-hero p {
  max-width: 780px;
  color: #bbcabf;
  line-height: 1.45;
}

.hero-status-card {
  min-width: 220px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(78, 222, 163, 0.18);
  border-radius: 8px;
  background: rgba(9, 16, 12, 0.52);
  padding: 14px;
}

.hero-status-card strong {
  font-size: 18px;
}

.hero-status-card small {
  color: #9ca3af;
}

.hero-status-card .status-chip {
  justify-self: start;
}

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

.ops-metric {
  min-width: 0;
  min-height: 94px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.ops-metric > div:last-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.ops-metric strong {
  font-size: 25px;
  line-height: 1;
}

.ops-metric small {
  color: #9ca3af;
}

.metric-warning .metric-icon {
  color: #f7b955;
  background: rgba(247, 185, 85, 0.12);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 4px 0 0;
  font-size: 19px;
}

.ops-alerts,
.ops-panel {
  padding: 16px;
}

.ops-alert-list,
.instance-list,
.ops-event-list,
.resource-list,
.process-list {
  display: grid;
  gap: 10px;
}

.ops-alert {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #314238;
  border-left-width: 4px;
  border-radius: 8px;
  background: rgba(9, 16, 12, 0.55);
  padding: 12px;
}

.ops-alert strong,
.ops-event strong {
  display: block;
  font-size: 13px;
}

.ops-alert small,
.ops-event small {
  display: block;
  margin-top: 4px;
  color: #9ca3af;
}

.alert-critical,
.alert-danger {
  border-left-color: #ff8f8f;
}

.alert-warning {
  border-left-color: #f7b955;
}

.alert-info {
  border-left-color: #adc6ff;
}

.alert-success {
  border-left-color: #4edea3;
}

.ops-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.ops-primary,
.ops-secondary {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.instance-card {
  display: grid;
  gap: 12px;
  border: 1px solid #314238;
  border-left: 4px solid var(--tenant-accent, #4edea3);
  border-radius: 8px;
  background: #0d1510;
  padding: 14px;
}

.instance-card header,
.instance-card footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.instance-card header strong {
  display: block;
  font-size: 15px;
}

.instance-card header small,
.instance-card footer > span,
.instance-number {
  color: #9ca3af;
  font-size: 12px;
}

.instance-number {
  font-weight: 750;
}

.instance-stats,
.service-grid,
.processing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.instance-stats span,
.service-grid article,
.processing-grid article {
  min-width: 0;
  display: grid;
  gap: 3px;
  border: 1px solid rgba(49, 66, 56, 0.72);
  border-radius: 8px;
  background: rgba(22, 31, 25, 0.68);
  padding: 9px;
  color: #9ca3af;
  font-size: 11px;
}

.instance-stats strong,
.service-grid strong,
.processing-grid strong {
  color: #dde4dd;
  font-size: 14px;
}

.instance-card footer div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.service-endpoint {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(49, 66, 56, 0.72);
  border-radius: 8px;
  background: rgba(9, 16, 12, 0.45);
  margin: 12px 0;
  padding: 12px;
}

.service-endpoint strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.service-endpoint small {
  color: #9ca3af;
}

.ops-event {
  border-left: 3px solid #adc6ff;
  background: rgba(9, 16, 12, 0.45);
  padding: 10px 12px;
}

.event-warning {
  border-left-color: #f7b955;
}

.event-success {
  border-left-color: #4edea3;
}

.resource-row {
  display: grid;
  gap: 8px;
}

.resource-row > div:first-child {
  display: flex;
  justify-content: space-between;
  color: #9ca3af;
  font-size: 12px;
}

.resource-row strong {
  color: #dde4dd;
}

.vps-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.vps-meta span {
  border: 1px solid rgba(49, 66, 56, 0.72);
  border-radius: 8px;
  background: rgba(9, 16, 12, 0.45);
  color: #9ca3af;
  padding: 9px;
  font-size: 12px;
}

.vps-meta strong {
  display: block;
  margin-top: 3px;
  color: #dde4dd;
}

.process-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  border-top: 1px solid rgba(49, 66, 56, 0.72);
  padding-top: 10px;
}

.process-list small {
  grid-column: 1 / -1;
  color: #9ca3af;
}

.ops-bars {
  justify-content: flex-start;
  height: 92px;
  margin-top: 8px;
}

.ops-bars span {
  flex: 1;
  max-width: 28px;
}

.compact-clients-panel {
  background: #141d17;
}

.empty-state {
  display: grid;
  gap: 5px;
  border: 1px dashed #3c4a42;
  border-radius: 8px;
  color: #9ca3af;
  padding: 18px;
}

.empty-state strong {
  color: #dde4dd;
}

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

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

@media (max-width: 760px) {
  .ops-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  .ops-filters label {
    min-width: 158px;
    scroll-snap-align: start;
  }

  .ops-hero {
    flex-direction: column;
    padding: 16px;
  }

  .hero-status-card {
    min-width: 0;
    padding: 12px;
  }

  .ops-metrics,
  .instance-stats,
  .service-grid,
  .processing-grid,
  .vps-meta {
    grid-template-columns: 1fr 1fr;
  }

  .instance-card header,
  .instance-card footer,
  .ops-alert {
    flex-direction: column;
    align-items: stretch;
  }

  .instance-card footer div {
    justify-content: flex-start;
  }
}

.cockpit-topbar {
  min-height: 62px;
  padding: 10px 18px;
}

.cockpit-topbar .topbar-title h1 {
  font-size: 21px;
}

.cockpit-topbar .topbar-title p {
  font-size: 12px;
}

.cockpit-canvas {
  gap: 10px;
  padding: 14px;
}

.cockpit-status,
.cockpit-card,
.signal-tile {
  border: 1px solid #314238;
  border-radius: 8px;
  background: #151f18;
}

.cockpit-status {
  min-height: 94px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-left: 4px solid #4edea3;
}

.cockpit-status.status-warning {
  border-left-color: #f7b955;
}

.cockpit-status h2 {
  margin: 7px 0 4px;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1;
}

.cockpit-status p {
  max-width: 860px;
  color: #bbcabf;
  font-size: 14px;
  line-height: 1.35;
}

.cockpit-status aside {
  min-width: 150px;
  display: grid;
  align-content: center;
  gap: 4px;
  color: #9ca3af;
  text-align: right;
  font-size: 12px;
}

.cockpit-status aside strong {
  color: #dde4dd;
  font-size: 18px;
}

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

.signal-tile {
  min-width: 0;
  min-height: 74px;
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  color: #dde4dd;
  text-align: left;
  cursor: pointer;
}

.signal-tile:hover {
  border-color: rgba(78, 222, 163, 0.58);
}

.signal-tile span {
  color: #9ca3af;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.signal-tile strong {
  font-size: 25px;
  line-height: 1;
}

.signal-tile small {
  color: #bbcabf;
  font-size: 12px;
}

.signal-warning {
  background: rgba(247, 185, 85, 0.075);
  border-color: rgba(247, 185, 85, 0.34);
}

.signal-success {
  background: rgba(78, 222, 163, 0.055);
}

.cockpit-main {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 10px;
  align-items: start;
}

.cockpit-card {
  min-width: 0;
  padding: 12px;
}

.compact-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 9px;
}

.compact-heading h2 {
  margin: 2px 0 0;
  font-size: 17px;
}

.compact-action {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
  white-space: nowrap;
}

.priority-list,
.client-health-list {
  display: grid;
  gap: 7px;
}

.priority-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #314238;
  border-left-width: 4px;
  border-radius: 8px;
  background: rgba(9, 16, 12, 0.5);
  padding: 9px 10px;
}

.priority-row strong,
.client-health-row strong {
  display: block;
  font-size: 13px;
}

.priority-row small {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  color: #9ca3af;
  font-size: 12px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.client-health-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(190px, 1.6fr) auto auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #314238;
  border-radius: 8px;
  background: rgba(9, 16, 12, 0.45);
  padding: 8px 10px;
  cursor: pointer;
}

.client-health-row:hover {
  border-color: rgba(78, 222, 163, 0.5);
}

.client-health-row small,
.client-health-row > span {
  color: #9ca3af;
  font-size: 12px;
}

.client-health-row > span strong {
  color: #dde4dd;
  font-size: 13px;
}

.drawer-body {
  display: grid;
  gap: 14px;
  padding-top: 16px;
}

.drawer-search {
  max-width: none;
}

.cockpit-drawer .ops-filters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cockpit-drawer .ops-filters label {
  min-width: 0;
}

.cockpit-drawer {
  width: min(620px, 100vw);
}

.drawer-client-list .client-health-row {
  grid-template-columns: minmax(190px, 1.5fr) auto auto auto;
}

.view-header-card {
  min-height: 92px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid #314238;
  border-radius: 8px;
  background: #151f18;
  padding: 16px;
}

.view-header-card h2 {
  margin: 4px 0;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1;
}

.view-header-card p {
  line-height: 1.35;
}

.billing-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

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

.integration-card,
.settings-card {
  min-width: 0;
  border: 1px solid #314238;
  border-radius: 8px;
  background: #151f18;
  padding: 14px;
}

.danger-zone-card {
  border-color: rgba(239, 91, 91, 0.38);
  background: rgba(40, 13, 13, 0.34);
}

.integration-card {
  display: grid;
  gap: 7px;
}

.integration-card strong {
  font-size: 19px;
}

.integration-card small {
  color: #9ca3af;
  line-height: 1.35;
}

.integration-card .status-chip {
  justify-self: start;
  margin-top: 3px;
}

.integration-card-action {
  border-color: rgba(247, 185, 85, 0.38);
}

.integration-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.integration-card-footer .status-chip {
  margin-top: 0;
}

/* Sparklines inside signal tiles */
.sparkline {
  display: block;
  width: 60px;
  height: 20px;
  margin-top: 4px;
  opacity: 0.85;
}

/* Alert timestamps */
.alert-time {
  display: inline-block;
  margin-top: 3px;
  color: #687986;
  font-size: 11px;
}

/* Messages bar chart */
.msgs-bar-section {
  border: 1px solid #253848;
  border-radius: 8px;
  background: #111a22;
}

.msgs-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9ca3af;
  font-size: 12px;
}

.msgs-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.msgs-legend-dot.msgs-recv { background: var(--primary); }
.msgs-legend-dot.msgs-sent { background: var(--cyan); }

.msgs-client-list {
  display: grid;
  gap: 16px;
  margin-top: 4px;
}

.msgs-client-row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 12px;
  align-items: center;
}

.msgs-client-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.msgs-client-info strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msgs-client-info small {
  color: #687986;
  font-size: 11px;
}

.client-avatar-sm {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 12px;
}

.msgs-bars {
  display: grid;
  gap: 6px;
}

.msgs-bar-row {
  display: grid;
  grid-template-columns: 62px 1fr 44px;
  align-items: center;
  gap: 8px;
}

.msgs-bar-label {
  color: #687986;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.msgs-bar-track {
  height: 8px;
  background: #1b2a36;
  border-radius: 4px;
  overflow: hidden;
}

.msgs-bar {
  height: 100%;
  border-radius: 4px;
  min-width: 3px;
  transition: width 0.4s ease;
}

.msgs-bar-recv { background: var(--primary); }
.msgs-bar-sent { background: var(--cyan); }

.msgs-bar-value {
  color: #9ca3af;
  font-size: 12px;
  text-align: right;
}

.msgs-total {
  color: #dde4dd;
  font-size: 15px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

/* Billing financial summary */
.billing-summary-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.billing-stat {
  display: grid;
  gap: 4px;
  border: 1px solid #253848;
  border-radius: 8px;
  background: #111a22;
  padding: 14px 16px;
}

.billing-stat strong {
  font-size: 24px;
  line-height: 1;
  color: var(--text);
}

.billing-stat small {
  color: #9ca3af;
  font-size: 12px;
}

.billing-table small {
  display: block;
  margin-top: 3px;
}

.billing-config-cell {
  display: grid;
  gap: 7px;
  min-width: 210px;
}

.client-profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin: 12px 0;
}

.client-profile-form label,
.temporary-unlock-row {
  display: grid;
  gap: 6px;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 750;
}

.client-profile-actions {
  display: flex;
  justify-content: flex-end;
  grid-column: 1 / -1;
}

.access-control-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.temporary-unlock-row {
  grid-template-columns: minmax(120px, 160px) auto;
  align-items: center;
}

.compact-input {
  width: 100%;
  height: 30px;
  border: 1px solid #314238;
  border-radius: 7px;
  background: #0a110d;
  color: #dde4dd;
  padding: 0 8px;
  font-size: 12px;
}

.compact-input:is(select) {
  appearance: none;
}

.settings-card h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

.settings-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.settings-card-title h2 {
  margin: 0;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.settings-list label {
  display: grid;
  gap: 6px;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 750;
}

.settings-list input {
  width: 100%;
  height: 38px;
  border: 1px solid #314238;
  border-radius: 8px;
  background: #0a110d;
  color: #dde4dd;
  padding: 0 10px;
}

.plan-manager-intro {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  color: #dde4dd;
}

.plan-manager-intro small {
  color: #9ca3af;
  line-height: 1.4;
}

.plan-editor-list {
  display: grid;
  gap: 12px;
}

.plan-editor-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #314238;
  border-radius: 8px;
  background: #111a14;
}

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

.plan-editor-head div,
.plan-price-field {
  display: grid;
  gap: 4px;
}

.plan-editor-head small,
.plan-price-field span {
  color: #9ca3af;
  font-size: 12px;
  line-height: 1.35;
}

.plan-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #dde4dd;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

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

.plan-editor-grid label,
.plan-price-field {
  color: #9ca3af;
  font-size: 12px;
  font-weight: 750;
}

.plan-editor-grid input,
.plan-price-field input {
  width: 100%;
  height: 36px;
  border: 1px solid #314238;
  border-radius: 8px;
  background: #0a110d;
  color: #dde4dd;
  padding: 0 10px;
}

.secrets-card {
  display: grid;
  gap: 14px;
}

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

.secrets-grid label {
  display: grid;
  gap: 6px;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 750;
}

.secrets-grid input,
.reminder-toolbar input,
.reminder-toolbar select,
.template-message {
  width: 100%;
  border: 1px solid #314238;
  border-radius: 8px;
  background: #0a110d;
  color: #dde4dd;
  padding: 0 10px;
}

.secrets-grid input,
.reminder-toolbar input,
.reminder-toolbar select {
  height: 40px;
}

.totp-setup-box {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(49, 66, 56, 0.8);
  border-radius: 8px;
  background: rgba(10, 17, 13, 0.42);
  padding: 12px;
}

.totp-setup-box label {
  display: grid;
  gap: 6px;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 750;
}

.totp-setup-box input {
  width: 100%;
  height: 40px;
  border: 1px solid #314238;
  border-radius: 8px;
  background: #0a110d;
  color: #dde4dd;
  padding: 0 10px;
}

.reminders-card {
  display: grid;
  gap: 14px;
}

.reminders-queue-card {
  display: grid;
  gap: 12px;
}

.reminder-queue-list {
  display: grid;
  gap: 8px;
}

.reminder-queue-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(49, 66, 56, 0.8);
  border-radius: 8px;
  background: rgba(10, 17, 13, 0.42);
  padding: 10px;
}

.reminder-queue-item strong,
.reminder-queue-item small {
  display: block;
}

.reminder-queue-item small {
  margin-top: 4px;
  color: #9ca3af;
}

.reminder-queue-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
  gap: 6px;
}

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

.reminder-toolbar label {
  display: grid;
  gap: 6px;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 750;
}

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

.template-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(49, 66, 56, 0.8);
  border-radius: 8px;
  background: rgba(10, 17, 13, 0.42);
  padding: 12px;
}

.template-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.template-card h3 {
  margin: 3px 0 0;
  font-size: 15px;
}

.template-message {
  min-height: 118px;
  resize: vertical;
  line-height: 1.4;
  padding: 10px;
}

.reminder-preview {
  border: 1px solid rgba(49, 66, 56, 0.8);
  border-left: 4px solid #4edea3;
  border-radius: 8px;
  background: rgba(9, 16, 12, 0.56);
  padding: 12px;
}

.reminder-preview p {
  margin-top: 6px;
  color: #dde4dd;
  line-height: 1.45;
}

.template-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.secrets-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-top: 1px solid rgba(49, 66, 56, 0.8);
  padding-top: 12px;
}

.secrets-footer p {
  max-width: 720px;
  font-size: 12px;
  line-height: 1.4;
}

.detail-header-card {
  align-items: center;
}

.detail-client-title .client-avatar {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.inline-actions {
  justify-content: flex-start;
  margin-top: 14px;
}

.detail-page {
  display: grid;
  gap: 10px;
}

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

.detail-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.detail-fields {
  display: grid;
  gap: 8px;
}

.detail-fields > div {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(49, 66, 56, 0.7);
  padding-bottom: 8px;
}

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

.detail-fields span {
  color: #9ca3af;
  font-size: 12px;
  font-weight: 750;
}

.detail-fields strong {
  min-width: 0;
  max-width: 65%;
  overflow-wrap: anywhere;
  color: #dde4dd;
  font-size: 13px;
  text-align: right;
}

.limit-detail-list {
  display: grid;
  gap: 10px;
}

.limit-detail-list article {
  display: grid;
  gap: 8px;
}

.limit-detail-list article > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #9ca3af;
  font-size: 12px;
}

.limit-detail-list strong {
  color: #dde4dd;
}

.detail-summary {
  margin: 0;
}

@media (max-width: 980px) {
  .cockpit-main {
    grid-template-columns: 1fr;
  }

  .integration-grid,
  .settings-grid,
  .secrets-grid,
  .template-grid,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .cockpit-topbar {
    min-height: 58px;
    flex-direction: row !important;
    align-items: center !important;
    padding: 9px 12px;
  }

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

  .cockpit-topbar .topbar-title h1 {
    font-size: 18px;
  }

  .cockpit-topbar .topbar-title p {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cockpit-topbar .top-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .cockpit-topbar .button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 0;
  }

  .cockpit-topbar .button svg {
    margin: 0;
  }

  .cockpit-topbar .icon-button {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .cockpit-canvas {
    gap: 9px;
    padding: 10px 12px 78px;
  }

  .cockpit-status {
    min-height: 100px;
    display: grid;
    gap: 8px;
    padding: 12px;
  }

  .cockpit-status h2 {
    font-size: 23px;
  }

  .cockpit-status p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .cockpit-status aside {
    display: none;
  }

  .signal-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .signal-tile {
    min-height: 70px;
    justify-items: center;
    padding: 8px 5px;
    text-align: center;
  }

  .signal-tile span {
    font-size: 9px;
  }

  .signal-tile strong {
    font-size: 18px;
  }

  .signal-tile small {
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
  }

  .cockpit-main {
    gap: 9px;
  }

  .cockpit-card {
    padding: 10px;
  }

  .compact-heading {
    margin-bottom: 7px;
  }

  .compact-heading h2 {
    font-size: 16px;
  }

  .priority-list {
    gap: 6px;
  }

  .priority-row {
    min-height: 48px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px;
  }

  .priority-row:nth-child(n+3) {
    display: none;
  }

  .priority-row small {
    -webkit-line-clamp: 1;
  }

  .priority-row .compact-action {
    min-height: 28px;
    padding: 0 8px;
  }

  .client-health-list {
    gap: 6px;
  }

  .client-health-row {
    min-height: 46px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 8px;
    padding: 7px 8px;
  }

  .client-health-row > span:nth-of-type(1),
  .client-health-row > span:nth-of-type(2) {
    display: none;
  }

  .client-health-row .client-avatar {
    width: 32px;
    height: 32px;
  }

  .client-health-row strong {
    font-size: 12px;
  }

  .client-health-row small {
    font-size: 11px;
  }

  .cockpit-drawer {
    width: 100vw;
  }

  .cockpit-drawer .ops-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .cockpit-drawer .ops-filters label {
    min-width: 0;
  }

  .view-header-card {
    min-height: 78px;
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
  }

  .view-header-card h2 {
    font-size: 21px;
  }

  .view-header-card .button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 12px;
  }

  .settings-card-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .integration-grid,
  .settings-grid,
  .secrets-grid,
  .template-grid,
  .reminder-toolbar,
  .detail-grid,
  .detail-summary {
    grid-template-columns: 1fr;
  }

  .reminder-queue-item,
  .client-profile-form,
  .temporary-unlock-row {
    grid-template-columns: 1fr;
  }

  .reminder-queue-item {
    align-items: stretch;
    flex-direction: column;
  }

  .secrets-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .detail-fields > div {
    display: grid;
    gap: 4px;
  }

  .detail-fields strong {
    max-width: none;
    text-align: left;
  }
}

/* ── Risk badges ──────────────────────────────────────────────────── */
.risk-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* ── Instance risk row ────────────────────────────────────────────── */
.instance-risk {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0 2px;
}

.instance-risk small {
  color: var(--subtle-text);
  font-size: 11px;
}

/* ── Wizard new-client drawer ─────────────────────────────────────── */
.wizard-form {
  gap: 10px;
}

.wizard-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--subtle-text);
}

.wizard-form input,
.wizard-form select {
  background: var(--input-bg, #1a1f2e);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  height: 34px;
  padding: 0 10px;
  outline: none;
  transition: border-color 0.15s;
}

.wizard-form input:focus,
.wizard-form select:focus {
  border-color: var(--accent);
}

.field-hint {
  font-size: 11px;
  color: var(--subtle-text);
  margin-top: -2px;
}

.wizard-step.hidden { display: none; }
.wizard-step h3 { font-size: 13px; margin-bottom: 10px; }

.install-progress {
  display: grid;
  gap: 14px;
  padding: 14px 0 4px;
}

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

.install-progress-head h3 {
  margin: 0;
}

.install-progress-head strong {
  color: #4edea3;
  font-size: 18px;
}

.install-progress-bar {
  height: 9px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #0f1117;
}

.install-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4edea3, #18c48f);
  transition: width 0.28s ease;
}

.install-stage-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.install-stage {
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--subtle-text);
  font-size: 11px;
  font-weight: 750;
  padding: 7px 8px;
  text-align: center;
}

.install-stage.active {
  border-color: rgba(78, 222, 163, 0.7);
  color: #ddf8ed;
  background: rgba(78, 222, 163, 0.12);
}

.mt-16 { margin-top: 16px; }

.wizard-success {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 0 16px;
}

.wizard-success svg {
  width: 28px;
  height: 28px;
  color: #4edea3;
}

.wizard-success h3 { font-size: 16px; margin: 0; }

.wizard-commands {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.wizard-cmd {
  display: block;
  background: var(--surface2, #0f1117);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11px;
  color: #4edea3;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: all;
}

.wizard-nginx summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--subtle-text);
  padding: 6px 0;
}

.wizard-nginx pre {
  font-size: 10px;
  font-family: monospace;
  background: var(--surface2, #0f1117);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  overflow-x: auto;
  max-height: 200px;
  overflow-y: auto;
  color: var(--subtle-text);
  white-space: pre;
}

/* ── Stripe actions in billing table ──────────────────────────────── */
.stripe-actions {
  gap: 4px;
}

.stripe-actions .compact-action {
  font-size: 11px;
  padding: 3px 8px;
  min-height: 26px;
  height: 26px;
}

.mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 10px;
  color: var(--subtle-text);
}

@media (max-width: 760px) {
  .billing-header-actions,
  .plan-editor-head {
    width: 100%;
    justify-content: flex-start;
  }

  .plan-editor-grid {
    grid-template-columns: 1fr;
  }
}
