﻿/* ==================== PREMIUM TYPOGRAPHY ==================== */

:root {
    --ct-font-sans-serif: 'Inter', 'Public Sans', sans-serif;
    --ct-body-font-size: 0.875rem;
    --ct-topbar-height: 60px;
}

/* Body — Inter for clean readability */
body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings — Space Grotesk for premium techy feel */
h1, h2, h3, h4, h5, h6,
.fw-bold, .section-title, .card-title {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

/* ==================== CENTERED LAYOUT ==================== */

/* Centered layout for unauthenticated users (no sidebar) */
body.no-sidebar {
    --ct-sidenav-width: 0px;
}

/* Mobile: small side gaps */
body.no-sidebar .page-content {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Large screens: centered with visible side space */
@media (min-width: 992px) {
    body.no-sidebar .page-content {
        max-width: 900px;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

.icon-xl {
    width: 100px;
    height: 100px;
}

/* ==================== SHARED PAGE LAYOUT ==================== */

.page-header-banner {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.page-header-banner::after {
    content: '';
    position: absolute;
    right: -30px; top: -30px;
    width: 160px; height: 160px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    pointer-events: none;
}

.page-header-banner::before {
    content: '';
    position: absolute;
    right: 60px; bottom: -50px;
    width: 120px; height: 120px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}

.page-header-icon {
    width: 44px; height: 44px;
    background: rgba(255,255,255,0.18);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.page-filter-bar {
    background: #fff;
    border-radius: 12px;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f8;
}

.page-filter-bar .form-control,
.page-filter-bar .form-select {
    border-color: #e8e8f0;
    background: #fafafa;
    font-size: 0.85rem;
}

.page-filter-bar .form-control:focus,
.page-filter-bar .form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    background: #fff;
}

.page-filter-bar .input-group-text {
    background: #fafafa;
    border-color: #e8e8f0;
    color: #adb5bd;
}

.page-table-card {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(99,102,241,0.08);
    border: 1px solid #f0f0f8;
}

.page-table-card table tbody tr td {
    border-bottom: 1px solid #e5e7eb !important;
}

.page-table-card table tbody tr:last-child td {
    border-bottom: none !important;
}

.btn-header-ghost {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}
.btn-header-ghost:hover { background: rgba(255,255,255,0.25); color: #fff; }

.btn-header-primary {
    background: #fff;
    border: none;
    color: #6366f1;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn-header-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    color: #4f46e5;
}
.btn-header-primary:active { transform: scale(0.98); }

/* ==================== CONTEXT MENU ==================== */

@keyframes ctxSlideIn {
    from { opacity: 0; transform: scale(0.94) translateY(-6px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.ctx-menu {
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06) !important;
    padding: 6px !important;
    min-width: 210px !important;
    animation: ctxSlideIn 0.15s ease-out forwards;
}

.ctx-label {
    padding: 5px 10px 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #adb5bd;
    user-select: none;
}

.ctx-menu .dropdown-item {
    border-radius: 8px !important;
    padding: 0.45rem 0.65rem !important;
    font-size: 0.845rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    transition: background 0.12s;
    color: #374151;
}

.ctx-menu .dropdown-item:hover,
.ctx-menu .dropdown-item:focus {
    background: #f4f4f8;
    color: #111;
}

.ctx-menu .dropdown-item.text-danger { color: #e11d48 !important; }

.ctx-menu .dropdown-item.text-danger:hover {
    background: #fff1f3 !important;
    color: #e11d48 !important;
}

.ctx-menu .dropdown-divider {
    border-color: #f0f0f5 !important;
    margin: 4px 8px !important;
    opacity: 1 !important;
}

.ctx-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.ctx-icon-game  { background: #eef2ff; color: #6366f1; }
.ctx-icon-lock  { background: #eff6ff; color: #3b82f6; }
.ctx-icon-edit  { background: #f0fdf4; color: #16a34a; }
.ctx-icon-trash { background: #fff1f2; color: #e11d48; }
.ctx-icon-view  { background: #fefce8; color: #ca8a04; }

.copy-icon, .payment {
    font-size: 24px; /* Adjust icon size */
    cursor: pointer; /* Change cursor to hand */
    position: relative;
    z-index: 10;
}

.payment, .productList {
    position: relative;
    cursor: pointer;
    width: 18em%;
}

    .payment:hover, .productList:hover {
        background-color: #d9d4d4;
    }

    .payment.selected::after {
        content: '\2713'; /* Unicode for checkmark */
        position: absolute;
        top: 5px;
        right: 5px;
        font-size: 20px;
        color: green;
        font-weight: bold;
    }

    .payment.selected {
        background-color: #e5e0fb; /* Keep selected background */
        border-color: #007eff; /* Keep selected border */
    }

#tblPaymentDtl tr.selected::after {
    content: '\2713'; /* Unicode checkmark */
    font-size: 20px;
    color: green;
    position: absolute;
    top: 5px;
    right: 10px;
}

#tblPaymentDtl tr.selected {
    background-color: #e5e0fb; /* Highlight selected row */
}


#tblPaymentDtl tr {
    position: relative; /* Needed for absolute positioning */
    cursor: pointer;
    padding: 100px;
    border-radius: 100px;
}

.img-product-checkout {
    height: 50vh; /* 50% of viewport height */
    width: 100%; /* Full width of container */
    object-fit: cover; /* Crop image to fit, preserving aspect ratio */
}
/* Optional: Adjust for smaller screens */
@media (max-width: 768px) {
    .img-product-checkout {
        height: 30vh; /* Smaller height on mobile */
    }
}

.img-payment-checkout {
    height: 8vh; /* 50% of viewport height */
    padding: 10px;
    object-fit: cover; /* Crop image to fit, preserving aspect ratio */
}
/* Optional: Adjust for smaller screens */
@media (max-width: 768px) {
    .img-payment-checkout {
        width: 40%;
        height: 10vh; /* Smaller height on mobile */
    }
}

@media (max-width: 575.98px) {
    .img-payment-checkout {
        width: 40%; /* Full width of container */
        max-height: 40vh
    }
}


@media (max-width: 575.98px) {
    .screen-payment-img {
        width: 40%; /* Full width of container */
        height: 5vh; /* Even smaller for very small screens */
    }
}

@media (max-width: 575.98px) {
    .dashboardImg {
        width: 100%; /* Full width of container */
        max-height: 50vh
    }
}

@media (max-width: 575.98px) {
    .dash-img {
        width: 100%; /* Full width of container */
        max-height: 40vh
    }
}


@keyframes pulse-focus {
    0% {
        box-shadow: 0 0 0 0 rgba(13,110,253,0.5);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(13,110,253,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(13,110,253,0);
    }
}

.animate-focus {
    animation: pulse-focus 0.8s ease-out;
    border-color: #0d6efd !important; /* Bootstrap primary */
}

@keyframes pulse-highlight {
    0% {
        box-shadow: 0 0 5px 2px rgba(40,167,69,0.4);
        background-color: rgba(40,167,69,0.1);
    }

    50% {
        box-shadow: 0 0 25px 8px rgba(40,167,69,0.8);
        background-color: rgba(40,167,69,0.2);
    }

    100% {
        box-shadow: 0 0 5px 2px rgba(40,167,69,0.4);
        background-color: rgba(40,167,69,0.1);
    }
}

.highlight-card {
    border: 3px solid #28a745 !important;
    border-radius: 12px;
    animation: pulse-highlight 1.5s ease-in-out 2, fadeOutHighlight 1s ease-in 3s forwards;
}

/* Fades background and shadow smoothly back to normal */
@keyframes fadeOutHighlight {
    from {
        box-shadow: 0 0 20px 6px rgba(40,167,69,0.6);
        background-color: rgba(40,167,69,0.1);
    }

    to {
        box-shadow: none;
        background-color: transparent;
        border-color: #dee2e6; /* Bootstrap default border color */
    }
}
#copyToast.show {
    transform: translateY(0);
    opacity: 1;
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    animation: toastBounce .4s ease-out;
}

@keyframes toastBounce {
    0% {
        transform: translateY(-25px);
        opacity: 0;
    }

    60% {
        transform: translateY(5px);
        opacity: 1;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.ajax-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.clickable {
    cursor: pointer;
}

/* ==================== TOPBAR THEME ==================== */

/* Main topbar — consistent at all scroll positions, no scroll animation */
.app-topbar,
.app-topbar.topbar-active {
    background: #ffffff !important;
    border: none !important;
    border-bottom: 1px solid #f0f0f8 !important;
    box-shadow: 0 1px 12px rgba(99,102,241,0.06) !important;
    min-height: 60px !important;
    transition: none !important;
    margin: 0 !important;
}

.app-topbar .topbar-menu {
    min-height: 60px !important;
}

/* Prevent the inner menu from floating/shifting on scroll */
.app-topbar.topbar-active .topbar-menu {
    background-color: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: none !important;
}

/* Page title */
.app-topbar .page-title {
    font-family: 'Space Grotesk', 'Inter', sans-serif !important;
    font-weight: 700 !important;
    color: #111827 !important;
    font-size: 1rem !important;
    letter-spacing: -0.01em !important;
}

/* Topbar icon buttons (toggle, search, theme, settings) */
.topbar-link {
    color: #6b7280 !important;
    border-radius: 8px !important;
    transition: background 0.15s, color 0.15s !important;
}

.topbar-link:hover {
    background: #eef2ff !important;
    color: #6366f1 !important;
}

/* Chat link in topbar */
.topbar-chat-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.topbar-chat-link i {
    font-size: 20px;
}

.topbar-chat-link:hover {
    background: #eef2ff;
    color: #6366f1;
}

/* Search trigger pill */
.topbar-search {
    background: #f8f9fc !important;
    border: 1px solid #f0f0f8 !important;
    border-radius: 10px !important;
    padding: 0.35rem 0.9rem !important;
    color: #9ca3af !important;
    font-size: 0.845rem !important;
    font-family: 'Inter', sans-serif !important;
    cursor: pointer !important;
    transition: border-color 0.15s, background 0.15s, color 0.15s !important;
}

.topbar-search:hover {
    border-color: #c7d2fe !important;
    background: #eef2ff !important;
    color: #6366f1 !important;
}

/* User avatar ring */
.nav-user img.rounded-circle {
    border: 2px solid #e8e8f0 !important;
    transition: border-color 0.15s !important;
}

.nav-user .dropdown-toggle:hover img.rounded-circle {
    border-color: #6366f1 !important;
}

/* User display name in topbar */
.nav-user h5 {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.845rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin: 0 !important;
}

/* ==================== MOBILE TOPBAR ==================== */

@media (max-width: 767.98px) {
    .app-topbar,
    .app-topbar.topbar-active {
        padding: 0 !important;
        min-height: 48px !important;
        border-bottom: 1px solid #ede9fe !important;
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06) !important;
    }

    .app-topbar .topbar-menu {
        padding: 0 10px !important;
        min-height: 48px !important;
    }

    /* Compact logo */
    .app-topbar .logo .logo-lg {
        display: none !important;
    }

    .app-topbar .logo .logo-sm img {
        height: 26px !important;
        width: auto !important;
    }

    /* Sidebar toggle */
    .app-topbar .sidenav-toggle-button {
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
        font-size: 20px !important;
        border: none !important;
        background: transparent !important;
        color: inherit !important;
    }

    /* Tighter gaps */
    .app-topbar .d-flex.align-items-center.gap-2 {
        gap: 2px !important;
    }

    /* Theme toggle — scaled for mobile */
    .app-topbar .theme-toggle-wrap {
        padding: 4px 6px !important;
        gap: 5px !important;
    }

    .app-topbar .theme-toggle-wrap i {
        font-size: 16px !important;
    }

    .app-topbar .theme-toggle-track {
        width: 38px !important;
        height: 22px !important;
        border-radius: 11px !important;
    }

    .app-topbar .theme-toggle-thumb {
        width: 16px !important;
        height: 16px !important;
    }

    [data-bs-theme="dark"] .app-topbar .theme-toggle-thumb {
        transform: translateX(16px) !important;
    }

    /* Chat link — icon only */
    .app-topbar .topbar-chat-link span {
        display: none !important;
    }

    .app-topbar .topbar-chat-link {
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
        font-size: 20px !important;
    }

    /* Topbar icon links (settings etc.) */
    .app-topbar .topbar-link {
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
    }

    .app-topbar .topbar-link i {
        font-size: 20px !important;
    }

    /* User dropdown — avatar only */
    .app-topbar .nav-user .d-lg-flex {
        display: none !important;
    }

    .app-topbar .nav-user .ri-arrow-down-s-line {
        display: none !important;
    }

    .app-topbar .nav-user .dropdown-toggle {
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
    }

    .app-topbar .nav-user img.rounded-circle {
        width: 30px !important;
        height: 30px !important;
        border-width: 1.5px !important;
    }
}

/* Dark mode mobile topbar */
@media (max-width: 767.98px) {
    [data-bs-theme="dark"] .app-topbar,
    [data-bs-theme="dark"] .app-topbar.topbar-active {
        border-bottom-color: #2d2e3f !important;
        box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2) !important;
    }
}

/* User dropdown panel */
.nav-user .dropdown-menu {
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06) !important;
    padding: 6px !important;
    min-width: 215px !important;
}

/* Info-only items (role, email) — non-interactive */
.nav-user .dropdown-menu .dropdown-item.text-info {
    border-radius: 8px !important;
    font-size: 0.8rem !important;
    color: #6b7280 !important;
    background: #f8f9fc !important;
    margin-bottom: 2px !important;
    pointer-events: none !important;
    cursor: default !important;
    padding: 0.35rem 0.65rem !important;
}

/* Regular dropdown items */
.nav-user .dropdown-menu .dropdown-item:not(.text-info):not(.text-danger) {
    border-radius: 8px !important;
    padding: 0.45rem 0.65rem !important;
    font-size: 0.845rem !important;
    font-weight: 500 !important;
    color: #374151 !important;
    transition: background 0.12s !important;
}

.nav-user .dropdown-menu .dropdown-item:not(.text-info):not(.text-danger):hover {
    background: #f4f4f8 !important;
    color: #111 !important;
}

/* Sign out row */
.nav-user .dropdown-menu form.dropdown-item {
    border-radius: 8px !important;
    padding: 0.45rem 0.65rem !important;
    background: transparent !important;
}

.nav-user .dropdown-menu form.dropdown-item:hover {
    background: #fff1f3 !important;
}

/* Dropdown divider */
.nav-user .dropdown-menu .dropdown-divider {
    border-color: #f0f0f5 !important;
    margin: 4px 8px !important;
    opacity: 1 !important;
}

/* Search modal */
#searchModal .card {
    border-radius: 14px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.13) !important;
    border: none !important;
}

#searchModal #top-search {
    gap: 0.75rem;
    border-radius: 14px !important;
}

#searchModal #top-search > i {
    color: #6366f1;
    font-size: 1.1rem;
}

#searchModal .form-control {
    font-size: 0.9rem !important;
    font-family: 'Inter', sans-serif !important;
}

#searchModal .form-control:focus {
    box-shadow: none !important;
}

/* ==================== SIDEBAR THEME ==================== */

/* Main sidebar container */
.sidenav-menu {
    background: #ffffff !important;
    border-right: 1px solid #f0f0f8 !important;
    box-shadow: 2px 0 20px rgba(99,102,241,0.07) !important;
}

/* Logo area bottom border */
.sidenav-menu .logo {
    border-bottom: 1px solid #f0f0f8;
}

/* User profile card — gradient banner */
.sidenav-user {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    border-radius: 12px !important;
    margin: 0.65rem 0.75rem 0.25rem !important;
    padding: 0.85rem 0.9rem !important;
    position: relative;
    overflow: visible;
}

/* Clip only the decorative circle, not the dropdown */
.sidenav-user::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    overflow: hidden;
    pointer-events: none;
}

/* Prevent topbar-link hover from whitening the gradient card */
.sidenav-user .topbar-link,
.sidenav-user .topbar-link:hover,
.sidenav-user .topbar-link:focus,
.sidenav-user .topbar-link:active {
    background: transparent !important;
    color: #fff !important;
}


.sidenav-user::after {
    content: '';
    position: absolute;
    right: 5px; top: 5px;
    width: 55px; height: 55px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* User avatar ring */
.sidenav-user img.rounded-circle {
    border: 2px solid rgba(255,255,255,0.4) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

/* User name & role text */
.sidenav-user .sidenav-user-name,
.sidenav-user .sidenav-user-name span,
.sidenav-user .sidenav-user-name .fw-semibold {
    color: #fff !important;
}

.sidenav-user .sidenav-user-name .text-muted,
.sidenav-user .sidenav-user-name p {
    color: rgba(255,255,255,0.72) !important;
}

.sidenav-user .sidenav-user-arrow {
    color: rgba(255,255,255,0.7) !important;
}

/* Section title labels */
.side-nav-title {
    font-family: 'Inter', sans-serif !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #6366f1 !important;
    opacity: 1 !important;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
}

/* Nav link base */
.side-nav-link {
    border-radius: 8px !important;
    margin: 1px 0.5rem !important;
    padding: 0.45rem 0.75rem !important;
    color: #4b5563 !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.845rem !important;
    font-weight: 500 !important;
    transition: background 0.15s, color 0.15s !important;
}

/* Nav link hover */
.side-nav-link:hover {
    background: #eef2ff !important;
    color: #6366f1 !important;
}

/* Active nav link */
.side-nav-link.active,
.menuitem-active > .side-nav-link {
    background: linear-gradient(135deg, rgba(99,102,241,0.13) 0%, rgba(139,92,246,0.09) 100%) !important;
    color: #6366f1 !important;
    font-weight: 600 !important;
    border-left: 3px solid #6366f1 !important;
}

/* Menu icon — default */
.side-nav-link .menu-icon {
    color: #9ca3af !important;
    font-size: 1.1rem !important;
    transition: color 0.15s !important;
}

/* Menu icon — hover & active */
.side-nav-link:hover .menu-icon,
.side-nav-link.active .menu-icon,
.menuitem-active > .side-nav-link .menu-icon {
    color: #6366f1 !important;
}

/* Menu text */
.side-nav-link .menu-text {
    font-size: 0.845rem !important;
    line-height: 1.4 !important;
}

/* Scrollable area */
.sidenav-menu [data-simplebar] {
    padding-bottom: 1rem;
}

/* ==================== MODAL THEME ==================== */

.modal-content {
    border-radius: 16px !important;
    border: none !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15) !important;
}

.modal-header-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none !important;
    padding: 1.1rem 1.5rem;
    position: relative;
    overflow: hidden;
    border-radius: 16px 16px 0 0 !important;
}

.modal-header-gradient::after {
    content: '';
    position: absolute;
    right: -20px; top: -20px;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    pointer-events: none;
}

.modal-header-icon {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.18);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.modal-title-text {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.modal-subtitle-text {
    font-size: 11px;
    color: rgba(255,255,255,0.75);
    margin: 0;
    margin-top: 1px;
    font-family: 'Inter', sans-serif;
}

.btn-modal-close {
    background: #f4f4f8 !important;
    border: none !important;
    color: #374151 !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
}
.btn-modal-close:hover { background: #e5e7eb !important; color: #111 !important; }

.btn-modal-save {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
}
.btn-modal-save:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3) !important;
}

.modal-footer {
    border-top: 1px solid #f0f0f8 !important;
    padding: 0.75rem 1.25rem !important;
}

/* ==================== LINK FORMATTER (Facebook column etc.) ==================== */
.lf-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.lf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #f8f9fa;
    color: #6b7280;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
}

.lf-btn:hover {
    background: #eef2ff;
    color: #6366f1;
    border-color: #c7d2fe;
}

.lf-btn-copy:active {
    background: #d1e7dd;
    color: #0f5132;
    border-color: #a3cfbb;
}

.lf-text {
    font-size: 0.8rem;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Dark mode */
[data-bs-theme="dark"] .lf-btn {
    background: #252636;
    border-color: #2d2e3f;
    color: #94a3b8;
}

[data-bs-theme="dark"] .lf-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.35);
}

[data-bs-theme="dark"] .lf-btn-copy:active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.35);
}

[data-bs-theme="dark"] .lf-text {
    color: #cbd5e1;
}

/* ==================== COLUMN RESIZE ==================== */
.col-resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    z-index: 10;
    transition: background 0.15s;
}

.col-resize-handle:hover,
.col-resizing .col-resize-handle {
    background: #6366f1;
    opacity: 0.5;
    border-radius: 2px;
}

body.col-resizing {
    cursor: col-resize !important;
    user-select: none;
}

body.col-resizing * {
    cursor: col-resize !important;
}

[data-bs-theme="dark"] .col-resize-handle:hover,
[data-bs-theme="dark"] .col-resizing .col-resize-handle {
    background: #a5b4fc;
}

/* ==================== EMAIL CELL ==================== */
.email-cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #374151;
    max-width: 240px;
}

.email-cell i {
    font-size: 15px;
    color: #9ca3af;
    flex-shrink: 0;
}

.email-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-bs-theme="dark"] .email-cell {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .email-cell i {
    color: #64748b;
}

/* ==================== DISPLAY NAME CELL ==================== */
.dn-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dn-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.dn-info {
    min-width: 0;
    flex: 1;
}

.dn-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

[data-bs-theme="dark"] .dn-name {
    color: #f1f5f9;
}

/* ==================== LAST LOGIN CELL ==================== */
.ll-wrap {
    line-height: 1.3;
}

.ll-date {
    font-size: 0.82rem;
    font-weight: 500;
    color: #374151;
}

.ll-ago {
    font-size: 0.73rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 1px;
}

.ll-recent .ll-ago {
    color: #059669;
}

.ll-stale .ll-ago {
    color: #ef4444;
}

.ll-never {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #9ca3af;
    font-style: italic;
}

.ll-never i {
    font-size: 14px;
}

[data-bs-theme="dark"] .ll-date {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .ll-ago {
    color: #64748b;
}

[data-bs-theme="dark"] .ll-recent .ll-ago {
    color: #34d399;
}

[data-bs-theme="dark"] .ll-stale .ll-ago {
    color: #f87171;
}

[data-bs-theme="dark"] .ll-never {
    color: #64748b;
}

/* ==================== STATUS CHIP ==================== */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.status-chip i {
    font-size: 14px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-active {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.status-active .status-dot {
    background: #059669;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.status-inactive {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fcd34d;
}

.status-inactive .status-dot {
    background: #d97706;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}

.status-disabled {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.status-disabled .status-dot {
    background: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.status-unknown {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.status-unknown .status-dot {
    background: #6b7280;
}

[data-bs-theme="dark"] .status-active {
    background: rgba(5, 150, 105, 0.15);
    color: #34d399;
    border-color: rgba(5, 150, 105, 0.3);
}

[data-bs-theme="dark"] .status-active .status-dot {
    background: #34d399;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.25);
}

[data-bs-theme="dark"] .status-inactive {
    background: rgba(217, 119, 6, 0.15);
    color: #fbbf24;
    border-color: rgba(217, 119, 6, 0.3);
}

[data-bs-theme="dark"] .status-inactive .status-dot {
    background: #fbbf24;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.25);
}

[data-bs-theme="dark"] .status-disabled {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
    border-color: rgba(220, 38, 38, 0.3);
}

[data-bs-theme="dark"] .status-disabled .status-dot {
    background: #f87171;
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.25);
}

[data-bs-theme="dark"] .status-unknown {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border-color: rgba(107, 114, 128, 0.3);
}

[data-bs-theme="dark"] .status-unknown .status-dot {
    background: #9ca3af;
}

/* ==================== ROLE CHIP ==================== */
.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.role-chip i {
    font-size: 14px;
}

.role-user {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.role-admin {
    background: #eef2ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
}

.role-super {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fcd34d;
}

[data-bs-theme="dark"] .role-user {
    background: rgba(5, 150, 105, 0.15);
    color: #34d399;
    border-color: rgba(5, 150, 105, 0.3);
}

[data-bs-theme="dark"] .role-admin {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.3);
}

[data-bs-theme="dark"] .role-super {
    background: rgba(217, 119, 6, 0.15);
    color: #fbbf24;
    border-color: rgba(217, 119, 6, 0.3);
}

/* ==================== CREATED INFO CELL ==================== */
.ci-wrap {
    line-height: 1.3;
    white-space: nowrap;
    min-width: 110px;
}

.ci-date {
    font-size: 0.82rem;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.ci-by {
    font-size: 0.75rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-bs-theme="dark"] .ci-date {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .ci-by {
    color: #64748b;
}

/* ==================== THEME TOGGLE SWITCH ==================== */
.theme-toggle-wrap {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border-radius: 22px;
    transition: background 0.25s ease;
}
.theme-toggle-wrap:hover {
    background: rgba(99, 102, 241, 0.08);
}
.theme-toggle-track {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    transition: background 0.3s ease;
    flex-shrink: 0;
}
.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Dark mode active state */
[data-bs-theme="dark"] .theme-toggle-track {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
[data-bs-theme="dark"] .theme-toggle-thumb {
    transform: translateX(20px);
}
[data-bs-theme="dark"] .theme-toggle-wrap:hover {
    background: rgba(99, 102, 241, 0.12);
}
/* Icon visibility */
.light-mode-icon { color: #f59e0b; font-size: 18px; }
.dark-mode-icon { color: #94a3b8; font-size: 18px; opacity: 0.45; }
[data-bs-theme="dark"] .light-mode-icon { color: #94a3b8; opacity: 0.45; }
[data-bs-theme="dark"] .dark-mode-icon { color: #eab308; opacity: 1; }

/* ==================== DARK THEME OVERRIDES ==================== */

/* --- Topbar --- */
[data-bs-theme="dark"] .app-topbar,
[data-bs-theme="dark"] .app-topbar.topbar-active {
    background: #1e1f2e !important;
    border: none !important;
    border-bottom: 1px solid #2d2e3f !important;
    box-shadow: 0 1px 12px rgba(0,0,0,0.25) !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

[data-bs-theme="dark"] .app-topbar .page-title {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .topbar-link {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .topbar-link:hover {
    background: rgba(99,102,241,0.15) !important;
    color: #a5b4fc !important;
}

[data-bs-theme="dark"] .topbar-search {
    background: #252636 !important;
    border: 1px solid #2d2e3f !important;
    color: #64748b !important;
}

[data-bs-theme="dark"] .topbar-search:hover {
    border-color: rgba(99,102,241,0.4) !important;
    background: rgba(99,102,241,0.1) !important;
    color: #a5b4fc !important;
}

[data-bs-theme="dark"] .nav-user img.rounded-circle {
    border-color: #3d3e50 !important;
}

[data-bs-theme="dark"] .nav-user h5 {
    color: #cbd5e1 !important;
}

/* --- User Dropdown (dark) --- */
[data-bs-theme="dark"] .nav-user .dropdown-menu {
    background: #1e1f2e !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.2) !important;
}

[data-bs-theme="dark"] .nav-user .dropdown-menu .dropdown-item.text-info {
    color: #94a3b8 !important;
    background: #252636 !important;
}

[data-bs-theme="dark"] .nav-user .dropdown-menu .dropdown-item:not(.text-info):not(.text-danger) {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .nav-user .dropdown-menu .dropdown-item:not(.text-info):not(.text-danger):hover {
    background: rgba(99,102,241,0.12) !important;
    color: #a5b4fc !important;
}

[data-bs-theme="dark"] .nav-user .dropdown-menu form.dropdown-item:hover {
    background: rgba(225,29,72,0.12) !important;
}

[data-bs-theme="dark"] .nav-user .dropdown-menu .dropdown-divider {
    border-color: #2d2e3f !important;
}

/* --- Search Modal (dark) --- */
[data-bs-theme="dark"] #searchModal .card {
    background: #1e1f2e !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4) !important;
}

[data-bs-theme="dark"] #searchModal #top-search > i {
    color: #a5b4fc;
}

[data-bs-theme="dark"] #searchModal .form-control {
    background: transparent !important;
    color: #e2e8f0 !important;
}

/* --- Sidebar --- */
[data-bs-theme="dark"] .sidenav-menu {
    background: #1a1b29 !important;
    border-right: 1px solid #2d2e3f !important;
    box-shadow: 2px 0 20px rgba(0,0,0,0.3) !important;
}

[data-bs-theme="dark"] .sidenav-menu .logo {
    border-bottom-color: #2d2e3f;
}

[data-bs-theme="dark"] .side-nav-title {
    color: #818cf8 !important;
}

[data-bs-theme="dark"] .side-nav-link {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .side-nav-link:hover {
    background: rgba(99,102,241,0.12) !important;
    color: #a5b4fc !important;
}

[data-bs-theme="dark"] .side-nav-link.active,
[data-bs-theme="dark"] .menuitem-active > .side-nav-link {
    background: linear-gradient(135deg, rgba(99,102,241,0.2) 0%, rgba(139,92,246,0.14) 100%) !important;
    color: #a5b4fc !important;
    border-left-color: #818cf8 !important;
}

[data-bs-theme="dark"] .side-nav-link .menu-icon {
    color: #64748b !important;
}

[data-bs-theme="dark"] .side-nav-link:hover .menu-icon,
[data-bs-theme="dark"] .side-nav-link.active .menu-icon,
[data-bs-theme="dark"] .menuitem-active > .side-nav-link .menu-icon {
    color: #a5b4fc !important;
}

/* --- Context Menu (dark) --- */
[data-bs-theme="dark"] .ctx-menu {
    background: #1e1f2e !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.25) !important;
}

[data-bs-theme="dark"] .ctx-label {
    color: #64748b;
}

[data-bs-theme="dark"] .ctx-menu .dropdown-item {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .ctx-menu .dropdown-item:hover,
[data-bs-theme="dark"] .ctx-menu .dropdown-item:focus {
    background: rgba(99,102,241,0.12);
    color: #e2e8f0;
}

[data-bs-theme="dark"] .ctx-menu .dropdown-item.text-danger:hover {
    background: rgba(225,29,72,0.12) !important;
}

[data-bs-theme="dark"] .ctx-menu .dropdown-divider {
    border-color: #2d2e3f !important;
}

[data-bs-theme="dark"] .ctx-icon-game  { background: rgba(99,102,241,0.15); color: #818cf8; }
[data-bs-theme="dark"] .ctx-icon-lock  { background: rgba(59,130,246,0.15); color: #60a5fa; }
[data-bs-theme="dark"] .ctx-icon-edit  { background: rgba(22,163,106,0.15); color: #4ade80; }
[data-bs-theme="dark"] .ctx-icon-trash { background: rgba(225,29,72,0.12);  color: #fb7185; }
[data-bs-theme="dark"] .ctx-icon-view  { background: rgba(202,138,4,0.15);  color: #facc15; }

/* --- Modal (dark) --- */
[data-bs-theme="dark"] .modal-content {
    background: #1e1f2e !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4) !important;
}

[data-bs-theme="dark"] .btn-modal-close {
    background: #252636 !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .btn-modal-close:hover {
    background: #2d2e3f !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .modal-footer {
    border-top-color: #2d2e3f !important;
}

/* --- Cards & general content (dark) --- */
[data-bs-theme="dark"] .card {
    background: #1e1f2e !important;
    border-color: #2d2e3f !important;
}

[data-bs-theme="dark"] .page-title-box {
    background: transparent !important;
}

/* --- Tables (dark) --- */
[data-bs-theme="dark"] .table {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .table thead th {
    background: #252636 !important;
    color: #94a3b8 !important;
    border-color: #2d2e3f !important;
}

[data-bs-theme="dark"] .table td {
    border-color: #2d2e3f !important;
}

[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(37,38,54,0.5) !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover {
    background-color: rgba(99,102,241,0.06) !important;
}

/* --- Form controls (dark) --- */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #252636 !important;
    border-color: #2d2e3f !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 0.15rem rgba(99,102,241,0.25) !important;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #64748b !important;
}

/* --- Badges & labels (dark readability) --- */
[data-bs-theme="dark"] .badge.bg-light {
    background: #252636 !important;
    color: #cbd5e1 !important;
}

/* --- Scrollbar (dark) --- */
[data-bs-theme="dark"] ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #1a1b29;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3d3e50;
    border-radius: 3px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #4d4e60;
}

/* --- Sidenav toggle button (dark) --- */
[data-bs-theme="dark"] .sidenav-toggle-button {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .sidenav-toggle-button:hover {
    color: #a5b4fc !important;
}

/* --- Chat link in topbar (dark) --- */
[data-bs-theme="dark"] .topbar-chat-link {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .topbar-chat-link:hover {
    color: #a5b4fc !important;
}

/* --- Bootstrap utility overrides for dark mode --- */
[data-bs-theme="dark"] .bg-white {
    background-color: #1e1f2e !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #252636 !important;
}

[data-bs-theme="dark"] .border-light {
    border-color: #2d2e3f !important;
}

[data-bs-theme="dark"] .border {
    border-color: #2d2e3f !important;
}

[data-bs-theme="dark"] .card-header {
    border-bottom-color: #2d2e3f !important;
}

[data-bs-theme="dark"] .card-body {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .text-muted {
    color: #7c8494 !important;
}

/* --- Body, wrapper & page content background --- */
[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .wrapper,
[data-bs-theme="dark"] .page-content {
    background-color: #141520 !important;
}

/* --- Footer --- */
[data-bs-theme="dark"] .footer {
    background: #1a1b29 !important;
    border-top-color: #2d2e3f !important;
    color: #64748b !important;
}

/* --- Breadcrumb / page title box --- */
[data-bs-theme="dark"] .page-title-box .breadcrumb a {
    color: #94a3b8 !important;
}

/* --- Dropdown menus (global) --- */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1e1f2e !important;
    border-color: #2d2e3f !important;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: rgba(99, 102, 241, 0.1) !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .dropdown-divider {
    border-color: #2d2e3f !important;
}

/* --- Shadows softer in dark mode --- */
[data-bs-theme="dark"] .shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2) !important;
}

/* --- Filter bar (shared + page-specific variants) --- */
[data-bs-theme="dark"] .page-filter-bar,
[data-bs-theme="dark"] .ud-filter-bar {
    background: #1e1f2e !important;
    border-color: #2d2e3f !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .page-filter-bar .form-control,
[data-bs-theme="dark"] .page-filter-bar .form-select,
[data-bs-theme="dark"] .ud-filter-bar .form-control,
[data-bs-theme="dark"] .ud-filter-bar .form-select {
    background: #252636 !important;
    border-color: #2d2e3f !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .page-filter-bar .form-control:focus,
[data-bs-theme="dark"] .page-filter-bar .form-select:focus,
[data-bs-theme="dark"] .ud-filter-bar .form-control:focus,
[data-bs-theme="dark"] .ud-filter-bar .form-select:focus {
    background: #2a2b3d !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

[data-bs-theme="dark"] .page-filter-bar .input-group-text,
[data-bs-theme="dark"] .ud-filter-bar .input-group-text {
    background: #252636 !important;
    border-color: #2d2e3f !important;
    color: #64748b !important;
}

[data-bs-theme="dark"] .page-filter-bar .form-control::placeholder,
[data-bs-theme="dark"] .ud-filter-bar .form-control::placeholder {
    color: #64748b !important;
}

/* --- Table card (shared + page-specific variants) --- */
[data-bs-theme="dark"] .page-table-card,
[data-bs-theme="dark"] .ud-table-card {
    background: #1e1f2e !important;
    border-color: #2d2e3f !important;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .page-table-card table tbody tr td,
[data-bs-theme="dark"] .ud-table-card table tbody tr td {
    border-bottom-color: #2d2e3f !important;
}

/* --- Bootstrap Table library dark mode --- */
[data-bs-theme="dark"] .fixed-table-container {
    background: #1e1f2e !important;
    border-color: #2d2e3f !important;
}

[data-bs-theme="dark"] .fixed-table-header,
[data-bs-theme="dark"] .bootstrap-table .fixed-table-container .table thead th {
    background: #252636 !important;
    color: #94a3b8 !important;
    border-color: #2d2e3f !important;
}

[data-bs-theme="dark"] .bootstrap-table .fixed-table-container .table tbody td {
    color: #cbd5e1 !important;
    border-color: #2d2e3f !important;
}

[data-bs-theme="dark"] .bootstrap-table .fixed-table-container .table tbody tr:hover td {
    background: rgba(99, 102, 241, 0.06) !important;
}

[data-bs-theme="dark"] .fixed-table-body {
    background: #1e1f2e !important;
}

/* Bootstrap Table pagination */
[data-bs-theme="dark"] .fixed-table-pagination .pagination .page-item .page-link {
    background: #252636 !important;
    border-color: #2d2e3f !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .fixed-table-pagination .pagination .page-item.active .page-link {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .fixed-table-pagination .pagination .page-item.disabled .page-link {
    background: #1a1b29 !important;
    color: #4d4e60 !important;
}

[data-bs-theme="dark"] .fixed-table-pagination .page-list .btn-group .btn {
    background: #252636 !important;
    border-color: #2d2e3f !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .fixed-table-pagination .page-list .btn-group .btn.active {
    background: #6366f1 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .fixed-table-pagination {
    background: #1e1f2e !important;
}

[data-bs-theme="dark"] .fixed-table-pagination .pagination-detail {
    color: #64748b !important;
}

/* Bootstrap Table toolbar & search */
[data-bs-theme="dark"] .fixed-table-toolbar .search input {
    background: #252636 !important;
    border-color: #2d2e3f !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .fixed-table-toolbar .btn-group .btn {
    background: #252636 !important;
    border-color: #2d2e3f !important;
    color: #94a3b8 !important;
}

/* Bootstrap Table loading */
[data-bs-theme="dark"] .fixed-table-loading {
    background: rgba(30, 31, 46, 0.85) !important;
}

[data-bs-theme="dark"] .fixed-table-loading .loading-wrap .loading-text {
    color: #94a3b8 !important;
}

/* --- Header button (white on gradient) dark adjust --- */
[data-bs-theme="dark"] .btn-header-primary,
[data-bs-theme="dark"] .btn-create-user {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .btn-header-primary:hover,
[data-bs-theme="dark"] .btn-create-user:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

/* --- Keyboard hint badges (UserDetail) --- */
[data-bs-theme="dark"] .kbd {
    background: #252636 !important;
    border-color: #3d3e50 !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .kbd-hint {
    color: #64748b !important;
}

/* --- Vertical rule --- */
[data-bs-theme="dark"] .vr {
    opacity: 0.15 !important;
    background-color: #64748b !important;
}

/* --- Input group text (global) --- */
[data-bs-theme="dark"] .input-group-text {
    background-color: #252636 !important;
    border-color: #2d2e3f !important;
    color: #64748b !important;
}

/* --- Modal content (global) --- */
[data-bs-theme="dark"] .modal-body {
    background: #1e1f2e !important;
    color: #cbd5e1 !important;
}

/* --- Bootstrap switch in dark mode --- */
[data-bs-theme="dark"] .form-check-input {
    background-color: #252636 !important;
    border-color: #3d3e50 !important;
}

[data-bs-theme="dark"] .form-check-input:checked {
    background-color: #6366f1 !important;
    border-color: #6366f1 !important;
}

/* --- Toast / alert --- */
[data-bs-theme="dark"] .toast {
    background: #1e1f2e !important;
    border-color: #2d2e3f !important;
    color: #cbd5e1 !important;
}

/* --- Spinner on dark bg --- */
[data-bs-theme="dark"] .spinner-grow.text-primary,
[data-bs-theme="dark"] .spinner-border.text-primary {
    color: #818cf8 !important;
}

/* --- GenerateCred credential state classes --- */
.gc-cred-placeholder {
    color: #adb5bd !important;
    font-style: italic;
}

.gc-cred-filled {
    color: #1f2937 !important;
    font-style: normal;
}

[data-bs-theme="dark"] .gc-cred-placeholder {
    color: #4d4e60 !important;
}

[data-bs-theme="dark"] .gc-cred-filled {
    color: #e2e8f0 !important;
}

/* --- GenerateCred cards (inline <style> overrides) --- */
[data-bs-theme="dark"] .gc-card {
    background: #1e1f2e !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .gc-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .gc-game-img {
    border-color: #2d2e3f !important;
}

[data-bs-theme="dark"] .gc-cred-row {
    background: #252636 !important;
}

[data-bs-theme="dark"] .gc-cred-label {
    color: #7c8494 !important;
}

[data-bs-theme="dark"] .gc-cred-value {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .gc-copy-btn {
    border-color: #3d3e50 !important;
    color: #7c8494 !important;
}

[data-bs-theme="dark"] .gc-copy-btn:hover {
    border-color: #6366f1 !important;
    color: #a5b4fc !important;
    background: rgba(99, 102, 241, 0.12) !important;
}

/* Product name in gc cards */
[data-bs-theme="dark"] .gc-card .productname {
    color: #e2e8f0 !important;
}

/* btn-light in dark mode */
[data-bs-theme="dark"] .btn-light {
    background-color: #252636 !important;
    border-color: #3d3e50 !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .btn-light:hover {
    background-color: #2d2e3f !important;
    color: #e2e8f0 !important;
}

/* --- Email template filter label (inline style fallback) --- */
[data-bs-theme="dark"] .page-filter-bar label {
    color: #cbd5e1 !important;
}

/* --- Bootstrap Table "No matching records" --- */
[data-bs-theme="dark"] .no-records-found td {
    color: #64748b !important;
}

/* --- Page list dropdown in Bootstrap Table --- */
[data-bs-theme="dark"] .fixed-table-pagination .dropdown-menu {
    background: #1e1f2e !important;
}

[data-bs-theme="dark"] .fixed-table-pagination .dropdown-menu .dropdown-item {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .fixed-table-pagination .dropdown-menu .dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1) !important;
}

/* --- User credential partial --- */
[data-bs-theme="dark"] .credential-box {
    color: #e2e8f0 !important;
}

/* --- Offcanvas / side panels --- */
[data-bs-theme="dark"] .offcanvas {
    background-color: #1e1f2e !important;
    border-color: #2d2e3f !important;
    color: #cbd5e1 !important;
}

/* --- UserProfile page --- */

/* Pill tab nav */
[data-bs-theme="dark"] .up-tab-nav {
    background: #1e1f2e !important;
    border-color: #2d2e3f !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .up-tab-nav .nav-link {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .up-tab-nav .nav-link:hover:not(.active) {
    background: #252636 !important;
    color: #e2e8f0 !important;
}

/* Profile card */
[data-bs-theme="dark"] .up-card {
    background: #1e1f2e !important;
    border-color: #2d2e3f !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2) !important;
}

/* Avatar ring */
[data-bs-theme="dark"] .up-avatar-ring {
    border-color: #1e1f2e !important;
    background: #252636 !important;
}

/* Info rows */
[data-bs-theme="dark"] .up-info-row {
    border-bottom-color: #2d2e3f !important;
}

[data-bs-theme="dark"] .up-info-icon {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #a5b4fc !important;
}

[data-bs-theme="dark"] .up-info-label {
    color: #64748b !important;
}

[data-bs-theme="dark"] .up-info-value {
    color: #e2e8f0 !important;
}

/* Form field labels */
[data-bs-theme="dark"] .up-field-label {
    color: #7c8494 !important;
}

/* Form controls inside profile card */
[data-bs-theme="dark"] .up-card .form-control {
    background: #252636 !important;
    border-color: #2d2e3f !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .up-card .form-control:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

/* Card footer */
[data-bs-theme="dark"] .up-card-footer {
    background: #161722 !important;
    border-top-color: #2d2e3f !important;
}

/* User status badge */
[data-bs-theme="dark"] .up-status-badge {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #a5b4fc !important;
}

/* --- Security / Reset Password card --- */
[data-bs-theme="dark"] .up-sec-card {
    background: #1e1f2e !important;
    border-color: #2d2e3f !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2) !important;
}

/* Password field */
[data-bs-theme="dark"] .up-pwd-field .form-control {
    background: #252636 !important;
    border-color: #2d2e3f !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .up-pwd-field .form-control:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
}

/* Password toggle button */
[data-bs-theme="dark"] .up-pwd-toggle {
    color: #64748b !important;
}

[data-bs-theme="dark"] .up-pwd-toggle:hover {
    color: #a5b4fc !important;
}

/* Security field labels */
[data-bs-theme="dark"] .up-sec-field-label {
    color: #7c8494 !important;
}

/* Password tips box */
[data-bs-theme="dark"] .up-pwd-tips {
    background: #252636 !important;
    border-color: #2d2e3f !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .up-pwd-tips .fw-semibold {
    color: #cbd5e1 !important;
}

/* ==================== SELECT2 DARK MODE ==================== */

[data-bs-theme="dark"] .select2-container--default .select2-selection--single {
    background: #252636 !important;
    border-color: #2d2e3f !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #64748b !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #64748b transparent transparent transparent !important;
}

[data-bs-theme="dark"] .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

[data-bs-theme="dark"] .select2-dropdown {
    background: #1e1f2e !important;
    border-color: #2d2e3f !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
    background: #252636 !important;
    border-color: #2d2e3f !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-results__option {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: rgba(99, 102, 241, 0.2) !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"] {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #a5b4fc !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-results__option--group {
    color: #64748b !important;
}

/* ==================== RECEIPT & CASHOUT DIALOG DARK MODE ==================== */

/* Form labels inside modals */
[data-bs-theme="dark"] .col-form-label,
[data-bs-theme="dark"] .col-form-label-sm {
    color: #cbd5e1 !important;
}

/* Dashed borders */
[data-bs-theme="dark"] .border-dashed {
    border-color: #2d2e3f !important;
}

/* Disabled / readonly form controls */
[data-bs-theme="dark"] .form-control:disabled,
[data-bs-theme="dark"] .form-control[readonly] {
    background: #1a1b29 !important;
    color: #94a3b8 !important;
    border-color: #2d2e3f !important;
    opacity: 1 !important;
}

/* Preview panes (pre blocks with bg-light) */
[data-bs-theme="dark"] pre.bg-light,
[data-bs-theme="dark"] pre.border {
    background: #1a1b29 !important;
    border-color: #2d2e3f !important;
    color: #e2e8f0 !important;
}

/* Outline secondary button */
[data-bs-theme="dark"] .btn-outline-secondary {
    color: #a5b4fc !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
    background: rgba(99, 102, 241, 0.08) !important;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    background: rgba(99, 102, 241, 0.18) !important;
    color: #c7d2fe !important;
    border-color: rgba(99, 102, 241, 0.5) !important;
}

/* Card headers inside modals */
[data-bs-theme="dark"] .modal .card .card-header {
    background: #252636 !important;
    border-bottom-color: #2d2e3f !important;
}

[data-bs-theme="dark"] .modal .card .card-header .header-title {
    color: #e2e8f0 !important;
}

/* bg-primary-subtle avatar circles in payment detail */
[data-bs-theme="dark"] .bg-primary-subtle {
    background: rgba(99, 102, 241, 0.15) !important;
}

/* Form select (native dropdowns) inside modals */
[data-bs-theme="dark"] .modal .form-select {
    background-color: #252636 !important;
    border-color: #2d2e3f !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .modal .form-select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}