/* 📋 Pesanan saya (purchase-orders.js, docs/PURCHASE_ORDER_CONTRACT.md "UI"). Phone first: no sideways scroll at 360px, every tap target >= 44px,
   the confirm buttons 52px. Colour is a signal (lesson warning-colors-only-for-warnings): red only for "Terlambat" and errors, amber only for a
   closed-short order and the price-unit line, green only for "Selesai". Neutral grey / indigo for everything else. From 900px the cards become a table. */
.pom-home-btn { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; max-width: 420px; min-height: 52px; margin: 0 0 .5rem; padding: .5rem .9rem; box-sizing: border-box; border: 1.5px solid var(--p); border-radius: 12px; background: #EEF2FF; color: var(--p); font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; }

.pom-ov { position: fixed; inset: 0; z-index: 150; display: flex; justify-content: center; background: rgba(16, 24, 40, .45); }
.pom-sheet { display: flex; flex-direction: column; width: 100%; max-width: 1240px; height: 100%; background: #EEF1F4; min-width: 0; }
.pom-bar { display: flex; align-items: center; gap: .4rem; flex: 0 0 auto; padding: .35rem .5rem; padding-top: calc(.35rem + env(safe-area-inset-top)); background: #fff; border-bottom: 1px solid var(--border); }
.pom-back, .pom-reload { min-height: 44px; min-width: 44px; padding: .3rem .7rem; border: 1px solid var(--border-input); border-radius: 10px; background: #fff; color: var(--dark); font: inherit; font-weight: 800; font-size: .95rem; cursor: pointer; white-space: nowrap; }
.pom-title { flex: 1; min-width: 0; font-weight: 800; font-size: 1rem; color: var(--dark); overflow-wrap: anywhere; }
.pom-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; overflow-anchor: none; padding: .5rem .55rem calc(1.2rem + env(safe-area-inset-bottom)); min-width: 0; }

.pom-q { width: 100%; min-height: 48px; box-sizing: border-box; padding: 0 .7rem; border: 1px solid var(--border-input); border-radius: 10px; background: #fff; font: inherit; font-size: 16px; }
.pom-chiprow { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .45rem 0 0; min-width: 0; }
.pom-lbl { font-size: .78rem; font-weight: 800; color: var(--ink2); margin-right: .1rem; }
.pom-chip { min-height: 44px; padding: .25rem .65rem; border: 1.5px solid var(--border-input); border-radius: 999px; background: #fff; color: var(--dark); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; }
.pom-chip[aria-pressed="true"] { background: var(--p); border-color: var(--p); color: #fff; }
.pom-chip-late[aria-pressed="true"] { background: #B42318; border-color: #B42318; }
.pom-wh { display: flex; align-items: center; gap: .5rem; margin: .45rem 0 0; }
.pom-wh select { min-height: 44px; padding: 0 .6rem; border: 1.5px solid var(--border-input); border-radius: 10px; background: #fff; font: inherit; font-size: 16px; }
.pom-meta { margin: .5rem .1rem .3rem; min-width: 0; }
.pom-count { font-size: .85rem; font-weight: 700; color: var(--ink2); }
.pom-quiet { font-size: .84rem; color: var(--muted); }
.pom-note { font-size: .85rem; border-radius: 10px; padding: .5rem .65rem; margin: .4rem 0; overflow-wrap: anywhere; line-height: 1.4; }
.pom-note-d { background: #FEF2F2; color: #991B1B; border-left: 4px solid var(--danger); }
.pom-note-w { background: #FFFBEB; color: #92400E; border-left: 4px solid var(--warn); }
.pom-note-i { background: var(--light); color: var(--ink2); border-left: 4px solid var(--border-input); }
.pom-empty { padding: 1.5rem .6rem; text-align: center; color: var(--muted); font-size: .95rem; }
.pom-empty .pom-btn2 { margin-top: .6rem; }

.pom-btn { min-height: 52px; padding: .45rem .9rem; border: none; border-radius: 10px; background: var(--p); color: #fff; font: inherit; font-weight: 800; font-size: .95rem; cursor: pointer; }
.pom-btn:disabled { background: #C7CBD6; cursor: default; }
.pom-btn2 { min-height: 44px; padding: .3rem .8rem; border: 1px solid var(--border-input); border-radius: 10px; background: #fff; color: var(--dark); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; }
.pom-btn2:disabled { color: var(--muted); cursor: default; }
.pom-btn-d { color: #B42318; border-color: #F4B4AE; }

.pom-cards { display: block; }
.pom-card { padding: .65rem .7rem; margin: 0 0 .5rem; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: var(--sh-sm); min-width: 0; overflow-wrap: anywhere; }
.pom-k-cancelled { opacity: .85; }
.pom-c1 { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.pom-no { font-weight: 800; font-size: 1rem; color: var(--dark); }
.pom-co { display: inline-block; font-size: .7rem; font-weight: 800; border-radius: 6px; padding: .02rem .35rem; border: 1px solid #CBD5E1; background: #F1F5F9; color: #334155; }
.pom-badges { display: flex; flex-wrap: wrap; gap: .3rem; margin: .25rem 0; }
.pom-badges:empty { display: none; }
.pom-badge { display: inline-block; white-space: nowrap; font-size: .74rem; font-weight: 800; border-radius: 8px; padding: .1rem .45rem; border: 1px solid #CBD5E1; background: #F1F5F9; color: #334155; }
.pom-b-late { background: #FEF2F2; border-color: #F4B4AE; color: #B42318; }
.pom-b-part { background: #EEF2FF; border-color: #C7D2FE; color: var(--s); }
.pom-b-short { background: #FFFBEB; border-color: #F5D58A; color: #92400E; }
.pom-b-done { background: #ECFDF3; border-color: #A6F4C5; color: #05603A; }
.pom-b-off { background: #F2F4F7; border-color: #D0D5DD; color: #475467; }
.pom-item { font-size: .95rem; font-weight: 700; color: var(--dark); }
.pom-item small { font-weight: 400; color: var(--muted); }
.pom-sub { font-size: .82rem; color: var(--ink2); margin-top: .1rem; }
.pom-qty3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin: .45rem 0 .3rem; }
.pom-qty3 span { display: block; padding: .3rem .45rem; border-radius: 8px; background: var(--light); min-width: 0; }
.pom-qty3 small { display: block; font-size: .7rem; color: var(--muted); }
.pom-qty3 b { display: block; font-size: 1rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pom-eta { font-size: .88rem; color: var(--dark); }
.pom-eta small, .pom-made small { color: var(--muted); }
.pom-price { font-size: .88rem; font-weight: 700; color: var(--dark); margin-top: .3rem; }
.pom-tax { font-size: .8rem; color: var(--ink2); }
.pom-unitwarn { font-size: .8rem; color: #92400E; background: #FFFBEB; border-left: 3px solid var(--warn); border-radius: 6px; padding: .2rem .45rem; margin-top: .25rem; }
.pom-notes { font-size: .82rem; color: var(--ink2); margin-top: .3rem; }
.pom-rcv { margin-top: .3rem; font-size: .82rem; color: var(--ink2); }
.pom-rcv summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.pom-made { margin-top: .2rem; }
.pom-acts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }

.pom-ask { margin-top: .5rem; padding: .55rem .6rem; border: 1px solid var(--border-input); border-radius: 12px; background: var(--light); }
.pom-ask-t { font-weight: 700; font-size: .9rem; color: var(--dark); overflow-wrap: anywhere; line-height: 1.4; }
.pom-err { font-size: .86rem; font-weight: 700; color: #B42318; margin-top: .3rem; overflow-wrap: anywhere; }
.pom-ask-b { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-top: .45rem; }
.pom-ask-b .pom-btn, .pom-ask-b .pom-btn2 { min-height: 52px; width: 100%; }

.pom-more { text-align: center; padding: .5rem 0 .2rem; }
.pom-more .pom-btn { width: 100%; max-width: 360px; margin-top: .3rem; }

.pom-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 12px; font-size: .88rem; }
.pom-table th { text-align: left; padding: .55rem .5rem; background: var(--light); border-bottom: 1px solid var(--border); font-size: .74rem; color: var(--ink2); white-space: nowrap; }
.pom-table td { padding: .5rem .5rem; border-bottom: 1px solid #EEF2F7; vertical-align: top; overflow-wrap: anywhere; }
.pom-table .pom-n { text-align: right; font-variant-numeric: tabular-nums; }
.pom-table .pom-td-no { white-space: nowrap; }
.pom-table .pom-td-act { min-width: 150px; }
.pom-table .pom-acts { margin-top: 0; flex-direction: column; align-items: stretch; }
.pom-tr-ask td { background: #fff; }

/* The order form (index.html poForm / poEdit): company and tax mode as big choice chips (>= 44px), nothing chosen for her, one calm yellow line under a price that is not per kg. */
.po-seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.ig .po-opt { position: relative; display: inline-flex; margin: 0; }
.po-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.po-opt span { display: inline-flex; align-items: center; min-height: 44px; padding: .25rem .9rem; border: 1.5px solid var(--border-input); border-radius: 10px; background: #fff; color: var(--dark); font-weight: 700; font-size: .9rem; }
.po-opt input:checked + span { background: var(--p); border-color: var(--p); color: #fff; }
.po-opt input:focus-visible + span { outline: 3px solid var(--p); outline-offset: 2px; }
.po-opt input:disabled + span { opacity: .7; }
.po-fe { font-size: .84rem; font-weight: 700; color: #B42318; margin-top: .3rem; }
.po-fe:empty, .po-lock:empty { display: none; }
.po-lock { font-size: .85rem; font-weight: 700; color: #92400E; background: #FFFBEB; border-left: 4px solid var(--warn); border-radius: 8px; padding: .45rem .6rem; margin: .4rem 0; }
.po-unitwarn { font-size: .82rem; color: #92400E; background: #FFFBEB; border-left: 3px solid var(--warn); border-radius: 6px; padding: .25rem .5rem; margin-top: .3rem; }
.po-ro { font-size: .95rem; font-weight: 700; color: var(--dark); }
.po-ro small { font-weight: 400; color: var(--muted); }

.pom-table td:nth-last-child(2) { min-width: 96px; }
/* Desktop table: a quantity never breaks inside the number ("20,00 / 0 pcs"); the yellow unit line in the price cell still wraps. */
.pom-table td.pom-n { white-space: nowrap; } .pom-table td.pom-n .pom-unitwarn { white-space: normal; }
