:root {
    --primary: #d35400;
    --primary-dark: #a84300;
    --sidebar-bg: #1f2733;
    --sidebar-hover: #2b3648;
    --bg-light: #f4f6f9;
}

* { font-family: 'Poppins', sans-serif; }

body { background: var(--bg-light); }

.app-wrapper { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: #fff;
    flex-shrink: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto; /* Pastikan sidebar bisa di-scroll jika menunya panjang */
    z-index: 1000;
    transition: transform .3s ease;
}
.sidebar-brand {
    padding: 20px;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.avatar {
    width: 38px; height: 38px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.role-badge { font-size: 11px; color: #ffb98a; }
.sidebar-menu { list-style: none; padding: 10px 0; margin: 0; }
.sidebar-menu li a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 20px;
    color: #c7cdd6;
    text-decoration: none;
    font-size: 14.5px;
    transition: .2s;
}
.sidebar-menu li a:hover, .sidebar-menu li a.active {
    background: var(--sidebar-hover);
    color: #fff;
    border-left: 3px solid var(--primary);
}
.sidebar-menu .menu-label {
    padding: 12px 20px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6b7382;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 250px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column; /* Mengatur konten utama secara vertikal */
}
.topbar {
    background: #fff;
    padding: 14px 25px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    position: sticky; top: 0; z-index: 900;
    flex-shrink: 0; /* Mencegah topbar menyusut */
}
.btn-toggle-sidebar {
    border: none;
    background: none;
    font-size: 20px;
}
.content-body { padding: 25px; width: 100%; flex-grow: 1; /* Mengisi sisa ruang */ }

.card { border: none; border-radius: 12px; box-shadow: 0 1px 6px rgba(0,0,0,.06); }
.card-stat { padding: 20px; }
.card-stat .icon-box {
    width: 50px; height: 50px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff;
}
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.text-primary-custom { color: var(--primary); }
.table thead { background: #f8f9fb; }
.badge-stock-low { background: #fdecea; color: #d32f2f; }

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #d35400, #f39c12);
}
.login-card {
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 15px 45px rgba(0,0,0,.2);
    max-width: 420px; width: 100%;
}

/* ===== POS PAGE ===== */
.pos-product-card {
    cursor: pointer; border-radius: 12px; overflow: hidden;
    background: #fff; transition: .15s; border: 1px solid #eee;
}
.pos-product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.pos-product-card.added {
    transform: scale(0.95);
    transition: transform 0.1s ease-in-out;
}
.pos-product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.1); }
.pos-product-img {
    width: 100%;
    height: 120px; /* Anda bisa sesuaikan tinggi gambar ini */
    object-fit: cover; /* Ini kunci agar gambar pas tanpa distorsi */
    background-color: #f0f0f0; /* Warna latar jika gambar gagal dimuat */
}
.pos-cart { background: #fff; border-radius: 12px; height: calc(100vh - 130px); display: flex; flex-direction: column; }
.pos-cart-items { flex: 1; overflow-y: auto; }
.category-pill { border-radius: 20px !important; }

/* ===== STRUK / RECEIPT ===== */
.receipt {
    width: 300px; margin: 20px auto; background: #fff;
    padding: 15px; font-family: 'Courier New', monospace; font-size: 12.5px;
    box-shadow: 0 0 10px rgba(0,0,0,.15);
}
.receipt hr { border-top: 1px dashed #333; }
.receipt table { width: 100%; }
.receipt .text-end { text-align: right; }

@media print {
    body * { visibility: hidden; }
    .receipt, .receipt * { visibility: visible; }
    .receipt { position: absolute; top: 0; left: 0; width: 100%; box-shadow: none; margin: 0; }
    .no-print { display: none !important; }
}

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content {
        margin-left: 0;
        /* Menambahkan overlay saat sidebar terbuka */
        position: relative;
    }
    .sidebar.show ~ .main-content::before {
        content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 999;
    }
    .main-footer { left: 0; }
}

.main-footer {
    /* Menghapus position:fixed dan mengembalikannya ke alur normal */
    flex-shrink: 0; /* Mencegah footer menyusut */
    padding: 10px 25px;
    background-color: transparent;
}
