/* Aqualuxe Sales System - Red Gradient Theme */

:root {
    --primary-red: #e53935;
    --dark-red: #b71c1c;
    --dark-bg: #1b1b1b;
    --gradient: linear-gradient(135deg, #e53935, #b71c1c, #1b1b1b);
    --light-red: #ff6b6b;
    --hover-red: #c62828;
    
    /* Light mode colors */
    --bg-color: #f5f5f5;
    --text-color: #333;
    --card-bg: #ffffff;
    --border-color: #ddd;
    --input-bg: #ffffff;
}

/* Dark mode colors */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --card-bg: #2d2d2d;
    --border-color: #404040;
    --input-bg: #3a3a3a;
    --dark-bg: #252525;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode styles */
[data-theme="dark"] body {
    background: var(--bg-color);
    color: var(--text-color);
}

[data-theme="dark"] .card {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .table {
    color: var(--text-color);
}

[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(229, 57, 53, 0.1);
}

[data-theme="dark"] .sidebar {
    background: var(--dark-bg);
}

[data-theme="dark"] .stat-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

/* Global type scale (responsive) */
html {
    font-size: 14px;
}

@media (max-width: 1200px) {
    html { font-size: 13.5px; }
}

@media (max-width: 992px) {
    html { font-size: 13px; }
}

@media (max-width: 576px) {
    html { font-size: 12.5px; }
}
/* Login Page */
.login-page {
    background: var(--gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.6s ease-in;
}

.login-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 48px;
    color: var(--primary-red);
    margin-bottom: 15px;
}

.login-header h2 {
    color: var(--dark-red);
    font-weight: 600;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary-red);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(229, 57, 53, 0.4);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: #999;
}

/* Header */
.header {
    background: var(--gradient);
    color: white;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.header-left a.logo-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: opacity 0.3s;
}

.header-left a.logo-link:hover {
    opacity: 0.8;
}

.header-left a.logo-link h1 {
    cursor: pointer;
    margin: 0;
}

.header-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-header {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-header:hover {
    background: rgba(255,255,255,0.3);
}

/* Mobile Menu Toggle Button - Also visible on desktop to reopen sidebar */
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 18px;
    min-width: 40px;
    min-height: 40px;
}

.mobile-menu-toggle:hover {
    background: rgba(255,255,255,0.3);
}

.mobile-menu-toggle:active {
    background: rgba(255,255,255,0.4);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--dark-bg);
    min-height: calc(100vh - 70px);
    padding: 20px 0;
    position: fixed;
    left: 0;
    top: 70px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    z-index: 999;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Sidebar mini (icon-only) */
body.sidebar-mini .sidebar {
    width: 72px !important;
    overflow: hidden;
}

body.sidebar-mini .main-content {
    margin-left: 72px !important;
}

/* Sidebar completely hidden */
body.sidebar-hidden .sidebar {
    width: 0 !important;
    left: -260px !important;
    opacity: 0;
    pointer-events: none;
}

body.sidebar-hidden .main-content {
    margin-left: 0 !important;
}

/* Override untuk mobile - pastikan sidebar tidak terpengaruh oleh class desktop */
@media (max-width: 768px) {
    body.sidebar-mini .sidebar,
    body.sidebar-hidden .sidebar,
    body.sidebar-collapsed .sidebar {
        width: 280px !important;
        max-width: 85vw !important;
        left: 0 !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    body.sidebar-mini .sidebar.active,
    body.sidebar-hidden .sidebar.active,
    body.sidebar-collapsed .sidebar.active {
        transform: translateX(0) !important;
    }
}

.sidebar-top .btn {
    padding: 6px 8px;
}

body.sidebar-mini .sidebar-menu a {
    padding: 12px 18px;
}

body.sidebar-mini .sidebar-menu a i {
    margin-right: 0;
    width: 100%;
    text-align: center;
    font-size: 18px;
}

body.sidebar-mini .sidebar-menu a {
    position: relative;
}

/* Hide text label but keep for accessibility */
body.sidebar-mini .sidebar-menu a {
    white-space: nowrap;
}

body.sidebar-mini .sidebar-menu a {
    color: #ccc;
}

body.sidebar-mini .sidebar-menu a span,
body.sidebar-mini .sidebar-menu a .menu-text {
    display: none;
}

/* Desktop default: allow .active to also mean hidden (for backward compatibility) */
.sidebar.active {
    transform: translateX(-100%);
    left: -260px;
}

/* Sidebar Header with Close Button */
.sidebar-header {
    display: flex;
    justify-content: flex-end;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-close-btn {
    display: none; /* Hidden by default on mobile */
    background: rgba(229, 57, 53, 0.2);
    border: 1px solid rgba(229, 57, 53, 0.3);
    color: #ccc;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.sidebar-close-btn:hover {
    background: rgba(229, 57, 53, 0.4);
    border-color: var(--primary-red);
    color: white;
    transform: scale(1.1);
}

/* Show close button only on desktop */
@media (min-width: 769px) {
    .sidebar-close-btn {
        display: flex;
    }
}

/* Hide sidebar header on mobile */
@media (max-width: 768px) {
    .sidebar-header {
        display: none;
    }
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin: 5px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}

.sidebar-menu a i + span {
    margin-left: 12px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(229, 57, 53, 0.2);
    color: white;
    border-left-color: var(--primary-red);
}

.sidebar-menu a i {
    margin-right: 12px;
    width: 20px;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 30px;
    animation: fadeIn 0.5s ease-in;
}

/* Collapsed sidebar (desktop) */
body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
    left: -260px; /* force hide off-canvas */
    opacity: 0;
    pointer-events: none;
}

body.sidebar-collapsed .main-content {
    margin-left: 0;
}

/* Also collapse if sidebar gets 'collapsed' class */
.sidebar.collapsed {
    transform: translateX(-100%);
    left: -260px; /* force hide off-canvas */
    opacity: 0;
    pointer-events: none;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    color: var(--dark-red);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.6rem;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(229, 57, 53, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-red);
    margin: 0;
}

.card-title i {
    margin-right: 8px;
    color: var(--primary-red);
}

.card-body {
    padding: 0;
}

.card-body:not(:empty) {
    padding: 22px;
}

.card-body h6 {
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--dark-red);
    line-height: 1.4;
}

.card-body h6 i {
    margin-right: 8px;
    color: var(--primary-red);
}

.card-body .list-unstyled {
    padding-left: 0;
}

.card-body .list-unstyled li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.card-body .list-unstyled li:last-child {
    border-bottom: none;
}

.card.bg-light {
    background: #f8f9fa !important;
    border: 1px solid #e9ecef;
}

.card.bg-light .card-title {
    font-size: 16px;
    color: var(--dark-red);
    margin-bottom: 15px;
}

.card.bg-light .card-body {
    padding: 20px;
}

.card.bg-light ul {
    margin: 0;
    padding-left: 20px;
}

.card.bg-light li {
    margin-bottom: 12px;
    line-height: 1.6;
    padding: 4px 0;
}

.card.bg-light li:last-child {
    margin-bottom: 0;
}

.card.bg-light li strong {
    display: inline-block;
    min-width: 140px;
    margin-right: 8px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-change {
    font-size: 12px;
    margin-top: 8px;
    font-weight: 500;
}

.stat-change i {
    margin-right: 4px;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(229, 57, 53, 0.2);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin-bottom: 15px;
}

.stat-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-red);
    margin-bottom: 6px;
    line-height: 1.2;
}

.stat-change {
    margin-top: 10px;
    line-height: 1.5;
    font-size: 13px;
    padding-top: 4px;
}

.stat-change i {
    margin-right: 4px;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 57, 53, 0.4);
}

.btn-success {
    background: #78101a;
    color: white;
}

.btn-success:hover {
    background: #78101a;
}

.btn-info {
    background: #78101a;
    color: white;
}

.btn-info:hover {
    background: #78101a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(23, 162, 184, 0.4);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

/* Tables */
.table-responsive {
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: visible;
}

.table {
    margin-bottom: 0;
}

.table thead {
    background: var(--primary-red) !important;
    background-color: #e53935 !important;
    color: white !important;
    display: table-header-group !important;
    visibility: visible !important;
}

.table thead th {
    border: none !important;
    padding: 14px 12px;
    font-weight: 600;
    font-size: 0.9rem;
    display: table-cell !important;
    visibility: visible !important;
    color: white !important;
    background: var(--primary-red) !important;
    background-color: #e53935 !important;
    opacity: 1 !important;
}

/* Ensure data-table class also has red header */
.data-table thead,
.data-table thead th {
    background: var(--primary-red) !important;
    background-color: #e53935 !important;
    color: white !important;
}

.table tbody tr {
    transition: all 0.3s;
}

.table tbody tr:hover {
    background: rgba(229, 57, 53, 0.05);
    transform: scale(1.01);
}

.table tbody td {
    padding: 14px 12px;
    vertical-align: middle;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Master Produk - alignments */
#productsTable th,
#productsTable td {
    text-align: center;
    vertical-align: middle;
}

/* Ensure products table headers are always visible */
#productsTable thead {
    display: table-header-group !important;
    visibility: visible !important;
}

#productsTable thead th {
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: white !important;
    background: var(--primary-red) !important;
}

/* Column 3 = Nama Produk aligned left */
/* After removing 'Kode' & 'Berat', Nama Produk is column 2 */
#productsTable th:nth-child(2),
#productsTable td:nth-child(2) {
    text-align: left;
}

/* Master Produk - compact sizing */
.page-produk .card-title {
    font-size: 1rem;
}
.page-produk #productsTable {
    font-size: 0.9rem;
}
.page-produk #productsTable th,
.page-produk #productsTable td {
    padding: 8px 10px;
}
.page-produk .form-control,
.page-produk .form-select {
    font-size: 0.85rem;
    min-height: 32px;
    padding: 6px 8px;
}
.page-produk .btn {
    font-size: 0.85rem;
    padding: 6px 10px;
}
.page-produk .badge {
    font-size: 0.85rem;
    padding: 4px 8px;
}

/* Text spacing utilities */
p {
    margin-bottom: 12px;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin-bottom: 12px;
}

/* Gap utilities for better spacing */
.d-flex.gap-2 {
    gap: 12px !important;
}

.d-flex.gap-2 .btn {
    margin: 0;
}

/* Quick Actions spacing */
.card-body .d-flex.gap-2 {
    margin-top: 12px;
}

.card-body .d-flex.gap-2 .btn {
    padding: 12px 20px;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
    display: block;
    line-height: 1.5;
}

.form-select,
.form-control {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.3s;
    min-height: 42px;
    font-size: 0.9rem;
}

.form-select:focus,
.form-control:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
    outline: none;
}

/* DataTables layout tweaks */
.dataTables_wrapper .row {
    align-items: center;
    gap: 10px;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    float: none !important;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.dataTables_wrapper .dataTables_filter input {
    margin-left: 6px;
}

/* Ensure DataTables header is always visible */
.dataTables_wrapper table thead {
    display: table-header-group !important;
    visibility: visible !important;
}

.dataTables_wrapper table thead th {
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: white !important;
    background: var(--primary-red) !important;
}

@media (max-width: 992px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .dataTables_wrapper .dataTables_filter {
        margin-top: 0;
    }
}
/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #333;
}

.badge-info {
    background: #78101a;
    color: white;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(229, 57, 53, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-red);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   MOBILE RESPONSIVE - TOTAL REDESIGN
   ============================================ */
@media (max-width: 768px) {
    /* ========== HEADER MOBILE ========== */
    .header {
        padding: 10px 12px !important;
        min-height: 56px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    }
    
    .header-content {
        flex-wrap: nowrap !important;
        gap: 8px !important;
    }
    
    .header-left {
        gap: 8px !important;
        flex: 1;
        min-width: 0;
    }
    
    .header-logo {
        height: 32px !important;
        max-width: 120px !important;
    }
    
    .header-left a.logo-link {
        gap: 8px !important;
        flex: 1;
        min-width: 0;
    }
    
    .header-left h1 {
        font-size: 14px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0 !important;
    }
    
    .header-left h1 i {
        font-size: 16px !important;
        margin-right: 6px;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 0 !important;
        font-size: 20px !important;
        flex-shrink: 0;
    }
    
    .header-right {
        gap: 8px !important;
        flex-shrink: 0;
    }
    
    .user-info {
        display: none !important;
    }
    
    .user-info i {
        font-size: 20px;
    }
    
    .btn-header {
        padding: 8px 12px !important;
        font-size: 13px !important;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn-header i {
        margin-right: 0 !important;
    }
    
    /* ========== SIDEBAR MOBILE ========== */
    .sidebar {
        transform: translateX(-100%) !important;
        width: 280px !important;
        max-width: 85vw !important;
        box-shadow: 2px 0 20px rgba(0,0,0,0.6) !important;
        position: fixed !important;
        left: 0 !important;
        top: 56px !important;
        height: calc(100vh - 56px) !important;
        z-index: 1001 !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        will-change: transform;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar.active {
        transform: translateX(0) !important;
        left: 0 !important;
    }
    
    .sidebar-menu {
        padding: 10px 0 !important;
    }
    
    .sidebar-menu li {
        margin: 2px 0 !important;
    }
    
    .sidebar-menu a {
        padding: 14px 20px !important;
        font-size: 15px !important;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .sidebar-menu a i {
        font-size: 18px !important;
        width: 24px !important;
        margin-right: 12px !important;
    }
    
    .sidebar-overlay {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0, 0, 0, 0.6) !important;
        z-index: 1000 !important;
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
        backdrop-filter: blur(2px);
    }
    
    .sidebar-overlay.active {
        display: block !important;
        opacity: 1 !important;
    }
    
    /* ========== MAIN CONTENT MOBILE ========== */
    .main-content {
        margin-left: 0 !important;
        padding: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .page-header {
        margin-bottom: 20px !important;
        padding-bottom: 12px;
        border-bottom: 2px solid #f0f0f0;
    }
    
    .page-header h2 {
        font-size: 20px !important;
        margin-bottom: 8px !important;
    }
    
    .page-header h2 i {
        font-size: 20px !important;
        margin-right: 8px;
    }
    
    .breadcrumb {
        font-size: 12px !important;
        margin: 0 !important;
    }
    
    /* ========== STATS CARDS MOBILE ========== */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        margin-bottom: 20px !important;
    }
    
    .stat-card {
        padding: 18px !important;
        margin-bottom: 0 !important;
        border-radius: 12px !important;
    }
    
    .stat-icon {
        width: 48px !important;
        height: 48px !important;
        font-size: 22px !important;
        margin-bottom: 12px !important;
    }
    
    .stat-label {
        font-size: 13px !important;
        margin-bottom: 8px !important;
        color: #666 !important;
        line-height: 1.4;
    }
    
    .stat-value {
        font-size: 26px !important;
        font-weight: 700 !important;
        line-height: 1.2;
        margin-bottom: 6px;
    }
    
    .stat-change {
        font-size: 11px !important;
        margin-top: 8px !important;
        line-height: 1.5;
        padding-top: 4px;
    }
    
    .stat-change i {
        margin-right: 4px;
    }
    
    /* ========== CARDS MOBILE ========== */
    .card {
        padding: 16px !important;
        margin-bottom: 16px !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    }
    
    .card:hover {
        transform: none !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    }
    
    .card-body:not(:empty) {
        padding: 16px !important;
    }
    
    .card-body h6 {
        margin-bottom: 14px !important;
        line-height: 1.4;
    }
    
    .card-body .list-unstyled li {
        padding: 8px 0 !important;
        margin-bottom: 0;
    }
    
    .card-body .list-unstyled li strong {
        min-width: 120px !important;
        margin-right: 6px;
    }
    
    .card-body .d-flex.gap-2 {
        margin-top: 12px !important;
        gap: 10px !important;
    }
    
    .card-body .d-flex.gap-2 .btn {
        padding: 12px 16px !important;
        font-size: 0.9rem !important;
        line-height: 1.5;
    }
    
    .card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 16px !important;
        margin-bottom: 0 !important;
        padding-bottom: 12px !important;
    }
    
    .card-title {
        font-size: 17px !important;
        font-weight: 600 !important;
        margin: 0 !important;
        width: 100%;
    }
    
    .card-title i {
        font-size: 18px !important;
        margin-right: 8px;
    }
    
    .card-header .btn,
    .card-header .btn-group {
        width: 100% !important;
        margin-top: 0 !important;
    }
    
    /* ========== FORMS MOBILE ========== */
    .form-label {
        font-size: 14px !important;
        font-weight: 500 !important;
        margin-bottom: 8px !important;
        color: #333 !important;
        display: block;
    }
    
    .form-select,
    .form-control {
        min-height: 48px !important;
        font-size: 16px !important; /* Prevent zoom on iOS */
        padding: 12px 16px !important;
        border-radius: 8px !important;
        border: 2px solid #ddd !important;
        width: 100% !important;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .form-select:focus,
    .form-control:focus {
        border-color: var(--primary-red) !important;
        box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1) !important;
        outline: none !important;
    }
    
    /* Form rows stack on mobile */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .row > [class*="col-"] {
        margin-bottom: 16px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .row > [class*="col-"]:last-child {
        margin-bottom: 0 !important;
    }

    /* Make filter forms stack better */
    .row.g-3 {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .row.g-3 > [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        margin-bottom: 12px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Form groups in cards */
    .card .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .card .row > [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Small text in forms */
    .form-text,
    small.text-muted {
        font-size: 12px !important;
        margin-top: 4px !important;
        display: block;
    }
    
    /* ========== BUTTONS MOBILE ========== */
    .btn {
        min-height: 48px !important;
        padding: 12px 20px !important;
        font-size: 15px !important;
        font-weight: 500 !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px;
        transition: all 0.2s !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn:not(.btn-sm):not(.btn-header):not(.flex-fill) {
        width: 100% !important;
        margin-bottom: 12px !important;
    }
    
    .btn:last-child {
        margin-bottom: 0 !important;
    }
    
    .btn i {
        font-size: 16px !important;
    }
    
    .btn-sm {
        min-height: 40px !important;
        padding: 8px 16px !important;
        font-size: 13px !important;
    }
    
    .btn-group {
        flex-direction: column !important;
        width: 100% !important;
        gap: 8px !important;
    }
    
    .btn-group .btn {
        margin-bottom: 0 !important;
        width: 100% !important;
        border-radius: 8px !important;
    }
    
    .btn-group .btn:not(:first-child) {
        margin-top: 0 !important;
    }
    
    .d-flex.gap-2 {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .d-flex.gap-2 .btn {
        width: 100% !important;
        margin: 0 !important;
    }
    
    .d-flex.gap-2.flex-wrap {
        flex-direction: row !important;
    }
    
    .d-flex.gap-2.flex-wrap .btn.flex-fill {
        flex: 1 1 auto;
        min-width: 0;
    }
    
    /* Button hover effects disabled on mobile */
    .btn:hover {
        transform: none !important;
    }
    
    .btn:active {
        transform: scale(0.98) !important;
        opacity: 0.9;
    }
    
    /* Flex utilities for mobile */
    .flex-fill {
        flex: 1 1 auto;
        min-width: 0;
    }
    
    @media (min-width: 768px) {
        .flex-md-grow-0 {
            flex-grow: 0 !important;
        }
    }
    
    /* ========== TABLES MOBILE ========== */
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 8px !important;
        position: relative !important;
        margin: 0 -16px;
        padding: 0 16px;
    }
    
    .table {
        font-size: 13px !important;
        min-width: 600px;
        margin-bottom: 0 !important;
        width: 100%;
    }
    
    .table thead {
        background: var(--primary-red) !important;
        display: table-header-group !important;
        visibility: visible !important;
    }
    
    .table thead th {
        padding: 12px 10px !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        white-space: nowrap;
        position: sticky;
        top: 0;
        z-index: 5;
        color: white !important;
        background: var(--primary-red) !important;
        display: table-cell !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .table tbody td {
        padding: 12px 10px !important;
        font-size: 13px !important;
        white-space: nowrap;
        vertical-align: middle;
    }
    
    .table tbody tr {
        border-bottom: 1px solid #f0f0f0;
    }
    
    .table tbody tr:last-child {
        border-bottom: none;
    }
    
    /* Action buttons in tables */
    .table .btn-sm {
        padding: 6px 12px !important;
        font-size: 12px !important;
        margin: 2px 4px !important;
        min-height: 36px !important;
        min-width: 36px !important;
    }
    
    .table .btn-group .btn-sm {
        margin: 0 !important;
    }
    
    /* Table card headers on mobile */
    .card-header {
        flex-wrap: wrap;
    }
    
    .card-header .btn,
    .card-header .btn-group {
        width: 100% !important;
        margin-top: 8px !important;
    }
    
    .card-header .btn:first-child,
    .card-header .btn-group:first-child {
        margin-top: 0 !important;
    }
    
    /* Badge in tables */
    .table .badge {
        padding: 4px 8px !important;
        font-size: 11px !important;
        border-radius: 4px !important;
    }
    
    /* ========== LOGIN MOBILE ========== */
    .login-page {
        padding: 20px 16px !important;
    }
    
    .login-container {
        max-width: 100% !important;
    }
    
    .login-card {
        padding: 24px 20px !important;
        border-radius: 12px !important;
    }
    
    .login-header i {
        font-size: 48px !important;
    }
    
    .login-header h2 {
        font-size: 22px !important;
    }
    
    .login-header p {
        font-size: 13px !important;
    }
    
    .form-group {
        margin-bottom: 18px !important;
    }
    
    .btn-login {
        min-height: 50px !important;
        font-size: 16px !important;
        margin-top: 8px !important;
    }
    
    /* ========== CHARTS MOBILE ========== */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .row > [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-bottom: 16px !important;
    }
    
    .row > [class*="col-"]:last-child {
        margin-bottom: 0 !important;
    }
    
    .col-md-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* ========== DATATABLES MOBILE ========== */
    .dataTables_wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .dataTables_wrapper .row {
        margin: 0 !important;
    }
    
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        width: 100% !important;
        margin-bottom: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px;
    }
    
    .dataTables_wrapper .dataTables_length label,
    .dataTables_wrapper .dataTables_filter label {
        width: 100% !important;
        margin: 0 !important;
    }
    
    .dataTables_wrapper .dataTables_length select,
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 4px !important;
        min-height: 44px !important;
        font-size: 16px !important;
    }
    
    /* ========== ALERTS MOBILE ========== */
    .alert {
        padding: 12px 16px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
        margin-bottom: 16px !important;
    }
    
    .alert-dismissible .btn-close {
        padding: 12px !important;
    }
    
    /* ========== BADGES MOBILE ========== */
    .badge {
        padding: 6px 10px !important;
        font-size: 12px !important;
        border-radius: 6px !important;
    }
    
    /* ========== UTILITIES MOBILE ========== */
    .mb-4 {
        margin-bottom: 20px !important;
    }
    
    .mb-3 {
        margin-bottom: 16px !important;
    }
    
    .mt-4 {
        margin-top: 20px !important;
    }
    
    .mt-3 {
        margin-top: 16px !important;
    }
    
    /* Hide desktop-only elements */
    .d-none.d-md-block,
    .d-md-inline {
        display: none !important;
    }
    
    /* Show mobile-only elements */
    .d-md-none {
        display: block !important;
    }
}

/* ============================================
   EXTRA SMALL SCREENS (Mobile kecil)
   ============================================ */
@media (max-width: 576px) {
    /* Header lebih compact */
    .header {
        padding: 8px 10px !important;
        min-height: 52px !important;
    }
    
    .header-logo {
        height: 36px !important;
        max-width: 140px !important;
    }
    
    .header-left h1 {
        font-size: 13px !important;
    }
    
    .header-left h1 i {
        font-size: 15px !important;
    }
    
    .mobile-menu-toggle {
        min-width: 40px !important;
        min-height: 40px !important;
        font-size: 18px !important;
    }
    
    .btn-header {
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 6px 10px !important;
    }

    /* Buttons lebih compact */
    .btn {
        padding: 10px 16px !important;
        font-size: 14px !important;
        min-height: 44px !important;
    }
    
    .btn-sm {
        padding: 6px 12px !important;
        font-size: 12px !important;
        min-height: 36px !important;
    }
    
    /* Main content lebih compact */
    .main-content {
        padding: 10px !important;
    }
    
    .page-header {
        margin-bottom: 16px !important;
    }
    
    .page-header h2 {
        font-size: 18px !important;
    }
    
    /* Cards lebih compact */
    .card {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }
    
    .card-body:not(:empty) {
        padding: 12px !important;
    }
    
    .card-header {
        padding: 12px !important;
    }
    
    .card-title {
        font-size: 16px !important;
    }
    
    /* Stats cards lebih compact */
    .stat-card {
        padding: 16px !important;
    }
    
    .stat-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 20px !important;
    }
    
    .stat-value {
        font-size: 24px !important;
    }
    
    .stat-label {
        font-size: 12px !important;
    }
    
    /* Forms lebih compact */
    .form-select,
    .form-control {
        min-height: 44px !important;
        padding: 10px 14px !important;
        font-size: 16px !important;
    }
    
    /* Tables lebih compact */
    .table {
        font-size: 12px !important;
    }
    
    .table thead th {
        padding: 10px 8px !important;
        font-size: 11px !important;
    }
    
    .table tbody td {
        padding: 10px 8px !important;
        font-size: 12px !important;
    }
    
    /* Sidebar lebih kecil */
    .sidebar {
        width: 260px !important;
        max-width: 90vw !important;
    }
    
    .sidebar-menu a {
        padding: 12px 16px !important;
        font-size: 14px !important;
        min-height: 44px;
    }
    
    /* Login lebih compact */
    .login-card {
        padding: 20px 16px !important;
    }
    
    .login-header i {
        font-size: 40px !important;
    }
    
    .login-header h2 {
        font-size: 20px !important;
    }
    
    .btn-login {
        min-height: 48px !important;
    }
}
/* Print Styles */
@media print {
    .sidebar,
    .header,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
