:root{--bg:#faf7f2;--card:#fff;--ink:#1f1d1a;--muted:#6f6a62;--line:#ebe5dc;--soft:#f3ede4;--brand:#c2410c;--brand-2:#9a3412;--ok:#15803d;--vf:#e60000;--wa:#1faa53;--radius:16px}
*{box-sizing:border-box}
body{margin:0;font-family:'Cairo',system-ui,sans-serif;background:var(--bg);color:var(--ink);line-height:1.6}
button,input,select,textarea{font-family:inherit;font-size:1rem;color:inherit}
h1,h2,h3{line-height:1.35}
.btn{border:0;border-radius:12px;padding:10px 16px;font-weight:700;cursor:pointer;background:var(--ink);color:#fff;display:inline-flex;align-items:center;justify-content:center;gap:6px;text-decoration:none;white-space:nowrap}
.btn.brand{background:var(--brand)}.btn.ok{background:var(--ok)}.btn.wa{background:var(--wa)}.btn.vf{background:var(--vf)}
.btn.ghost{background:#fff;color:var(--ink);border:1px solid var(--line)}
.btn.danger{background:#fff;color:#b91c1c;border:1px solid #fecaca}
.btn.sm{padding:6px 11px;font-size:.88rem;border-radius:9px}
.btn.block{width:100%}
.btn:disabled{opacity:.5;cursor:not-allowed}
.f{width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff}
.f:focus{outline:2px solid var(--brand);outline-offset:-1px;border-color:transparent}
label.l{display:block;font-weight:600;margin:12px 0 4px;font-size:.95rem}
.req{color:var(--brand)}
.note{color:var(--muted);font-size:.86rem}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{border:1px solid var(--line);background:#fff;border-radius:999px;padding:6px 14px;cursor:pointer;font-size:.92rem}
.chip.on{background:var(--ink);color:#fff;border-color:var(--ink)}
.chip b{font-weight:800;margin-inline-start:4px}
.modal{position:fixed;inset:0;z-index:60;display:none;align-items:center;justify-content:center;padding:16px;background:rgba(20,15,10,.5)}
.modal.show{display:flex}
.box{background:#fff;border-radius:18px;width:min(560px,100%);max-height:92vh;overflow:auto;padding:22px;position:relative}
.box.wide{width:min(860px,100%)}
.x{position:absolute;top:10px;left:12px;background:none;border:0;font-size:1.8rem;cursor:pointer;line-height:1;color:var(--muted);z-index:2}
.err{color:#b91c1c;font-size:.9rem;min-height:1.2em;margin-top:8px}
.toast{position:fixed;bottom:22px;right:50%;transform:translateX(50%);background:var(--ink);color:#fff;padding:10px 18px;border-radius:999px;opacity:0;transition:.2s;z-index:90;pointer-events:none;max-width:90vw;text-align:center}
.toast.show{opacity:1}
.st{display:inline-block;border-radius:999px;padding:2px 10px;font-size:.82rem;font-weight:700;white-space:nowrap}
.st-pending{background:#fef3c7;color:#92400e}.st-confirmed{background:#dbeafe;color:#1e40af}.st-in_production{background:#ede9fe;color:#5b21b6}
.st-shipped{background:#cffafe;color:#155e75}.st-delivered{background:#dcfce7;color:#166534}.st-cancelled{background:#fee2e2;color:#991b1b}
.timeline{list-style:none;padding:0;margin:14px 0}
.timeline li{display:flex;gap:12px;padding:0 0 16px;position:relative;color:var(--muted)}
.timeline li::before{content:"";position:absolute;right:16px;top:34px;bottom:2px;width:2px;background:var(--line)}
.timeline li:last-child::before{display:none}
.timeline .dot{width:34px;height:34px;border-radius:50%;background:var(--soft);display:grid;place-items:center;flex:none;position:relative;z-index:1;font-size:.95rem}
.timeline li.done{color:var(--ink)}.timeline li.done .dot{background:var(--ok);color:#fff}
.timeline li.done::before{background:var(--ok)}
.timeline li.cur{color:var(--ink)}.timeline li.cur .dot{background:var(--brand);color:#fff;box-shadow:0 0 0 4px #fed7aa}
.timeline b{display:block}.timeline small{display:block;font-size:.84rem}
.thumbs{display:flex;gap:8px;flex-wrap:wrap}
.thumbs img{width:68px;height:68px;object-fit:cover;border-radius:10px;border:2px solid var(--line);cursor:pointer}
.thumbs img.on{border-color:var(--brand)}
.panel{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px;margin:12px 0}
.panel h3{margin:0 0 8px;font-size:1.02rem}
.kv{display:flex;justify-content:space-between;gap:10px;margin:3px 0}
.kv.total{font-weight:800;font-size:1.08rem;border-top:1px dashed var(--line);padding-top:6px;margin-top:6px}
.line{display:flex;gap:10px;align-items:flex-start;padding:10px 0;border-bottom:1px solid var(--line)}
.line:last-child{border-bottom:0}
.line .e{width:54px;height:54px;border-radius:10px;background:var(--soft);display:grid;place-items:center;font-size:1.7rem;overflow:hidden;flex:none}
.line .e img{width:100%;height:100%;object-fit:cover}
.line .t{flex:1;min-width:0}
.cust{font-size:.86rem;color:var(--muted);margin-top:2px}
.cust img{width:44px;height:44px;object-fit:cover;border-radius:8px;vertical-align:middle;border:1px solid var(--line)}
.spin{display:inline-block;width:16px;height:16px;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:sp .7s linear infinite;vertical-align:middle}
@keyframes sp{to{transform:rotate(360deg)}}
.vfnum{font-size:1.35rem;font-weight:800;color:var(--vf);letter-spacing:1px;direction:ltr;display:inline-block}
.alert{border-radius:12px;padding:10px 14px;margin:10px 0;font-size:.93rem}
.alert.warn{background:#fff7ed;border:1px solid #fed7aa}
.alert.info{background:#eff6ff;border:1px solid #bfdbfe}
.alert.good{background:#f0fdf4;border:1px solid #bbf7d0}
.alert.vf{background:#fff1f1;border:1px dashed var(--vf)}
