@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  --navy: #0D1B2A;
  --navy-mid: #0d1e35;
  --navy-light: #112240;
  --navy-card: #0f1d33;
  --gold: #C9A84C;
  --gold-light: #d4b46a;
  --gold-dim: rgba(201,168,76,0.12);
  --border: rgba(201,168,76,0.15);
  --border-subtle: rgba(255,255,255,0.08);
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,0.85);
  --text-muted: rgba(255,255,255,0.5);
  --success: #2dd4a0;
  --danger: #e05555;
  --warning: #f0a500;
  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Montserrat', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  background: var(--navy) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-body) !important;
  font-size: 0.875rem !important;
  -webkit-text-size-adjust: 100%;
}

p, span, div, li, td, th, label, h1, h2, h3, h4, h5, h6,
a:not(.btn), small, strong, em {
  color: var(--text-primary);
}

/* ── FORCE ALL INPUTS READABLE ── */
input,
textarea,
select,
.form-control,
.form-group .form-control {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 3px !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  padding: 11px 16px !important;
  font-family: var(--font-body) !important;
  font-size: 0.875rem !important;
  width: 100% !important;
  height: auto !important;
  min-height: 46px !important;
  line-height: 1.5 !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0px 1000px #112240 inset !important;
  box-shadow: 0 0 0px 1000px #112240 inset !important;
  caret-color: #ffffff !important;
}

.form-control:focus {
  border-color: var(--gold) !important;
  background: rgba(201,168,76,0.04) !important;
  box-shadow: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.form-control::placeholder {
  color: var(--text-muted) !important;
  -webkit-text-fill-color: var(--text-muted) !important;
}

.form-group label, label {
  font-size: 0.62rem !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: var(--gold) !important;
  margin-bottom: 6px !important;
  font-weight: 500 !important;
  display: block !important;
}

select.form-control option {
  background: var(--navy-mid);
  color: #ffffff;
}

/* ── SIDEBAR ── */
.sidebar {
  background: var(--navy-mid) !important;
  border-right: 1px solid var(--border) !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  height: 100vh !important;
  width: 260px !important;
  z-index: 9999 !important;
  overflow-y: auto !important;
  transition: transform 0.3s ease !important;
}

.sidebar:before,
.sidebar:after { display: none !important; }

/* ── LOGO — FORCE VISIBLE ── */
.sidebar .logo {
  padding: 20px !important;
  border-bottom: 1px solid var(--border) !important;
  background: transparent !important;
  display: block !important;
  min-height: 64px !important;
  overflow: visible !important;
}

.sidebar .logo:after { display: none !important; }

.sidebar .logo a,
.sidebar .logo a.logo-normal,
.sidebar .logo a.logo-mini {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible !important;
  height: auto !important;
  width: auto !important;
}

.sidebar .logo img,
.sidebar .logo a img,
.sidebar .logo a.logo-normal img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-height: 44px !important;
  width: auto !important;
  max-width: 100% !important;
  object-fit: contain !important;
}

/* ── SIDEBAR NAV ── */
.sidebar .sidebar-wrapper {
  background: transparent !important;
}

.sidebar .nav li > a {
  color: var(--text-secondary) !important;
  font-size: 0.65rem !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  padding: 12px 24px !important;
  border-left: 2px solid transparent !important;
  transition: all 0.2s !important;
  border-radius: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.sidebar .nav li > a p {
  color: #ffffff !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: inline-block !important;
  margin: 0 !important;
  font-size: 0.65rem !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
}

.sidebar .nav li > a i {
  color: var(--gold) !important;
  opacity: 0.7 !important;
  margin-right: 10px !important;
  font-size: 1rem !important;
  flex-shrink: 0 !important;
}

.sidebar .nav li > a:hover,
.sidebar .nav li.active > a {
  color: var(--gold) !important;
  background: var(--gold-dim) !important;
  border-left-color: var(--gold) !important;
}

.sidebar .nav li > a:hover p,
.sidebar .nav li.active > a p {
  color: var(--gold) !important;
}

.sidebar .nav li.active > a i { opacity: 1 !important; }

/* ── MAIN PANEL ── */
.main-panel {
  background: var(--navy) !important;
  border-top: none !important;
  margin-left: 260px !important;
  width: calc(100% - 260px) !important;
  min-height: 100vh !important;
  float: none !important;
}

.main-panel > .content {
  padding: 80px 30px 30px !important;
  margin-top: 0 !important;
}

/* ── NAVBAR ── */
.navbar.navbar-absolute,
.navbar {
  background: var(--navy-mid) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important;
  position: fixed !important;
  top: 0 !important;
  left: 260px !important;
  right: 0 !important;
  z-index: 1000 !important;
  width: calc(100% - 260px) !important;
}

.navbar .navbar-brand,
.navbar .navbar-brand img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-height: 36px !important;
  width: auto !important;
}

.navbar-nav .nav-link,
.navbar .navbar-toggler {
  color: var(--text-secondary) !important;
}

.navbar .navbar-brand:hover,
.navbar-nav .nav-link:hover { color: #ffffff !important; }

/* ── CARDS ── */
.card {
  background: var(--navy-card) !important;
  border: 1px solid var(--border-subtle) !important;
  border-top: 2px solid var(--gold) !important;
  border-radius: 4px !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25) !important;
  margin-bottom: 24px !important;
}

.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  padding: 20px 24px 16px !important;
}

.card-header .card-title,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5 {
  font-family: var(--font-display) !important;
  color: #ffffff !important;
  font-size: 1.1rem !important;
}

.card-header .card-category {
  color: var(--gold) !important;
  font-size: 0.6rem !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
}

.card-body {
  padding: 24px !important;
  color: #ffffff !important;
}

.card-body h1, .card-body h2, .card-body h3,
.card-body h4, .card-body h5, .card-body h6,
.card-body p, .card-body span:not(.badge),
.card-body label, .card-body td, .card-body th {
  color: #ffffff !important;
}

/* ── STAT CARDS ── */
.stat-card {
  background: var(--navy-card);
  border: 1px solid var(--border-subtle);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

.stat-label {
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  display: block;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: #ffffff;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-change { font-size: 0.7rem; color: var(--text-muted); }
.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }
.pl-positive { color: var(--success) !important; }
.pl-negative { color: var(--danger) !important; }

/* ── TABLES ── */
.table {
  color: #ffffff !important;
  border-color: transparent !important;
}

.table thead th {
  background: var(--navy-mid) !important;
  color: var(--gold) !important;
  font-size: 0.58rem !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  border-bottom: 1px solid var(--border) !important;
  border-top: none !important;
  padding: 12px 16px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}

.table tbody tr {
  border-bottom: 1px solid var(--border-subtle) !important;
  transition: background 0.15s !important;
}

.table tbody tr:hover {
  background: rgba(201,168,76,0.04) !important;
}

.table tbody td {
  padding: 13px 16px !important;
  vertical-align: middle !important;
  border: none !important;
  color: var(--text-primary) !important;
}

.table tbody td:first-child {
  color: #ffffff !important;
  font-weight: 500 !important;
}

.table-responsive {
  border: none !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* ── BUTTONS ── */
.btn {
  font-size: 0.65rem !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  border-radius: 2px !important;
  font-weight: 600 !important;
  transition: all 0.2s !important;
}

.btn-primary,
.btn-primary:not(:disabled):not(.disabled) {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  color: var(--navy) !important;
}

.btn-primary:hover {
  background: var(--gold-light) !important;
  border-color: var(--gold-light) !important;
}

.btn-secondary, .btn-simple {
  background: transparent !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  color: var(--text-secondary) !important;
}

.btn-secondary:hover, .btn-simple:hover {
  border-color: var(--gold) !important;
  color: var(--gold) !important;
  background: var(--gold-dim) !important;
}

.btn-danger {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #ffffff !important;
}

.btn-success {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  color: var(--navy) !important;
}

.btn-success:hover {
  background: var(--gold-light) !important;
  border-color: var(--gold-light) !important;
}

.btn-sm { padding: 6px 14px !important; }

/* ── BADGES ── */
.badge {
  font-size: 0.58rem !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  padding: 4px 10px !important;
  border-radius: 2px !important;
  font-weight: 600 !important;
}

.badge-success, .badge.bg-success {
  background: rgba(45,212,160,0.15) !important;
  color: var(--success) !important;
  border: 1px solid rgba(45,212,160,0.25) !important;
}

.badge-danger, .badge.bg-danger {
  background: rgba(224,85,85,0.15) !important;
  color: var(--danger) !important;
  border: 1px solid rgba(224,85,85,0.25) !important;
}

.badge-warning, .badge.bg-warning {
  background: rgba(240,165,0,0.15) !important;
  color: var(--warning) !important;
  border: 1px solid rgba(240,165,0,0.25) !important;
}

.badge-info {
  background: rgba(201,168,76,0.15) !important;
  color: var(--gold) !important;
  border: 1px solid var(--border) !important;
}

/* ── ALERTS ── */
.alert-success {
  background: rgba(45,212,160,0.1) !important;
  border: 1px solid rgba(45,212,160,0.25) !important;
  color: var(--success) !important;
  border-radius: 3px !important;
}

.alert-danger {
  background: rgba(224,85,85,0.1) !important;
  border: 1px solid rgba(224,85,85,0.25) !important;
  color: var(--danger) !important;
  border-radius: 3px !important;
}

/* ── DROPDOWN ── */
.dropdown-menu {
  background: var(--navy-mid) !important;
  border: 1px solid var(--border) !important;
  border-radius: 3px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
}

.dropdown-item {
  color: var(--text-secondary) !important;
  font-size: 0.8rem !important;
  padding: 8px 16px !important;
}

.dropdown-item:hover {
  background: var(--gold-dim) !important;
  color: var(--gold) !important;
}

.dropdown-divider { border-color: var(--border-subtle) !important; }

/* ── MODAL ── */
.modal-content {
  background: var(--navy-card) !important;
  border: 1px solid var(--border) !important;
  border-top: 2px solid var(--gold) !important;
}

.modal-header {
  border-bottom: 1px solid var(--border-subtle) !important;
  padding: 20px 24px !important;
}

.modal-title {
  font-family: var(--font-display) !important;
  color: #ffffff !important;
  font-size: 1.2rem !important;
}

.modal-body { padding: 24px !important; color: #ffffff !important; }
.modal-footer { border-top: 1px solid var(--border-subtle) !important; padding: 16px 24px !important; }
.close { color: var(--text-muted) !important; }
.close:hover { color: #ffffff !important; }

/* ── PAGINATION ── */
.pagination .page-link {
  background: var(--navy-card) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-secondary) !important;
  font-size: 0.7rem !important;
}

.pagination .page-item.active .page-link {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  color: var(--navy) !important;
}

.pagination .page-link:hover {
  background: var(--gold-dim) !important;
  color: var(--gold) !important;
}

/* ── FOOTER ── */
.footer {
  background: transparent !important;
  border-top: 1px solid var(--border) !important;
  padding: 16px 24px !important;
}

.footer .copyright {
  font-size: 0.62rem !important;
  color: var(--text-muted) !important;
  letter-spacing: 0.06em !important;
}

/* ── PE METRICS ── */
.pe-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.pe-metric {
  background: var(--navy-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  border-radius: 3px;
  padding: 16px 20px;
}

.pe-metric-label {
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.pe-metric-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #ffffff;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--navy-mid); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }

/* ── LOGIN PAGE ── */
.full-page {
  background: var(--navy) !important;
  min-height: 100vh !important;
}

.full-page:before, .full-page:after { display: none !important; }

/* ── STATUS HELPERS ── */
.status-active { color: var(--success); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; }
.status-pending { color: var(--warning); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; }
.status-closed { color: var(--text-muted); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; }

/* ════════════════════════════════════════
   MOBILE RESPONSIVE — TABLET (≤ 991px)
   ════════════════════════════════════════ */
@media (max-width: 991px) {

  /* Sidebar slides off-screen by default on mobile */
  .sidebar {
    transform: translateX(-260px) !important;
    width: 260px !important;
    z-index: 9999 !important;
  }

  /* When nav-open class is added by White Dashboard JS, sidebar slides in */
  .nav-open .sidebar {
    transform: translateX(0) !important;
  }

  /* Main panel takes full width */
  .main-panel {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* Navbar stretches full width */
  .navbar.navbar-absolute,
  .navbar {
    left: 0 !important;
    width: 100% !important;
  }

  .main-panel > .content {
    padding: 80px 15px 20px !important;
  }

  /* Overlay when sidebar is open */
  .nav-open::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
  }

  .card-body { padding: 16px !important; }
  .card-header { padding: 14px 16px !important; }

  .pe-metrics-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .stat-value { font-size: 1.4rem !important; }

  /* Stack Bootstrap columns */
  .col-md-4, .col-md-6, .col-md-8, .col-md-3 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* ════════════════════════════════════════
   MOBILE RESPONSIVE — PHONE (≤ 575px)
   ════════════════════════════════════════ */
@media (max-width: 575px) {

  .main-panel > .content {
    padding: 70px 10px 15px !important;
  }

  .card { margin-bottom: 14px !important; }
  .card-body { padding: 14px !important; }

  /* Inputs easier to tap on mobile */
  .form-control,
  input, textarea, select {
    font-size: 16px !important;
    padding: 12px 14px !important;
  }

  /* Buttons full width on phone */
  .btn {
    width: 100% !important;
    margin-bottom: 8px !important;
    padding: 12px !important;
    text-align: center !important;
  }

  /* Side by side buttons stay side by side */
  .btn-group .btn,
  .d-flex .btn {
    width: auto !important;
  }

  .form-group { margin-bottom: 14px !important; }

  .pe-metrics-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .stat-value { font-size: 1.3rem !important; }
  .stat-card { padding: 16px !important; }

  .table thead th,
  .table tbody td {
    font-size: 0.72rem !important;
    padding: 10px 8px !important;
  }

  .col-sm-6, .col-sm-4, .col-sm-3, .col-sm-2 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  h4, h5 { font-size: 1rem !important; }

  .footer {
    text-align: center !important;
    padding: 12px !important;
  }

  .footer .copyright { font-size: 0.55rem !important; }

  .navbar .navbar-brand img {
    max-height: 30px !important;
  }
}

/* ══════════════════════════════════════════════════════════
   SUPPLEMENTAL FIXES — March 2026
   ══════════════════════════════════════════════════════════ */

/* ═══ SELECT2 — COMPLETE DARK THEME — ALL STATES ═══ */
.select2-container { width: 100% !important; }

.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.select2-container--focus .select2-selection--single,
.select2-container--open .select2-selection--single {
    background-color: #0f1d33 !important;
    background: #0f1d33 !important;
    border: 1px solid rgba(201,168,76,0.35) !important;
    color: #ffffff !important;
    height: 46px !important;
    border-radius: 4px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-selection--single .select2-selection__rendered,
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__rendered {
    background-color: #0f1d33 !important;
    background: #0f1d33 !important;
    color: #ffffff !important;
    line-height: 44px !important;
    padding-left: 14px !important;
    padding-right: 30px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow,
.select2-selection--single .select2-selection__arrow {
    background: transparent !important;
    height: 44px !important;
    right: 8px !important;
    top: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #C9A84C transparent transparent transparent !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #C9A84C transparent !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: rgba(255,255,255,0.4) !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    color: rgba(255,255,255,0.5) !important;
}

.select2-dropdown,
.select2-container--default .select2-dropdown,
.select2-container--open .select2-dropdown {
    background-color: #0f1d33 !important;
    background: #0f1d33 !important;
    border: 1px solid rgba(201,168,76,0.35) !important;
    border-radius: 4px !important;
    z-index: 99999 !important;
}

.select2-results,
.select2-results__options {
    background-color: #0f1d33 !important;
    background: #0f1d33 !important;
}

.select2-container--default .select2-results__option,
.select2-results__option {
    background-color: #0f1d33 !important;
    color: #ffffff !important;
    padding: 10px 14px !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[data-selected] {
    background-color: rgba(201,168,76,0.2) !important;
    color: #C9A84C !important;
}

.select2-container--default .select2-results__option[aria-selected="true"],
.select2-container--default .select2-results__option[data-selected="true"] {
    background-color: rgba(201,168,76,0.12) !important;
    color: #C9A84C !important;
}

.select2-search--dropdown,
.select2-container--default .select2-search--dropdown {
    background-color: #0B1628 !important;
    padding: 8px !important;
}

.select2-search--dropdown .select2-search__field,
.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: #0B1628 !important;
    background: #0B1628 !important;
    border: 1px solid rgba(201,168,76,0.25) !important;
    color: #ffffff !important;
    border-radius: 3px !important;
    padding: 7px 10px !important;
    outline: none !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #C9A84C !important;
    box-shadow: none !important;
}

/* Kill any white that Bootstrap or other CSS injects */
.select2-container *,
.select2-dropdown *,
.select2-results * {
    box-sizing: border-box !important;
}

/* ── SELECTIZE DARK THEME ── */
.selectize-input {
  background-color: #0f1d33 !important;
  border: 1px solid rgba(201,168,76,0.35) !important;
  color: #ffffff !important;
  border-radius: 4px !important;
  min-height: 46px !important;
  padding: 10px 14px !important;
  box-shadow: none !important;
}
.selectize-input.focus {
  border-color: #C9A84C !important;
  box-shadow: 0 0 0 0.2rem rgba(201,168,76,0.15) !important;
}
.selectize-input input {
  color: #ffffff !important;
}
.selectize-input .item {
  color: #ffffff !important;
}
.selectize-dropdown {
  background-color: #0f1d33 !important;
  border: 1px solid rgba(201,168,76,0.35) !important;
  border-radius: 4px !important;
  color: #ffffff !important;
  z-index: 9999 !important;
}
.selectize-dropdown .option {
  color: #ffffff !important;
  background-color: #0f1d33 !important;
  padding: 10px 14px !important;
}
.selectize-dropdown .option.active,
.selectize-dropdown .option:hover {
  background-color: rgba(201,168,76,0.18) !important;
  color: #C9A84C !important;
}
.selectize-dropdown .option.selected {
  background-color: rgba(201,168,76,0.1) !important;
  color: #C9A84C !important;
}
.selectize-control.single .selectize-input:after {
  border-color: var(--gold) transparent transparent !important;
}

/* ── DATATABLES DARK THEME ── */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  background-color: #0f1d33 !important;
  border: 1px solid rgba(201,168,76,0.3) !important;
  color: #ffffff !important;
  border-radius: 4px !important;
  padding: 4px 8px !important;
}
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_info {
  color: var(--text-muted) !important;
  font-size: 0.75rem !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  background: var(--navy-card) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-secondary) !important;
  border-radius: 3px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  color: var(--navy) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--gold-dim) !important;
  border-color: var(--gold) !important;
  color: var(--gold) !important;
}
table.dataTable thead th {
  border-bottom: 1px solid var(--border) !important;
}
table.dataTable.no-footer {
  border-bottom: 1px solid var(--border-subtle) !important;
}

/* Input group styling */
.input-group-append .btn,
.input-group-prepend .btn {
    width: auto !important;
    border-left: none !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    background: rgba(255,255,255,0.04) !important;
    color: var(--text-muted) !important;
    padding: 0 12px !important;
}

.input-group-append .btn:hover {
    color: var(--gold) !important;
    border-color: var(--gold) !important;
}

/* Profile photo wrapper */
.profile-photo-wrapper { cursor: pointer; }

/* Navbar — ensure logo visible */
.crescendo-navbar {
    background: var(--navy-mid) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: none !important;
}

.crescendo-navbar .navbar-brand img {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-height: 36px !important;
    width: auto !important;
}

/* Dropdown navbar styling */
.dropdown-navbar {
    background: var(--navy-mid) !important;
    border: 1px solid var(--border) !important;
    min-width: 200px !important;
}

.dropdown-navbar .nav-link a,
.dropdown-navbar .dropdown-item {
    color: var(--text-secondary) !important;
    font-size: 0.78rem !important;
}

.dropdown-navbar .dropdown-item:hover {
    background: var(--gold-dim) !important;
    color: var(--gold) !important;
}

/* Photo in navbar */
.navbar .photo img,
.navbar .photo div {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Alert styling */
.alert {
    border-radius: 3px !important;
    font-size: 0.8rem !important;
    padding: 12px 16px !important;
}

/* Required field asterisk */
span[style*="color:var(--danger)"] {
    color: var(--danger) !important;
}

/* Fix register page form text visibility */
.users-create .form-control,
.profile-form .form-control {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Fix table action buttons */
.table .btn {
    width: auto !important;
    margin-bottom: 0 !important;
    padding: 4px 10px !important;
}

/* Fix card on settings page */
.settings-card {
    background: var(--navy-card) !important;
}

/* ══════════════════════════════════════════════════════════
   FINAL CSS ADDITIONS — March 2026
   ══════════════════════════════════════════════════════════ */

/* ── FLASH ALERT AUTO-DISMISS ── */
.alert-auto-dismiss {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    animation: slideInRight 0.4s ease forwards, fadeOut 0.5s ease 5s forwards;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-10px); }
}

/* ── STATUS BADGE CLASSES ── */
.badge-active {
    background: #22C55E !important;
    color: #ffffff !important;
}

.badge-pending {
    background: #F59E0B !important;
    color: #1a1a1a !important;
}

.badge-inactive {
    background: #6B7280 !important;
    color: #ffffff !important;
}

/* ── SELECT ELEMENT FIX ── */
select,
select.form-control {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: #0D1B2A !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 1px solid rgba(201,168,76,0.4) !important;
    border-radius: 4px !important;
    padding: 10px 36px 10px 14px !important;
    height: 46px !important;
    min-height: 46px !important;
    line-height: 1.5 !important;
    font-size: 0.875rem !important;
    width: 100% !important;
    cursor: pointer !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23C9A84C' d='M6 8L0 0h12z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
}

select:focus,
select.form-control:focus {
    border-color: #C9A84C !important;
    outline: none !important;
    box-shadow: none !important;
}

/* ── INITIALS AVATAR ── */
.initials-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(201,168,76,0.2), rgba(201,168,76,0.08));
    border: 2px solid rgba(201,168,76,0.4);
    color: var(--gold);
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.initials-avatar.avatar-lg {
    width: 120px;
    height: 120px;
    font-size: 2.5rem;
}

.initials-avatar.avatar-md {
    width: 80px;
    height: 80px;
    font-size: 1.6rem;
}

.initials-avatar.avatar-sm {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
}

/* ── LOGO TEXT FALLBACK ── */
.logo-text-fallback {
    display: none;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.04em;
    line-height: 44px;
}

.sidebar .logo img.logo-broken + .logo-text-fallback,
.sidebar .logo img[src=""] + .logo-text-fallback {
    display: block;
}

/* ── EMPTY STATE STYLING ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    color: var(--gold);
    opacity: 0.5;
    margin-bottom: 16px;
    display: block;
}

.empty-state p {
    font-size: 0.85rem;
}

/* ── CONFIRMATION MODAL STYLING ── */
.modal-confirm .modal-content {
    border-top: 2px solid var(--danger) !important;
}

.modal-confirm input.confirm-input {
    text-align: center;
    font-size: 0.85rem;
}

/* ── FUND METRICS TABLE ── */
.metric-value {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--gold);
}

/* ══════════════════════════════════════════════════════════
   GLOBAL FORM INPUT DARK THEME (Issue 5 — Contrast)
   ══════════════════════════════════════════════════════════ */
.form-control, .form-select, input[type="text"], input[type="number"],
input[type="email"], input[type="date"], input[type="password"],
input[type="tel"], textarea, select:not(.select2-hidden-accessible) {
    background-color: #0f1d33 !important;
    border: 1px solid rgba(201,168,76,0.3) !important;
    color: #ffffff !important;
}
.form-control::placeholder, textarea::placeholder {
    color: rgba(255,255,255,0.35) !important;
}
.form-control:focus, .form-select:focus, input:focus,
textarea:focus, select:focus {
    background-color: #0f1d33 !important;
    border-color: #C9A84C !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.2rem rgba(201,168,76,0.15) !important;
}

/* ═══════════════════════════════════════════════════
   CRESCENDO — GLOBAL VISIBILITY ENFORCEMENT
   These rules are the final word on text color.
   They exist because white-content class and CSS
   inheritance was causing near-invisible text.
═══════════════════════════════════════════════════ */

/* Base: everything in the main content area is white */
.main-panel,
.main-panel *:not(button):not(.btn):not(.badge):not(a),
.card-body,
.card-body * {
    color: #ffffff;
}

/* Gold for labels, headings, table headers */
.main-panel label,
.main-panel .form-label,
.main-panel th,
.main-panel thead th,
.main-panel .card-title,
.main-panel h1, .main-panel h2,
.main-panel h3, .main-panel h4,
.main-panel h5, .main-panel h6 {
    color: #C9A84C !important;
}

/* White for table cell content */
.main-panel td,
.main-panel td *,
.main-panel tbody tr td {
    color: #ffffff !important;
}

/* Settings / info tables specifically */
.table td,
.table th,
.table-striped td,
.table-striped th,
.table-bordered td,
.table-bordered th {
    color: #ffffff !important;
    border-color: rgba(201,168,76,0.15) !important;
}

/* ═══ ERROR AND ALERT MESSAGES — ALWAYS VISIBLE ═══ */
.alert,
.alert *,
.alert p,
.alert ul,
.alert li,
.alert-danger,
.alert-danger *,
.alert-success,
.alert-success *,
.alert-warning,
.alert-warning *,
.alert-info,
.alert-info * {
    color: #ffffff !important;
}

.alert-danger {
    background-color: rgba(224, 85, 85, 0.18) !important;
    border: 1px solid rgba(224, 85, 85, 0.5) !important;
    border-left: 4px solid #e05555 !important;
    border-radius: 6px !important;
    padding: 14px 18px !important;
}

.alert-success {
    background-color: rgba(45, 212, 160, 0.15) !important;
    border: 1px solid rgba(45, 212, 160, 0.4) !important;
    border-left: 4px solid #2dd4a0 !important;
    border-radius: 6px !important;
    padding: 14px 18px !important;
}

.alert-warning {
    background-color: rgba(201, 168, 76, 0.15) !important;
    border: 1px solid rgba(201, 168, 76, 0.4) !important;
    border-left: 4px solid #C9A84C !important;
    border-radius: 6px !important;
    padding: 14px 18px !important;
}

/* ═══ INLINE VALIDATION ERRORS ═══ */
.invalid-feedback,
.text-danger,
.text-danger *,
span.text-danger,
div.text-danger,
p.text-danger {
    color: #ff8080 !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    margin-top: 5px !important;
    display: block !important;
}

/* ═══ FORM INPUTS — ALL STATES (final override) ═══ */
.form-control,
.form-control:focus,
.form-control:active,
.form-control:hover,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
textarea,
select {
    background-color: #0f1d33 !important;
    background: #0f1d33 !important;
    border: 1px solid rgba(201,168,76,0.3) !important;
    color: #ffffff !important;
    border-radius: 4px !important;
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: #C9A84C !important;
    box-shadow: 0 0 0 0.2rem rgba(201,168,76,0.15) !important;
    outline: none !important;
}

input::placeholder,
textarea::placeholder,
.form-control::placeholder {
    color: rgba(255,255,255,0.35) !important;
}

/* ═══ BREADCRUMBS ═══ */
.breadcrumb-item,
.breadcrumb-item a,
.breadcrumb-item.active {
    color: rgba(255,255,255,0.6) !important;
}
.breadcrumb-item a:hover {
    color: #C9A84C !important;
}

/* ═══ MUTED / SECONDARY TEXT ═══ */
.text-muted,
.text-secondary,
small,
.small {
    color: rgba(255,255,255,0.55) !important;
}

/* ═══ CARD SECTION TITLES ═══ */
.card .card-header,
.card .card-header * {
    color: #C9A84C !important;
    background-color: transparent !important;
    border-bottom: 1px solid rgba(201,168,76,0.2) !important;
}

/* ═══ FINAL SELECT2 OVERRIDE — must be last in file ═══ */
.select2-container .select2-selection--single,
.select2-container--default .select2-selection--single {
    background-color: #0f1d33 !important;
    background: #0f1d33 !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    border-radius: 4px !important;
    height: 40px !important;
    color: #ffffff !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #ffffff !important;
    line-height: 40px !important;
    padding-left: 12px !important;
    background-color: #0f1d33 !important;
    background: #0f1d33 !important;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: rgba(255,255,255,0.45) !important;
    background-color: #0f1d33 !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
    background-color: #0f1d33 !important;
    background: #0f1d33 !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: rgba(201,168,76,0.7) transparent transparent transparent !important;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent rgba(201,168,76,0.7) transparent !important;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #C9A84C !important;
    outline: none !important;
}
.select2-dropdown {
    background-color: #0f1d33 !important;
    border: 1px solid #C9A84C !important;
}
.select2-container--default .select2-results__option {
    color: #ffffff !important;
    background-color: #0f1d33 !important;
    padding: 8px 12px !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: rgba(201,168,76,0.15) !important;
    color: #C9A84C !important;
}
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: rgba(201,168,76,0.1) !important;
    color: #C9A84C !important;
}
.select2-search--dropdown .select2-search__field {
    background-color: #0D1B2A !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    color: #ffffff !important;
    padding: 6px 10px !important;
}
.select2-container--default .select2-selection--multiple {
    background-color: #0f1d33 !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    min-height: 40px !important;
}

/* ═══ NATIVE SELECT — DARK THEME ═══ */
select,
select.form-control,
.form-control select {
    background-color: #0f1d33 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    -webkit-appearance: none;
    appearance: none;
}
select option {
    background-color: #0f1d33 !important;
    color: #ffffff !important;
}

/* ═══ HOLDING STATUS BADGES ═══ */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.status-pending   { background: rgba(201,168,76,0.15);  color: #C9A84C; }
.status-settled   { background: rgba(45,212,160,0.15);  color: #2dd4a0; }
.status-completed { background: rgba(45,212,160,0.15);  color: #2dd4a0; }
.status-cancelled { background: rgba(224,85,85,0.15);   color: #e05555; }
.status-partial   { background: rgba(85,153,255,0.15);  color: #5599ff; }
.status-active    { background: rgba(45,212,160,0.15);  color: #2dd4a0; }
.status-paid      { background: rgba(45,212,160,0.15);  color: #2dd4a0; }
.status-closed    { background: rgba(107,114,128,0.15); color: #9CA3AF; }

/* Override white-content class remnants from White Dashboard theme */
.white-content .card,
.white-content .card-body,
.white-content .main-panel,
.white-content .table td,
.white-content .form-control,
.white-content input,
.white-content select,
.white-content textarea {
    background-color: inherit;
    color: inherit;
}

/* ── Chrome / Safari Autofill Override ─────────────────────────────────
   Must be at very bottom to win all specificity battles.
   Uses box-shadow inset trick + delayed transition to prevent white flash.
   ───────────────────────────────────────────────────────────────────── */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0px 1000px #0f1d33 inset !important;
    box-shadow: 0 0 0px 1000px #0f1d33 inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

.auth-card input:-webkit-autofill,
.auth-card input:-webkit-autofill:hover,
.auth-card input:-webkit-autofill:focus,
.auth-card input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0px 1000px #0f1d33 inset !important;
    box-shadow: 0 0 0px 1000px #0f1d33 inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s !important;
}
