:root {
  --bg: #fff7ec; --card: #ffffff; --ink: #3a2418; --muted: #8a6f5e; --line: #f0dfcc;
  --brand: #c4661f; --brand-d: #a4521a; --brand-l: #fde6cf; --accent: #d9455f;
  --green: #2e8b57; --green-l: #dff3e7; --red: #c0392b; --red-l: #fbe3df; --amber: #b7791f; --amber-l: #fdf0cf;
  --blue: #2b6cb0; --blue-l: #e0ecf9; --gray-l: #ece6df;
  --radius: 16px; --shadow: 0 2px 10px rgba(90, 50, 20, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; font-family: Georgia, "Times New Roman", serif; }
h2 { font-size: 1.35rem; } h3 { font-size: 1.05rem; }
a { color: var(--brand-d); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; } .center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; }
.grow { flex: 1 1 auto; } .mt { margin-top: 1rem; } .mt-s { margin-top: .5rem; } .mb { margin-bottom: 1rem; }

/* tombol */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 0; border-radius: 999px; padding: .65rem 1.2rem; min-height: 44px; font-weight: 600; cursor: pointer; background: var(--brand); color: #fff; text-decoration: none; transition: background .15s, transform .05s; }
.btn:hover { background: var(--brand-d); } .btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--brand-d); box-shadow: inset 0 0 0 2px var(--brand); }
.btn.ghost:hover { background: var(--brand-l); }
.btn.soft { background: var(--brand-l); color: var(--brand-d); }
.btn.danger { background: var(--red); } .btn.green { background: var(--green); }
.btn.sm { padding: .35rem .8rem; min-height: 36px; font-size: .9rem; } .btn.block { display: flex; width: 100%; }
:focus-visible { outline: 3px solid #f4a259; outline-offset: 2px; }

/* form */
label { display: block; font-weight: 600; font-size: .9rem; margin: .8rem 0 .25rem; }
input[type=text], input[type=number], input[type=password], input[type=date], input[type=tel], input[type=email], select, textarea {
  width: 100%; padding: .6rem .8rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; min-height: 44px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(196, 102, 31, .18); }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; margin: .6rem 0; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.hint { font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

/* header buyer */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 247, 236, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1040px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: .6rem; }
.logo { font-family: Georgia, serif; font-weight: 700; font-size: 1.25rem; color: var(--brand-d); text-decoration: none; display: flex; align-items: center; gap: .4rem; }
.nav { margin-left: auto; display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav button, .nav a { background: none; border: 0; padding: .45rem .8rem; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--ink); text-decoration: none; min-height: 40px; }
.nav button:hover, .nav a:hover { background: var(--brand-l); } .nav .on { background: var(--brand-l); color: var(--brand-d); }
.cart-pill { position: relative; }
.cart-pill b { position: absolute; top: -2px; right: -2px; background: var(--accent); color: #fff; font-size: .72rem; min-width: 20px; height: 20px; line-height: 20px; border-radius: 10px; text-align: center; padding: 0 5px; }
main { max-width: 1040px; margin: 0 auto; padding: 1rem 1rem 7rem; }
.hero { background: linear-gradient(135deg, #f6b26b, #e6783a); color: #fff; border-radius: 24px; padding: 1.6rem 1.4rem; margin: .4rem 0 1.4rem; position: relative; overflow: hidden; }
.hero h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); color: #fff; margin-bottom: .3rem; }
.hero p { margin: .2rem 0; max-width: 34rem; opacity: .95; }
.hero .pill { display: inline-block; background: rgba(255, 255, 255, .22); border-radius: 999px; padding: .25rem .8rem; font-size: .88rem; margin-top: .6rem; }
.hero::after { content: "🥐"; position: absolute; right: 1rem; bottom: -.6rem; font-size: 6rem; opacity: .22; }
.sec-title { display: flex; align-items: baseline; gap: .6rem; margin: 1.6rem 0 .7rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card .pic { aspect-ratio: 4/3; background: var(--brand-l); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.card .pic img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.card .name { font-weight: 700; } .card .price { font-weight: 700; color: var(--brand-d); }
.card .desc { color: var(--muted); font-size: .88rem; flex: 1; }
.card.soldout { opacity: .6; }
.card.box { border: 2px dashed var(--brand); background: #fffaf3; }
.card.box .pic { background: linear-gradient(135deg, #fde6cf, #f9c995); }
.tag { display: inline-block; background: var(--brand-l); color: var(--brand-d); border-radius: 999px; font-size: .75rem; font-weight: 700; padding: .1rem .55rem; }

.stepper { display: inline-flex; align-items: center; background: var(--brand-l); border-radius: 999px; }
.stepper button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.3rem; font-weight: 700; color: var(--brand-d); cursor: pointer; border-radius: 50%; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper span { min-width: 2ch; text-align: center; font-weight: 700; }

.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: linear-gradient(0deg, var(--bg) 70%, transparent); }
.cartbar button { max-width: 1040px; margin: 0 auto; display: flex; width: 100%; justify-content: space-between; box-shadow: 0 6px 20px rgba(150, 70, 10, .35); }

/* badge */
.badge { display: inline-block; padding: .12rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.b-blue { background: var(--blue-l); color: var(--blue); } .b-amber { background: var(--amber-l); color: var(--amber); }
.b-green { background: var(--green-l); color: var(--green); } .b-red { background: var(--red-l); color: var(--red); } .b-gray { background: var(--gray-l); color: #6b5b4e; }

/* dialog */
dialog { border: 0; border-radius: 22px; padding: 0; width: min(560px, calc(100vw - 1.4rem)); max-height: calc(100dvh - 1.4rem); background: var(--bg); color: var(--ink); box-shadow: 0 20px 60px rgba(40, 15, 0, .4); overflow: hidden; }
dialog.wide { width: min(860px, calc(100vw - 1.4rem)); }
dialog::backdrop { background: rgba(40, 20, 8, .55); }
dialog[open] { display: flex; flex-direction: column; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: 1rem 1.2rem .6rem; }
.dlg-head h2 { margin: 0; }
.dlg-x { border: 0; background: var(--brand-l); width: 38px; height: 38px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; flex: none; }
.dlg-body { padding: .2rem 1.2rem 1rem; overflow-y: auto; flex: 1 1 auto; }
.dlg-foot { padding: .8rem 1.2rem calc(.9rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fffaf3; }

.panel { background: var(--card); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.line { display: flex; gap: .7rem; align-items: center; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.line:last-child { border-bottom: 0; }
.line .t { flex: 1; min-width: 0; } .line .amt { font-weight: 700; white-space: nowrap; }
.sum > div { display: flex; justify-content: space-between; padding: .15rem 0; }
.sum .total { font-weight: 800; font-size: 1.15rem; border-top: 2px solid var(--ink); margin-top: .4rem; padding-top: .5rem; }
.opt { display: flex; gap: .7rem; align-items: flex-start; border: 2px solid var(--line); border-radius: 14px; padding: .7rem .8rem; margin: .4rem 0; cursor: pointer; background: #fff; font-weight: 500; }
.opt input { margin-top: .25rem; accent-color: var(--brand); width: 18px; height: 18px; }
.opt.sel { border-color: var(--brand); background: #fff6ea; }
.opt b { display: block; }
.paybox { background: #fff; border: 2px dashed var(--brand); border-radius: 14px; padding: .9rem; margin: .6rem 0; }
.paybox .acc { font-size: 1.3rem; font-weight: 800; letter-spacing: .04em; word-break: break-all; }
.paybox img.qr { max-width: 240px; margin: .6rem auto; border-radius: 12px; }
.progress { font-size: .85rem; font-weight: 700; padding: .1rem .6rem; border-radius: 999px; background: var(--amber-l); color: var(--amber); }
.progress.done { background: var(--green-l); color: var(--green); }

/* struk */
.receipt { background: #fff; border-radius: 14px; padding: 1.1rem; font-size: .93rem; border: 1px solid var(--line); }
.r-head { text-align: center; border-bottom: 2px dashed var(--line); padding-bottom: .7rem; margin-bottom: .7rem; }
.r-shop { font-family: Georgia, serif; font-weight: 700; font-size: 1.3rem; }
.r-meta > div { display: flex; justify-content: space-between; gap: 1rem; padding: .12rem 0; } .r-meta > div > span:last-child, .r-meta > div > b { text-align: right; }
.r-items { border-top: 2px dashed var(--line); border-bottom: 2px dashed var(--line); margin: .7rem 0; padding: .4rem 0; }
.r-row { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; } .r-amt { font-weight: 700; white-space: nowrap; }
.r-sum > div { display: flex; justify-content: space-between; padding: .1rem 0; }
.r-total { font-weight: 800; font-size: 1.15rem; border-top: 2px solid var(--ink); margin-top: .3rem; padding-top: .35rem; }
.r-foot { text-align: center; margin-top: .8rem; }

.toast-box, #toasts { position: fixed; left: 50%; bottom: 5.2rem; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: .4rem; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { background: #3a2418; color: #fff; padding: .65rem 1.1rem; border-radius: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); font-weight: 600; transition: opacity .3s; text-align: center; }
.toast.err { background: var(--red); } .toast.ok { background: var(--green); } .toast.out { opacity: 0; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .big { font-size: 3rem; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem 6rem; }
.spinner { text-align: center; padding: 3rem; color: var(--muted); }

/* ===== Dashboard penjual ===== */
body.seller { background: #faf6f1; }
.s-wrap { display: grid; grid-template-columns: 220px 1fr; min-height: 100dvh; }
.s-side { background: #3a2418; color: #fff; padding: 1rem .8rem; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: .2rem; overflow-y: auto; }
.s-side .brand { font-family: Georgia, serif; font-size: 1.2rem; font-weight: 700; padding: .4rem .6rem 1rem; }
.s-side button.tab { background: none; border: 0; color: #f3dcc6; text-align: left; padding: .65rem .8rem; border-radius: 12px; cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.s-side button.tab:hover { background: rgba(255, 255, 255, .1); } .s-side button.tab.on { background: var(--brand); color: #fff; }
.s-side .dot { background: var(--accent); color: #fff; border-radius: 10px; font-size: .72rem; padding: 0 .5rem; min-width: 20px; text-align: center; }
.s-main { padding: 1rem 1.2rem 4rem; min-width: 0; max-width: none; margin: 0; }
.s-top { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.s-top h1 { font-size: 1.5rem; margin: 0; }
.bell { position: relative; background: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; box-shadow: var(--shadow); margin-left: auto; }
.bell b { position: absolute; top: -3px; right: -3px; background: var(--accent); color: #fff; font-size: .72rem; min-width: 20px; height: 20px; line-height: 20px; border-radius: 10px; padding: 0 5px; }
.bell.ring { animation: ring .6s ease 3; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-6deg); } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { background: #fff; border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); }
.stat .k { color: var(--muted); font-size: .85rem; font-weight: 600; } .stat .v { font-size: 1.5rem; font-weight: 800; font-family: Georgia, serif; }
.v.pos { color: var(--green); } .v.neg { color: var(--red); }
.tbl-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #fbf3e8; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; align-items: end; }
.filters > * { flex: 0 1 auto; width: auto; min-width: 0; } .filters input[type=text] { min-width: 190px; }
.filters label { margin: 0; }
.ordcard { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: .8rem; border-left: 6px solid var(--line); }
.ordcard.s-baru { border-left-color: var(--blue); } .ordcard.s-diproses { border-left-color: #e0a526; } .ordcard.s-siap { border-left-color: var(--green); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: .35rem .9rem; font-weight: 600; cursor: pointer; min-height: 38px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; background: #fff; border-radius: var(--radius); padding: .8rem .8rem 1.6rem; box-shadow: var(--shadow); overflow-x: auto; }
.bars .col { flex: 1 0 14px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; align-items: center; gap: 1px; }
.bars .in, .bars .out { width: 100%; max-width: 22px; border-radius: 4px 4px 0 0; min-height: 0; }
.bars .in { background: var(--green); } .bars .out { background: var(--accent); }
.bars .col i { position: absolute; bottom: -1.3rem; font-size: .62rem; font-style: normal; color: var(--muted); }
.legend { display: flex; gap: 1rem; font-size: .85rem; margin: .4rem 0; } .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.notif { padding: .7rem 0; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; gap: .6rem; } .notif.unread { background: #fff6ea; margin: 0 -1.2rem; padding-left: 1.2rem; padding-right: 1.2rem; }
.thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 10px; background: var(--brand-l); flex: none; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.proof { max-height: 320px; margin: .5rem auto; border-radius: 10px; border: 1px solid var(--line); }
.login-box { max-width: 380px; margin: 12vh auto; padding: 0 1rem; }
.s-menu-toggle { display: none; }
@media (max-width: 800px) {
  .s-wrap { grid-template-columns: 1fr; }
  .s-side { position: fixed; z-index: 30; width: 250px; left: 0; top: 0; transform: translateX(-105%); transition: transform .2s; }
  .s-side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
  .s-menu-toggle { display: inline-flex; background: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 1.3rem; box-shadow: var(--shadow); cursor: pointer; align-items: center; justify-content: center; }
  .s-main { padding: .8rem .8rem 4rem; }
}

/* ===== Layar HP ===== */
@media (max-width: 560px) {
  .top-in { flex-wrap: wrap; padding: .5rem .8rem; row-gap: .2rem; }
  .logo { font-size: 1.1rem; white-space: nowrap; }
  .nav { order: 3; width: 100%; margin-left: 0; justify-content: space-between; flex-wrap: nowrap; }
  .nav > * { flex: 1 1 auto; text-align: center; padding: .4rem .5rem; font-size: .92rem; white-space: nowrap; }
  .hero { padding: 1.2rem 1.1rem; border-radius: 20px; } .hero::after { font-size: 4.5rem; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .card .pic { aspect-ratio: 5/4; font-size: 2.4rem; }
  .card .body { padding: .6rem .7rem .8rem; }
  .card .row.between { flex-direction: column; align-items: stretch; gap: .4rem; }
  .card .row.between .btn, .card .stepper { width: 100%; justify-content: space-between; }
  .card .row.between .btn { justify-content: center; }
  .card .price { font-size: .95rem; }
}

@media print {
  body > *:not(dialog[open]) { display: none !important; }
  dialog[open] { position: static; width: 100%; max-height: none; box-shadow: none; background: #fff; display: block; }
  dialog::backdrop { display: none; }
  .no-print, .dlg-head .dlg-x, .dlg-foot { display: none !important; }
  .dlg-body { overflow: visible; padding: 0; } .receipt { border: 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
