/* ConnexiFi Wholesale UI Consistency Layer */
:root {
  --cxfi-bg: #06101d;
  --cxfi-bg-2: #0b1626;
  --cxfi-panel: rgba(15, 23, 42, 0.88);
  --cxfi-panel-2: rgba(17, 24, 39, 0.92);
  --cxfi-border: rgba(148, 163, 184, 0.22);
  --cxfi-text: #f8fafc;
  --cxfi-muted: #b6c3d5;
  --cxfi-soft: #dbeafe;
  --cxfi-cyan: #67e8f9;
  --cxfi-green: #22c55e;
  --cxfi-green-soft: rgba(34, 197, 94, 0.16);
  --cxfi-danger: #fca5a5;
  --cxfi-warn: #fbbf24;
  --cxfi-nav-width: 248px;
  --cxfi-top-height: 64px;
  --cxfi-radius: 18px;
  --cxfi-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

/* Base dark theme */
html.cxfi-wholesale-ui,
html.cxfi-wholesale-ui body {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.22), transparent 30rem),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 32rem),
    linear-gradient(135deg, #06101d 0%, #09111f 54%, #0b1220 100%) !important;
  color: var(--cxfi-text) !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
}

html.cxfi-wholesale-ui body {
  line-height: 1.55;
}

/* Add space for persistent nav */
@media (min-width: 901px) {
  html.cxfi-wholesale-ui body {
    padding-left: var(--cxfi-nav-width) !important;
  }
}

html.cxfi-wholesale-ui body.cxfi-nav-collapsed {
  padding-left: 0 !important;
}

/* Fixed shell */
#cxfi-wholesale-shell {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--cxfi-nav-width);
  z-index: 2147482000;
  background: linear-gradient(180deg, rgba(8, 49, 55, 0.98), rgba(8, 18, 32, 0.98) 55%, rgba(6, 16, 29, 0.98));
  border-right: 1px solid var(--cxfi-border);
  box-shadow: 18px 0 48px rgba(0, 0, 0, 0.28);
  color: var(--cxfi-text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#cxfi-wholesale-shell * {
  box-sizing: border-box;
}

#cxfi-wholesale-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  min-height: var(--cxfi-top-height);
  border-bottom: 1px solid var(--cxfi-border);
  color: var(--cxfi-text);
  text-decoration: none;
}

.cxfi-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(103, 232, 249, 0.48);
  background: rgba(103, 232, 249, 0.12);
  color: var(--cxfi-cyan);
  font-weight: 950;
}

.cxfi-brand-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.cxfi-brand-subtitle {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #9be9f3;
}

#cxfi-wholesale-nav {
  padding: 16px 12px 28px;
  overflow: auto;
  flex: 1;
}

.cxfi-nav-section {
  margin: 14px 8px 8px;
  color: #8fa3bb;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.cxfi-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  margin: 3px 0;
  color: #dce8f7 !important;
  text-decoration: none !important;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 780;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.cxfi-nav-link:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(103, 232, 249, 0.20);
  color: #ffffff !important;
  transform: translateX(2px);
}

.cxfi-nav-link.cxfi-active {
  background: linear-gradient(135deg, rgba(103, 232, 249, 0.95), rgba(34, 197, 94, 0.82));
  color: #06101d !important;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 24px rgba(34, 211, 238, 0.18);
}

.cxfi-nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  flex: 0 0 auto;
}

.cxfi-nav-link.cxfi-active .cxfi-nav-icon {
  background: rgba(6, 16, 29, 0.12);
}

#cxfi-wholesale-nav-footer {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--cxfi-border);
}

.cxfi-nav-status {
  border: 1px solid rgba(34, 197, 94, 0.30);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 750;
}

/* Top helper bar */
#cxfi-mobile-bar {
  display: none;
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--cxfi-top-height);
  z-index: 2147482001;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(6, 16, 29, 0.96);
  border-bottom: 1px solid var(--cxfi-border);
  backdrop-filter: blur(14px);
}

#cxfi-mobile-toggle,
#cxfi-nav-close {
  border: 1px solid rgba(103, 232, 249, 0.28);
  background: rgba(103, 232, 249, 0.12);
  color: var(--cxfi-text);
  border-radius: 12px;
  padding: 9px 12px;
  font-weight: 900;
  cursor: pointer;
}

#cxfi-nav-close {
  display: none;
  margin-left: auto;
}

#cxfi-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147481999;
  background: rgba(2, 6, 23, 0.64);
  backdrop-filter: blur(4px);
}

/* Normalize old page content into dark readable cards */
html.cxfi-wholesale-ui body > *:not(#cxfi-wholesale-shell):not(#cxfi-mobile-bar):not(#cxfi-nav-backdrop):not(script):not(style) {
  color: var(--cxfi-text);
}

html.cxfi-wholesale-ui main,
html.cxfi-wholesale-ui .main,
html.cxfi-wholesale-ui .content,
html.cxfi-wholesale-ui .container,
html.cxfi-wholesale-ui .page,
html.cxfi-wholesale-ui #content,
html.cxfi-wholesale-ui .app,
html.cxfi-wholesale-ui .layout {
  color: var(--cxfi-text) !important;
}

html.cxfi-wholesale-ui h1,
html.cxfi-wholesale-ui h2,
html.cxfi-wholesale-ui h3,
html.cxfi-wholesale-ui h4,
html.cxfi-wholesale-ui h5,
html.cxfi-wholesale-ui h6 {
  color: #ffffff !important;
  letter-spacing: -0.025em;
}

html.cxfi-wholesale-ui p,
html.cxfi-wholesale-ui li,
html.cxfi-wholesale-ui span,
html.cxfi-wholesale-ui label,
html.cxfi-wholesale-ui small {
  color: inherit;
}

/* Cards, panels, tables */
html.cxfi-wholesale-ui .card,
html.cxfi-wholesale-ui .panel,
html.cxfi-wholesale-ui .box,
html.cxfi-wholesale-ui .tile,
html.cxfi-wholesale-ui section,
html.cxfi-wholesale-ui article,
html.cxfi-wholesale-ui .table-container,
html.cxfi-wholesale-ui .cxfi-card {
  border-color: var(--cxfi-border) !important;
}

html.cxfi-wholesale-ui table {
  width: 100%;
  border-collapse: collapse;
  color: #e5eefb !important;
  background: rgba(15, 23, 42, 0.72) !important;
  border: 1px solid var(--cxfi-border);
  border-radius: 16px;
  overflow: hidden;
}

html.cxfi-wholesale-ui th {
  color: #c7e8ff !important;
  background: rgba(15, 23, 42, 0.94) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25) !important;
  padding: 10px 12px !important;
  text-align: left;
}

html.cxfi-wholesale-ui td {
  color: #eef6ff !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
  padding: 10px 12px !important;
}

html.cxfi-wholesale-ui tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.025);
}

/* Form fields must be visible and descriptive */
html.cxfi-wholesale-ui input,
html.cxfi-wholesale-ui select,
html.cxfi-wholesale-ui textarea {
  background: rgba(2, 6, 23, 0.72) !important;
  color: #ffffff !important;
  border: 1px solid rgba(148, 163, 184, 0.40) !important;
  border-radius: 12px !important;
  min-height: 42px;
  padding: 10px 12px !important;
  outline: none !important;
  box-shadow: none !important;
}

html.cxfi-wholesale-ui input:focus,
html.cxfi-wholesale-ui select:focus,
html.cxfi-wholesale-ui textarea:focus {
  border-color: rgba(103, 232, 249, 0.92) !important;
  box-shadow: 0 0 0 4px rgba(103, 232, 249, 0.16) !important;
}

html.cxfi-wholesale-ui input::placeholder,
html.cxfi-wholesale-ui textarea::placeholder {
  color: #8ea3b8 !important;
  opacity: 1 !important;
}

html.cxfi-wholesale-ui label {
  display: inline-block;
  margin-bottom: 5px;
  color: #dbeafe !important;
  font-weight: 820 !important;
}

/* Add visual required marker where browser validates required fields */
html.cxfi-wholesale-ui input[required] + small::before,
html.cxfi-wholesale-ui select[required] + small::before,
html.cxfi-wholesale-ui textarea[required] + small::before {
  content: "Required · ";
  color: var(--cxfi-warn);
  font-weight: 900;
}

html.cxfi-wholesale-ui input[required],
html.cxfi-wholesale-ui select[required],
html.cxfi-wholesale-ui textarea[required] {
  border-left: 4px solid var(--cxfi-warn) !important;
}

/* Buttons and links */
html.cxfi-wholesale-ui button,
html.cxfi-wholesale-ui .btn,
html.cxfi-wholesale-ui input[type="submit"],
html.cxfi-wholesale-ui a.button {
  border: 0;
  border-radius: 12px !important;
  min-height: 40px;
  padding: 10px 14px !important;
  font-weight: 900 !important;
}

html.cxfi-wholesale-ui button,
html.cxfi-wholesale-ui .btn-primary,
html.cxfi-wholesale-ui input[type="submit"] {
  background: linear-gradient(135deg, #67e8f9, #22c55e) !important;
  color: #06101d !important;
}

html.cxfi-wholesale-ui a {
  color: #8ecbff;
}

html.cxfi-wholesale-ui a:hover {
  color: #bbf7d0;
}

/* Make existing content not hide under shell and improve spacing */
html.cxfi-wholesale-ui .cxfi-content-adjusted {
  max-width: none !important;
}

html.cxfi-wholesale-ui .cxfi-auto-card {
  background: rgba(15, 23, 42, 0.82) !important;
  border: 1px solid var(--cxfi-border) !important;
  border-radius: 22px !important;
  box-shadow: var(--cxfi-shadow) !important;
}

/* Mobile */
@media (max-width: 900px) {
  html.cxfi-wholesale-ui body {
    padding-left: 0 !important;
    padding-top: var(--cxfi-top-height) !important;
  }

  #cxfi-mobile-bar {
    display: flex;
  }

  #cxfi-wholesale-shell {
    transform: translateX(-105%);
    transition: transform 220ms ease;
    width: min(86vw, 310px);
  }

  body.cxfi-mobile-nav-open #cxfi-wholesale-shell {
    transform: translateX(0);
  }

  body.cxfi-mobile-nav-open #cxfi-nav-backdrop {
    display: block;
  }

  #cxfi-nav-close {
    display: inline-block;
  }

  html.cxfi-wholesale-ui table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  html.cxfi-wholesale-ui h1 {
    font-size: clamp(26px, 8vw, 40px) !important;
  }

  html.cxfi-wholesale-ui input,
  html.cxfi-wholesale-ui select,
  html.cxfi-wholesale-ui textarea,
  html.cxfi-wholesale-ui button,
  html.cxfi-wholesale-ui .btn {
    width: 100%;
  }
}
