/* ===================================================================
   JMMS Night Mode — Premium Dark Theme
   Palette: Navy #050b14/#0a1628, Copper #c4956a, Gold #d4a57a
   =================================================================== */

:root {
    --nm-bg-deepest: #050b14;
    --nm-bg-deep: #0a1628;
    --nm-bg-mid: #0d1f3a;
    --nm-bg-card: rgba(16, 28, 48, 0.75);
    --nm-copper: #c4956a;
    --nm-gold: #d4a57a;
    --nm-copper-dark: #8b6f47;
    --nm-text-primary: #f1f5f9;
    --nm-text-secondary: #cbd5e1;
    --nm-text-muted: #94a3b8;
    --nm-text-dim: #64748b;
    --nm-border: rgba(196, 149, 106, 0.12);
    --nm-border-strong: rgba(196, 149, 106, 0.25);
    --nm-glow: rgba(196, 149, 106, 0.15);
    --nm-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BODY & BACKGROUND ===== */
body[data-bs-theme="dark"] {
    background: linear-gradient(135deg, var(--nm-bg-deepest) 0%, var(--nm-bg-deep) 50%, var(--nm-bg-mid) 100%) fixed;
    color: var(--nm-text-secondary);
    min-height: 100vh;
}

body[data-bs-theme="dark"] #layout-wrapper {
    background: transparent;
}

body[data-bs-theme="dark"] .main-content {
    background: transparent;
}


/* ===== TOPBAR ===== */
body[data-bs-theme="dark"] #page-topbar {
    background: rgba(10, 22, 40, 0.85) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--nm-border) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25) !important;
}

/* Copper accent line at bottom of topbar */
body[data-bs-theme="dark"] #page-topbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--nm-copper), transparent);
    opacity: 0.4;
}

body[data-bs-theme="dark"] .header-item {
    color: var(--nm-text-secondary) !important;
    transition: var(--nm-transition);
}

body[data-bs-theme="dark"] .header-item:hover {
    color: var(--nm-gold) !important;
}

/* User avatar copper ring */
body[data-bs-theme="dark"] .header-profile-user {
    background: rgba(196, 149, 106, 0.15) !important;
    color: var(--nm-gold) !important;
    border: 2px solid rgba(196, 149, 106, 0.3);
    transition: var(--nm-transition);
}

body[data-bs-theme="dark"] .header-profile-user:hover {
    border-color: var(--nm-copper);
    box-shadow: 0 0 12px var(--nm-glow);
}

/* User dropdown dark theme */
body[data-bs-theme="dark"] .dropdown-menu {
    background: var(--nm-bg-deep) !important;
    border: 1px solid var(--nm-border) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(12px);
}

body[data-bs-theme="dark"] .dropdown-header {
    color: var(--nm-text-muted) !important;
    border-bottom: 1px solid var(--nm-border);
}

body[data-bs-theme="dark"] .dropdown-item {
    color: var(--nm-text-secondary) !important;
    transition: var(--nm-transition);
}

body[data-bs-theme="dark"] .dropdown-item:hover,
body[data-bs-theme="dark"] .dropdown-item:focus {
    background: rgba(196, 149, 106, 0.08) !important;
    color: var(--nm-gold) !important;
}

body[data-bs-theme="dark"] .dropdown-item.text-danger {
    color: #f87171 !important;
}

body[data-bs-theme="dark"] .dropdown-item.text-danger:hover {
    background: rgba(248, 113, 113, 0.08) !important;
    color: #fca5a5 !important;
}


/* ===== SIDEBAR ===== */
body[data-bs-theme="dark"] .vertical-menu {
    background: linear-gradient(180deg, var(--nm-bg-deepest) 0%, #070e1a 100%) !important;
    border-left: 1px solid var(--nm-border);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3) !important;
}

/* Sidebar brand box */
body[data-bs-theme="dark"] .navbar-brand-box {
    background: var(--nm-bg-deepest) !important;
    border-bottom: 1px solid var(--nm-border) !important;
}

/* Menu title labels */
body[data-bs-theme="dark"] .menu-title {
    color: var(--nm-text-dim) !important;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.1em;
}

/* Menu items */
body[data-bs-theme="dark"] #sidebar-menu ul li a {
    color: var(--nm-text-muted);
    transition: var(--nm-transition);
    border-radius: 8px;
    position: relative;
}

body[data-bs-theme="dark"] #sidebar-menu ul li a i {
    color: var(--nm-text-dim);
    transition: var(--nm-transition);
}

body[data-bs-theme="dark"] #sidebar-menu ul li a:hover {
    color: var(--nm-text-primary);
    background: rgba(196, 149, 106, 0.06);
}

body[data-bs-theme="dark"] #sidebar-menu ul li a:hover i {
    color: var(--nm-gold);
}

/* Active menu item — copper glow */
body[data-bs-theme="dark"] .mm-active {
    color: var(--nm-gold) !important;
}

body[data-bs-theme="dark"] .mm-active>a {
    background: rgba(196, 149, 106, 0.12) !important;
    color: var(--nm-text-primary) !important;
    border-right: 3px solid var(--nm-copper) !important;
    box-shadow: inset -4px 0 12px rgba(196, 149, 106, 0.08);
}

body[data-bs-theme="dark"] .mm-active>a i {
    color: var(--nm-gold) !important;
}

body[data-bs-theme="dark"] .mm-active .active {
    color: var(--nm-gold) !important;
}

body[data-bs-theme="dark"] .mm-active .active i {
    color: var(--nm-gold) !important;
}

/* Sub-menu */
body[data-bs-theme="dark"] #sidebar-menu ul li ul.sub-menu {
    background: transparent;
}

body[data-bs-theme="dark"] #sidebar-menu ul li ul.sub-menu li a {
    color: var(--nm-text-muted) !important;
    font-size: 13.5px;
    transition: var(--nm-transition);
}

body[data-bs-theme="dark"] #sidebar-menu ul li ul.sub-menu li a:hover {
    color: var(--nm-text-primary) !important;
    padding-right: 52px;
}

body[data-bs-theme="dark"] #sidebar-menu ul li ul.sub-menu li.mm-active>a {
    color: var(--nm-gold) !important;
}

/* Sidebar toggle button */
body[data-bs-theme="dark"] .vertical-menu-btn {
    color: var(--nm-text-muted) !important;
}

body[data-bs-theme="dark"] .vertical-menu-btn:hover {
    color: var(--nm-gold) !important;
}


/* ===== CARDS ===== */
body[data-bs-theme="dark"] .card {
    background: var(--nm-bg-card) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--nm-border) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    transition: var(--nm-transition);
}

body[data-bs-theme="dark"] .card:hover {
    border-color: var(--nm-border-strong) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35) !important;
}

body[data-bs-theme="dark"] .card-header {
    background: rgba(196, 149, 106, 0.04) !important;
    border-bottom: 1px solid var(--nm-border) !important;
}

body[data-bs-theme="dark"] .card-title,
body[data-bs-theme="dark"] h1,
body[data-bs-theme="dark"] h2,
body[data-bs-theme="dark"] h3,
body[data-bs-theme="dark"] h4,
body[data-bs-theme="dark"] h5,
body[data-bs-theme="dark"] h6 {
    color: var(--nm-text-primary) !important;
}

body[data-bs-theme="dark"] .card-body {
    background: transparent !important;
}

body[data-bs-theme="dark"] .text-muted {
    color: var(--nm-text-muted) !important;
}

body[data-bs-theme="dark"] .text-primary {
    color: var(--nm-gold) !important;
}


/* ===== FOOTER ===== */
body[data-bs-theme="dark"] .footer {
    background: rgba(10, 22, 40, 0.85) !important;
    backdrop-filter: blur(12px);
    color: var(--nm-text-dim) !important;
    border-top: 1px solid var(--nm-border);
    box-shadow: none !important;
}


/* ===== TABLES ===== */
body[data-bs-theme="dark"] .table {
    color: var(--nm-text-secondary) !important;
}

body[data-bs-theme="dark"] .table thead th {
    background: rgba(196, 149, 106, 0.06) !important;
    color: var(--nm-gold) !important;
    border-bottom: 2px solid var(--nm-border-strong) !important;
    font-weight: 600;
}

body[data-bs-theme="dark"] .table td {
    border-bottom-color: var(--nm-border) !important;
}

body[data-bs-theme="dark"] .table-striped>tbody>tr:nth-of-type(odd)>* {
    background-color: rgba(196, 149, 106, 0.02) !important;
    color: inherit;
}

body[data-bs-theme="dark"] .table-hover>tbody>tr:hover>* {
    background-color: rgba(196, 149, 106, 0.06) !important;
    color: inherit;
}


/* ===== BUTTONS ===== */
body[data-bs-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, var(--nm-copper) 0%, var(--nm-copper-dark) 100%) !important;
    border: none !important;
    box-shadow: 0 4px 16px rgba(196, 149, 106, 0.25);
    color: #fff !important;
    transition: var(--nm-transition);
}

body[data-bs-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, var(--nm-gold) 0%, #a67c52 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(196, 149, 106, 0.35);
}

body[data-bs-theme="dark"] .btn-outline-primary {
    border-color: var(--nm-copper) !important;
    color: var(--nm-copper) !important;
}

body[data-bs-theme="dark"] .btn-outline-primary:hover {
    background: var(--nm-copper) !important;
    color: #fff !important;
}

body[data-bs-theme="dark"] .btn-light {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: var(--nm-border) !important;
    color: var(--nm-text-secondary) !important;
}

body[data-bs-theme="dark"] .btn-light:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--nm-text-primary) !important;
}


/* ===== FORM CONTROLS ===== */
body[data-bs-theme="dark"] .form-control {
    background-color: rgba(10, 22, 40, 0.6) !important;
    border-color: var(--nm-border) !important;
    color: var(--nm-text-primary) !important;
    transition: var(--nm-transition);
}

body[data-bs-theme="dark"] .form-control:focus {
    background-color: rgba(10, 22, 40, 0.8) !important;
    border-color: var(--nm-copper) !important;
    box-shadow: 0 0 0 0.2rem var(--nm-glow) !important;
}

body[data-bs-theme="dark"] .form-control::placeholder {
    color: var(--nm-text-dim) !important;
}

body[data-bs-theme="dark"] .form-label {
    color: var(--nm-text-secondary) !important;
}

body[data-bs-theme="dark"] .form-select {
    background-color: rgba(10, 22, 40, 0.6) !important;
    border-color: var(--nm-border) !important;
    color: var(--nm-text-primary) !important;
}

body[data-bs-theme="dark"] .input-group-text {
    background-color: rgba(10, 22, 40, 0.6) !important;
    border-color: var(--nm-border) !important;
    color: var(--nm-copper) !important;
}


/* ===== BREADCRUMBS ===== */
body[data-bs-theme="dark"] .page-title-box h4 {
    color: var(--nm-text-primary) !important;
}

body[data-bs-theme="dark"] .breadcrumb-item+.breadcrumb-item::before {
    color: var(--nm-text-dim) !important;
}

body[data-bs-theme="dark"] .breadcrumb-item {
    color: var(--nm-text-muted) !important;
}

body[data-bs-theme="dark"] .breadcrumb-item.active {
    color: var(--nm-text-secondary) !important;
}

body[data-bs-theme="dark"] .breadcrumb-item a {
    color: var(--nm-gold) !important;
}


/* ===== SELECT2 DARK ===== */
body[data-bs-theme="dark"] .select2-container--default .select2-selection--single {
    background-color: rgba(10, 22, 40, 0.6) !important;
    border-color: var(--nm-border) !important;
}

body[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--nm-text-primary) !important;
}

body[data-bs-theme="dark"] .select2-dropdown {
    background-color: var(--nm-bg-deep) !important;
    border-color: var(--nm-border) !important;
}

body[data-bs-theme="dark"] .select2-results__option {
    color: var(--nm-text-secondary) !important;
}

body[data-bs-theme="dark"] .select2-results__option--highlighted {
    background-color: rgba(196, 149, 106, 0.12) !important;
    color: var(--nm-gold) !important;
}

body[data-bs-theme="dark"] .select2-search__field {
    background-color: rgba(10, 22, 40, 0.6) !important;
    color: var(--nm-text-primary) !important;
    border-color: var(--nm-border) !important;
}


/* ===== DATATABLE DARK ===== */
body[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select,
body[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input {
    background-color: rgba(10, 22, 40, 0.6) !important;
    border-color: var(--nm-border) !important;
    color: var(--nm-text-primary) !important;
}

body[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length label,
body[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter label,
body[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info {
    color: var(--nm-text-muted) !important;
}

body[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--nm-text-muted) !important;
}

body[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: rgba(196, 149, 106, 0.15) !important;
    border-color: var(--nm-copper) !important;
    color: var(--nm-gold) !important;
}

body[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(196, 149, 106, 0.1) !important;
    border-color: var(--nm-border) !important;
    color: var(--nm-gold) !important;
}


/* ===== MODALS ===== */
body[data-bs-theme="dark"] .modal-content {
    background: var(--nm-bg-deep) !important;
    border: 1px solid var(--nm-border) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

body[data-bs-theme="dark"] .modal-header {
    border-bottom-color: var(--nm-border) !important;
}

body[data-bs-theme="dark"] .modal-footer {
    border-top-color: var(--nm-border) !important;
}

body[data-bs-theme="dark"] .modal-title {
    color: var(--nm-text-primary) !important;
}

body[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}


/* ===== ALERTS ===== */
body[data-bs-theme="dark"] .alert {
    border: 1px solid var(--nm-border);
}


/* ===== TOASTS / NOTIFICATIONS ===== */
body[data-bs-theme="dark"] .toast {
    background: var(--nm-bg-deep) !important;
    border-color: var(--nm-border) !important;
}


/* ===== SCROLLBAR ===== */
body[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--nm-bg-deepest);
}

body[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}

body[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--nm-copper);
}


/* ===== PAGINATION ===== */
body[data-bs-theme="dark"] .page-link {
    background-color: rgba(10, 22, 40, 0.6) !important;
    border-color: var(--nm-border) !important;
    color: var(--nm-text-secondary) !important;
}

body[data-bs-theme="dark"] .page-link:hover {
    background-color: rgba(196, 149, 106, 0.1) !important;
    color: var(--nm-gold) !important;
}

body[data-bs-theme="dark"] .page-item.active .page-link {
    background-color: var(--nm-copper) !important;
    border-color: var(--nm-copper) !important;
    color: #fff !important;
}


/* ===== NAV TABS ===== */
body[data-bs-theme="dark"] .nav-tabs {
    border-bottom-color: var(--nm-border) !important;
}

body[data-bs-theme="dark"] .nav-tabs .nav-link {
    color: var(--nm-text-muted) !important;
}

body[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    background: transparent !important;
    border-color: var(--nm-border) var(--nm-border) transparent !important;
    color: var(--nm-gold) !important;
}

body[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: var(--nm-border) !important;
    color: var(--nm-text-primary) !important;
}