:root {
    --primary: #16a34a;
    --primary-dark: #15803d;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-bg: #f3f4f6;
    --border: #e5e7eb;
    --danger: #dc2626;
    --white: #ffffff;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--light-bg);
    color: var(--dark);
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }

/* ===== NAVBAR PUBLIK ===== */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.navbar .brand { font-size: 20px; font-weight: 700; color: var(--primary-dark); }
.navbar .brand span { color: var(--dark); }

.navbar .admin-link {
    font-size: 14px;
    color: var(--gray);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 6px;
}
.navbar .admin-link:hover { background: var(--light-bg); }

.cart-link {
    position: relative;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    padding: 6px 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cart-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.cart-badge {
    background: var(--danger);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    margin-left: 4px;
}

/* ===== TOTAL BAYAR BOX (halaman konfirmasi) ===== */
.total-bayar-box .baris-total {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 4px 0;
}
.peringatan-kode-unik {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 6px;
    margin-top: 14px;
    line-height: 1.5;
}

/* ===== PILIHAN METODE PEMBAYARAN (checkout) ===== */
.metode-bayar-pilihan { display: flex; flex-direction: column; gap: 10px; }
.pilihan-bayar {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.pilihan-bayar:hover { border-color: var(--primary); }
.pilihan-bayar input[type="radio"] { margin-top: 4px; }
.pilihan-bayar:has(input:checked) { border-color: var(--primary); background: #f0fdf4; }
.pilihan-bayar strong { display: block; font-size: 14px; margin-bottom: 2px; }
.pilihan-bayar p { font-size: 12px; color: var(--gray); }

/* ===== QRIS DI HALAMAN KONFIRMASI ===== */
.qris-box { text-align: center; }
.qris-box img { width: 220px; height: 220px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; padding: 10px; }

/* ===== BADGE STATUS PESANAN (admin) ===== */
.badge-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-menunggu_pembayaran { background: #fef3c7; color: #92400e; }
.badge-sudah_bayar { background: #dbeafe; color: #1e40af; }
.badge-diproses { background: #e0e7ff; color: #3730a3; }
.badge-selesai { background: #dcfce7; color: #166534; }
.badge-dibatalkan { background: #fee2e2; color: #991b1b; }

/* ===== CAROUSEL BANNER HEADER ===== */
.carousel-header {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--light-bg);
}
.carousel-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.carousel-slide.active { opacity: 1; }
.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
}
.carousel-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.6);
    transition: background 0.2s, width 0.2s;
}
.carousel-dot.active { background: var(--white); width: 18px; }

@media (min-width: 768px) {
    .carousel-header { height: 320px; }
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 48px 24px;
    text-align: center;
}
.hero h1 { font-size: 28px; margin-bottom: 8px; }
.hero p { opacity: 0.9; font-size: 15px; }

/* ===== FILTER BAR ===== */
.filter-bar {
    max-width: 1100px;
    margin: -24px auto 0;
    background: var(--white);
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.filter-bar input, .filter-bar select {
    flex: 1;
    min-width: 160px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}
.filter-bar button {
    padding: 10px 20px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
.filter-bar button:hover { background: var(--primary-dark); }

/* ===== GRID PRODUK ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }

.grid-produk {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.kartu-produk {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
}
.kartu-produk:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }

.kartu-produk .gambar-produk {
    width: 100%;
    height: 160px;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-size: 13px;
    overflow: hidden;
}
.kartu-produk .gambar-produk img { width: 100%; height: 100%; object-fit: cover; }

.kartu-produk .info { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.kartu-produk .kategori-tag {
    font-size: 11px;
    color: var(--primary-dark);
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 6px;
    width: fit-content;
}
.kartu-produk h3 { font-size: 15px; margin-bottom: 6px; }
.kartu-produk .harga { font-weight: 700; color: var(--primary-dark); font-size: 16px; margin-bottom: 4px; }
.kartu-produk .stok { font-size: 12px; color: var(--gray); margin-bottom: 10px; }

.btn-wa {
    margin-top: auto;
    background: #25D366;
    color: var(--white);
    text-align: center;
    padding: 9px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-wa:hover { background: #1ebc59; }

.kosong { text-align: center; padding: 60px 20px; color: var(--gray); }

footer.footer-publik {
    text-align: center;
    padding: 24px;
    color: var(--gray);
    font-size: 13px;
    border-top: 1px solid var(--border);
    background: var(--white);
}

/* ===== NAV BERANDA/NOTIFIKASI/PROFIL (statis, selalu tampil) ===== */
.bottom-nav {
    display: flex;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    margin: 24px auto;
    padding: 6px 8px;
    gap: 4px;
    width: fit-content;
}
.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 18px;
    color: var(--gray);
    font-size: 10px;
    font-weight: 600;
    border-radius: 999px;
    transition: background 0.15s, color 0.15s;
}
.bottom-nav a.active { color: var(--white); background: var(--primary); }
.bn-icon {
    width: 20px;
    height: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bn-icon svg { width: 20px; height: 20px; display: block; }
.bn-dot {
    position: absolute;
    top: -6px;
    right: -9px;
    background: var(--danger);
    color: var(--white);
    font-size: 8px;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 999px;
    line-height: 1.3;
    min-width: 12px;
    text-align: center;
}

/* ===== TABS HALAMAN AKUN PENGGUNA ===== */
.akun-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
}
.akun-tabs a {
    padding: 14px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}
.akun-tabs a.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.akun-tabs a.tab-keluar { color: var(--danger); margin-left: auto; }

/* ===== NOTIFIKASI LIST ===== */
.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-icon { font-size: 22px; flex-shrink: 0; }
.notif-item .notif-judul { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.notif-item .notif-isi { font-size: 13px; color: var(--gray); }
.notif-item .notif-waktu { font-size: 11px; color: #9ca3af; margin-top: 4px; }
.notif-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    margin-bottom: 4px;
}
.notif-tag-status { background: #e0e7ff; color: #3730a3; }
.notif-tag-info { background: #dbeafe; color: #1e40af; }
.notif-tag-promo { background: #fce7f3; color: #9d174d; }

/* ===== KARTU RIWAYAT PESANAN (akun pengguna) ===== */
.pesanan-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
}
.pesanan-card .baris-atas {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.pesanan-card .kode { font-weight: 700; font-size: 14px; }
.pesanan-card .tanggal { font-size: 12px; color: var(--gray); }
.pesanan-card .ringkas-item { font-size: 13px; color: var(--gray); margin-bottom: 8px; }
.pesanan-card .baris-bawah { display: flex; justify-content: space-between; align-items: center; }
.pesanan-card .total { font-weight: 700; color: #15803d; }

/* ===== FAQ / PUSAT BANTUAN ===== */
.faq-item { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item .pertanyaan { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.faq-item .jawaban { font-size: 13px; color: var(--gray); line-height: 1.6; }

/* ===== GRAFIK LAPORAN (admin) ===== */
.chart-container { position: relative; height: 320px; margin-top: 10px; }
.tab-laporan {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.tab-laporan a {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    background: var(--light-bg);
    color: var(--dark);
}
.tab-laporan a.active { background: var(--primary); color: var(--white); }

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

.sidebar {
    width: 230px;
    background: var(--dark);
    color: var(--white);
    padding: 20px 0;
    flex-shrink: 0;
}
.sidebar .brand-admin { padding: 0 20px 20px; font-size: 18px; font-weight: 700; border-bottom: 1px solid #374151; margin-bottom: 12px; }
.sidebar a {
    display: block;
    padding: 12px 20px;
    color: #d1d5db;
    font-size: 14px;
}
.sidebar a:hover, .sidebar a.active { background: #374151; color: var(--white); }

.admin-main { flex: 1; padding: 24px 32px; }

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.admin-topbar h1 { font-size: 22px; }

.card {
    background: var(--white);
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 20px;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.stat-card .angka { font-size: 26px; font-weight: 700; color: var(--primary-dark); }
.stat-card .label { font-size: 13px; color: var(--gray); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; }
table th, table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
table th { background: var(--light-bg); font-weight: 600; }
table img.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-secondary { background: var(--light-bg); color: var(--dark); border: 1px solid var(--border); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}
.form-group textarea { resize: vertical; min-height: 90px; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}
.login-box {
    background: var(--white);
    padding: 36px;
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}
.login-box h2 { text-align: center; margin-bottom: 4px; }
.login-box p.subtitle { text-align: center; color: var(--gray); font-size: 13px; margin-bottom: 20px; }
.login-box button { width: 100%; padding: 11px; margin-top: 6px; }

@media (max-width: 768px) {
    .admin-wrapper { flex-direction: column; }
    .sidebar { width: 100%; }
    .admin-main { padding: 16px; }
}
