/* here you can put your own css to customize and override the theme */

/* Premium Dashboard Styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Typography */
body, h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Poppins', sans-serif !important;
}

/* Background Gradient for Main Content - AI Analytics Style */
.content-wrapper, .main-footer {
    /* Soft Blue -> Soft Peach gradient (as reference) */
    background: linear-gradient(90deg, #cdefff 0%, #e6f2f7 45%, #ffe7c7 100%) !important;
}

/* Background Gradient for Login Page - Minimalist Invisible */
.login-page {
    background: linear-gradient(135deg, #039be5 0%, #3c8dbc 60%, #9fd9ff 100%) !important; 
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100vh !important;
}

/* Footer Styling */
.main-footer {
    border-top: none !important;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.03);
    color: #555 !important;
}
.main-footer strong {
    color: #333 !important;
}
.main-footer a {
    color: #3c8dbc !important;
}

/* Glassmorphism Cards - AI Analytics Style */
.box, .card, .info-box, .small-box {
    background: #ffffff !important;
    border-radius: 12px !important; /* Slightly smaller radius for professional look */
    box-shadow: 0 4px 20px rgba(0,0,0,0.05) !important; /* Soft, diffuse shadow */
    border: 1px solid rgba(0,0,0,0.03) !important; /* Subtle border */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.box-default, .box-primary, .box-success, .box-info, .box-warning, .box-danger {
    border: 1px solid rgba(0,0,0,0.05) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05) !important;
}

.box-header.with-border {
    border-bottom: 1px solid #eee !important;
}

.box-title {
    font-weight: 600;
    color: #333;
}

.box:hover, .card:hover, .info-box:hover, .small-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08) !important;
}

/* Form Inputs - AI Analytics Style */
.form-control {
    background-color: #ffffff !important;
    border: 1px solid #dddddd !important;
    border-radius: 8px !important;
    height: 30px !important;
    padding: 4px 8px !important;
    box-shadow: none !important;
    color: #444;
    transition: all 0.2s ease;
    font-size: 12px !important;
}

.form-control:focus {
    border-color: #4b49ac !important; /* Deep Purple Focus */
    box-shadow: 0 0 0 3px rgba(75, 73, 172, 0.12) !important;
}

/* =========================================
   GLOBAL COMPACT SIZE OVERRIDES
   ========================================= */
body, h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, p, span, a, div {
    font-size: 12px !important;
}

.btn {
    font-size: 12px !important;
    padding: 3px 8px !important;
    line-height: 1.5 !important;
    border-radius: 4px !important;
}

.btn-lg {
    font-size: 14px !important;
    padding: 5px 10px !important;
}

.btn-sm, .btn-xs {
    font-size: 11px !important;
    padding: 2px 6px !important;
}

.table td, .table th, .dataTables_wrapper, .dataTables_info, .dataTables_paginate {
    font-size: 12px !important;
}

.sidebar-menu > li > a {
    font-size: 12px !important;
}

.box-title {
    font-size: 14px !important;
}

.select2-container .select2-selection--single {
    height: 30px !important;
    font-size: 12px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px !important;
    font-size: 12px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 28px !important;
}


/* Header Styling */
.main-header {
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.skin-blue-light .main-header .navbar {
    background: linear-gradient(90deg, #9fd9ff 0%, #8fcdf7 100%) !important;
}

.skin-blue-light .main-header .logo {
    background-color: #7ec8f8 !important;
    color: #fff !important;
}

.skin-blue-light .main-header .navbar .sidebar-toggle:hover {
    background-color: rgba(255,255,255,0.15) !important;
}

.main-header .logo {
    font-weight: 700;
    letter-spacing: 1px;
}

/* Sidebar Styling */
.main-sidebar {
    box-shadow: 2px 0 15px rgba(0,0,0,0.05);
    border-right: none !important;
}

.skin-blue-light .main-sidebar {
    background: linear-gradient(180deg, #f9fcff 0%, #eef7ff 100%) !important;
}

.sidebar-menu > li > a {
    border-radius: 0 30px 30px 0;
    margin-right: 15px;
    margin-top: 5px;
    transition: all 0.3s;
    color: #566e86;
    background: transparent;
}

.sidebar-menu > li.active > a, 
.sidebar-menu > li:hover > a {
    background: #eaf7ff !important;
    color: #2f3e4e !important;
    border-left: 4px solid #4facfe;
    box-shadow: none !important;
}

.sidebar-menu > li.active > a > i,
.sidebar-menu > li:hover > a > i {
    color: #2f3e4e !important;
}

.main-footer {
    background: linear-gradient(90deg, #fff1df 0%, #ffe7c7 100%) !important;
    color: #665 !important;
}
.main-footer a {
    color: #3c8dbc !important;
}

/* Buttons - AI Analytics Style */
.btn {
    border-radius: 12px !important;
    box-shadow: none !important;
    transition: all 0.2s;
    text-transform: none !important;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 8px 14px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.btn-primary {
    background: #4b49ac !important; /* Deep Blue/Purple to match login */
    border: none !important;
    color: #fff !important;
}

.btn-primary:hover {
    background: #3f3d91 !important;
}

/* Select2 Styling */
.select2-container .select2-selection--single {
    height: 38px !important;
    border: 1px solid #dddddd !important;
    border-radius: 12px !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important;
    padding-left: 12px !important;
    color: #444 !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
    right: 8px !important;
}
.select2-container--default .select2-selection--single:focus,
.select2-container--default .select2-selection--single:active {
    border-color: #4b49ac !important;
    box-shadow: 0 0 0 4px rgba(75, 73, 172, 0.12) !important;
    outline: none !important;
}
.select2-dropdown {
    border: 1px solid #eee !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08) !important;
    width: auto !important; /* follow the combobox/container width */
}
.select2-results__option {
    padding: 8px 12px !important;
    font-size: 13px !important;
}
.select2-results__option--highlighted {
    background: #f0f2ff !important;
    color: #222 !important;
}
.select2-search__field {
    border-radius: 10px !important;
    border: 1px solid #ddd !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
}
.form-inline .form-group {
    flex: 1 1 220px;
    min-width: 220px;
    margin-bottom: 6px;
}
.form-inline .btn {
    flex: 0 0 auto;
    margin-top: 0;
}
@media (max-width: 768px) {
    .form-inline .form-group {
        flex: 1 1 100%;
        min-width: 100%;
    }
    .form-inline .btn {
        width: 100%;
    }
}
.box .box-body form .form-group {
    margin-bottom: 10px;
}
.control-label {
    font-weight: 600;
    color: #566e86;
    margin-bottom: 6px;
}
select.form-control {
    width: 100% !important;
}
.select2-container {
    width: 100% !important;
    max-width: 100% !important;
}
.input-group .form-control {
    height: 38px;
    border-radius: 12px;
}
.input-group-addon {
    border-radius: 12px 0 0 12px;
    border: 1px solid #ddd;
    background: #f8fafc;
    color: #566e86;
}

.box, .card, .panel {
    position: relative;
}

.modal-content, .modal-body {
    position: relative;
}
.modal .select2-container {
    width: 100% !important;
    max-width: 100% !important;
    z-index: 2050;
}
.modal .select2-dropdown {
    width: auto !important; /* follow the combobox/container width in modal */
}
.btn-success {
    background: #e8f5e9 !important; /* Pale Green Background */
    color: #2e7d32 !important; /* Dark Green Text */
    border: 1px solid #c8e6c9 !important;
}

.btn-success:hover {
    background: #c8e6c9 !important;
}

.btn-warning {
    background: #fff6e8 !important; 
    color: #ef6c00 !important;
    border: 1px solid #ffe3c2 !important;
}

.btn-danger {
    background: #ffebee !important;
    color: #c62828 !important;
    border: 1px solid #ffcdd2 !important;
}

/* Specific override for Login Page button to keep it solid */
.login-page .btn-danger,
.login-page .btn-primary {
    background: linear-gradient(135deg, #039be5 0%, #3c8dbc 60%, #9fd9ff 100%) !important;
    color: #fff !important;
    border: none !important;
}
.login-page .btn,
.login-page button[type="submit"],
.login-page input[type="submit"] {
    background: linear-gradient(135deg, #039be5 0%, #3c8dbc 60%, #9fd9ff 100%) !important;
    color: #fff !important;
    border: none !important;
}
.login-page .btn-danger:hover,
.login-page .btn-primary:hover {
    filter: brightness(1.05);
}
.login-page .btn:hover,
.login-page button[type="submit"]:hover,
.login-page input[type="submit"]:hover {
    filter: brightness(1.05);
}

/* Table Styling */
.table {
    background-color: transparent !important;
}

.table thead th {
    border-bottom: 2px solid #eee !important;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}

.table td {
    vertical-align: middle !important;
    border-top: 1px solid #f4f4f4 !important;
}

/* Modal */
.modal-content {
    border-radius: 15px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3) !important;
    border: none !important;
}

.modal-header {
    border-bottom: 1px solid #eee;
    background-color: #f9fafc;
    border-radius: 15px 15px 0 0;
}

.modal-footer {
    border-top: 1px solid #eee;
    background-color: #f9fafc;
    border-radius: 0 0 15px 15px;
}

/* LOGIN PAGE CUSTOMIZATION - SPLIT SCREEN "TASKY" STYLE */
html, body {
    height: 100%;
}

.login-page {
    background: linear-gradient(135deg, #039be5 0%, #3c8dbc 60%, #9fd9ff 100%) !important;
    
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100vh !important;
    min-height: 100vh !important;
    overflow: hidden !important;
    font-family: 'Poppins', sans-serif !important;
}

/* Override AdminLTE Login Box width - Compact Version */
.login-box {
    width: 420px !important;
    max-width: 92% !important;
    margin: 0 !important;
    background: transparent !important;
}

/* New Split Container - Compact */
.login-container-split {
    display: flex;
    background: #fff;
    border-radius: 16px; /* Slightly tighter radius */
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: 420px; /* Reduced from 500px */
}

/* Left Side: Form */
.login-form-side {
    flex: 1;
    padding: 25px 30px; /* Reduced vertical padding */
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12) !important;
}

.login-header {
    margin-bottom: 15px; /* Reduced margin */
}

.login-logo-small {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b49ac;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
}
.login-logo-small img {
    display: block;
    margin: 0 auto;
}

.login-logo-small img {
    max-height: 70px !important; /* Smaller logo */
}

.login-header h2 {
    font-size: 22px; /* Slightly smaller */
    font-weight: 700;
    color: #333;
    margin: 0 0 5px 0;
}

.login-header p {
    color: #888;
    font-size: 13px;
}

/* Form Styling */
.form-wrapper {
    width: 100%;
}

.login-form-side form dt {
    display: none !important; 
}

.login-form-side form dd {
    margin-bottom: 10px;
}

.login-form-side .form-control {
    height: 48px; /* Taller inputs for modern look */
    border-radius: 12px;
    border: 1px solid #eee; /* Softer border */
    padding: 0 18px;
    font-size: 14px;
    background: #f8f9fa; /* Light grey background */
    transition: all 0.3s;
    color: #444;
}

.login-form-side .form-control:focus {
    background: #fff;
    border-color: #4b49ac;
    box-shadow: 0 4px 12px rgba(75, 73, 172, 0.08);
}

/* Button Styling */
.login-form-side .btn {
    height: 48px; /* Match input height */
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    margin-top: 15px;
    width: 100%;
    letter-spacing: 0.5px;
}

.login-form-side .btn-danger { /* Assuming the form uses btn-danger */
    background: #4b49ac !important; /* Deep Blue/Purple */
    border: none !important;
    box-shadow: 0 10px 20px rgba(75, 73, 172, 0.2);
}

.login-form-side .btn-danger:hover {
    background: #3f3d91 !important;
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(75, 73, 172, 0.3);
}

.login-footer-text {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.login-footer-text a {
    color: #4b49ac;
    font-weight: 600;
    text-decoration: none;
}

/* Right Side: Illustration */
.login-illustration-side {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Deep Purple Gradient */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    position: relative;
    padding: 30px;
    text-align: center;
}

/* Slider Styles */
.illustration-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.slides-container {
    position: relative;
    width: 100%;
    height: 80%; /* Occupy most of the vertical space */
    display: flex;
    justify-content: center;
    align-items: center;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 30px;
}

.slide.active {
    opacity: 1;
    z-index: 2;
    position: relative; /* Ensure it takes up space if needed, but absolute is fine for stacking */
}

/* Ensure absolute positioning works for stacking */
.slide:not(.active) {
    position: absolute;
    visibility: hidden; /* Hide completely when not active to prevent interaction */
}

.slide.active {
    position: relative; /* Make the active one relative to flow correctly if container size depends on it, but here container has height */
    visibility: visible;
}
/* Wait, if I make .slide absolute, they stack. If I make .slide.active relative, it might jump. 
   Better approach: All slides absolute, container has fixed height or flex grow.
   The illustration-content already has layout. 
   Let's stick to absolute for all to ensure perfect overlap.
*/
.slide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
    visibility: hidden;
}

.slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.illustration-content h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
}

.illustration-content p {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.5;
    margin-bottom: 20px;
}

.big-icon {
    font-size: 80px;
    margin-bottom: 20px;
    color: rgba(255,255,255,0.9);
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2));
}

.floating-icon {
    position: absolute;
    color: rgba(255,255,255,0.4);
    animation: float 6s ease-in-out infinite;
}

.icon-1 { top: 20%; left: 10%; font-size: 30px; animation-delay: 0s; }
.icon-2 { top: 15%; right: 15%; font-size: 20px; animation-delay: 2s; }
.icon-3 { bottom: 20%; right: 10%; font-size: 40px; animation-delay: 4s; }

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.slider-dots .dot {
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
}

.slider-dots .dot.active {
    background: #fff;
    width: 20px;
    border-radius: 4px;
}

/* Hide original box shadow/styles */
.premium-login-box {
    box-shadow: none !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.login-box-msg {
    display: none !important;
}

/* Captcha alignment fix for new layout */
.login-form-side dd[id*="captcha"] input[type="text"] {
    width: 100% !important;
    text-align: center;
    letter-spacing: 4px;
    height: 30px !important;
    border-radius: 8px !important;
    border: 1px solid #ddd !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    background: #fff !important;
    transition: all 0.3s;
}
.login-form-side img[src*="captcha"] {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    border-radius: 8px !important;
    border: 1px solid #eee !important;
    margin-bottom: 8px !important;
}
.login-form-side .captcha-wrapper {
    width: 100% !important;
    position: relative !important;
}
.login-form-side form dl {
    width: 100% !important;
}
.login-form-side form dd {
    width: 100% !important;
    display: block !important;
    margin-bottom: 10px !important;
}
.login-form-side .refresh-captcha {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    height: 28px !important;
    width: 28px !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #888;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.toggle-password:hover {
    color: #4b49ac;
}

/* =========================================
   THEME LOGIC (Dark & Light Vuesy Style)
   ========================================= */

/* Theme Variables */
:root {
    --bg-body: linear-gradient(135deg, #e0f7fa 0%, #ffe0b2 100%); /* Soft Blue -> Peach */
    --bg-card: #ffffff;
    --text-main: #5e5873;
    --text-muted: #b9b9c3;
    --border-color: #ebe9f1;
    --shadow-card: 0 4px 24px 0 rgba(34, 41, 47, 0.1);
    --primary-color: #7367f0;
    --sidebar-bg: #ffffff;
    --sidebar-text: #6e6b7b;
    --header-bg: rgba(255,255,255,0.8);
}

/* Dark Mode Variables */
body.theme-dark {
    /* Soft Gradient: Dark Slate -> Soft Teal (More visible, "softer" feel) */
    --bg-body: linear-gradient(135deg, #2c3e50 0%, #3a6073 100%);
    
    --bg-card: #243447; /* Slightly lighter/bluer slate to match new gradient */
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-card: 0 4px 24px 0 rgba(0, 0, 0, 0.3);
    --primary-color: #4ca1af; /* Teal accent to match gradient */
    
    /* Sidebar & Header - Glassy/Translucent to show gradient or match it */
    --sidebar-bg: rgba(36, 52, 71, 0.95);
    --sidebar-text: #e2e8f0;
    --header-bg: rgba(36, 52, 71, 0.95);
}

/* =========================================
   USER PROFILE WIDGET (DARK MODE FIX)
   ========================================= */

/* Base Widget Styling */
.widget-user .widget-user-header {
    border-radius: 12px 12px 0 0 !important;
}

.widget-user .box-footer {
    background-color: transparent !important;
    border-top: none !important;
    padding-top: 10px !important;
}

/* List Items in Profile Card */
.list-group-unbordered > .list-group-item {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 8px 5px !important; /* Slightly tighter padding */
    font-size: 12px !important;   /* Font size reduced to 12px as requested */
    color: var(--text-main) !important;
}

/* Specific Dark Mode overrides for the profile card */
body.theme-dark .widget-user .box-footer {
    background-color: var(--bg-card) !important;
}

body.theme-dark .list-group-unbordered > .list-group-item {
    border-bottom-color: var(--border-color) !important;
    color: var(--text-main) !important;
}

/* Badges in Profile Card */
.list-group-unbordered > .list-group-item > .badge {
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 5px 8px !important;
}

/* Fix "Saldo Lembur" row background in dark mode */
body.theme-dark .list-group-item[style*="background-color: #daf8f6;"] {
    background-color: rgba(76, 161, 175, 0.15) !important; /* Soft Teal tint */
    border: none !important;
    color: #fff !important;
}

/* Badge colors in dark mode */
body.theme-dark .badge.bg-default {
    background-color: #4b5563 !important; /* Dark Gray */
    color: #fff !important;
}
body.theme-dark .badge.bg-red {
    background-color: #ef4444 !important; /* Soft Red */
}
body.theme-dark .badge.bg-green {
    background-color: #10b981 !important; /* Soft Emerald */
}

/* Ensure the widget box itself matches the theme */
body.theme-dark .box-widget {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-card) !important;
}

/* =========================================
   DARK MODE TABLE OVERRIDES (Fix for inline styles)
   ========================================= */
/* Force all table cells to respect dark theme, ignoring inline PHP styles */
body.theme-dark table tr,
body.theme-dark table td,
body.theme-dark table th {
    background-color: transparent !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Re-apply stripe effect safely */
body.theme-dark .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(255,255,255,0.03) !important;
}

/* Specific fix for the "Total Lembur" yellow row */
body.theme-dark tr[style*="#fcffd6"],
body.theme-dark td[style*="#fcffd6"] {
    background-color: rgba(76, 161, 175, 0.1) !important; /* Soft teal tint instead of yellow */
    color: #fff !important;
    font-weight: bold;
}

/* Fix for green/red text in tables (e.g. status) to be readable */
body.theme-dark td[style*="color:#CC0000"],
body.theme-dark td[style*="color:red"] {
    color: #ff6b6b !important; /* Soft Red */
}

/* =========================================
   DATATABLE FULL WIDTH & LAYOUT FIX
   ========================================= */
table.dataTable,
.dataTables_wrapper .table {
    width: 100% !important;
    max-width: 100% !important;
    display: table !important; /* Ensure it behaves like a table, not block/inline */
    clear: both !important;
    margin-bottom: 20px !important;
}

/* Ensure the wrapper itself takes full width */
.dataTables_wrapper {
    width: 100% !important;
    overflow-x: auto !important; /* Allow scroll if table is too wide */
    display: block !important;
}

/* Fix Info and Pagination Alignment (Bottom Row) */
.dataTables_wrapper > .row:last-child {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
    margin-top: 10px !important;
}

.dataTables_wrapper > .row:last-child > div[class*="col-"] {
    width: auto !important;
    flex: 1 !important;
}

/* Align Pagination to the right */
.dataTables_wrapper > .row:last-child > div[class*="col-"]:last-child {
    display: flex !important;
    justify-content: flex-end !important;
}

/* Reset any floating that might break layout */
.dataTables_info,
.dataTables_paginate {
    float: none !important;
    width: auto !important;
    text-align: inherit !important;
}

/* =========================================
   DATATABLE SEARCH FILTER ALIGNMENT
   ========================================= */
/* Force the header row to be a flex container spreading items apart */
.dataTables_wrapper > .row:first-child {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important; /* Reset negative margins if any */
}

/* Ensure the columns inside take available space */
.dataTables_wrapper > .row:first-child > div[class*="col-"] {
    width: auto !important;
    flex: 1 !important;
}

/* Explicitly align the right column (filter) to the end */
.dataTables_wrapper > .row:first-child > div[class*="col-"]:last-child {
    text-align: right !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
}

.dataTables_filter {
    text-align: right !important;
    float: right !important;
    width: auto !important;
    display: inline-block !important;
}

.dataTables_wrapper .dataTables_filter {
    float: right !important;
    text-align: right !important;
}

.dataTables_filter label {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: auto !important;
    font-weight: normal !important;
    margin-bottom: 0 !important;
}

.dataTables_filter input {
    margin-left: 10px !important;
    border-radius: 8px !important;
    border: 1px solid #ddd !important;
    padding: 6px 12px !important;
}

body.theme-dark td[style*="color:#008000"],
body.theme-dark td[style*="color:green"] {
    color: #51cf66 !important; /* Soft Green */
}
body.theme-dark b[style*="color:green"] {
    color: #51cf66 !important;
}
body.theme-dark b[style*="color:red"] {
    color: #ff6b6b !important;
}

/* Global Background */
body, .content-wrapper, .wrapper {
    background: var(--bg-body) !important;
    color: var(--text-main);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Cards / Boxes */
.box, .card, .info-box, .nav-tabs-custom {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-radius: 10px !important;
    box-shadow: var(--shadow-card) !important;
    border: none !important;
    margin-bottom: 2rem !important;
}

/* Header / Title */
.box-header, .card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

.box-title, .card-title, h1, h2, h3, h4, h5, h6 {
    color: var(--text-main) !important;
}

/* Sidebar Overrides */
.main-sidebar, .left-side {
    background-color: var(--sidebar-bg) !important;
    box-shadow: 0 0 15px 0 rgba(34, 41, 47, 0.05);
}

.sidebar-menu > li > a {
    color: var(--sidebar-text) !important;
}
.sidebar-menu > li.active > a {
    background: linear-gradient(118deg, #7367f0, rgba(115, 103, 240, 0.7)) !important;
    color: #fff !important;
    box-shadow: 0 0 10px 1px rgba(115, 103, 240, 0.7);
    border-radius: 4px;
}
.sidebar-menu > li:hover > a {
    color: var(--primary-color) !important;
}

/* Inputs */
.form-control {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
}
.form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 3px 10px 0 rgba(34, 41, 47, 0.1);
}

/* Tables */
.table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td {
    border-top: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}
.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.02) !important; /* Subtle stripe */
}
body.theme-dark .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(255,255,255,0.02) !important;
}

/* Header/Navbar */
.main-header .navbar, .main-header .logo {
    background-color: var(--header-bg) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-bottom: none !important;
}
/* Dark Mode Header Overrides */
body.theme-dark .main-header .navbar {
    background: var(--header-bg) !important;
}

body.theme-dark .main-header .logo {
    background-color: var(--header-bg) !important;
    color: var(--text-main) !important;
    border-right: 1px solid var(--border-color);
}

body.theme-dark .main-header .navbar .sidebar-toggle:hover {
    background-color: rgba(255,255,255,0.05) !important;
}

/* Dark Mode Sidebar Overrides */
body.theme-dark .main-sidebar {
    background: var(--sidebar-bg) !important;
    border-right: 1px solid var(--border-color) !important;
}

body.theme-dark .sidebar-menu > li.header {
    background: var(--sidebar-bg) !important;
    color: var(--text-muted) !important;
}

body.theme-dark .user-panel > .info {
    color: var(--text-main) !important;
}

/* Dark Mode Footer Overrides */
body.theme-dark .main-footer {
    background: var(--bg-card) !important;
    color: var(--text-muted) !important;
    border-top: 1px solid var(--border-color) !important;
}

/* In Dark mode, header text needs to be light */
body.theme-dark .main-header .navbar .nav > li > a, 
body.theme-dark .main-header .logo {
    color: #d0d2d6 !important;
}
body.theme-dark .main-header .logo:hover {
    background-color: var(--header-bg) !important;
}
body.theme-dark .navbar-nav > .user-menu > .dropdown-menu {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color);
}
body.theme-dark .navbar-nav > .user-menu > .dropdown-menu > .user-header {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
}
body.theme-dark .navbar-nav > .user-menu > .dropdown-menu > .user-footer {
    background-color: var(--bg-card) !important;
    border-top: 1px solid var(--border-color);
}

/* Light mode specific fixes */
body:not(.theme-dark) .main-header .navbar {
    background: rgba(255,255,255,0.8) !important;
    backdrop-filter: blur(10px);
}
body:not(.theme-dark) .main-header .navbar .nav > li > a {
    color: #5e5873 !important;
}
body:not(.theme-dark) .main-header .logo {
    background-color: #fff !important;
    color: #333 !important;
}

/* Select2 overrides for dark mode */
body.theme-dark .select2-container--default .select2-selection--single,
body.theme-dark .select2-container--default .select2-selection--multiple {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
}
body.theme-dark .select2-dropdown {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
}
body.theme-dark .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color) !important;
}
body.theme-dark .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-main) !important;
}

.captcha-wrapper {
    position: relative;
    width: fit-content;
    margin-bottom: 10px;
}
.login-form-side .captcha-wrapper {
    margin-bottom: 6px;
}
.login-form-side dd[id*="captcha-element"] {
    margin-bottom: 6px !important;
}
.login-form-side dd[id*="captcha"] {
    margin-top: 6px !important;
}

.login-form-side img[src*="captcha"] {
    width: 100% !important;
    height: 95px !important; /* Smaller fixed height */
    max-width: 100% !important;
    display: block;
    border-radius: 8px;
    border: 1px solid #eee;
}

.refresh-captcha {
    position: absolute;
    right: 5px;
    top: 5px;
    background: rgba(255,255,255,0.9);
    color: #4b49ac;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.refresh-captcha:hover {
    background: #fff;
    transform: rotate(180deg);
    color: #3f3d91;
}

/* Restored Filter Styles */
.filter-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}
.filter-wrapper .form-group {
    flex: 1 1 200px;
    margin-bottom: 0;
}
.select2-container {
    width: 100% !important;
}

/* =========================================
   DARK MODE DASHBOARD WIDGETS & CARDS
   ========================================= */

/* Base Card/Box Styling in Dark Mode */
body.theme-dark .box, 
body.theme-dark .card, 
body.theme-dark .small-box, 
body.theme-dark .info-box,
body.theme-dark .nav-tabs-custom {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    box-shadow: var(--shadow-card) !important;
    border: 1px solid var(--border-color) !important;
}

/* Box Headers - Remove Bright Gradients/Colors in Dark Mode */
body.theme-dark .box-header,
body.theme-dark .card-header {
    background-color: transparent !important;
    background-image: none !important; /* Kill gradients */
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

body.theme-dark .box-header .box-title,
body.theme-dark .card-header .card-title,
body.theme-dark .box-header .header-title {
    color: var(--text-main) !important;
}

/* Specific Override for Colored Header Boxes (e.g. .box-primary, .box-info) */
body.theme-dark .box.box-solid.box-default > .box-header,
body.theme-dark .box.box-solid.box-primary > .box-header,
body.theme-dark .box.box-solid.box-info > .box-header,
body.theme-dark .box.box-solid.box-warning > .box-header,
body.theme-dark .box.box-solid.box-success > .box-header,
body.theme-dark .box.box-solid.box-danger > .box-header {
    background-color: var(--bg-card) !important;
    background-image: none !important;
    color: var(--text-main) !important;
    border-bottom: 1px solid var(--border-color);
}

/* Small Boxes (Stats) - Make them dark but keep accent border or icon */
body.theme-dark .small-box {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
}
body.theme-dark .small-box .icon {
    color: rgba(255,255,255,0.05) !important;
}
body.theme-dark .small-box > .inner {
    color: var(--text-main) !important;
}
body.theme-dark .small-box > .small-box-footer {
    background-color: rgba(0,0,0,0.2) !important;
    color: var(--text-muted) !important;
}

/* Bootstrap Modals in Dark Mode */
body.theme-dark .modal-content {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
}
body.theme-dark .modal-header,
body.theme-dark .modal-footer {
    border-color: var(--border-color) !important;
    background-color: rgba(0,0,0,0.02) !important;
}
body.theme-dark .close {
    color: var(--text-main) !important;
    text-shadow: none !important;
    opacity: 0.8;
}

/* Tabs */
body.theme-dark .nav-tabs-custom > .nav-tabs > li.active > a, 
body.theme-dark .nav-tabs-custom > .nav-tabs > li.active > a:hover {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
    border-bottom-color: transparent !important;
}
body.theme-dark .nav-tabs-custom > .nav-tabs > li > a {
    color: var(--text-muted) !important;
}
body.theme-dark .nav-tabs-custom > .nav-tabs {
    border-bottom-color: var(--border-color) !important;
}

/* Charts / SVG */
body.theme-dark rect {
    fill: var(--bg-card) !important;
}
body.theme-dark text {
    fill: var(--text-muted) !important;
}
body.theme-dark .highcharts-background {
    fill: var(--bg-card) !important;
}
body.theme-dark .highcharts-title,
body.theme-dark .highcharts-subtitle,
body.theme-dark .highcharts-axis-title,
body.theme-dark .highcharts-legend-item text {
    fill: var(--text-main) !important;
    color: var(--text-main) !important;
}
body.theme-dark .highcharts-axis-labels text {
    fill: var(--text-muted) !important;
    color: var(--text-muted) !important;
}

/* Specific fix for the gradient headers in the screenshot if they use inline styles or specific IDs */
/* We target standard header elements and force override */
body.theme-dark [style*="background"], 
body.theme-dark [style*="background-color"] {
    /* Be careful with this, but for boxes it might be necessary if inline styles are used */
}

/* Safe override for known gradient classes if they exist */
body.theme-dark .bg-gradient-blue,
body.theme-dark .bg-gradient-teal,
body.theme-dark .bg-teal-gradient,
body.theme-dark .bg-light-blue-gradient {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
}

/* Dark Mode Login Page Support */
body.theme-dark.login-page,
body.theme-dark .login-page {
    background: var(--bg-body) !important;
}

body.theme-dark .login-container-split {
    background: var(--bg-card) !important;
    box-shadow: 0 0 50px rgba(0,0,0,0.5) !important;
}

body.theme-dark .login-illustration-side {
    background: rgba(255,255,255,0.05) !important; /* Very subtle light overlay on dark gradient */
}

body.theme-dark .login-form-side {
    background: var(--bg-card) !important;
}

body.theme-dark .login-title {
    color: var(--text-main) !important;
}

body.theme-dark .login-subtitle {
    color: var(--text-muted) !important;
}

/* =========================================
   LIGHT MODE REFINEMENTS (Soft Blue/Peach)
   ========================================= */
/* Ensure cards are white and clean in light mode */
body:not(.theme-dark) .box,
body:not(.theme-dark) .card {
    background: #ffffff !important;
    border: 1px solid #e6e6e6 !important;
}
