:root { font: 16px/1.5 system-ui, sans-serif; color: #183d33; background: #f6f7f2; }
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.top { background: #183d33; color: white; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; max-width: 78rem; padding: .9rem 1.25rem; margin: auto; }
.bar strong { margin-right: auto; font-size: 1.2rem; }
nav.bar { padding-top: .2rem; }
nav a { color: white; padding: .45rem .7rem; border-radius: .5rem; }
nav a[aria-current] { background: #eef3e9; color: #183d33; }
main { max-width: 78rem; margin: auto; padding: 1.25rem; }
main.mobile, .login { max-width: 32rem; }
h1, h2 { line-height: 1.15; }
h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); margin: 0 0 1.25rem; }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
.card { background: white; border: 1px solid #dbe4d9; border-radius: 13px; padding: clamp(1rem, 3vw, 1.65rem); box-shadow: 0 3px 12px #183d330a; min-width: 0; }
.overview { background: #eef3e9; }
.grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
form, label { display: grid; gap: .45rem; }
form { gap: .85rem; }
input, select, button, .action { font: inherit; border-radius: 8px; padding: .6rem .8rem; min-height: 44px; }
input, select { width: 100%; border: 1px solid #8ba697; background: white; color: inherit; }
button, .action { background: #1d795c; border: 1px solid transparent; color: white; cursor: pointer; font-weight: 650; }
.action { display: inline-block; text-decoration: none; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid #db8959; outline-offset: 2px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: .8rem 0; }
th, td { padding: .5rem; text-align: left; border-bottom: 1px solid #dbe4d9; }
th:last-child, td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
#status:not(:empty) { background: #eef3e9; padding: .7rem; border-radius: 8px; }
@media (max-width: 46rem) { .grid { grid-template-columns: 1fr; } }
.history { margin-top: 1rem; }
.business-map-picker { min-width: 0; }
.business-map-picker summary { cursor: pointer; font-weight: 600; }
.business-map-picker summary span { color: #4d665a; font-size: .85em; font-weight: 400; margin-left: .4rem; }
.business-map { min-height: 15rem; border: 1px solid #dbe4d9; border-radius: 8px; background: #eef3e9; isolation: isolate; }
.business-map-actions { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; margin-top: .5rem; }
.business-map-actions > label { min-width: min(11rem, 100%); flex: 1; }
#order-lines { display: grid; gap: .75rem; }
#order-lines fieldset { display: grid; gap: .65rem; border: 1px solid #dbe4d9; border-radius: 8px; min-width: 0; }
.order-line-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(8.25rem, 100%), 1fr)); align-items: end; gap: .75rem; }
.order-line-notice { margin: 0; }
.order-line-price { display: block; padding: .65rem .8rem; min-height: 44px; background: #eef3e9; border-radius: 8px; }
.order-line-actions, .order-total { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .45rem .75rem; }
.purchase-line { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .55rem; align-items: start; min-width: 0; }
.purchase-line > button { align-self: end; justify-self: start; }
[data-purchase-lines] { display: grid; gap: .55rem; }
.purchase-suppliers { margin-top: .75rem; }
.order-line-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.order-subtotal { display: flex; flex-wrap: wrap; }
.order-line-price, .order-subtotal output, .order-total output { font-weight: 700; font-variant-numeric: tabular-nums; }
.order-line-actions button { background: #eef3e9; color: #183d33; border-color: #dbe4d9; }
.order-total { background: #eef3e9; border-radius: 8px; margin: 0; padding: .65rem .8rem; }
#order-list details { padding: .65rem 0; border-bottom: 1px solid #dbe4d9; }
textarea { font: inherit; width: 100%; padding: .6rem; color: inherit; border: 1px solid #8ba697; border-radius: 8px; }
.check { display: flex; align-items: center; }
.check input { width: 1.2rem; }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .8rem; }
.overview-grid dt { font-weight: 600; }
.overview-grid dd { margin: .3rem 0 0; font-size: 1.35rem; font-weight: 750; }

.order-choices:not(:empty) { display: grid; gap: .3rem; padding-top: .3rem; }
.order-choices button { text-align: left; background: #eef3e9; color: #183d33; border-color: #dbe4d9; }

.inventory-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.inventory-nav button[aria-pressed="false"] { background: #eef3e9; color: #183d33; border-color: #dbe4d9; }
.stock-filters { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.stock-filters label { flex: 1 1 12rem; }
.stock-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.stock-table-price { white-space: nowrap; }
#items small { display: block; color: #425e54; }
.stock-price-edit input { max-width: 10rem; }
#stock-loss { max-width: min(29rem, 92vw); border: 1px solid #dbe4d9; border-radius: 12px; padding: 1rem; }
#stock-loss::backdrop { background: #142d2699; }
