/* 
==========================================================================
    0. ROOT VARIABLES & GLOBAL RESET
========================================================================== 
*/
:root {
    --primary-blue: #00a8ff;
    --success-green: #2ecc71;
    --danger-red: #ef4444;
    --slate-900: #1e293b;
    --slate-500: #64748b;
    --bg-body: #f8fafc;
    --bg-black: #000000;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Poppins', sans-serif; 
    -webkit-font-smoothing: antialiased;
}

body { 
    background: #d7dbdf; 
    color: var(--bg-black); 
    overflow-x: hidden; 
}

/* Dashboard body gets light gray background */
.main-content {
    background: #f1f5f9;
}

/* 
==========================================================================
    1. HALAMAN LOGIN (MODERN GLASSMORPHISM)
========================================================================== 
*/
.main-container { 
    display: flex;
    justify-content: center; 
    align-items: center;     
    height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden; 
}

.bg-full {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
}

.dark-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.65);
    z-index: 2;
}

.glass-form-wrapper {
    position: relative; 
    z-index: 3; 
    width: 90%; 
    max-width: 380px;
    background: rgba(255, 255, 255, 0.1); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px); 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    border-radius: 40px; 
    padding: 45px 35px;
    text-align: center; 
    color: var(--bg-body); 
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.header h1 { 
    font-size: 32px; 
    margin-bottom: 5px; 
    font-weight: 700; 
    letter-spacing: -0.5px;
    color: var(--bg-body); 
}

.header p { 
    font-size: 11px; 
    opacity: 0.6; 
    margin-bottom: 35px; 
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--bg-body); 
}

/* Role Selection */
.select-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--primary-blue);
    margin-bottom: 15px;
}

.role-options { 
    display: flex; 
    gap: 12px; 
    margin-bottom: 25px; 
}

.role-card {
    flex: 1; 
    padding: 18px 10px; 
    background: rgba(255, 255, 255, 0.05); 
    border-radius: 20px; 
    cursor: pointer; 
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.role-card i { display: block; font-size: 22px; margin-bottom: 6px; opacity: 0.5; }
.role-card span { font-size: 11px; font-weight: 600; opacity: 0.5; }

.role-card.active { 
    background: var(--primary-blue); 
    border-color: #38bdf8; 
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4); 
}

.role-card.active i, .role-card.active span { opacity: 1; }

/* Input Elements */
.input-group { margin-bottom: 15px; }

.input-box {
    display: flex; 
    align-items: center; 
    background: rgba(255, 255, 255, 0.08);
    border-radius: 18px; 
    padding: 0 20px; 
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s;
}

.input-box i { color: rgba(255, 255, 255, 0.4); font-size: 16px; }

.input-box input { 
    background: transparent; 
    border: none; 
    padding: 15px; 
    width: 100%; 
    color: var(--bg-body); 
    outline: none; 
    font-size: 14px;
    font-weight: 400;
}

.input-box input::placeholder { color: rgba(255, 255, 255, 0.3); }

.btn-masuk {
    width: 100%;
    padding: 16px;
    background: var(--primary-blue);
    color: var(--bg-body);
    border: none;
    border-radius: 18px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.2);
    margin-top: 10px;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -ms-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
}

.btn-masuk:hover {
    background: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(14, 165, 233, 0.4);
    -webkit-transform: translateY(-2px);
    -moz-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    -o-transform: translateY(-2px);
}

.copyright { 
    font-size: 10px; 
    margin-top: 35px; 
    opacity: 0.4; 
    color: var(--bg-body); 
    letter-spacing: 1px;
}

/* 
==========================================================================
    2. SIDEBAR & LAYOUT STRUCTURE
========================================================================== 
*/
.sidebar {
    width: 260px;
    height: 100vh;
    background: #ffffff;
    color: #1e293b;
    padding: 25px 20px;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    /* Desktop: smooth width transition for collapse */
    transition: width 0.3s ease, padding 0.3s ease, left 0.3s ease;
    overflow: hidden;
}

/* Collapsed state: icon-only */
.sidebar.collapsed {
    width: 70px;
    padding: 25px 12px;
}
.sidebar.collapsed .sidebar-brand-name,
.sidebar.collapsed .sidebar-brand-sub,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .desktop-profile-footer .profile-info,
.sidebar.collapsed .nav-divider {
    display: none;
    opacity: 0;
}
.sidebar.collapsed .sidebar-brand-icon { margin-right: 0; }
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
}
.sidebar.collapsed .nav-link i { margin-right: 0; }
.sidebar.collapsed .desktop-profile-footer {
    justify-content: center;
    padding: 12px 0;
}
.sidebar.collapsed .sidebar-avatar { margin-right: 0; }
.sidebar.collapsed .sidebar-header { justify-content: center; }

.sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar h2 { 
    font-size: 18px; font-weight: 700; color: #1e293b; letter-spacing: 0.5px; margin: 0;
}

/* Brand icon in sidebar header */
.sidebar-brand-icon {
    background: #ef4444;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    margin-right: 12px;
    flex-shrink: 0;
}
.sidebar-brand-name {
    display: block;
    color: #1e293b;
    font-size: 15px;
    margin: 0;
    line-height: 1.2;
}
.sidebar-brand-sub {
    color: #94a3b8;
    font-size: 11px;
    letter-spacing: 0.3px;
}

/* Shared avatar circle */
.sidebar-avatar {
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    margin-right: 12px;
}

/* Mobile profile header block — hidden on desktop */
.mobile-menu-header {
    display: none;
    align-items: center;
    padding: 5px 10px 10px;
}
.mobile-menu-header strong {
    display: block;
    color: #1e293b;
    font-size: 15px;
}
.mobile-menu-header span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-top: 2px;
}
.role-badge {
    display: inline-block !important;
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid #e2e8f0;
    margin-top: 5px;
}
.mobile-menu-header-divider {
    display: none;
    height: 1px;
    background: #e2e8f0;
    margin: 10px 0 15px;
}

/* Desktop profile footer block */
.desktop-profile-footer {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
    margin-bottom: 8px;
}
.desktop-profile-footer strong {
    display: block;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
}
.desktop-profile-footer span {
    display: block;
    color: #64748b;
    font-size: 12px;
}

/* Top bar date and profile */
.top-bar-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}
.top-bar-profile {
    margin-left: 15px;
}
.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1e293b;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

/* Profile info shared */
.profile-info strong { display: block; color: #1e293b; font-size: 14px; font-weight: 600; }
.profile-info span { display: block; color: #64748b; font-size: 12px; }

.nav-link {
    display: flex;
    align-items: center;
    color: #64748b;
    text-decoration: none;
    padding: 11px 16px;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: 0.2s all;
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.nav-link.active { 
    background: #f1f5f9;
    color: #1e293b;
    font-weight: 600;
}

.nav-link i { margin-right: 12px; width: 18px; text-align: center; font-size: 15px; }

.nav-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 12px 0;
}

.nav-link-logout { color: #ef4444 !important; margin-bottom: 5px; }
.nav-link-logout:hover { background: #fef2f2; color: #dc2626 !important; }


.main-content { 
    margin-left: 260px;
    padding: 30px;
    transition: margin-left 0.3s ease, width 0.3s ease;
    width: calc(100% - 260px);
    min-height: 100vh; 
    background: #f1f5f9;
}

/* Desktop collapsed: icon-only sidebar */
.sidebar.collapsed {
    width: 70px;
    padding: 25px 12px;
}
.sidebar.collapsed + .main-content,
.main-content.expanded {
    margin-left: 70px;
    width: calc(100% - 70px);
}

/* Breadcrumb Styles */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--slate-500);
    margin-top: -15px;
    margin-bottom: 25px;
    padding-left: 5px;
}
.breadcrumb a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
}
.breadcrumb a:hover {
    color: #0284c7;
    text-decoration: underline;
}
.breadcrumb i {
    font-size: 10px;
    color: #94a3b8;
}

.top-bar { 
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: #ffffff;
    padding: 14px 24px;
    border-bottom: 1px solid #e2e8f0;
    /* Extend to edges of main-content */
    margin-left: -30px;
    margin-right: -30px;
    margin-top: -30px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.top-bar-left { display: flex; align-items: center; gap: 12px; }
.top-bar-right { display: flex; align-items: center; gap: 12px; }

.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 700; color: #1e293b; font-size: 15px; line-height: 1.2; }
.user-role { color: #94a3b8; font-size: 12px; font-weight: 500; }

#menu-toggle { 
    display: flex; /* Always visible for sidebar toggle */
    background: transparent; color: #64748b; border: none; padding: 7px; 
    font-size: 20px; cursor: pointer; transition: 0.3s; outline: none;
    align-items: center; justify-content: center; border-radius: 8px;
    width: 36px; height: 36px;
}
#menu-toggle:hover { background: #f1f5f9; color: #1e293b; }

/* ── TOPBAR PROFILE DROPDOWN ── */
.topbar-profile-wrap {
    position: relative;
    z-index: 1001; /* Lebih tinggi dari sidebar-overlay (998) */
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1e293b;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    outline: none;
    transition: 0.2s;
    flex-shrink: 0;
}
.topbar-avatar:hover { background: #334155; transform: scale(1.05); }

.topbar-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 10px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    min-width: 220px;
    z-index: 9999;
    overflow: hidden;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.topbar-dropdown.open { display: block; }

.topbar-dropdown-header {
    padding: 18px 20px;
    background: #f8fafc;
}

.dropdown-user-meta strong {
    display: block;
    font-size: 14px;
    color: #1e293b;
    font-weight: 700;
}

.role-text {
    font-size: 11px;
    color: #0ea5e9;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topbar-dropdown-body {
    padding: 8px 0;
}

.topbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #475569;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: 0.2s;
}

.topbar-dropdown-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.topbar-dropdown-item i {
    font-size: 16px;
    color: #94a3b8;
    width: 20px;
    text-align: center;
}

.topbar-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 0;
}

.topbar-dropdown-logout {
    color: #ef4444;
}

.topbar-dropdown-logout:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

.topbar-dropdown-logout i {
    color: #ef4444;
}

/* ── CART TABLE RESPONSIVE ── */
.cart-table {
    width: 100%;
    border-collapse: collapse;
}
.cart-table thead tr {
    text-align: left;
    border-bottom: 2px solid #f1f5f9;
    color: #94a3b8;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.cart-table th { padding: 0 8px 12px; }
.cart-table th:nth-child(2) { text-align: center; }
.cart-table th:nth-child(3) { text-align: right; }
.cart-table td { padding: 12px 8px; vertical-align: middle; }
.cart-table tbody tr { border-bottom: 1px solid #f1f5f9; }
.cart-table td:nth-child(1) { font-weight: 600; color: #1e293b; font-size: 13px; min-width: 0; word-break: break-word; }
.cart-table td:nth-child(2) { text-align: center; font-weight: 600; white-space: nowrap; }
.cart-table td:nth-child(3) { text-align: right; font-weight: 700; color: #0ea5e9; white-space: nowrap; font-size: 13px; }
.cart-table td:nth-child(4) { text-align: center; width: 32px; }
.cart-table .cart-delete { color: #ef4444; font-size: 16px; line-height: 1; }

/* 
==========================================================================
    3. OWNER DASHBOARD & REPORTING
========================================================================== 
*/
.dashboard-wrapper {
    font-family: 'Poppins', sans-serif;
    color: var(--slate-900);
}

.stat-card {
    flex: 1;
    min-width: 250px;
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chart-container {
    margin-top: 30px;
    background: white;
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.badge-update {
    background: #e0f2fe;
    color: #0369a1;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.stats-container {
    display: flex; gap: 20px; margin-bottom: 30px; flex-wrap: wrap;
}

.report-card { 
    background: white; padding: 25px; border-radius: 20px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.02); border: 1px solid #e2e8f0; 
    flex: 0 1 350px; min-width: 280px; min-height: 140px;
    display: flex; flex-direction: column; justify-content: center;
}

.table-responsive { overflow-x: auto; background: white; border-radius: 15px; }

/* 
==========================================================================
    4. PRODUCT MANAGEMENT (EDIT STOK)
========================================================================== 
*/
.edit-body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8fafc;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    color: #64748b !important;
    font-size: 13px;
    font-weight: 600;
    background: white;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
}

.btn-back:hover {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-color: #cbd5e1;
    transform: translateX(-3px);
}

.form-card {
    background: white; 
    padding: 40px; 
    border-radius: 25px; 
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); 
    max-width: 650px; 
    border: 1px solid #e2e8f0; 
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block; 
    margin-bottom: 8px; 
    font-weight: 600; 
    color: #475569;
    font-size: 14px;
}

.form-control {
    width: 100%; 
    padding: 12px 15px; 
    border: 1px solid #e2e8f0; 
    border-radius: 12px; 
    outline: none; 
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    transition: 0.3s;
}

.form-control:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.price-input {
    border: 2px solid #e2e8f0;
    font-weight: 700;
    font-size: 18px;
    color: #0ea5e9;
}

.price-input:focus {
    border-color: #2ecc71;
}

.btn-update {
    width: 100%; 
    padding: 16px; 
    background: #0ea5e9; 
    color: white; 
    border: none; 
    border-radius: 15px; 
    font-weight: 700; 
    font-size: 16px; 
    cursor: pointer; 
    transition: 0.3s; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.3);
    margin-top: 10px;
}

.btn-update:hover {
    background: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(14, 165, 233, 0.4);
}

.grid-inputs {
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px;
}

/* 
==========================================================================
    5. KASIR / POS MODE & TRANSACTION SYSTEM
========================================================================== 
*/
.welcome-section { margin-bottom: 30px; }
.welcome-section h1 { font-size: 28px; color: #1e293b; font-weight: 700; }
.welcome-section p { color: #64748b; font-size: 14px; }

.stats-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 20px; 
    margin-bottom: 30px; 
}

.card-header-flex { display: flex; justify-content: space-between; align-items: center; }
.card-label { font-size: 11px; font-weight: 700; color: var(--slate-500); text-transform: uppercase; letter-spacing: 1px; }
.icon-opacity { opacity: 0.3; font-size: 18px; }
.card-value { font-size: 26px; font-weight: 700; color: #1e293b; margin: 10px 0; }
.unit-text { font-size: 16px; font-weight: 400; color: var(--slate-500); }
.card-subtext { font-size: 11px; color: var(--slate-500);}
.card-green { border-left: 6px solid #2ecc71; }
.card-blue { border-left: 6px solid #0ea5e9; }

/* Hero POS Area */
.hero-pos-container {
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 30px;
    padding: 50px 20px;
    text-align: center;
    margin-top: 20px;
}

.pos-icon-circle {
    width: 70px; height: 70px;
    background: #0ea5e9;
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px auto;
    font-size: 28px;
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.3);
}

.hero-title { color: #1e293b; margin-bottom: 10px; font-weight: 600; }
.hero-desc { color: #64748b; margin-bottom: 30px; max-width: 450px; margin: 0 auto 30px auto; font-size: 14px; }

.btn-pos-start {
    background: #0ea5e9;
    color: white;
    padding: 18px 35px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: 0.3s;
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.2);
}

.btn-pos-start:hover { transform: translateY(-3px); background: #0284c7; }

/* POS Layout & Numpad */
.pos-container { display: flex; gap: 20px; flex-wrap: wrap; }
.cart-section { flex: 1.5; min-width: 350px; }
.payment-section { flex: 1; min-width: 350px; }

.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 15px; }

.num-btn { 
    padding: 20px; background: #f8fafc; border: 1px solid #e2e8f0; 
    border-radius: 12px; font-size: 20px; font-weight: 700; color: #1e293b;
    cursor: pointer; transition: 0.2s;
}

.num-btn:active { background: #00a8ff; color: white; transform: scale(0.95); }
.num-btn.clear { background: #fee2e2; color: #991b1b; }
.num-btn.pay { background: #2ecc71; color: white; grid-column: span 3; margin-top: 10px; padding: 15px; font-size: 18px; }

/* Input Pay & Select2 */
.input-pay-display {
    background: #f0f9ff !important;
    border: 2px solid #0ea5e9 !important;
    border-radius: 18px !important;
    font-size: 32px !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    text-align: right !important;
    padding: 15px 25px !important;
    width: 100%;
}

/* Custom Select2 Styling */
.select2-container--default .select2-selection--single {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    height: 45px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    transition: 0.3s;
}
.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 43px;
    right: 15px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #1e293b;
    font-size: 14px;
    font-weight: 500;
    padding-left: 0;
}
.select2-dropdown {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-top: 4px;
    /* Width is set by jQuery in footer.php via select2:open event */
}
.select2-results__option {
    padding: 10px 15px;
    font-size: 14px;
    color: #475569;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #f1f5f9;
    color: #0ea5e9;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
}
/* 
==========================================================================
    6. RESPONSIVE BREAKPOINTS
    Mobile: < 640px | sm: 640px | md: 768px | lg: 1024px | xl: 1280px | 2xl: 1536px
========================================================================== 
*/

/* ── MOBILE default: < 640px ── */
/* Sidebar is hidden off-screen (left drawer) */
.sidebar {
    left: -300px;
    width: 280px;
    padding: 20px 15px;
    overflow-y: auto;
    /* Override collapsed on mobile — always full-width drawer */
}
.sidebar.active {
    left: 0;
    box-shadow: 10px 0 40px rgba(0,0,0,0.18);
}
/* Collapsed state does nothing on mobile */
.sidebar.collapsed {
    width: 280px;
    left: -300px;
    padding: 20px 15px;
}
.sidebar.collapsed.active {
    left: 0;
}

.main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 15px;
}

.top-bar {
    margin-left: -15px;
    margin-right: -15px;
    margin-top: -15px;
    padding: 12px 15px;
}

.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.45); z-index: 998; display: none;
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

.mobile-menu-header { display: flex; }
.mobile-menu-header-divider { display: block; }
.desktop-profile-footer { display: none !important; }
.mobile-close-btn { display: none !important; } /* close btn tidak dipakai */
.top-bar-date { display: none; }

/* Layout stacks */
.pos-container { flex-direction: column !important; }
.cart-section, .payment-section { min-width: unset !important; width: 100%; }
.stats-container { flex-direction: column !important; }
.stats-grid { grid-template-columns: 1fr; }
.grid-inputs { grid-template-columns: 1fr !important; }

/* Select2 pada mobile: ikuti lebar parent */
.select2-container { max-width: 100% !important; }
.select2-container--default .select2-selection--single { width: 100% !important; }
/* JANGAN override left/width di sini — dihandle jQuery */

/* Table on mobile */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── SM: ≥ 640px (phablet) ── */
@media (min-width: 640px) {
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
    .stats-container { flex-direction: row !important; flex-wrap: wrap; }
    .main-content { padding: 20px; }
    .top-bar {
        margin-left: -20px;
        margin-right: -20px;
        margin-top: -20px;
        padding: 13px 20px;
    }
}

/* ── MD: ≥ 768px (tablet) ── */
@media (min-width: 768px) {
    .pos-container { flex-direction: row !important; flex-wrap: wrap; }
    .cart-section { flex: 1.5; min-width: 320px; }
    .payment-section { flex: 1; min-width: 300px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-inputs { grid-template-columns: 1fr 1fr !important; }
}

/* ── LG: ≥ 1024px (desktop) — sidebar becomes fixed collapsible ── */
@media (min-width: 1024px) {
    /* Reset mobile-only sidebar behavior */
    .sidebar {
        left: 0 !important;
        width: 260px;
        padding: 25px 20px;
        overflow: hidden;
        box-shadow: none;
        transition: width 0.3s ease, padding 0.3s ease;
    }

    /* Collapsed icon-only sidebar on desktop */
    .sidebar.collapsed {
        width: 70px;
        padding: 25px 12px;
        left: 0 !important;
    }
    .sidebar.collapsed .sidebar-brand-name,
    .sidebar.collapsed .sidebar-brand-sub,
    .sidebar.collapsed .nav-link span,
    .sidebar.collapsed .nav-section-title,
    .sidebar.collapsed .desktop-profile-footer .profile-info,
    .sidebar.collapsed .nav-divider { display: none; }
    .sidebar.collapsed .sidebar-brand-icon { margin-right: 0; }
    .sidebar.collapsed .nav-link { justify-content: center; padding: 12px; }
    .sidebar.collapsed .nav-link i { margin-right: 0; }
    .sidebar.collapsed .desktop-profile-footer { justify-content: center; padding: 12px 0; }
    .sidebar.collapsed .sidebar-avatar { margin-right: 0; }
    .sidebar.collapsed .sidebar-header { justify-content: center; }

    /* Main content respects sidebar */
    .main-content {
        margin-left: 260px !important;
        width: calc(100% - 260px) !important;
        padding: 30px;
    }
    .main-content.expanded {
        margin-left: 70px !important;
        width: calc(100% - 70px) !important;
    }

    .top-bar {
        margin-left: -30px;
        margin-right: -30px;
        margin-top: -30px;
        padding: 14px 24px;
    }

    /* Hide mobile-only elements */
    .mobile-menu-header { display: none !important; }
    .mobile-menu-header-divider { display: none !important; }
    .mobile-close-btn { display: none !important; }
    .sidebar-overlay { display: none !important; }

    /* Show desktop profile footer */
    .desktop-profile-footer { display: flex !important; }

    /* Show date in top-bar */
    .top-bar-date { display: flex; }

    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
    .pos-container { flex-wrap: nowrap; }
}

/* ── XL: ≥ 1280px ── */
@media (min-width: 1280px) {
    .main-content { padding: 35px; }
    .top-bar {
        margin-left: -35px;
        margin-right: -35px;
        margin-top: -35px;
        padding: 15px 30px;
    }
}

/* ── 2XL: ≥ 1536px ── */
@media (min-width: 1536px) {
    .sidebar { width: 280px; }
    .main-content {
        margin-left: 280px !important;
        width: calc(100% - 280px) !important;
    }
    .sidebar.collapsed ~ .main-content,
    .main-content.expanded {
        margin-left: 70px !important;
        width: calc(100% - 70px) !important;
    }
}

/* 
==========================================================================
    7. PRINT STYLES
========================================================================== 
*/
@media print {
    header, .sidebar, .no-print, footer, .top-bar, #menu-toggle { display: none !important; }
    body, html { background: white !important; }
    .main-content { margin: 0 !important; padding: 0 !important; width: 100% !important; }
    .report-card { box-shadow: none !important; border: 1px solid #eee !important; page-break-inside: avoid; }
}




