/* =====================================================================
   VN⇄KR Logistics — design tokens
   ===================================================================== */
:root {
  --bg: #faf5f5;
  --surface: #ffffff;
  --surface-2: #f7eff0;
  --border: #eddcdf;
  --border-strong: #d9c2c6;
  --text: #1f1115;
  --text-2: #4a3237;
  --muted: #85686d;
  --primary: #c8102e;
  --primary-600: #e11d34;
  --primary-50: #fef0f1;
  --success: #15803d;
  --success-50: #ecfdf3;
  --warning: #b45309;
  --warning-50: #fffbeb;
  --danger: #7f1d1d;
  --danger-50: #fdecec;
  --info-50: #fff3f4;
  --sidebar: #1f0a0d;
  --sidebar-2: #35151a;
  --sidebar-text: #ebd3d6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 1px 3px rgba(0, 0, 0, .06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .16);
  --tap: 40px;
  color-scheme: light;
  accent-color: var(--primary);
}
@media (pointer: coarse) { :root { --tap: 44px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.no-scroll { overflow: hidden; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.strong { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.error-text { color: var(--danger); }
.spacer { flex: 1; }
.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -3px; }

/* ---------------- Buttons & inputs ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--primary); background: var(--primary); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--primary-600); text-decoration: none; }
.btn:focus-visible, .icon-btn:focus-visible, .chip:focus-visible, .tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:disabled, .btn.is-busy { opacity: .6; cursor: progress; }
.btn--ghost { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: #5f1414; }
.btn--danger-text { color: var(--danger); }
.btn--light { background: #fff; color: var(--primary); border-color: #fff; }
.btn--lg { min-height: 48px; padding: 0 22px; font-size: 1rem; }
.btn--sm { min-height: 32px; padding: 0 10px; font-size: .82rem; }
.btn--block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; }

input, select, textarea {
  width: 100%; min-height: var(--tap); padding: 8px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(200, 16, 46, .15); }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: .8rem; font-weight: 600; color: var(--text-2); }
.field--full { grid-column: 1 / -1; }
.field--wide { grid-column: span 2; }
.req { color: var(--danger); }
.hint { color: var(--muted); font-size: .8rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.input-group { display: flex; gap: 6px; }
.dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row select { width: auto; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.check-group { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; cursor: pointer; }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.fieldset legend { font-weight: 700; padding: 0 6px; }

/* ---------------- Language switch ---------------- */
.lang-switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.lang-btn { border: 0; background: var(--surface); color: var(--muted); padding: 6px 10px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; min-height: 32px; }
.lang-btn + .lang-btn { border-left: 1px solid var(--border-strong); }
.lang-btn.active { background: var(--primary); color: #fff; }

/* ---------------- Brand ---------------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #c8102e, #ff5a4d); color: #fff; font-size: .8rem; letter-spacing: .02em; }

/* ---------------- Login ---------------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login__brand-panel {
  background: radial-gradient(circle at 20% 20%, #b3122c 0, #1f0a0d 60%); color: #fff;
  padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 18px;
}
.login__brand-panel h1 { font-size: 2.2rem; max-width: 520px; }
.login__brand-panel p { color: #fbd5da; max-width: 480px; font-size: 1.05rem; margin: 0; }
.login__brand-panel .btn { align-self: flex-start; }
.brand--light { color: #fff; margin-bottom: 24px; }
.login__form-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; gap: 20px; position: relative; }
.login__form-panel .lang-switch { position: absolute; top: 20px; right: 20px; }
.login__card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.login__card h2 { font-size: 1.4rem; margin-bottom: 4px; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login__brand-panel { padding: 28px 22px; }
  .login__brand-panel h1 { font-size: 1.5rem; }
  .brand--light { margin-bottom: 6px; }
}

/* ---------------- App shell ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 18px 12px; z-index: 30; transition: transform .2s ease;
}
.sidebar .brand { color: #fff; padding: 0 8px 18px; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.sidebar__footer { border-top: 1px solid var(--sidebar-2); padding-top: 10px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-weight: 500; text-decoration: none;
}
.nav-item:hover { background: var(--sidebar-2); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item--muted { font-size: .85rem; opacity: .8; }
.nav-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: #f59e0b; color: #111827; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.nav-item.active .nav-badge { background: #fff; color: var(--primary); }
.sidebar-backdrop { display: none; }
.app__main { flex: 1; margin-left: 248px; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.topbar__menu { display: none; }
.topbar__title { font-weight: 700; font-size: 1.05rem; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid var(--border); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.user-chip__text { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip__text small { color: var(--muted); }
.content { padding: 24px; max-width: 1320px; width: 100%; margin: 0 auto; }

.bell { position: relative; }
.bell__count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.bell__panel { position: absolute; right: 0; top: 46px; width: 340px; max-height: 420px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 40; }
.bell__title { padding: 12px 14px; font-weight: 700; border-bottom: 1px solid var(--border); }
.bell__panel ul { list-style: none; margin: 0; padding: 0; }
.bell__panel li { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; font-size: .88rem; }
.bell__panel li[data-pkg] { cursor: pointer; }
.bell__panel li[data-pkg]:hover { background: var(--surface-2); }
.bell__panel li.unread { background: var(--info-50); }
.bell__panel li time { color: var(--muted); font-size: .75rem; }
.bell__panel li.empty { color: var(--muted); }

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 25; }
  .app__main { margin-left: 0; }
  .topbar { padding: 0 12px; }
  .topbar__menu { display: inline-grid; }
  .content { padding: 16px 12px 80px; }
}
@media (max-width: 640px) {
  .user-chip__text { display: none; }
  .topbar .lang-switch .lang-btn { padding: 6px 7px; }
}

/* ---------------- Page building blocks ---------------- */
.view { display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head p { margin: 4px 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-actions select { width: auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card__title { font-size: .95rem; font-weight: 700; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.section-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; list-style: none; }
.empty .icon { width: 32px; height: 32px; opacity: .5; }
.empty p { margin: 8px 0 0; }
.banner { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--info-50); color: #7f1d1d; border: 1px solid #fbc6cd; font-size: .9rem; }
.banner--warn { background: var(--warning-50); color: var(--warning); border-color: #fde68a; }
.banner--ok { background: var(--success-50); color: var(--success); border-color: #bbf7d0; }
@media (max-width: 860px) {
  .grid-2, .form-grid--4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
}
@media (min-width: 861px) and (max-width: 1180px) { .form-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------- Steps / tabs / chips / segmented ---------------- */
.steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 8px 0 0; counter-reset: s; }
.steps li { counter-increment: s; display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text-2); }
.steps li::before { content: counter(s); width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .7rem; font-weight: 700; }
.steps li + li::after { order: -1; content: '›'; color: var(--muted); margin-right: 2px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; max-width: 100%; }
.tabs--scroll { overflow-x: auto; scrollbar-width: thin; }
.tab { border: 0; background: none; padding: 10px 14px; min-height: var(--tap); font: inherit; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab--active { color: var(--primary); border-bottom-color: var(--primary); }
.tab__count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: .72rem; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 4px 12px; min-height: 32px; font: inherit; font-size: .82rem; font-weight: 500; cursor: pointer; }
.chip:hover { border-color: var(--primary); }
.chip--active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip__count { opacity: .7; margin-left: 2px; font-variant-numeric: tabular-nums; }

.segmented { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--border); }
.segmented button { border: 0; background: transparent; border-radius: 8px; padding: 0 14px; min-height: 36px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.segmented button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.segmented--lg { display: flex; }
.segmented--lg button { flex: 1; justify-content: center; min-height: 46px; }

/* ---------------- Status pills ---------------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.pill--RECEIVED_AT_ORIGIN, .pill--CUSTOMS_ORIGIN, .pill--BAGGED, .pill--DISPATCHED, .pill--IN_TRANSIT, .pill--ARRIVED_DESTINATION,
.pill--CUSTOMS_DESTINATION, .pill--AT_LOCAL_HUB, .pill--OUT_FOR_DELIVERY, .pill--bag-OPEN, .pill--asg-ASSIGNED, .pill--req-CONTACTED { background: var(--primary-50); color: var(--primary); border-color: #fbc6cd; }
.pill--DELIVERED, .pill--bag-DISPATCHED, .pill--asg-COMPLETED, .pill--req-CONVERTED { background: var(--success-50); color: var(--success); border-color: #bbf7d0; }
.pill--DELIVERY_FAILED, .pill--RETURNED, .pill--CANCELLED, .pill--LOST, .pill--asg-FAILED, .pill--req-REJECTED { background: var(--danger-50); color: var(--danger); border-color: #fecaca; }
.pill--bag-SEALED, .pill--req-PENDING, .pill--WAIT_CONFIRMATION, .pill--FLIGHT_DELAYED { background: var(--warning-50); color: var(--warning); border-color: #fde68a; }
.pay { font-size: .85rem; }
.pay--PAID { color: var(--success); font-weight: 600; }
.pay--UNPAID { color: var(--warning); }

/* ---------------- KPI tiles + bar charts (dashboard) ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.kpi { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi__icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; }
.kpi__value { display: block; font-size: 1.45rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__label { display: block; font-size: .8rem; color: var(--muted); }

.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bar-list li { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 40px; align-items: center; gap: 10px; font-size: .85rem; }
.bar-list__label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-list__track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar-list__bar { display: block; height: 100%; background: var(--primary); border-radius: 0 4px 4px 0; }
.bar-list__value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.col-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 200px; align-items: end; padding-top: 8px; border-bottom: 1px solid var(--border); }
.col-chart__col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; position: relative; padding-bottom: 22px; }
.col-chart__bar { width: 60%; max-width: 36px; background: var(--primary); border-radius: 4px 4px 0 0; }
.col-chart__value { font-size: .78rem; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.col-chart__label { position: absolute; bottom: 0; font-size: .75rem; color: var(--muted); }

/* ---------------- Filters / tables / pagination ---------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters select { width: auto; }
.filters__search { flex: 1 1 260px; position: relative; display: flex; align-items: center; }
.filters__search .icon { position: absolute; left: 12px; color: var(--muted); }
.filters__search input { padding-left: 38px; }
.filters__date { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.filters__date input { width: auto; }
#status-chips { margin-bottom: 8px; }

.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .sub { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #fff8f8; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn + .btn { margin-left: 6px; }
.pagination { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; font-size: .85rem; }
.pagination__controls { display: flex; align-items: center; gap: 8px; }
.pagination__controls select { width: auto; min-height: 32px; padding: 4px 8px; }

/* Tables turn into stacked cards on phones (each cell shows its column name). */
@media (max-width: 760px) {
  .table--responsive thead { display: none; }
  .table--responsive, .table--responsive tbody, .table--responsive tr, .table--responsive td { display: block; width: 100%; }
  .table--responsive tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; padding: 6px 4px; background: var(--surface); }
  .table--responsive td { border: 0; padding: 6px 10px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table--responsive td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; text-align: left; flex-shrink: 0; }
  .table--responsive td > .cell { min-width: 0; }
  .table--responsive td.row-actions { justify-content: flex-end; }
  .table--responsive td.row-actions::before { content: none; }
}

.menu { position: relative; }
.menu__panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 4px; z-index: 15; }
.menu__panel button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 6px; font: inherit; cursor: pointer; }
.menu__panel button:hover { background: var(--surface-2); }

/* ---------------- Create package ---------------- */
.sticky-actions {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255, 255, 255, .95); backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
}
#total-charge { font-size: 1.2rem; }

/* ---------------- Drawer ---------------- */
.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: var(--bg); box-shadow: var(--shadow-lg); animation: drawer-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer__body { height: 100%; display: flex; flex-direction: column; }
.drawer__header { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; background: var(--surface); }
.drawer__code { font-size: 1.3rem; font-weight: 700; }
.drawer__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 6px; font-size: .85rem; color: var(--text-2); }
.drawer__actions { display: flex; gap: 2px; }
.drawer__body > .progress, .drawer__body > .tabs { background: var(--surface); padding-left: 20px; padding-right: 20px; }
.drawer__content { flex: 1; overflow-y: auto; padding: 16px 20px 32px; display: flex; flex-direction: column; gap: 14px; }

.progress { list-style: none; margin: 0; padding: 4px 0 14px; display: grid; grid-template-columns: repeat(5, 1fr); }
.progress li { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; text-align: center; font-size: .75rem; color: var(--muted); }
.progress li::before { content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--border-strong); z-index: 0; }
.progress li:first-child::before { display: none; }
.progress li.done::before, .progress li.current::before { background: var(--primary); }
.progress__dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-strong); font-weight: 700; font-size: .75rem; }
.progress__dot .icon { width: 14px; height: 14px; }
.progress li.done .progress__dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.progress li.current .progress__dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.progress li.current { color: var(--text); font-weight: 600; }
.progress li.problem .progress__dot { border-color: var(--danger); color: var(--danger); box-shadow: 0 0 0 4px var(--danger-50); }
.progress--halted { display: block; padding: 6px 0 12px; }

.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.info-card h4 { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.info-card__name { font-weight: 700; font-size: 1.05rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv--2 { grid-template-columns: max-content 1fr; }
.kv-inline { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; color: var(--text-2); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline__item, .timeline--compact li { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 10px 0 10px 16px; border-left: 2px solid var(--border); position: relative; font-size: .88rem; }
.timeline__item::before { content: ''; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); border: 2px solid var(--bg); }
.timeline__item--status::before { background: var(--primary); }
.timeline__item--note::before { background: #f59e0b; }
.timeline time, .timeline--compact time { color: var(--muted); font-size: .78rem; }
.timeline--compact li { grid-template-columns: 130px 1fr; padding: 6px 0 6px 12px; }
@media (max-width: 560px) { .timeline__item, .timeline--compact li { grid-template-columns: 1fr; gap: 2px; } }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gallery__item { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; position: relative; }
.gallery__item img, .gallery__doc { display: block; width: 100%; height: 120px; object-fit: cover; background: var(--surface-2); }
.gallery__doc { display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.gallery__doc .icon { width: 32px; height: 32px; }
.gallery__item figcaption { padding: 8px; font-size: .75rem; display: flex; flex-direction: column; gap: 2px; color: var(--muted); }
.gallery__item figcaption strong { color: var(--text); }
.gallery__del { position: absolute; top: 4px; right: 4px; background: rgba(255, 255, 255, .9); width: 32px; height: 32px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs figure { margin: 0; width: 88px; text-align: center; font-size: .7rem; color: var(--muted); }
.thumbs img { width: 88px; height: 88px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ---------------- Modals ---------------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); }
.modal__dialog { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); animation: modal-in .16s ease-out; }
.modal__dialog--sm { width: min(420px, 100%); }
.modal__dialog--md { width: min(640px, 100%); }
.modal__dialog--lg { width: min(920px, 100%); }
@keyframes modal-in { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--border); }
.modal__header h3 { font-size: 1.05rem; }
.modal__body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal__body p { margin: 0; }
.modal__footer { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal__footer .hint { margin-right: auto; }
@media (max-width: 640px) {
  .modal { padding: 0; place-items: end stretch; }
  .modal__dialog, .modal__dialog--sm, .modal__dialog--md, .modal__dialog--lg { width: 100%; max-height: 94vh; border-radius: 16px 16px 0 0; }
}

/* ---------------- Scanner ---------------- */
.scanner { display: flex; flex-direction: column; gap: 12px; }
.scanner__viewport { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.scanner__viewport video { width: 100%; height: 100%; object-fit: cover; }
.scanner__frame { position: absolute; inset: 18% 22%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); }
.scanner__status { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; color: #fff; margin: 0; text-shadow: 0 1px 2px #000; }

.scanner__status--ok, .scanner__status--error { left: 10px; right: 10px; bottom: 10px; padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 700; text-shadow: none; }
.scanner__status--ok { background: var(--success); }
.scanner__status--error { background: var(--danger); }

/* ---------------- Bag QR label ---------------- */
.bag-qr { text-align: center; max-width: 100%; }
.bag-qr .label-a5__header { text-align: left; }
.bag-qr__code { display: grid; place-items: center; min-height: 220px; margin: 6px 0; }
.bag-qr .qr-canvas { width: 220px !important; height: 220px !important; }
.bag-qr__meta { font-weight: 700; font-size: 14px; }

/* ---------------- Toasts ---------------- */
.toasts { position: fixed; z-index: 80; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--text); color: #fff; box-shadow: var(--shadow-lg); font-size: .9rem; animation: modal-in .16s ease-out; }
.toast--success { background: var(--success); }
.toast--error { background: var(--danger); }
.toast--out { opacity: 0; transform: translateY(6px); transition: all .25s; }
@media (max-width: 640px) { .toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; } }

/* ---------------- Warehouse ---------------- */
.scan-panel { display: flex; flex-direction: column; gap: 14px; }
.scan-panel__top { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.scan-panel__top .field { flex: 1 1 280px; }
.scan-panel__stats { display: flex; gap: 32px; }
.scan-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 120px; border: 2px dashed #f2a0ab; border-radius: var(--radius); background: var(--primary-50); color: var(--primary); font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.scan-button .icon { width: 40px; height: 40px; }
.scan-button:hover { background: #fde0e4; }
.scan-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.scan-feed__item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: .88rem; }
.scan-feed__item div { flex: 1; display: flex; flex-direction: column; }
.scan-feed__item span { color: inherit; opacity: .85; }
.scan-feed__item time { font-size: .75rem; opacity: .7; }
.scan-feed__item--ok { background: var(--success-50); color: var(--success); }
.scan-feed__item--error { background: var(--danger-50); color: var(--danger); }
.scan-feed__item:first-child { box-shadow: 0 0 0 2px currentColor inset; }

/* ---------------- Requests / driver cards ---------------- */
.request-list, .job-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 14px; }
.request-card, .job { display: flex; flex-direction: column; gap: 10px; }
.request-card p { margin: 0; }
.request-card, .request-card * { min-width: 0; overflow-wrap: anywhere; }
.request-card__head, .job__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.job__receiver { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.job__name { font-size: 1.15rem; font-weight: 700; }
.job__addr { color: var(--text-2); }
.cod { color: var(--warning); font-weight: 700; }
.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px var(--primary); } 100% { box-shadow: var(--shadow); } }
.signature { width: 100%; height: 160px; border: 2px dashed var(--border-strong); border-radius: var(--radius-sm); background: #fff; touch-action: none; }

/* ---------------- Public page ---------------- */
.public { min-height: 100vh; display: flex; flex-direction: column; }
/* Header colours are taken from the logo's own gradient (peach -> pink) so the logo blends in; the rest fades to the banner's pink. */
.public__header { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; background: linear-gradient(90deg, #fde9eb, #f8c9cf 55%, #f1a5ae 100%); border-bottom: 1px solid rgba(200, 16, 46, .18); }
.public__header .topbar__right { margin-left: auto; }
.public__main { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px 40px; display: flex; flex-direction: column; gap: 20px; }
.public__footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 20px; }
.hero { text-align: center; padding: 40px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hero h1 { font-size: 2rem; }
.hero p { color: var(--muted); max-width: 560px; margin: 0; }
.hero__card { width: 100%; max-width: 640px; margin-top: 14px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: left; }
.hero__card .segmented { align-self: center; }
.track-form { display: flex; gap: 8px; }
.track-form input:first-child { flex: 2; }
.track-form input[name="phoneLast4"] { flex: 1; min-width: 120px; }
@media (max-width: 640px) { .track-form { flex-direction: column; } .hero h1 { font-size: 1.5rem; } .hero { padding-top: 24px; } .public__header { padding: 10px 12px; } }
.track-result { display: flex; flex-direction: column; gap: 14px; }
.track-result__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
#request-section h2 { margin-bottom: 4px; }

/* ---------------- Printable A5 label ---------------- */
.label-a5 { color: #0b1220; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; padding: 14px; font-size: 12px; max-width: 128mm; margin: 0 auto; }
.label-a5__header { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #0b1220; padding-bottom: 6px; }
.label-a5__brand { font-weight: 800; font-size: 14px; }
.label-a5__route { font-weight: 700; }
.label-a5__code { font-size: 22px; font-weight: 800; letter-spacing: .02em; margin: 8px 0; font-family: ui-monospace, Consolas, monospace; }
.label-a5__qr-row { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.label-a5__qr .qr-canvas { width: 110px !important; height: 110px !important; display: block; }
.label-a5__qr-text { font-size: 11px; color: #475569; }
.label-a5__token { font-family: ui-monospace, Consolas, monospace; word-break: break-all; color: #0b1220; }
.label-a5__parties { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.label-a5 .party { border: 1px solid #cbd5e1; border-radius: 6px; padding: 6px 8px; }
.label-a5 .party__label { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.label-a5 .party__name { font-weight: 700; font-size: 13px; }
.label-a5__meta { width: 100%; border-collapse: collapse; font-size: 11px; }
.label-a5__meta th, .label-a5__meta td { border: 1px solid #cbd5e1; padding: 3px 5px; text-align: left; }
.label-a5__meta th { background: #f1f5f9; font-weight: 600; color: #475569; white-space: nowrap; }
.label-a5__privacy { font-size: 9px; color: #94a3b8; margin-top: 8px; border-top: 1px dashed #cbd5e1; padding-top: 4px; }

/* Phones: the label preview must fit the screen width (no clipped text). */
.label-a5, .label-a5 * { min-width: 0; overflow-wrap: anywhere; }
.label-a5__header { flex-wrap: wrap; gap: 4px 10px; }
.label-a5__code { font-size: clamp(16px, 5.5vw, 22px); }
.label-a5__meta { table-layout: fixed; }
.label-a5__meta th { white-space: normal; }
@media (max-width: 640px) {
  .modal__body { padding: 14px 12px; }
  .label-a5 { padding: 10px; max-width: 100%; }
  .label-a5__qr-row { flex-direction: column; align-items: flex-start; }
  .label-a5__parties { grid-template-columns: 1fr; }
  .label-a5__meta, .label-a5__meta tbody, .label-a5__meta tr { display: block; width: 100%; }
  .label-a5__meta tr { display: grid; grid-template-columns: auto 1fr; border: 1px solid #cbd5e1; border-bottom: 0; }
  .label-a5__meta tr:last-child { border-bottom: 1px solid #cbd5e1; }
  .label-a5__meta th, .label-a5__meta td { border: 0; border-bottom: 1px solid #e2e8f0; }
  .label-a5__meta tr > :nth-last-child(-n+2) { border-bottom: 0; }
  .bag-qr .qr-canvas, .bag-qr__code canvas, .bag-qr__code img { width: min(220px, 70vw) !important; height: auto !important; aspect-ratio: 1; }
  .bag-qr__code { min-height: 0; }
}

@media print {
  @page { size: A5; margin: 8mm; }
  @page wide { size: A4 landscape; margin: 10mm; }
  #global-print-area.print-landscape { page: wide; }
  html, body { height: 0 !important; overflow: hidden !important; background: #fff !important; }
  body * { visibility: hidden !important; }
  /* Belt and braces: nothing but the print area takes part in printing (no sidebar, login panel, modal overlay or other coloured backgrounds). */
  body > *:not(#global-print-area) { display: none !important; }
  #global-print-area, #global-print-area * { visibility: visible !important; }
  #global-print-area { display: block !important; position: absolute !important; inset: 0; background: #fff !important; height: auto !important; overflow: visible !important; color: #0b1220; font-size: 11px; }
  .label-a5 { border: 0; max-width: 100%; padding: 0; }
  .print-table { width: 100%; border-collapse: collapse; font-size: 10px; }
  .print-table th, .print-table td { border: 1px solid #94a3b8; padding: 3px 5px; text-align: left; }
}


/* ---------------- Promotions: slideshow (public) ---------------- */
.slideshow { position: relative; overflow: hidden; border-radius: var(--radius); background: #1f0a0d; box-shadow: var(--shadow-lg); margin-top: 16px; touch-action: pan-y; user-select: none; }
.slideshow__track { display: flex; transition: transform .5s ease; }
.slide { position: relative; flex: 0 0 100%; display: block; aspect-ratio: 16 / 6; color: #fff; text-decoration: none; }
.slide:hover { text-decoration: none; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.slide__caption { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 2px; padding: 28px 56px 30px 24px; background: linear-gradient(transparent, rgba(31, 10, 13, .85)); }
.slide__caption strong { font-size: 1.5rem; line-height: 1.2; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.slide__caption span { font-size: 1rem; opacity: .95; }
.slide__cta { font-style: normal; font-weight: 700; margin-top: 4px; }
.slideshow__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .85); color: var(--primary); font-size: 1.6rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0 0 3px; }
.slideshow__nav:hover { background: #fff; }
.slideshow__nav--prev { left: 10px; }
.slideshow__nav--next { right: 10px; }
.slideshow__dots { position: absolute; right: 14px; bottom: 12px; display: flex; gap: 6px; }
.slideshow__dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .5); cursor: pointer; }
.slideshow__dot.active { background: #fff; transform: scale(1.25); }
.slideshow--lg .slide { aspect-ratio: 16 / 8; }
.modal--promo .modal__body { padding: 0; }
.modal--promo .slideshow { margin: 0; border-radius: 0 0 14px 14px; box-shadow: none; }
@media (max-width: 640px) {
  .slide, .slideshow--lg .slide { aspect-ratio: 4 / 3; }
  .slide__caption { padding: 20px 16px 28px; }
  .slide__caption strong { font-size: 1.15rem; }
  .slideshow__nav { width: 34px; height: 34px; }
  /* Popup: show the whole picture (no cropping) and keep it inside the screen; caption sits under it */
  .modal--promo .modal__dialog { max-height: 88vh; }
  .modal--promo .slide { aspect-ratio: auto; display: flex; flex-direction: column; justify-content: center; background: #1f0a0d; }
  .modal--promo .slide img { height: auto; max-height: calc(88vh - 190px); object-fit: contain; }
  .modal--promo .slide__caption { position: static; background: #1f0a0d; padding: 10px 16px 34px; }
  .modal--promo .slideshow__nav { top: 35%; }
}

/* ---------------- Promotions: staff screen ---------------- */
.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.promo-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.promo-card--off .promo-card__img { filter: grayscale(.7); opacity: .7; }
.promo-card__img { width: 100%; aspect-ratio: 16 / 6; object-fit: cover; display: block; background: var(--surface-2); }
.promo-card__body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.promo-card__body p { margin: 0; }
.promo-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.promo-card__head h3 { font-size: 1rem; }
.promo-pill--Live { background: var(--success-50); color: var(--success); border-color: #bbf7d0; }
.promo-pill--Scheduled { background: var(--warning-50); color: var(--warning); border-color: #fde68a; }
.promo-pick { display: flex; flex-direction: column; gap: 8px; }
.promo-pick__preview { aspect-ratio: 16 / 6; border: 2px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); display: grid; place-items: center; text-align: center; overflow: hidden; }
.promo-pick__preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------- TT Express bill label (matches the physical sample) ---------------- */
.bill { max-width: 128mm; padding: 10px 12px; font-family: "Courier New", ui-monospace, monospace; font-size: 12px; border: 1px solid #cbd5e1; }
.bill__top { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 8px; }
.bill__logo { display: flex; flex-direction: column; font-weight: 900; line-height: 1; }
.bill__logo-mark { font-size: 34px; font-style: italic; letter-spacing: -2px; }
.bill__logo-text { font-size: 14px; }
.bill__ref { text-align: right; font-size: 13px; line-height: 1.7; }
.bill__k { font-size: 11px; letter-spacing: .03em; }
.bill__big { font-size: 18px; margin-left: 8px; }
.bill__sec { border-top: 1px dashed #000; padding: 4px 0; }
.bill__row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bill__row--end { margin-top: 14px; }
.bill__name { font-family: Arial, Helvetica, sans-serif; font-weight: 800; font-size: 16px; margin-top: 4px; text-transform: uppercase; }
.bill__addr { text-transform: uppercase; min-height: 3.2em; }
.bill__qr { text-align: center; padding: 8px 0 4px; }
.bill__qr .qr-canvas { width: 120px !important; height: 120px !important; display: block; margin: 0 auto; }
.bill__code { font-family: Arial, Helvetica, sans-serif; font-size: 20px; margin-top: 2px; }
.bill__box { display: inline-block; width: 14px; height: 14px; border: 1px solid #000; border-radius: 2px; text-align: center; line-height: 13px; font-size: 11px; vertical-align: middle; margin: 0 2px 0 6px; }
.bill__pcs { font-family: Arial, Helvetica, sans-serif; font-weight: 800; font-size: 22px; padding-left: 12px; }
.bill__wd > div { margin-bottom: 4px; }
.bill__desc { min-height: 60px; }@media print { .label-a5.bill { border: 0; padding: 0; max-width: 100%; } }

/* ---------------- Round 6: client logo, agency, delayed flight ---------------- */
.brand--logo { padding: 0 8px 18px; }
.brand--logo img { display: block; width: 100%; max-width: 190px; height: auto; border-radius: 10px; background: #fff; }
.sidebar .brand--logo { padding-bottom: 18px; }
.brand--public { padding: 0; }
.brand--public img { width: auto; height: 44px; max-width: 150px; border-radius: 0; background: transparent; }
.login__banner img { display: block; width: 100%; max-width: 560px; height: auto; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.login__banner { margin-bottom: 18px; }
.hero__banner { width: 100%; max-width: 900px; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-lg); margin-bottom: 6px; }
.bill__logo img { display: block; height: 56px; width: auto; filter: grayscale(1) contrast(1.6); }
.pill--FLIGHT_DELAYED { font-weight: 700; }
.cell-agency { font-size: .75rem; color: var(--muted); }
.range-hint { font-size: .85rem; color: var(--muted); margin: 0 0 8px; }
/* ---------------- Round 7: bulk bag bar ---------------- */
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 8px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: .9rem; }
.bulk-bar--on { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.check-col { width: 36px; }
.row-selected { background: var(--primary-50); }

/* ---------------- Bag label: QR + bag number + weight only ---------------- */
.bag-label { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; color: #000; background: #fff; text-align: center; }
.bag-label .qr-canvas { width: 240px !important; height: 240px !important; display: block; margin: 0 auto; }
.bag-label__code { font-family: ui-monospace, Consolas, monospace; font-weight: 800; font-size: 20px; word-break: break-all; }
/* The print area is only for the printer: while the print dialog is open it must not show up on the screen. */
@media screen { #global-print-area { position: fixed; left: -99999px; top: 0; width: 210mm; pointer-events: none; } }

/* Bag label print: A5 portrait page, only the QR and the bag number, centred horizontally and vertically. */
@media print {
  @page bag { size: A5 portrait; margin: 8mm; }
  #global-print-area.print-bag { page: bag; }
  #global-print-area.print-bag .bag-label {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10mm;
    width: 100%; min-height: 192mm; padding: 0; margin: 0; text-align: center;
  }
  #global-print-area.print-bag .bag-label .qr-canvas, #global-print-area.print-bag .bag-label img { width: 100mm !important; height: 100mm !important; display: block; margin: 0 auto; image-rendering: pixelated; }
  #global-print-area.print-bag .bag-label__code { font-size: 30pt; line-height: 1.1; text-align: center; width: 100%; word-break: normal; overflow-wrap: anywhere; }
}
.user-chip { cursor: pointer; }

::selection { background: rgba(200, 16, 46, .2); }
