/* ============================================================
   Nexus Theme — Modern Futuristic Design for FOSSBilling
   ============================================================ */

/* ----------  Google Fonts (Inter)  ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ----------  Design Tokens  ---------- */
:root {
  --nx-font: 'Inter', system-ui, -apple-system, sans-serif;

  /* Accent colors */
  --nx-cyan:       #22d3ee;
  --nx-cyan-dim:   rgba(34, 211, 238, 0.08);
  --nx-cyan-glow:  rgba(34, 211, 238, 0.35);
  --nx-purple:     #a78bfa;
  --nx-purple-dim: rgba(167, 139, 250, 0.08);
  --nx-teal:       #06d6a0;

  /* Status colors */
  --nx-success:    #10b981;
  --nx-warning:    #f59e0b;
  --nx-danger:     #f43f5e;
  --nx-info:       #22d3ee;

  /* Surface */
  --nx-radius:     10px;
  --nx-radius-sm:  6px;
  --nx-transition: all 0.18s ease;
}

/* ============================================================
   DARK MODE  (default for Nexus)
   ============================================================ */
[data-bs-theme="dark"],
[data-bs-theme="dark"] * {
  --bs-body-font-family:   var(--nx-font);
  --bs-border-radius:      var(--nx-radius);
  --bs-border-radius-sm:   var(--nx-radius-sm);
}

[data-bs-theme="dark"] {
  /* Override Bootstrap dark palette */
  --bs-body-bg:            #080c1a;
  --bs-body-color:         #bfcfe8;
  --bs-secondary-color:    #5a7090;
  --bs-border-color:       rgba(34, 211, 238, 0.12);
  --bs-border-color-translucent: rgba(34, 211, 238, 0.1);

  --bs-primary-rgb:        34, 211, 238;
  --bs-primary:            #22d3ee;
  --bs-link-color:         #22d3ee;
  --bs-link-hover-color:   #67e8f9;

  --bs-card-bg:            rgba(10, 18, 42, 0.88);
  --bs-card-border-color:  rgba(34, 211, 238, 0.12);

  --bs-nav-link-color:     #8aa4c4;
  --bs-nav-link-hover-color: #22d3ee;

  --bs-navbar-color:       #8aa4c4;
  --bs-navbar-hover-color: #22d3ee;
  --bs-navbar-active-color:#22d3ee;
  --bs-navbar-brand-color: #ffffff;
  --bs-navbar-bg:          rgba(6, 10, 24, 0.88);

  --bs-table-color:        #bfcfe8;
  --bs-table-bg:           transparent;
  --bs-table-border-color: rgba(34, 211, 238, 0.1);
  --bs-table-striped-bg:   rgba(34, 211, 238, 0.04);
  --bs-table-hover-bg:     rgba(34, 211, 238, 0.07);

  --bs-input-bg:           rgba(8, 14, 30, 0.9);
  --bs-input-border-color: rgba(34, 211, 238, 0.18);
  --bs-input-color:        #d4e8ff;
  --bs-input-placeholder-color: #4a6080;
  --bs-input-focus-border-color: #22d3ee;
  --bs-input-focus-box-shadow: 0 0 0 0.2rem rgba(34, 211, 238, 0.15);

  --bs-dropdown-bg:        #0c1530;
  --bs-dropdown-border-color: rgba(34, 211, 238, 0.2);
  --bs-dropdown-color:     #bfcfe8;
  --bs-dropdown-link-color:#bfcfe8;
  --bs-dropdown-link-hover-color: #22d3ee;
  --bs-dropdown-link-hover-bg: rgba(34, 211, 238, 0.08);
  --bs-dropdown-link-active-bg: rgba(34, 211, 238, 0.15);
  --bs-dropdown-link-active-color: #22d3ee;

  --bs-pagination-bg:      transparent;
  --bs-pagination-border-color: rgba(34, 211, 238, 0.18);
  --bs-pagination-color:   #8aa4c4;
  --bs-pagination-hover-bg: rgba(34, 211, 238, 0.08);
  --bs-pagination-hover-color: #22d3ee;
  --bs-pagination-active-bg: rgba(34, 211, 238, 0.18);
  --bs-pagination-active-color: #22d3ee;
  --bs-pagination-active-border-color: #22d3ee;
  --bs-pagination-disabled-bg: transparent;
  --bs-pagination-disabled-color: #2d4060;
  --bs-pagination-disabled-border-color: rgba(34, 211, 238, 0.06);

  --bs-modal-bg:           #0c1530;
  --bs-modal-content-border-color: rgba(34, 211, 238, 0.2);
  --bs-modal-header-border-color: rgba(34, 211, 238, 0.12);
  --bs-modal-footer-border-color: rgba(34, 211, 238, 0.12);

  --bs-badge-color:        #fff;

  --bs-breadcrumb-divider-color: #2d4060;
  --bs-breadcrumb-item-active-color: #22d3ee;
}

/* ============================================================
   LIGHT MODE
   ============================================================ */
[data-bs-theme="light"] {
  --bs-body-font-family: var(--nx-font);
  --bs-body-bg:          #f0f4ff;
  --bs-body-color:       #1e2840;
  --bs-border-color:     rgba(99, 102, 241, 0.18);

  --bs-primary-rgb:      99, 102, 241;
  --bs-primary:          #6366f1;
  --bs-link-color:       #6366f1;

  --bs-card-bg:          #ffffff;
  --bs-card-border-color: rgba(99, 102, 241, 0.15);

  --bs-input-focus-border-color: #6366f1;
  --bs-input-focus-box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.18);

  --bs-navbar-bg:        rgba(255, 255, 255, 0.9);
}

/* ============================================================
   BASE
   ============================================================ */
body {
  font-family: var(--nx-font);
  min-height: 100vh;
}

/* Grid background pattern (dark only) */
[data-bs-theme="dark"] body {
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Radial ambient glow top-left */
[data-bs-theme="dark"] body::before {
  content: '';
  position: fixed;
  top: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(34, 211, 238, 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   SCROLLBAR (dark)
   ============================================================ */
[data-bs-theme="dark"] ::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-track  { background: #080c1a; }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb  {
  background: rgba(34, 211, 238, 0.25);
  border-radius: 3px;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 211, 238, 0.45);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.01em;
}

[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6 {
  color: #e8f4ff;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bs-border-color, rgba(34,211,238,0.12));
  transition: var(--nx-transition);
}

[data-bs-theme="dark"] .navbar {
  background: rgba(6, 10, 24, 0.82) !important;
  box-shadow: 0 1px 0 rgba(34, 211, 238, 0.08), 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 1px 0 rgba(99, 102, 241, 0.12), 0 2px 12px rgba(99, 102, 241, 0.06);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}

[data-bs-theme="dark"] .navbar-brand { color: #ffffff; }
[data-bs-theme="dark"] .navbar-brand:hover { color: var(--nx-cyan); }

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--nx-transition);
  border-radius: var(--nx-radius-sm);
}

[data-bs-theme="dark"] .navbar .nav-link { color: #8aa4c4; }
[data-bs-theme="dark"] .navbar .nav-link:hover { color: var(--nx-cyan); }
[data-bs-theme="dark"] .navbar .nav-link.active {
  color: var(--nx-cyan);
  text-shadow: 0 0 8px var(--nx-cyan-glow);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
[data-bs-theme="dark"] .offcanvas-body,
[data-bs-theme="dark"] .offcanvas-md {
  background: transparent;
}

[data-bs-theme="dark"] .offcanvas-body .nav-link {
  color: #6a8cae;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 0.9rem;
  border-radius: var(--nx-radius-sm);
  margin-bottom: 2px;
  transition: var(--nx-transition);
  border-left: 2px solid transparent;
  letter-spacing: 0.01em;
}

[data-bs-theme="dark"] .offcanvas-body .nav-link svg {
  opacity: 0.55;
  transition: var(--nx-transition);
}

[data-bs-theme="dark"] .offcanvas-body .nav-link:hover {
  color: #d4efff;
  background: rgba(34, 211, 238, 0.06);
  border-left-color: rgba(34, 211, 238, 0.35);
}
[data-bs-theme="dark"] .offcanvas-body .nav-link:hover svg { opacity: 0.9; }

[data-bs-theme="dark"] .offcanvas-body .nav-item.active .nav-link,
[data-bs-theme="dark"] .offcanvas-body .nav-link.active {
  color: var(--nx-cyan);
  background: rgba(34, 211, 238, 0.1);
  border-left-color: var(--nx-cyan);
  text-shadow: 0 0 6px rgba(34, 211, 238, 0.4);
}
[data-bs-theme="dark"] .offcanvas-body .nav-item.active .nav-link svg,
[data-bs-theme="dark"] .offcanvas-body .nav-link.active svg {
  opacity: 1;
  filter: drop-shadow(0 0 3px var(--nx-cyan));
}

/* Light sidebar */
[data-bs-theme="light"] .offcanvas-body .nav-link {
  color: #475569;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 0.9rem;
  border-radius: var(--nx-radius-sm);
  margin-bottom: 2px;
  transition: var(--nx-transition);
  border-left: 2px solid transparent;
}
[data-bs-theme="light"] .offcanvas-body .nav-link:hover {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.06);
  border-left-color: rgba(99, 102, 241, 0.35);
}
[data-bs-theme="light"] .offcanvas-body .nav-item.active .nav-link,
[data-bs-theme="light"] .offcanvas-body .nav-link.active {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  border-left-color: #6366f1;
  font-weight: 600;
}

/* Sidebar balance block */
[data-bs-theme="dark"] .offcanvas-body li.pt-3 h5 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #3d5570;
}
[data-bs-theme="dark"] .offcanvas-body li.pt-3 h6 { color: var(--nx-cyan); font-weight: 700; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  border-radius: var(--nx-radius);
  transition: var(--nx-transition);
}

[data-bs-theme="dark"] .card {
  background: rgba(10, 18, 42, 0.85);
  border: 1px solid rgba(34, 211, 238, 0.1);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(34, 211, 238, 0.04) inset;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

[data-bs-theme="dark"] .card:hover {
  border-color: rgba(34, 211, 238, 0.22);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 12px rgba(34, 211, 238, 0.07);
}

[data-bs-theme="dark"] .card-header {
  background: rgba(34, 211, 238, 0.04);
  border-bottom: 1px solid rgba(34, 211, 238, 0.1);
}

[data-bs-theme="dark"] .card-footer {
  background: rgba(34, 211, 238, 0.03);
  border-top: 1px solid rgba(34, 211, 238, 0.08);
}

[data-bs-theme="dark"] .card-title {
  color: #d4e8ff;
  font-weight: 600;
}

/* Light cards */
[data-bs-theme="light"] .card {
  border: 1px solid rgba(99, 102, 241, 0.12);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.06);
}
[data-bs-theme="light"] .card-header {
  background: rgba(99, 102, 241, 0.04);
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { font-weight: 500; transition: var(--nx-transition); letter-spacing: 0.01em; }

/* Primary button */
[data-bs-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #22d3ee 100%);
  border-color: transparent;
  color: #080c1a;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(34, 211, 238, 0.25);
}
[data-bs-theme="dark"] .btn-primary:hover,
[data-bs-theme="dark"] .btn-primary:focus {
  background: linear-gradient(135deg, #38bdf8 0%, #67e8f9 100%);
  box-shadow: 0 4px 20px rgba(34, 211, 238, 0.45);
  transform: translateY(-1px);
}
[data-bs-theme="dark"] .btn-primary:active { transform: translateY(0); }

/* Secondary button */
[data-bs-theme="dark"] .btn-secondary {
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: var(--nx-purple);
}
[data-bs-theme="dark"] .btn-secondary:hover {
  background: rgba(167, 139, 250, 0.2);
  border-color: var(--nx-purple);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(167, 139, 250, 0.25);
}

/* Outline primary */
[data-bs-theme="dark"] .btn-outline-primary {
  border-color: rgba(34, 211, 238, 0.45);
  color: var(--nx-cyan);
}
[data-bs-theme="dark"] .btn-outline-primary:hover {
  background: rgba(34, 211, 238, 0.12);
  border-color: var(--nx-cyan);
  color: var(--nx-cyan);
  box-shadow: 0 2px 10px var(--nx-cyan-glow);
}

/* Danger */
[data-bs-theme="dark"] .btn-danger {
  background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.25);
}
[data-bs-theme="dark"] .btn-danger:hover {
  box-shadow: 0 4px 18px rgba(244, 63, 94, 0.4);
  transform: translateY(-1px);
}

/* Dark/Light button */
[data-bs-theme="dark"] .btn-dark {
  background: rgba(30, 40, 70, 0.8);
  border: 1px solid rgba(34, 211, 238, 0.15);
  color: #8aa4c4;
}
[data-bs-theme="dark"] .btn-dark:hover {
  background: rgba(40, 55, 90, 0.9);
  border-color: rgba(34, 211, 238, 0.3);
  color: #d4efff;
}

/* Warning */
[data-bs-theme="dark"] .btn-outline-warning {
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}
[data-bs-theme="dark"] .btn-outline-warning:hover {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
}

/* Small buttons */
.btn-sm { font-size: 0.8rem; padding: 0.3rem 0.75rem; }

/* ============================================================
   FORMS
   ============================================================ */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background: rgba(5, 10, 25, 0.8);
  border: 1px solid rgba(34, 211, 238, 0.16);
  color: #d4e8ff;
  transition: var(--nx-transition);
}
[data-bs-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] .form-select::placeholder { color: #3d5570; }
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background: rgba(8, 15, 35, 0.95);
  border-color: var(--nx-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12), 0 0 12px rgba(34, 211, 238, 0.08);
  color: #e8f4ff;
}
[data-bs-theme="dark"] .form-label { color: #7a9cbc; font-size: 0.85rem; font-weight: 500; }
[data-bs-theme="dark"] .form-text  { color: #3d5570; }
[data-bs-theme="dark"] .input-group-text {
  background: rgba(8, 14, 30, 0.9);
  border-color: rgba(34, 211, 238, 0.16);
  color: #5a7090;
}

/* Checkbox / Radio */
[data-bs-theme="dark"] .form-check-input {
  background-color: rgba(5, 10, 25, 0.8);
  border-color: rgba(34, 211, 238, 0.25);
}
[data-bs-theme="dark"] .form-check-input:checked {
  background-color: #0ea5e9;
  border-color: #22d3ee;
}
[data-bs-theme="dark"] .form-check-label { color: #8aa4c4; }

/* Switch */
[data-bs-theme="dark"] .form-switch .form-check-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(90,112,144,1)'/%3e%3c/svg%3e");
}
[data-bs-theme="dark"] .form-switch .form-check-input:checked {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23080c1a'/%3e%3c/svg%3e");
}

/* ============================================================
   TABLES
   ============================================================ */
[data-bs-theme="dark"] .table {
  color: #bfcfe8;
  border-color: rgba(34, 211, 238, 0.08);
}
[data-bs-theme="dark"] .table thead th {
  color: #5a7090;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(34, 211, 238, 0.14);
  padding-bottom: 0.85rem;
}
[data-bs-theme="dark"] .table td {
  border-color: rgba(34, 211, 238, 0.06);
  vertical-align: middle;
  padding: 0.7rem 0.75rem;
}
[data-bs-theme="dark"] .table-hover tbody tr:hover td {
  background: rgba(34, 211, 238, 0.05);
  color: #d4e8ff;
}
[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background: rgba(34, 211, 238, 0.03);
}
[data-bs-theme="dark"] .table-bordered {
  border-color: rgba(34, 211, 238, 0.1);
}
[data-bs-theme="dark"] .table-bordered td,
[data-bs-theme="dark"] .table-bordered th {
  border-color: rgba(34, 211, 238, 0.1);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge { font-weight: 600; letter-spacing: 0.03em; border-radius: 20px; font-size: 0.72rem; }

[data-bs-theme="dark"] .bg-success { background: rgba(16, 185, 129, 0.18) !important; color: #34d399 !important; border: 1px solid rgba(16, 185, 129, 0.3); }
[data-bs-theme="dark"] .bg-warning { background: rgba(245, 158, 11, 0.18) !important; color: #fbbf24 !important; border: 1px solid rgba(245, 158, 11, 0.3); }
[data-bs-theme="dark"] .bg-danger  { background: rgba(244, 63, 94, 0.18) !important;  color: #fb7185 !important;  border: 1px solid rgba(244, 63, 94, 0.3); }
[data-bs-theme="dark"] .bg-primary { background: rgba(34, 211, 238, 0.15) !important; color: #67e8f9 !important; border: 1px solid rgba(34, 211, 238, 0.3); }
[data-bs-theme="dark"] .bg-secondary { background: rgba(100, 116, 139, 0.18) !important; color: #94a3b8 !important; border: 1px solid rgba(100, 116, 139, 0.3); }
[data-bs-theme="dark"] .bg-info   { background: rgba(34, 211, 238, 0.15) !important;  color: #67e8f9 !important; border: 1px solid rgba(34, 211, 238, 0.3); }

/* ============================================================
   ALERTS
   ============================================================ */
[data-bs-theme="dark"] .alert {
  border-width: 1px;
  border-radius: var(--nx-radius);
}
[data-bs-theme="dark"] .alert-info {
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.25);
  color: #67e8f9;
}
[data-bs-theme="dark"] .alert-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
  color: #34d399;
}
[data-bs-theme="dark"] .alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}
[data-bs-theme="dark"] .alert-danger {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.25);
  color: #fb7185;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
[data-bs-theme="dark"] .breadcrumb {
  background: transparent;
  font-size: 0.8rem;
}
[data-bs-theme="dark"] .breadcrumb-item a {
  color: #5a7090;
  text-decoration: none;
  transition: var(--nx-transition);
}
[data-bs-theme="dark"] .breadcrumb-item a:hover { color: var(--nx-cyan); }
[data-bs-theme="dark"] .breadcrumb-item.active { color: var(--nx-cyan); }
[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before { color: #2d4060; }

/* ============================================================
   PAGINATION
   ============================================================ */
[data-bs-theme="dark"] .page-link {
  background: transparent;
  border-color: rgba(34, 211, 238, 0.15);
  color: #5a7090;
  font-size: 0.85rem;
  transition: var(--nx-transition);
}
[data-bs-theme="dark"] .page-link:hover {
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.3);
  color: var(--nx-cyan);
}
[data-bs-theme="dark"] .page-item.active .page-link {
  background: rgba(34, 211, 238, 0.15);
  border-color: var(--nx-cyan);
  color: var(--nx-cyan);
  box-shadow: 0 0 8px var(--nx-cyan-glow);
}
[data-bs-theme="dark"] .page-item.disabled .page-link {
  background: transparent;
  border-color: rgba(34, 211, 238, 0.06);
  color: #1e2d40;
}

/* ============================================================
   DROPDOWN
   ============================================================ */
[data-bs-theme="dark"] .dropdown-menu {
  background: #0c1530;
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: var(--nx-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(34, 211, 238, 0.06) inset;
}
[data-bs-theme="dark"] .dropdown-item {
  color: #8aa4c4;
  font-size: 0.875rem;
  transition: var(--nx-transition);
  border-radius: var(--nx-radius-sm);
  margin: 1px 4px;
}
[data-bs-theme="dark"] .dropdown-item:hover {
  background: rgba(34, 211, 238, 0.08);
  color: var(--nx-cyan);
}
[data-bs-theme="dark"] .dropdown-divider { border-color: rgba(34, 211, 238, 0.1); }
[data-bs-theme="dark"] .dropdown-header { color: #3d5570; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* ============================================================
   MODALS
   ============================================================ */
[data-bs-theme="dark"] .modal-content {
  background: #0c1530;
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: var(--nx-radius);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(34, 211, 238, 0.06) inset;
}
[data-bs-theme="dark"] .modal-header {
  border-bottom: 1px solid rgba(34, 211, 238, 0.1);
}
[data-bs-theme="dark"] .modal-title { color: #d4e8ff; }
[data-bs-theme="dark"] .modal-footer {
  border-top: 1px solid rgba(34, 211, 238, 0.1);
}
[data-bs-theme="dark"] .modal-backdrop { background: rgba(5, 8, 20, 0.75); }
[data-bs-theme="dark"] .btn-close { filter: invert(1) brightness(0.6); }
[data-bs-theme="dark"] .btn-close:hover { filter: invert(1) brightness(1); }

/* ============================================================
   TOASTS
   ============================================================ */
[data-bs-theme="dark"] .toast {
  background: #0c1530;
  border: 1px solid rgba(34, 211, 238, 0.2);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}
[data-bs-theme="dark"] .toast-header {
  background: rgba(34, 211, 238, 0.06);
  border-bottom: 1px solid rgba(34, 211, 238, 0.1);
  color: #8aa4c4;
}

/* ============================================================
   FOOTER
   ============================================================ */
[data-bs-theme="dark"] footer#footer {
  color: #2d4060;
  font-size: 0.78rem;
  border-top: 1px solid rgba(34, 211, 238, 0.07);
  padding-top: 1rem;
}
[data-bs-theme="dark"] footer#footer a {
  color: #3d5570;
  transition: var(--nx-transition);
}
[data-bs-theme="dark"] footer#footer a:hover { color: var(--nx-cyan); }

/* ============================================================
   CODE / PRE
   ============================================================ */
[data-bs-theme="dark"] code {
  color: var(--nx-cyan);
  background: rgba(34, 211, 238, 0.08);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
}
[data-bs-theme="dark"] pre {
  background: rgba(5, 10, 25, 0.9);
  border: 1px solid rgba(34, 211, 238, 0.12);
  border-radius: var(--nx-radius);
  color: #b8d4f0;
}

/* ============================================================
   LINKS
   ============================================================ */
[data-bs-theme="dark"] a {
  color: var(--nx-cyan);
  transition: color 0.15s ease;
}
[data-bs-theme="dark"] a:hover { color: #67e8f9; }

/* ============================================================
   MISC UTILITIES
   ============================================================ */
[data-bs-theme="dark"] .text-muted { color: #3d5570 !important; }
[data-bs-theme="dark"] .text-secondary { color: #4a6080 !important; }
[data-bs-theme="dark"] .border        { border-color: rgba(34, 211, 238, 0.12) !important; }
[data-bs-theme="dark"] .border-top    { border-top-color: rgba(34, 211, 238, 0.1) !important; }
[data-bs-theme="dark"] .border-bottom { border-bottom-color: rgba(34, 211, 238, 0.1) !important; }
[data-bs-theme="dark"] .bg-body-secondary { background: rgba(34, 211, 238, 0.04) !important; }
[data-bs-theme="dark"] .bg-dark { background: rgba(10, 18, 42, 0.8) !important; }
[data-bs-theme="dark"] hr { border-color: rgba(34, 211, 238, 0.1); opacity: 1; }

/* ============================================================
   ICON SVG sizing
   ============================================================ */
.icon {
  width: 1.1em;
  height: 1.1em;
  display: inline-block;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
[data-bs-theme="dark"] .wait {
  background: rgba(5, 8, 20, 0.7);
  backdrop-filter: blur(6px);
}
[data-bs-theme="dark"] .spinner-border {
  color: var(--nx-cyan) !important;
  filter: drop-shadow(0 0 8px var(--nx-cyan));
}

/* ============================================================
   THEME TOGGLE BUTTON
   ============================================================ */
.js-theme-toggler {
  opacity: 0.6;
  transition: opacity 0.15s ease;
}
.js-theme-toggler:hover { opacity: 1; }

/* Dark/Light visibility helpers */
[data-bs-theme="dark"]  .hide-theme-dark  { display: none !important; }
[data-bs-theme="light"] .hide-theme-light { display: none !important; }

/* ============================================================
   CLIENT DROPDOWN
   ============================================================ */
[data-bs-theme="dark"] .client-dropdown > button {
  background: transparent;
  border: 1px solid rgba(34, 211, 238, 0.15);
  color: #8aa4c4;
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 500;
}
[data-bs-theme="dark"] .client-dropdown > button:hover {
  border-color: rgba(34, 211, 238, 0.35);
  color: #d4efff;
  background: rgba(34, 211, 238, 0.06);
}

/* ============================================================
   LANGUAGE SELECTOR
   ============================================================ */
[data-bs-theme="dark"] .js-locale-selector {
  background: rgba(5, 10, 25, 0.8);
  border: 1px solid rgba(34, 211, 238, 0.15);
  color: #8aa4c4;
  font-size: 0.8rem;
  max-width: 140px;
}

/* ============================================================
   INVOICE GATEWAY PICKER
   ============================================================ */
.invoice-gateway {
  cursor: pointer;
  transition: var(--nx-transition);
}
[data-bs-theme="dark"] .invoice-gateway {
  border: 1px solid rgba(34, 211, 238, 0.1) !important;
  background: rgba(10, 18, 42, 0.6);
}
[data-bs-theme="dark"] .invoice-gateway:hover {
  border-color: rgba(34, 211, 238, 0.35) !important;
  background: rgba(34, 211, 238, 0.06);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.12);
}
[data-bs-theme="dark"] .btn-check:checked + .btn {
  box-shadow: 0 0 0 2px var(--nx-cyan), 0 0 12px var(--nx-cyan-glow);
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
[data-bs-theme="dark"] a.btn.btn-primary.bottom-0.end-0 {
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--nx-cyan);
  box-shadow: 0 2px 12px rgba(34, 211, 238, 0.2);
}
[data-bs-theme="dark"] a.btn.btn-primary.bottom-0.end-0:hover {
  background: rgba(34, 211, 238, 0.22);
  box-shadow: 0 4px 20px rgba(34, 211, 238, 0.35);
}

/* ============================================================
   SHOWCASE BLOCK (dashboard welcome)
   ============================================================ */
.nx-showcase {
  position: relative;
  overflow: hidden;
  border-radius: var(--nx-radius);
  padding: 2.5rem;
  margin-bottom: 1.5rem;
}

[data-bs-theme="dark"] .nx-showcase {
  background: linear-gradient(135deg, rgba(14, 24, 55, 0.95) 0%, rgba(10, 20, 48, 0.95) 100%);
  border: 1px solid rgba(34, 211, 238, 0.15);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), inset 0 0 60px rgba(34, 211, 238, 0.02);
}

[data-bs-theme="dark"] .nx-showcase::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(34, 211, 238, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

[data-bs-theme="dark"] .nx-showcase h2,
[data-bs-theme="dark"] .nx-showcase h3 {
  color: #e8f4ff;
}

[data-bs-theme="light"] .nx-showcase {
  background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

/* ============================================================
   NAVBAR TOGGLER
   ============================================================ */
[data-bs-theme="dark"] .navbar-toggler {
  border-color: rgba(34, 211, 238, 0.2);
}
[data-bs-theme="dark"] .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2834%2C 211%2C 238%2C 0.7%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767.98px) {
  .card { border-radius: 8px; }
  .nx-showcase { padding: 1.5rem; }

  [data-bs-theme="dark"] .offcanvas-md {
    background: #070b1a !important;
    border-left: 1px solid rgba(34, 211, 238, 0.15);
  }
}

/* ============================================================
   PULSE ANIMATION (for active states)
   ============================================================ */
@keyframes nx-pulse-border {
  0%   { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.3); }
  70%  { box-shadow: 0 0 0 6px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}

[data-bs-theme="dark"] .card.nx-pulse {
  animation: nx-pulse-border 2s infinite;
}

/* ============================================================
   PUBLIC PAGES (Login / Signup / Password Reset)
   ============================================================ */
.page-login body,
.page-signup body {
  min-height: 100vh;
}

/* Full-height centering container for login/signup */
.page-login .container.h-100,
.page-signup .container.h-100 {
  min-height: 100vh;
}

/* Login/signup card polish */
[data-bs-theme="dark"] .page-login .card,
[data-bs-theme="dark"] .page-signup .card {
  border-color: rgba(34, 211, 238, 0.18);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(34, 211, 238, 0.06) inset;
}

[data-bs-theme="dark"] .auth h5 {
  color: #e8f4ff;
  letter-spacing: -0.01em;
}

/* ============================================================
   FLASH MESSAGES (partial_message)
   ============================================================ */
[data-bs-theme="dark"] .h-block {
  padding: 0.8rem 1.2rem;
  border-radius: var(--nx-radius);
  margin-bottom: 0.75rem;
  border: 1px solid;
}
[data-bs-theme="dark"] .h-block.error,
[data-bs-theme="dark"] .h-block.danger {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.3);
  color: #fb7185;
}
[data-bs-theme="dark"] .h-block.success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}
[data-bs-theme="dark"] .h-block h2 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}
[data-bs-theme="dark"] .h-block p { margin: 0; font-size: 0.9rem; }
