/* Wholesale ordering app — plain white look with black buttons, like the existing wholesale site. */
* { box-sizing: border-box; }
body { margin: 0; font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 14px; color: #0a0a0a; background: #fafafa; }
a { color: inherit; }
.muted { color: #737373; }
.c { text-align: center; } .r { text-align: right; }
.wshell { display: flex; min-height: 100vh; }
.wside { width: 240px; flex: 0 0 240px; background: #fafafa; border-right: 1px solid #e5e5e5; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; transition: margin .2s; }
.wshell.closed .wside { margin-left: -240px; }
.wlogo { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; padding: 4px 8px 16px; }
.wgroup { font-size: 12px; color: #737373; padding: 4px 8px; }
.wnav { display: flex; align-items: center; gap: 8px; padding: 6px 8px; }
.wnav-sub { display: block; padding: 6px 8px 6px 32px; border-radius: 6px; text-decoration: none; }
.wnav-sub:hover, .wnav-sub.on { background: #f0f0f0; }
.wuser { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 8px; }
.wuser small { display: block; color: #737373; font-size: 11px; }
.wmain { flex: 1; min-width: 0; background: #fff; }
.whead { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid #f0f0f0; }
.whead .wbtn { margin-left: auto; }
.wbody { padding: 16px 24px; background: #fafafa; min-height: calc(100vh - 56px); }
.wcard { background: #fff; border: 1px solid #e5e5e5; border-radius: 12px; padding: 16px; }
.wcard h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; display: flex; gap: 8px; align-items: center; }
.wbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid #171717; background: #171717; color: #fafafa; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }
.wbtn:disabled { opacity: .5; cursor: not-allowed; }
.wbtn.ghost { background: #fff; color: #171717; border-color: #e5e5e5; }
.wicon { border: 0; background: none; cursor: pointer; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 16px; }
.wicon:hover { background: #f0f0f0; }
.winput, .wadd .input, .combo .input { width: 100%; height: 36px; border: 1px solid #e5e5e5; border-radius: 8px; padding: 6px 10px; font: inherit; background: #fff; }
textarea.winput { height: auto; }
label { display: grid; gap: 6px; font-weight: 500; }
.wtable { width: 100%; border-collapse: collapse; }
.wtable th { text-align: left; font-weight: 500; color: #737373; padding: 10px 8px; border-bottom: 1px solid #e5e5e5; }
.wtable td { padding: 10px 8px; border-bottom: 1px solid #f0f0f0; }
.wtable tr.click { cursor: pointer; } .wtable tr.click:hover { background: #fafafa; }
.wbadge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; color: #fff; }
.wbadge.approved { background: #16a34a; } .wbadge.pending { background: #eab308; } .wbadge.cancelled { background: #dc2626; }
.wadd { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.witem { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.witem span { flex: 1; }
.wactions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.werr { color: #dc2626; }
.linkish { border: 0; background: none; color: #dc2626; cursor: pointer; font: inherit; padding: 0; }
.wlogin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.wlogin .wcard { width: 100%; max-width: 380px; display: grid; gap: 14px; }
.wlogin h1 { font-size: 20px; display: flex; align-items: center; gap: 8px; margin: 0; }
/* Search select (shared component) */
.combo { position: relative; } .combo-chev { position: absolute; right: 10px; top: 10px; color: #737373; pointer-events: none; }
.combo-clear { position: absolute; right: 6px; top: 6px; border: 0; background: none; cursor: pointer; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: 40px; margin: 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.08); max-height: 260px; overflow-y: auto; font-weight: 400; }
.combo-list li { padding: 7px 12px; cursor: pointer; } .combo-list li.active { background: #f5f5f5; } .combo-list li.none { color: #737373; }
@media (max-width: 800px) { .wside { position: fixed; z-index: 20; height: 100vh; } .wbody { padding: 12px; } }
/* Number columns line up with their headings (a header class beats the default left alignment) */
.wtable th.r, .wtable td.r { text-align: right; } .wtable th.c, .wtable td.c { text-align: center; }
.wtable.wdetail { table-layout: fixed; } .wdetail col.wq { width: 90px; } .wdetail col.wp { width: 110px; } .wdetail col.wt { width: 120px; }
.wtable td.r { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wtotals { margin-left: auto; width: min(100%, 300px); margin-top: 10px; display: grid; gap: 4px; }
.wtotals > div { display: flex; justify-content: space-between; } .wtotals .due { color: #dc2626; }
/* Header: last payment + outstanding */
.wchips { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.wchip { border: 1px solid #e5e5e5; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.wchip.due { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; } .wchip.clear { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.whead .wchips + .wbtn { margin-left: 8px; }
@media (max-width: 700px) { .wchips { font-size: 11px; } .wchip { padding: 2px 8px; } .whead { height: auto; min-height: 56px; flex-wrap: wrap; padding: 8px 12px; } }
/* ───────── Header: New Order in the middle, account chips on the right ───────── */
.whead .whead-new { margin: 0 auto; background: #ea580c; border-color: #ea580c; box-shadow: 0 4px 12px rgba(234, 88, 12, .25); }
.whead .whead-new:hover { background: #c2410c; }
.whead .wchips { margin-left: 0; }

/* ───────── Create Order (modern, responsive) ───────── */
.co { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.co-main { display: grid; gap: 16px; min-width: 0; }
.co .wcard { border-radius: 16px; border-color: #ececec; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.04); padding: 18px; }
.co .wcard h2 { font-size: 16px; margin-bottom: 14px; }
.co-add { display: grid; gap: 14px; background: linear-gradient(180deg, #fffbeb 0%, #fff 60%); border-color: #fde68a !important; }
.co-add .combo .input { height: 46px; font-size: 15px; border-radius: 12px; padding-left: 14px; }
.co-add .combo-list { top: 50px; }
.co-qty { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 12px; align-items: end; }
.co-field { gap: 8px; }
.co-label { display: flex; justify-content: space-between; align-items: center; gap: 6px 8px; flex-wrap: wrap; font-weight: 600; }
.co-label > span:first-child { white-space: nowrap; }
.co-qty-input { height: 46px !important; font-size: 18px !important; border-radius: 12px !important; font-variant-numeric: tabular-nums; }
.co-qty-input:focus, .co-add .combo .input:focus { outline: none; border-color: #ea580c; box-shadow: 0 0 0 3px rgba(234, 88, 12, .18); }
.co-add-btn { height: 46px; justify-content: center; border-radius: 12px; background: #ea580c; border-color: #ea580c; font-size: 15px; }
.co-add-btn:hover { background: #c2410c; }
.co-count { background: #f4f4f5; border-radius: 999px; padding: 1px 9px; font-size: 12px; color: #52525b; }
.co-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.co-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid #f0f0f0; border-radius: 12px; background: #fff; }
.co-list li.new { animation: co-new 1.4s ease-out; }
@keyframes co-new { 0% { background: #fff7ed; border-color: #fdba74; } 100% { background: #fff; border-color: #f0f0f0; } }
.co-name { min-width: 0; display: grid; gap: 2px; } .co-name b { font-weight: 600; overflow-wrap: anywhere; } .co-name small { color: #737373; font-size: 12px; }
.co-step { display: inline-flex; align-items: center; border: 1px solid #e5e5e5; border-radius: 10px; overflow: hidden; }
.co-step button { width: 34px; height: 36px; border: 0; background: #fafafa; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.co-step button:hover { background: #f0f0f0; }
.co-step input { width: 70px; height: 36px; border: 0; border-left: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5; text-align: center; font: inherit; font-weight: 600; -moz-appearance: textfield; }
.co-step input::-webkit-outer-spin-button, .co-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.co-del { color: #dc2626; }
.co-empty { display: grid; justify-items: center; gap: 4px; padding: 26px 10px; color: #a1a1aa; text-align: center; } .co-empty p { margin: 0; max-width: 340px; }
.co-side { position: sticky; top: 16px; }
.co-summary { display: grid; gap: 12px; }
.co-sumrow { display: flex; justify-content: space-between; font-size: 15px; } .co-sumrow b { font-variant-numeric: tabular-nums; }
.co-note-hint { margin: 0; font-size: 12.5px; padding: 8px 10px; background: #f8fafc; border-radius: 8px; }
.co-submit { height: 48px; justify-content: center; border-radius: 12px; font-size: 15px; background: #16a34a; border-color: #16a34a; }
.co-submit:hover:not(:disabled) { background: #15803d; }
.co-sub2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .co-sub2 .wbtn { justify-content: center; border-radius: 10px; }
.co-bar { display: none; }
/* Box / strip helpers (same as the POS) */
.box-chip { margin-left: 8px; padding: 1px 8px; border: 1px solid #ea580c; border-radius: 999px; background: #fff7ed; color: #c2410c; font-size: 11.5px; font-weight: 600; cursor: pointer; line-height: 1.5; }
.box-chip:hover { background: #ffedd5; }
.strip-hint { font-size: 11.5px; font-weight: 600; color: #475569; border-radius: 999px; padding: 1px 8px; background: #f1f5f9; border: 1px solid #e2e8f0; white-space: nowrap; }
.strip-hint.ok { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.strip-hint.suggest { color: #fff; background: #ea580c; border-color: #ea580c; cursor: pointer; }
.qty-flash { animation: qty-flash 1.2s ease-out 1; }
@keyframes qty-flash { 0%, 40% { box-shadow: 0 0 0 4px rgba(234, 88, 12, .55); border-color: #ea580c; } 100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); } }

@media (max-width: 1000px) {
  .co { grid-template-columns: 1fr; }
  .co-side { position: static; }
}
@media (max-width: 640px) {
  .wbody { padding-bottom: 90px; }
  .co-qty { grid-template-columns: 1fr; }
  .co-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .co-list li .co-step { grid-column: 1; justify-self: start; }
  .co-list li .co-del { grid-row: 1 / span 2; grid-column: 2; }
  .co .wcard { padding: 14px; border-radius: 14px; }
  .co-bar { display: flex; position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #e5e5e5;
    box-shadow: 0 -6px 20px rgba(0,0,0,.06); align-items: center; justify-content: space-between; gap: 12px; }
  .co-bar .co-submit { height: 44px; padding: 0 22px; }
  .whead .whead-new { order: 5; margin: 0; flex: 1 1 100%; justify-content: center; }
  .whead-crumb { display: none; }
}
