/* ==========================================================================
   Unknown Proxies — admin dashboard theme
   Tokens mirror the customer site (src/app.css in the unknown-proxies repo):
   dark #15171b / #1a1d22 / #1d2025 / #282b31, brand #00cc99, text #c1c9d5
   and #828c9b, hairlines from #979797. Bootstrap 5 stays for layout, modals
   and dropdowns; this sheet re-skins it. Everything sits on a 4px grid.
   ========================================================================== */

@font-face {
  font-family: "SwissPostersRegular";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("/fonts/SwissPostersRegular.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  --bg: #15171b;
  --surface-1: #1a1d22;
  --surface-2: #1d2025;
  --surface-3: #282b31;
  --raised: #3a3e47;
  --raised-hover: #464c58;

  --text: #f5f6f8;
  --text-2: #c1c9d5;
  --text-3: #828c9b;
  --placeholder: #949dab;        /* --text-3 is 4.17:1 on control fills */

  --brand: #00cc99;
  --brand-ink: #00cc99;          /* brand used as text on this surface */
  --brand-fill: #00b78a;         /* primary button fill (site green-button) */
  --brand-fill-hover: #00cc99;
  --brand-fill-shadow: #00724f;

  --ok: #00cc99;
  --warn: #fbbf24;
  --danger: #f87171;
  --danger-fill: #dc2626;
  --danger-ink: #fca5a5;         /* danger text on raised controls */
  --danger-fill-hover: #ef4444;

  --hairline: rgba(151, 151, 151, 0.18);
  --hairline-strong: rgba(151, 151, 151, 0.3);
  --focus-ring: rgba(0, 204, 153, 0.25);
  --focus-outline: #00cc99;
  --on-brand: #04241b;           /* text on brand fills; white fails contrast */

  --neutral-bar: #6b7280;
  --stranded: rgba(151, 151, 151, 0.28);

  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-swiss: "SwissPostersRegular", var(--font-ui);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms;
  --t-enter: 400ms;

  --sidebar-w: 270px;
  --content-max: 1200px;

  --r-ctl: 8px;
  --r-card: 12px;
  --r-panel: 16px;
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #ffffff;
  --surface-1: #f5f7fa;
  --surface-2: #eef0f4;
  --surface-3: #e4e7ec;
  --raised: #d5d9e0;
  --raised-hover: #cdd1d9;

  --text: #111827;
  --text-2: #4b5563;
  --text-3: #5b6472;
  --placeholder: #5b6472;

  --brand-ink: #007a5b;
  --ok: #00a67d;
  --warn: #b45309;
  --danger: #b91c1c;
  --danger-ink: #a51b1b;

  --hairline: rgba(107, 114, 128, 0.22);
  --hairline-strong: rgba(107, 114, 128, 0.35);
  --neutral-bar: #7b8391;
  --stranded: rgba(107, 114, 128, 0.35);
  --focus-outline: #007a5b;
}

/* --------------------------------------------------------------------------
   Bootstrap variable bridge
   -------------------------------------------------------------------------- */

html[data-bs-theme],
body {
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-body-font-family: var(--font-ui);
  --bs-body-font-size: 0.875rem;
  --bs-body-line-height: 1.43;
  --bs-border-color: var(--hairline);
  --bs-border-color-translucent: var(--hairline);
  --bs-secondary-color: var(--text-3);
  --bs-tertiary-color: var(--text-3);
  --bs-tertiary-bg: var(--surface-3);
  --bs-secondary-bg: var(--surface-2);
  --bs-link-color: var(--brand-ink);
  --bs-link-hover-color: var(--brand-ink);
  --bs-link-color-rgb: 0, 204, 153;
  --bs-link-hover-color-rgb: 0, 204, 153;
  --bs-heading-color: var(--text);
  --bs-emphasis-color: var(--text);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--brand-ink);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

::selection {
  background: rgba(0, 204, 153, 0.3);
}

.mono,
code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: inherit;
}
.tnum {
  font-variant-numeric: tabular-nums;
}

.text-muted,
.text-secondary {
  color: var(--text-3) !important;
}
.text-danger {
  color: var(--danger) !important;
}
.text-warning {
  color: var(--warn) !important;
}
.text-success {
  color: var(--ok) !important;
}
.text-primary {
  color: var(--brand-ink) !important;
}

strong,
b {
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Icons (inline SVG sprite, one size and stroke)
   -------------------------------------------------------------------------- */

.ic {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  vertical-align: -3px;
  color: currentColor;
}
.ic-18 {
  width: 18px;
  height: 18px;
}
.ic-20 {
  width: 20px;
  height: 20px;
}
.ic-brand {
  color: var(--brand);
}
.ic-spin {
  animation: ic-spin 0.9s linear infinite;
}
@keyframes ic-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   App shell: sticky sidebar + fluid content
   -------------------------------------------------------------------------- */

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

.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  background: var(--surface-2);
  border-right: 1px solid var(--hairline);
  overflow: hidden;
  z-index: 30;
}

.sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-scroll::-webkit-scrollbar {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 72px;
  padding: 0 12px;
  color: var(--text);
}
.brand:hover {
  text-decoration: none;
}
.brand-logo {
  width: 24px;
  height: 24px;
  transform: translateY(-2px);
}
.wordmark {
  font-family: var(--font-swiss);
  font-weight: 500;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--text);
}
.wordmark-accent {
  color: var(--brand);
}

/* Section group: the customer dashboard's plan-list pattern */
.nav-group {
  background: var(--bg);
  border-radius: 12px;
  padding: 4px;
  margin-top: 8px;
}
.nav-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.nav-group-head .ic {
  color: var(--brand);
}
.nav-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  overflow: hidden;
}
.nav-list li + li {
  border-top: 1px solid var(--hairline-strong);
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 36px;
  padding: 0 8px 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-3);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav-link:hover {
  text-decoration: none;
  background: color-mix(in srgb, var(--raised) 70%, transparent);
  color: var(--text);
}
.nav-link.is-active {
  background: var(--raised);
}
.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--brand);
}
.nav-link:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: -2px;
}
.nav-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  margin-top: 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.side-link:hover {
  background: var(--surface-3);
  color: var(--text);
  text-decoration: none;
}
.side-link .ic {
  color: var(--brand);
}

.sidebar-foot {
  display: flex;
  gap: 8px;
  padding: 8px 0 16px;
  flex: 0 0 auto;
}
.sidebar-foot .btn {
  flex: 1 1 auto;
}
.sidebar-foot .btn-icon {
  flex: 0 0 36px;
  width: 36px;
  padding: 0;
  color: var(--text-3);
}

.sidebar-cubes {
  flex: 0 0 auto;
  height: 46px;
  margin: 0 -16px;
  background: url("/img/footer-cubes.svg") repeat-x left bottom;
  opacity: 0.9;
  pointer-events: none;
}

/* Mobile top bar */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 25;
  height: 48px;
  padding: 0 8px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border-bottom: 1px solid var(--hairline);
}
.topbar .wordmark {
  font-size: 18px;
}
.scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(0, 0, 0, 0.45);
}

.content {
  flex: 1 1 auto;
  min-width: 0;
}
.content-inner {
  max-width: var(--content-max);
  padding: 32px 48px 64px;
}

.page-head {
  margin-bottom: 32px;
}
.page-title {
  font-family: var(--font-swiss);
  font-weight: 500;
  font-size: 28px;
  line-height: 32px;
  letter-spacing: 0.02em;
  margin: 0;
}
.page-sub {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Panels (one per admin section)
   -------------------------------------------------------------------------- */

.panel {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-panel);
  margin-bottom: 40px;
  scroll-margin-top: 24px;
}
.panel:last-child {
  margin-bottom: 0;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--hairline);
}
.panel-title {
  font-family: var(--font-swiss);
  font-weight: 500;
  font-size: 20px;
  line-height: 24px;
  letter-spacing: 0.02em;
  margin: 0;
}
.panel-desc {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-3);
}
.panel-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.panel-body {
  padding: 24px;
}
.subhead {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 16px;
}
.divider {
  height: 1px;
  background: var(--hairline);
  margin: 24px 0;
}
hr {
  border-color: var(--hairline);
  opacity: 1;
  margin: 24px 0;
}

/* Quiet info strip (UID row, token count row) */
.strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 8px 16px;
  margin-top: 24px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
}
.strip p {
  margin: 0;
}
.strip .mono {
  color: var(--text);
}

/* Empty / status text inside panels */
.empty {
  color: var(--text-3);
  font-size: 13px;
  margin: 0;
}
.error-text {
  color: var(--danger);
  font-size: 13px;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-label,
label.form-check-label {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 8px;
}
.form-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-height: 20px;
}
.form-text {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 8px;
}

.form-control,
.form-select,
textarea.form-control {
  height: 36px;
  padding: 0 12px;
  background: var(--surface-3);
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
  color: var(--text);
  font-size: 14px;
  line-height: 34px;
  box-shadow: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
textarea.form-control {
  height: auto;
  min-height: 72px;
  padding: 8px 12px;
  line-height: 20px;
}
select.form-control,
.form-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'><path d='M6.6665 8.33334L9.5579 11.2247C9.80197 11.4688 10.1977 11.4688 10.4418 11.2247L13.3332 8.33334' stroke='%23828c9b' stroke-width='1.66667' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 20px;
}
select.form-control[multiple] {
  height: auto;
  background-image: none;
  padding: 6px 8px;
  line-height: 20px;
}
.form-control::placeholder {
  color: var(--placeholder);
}
.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
  background: var(--surface-3);
  border-color: var(--brand);
  color: var(--text);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}
.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
  background: var(--surface-2);
  color: var(--text-2);
  opacity: 1;
}
.form-control[readonly] {
  font-family: var(--font-mono);
  font-size: 12.5px;
}
select.form-control option {
  background: var(--surface-1);
  color: var(--text);
}

.input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.input-group > :not(:first-child) {
  margin-left: -1px;
}

.form-check {
  min-height: 20px;
  padding-left: 24px;
  margin-bottom: 0;
}
.form-check .form-check-label {
  margin-bottom: 0;
  color: var(--text);
  font-size: 14px;
}
.form-check-input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  margin-left: -24px;
  background-color: var(--surface-3);
  border: 1px solid var(--hairline-strong);
  box-shadow: none;
}
.form-check-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}
.form-check + .form-check {
  margin-top: 8px;
}

/* Segmented control (token source) */
.seg {
  display: inline-flex;
  width: 100%;
  padding: 2px;
  background: var(--surface-3);
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
}
.seg-opt {
  flex: 1 1 0;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  margin: 0;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.seg-opt:hover {
  color: var(--text);
}
.btn-check:checked + .seg-opt {
  background: var(--raised);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
}
.btn-check:focus-visible + .seg-opt {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  --bs-btn-padding-x: 14px;
  --bs-btn-padding-y: 0;
  --bs-btn-font-size: 14px;
  --bs-btn-font-weight: 500;
  --bs-btn-line-height: 34px;
  --bs-btn-border-radius: var(--r-ctl);
  --bs-btn-focus-box-shadow: 0 0 0 3px var(--focus-ring);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:active {
  transform: scale(0.98);
}
.btn:focus-visible,
a:focus-visible,
button:focus-visible,
.dropdown-item:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}
.btn-sm {
  --bs-btn-padding-x: 10px;
  --bs-btn-font-size: 13px;
  --bs-btn-line-height: 26px;
  height: 28px;
}
.btn-sm .ic {
  width: 14px;
  height: 14px;
}

/* Primary: the customer site's green button */
.btn-primary,
.btn-success,
.btn-info {
  --bs-btn-bg: var(--brand-fill);
  --bs-btn-border-color: transparent;
  --bs-btn-color: var(--on-brand);
  --bs-btn-hover-bg: var(--brand-fill-hover);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-hover-color: var(--on-brand);
  --bs-btn-active-bg: var(--brand-fill-hover);
  --bs-btn-active-border-color: transparent;
  --bs-btn-active-color: var(--on-brand);
  --bs-btn-disabled-bg: var(--brand-fill);
  --bs-btn-disabled-border-color: transparent;
  --bs-btn-disabled-color: var(--on-brand);
  --bs-btn-disabled-opacity: 0.45;
  box-shadow: 0 2px 0 0 var(--brand-fill-shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.btn-primary:active,
.btn-success:active,
.btn-info:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 0 var(--brand-fill-shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
:root[data-theme="light"] .btn-primary,
:root[data-theme="light"] .btn-success,
:root[data-theme="light"] .btn-info {
  box-shadow: 0 2px 0 0 #009a6b, inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* Secondary: the customer site's small grey button */
.btn-secondary,
.btn-warning,
.btn-light,
.btn-dark,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-light,
.btn-outline-dark,
.btn-outline-info {
  --bs-btn-bg: var(--raised);
  --bs-btn-border-color: transparent;
  --bs-btn-color: var(--text);
  --bs-btn-hover-bg: var(--raised-hover);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-hover-color: var(--text);
  --bs-btn-active-bg: var(--raised-hover);
  --bs-btn-active-border-color: transparent;
  --bs-btn-active-color: var(--text);
  --bs-btn-disabled-bg: var(--raised);
  --bs-btn-disabled-border-color: transparent;
  --bs-btn-disabled-color: var(--text-3);
  --bs-btn-disabled-opacity: 0.6;
  box-shadow: inset 0 0 0 1px rgba(151, 151, 151, 0.14);
}
.btn-secondary .ic,
.btn-outline-secondary .ic,
.btn-outline-primary .ic,
.btn-outline-light .ic,
.btn-warning .ic {
  color: var(--text-3);
}

/* Destructive confirm */
.btn-danger {
  --bs-btn-bg: var(--danger-fill);
  --bs-btn-border-color: transparent;
  --bs-btn-color: #ffffff;
  --bs-btn-hover-bg: var(--danger-fill-hover);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-active-bg: var(--danger-fill-hover);
  --bs-btn-active-border-color: transparent;
  --bs-btn-active-color: #ffffff;
  --bs-btn-disabled-bg: var(--danger-fill);
  --bs-btn-disabled-border-color: transparent;
  --bs-btn-disabled-color: #ffffff;
  --bs-btn-disabled-opacity: 0.45;
}

/* Quiet destructive (on cards) */
.btn-outline-danger {
  --bs-btn-bg: var(--raised);
  --bs-btn-border-color: transparent;
  --bs-btn-color: var(--danger-ink);
  --bs-btn-hover-bg: rgba(229, 72, 77, 0.14);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-hover-color: var(--danger-ink);
  --bs-btn-active-bg: rgba(229, 72, 77, 0.2);
  --bs-btn-active-border-color: transparent;
  --bs-btn-active-color: var(--danger-ink);
  --bs-btn-disabled-bg: var(--raised);
  --bs-btn-disabled-border-color: transparent;
  --bs-btn-disabled-color: var(--danger-ink);
  box-shadow: inset 0 0 0 1px rgba(151, 151, 151, 0.14);
}

.btn-icon {
  padding: 0;
  width: 36px;
}
.btn-ghost {
  --bs-btn-bg: transparent;
  --bs-btn-border-color: transparent;
  --bs-btn-color: var(--text-3);
  --bs-btn-hover-bg: var(--surface-3);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-hover-color: var(--text);
  --bs-btn-active-bg: var(--surface-3);
  --bs-btn-active-border-color: transparent;
  --bs-btn-active-color: var(--text);
}
.btn-link {
  --bs-btn-color: var(--brand-ink);
  --bs-btn-hover-color: var(--brand-ink);
  padding: 0;
  height: auto;
}

.dropdown-toggle::after {
  margin-left: 2px;
  vertical-align: 2px;
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Badges → quiet status tags with a live dot
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 20px;
  max-width: 100%;          /* long status text wraps inside narrow columns */
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  white-space: normal;
  color: var(--text-2);
  background: var(--surface-3) !important;
  border: 1px solid var(--hairline);
  vertical-align: middle;
  text-transform: lowercase;
  margin: 0;
}
.form-label .badge,
.badge.ms-2 {
  margin-left: 0 !important;
  text-transform: none;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  flex: 0 0 auto;
}
.badge.bg-success::before,
.badge.bg-primary::before,
.badge.bg-info::before {
  background: var(--ok);
}
.badge.bg-success,
.badge.bg-primary,
.badge.bg-info {
  color: var(--text);
}
.badge.bg-danger::before {
  background: var(--danger);
}
.badge.bg-warning::before {
  background: var(--warn);
}
.badge.bg-dark::before,
.badge.bg-secondary::before {
  background: var(--text-3);
}

/* --------------------------------------------------------------------------
   Alerts → quiet notes with a left rule
   -------------------------------------------------------------------------- */

.alert {
  --bs-alert-bg: var(--surface-2);
  --bs-alert-border-color: var(--hairline);
  --bs-alert-color: var(--text-2);
  --bs-alert-padding-x: 16px;
  --bs-alert-padding-y: 12px;
  --bs-alert-border-radius: var(--r-ctl);
  --bs-alert-margin-bottom: 16px;
  position: relative;
  font-size: 13px;
  line-height: 20px;
  padding-left: 20px;
  border-left-width: 1px;
}
.alert::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  bottom: -1px;
  width: 3px;
  border-radius: var(--r-ctl) 0 0 var(--r-ctl);
  background: var(--text-3);
}
.alert-success::before,
.alert-info::before,
.alert-primary::before {
  background: var(--brand);
}
.alert-warning::before {
  background: var(--warn);
}
.alert-danger::before {
  background: var(--danger);
}
.alert strong {
  color: var(--text);
}
.alert ul {
  padding-left: 18px;
}
.alert .btn {
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   Cards (plan dossiers, stock, modals' plan info)
   -------------------------------------------------------------------------- */

.card {
  --bs-card-bg: var(--surface-2);
  --bs-card-border-color: var(--hairline);
  --bs-card-border-radius: var(--r-card);
  --bs-card-inner-border-radius: calc(var(--r-card) - 1px);
  --bs-card-cap-bg: transparent;
  --bs-card-cap-padding-y: 12px;
  --bs-card-cap-padding-x: 16px;
  --bs-card-spacer-y: 16px;
  --bs-card-spacer-x: 16px;
  --bs-card-color: var(--text);
  --bs-card-title-color: var(--text);
}
.card.border-warning {
  border-color: rgba(251, 191, 36, 0.45);
}
.card-header {
  border-bottom: 1px solid var(--hairline);
  font-weight: 500;
}
.card-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  margin-bottom: 12px;
}
.card-title.text-warning {
  color: var(--warn) !important;
}

/* Plan card */
.plan-card .card-body {
  padding: 16px;
}
.plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.plan-name {
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  margin: 0;
  color: var(--text);
}
.plan-kind {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

/* Key/value rows */
.kv {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0 12px;
  min-height: 24px;
  align-items: baseline;
  padding: 2px 0;
  font-size: 14px;
  line-height: 22px;
}
.kv-k {
  font-size: 13px;
  color: var(--text-3);
}
.kv-v {
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}
.kv-v.mono {
  font-size: 13px;
}
.kv-v .badge {
  margin-left: 8px;
}
.kv-v a {
  color: var(--brand-ink);
}
.kv-v .btn-sm {
  height: 22px;
  --bs-btn-line-height: 20px;
  --bs-btn-padding-x: 8px;
  --bs-btn-font-size: 12px;
  margin-left: 8px;
  vertical-align: 1px;
}
.kv-list {
  padding: 4px 0 0;
}
.kv-note {
  font-family: var(--font-ui);
  margin-top: 8px;
  padding-left: 8px;
  border-left: 2px solid var(--hairline-strong);
  font-size: 12.5px;
  color: var(--text-2);
}
.kv-note .badge {
  margin-left: 0;
}
.kv-note > div + div {
  margin-top: 4px;
}

.plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}
.plan-actions .dropdown {
  flex: 1 1 auto;
}
/* Cards in a row share a height; pin their actions to the bottom so the
   Manage buttons line up. Actions sit in .kv-list or directly in .card-body. */
.plan-card .card-body,
.plan-card .kv-list {
  display: flex;
  flex-direction: column;
}
.plan-card .kv-list {
  flex: 1 1 auto;
}
.plan-card .plan-actions {
  margin-top: auto;
}
.plan-card :not(.plan-actions):has(+ .plan-actions) {
  margin-bottom: 16px;
}
.plan-actions .dropdown .btn {
  width: 100%;
}

.token-copy {
  padding: 0;
  border: 0;
  border-bottom: 1px dotted var(--text-3);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  vertical-align: top;
  cursor: pointer;
}
.token-copy:hover {
  color: var(--brand-ink);
  border-bottom-color: var(--brand-ink);
}

/* Dropdown menu, like the customer site's */
.dropdown-menu {
  --bs-dropdown-bg: var(--surface-1);
  --bs-dropdown-border-color: var(--hairline-strong);
  --bs-dropdown-border-radius: var(--r-ctl);
  --bs-dropdown-padding-y: 4px;
  --bs-dropdown-padding-x: 4px;
  --bs-dropdown-item-padding-y: 6px;
  --bs-dropdown-item-padding-x: 10px;
  --bs-dropdown-border-radius: 8px;
  --bs-dropdown-link-color: var(--text-2);
  --bs-dropdown-link-hover-color: var(--text);
  --bs-dropdown-link-hover-bg: var(--surface-3);
  --bs-dropdown-link-active-color: var(--text);
  --bs-dropdown-link-active-bg: var(--surface-3);
  --bs-dropdown-font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.dropdown-item {
  border-radius: 4px;
}
.dropdown-item.text-danger:hover {
  color: var(--danger) !important;
}

/* --------------------------------------------------------------------------
   Subnet stock
   -------------------------------------------------------------------------- */

.stock-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-2);
}
.stock-summary strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stock-legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--text-3);
}
.stock-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.stock-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.stock-legend .usable i {
  background: var(--brand);
}
.stock-legend .used i {
  background: var(--neutral-bar);
}
.stock-legend .rest i {
  background: repeating-linear-gradient(135deg, var(--stranded) 0 2px, transparent 2px 4px), var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
}

.stock-list {
  display: flex;
  flex-direction: column;
}
.stock-row {
  padding: 20px 0;
  border-top: 1px solid var(--hairline);
}
.stock-row:first-child {
  border-top: 0;
  padding-top: 0;
}
.stock-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.stock-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}
.stock-figs {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stock-usable {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}
.stock-unit,
.stock-total {
  font-size: 12px;
  color: var(--text-3);
}
.stock-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  /* The unfilled remainder is capacity stranded in subnets under 10 free. */
  background: repeating-linear-gradient(135deg, var(--stranded) 0 2px, transparent 2px 4px), var(--surface-3);
}
.stock-bar-used + .stock-bar-usable {
  border-left: 2px solid var(--surface-1);
}
.stock-bar-used {
  height: 100%;
  background: var(--neutral-bar);
}
.stock-bar-usable {
  height: 100%;
  background: var(--brand);
}
.stock-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 8px;
  font-size: 12px;
  color: var(--text-3);
}
.stock-subnets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr));
  gap: 6px;
}
.stock-subnets:not(.is-open) > .is-extra {
  display: none;
}
.sn {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 18px;
}
.sn-ip {
  color: var(--text-2);
  min-width: 0;
  overflow-wrap: anywhere;
}
.sn-n {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stock-more {
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--brand-ink);
  cursor: pointer;
}
.stock-more:hover {
  text-decoration: underline;
}
.stock-more:focus-visible {
  border-radius: 4px;
}

.stock-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--hairline-strong);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}
.stock-group-title span {
  font-weight: 400;
}
.stock-list.is-empty .stock-row {
  padding: 12px 0;
}
.stock-list.is-empty .stock-row:first-child {
  padding-top: 12px;
  border-top: 0;
}
.stock-list.is-empty .stock-name {
  color: var(--text-2);
  font-weight: 500;
}
.stock-list.is-empty .stock-usable {
  font-size: 14px;
  color: var(--text-3);
}
.stock-list.is-empty .stock-bar {
  height: 4px;
}

/* --------------------------------------------------------------------------
   Cancellations list
   -------------------------------------------------------------------------- */

.cx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.cx-card {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  padding: 12px 16px;
}
.cx-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 4px;
}
.cx-product {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
}
.cx-total {
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--danger);
}
.cx-total small {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  margin-left: 4px;
}
.cx-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  height: 24px;
  align-items: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.cx-row .d {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
}
.cx-row .n {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Maintenance banners (composer, customer preview, list)
   .mnt-banner mirrors MaintenanceBanners.svelte in the customer repo, so it
   keeps that repo's amber (#f59e0b / #fbbf24) instead of --warn.
   -------------------------------------------------------------------------- */

.mnt-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 32px;
  align-items: start;
}
.mnt-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.mnt-form textarea.form-control {
  min-height: 96px;
  resize: vertical;
}
.mnt-counter {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.mnt-times {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.mnt-durations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.mnt-durations-label {
  font-size: 12px;
  color: var(--text-3);
  margin-right: 4px;
}
.mnt-chip {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.mnt-chip:hover {
  color: var(--text);
  border-color: var(--hairline-strong);
}
.mnt-chip.is-active {
  color: var(--brand-ink);
  border-color: rgba(0, 204, 153, 0.4);
  background: rgba(0, 204, 153, 0.1);
}
.mnt-chip:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}
.mnt-submit {
  display: flex;
  justify-content: flex-end;
}

/* Preview: a slice of the customer dashboard's content column */
.mnt-preview {
  position: sticky;
  top: 24px;
}
.mnt-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-2);
}
.mnt-preview-note {
  font-size: 12px;
  color: var(--text-3);
  text-align: right;
}
.mnt-preview-stage {
  padding: 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  background: var(--bg);
}
.mnt-preview-empty {
  margin: 0;
  padding: 18px 16px;
  border: 1px dashed var(--hairline-strong);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}

.mnt-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.08);
}
:root[data-theme="light"] .mnt-banner {
  border-color: rgba(217, 119, 6, 0.3);
}
.mnt-banner-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}
.mnt-banner-icon .ic {
  width: 17px;
  height: 17px;
  vertical-align: 0;
}
.mnt-banner-body {
  flex: 1 1 auto;
  min-width: 0;
}
.mnt-banner-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: center;
  gap: 2px 10px;
  min-height: 32px;
}
.mnt-banner-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.mnt-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fbbf24;
  flex: 0 0 auto;
}
.mnt-banner.is-live .mnt-dot,
.mnt-badge-live::before {
  animation: mnt-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.mnt-banner-when {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.mnt-banner-msg {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.mnt-banner-placeholder {
  color: var(--text-3);
  font-style: italic;
}
.mnt-banner-x {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 2px -4px 0 0;
  flex: 0 0 auto;
  color: var(--text-3);
}
.mnt-banner-x .ic {
  width: 20px;
  height: 20px;
  vertical-align: 0;
}
@keyframes mnt-pulse {
  50% {
    opacity: 0.5;
  }
}

/* List */
.mnt-list-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.mnt-list-head .subhead {
  margin-bottom: 12px;
}
.mnt-count {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.mnt-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mnt-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
}
.mnt-item.is-live {
  box-shadow: inset 3px 0 0 var(--warn);
}
.mnt-item.is-ended,
.mnt-item.is-queued {
  background: transparent;
}
.mnt-item.is-queued {
  border-style: dashed;
}
.mnt-item.is-ended .mnt-item-msg {
  color: var(--text-3);
}
.mnt-item-main {
  flex: 1 1 auto;
  min-width: 0;
}
.mnt-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.mnt-item-when {
  font-size: 13px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.mnt-item-rel {
  font-size: 12px;
  color: var(--text-3);
}
.mnt-item-msg {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-2);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.mnt-item-meta {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-3);
}

@media (max-width: 1100px) {
  .mnt-compose {
    grid-template-columns: minmax(0, 1fr);
  }
  .mnt-preview {
    position: static;
  }
}
@media (max-width: 575.98px) {
  .mnt-times {
    grid-template-columns: minmax(0, 1fr);
  }
  .mnt-item {
    flex-direction: column;
    gap: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mnt-banner.is-live .mnt-dot,
  .mnt-badge-live::before {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */

.modal {
  --bs-modal-bg: var(--surface-1);
  --bs-modal-border-color: var(--hairline-strong);
  --bs-modal-border-radius: var(--r-panel);
  --bs-modal-inner-border-radius: calc(var(--r-panel) - 1px);
  --bs-modal-header-padding: 20px 24px;
  --bs-modal-padding: 24px;
  --bs-modal-footer-gap: 8px;
  --bs-modal-header-border-color: var(--hairline);
  --bs-modal-footer-border-color: var(--hairline);
  --bs-modal-color: var(--text);
  --bs-modal-box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}
.modal-backdrop {
  --bs-backdrop-opacity: 0.6;
}
.modal-title {
  font-family: var(--font-swiss);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.02em;
}
.modal-body h6 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin: 0 0 8px;
}
.modal-body .card {
  --bs-card-bg: var(--surface-2);
}
.modal-body .card .card-body {
  padding: 12px 16px;
}
/* Label/value rows: the label floats into the left padding, so every line of
   a wrapped value starts in the value column. A grid would break rows with
   trailing text (" GB") or a JS-set display: block. */
.modal-body .card p {
  display: flow-root;
  margin: 0;
  padding-left: 132px;
  font-size: 14px;
  line-height: 24px;
  overflow-wrap: anywhere;
}
.modal-body .card p strong {
  float: left;
  width: 120px;
  margin-left: -132px;
  font-size: 13px;
  color: var(--text-3);
  font-weight: 400;
}
.modal-footer {
  padding: 16px 24px;
  gap: 8px;
}
/* gap spaces wrapped rows too (e.g. the three delete buttons) */
.modal-footer > * {
  margin: 0;
}
.btn-close {
  --bs-btn-close-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23828c9b'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
  filter: none;
  opacity: 0.8;
}

.mono-box {
  max-height: 160px;
  overflow-y: auto;
  padding: 8px 12px;
  background: var(--surface-3);
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 20px;
  color: var(--text-2);
  white-space: pre;          /* one proxy per line; scroll sideways, never split a credential */
  overflow-x: auto;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--hairline);
  font-size: 13px;
}
.table > :not(caption) > * > * {
  padding: 8px 12px;
}
.table thead th {
  color: var(--text-3);
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Select2 (bootstrap-5 theme) on the dark palette
   -------------------------------------------------------------------------- */

.select2-container--bootstrap-5 .select2-selection {
  min-height: 36px;
  background: var(--surface-3);
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
  color: var(--text);
  font-size: 14px;
}
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.select2-container--bootstrap-5 .select2-selection--single {
  padding: 0 36px 0 0;
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  line-height: 34px;
  padding-left: 12px;
  color: var(--text);
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered .select2-selection__placeholder {
  color: var(--placeholder);
}
.select2-container--bootstrap-5 .select2-selection:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered {
  padding: 2px 8px;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
  background: var(--raised);
  border: 1px solid var(--hairline);
  color: var(--text);
  border-radius: 6px;
  font-size: 13px;
}
.select2-container--bootstrap-5 .select2-dropdown {
  background: var(--surface-1);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-ctl);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  color: var(--text);
}
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
  background: var(--surface-3);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  color: var(--text);
  height: 32px;
}
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.select2-container--bootstrap-5 .select2-results__option {
  font-size: 13px;
  padding: 6px 10px;
  color: var(--text-2);
}
.select2-container--bootstrap-5 .select2-results__option--highlighted,
.select2-container--bootstrap-5 .select2-results__option--highlighted.select2-results__option--selectable {
  background: var(--surface-3);
  color: var(--text);
}
.select2-container--bootstrap-5 .select2-results__option--selected {
  background: var(--raised);
  color: var(--text);
}
.select2-container--bootstrap-5 .select2-results__option--disabled {
  color: var(--text-3);
}
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__clear {
  color: var(--text-3);
}
.modal .select2-container {
  z-index: 9999;
}

/* --------------------------------------------------------------------------
   Toastr on the palette
   -------------------------------------------------------------------------- */

#toast-container > div {
  opacity: 1;
  padding: 12px 16px 12px 20px;
  width: 320px;
  border-radius: 10px;
  background-color: var(--surface-3);
  background-image: none !important;
  border: 1px solid var(--hairline-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 13px;
  line-height: 20px;
  position: relative;
}
/* toastr sets its icons on the status classes with !important; the id+class
   selectors below outrank the id+element rule above */
#toast-container > .toast-success,
#toast-container > .toast-error,
#toast-container > .toast-warning,
#toast-container > .toast-info {
  background-image: none !important;
}
#toast-container > div::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  bottom: -1px;
  width: 3px;
  border-radius: 10px 0 0 10px;
  background: var(--text-3);
}
#toast-container > .toast-success::before {
  background: var(--brand);
}
#toast-container > .toast-error::before {
  background: var(--danger);
}
#toast-container > .toast-warning::before {
  background: var(--warn);
}
#toast-container > div:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.toast-title {
  display: none;
}
.toast-message {
  color: var(--text);
}
.toast-close-button {
  color: var(--text-3);
  text-shadow: none;
  opacity: 1;
  font-weight: 400;
  top: 0;
}
.toast-progress {
  background: var(--brand);
  opacity: 0.6;
  height: 2px;
}

/* --------------------------------------------------------------------------
   Entrance: one short fade and rise, small stagger
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .panel {
    animation: rise var(--t-enter) var(--ease) backwards;
  }
  .panel:nth-child(2) {
    animation-delay: 40ms;
  }
  .panel:nth-child(3) {
    animation-delay: 80ms;
  }
  .panel:nth-child(4) {
    animation-delay: 120ms;
  }
  .panel:nth-child(5) {
    animation-delay: 160ms;
  }
  .panel:nth-child(6) {
    animation-delay: 200ms;
  }
  .panel:nth-child(7) {
    animation-delay: 240ms;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .content-inner {
    padding: 24px 32px 48px;
  }
}

@media (max-width: 767.98px) {
  .app {
    display: block;
  }
  .topbar {
    display: flex;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 220ms var(--ease);
  }
  .app.nav-open .sidebar {
    transform: none;
  }
  .app.nav-open .scrim {
    display: block;
  }
  .content-inner {
    padding: 16px 16px 48px;
  }
  .page-head {
    margin-bottom: 24px;
  }
  .panel {
    margin-bottom: 24px;
  }
  .panel-head {
    padding: 16px;
    flex-direction: column;
  }
  .panel-body {
    padding: 16px;
  }
  .kv {
    grid-template-columns: 120px minmax(0, 1fr);
  }
  .stock-subnets {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn,
  .nav-link,
  .seg-opt {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Small additions
   -------------------------------------------------------------------------- */

.ic-xs {
  width: 12px;
  height: 12px;
  vertical-align: -1px;
  margin-left: 2px;
}
.plans-grid {
  margin-top: 8px;
}
.kv-note strong {
  display: block;
  color: var(--text-3);
  font-weight: 400;
}
#ispSummaryAlert {
  margin-top: 24px;
}
.kv-note a {
  color: var(--brand-ink);
}
.theme-moon {
  display: none;
}
:root[data-theme="light"] .theme-sun {
  display: none;
}
:root[data-theme="light"] .theme-moon {
  display: block;
}
.plan-name.mono {
  font-size: 13px;
}
