/* ============================================================
   관리자 페이지 다크모드 CSS
   Bootstrap 5.3.0-alpha1 (내장 다크모드 미지원) 수동 오버라이드
   - 기능/로직 변경 없음, UI 색상만 변경
   ============================================================

   색상 체계:
   - 배경 (가장 어두움): #0f1623
   - 표면 (카드/컨텐츠): #1a2035
   - 표면 (높음/헤더):   #1e2a3a / #253048
   - 보더:               rgba(255,255,255,0.1)
   - 텍스트 기본:        #d4daf0
   - 텍스트 보조:        #8898aa
   ============================================================ */

/* ── 다크모드 전환 버튼 ── */
.dark-mode-btn {
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  opacity: 0.75;
  transition: opacity 0.15s;
  color: rgba(255, 255, 255, 0.85) !important;
  text-decoration: none !important;
}
.dark-mode-btn:hover {
  opacity: 1;
}

/* ============================================================
   다크모드 전체 기반
   ============================================================ */

[data-bs-theme="dark"] body {
  background-color: #0f1623 !important;
  color: #d4daf0 !important;
}

/* ── 레이아웃 영역 ── */
[data-bs-theme="dark"] #layoutSidenav #layoutSidenav_content {
  background-color: #0f1623 !important;
}
[data-bs-theme="dark"] main.container-fluid,
[data-bs-theme="dark"] main {
  background-color: #0f1623 !important;
}

/* ── 카드 ── */
[data-bs-theme="dark"] .card {
  background-color: #1a2035;
  border-color: rgba(255, 255, 255, 0.1);
  color: #d4daf0;
}
[data-bs-theme="dark"] .card-body {
  background-color: #1a2035;
  color: #d4daf0;
}
[data-bs-theme="dark"] .card-footer {
  background-color: rgba(255, 255, 255, 0);
  border-top-color: rgba(255, 255, 255, 0.1);
}
[data-bs-theme="dark"] .card-header {
  background-color: #1e2a3a;
  color: rgba(255, 255, 255, 0.88);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
[data-bs-theme="dark"] #userDetail .card-header {
  background-color: rgba(255, 255, 255, 0.06);
  color: #d4daf0;
}
[data-bs-theme="dark"] #setMacroModal .modal-dialog .modal-body .card .card-header {
  background: rgba(255, 255, 255, 0.06);
  color: #d4daf0;
}
[data-bs-theme="dark"] .card.platinum .card-header { background-color: #8b1e2a; }
[data-bs-theme="dark"] .card.gold    .card-header { background-color: #7a5500; }
[data-bs-theme="dark"] .card.silver  .card-header { background-color: #0d4f30; }
[data-bs-theme="dark"] .card.bronze  .card-header { background-color: #003d73; }
[data-bs-theme="dark"] .card.user    .card-header { background-color: #5a2275; }

/* ── 모달 ── */
[data-bs-theme="dark"] .modal-content {
  background-color: #1a2035;
  border-color: rgba(255, 255, 255, 0.15);
  color: #d4daf0;
}
[data-bs-theme="dark"] .modal-header {
  background-color: #1e2a3a;
  border-bottom-color: rgba(255, 255, 255, 0.1);
  color: #d4daf0;
}
[data-bs-theme="dark"] .modal-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
}
[data-bs-theme="dark"] .modal-title {
  color: #e2e8f0;
}
[data-bs-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

/* ── 테이블 ── */
[data-bs-theme="dark"] .table {
  color: #d4daf0;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-bs-theme="dark"] .table > :not(caption) > * > * {
  background-color: transparent;
  color: #d4daf0;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
[data-bs-theme="dark"] .table thead > tr > th,
[data-bs-theme="dark"] .table > thead {
  background-color: #1e2a3a;
  color: #b0c4de;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, 0.03);
  color: #d4daf0;
}
[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
  background-color: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}
[data-bs-theme="dark"] .table-bordered,
[data-bs-theme="dark"] .table-bordered > :not(caption) > * > * {
  border-color: rgba(255, 255, 255, 0.1);
}
[data-bs-theme="dark"] tfoot th {
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #b0c4de;
}

/* DataTables */
[data-bs-theme="dark"] table.dataTable thead th,
[data-bs-theme="dark"] table.dataTable thead td {
  background-color: #1e2a3a;
  color: #b0c4de;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}
[data-bs-theme="dark"] table.dataTable tbody tr {
  background-color: transparent;
}
[data-bs-theme="dark"] table.dataTable tbody tr.odd {
  background-color: rgba(255, 255, 255, 0.02);
}
[data-bs-theme="dark"] table.dataTable tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.06);
}
[data-bs-theme="dark"] table.dataTable tbody td {
  color: #d4daf0;
  border-top-color: rgba(255, 255, 255, 0.06);
}
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length label,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter label,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate {
  color: #94a3b8;
}
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input {
  background-color: #253048;
  border-color: rgba(255, 255, 255, 0.15);
  color: #d4daf0;
}
[data-bs-theme="dark"] table.dataTable.dtr-column > tbody > tr > td.dtr-control:before {
  border-color: rgba(255, 255, 255, 0.4);
  color: #d4daf0;
}
[data-bs-theme="dark"] td.child {
  background-color: #141e30 !important;
}

/* ── 폼 컨트롤 ── */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] textarea.form-control {
  background-color: #253048;
  border-color: rgba(255, 255, 255, 0.2);
  color: #d4daf0;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #253048;
  border-color: #5a7fcc;
  color: #e2e8f0;
  box-shadow: 0 0 0 0.25rem rgba(90, 127, 204, 0.25);
}
/* form-floating 이 아닌 일반 입력칸만 placeholder 색상 적용
   form-floating 내부는 Bootstrap 기본(transparent)을 유지해야
   레이블과 placeholder 가 겹치지 않음 */
[data-bs-theme="dark"] :not(.form-floating) > .form-control::placeholder {
  color: #6a7a9b;
}
[data-bs-theme="dark"] .form-floating > .form-control::placeholder {
  color: transparent !important;
}
[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-select:disabled {
  background-color: #1a2035;
  color: #6a7a9b;
  border-color: rgba(255, 255, 255, 0.12);
}
[data-bs-theme="dark"] .form-label {
  color: #94a3b8;
}
[data-bs-theme="dark"] .input-group-text {
  background-color: #253048;
  border-color: rgba(255, 255, 255, 0.2);
  color: #94a3b8;
}
[data-bs-theme="dark"] .form-check-label {
  color: #94a3b8;
}
[data-bs-theme="dark"] .form-floating > label {
  color: #8fa3c4;
}

/* ── 버튼 ── */
[data-bs-theme="dark"] .btn-light {
  background-color: #253048;
  border-color: rgba(255, 255, 255, 0.2);
  color: #d4daf0;
}
[data-bs-theme="dark"] .btn-light:hover {
  background-color: #2e3d5e;
  border-color: rgba(255, 255, 255, 0.3);
  color: #e2e8f0;
}
[data-bs-theme="dark"] .btn-outline-secondary {
  color: #94a3b8;
  border-color: #4a5568;
}
[data-bs-theme="dark"] .btn-outline-secondary:hover {
  background-color: #253048;
  color: #d4daf0;
}
[data-bs-theme="dark"] .btn-outline-dark {
  color: #94a3b8;
  border-color: #4a5568;
}
[data-bs-theme="dark"] .btn-outline-dark:hover {
  background-color: #253048;
  color: #d4daf0;
  border-color: #6a7a9b;
}

/* ── 드롭다운 ── */
[data-bs-theme="dark"] .dropdown-menu {
  background-color: #1a2035;
  border-color: rgba(255, 255, 255, 0.15);
}
[data-bs-theme="dark"] .dropdown-item {
  color: #d4daf0;
}
[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
  background-color: #253048;
  color: #e2e8f0;
}
[data-bs-theme="dark"] .dropdown-divider {
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* ── 리스트 그룹 ── */
[data-bs-theme="dark"] .list-group-item {
  background-color: #1a2035;
  border-color: rgba(255, 255, 255, 0.1);
  color: #d4daf0;
}
[data-bs-theme="dark"] .list-group-item.active {
  background-color: #0d6efd;
  border-color: #0d6efd;
}
[data-bs-theme="dark"] .list-group-item-action:hover {
  background-color: #253048;
  color: #e2e8f0;
}

/* ── Admin Dashboard Header (Navbar) ── */
[data-bs-theme="dark"] .admin-dashboard-header .list-group-item {
  border-color: rgba(255, 255, 255, 0.1);
}
[data-bs-theme="dark"] .admin-dashboard-header .list-group-item.title {
  background-color: #253048;
  color: #b0c4de;
}
[data-bs-theme="dark"] .admin-dashboard-header .list-group-item.contents {
  background-color: #1a2535;
  color: #7ab3f0;
}
[data-bs-theme="dark"] .admin-dashboard-header .list-group-item.button:hover {
  background-color: #2d3f60;
}
[data-bs-theme="dark"] .admin-dashboard-header .list-group-item.contents.low-balance {
  background-color: #3a1c22;
  color: #f88080;
}
[data-bs-theme="dark"] .admin-dashboard-header .list-group-item.contents.negative {
  color: #f87171;
}
[data-bs-theme="dark"] #alramToggleWrap:hover {
  background-color: #2d3f60;
}
[data-bs-theme="dark"] .admin-dashboard-header .list-group-item.has-noti {
  border-color: #f87171 !important;
}
/* 일반 list-group-item 타이틀 */
[data-bs-theme="dark"] .list-group-item.title {
  background-color: #253048;
  color: #b0c4de;
}

/* ── 내비게이션 탭/필 ── */
[data-bs-theme="dark"] .nav-tabs {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
[data-bs-theme="dark"] .nav-tabs .nav-link {
  color: #8898aa;
  border-color: transparent;
}
[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
  color: #d4daf0;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-bs-theme="dark"] .nav-tabs .nav-link.active,
[data-bs-theme="dark"] .nav-tabs .nav-item.show .nav-link {
  background-color: #1a2035;
  border-color: rgba(255, 255, 255, 0.1) rgba(255, 255, 255, 0.1) #1a2035;
  color: #e2e8f0;
}
[data-bs-theme="dark"] .nav-pills .nav-link {
  color: #94a3b8;
}
[data-bs-theme="dark"] .nav-pills .nav-link.active {
  background-color: #0d6efd;
  color: #fff;
}

/* ── 페이지네이션 ── */
[data-bs-theme="dark"] .page-link {
  background-color: #1a2035;
  border-color: rgba(255, 255, 255, 0.12);
  color: #7ab3f0;
}
[data-bs-theme="dark"] .page-link:hover {
  background-color: #253048;
  color: #a8d0ff;
}
[data-bs-theme="dark"] .page-item.active .page-link {
  background-color: #0d6efd;
  border-color: #0d6efd;
}
[data-bs-theme="dark"] .page-item.disabled .page-link {
  background-color: #141e30;
  border-color: rgba(255, 255, 255, 0.08);
  color: #4a5568;
}

/* ── 아코디언 ── */
[data-bs-theme="dark"] .accordion-item {
  background-color: #1a2035;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-bs-theme="dark"] .accordion-button {
  background-color: #1e2a3a;
  color: #d4daf0;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
  background-color: #253048;
  color: #a8d0ff;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}
[data-bs-theme="dark"] .accordion-button::after {
  filter: invert(1);
}
[data-bs-theme="dark"] .accordion-body {
  background-color: #1a2035;
  color: #d4daf0;
}

/* ── 알림/배지 ── */
[data-bs-theme="dark"] .alert-light {
  background-color: #253048;
  border-color: rgba(255, 255, 255, 0.15);
  color: #d4daf0;
}
[data-bs-theme="dark"] .alert-secondary {
  background-color: #1e2a3a;
  border-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

/* ── 뱃지 ── */
[data-bs-theme="dark"] .badge.bg-light {
  background-color: #253048 !important;
  color: #d4daf0 !important;
}
[data-bs-theme="dark"] .badge.bg-secondary {
  background-color: #3a4a66 !important;
}
/*
 * bg-warning 뱃지: 노란 배경엔 어두운 글자가 필수
 * (.text-dark 전역 오버라이드가 흰색으로 바꿔서 저대비 문제 발생 → 되돌림)
 */
[data-bs-theme="dark"] .badge.bg-warning,
[data-bs-theme="dark"] .badge.bg-warning.text-dark {
  background-color: #d97706 !important; /* 약간 어두운 앰버로 조정 */
  color: #000 !important;
}
/* 공배팅 순번 텍스트 (.text-muted 이 너무 흐림) */
[data-bs-theme="dark"] td .text-muted,
[data-bs-theme="dark"] th .text-muted {
  color: #94a3b8 !important;
}

/* ── 팝오버 ── */
[data-bs-theme="dark"] .popover {
  background-color: #1a2035;
  border-color: rgba(255, 255, 255, 0.15);
}
[data-bs-theme="dark"] .popover-header {
  background-color: #1e2a3a;
  border-bottom-color: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}
[data-bs-theme="dark"] .popover-body {
  color: #d4daf0;
}
[data-bs-theme="dark"] .bs-popover-auto[data-popper-placement^=bottom] > .popover-arrow::after,
[data-bs-theme="dark"] .bs-popover-bottom > .popover-arrow::after {
  border-bottom-color: #1e2a3a;
}

/* ── 텍스트 색상 유틸리티 ── */
[data-bs-theme="dark"] .text-dark {
  color: #d4daf0 !important;
}
[data-bs-theme="dark"] .text-black {
  color: #d4daf0 !important;
}
[data-bs-theme="dark"] .text-muted {
  color: #8898aa !important;
}
[data-bs-theme="dark"] .text-secondary {
  color: #8898aa !important;
}
[data-bs-theme="dark"] .text-body {
  color: #d4daf0 !important;
}

/* ── 배경 유틸리티 ── */
[data-bs-theme="dark"] .bg-white {
  background-color: #1a2035 !important;
}
[data-bs-theme="dark"] .bg-light {
  background-color: #1e2a3a !important;
  color: #d4daf0;
}
[data-bs-theme="dark"] .bg-gray        { background-color: #253048 !important; }
[data-bs-theme="dark"] .bg-mistyred    { background-color: #2a1a1e !important; }
[data-bs-theme="dark"] .bg-mistyblue   { background-color: #1a2535 !important; }
[data-bs-theme="dark"] .bg-mistygreen  { background-color: #1a2820 !important; }
[data-bs-theme="dark"] .bg-mistyyellow { background-color: #26220f !important; }

/* ── 보더 ── */
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end {
  border-color: rgba(255, 255, 255, 0.12) !important;
}
[data-bs-theme="dark"] .border-dark-subtle {
  border-color: rgba(255, 255, 255, 0.2) !important;
}
[data-bs-theme="dark"] hr {
  border-top-color: rgba(255, 255, 255, 0.1);
  opacity: 0.5;
}

/* ── 헤딩/본문 색상 ── */
[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,
[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: #e2e8f0;
}
[data-bs-theme="dark"] p,
[data-bs-theme="dark"] span:not([class*="badge"]):not([class*="btn"]) {
  color: inherit;
}
[data-bs-theme="dark"] label {
  color: #94a3b8;
}
[data-bs-theme="dark"] small,
[data-bs-theme="dark"] .small {
  color: #8898aa;
}
[data-bs-theme="dark"] strong,
[data-bs-theme="dark"] b {
  color: #e2e8f0;
}

/* ── 링크 ── */
[data-bs-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.list-group-item-action) {
  color: #7ab3f0;
}
[data-bs-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.list-group-item-action):hover {
  color: #a8d0ff;
}

/* ── 사이드바 (이미 dark - 보조 조정) ── */
[data-bs-theme="dark"] .sb-sidenav-dark .sb-sidenav-menu .nav-link {
  color: rgba(255, 255, 255, 0.6);
}
[data-bs-theme="dark"] .sb-sidenav-dark .sb-sidenav-menu .nav-link:hover {
  color: #fff;
}
[data-bs-theme="dark"] .sb-sidenav-dark .sb-sidenav-menu .nav-link.active {
  color: #fff;
}

/* ── SB Admin 레이아웃 보조 ── */
[data-bs-theme="dark"] .sb-topnav {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── asset 커스텀 버튼 (다크 배경에 맞는 선명한 색상) ── */
[data-bs-theme="dark"] .asset-danger {
  color: #fca5a5;
  background-color: rgba(220, 53, 69, 0.22) !important;
  border-color: rgba(220, 53, 69, 0.55);
}
[data-bs-theme="dark"] .asset-danger:hover {
  color: #fecaca;
  background-color: rgba(220, 53, 69, 0.35) !important;
  border-color: #dc3545;
}
[data-bs-theme="dark"] .asset-warning {
  color: #fcd34d;
  background-color: rgba(255, 193, 7, 0.18) !important;
  border-color: rgba(255, 193, 7, 0.45);
}
[data-bs-theme="dark"] .asset-warning:hover {
  color: #fde68a;
  background-color: rgba(255, 193, 7, 0.3) !important;
  border-color: #ffc107;
}
[data-bs-theme="dark"] .asset-success {
  color: #6ee7b7;
  background-color: rgba(25, 135, 84, 0.22) !important;
  border-color: rgba(25, 135, 84, 0.55);
}
[data-bs-theme="dark"] .asset-success:hover {
  color: #a7f3d0;
  background-color: rgba(25, 135, 84, 0.35) !important;
  border-color: #198754;
}
[data-bs-theme="dark"] .asset-primary {
  color: #93c5fd;
  background-color: rgba(13, 110, 253, 0.22) !important;
  border-color: rgba(13, 110, 253, 0.55);
}
[data-bs-theme="dark"] .asset-primary:hover {
  color: #bfdbfe;
  background-color: rgba(13, 110, 253, 0.35) !important;
  border-color: #0d6efd;
}
[data-bs-theme="dark"] .asset-dark {
  color: #94a3b8;
  background-color: rgba(108, 117, 125, 0.2) !important;
  border-color: rgba(108, 117, 125, 0.45);
}
[data-bs-theme="dark"] .asset-dark:hover {
  color: #cbd5e1;
  border-color: #6c757d;
}
[data-bs-theme="dark"] .asset-secondary {
  color: #94a3b8;
  background-color: rgba(108, 117, 125, 0.15) !important;
  border-color: rgba(108, 117, 125, 0.35);
}
[data-bs-theme="dark"] .asset-secondary:hover {
  border-color: #6c757d;
}

/* ── btn-outline-dark (테이블 내 아이디 버튼 등) ── */
[data-bs-theme="dark"] .btn-outline-dark.id-btn,
[data-bs-theme="dark"] .btn-outline-dark.balance-btn {
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.2);
}
[data-bs-theme="dark"] .btn-outline-dark.id-btn:hover,
[data-bs-theme="dark"] .btn-outline-dark.balance-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

/* ── 에이전트 추가 버튼 (add-gold, add-silver, add-bronze) ── */
[data-bs-theme="dark"] .add-gold {
  color: #fcd34d;
  background-color: rgba(255, 193, 7, 0.18) !important;
  border-color: rgba(255, 193, 7, 0.45) !important;
}
[data-bs-theme="dark"] .add-silver {
  color: #6ee7b7;
  background-color: rgba(25, 135, 84, 0.22) !important;
  border-color: rgba(25, 135, 84, 0.5) !important;
}
[data-bs-theme="dark"] .add-bronze {
  color: #93c5fd;
  background-color: rgba(13, 110, 253, 0.22) !important;
  border-color: rgba(13, 110, 253, 0.5) !important;
}

/* ── 에이전트/회원 행 배경 (tier 구분) ── */
/* 라이트 모드의 rgba(…,0.3) 저투명도를 선명한 솔리드 다크 컬러로 교체 */

/* 본사 (type 0) — 딥 크림슨 */
[data-bs-theme="dark"] tr.platinum-bg,
[data-bs-theme="dark"] tr.platinum-bg > td,
[data-bs-theme="dark"] tr.platinum-bg > th,
[data-bs-theme="dark"] .platinum-bg {
  background-color: #2e1018 !important;
}
[data-bs-theme="dark"] tr.platinum-bg:hover > td,
[data-bs-theme="dark"] tr.platinum-bg:hover > th {
  background-color: #3d1522 !important;
}

/* 총판 (type 1) — 딥 앰버 */
[data-bs-theme="dark"] tr.gold-bg,
[data-bs-theme="dark"] tr.gold-bg > td,
[data-bs-theme="dark"] tr.gold-bg > th,
[data-bs-theme="dark"] .gold-bg {
  background-color: #261a02 !important;
}
[data-bs-theme="dark"] tr.gold-bg:hover > td,
[data-bs-theme="dark"] tr.gold-bg:hover > th {
  background-color: #332204 !important;
}

/* 매장 (type 2) — 딥 에메랄드 */
[data-bs-theme="dark"] tr.silver-bg,
[data-bs-theme="dark"] tr.silver-bg > td,
[data-bs-theme="dark"] tr.silver-bg > th,
[data-bs-theme="dark"] .silver-bg {
  background-color: #0b2016 !important;
}
[data-bs-theme="dark"] tr.silver-bg:hover > td,
[data-bs-theme="dark"] tr.silver-bg:hover > th {
  background-color: #102c1e !important;
}

/* 에이전트/유저사이트 (type 3, 5) — 딥 네이비 */
[data-bs-theme="dark"] tr.bronze-bg,
[data-bs-theme="dark"] tr.bronze-bg > td,
[data-bs-theme="dark"] tr.bronze-bg > th,
[data-bs-theme="dark"] .bronze-bg {
  background-color: #0c1e3a !important;
}
[data-bs-theme="dark"] tr.bronze-bg:hover > td,
[data-bs-theme="dark"] tr.bronze-bg:hover > th {
  background-color: #102848 !important;
}

/* 차단 계정 — 딥 블러드 레드 */
[data-bs-theme="dark"] tr.block-bg,
[data-bs-theme="dark"] tr.block-bg > td,
[data-bs-theme="dark"] tr.block-bg > th,
[data-bs-theme="dark"] .block-bg {
  background-color: #2a0808 !important;
}
[data-bs-theme="dark"] tr.block-bg:hover > td,
[data-bs-theme="dark"] tr.block-bg:hover > th {
  background-color: #380a0a !important;
}

/* 중복 IP 경고 행 */
[data-bs-theme="dark"] tr.duplicate-ip > td,
[data-bs-theme="dark"] tr.duplicate-ip > th,
[data-bs-theme="dark"] .duplicate-ip {
  background-color: rgba(220, 53, 69, 0.28) !important;
}

/* DataTables 홀/짝 스트라이핑 — 티어 행은 색상 유지 */
[data-bs-theme="dark"] table.dataTable tbody tr.odd.platinum-bg > td { background-color: #2e1018 !important; }
[data-bs-theme="dark"] table.dataTable tbody tr.odd.gold-bg    > td { background-color: #261a02 !important; }
[data-bs-theme="dark"] table.dataTable tbody tr.odd.silver-bg  > td { background-color: #0b2016 !important; }
[data-bs-theme="dark"] table.dataTable tbody tr.odd.bronze-bg  > td { background-color: #0c1e3a !important; }
[data-bs-theme="dark"] table.dataTable tbody tr.odd.block-bg   > td { background-color: #2a0808 !important; }

/* 온라인/매장 태그 (다크 모드 가시성 강화) */
[data-bs-theme="dark"] .online-tag {
  color: #60a5fa !important;
  background-color: rgba(13, 110, 253, 0.22) !important;
  border-color: rgba(13, 110, 253, 0.55) !important;
}
[data-bs-theme="dark"] .local-tag {
  color: #fca5a5 !important;
  background-color: rgba(220, 53, 69, 0.22) !important;
  border-color: rgba(220, 53, 69, 0.55) !important;
}

/* ── 사용자 정의 테이블 헤더 ── */
[data-bs-theme="dark"] #attEventTable table th {
  background-color: #1e2a3a;
}
[data-bs-theme="dark"] #virtualSetTable th,
[data-bs-theme="dark"] #virtualSetTable td.type {
  background-color: #1e2a3a;
}

/* ── 레벨 계정 설정 ── */
[data-bs-theme="dark"] #levelAccountSetting .col input.title,
[data-bs-theme="dark"] #levelAccountSetting .col-2 input.title,
[data-bs-theme="dark"] #levelAccountSetting .col-3 input.title {
  background-color: #1e2a3a;
  color: #d4daf0;
}

/* ── 차트 영역 ── */
[data-bs-theme="dark"] #collapseChart {
  background-color: #0f1623 !important;
}

/* ── todayInfo 카드 그라디언트 ── */
[data-bs-theme="dark"] .todayInfo .card {
  color: #e2e8f0;
}
[data-bs-theme="dark"] .todayInfo .summary-bg {
  background-image: radial-gradient(circle farthest-corner at 10% 20%, rgba(20, 60, 38, 0.9) 0%, rgba(35, 52, 22, 0.9) 90%);
}
[data-bs-theme="dark"] .todayInfo .basic-bg {
  background-image: linear-gradient(174.2deg, rgba(50, 40, 28, 0.9) 7.1%, rgba(35, 45, 35, 0.9) 67.4%);
}
[data-bs-theme="dark"] .todayInfo .minus-bg {
  background: linear-gradient(to right, rgba(100, 28, 55, 0.9), rgba(110, 48, 28, 0.9));
}
[data-bs-theme="dark"] .todayInfo .plus-bg {
  background: linear-gradient(to right, rgba(38, 52, 100, 0.9), rgba(22, 82, 72, 0.9));
}
[data-bs-theme="dark"] .todayInfo .card .total-text,
[data-bs-theme="dark"] .todayInfo .card #totalSummary {
  color: #e2e8f0;
}

/* ── 입출금 상태 필터 활성 버튼 ── */
[data-bs-theme="dark"] #depositStatusFilter .btn.active,
[data-bs-theme="dark"] #withdrawStatusFilter .btn.active {
  background-color: #253048;
  border-color: #4a5568;
  color: #e2e8f0;
  box-shadow: 0 0 0 0.15rem rgba(100, 120, 160, 0.3);
}

/* ── 보더 라인 조정 ── */
[data-bs-theme="dark"] .left-border {
  border-left-color: rgba(255, 255, 255, 0.2) !important;
}
[data-bs-theme="dark"] table tfoot:nth-child(1) th {
  border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}
[data-bs-theme="dark"] .income-betwin-downline-roll__total {
  border-top-color: rgba(255, 255, 255, 0.15);
}
[data-bs-theme="dark"] #userInfoAll td.child .dtr-details > li {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* ── 롤링 하부 발생 총합 ── */
[data-bs-theme="dark"] .income-betwin-downline-roll__total,
[data-bs-theme="dark"] .income-betwin-downline-roll__total .income-betwin-downline-roll__amt,
[data-bs-theme="dark"] .income-betwin-downline-roll__total-label {
  color: #f87171;
}
[data-bs-theme="dark"] .income-betwin-downline-roll__title {
  color: #7ab3f0;
}

/* ── Select2 다크 ── */
[data-bs-theme="dark"] .select2-container--default .select2-selection--single,
[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple {
  background-color: #253048;
  border-color: rgba(255, 255, 255, 0.2);
  color: #d4daf0;
}
[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #d4daf0;
}
[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-top-color: #8898aa;
}
[data-bs-theme="dark"] .select2-dropdown {
  background-color: #1e2535;
  border-color: rgba(255, 255, 255, 0.15);
  color: #d4daf0;
}
[data-bs-theme="dark"] .select2-search--dropdown .select2-search__field {
  background-color: #141e30;
  border-color: rgba(255, 255, 255, 0.2);
  color: #d4daf0;
}
[data-bs-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #0d6efd;
  color: #fff;
}
[data-bs-theme="dark"] .select2-container--default .select2-results__option[aria-selected=true] {
  background-color: #253048;
}
[data-bs-theme="dark"] .select2-results__option {
  color: #d4daf0;
}

/* ── DateRangePicker 다크 ── */
[data-bs-theme="dark"] .daterangepicker {
  background-color: #1e2535;
  border-color: rgba(255, 255, 255, 0.15);
  color: #d4daf0;
}
[data-bs-theme="dark"] .daterangepicker:before { border-bottom-color: rgba(255, 255, 255, 0.15); }
[data-bs-theme="dark"] .daterangepicker:after  { border-bottom-color: #1e2535; }
[data-bs-theme="dark"] .daterangepicker .calendar-table {
  background-color: #1e2535;
  border-color: rgba(255, 255, 255, 0.1);
}
[data-bs-theme="dark"] .daterangepicker .calendar-table th,
[data-bs-theme="dark"] .daterangepicker .calendar-table td {
  color: #d4daf0;
}
[data-bs-theme="dark"] .daterangepicker td.off,
[data-bs-theme="dark"] .daterangepicker td.off.in-range,
[data-bs-theme="dark"] .daterangepicker td.off.start-date,
[data-bs-theme="dark"] .daterangepicker td.off.end-date {
  background-color: #1e2535;
  color: #4a5578;
}
[data-bs-theme="dark"] .daterangepicker td.available:hover {
  background-color: #253048;
  color: #e2e8f0;
}
[data-bs-theme="dark"] .daterangepicker td.active,
[data-bs-theme="dark"] .daterangepicker td.active:hover {
  background-color: #0d6efd;
  color: #fff;
}
[data-bs-theme="dark"] .daterangepicker td.in-range {
  background-color: #1a3055;
  color: #d4daf0;
}
[data-bs-theme="dark"] .daterangepicker .month,
[data-bs-theme="dark"] .daterangepicker th.month { color: #d4daf0; }
[data-bs-theme="dark"] .daterangepicker select.monthselect,
[data-bs-theme="dark"] .daterangepicker select.yearselect {
  background-color: #1e2535;
  color: #d4daf0;
  border-color: rgba(255, 255, 255, 0.15);
}
[data-bs-theme="dark"] .daterangepicker .ranges ul { background-color: #1e2535; }
[data-bs-theme="dark"] .daterangepicker .ranges li { color: #d4daf0; }
[data-bs-theme="dark"] .daterangepicker .ranges li:hover { background-color: #253048; color: #e2e8f0; }
[data-bs-theme="dark"] .daterangepicker .ranges li.active { background-color: #0d6efd; color: #fff; }
[data-bs-theme="dark"] .daterangepicker .drp-buttons {
  border-top-color: rgba(255, 255, 255, 0.1);
  background-color: #1e2535;
}
[data-bs-theme="dark"] .daterangepicker .drp-buttons .btn-default {
  background-color: #253048;
  border-color: rgba(255, 255, 255, 0.15);
  color: #d4daf0;
}

/* ── 모달 내 특수 스타일 ── */
[data-bs-theme="dark"] #agentDepositModal .modal-dialog .modal-content .modal-body .form .row .btn.btn-light,
[data-bs-theme="dark"] #agentWithdrawModal .modal-dialog .modal-content .modal-body .form .row .btn.btn-light,
[data-bs-theme="dark"] #giveBalanceModal .modal-dialog .modal-content .modal-body .form .row .btn.btn-light,
[data-bs-theme="dark"] #takeBalanceModal .modal-dialog .modal-content .modal-body .form .row .btn.btn-light,
[data-bs-theme="dark"] #agentExchangeModal .modal-dialog .modal-content .modal-body .form .row .btn.btn-light,
[data-bs-theme="dark"] #agentConfirmModal .modal-dialog .modal-content .modal-body .form .row .btn.btn-light {
  background-color: #2d3648 !important;
  color: #d4daf0;
}

/* ── userDetail 팝업 내 색상 ── */
[data-bs-theme="dark"] #userDetail .nav-item .nav-link {
  color: #94a3b8;
}
[data-bs-theme="dark"] #userDetail .nav-item .nav-link.active {
  color: #d4daf0;
  background-color: rgba(255, 255, 255, 0.06);
}

/* ── member-info-popup ── */
[data-bs-theme="dark"] #memberInfoPopup .nav-link {
  color: #94a3b8;
}
[data-bs-theme="dark"] #memberInfoPopup .nav-link.active {
  color: #d4daf0;
  background-color: rgba(255, 255, 255, 0.06);
}

/* ── 트리 테이블 ── */
[data-bs-theme="dark"] .simple-tree-table tr td {
  color: #d4daf0;
  border-color: rgba(255, 255, 255, 0.08);
}

/* ── 스크롤바 (Webkit) ── */
[data-bs-theme="dark"] ::-webkit-scrollbar {
  display: none;
}

/* ── 로그 테이블 그룹 행 교번 배경 (다크모드) ── */
[data-bs-theme="dark"] tr.row-group-alt,
[data-bs-theme="dark"] tr.row-group-alt > td {
  background-color: #1e2d3d !important;
}

/* ── user-info-online-local 페이지 테이블 헤더 (다크모드) ── */
[data-bs-theme="dark"] #userInfoOnlineLocal thead th,
[data-bs-theme="dark"] #userInfoRealBetting thead th {
  background-color: #1e2d3d !important;
  color: #d4daf0 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

/* ── user-info-online-local 모바일 뷰: responsive details 행 높이 개선 ── */
@media (max-width: 767px) {
  #userInfoOnlineLocal .dtr-details li,
  #userInfoRealBetting .dtr-details li {
    min-height: 40px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    display: flex !important;
    align-items: flex-start !important;
  }
  
  #userInfoOnlineLocal .dtr-details .dtr-title,
  #userInfoRealBetting .dtr-details .dtr-title {
    padding-top: 4px !important;
    min-width: 100px !important;
  }
  
  #userInfoOnlineLocal .dtr-details .dtr-data,
  #userInfoRealBetting .dtr-details .dtr-data {
    line-height: 1.6 !important;
    padding-top: 4px !important;
  }
}
