/* ===== Screen UI ===== */
* { box-sizing: border-box; }
html, body { margin: 0; background: #eef1f5; color: #1c2430; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; }
a { color: #1d5fbf; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 22px; background: #13294b; color: #fff; }
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.topbar .brand img { height: 30px; background: #fff; border-radius: 4px; padding: 2px; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { color: #cfdcf2; text-decoration: none; padding: 7px 12px; border-radius: 6px; }
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.topbar .spacer { flex: 1; }
main#app { max-width: 1280px; margin: 0 auto; padding: 22px; }
h1 { font-size: 22px; margin: 0 0 14px; } h2 { font-size: 17px; margin: 0 0 12px; } h3 { font-size: 15px; margin: 0 0 10px; } h4 { margin: 0; font-size: 14px; }
.card { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(16,30,54,.12); padding: 18px; margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.grid { display: grid; gap: 10px 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); } .g6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .spanall { grid-column: 1 / -1; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #4a5668; min-width: 0; }
label.f.chk { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: #1c2430; }
input, select, textarea { font: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid #c9d1dc; border-radius: 6px; background: #fff; color: #1c2430; width: 100%; min-width: 0; }
input[type=checkbox], input[type=radio] { width: auto; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #8db4ef; border-color: #4f86d8; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px; border: 1px solid #c9d1dc; background: #fff; color: #1c2430; cursor: pointer; font: inherit; font-size: 13px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #f3f6fa; }
.btn.primary { background: #1d5fbf; border-color: #1d5fbf; color: #fff; } .btn.primary:hover { background: #174f9f; }
.btn.danger { color: #b3261e; border-color: #e6b4b0; } .btn.danger:hover { background: #fdf0ef; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; color: #5a6676; font-weight: 600; padding: 8px; border-bottom: 2px solid #e2e7ee; white-space: nowrap; }
table.list td { padding: 8px; border-bottom: 1px solid #edf0f4; vertical-align: top; }
table.list tr:hover td { background: #f8fafc; }
.muted { color: #6b7685; font-size: 12px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: #e7ecf3; color: #33415a; white-space: nowrap; }
.badge.AIR { background: #e3efff; color: #1d5fbf; } .badge.OCEAN { background: #ddf5ef; color: #0f7a5f; }
.badge.s-Draft { background: #f0f0f0; } .badge.s-Booked { background: #fff3d6; color: #8a5a00; } .badge.s-In-Transit { background: #e3efff; color: #1d5fbf; }
.badge.s-Arrived { background: #ede4ff; color: #5b34b0; } .badge.s-Delivered { background: #ddf5e3; color: #1f7a36; } .badge.s-Cancelled { background: #fde3e1; color: #b3261e; }
.badge.sample { background: #fff0c2; color: #7a5b00; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: 10px; padding: 14px 18px; box-shadow: 0 1px 3px rgba(16,30,54,.12); }
.stat b { display: block; font-size: 26px; } .stat span { color: #6b7685; font-size: 12px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.party-card { border: 1px solid #e2e7ee; border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #fbfcfe; }
.pc-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.pc-head select { width: auto; max-width: 220px; font-size: 12px; padding: 4px 6px; }
.edit-table { width: 100%; border-collapse: collapse; }
.edit-table th { font-size: 11px; color: #5a6676; font-weight: 600; text-align: left; padding: 4px; white-space: nowrap; }
.edit-table td { padding: 3px; vertical-align: top; }
.edit-table input, .edit-table select, .edit-table textarea { padding: 5px 6px; font-size: 12px; }
.calc { font-variant-numeric: tabular-nums; font-size: 12px; padding: 6px 4px; white-space: nowrap; color: #0f3d80; font-weight: 600; }
.msg { font-size: 12px; margin-top: 2px; } .msg.ok { color: #1f7a36; } .msg.err { color: #b3261e; }
.totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: #f3f7fd; border-radius: 8px; padding: 10px 12px; }
.totals div span { display: block; font-size: 11px; color: #5a6676; } .totals div b { font-size: 15px; font-variant-numeric: tabular-nums; }
.sticky-save { position: sticky; bottom: 0; background: rgba(238,241,245,.96); padding: 10px 0; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid #d8dee7; z-index: 5; }
.seg { display: inline-flex; border: 1px solid #c9d1dc; border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 14px; cursor: pointer; font: inherit; font-size: 13px; }
.seg button.on { background: #1d5fbf; color: #fff; }
.print-toolbar { position: sticky; top: 50px; z-index: 10; background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(16,30,54,.15); padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.print-toolbar .copies { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; max-width: 640px; }
.print-toolbar .copies label { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.hint { font-size: 12px; color: #5a6676; background: #f3f7fd; padding: 6px 10px; border-radius: 6px; }
.warnbox { background: #fdecea; color: #8c1d18; border-radius: 6px; padding: 6px 10px; font-size: 12px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #13294b; color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; }
#toast.show { opacity: 1; }
.logo-prev { max-height: 70px; max-width: 260px; border: 1px dashed #c9d1dc; padding: 4px; background: #fff; }
.empty { text-align: center; color: #6b7685; padding: 30px; }
@media (max-width: 900px) { .g4, .g6 { grid-template-columns: repeat(2, minmax(0,1fr)); } .stats { grid-template-columns: repeat(2,1fr); } .g3 { grid-template-columns: 1fr; } }

.badge.w-Received { background: #fff3d6; color: #8a5a00; } .badge.w-Linked { background: #e3efff; color: #1d5fbf; }
.badge.w-Shipped { background: #ede4ff; color: #5b34b0; } .badge.w-Released { background: #ddf5e3; color: #1f7a36; }
.badge.haz { background: #ffe1cc; color: #9a3a00; }
.selbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 34px; margin-bottom: 8px; padding: 6px 10px; background: #f3f7fd; border-radius: 6px; }
.picker { margin-top: 14px; border: 2px solid #8db4ef; border-radius: 8px; padding: 12px; background: #f7faff; }
.linked-box { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: #f3f7fd; border-radius: 8px; padding: 10px 12px; }

.badge.itn-ok { background: #ddf5e3; color: #1f7a36; } .badge.itn-ex { background: #e3efff; color: #1d5fbf; } .badge.itn-miss { background: #fde3e1; color: #b3261e; }
.msg.warnc { color: #8a5a00; } .msg ul { margin: 4px 0 6px 18px; padding: 0; }
.sli-table tr.sl-sub td { padding-bottom: 10px; border-bottom: 1px solid #e2e7ee; }
.sub-grid { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; } .sub-grid label.f { width: 130px; } .sub-grid .muted { align-self: center; }

/* carrier tracking numbers on the warehouse receipt form */
.trk-scanrow { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.trk-scan-f { flex: 1; min-width: 280px; }
#trk-scan { font-size: 16px; padding: 10px 12px; font-family: Consolas, 'DejaVu Sans Mono', monospace; letter-spacing: .5px; border: 2px solid #1d5fbf; }
#trk-scan:focus { outline: 3px solid #bcd5ff; background: #f7fbff; }
.trk-msg { min-height: 20px; margin: 6px 0 8px; font-size: 13px; }
.trk-msg.ok { color: #1f7a36; } .trk-msg.warn { color: #8a5a00; font-weight: 600; } .trk-msg.err { color: #b3261e; font-weight: 600; }
.trk-count { font-size: 13px; color: #4a5668; }
.trk-table input { font-family: Consolas, 'DejaVu Sans Mono', monospace; }
.trk-table tr.trk-flash td { animation: trkflash 1.6s ease-out; }
@keyframes trkflash { from { background: #fff1b8; } to { background: transparent; } }
