:root {
    --nb-bg: #fff8ed;
    --nb-paper: #ffffff;
    --nb-soft: #fff1cf;
    --nb-gold: #f5aa16;
    --nb-gold-dark: #d98c00;
    --nb-brown: #21150d;
    --nb-muted: #77695f;
    --nb-line: #f0dfc8;
    --nb-success: #28a164;
    --nb-danger: #dc3545;
}

* { box-sizing: border-box; }
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top right, rgba(245,170,22,.16), transparent 32%), var(--nb-bg);
    color: var(--nb-brown);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.nb-title, h1, h2, h3, h4 { letter-spacing: -.04em; }

.navbar.nb-navbar {
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(240,223,200,.8);
}
.brand-badge {
    width: 38px; height: 38px; border-radius: 14px;
    display: inline-grid; place-items: center;
    background: linear-gradient(135deg, #f7b21c, #ffcc54);
    color: var(--nb-brown); font-weight: 900;
}
.navbar .nav-link { font-weight: 700; color: var(--nb-brown); border-radius: 999px; padding: .6rem 1rem !important; }
.navbar .nav-link.active, .navbar .nav-link:hover { color: var(--nb-brown); background: var(--nb-soft); }
.cart-link { position: relative; }
.cart-badge {
    position: absolute; top: -5px; right: -4px; min-width: 20px; height: 20px;
    border-radius: 999px; display: grid; place-items: center;
    background: var(--nb-gold); color: var(--nb-brown); font-size: .72rem; font-weight: 900;
}
.btn-warning { background: var(--nb-gold); border-color: var(--nb-gold); color: var(--nb-brown); }
.btn-warning:hover { background: #ffc547; border-color: #ffc547; color: var(--nb-brown); }
.btn-dark { background: var(--nb-brown); border-color: var(--nb-brown); }
.btn-outline-dark { border-color: var(--nb-brown); color: var(--nb-brown); }

.hero-section { padding: 32px 0 24px; overflow: hidden; }
.eyebrow {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .45rem .85rem; border: 1px solid #f4d79d;
    background: #fff5df; color: #9a6400; border-radius: 999px;
    font-size: .9rem; font-weight: 800;
}
.hero-heading { font-size: clamp(2.75rem, 6vw, 5.4rem); line-height: .94; font-weight: 900; }
.hero-copy { color: var(--nb-muted); max-width: 590px; }
.hero-media-wrap { position: relative; }
.hero-media-wrap::before {
    content: ''; position: absolute; inset: -40px -70px auto auto;
    width: 360px; height: 360px; border-radius: 50%; background: var(--nb-gold); z-index: 0;
}
.hero-card {
    position: relative; z-index: 1; overflow: hidden; border-radius: 34px;
    background: white; border: 1px solid #f2dba9; box-shadow: 0 28px 70px rgba(80, 48, 12, .16);
}
.hero-card img { height: 315px; width: 100%; object-fit: cover; }
.hero-card-body { padding: 28px; }
.floating-pill {
    position: absolute; right: 22px; top: 26px; z-index: 2;
    background: var(--nb-gold); border-radius: 999px; padding: .6rem 1rem;
    font-weight: 900; box-shadow: 0 12px 30px rgba(217,140,0,.26);
}
.stat-card, .soft-card, .product-card, .feature-panel, .checkout-card, .auth-card, .admin-card {
    background: rgba(255,255,255,.9); border: 1px solid var(--nb-line); border-radius: 24px;
    box-shadow: 0 18px 44px rgba(60,35,12,.07);
}
.stat-card { padding: 18px; min-width: 150px; }
.stat-card strong { display: block; font-size: 1.35rem; }
.stat-card span { color: var(--nb-muted); font-size: .9rem; }
.secure-note { color: var(--nb-muted); }

.section-space { padding: 72px 0; }
.product-card { overflow: hidden; height: 100%; transition: .25s ease; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 24px 56px rgba(60,35,12,.12); }
.product-card .product-image { width: 100%; height: 220px; object-fit: cover; }
.product-card .product-body { padding: 24px; display: flex; min-height: 210px; flex-direction: column; }
.stock-label { background: #fff3d2; color: #9a6400; border-radius: 999px; padding: .35rem .65rem; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.product-price { font-weight: 900; font-size: 1.35rem; }
.price-tag { font-size: 1.4rem; font-weight: 900; }
.price-tag.big { font-size: 2rem; color: var(--nb-gold-dark); }
.detail-image { width: 100%; border-radius: 34px; aspect-ratio: 1.12/1; object-fit: cover; border: 1px solid var(--nb-line); box-shadow: 0 26px 65px rgba(60,35,12,.13); }
.order-box { border: 1px solid var(--nb-line); background: white; border-radius: 24px; padding: 22px; }
.qty-input { max-width: 110px; }
.feature-panel { padding: 28px; }
.step-card { background: white; border: 1px solid var(--nb-line); border-radius: 20px; padding: 18px; min-height: 155px; }
.step-card span { color: #9a6400; font-weight: 900; }
.step-icon { width: 48px; height: 48px; border-radius: 18px; background: var(--nb-soft); display: grid; place-items: center; font-size: 1.3rem; }

.page-header { padding: 56px 0 28px; background: linear-gradient(180deg, rgba(255,255,255,.7), transparent); }
.search-box { display: flex; gap: 8px; padding: 8px; background: white; border: 1px solid var(--nb-line); border-radius: 999px; box-shadow: 0 15px 35px rgba(60,35,12,.06); }
.search-box input { border: 0; box-shadow: none !important; border-radius: 999px; }
.empty-state { background: white; border: 1px dashed #e4cda7; border-radius: 22px; padding: 34px; text-align: center; color: var(--nb-muted); }

.checkout-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(320px,.85fr); gap: 28px; align-items: start; }
.checkout-card { padding: 24px; }
.cart-item { display: grid; grid-template-columns: 118px minmax(0,1fr) auto; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--nb-line); }
.cart-item:last-child { border-bottom: 0; }
.cart-thumb { width: 118px; height: 86px; border-radius: 18px; object-fit: cover; }
.payment-option {
    border: 1px solid var(--nb-line); border-radius: 18px; padding: 16px;
    background: white; cursor: pointer; transition: .2s ease;
}
.payment-option:hover, .payment-option.active { border-color: var(--nb-gold); background: #fff8ea; }
.payment-icon { width: 46px; height: 46px; border-radius: 16px; background: var(--nb-soft); display: grid; place-items: center; font-size: 1.3rem; }
.summary-row { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 14px; color: var(--nb-muted); }
.summary-row strong { color: var(--nb-brown); }
.total-row { border-top: 1px dashed #dec7a4; padding-top: 18px; }

.status-pill { border-radius: 999px; padding: .42rem .75rem; font-weight: 800; font-size: .82rem; display: inline-flex; align-items: center; gap: .35rem; }
.status-warning { background: #fff1cf; color: #a56800; }
.status-primary { background: #e8f1ff; color: #1c5bbd; }
.status-info { background: #eef2ff; color: #5f3dc4; }
.status-success { background: #dcfce7; color: #177245; }
.status-danger { background: #ffe4e6; color: #b42318; }
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 8px; width: 2px; background: var(--nb-line); }
.timeline-item { position: relative; margin-bottom: 18px; }
.timeline-dot { position: absolute; left: -25px; top: 1px; width: 18px; height: 18px; border-radius: 50%; background: white; border: 3px solid var(--nb-line); }
.timeline-dot.done { background: var(--nb-success); border-color: var(--nb-success); }

.auth-wrap { min-height: 72vh; display: grid; place-items: center; padding: 60px 0; }
.auth-card { width: min(100%, 540px); padding: 34px; }
.admin-shell { display: grid; grid-template-columns: 280px minmax(0,1fr); min-height: 100vh; }
.admin-sidebar { background: var(--nb-brown); color: white; padding: 28px; }
.admin-sidebar a { display: block; padding: 13px 18px; border-radius: 18px; margin: 6px 0; color: rgba(255,255,255,.82); font-weight: 700; }
.admin-sidebar a.active, .admin-sidebar a:hover { background: rgba(255,255,255,.12); color: white; }
.admin-main { padding: 42px; }
.admin-stat { padding: 22px; }
.table > :not(caption) > * > * { padding: 1rem; }

.footer { background: var(--nb-brown); color: white; padding: 56px 0 22px; margin-top: 60px; }
.footer p, .footer a { color: rgba(255,255,255,.72); }
.footer a:hover { color: var(--nb-gold); }
.footer-title { color: white; font-weight: 900; }
.social-dot { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.12); }

@media (max-width: 991.98px) {
    .checkout-grid { grid-template-columns: 1fr; }
    .cart-item { grid-template-columns: 96px minmax(0,1fr); }
    .cart-item .cart-actions { grid-column: 1/-1; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; }
}
@media (max-width: 575.98px) {
    .hero-heading { font-size: 2.7rem; }
    .hero-card img { height: 240px; }
    .cart-item { grid-template-columns: 1fr; }
    .cart-thumb { width: 100%; height: 180px; }
}

/* Revision v2: customer management, profile, reports, and better responsive layout */
.avatar-nav { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.35); }
.avatar-sm { width: 48px; height: 48px; border-radius: 18px; object-fit: cover; border: 1px solid var(--nb-line); }
.avatar-xl { width: 132px; height: 132px; border-radius: 36px; object-fit: cover; border: 4px solid #fff1cf; box-shadow: 0 14px 36px rgba(60,35,12,.14); }
.chart-wrap { position: relative; height: 360px; min-height: 280px; }
.admin-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: rgba(255,255,255,.86); border: 1px solid var(--nb-line); border-radius: 24px; padding: 16px 18px;
    box-shadow: 0 12px 34px rgba(60,35,12,.06);
}
.admin-nav { display: grid; gap: 4px; }
.admin-table { min-width: 760px; }
.form-control:focus, .form-select:focus { border-color: var(--nb-gold); box-shadow: 0 0 0 .22rem rgba(245,170,22,.18); }
.pagination { --bs-pagination-active-bg: var(--nb-gold); --bs-pagination-active-border-color: var(--nb-gold); --bs-pagination-active-color: var(--nb-brown); --bs-pagination-color: var(--nb-brown); }

@media (max-width: 1199.98px) {
    .hero-media-wrap::before { width: 260px; height: 260px; right: -24px; }
    .admin-main { padding: 28px; }
}

@media (max-width: 991.98px) {
    .navbar.nb-navbar .navbar-nav { align-items: stretch !important; gap: .55rem; }
    .navbar.nb-navbar .btn { width: 100%; justify-content: center; }
    .navbar.nb-navbar .dropdown .btn { display: flex; }
    .hero-section { padding-top: 18px; }
    .section-space { padding: 48px 0; }
    .admin-shell { display: block; }
    .admin-sidebar {
        position: sticky; top: 0; z-index: 1030; padding: 16px;
        border-bottom-left-radius: 26px; border-bottom-right-radius: 26px;
    }
    .admin-brand { margin-bottom: 12px !important; }
    .admin-nav {
        display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; overflow-y: hidden; padding-bottom: 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
    }
    .admin-sidebar a { white-space: nowrap; margin: 0; padding: 11px 18px; flex: 0 0 auto; text-align: center; }
    .admin-sidebar form { max-width: none; margin-top: 12px; }
    .admin-main { padding: 22px 16px; }
    .admin-topbar { border-radius: 18px; }
    .chart-wrap { height: 300px; }
}

@media (max-width: 767.98px) {
    .page-header { padding: 38px 0 20px; }
    .display-5, .display-6 { font-size: 2rem; }
    .checkout-card, .admin-card, .auth-card { border-radius: 20px; padding: 18px !important; }
    .stat-card { width: 100%; }
    .search-box { border-radius: 20px; flex-direction: column; }
    .search-box .btn { width: 100%; }
    .admin-topbar { flex-direction: column; align-items: flex-start; }
    .avatar-xl { width: 108px; height: 108px; border-radius: 30px; }
    .footer { padding-top: 38px; }
    .footer .row { row-gap: 28px; }
}

@media (max-width: 575.98px) {
    body { overflow-x: hidden; }
    .container { padding-left: 16px; padding-right: 16px; }
    .hero-heading { font-size: 2.25rem; line-height: 1.02; }
    .hero-copy { font-size: .95rem; }
    .hero-card-body { padding: 20px; }
    .floating-pill { right: 12px; top: 12px; font-size: .78rem; }
    .product-card .product-image { height: 185px; }
    .product-card .product-body { min-height: auto; padding: 18px; }
    .checkout-grid { gap: 18px; }
    .cart-thumb { height: 164px; }
    .payment-option { padding: 14px; }
    .payment-icon { width: 40px; height: 40px; border-radius: 14px; }
    .admin-sidebar { border-radius: 0 0 20px 20px; }
    .admin-sidebar form { max-width: none; }
    .admin-stat h2 { font-size: 1.45rem; }
    .chart-wrap { height: 260px; }
}


/* Revision v3: bukti pembayaran, notifikasi admin, dan penguncian role/session */
.payment-proof-form .form-control[type="file"] { padding: .9rem 1.1rem; }
.admin-notification-box { background: #fff8ea; border-color: #f3d8a0; }
@media (max-width: 575.98px) {
    .payment-proof-form .btn { width: 100%; margin-left: 0 !important; }
}


/* Revision v4: gambar QRIS, update keranjang sekali klik, dan perbaikan responsif HP & tablet */
.qris-image { width: min(320px, 80%); height: auto; border-radius: 18px; border: 1px solid var(--nb-line); box-shadow: 0 14px 36px rgba(60,35,12,.12); margin: 0 auto; }
.qris-box { background: #fff8ea; border: 1px solid var(--nb-line); border-radius: 18px; padding: 18px; }
.cart-note-input { max-width: 250px; }
.qty-input { max-width: 110px; }

@media (max-width: 991.98px) {
    .cart-item { grid-template-columns: 96px minmax(0,1fr); align-items: start; }
    .cart-item .cart-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; text-align: left !important; }
    .cart-item .cart-actions strong { margin-bottom: 0 !important; }
    .cart-bottom-actions { gap: 12px; }
}

@media (max-width: 767.98px) {
    .navbar.nb-navbar { padding-top: .6rem !important; padding-bottom: .6rem !important; }
    .hero-card img { height: 260px; }
    .detail-image { aspect-ratio: 1.25/1; }
    .summary-row { font-size: .95rem; }
    .auth-card { padding: 24px; }
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 575.98px) {
    .cart-item { grid-template-columns: 1fr; gap: 12px; }
    .cart-thumb { width: 100%; height: 180px; }
    .qty-input { max-width: 110px; flex: 0 0 auto; }
    .cart-note-input { max-width: 100%; flex: 1 1 100%; }
    .cart-bottom-actions { flex-direction: column; align-items: stretch !important; }
    .cart-bottom-actions > a, .cart-bottom-actions > .d-flex { width: 100%; }
    .cart-bottom-actions .d-flex .btn, .cart-bottom-actions .d-flex form { flex: 1 1 auto; }
    .cart-bottom-actions .d-flex .btn { width: 100%; }
    .qris-image { width: 86%; }
    .btn { white-space: normal; }
}


/* Revision v5: daftar e-wallet & QRIS foto utuh */
.qris-image { max-height: 480px; object-fit: contain; }
.ewallet-list li { padding: 10px 2px; border-bottom: 1px solid var(--nb-line); font-size: .98rem; }
.ewallet-list li:last-child { border-bottom: 0; }
.ewallet-list strong { color: #b8860b; letter-spacing: .3px; }


/* Revision v6: ganti metode & batal pembayaran */
details.change-method summary { cursor: pointer; color: var(--nb-ink, #21150d); }
details.change-method summary:hover { opacity: .8; }
details.change-method[open] summary { margin-bottom: .75rem; }
.change-method .payment-option { cursor: pointer; }


/* Revision v7: error pages, justify, confirm modal */
.error-page { max-width: 560px; padding: 56px 24px; }
.error-page .error-code { font-size: 110px; font-weight: 900; line-height: 1; color: #f0a500; letter-spacing: 2px; }
#confirmModal .modal-content { padding: 6px; }

/* ===== Toggle show/hide password (#17) ===== */
.nb-password { position: relative; }
.nb-password .form-control { padding-right: 2.8rem; }
.nb-password-toggle {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #8a8f98;
    padding: 0;
    line-height: 1;
    cursor: pointer;
    font-size: 1.1rem;
    z-index: 3;
}
.nb-password-toggle:hover { color: var(--nb-brown, #5b3a1a); }

/* ===== Logo bulat pengganti badge NB (#18) ===== */
img.brand-badge-img {
    background: transparent !important;
    border-radius: 50% !important;
    object-fit: cover;
    padding: 0 !important;
    display: inline-block;
}
