/* ============================================================
   BoxItAndGo — Main Stylesheet
   Bootstrap 5 + custom theme
   ============================================================ */

:root {
  --bit-primary:       #3b5bdb;
  --bit-primary-dark:  #2f4ac0;
  --bit-secondary:     #6c757d;
  --bit-accent:        #f76707;
  --bit-success:       #2f9e44;
  --bit-sidebar-bg:    #1e2a3a;
  --bit-sidebar-text:  rgba(255,255,255,0.82);
  --bit-sidebar-hover: rgba(255,255,255,0.12);
  --bit-sidebar-active:#3b5bdb;
  --bit-sidebar-width: 260px;
  --bit-topbar-h:      60px;
  --bit-card-shadow:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.12);
  --bit-card-radius:   .625rem;
  --bit-transition:    .2s ease;
}

/* ── Layout ── */
body {
  background: #f4f6fb;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: .9375rem;
}

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

/* ── Sidebar ── */
.bit-sidebar {
  width: var(--bit-sidebar-width);
  background: var(--bit-sidebar-bg);
  color: var(--bit-sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1040;
  transition: transform var(--bit-transition);
  overflow-y: auto;
  overflow-x: hidden;
}
.bit-sidebar::-webkit-scrollbar { width: 4px; }
.bit-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.bit-sidebar-brand {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.bit-sidebar-brand .brand-icon {
  width: 38px;
  height: 38px;
  background: var(--bit-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.bit-sidebar-nav {
  padding: .75rem 0;
  flex: 1;
}

.bit-nav-section-label {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 1rem 1.5rem .35rem;
}

.bit-sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .55rem 1.5rem;
  color: var(--bit-sidebar-text);
  text-decoration: none;
  font-size: .9rem;
  border-radius: 0;
  transition: background var(--bit-transition), color var(--bit-transition);
  white-space: nowrap;
}
.bit-sidebar-nav .nav-link:hover {
  background: var(--bit-sidebar-hover);
  color: #fff;
}
.bit-sidebar-nav .nav-link.active {
  background: var(--bit-sidebar-active);
  color: #fff;
}
.bit-sidebar-nav .nav-link i {
  font-size: 1rem;
  width: 1.2rem;
  text-align: center;
  flex-shrink: 0;
}

/* Sub-menu collapse */
.bit-sidebar-nav .collapse-toggle::after {
  content: "\F229";
  font-family: "bootstrap-icons";
  margin-left: auto;
  font-size: .75rem;
  transition: transform var(--bit-transition);
}
.bit-sidebar-nav .collapse-toggle[aria-expanded="true"]::after {
  transform: rotate(90deg);
}
.bit-sidebar-nav .sub-nav {
  padding-left: 1rem;
}
.bit-sidebar-nav .sub-nav .nav-link {
  font-size: .85rem;
  padding: .4rem 1.5rem;
}

.bit-sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .82rem;
  color: rgba(255,255,255,.4);
}

/* ── Main Content ── */
.bit-main {
  margin-left: var(--bit-sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Topbar ── */
.bit-topbar {
  height: var(--bit-topbar-h);
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.bit-topbar .topbar-search {
  flex: 1;
  max-width: 400px;
}
.bit-topbar .topbar-search .form-control {
  border-radius: 8px;
  background: #f4f6fb;
  border-color: transparent;
  font-size: .875rem;
}
.bit-topbar .topbar-search .form-control:focus {
  background: #fff;
  border-color: var(--bit-primary);
  box-shadow: 0 0 0 3px rgba(59,91,219,.15);
}

.bit-topbar .topbar-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
}
.bit-topbar .topbar-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  position: relative;
  transition: background var(--bit-transition);
  text-decoration: none;
}
.bit-topbar .topbar-icon-btn:hover {
  background: #f4f6fb;
  color: var(--bit-primary);
}
.workspace-switcher-btn {
  font-size: .8rem;
  padding: .25rem .6rem;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bit-topbar .notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: #dc3545;
  border-radius: 50%;
  border: 2px solid #fff;
}

.bit-topbar .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bit-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  text-decoration: none;
}

/* ── Page Content ── */
.bit-content {
  padding: 1.75rem;
  flex: 1;
}

.bit-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.bit-page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: #1a1d23;
}
.bit-breadcrumb {
  font-size: .8rem;
  color: #6c757d;
  margin-bottom: .25rem;
}
.bit-breadcrumb a { color: #6c757d; text-decoration: none; }
.bit-breadcrumb a:hover { color: var(--bit-primary); }

/* ── Cards ── */
.bit-card {
  background: #fff;
  border-radius: var(--bit-card-radius);
  box-shadow: var(--bit-card-shadow);
  border: 1px solid #e9ecef;
  overflow: hidden;
}
.bit-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.bit-card-header h5 {
  font-size: .95rem;
  font-weight: 600;
  margin: 0;
  color: #1a1d23;
}
.bit-card-body { padding: 1.25rem; }

/* ── Stat Cards (Dashboard) ── */
.bit-stat-card {
  background: #fff;
  border-radius: var(--bit-card-radius);
  box-shadow: var(--bit-card-shadow);
  border: 1px solid #e9ecef;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--bit-transition), transform var(--bit-transition);
}
.bit-stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  transform: translateY(-1px);
  color: inherit;
}
.bit-stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.bit-stat-icon.bg-primary-soft { background: rgba(59,91,219,.12); color: var(--bit-primary); }
.bit-stat-icon.bg-success-soft { background: rgba(47,158,68,.12); color: var(--bit-success); }
.bit-stat-icon.bg-warning-soft { background: rgba(247,103,7,.12); color: var(--bit-accent); }
.bit-stat-icon.bg-danger-soft  { background: rgba(220,53,69,.12); color: #dc3545; }
.bit-stat-icon.bg-info-soft    { background: rgba(13,202,240,.12); color: #0dcaf0; }
.bit-stat-icon.bg-purple-soft  { background: rgba(111,66,193,.12); color: #6f42c1; }
.bit-stat-count {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  color: #1a1d23;
}
.bit-stat-label {
  font-size: .8rem;
  color: #6c757d;
  margin-top: .2rem;
}

/* ── Tables ── */
.bit-table th {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6c757d;
  background: #f8f9fa;
  border-color: #e9ecef;
  white-space: nowrap;
}
.bit-table td { 
  vertical-align: middle;
  border-color: #f0f2f5;
  font-size: .9rem;
}

/* ── Forms ── */
.bit-form-label {
  font-size: .85rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: .35rem;
}
.form-control, .form-select {
  font-size: .9rem;
  border-color: #dee2e6;
}
.form-control:focus, .form-select:focus {
  border-color: var(--bit-primary);
  box-shadow: 0 0 0 3px rgba(59,91,219,.15);
}

/* ── Buttons ── */
.btn-primary {
  background: var(--bit-primary);
  border-color: var(--bit-primary);
}
.btn-primary:hover {
  background: var(--bit-primary-dark);
  border-color: var(--bit-primary-dark);
}

/* ── Auth Pages ── */
.bit-auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e2a3a 0%, #3b5bdb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.bit-auth-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}
.bit-auth-logo {
  width: 56px;
  height: 56px;
  background: var(--bit-primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  margin: 0 auto 1.5rem;
}

/* ── Badges ── */
.badge { font-weight: 500; font-size: .75rem; }

/* ── Empty State ── */
.bit-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #6c757d;
}
.bit-empty-state i {
  font-size: 3.5rem;
  opacity: .3;
  display: block;
  margin-bottom: 1rem;
}
.bit-empty-state h5 { font-weight: 600; color: #495057; }

/* ── QR Code ── */
.qr-container img { max-width: 200px; }

/* ── Progress ring ── */
.bit-progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Responsive ── */
@media (max-width: 991.98px) {
  .bit-sidebar {
    transform: translateX(-100%);
  }
  .bit-sidebar.show {
    transform: translateX(0);
  }
  .bit-main {
    margin-left: 0;
  }
  .bit-content {
    padding: 1.25rem 1rem;
  }
}

/* ── Utilities ── */
.fs-7 { font-size: .8rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Subscription plan badges ── */
.plan-free     { background: #6c757d; }
.plan-basic    { background: #0d6efd; }
.plan-pro      { background: #6f42c1; }
.plan-enterprise { background: #d63384; }

/* ── Pagination ─────────────────────────────────────────────── */
/* Targets Yii2 LinkPager output: <li class="active|prev|next|disabled"> with plain <a>/<span> */
.pagination {
    gap: 3px;
    margin: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding-left: 0;
}

.pagination li a,
.pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px !important;
    color: #1A3A5C;
    font-size: .82rem;
    font-weight: 500;
    padding: 5px 12px;
    line-height: 1.4;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
    min-width: 32px;
}

.pagination li a:hover {
    background: #f0f4f8;
    border-color: #1A3A5C;
    color: #1A3A5C;
}

.pagination li a:focus {
    box-shadow: 0 0 0 3px rgba(26, 58, 92, .15);
    outline: none;
}

/* Active page */
.pagination li.active a {
    background: #1A3A5C;
    border-color: #1A3A5C;
    color: #fff;
    font-weight: 700;
    pointer-events: none;
}

/* Disabled (prev/next when on first/last page) */
.pagination li.disabled span,
.pagination li.disabled a {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #b0bec5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Prev / Next arrow buttons — slightly wider */
.pagination li.prev a,
.pagination li.prev span,
.pagination li.next a,
.pagination li.next span {
    padding: 5px 14px;
    font-weight: 600;
    letter-spacing: .02em;
}

/* Portal / custom pagination */
.portal-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #1A3A5C;
    text-decoration: none;
    font-size: .82rem;
    font-weight: 500;
    background: #fff;
    transition: background .15s, border-color .15s, color .15s;
}

.portal-pagination-link:hover {
    background: #f0f4f8;
    border-color: #1A3A5C;
    color: #1A3A5C;
    text-decoration: none;
}

.portal-pagination-link-active {
    background: #1A3A5C;
    border-color: #1A3A5C;
    color: #fff;
    font-weight: 700;
    pointer-events: none;
}

.portal-pagination-wrap {
    padding: 1rem 1.25rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.portal-pagination-pages {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.portal-pagination-info {
    font-size: .78rem;
    color: #64748b;
}

/* ── Audit log change list ── */
.audit-change-list {
    border-left: 2px solid #e2e8f0;
    padding-left: .75rem;
    margin-left: .25rem;
}

.audit-change-row {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    padding: .2rem 0;
    font-size: .8rem;
    line-height: 1.4;
    flex-wrap: wrap;
}

.audit-field-label {
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
    min-width: 90px;
    flex-shrink: 0;
}

.audit-field-label::after {
    content: ':';
}

.audit-arrow {
    display: flex;
    align-items: baseline;
    gap: .2rem;
    flex-wrap: wrap;
}

.audit-old {
    color: #94a3b8;
    text-decoration: line-through;
    font-size: .78rem;
}

.audit-new {
    font-weight: 500;
}

/* Chevron rotation on expand */
.audit-toggle[aria-expanded="true"] .audit-chevron {
    transform: rotate(180deg);
}

.audit-chevron {
    display: inline-block;
    transition: transform .2s ease;
}

/* ── Sidebar overlay for mobile ── */
.bit-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
}
.bit-sidebar-overlay.show { display: block; }

/* Scroll offset for tab cards so fixed topbar doesn't cover them */
.bit-scroll-target,
#location-tabs-card,
#room-tabs-card,
#itemTabs {
  scroll-margin-top: calc(var(--bit-topbar-h) + 16px);
}

/* ── Dark Mode ─────────────────────────────────────────────────────────────
   Step 1: Redefine Bootstrap CSS custom properties at the scope root.
           Every Bootstrap component reads these variables, so this one block
           makes cards, tables, forms, dropdowns, modals, etc. all go dark
           without needing individual rules for each component.
   Step 2: Override our custom .bit-* classes that use hardcoded hex colors.
   ──────────────────────────────────────────────────────────────────────── */

/* ── 1. Bootstrap CSS variable reset ── */
[data-bs-theme="dark"] {
  color-scheme: dark;

  /* Core */
  --bs-body-bg:              #0f1117;
  --bs-body-bg-rgb:          15,17,23;
  --bs-body-color:           #e2e8f0;
  --bs-body-color-rgb:       226,232,240;

  /* Text emphasis levels */
  --bs-emphasis-color:       #f8fafc;
  --bs-secondary-color:      #94a3b8;
  --bs-tertiary-color:       #64748b;
  --bs-heading-color:        #e2e8f0;

  /* Surface layers */
  --bs-secondary-bg:         #1a1d27;
  --bs-tertiary-bg:          #1e2130;

  /* Borders */
  --bs-border-color:                #2a2d3a;
  --bs-border-color-translucent:    rgba(255,255,255,.12);

  /* Links */
  --bs-link-color:           #7c9ef5;
  --bs-link-hover-color:     #a5b9f7;

  /* Card */
  --bs-card-bg:              #1a1d27;
  --bs-card-border-color:    #2a2d3a;
  --bs-card-cap-bg:          rgba(255,255,255,.04);
  --bs-card-color:           #e2e8f0;

  /* Table */
  --bs-table-bg:             #1a1d27;
  --bs-table-color:          #e2e8f0;
  --bs-table-border-color:   #2a2d3a;
  --bs-table-striped-bg:     #1e2130;
  --bs-table-striped-color:  #e2e8f0;
  --bs-table-hover-bg:       rgba(255,255,255,.05);
  --bs-table-hover-color:    #e2e8f0;

  /* Form controls */
  --bs-form-control-bg:               #252830;
  --bs-form-select-bg:                #252830;

  /* Input group */
  --bs-input-group-addon-bg:          #1e2130;
  --bs-input-group-addon-border-color:#2a2d3a;
  --bs-input-group-addon-color:       #94a3b8;

  /* Dropdown */
  --bs-dropdown-bg:                   #1e2130;
  --bs-dropdown-border-color:         #2a2d3a;
  --bs-dropdown-color:                #e2e8f0;
  --bs-dropdown-link-color:           #e2e8f0;
  --bs-dropdown-link-hover-color:     #fff;
  --bs-dropdown-link-hover-bg:        #252830;
  --bs-dropdown-link-active-bg:       var(--bit-primary);
  --bs-dropdown-divider-bg:           #2a2d3a;
  --bs-dropdown-header-color:         #64748b;

  /* Modal */
  --bs-modal-bg:             #1a1d27;
  --bs-modal-content-bg:     #1a1d27;
  --bs-modal-border-color:   #2a2d3a;
  --bs-modal-header-border-color: #2a2d3a;
  --bs-modal-footer-border-color: #2a2d3a;

  /* Nav / tabs */
  --bs-nav-tabs-border-color:              #2a2d3a;
  --bs-nav-tabs-link-hover-border-color:   #2a2d3a;
  --bs-nav-tabs-link-active-bg:            #1a1d27;
  --bs-nav-tabs-link-active-color:         #e2e8f0;
  --bs-nav-tabs-link-active-border-color:  #2a2d3a #2a2d3a #1a1d27;
  --bs-nav-link-color:                     #94a3b8;
  --bs-nav-link-hover-color:               #e2e8f0;

  /* List group */
  --bs-list-group-bg:              #1a1d27;
  --bs-list-group-border-color:    #2a2d3a;
  --bs-list-group-color:           #e2e8f0;
  --bs-list-group-hover-bg:        #252830;
  --bs-list-group-action-hover-color: #fff;
  --bs-list-group-action-color:    #e2e8f0;

  /* Pagination */
  --bs-pagination-bg:                   #1a1d27;
  --bs-pagination-border-color:         #2a2d3a;
  --bs-pagination-color:                #e2e8f0;
  --bs-pagination-hover-bg:             #252830;
  --bs-pagination-hover-color:          #fff;
  --bs-pagination-hover-border-color:   var(--bit-primary);
  --bs-pagination-active-bg:            var(--bit-primary);
  --bs-pagination-active-border-color:  var(--bit-primary);
  --bs-pagination-disabled-bg:          #151820;
  --bs-pagination-disabled-color:       #4a5568;
  --bs-pagination-disabled-border-color:#2a2d3a;

  /* Accordion */
  --bs-accordion-bg:             #1a1d27;
  --bs-accordion-border-color:   #2a2d3a;
  --bs-accordion-color:          #e2e8f0;
  --bs-accordion-btn-color:      #e2e8f0;
  --bs-accordion-btn-bg:         #1a1d27;
  --bs-accordion-active-color:   #fff;
  --bs-accordion-active-bg:      #1e2130;

  /* Tooltip / popover */
  --bs-tooltip-bg:               #e2e8f0;
  --bs-tooltip-color:            #1a1d27;
  --bs-popover-bg:               #1e2130;
  --bs-popover-border-color:     #2a2d3a;
  --bs-popover-header-bg:        #252830;
  --bs-popover-header-color:     #e2e8f0;
  --bs-popover-body-color:       #94a3b8;

  /* Subtle bg / border helpers (Bootstrap 5.3+) */
  --bs-secondary-bg-subtle:      #1e2130;
  --bs-secondary-border-subtle:  #2a2d3a;
  --bs-secondary-text-emphasis:  #94a3b8;
  --bs-light-bg-subtle:          #1e2130;
  --bs-light-border-subtle:      #2a2d3a;
  --bs-dark-bg-subtle:           #0f1117;
  --bs-dark-border-subtle:       #2a2d3a;
}

/* ── 2. Force backgrounds that Bootstrap doesn't cover via variables ── */
[data-bs-theme="dark"] body                 { background-color: #0f1117 !important; color: #e2e8f0; }
[data-bs-theme="dark"] .bit-topbar          { background: #1a1d27 !important; border-bottom-color: #2a2d3a !important; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
[data-bs-theme="dark"] .bit-content         { background: #0f1117 !important; }

/* Custom .bit-* cards and components */
[data-bs-theme="dark"] .bit-card            { background: #1a1d27 !important; border-color: #2a2d3a !important; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
[data-bs-theme="dark"] .bit-card-header     { background: #1e2130; border-bottom-color: #2a2d3a !important; }
[data-bs-theme="dark"] .bit-card-header h5,
[data-bs-theme="dark"] .bit-card-header h6  { color: #e2e8f0; }
[data-bs-theme="dark"] .bit-stat-card       { background: #1a1d27 !important; border-color: #2a2d3a !important; }
[data-bs-theme="dark"] .bit-stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.4); }
[data-bs-theme="dark"] .bit-stat-count      { color: #e2e8f0; }
[data-bs-theme="dark"] .bit-stat-label      { color: #94a3b8; }
[data-bs-theme="dark"] .bit-page-header h1  { color: #e2e8f0; }
[data-bs-theme="dark"] .bit-breadcrumb      { color: #64748b; }
[data-bs-theme="dark"] .bit-breadcrumb a    { color: #64748b; }
[data-bs-theme="dark"] .bit-breadcrumb a:hover { color: #7c9ef5; }
[data-bs-theme="dark"] .bit-form-label      { color: #94a3b8; }
[data-bs-theme="dark"] .bit-empty-state     { color: #94a3b8; }
[data-bs-theme="dark"] .bit-empty-state h5,
[data-bs-theme="dark"] .bit-empty-state h6  { color: #94a3b8; }

/* Tables — Bootstrap uses inline vars, also need direct overrides */
[data-bs-theme="dark"] .bit-table th        { background-color: #1e2130 !important; color: #94a3b8 !important; border-color: #2a2d3a !important; }
[data-bs-theme="dark"] .bit-table td        { border-color: #2a2d3a !important; color: #e2e8f0; }
[data-bs-theme="dark"] .table               { color: #e2e8f0; --bs-table-bg: #1a1d27; --bs-table-border-color: #2a2d3a; }
[data-bs-theme="dark"] .table th            { background-color: #1e2130 !important; color: #94a3b8; border-color: #2a2d3a; }
[data-bs-theme="dark"] .table td            { border-color: #2a2d3a; }
[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * { background-color: #252830; color: #e2e8f0; }

/* Bootstrap .card (not .bit-card) */
[data-bs-theme="dark"] .card               { background-color: #1a1d27 !important; border-color: #2a2d3a !important; }
[data-bs-theme="dark"] .card-header        { background-color: #1e2130 !important; border-bottom-color: #2a2d3a !important; color: #e2e8f0; }
[data-bs-theme="dark"] .card-body          { background-color: #1a1d27; color: #e2e8f0; }
[data-bs-theme="dark"] .card-footer        { background-color: #1e2130; border-top-color: #2a2d3a; }

/* Forms */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select        { background-color: #252830 !important; border-color: #2a2d3a !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus  { background-color: #1e2130 !important; border-color: var(--bit-primary) !important; color: #e2e8f0 !important; box-shadow: 0 0 0 3px rgba(59,91,219,.25); }
[data-bs-theme="dark"] .form-control::placeholder { color: #64748b; opacity: 1; }
[data-bs-theme="dark"] .form-check-input  { background-color: #252830; border-color: #4a5568; }
[data-bs-theme="dark"] .form-check-input:checked { background-color: var(--bit-primary); border-color: var(--bit-primary); }
[data-bs-theme="dark"] .form-text         { color: #64748b; }
[data-bs-theme="dark"] .input-group-text  { background-color: #1e2130 !important; border-color: #2a2d3a !important; color: #94a3b8; }

/* Nav tabs */
[data-bs-theme="dark"] .nav-tabs           { border-bottom-color: #2a2d3a; }
[data-bs-theme="dark"] .nav-tabs .nav-link { color: #94a3b8; border-color: transparent; }
[data-bs-theme="dark"] .nav-tabs .nav-link:hover { color: #e2e8f0; border-color: #2a2d3a #2a2d3a transparent; background: rgba(255,255,255,.04); }
[data-bs-theme="dark"] .nav-tabs .nav-link.active { background-color: #1a1d27 !important; border-color: #2a2d3a #2a2d3a #1a1d27 !important; color: #e2e8f0 !important; }

/* Dropdowns */
[data-bs-theme="dark"] .dropdown-menu      { background-color: #1e2130 !important; border-color: #2a2d3a !important; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
[data-bs-theme="dark"] .dropdown-item      { color: #e2e8f0; }
[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus { background-color: #252830 !important; color: #fff; }
[data-bs-theme="dark"] .dropdown-item.active,
[data-bs-theme="dark"] .dropdown-item:active { background-color: var(--bit-primary) !important; color: #fff; }
[data-bs-theme="dark"] .dropdown-divider   { border-color: #2a2d3a; opacity: 1; }
[data-bs-theme="dark"] .dropdown-header    { color: #64748b; }

/* Modals */
[data-bs-theme="dark"] .modal-content      { background-color: #1a1d27 !important; border-color: #2a2d3a; }
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer       { border-color: #2a2d3a !important; }
[data-bs-theme="dark"] .modal-title        { color: #e2e8f0; }

/* List groups */
[data-bs-theme="dark"] .list-group-item                { background-color: #1a1d27 !important; border-color: #2a2d3a !important; color: #e2e8f0; }
[data-bs-theme="dark"] .list-group-item-action:hover   { background-color: #252830 !important; color: #fff; }
[data-bs-theme="dark"] .list-group-flush .list-group-item { border-color: #2a2d3a; }

/* Alerts */
[data-bs-theme="dark"] .alert-info         { background: rgba(13,202,240,.12)  !important; border-color: rgba(13,202,240,.25)  !important; color: #7dd3fc; }
[data-bs-theme="dark"] .alert-warning      { background: rgba(247,103,7,.12)   !important; border-color: rgba(247,103,7,.25)   !important; color: #fdba74; }
[data-bs-theme="dark"] .alert-success      { background: rgba(47,158,68,.12)   !important; border-color: rgba(47,158,68,.25)   !important; color: #86efac; }
[data-bs-theme="dark"] .alert-danger       { background: rgba(220,53,69,.12)   !important; border-color: rgba(220,53,69,.25)   !important; color: #fca5a5; }
[data-bs-theme="dark"] .alert-secondary    { background: #1e2130 !important; border-color: #2a2d3a !important; color: #94a3b8; }

/* Buttons */
[data-bs-theme="dark"] .btn-outline-secondary { border-color: #4a5568;  color: #94a3b8; }
[data-bs-theme="dark"] .btn-outline-secondary:hover { background-color: #252830; border-color: #94a3b8; color: #e2e8f0; }
[data-bs-theme="dark"] .btn-outline-primary { border-color: var(--bit-primary); color: #7c9ef5; }
[data-bs-theme="dark"] .btn-outline-primary:hover { background-color: var(--bit-primary); color: #fff; }
[data-bs-theme="dark"] .btn-outline-danger  { border-color: #ef4444; color: #fca5a5; }
[data-bs-theme="dark"] .btn-outline-danger:hover  { background-color: #ef4444; color: #fff; }
[data-bs-theme="dark"] .btn-outline-warning { border-color: #f59e0b; color: #fbbf24; }
[data-bs-theme="dark"] .btn-outline-warning:hover { background-color: #f59e0b; color: #000; }
[data-bs-theme="dark"] .btn-outline-info    { border-color: #0dcaf0; color: #7dd3fc; }
[data-bs-theme="dark"] .btn-outline-info:hover { background-color: #0dcaf0; color: #000; }
[data-bs-theme="dark"] .btn-light           { background-color: #1e2130; border-color: #2a2d3a; color: #e2e8f0; }
[data-bs-theme="dark"] .btn-light:hover     { background-color: #252830; }
[data-bs-theme="dark"] .btn-close           { filter: invert(1) grayscale(100%) brightness(200%); }

/* Topbar */
[data-bs-theme="dark"] .bit-topbar .topbar-search .form-control { background-color: #252830 !important; border-color: #2a2d3a !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .bit-topbar .topbar-icon-btn             { color: #94a3b8; }
[data-bs-theme="dark"] .bit-topbar .topbar-icon-btn:hover       { background: #252830; color: #e2e8f0; }
[data-bs-theme="dark"] .bit-topbar .notif-badge                 { border-color: #1a1d27; }

/* Badges */
[data-bs-theme="dark"] .badge.bg-secondary-subtle { background-color: #1e2130 !important; color: #94a3b8 !important; }
[data-bs-theme="dark"] .badge.bg-light            { background-color: #252830 !important; color: #e2e8f0  !important; }

/* Utilities */
[data-bs-theme="dark"] .text-muted         { color: #94a3b8 !important; }
[data-bs-theme="dark"] .text-dark          { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .bg-light           { background-color: #1e2130 !important; }
[data-bs-theme="dark"] .bg-white           { background-color: #1a1d27 !important; }
[data-bs-theme="dark"] hr                  { border-color: #2a2d3a; opacity: 1; }
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-top         { border-color: #2a2d3a !important; }

/* Custom pagination */
[data-bs-theme="dark"] .pagination li a,
[data-bs-theme="dark"] .pagination li span   { background: #1a1d27;  border-color: #2a2d3a; color: #e2e8f0; }
[data-bs-theme="dark"] .pagination li a:hover { background: #252830; border-color: var(--bit-primary); color: #e2e8f0; }
[data-bs-theme="dark"] .pagination li.active a { background: var(--bit-primary); border-color: var(--bit-primary); color: #fff; }
[data-bs-theme="dark"] .pagination li.disabled a,
[data-bs-theme="dark"] .pagination li.disabled span { background: #151820; border-color: #2a2d3a; color: #4a5568; }
[data-bs-theme="dark"] .portal-pagination-link       { background: #1a1d27;  border-color: #2a2d3a; color: #e2e8f0; }
[data-bs-theme="dark"] .portal-pagination-link:hover { background: #252830;  border-color: var(--bit-primary); color: #e2e8f0; }
[data-bs-theme="dark"] .portal-pagination-wrap       { border-top-color: #2a2d3a; }
[data-bs-theme="dark"] .portal-pagination-info       { color: #94a3b8; }

/* Audit log */
[data-bs-theme="dark"] .audit-change-list  { border-left-color: #2a2d3a; }
[data-bs-theme="dark"] .audit-field-label  { color: #94a3b8; }
[data-bs-theme="dark"] .audit-old          { color: #64748b; }
