* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Arial, sans-serif; font-size: 13px; background: #f0f2f5; color: #1a1a2e; }
a { color: #16214d; }
.topbar { background: #16214d; color: white; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.topbar h1 { font-size: 16px; }
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-logo { height: 30px; background: #fff; padding: 4px 8px; border-radius: 5px; display: block; }
.login-logo { display: block; height: 46px; margin: 0 auto 16px; }
.topbar-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar-nav a { color: #cfd6ee; font-size: 12px; text-decoration: none; }
.topbar-nav a:hover { color: white; text-decoration: underline; }
.topbar a.logout { color: #cfd6ee; font-size: 12px; text-decoration: none; }
.topbar .who { color: #8f9bc4; font-size: 11px; }
.container { max-width: 1180px; margin: 0 auto; padding: 22px; }
.card { background: white; border: 1px solid #dde1e7; border-radius: 6px; margin-bottom: 18px; }
.card-head { padding: 12px 16px; border-bottom: 1px solid #eee; font-weight: bold; background: #f7f9fb; border-radius: 6px 6px 0 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-body { padding: 16px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 760px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { background: #16214d; color: white; padding: 8px 10px; text-align: left; }
td { padding: 7px 10px; border-bottom: 1px solid #eee; vertical-align: middle; }
tr:hover td { background: #f8faff; }
.btn { display: inline-block; padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: bold; text-decoration: none; }
.btn-primary { background: #16214d; color: white; }
.btn-primary:hover { background: #0f1836; }
.btn-secondary { background: white; border: 1px solid #16214d; color: #16214d; }
.btn-danger { background: #b3261e; color: white; }
.btn-success { background: #157347; color: white; }
.btn-sm { padding: 5px 12px; font-size: 11.5px; }
input, select, textarea { padding: 7px 9px; border: 1px solid #ccd2dc; border-radius: 4px; font-size: 13px; width: 100%; font-family: inherit; }
input[readonly] { background: #f2f4f7; color: #555; }
label { display: block; font-weight: bold; margin: 10px 0 4px; font-size: 12px; color: #16214d; }
.form-row { margin-bottom: 10px; }
.row-grid { display: grid; gap: 10px 14px; align-items: end; }
.row-grid-2 { grid-template-columns: repeat(2, 1fr); }
.row-grid-3 { grid-template-columns: repeat(3, 1fr); }
.row-grid-4 { grid-template-columns: repeat(4, 1fr); }
.row-grid > .form-row { display: flex; flex-direction: column; margin-bottom: 0; }
.row-grid > .form-row > label { margin-top: 0; flex: 0 0 auto; }
.row-grid > .form-row > input,
.row-grid > .form-row > select,
.row-grid > .form-row > textarea { margin-top: auto; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: bold; white-space: nowrap; }
.badge-NEW { background: #cfe2ff; color: #084298; }
.badge-DELIVERY_SET { background: #fff3cd; color: #856404; }
.badge-PICKUP_SCHEDULED { background: #d8c7f5; color: #4b2e83; }
.badge-STAGED { background: #c9e6d5; color: #0f5132; }
.badge-COLLECTED { background: #16214d; color: white; }
.badge-CANCELLED { background: #f8d7da; color: #842029; }
.badge-kind { background: #e4e8ef; color: #16214d; }
.error { background: #fdecea; color: #b3261e; padding: 10px 14px; border-radius: 4px; margin-bottom: 12px; font-size: 12.5px; }
.notice { background: #e7f1ff; color: #084298; padding: 10px 14px; border-radius: 4px; margin-bottom: 12px; font-size: 12.5px; }
.success { background: #d1e7dd; color: #0f5132; padding: 10px 14px; border-radius: 4px; margin-bottom: 12px; font-size: 12.5px; }
.warn-banner { background: #fff3cd; color: #856404; padding: 10px 14px; border-radius: 4px; margin-bottom: 12px; font-size: 12.5px; font-weight: bold; }
.hint { color: #888; font-size: 11.5px; margin-top: 4px; }

/* how-to-use help box */
details.help { background: #e7f1ff; border: 1px solid #bcd4ff; border-radius: 6px; margin-bottom: 16px; font-size: 12.5px; }
details.help > summary { cursor: pointer; padding: 10px 14px; font-weight: bold; color: #084298; list-style: none; }
details.help > summary::-webkit-details-marker { display: none; }
details.help > summary::before { content: "\2753  "; }
details.help[open] > summary { border-bottom: 1px solid #bcd4ff; }
details.help .help-body { padding: 12px 16px; color: #1a2a4d; }
details.help .help-body p { margin: 0 0 8px; }
details.help .help-body ol, details.help .help-body ul { margin: 0 0 0 18px; }
details.help .help-body li { margin: 5px 0; }
details.help .help-body strong { color: #16214d; }
.login-wrap { max-width: 340px; margin: 80px auto; }
.center { text-align: center; }
.muted { color: #888; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.actions-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 5px 12px; font-size: 12.5px; }
.kv dt { font-weight: bold; color: #16214d; }
.kv dd { color: #333; }
.timeline { list-style: none; font-size: 12px; }
.timeline li { padding: 6px 0; border-bottom: 1px solid #f0f0f0; }
.timeline .t { color: #999; font-size: 11px; }

/* dashboard stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: white; border: 1px solid #dde1e7; border-radius: 6px; padding: 16px; text-decoration: none; display: block; }
.stat:hover { border-color: #16214d; }
.stat .n { font-size: 30px; font-weight: bold; color: #16214d; line-height: 1; }
.stat .l { color: #666; font-size: 12px; margin-top: 6px; }

/* sortable / filterable tables */
th.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
th.th-sort:hover { background: #24325f; }
th.th-sort::after { content: " ⇅"; opacity: .35; font-size: 10px; }
th.th-sort.sorted-asc::after { content: " ↑"; opacity: 1; }
th.th-sort.sorted-desc::after { content: " ↓"; opacity: 1; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 12px 16px; background: #f7f9fb; border-bottom: 1px solid #eee; }
.filter-bar .f { display: flex; flex-direction: column; gap: 3px; }
.filter-bar .f label { margin: 0; font-size: 11px; }
.filter-bar .f input, .filter-bar .f select { width: auto; min-width: 130px; }
.filter-bar .f.grow { flex: 1; min-width: 180px; }
.filter-bar .f.grow input { width: 100%; }
.filter-note { color: #888; font-size: 11.5px; padding: 6px 16px 0; }

/* bulk assign bar */
.assign-bar { background: #eef2fb; border: 1px solid #c9d4ee; border-radius: 6px; padding: 12px 16px; margin-bottom: 14px; display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.assign-bar .f { display: flex; flex-direction: column; gap: 3px; }
.assign-bar .f label { margin: 0; font-size: 11px; }
.assign-bar .f input, .assign-bar .f select { width: auto; min-width: 160px; }
.assign-bar .sel-count { font-weight: bold; color: #16214d; font-size: 13px; }
.assign-bar .spacer { flex: 1; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
td.cell-input input { padding: 5px 7px; font-size: 12px; min-width: 90px; }
tr.norows td { color: #888; text-align: center; }

/* staging board */
.board-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.board-nav a { padding: 6px 12px; border-radius: 6px; background: #e4e8ef; color: #16214d; text-decoration: none; font-size: 12px; font-weight: bold; }
.board-nav a.active { background: #16214d; color: white; }
.grp { background: white; border: 1px solid #dde1e7; border-radius: 6px; margin-bottom: 16px; overflow: hidden; }
.grp-head { background: #16214d; color: white; padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.grp-head .tname { font-size: 15px; font-weight: bold; }
.grp-head .tmeta { color: #b9c2e0; font-size: 12px; }
.grp-tot { color: #cfd6ee; font-size: 12px; }
.pickcard { border-bottom: 1px solid #eee; padding: 10px 16px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pickcard:last-child { border-bottom: none; }
.pickcard .who2 { font-weight: bold; color: #16214d; }
.pickcard .addr { color: #555; font-size: 12px; max-width: 420px; }
.pickcard .load { font-size: 12px; color: #333; }
.pickcard .stg { font-size: 12px; }
.stg-loc { display: inline-block; background: #eef6ff; border: 1px solid #cfe2ff; color: #084298; border-radius: 4px; padding: 1px 8px; font-weight: bold; }
.stg-none { color: #b3261e; font-weight: bold; }
