/* assets/css/dinar.css */
:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #e94560;
    --text: #eaeaea;
    --text-muted: #8892b0;
    --card-bg: rgba(26, 26, 46, 0.85);
    --card-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.1);
    --hover: rgba(255, 255, 255, 0.05);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glow: rgba(233, 69, 96, 0.3);
    --sidebar-width: 260px;
    --header-height: 64px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="black"] {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #e94560;
    --text: #eaeaea;
    --glow: rgba(233, 69, 96, 0.3);
}

[data-theme="green"] {
    --primary: #0d2818;
    --secondary: #1a472a;
    --accent: #00d26a;
    --text: #e8f5e9;
    --glow: rgba(0, 210, 106, 0.3);
}

[data-theme="blue"] {
    --primary: #0a192f;
    --secondary: #112240;
    --accent: #64ffda;
    --text: #ccd6f6;
    --glow: rgba(100, 255, 218, 0.3);
}

[data-theme="ungu"] {
    --primary: #2d132c;
    --secondary: #4a1942;
    --accent: #ee6c4d;
    --text: #f0e6f0;
    --glow: rgba(238, 108, 77, 0.3);
}

[data-theme="biru_muda"] {
    --primary: #1b262c;
    --secondary: #0f4c75;
    --accent: #3282b8;
    --text: #bbe1fa;
    --glow: rgba(50, 130, 184, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    background: var(--primary);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.login-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    top: -20%;
    right: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: -20%;
    left: -10%;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(-30px, -20px) scale(1.02); }
}

.particles {
    position: absolute;
    inset: 0;
}

.particle {
    position: absolute;
    background: var(--text);
    border-radius: 50%;
    opacity: 0.1;
    animation: drift 30s infinite linear;
}

@keyframes drift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(100px, -200px) rotate(360deg); }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: var(--shadow);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.logo-icon {
    width: 56px;
    height: 56px;
    color: var(--accent);
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.logo-text h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text span {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.tagline {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
}

.login-form .form-floating {
    position: relative;
}

.login-form .form-control {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 16px 16px 16px 44px;
    color: var(--text);
    font-size: 15px;
    height: 56px;
    transition: var(--transition);
}

.login-form .form-control:focus {
    background: var(--input-bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--glow);
    outline: none;
}

.login-form .form-control::placeholder {
    color: var(--text-muted);
}

.login-form .form-floating label {
    padding-left: 44px;
    color: var(--text-muted);
}

.login-form .form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 16px 16px 16px 44px;
    pointer-events: none;
    transform-origin: 0 0;
    transition: var(--transition);
}

.login-form .form-floating > .form-control:focus ~ label,
.login-form .form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-0.75rem) translateX(0.15rem);
    color: var(--accent);
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

.password-toggle:hover {
    color: var(--accent);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-options .btn-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px;
    transition: var(--transition);
}

.form-options .btn-link:hover {
    color: var(--accent);
}

.theme-selector .theme-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.btn-login {
    height: 52px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    border: none;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.2));
    opacity: 0;
    transition: var(--transition);
}

.btn-login:hover::before {
    opacity: 1;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--glow);
}

.btn-login .btn-loader {
    display: none;
}

.btn-login.loading .btn-text {
    display: none;
}

.btn-login.loading .btn-loader {
    display: inline-block;
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--card-border);
}

.machine-icon {
    position: relative;
    width: 60px;
    height: 40px;
    margin: 0 auto 12px;
    color: var(--text-muted);
    font-size: 28px;
}

.machine-icon .cog-2 {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 20px;
    animation: rotate 10s linear infinite reverse;
}

.machine-icon i:first-child {
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-footer p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== MAIN LAYOUT ===== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--secondary);
    border-right: 1px solid var(--card-border);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--card-border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
}

.sidebar-logo .logo-text h1 {
    font-size: 18px;
    margin: 0;
    color: var(--text);
}

.sidebar-logo .logo-text span {
    font-size: 10px;
    color: var(--text-muted);
}

.sidebar-menu {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.menu-section {
    margin-bottom: 24px;
}

.menu-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: var(--transition);
    position: relative;
}

.menu-item:hover {
    background: var(--hover);
    color: var(--text);
}

.menu-item.active {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    color: var(--text);
    box-shadow: 0 4px 12px var(--glow);
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--text);
    border-radius: 0 3px 3px 0;
}

.menu-item i {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.menu-item span {
    font-size: 14px;
    font-weight: 500;
}

.menu-badge {
    margin-left: auto;
    background: var(--accent);
    color: var(--text);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--card-border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--input-bg);
    border-radius: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-details h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.user-details span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    height: var(--header-height);
    background: var(--secondary);
    border-bottom: 1px solid var(--card-border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb span {
    color: var(--text);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.header-btn:hover {
    background: var(--hover);
    color: var(--accent);
    border-color: var(--accent);
}

.header-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--accent);
    color: var(--text);
    font-size: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 24px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.card-body {
    padding: 24px;
}

/* Stat Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text);
}

.stat-content h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

.stat-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 4px 0 0;
}

.stat-trend {
    margin-left: auto;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
}

.stat-trend.up {
    background: rgba(0, 210, 106, 0.15);
    color: #00d26a;
}

.stat-trend.down {
    background: rgba(233, 69, 96, 0.15);
    color: #e94560;
}

/* Buttons */
.btn {
    font-family: inherit;
    font-weight: 500;
    border-radius: 10px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    border: none;
    color: var(--text);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--glow);
    background: linear-gradient(135deg, var(--accent), var(--secondary));
}

.btn-secondary {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--hover);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger {
    background: rgba(233, 69, 96, 0.15);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-danger:hover {
    background: var(--accent);
    color: var(--text);
}

/* Form Controls */
.form-control, .form-select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text);
    padding: 10px 14px;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    background: var(--input-bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--glow);
    color: var(--text);
}

.form-label {
    color: var(--text);
    font-weight: 500;
    margin-bottom: 8px;
}

/* DataTables */
.table {
    color: var(--text);
}

.table thead th {
    background: var(--input-bg);
    border-color: var(--card-border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
}

.table tbody td {
    border-color: var(--card-border);
    padding: 14px 16px;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--hover);
}

/* Select2 */
.select2-container--default .select2-selection--single {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    height: 42px;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text);
    padding-left: 14px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 10px;
}

.select2-dropdown {
    background: var(--secondary);
    border: 1px solid var(--card-border);
    border-radius: 10px;
}

.select2-results__option {
    color: var(--text);
    padding: 10px 14px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--hover);
    color: var(--accent);
}

/* Footer */
.footer {
    padding: 16px 24px;
    border-top: 1px solid var(--card-border);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 768px) {
    .login-card {
        padding: 32px 24px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .stat-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   GLOBAL SIZE CONTROLS (Applied to <body>)
   ========================================= */

/* --- 1. TEXT SIZE --- */
body.text-size-xs { font-size: 12px; }
body.text-size-xs h1, body.text-size-xs h2, body.text-size-xs h3 { font-size: 1.5rem; }
body.text-size-xs .page-title { font-size: 20px; }

body.text-size-s { font-size: 14px; }
body.text-size-s h1, body.text-size-s h2, body.text-size-s h3 { font-size: 1.7rem; }
body.text-size-s .page-title { font-size: 22px; }

body.text-size-m { font-size: 15px; } /* Default */
body.text-size-m h1, body.text-size-m h2, body.text-size-m h3 { font-size: 1.9rem; }
body.text-size-m .page-title { font-size: 24px; }

body.text-size-l { font-size: 16px; }
body.text-size-l h1, body.text-size-l h2, body.text-size-l h3 { font-size: 2.1rem; }
body.text-size-l .page-title { font-size: 28px; }

/* --- 2. BUTTON SIZE --- */
/* XS */
body.btn-size-xs .btn { 
    padding: 3px 8px !important; 
    font-size: 11px !important; 
    border-radius: 6px !important;
}
body.btn-size-xs .btn i { font-size: 12px !important; }

/* S */
body.btn-size-s .btn { 
    padding: 5px 12px !important; 
    font-size: 13px !important; 
}
body.btn-size-s .btn i { font-size: 14px !important; }

/* M (Default) */
body.btn-size-m .btn { 
    padding: 8px 16px !important; 
    font-size: 14px !important; 
}
body.btn-size-m .btn i { font-size: 16px !important; }

/* L */
body.btn-size-l .btn { 
    padding: 12px 24px !important; 
    font-size: 16px !important; 
}
body.btn-size-l .btn i { font-size: 20px !important; }

/* --- 3. ICON SIZE --- */
/* XS */
body.icon-size-xs .mdi { font-size: 14px !important; }
body.icon-size-xs .stat-icon { width: 36px !important; height: 36px !important; font-size: 16px !important; }
body.icon-size-xs .header-btn { width: 32px !important; height: 32px !important; }

/* S */
body.icon-size-s .mdi { font-size: 16px !important; }
body.icon-size-s .stat-icon { width: 44px !important; height: 44px !important; font-size: 18px !important; }
body.icon-size-s .header-btn { width: 36px !important; height: 36px !important; }

/* M (Default) */
body.icon-size-m .mdi { font-size: 18px !important; }
body.icon-size-m .stat-icon { width: 52px !important; height: 52px !important; font-size: 24px !important; }

/* L */
body.icon-size-l .mdi { font-size: 22px !important; }
body.icon-size-l .stat-icon { width: 60px !important; height: 60px !important; font-size: 28px !important; }
body.icon-size-l .header-btn { width: 48px !important; height: 48px !important; }

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary);
}

::-webkit-scrollbar-thumb {
    background: var(--input-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Dark Mode Dropdown Fix */
.dropdown-menu {
    background: var(--secondary);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow);
}

.dropdown-item {
    color: var(--text);
    border-radius: 8px;
    padding: 10px 16px;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--hover);
    color: var(--accent);
}

/* SweetAlert2 Dark Theme */
.swal2-popup {
    background: var(--secondary) !important;
    border: 1px solid var(--card-border) !important;
    color: var(--text) !important;
    border-radius: 16px !important;
}

.swal2-title {
    color: var(--text) !important;
}

.swal2-html-container {
    color: var(--text-muted) !important;
}

.swal2-confirm {
    background: var(--accent) !important;
    border: none !important;
    border-radius: 10px !important;
}

.swal2-cancel {
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: var(--text) !important;
    border-radius: 10px !important;
}

/* ===== TOGGLE SIDEBAR (DESKTOP & MOBILE) ===== */

/* Tampilkan tombol burger di semua ukuran layar */
.header .sidebar-toggle {
    display: flex !important; /* Override display:none sebelumnya */
}

/* Desktop Mode: Push Content */
@media (min-width: 1025px) {
    /* Saat sidebar collapsed */
    body.sidebar-collapsed .sidebar {
        left: -260px; /* Sembunyikan ke kiri */
    }

    body.sidebar-collapsed .main-content {
        margin-left: 0; /* Konten penuh */
    }
    
    /* Animasi smooth */
    .sidebar, .main-content {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Mobile Mode: Overlay */
@media (max-width: 1024px) {
    /* Di mobile, tombol burger sudah ada, logika JS yang mengatur */
    /* Pastikan sidebar toggle tetap terlihat */
    .header .sidebar-toggle {
        display: flex !important;
    }
}

/* Icon animation (Opsional: animasi X saat tertutup di mobile) */
.sidebar-toggle.active i {
    transform: rotate(90deg);
}

/* ===== MODAL DARK MODE STYLING ===== */
.modal-content {
    background: var(--secondary);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    color: var(--text);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal-header {
    border-bottom: 1px solid var(--card-border);
    padding: 16px 24px;
}

.modal-title {
    color: var(--text);
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--card-border);
    padding: 16px 24px;
}

.modal .btn-close {
    filter: invert(1) brightness(0.8);
    opacity: 0.7;
}

.modal .btn-close:hover {
    opacity: 1;
}

/* Alert Colors for Dark Theme */
.badge.bg-success {
    background-color: rgba(0, 210, 106, 0.2) !important;
    color: #00d26a !important;
    border: 1px solid rgba(0, 210, 106, 0.3);
}

.badge.bg-secondary {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-muted) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== DATATABLES PROFESSIONAL DARK THEME (FIXED) ===== */

/* 1. Override Bootstrap Table Variables (PENTING) */
.table {
    --bs-table-bg: transparent !important;
    --bs-table-striped-bg: transparent !important;
    --bs-table-hover-bg: var(--hover) !important;
    --bs-table-border-color: var(--card-border) !important;
    color: var(--text);
    border-collapse: collapse !important;
}

/* 2. Wrapper & Container */
.dataTables_wrapper {
    background: transparent !important;
    color: var(--text-muted) !important;
}

/* 3. Table Head Styling */
table.dataTable thead {
    background: var(--secondary) !important;
}

table.dataTable thead th {
    background: transparent !important;
    border-bottom: 2px solid var(--accent) !important;
    color: var(--text) !important;
    font-weight: 600;
}

/* Sorting icons color fix */
table.dataTable thead .sorting::before,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_desc::before,
table.dataTable thead .sorting_asc_disabled::before,
table.dataTable thead .sorting_desc_disabled::before {
    color: var(--accent) !important;
    opacity: 0.6;
}

table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_desc::before {
    opacity: 1;
}

/* 4. Table Body Styling */
table.dataTable tbody tr {
    background: transparent !important;
    transition: var(--transition) !important;
}

/* Fix untuk warna baris ganjil/genap jika diaktifkan */
table.dataTable.stripe tbody tr.odd,
table.dataTable.display tbody tr.odd {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

table.dataTable tbody td {
    border-bottom: 1px solid var(--card-border) !important;
    color: var(--text) !important;
}

/* Hover Effect */
table.dataTable tbody tr:hover {
    background: var(--hover) !important;
}

/* Selected Row */
table.dataTable tbody tr.selected {
    background-color: var(--hover) !important;
    box-shadow: inset 4px 0 0 var(--accent) !important;
}

/* 5. Controls Area (Search, Length, Info) */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info {
    color: var(--text-muted) !important;
}

/* FIX: Dropdown "Show Entries" (Select) */
.dataTables_wrapper .dataTables_length select {
    background-color: var(--secondary) !important; /* Warna background solid sesuai tema */
    border: 1px solid var(--input-border) !important;
    border-radius: 8px !important;
    color: var(--text) !important;
    padding: 6px 30px 6px 12px !important; /* Padding untuk ruang teks dan panah */
    outline: none !important;
    cursor: pointer !important;
    min-width: 60px;
    
    /* Hapus style default browser agar warna background bisa berubah */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Tambahkan custom arrow dengan SVG (Warna abu-abu tema) */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238892b0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 12px 10px !important;
}

/* Hover effect untuk Select */
.dataTables_wrapper .dataTables_length select:hover {
    border-color: var(--accent) !important;
}

/* FIX: Input Search */
.dataTables_wrapper .dataTables_filter input {
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    border-radius: 10px !important;
    color: var(--text) !important;
    outline: none !important;
    padding: 8px 14px !important;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--glow) !important;
}

/* 6. Pagination Styling */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    border-radius: 8px !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
    margin: 0 2px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--secondary) !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, var(--accent), var(--secondary)) !important;
    border-color: transparent !important;
    color: var(--text) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    background: transparent !important;
    color: var(--text-muted) !important;
    opacity: 0.3;
    border-color: transparent !important;
}

/* 7. Processing Indicator (Dinamis mengikuti tema) */
.dataTables_wrapper .dataTables_processing {
    background: var(--secondary) !important; /* Menggunakan variabel tema */
    color: var(--accent) !important;
    border: 1px solid var(--card-border) !important;
    box-shadow: var(--shadow) !important;
    border-radius: 12px !important;
}

/* 8. Empty Row */
table.dataTable tbody tr td.dataTables_empty {
    background: var(--input-bg) !important;
    color: var(--text-muted) !important;
    border-radius: 8px !important;
}

/* ============================================= */
/* FIX: VISIBILITY TEXT DI MODAL & TABEL (DARK MODE) */
/* ============================================= */

/* 1. Perbaiki class .text-muted (abu-abu) agar terlihat di dark mode */
.text-muted {
    color: var(--text-muted) !important;
}

/* 2. Pastikan warna placeholder input mengikuti tema */
.form-control::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.7;
}

/* 3. Override variabel warna tabel Bootstrap 5 */
.table {
    --bs-table-color: var(--text);         /* Warna teks utama */
    --bs-table-bg: transparent;            /* Background transparan */
    --bs-table-border-color: var(--card-border);
}

/* 4. Pastikan thead di dalam modal terlihat jelas */
.modal-content .table thead th {
    color: var(--text) !important;
    border-bottom-width: 2px;
}

/* 5. Fix warna border input group di dalam modal */
.modal-content .input-group .form-control {
    border-color: var(--input-border);
}

/* ============================================= */
/* FIX: SELECT2 DROPDOWN THEME SUPPORT (ALL 5 THEMES) */
/* ============================================= */

/* 1. Background Utama Dropdown */
.select2-container--default .select2-dropdown {
    background-color: var(--secondary) !important;
    border: 1px solid var(--card-border) !important;
    border-radius: 0 0 10px 10px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* 2. Jika ada input pencarian di dalam dropdown */
.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: var(--text) !important;
    border-radius: 6px !important;
    margin: 5px;
    width: calc(100% - 12px) !important; /* Adjust margin */
}

/* 3. Warna Teks pada Opsi List */
.select2-container--default .select2-results__option {
    color: var(--text) !important;
    background-color: transparent !important;
    padding: 10px 14px;
    transition: var(--transition);
}

/* 4. Efek Hover (Saat mouse diarahkan) */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--hover) !important;
    color: var(--accent) !important;
}

/* 5. Warna Opsi yang Sudah Dipilih */
.select2-container--default .select2-results__option--selected {
    background-color: var(--input-bg) !important;
    border-left: 3px solid var(--accent);
    color: var(--text) !important;
    font-weight: 600;
}

/* 6. Teks Placeholder di Input Select */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text) !important;
}

/* 7. Tanda Panah Bawah (Arrow) */
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-muted) transparent transparent transparent !important;
}

/* 8. Fix Z-Index agar tidak tertutup modal (kadang dibutuhkan) */
.select2-container--open {
    z-index: 9999 !important;
}