:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #687282;
  --line: #dfe4ea;
  --primary: #1769e0;
  --primary-dark: #0f55b9;
  --danger: #b42318;
  --ok: #067647;
  --warn: #b54708;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-hover: 0 8px 22px rgba(16, 24, 40, 0.09);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
}

.mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 22px 20px 96px;
}

.auth {
  display: grid;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-card h1,
.section h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

/* Hide page-level large titles across views; keep compact UI text only. */
.section > div > h1,
.section-head > div > h1 {
  display: none;
}

/* Hide top header action button in the same title row. */
.section > div:first-child > button,
.section-head > button {
  display: none;
}

.muted {
  color: var(--muted);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.notif-wrap {
  position: relative;
}

.notif-btn {
  position: relative;
  min-width: 42px;
  display: inline-grid;
  place-items: center;
  color: #0f172a;
}

.notif-btn svg {
  width: 19px;
  height: 19px;
}

.notif-panel {
  position: relative;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-hover);
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  animation: panel-in 200ms ease-out both;
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 6px;
}

.notif-head span {
  color: #6b7280;
  font-size: 13px;
}

.notif-list {
  display: grid;
  gap: 8px;
}

.notif-item {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 12px;
  background: #fff;
  animation: item-in 220ms ease-out both;
}

.notif-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.notif-count {
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #e8f3da;
  color: #166534;
  font-size: 14px;
  font-weight: 700;
}

.notif-action {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #f9fafb;
  color: #1f2937;
  font-weight: 600;
  transition: transform 120ms ease, background 140ms ease, border-color 140ms ease;
}

.notif-action:hover {
  background: #f3f4f6;
  border-color: #cfd4dc;
}

.notif-action:active {
  transform: scale(0.985);
}

.between {
  justify-content: space-between;
}

.section-head,
.card-head,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar {
  justify-content: flex-start;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
  animation: rise-in 180ms ease-out both;
}

.section {
  display: grid;
  gap: 16px;
  animation: fade-in 160ms ease-out both;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab {
  position: relative;
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.tab-icon {
  margin-right: 6px;
}

.tab.active {
  background: #e9f1ff;
  color: var(--primary);
  font-weight: 700;
}

.tab:active,
.bottom-nav button:active,
.button:active {
  transform: scale(0.98);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 6;
  display: none;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -8px 22px rgba(16, 24, 40, 0.07);
}

.bottom-nav button {
  position: relative;
  display: grid;
  gap: 2px;
  place-items: center;
  padding: 9px 4px 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.bottom-nav button.active {
  color: var(--primary);
  font-weight: 700;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: #344054;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: #84c5ff;
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.12);
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  transition: background 140ms ease, transform 120ms ease, box-shadow 140ms ease;
}

.button:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-hover);
}

.button.secondary {
  background: #edf2f7;
  color: #263241;
}

.button.secondary:hover {
  background: #e3e9f0;
}

.button.danger {
  background: var(--danger);
}

.button:disabled,
.button.secondary:disabled {
  cursor: not-allowed;
  background: #f2f4f7;
  color: #98a2b3;
  box-shadow: none;
  transform: none;
}

.button.full {
  width: 100%;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  background: #fff;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #475467;
  background: #f9fafb;
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.cards {
  display: grid;
  gap: 12px;
}

.card {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  animation: rise-in 180ms ease-out both;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.card:hover {
  border-color: #c9d7ea;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.ship-compact {
  margin-top: 6px;
  display: grid;
  gap: 6px;
}

.ship-line {
  color: #4b5563;
  line-height: 1.35;
}

.ship-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ship-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.ship-pill.weight {
  background: #e6f4ea;
  color: #166534;
}

.ship-pill.total {
  background: #e8efff;
  color: #1d4ed8;
}

.ship-pill.track {
  background: #fff0df;
  color: #9a3412;
}

.ship-fee {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.35;
}

.quote-breakdown,
.quote-advanced {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
}

.quote-breakdown summary,
.quote-advanced summary {
  cursor: pointer;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}

.mini-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}

.mini-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-delete-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #e4c2c2;
  background: #fff5f5;
  color: #b42318;
  display: inline-grid;
  place-items: center;
}

.profile-delete-btn:hover {
  background: #ffe8e8;
}

.profile-delete-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.tracking {
  font-size: 18px;
  letter-spacing: 0;
  word-break: break-all;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workbench-summary {
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafb;
}

.queue-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: start;
}

.queue-grid > .panel:first-child {
  grid-row: span 2;
}

.status-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.toolbar > .input,
.toolbar > .select {
  flex: 1 1 220px;
  min-width: 220px;
}

.status-pill {
  border: 0;
  border-radius: 999px;
  min-height: 38px;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 700;
  transition: transform 120ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.status-pill.neutral { background: #eef2f7; color: #334155; }
.status-pill.info { background: #dfe9ff; color: #1e40af; }
.status-pill.ok { background: #dbf2e4; color: #166534; }
.status-pill.pending { background: #f7e2b8; color: #92400e; }
.status-pill.done { background: #d7dee8; color: #334155; }
.status-pill.danger { background: #f6d5dd; color: #9f1239; }

.status-pill.active {
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.3), 0 1px 6px rgba(15, 23, 42, 0.12);
  filter: saturate(1.12);
}

.status-pill.neutral.active { background: #334155; color: #ffffff; }
.status-pill.info.active { background: #1d4ed8; color: #ffffff; }
.status-pill.ok.active { background: #15803d; color: #ffffff; }
.status-pill.pending.active { background: #b45309; color: #ffffff; }
.status-pill.done.active { background: #1f3a5f; color: #ffffff; }
.status-pill.danger.active { background: #be123c; color: #ffffff; }

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  transition: border-color 140ms ease, background 140ms ease, transform 120ms ease;
}

.pill strong {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1849a9;
  font-size: 12px;
}

.pill.active {
  border-color: #84c5ff;
  background: #eff8ff;
  color: var(--primary);
}

.stat {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: left;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.stat:hover,
.stat.active {
  border-color: #84c5ff;
  box-shadow: var(--shadow-hover);
}

.stat.active {
  background: #eff8ff;
  color: var(--primary);
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  font-size: 26px;
}

.badge {
  position: absolute;
  top: -2px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #ff3b30;
  border: 2px solid #fff;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  animation: badge-pulse 1.6s ease-in-out infinite;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #ff3b30;
  border: 2px solid #fff;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
}

.nav-badge.pulse {
  animation: nav-badge-bump 420ms ease;
}

.mobile-cards {
  display: none;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.note-text {
  color: #7a4b00;
  font-size: 13px;
  line-height: 1.35;
}

.copyable {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: #b8c2cf;
}

.copyable:hover {
  text-decoration-color: #1769e0;
}

.exception-box {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #fedf89;
  border-radius: 8px;
  background: #fffaeb;
  color: #7a4b00;
  font-size: 13px;
}

.scanner {
  border-color: var(--line);
  animation: scan-open 180ms ease-out both;
}

.scan-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}

#scanner-video,
#scan-photo-preview {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f5f5f4;
}

#scanner-video {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

#scan-photo-preview {
  max-height: 220px;
  object-fit: cover;
}

.scanner-compact {
  padding: 14px 16px;
}

.flow-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.flow-step {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #d8d8d4;
  background: #f7f7f5;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.flow-step.active {
  border-color: #b8d995;
  background: #e8f3da;
  color: #24351a;
  transform: translateY(-1px);
}

#scanner-video-wrap[hidden] {
  display: none;
}


.status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1849a9;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.status.info {
  background: #eef4ff;
  color: #1849a9;
}

.status.ok {
  background: #ecfdf3;
  color: var(--ok);
}

.status.pending {
  background: #ffe9bf;
  color: #8c3a06;
}

.status.warn {
  background: #ffdca3;
  color: #6f3b00;
}

.status.danger {
  background: #ffd3db;
  color: #972217;
}

.status.done {
  background: #d9dfe8;
  color: #253244;
}

.status.neutral {
  background: #f8fafc;
  color: #64748b;
}

.notice {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #d8d8d4;
  background: #f7f7f5;
  color: #1f2937;
}

.quote-preview strong {
  color: #0f55b9;
}

.error {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #fda29b;
  background: #fff7f7;
  color: var(--danger);
}

.exception-box.new-msg {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.success {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #86efac;
  background: #ecfdf3;
  color: #166534;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.photo-grid.mini {
  margin-top: 8px;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}


.checkbox-list {
  display: grid;
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 140ms ease, background 140ms ease;
}

.outbound-check-card {
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
}

.outbound-check-main {
  min-width: 0;
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
}

.outbound-check-main strong {
  font-size: 17px;
  line-height: 1.2;
  word-break: break-all;
}

.outbound-check-main .muted {
  line-height: 1.25;
}

.outbound-thumb {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.check-row:has(input:checked) {
  border-color: #84c5ff;
  background: #eff8ff;
}

.empty {
  padding: 26px;
  border: 1px dashed #cfd6df;
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
}

.image-zoom-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.72);
  padding: 24px;
}

.image-zoom-mask.open {
  display: flex;
}

.image-zoom-box {
  position: relative;
  max-width: min(1100px, 96vw);
  max-height: 92vh;
  display: grid;
  gap: 10px;
}

.image-zoom-box img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: #0b1220;
  object-fit: contain;
}

.image-zoom-close {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-weight: 700;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 58px;
  height: 32px;
  align-items: center;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .switch-pill {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid #1f2937;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.switch .switch-label {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  transition: color 160ms ease;
}

.switch .switch-label.on {
  color: #0f172a;
}

.switch .switch-label.off {
  color: #cbd5e1;
}

.switch .switch-label {
  opacity: 0;
}

.switch .switch-dot {
  position: absolute;
  width: 24px;
  height: 24px;
  top: 3px;
  left: 3px;
  border-radius: 999px;
  background: #f8fafc;
  box-shadow: 0 1px 4px rgba(2, 6, 23, 0.35);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.switch input:checked + .switch-pill {
  background: #8fae67;
  border-color: #8fae67;
  box-shadow: 0 0 0 2px rgba(143, 174, 103, 0.24);
}

.switch input:checked + .switch-pill .switch-dot {
  transform: translateX(28px);
}

.switch input:not(:checked) + .switch-pill .switch-dot {
  transform: translateX(0);
}

.switch input:not(:checked) + .switch-pill .switch-label.on {
  opacity: 0;
}

.switch input:not(:checked) + .switch-pill .switch-label.off {
  opacity: 1;
  color: #e2e8f0;
}

.switch input:checked + .switch-pill .switch-label.on {
  opacity: 1;
}

.switch input:checked + .switch-pill .switch-label.off {
  opacity: 0;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes nav-badge-bump {
  0% {
    transform: scale(0.7);
    opacity: 0.72;
  }
  60% {
    transform: scale(1.16);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes scan-open {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 12px 14px;
    gap: 10px;
  }

  .topbar .tabs {
    display: none;
  }

  .main {
    padding: 14px 12px calc(92px + env(safe-area-inset-bottom));
  }

  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .toolbar > .input,
  .toolbar > .select {
    min-width: 0;
    width: 100%;
  }

  #user-package-search,
  #admin-package-search,
  #admin-package-address-filter {
    max-width: none !important;
  }

  .stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0;
    padding: 0;
  }

  .queue-grid {
    grid-template-columns: 1fr;
  }

  .queue-grid > .panel:first-child {
    grid-row: auto;
  }

  .filter-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -12px;
    padding: 0 12px 4px;
  }

  .pill {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .stat {
    min-width: 0;
    padding: 10px 11px;
  }

  .stat span {
    font-size: 12px;
    white-space: nowrap;
  }

  .stat strong {
    font-size: 22px;
  }

  .scan-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    display: none;
  }

  .mobile-cards {
    display: grid;
    gap: 12px;
  }

  .panel {
    padding: 13px;
  }

  .auth-card {
    padding: 22px;
  }

  .bottom-nav {
    display: grid;
  }

  .topbar .row .muted {
    display: none;
  }

  .brand {
    min-width: 0;
  }

  .brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .card {
    padding: 13px;
  }

  .card-head,
  .section-head {
    align-items: flex-start;
  }

  .tracking {
    font-size: 17px;
  }

  .button {
    min-height: 42px;
  }

  .action-cell {
    display: grid;
    grid-template-columns: 1fr;
  }

.action-cell .button,
.action-cell label.button {
  width: 100%;
}
}

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

/* Rexora-like dashboard theme override */
:root {
  --bg: #f5f5f4;
  --panel: #ffffff;
  --text: #1c1c1f;
  --muted: #636363;
  --line: #e1e1de;
  --primary: #b8d995;
  --primary-dark: #a6c57f;
  --shadow: 0 1px 2px rgba(18, 20, 22, 0.08);
}

html,
body {
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.shell {
  width: 100%;
  max-width: 100%;
  padding: 22px 18px 48px;
}

.topbar.topbar-lite {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: var(--bg);
  border: 0;
  padding: 8px 0 20px;
}

.brand.brand-lite {
  gap: 10px;
  font-size: 40px;
  font-weight: 700;
}

.menu-button {
  border: 0;
  background: transparent;
  font-size: 28px;
  color: #27272a;
}

.tabs.tabs-pill {
  gap: 6px;
  padding: 8px;
  border-radius: 999px;
  background: #efefed;
  border: 1px solid #d9d9d5;
}

.tabs.tabs-pill .tab {
  border-radius: 999px;
  color: #4c4c4c;
  padding: 10px 28px;
  font-weight: 600;
  font-size: 15px;
  background: transparent;
}

.tabs.tabs-pill .tab.active {
  background: var(--primary);
  color: #1f2b16;
}

.user-strip {
  justify-self: end;
  gap: 10px;
}

.icon-lite {
  min-width: 40px;
  min-height: 40px;
  border: 0;
  background: transparent;
}

.avatar-lite {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
}

.avatar-lite img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.user-role {
  color: var(--muted);
  font-size: 12px;
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 240px;
  border: 1px solid #d8d8d4;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  display: grid;
  z-index: 40;
}

.user-menu-item {
  border: 0;
  border-top: 1px solid #ececea;
  background: #fff;
  text-align: left;
  padding: 14px 18px;
  font-size: 16px;
  color: #1f2937;
}

.user-menu-item:first-child {
  border-top: 0;
}

.user-menu-item.danger {
  color: #dc2626;
}

.main {
  width: 100%;
  margin: 0;
  padding: 0;
}

.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.hero-title {
  margin: 0;
  font-size: 44px;
}

.hero-sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.hero-actions .button.secondary {
  border: 1px solid #d8d8d4;
  border-radius: 14px;
  background: #f7f7f5;
  color: #252526;
}

.panel,
.toolbar,
.card,
.auth-card,
.mini-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.button.secondary {
  border: 1px solid #d8d8d4;
  background: #f7f7f5;
  color: #2a2a2a;
}

.button.dark-action {
  background: #111214;
  color: #fff;
  border-radius: 18px;
  min-height: 48px;
  padding: 10px 20px;
}

.button.dark-action:hover {
  background: #1d1f23;
}

.button,
.icon-lite,
.tab {
  transition: transform 120ms ease, box-shadow 140ms ease, background-color 140ms ease, color 140ms ease;
}

.button:active,
.icon-lite:active,
.tab:active {
  transform: scale(0.98);
}

.panel,
.card,
.mini-card {
  animation: panel-in 200ms ease-out both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes item-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section > div > .muted,
.section-head > div > .muted {
  display: none;
}

.toast-root {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 120;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  min-width: 220px;
  max-width: 360px;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid #d8d8d4;
  background: #f7f7f5;
  color: #1f2937;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.12);
  transition: all 160ms ease;
}

.toast-item.error {
  border-color: #fda29b;
  background: #fff7f7;
  color: #b42318;
}

.finance-section {
  gap: 14px;
}

.finance-summary-card {
  display: grid;
  gap: 10px;
  overflow: hidden;
}

.finance-trend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.finance-trend-card {
  display: grid;
  gap: 8px;
  background: #f3f3f2;
  border-color: #e4e4e1;
}

.finance-trend-card--wide {
  grid-column: span 2;
}

.finance-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.finance-card-value {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.finance-more {
  border: 0;
  background: #111216;
  color: #f4f4f5;
  font-weight: 700;
  line-height: 1;
  border-radius: 999px;
  min-height: 34px;
  padding: 0 12px;
}

.finance-delta-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.finance-delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  min-height: 34px;
  padding: 0 14px;
  font-weight: 700;
}

.finance-delta.up {
  background: #dbe7d0;
  color: #1f2d16;
}

.finance-delta.down {
  background: #f3d8d6;
  color: #7f1d1d;
}

.finance-filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.finance-filter-pills {
  padding: 5px;
}

.finance-mini-toggle {
  padding: 3px;
}

.finance-mini-toggle .tab {
  padding: 7px 12px;
  font-size: 12px;
}

.finance-date-range {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.finance-date-range .input {
  min-height: 38px;
  padding: 8px 10px;
}

.finance-big-number {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.finance-chart-wrap {
  position: relative;
  min-height: 220px;
  border-radius: 16px;
  background: #f0f0ef;
  border: 1px solid #dfdfdc;
  overflow: hidden;
}

.finance-chart-wrap.compact {
  min-height: 170px;
}

.finance-chart-wrap.tall {
  min-height: 300px;
}

.finance-chart-canvas {
  width: 100%;
  height: 170px !important;
  display: block;
}

.finance-chart-canvas--tall {
  height: 300px !important;
}

.finance-tooltip {
  position: absolute;
  background: #111216;
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  pointer-events: none;
  font-size: 13px;
  display: none;
  min-width: 150px;
  z-index: 10;
}

.finance-tooltip .t-month {
  opacity: 0.76;
  margin-bottom: 3px;
}

.finance-tooltip .t-val {
  color: #7b8cff;
  font-size: 15px;
  font-weight: 600;
}

.input,
.select,
.textarea {
  background: #fff;
  color: #1f2937;
}

@media (max-width: 980px) {
  table {
    min-width: 0;
  }

  th,
  td {
    padding: 10px;
    font-size: 13px;
  }

  .topbar.topbar-lite {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand user"
      "tabs tabs";
    align-items: center;
    gap: 8px 10px;
  }

  .brand.brand-lite {
    grid-area: brand;
    align-self: center;
  }

  .tabs.tabs-pill {
    grid-area: tabs;
    justify-self: stretch;
  }

  .user-strip {
    grid-area: user;
    justify-self: end;
    align-self: center;
  }

  .hero-row {
    flex-direction: column;
  }

  .finance-date-range {
    width: 100%;
  }

  .finance-date-range .input {
    width: 100%;
  }

  .finance-trend-grid {
    grid-template-columns: 1fr;
  }

  .finance-trend-card--wide {
    grid-column: span 1;
  }

  .finance-filter-pills {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    padding: 6px;
    border-radius: 999px;
  }

  .finance-filter-pills .tab {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
    font-weight: 700;
    padding: 0;
    text-align: center;
  }

  .finance-big-number {
    font-size: clamp(40px, 12vw, 56px);
    line-height: 1;
  }

  .finance-delta-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
  }

  .finance-delta {
    width: fit-content;
    min-height: 40px;
    padding: 0 18px;
    font-size: 16px;
    white-space: nowrap;
  }

  .finance-mini-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    border-radius: 999px;
  }

  .finance-mini-toggle .tab {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
    font-weight: 700;
  }

  .finance-chart-wrap,
  .finance-chart-wrap.tall {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .finance-chart-canvas,
  .finance-chart-canvas--tall {
    max-width: 100%;
  }
}

/* Mobile-consistent header style */
@media (max-width: 760px) {
  .shell {
    padding: 12px 12px 90px;
  }

  .topbar.topbar-lite {
    position: sticky;
    top: 0;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand user"
      "tabs tabs";
    align-items: center;
    gap: 8px 10px;
    padding: 6px 0 12px;
    margin-bottom: 8px;
  }

  .brand.brand-lite {
    font-size: 24px;
  }

  .menu-button {
    font-size: 22px;
  }

  .tabs.tabs-pill {
    width: 100%;
    justify-self: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 6px;
    gap: 4px;
    scrollbar-width: none;
  }

  .tabs.tabs-pill::-webkit-scrollbar {
    display: none;
  }

  .tabs.tabs-pill .tab {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 13px;
  }

  .bottom-nav {
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    border: 1px solid #d9d9d5;
    border-radius: 999px;
    background: #efefed;
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.08);
    padding: 6px;
    grid-auto-columns: 1fr;
    gap: 4px;
  }

  .bottom-nav button {
    border-radius: 999px;
    padding: 8px 6px;
    font-size: 13px;
    color: #4c4c4c;
    font-weight: 600;
    min-height: 36px;
  }

  .bottom-nav button.active {
    background: var(--primary);
    color: #1f2b16;
    font-weight: 700;
  }

  .user-strip {
    justify-self: end;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
  }

  .avatar-lite {
    width: 36px;
    height: 36px;
  }

  .user-name {
    font-size: 13px;
  }

  .user-role {
    font-size: 11px;
  }

  .icon-lite {
    min-width: 34px;
    min-height: 34px;
  }

  .user-menu {
    top: calc(100% + 8px);
    right: 0;
    width: min(260px, calc(100vw - 24px));
  }

  .notif-panel {
    position: relative;
    width: 100%;
    border-radius: 14px;
    padding: 10px;
  }

  .notif-item {
    border-radius: 14px;
  }
}
