:root {
    --coklat-tua: #1e1712;
    --coklat: #2b2118;
    --emas: #c9a35f;
    --emas-terang: #d9bd85;
    --coklat-tombol: #6b4226;
    --bg-content: #f6f4f1;
    --teks-muted: #8a8a8a;
}

body {
    background: var(--bg-content);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ===== LOGIN ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-content);
}

.login-card {
    display: flex;
    max-width: 850px;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,.12);
}

.login-brand {
    background: linear-gradient(160deg, var(--coklat-tua), var(--coklat));
    color: #fff;
    flex: 1;
    padding: 48px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.login-brand h1 {
    color: var(--emas);
    letter-spacing: 2px;
    font-size: 1.5rem;
    margin-top: 12px;
}

.login-form-side {
    flex: 1;
    background: #fff;
    padding: 48px 40px;
}

.btn-emas {
    background: var(--coklat-tombol);
    color: #fff;
    border: none;
    font-weight: 600;
}

.btn-emas:hover {
    background: #52301b;
    color: #fff;
}

/* ===== SIDEBAR ===== */
.sidebar {
    background: var(--coklat-tua);
    min-height: 100vh;
    color: #d8d3cb;
    width: 240px;
    flex-shrink: 0;
}

.sidebar .brand {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar .brand h5 {
    color: var(--emas);
    margin: 0;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar .nav-link {
    color: #c9c3b8;
    padding: 12px 20px;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .93rem;
}

.sidebar .nav-link:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}

.sidebar .nav-link.active {
    background: var(--coklat-tombol);
    color: #fff;
    border-left: 3px solid var(--emas);
}

/* ===== LAYOUT ===== */
.app-shell {
    display: flex;
}

.main-content {
    flex: 1;
    min-width: 0; /* agar tabel lebar tidak membuat halaman bergeser di HP */
    min-height: 100vh;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-body {
    padding: 28px;
}

/* ===== CARDS / STAT ===== */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #222;
}

.stat-card .stat-label {
    color: var(--teks-muted);
    font-size: .85rem;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.card-panel {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

/* ===== TABLE ===== */
.table-app thead th {
    background: #faf9f7;
    font-size: .8rem;
    text-transform: uppercase;
    color: var(--teks-muted);
    font-weight: 600;
    border-bottom: 2px solid #eee;
}

.table-app td, .table-app th {
    vertical-align: middle;
    padding: 12px 14px;
}

/* ===== POS / TRANSAKSI ===== */
.pos-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 18px;
}

.produk-item {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    cursor: pointer;
    transition: transform .12s;
}

.produk-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

.produk-icon-box {
    background: var(--coklat-tua);
    color: var(--emas);
    border-radius: 8px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.keranjang-box {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.keranjang-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-control button {
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    line-height: 1;
}

.badge-kategori {
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: .85rem;
    color: #555;
    cursor: pointer;
}

.badge-kategori.active {
    background: var(--coklat-tombol);
    color: #fff;
    border-color: var(--coklat-tombol);
}

/* ===== METODE PEMBAYARAN ===== */
.metode-bayar-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.metode-bayar-btn {
    border: 1.5px solid #ddd;
    border-radius: 10px;
    padding: 10px 4px;
    text-align: center;
    cursor: pointer;
    font-size: .78rem;
    color: #555;
    transition: .15s;
}

.metode-bayar-btn i {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 3px;
    color: #888;
}

.metode-bayar-btn:hover {
    border-color: var(--emas);
}

.metode-bayar-btn.active {
    border-color: var(--coklat-tombol);
    background: #fbf6ee;
    color: var(--coklat-tombol);
    font-weight: 600;
}

.metode-bayar-btn.active i {
    color: var(--coklat-tombol);
}

/* ===== FOTO PROFIL & PRODUK ===== */
.profile-photo {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--emas);
}

.topbar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.topbar-profile:hover .fw-semibold {
    color: var(--coklat-tombol);
}

.produk-foto {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.produk-thumb-tabel {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
}

.produk-thumb-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    background: var(--coklat-tua);
    color: var(--emas);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* ===== RESPONSIVE ===== */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 999;
}

.sidebar-backdrop.show {
    display: block;
}

@media (max-width: 900px) {
    .pos-grid { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }
    .sidebar.show { transform: translateX(0); }
    .content-body { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .login-card { flex-direction: column; margin: 16px; }
    .login-brand { padding: 32px 24px; }
    .login-form-side { padding: 32px 24px; }
}

@media (max-width: 480px) {
    .stat-card { padding: 14px; }
    .stat-value { font-size: 1.15rem; }
    .stat-icon { width: 36px; height: 36px; font-size: 1rem; }
    .content-body { padding: 12px; }
    .card-panel { padding: 14px; }
    .keranjang-box { padding: 12px; }
}

img { max-width: 100%; }

/* Tab navigasi laporan */
.laporan-tabs .nav-link {
    color: #6b5444;
    font-weight: 600;
    border-radius: 8px;
}
.laporan-tabs .nav-link.active {
    background: var(--coklat-tombol);
    color: #fff;
}

/* ===== NOTIFIKASI POP-UP (SweetAlert2) ===== */
.swal2-container { z-index: 2000; }

.it-dialog {
    border-radius: 18px !important;
    padding: 1.6rem 1.4rem 1.4rem !important;
    font-family: 'Segoe UI', system-ui, sans-serif;
    border-top: 5px solid var(--emas);
}
.it-dialog .swal2-title { color: var(--coklat-tua); font-size: 1.35rem; }
.it-dialog .swal2-html-container { font-size: .95rem; color: #555; }
.it-dialog .btn { border-radius: 10px; font-weight: 600; }

.it-toast {
    border-radius: 14px !important;
    border-left: 5px solid #2ea86a;
    box-shadow: 0 10px 30px rgba(30, 23, 18, .18) !important;
    padding: .8rem 1rem !important;
}
.it-toast.swal2-icon-error { border-left-color: #d64545; }
.it-toast.swal2-icon-info { border-left-color: var(--emas); }
.it-toast .swal2-title { font-size: .95rem !important; color: var(--coklat-tua); margin-bottom: 0 !important; }
.it-toast .swal2-html-container { font-size: .85rem !important; margin: .15rem 0 0 !important; color: #666; }
.it-toast .swal2-timer-progress-bar { background: var(--emas); }

/* pop-up stok menipis */
.it-icon-stok {
    border-color: var(--emas) !important;
    color: var(--coklat-tombol) !important;
    font-size: 1.6rem;
    animation: it-goyang 1.2s ease-in-out 2;
}
.it-dialog-stok { width: 30rem !important; }
.it-stok-list { list-style: none; padding: 0; margin: 0; max-height: 280px; overflow-y: auto; }
.it-stok-item {
    background: #faf7f2;
    border: 1px solid #efe6d6;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: .9rem;
}
.it-stok-bar { height: 5px; background: #ece4d6; border-radius: 10px; margin-top: 8px; overflow: hidden; }
.it-stok-bar span { display: block; height: 100%; background: linear-gradient(90deg, #f0ad4e, #e8842c); border-radius: 10px; }
.it-stok-bar span.habis { background: #d64545; }

@keyframes it-goyang {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-12deg); }
    40% { transform: rotate(10deg); }
    60% { transform: rotate(-6deg); }
    80% { transform: rotate(4deg); }
}

/* ===== LONCENG NOTIFIKASI ===== */
.notif-bell {
    position: relative;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #f6f4f1;
    color: var(--coklat-tombol);
    font-size: 1.15rem;
    border: none;
}
.notif-bell:hover, .notif-bell.show { background: #efe6d6; color: var(--coklat-tombol); }
.notif-bell.ada i { animation: it-goyang 1.4s ease-in-out 3; transform-origin: top center; }
.notif-badge {
    position: absolute; top: 2px; right: 0;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px;
    background: #d64545; color: #fff;
    font-size: .68rem; font-weight: 700; line-height: 18px;
    border: 2px solid #fff;
}
.notif-bell.ada .notif-badge::after {
    content: ''; position: absolute; inset: -2px; border-radius: 9px;
    border: 2px solid #d64545; animation: it-denyut 1.8s ease-out infinite;
}
@keyframes it-denyut { from { transform: scale(1); opacity: .8; } to { transform: scale(1.8); opacity: 0; } }

.notif-menu { width: 330px; border: none; border-radius: 14px; overflow: hidden; }
.notif-head { background: linear-gradient(135deg, var(--coklat-tua), var(--coklat-tombol)); color: #fff; padding: 14px 16px; }
.notif-body { max-height: 320px; overflow-y: auto; }
.notif-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #f2eee8; font-size: .88rem; }
.notif-item:hover { background: #faf7f2; }
.notif-ikon {
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    background: #fff4e0; color: #e8842c;
}
.notif-ikon.habis { background: #fde8e8; color: #d64545; }
.notif-foot { padding: 10px 16px; background: #fcfbf9; }
.min-w-0 { min-width: 0; }

@media (max-width: 576px) {
    .notif-menu { width: calc(100vw - 24px); }
}
.it-toast.swal2-icon-warning { border-left-color: #f0ad4e; }
