@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap");

:root {
  --ink: #14201b;
  --muted: #5c6b63;
  --paper: #f3f6f4;
  --panel: #ffffff;
  --line: #d7e0db;
  --brand: #0b6e4f;
  --brand-ink: #083b2c;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(11, 110, 79, 0.12), transparent 36%),
    linear-gradient(180deg, #e8f0eb 0%, var(--paper) 42%, #eef3f0 100%);
  min-height: 100vh;
}

h1, h2, .brand-mark {
  font-family: "Fraunces", Georgia, serif;
}

.admin-nav {
  background: linear-gradient(120deg, #0b6e4f, #0f513f);
}

.nav-link--icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link--icon svg {
  opacity: 0.85;
}

.btn-nav-profile {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.28rem 0.7rem 0.28rem 0.35rem;
}

.btn-nav-profile:hover,
.btn-nav-profile:focus,
.btn-nav-profile.show {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-nav-profile__avatar {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.22);
}

.btn-nav-profile::after {
  margin-left: 0.15rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin-bottom: 0.25rem;
  font-size: 2rem;
}

.stat-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-tile span {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-tile strong {
  font-size: 1.8rem;
  font-family: "Fraunces", Georgia, serif;
}

.auth-page,
.customer-page {
  min-height: 100vh;
}

.auth-shell,
.customer-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card,
.customer-card {
  width: min(100%, 440px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: 0 18px 50px rgba(20, 32, 27, 0.08);
}

.customer-card {
  width: min(100%, 480px);
}

.brand-mark {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  color: var(--brand);
}

.btn-primary,
.btn-brand {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-ink);
  --bs-btn-hover-border-color: var(--brand-ink);
  background: var(--brand);
  border-color: var(--brand);
}

.btn-brand:hover {
  background: var(--brand-ink);
  border-color: var(--brand-ink);
}

.detail-list {
  display: grid;
  gap: 0.85rem;
  margin: 1.25rem 0 1.5rem;
}

.detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.65rem;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 500;
}

.detail-list dd {
  margin: 0;
  text-align: right;
}

.plan-option {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  cursor: pointer;
  background: #fff;
}

.plan-option span {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.plan-option em {
  font-style: normal;
  color: var(--muted);
}

.plan-option:has(input:checked) {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.table {
  background: var(--panel);
}

.stack-form .form-control,
.stack-form .form-select {
  border-radius: 0.7rem;
}

/* ?? Router discovery + managed device cards ?? */
.device-list {
  display: grid;
  gap: 0.65rem;
}

.discover-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.discover-card:hover {
  border-color: rgba(11, 110, 79, 0.45);
  box-shadow: 0 8px 22px rgba(20, 32, 27, 0.07);
}

.discover-card.is-selected {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
  background: rgba(11, 110, 79, 0.05);
}

.discover-card.is-registered {
  background: #f7faf8;
}

.discover-card__icon {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.7rem;
  display: grid;
  place-items: center;
  background: rgba(11, 110, 79, 0.1);
  color: var(--brand);
}

.discover-card__body {
  flex: 1;
  min-width: 0;
}

.discover-card__name {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
}

.discover-card__ip {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 0.15rem;
}

.discover-card__status {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.discover-card__status.is-ok {
  color: var(--brand);
  font-weight: 600;
}

.discover-card__status .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}

.discover-card__badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(11, 110, 79, 0.12);
  color: var(--brand-ink);
}

.router-search {
  border-radius: 0.65rem;
}

.router-card-list {
  display: grid;
  gap: 0.9rem;
}

.router-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.1rem 1.15rem 1rem;
  box-shadow: 0 8px 24px rgba(20, 32, 27, 0.04);
}

.router-card.is-offline {
  border-color: rgba(176, 50, 50, 0.25);
}

.router-card__main {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.router-card__identity {
  display: flex;
  gap: 0.85rem;
  min-width: 0;
}

.router-card__icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  background: rgba(11, 110, 79, 0.1);
  color: var(--brand);
  flex-shrink: 0;
}

.router-card.is-offline .router-card__icon {
  background: rgba(176, 50, 50, 0.1);
  color: #a32d2d;
}

.router-card__name {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.router-card__addr {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.router-card__status {
  text-align: right;
  flex-shrink: 0;
}

.router-card__health {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
  font-size: 0.75rem;
  color: var(--muted);
}

.router-card__health span {
  background: #eef1ef;
  padding: 0.12rem 0.4rem;
  border-radius: 0.35rem;
}

.rtt-badge {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.rtt-badge--excellent {
  background: #d8f3e5 !important;
  color: #0b6e4f;
}

.rtt-badge--good {
  background: #e7f0d8 !important;
  color: #4d6b1f;
}

.rtt-badge--fair {
  background: #fff3d6 !important;
  color: #8a6d00;
}

.rtt-badge--slow {
  background: #fde8e8 !important;
  color: #9b1c1c;
}

.rtt-badge--unknown {
  background: #eef1ef !important;
  color: var(--muted);
}

.rtt-checked {
  background: transparent !important;
  padding-left: 0 !important;
  color: var(--muted);
}

.router-card__stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 1rem 0 0.85rem;
  padding: 0.75rem 0.65rem;
  border-radius: 0.8rem;
  background: #f7faf8;
  border: 1px solid var(--line);
}

.router-card__stats .lbl {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.router-card__stats strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
}

.router-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.router-card__actions form {
  margin: 0;
}

/* Progressive Diagnostics drawer */
.diag-drawer {
  position: fixed;
  inset: 0;
  z-index: 1080;
  background: rgba(18, 28, 24, 0.38);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
}

.diag-drawer[hidden] {
  display: none !important;
}

.diag-drawer__panel {
  width: min(420px, 100%);
  background: var(--surface, #fff);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(20, 40, 30, 0.12);
  padding: 1.25rem 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.diag-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.diag-health {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, #f3f8f5, #e8f2ec);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}

.diag-health__score {
  font-family: "Fraunces", Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  color: #0b6e4f;
  min-width: 4.5rem;
}

.diag-health__score span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.diag-health__checks {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  font-size: 0.82rem;
}

.diag-health__checks li {
  margin: 0.15rem 0;
}

.diag-health__checks .is-bad {
  color: #9b1c1c;
}

.diag-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.diag-steps__item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  font-size: 0.86rem;
}

.diag-steps__item.is-pending {
  opacity: 0.72;
}

.diag-steps__item.is-ok {
  border-color: #b7dcc9;
  background: #f6fbf8;
}

.diag-steps__item.is-slow {
  border-color: #e8d48a;
  background: #fffdf5;
}

.diag-steps__item.is-fail {
  border-color: #e8b4b4;
  background: #fff6f6;
}

.diag-steps__label {
  font-weight: 600;
}

.diag-steps__detail,
.diag-steps__cmd {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.diag-steps__right {
  text-align: right;
  flex-shrink: 0;
}

.diag-steps__ms {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  color: var(--muted);
}

.diag-steps__mark {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.is-ok .diag-steps__mark { color: #0b6e4f; }
.is-slow .diag-steps__mark { color: #8a6d00; }
.is-fail .diag-steps__mark { color: #9b1c1c; }
.is-pending .diag-steps__mark { color: var(--muted); font-weight: 500; text-transform: none; }

@media (max-width: 575.98px) {
  .router-card__main {
    flex-direction: column;
  }

  .router-card__status {
    text-align: left;
  }

  .router-card__health {
    justify-content: flex-start;
  }

  .router-card__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .diag-drawer__panel {
    width: 100%;
  }
}

.device-ip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.device-ip:hover {
  border-color: var(--brand);
}

.device-ip.is-selected {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
  background: rgba(11, 110, 79, 0.06);
}

.device-ip.is-registered .device-ip__addr {
  opacity: 0.75;
}

.device-ip__addr {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
}

.device-ip__meta {
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.device-ip__meta em {
  font-style: normal;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #e7efe9;
  color: var(--brand-ink);
}

.selected-ip-pill {
  display: inline-block;
  padding: 0.55rem 0.85rem;
  border-radius: 0.7rem;
  background: rgba(11, 110, 79, 0.1);
  border: 1px solid rgba(11, 110, 79, 0.25);
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
}

.profile-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.25rem;
}

/* ?? Subscriber cards (ISP admin) ?? */
.subscriber-list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.subscriber-count {
  color: var(--muted);
  font-size: 0.875rem;
}

.subscriber-list {
  display: grid;
  gap: 0.85rem;
}

.sub-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.1rem 1.2rem 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  box-shadow: 0 1px 0 rgba(20, 32, 27, 0.03);
}

.sub-card:hover,
.sub-card:focus-visible {
  border-color: rgba(11, 110, 79, 0.45);
  box-shadow: 0 10px 28px rgba(20, 32, 27, 0.08);
  outline: none;
}

.sub-card--expiring_soon {
  border-color: rgba(180, 120, 20, 0.35);
}

.sub-card--expired,
.sub-card--failed,
.sub-card--provision_failed {
  border-color: rgba(176, 50, 50, 0.3);
}

.sub-card--disabled {
  opacity: 0.82;
}

.sub-card__main {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: flex-start;
}

.sub-card__identity {
  display: flex;
  gap: 0.9rem;
  min-width: 0;
  flex: 1;
}

.sub-avatar {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(145deg, #0b6e4f, #1a8f6a);
}

.sub-card:nth-child(4n+2) .sub-avatar {
  background: linear-gradient(145deg, #0f513f, #2a7a62);
}

.sub-card:nth-child(4n+3) .sub-avatar {
  background: linear-gradient(145deg, #1e5f74, #2d7a8f);
}

.sub-card:nth-child(4n+4) .sub-avatar {
  background: linear-gradient(145deg, #3d5a46, #5a7a62);
}

.sub-card__who {
  min-width: 0;
}

.sub-card__name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sub-card__name {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.25;
}

.sub-source {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1e5f74;
  background: rgba(30, 95, 116, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
}

.sub-card__user {
  margin-top: 0.15rem;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.9rem;
  color: #b03a4a;
  font-weight: 500;
}

.sub-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-top: 0.55rem;
}

.sub-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.sub-meta-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.sub-meta-item.is-urgent {
  color: #9a4b00;
  font-weight: 600;
}

.sub-card__stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
  flex-shrink: 0;
}

.sub-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: #eef1ef;
  color: #4a5550;
}

.sub-status__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.sub-status--active {
  background: rgba(11, 110, 79, 0.12);
  color: #0b6e4f;
}

.sub-status--expiring_soon {
  background: rgba(180, 120, 20, 0.14);
  color: #9a4b00;
}

.sub-status--expired,
.sub-status--failed,
.sub-status--provision_failed {
  background: rgba(176, 50, 50, 0.12);
  color: #a32d2d;
}

.sub-status--disabled {
  background: #e8e8e8;
  color: #3a3a3a;
}

.sub-status--pending,
.sub-status--missing_on_router {
  background: #eef1ef;
  color: #5c6b63;
}

.sub-plan {
  text-align: right;
  line-height: 1.2;
}

.sub-plan__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.1rem;
}

.sub-plan__value {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.sub-plan__copy {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.sub-plan__copy:hover {
  color: var(--ink);
}

.sub-plan__copy.is-copied {
  color: #0b6e4f;
  text-decoration: none;
}

.sub-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.sub-card__actions form {
  display: inline;
  margin: 0;
}

.btn-renew {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--brand-ink);
  --bs-btn-hover-border-color: var(--brand-ink);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #8aa99a;
  --bs-btn-disabled-border-color: #8aa99a;
  font-weight: 600;
}

.sub-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed var(--line);
  border-radius: 1rem;
}

@media (max-width: 575.98px) {
  .sub-card__main {
    flex-direction: column;
  }

  .sub-card__stats {
    align-items: flex-start;
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ?? Compact flash toasts ?? */
.toast-stack {
  position: fixed;
  top: 4.5rem;
  right: 1rem;
  z-index: 1080;
  display: grid;
  gap: 0.55rem;
  width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.flash-toast {
  pointer-events: auto;
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.35;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(20, 32, 27, 0.14);
  animation: toast-in 0.25s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.flash-toast.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
}

.flash-toast--ok {
  border-color: rgba(11, 110, 79, 0.28);
  background: #f3faf6;
  color: #0b6e4f;
}

.flash-toast--error {
  border-color: rgba(176, 50, 50, 0.3);
  background: #fff5f5;
  color: #a32d2d;
}

.flash-toast__icon {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(11, 110, 79, 0.15);
  color: inherit;
}

.flash-toast--error .flash-toast__icon {
  background: rgba(176, 50, 50, 0.15);
}

.flash-toast__link {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  word-break: break-all;
}

.flash-toast__link a {
  color: inherit;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ?? Create / edit subscriber panel ?? */
.form-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 0;
  box-shadow: 0 14px 40px rgba(20, 32, 27, 0.07);
  overflow: hidden;
}

.form-panel__header {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1.25rem 1.35rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 110, 79, 0.06), transparent);
}

.form-panel__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  background: rgba(11, 110, 79, 0.12);
  color: var(--brand);
}

.form-panel__title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.form-panel__desc {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.form-panel__desc code {
  font-size: 0.8rem;
  color: #b03a4a;
}

.form-section {
  padding: 1.15rem 1.35rem 0.25rem;
  border-bottom: 1px solid var(--line);
}

.form-section--flush {
  margin: 0;
  padding-bottom: 1.1rem;
}

.form-section--check {
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-bottom: none;
}

.form-section__title {
  margin: 0 0 0.85rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-label--icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--ink);
}

.form-label--icon svg {
  opacity: 0.65;
  color: var(--brand);
}

.form-hint {
  margin-top: 0.45rem;
  font-size: 0.825rem;
  color: var(--muted);
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.4rem;
}

.password-field .form-control {
  min-width: 0;
}

.password-field__toggle {
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}

.payment-preview {
  margin: 0.25rem 0 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 0.8rem;
  background: rgba(11, 110, 79, 0.05);
  border: 1px dashed rgba(11, 110, 79, 0.28);
}

.payment-preview__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.payment-preview__url {
  display: block;
  font-size: 0.8rem;
  color: var(--brand-ink);
  word-break: break-all;
}

.payment-preview__note {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.create-summary {
  margin: 0 1.35rem 0;
  padding: 1rem 1.05rem;
  border-radius: 0.85rem;
  background: #f7faf8;
  border: 1px solid var(--line);
}

.create-summary__title {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.create-summary__list {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.create-summary__list > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.create-summary__list dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.825rem;
  font-weight: 500;
}

.create-summary__list dd {
  margin: 0;
  text-align: right;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.form-panel__actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.35rem 1.25rem;
  border-top: 1px solid var(--line);
  background: rgba(243, 246, 244, 0.65);
}

.btn-create {
  min-width: 10.5rem;
  font-weight: 650;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (max-width: 575.98px) {
  .password-field {
    grid-template-columns: 1fr auto;
  }

  .password-field [data-password-generate] {
    grid-column: 1 / -1;
  }

  .form-panel__actions {
    flex-direction: column-reverse;
  }

  .form-panel__actions .btn {
    width: 100%;
  }
}

/* ?? Operational dashboard ?? */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.95rem 1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 1px 0 rgba(20, 32, 27, 0.03);
}

.kpi-card--warn {
  border-color: rgba(180, 120, 20, 0.35);
  background: linear-gradient(180deg, #fffbf3, #fff);
}

.kpi-card__top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.kpi-card__icon {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.5rem;
  display: grid;
  place-items: center;
  background: rgba(11, 110, 79, 0.1);
  color: var(--brand);
}

.kpi-card__icon--live {
  background: rgba(30, 95, 116, 0.12);
  color: #1e5f74;
}

.kpi-card__icon--warn {
  background: rgba(180, 120, 20, 0.14);
  color: #9a4b00;
}

.kpi-card__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.kpi-card__value {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 0.2rem;
}

.kpi-card__value--money {
  font-size: 1.45rem;
}

.kpi-card__meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.kpi-card__meta.is-ok {
  color: var(--brand);
  font-weight: 600;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.status-chip .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.status-chip--active { color: #0b6e4f; background: rgba(11, 110, 79, 0.08); border-color: transparent; }
.status-chip--pending { color: #5c6b63; background: #eef1ef; border-color: transparent; }
.status-chip--soon { color: #9a4b00; background: rgba(180, 120, 20, 0.12); border-color: transparent; }
.status-chip--expired { color: #a32d2d; background: rgba(176, 50, 50, 0.1); border-color: transparent; }
.status-chip--disabled { color: #3a3a3a; background: #e8e8e8; border-color: transparent; }

.dash-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem 1.1rem 0.85rem;
  box-shadow: 0 8px 24px rgba(20, 32, 27, 0.04);
}

.dash-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.dash-panel__head a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.dash-table code.dash-username {
  color: #b03a4a;
  font-size: 0.85rem;
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.dash-user__avatar {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #0b6e4f, #1a8f6a);
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 2rem 1.25rem;
}

.empty-state--inline {
  padding: 1.5rem 0.5rem;
}

.empty-state__icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  background: rgba(11, 110, 79, 0.08);
  color: var(--brand);
}

.chart-placeholder {
  padding: 0.5rem 0.25rem 0.75rem;
}

.chart-placeholder__bars {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  height: 5.5rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.25rem;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, rgba(11, 110, 79, 0.05), transparent);
}

.chart-placeholder__bars span {
  flex: 1;
  height: var(--h);
  border-radius: 0.35rem 0.35rem 0.15rem 0.15rem;
  background: linear-gradient(180deg, rgba(11, 110, 79, 0.45), rgba(11, 110, 79, 0.18));
}

/* ?? Plans & profiles page ?? */
.profiles-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
}

.profiles-toolbar__router {
  min-width: min(100%, 260px);
}

.profiles-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.router-mini {
  flex: 1;
  min-width: min(100%, 280px);
  padding: 0.7rem 0.9rem;
  border-radius: 0.85rem;
  background: var(--panel);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.router-mini:hover {
  border-color: rgba(11, 110, 79, 0.35);
  box-shadow: 0 8px 22px rgba(20, 32, 27, 0.06);
  transform: translateY(-1px);
  color: inherit;
}

.router-mini.is-offline {
  border-color: rgba(176, 50, 50, 0.28);
}

.router-mini__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.router-mini__identity {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  min-width: 0;
}

.router-mini__globe {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.5rem;
  display: grid;
  place-items: center;
  background: rgba(11, 110, 79, 0.1);
  color: var(--brand);
  flex-shrink: 0;
}

.router-mini__name {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
}

.router-mini__host {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.router-mini__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4.5rem, 1fr));
  gap: 0.45rem 0.65rem;
  margin-top: 0.7rem;
}

.router-mini__stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.router-mini__stat span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 650;
}

.router-mini__stat strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}

.router-mini__footer {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--muted);
}

.router-mini__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.4rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.router-mini__meta > span:not(.sub-status) {
  background: #eef1ef;
  padding: 0.12rem 0.4rem;
  border-radius: 0.35rem;
}

.form-panel__header--split {
  align-items: center;
  gap: 0.85rem;
}

.plan-search {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: min(100%, 200px);
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #f7faf8;
  color: var(--muted);
  flex-shrink: 0;
}

.plan-search input {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
  min-width: 0;
}

.plan-search input:focus {
  box-shadow: none;
}

.plans-table-wrap {
  max-height: min(62vh, 560px);
  overflow: auto;
}

.plans-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  box-shadow: inset 0 -1px 0 var(--line);
}

.plan-name-cell {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
}

.plan-name-cell__icon {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.45rem;
  display: grid;
  place-items: center;
  background: rgba(11, 110, 79, 0.1);
  color: var(--brand);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.plan-metric {
  font-weight: 600;
  white-space: nowrap;
}

.plan-users {
  font-weight: 650;
  color: var(--muted);
}

.plan-users.is-used {
  color: var(--ink);
}

.plan-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.plan-switch__track {
  width: 2.35rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #d5ddd8;
  position: relative;
  transition: background 0.15s ease;
}

.plan-switch__knob {
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 32, 27, 0.2);
  transition: transform 0.15s ease;
}

.plan-switch.is-on .plan-switch__track {
  background: var(--brand);
}

.plan-switch.is-on .plan-switch__knob {
  transform: translateX(1.05rem);
}

.plan-switch__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  min-width: 1.5rem;
}

.plan-switch.is-on .plan-switch__label {
  color: var(--brand);
}

.plan-actions {
  display: inline-flex;
  gap: 0.25rem;
  justify-content: flex-end;
}

.plan-action-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  padding: 0;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.plan-action-btn:hover {
  background: #f7faf8;
  border-color: rgba(11, 110, 79, 0.28);
  color: var(--brand);
}

.plan-action-btn--danger {
  color: #a33a3a;
}

.plan-action-btn--danger:hover {
  background: rgba(176, 50, 50, 0.08);
  border-color: rgba(176, 50, 50, 0.28);
  color: #8f2c2c;
}

.clone-source {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.7rem;
  background: rgba(11, 110, 79, 0.06);
  border: 1px solid rgba(11, 110, 79, 0.12);
  font-size: 0.84rem;
}

.clone-source--warn {
  background: #f7faf8;
  border-color: var(--line);
}

.clone-source__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  width: 100%;
}

.plan-preview {
  padding: 0.85rem 0.95rem;
  border-radius: 0.8rem;
  background: #f7faf8;
  border: 1px solid var(--line);
}

.plan-preview__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.plan-preview__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line);
}

.plan-preview__row:last-child {
  border-bottom: none;
}

.plan-preview__row span {
  color: var(--muted);
}

.plan-delete-impact {
  padding: 0.85rem 0.95rem;
  border-radius: 0.75rem;
  background: rgba(176, 50, 50, 0.06);
  border: 1px solid rgba(176, 50, 50, 0.15);
}

.plan-delete-impact__users {
  font-weight: 650;
  margin-bottom: 0.35rem;
}

.plan-delete-modal .modal-content {
  border-radius: 1rem;
  border: 1px solid var(--line);
}

.form-panel__header .router-search {
  align-self: center;
}

/* ?? Payments dashboard ?? */
.pay-filters {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0 1.35rem 1rem;
}

.pay-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.pay-row:hover,
.pay-row:focus-visible {
  background: rgba(11, 110, 79, 0.05);
  outline: none;
}

.provider-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 650;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #eef1ef;
  color: var(--ink);
  white-space: nowrap;
}

.provider-pill--mock {
  background: rgba(30, 95, 116, 0.12);
  color: #1e5f74;
}

.provider-pill--fapshi {
  background: rgba(180, 120, 20, 0.14);
  color: #9a4b00;
}

.provider-pill--flutterwave {
  background: rgba(245, 130, 32, 0.14);
  color: #b35a00;
}

.provider-pill--mtn {
  background: rgba(255, 204, 0, 0.28);
  color: #5c4b00;
}

.provider-pill--orange {
  background: rgba(255, 121, 0, 0.16);
  color: #b34a00;
}

.pay-detail-modal .modal-content {
  border-radius: 1rem;
  border: 1px solid var(--line);
}

.pay-detail-list {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.pay-detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}

.pay-detail-list dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.875rem;
}

.pay-detail-list dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  font-size: 0.9rem;
  word-break: break-word;
}

@media (max-width: 991.98px) {
  .pay-filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 575.98px) {
  .pay-filters {
    grid-template-columns: 1fr;
  }
}

.router-card.is-selected {
  border-color: rgba(11, 110, 79, 0.4);
  box-shadow: 0 0 0 2px rgba(11, 110, 79, 0.12);
}

.payment-config-status {
  padding: 0.75rem 0.85rem;
  border-radius: 0.7rem;
  background: #f7faf8;
  border: 1px solid var(--line);
}

.payment-config-status code {
  font-size: 0.78em;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 767.98px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
}

.settings-nav {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
}

.settings-nav__title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.settings-nav__list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.settings-nav__link {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 0.5rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 550;
}

.settings-nav__link:hover {
  background: #f7faf8;
  color: var(--brand);
}

.settings-nav__link.is-active {
  background: rgba(11, 110, 79, 0.1);
  color: var(--brand);
}

.settings-nav__link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.settings-panel {
  margin: 0;
}

.settings-panel--scroll,
.settings-layout .settings-panel:has(.table-responsive) {
  display: flex;
  flex-direction: column;
}

.settings-panel--scroll .form-panel__header,
.settings-layout .settings-panel:has(.table-responsive) > .form-panel__header {
  flex-shrink: 0;
}

.table-scroll-panel,
.settings-layout .settings-panel .table-responsive {
  max-height: min(32rem, calc(100vh - 14rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.table-scroll-panel thead th,
.settings-layout .settings-panel .table-responsive thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f7f5;
  box-shadow: 0 1px 0 var(--line);
}

.ops-sql-cell {
  max-width: 0;
  width: 55%;
}

.ops-sql-query,
.ops-cell-truncate {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ops-mikrotik-panel {
  max-height: calc(100vh - 7rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ops-trace-panel {
  max-height: calc(100vh - 7rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ops-trace-panel > .form-panel__header {
  flex-shrink: 0;
}

.ops-trace-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-bottom: 1rem;
}

.ops-mikrotik-panel > .form-panel__header,
.ops-mikrotik-summary,
.ops-mikrotik-commands,
.ops-mikrotik-log .ops-filter-tabs {
  flex-shrink: 0;
}

.ops-mikrotik-log {
  flex: 1 1 auto;
  min-height: 10rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.table-scroll-panel.table-scroll-panel--compact,
.settings-layout .settings-panel .table-responsive.table-scroll-panel--compact {
  max-height: 10rem;
}

.settings-layout .settings-panel .table-responsive.table-scroll-panel--fill,
.ops-mikrotik-log .table-scroll-panel.table-scroll-panel--fill {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.ops-mikrotik-cmd {
  max-width: 0;
  width: 22%;
}

.ops-mikrotik-detail {
  max-width: 0;
  width: 28%;
}

.env-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

.env-badge--live {
  background: rgba(11, 110, 79, 0.14);
  color: #0B6E4F;
}

.env-badge--sandbox {
  background: rgba(180, 110, 20, 0.16);
  color: #9a4b00;
}

.env-badge--sm {
  padding: 0.15rem 0.45rem;
  font-size: 0.68rem;
}

.env-badge--live::before,
.env-badge--sandbox::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}

.connection-status {
  padding: 0.9rem 1rem;
  border-radius: 0.8rem;
  background: #f7faf8;
  border: 1px solid var(--line);
}

.connection-status.is-ok {
  border-color: rgba(11, 110, 79, 0.28);
  background: rgba(11, 110, 79, 0.06);
}

.connection-status.is-bad {
  border-color: rgba(176, 50, 50, 0.25);
  background: rgba(176, 50, 50, 0.05);
}

.connection-status__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.connection-status__label {
  color: var(--muted);
}

.secret-display {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #f7faf8;
}

.secret-display code {
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.pay-wait-pulse {
  width: 3rem;
  height: 3rem;
  margin: 1.25rem auto;
  border-radius: 50%;
  border: 3px solid rgba(11, 110, 79, 0.2);
  border-top-color: var(--brand, #0B6E4F);
  animation: pay-spin 0.9s linear infinite;
}

@keyframes pay-spin {
  to { transform: rotate(360deg); }
}

.app-footer {
  margin-top: 2.5rem;
  padding: 1rem 0 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}

.license-banner {
  background: #9a4b00;
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
}

body.customer-page .app-footer {
  margin-top: 1.5rem;
}

.auth-logo {
  display: block;
  max-height: 48px;
  max-width: 160px;
  margin: 0 auto 0.75rem;
  object-fit: contain;
}

.settings-layout--branding {
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
}

.branding-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 991.98px) {
  .branding-grid {
    grid-template-columns: 1fr;
  }
}

.branding-preview {
  position: sticky;
  top: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: #f7faf8;
}

.branding-preview__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.65rem;
}

.branding-preview__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.branding-preview__tabs button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  color: var(--ink);
}

.branding-preview__tabs button.is-active {
  background: rgba(11, 110, 79, 0.12);
  border-color: transparent;
  color: var(--brand);
}

.branding-preview__panel {
  display: none;
}

.branding-preview__panel.is-active {
  display: block;
}

.preview-portal {
  --preview-primary: #0B6E4F;
  --preview-secondary: #14201b;
  border-radius: 0.85rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
}

.preview-portal__hero {
  padding: 1.25rem 1rem 1rem;
  background: linear-gradient(160deg, var(--preview-secondary), #0a1511 55%, var(--preview-primary));
  color: #fff;
  text-align: center;
}

.preview-portal__logo {
  max-height: 36px;
  max-width: 120px;
  margin: 0 auto 0.5rem;
  display: block;
  object-fit: contain;
}

.preview-portal__brand {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
}

.preview-portal__sub {
  font-size: 0.8rem;
  opacity: 0.85;
  margin: 0 0 0.85rem;
}

.preview-portal__cta {
  border: 0;
  border-radius: 0.5rem;
  background: var(--preview-primary);
  color: #fff;
  font-weight: 650;
  font-size: 0.8rem;
  padding: 0.45rem 1rem;
  pointer-events: none;
}

.preview-portal__meta {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
  padding: 0.65rem 0.75rem;
}

.preview-doc {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  overflow: hidden;
  padding-bottom: 0.75rem;
}

.preview-doc__bar {
  height: 6px;
  background: #0B6E4F;
}

.preview-doc__head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 0.9rem 0.35rem;
  font-size: 0.85rem;
}

.preview-doc__line,
.preview-doc__foot {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
  padding: 0 0.9rem;
}

.preview-doc__row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  border-top: 1px dashed var(--line);
  margin-top: 0.5rem;
}

.preview-doc__foot {
  margin-top: 0.65rem;
}

.form-section__title {
  font-size: 0.95rem;
  font-weight: 650;
  margin: 0 0 0.35rem;
}

/* Operations Center */
.ops-live-dot {
  color: #0b6e4f;
  font-size: 0.8rem;
  font-weight: 700;
}

.ops-table .ops-row {
  cursor: pointer;
}

.ops-table .ops-row:hover {
  background: #f7faf8;
}

.ops-row--slow {
  background: #fff8e8;
}

.ops-row--fail {
  background: #fff8f8;
}

.ops-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ops-filter-tabs__item {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  background: #fff;
}

.ops-filter-tabs__item:hover {
  color: inherit;
  border-color: #9bb5a8;
}

.ops-filter-tabs__item.is-active {
  color: #0b6e4f;
  border-color: #0b6e4f;
  background: #eef7f3;
  font-weight: 600;
}

.ops-conn-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.88rem;
}

.ops-suggestions {
  padding: 0.85rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid #e6d28a;
  background: #fffaf0;
  font-size: 0.88rem;
}

.ops-suggestions ul {
  padding-left: 1.1rem;
}

.ops-grade {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid var(--line);
  background: #f7faf8;
}

.ops-grade__mark {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  min-width: 2.75rem;
  text-align: center;
  padding: 0.35rem 0.25rem;
  border-radius: 0.5rem;
  background: #e8eeeb;
  color: #0b6e4f;
}

.ops-grade__mark--a { background: #d8f3e7; color: #0b6e4f; }
.ops-grade__mark--b { background: #eef6d8; color: #5a6b00; }
.ops-grade__mark--c { background: #fff3cd; color: #8a5a00; }
.ops-grade__mark--d,
.ops-grade__mark--f { background: #fde8e8; color: #9b1c1c; }

.ops-grade__body {
  flex: 1;
  font-size: 0.88rem;
}

.ops-grade__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.35rem 1rem;
  margin-top: 0.5rem;
}

.ops-grade__k {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ops-grade__body ul {
  padding-left: 1.1rem;
  margin: 0;
}

.ops-grade__cats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.75rem;
  margin-top: 0.75rem;
}

.ops-grade__cat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.05rem 0.5rem;
  padding: 0.45rem 0.55rem;
  background: #f4f7f5;
  border-radius: 0.4rem;
  font-size: 0.8rem;
}

.ops-grade__cat-name { color: var(--muted); }
.ops-grade__cat-score { font-variant-numeric: tabular-nums; }
.ops-grade__cat-ms {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.72rem;
}

.ops-compare-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.ops-compare-summary__item {
  padding: 0.85rem 1rem;
  background: #f4f7f5;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
}

.ops-compare-summary__item.is-good {
  background: #d8f3e5;
  border-color: #b7dcc9;
}

.ops-compare-summary__item.is-bad {
  background: #fde8e8;
  border-color: #e8b4b4;
}

.ops-compare-summary__l {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.ops-compare-summary__item strong {
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.ops-row--improved td:first-child {
  font-weight: 600;
}

.ops-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .ops-compare-grid { grid-template-columns: 1fr; }
}

.ops-tree {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  font-size: 0.88rem;
}

.ops-tree ul {
  list-style: none;
  margin: 0.25rem 0 0.25rem 1.1rem;
  padding: 0;
  border-left: 1px solid var(--line);
}

.ops-tree li {
  padding: 0.2rem 0 0.2rem 0.65rem;
  position: relative;
}

.ops-tree__label {
  font-weight: 600;
  margin-right: 0.5rem;
}

.ops-tree__detail {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}

.ops-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
}

.ops-badge--ok {
  background: rgba(11, 110, 79, 0.12);
  color: #0b6e4f;
}

.ops-badge--bad {
  background: rgba(176, 0, 32, 0.1);
  color: #9b1c1c;
}

.ops-badge--warn {
  background: rgba(180, 120, 0, 0.12);
  color: #8a5a00;
}

.ops-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ops-stat {
  min-width: 6.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: #fff;
}

.ops-stat__n {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: "Fraunces", Georgia, serif;
}

.ops-stat__l {
  font-size: 0.75rem;
  color: var(--muted);
}

.ops-stat--bad .ops-stat__n { color: #9b1c1c; }
.ops-stat--warn .ops-stat__n { color: #8a5a00; }

.ops-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.5rem 0 1rem;
}

.ops-timeline__item {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid var(--line);
  border-left-width: 3px;
}

.ops-timeline__item.is-ok { border-left-color: #0b6e4f; }
.ops-timeline__item.is-fail { border-left-color: #9b1c1c; background: #fff8f8; }
.ops-timeline__item.is-slow { border-left-color: #c48a00; background: #fffaf0; }

.ops-timeline__time {
  font-size: 0.78rem;
  color: var(--muted);
}

.ops-timeline__body {
  position: relative;
}

.ops-timeline__mark {
  float: right;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0b6e4f;
}

.ops-timeline__item.is-fail .ops-timeline__mark { color: #9b1c1c; }
.ops-timeline__item.is-slow .ops-timeline__mark { color: #8a5a00; }

.ops-pre,
.ops-console {
  background: #14201b;
  color: #d7ebe1;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  max-height: 28rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.ops-console {
  min-height: 18rem;
  font-family: ui-monospace, Consolas, monospace;
}

.ops-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.ops-health-card {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: #fff;
}

.ops-health-card__dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  margin-top: 0.35rem;
  background: #9b1c1c;
  flex-shrink: 0;
}

.ops-health-card.is-ok .ops-health-card__dot {
  background: #0b6e4f;
}

/* Enterprise Performance Analyzer */
.ops-verdict {
  margin: 0.75rem 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 0.65rem;
  background: #f4f8f6;
  border: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.45;
}

.ops-analyzer {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 900px) {
  .ops-analyzer { grid-template-columns: 1fr; }
}

.ops-phase-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0 0.75rem;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.ops-phase-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ops-phase-list__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.4rem 0;
  border-bottom: 1px solid #eef2f0;
  font-size: 0.88rem;
}

.ops-phase-list__meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.ops-ms {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.86rem;
}

.ops-ms--green { color: #0b6e4f; }
.ops-ms--yellow { color: #8a6d00; }
.ops-ms--orange { color: #c45c00; }
.ops-ms--red { color: #9b1c1c; }

.ops-waterfall {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ops-waterfall__row {
  display: grid;
  grid-template-columns: 7.5rem 1fr 4.5rem;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
}

.ops-waterfall__label {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ops-waterfall__track {
  height: 0.55rem;
  background: #e8eeeb;
  border-radius: 999px;
  overflow: hidden;
}

.ops-waterfall__bar {
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
}

.ops-waterfall__bar--green { background: #0b6e4f; }
.ops-waterfall__bar--yellow { background: #c9a227; }
.ops-waterfall__bar--orange { background: #d97706; }
.ops-waterfall__bar--red { background: #9b1c1c; }

.ops-waterfall__ms {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.ops-band-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
  align-items: center;
}

.ops-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.25rem;
  vertical-align: middle;
}

.ops-dot--green { background: #0b6e4f; }
.ops-dot--yellow { background: #c9a227; }
.ops-dot--orange { background: #d97706; }
.ops-dot--red { background: #9b1c1c; }

.ops-timeline__title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.15rem;
}

.ops-timeline__title-row .ops-timeline__mark {
  float: none;
  margin-left: auto;
}

.ops-slow-flag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a5a00;
  background: #fff3cd;
  border: 1px solid #e6d28a;
  border-radius: 0.35rem;
  padding: 0.1rem 0.4rem;
}

.ops-ros-cmd {
  font-size: 0.78rem;
  margin-top: 0.2rem;
}

.ops-ros-cmd code {
  background: #f0f4f2;
  padding: 0.15rem 0.4rem;
  border-radius: 0.35rem;
}

/* —— Super Admin dashboard —— */
body.page-super-admin {
  background: #f7f9f8;
}

.super-admin .super-kpi-row {
  --bs-gutter-y: 1rem;
}

.super-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.super-status--ok {
  color: var(--brand);
  border-color: rgba(11, 110, 79, 0.25);
  background: rgba(11, 110, 79, 0.06);
}

.super-status--warn {
  color: #9a4b00;
  border-color: rgba(180, 120, 20, 0.35);
  background: rgba(180, 120, 20, 0.08);
}

.super-status__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentColor;
}

.super-system-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.65rem;
}

.super-system-strip__item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
}

.super-system-strip__item.is-ok {
  border-color: rgba(11, 110, 79, 0.2);
}

.super-system-strip__item.is-bad {
  border-color: rgba(176, 50, 50, 0.35);
  background: #fffafa;
}

.super-system-strip__name {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.super-system-strip__detail {
  display: block;
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.super-health-dl dt {
  color: var(--muted);
  font-weight: 500;
}

.audit-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  line-height: 1.3;
}

.audit-badge--success {
  color: #0b6e4f;
  background: rgba(11, 110, 79, 0.12);
}

.audit-badge--warning {
  color: #9a4b00;
  background: rgba(180, 120, 20, 0.14);
}

.audit-badge--info {
  color: #1e5f74;
  background: rgba(30, 95, 116, 0.12);
}

.audit-badge--danger {
  color: #a12828;
  background: rgba(176, 50, 50, 0.12);
}

.audit-badge--secondary {
  color: #5c6b63;
  background: #eef1ef;
}

.super-audit-panel {
  display: flex;
  flex-direction: column;
}

.super-audit-panel .dash-panel__head {
  flex-shrink: 0;
}

.super-audit-panel .super-audit-feed {
  max-height: min(26rem, calc(100vh - 14rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.super-audit-feed .list-group-item {
  border-color: var(--line);
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.super-audit-item__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.super-audit-item__time {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.super-audit-item__actor {
  font-size: 0.88rem;
  font-weight: 600;
}

.super-audit-item__detail {
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

.super-live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #1e5f74;
  box-shadow: 0 0 0 0 rgba(30, 95, 116, 0.45);
  animation: super-live-pulse 2s infinite;
}

@keyframes super-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(30, 95, 116, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(30, 95, 116, 0); }
  100% { box-shadow: 0 0 0 0 rgba(30, 95, 116, 0); }
}

.super-tenant-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

