:root {
  --bg: #fffdf8;
  --surface: #ffffff;
  --alt: #f5f1e8;
  --text: #1f2a24;
  --muted: #5f6b63;
  --border: #e4ded1;
  --primary: #2f6b47;
  --primary-hover: #245638;
  --accent: #d9822b;
  --danger: #b3261e;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(31, 42, 36, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.55; }
img { max-width: 100%; display: block; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: 1.6rem; }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 100; }

/* Top bar + header */
.topbar { background: var(--primary); color: #fff; font-size: .85rem; padding: 6px 0; text-align: center; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.25rem; text-decoration: none; color: var(--text); }
.site-nav { display: flex; gap: 20px; margin-left: auto; }
.site-nav a { text-decoration: none; color: var(--text); font-weight: 500; }
.site-nav a:hover { color: var(--primary); }
.cart-link { text-decoration: none; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.cart-count { background: var(--accent); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; font-size: .8rem; padding: 0 6px; }
.cart-count.bump { animation: bump .3s ease; }
@keyframes bump { 50% { transform: scale(1.35); } }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; }

/* Buttons */
.btn { display: inline-block; border: 0; border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s; }
.btn-primary, .btn-small { background: var(--primary); color: #fff; }
.btn-primary:hover, .btn-small:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-small { padding: 8px 14px; font-size: .9rem; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Hero */
.hero { background: linear-gradient(135deg, #e8f1ea, #fbf0e1); padding: 72px 0; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 520px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* Sections */
.section { padding: 56px 0; }
.section-alt { background: var(--alt); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.empty { color: var(--muted); }

/* Categories */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.category-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 4px; transition: transform .15s, box-shadow .15s; }
.category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.category-name { font-weight: 700; font-size: 1.1rem; }
.category-count { color: var(--muted); font-size: .9rem; }

/* Products */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.product-image { text-decoration: none; aspect-ratio: 4 / 3; background: #e8f1ea; display: grid; place-items: center; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.placeholder { font-size: 3rem; font-weight: 800; color: var(--primary); opacity: .4; }
.product-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-category { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.product-body h3 { font-size: 1.05rem; margin: 0; }
.product-body h3 a { color: var(--text); text-decoration: none; }
.product-desc { color: var(--muted); font-size: .9rem; margin: 0; flex: 1; }
.product-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.add-to-cart { margin: 0; }
.price { font-weight: 700; font-size: 1.1rem; }
.badge-out { background: var(--alt); color: var(--muted); border-radius: 999px; padding: 6px 12px; font-size: .85rem; }
.low-stock { color: var(--accent); font-size: .85rem; font-weight: 600; margin: 0; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; counter-reset: step; }
.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 4px; counter-increment: step; }
.steps li::before { content: counter(step); background: var(--primary); color: #fff; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; margin-bottom: 8px; }
.steps span { color: var(--muted); }

/* Footer */
.site-footer { background: var(--text); color: #d9e0db; padding: 40px 0 16px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.site-footer strong { color: #fff; }
.copyright { font-size: .85rem; margin-top: 24px; opacity: .7; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--primary); color: #fff; padding: 12px 20px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

/* Mobile */
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; flex-direction: column; gap: 0; order: 3; padding-bottom: 12px; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 0; border-top: 1px solid var(--border); }
  .cart-link { order: 2; }
  .hero { padding: 48px 0; }
}

/* Cart */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-block { display: block; text-align: center; width: 100%; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.link-button:hover { color: var(--danger); }

.flash { padding: 12px 16px; border-radius: 8px; margin: 0 0 20px; }
.flash-ok { background: #e3f1e7; color: var(--primary); }
.flash-error { background: #fbe9e7; color: var(--danger); }

.cart-empty { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; text-align: center; }
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
.cart-items { display: flex; flex-direction: column; gap: 12px; }
.cart-item { display: grid; grid-template-columns: 88px 1fr auto auto auto; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.cart-thumb { width: 88px; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #e8f1ea; display: grid; place-items: center; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-thumb .placeholder { font-size: 2rem; }
.cart-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cart-name { font-size: 1.05rem; margin: 0; }
.cart-unit { color: var(--muted); font-size: .9rem; }
.cart-qty { display: flex; gap: 8px; align-items: center; margin: 0; }
.cart-qty { gap: 0; border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.cart-qty input { width: 48px; padding: 8px 0; border: 0; text-align: center; font: inherit; font-weight: 600; background: transparent; -moz-appearance: textfield; }
.cart-qty input::-webkit-outer-spin-button, .cart-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-qty input:focus { outline: none; }
.cart-qty:focus-within { border-color: var(--primary); }
.qty-btn { width: 38px; height: 38px; border: 0; background: transparent; color: var(--primary); font-size: 1.3rem; font-weight: 600; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.qty-btn:hover:not(:disabled) { background: #e8f1ea; }
.qty-btn:disabled { color: var(--border); cursor: not-allowed; }
.qty-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cart-item.saving .cart-line { opacity: .5; }
.cart-item.removing { opacity: 0; transform: translateX(-12px); transition: opacity .2s, transform .2s; }
.cart-line { min-width: 72px; text-align: right; }
.cart-remove, .cart-clear { margin: 0; }
.cart-clear { align-self: flex-start; padding: 4px 0; }

.cart-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; position: sticky; top: 88px; }
.cart-summary h2 { font-size: 1.2rem; }
.cart-summary dl { margin: 0 0 12px; }
.cart-summary dl div { display: flex; justify-content: space-between; padding: 6px 0; }
.cart-summary dt { color: var(--muted); }
.cart-summary dd { margin: 0; }
.cart-total { display: flex; justify-content: space-between; border-top: 1px solid var(--border); padding: 12px 0 16px; font-size: 1.2rem; }
.continue { display: block; text-align: center; margin-top: 12px; }

@media (max-width: 860px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
}
@media (max-width: 560px) {
  .cart-item { grid-template-columns: 72px 1fr; }
  .cart-thumb { width: 72px; grid-row: span 2; }
  .cart-qty, .cart-line, .cart-remove { grid-column: 2; }
  .cart-line { text-align: left; }
}

/* Admin */
.muted { color: var(--muted); font-weight: 400; }
.admin-header { background: var(--text); color: #fff; }
.admin-header .logo { color: #fff; }
.admin-tag { background: var(--accent); color: #fff; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 6px; }
.admin-nav { display: flex; align-items: center; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.admin-nav a, .admin-nav .link-button { color: #d9e0db; text-decoration: none; font-weight: 500; }
.admin-nav a:hover, .admin-nav .link-button:hover { color: #fff; }
.admin-nav form { margin: 0; }

.admin-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-toolbar h1 { margin: 0; margin-right: auto; }
.admin-search { display: flex; gap: 8px; margin: 0; }
.admin-search input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; font: inherit; min-width: 200px; }

.table-wrap { position: relative; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.admin-table th, .admin-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--alt); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .actions { display: flex; gap: 8px; justify-content: flex-end; }
.admin-table .actions form { margin: 0; }
.admin-product { display: flex; align-items: center; gap: 12px; }
.admin-thumb { width: 48px; }
.admin-thumb .placeholder { font-size: 1.2rem; }
.stock { font-weight: 600; }
.stock-low { color: var(--accent); }
.stock-out { color: var(--danger); }
.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.admin-form { display: flex; flex-direction: column; gap: 16px; }
.admin-form label, .label-text { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.admin-form input[type=text], .admin-form input[type=email], .admin-form input[type=password], .admin-form input[type=tel],
.admin-form input[type=number], .admin-form select, .admin-form textarea {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-weight: 400; background: var(--surface);
}
.admin-form [aria-invalid=true] { border-color: var(--danger); }
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.admin-form .checkbox { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.field-error { color: var(--danger); font-weight: 400; font-size: .9rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.product-form { display: grid; grid-template-columns: 1fr 300px; gap: 24px 32px; align-items: start; }
.form-main, .form-side { display: flex; flex-direction: column; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 12px; }
.image-preview { aspect-ratio: 4 / 3; border-radius: 8px; background: #e8f1ea; display: grid; place-items: center; overflow: hidden; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }

.login-card { max-width: 400px; margin: 40px auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }

@media (max-width: 760px) {
  .product-form { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* Shop */
.breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.category-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 20px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 500; }
.pill:hover { border-color: var(--primary); }
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill-count { font-size: .8rem; opacity: .7; }
.shop-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.shop-filters input, .shop-filters select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; font: inherit; background: var(--surface); }
.shop-filters input { flex: 1; min-width: 180px; }
.result-count { color: var(--muted); margin: 0 0 20px; }

/* Admin categories */
.admin-search select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; font: inherit; background: var(--surface); }
.inline-add { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; }
.inline-add input[type=text] { flex: 1; min-width: 200px; }
.category-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.category-admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.category-admin-head h2 { font-size: 1.15rem; margin: 0 0 2px; }
.category-admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.category-admin-actions .btn-ghost { padding: 8px 14px; font-size: .9rem; border-width: 1.5px; }
.category-admin-more summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.category-admin-more[open] summary { margin-bottom: 12px; }
.category-admin-more .inline-add { margin-bottom: 8px; }
.category-admin-more .delete-form { margin: 0; }
.small { font-size: .85rem; margin: 0; }

/* Delete category */
.delete-category { max-width: 720px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.delete-category p { margin: 0; }
.affected-products { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; max-height: 260px; overflow-y: auto; }
.affected-products li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-weight: 400; }
.affected-products li:last-child { border-bottom: 0; }
.affected-products li .muted { margin-left: auto; font-size: .9rem; }
.delete-options { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.option-card { border: 1.5px solid var(--border); border-radius: 10px; padding: 16px; font-weight: 400 !important; }
.option-card:has(input[type=radio]:checked) { border-color: var(--primary); background: #f3f8f4; }
.option-card.danger:has(input[type=radio]:checked) { border-color: var(--danger); background: #fdf3f2; }
.option-card.disabled { opacity: .6; }
.option-card select, .option-card input[type=text] { max-width: 320px; }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #8f1e18; }

/* Checkout */
.checkout-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }
.checkout-main { display: flex; flex-direction: column; gap: 20px; }
.checkout-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin: 0; }
.checkout-card legend { font-weight: 700; font-size: 1.15rem; padding: 0 6px; margin-left: -6px; }
.checkout-card h2 { font-size: 1.15rem; }
.delivery-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.option-card { display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.pay-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pay-tile { position: relative; display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 4px !important;
  min-height: 96px; padding: 16px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.pay-tile input { position: absolute; opacity: 0; pointer-events: none; }
.pay-tile:hover { border-color: var(--primary); }
.pay-tile:has(input:checked) { border-color: var(--primary); background: #f3f8f4; box-shadow: inset 0 0 0 1px var(--primary); }
.pay-tile:has(input:checked)::after { content: "✓"; position: absolute; top: 8px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .8rem; display: grid; place-items: center; }
.pay-tile:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.pay-tile-title { font-size: 1.25rem; font-weight: 800; letter-spacing: .04em; color: var(--text); }
.pay-tile-sub { font-size: .9rem; color: var(--muted); font-weight: 400; }
.pay-panel { display: flex; flex-direction: column; gap: 14px; border-top: 1px dashed var(--border); padding-top: 16px; }
.pay-panel p { margin: 0; }
.wallet-choice { display: flex; gap: 8px; }
.wallet-pill { cursor: pointer; }
.wallet-pill input { position: absolute; opacity: 0; pointer-events: none; }
.wallet-pill:has(input:checked) { background: var(--primary); border-color: var(--primary); color: #fff; }
.wallet-pill:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.wallet-details { background: var(--alt); border-radius: 10px; padding: 16px; display: flex; gap: 16px; align-items: flex-start; }
.wallet-qr { width: 140px; height: 140px; object-fit: contain; background: #fff; border-radius: 8px; padding: 6px; flex-shrink: 0; }
.pay-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-weight: 400; }
.wallet-account { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.wallet-account strong { font-size: 1.15rem; letter-spacing: .03em; }
.copy-btn { border: 1px solid var(--primary); background: var(--surface); color: var(--primary); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: .8rem; cursor: pointer; }
.copy-btn:hover { background: var(--primary); color: #fff; }
.selected-static { border-color: var(--primary); background: #f3f8f4; cursor: default; }
.checkout-items { list-style: none; margin: 0 0 12px; padding: 0 0 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.checkout-items li { display: flex; justify-content: space-between; gap: 12px; font-size: .95rem; }
.checkout-layout .cart-summary .btn-block { margin-top: 4px; }

/* Confirmation */
.confirmation { max-width: 960px; }
.confirm-hero { text-align: center; margin-bottom: 32px; }
.confirm-check { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 2rem; margin-bottom: 12px; }
.confirm-hero .lead { margin: 0 auto 12px; }
.order-number { font-size: 1.2rem; margin: 0 0 4px; }
.order-number strong { background: var(--alt); padding: 4px 12px; border-radius: 8px; letter-spacing: .05em; }
.confirm-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.confirm-grid .checkout-card p { margin: 0 0 12px; }

/* Admin orders */
.nav-badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: .75rem; padding: 1px 7px; margin-left: 2px; }
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.status-new { background: #fff1e0; color: #a35a10; }
.status-preparing { background: #e6effa; color: #1f5b9a; }
.status-ready { background: #e3f1e7; color: var(--primary); }
.status-completed { background: var(--alt); color: var(--muted); }
.status-cancelled { background: #fbe9e7; color: var(--danger); }
.order-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; align-items: start; }
.details { margin: 0; }
.details div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.details div:last-child { border-bottom: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.order-notes { background: #fff8e6; padding: 6px 10px; border-radius: 6px; }
.order-lines { min-width: 0; }
.order-lines tfoot td { border-bottom: 0; padding-top: 6px; padding-bottom: 6px; }
.order-lines tfoot .grand td { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--border); }
.status-buttons { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.status-buttons form { margin: 0; display: flex; gap: 8px; }
.status-select select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; font: inherit; background: var(--surface); }
.cancel-form { margin-left: auto !important; }

@media (max-width: 860px) {
  .checkout-layout, .confirm-grid, .order-grid { grid-template-columns: 1fr; }
  .delivery-options { grid-template-columns: 1fr; }
  .wallet-details { flex-direction: column; }
}

.pay-confirm { display: flex; flex-direction: column; gap: 4px; background: #f3f8f4; border: 1px solid #cfe3d5; border-radius: 10px; padding: 14px 16px; margin: 0 0 12px; }

/* Admin payment */
.pay-status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pay-unpaid { background: var(--alt); color: var(--muted); }
.pay-pending { background: #fff1e0; color: #a35a10; }
.pay-paid { background: #e3f1e7; color: var(--primary); }
.pay-rejected { background: #fbe9e7; color: var(--danger); }
.payment-card { margin-bottom: 20px; display: flex; flex-direction: column; gap: 12px; }
.payment-head { display: flex; align-items: center; gap: 12px; }
.payment-head h2 { margin: 0; }
.ref-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; }
.pay-hint { margin: 0; background: #fff8e6; padding: 10px 12px; border-radius: 8px; }
.pill-verify { border-color: #e9b46c; }


.cod-reminder { display: flex; flex-direction: column; gap: 2px; background: #fff8e6; border: 1px solid #f0d9a8; border-radius: 10px; padding: 12px 14px; margin: 0; font-weight: 400; }
.cod-reminder strong { font-size: 1.2rem; }

/* GCash scan-to-pay */
.wallet-scan { flex-wrap: wrap; }
.scan-qr { flex-shrink: 0; }
.qr-for-amount { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qr-box { width: 200px; height: 200px; background: #fff; border-radius: 10px; padding: 6px; box-shadow: var(--shadow); }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-for-amount figcaption { font-size: .95rem; }
.qr-for-amount figcaption strong { font-size: 1.1rem; }
.save-qr { font-size: .85rem; }
.wallet-scan .pay-steps { flex: 1; min-width: 220px; }
.scan-tip { display: block; margin-top: 6px; }
.scan-fallback { flex-basis: 100%; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-top: 1px dashed var(--border); padding-top: 10px; }
@media (max-width: 560px) { .wallet-scan { flex-direction: column; align-items: center; } }

/* Admin payments */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); transition: box-shadow .15s, transform .15s; }
.stat-tile:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .85rem; color: var(--muted); }
.stat-attention { border-color: #e9b46c; background: #fffaf0; }
.payments-filters { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.payments-filters .category-pills { margin: 0; }
.payments-table { min-width: 960px; }
.payments-table .actions form { margin: 0; }
.payments-table tfoot td { border-top: 2px solid var(--border); border-bottom: 0; background: var(--alt); }
.nowrap { white-space: nowrap; }

.btn-place { padding: 14px 22px; font-size: 1.05rem; }

/* Amount received check */
.diff { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.diff-ok { background: #e3f1e7; color: var(--primary); }
.diff-short { background: #fbe9e7; color: var(--danger); }
.diff-over { background: #e6effa; color: #1f5b9a; }
.pay-short { background: #fbe9e7; color: var(--danger); }
.stat-danger { border-color: #e7a59f; background: #fdf3f2; }
.money-input { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.money-input > span { padding: 0 8px 0 10px; color: var(--muted); font-weight: 600; }
.money-input input { border: 0; padding: 8px 10px 8px 0; font: inherit; width: 110px; background: transparent; }
.money-input:focus-within { outline: 2px solid var(--primary); outline-offset: 1px; }
.verify-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.verify-form label { font-weight: 600; flex-basis: 100%; }
.verify-inline { display: flex; align-items: center; gap: 6px; }
.verify-inline .money-input input { width: 84px; padding: 6px 8px 6px 0; }

/* Received payments & matching */
.match { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; margin-top: 4px; white-space: nowrap; }
.match-ok { background: #e3f1e7; color: var(--primary); }
.match-missing { background: #fbe9e7; color: var(--danger); }
.received-form { margin-bottom: 28px; max-width: 900px; }
.received-form h2 { margin: 0; }
.form-row-3 { grid-template-columns: 1.2fr 1fr 1fr; align-items: start; }
.form-row-3 .money-input input { width: 100%; }
.received-head h2 { margin: 0; margin-right: auto; font-size: 1.2rem; }
@media (max-width: 760px) { .form-row-3 { grid-template-columns: 1fr; } }

.import-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-weight: 400; }
.received-form textarea#history { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }

.form-errors { background: #fbe9e7; border: 1px solid #e7a59f; color: var(--danger); border-radius: 10px; padding: 12px 14px; }
.form-errors ul { margin: 6px 0 0; padding-left: 18px; }

.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.status-actions .pay-hint { margin-bottom: 12px; }

/* Scan to pay (PayMongo) */
.pay-page { max-width: 820px; }
.pay-page h1 { margin-bottom: 4px; }
.pay-card { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-top: 20px; transition: border-color .3s, background .3s; }
.pay-card.is-paid { border-color: var(--primary); background: #f3f8f4; }
.pay-qr { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pay-qr img { width: 260px; height: 260px; border-radius: 10px; box-shadow: var(--shadow); background: #fff; transition: opacity .3s; }
.pay-qr-expired { position: absolute; top: 70px; left: 0; right: 0; text-align: center; }
.pay-qr-expired p { margin: 0 0 8px; }
.pay-info { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 12px; }
.pay-info p { margin: 0; }
.pay-waiting { display: flex; align-items: center; gap: 10px; background: var(--alt); border-radius: 10px; padding: 12px 14px; font-weight: 600; }
.is-paid .pay-waiting { background: #e3f1e7; color: var(--primary); }
.spinner { width: 18px; height: 18px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
.is-paid .spinner { animation: none; border-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }
.test-note { font-size: .85rem; background: #fff8e6; border: 1px dashed #f0d9a8; border-radius: 8px; padding: 8px 10px; }
.paymongo-info .pay-steps { gap: 8px; }
@media (max-width: 560px) { .pay-card { flex-direction: column; align-items: center; } }

.pay-confirm-due { background: #fff8e6; border-color: #f0d9a8; }
.pay-confirm-due .btn { align-self: flex-start; margin-top: 6px; }

.account-form { max-width: 640px; }
.account-form h2 { font-size: 1.05rem; margin: 8px 0 0; }
.account-form h2 .muted { font-size: .85rem; }

.test-banner { background: #fff3cd; border: 2px solid #e0a800; color: #6b4e00; border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; line-height: 1.45; }
.test-banner strong { display: block; color: #8a5a00; }
.test-banner.small strong { display: inline; }

/* Admins */
.credentials-card { background: #f3f8f4; border: 2px solid var(--primary); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.credentials-card p { margin: 0; }
.credentials-card .details div { grid-template-columns: 150px 1fr; }
.add-admin-form { margin-top: 24px; }
.add-admin-form h2 { margin: 0; }

/* Category photos */
.category-card.has-photo { padding: 0; overflow: hidden; gap: 0; }
.category-photo { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; transition: transform .3s; }
.category-card.has-photo:hover .category-photo { transform: scale(1.04); }
.category-text { display: flex; flex-direction: column; gap: 4px; }
.category-card.has-photo .category-text { padding: 16px 20px 18px; background: var(--surface); position: relative; }
.category-photo-form { display: flex; flex-direction: column; gap: 8px; }
.category-photo-preview { aspect-ratio: 16 / 10; border-radius: 8px; background: var(--alt); display: grid; place-items: center; overflow: hidden; text-align: center; padding: 0; }
.category-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.category-photo-buttons { display: flex; gap: 12px; align-items: center; }
