*{box-sizing:border-box}
:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172033;background:#f5f7fb;line-height:1.4}
body{margin:0;min-width:320px}
button,input,select,textarea{font:inherit}
button,.button-like{border:1px solid #ccd3df;background:#fff;color:#172033;border-radius:10px;padding:.65rem .85rem;cursor:pointer}
button:hover,.button-like:hover{background:#f0f3f8}
button.primary{background:#1769e0;color:#fff;border-color:#1769e0}
button.primary:hover{background:#1258bf}
button.danger{color:#b42318;border-color:#f1b8b3}
button.secondary{background:#fff}
.topbar{background:#fff;border-bottom:1px solid #e2e7ef;padding:1rem;display:flex;justify-content:space-between;align-items:center;gap:1rem;position:sticky;top:0;z-index:5}
.topbar h1{font-size:1.25rem;margin:0}.topbar p{margin:.1rem 0 0;color:#697386;font-size:.8rem}
.container{width:min(1100px,100%);margin:auto;padding:1rem}
.dashboard{display:grid;grid-template-columns:repeat(2,1fr);gap:.65rem;margin-bottom:1rem}
.metric{background:#fff;border:1px solid #e2e7ef;border-radius:12px;padding:.75rem;min-height:76px}
.metric span{display:block;color:#697386;font-size:.75rem}.metric strong{font-size:1.35rem}
.total-metric{grid-column:1/-1}.total-metric #currencyTotals{font-weight:700;margin-top:.25rem}
.panel{background:#fff;border:1px solid #e2e7ef;border-radius:14px;margin-bottom:1rem;padding:1rem}
.filter-grid{display:grid;gap:.75rem}
label{display:block;font-size:.8rem;font-weight:650;color:#3f4a5d}
input,select,textarea{display:block;width:100%;margin-top:.3rem;border:1px solid #cbd3df;border-radius:9px;padding:.65rem;background:#fff;color:#172033}
textarea{resize:vertical}
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-top:1rem;color:#697386;font-size:.82rem}
.toolbar-actions{display:flex;gap:.5rem;flex-wrap:wrap;justify-content:flex-end}
.button-like{display:inline-flex;align-items:center}.button-like input{display:none}
.empty{text-align:center;padding:2.5rem 1rem;color:#697386}.empty h2{color:#172033;margin:.25rem}
.orders-list{display:grid;gap:.75rem}
.order-card{border:1px solid #e0e5ec;border-radius:12px;padding:.9rem}
.order-head{display:flex;justify-content:space-between;gap:.75rem;align-items:flex-start}
.order-number{font-weight:750}.customer{color:#526074;margin-top:.1rem}
.badge{font-size:.72rem;padding:.25rem .5rem;border-radius:999px;background:#edf1f7;white-space:nowrap}
.order-meta{display:flex;flex-wrap:wrap;gap:.4rem .8rem;color:#667085;font-size:.75rem;margin:.65rem 0}
.items{margin:.5rem 0;padding:0;list-style:none}.items li{display:flex;justify-content:space-between;gap:1rem;padding:.25rem 0;border-bottom:1px dashed #e5e7eb;font-size:.84rem}
.order-bottom{display:flex;justify-content:space-between;align-items:end;gap:1rem;margin-top:.7rem}.order-total-label{color:#697386;font-size:.75rem}.order-total-value{font-size:1rem;font-weight:750}
.card-actions{display:flex;gap:.45rem;flex-wrap:wrap}
dialog{border:0;border-radius:16px;padding:0;width:min(680px,calc(100% - 1.5rem));max-height:92vh;box-shadow:0 20px 60px rgba(20,30,50,.25)}
dialog::backdrop{background:rgba(10,18,30,.48)}
#orderForm{padding:1rem;overflow:auto;max-height:92vh}.dialog-head{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;margin-bottom:1rem}.dialog-head h2{margin:0}.dialog-head p{margin:.2rem 0;color:#697386;font-size:.78rem}.icon-btn{font-size:1.3rem;line-height:1;padding:.3rem .55rem}
.form-grid{display:grid;gap:.75rem}
fieldset{border:1px solid #e0e5ec;border-radius:10px;margin:1rem 0;padding:.75rem}legend{font-size:.8rem;font-weight:700}
.item-row{display:grid;grid-template-columns:1fr 76px 105px auto;gap:.45rem;align-items:end;margin-bottom:.5rem}.item-row label{min-width:0}
.remove-item{padding:.55rem}.order-total{display:flex;justify-content:space-between;border-top:1px solid #e0e5ec;padding-top:.75rem;margin-top:.5rem}
.dialog-actions{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}.form-error{color:#b42318;font-size:.82rem;min-height:1.2em;margin-top:.5rem}
.cancelled{opacity:.7}.cancelled .order-total-value{text-decoration:line-through}
@media(min-width:650px){.dashboard{grid-template-columns:repeat(5,1fr)}.total-metric{grid-column:auto}.filter-grid{grid-template-columns:2fr 1fr 1fr 1fr}.form-grid{grid-template-columns:repeat(2,1fr)}}

[hidden], .hidden { display: none !important; }
