:root {
  --ink: #16212b;
  --ink-2: #4a5866;
  --line: #e2e6ea;
  --bg: #f5f6f4;
  --card: #ffffff;
  --brand: #0f4c5c;
  --brand-2: #0b3a47;
  --accent: #e3a33b;
  --ok: #2f7d4f;
  --err: #b4442f;
  --info: #2c5d8a;
  --ppn: #0f4c5c;
  --nonppn: #7a4a12;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 33, 43, .06), 0 4px 14px rgba(16, 33, 43, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: .2em 0 .6em; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 1.2em 0 .6em; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 22px; padding-bottom: 48px; min-height: 60vh; }
.muted { color: var(--ink-2); }
.small { font-size: .86rem; }
.right { text-align: right; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; color: var(--ink-2); }
.warn { color: var(--err); font-size: .86rem; }
.strike { text-decoration: line-through; }

/* Header */
.top { background: var(--brand-2); color: #fff; position: sticky; top: 0; z-index: 10; }
.top-row { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--brand-2); display: grid; place-items: center; font-weight: 800; }
.search { flex: 1; }
.search input { width: 100%; max-width: 520px; height: 38px; border-radius: 8px; border: 0; padding: 0 14px; font-size: .95rem; }
.top-nav { display: flex; align-items: center; gap: 14px; }
.nav-link { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 6px; }
.cart-link { position: relative; color: #fff; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: rgba(255,255,255,.08); }
.cart-n { position: absolute; top: -4px; right: -4px; background: var(--accent); color: var(--brand-2); font-size: .72rem; font-weight: 700; border-radius: 99px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-2); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: rgba(15, 76, 92, .07); }
.btn-sm { height: 34px; padding: 0 12px; font-size: .88rem; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-danger { background: var(--err); border-color: var(--err); }
.link-btn { background: none; border: 0; color: var(--err); cursor: pointer; font: inherit; font-size: .86rem; padding: 0; }

/* Flash */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border-left: 4px solid; background: #fff; box-shadow: var(--shadow); }
.flash-ok { border-color: var(--ok); }
.flash-err { border-color: var(--err); }
.flash-info { border-color: var(--info); }

/* Pills, seller badges, status */
.pill { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }
.pill-grp { background: var(--accent); color: var(--brand-2); }
.seller { display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .02em; padding: 2px 8px; border-radius: 6px; }
.seller-ppn { background: rgba(15, 76, 92, .1); color: var(--ppn); }
.seller-nonppn { background: rgba(122, 74, 18, .1); color: var(--nonppn); }
.status { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: #eef1f3; color: var(--ink-2); }
.st-so_dibuat, .st-baru { background: #fff4df; color: #8a5a0b; }
.st-lunas { background: #e3f3e8; color: var(--ok); }
.st-selesai { background: #e5eef6; color: var(--info); }
.st-batal { background: #f8e6e2; color: var(--err); }

/* Catalog */
.catalog { display: grid; grid-template-columns: 210px 1fr; gap: 28px; }
.filters { position: sticky; top: 84px; align-self: start; }
.filters-title { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin: 0 0 8px; }
.filters-title:not(:first-child) { margin-top: 22px; }
.filter { display: block; padding: 6px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: .92rem; }
.filter:hover { background: #e9ece9; }
.filter.on { background: var(--brand); color: #fff; }
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.list-head h1 { margin-bottom: .3em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-top: 10px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card-img { aspect-ratio: 4/3; background: #eef0ec; display: grid; place-items: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.noimg { font-size: 1.6rem; font-weight: 800; color: #b9c2bd; letter-spacing: .05em; }
.noimg.big { font-size: 3.5rem; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-name { color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.card-name:hover { color: var(--brand); }
.card-foot { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 8px; margin-top: auto; padding-top: 6px; }
.price { color: var(--ink); font-size: 1.05rem; }
.price.big { font-size: 1.8rem; }
.stock { font-size: .8rem; color: var(--ok); }
.stock.out, .stock-line.out { color: var(--err); }
.pager { display: flex; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pager a { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: #fff; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.pager a.on { background: var(--brand); color: #fff; }

/* Product */
.crumbs { font-size: .88rem; margin-bottom: 12px; color: var(--ink-2); }
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 36px; background: #fff; padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.product-img { background: #eef0ec; border-radius: 8px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: contain; }
.product-info h1 { margin-top: 10px; }
.price-box { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 14px 0 6px; }
.add-form { display: flex; gap: 12px; align-items: flex-end; margin: 14px 0; flex-wrap: wrap; }
.qty-label { display: flex; flex-direction: column; font-size: .82rem; color: var(--ink-2); }
.qty-label input, input.qty { width: 90px; height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; }
.desc { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; white-space: normal; }

/* Panels & tables */
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; }
.tbl th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tfoot td { border-bottom: 0; padding: 6px 10px; }
.tbl tfoot .grand td { font-weight: 700; font-size: 1.05rem; border-top: 2px solid var(--ink); }
.cart-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 6px 0 16px; flex-wrap: wrap; }
.cart-total { display: flex; flex-direction: column; align-items: flex-end; }
.cart-total strong { font-size: 1.5rem; }

/* Forms */
.form label { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; color: var(--ink-2); margin-bottom: 12px; }
.form input:not([type=checkbox]):not([type=file]), .form textarea, .form select {
  font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fff; width: 100%;
}
.form input:focus, .form textarea:focus, .form select:focus, .search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: .92rem; }
.form.narrow { max-width: 560px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reseller-box { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 14px 4px; margin: 6px 0 14px; }
.reseller-box legend { font-size: .82rem; font-weight: 700; padding: 0 6px; }
.auth { max-width: 420px; margin: 20px auto; }
.auth.wide { max-width: 640px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.summary .sum-group { border-bottom: 1px solid var(--line); padding: 10px 0; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: .92rem; padding: 3px 0; }
.sum-row.sub { font-weight: 600; }
.sum-row.total { font-weight: 700; font-size: 1.1rem; padding-top: 12px; }

/* Done & invoice */
.done { text-align: center; max-width: 640px; margin: 10px auto 20px; }
.done-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 1.8rem; margin: 0 auto 10px; }
.inv-no { font-family: ui-monospace, Consolas, monospace; font-weight: 700; margin-top: 4px; }
.banks { display: grid; gap: 6px; padding: 10px 12px; background: #f7f8f6; border-radius: 8px; margin-bottom: 12px; }
.bank-name { font-weight: 700; }
.bank-no { font-family: ui-monospace, Consolas, monospace; font-size: 1.02rem; font-weight: 700; letter-spacing: .03em; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-actions form { margin: 0; }
.empty { text-align: center; padding: 48px 16px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }

.print-body { background: #e9ebe8; }
.invoice { max-width: 820px; margin: 24px auto; background: #fff; padding: 36px 40px; box-shadow: var(--shadow); border-radius: 6px; }
.inv-tools { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.inv-head { display: flex; justify-content: space-between; gap: 24px; border-bottom: 2px solid var(--ink); padding-bottom: 16px; }
.inv-seller { font-size: 1.25rem; font-weight: 800; }
.inv-title { font-size: 1.5rem; font-weight: 800; letter-spacing: .12em; color: var(--brand); }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 18px 0; font-size: .92rem; }
.lbl { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin-bottom: 4px; }
.inv-tbl { margin: 8px 0 18px; font-size: .92rem; }
.inv-pay { background: #f7f8f6; padding: 14px 16px; border-radius: 6px; margin-bottom: 16px; }
.inv-pay .bank { margin: 4px 0; }

/* Footer */
.foot { background: #e9ebe8; border-top: 1px solid var(--line); padding: 22px 0; font-size: .88rem; color: var(--ink-2); }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* Admin */
.admin-body { background: #f1f3f2; }
.admin-top { background: #1d2a33; }
.admin-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.admin-nav a { color: #cfd8dd; text-decoration: none; padding: 8px 12px; border-radius: 6px; font-size: .92rem; }
.admin-nav a.on, .admin-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 6px 12px; border-radius: 99px; background: #fff; text-decoration: none; color: var(--ink); font-size: .88rem; box-shadow: var(--shadow); }
.tabs a.on { background: var(--brand); color: #fff; }
.tabs .n { opacity: .7; margin-left: 4px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; font-size: .92rem; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }
.log { font-size: .84rem; list-style: none; padding: 0; margin: 0; }
.log li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form input, .inline-form select { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; }
.err-box { background: #f8e6e2; color: var(--err); padding: 8px 12px; border-radius: 8px; font-size: .86rem; margin: 8px 0; }
.thumb { width: 44px; height: 44px; object-fit: contain; background: #eef0ec; border-radius: 6px; }
.sync-ok { color: var(--ok); font-weight: 600; }
.sync-error { color: var(--err); font-weight: 600; }
pre.raw { background: #1d2a33; color: #d9e4ea; padding: 12px; border-radius: 8px; overflow: auto; font-size: .8rem; max-height: 360px; }

@media (max-width: 860px) {
  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; flex-wrap: nowrap; }
  .filters-title { display: none; }
  .filter { white-space: nowrap; background: #fff; box-shadow: var(--shadow); }
  .product, .two-col, .inv-parties { grid-template-columns: 1fr; }
  .product { padding: 16px; gap: 18px; }
  .brand-text { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cols-2 { grid-template-columns: 1fr; }
  .invoice { padding: 20px; margin: 0; border-radius: 0; }
  .tbl.resp thead, .main .tbl:not(.inv-tbl) thead { display: none; }
  .main .tbl:not(.inv-tbl) tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .main .tbl:not(.inv-tbl) td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 6px; text-align: right; }
  .main .tbl:not(.inv-tbl) td[data-l]::before { content: attr(data-l); color: var(--ink-2); font-size: .8rem; text-align: left; }
  .main .tbl:not(.inv-tbl) td:first-child { text-align: left; }
}

@media print {
  .no-print { display: none !important; }
  .print-body { background: #fff; }
  .invoice { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  a { color: inherit; text-decoration: none; }
}

/* Penyesuaian */
.card-img, .card-img:hover { text-decoration: none; }
.inv-no .status { font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; margin-left: 6px; vertical-align: 1px; }
.cart-tbl { table-layout: fixed; }
.cart-tbl th:first-child { width: 44%; }
.cart-tbl th:last-child { width: 70px; }
@media (max-width: 860px) { .cart-tbl { table-layout: auto; } }
@media (max-width: 520px) {
  .card-body { padding: 10px; }
  .card-foot { flex-direction: column; align-items: flex-start; gap: 2px; }
  .card .btn { height: auto; min-height: 34px; padding: 6px 8px; font-size: .8rem; line-height: 1.2; }
  .card .price { font-size: .98rem; }
  .card .seller { font-size: .68rem; }
  .card-name { font-size: .9rem; }
}

/* Label koleksi */
.card-img { position: relative; }
.card-img .badges { position: absolute; top: 8px; left: 8px; }
.badges { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; }
.product-info .badges { margin-left: 6px; }
.badge { font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 5px; color: #fff; }
.badge-promo { background: #c2412d; }
.badge-new { background: #2c6e9e; }
.badge-hot { background: #e3a33b; color: #3a2606; }
.filters .n { font-size: .78rem; opacity: .6; margin-left: 2px; }
.filter-promo:not(.on) { color: #c2412d; font-weight: 600; }
.filter-new:not(.on) { color: #2c6e9e; font-weight: 600; }
.filter-hot:not(.on) { color: #9a6410; font-weight: 600; }
.feature { margin-bottom: 30px; padding-bottom: 6px; }
.feature .grid { margin-top: 4px; }
.feature-title { font-size: 1.25rem; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.feature-title::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--brand); }
.feature-promo .feature-title::before { background: #c2412d; }
.feature-new .feature-title::before { background: #2c6e9e; }
.feature-hot .feature-title::before { background: #e3a33b; }
.feature .list-head a { font-size: .9rem; text-decoration: none; font-weight: 600; }
.label-cell { white-space: nowrap; }
.label-cell .badge { display: inline-block; margin: 1px 0; }
