:root {
  color-scheme: light;
  --ink: #111111;
  --ink-soft: #292929;
  --paper: #ffffff;
  --canvas: #f3f3f1;
  --line: #deded9;
  --line-strong: #c8c8c1;
  --muted: #696966;
  --muted-light: #92928d;
  --brand: #ee1b24;
  --brand-dark: #b80c15;
  --brand-soft: #fff0f1;
  --success: #18824b;
  --success-soft: #eaf7ef;
  --warning: #9a6110;
  --warning-soft: #fff6e6;
  --route: #176bb5;
  --route-soft: #ebf5ff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-float: 0 20px 48px rgba(17, 17, 17, 0.12);
  --sidebar-width: 264px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

button {
  color: inherit;
}

button,
a,
input,
select,
textarea {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  box-shadow: 0 0 0 3px rgba(238, 27, 36, 0.22);
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow--inverse {
  color: #ff5e65;
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
  min-height: 100vh;
  background: var(--paper);
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 40px clamp(40px, 6vw, 88px) 36px;
  color: white;
  background: var(--ink);
  overflow: hidden;
}

.login-brand::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  background: var(--brand);
}

.login-brand::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -220px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  box-shadow: 0 0 0 64px rgba(255, 255, 255, 0.025), 0 0 0 128px rgba(255, 255, 255, 0.018);
}

.login-brand__top,
.login-brand__statement,
.route-preview,
.login-brand__foot {
  position: relative;
  z-index: 1;
}

.login-brand__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: white;
}

.brand-plate img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-plate--login {
  width: 132px;
  height: 84px;
  padding: 6px 10px;
  border-radius: 4px;
}

.prototype-tag {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-brand__statement {
  max-width: 620px;
  margin-top: 8vh;
}

.login-brand__statement h1 {
  max-width: 610px;
  margin: 0;
  font-size: clamp(38px, 4.3vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.login-brand__statement > p:last-child {
  max-width: 530px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.65;
}

.route-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 52px 0 40px;
  padding: 0;
  list-style: none;
}

.route-preview li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 22px 16px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.route-preview li::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 0;
  width: 7px;
  height: 7px;
  background: var(--brand);
  border-radius: 50%;
}

.route-preview span {
  color: #ff5e65;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.route-preview strong {
  max-width: 120px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  line-height: 1.4;
}

.login-brand__foot {
  margin: 0;
  color: rgba(255, 255, 255, 0.36);
  font-size: 12px;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 56px clamp(40px, 9vw, 150px) 28px;
  background: var(--paper);
}

.login-panel__inner {
  width: 100%;
  max-width: 450px;
  margin: auto;
}

.mobile-logo {
  display: none;
}

.login-heading h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -0.045em;
}

.login-heading > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.demo-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 24px;
  padding: 12px 14px;
  color: #5d460d;
  background: #fff9e8;
  border: 1px solid #f1e1aa;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.45;
}

.demo-notice span {
  color: #c18405;
  font-size: 9px;
}

.auth-notice {
  color: var(--success);
  background: var(--success-soft);
  border-color: #b7dfc5;
}

.auth-notice span {
  color: var(--success);
}

.login-form {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.field-control {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 52px;
  background: #fafafa;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field-control:focus-within {
  background: white;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.field-control > svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-left: 15px;
  color: var(--muted-light);
}

.field-control input,
.field-control select {
  width: 100%;
  min-width: 0;
  padding: 14px 15px;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.password-toggle {
  flex: 0 0 auto;
  margin-right: 6px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(17, 17, 17, 0.06);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.check-control {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.check-control input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.text-button,
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: var(--ink);
  background: none;
  border: 0;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.text-button {
  color: var(--brand-dark);
}

.text-link svg {
  width: 15px;
  height: 15px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.primary-button {
  color: white;
  background: var(--brand);
  border: 1px solid var(--brand);
}

.primary-button:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.primary-button svg,
.secondary-button svg {
  width: 17px;
  height: 17px;
}

.primary-button--large {
  min-height: 54px;
  width: 100%;
  margin-top: 4px;
}

.secondary-button {
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
}

.secondary-button:hover {
  border-color: var(--ink);
}

.secondary-button--full {
  width: 100%;
}

.form-error {
  min-height: 18px;
  margin: -10px 0 -8px;
  color: var(--brand-dark);
  font-size: 12px;
}

.has-error .field-control:has(input:invalid) {
  border-color: var(--brand);
}

.login-security {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.login-security svg {
  flex: 0 0 auto;
  width: 20px;
  color: var(--success);
}

.login-security p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.login-security strong {
  color: var(--ink-soft);
}

.login-legal {
  margin: 32px auto 0;
  color: var(--muted-light);
  font-size: 11px;
}

.workspace {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  color: white;
  background: #121212;
  border-right: 1px solid #2b2b2b;
}

.sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
  padding: 16px 20px;
  border-bottom: 1px solid #2b2b2b;
}

.brand-plate--sidebar {
  width: 104px;
  height: 56px;
  padding: 2px 7px;
  border-radius: 3px;
}

.sidebar-close {
  display: none;
  color: white;
}

.main-nav {
  flex: 1;
  padding: 18px 12px;
  overflow-y: auto;
}

.nav-label {
  margin: 22px 10px 8px;
  color: #777;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-label:first-child {
  margin-top: 2px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  margin: 2px 0;
  padding: 9px 11px;
  color: #aaa;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover {
  color: white;
  background: #202020;
}

.nav-item.is-active {
  color: white;
  background: #292929;
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  width: 3px;
  height: 24px;
  background: var(--brand);
}

.nav-icon {
  display: inline-flex;
  flex: 0 0 auto;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-item small {
  margin-left: auto;
  color: #777;
  font-size: 10px;
}

.nav-item .nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 20px;
  padding: 2px 6px;
  color: white;
  background: var(--brand);
  border-radius: 999px;
}

.nav-group { margin: 2px 0; }

.nav-item--group {
  margin: 0;
}

.nav-group.is-current > .nav-item--group {
  color: white;
  background: #202020;
}

.nav-group__chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: #777;
  transition: transform 160ms ease, color 160ms ease;
}

.nav-group.is-open .nav-group__chevron {
  color: #d4d4d4;
  transform: rotate(180deg);
}

.nav-group__items {
  display: grid;
  gap: 1px;
  padding: 3px 0 5px 30px;
}

.nav-item--child {
  min-height: 36px;
  padding: 7px 9px;
  color: #929292;
  font-size: 12px;
}

.nav-item--child .nav-icon svg {
  width: 16px;
  height: 16px;
}

.nav-item--child.is-active::before { left: -30px; height: 20px; }

.sidebar__foot {
  padding: 12px;
  border-top: 1px solid #2b2b2b;
}

.sidebar-health {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 4px 10px;
  padding: 10px 8px;
}

.sidebar-health > span {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  background: #29b869;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(41, 184, 105, 0.12);
}

.sidebar-health div {
  display: grid;
  gap: 3px;
}

.sidebar-health strong {
  font-size: 11px;
}

.sidebar-health small {
  color: #777;
  font-size: 9px;
}

.nav-item--muted {
  color: #888;
}

.workspace__body {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  padding: 14px clamp(20px, 3vw, 44px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar__title,
.topbar__actions,
.profile-button {
  display: flex;
  align-items: center;
}

.topbar__title {
  gap: 12px;
}

.breadcrumbs {
  margin: 0 0 4px;
  color: var(--muted-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.topbar h1 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.menu-button {
  display: none;
}

.topbar__actions {
  gap: 10px;
}

.global-search {
  display: flex;
  align-items: center;
  width: min(320px, 28vw);
  min-height: 42px;
  padding: 0 10px 0 13px;
  color: var(--muted-light);
  background: var(--canvas);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.global-search:focus-within {
  background: white;
  border-color: var(--line-strong);
}

.global-search svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

.global-search input {
  width: 100%;
  min-width: 0;
  padding: 10px;
  background: transparent;
  border: 0;
  font-size: 12px;
}

.global-search kbd {
  padding: 3px 6px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: inherit;
  font-size: 9px;
}

.notification-button {
  position: relative;
  border: 1px solid var(--line);
}

.status-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: var(--brand);
  border: 2px solid white;
  border-radius: 50%;
}

.profile-button {
  gap: 10px;
  min-height: 46px;
  padding: 4px 8px 4px 4px;
  background: white;
  border: 0;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
}

.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: white;
  background: var(--ink);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.profile-copy {
  display: grid;
  gap: 2px;
}

.profile-copy strong {
  font-size: 11px;
}

.profile-copy small {
  color: var(--muted);
  font-size: 9px;
}

.profile-button > svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.main-content {
  min-height: calc(100vh - 88px);
  padding: 32px clamp(20px, 3vw, 44px) 48px;
}

.page {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.demo-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--warning);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.demo-chip span {
  width: 7px;
  height: 7px;
  background: #d99c2b;
  border-radius: 50%;
}

.page-heading h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.045em;
}

.page-heading p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.page-actions,
.compact-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.operations-overview {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(270px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.command-card,
.focus-card,
.surface,
.control-strip {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.command-card {
  padding: 24px;
}

.command-card__head,
.surface__head,
.focus-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-kicker {
  margin-bottom: 6px;
  color: var(--muted-light);
  font-size: 9px;
}

.section-kicker--danger {
  color: var(--brand);
}

.command-card h3,
.surface h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
}

.delta svg {
  width: 13px;
  height: 13px;
}

.delta--up {
  color: var(--success);
  background: var(--success-soft);
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 30px;
}

.pipeline__item {
  min-width: 0;
}

.pipeline__item span {
  display: block;
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.pipeline__item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.pipeline-track {
  display: flex;
  height: 7px;
  margin-top: 24px;
  overflow: hidden;
  background: var(--canvas);
  border-radius: 999px;
}

.pipeline-track span:first-child {
  border-radius: 999px 0 0 999px;
}

.pipeline-track span:last-child {
  border-radius: 0 999px 999px 0;
}

.track--warehouse { background: #8f989f; }
.track--route { background: var(--route); }
.track--delivered { background: var(--success); }
.track--incident { background: #e2a124; }
.track--returned { background: var(--brand); }

.focus-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.focus-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: #252525;
  border: 1px solid #333;
  border-radius: var(--radius-sm);
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #aaa;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.live-indicator i {
  width: 7px;
  height: 7px;
  background: #2fcc72;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(47, 204, 114, 0.1);
}

.focus-card > p {
  margin: 20px 0 4px;
  color: #aaa;
  font-size: 11px;
}

.focus-card > strong {
  font-size: 38px;
  letter-spacing: -0.05em;
}

.focus-card > strong small {
  color: #666;
  font-size: 16px;
}

.rider-avatars {
  display: flex;
  margin: 18px 0 22px 8px;
}

.rider-avatars span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: -8px;
  color: #ddd;
  background: #303030;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 8px;
  font-weight: 800;
}

.rider-avatars span:last-child {
  color: var(--ink);
  background: white;
}

.focus-card .text-link {
  margin-top: auto;
  color: white;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.surface {
  min-width: 0;
  padding: 22px;
}

.recent-orders {
  overflow: hidden;
}

.surface__head {
  align-items: center;
  margin-bottom: 18px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th {
  padding: 10px 12px;
  color: var(--muted-light);
  background: #f8f8f6;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

th:first-child {
  border-radius: 6px 0 0 0;
}

th:last-child {
  border-radius: 0 6px 0 0;
}

td {
  padding: 13px 12px;
  border-bottom: 1px solid #ecece8;
  color: var(--ink-soft);
  font-size: 13px;
}

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

tbody tr:hover {
  background: #fbfbfa;
}

td strong,
td small {
  display: block;
}

td small {
  margin-top: 4px;
  color: var(--muted-light);
  font-size: 11px;
}

.order-link {
  padding: 0;
  color: var(--ink);
  background: none;
  border: 0;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.order-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.status-pill i {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}

.status--route { color: var(--route); background: var(--route-soft); }
.status--warehouse { color: #59636a; background: #eef0f1; }
.status--incident { color: var(--warning); background: var(--warning-soft); }
.status--delivered { color: var(--success); background: var(--success-soft); }
.status--neutral { color: var(--muted); background: var(--canvas); }
.status--returned { color: var(--brand-dark); background: var(--brand-soft); }
.status--created { color: #6659a8; background: #f0edff; }
.status--assigned { color: #176bb5; background: #e8f1fb; }

.table-action {
  width: 30px;
  height: 30px;
}

.table-action svg {
  width: 15px;
  height: 15px;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  color: white;
  background: var(--brand);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.incident-list {
  display: grid;
  margin-bottom: 16px;
}

.incident-item {
  position: relative;
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 16px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #ecece8;
  text-align: left;
  cursor: pointer;
}

.incident-item:hover strong {
  color: var(--brand);
}

.incident-item__time {
  color: var(--muted-light);
  font-size: 9px;
}

.incident-item strong {
  padding-right: 80px;
  font-size: 11px;
}

.incident-item small {
  color: var(--muted);
  font-size: 9px;
}

.evidence-count {
  position: absolute;
  right: 0;
  bottom: 16px;
  padding: 4px 6px;
  color: var(--muted);
  background: var(--canvas);
  border-radius: 5px;
  font-size: 8px;
  font-weight: 750;
}

.control-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 16px;
  overflow: hidden;
}

.control-strip article {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.control-strip article:last-child {
  border-right: 0;
}

.control-strip__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
}

.control-strip__icon svg {
  width: 17px;
  height: 17px;
}

.control-strip__icon--dark { color: white; background: var(--ink); }
.control-strip__icon--green { color: var(--success); background: var(--success-soft); }
.control-strip__icon--red { color: var(--brand); background: var(--brand-soft); }

.control-strip article > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.control-strip small {
  color: var(--muted);
  font-size: 9px;
}

.control-strip strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.microtrend {
  margin-left: auto;
  color: var(--success);
  font-size: 9px;
  font-weight: 750;
}

.microtrend--alert {
  color: var(--brand);
}

.empty-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 190px);
  padding: 48px;
  text-align: center;
}

.empty-preview__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
}

.empty-preview h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.empty-preview > p:not(.eyebrow) {
  max-width: 430px;
  margin: 12px 0 22px;
  color: var(--muted);
}

.sidebar-scrim,
.mobile-nav {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  /* Leaflet usa capas internas hasta 1000; la ventana debe cubrirlas siempre. */
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 10, 10, 0.58);
  opacity: 0;
  backdrop-filter: blur(4px);
  transition: opacity 180ms ease;
}

.modal-backdrop.is-visible {
  opacity: 1;
}

.modal {
  position: relative;
  width: min(600px, 100%);
  max-width: 100vw;
  max-height: min(760px, calc(100vh - 40px));
  padding: 28px;
  overflow-x: clip;
  overflow-y: auto;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  transform: translateY(10px) scale(0.985);
  transition: transform 180ms ease;
}

.modal,
.modal-heading,
.demo-profile-list {
  min-width: 0;
}

.is-visible .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.modal-heading {
  margin-bottom: 24px;
  padding-right: 38px;
}

.modal-heading--row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-heading--row .status-pill {
  margin-left: auto;
}

.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  color: white;
  background: var(--ink);
  border-radius: var(--radius-sm);
}

.modal-heading--row .modal-icon {
  margin-bottom: 0;
}

.modal-heading h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.035em;
}

.modal-heading p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.modal .field + .primary-button {
  margin-top: 16px;
}

.modal-disclaimer {
  margin: 12px 0 0;
  color: var(--muted-light);
  font-size: 10px;
  text-align: center;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.order-detail-grid > div {
  display: grid;
  gap: 5px;
  padding: 14px;
  background: white;
}

.order-detail-grid small {
  color: var(--muted);
  font-size: 9px;
}

.order-detail-grid strong {
  font-size: 12px;
}

.timeline {
  margin: 24px 0;
}

.timeline__item {
  position: relative;
  display: flex;
  gap: 12px;
  min-height: 54px;
}

.timeline__item::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: -4px;
  left: 5px;
  width: 1px;
  background: var(--line);
}

.timeline__item:last-child::before {
  display: none;
}

.timeline__item > i {
  z-index: 1;
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  margin-top: 2px;
  background: white;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
}

.timeline__item.is-done > i {
  background: var(--success);
  border-color: var(--success);
}

.timeline__item.is-current > i {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.timeline__item div {
  display: grid;
  align-content: start;
  gap: 3px;
}

.timeline__item strong {
  font-size: 11px;
}

.timeline__item small {
  color: var(--muted);
  font-size: 9px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 150;
  display: grid;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, calc(100vw - 40px));
  padding: 14px 16px;
  color: white;
  background: var(--ink);
  border: 1px solid #333;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-float);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  color: var(--success);
  background: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.toast p {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
}

/* Operational modules */
.page-heading--module {
  align-items: center;
}

.page-heading--module .eyebrow {
  margin-bottom: 7px;
}

.module-metrics {
  display: grid;
  gap: 1px;
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.module-metrics--five {
  grid-template-columns: repeat(5, 1fr);
}

.module-metrics article {
  display: grid;
  min-width: 0;
  padding: 18px 20px;
  background: white;
}

.module-metrics small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.module-metrics strong {
  margin: 4px 0 6px;
  font-size: 28px;
  letter-spacing: -0.05em;
}

.module-metrics span {
  color: var(--muted-light);
  font-size: 9px;
}

.module-metrics .metric-alert {
  background: var(--brand-soft);
}

.module-metrics .metric-alert strong,
.module-metrics .metric-alert span {
  color: var(--brand-dark);
}

.data-surface {
  padding: 0;
  overflow: hidden;
}

.filter-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.table-search,
.courier-search {
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  min-height: 40px;
  padding: 0 12px;
  color: var(--muted-light);
  background: #f8f8f6;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.table-search svg,
.courier-search svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

.table-search input,
.courier-search input {
  width: 100%;
  min-width: 0;
  padding: 10px;
  background: transparent;
  border: 0;
  font-size: 11px;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  background: var(--canvas);
  border-radius: var(--radius-sm);
}

.filter-pill {
  min-height: 34px;
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.filter-pill span {
  margin-left: 4px;
  color: var(--muted-light);
}

.filter-pill.is-active {
  color: var(--ink);
  background: white;
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.08);
}

.orders-table th:first-child,
.orders-table td:first-child {
  width: 42px;
  padding-right: 2px;
}

.orders-table th,
.orders-table td {
  padding-block: 14px;
}

.table-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.table-footer div {
  display: flex;
  align-items: center;
  gap: 4px;
}

.table-footer div strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: white;
  background: var(--ink);
  border-radius: 6px;
}

.step-indicator {
  display: flex;
  align-items: center;
}

.step-indicator span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.step-indicator span.is-active {
  color: white;
  background: var(--brand);
  border-color: var(--brand);
}

.step-indicator i {
  width: 24px;
  height: 1px;
  background: var(--line-strong);
}

.create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.65fr);
  gap: 18px;
  align-items: start;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.form-section {
  padding: 22px;
}

.form-section__head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 20px;
}

.form-section__head > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 850;
}

.form-section__head h3 {
  margin: 0;
  font-size: 15px;
}

.form-section__head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.segmented-control label {
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
}

.segmented-control label > span {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 2px 10px;
  min-height: 78px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 150ms ease, background 150ms ease;
}

.segmented-control svg {
  grid-row: 1 / 3;
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.segmented-control strong {
  font-size: 11px;
}

.segmented-control small {
  color: var(--muted);
  font-size: 9px;
}

.segmented-control input:checked + span {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.segmented-control input:checked + span svg {
  color: var(--brand);
}

.segmented-control input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(238, 27, 36, 0.2);
}

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

.field--wide {
  grid-column: 1 / -1;
}

.field-control select {
  appearance: none;
  cursor: pointer;
}

.field-control--money > strong {
  margin-left: 15px;
  color: var(--muted);
  font-size: 14px;
}

.field-control--scan {
  gap: 8px;
  padding-right: 8px;
}

.field-control--scan input {
  min-width: 0;
}

.field-scan-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 11px;
  font-size: 10px;
}

.field-scan-button svg { width: 15px; height: 15px; }

.field-help {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

/* La lista de clientes con cuenta no cargó: el aviso se resalta sin romper la
   pantalla (el usuario puede seguir con "Mostrador"). */
.field-help.is-warn { color: var(--warning); font-weight: 700; }

/* Crear pedido: el formulario sigue el orden operativo, no solo el visual. */
.form-section__group + .form-section__group {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.form-section__group-title {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-grid--contact,
.form-grid--destination {
  align-items: start;
}

.mercado-flex-panel {
  border-color: rgba(25, 108, 181, 0.25);
  background: linear-gradient(135deg, rgba(25, 108, 181, 0.055), rgba(255, 255, 255, 0.96));
}

.field-control--textarea {
  align-items: stretch;
}

.field-control textarea {
  width: 100%;
  padding: 14px 15px;
  resize: vertical;
  background: transparent;
  border: 0;
  line-height: 1.5;
}

.guide-preview-column {
  position: sticky;
  top: 116px;
}

.guide-preview {
  padding: 20px;
}

.guide-preview__head,
.route-batch__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.guide-preview__head h3,
.route-batch__head h3 {
  margin: 0;
  font-size: 16px;
}

.shipping-label {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 112px;
  padding: 18px;
  overflow: hidden;
  background: white;
  border: 1px dashed #888;
  border-radius: 4px;
}

.shipping-label::before,
.shipping-label::after {
  content: "";
  position: absolute;
  top: 0;
  width: 16px;
  height: 5px;
  background: var(--brand);
}

.shipping-label::before { left: 0; }
.shipping-label::after { right: 0; }

.shipping-label__brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shipping-label__brand img {
  width: 46px;
  height: 36px;
  object-fit: cover;
}

.shipping-label__brand div,
.shipping-label__person,
.shipping-label__address {
  display: grid;
  gap: 3px;
}

.shipping-label__brand strong {
  font-size: 9px;
}

.shipping-label__brand small,
.shipping-label small {
  color: #777;
  font-size: 7px;
  letter-spacing: 0.06em;
}

.shipping-label__code {
  justify-self: end;
  display: grid;
  gap: 3px;
  text-align: right;
}

.shipping-label__code span {
  color: #777;
  font-size: 7px;
  text-transform: uppercase;
}

.shipping-label__code strong {
  font-size: 12px;
}

.visual-qr {
  grid-column: 2;
  grid-row: 2 / 6;
  align-self: start;
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  width: 96px;
  height: 96px;
  margin: 16px 0 0 16px;
  background: white;
  border: 4px solid white;
  box-shadow: 0 0 0 1px #ddd;
}

.visual-qr i {
  background: white;
}

.visual-qr i.is-dark {
  background: var(--ink);
}

.shipping-label__person,
.shipping-label__address,
.shipping-label__amount,
.shipping-label__note {
  grid-column: 1;
  padding-top: 14px;
}

.shipping-label__person strong,
.shipping-label__address strong {
  margin-top: 2px;
  font-size: 12px;
}

.shipping-label__person span,
.shipping-label__address span {
  font-size: 9px;
}

.shipping-label__amount {
  display: grid;
  gap: 3px;
}

.shipping-label__amount strong {
  font-size: 20px;
}

.shipping-label__note {
  margin: 12px 0 0;
  border-top: 1px solid #ddd;
  color: #555;
  font-size: 8px;
  line-height: 1.4;
}

.guide-preview__actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 9px;
  margin-top: 14px;
}

.prototype-footnote {
  margin: 12px 0 0;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.mercado-flex-preview {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 14px;
  color: #164d7d;
  background: #edf7ff;
  border: 1px solid #c9e2f7;
  border-radius: var(--radius-sm);
}

.mercado-flex-preview > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  color: white;
  background: #176bb5;
  border-radius: 9px;
  box-shadow: 0 4px 10px rgba(23, 107, 181, 0.2);
}

.mercado-flex-preview svg { width: 17px; height: 17px; }
.mercado-flex-preview p { margin: 0; font-size: 10px; line-height: 1.45; }
.mercado-flex-preview h4 { margin: 3px 0 4px; font-size: 13px; color: var(--ink); }

.order-origin {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 750;
}

.order-origin--flex { color: #176bb5; }

.route-source,
.trace-source {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-left: 6px;
  padding: 3px 6px;
  color: #176bb5;
  background: #eaf5ff;
  border: 1px solid #c9e2f7;
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: 2px;
  white-space: nowrap;
}

.trace-source { margin: 7px 0 0; }

@media (max-width: 640px) {
  .field-control--scan { display: grid; grid-template-columns: minmax(0, 1fr); padding: 8px; }
  .field-control--scan input { min-height: 42px; }
  .field-scan-button { width: 100%; min-height: 42px; justify-content: center; }
  .route-source { display: inline-flex; margin: 4px 0 0; }
}

.operator-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 7px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.operator-chip > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: white;
  background: var(--ink);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
}

.operator-chip div {
  display: grid;
  gap: 2px;
}

.operator-chip small {
  color: var(--muted);
  font-size: 8px;
}

.operator-chip strong {
  font-size: 10px;
}

.warehouse-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.55fr);
  gap: 16px;
  margin-bottom: 16px;
}

.warehouse-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.warehouse-kpis article {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.warehouse-kpis small,
.warehouse-kpis span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.warehouse-kpis strong {
  display: block;
  margin: 6px 0 3px;
  font-size: 28px;
  letter-spacing: -0.05em;
}

.warehouse-kpi--flex { border-color: rgba(23, 107, 181, 0.28) !important; }
.warehouse-kpi--flex strong { color: #176bb5; }

.warehouse-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.warehouse-next-actions {
  display: grid;
  gap: 12px;
}

.warehouse-action-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
}

.warehouse-action-card > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 10px;
}

.warehouse-action-card > span svg { width: 18px; height: 18px; }
.warehouse-action-card h3 { margin: 3px 0 4px; font-size: 14px; }
.warehouse-action-card p:not(.section-kicker) { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.warehouse-action-card .secondary-button { min-height: 36px; padding-inline: 11px; white-space: nowrap; }

.warehouse-action-card--flex { border-color: rgba(23, 107, 181, 0.26); }
.warehouse-action-card--flex > span { color: #176bb5; background: #eaf5ff; }

.warehouse-inventory { overflow: hidden; }
.warehouse-inventory__head { gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.warehouse-inventory__head h3 { margin: 3px 0; }
.warehouse-inventory__head p:not(.section-kicker) { max-width: 630px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.warehouse-order-list { display: grid; }

.warehouse-order-card {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(220px, 1.55fr) minmax(92px, 0.6fr) minmax(160px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.warehouse-order-card:last-child { border-bottom: 0; }

.warehouse-order__guide > span {
  display: block;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.warehouse-order__source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 6px;
  color: var(--muted);
  background: var(--surface-alt);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.warehouse-order__source svg { width: 12px; height: 12px; }
.warehouse-order__source--flex { color: #176bb5; background: #eaf5ff; }

.warehouse-order__destination strong,
.warehouse-order__destination span,
.warehouse-order__destination small,
.warehouse-order__availability strong,
.warehouse-order__availability small {
  display: block;
}

.warehouse-order__destination strong { font-size: 12px; }
.warehouse-order__destination span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.warehouse-order__destination small { margin-top: 4px; color: var(--brand-dark); font-size: 10px; font-weight: 800; }

.warehouse-order__collection small { display: block; color: var(--muted-light); font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em; }
.warehouse-order__collection b { display: block; margin-top: 4px; font-size: 12px; }

.warehouse-order__availability { padding-left: 10px; border-left: 3px solid var(--line-dark); }
.warehouse-order__availability strong { font-size: 11px; }
.warehouse-order__availability small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.warehouse-order__availability.is-available { border-color: var(--success); }
.warehouse-order__availability.is-requested { border-color: #d08a15; }
.warehouse-order__availability.is-preparing { border-color: var(--brand); }
.warehouse-order__availability.is-ready { border-color: #176bb5; }

.warehouse-order__detail { min-height: 34px; padding-inline: 10px; font-size: 10px; white-space: nowrap; }

.warehouse-inventory-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 30px 20px;
  color: var(--muted);
}

.warehouse-inventory-empty > svg { width: 26px; height: 26px; color: var(--brand); }
.warehouse-inventory-empty strong { display: block; color: var(--ink); font-size: 13px; }
.warehouse-inventory-empty p { margin: 3px 0 0; font-size: 11px; line-height: 1.45; }

.scanner-console {
  padding: 22px;
  color: white;
  background: var(--ink);
  border: 1px solid #2b2b2b;
  border-radius: var(--radius-md);
}

.scanner-console__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.scanner-console .icon-button {
  color: #aaa;
}

.scanner-camera-button {
  min-height: 36px;
  padding: 0 12px;
  color: white;
  background: #242424;
  border-color: #4a4a4a;
  font-size: 10px;
  white-space: nowrap;
}

.scanner-camera-button:hover {
  color: white;
  background: #303030;
  border-color: #6b6b6b;
}

.scanner-camera-button svg {
  width: 15px;
  height: 15px;
}

.scanner-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  background: #191919;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.scanner-frame::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 15%;
  right: 15%;
  height: 1px;
  background: var(--brand);
  box-shadow: 0 0 16px rgba(238, 27, 36, 0.8);
}

.scanner-frame > i {
  position: absolute;
  width: 36px;
  height: 36px;
  border-color: white;
}

.scanner-frame > i:nth-child(1) { top: 34px; left: 12%; border-top: 2px solid; border-left: 2px solid; }
.scanner-frame > i:nth-child(2) { top: 34px; right: 12%; border-top: 2px solid; border-right: 2px solid; }
.scanner-frame > i:nth-child(3) { bottom: 34px; left: 12%; border-bottom: 2px solid; border-left: 2px solid; }
.scanner-frame > i:nth-child(4) { right: 12%; bottom: 34px; border-right: 2px solid; border-bottom: 2px solid; }

.scanner-frame > span {
  display: inline-flex;
  margin-bottom: 16px;
  color: #666;
}

.scanner-frame > span svg {
  width: 46px;
  height: 46px;
}

.scanner-frame > div {
  display: grid;
  gap: 6px;
  padding-inline: 20px;
  text-align: center;
}

.scanner-frame strong {
  font-size: 13px;
}

.scanner-frame small {
  color: #777;
  font-size: 9px;
}

.manual-scan {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.manual-scan > span {
  color: #777;
  font-size: 9px;
  text-align: center;
}

.manual-scan > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.manual-scan input {
  min-width: 0;
  padding: 11px 13px;
  color: white;
  background: #222;
  border: 1px solid #333;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.scan-result {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 14px;
  padding: 11px 12px;
  background: #171717;
  border: 1px solid #2b2b2b;
  border-radius: var(--radius-sm);
}

.scan-result > span {
  display: inline-flex;
  color: #777;
}

.scan-result div {
  display: grid;
  gap: 3px;
}

.scan-result small {
  color: #777;
  font-size: 8px;
}

.scan-result strong {
  font-size: 10px;
}

.scan-result.is-success {
  color: #b6f3d0;
  background: rgba(24, 130, 75, 0.14);
  border-color: rgba(41, 184, 105, 0.35);
}

.scan-result.is-success > span,
.scan-result.is-success small {
  color: #6fd59a;
}

.warehouse-summary {
  display: grid;
  gap: 16px;
}

.warehouse-count {
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.warehouse-count > strong {
  font-size: 52px;
  letter-spacing: -0.06em;
}

.warehouse-count > span {
  color: var(--muted);
  font-size: 11px;
}

.warehouse-count > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 24px;
  color: var(--muted-light);
  border-top: 1px solid var(--line);
  font-size: 9px;
}

.process-rules {
  padding: 22px;
}

.process-rules h3 {
  margin: 0 0 14px;
  font-size: 13px;
}

.process-rules ul {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-rules li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
}

.process-rules li span {
  color: var(--success);
  font-weight: 900;
}

.warehouse-history .surface__head {
  padding: 18px 20px 0;
}

.assignment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(370px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.assignment-column {
  display: grid;
  gap: 16px;
}

.courier-selector {
  padding: 22px;
}

.courier-search {
  width: 100%;
  margin-bottom: 12px;
}

.courier-selected {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #f8f8f6;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.courier-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  color: white;
  background: var(--ink);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.courier-selected > div {
  display: grid;
  gap: 3px;
}

.courier-selected strong {
  font-size: 11px;
}

.courier-selected small,
.courier-selected div span {
  color: var(--muted);
  font-size: 8px;
}

.courier-selected .text-button {
  margin-left: auto;
}

.scanner-console--compact {
  min-height: 370px;
}

.form-section__head--inverse > span {
  color: white;
  background: var(--brand);
}

.form-section__head--inverse p {
  color: #777;
}

.compact-scan-target {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 138px;
  color: #888;
  background: #191919;
  border: 1px dashed #444;
  border-radius: var(--radius-sm);
}

.compact-scan-target > svg {
  width: 38px;
  height: 38px;
}

.compact-scan-target > div {
  display: grid;
  gap: 4px;
}

.compact-scan-target strong {
  color: white;
  font-size: 12px;
}

.compact-scan-target small {
  color: #777;
  font-size: 9px;
}

.compact-scan-target .scanner-camera-button {
  margin-left: auto;
}

.manual-scan--dark {
  margin-top: 12px;
}

.scan-result--dark {
  margin-top: 12px;
}

.route-batch {
  padding: 22px;
}

.route-batch__head > strong {
  font-size: 28px;
  letter-spacing: -0.05em;
}

.route-batch__head > strong small {
  color: var(--muted-light);
  font-size: 12px;
}

.batch-list {
  display: grid;
}

.batch-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
}

.batch-item > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  color: var(--muted);
  background: var(--canvas);
  border-radius: 50%;
  font-size: 8px;
  font-weight: 800;
}

.batch-item > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.batch-item strong {
  font-size: 10px;
}

.batch-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-item .icon-button {
  margin-left: auto;
  color: var(--muted-light);
  font-size: 18px;
}

.batch-totals {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 18px 0;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.batch-totals div {
  display: grid;
  gap: 4px;
  padding: 13px;
  background: #f8f8f6;
}

.batch-totals small {
  color: var(--muted);
  font-size: 8px;
}

.batch-totals strong {
  font-size: 13px;
}

/* Management and control modules */
.module-metrics--four {
  grid-template-columns: repeat(4, 1fr);
}

.couriers-layout,
.collections-layout,
.users-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.45fr);
  gap: 16px;
  align-items: start;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.person-cell > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  color: white;
  background: var(--ink);
  border-radius: 50%;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.person-cell > span {
  display: grid;
  gap: 1px;
}

.rider-preview {
  display: grid;
  place-items: center;
  padding: 20px 12px;
  background: #deded9;
  border-radius: var(--radius-md);
}

.phone-shell {
  position: relative;
  width: min(300px, 100%);
  min-height: 606px;
  padding: 16px 14px 12px;
  overflow: hidden;
  background: #f6f6f4;
  border: 7px solid var(--ink);
  border-radius: 30px;
  box-shadow: 0 20px 36px rgba(17, 17, 17, 0.18);
}

.phone-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px 12px;
  font-size: 8px;
  font-weight: 800;
}

.phone-status i {
  width: 42px;
  height: 11px;
  background: var(--ink);
  border-radius: 999px;
}

.rider-app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px 16px;
}

.rider-app-head div {
  display: grid;
  gap: 3px;
}

.rider-app-head small {
  color: var(--muted);
  font-size: 8px;
}

.rider-app-head strong {
  font-size: 18px;
  letter-spacing: -0.035em;
}

.rider-app-head > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: white;
  background: var(--ink);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
}

.rider-progress {
  padding: 16px;
  color: white;
  background: var(--ink);
  border-radius: var(--radius-md);
}

.rider-progress > div {
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.rider-progress small {
  color: #999;
  font-size: 8px;
}

.rider-progress strong {
  font-size: 26px;
}

.rider-progress strong b {
  color: #777;
  font-size: 11px;
}

.rider-progress > i {
  display: block;
  height: 5px;
  margin: 12px 0 6px;
  overflow: hidden;
  background: #333;
  border-radius: 999px;
}

.rider-progress > i span {
  display: block;
  height: 100%;
  background: var(--brand);
}

.rider-scan-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  margin: 12px 0 16px;
  color: white;
  background: var(--brand);
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.rider-order-list > p {
  margin: 0 0 6px;
  color: var(--muted-light);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.rider-order-list article {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 60px;
  padding: 0 2px;
  border-bottom: 1px solid var(--line);
}

.rider-order-list article > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--muted);
  background: white;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 800;
}

.rider-order-list article div {
  display: grid;
  gap: 3px;
}

.rider-order-list article strong {
  font-size: 9px;
}

.rider-order-list article small {
  color: var(--muted);
  font-size: 7px;
}

.rider-order-list article > i {
  margin-left: auto;
  color: var(--muted-light);
  font-style: normal;
}

.rider-bottom-nav {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: 62px;
  padding: 8px 12px;
  background: white;
  border-top: 1px solid var(--line);
}

.rider-bottom-nav span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted-light);
}

.rider-bottom-nav span.is-active {
  color: var(--brand);
}

.rider-bottom-nav svg {
  width: 17px;
  height: 17px;
}

.rider-bottom-nav small {
  font-size: 7px;
}

.rider-preview > p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 8px;
  text-align: center;
}

.collections-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.55fr);
}

.collections-main {
  display: grid;
  gap: 16px;
}

.payment-breakdown {
  padding: 22px;
}

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

.settlements__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.settlements__heading h3 {
  margin: 3px 0 4px;
  font-size: 17px;
}

.settlements__heading p:not(.section-kicker) {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

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

.settlement-card {
  padding: 18px;
  border-top: 3px solid var(--brand);
}

.settlement-card__head,
.settlement-card__recipient,
.settlement-card__totals {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settlement-card__head h3 {
  margin: 2px 0 0;
  font-size: 14px;
}

.settlement-card__recipient {
  justify-content: flex-start;
  margin: 16px 0;
}

.settlement-card__recipient > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.settlement-card__recipient div {
  display: grid;
  gap: 2px;
}

.settlement-card__recipient strong { font-size: 12px; }
.settlement-card__recipient small { color: var(--muted); font-size: 9px; }

.settlement-card__totals {
  align-items: stretch;
  gap: 0;
  padding: 10px 0;
  border-block: 1px solid var(--line);
}

.settlement-card__totals div {
  display: grid;
  flex: 1;
  gap: 4px;
  padding-right: 9px;
}

.settlement-card__totals div + div {
  padding-left: 9px;
  border-left: 1px solid var(--line);
}

.settlement-card__totals dt { color: var(--muted); font-size: 8px; }
.settlement-card__totals dd { margin: 0; font-size: 11px; font-weight: 800; }
.settlement-card__totals .settlement-card__total dd { color: var(--brand-dark); }

.settlement-card__wa {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  text-decoration: none;
}

.settlement-card .whatsapp-disclaimer {
  margin-top: 8px;
  text-align: left;
}

.date-chip {
  padding: 6px 8px;
  color: var(--muted);
  background: var(--canvas);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 750;
}

.payment-bars {
  display: grid;
  gap: 15px;
}

.payment-bars > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.55fr) minmax(160px, 1fr) 46px;
  align-items: center;
  gap: 14px;
}

.payment-bars span {
  display: grid;
  gap: 3px;
}

.payment-bars strong {
  font-size: 10px;
}

.payment-bars small {
  color: var(--muted);
  font-size: 8px;
}

.payment-bars > div > i {
  height: 7px;
  overflow: hidden;
  background: var(--canvas);
  border-radius: 999px;
}

.payment-bars b {
  display: block;
  height: 100%;
  background: var(--ink);
}

.payment-bars > div:nth-child(2) b { background: #5d4bd6; }
.payment-bars > div:nth-child(3) b { background: #e16c28; }
.payment-bars > div:nth-child(4) b { background: var(--route); }

.payment-bars em {
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
}

.surface__head--padded {
  padding: 18px 20px 0;
}

.proof-link {
  padding: 0;
  color: var(--route);
  background: transparent;
  border: 0;
  font-size: 9px;
  font-weight: 750;
  text-decoration: underline;
  cursor: pointer;
}

.delivery-capture {
  position: sticky;
  top: 116px;
  padding: 22px;
}

.delivery-capture__head,
.role-matrix__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.delivery-capture__head > span,
.role-matrix__head > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: white;
  background: var(--ink);
  border-radius: var(--radius-sm);
}

.delivery-capture__head h3,
.role-matrix__head h3 {
  margin: 0;
  font-size: 15px;
}

.delivery-order {
  display: grid;
  gap: 3px;
  margin-bottom: 18px;
  padding: 14px;
  color: white;
  background: var(--ink);
  border-radius: var(--radius-sm);
}

.delivery-order small {
  color: #888;
  font-size: 8px;
}

.delivery-order strong {
  font-size: 16px;
}

.delivery-order span {
  color: #bbb;
  font-size: 9px;
}

.evidence-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  margin: 14px 0;
  padding: 16px;
  color: var(--muted);
  background: #fafafa;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  text-align: center;
}

.evidence-upload > span {
  display: inline-flex;
  margin-bottom: 8px;
}

.evidence-upload strong {
  color: var(--ink-soft);
  font-size: 10px;
}

.evidence-upload small {
  margin: 4px 0 12px;
  font-size: 8px;
}

.evidence-upload .secondary-button {
  min-height: 34px;
  font-size: 9px;
}

.evidence-upload.is-required {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: var(--brand);
}

.delivery-confirm {
  align-items: flex-start;
  padding: 4px 0 12px;
  line-height: 1.4;
}

.incidents-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.incident-queue {
  padding: 0;
  overflow: hidden;
}

.incident-queue__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.incident-queue__head strong {
  font-size: 11px;
}

.incident-queue__head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: white;
  background: var(--brand);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
}

.queue-item {
  position: relative;
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 96px;
  padding: 16px;
  background: white;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.queue-item:hover,
.queue-item.is-active {
  background: #fafafa;
}

.queue-item.is-active::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand);
}

.queue-time {
  color: var(--muted-light);
  font-size: 8px;
}

.queue-item strong {
  padding-right: 42px;
  font-size: 10px;
}

.queue-item small {
  color: var(--muted);
  font-size: 8px;
}

.queue-item i {
  position: absolute;
  right: 14px;
  bottom: 16px;
  color: var(--muted-light);
  font-size: 7px;
  font-style: normal;
}

.incident-detail {
  padding: 24px;
}

.incident-detail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.incident-detail__head h3 {
  margin: 0;
  font-size: 20px;
}

.incident-detail__head div > span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
}

.incident-context {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 20px 0;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.incident-context > div {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: #fafafa;
}

.incident-context small {
  color: var(--muted-light);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.incident-context strong {
  font-size: 10px;
}

.incident-context span {
  color: var(--muted);
  font-size: 8px;
}

.incident-detail blockquote {
  margin: 0 0 20px;
  padding: 14px 16px;
  color: var(--ink-soft);
  background: var(--warning-soft);
  border-left: 3px solid #d99c2b;
  font-size: 11px;
  line-height: 1.55;
}

.evidence-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.evidence-section__head h4 {
  margin: 0;
  font-size: 11px;
}

.evidence-section__head span {
  color: var(--muted-light);
  font-size: 8px;
}

.evidence-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.evidence-photo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 170px;
  overflow: hidden;
  color: white;
  background: #5e615e;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.evidence-photo::before,
.evidence-photo::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.evidence-photo--building::before {
  width: 54%;
  height: 68%;
  bottom: 0;
  background: #777d7b;
  box-shadow: -52px 18px 0 #686e6b, 52px 22px 0 #686e6b;
}

.evidence-photo--building::after {
  width: 8px;
  height: 8px;
  background: #bbc1bc;
  box-shadow: 22px 0 #bbc1bc, -22px 0 #bbc1bc, 0 24px #bbc1bc, 22px 24px #bbc1bc, -22px 24px #bbc1bc, 0 48px #bbc1bc, 22px 48px #bbc1bc, -22px 48px #bbc1bc;
}

.evidence-photo--door::before {
  bottom: 0;
  width: 42%;
  height: 78%;
  background: #333634;
  border: 10px solid #7e817e;
}

.evidence-photo > span {
  z-index: 1;
  display: inline-flex;
  opacity: 0.65;
}

.evidence-photo > span svg {
  width: 34px;
  height: 34px;
}

.evidence-photo small {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  padding: 18px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  font-size: 8px;
  text-align: left;
}

.incident-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 22px 0;
}

.incident-timeline > div {
  position: relative;
  display: flex;
  gap: 8px;
  padding-right: 12px;
}

.incident-timeline > div::before {
  content: "";
  position: absolute;
  top: 5px;
  right: 0;
  left: 5px;
  height: 1px;
  background: var(--line);
}

.incident-timeline > div:last-child::before {
  display: none;
}

.incident-timeline i {
  z-index: 1;
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  background: white;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
}

.incident-timeline .is-done i { background: var(--success); border-color: var(--success); }
.incident-timeline .is-current i { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

.incident-timeline span {
  z-index: 1;
  display: grid;
  gap: 3px;
  padding: 0 8px 0 0;
  background: white;
}

.incident-timeline strong {
  font-size: 8px;
}

.incident-timeline small {
  color: var(--muted);
  font-size: 7px;
}

.incident-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.whatsapp-disclaimer {
  margin: 10px 0 0;
  color: var(--muted-light);
  font-size: 8px;
  text-align: right;
}

.returns-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 16px;
  margin-bottom: 16px;
}

.return-scanner {
  padding: 24px;
  color: white;
  background: var(--ink);
  border-radius: var(--radius-md);
}

.return-scanner__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  color: var(--brand);
  background: #222;
  border: 1px solid #333;
  border-radius: var(--radius-sm);
}

.return-scanner h3 {
  margin: 0;
  font-size: 22px;
}

.return-scanner > p:not(.section-kicker) {
  max-width: 520px;
  margin: 9px 0 20px;
  color: #999;
  font-size: 10px;
  line-height: 1.5;
}

.manual-scan--return {
  max-width: 580px;
}

.return-scanner .scanner-camera-button {
  margin-bottom: 12px;
}

/* Cámara QR real: se abre encima de la operación para no perder el contexto. */
.qr-camera-dialog {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.qr-camera-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.qr-camera-dialog__panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(760px, calc(100svh - 48px));
  padding: 20px;
  overflow: auto;
  color: white;
  background: #151515;
  border: 1px solid #3a3a3a;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.qr-camera-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.qr-camera-dialog__head p {
  margin: 0 0 5px;
  color: #9f9f9a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qr-camera-dialog__head h2 {
  margin: 0;
  color: white;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.qr-camera-dialog__head .icon-button {
  flex: 0 0 auto;
  color: white;
  background: #292929;
  border: 1px solid #424242;
  font-size: 22px;
}

.qr-camera-dialog__viewer {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  background: #050505;
  border: 1px solid #363636;
  border-radius: 12px;
}

.qr-camera-dialog__video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
}

.qr-camera-dialog__target {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(62vw, 250px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 14px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(238, 27, 36, 0.75) inset;
}

.qr-camera-dialog__target::after {
  position: absolute;
  top: 50%;
  right: 8px;
  left: 8px;
  height: 2px;
  content: "";
  background: var(--brand);
  box-shadow: 0 0 14px rgba(238, 27, 36, 0.95);
  animation: qr-scan-line 1.8s ease-in-out infinite;
}

.qr-camera-dialog__status {
  min-height: 40px;
  margin-top: 12px;
  padding: 11px 12px;
  color: #d9d9d4;
  background: #202020;
  border: 1px solid #383838;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.35;
}

.qr-camera-dialog__help {
  margin: 12px 0 16px;
  color: #a2a29d;
  font-size: 11px;
  line-height: 1.5;
}

.qr-camera-dialog__cancel {
  width: 100%;
  color: white;
  background: transparent;
  border-color: #505050;
}

@keyframes qr-scan-line {
  0%, 100% { transform: translateY(-90px); opacity: 0.45; }
  50% { transform: translateY(90px); opacity: 1; }
}

@media (max-width: 720px) {
  .page-heading--warehouse { display: block; }
  .page-heading--warehouse .page-actions--warehouse { display: block; margin-top: 14px; }
  .page-heading--warehouse .page-actions .primary-button { display: inline-flex; width: 100%; min-width: 0; min-height: 44px; padding-inline: 14px; font-size: 11px; }
  .page-heading--warehouse .page-actions .secondary-button { display: none; }
  .warehouse-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .warehouse-kpis article { padding: 13px; }
  .warehouse-kpis strong { font-size: 24px; }
  .warehouse-workspace { grid-template-columns: 1fr; gap: 12px; }
  .warehouse-action-card { grid-template-columns: 34px minmax(0, 1fr); padding: 14px; }
  .warehouse-action-card > span { width: 34px; height: 34px; }
  .warehouse-action-card .secondary-button { grid-column: 1 / -1; width: 100%; min-height: 40px; }
  .warehouse-inventory__head { align-items: flex-start; padding: 16px; }
  .warehouse-inventory__head .text-link { margin-top: 4px; }
  .warehouse-order-card { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 14px 16px; }
  .warehouse-order__destination { grid-column: 1 / -1; }
  .warehouse-order__collection { grid-column: 1; }
  .warehouse-order__availability { grid-column: 2; grid-row: 3; }
  .warehouse-order__detail { grid-column: 1 / -1; width: 100%; min-height: 40px; }
  .warehouse-inventory-empty { align-items: flex-start; padding: 24px 16px; }
  .scanner-console__top { align-items: flex-start; gap: 10px; }
  .scanner-camera-button { min-height: 40px; font-size: 11px; }
  .compact-scan-target { flex-wrap: wrap; padding: 18px; }
  .compact-scan-target .scanner-camera-button { width: 100%; margin-left: 0; }
  .qr-camera-dialog { place-items: end center; padding: 0; }
  .qr-camera-dialog__panel {
    width: 100%;
    max-height: 90svh;
    padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }
  .qr-camera-dialog__viewer,
  .qr-camera-dialog__video { min-height: 360px; }
  .qr-camera-dialog__target { width: min(72vw, 265px); }
}

.return-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  padding: 1px;
  overflow: hidden;
  background: var(--line);
}

.return-summary > div {
  display: grid;
  align-content: center;
  min-height: 120px;
  padding: 18px;
  background: white;
}

.return-summary small {
  color: var(--muted);
  font-size: 9px;
}

.return-summary strong {
  margin-top: 5px;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.text-danger {
  color: var(--brand);
}

.company-feature {
  display: grid;
  grid-template-columns: minmax(340px, 1.3fr) repeat(3, minmax(130px, 0.55fr));
  gap: 1px;
  margin-bottom: 16px;
  overflow: hidden;
  color: white;
  background: #303030;
  border-radius: var(--radius-md);
}

.company-feature > article {
  display: grid;
  align-content: center;
  min-height: 140px;
  padding: 20px;
  background: var(--ink);
}

.company-feature__main {
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 13px;
}

.company-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--ink);
  background: white;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 850;
}

.company-feature__main > div:nth-child(2) {
  display: grid;
  gap: 3px;
}

.company-feature__main p {
  margin: 0;
  color: #777;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.company-feature h3 {
  margin: 0;
  font-size: 17px;
}

.company-feature__main span,
.company-feature article > span {
  color: #888;
  font-size: 8px;
}

.company-feature .secondary-button {
  color: white;
  background: #252525;
  border-color: #3a3a3a;
  font-size: 9px;
}

.company-feature article > small {
  color: #888;
  font-size: 8px;
}

.company-feature article > strong {
  margin: 4px 0;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.users-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.45fr);
}

.role-chip {
  display: inline-flex;
  padding: 5px 8px;
  color: var(--ink-soft);
  background: var(--canvas);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 750;
}

.role-chip--admin {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.role-matrix {
  padding: 22px;
}

.role-list {
  display: grid;
}

.role-list article {
  display: grid;
  gap: 4px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.role-list strong {
  font-size: 10px;
}

.role-list span {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.role-list b {
  justify-self: start;
  padding: 3px 6px;
  color: var(--route);
  background: var(--route-soft);
  border-radius: 4px;
  font-size: 7px;
}

.security-note {
  display: flex;
  gap: 9px;
  margin-top: 16px;
  padding: 12px;
  background: var(--success-soft);
  border-radius: var(--radius-sm);
}

.security-note > span {
  color: var(--success);
  font-weight: 900;
}

.security-note p {
  margin: 0;
  color: #3e6950;
  font-size: 8px;
  line-height: 1.45;
}

.security-note strong {
  color: #245d3c;
}

@media (max-width: 1180px) {
  :root { --sidebar-width: 238px; }
  .operations-overview { grid-template-columns: minmax(0, 2.5fr) minmax(240px, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .incident-list { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .incident-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
  .evidence-count { right: 12px; bottom: 12px; }
  .incident-item strong { padding-right: 0; }
  .create-layout { grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr); }
  .filter-pills { max-width: 340px; overflow-x: auto; }
  .company-feature { grid-template-columns: minmax(310px, 1.2fr) repeat(3, minmax(105px, 0.5fr)); }
}

@media (max-width: 960px) {
  .login-screen { grid-template-columns: minmax(340px, 0.85fr) minmax(440px, 1.15fr); }
  .login-brand { padding-inline: 34px; }
  .route-preview { grid-template-columns: repeat(2, 1fr); row-gap: 26px; }
  .login-panel { padding-inline: 46px; }

  .sidebar {
    transform: translateX(-105%);
    box-shadow: var(--shadow-float);
    transition: transform 220ms ease;
  }

  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-close { display: inline-flex; }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    background: rgba(10, 10, 10, 0.52);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }
  .sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .workspace__body { margin-left: 0; }
  .menu-button { display: inline-flex; }
  .operations-overview { grid-template-columns: 1fr; }
  .focus-card { min-height: 220px; }
  .create-layout,
  .assignment-layout { grid-template-columns: 1fr; }
  .guide-preview-column { position: static; }
  .warehouse-layout { grid-template-columns: 1fr; }
  .warehouse-summary { grid-template-columns: repeat(2, 1fr); }
  .couriers-layout,
  .collections-layout,
  .users-layout { grid-template-columns: 1fr; }
  .rider-preview { padding-block: 26px; }
  .delivery-capture { position: static; }
  .incidents-workbench { grid-template-columns: 1fr; }
  .incident-queue { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); overflow-x: auto; }
  .incident-queue__head { display: none; }
  .queue-item { border-right: 1px solid var(--line); }
  .company-feature { grid-template-columns: repeat(3, 1fr); }
  .company-feature__main { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body.is-authenticated { padding-bottom: 72px; }
  .login-screen { display: block; background: white; }
  .login-brand { display: none; }
  .login-panel { min-height: 100svh; padding: 28px 22px 20px; }
  .login-panel__inner { max-width: 480px; }
  .mobile-logo { display: flex; width: 108px; height: 68px; margin-bottom: clamp(40px, 10vh, 88px); padding: 4px 8px; }
  .login-heading h2 { font-size: 36px; }
  .login-legal { text-align: center; }

  .topbar { min-height: 70px; padding: 10px 16px; }
  .breadcrumbs { display: none; }
  .topbar h1 { font-size: 17px; }
  .global-search,
  .profile-copy,
  .profile-button > svg { display: none; }
  .profile-button { padding: 0; }
  .profile-avatar { width: 36px; height: 36px; }
  .main-content { min-height: calc(100vh - 70px); padding: 22px 16px 32px; }
  .page-heading { align-items: flex-start; margin-bottom: 20px; }
  .page-heading h2 { font-size: 28px; }
  .page-heading p:last-child { font-size: 12px; }
  .page-actions .secondary-button { display: none; }
  .page-actions .primary-button { width: 42px; min-width: 42px; padding: 0; font-size: 0; }

  .command-card { padding: 18px; }
  .command-card__head { align-items: flex-start; }
  .command-card h3 { font-size: 16px; }
  .delta { font-size: 8px; }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; margin-top: 24px; overflow: visible; padding-bottom: 0; }
  .pipeline__item span { font-size: 26px; }
  .focus-card { min-height: 220px; }
  .surface { padding: 18px; }
  .recent-orders { margin-inline: -16px; border-radius: 0; border-inline: 0; }
  .recent-orders .surface__head { padding-inline: 0; }
  .incident-list { grid-template-columns: 1fr; }
  .control-strip { grid-template-columns: 1fr; }
  .control-strip article { border-right: 0; border-bottom: 1px solid var(--line); }
  .control-strip article:last-child { border-bottom: 0; }
  .page-heading--module { align-items: flex-start; }
  .module-metrics--five { grid-template-columns: repeat(5, minmax(115px, 1fr)); overflow-x: auto; }
  .settlements__grid { grid-template-columns: 1fr; }
  .filter-toolbar { align-items: stretch; flex-direction: column; }
  .table-search,
  .courier-search { flex: 0 0 auto; width: 100%; }
  .filter-pills { max-width: 100%; overflow-x: auto; }
  .filter-button { align-self: flex-start; }
  .data-surface { margin-inline: -16px; border-radius: 0; border-inline: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .segmented-control { grid-template-columns: 1fr; }
  .shipping-label { grid-template-columns: 1fr 104px; }
  .warehouse-summary { grid-template-columns: 1fr; }
  .scanner-frame { min-height: 230px; }
  .operator-chip { display: none; }
  .warehouse-history .surface__head { padding-inline: 16px; }
  .assignment-layout { gap: 12px; }
  .module-metrics--four { grid-template-columns: repeat(4, minmax(135px, 1fr)); overflow-x: auto; }
  .couriers-table-card,
  .users-table-card { margin-inline: -16px; border-radius: 0; border-inline: 0; }
  .payment-bars > div { grid-template-columns: 110px 1fr 40px; }
  .incident-context { grid-template-columns: 1fr; }
  .incident-timeline { grid-template-columns: 1fr; gap: 14px; }
  .incident-timeline > div::before { top: 5px; bottom: -14px; left: 5px; width: 1px; height: auto; }
  .incident-actions { flex-wrap: wrap; }
  .returns-layout { grid-template-columns: 1fr; }
  .company-feature { grid-template-columns: 1fr; }
  .company-feature__main { grid-column: auto; grid-template-columns: 44px 1fr; }
  .company-feature__main .secondary-button { grid-column: 1 / -1; }

  .mobile-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 66px;
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .mobile-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted-light);
    background: none;
    border: 0;
    font-size: 9px;
  }

  .mobile-nav__item span { display: inline-flex; }
  .mobile-nav__item svg { width: 19px; height: 19px; }
  .mobile-nav__item.is-active { color: var(--brand); }
  .mobile-nav__scan {
    align-self: center;
    justify-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-top: -26px;
    color: white;
    background: var(--brand);
    border: 4px solid var(--canvas);
    border-radius: 50%;
    box-shadow: 0 8px 18px rgba(238, 27, 36, 0.26);
  }
  .mobile-nav__scan span { display: inline-flex; }
  .mobile-nav__scan svg { width: 21px; height: 21px; }

  .modal-backdrop { align-items: end; justify-items: stretch; padding: 0; }
  .modal { width: 100vw; max-width: 100vw; max-height: 88svh; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; transform: translateY(24px); }
}

@media (max-width: 420px) {
  .login-options { align-items: flex-start; flex-direction: column; gap: 12px; }
  .page-heading { gap: 12px; }
  .page-heading h2 { font-size: 25px; }
  .page-heading p:last-child { max-width: 230px; }
  .command-card__head { display: grid; }
  .delta { justify-self: start; }
  .order-detail-grid { grid-template-columns: 1fr; }
  .modal-heading--row { align-items: flex-start; flex-wrap: wrap; }
  .modal-heading--row .status-pill { margin-left: 56px; }
  .shipping-label { grid-template-columns: 1fr 88px; padding: 14px; }
  .visual-qr { width: 78px; height: 78px; margin-left: 10px; }
  .guide-preview { padding: 14px; }
  .guide-preview__actions { grid-template-columns: 1fr; }
  .manual-scan > div { grid-template-columns: 1fr; }
  .payment-bars > div { grid-template-columns: 1fr 42px; gap: 8px; }
  .payment-bars > div > span { grid-column: 1 / -1; }
  .evidence-gallery { grid-template-columns: 1fr; }
  .incident-detail { padding: 18px; }
  .incident-actions { display: grid; grid-template-columns: 1fr; }
  .whatsapp-disclaimer { text-align: left; }
  .return-summary { grid-template-columns: 1fr 1fr; }
}

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

.role-home__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.role-home__heading h2 {
  margin: 0;
  font-size: clamp(30px, 3vw, 42px);
  letter-spacing: -0.055em;
}

.role-home__heading p:last-child {
  max-width: 610px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.courier-command {
  padding: 28px;
  color: white;
  background: var(--ink);
  border-radius: var(--radius-lg);
}

.courier-command__route {
  display: flex;
  align-items: center;
  gap: 14px;
}

.courier-command__route > span,
.company-attention > div > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  color: white;
  background: var(--brand);
  border-radius: 14px;
}

.courier-command__route small,
.courier-command__route p {
  color: #b9b9b5;
}

.courier-command h3 {
  margin: 2px 0;
  font-size: 24px;
}

.courier-command__route p { margin: 0; font-size: 13px; }
.courier-command__route > strong { margin-left: auto; font-size: 36px; letter-spacing: -0.06em; }
.courier-command__route > strong small { font-size: 15px; }

.courier-progress { margin-top: 26px; }
.courier-progress > div { display: flex; justify-content: space-between; color: #d5d5d1; font-size: 13px; }
.courier-progress > i { display: block; height: 8px; margin-top: 9px; overflow: hidden; background: #3a3a38; border-radius: 999px; }
.courier-progress > i b { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.courier-command__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.courier-command__actions .secondary-button { color: white; border-color: #555552; background: transparent; }

.courier-availability {
  margin-top: 18px;
  padding: 20px 22px;
}

.courier-availability .surface__head > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 10px;
}

.courier-availability .surface__head > span svg { width: 17px; height: 17px; }
.courier-availability__intro { margin: -8px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.courier-availability__list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 10px; }
.courier-availability__list > article { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; padding: 12px; background: white; }
.courier-availability__count { display: inline-flex; align-items: center; justify-content: center; width: 27px; height: 27px; color: white; background: var(--ink); border-radius: 50%; font-size: 11px; font-weight: 850; }
.courier-availability__list strong,
.courier-availability__list small,
.courier-availability__list b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.courier-availability__list strong { font-size: 12px; }
.courier-availability__list small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.courier-availability__list b { grid-column: 1 / -1; color: var(--brand-dark); font-size: 10px; }
.courier-availability__empty { margin: 0; padding: 16px; color: var(--muted); background: white; font-size: 12px; line-height: 1.45; }
.courier-availability__action { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding: 14px 0 0; border-top: 1px solid var(--line); }
.courier-availability__action p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.courier-availability__action .secondary-button { flex: 0 0 auto; min-height: 40px; }

.courier-home-grid,
.company-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(250px, 0.85fr);
  gap: 18px;
  margin-top: 18px;
}

.courier-stops,
.company-orders { padding: 22px; }
.courier-stop-list,
.company-order-list { display: grid; margin: 16px 0; border-top: 1px solid var(--line); }

.courier-stop-list button,
.company-order-list button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.courier-stop-list button > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.courier-stop-list small,
.company-order-list small { display: block; margin-top: 3px; color: var(--muted); }
.courier-stop-list b,
.company-order-list b { font-size: 14px; }
.courier-stop-list i { color: var(--muted-light); font-size: 24px; font-style: normal; }

.courier-revenue,
.company-attention {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: #f0f0ed;
  border-radius: var(--radius-lg);
}

.courier-revenue > strong { margin-top: 2px; font-size: 34px; letter-spacing: -0.06em; }
.courier-revenue > span { margin-top: 4px; color: var(--muted); font-size: 13px; }
.courier-revenue > div { display: flex; justify-content: space-between; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); font-size: 13px; }
.courier-revenue > div small { color: var(--muted); }
.courier-revenue > button { margin-top: auto; padding-top: 14px; }

.company-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.company-metrics article {
  min-height: 140px;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.company-metrics small { display: block; color: var(--muted); font-size: 12px; }
.company-metrics strong { display: block; margin: 14px 0 4px; font-size: 30px; letter-spacing: -0.06em; }
.company-metrics span { color: var(--muted); font-size: 12px; }
.company-metrics__alert { background: var(--brand-soft) !important; border-color: #ffd0d3 !important; }
.company-metrics__alert button { padding: 0; color: var(--brand-dark); background: none; border: 0; font-size: 12px; font-weight: 800; }

.company-order-list button { grid-template-columns: minmax(0, 1fr) auto auto; }
.company-order-list .status-pill { margin-right: 8px; }

/* Panel visual del cliente empresa (efectividad, estados y recaudo) */
.company-panel { margin-top: 18px; padding: 22px; }
.panel-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.85fr) minmax(0, 1.35fr) minmax(175px, 0.8fr);
  gap: 24px;
  align-items: center;
  margin-top: 16px;
}

.panel-donut { display: flex; flex-direction: column; align-items: center; text-align: center; }
.donut-wrap { position: relative; width: 148px; height: 148px; }
.donut { width: 100%; height: 100%; }
.donut circle { fill: none; stroke-width: 14; }
.donut__bg { stroke: #ececea; }
.donut__fg { stroke: var(--success); stroke-linecap: round; }
.donut-caption { position: absolute; inset: 0; display: grid; place-content: center; }
.donut-caption strong { font-size: 34px; letter-spacing: -0.05em; line-height: 1; }
.donut-caption small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.25; }
.panel-note { max-width: 220px; margin: 14px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.panel-dist { align-self: center; }
.panel-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.dist-bars { display: grid; gap: 11px; margin: 14px 0 0; padding: 0; list-style: none; }
.dist-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 22px; align-items: center; gap: 11px; background: transparent; }
.dist-name { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 12.5px; font-weight: 600; }
.dist-name i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.dist-track { height: 10px; overflow: hidden; background: #efefec; border-radius: 999px; }
.dist-track b { display: block; height: 100%; background: currentColor; border-radius: inherit; }
.dist-count { color: var(--ink); font-size: 13px; font-weight: 800; text-align: right; }

.panel-money { display: grid; gap: 12px; align-content: center; }
.money-cell { padding: 14px 16px; background: #f6f6f3; border: 1px solid var(--line); border-radius: var(--radius-md); }
.money-cell small { display: block; color: var(--muted); font-size: 12px; }
.money-cell strong { display: block; margin: 5px 0 2px; font-size: 22px; letter-spacing: -0.04em; }
.money-cell span { color: var(--muted); font-size: 11.5px; }
.money-cell--in { background: var(--success-soft); border-color: #bfe6cd; }
.money-cell--in strong { color: var(--success); }

/* Filas de pedido con detalle (últimos pedidos del cliente empresa) */
.company-order-list--rich { margin-top: 14px; border-top: 1px solid var(--line); }
.company-order-list--rich .home-order {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  cursor: pointer;
}
.company-order-list--rich .home-order:hover { background: var(--canvas); }
.home-order__id strong { font-size: 14px; }
.home-order__id small { display: block; margin-top: 3px; color: var(--muted); }
.home-order__id em { display: block; margin-top: 3px; color: var(--muted-light); font-size: 11.5px; font-style: normal; }
.home-order__mid { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.home-order__end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.home-order__end b { font-size: 14px; }
.home-order__see { display: inline-flex; align-items: center; gap: 5px; color: var(--brand-dark); font-size: 12px; font-weight: 700; }
.home-order__see svg { width: 15px; height: 15px; }

@media (max-width: 900px) {
  .panel-grid { grid-template-columns: 1fr 1fr; }
  .panel-money { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .panel-grid { grid-template-columns: 1fr; }
  .panel-money { grid-template-columns: 1fr; }
  .company-order-list--rich .home-order { grid-template-columns: 1fr; gap: 9px; }
  .company-order-list--rich .home-order__end { align-items: flex-start; }
}
.company-attention { justify-content: space-between; background: var(--ink); color: white; }
.company-attention p:not(.section-kicker) { color: #c6c6c1; line-height: 1.55; }
.company-attention h3 { margin: 11px 0 8px; font-size: 21px; }
.company-attention .secondary-button { color: white; border-color: #5a5a56; background: transparent; }

.demo-profile-list { display: grid; gap: 8px; margin-top: 20px; }
.demo-profile-option { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 12px; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.demo-profile-option:hover { border-color: var(--ink); }
.demo-profile-option.is-current { background: var(--brand-soft); border-color: #ffc1c5; }
.demo-profile-option > span { display: grid; width: 42px; height: 42px; place-items: center; color: var(--brand); background: #ffe4e6; border-radius: 50%; font-size: 12px; font-weight: 900; }
.demo-profile-option > div { min-width: 0; }
.demo-profile-option strong,
.demo-profile-option small { display: block; }
.demo-profile-option small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.demo-profile-option b { color: var(--success); font-size: 11px; }
.demo-profile-option i { color: var(--muted); font-size: 24px; font-style: normal; }
.demo-route-scenario { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; background: var(--ink); color: white; border-radius: var(--radius-sm); }
.demo-route-scenario > div { min-width: 0; }
.demo-route-scenario .section-kicker { margin-bottom: 5px; color: #ff858b; font-size: 9px; }
.demo-route-scenario strong,
.demo-route-scenario small { display: block; }
.demo-route-scenario strong { font-size: 13px; }
.demo-route-scenario small { margin-top: 4px; color: #c8c8c3; font-size: 11px; line-height: 1.4; }
.demo-route-scenario .secondary-button { flex: 0 0 auto; color: white; background: transparent; border-color: #60605c; }

@media (max-width: 900px) {
  .company-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .courier-home-grid,
  .company-home-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .role-home__heading { display: grid; gap: 14px; }
  .role-home__heading .live-indicator { justify-self: start; }
  .courier-command { padding: 20px; }
  .courier-command__route { align-items: flex-start; }
  .courier-command__route > strong { font-size: 28px; }
  .courier-command__actions { display: grid; grid-template-columns: 1fr; }
  .courier-command__actions button { justify-content: center; }
  .company-metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .company-metrics article { min-height: 124px; padding: 15px; }
  .company-metrics strong { margin-top: 10px; font-size: 26px; }
  .courier-stop-list button { grid-template-columns: 30px minmax(0, 1fr) auto 10px; gap: 8px; }
  .company-order-list button { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .company-order-list .status-pill { grid-row: 2; justify-self: start; margin-top: 4px; }
  .company-order-list b { grid-column: 2; grid-row: 1 / span 2; }
  .demo-profile-option { grid-template-columns: 38px minmax(0, 1fr) auto; padding: 10px; }
  .demo-profile-option > span { width: 38px; height: 38px; }
  .demo-profile-option small { white-space: normal; overflow-wrap: anywhere; }
  .demo-profile-option b { align-self: start; padding-top: 2px; }
  .demo-route-scenario { align-items: flex-start; flex-direction: column; gap: 12px; }
  .demo-route-scenario .secondary-button { width: 100%; }
}

.role-orders-table { padding: 20px; }
.courier-collection-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.courier-collection-metrics article { padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); }
.courier-collection-metrics small { display: block; color: var(--muted); font-size: 12px; }
.courier-collection-metrics strong { display: block; margin: 11px 0 4px; font-size: 30px; letter-spacing: -0.06em; }
.courier-collection-metrics span { color: var(--muted); font-size: 12px; }

.courier-incident-layout,
.company-incidents-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr); gap: 18px; }
.courier-incident-form { display: grid; gap: 16px; padding: 24px; }
.courier-evidence,
.company-evidence-row { display: flex; align-items: center; gap: 13px; padding: 14px; background: var(--canvas); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.courier-evidence > span,
.company-evidence-row > span { display: inline-flex; color: var(--brand); }
.courier-evidence small,
.company-evidence-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.courier-evidence .secondary-button,
.company-evidence-row .secondary-button { margin-left: auto; }
.courier-incident-status { display: flex; flex-direction: column; padding: 24px; color: white; background: var(--ink); border-radius: var(--radius-lg); }
.courier-incident-status > span { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; color: white; background: var(--brand); border-radius: 12px; }
.courier-incident-status h3 { margin: 10px 0; font-size: 22px; }
.courier-incident-status p:not(.section-kicker) { color: #c7c7c2; line-height: 1.6; }
.courier-incident-status .secondary-button { margin-top: auto; color: white; background: transparent; border-color: #585854; }

.company-incident-detail { padding: 24px; }
.company-incident-detail .surface__head { align-items: flex-start; }
.company-incident-detail .surface__head span:not(.status-pill) { color: var(--muted); font-size: 13px; }
.company-incident-context { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.company-incident-context small { display: block; color: var(--muted); font-size: 11px; }
.company-incident-context strong { display: block; margin-top: 4px; font-size: 14px; }
.company-incident-detail blockquote { margin: 18px 0; padding-left: 16px; color: var(--ink-soft); border-left: 3px solid var(--brand); font-size: 16px; line-height: 1.55; }
.company-evidence-row { margin-bottom: 20px; }
.company-incident-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.company-incident-queue { display: grid; align-content: start; gap: 8px; padding: 20px; background: #f0f0ed; border-radius: var(--radius-lg); }
.company-incident-queue button { display: grid; gap: 4px; padding: 13px; text-align: left; background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); }
.company-incident-queue button:hover,
.company-incident-queue button.is-active { background: var(--paper); border-color: var(--line); }
.company-incident-queue small { color: var(--muted); }

@media (max-width: 900px) {
  .courier-incident-layout,
  .company-incidents-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .courier-collection-metrics { grid-template-columns: 1fr; gap: 10px; }
  .courier-collection-metrics article { padding: 16px; }
  .company-incident-context { grid-template-columns: 1fr; gap: 10px; }
  .company-incident-actions { display: grid; grid-template-columns: 1fr; }
  .company-evidence-row { align-items: flex-start; flex-wrap: wrap; }
  .company-evidence-row .secondary-button { margin-left: 55px; }
  .courier-evidence { align-items: flex-start; flex-wrap: wrap; }
  .courier-evidence .secondary-button { margin-left: 55px; }
}

/* Tarjeta de seguimiento en vivo del pedido rastreado (FE-001285). */
.trace-card {
  margin-bottom: 22px;
  padding: 20px 22px;
  border-left: 4px solid var(--trace-accent, var(--line-strong));
}

.trace-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.trace-card__head h3 {
  margin: 2px 0 4px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.trace-card__route {
  color: var(--muted);
  font-size: 12px;
}

.trace-card__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.trace-card__facts small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trace-card__facts strong {
  font-size: 14px;
  letter-spacing: -0.01em;
}

/* Riel de progreso del ciclo Creado -> En bodega -> Asignado -> En ruta. */
.trace-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 4px;
  margin-bottom: 14px;
}

.trace-flow__step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.trace-flow__step b {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.trace-flow__step.is-done {
  color: var(--ink-soft);
  background: #eef1ee;
}

.trace-flow__step.is-done b { background: var(--success); }

.trace-flow__step.is-current {
  color: #fff;
  background: var(--trace-accent, var(--ink));
}

.trace-flow__step.is-current b { background: #fff; }

.trace-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--canvas);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.trace-banner svg { width: 16px; height: 16px; flex: none; }
.trace-banner--alert { background: var(--warning-soft); color: var(--warning); }
.trace-banner--ok { background: var(--success-soft); color: var(--success); }

.trace-timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trace-timeline__item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 0 0 14px 2px;
}

.trace-timeline__item i {
  position: relative;
  flex: none;
  width: 11px;
  height: 11px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--trace-accent, var(--ink));
}

.trace-timeline__item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.trace-timeline__item:last-child { padding-bottom: 0; }
.trace-timeline__item:last-child::before { display: none; }

.trace-timeline__item strong {
  display: block;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.trace-timeline__item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.trace-timeline__item small {
  display: block;
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 11px;
}

.trace-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.trace-card__foot .text-button {
  padding: 0;
  background: none;
  border: 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.delivery-order--live {
  border-color: var(--route);
  background: var(--route-soft);
}

.evidence-upload.has-evidence {
  border-color: var(--success);
  background: var(--success-soft);
}

@media (max-width: 640px) {
  .trace-card__facts { grid-template-columns: 1fr; gap: 10px; }
  .trace-card__head { flex-direction: column; }
}

/* QR real (SVG escaneable) dentro del recuadro de la guía. */
.visual-qr--real {
  display: block;
  grid-template-columns: none;
  padding: 4px;
  background: #fff;
  border-radius: 4px;
}
.visual-qr--real .qr-svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Guía de demostración: cartel paso a paso para presentar en vivo. */
.demo-guide {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fff 0%, var(--brand-soft) 100%);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-md);
}

.demo-guide__badge {
  flex: none;
  align-self: flex-start;
  padding: 4px 8px;
  background: var(--brand);
  color: #fff;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.demo-guide__body { flex: 1; min-width: 0; }

.demo-guide__step {
  margin: 0 0 3px;
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-guide__text {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
}

.demo-guide__text b { font-weight: 800; }

.demo-guide__actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-guide__actions .primary-button { white-space: nowrap; }

.demo-guide__actions .text-button {
  padding: 0;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.demo-guide-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.demo-guide-chip svg { width: 15px; height: 15px; }

@media (max-width: 720px) {
  .demo-guide { flex-direction: column; align-items: stretch; gap: 10px; }
  .demo-guide__actions { justify-content: space-between; }
  .demo-guide__actions .primary-button { flex: 1; text-align: center; justify-content: center; }
}

/* Botones para generar la guía PDF (Carta / Sticker 10×15). */
.guide-print-label {
  margin: 4px 0 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.guide-print-row,
.modal-print-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.modal-print-row { margin: 0 0 12px; }

.guide-print-row .secondary-button,
.modal-print-row .secondary-button {
  flex: 1;
  justify-content: center;
  white-space: nowrap;
}

@media (max-width: 380px) {
  .guide-print-row,
  .modal-print-row { flex-direction: column; }
}

/* Vista previa de la guía: observaciones con etiqueta y valor "sin recaudo". */
.shipping-label__note small {
  display: block;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #111;
  margin-bottom: 2px;
}
.shipping-label__note span {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: #222;
  line-height: 1.35;
}
.shipping-label__amount--none strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

/* Selector de tamaño de impresión (Sticker 10×15 / Carta) — estado marcado muy claro. */
.size-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.size-toggle__option { cursor: pointer; }
.size-toggle__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.size-toggle__option > span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 10px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  text-align: center;
}
.size-toggle__option > span svg { width: 18px; height: 18px; color: var(--muted); }
.size-toggle__option input:checked + span {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(238, 27, 36, 0.28);
}
.size-toggle__option input:checked + span svg { color: #fff; }
.size-toggle__option input:focus-visible + span { box-shadow: 0 0 0 3px rgba(238, 27, 36, 0.28); }

@media (max-width: 380px) {
  .size-toggle { grid-template-columns: 1fr; }
}

/* Crear pedido: acciones de guía separadas del botón de crear. */
.guide-print-label--spaced { margin-top: 20px; }
.guide-secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
  margin-bottom: 10px;
}
.guide-secondary-actions .secondary-button { justify-content: center; }

/* Formato de impresión: dos piezas físicas claras, no dos botones genéricos. */
.guide-format {
  margin: 18px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #fff 0%, #fbfaf9 100%);
}

.guide-format__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.guide-format__head .section-kicker { margin-bottom: 3px; }
.guide-format__head h4 { margin: 0; font-size: 13px; letter-spacing: -0.01em; }
.guide-format__head > span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.guide-format__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.guide-format__option { cursor: pointer; min-width: 0; }
.guide-format__option > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.guide-format__card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease, background 150ms ease;
}

.guide-format__paper {
  position: relative;
  display: grid;
  place-content: center;
  gap: 3px;
  justify-self: center;
  width: 27px;
  border: 1px solid #8e8a86;
  border-radius: 3px;
  background: #fff;
  box-shadow: 2px 3px 0 rgba(25, 22, 20, 0.09);
}

.guide-format__paper--letter { height: 37px; }
.guide-format__paper--sticker { width: 36px; height: 25px; }
.guide-format__paper i {
  display: block;
  width: 15px;
  height: 2px;
  border-radius: 2px;
  background: #c5c1be;
}
.guide-format__paper i:first-child { background: var(--brand); }
.guide-format__paper--sticker i { width: 21px; }

.guide-format__copy { display: grid; min-width: 0; gap: 2px; }
.guide-format__copy strong { font-size: 12px; line-height: 1.15; }
.guide-format__copy small { color: var(--muted); font-size: 9px; font-weight: 650; line-height: 1.25; }
.guide-format__copy em {
  overflow: hidden;
  color: var(--brand-dark);
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-format__card > b {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: transparent;
  font-size: 11px;
  line-height: 1;
}

.guide-format__option:hover .guide-format__card { border-color: #9a9692; transform: translateY(-1px); }
.guide-format__option > input:checked + .guide-format__card {
  border-color: var(--brand);
  background: linear-gradient(135deg, #fff 0%, var(--brand-soft) 100%);
  box-shadow: 0 7px 16px rgba(238, 27, 36, 0.13);
}
.guide-format__option > input:checked + .guide-format__card > b {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.guide-format__option > input:focus-visible + .guide-format__card { box-shadow: 0 0 0 3px rgba(238, 27, 36, 0.25); }

@media (max-width: 640px) {
  .page-heading--module .step-indicator { display: none; }
  .guide-format__options { grid-template-columns: 1fr; }
  .guide-format__card { min-height: 70px; }

  /* Crear pedido: una sola columna táctil, sin espacios laterales ni filas desiguales. */
  .form-section[data-create-section="destination"] { padding: 18px 16px; }
  .form-section[data-create-section="destination"] .form-grid { gap: 12px; }
  .form-section[data-create-section="destination"] .form-section__group + .form-section__group {
    margin-top: 16px;
    padding-top: 16px;
  }
}

/* Barra de acciones en lote (Pedidos): imprimir varias guías. */
.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-md);
}
.bulk-bar__count { font-size: 13px; font-weight: 600; }
.bulk-bar__count strong { font-size: 17px; }
.bulk-bar__right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bulk-bar .primary-button { white-space: nowrap; }

.size-toggle--mini { display: flex; gap: 6px; margin: 0; }
.size-toggle--mini .size-toggle__option > span {
  padding: 7px 11px;
  font-size: 12px;
  border-width: 1px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.size-toggle--mini .size-toggle__option input:checked + span {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
  box-shadow: none;
}

.orders-table .view-guide { white-space: nowrap; font-weight: 700; }
.orders-table .view-guide svg { width: 14px; height: 14px; }
.is-live-row { background: var(--brand-soft); }

@media (max-width: 640px) {
  .guide-secondary-actions { grid-template-columns: 1fr; }
  .bulk-bar { flex-direction: column; align-items: stretch; }
  .bulk-bar__right { justify-content: space-between; }
}

/* Botón de WhatsApp contextual en la tarjeta de seguimiento. */
.trace-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #25d366;
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.trace-wa svg { width: 14px; height: 14px; }
.trace-wa:hover { background: #1fb457; }

/* Estado de cuenta del cliente empresa. */
.account-card { margin-bottom: 18px; }
.account-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0 6px;
}
.account-cell {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--paper);
}
.account-cell small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.account-cell strong { display: block; margin: 6px 0 2px; font-size: 24px; letter-spacing: -0.02em; }
.account-cell span { font-size: 11px; color: var(--muted-light); }
.account-cell--in strong { color: var(--success); }
.account-cell--out strong { color: var(--brand); }
.account-cell--net { background: var(--ink); border-color: var(--ink); }
.account-cell--net small { color: #b9b9b9; }
.account-cell--net strong { color: #fff; }
.account-cell--net span { color: #9a9a9a; }

.account-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 14px;
  padding: 10px 12px;
  background: var(--warning-soft);
  color: var(--warning);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.4;
}
.account-note svg { width: 18px; height: 18px; flex: none; }

.account-table th, .account-table td { padding: 10px 12px; font-size: 13px; }
.account-table td small { display: block; color: var(--muted); font-size: 11px; }
.account-flete { color: var(--brand); font-weight: 700; white-space: nowrap; }

@media (max-width: 640px) {
  .account-summary { grid-template-columns: 1fr; gap: 10px; }
  .account-cell strong { font-size: 22px; }
}

/* Botón "Ver guía" en el modal de detalle. */
.modal-view-guide { width: 100%; justify-content: center; margin: 4px 0 14px; }

/* Estados vacíos: cuando aún no hay pedidos reales (operación limpia). */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 34px 22px;
  text-align: center;
  color: var(--muted);
}
.empty-state svg { width: 34px; height: 34px; stroke: currentColor; fill: none; opacity: 0.55; }
.empty-state p { margin: 0; font-size: 14px; line-height: 1.45; max-width: 34ch; }
.empty-state--inline { padding: 20px 16px; }
.table-empty td { padding: 0 !important; background: transparent; }
.batch-empty { padding: 8px 4px; }
.rider-order-empty { padding: 16px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.delivery-order--empty strong { color: var(--muted); font-weight: 700; }
.delivery-order--empty { opacity: 0.85; }

/* Mini-trazabilidad por fila (4 puntos: Creado · Bodega · Ruta · Entregado). */
.mini-flow { display: flex; gap: 4px; margin-top: 5px; }
.mini-flow i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex: 0 0 auto; }
.mini-flow i.is-done { background: #176bb5; }
.mini-flow i.is-current { background: #176bb5; box-shadow: 0 0 0 3px rgba(23, 107, 181, 0.18); }
.mini-flow--alert i.is-done { background: #c47f17; }
.mini-flow--alert i.is-current { background: #c47f17; box-shadow: 0 0 0 3px rgba(196, 127, 23, 0.18); }
.reassign-block { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 4px 0 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }
.reassign-block .field { flex: 1; min-width: 180px; margin: 0; }
.list-totals { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.list-total { flex: 1; min-width: 120px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.list-total small { display: block; color: var(--muted); font-size: 12px; }
.list-total strong { font-size: 20px; font-weight: 800; }
tr[hidden] { display: none; }
.filter-empty { text-align: center; color: var(--muted); padding: 18px; font-size: 14px; }
.row-actions { white-space: nowrap; }
.row-actions .text-link { margin-right: 12px; }
.row-actions .text-link:last-child { margin-right: 0; }

/* Cuadre / liquidación diaria. */
.cuadre-card { margin-bottom: 16px; }
.cuadre-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 14px; }
.cuadre-cell { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.cuadre-cell small { display: block; color: var(--muted); font-size: 12px; }
.cuadre-cell strong { display: block; font-size: 20px; font-weight: 800; margin: 2px 0; }
.cuadre-cell span { font-size: 11px; color: var(--muted); }
.cuadre-cell--cash { background: rgba(37, 211, 102, 0.10); border-color: rgba(37, 211, 102, 0.35); }
.cuadre-cell--net { background: #111; color: #fff; border-color: #111; }
.cuadre-cell--net small, .cuadre-cell--net span { color: #cfcfcf; }
.cuadre-history { margin-top: 14px; }
.cuadre-history--inline { margin-top: 16px; }
.cuadre-guias { font-size: 12px; color: var(--muted); word-break: break-word; margin: 2px 0 12px; }
.dashboard-cuadres { margin-top: 16px; }
.account-note--ok { color: #0b7a3b; }
.account-note--ok svg { stroke: currentColor; }

/* Interruptor On/Off de usuarios. */
.user-status { display: flex; align-items: center; gap: 8px; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: #c9c9c4; border-radius: 999px; transition: background .18s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + span { background: #25d366; }
.switch input:checked + span::after { transform: translateX(16px); }
.user-state { font-size: 12px; font-weight: 700; color: #0b7a3b; }
.user-row--off { opacity: 0.55; }
.user-row--off .user-state { color: var(--muted); }

/* Mi ruta (motorizado): cada parada se resuelve con sus propios botones. */
.courier-command__hint { margin: 8px 0 0; font-size: 12.5px; opacity: 0.85; }
.stop-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 10px;
  background: #fff;
}
.stop-row__main {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px;
  background: transparent; border: 0; cursor: pointer; text-align: left;
}
.stop-row__num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--line); color: #333; font-size: 12px; font-weight: 800;
}
.stop-row__info { flex: 1; min-width: 0; }
.stop-row__info strong { display: block; font-size: 15px; }
.stop-row__info small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stop-row__amount { font-weight: 800; font-size: 15px; white-space: nowrap; }
.stop-row__amount.is-paid { color: var(--muted); font-weight: 600; }
.stop-row__actions {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  min-width: 0; background: var(--line); border-top: 1px solid var(--line);
}
.stop-act {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-width: 0; min-height: 78px; padding: 9px 4px 8px; border: 0; background: #fff; cursor: pointer;
  font-size: 11px; font-weight: 800; color: #333; transition: background .16s ease, transform .16s ease;
}
.stop-act > span:not(.action-icon) { max-width: 100%; overflow: hidden; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.stop-act svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }
.action-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 31px; height: 31px;
  border: 1px solid currentColor; border-radius: 11px; background: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 3px 7px rgba(16, 24, 40, .12);
}
.action-icon svg { width: 17px; height: 17px; }
.stop-act:hover { background: #fafaf8; }
.stop-act:active { transform: translateY(1px); }
.stop-act:focus-visible, .contact-choice:focus-visible { z-index: 1; outline: 3px solid rgba(239, 27, 42, .3); outline-offset: -3px; }
.stop-act--wa { color: #1c8c4c; }
.stop-act--wa .action-icon { background: linear-gradient(145deg, #f5fff8, #ddf7e7); }
.stop-act--deliver { color: #0b7a3b; background: rgba(37, 211, 102, 0.10); }
.stop-act--deliver:hover { background: rgba(37, 211, 102, 0.18); }
.stop-act--deliver .action-icon { background: linear-gradient(145deg, #f4fff7, #d7f7e2); }
.stop-act--incident { color: #b45c09; }
.stop-act--incident .action-icon { background: linear-gradient(145deg, #fffaf2, #fee9c9); }
.stop-act--return { color: var(--muted); }
.stop-act--return .action-icon { background: linear-gradient(145deg, #fff, #eeeeeb); }
.stop-act__whatsapp { display: inline-flex; align-items: center; max-width: 100%; gap: 3px; overflow: hidden; color: #1c8c4c; font-size: 8px; font-weight: 850; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.stop-act__whatsapp svg { width: 11px; height: 11px; }

.modal-icon--contact { color: #fff; background: #16874a; box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 6px 16px rgba(22, 135, 74, .22); }
.contact-summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafaf8; font-size: 12px; }
.contact-summary span { color: var(--muted); }
.contact-summary strong { min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.contact-choices { display: grid; gap: 9px; }
.contact-choice { display: grid; grid-template-columns: 44px minmax(0, 1fr) 18px; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 10px 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; text-align: left; text-decoration: none; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.contact-choice:hover { transform: translateY(-1px); border-color: #b7b7b1; box-shadow: 0 5px 14px rgba(16,24,40,.08); }
.contact-choice:active { transform: translateY(0); }
.contact-choice__icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 13px; }
.contact-choice__icon svg { width: 21px; height: 21px; }
.contact-choice > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.contact-choice strong { font-size: 14px; }
.contact-choice small { color: var(--muted); font-size: 11px; line-height: 1.25; }
.contact-choice > svg { width: 16px; height: 16px; color: var(--muted); }
.contact-choice--whatsapp .contact-choice__icon { color: #fff; background: #16874a; box-shadow: inset 0 1px 0 rgba(255,255,255,.26), 0 4px 10px rgba(22, 135, 74, .20); }
.contact-choice--phone .contact-choice__icon { color: #173f74; background: #e9f1ff; box-shadow: inset 0 1px 0 rgba(255,255,255,.92), 0 4px 10px rgba(23,63,116,.12); }
.contact-empty { margin: 0; padding: 12px 14px; color: #9b590d; border: 1px solid #f3d6ad; border-radius: 12px; background: #fff8ed; font-size: 13px; line-height: 1.45; }

.whatsapp-disclaimer svg { width: 13px; height: 13px; margin-right: 3px; color: #1c8c4c; vertical-align: -2px; }

/* Selector de tamaño de guía compacto (arriba de CREAR PEDIDO). */
.size-toggle--compact { margin-bottom: 10px; }
.size-toggle--compact .size-toggle__option { padding: 8px 10px; font-size: 12px; }
.size-toggle--compact .size-toggle__option svg { width: 14px; height: 14px; }
.guide-secondary-actions--stack { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.field-hint { color: var(--muted); font-weight: 400; font-size: 11px; }
.field-control select:disabled { opacity: 0.55; cursor: not-allowed; }

/* Acciones del motorizado sobre su pedido (entregar / novedad). */
.trace-cobro {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 10px; padding: 10px 12px;
  border-radius: 10px; font-size: 14px; font-weight: 700;
  background: rgba(37, 211, 102, 0.12); color: #0b7a3b;
}
.trace-cobro b { font-weight: 800; }
.trace-cobro svg { width: 18px; height: 18px; flex: 0 0 auto; }
.trace-cobro--paid { background: rgba(105, 105, 102, 0.12); color: var(--muted); }
.trace-actions { display: flex; gap: 10px; margin: 2px 0 12px; }
.trace-action {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 12px; border: 0; border-radius: 12px;
  font-size: 15px; font-weight: 800; cursor: pointer;
}
.trace-action svg { width: 18px; height: 18px; }
.trace-action--deliver { background: #25d366; color: #fff; }
.trace-action--deliver:hover { background: #1fb457; }
.trace-action--incident { background: #fef3e2; color: #b45c09; }
.trace-action--incident:hover { background: #fde6c7; }
.pay-highlight {
  display: flex; align-items: center; gap: 8px;
  margin: 6px 0 12px; padding: 12px 14px; border-radius: 12px;
  font-size: 15px; font-weight: 700;
  background: rgba(37, 211, 102, 0.12); color: #0b7a3b;
}
.pay-highlight b { font-weight: 900; font-size: 17px; }
.pay-highlight--paid { background: rgba(105, 105, 102, 0.12); color: var(--muted); }

/* Devoluciones: paquetes en bodega listos para regresar a la empresa. */
.return-ready { margin-top: 16px; }
.return-ready-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 8px; }
.return-ready-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface, #fff);
}
.return-ready-item strong { display: block; font-size: 14px; }
.return-ready-item small { color: var(--muted); font-size: 12px; }
.return-ready-item .primary-button { white-space: nowrap; }

/* Botón de WhatsApp ancho (dentro del detalle del pedido). */
.trace-wa--block {
  width: 100%;
  justify-content: center;
  padding: 13px 16px;
  font-size: 14px;
  border-radius: 12px;
  margin: 2px 0 12px;
}
.trace-wa--block svg { width: 18px; height: 18px; }

/* Auditoría visual responsive v2.2.0.
   El producto operativo debe leerse sin zoom y ningún módulo puede forzar
   desplazamiento horizontal fuera de su propio contenedor. */
@media (max-width: 760px) {
  .main-content,
  .page,
  .surface,
  .modal,
  .table-wrap {
    min-width: 0;
  }

  .main-content {
    overflow-x: clip;
  }

  .main-content .table-wrap {
    max-width: 100%;
    overscroll-behavior-inline: contain;
  }

  .main-content th {
    font-size: 11px;
  }

  .main-content td {
    font-size: 13px;
  }

  .main-content td small,
  .main-content .status-pill,
  .main-content .text-button,
  .main-content .text-link,
  .main-content .module-metrics small,
  .main-content .module-metrics span,
  .main-content .prototype-footnote,
  .main-content .whatsapp-disclaimer,
  .main-content .proof-link,
  .main-content .trace-card__facts small,
  .main-content .trace-flow__step,
  .main-content .trace-timeline__item small,
  .main-content .trace-timeline__item span,
  .main-content .company-feature__main p,
  .main-content .company-feature__main span,
  .main-content .company-feature article > small,
  .main-content .company-feature article > span,
  .main-content .role-chip,
  .main-content .role-list span,
  .main-content .role-list b,
  .main-content .security-note p,
  .main-content .payment-bars small,
  .main-content .payment-bars em,
  .main-content .evidence-upload small,
  .main-content .delivery-order small,
  .main-content .delivery-order span,
  .main-content .incident-context small,
  .main-content .incident-context span,
  .main-content .queue-item small,
  .main-content .incident-timeline strong,
  .main-content .incident-timeline small,
  .main-content .return-summary small,
  .main-content .rider-order-list > p,
  .main-content .rider-order-list article strong,
  .main-content .rider-order-list article small,
  .main-content .rider-bottom-nav small,
  .main-content .rider-preview > p {
    font-size: 11px;
  }

  .main-content .section-kicker,
  .main-content .eyebrow,
  .main-content .demo-guide__step {
    font-size: 10px;
  }

  .main-content .primary-button,
  .main-content .secondary-button {
    min-height: 44px;
    font-size: 14px;
  }

  .main-content .modal .primary-button,
  .main-content .modal .secondary-button {
    min-height: 46px;
  }

  .mobile-nav__item {
    font-size: 10px;
    font-weight: 700;
  }

  .mobile-nav__item small,
  .sidebar-health small {
    font-size: 10px;
  }

  .sidebar .nav-label {
    font-size: 11px;
  }
}

/* Disponibilidad territorial: torre de control para bodega y administración.
   El mapa es un esquema propio (SVG + marcadores en HTML), 100% local: no
   depende de red ni de proveedores externos. La lista conserva todo el detalle. */
.page-actions--warehouse {
  align-items: center;
}

.territory-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 18px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.territory-metrics article {
  min-width: 0;
  padding: 18px 20px;
  background: var(--paper);
}

.territory-metrics small,
.territory-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.territory-metrics strong {
  display: block;
  margin: 5px 0 3px;
  overflow: hidden;
  font-size: clamp(24px, 2.2vw, 32px);
  letter-spacing: -0.055em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.territory-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  align-items: start;
  gap: 18px;
}

.territory-map-card,
.territory-list {
  min-width: 0;
}

.territory-map-card {
  padding: 0;
  overflow: hidden;
}

.territory-map-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--line);
}

.territory-map-card__head h3,
.territory-list h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.035em;
}

.territory-map-card__head p:last-child {
  max-width: 450px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.territory-map-card__head .secondary-button {
  flex: 0 0 auto;
  min-height: 40px;
  white-space: nowrap;
}

.territory-map {
  position: relative;
  overflow: hidden;
}

.territory-live-map { position: relative; padding: 18px 18px 16px; }

.territory-live-map__canvas {
  position: relative;
  /* Encierra las capas internas de Leaflet para que no compitan con ventanas. */
  z-index: 0;
  isolation: isolate;
  width: 100%;
  height: clamp(360px, 42vw, 520px);
  min-height: 360px;
  overflow: hidden;
  background: #e8edeb;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.territory-live-map__canvas .leaflet-container {
  width: 100%;
  height: 100%;
  color: var(--ink);
  font: inherit;
  background: #e8edeb;
}

.territory-live-map__canvas .leaflet-control-attribution {
  padding: 2px 5px;
  color: #4f5a57;
  background: rgba(255, 255, 255, 0.9);
  font-size: 10px;
}

.territory-live-map__canvas .leaflet-control-attribution a { color: #384b44; }
.territory-live-map__canvas .leaflet-control-zoom { border: 1px solid rgba(17, 17, 17, 0.14); box-shadow: 0 4px 14px rgba(17, 17, 17, 0.12); }
.territory-live-map__canvas .leaflet-control-zoom a { color: var(--ink); }

.territory-live-map__fallback {
  position: absolute;
  inset: 18px;
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
}

.territory-live-map__fallback strong { color: var(--ink); font-size: 14px; }
.territory-live-map__fallback span { max-width: 330px; font-size: 12px; line-height: 1.5; }
.territory-live-map__fallback[hidden] { display: none; }

.territory-live-marker-wrap { background: transparent; border: 0; }

.territory-live-pin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: max-content;
  padding: 4px 9px 4px 4px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(17, 17, 17, 0.22);
  white-space: nowrap;
}

.territory-live-pin b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  color: white;
  border-radius: 50%;
  background: #6659a8;
  font-size: 11px;
  font-weight: 850;
}

.territory-live-pin span { font-size: 11px; font-weight: 850; }
.territory-live-pin--mun { border-radius: 11px; }
.territory-live-pin--mun b { border-radius: 5px; background: #176bb5; }

.territory-live-map__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.territory-live-map__legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 10px; height: 10px; flex: 0 0 auto; }
.legend-dot--loc { background: #6659a8; border-radius: 50%; }
.legend-dot--mun { background: #176bb5; border-radius: 2px; transform: rotate(45deg); }

.territory-live-map__note {
  max-width: 520px;
  margin: 10px auto 0;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
}

.territory-live-map__note { font-size: 10.5px; }

.territory-map-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 22px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.45;
}

.territory-map-card__foot > span {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
}

.territory-map-card__foot svg { flex: 0 0 auto; width: 15px; height: 15px; color: var(--brand); }

.territory-list {
  padding: 0;
  overflow: hidden;
}

.territory-list__title,
.territory-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.territory-list__title {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.territory-list__title > span,
.territory-list__head > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.territory-list__groups { max-height: 552px; overflow: auto; }
.territory-list__group + .territory-list__group { border-top: 1px solid var(--line); }
.territory-list__head { padding: 16px 18px 10px; }
.territory-list__head .section-kicker { margin-bottom: 4px; font-size: 9px; }
.territory-list__head h3 { font-size: 14px; }

.territory-zone-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.4fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0 10px;
  padding: 11px 8px;
  border-top: 1px solid rgba(222, 222, 217, 0.72);
}

.territory-list__head + .territory-zone-card { border-top: 0; }

.territory-zone-card__marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: white;
  background: var(--ink);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(17, 17, 17, 0.16);
  font-size: 11px;
  font-weight: 850;
}

.territory-zone-card__body,
.territory-zone-card__facts { min-width: 0; }
.territory-zone-card__body strong,
.territory-zone-card__body small,
.territory-zone-card__facts b,
.territory-zone-card__facts small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.territory-zone-card__body strong { font-size: 12px; }
.territory-zone-card__body small,
.territory-zone-card__facts small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.territory-zone-card__facts { text-align: right; }
.territory-zone-card__facts b { color: var(--ink-soft); font-size: 10px; }
.territory-zone-card__arrow { color: var(--muted-light); }
.territory-zone-card__arrow svg { width: 14px; height: 14px; }
.territory-list__empty { margin: 0; padding: 16px 18px 20px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.territory-empty {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px;
  padding: 24px;
}

.territory-empty > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--muted);
  background: var(--canvas);
  border-radius: 10px;
}

.territory-empty > span svg { width: 19px; height: 19px; }
.territory-empty strong { display: block; font-size: 13px; }
.territory-empty p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

@media (max-width: 960px) {
  .territory-workspace { grid-template-columns: 1fr; }
  .territory-list__groups { max-height: none; }
}

@media (max-width: 760px) {
  .territory-workspace { grid-template-columns: 1fr; gap: 14px; }
  .territory-metrics { margin-inline: -2px; }
  .territory-metrics article { padding: 14px 12px; }
  .territory-metrics strong { font-size: 22px; }
  .territory-metrics small,
  .territory-metrics span { font-size: 10px; }
  .territory-map-card__head { display: grid; padding: 18px; }
  .territory-live-map { padding: 14px 12px 12px; }
  .territory-live-map__canvas { height: clamp(330px, 92vw, 440px); min-height: 330px; }
  .territory-live-pin { gap: 4px; padding: 3px 6px 3px 3px; }
  .territory-live-pin span { display: block; max-width: 66px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .territory-live-pin b { min-width: 21px; height: 21px; }
  .territory-live-map__legend { display: grid; grid-template-columns: 1fr; gap: 6px; justify-content: stretch; font-size: 10.5px; }
  .territory-live-map__legend span { justify-content: center; }
  .territory-live-map__fallback { inset: 14px 12px 12px; }
  .territory-map-card__foot { align-items: flex-start; padding: 13px 18px; }
  .territory-map-card__foot .text-link { flex: 0 0 auto; font-size: 0; }
  .territory-map-card__foot .text-link svg { width: 18px; height: 18px; }
  .territory-list__title { padding: 18px; }
  .territory-list__groups { max-height: none; }
  .territory-zone-card { grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; margin-inline: 8px; }
  .territory-zone-card__facts { grid-column: 2 / 4; grid-row: 2; text-align: left; }
  .territory-zone-card__facts b,
  .territory-zone-card__facts small { display: inline; white-space: normal; }
  .territory-zone-card__facts small::before { content: " · "; }
  .territory-zone-card__arrow { grid-column: 3; grid-row: 1; }
  .courier-availability { padding: 18px; }
  .courier-availability__list { grid-template-columns: 1fr; }
  .courier-availability__list > article { grid-template-columns: auto minmax(0, 1fr) auto; }
  .courier-availability__list b { grid-column: 2 / 4; }
  .courier-availability__action { align-items: stretch; flex-direction: column; }
  .courier-availability__action .secondary-button { width: 100%; }
}

/* ================= Alistamiento por lotes (motorizado ↔ bodega) ================= */
.pick-surface { padding: 20px; }
.pick-list { display: grid; gap: 14px; margin-top: 14px; }
.pick-group__zona { margin: 0 0 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.pick-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius-md); cursor: pointer; }
.pick-item:hover { border-color: var(--ink); }
.pick-item input { width: 18px; height: 18px; accent-color: var(--brand); }
.pick-item__body { min-width: 0; }
.pick-item__body strong { display: block; overflow-wrap: anywhere; font-size: 13px; }
.pick-item__body small { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }
.pick-item__address { margin-top: 3px; color: var(--ink-soft) !important; font-weight: 700; }
.pick-item__zone { margin-top: 2px; }
.pick-item b { font-size: 13px; text-align: right; white-space: nowrap; }
.pick-locked { margin: 12px 0 0; padding: 10px 12px; color: var(--brand-dark); background: var(--brand-soft); border-radius: var(--radius-sm); font-size: 12px; }
.pick-locked svg { width: 15px; height: 15px; vertical-align: -2px; }

@media (max-width: 640px) {
  .pick-item { grid-template-columns: 18px minmax(0, 1fr) auto; gap: 9px; padding: 12px; }
  .pick-item b { align-self: start; padding-top: 1px; font-size: 12px; }
}

.picking-bar { position: sticky; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding: 14px 18px; background: var(--ink); color: #fff; border-radius: var(--radius-md); box-shadow: 0 12px 30px rgba(17, 17, 17, 0.22); }
.picking-bar small { display: block; color: #c6c6c1; font-size: 11px; }
.picking-bar strong { font-size: 16px; }
.picking-bar .primary-button { flex: 0 0 auto; }

.lote-card { padding: 18px; }
.lote-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lote-card__head h3 { margin: 4px 0 2px; font-size: 18px; }
.lote-card__head span:not(.status-pill) { color: var(--muted); font-size: 12px; }
.lote-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.lote-note svg { width: 16px; height: 16px; vertical-align: -3px; }
.lote-note--ok { color: var(--ink); }
.lote-confirm { display: flex; gap: 10px; margin-top: 12px; }
.lote-pin-input { flex: 1 1 auto; min-width: 0; padding: 12px 14px; font-size: 18px; letter-spacing: 0.3em; text-align: center; border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* Bandas apiladas a lo ancho (En espera → Preparando → Listos): el paquete a
   alistar se ve con espacio y claridad para el operador de bodega. */
.queue-bands { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.queue-band { padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.queue-band--work { border-color: #cfe0ff; background: #f7faff; box-shadow: 0 8px 22px rgba(23, 107, 181, 0.06); }
.queue-band--work .queue-band__head h3 { color: #0f5aa0; }
.queue-band .queue-card { max-width: 760px; }
.queue-band__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.queue-band__head h3 { margin: 0; font-size: 14px; }
.queue-band__head span { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 7px; color: var(--brand-dark); background: var(--brand-soft); border-radius: 999px; font-size: 12px; font-weight: 800; }
.queue-empty { margin: 0; color: var(--muted); font-size: 12px; }

.queue-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.queue-card + .queue-card { margin-top: 10px; }
.queue-card__turno { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: #fff; background: var(--ink); border-radius: 10px; font-size: 13px; font-weight: 850; }
.queue-card__body { min-width: 0; }
.queue-card__body strong { display: block; font-size: 13px; }
.queue-card__body small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.queue-card .primary-button,
.queue-card .status-pill { grid-column: 1 / -1; }
.queue-card--work { border-color: #cfe0ff; background: #f5f8ff; }
.queue-card--ready { border-color: #bfe6cd; background: var(--success-soft); }
.queue-pin { margin: 8px 0 0; font-size: 12px; }
.queue-pin b { display: inline-block; margin-left: 4px; padding: 2px 8px; font-size: 15px; letter-spacing: 0.18em; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.guia-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.guia-chip { padding: 3px 8px; font-size: 11px; font-weight: 700; background: var(--canvas); border: 1px solid var(--line); border-radius: 999px; }

@media (max-width: 900px) {
  .queue-bands { grid-template-columns: 1fr; }
}

/* Escaneo del lote (bodega arma canastilla / motorizado recibe) */
.scan-progress { margin: 10px 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.scan-items { display: grid; gap: 6px; margin-bottom: 10px; }
.scan-item { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 12px; }
.scan-item strong { font-weight: 700; }
.scan-item__tick { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; color: var(--muted-light); font-weight: 900; }
.scan-item.is-done { border-color: #bfe6cd; background: var(--success-soft); }
.scan-item.is-done .scan-item__tick { color: var(--success); }
.scan-item__ok { color: var(--success); font-size: 11px; font-weight: 800; }
.scan-item__miss { padding: 0; color: var(--brand-dark); background: none; border: 0; font-size: 11px; font-weight: 700; cursor: pointer; }
.scan-input { display: flex; gap: 8px; margin-bottom: 10px; }
.scan-input input { flex: 1 1 auto; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; }
.scan-input .secondary-button { flex: 0 0 auto; min-height: 0; padding: 9px 14px; }
.scan-input .icon-button { flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.queue-card__body .primary-button { width: 100%; margin-top: 4px; }
.queue-card__body .primary-button[disabled] { opacity: 0.45; cursor: not-allowed; }
.primary-button--full { width: 100%; }
.lote-fallback { margin-top: 12px; }
.lote-fallback summary { color: var(--muted); font-size: 12px; cursor: pointer; }
.lote-fallback .lote-confirm { margin-top: 10px; }

/* Etiqueta azul de Mercado Flex en las listas del cliente empresa */
.flex-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  padding: 2px 8px;
  color: #0f5aa0;
  background: #e8f1fb;
  border: 1px solid #bcd8f2;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.flex-tag svg { width: 12px; height: 12px; stroke: currentColor; }

/* Ítems del alistamiento más fáciles de ubicar: nombre + código corto + zona */
.scan-item__info { min-width: 0; }
.scan-item__info strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.scan-item__info small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.guia-code { color: var(--ink); font-weight: 850; letter-spacing: 0.03em; }
.scan-item__flex { color: #0f5aa0; font-weight: 800; }
.scan-hint { display: flex; align-items: center; gap: 6px; margin: -2px 0 10px; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.scan-hint svg { flex: 0 0 auto; width: 14px; height: 14px; stroke: currentColor; }

/* En móvil, la acción del ítem baja a una segunda línea: el nombre no se corta */
@media (max-width: 560px) {
  .scan-item { grid-template-columns: 20px minmax(0, 1fr); row-gap: 4px; }
  .scan-item__ok,
  .scan-item__miss { grid-column: 2; justify-self: start; }
}

/* Localidad/municipio grande y visible: para organizar el montón por zona */
.scan-zone {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 9px;
  color: #fff;
  background: var(--ink);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.06em;
}

/* ===================== Módulo de CAJA (control financiero) ===================== */
.caja-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.caja-kpi { padding: 18px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); }
.caja-kpi small { display: block; color: var(--muted); font-size: 12px; }
.caja-kpi strong { display: block; margin: 10px 0 3px; font-size: 26px; letter-spacing: -0.05em; }
.caja-kpi span { color: var(--muted); font-size: 11.5px; }
.caja-kpi--out strong { color: var(--brand-dark); }
.caja-kpi--net { background: var(--success-soft); border-color: #bfe6cd; }
.caja-kpi--net strong { color: var(--success); }

.caja-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.caja-card { padding: 20px; }
.caja-total { font-size: 22px; letter-spacing: -0.04em; }
.caja-note { margin: 12px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.caja-note svg { width: 14px; height: 14px; vertical-align: -2px; }
.caja-empty { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; }

.pay-list { display: grid; gap: 12px; margin-top: 14px; }
.pay-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; }
.pay-badge { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: #fff; border-radius: 12px; font-size: 16px; font-weight: 850; box-shadow: 0 6px 14px rgba(17, 17, 17, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.pay-row__info { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pay-row__info small { color: var(--muted); font-size: 12px; }
.pay-row__info strong { font-size: 15px; letter-spacing: -0.03em; }
.pay-bar { grid-column: 2; height: 8px; overflow: hidden; background: #ececea; border-radius: 999px; }
.pay-bar i { display: block; height: 100%; border-radius: inherit; }

.pay-row--efectivo .pay-badge { background: linear-gradient(135deg, #1e9e5a, #136c3c); }
.pay-row--efectivo .pay-bar i { background: #18824b; }
.pay-row--nequi .pay-badge { background: linear-gradient(135deg, #8e24aa, #4a148c); }
.pay-row--nequi .pay-bar i { background: #7b1fa2; }
.pay-row--daviplata .pay-badge { background: linear-gradient(135deg, #ff3b52, #c1001f); }
.pay-row--daviplata .pay-bar i { background: #e4002b; }
.pay-row--llave .pay-badge { background: linear-gradient(135deg, #12b5ad, #0a6f6a); }
.pay-row--llave .pay-bar i { background: #0a7d78; }
.pay-row--transferencia .pay-badge { background: linear-gradient(135deg, #64748b, #334155); }
.pay-row--transferencia .pay-bar i { background: #475569; }

.caja-list { display: grid; gap: 10px; margin-top: 12px; }
.caja-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.caja-line strong { display: block; font-size: 13px; }
.caja-line small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.caja-line b { font-size: 15px; letter-spacing: -0.03em; }

/* Reporte financiero: el período deja claro qué se está leyendo y evita
   confundir la caja abierta con el historial ya cerrado. */
.caja-period { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 22px; align-items: end; padding: 18px 20px; margin-bottom: 18px; background: linear-gradient(120deg, #fff 0%, #fbfbfa 100%); }
.caja-period__heading { min-width: 0; }
.caja-period__heading .section-kicker { margin: 0 0 5px; }
.caja-period__heading strong { display: block; font-size: 17px; letter-spacing: -0.03em; }
.caja-period__heading span { display: block; max-width: 630px; margin-top: 5px; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.caja-period__presets { display: flex; flex-wrap: wrap; gap: 6px; }
.caja-period__preset { min-height: 32px; padding: 0 10px; color: #5c5c59; background: #f1f1ef; border: 1px solid transparent; border-radius: 7px; font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; transition: background .18s ease, color .18s ease, border-color .18s ease; }
.caja-period__preset:hover { color: var(--ink); background: #e7e7e4; }
.caja-period__preset.is-active { color: #fff; background: var(--ink); border-color: var(--ink); box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.caja-period__dates { display: flex; align-items: center; gap: 8px; justify-self: end; color: var(--muted); }
.caja-period__dates label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.caja-period__dates input { width: 142px; min-height: 36px; padding: 0 9px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: 12px; text-transform: none; }

.caja-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.caja-section-heading .section-kicker { margin: 0 0 5px; }
.caja-section-heading h3 { margin: 0; font-size: 21px; letter-spacing: -0.045em; }
.caja-section-heading p:not(.section-kicker) { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.caja-pyg { padding: 20px; margin-bottom: 18px; overflow: hidden; color: #fff; background: #151515; border: 1px solid #151515; border-radius: var(--radius-md); box-shadow: inset 3px 0 0 var(--brand), 0 10px 24px rgba(0,0,0,.08); }
.caja-pyg .caja-section-heading h3 { color: #fff; }
.caja-pyg .caja-section-heading p:not(.section-kicker) { color: #b8b8b5; }
.caja-pyg .date-chip { color: #e2e2df; background: #272726; border-color: #3d3d3b; }
.caja-pyg__flow { display: grid; grid-template-columns: minmax(0,1fr) 22px minmax(0,1fr) 22px minmax(0,1fr) 22px minmax(0,1.15fr); gap: 8px; align-items: center; margin-top: 18px; }
.caja-pyg__flow article { min-width: 0; padding: 14px 12px; background: #20201f; border: 1px solid #333331; border-radius: 9px; }
.caja-pyg__flow small, .caja-pyg__flow span { display: block; }
.caja-pyg__flow small { color: #b8b8b5; font-size: 10px; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.caja-pyg__flow strong { display: block; margin: 7px 0 4px; color: #fff; font-size: 21px; letter-spacing: -0.055em; white-space: nowrap; }
.caja-pyg__flow span { overflow: hidden; color: #aaa9a5; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.caja-pyg__flow > i { color: #7b7b77; font-size: 21px; font-style: normal; font-weight: 700; text-align: center; }
.caja-pyg__flow .caja-pyg__final { background: linear-gradient(135deg, #1d5138, #113525); border-color: #387750; }
.caja-pyg__flow .caja-pyg__final.is-loss { background: linear-gradient(135deg, #5a1919, #35100f); border-color: #a24740; }
.caja-pyg__flow .caja-pyg__final strong { color: #e6ffe9; }
.caja-pyg__flow .caja-pyg__final.is-loss strong { color: #ffe8e5; }

.caja-insight-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(300px,.9fr); gap: 18px; margin-bottom: 18px; align-items: stretch; }
.caja-chart-card, .caja-expenses-card { padding: 20px; }
.caja-chart-toggle { display: inline-flex; padding: 3px; background: #f0f0ee; border: 1px solid #e7e7e4; border-radius: 8px; }
.caja-chart-toggle button { min-height: 29px; padding: 0 10px; color: var(--muted); background: transparent; border: 0; border-radius: 5px; font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.caja-chart-toggle button.is-active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.caja-chart__legend { display: flex; gap: 14px; margin: 17px 0 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.caja-chart__legend span { display: inline-flex; align-items: center; gap: 5px; }
.caja-chart__legend i { width: 8px; height: 8px; border-radius: 999px; }
.caja-chart__legend .is-income { background: #b7b8b4; }
.caja-chart__legend .is-profit { background: var(--success); }
.caja-chart { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 8px; height: 194px; padding: 8px 4px 0; border-bottom: 1px solid var(--line); }
.caja-chart__point { display: grid; grid-template-rows: 1fr auto auto; gap: 4px; min-width: 0; text-align: center; }
.caja-chart__bars { display: flex; align-items: end; justify-content: center; gap: 4px; min-height: 0; padding: 9px 0; background: repeating-linear-gradient(to bottom, transparent 0, transparent 42px, #f0f0ee 43px); }
.caja-chart__bar { display: block; width: min(16px, 38%); min-height: 2px; max-height: 100%; border-radius: 5px 5px 2px 2px; transition: height .22s ease; }
.caja-chart__bar--income { background: #b9bab6; }
.caja-chart__bar--profit { background: linear-gradient(180deg, #42bf77, #198853); box-shadow: inset 0 1px 0 rgba(255,255,255,.32); }
.caja-chart__bar--loss { background: linear-gradient(180deg, #ee635d, #b42318); box-shadow: inset 0 1px 0 rgba(255,255,255,.22); }
.caja-chart__point strong { overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.caja-chart__point small { overflow: hidden; color: var(--muted); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }

.caja-expenses-card { display: flex; flex-direction: column; }
.caja-expenses-list { display: grid; gap: 8px; flex: 1; margin-top: 13px; }
.caja-expenses-empty { display: grid; place-items: center; min-height: 154px; padding: 18px; color: var(--muted); text-align: center; }
.caja-expenses-empty span { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 6px; color: #8c8c87; background: #f2f2f0; border-radius: 10px; }
.caja-expenses-empty svg { width: 19px; height: 19px; }
.caja-expenses-empty p { margin: 0; font-size: 12px; line-height: 1.5; }
.caja-expenses-empty small { font-size: 10.5px; }
.caja-expense-row { display: grid; grid-template-columns: 32px minmax(0,1fr) auto 28px; gap: 9px; align-items: center; padding: 9px 7px; background: #fafaf9; border: 1px solid #eeeeeb; border-radius: 8px; }
.caja-expense-row__icon { display: grid; place-items: center; width: 32px; height: 32px; color: #c51d25; background: #fff0f0; border-radius: 8px; }
.caja-expense-row__icon svg { width: 16px; height: 16px; }
.caja-expense-row strong, .caja-expense-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caja-expense-row strong { font-size: 12px; }
.caja-expense-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.caja-expense-row b { color: #b42318; font-size: 12px; letter-spacing: -.03em; white-space: nowrap; }
.caja-expense-row__delete { width: 27px; height: 27px; color: #8d8d88; border: 0; background: transparent; font-size: 18px; line-height: 1; }
.caja-expense-row__delete:hover { color: #b42318; background: #fff0f0; }
.caja-expenses-card__add { width: 100%; margin-top: 12px; }
.modal-copy { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.modal-actions--split { justify-content: space-between; }
.modal-icon--warning { color: #b42318; background: #fff0f0; }

@media (max-width: 900px) {
  .caja-kpis { grid-template-columns: 1fr 1fr; }
  .caja-grid { grid-template-columns: 1fr; }
  .caja-period { grid-template-columns: 1fr; }
  .caja-period__dates { justify-self: start; }
  .caja-insight-grid { grid-template-columns: 1fr; }
  .caja-pyg__flow { grid-template-columns: minmax(0,1fr) 16px minmax(0,1fr); }
  .caja-pyg__flow > i:nth-of-type(2) { grid-column: 2; grid-row: 2; }
  .caja-pyg__flow > article:nth-of-type(3) { grid-column: 3; grid-row: 2; }
  .caja-pyg__flow > i:nth-of-type(3) { grid-column: 1; grid-row: 3; }
  .caja-pyg__flow > article:nth-of-type(4) { grid-column: 2 / 4; grid-row: 3; }
}

@media (max-width: 560px) {
  .caja-period, .caja-pyg, .caja-chart-card, .caja-expenses-card { padding: 15px; }
  .caja-period__presets { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .caja-period__preset { width: 100%; padding: 0 7px; font-size: 10.5px; }
  .caja-period__dates { display: grid; grid-template-columns: 1fr 10px 1fr; width: 100%; }
  .caja-period__dates input { width: 100%; min-width: 0; }
  .caja-section-heading { align-items: start; flex-direction: column; }
  .caja-pyg__flow { grid-template-columns: 1fr; gap: 7px; }
  .caja-pyg__flow > i { display: none; }
  .caja-pyg__flow > article, .caja-pyg__flow > article:nth-of-type(3), .caja-pyg__flow > article:nth-of-type(4) { grid-column: auto; grid-row: auto; }
  .caja-pyg__flow article { padding: 11px 12px; }
  .caja-pyg__flow strong { margin: 4px 0 2px; font-size: 19px; }
  .caja-chart { gap: 3px; height: 174px; }
  .caja-chart__bars { gap: 2px; }
  .caja-chart__bar { width: min(11px, 42%); }
  .caja-chart__point strong { font-size: 8.5px; }
  .caja-chart__point small { display: none; }
  .caja-chart-toggle { width: 100%; }
  .caja-chart-toggle button { flex: 1; }
  .modal-actions--split { flex-direction: column-reverse; }
  .modal-actions--split button { width: 100%; }
}

/* ============================================================
   Enrutamiento por arrastre y estados de la ruta (motorizado)
   ============================================================ */
.route-hint {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 12px; padding: 9px 12px;
  background: rgba(37, 99, 235, .07); border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 11px; color: #1d4ed8; font-size: 12.5px; font-weight: 700;
}
.route-hint svg { width: 16px; height: 16px; stroke: currentColor; fill: none; flex: none; }
.route-hint b { font-weight: 900; letter-spacing: 1px; }

/* Fila arrastrable: mango a la izquierda, contenido y acciones a la derecha. */
.stop-row--drag { display: grid; grid-template-columns: 34px 1fr; align-items: stretch; }
.stop-row--drag .stop-drag { grid-column: 1; grid-row: 1; }
.stop-row--drag > .stop-row__main { grid-column: 2; grid-row: 1; }
.stop-row--drag .stop-row__actions { grid-column: 1 / -1; }

.stop-drag {
  display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--line); background: #fbfbfa;
  color: var(--muted-light); cursor: grab;
  touch-action: none; -webkit-user-select: none; user-select: none;
}
.stop-drag:active { cursor: grabbing; }
.stop-drag svg { width: 18px; height: 18px; }
.stop-drag:focus-visible { outline: 3px solid rgba(37, 99, 235, .35); outline-offset: -3px; }

.stop-row.is-dragging {
  position: relative; z-index: 5; opacity: .97;
  border-color: #2563eb; box-shadow: 0 16px 32px -12px rgba(16, 24, 40, .38);
}
body.is-reordering { -webkit-user-select: none; user-select: none; }
body.is-reordering * { cursor: grabbing !important; }

/* Las etiquetas usan todo el ancho del botón (no se cortan a media palabra). */
.stop-row__actions .stop-act > span:not(.action-icon) { width: 100%; text-align: center; }

/* Variantes de peligro para acciones destructivas (p. ej. "Resetear datos"). */
.secondary-button--danger { color: #b91c1c; border-color: rgba(220, 38, 38, .38); }
.secondary-button--danger:hover { background: rgba(220, 38, 38, .08); border-color: rgba(220, 38, 38, .55); }
.secondary-button--danger svg { stroke: currentColor; }
.primary-button--danger { background: #dc2626; border-color: #dc2626; }
.primary-button--danger:hover { background: #b91c1c; border-color: #b91c1c; }
.modal-icon--danger { color: #fff; background: #dc2626; }

/* Lista de paquetes tomados de bodega en el escaneo del motorizado. */
.claim-taken { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.claim-taken__label {
  margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.claim-taken ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.claim-taken li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(37, 211, 102, .07);
}
.claim-taken li strong { font-size: 13px; }
.claim-taken li span { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Nota informativa del cuadre del motorizado (ya no cierra él, lo hace el admin). */
.cuadre-note {
  display: flex; align-items: center; gap: 9px; margin: 14px 0 0;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: #f7f8fb; color: var(--muted); font-size: 13px; line-height: 1.4;
}
.cuadre-note svg { width: 18px; height: 18px; stroke: currentColor; fill: none; flex: none; }

/* Cuarta acción: Reenviar (azul). */
.stop-act--resend { color: #1d4ed8; background: rgba(37, 99, 235, .08); }
.stop-act--resend:hover { background: rgba(37, 99, 235, .16); }
.stop-act--resend .action-icon { background: linear-gradient(145deg, #f3f7ff, #dbe7ff); }

/* Paradas ya resueltas: color claro para leer el avance de un vistazo. */
.route-done { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.route-done__label {
  margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.stop-row--resolved {
  display: grid; grid-template-columns: 6px 1fr auto auto; align-items: center;
  gap: 12px; padding: 11px 0; background: #fff;
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.stop-row--resolved:hover { background: #fafaf8; }
.stop-detail-ico { display: inline-flex; align-items: center; margin-right: 12px; color: var(--muted-light); }
.stop-detail-ico svg { width: 16px; height: 16px; }
.stop-row--resolved .stop-state { align-self: stretch; width: 6px; }
.stop-row--resolved .stop-row__info { min-width: 0; padding-left: 4px; }
.stop-row--resolved .stop-row__info strong { font-size: 14px; }
.stop-chip {
  justify-self: end; margin-right: 12px; padding: 4px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; white-space: nowrap;
}
.is-done-ok { background: rgba(37, 211, 102, .08); }
.is-done-ok .stop-state { background: #16a34a; }
.is-done-ok .stop-chip { background: rgba(22, 163, 74, .14); color: #0b7a3b; }
.is-done-alert { background: rgba(239, 68, 68, .07); }
.is-done-alert .stop-state { background: #dc2626; }
.is-done-alert .stop-chip { background: rgba(220, 38, 38, .13); color: #b91c1c; }
.is-done-resend { background: rgba(37, 99, 235, .07); }
.is-done-resend .stop-state { background: #2563eb; }
.is-done-resend .stop-chip { background: rgba(37, 99, 235, .13); color: #1d4ed8; }
.is-done-return { background: rgba(107, 114, 128, .08); }
.is-done-return .stop-state { background: #6b7280; }
.is-done-return .stop-chip { background: rgba(107, 114, 128, .15); color: #4b5563; }

/* Comprobante del pago: subida en el modal de entrega y vista en "Ver detalle". */
.field-control--file { padding: 9px 10px; }
.field-control--file input[type="file"] { width: 100%; font-size: 13px; border: 0; background: transparent; }
.evidence-preview { display: block; max-width: 220px; max-height: 240px; margin: 10px 0 0; border: 1px solid var(--line); border-radius: 12px; }
.evidence-block { margin: 14px 0; }
.evidence-link { display: inline-flex; flex-direction: column; gap: 5px; text-decoration: none; color: var(--muted); font-size: 11px; }
.evidence-thumb { max-width: 240px; max-height: 260px; border: 1px solid var(--line); border-radius: 12px; }
.account-medio { font-size: 12px; color: var(--muted); white-space: nowrap; }
.account-note--info { background: rgba(37, 99, 235, .07); border-color: rgba(37, 99, 235, .2); color: #1d4ed8; }

/* Dos iconos para el comprobante: ver archivos / abrir cámara. */
.evidence-actions { display: flex; gap: 10px; margin-top: 8px; }
.evidence-btn {
  flex: 1 1 0; min-width: 0; display: inline-flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 15px 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff;
  cursor: pointer; color: var(--ink); font-size: 12.5px; font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 3px 8px rgba(16,24,40,.06);
  transition: background .16s ease, border-color .16s ease, transform .12s ease;
}
.evidence-btn:hover { background: #fafaf8; border-color: #d8b3b6; }
.evidence-btn:active { transform: translateY(1px); }
.evidence-btn:focus-visible { outline: 3px solid rgba(239,27,42,.3); outline-offset: 2px; }
.evidence-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.evidence-full { display: block; width: 100%; max-height: 68vh; object-fit: contain; margin: 8px 0 0; border: 1px solid var(--line); border-radius: 14px; background: #f4f4f2; }

/* Responsive premium: en móvil el encabezado apila y sus botones bajan
   completos y se ajustan en filas (sin texto cortado ni desborde). */
@media (max-width: 760px) {
  .page-heading,
  .role-home__heading { flex-direction: column; align-items: stretch; gap: 14px; }
  .page-heading > .page-actions { width: 100%; flex-wrap: wrap; gap: 8px; }
  .page-heading .page-actions .primary-button,
  .page-heading .page-actions .secondary-button,
  .role-home__heading > .primary-button,
  .role-home__heading > .secondary-button {
    display: inline-flex; width: auto; flex: 1 1 44%; min-width: 0; min-height: 46px;
    padding: 0 12px; font-size: 12.5px; white-space: nowrap; justify-content: center;
  }
  .page-heading .page-actions .primary-button svg,
  .page-heading .page-actions .secondary-button svg,
  .role-home__heading > .primary-button svg { width: 18px; height: 18px; }
  /* La franja de acciones de bodega también se apila y ajusta. */
  .page-actions--warehouse { flex-wrap: wrap; }
}

/* ---- Añadidos del carril visual oficial (no van en la demo) ---- */
.owners-pending { margin: 20px 0 0; padding: 14px 16px; border-radius: 12px;
  background: #fff6e6; border: 1px solid #f0dcb3; color: #7a4d0c; font-size: 13.5px; line-height: 1.5; }
.owners-pending strong { color: #9a6110; }
/* Aviso de lectura (p. ej. "modo local: solo lectura", "vista parcial"): tira
   discreta sobre los datos para no leer una página como si fuera el total. */
.data-aviso { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px;
  padding: 11px 14px; border-radius: 12px; background: var(--warning-soft);
  border: 1px solid #f0dcb3; color: #7a4d0c; font-size: 12.5px; line-height: 1.45; }
.data-aviso svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.data-aviso p { margin: 0; }
.data-aviso strong { color: #9a6110; }
.data-aviso + .data-aviso { margin-top: -4px; }
/* Aviso "warning" del toast: hasta ahora se veía igual que un éxito salvo el
   icono. Se le da acento ámbar (barra izquierda + icono) para leerlo de un
   vistazo; el toast de éxito no cambia. */
.toast--warning { box-shadow: inset 3px 0 0 var(--warning), var(--shadow-float); }
.toast--warning > span { color: var(--warning); }
.mapa-mock { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 220px; border-radius: 14px; border: 2px dashed #c8c8c1; color: #696966;
  background: repeating-linear-gradient(45deg, #f7f7f5, #f7f7f5 12px, #f1f1ee 12px, #f1f1ee 24px); }
.mapa-mock span { font-weight: 700; }
.mapa-mock small { font-size: 12px; }
.caja-preview { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.caja-preview__card { padding: 20px; }
.caja-preview__card h3 { margin: 4px 0 6px; font-size: 16px; }
.caja-preview__card p { margin: 0; color: #696966; font-size: 13px; line-height: 1.5; }
@media (max-width: 760px) { .caja-preview { grid-template-columns: 1fr; } }

/* ---- Mi ruta (motorizado) ---- */
.ruta-list { display: grid; gap: 12px; margin-top: 6px; }
.ruta-card { background: #fff; border: 1px solid #deded9; border-left: 3px solid #176bb5;
  border-radius: 12px; padding: 16px; box-shadow: 0 6px 18px rgba(17,17,17,.06); }
.ruta-card__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ruta-card__top strong { font-size: 15px; }
.ruta-card__dest { margin: 0; font-weight: 700; font-size: 14.5px; }
.ruta-card__dir { margin: 2px 0 12px; color: #696966; font-size: 13px; }
.ruta-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ruta-card__amount { font-weight: 800; font-size: 15px; }
.ruta-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Login: selector de rol ---- */
.role-pick { display: grid; gap: 10px; margin-top: 18px; }
.role-pick__btn { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 12px 14px; border: 1px solid #deded9; border-radius: 12px; background: #fff;
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease; }
.role-pick__btn:hover { border-color: #ee1b24; box-shadow: 0 6px 18px rgba(17,17,17,.06); transform: translateY(-1px); }
.role-pick__av { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
  background: #111; color: #fff; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.role-pick__copy { display: flex; flex-direction: column; flex: 1; }
.role-pick__copy strong { font-size: 15px; }
.role-pick__copy small { color: #696966; font-size: 12.5px; }
.role-pick__btn svg { width: 20px; height: 20px; color: #92928d; }

/* Estado "Faltan datos" (Mercado Flex sin completar) — ambar. */
.status-pill.status--datos { background: #fff6e6; color: #9a6110; }
.status-pill.status--datos i { background: #9a6110; }

/* ---- Estados de la capa api (loading / error) ---- */
.api-state { background: #fff; border: 1px solid #deded9; border-radius: 18px; padding: 24px; box-shadow: 0 6px 18px rgba(17,17,17,.06); }
.api-state--loading { display: grid; gap: 12px; }
.api-state__msg { margin: 0; color: #696966; font-size: 13.5px; }
.api-state--error { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.api-state--error h3 { margin: 4px 0 0; font-size: 17px; }
.api-state__icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: #fff6e6; color: #9a6110; }
.api-state__actions { margin-top: 8px; }
.skeleton { position: relative; overflow: hidden; background: #eeeeec; border-radius: 8px; }
.skeleton--line { height: 14px; }
.skeleton--w70 { width: 70%; }
.skeleton--block { height: 120px; border-radius: 12px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* Selector "vista de conexión (demo)" en Pedidos */
.sim-chips { align-items: center; margin: -4px 0 14px; }
.sim-chips__label { font-size: 12px; font-weight: 700; color: #696966; margin-right: 4px; }

/* Barra global "Vista de conexión (demo)" (debajo del topbar, solo lecturas) */
.dev-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px clamp(16px,3vw,32px); background: #fbfbfa; border-bottom: 1px solid #deded9; }
.dev-bar__label { font-size: 12px; font-weight: 700; color: #696966; }
.dev-bar .chip { padding: 5px 12px; font-size: 12.5px; }

/* Sello de versión (v2.0.0) — visible en login, barra lateral y splash. */
.version-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #ee1b24;
  background: rgba(238, 27, 36, .10);
  border: 1px solid rgba(238, 27, 36, .22);
  vertical-align: middle;
}

/* ============================================================
   RESPONSIVE v2.0.0 — Tablas de pedidos como TARJETAS en móvil.
   En pantallas angostas la tabla se apila: cada pedido es una
   tarjeta con su etiqueta de campo y TODOS los botones (Detalle,
   Ver guía) visibles y tocables, sin desplazamiento lateral.
   ============================================================ */
@media (max-width: 760px) {
  .orders-table { white-space: normal; }
  .orders-table thead { display: none; }
  .orders-table,
  .orders-table tbody { display: block; width: 100%; }

  .orders-table tr {
    display: block;
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 14px 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(17, 17, 17, .05);
  }

  .orders-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    border: 0;
    text-align: right;
  }

  .orders-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
  }

  /* Checkbox: esquina superior derecha de la tarjeta. */
  .orders-table td.cell-check {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0;
    width: auto;
  }
  .orders-table td.cell-check::before { content: ""; }

  /* Número de pedido: título de la tarjeta. */
  .orders-table td.cell-id {
    justify-content: flex-start;
    padding: 0 42px 10px 0;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line);
  }
  .orders-table td.cell-id::before { content: ""; }
  .orders-table td.cell-id .order-link {
    font-size: 15px;
    font-weight: 800;
  }

  .orders-table td strong { font-weight: 700; }
  .orders-table td small { display: block; }

  /* Acciones: fila completa con botones grandes y tocables. */
  .orders-table td.row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  .orders-table td.row-actions::before { content: ""; }
  .orders-table td.row-actions .text-link {
    margin: 0;
    padding: 9px 14px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
  }

  /* Estado vacío: no aplicar layout de tarjeta. */
  .orders-table .table-empty td {
    display: block;
    text-align: center;
    padding: 24px 0;
  }
  .orders-table .table-empty td::before { content: ""; }
}

/* ============================================================
   FIABILIDAD DE TAP EN MÓVIL v2.0.1
   - touch-action: manipulation elimina el retardo de 300 ms y
     evita que el doble-tap-zoom "se coma" el toque en el móvil.
   - Área de toque cómoda y realimentación visible al presionar.
   ============================================================ */
button,
a,
label.table-check,
input[type="checkbox"],
[role="button"],
[data-route],
[data-order],
[data-view-guide],
[data-print-selected] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(238, 27, 36, .12);
}

button:not(:disabled),
[role="button"],
[data-route] {
  cursor: pointer;
}

/* En móvil, los controles de acción tienen área de toque >= 40px. */
@media (max-width: 760px) {
  .orders-table td.row-actions .text-link,
  .bulk-bar button,
  .order-filter .chip {
    min-height: 42px;
  }
  .table-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
  }
}

/* ============================================================
   RESPONSIVE v2.1.0 — Tablas del admin con acciones como TARJETAS
   (Clientes, Usuarios, Motorizados). Mismo patrón que pedidos:
   en móvil se apilan y el botón (Ver/Editar) queda visible y tocable.
   Además, scroll lateral suave con pista visual para las tablas
   informativas (Recaudos, Devoluciones, Pedidos recientes).
   ============================================================ */
@media (max-width: 760px) {
  .table-cards { white-space: normal; }
  .table-cards thead { display: none; }
  .table-cards,
  .table-cards tbody { display: block; width: 100%; }

  .table-cards tr {
    display: block;
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 14px 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(17, 17, 17, .05);
  }

  .table-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    border: 0;
    text-align: right;
  }
  .table-cards td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
  }

  /* Primera celda = título de la tarjeta. */
  .table-cards td.cell-title {
    justify-content: flex-start;
    gap: 8px;
    padding: 0 0 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
    font-weight: 800;
  }
  .table-cards td.cell-title::before { content: ""; }
  .table-cards td.muted { color: var(--muted); }

  /* Acciones: fila completa, botón grande y tocable. */
  .table-cards td.row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  .table-cards td.row-actions::before { content: ""; }
  .table-cards td.row-actions .text-link {
    margin: 0;
    padding: 9px 14px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
  }

  .table-cards .table-empty td {
    display: block;
    text-align: center;
    padding: 24px 0;
  }
  .table-cards .table-empty td::before { content: ""; }

  /* Tablas informativas (sin .table-cards): scroll lateral suave + pista de
     sombra a la derecha para que se note que hay más columnas al deslizar. */
  .main-content .table-wrap {
    -webkit-overflow-scrolling: touch;
    background:
      linear-gradient(to left, var(--paper), rgba(255, 255, 255, 0) 24px) right center / 40px 100% no-repeat;
  }
  .main-content .table-cards.table-wrap,
  .main-content .table-wrap:has(.table-cards) { background: none; }
}

/* =========================================================================
   Clientes empresa · ficha premium (v2.9.0)
   Reusa el lenguaje visual de la demo (monograma, métricas, lista de pedidos).
   Solo agrega lo que no existía: celdas de dos líneas, chips de zona y los
   bloques de la ficha.
   ========================================================================= */

/* Celda de tabla con dos líneas: dato principal + dato de apoyo. */
.cell-stack { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; min-width: 0; }
.cell-stack b, .cell-stack strong { font-weight: 700; }
.cell-stack small { color: var(--muted); font-size: 12px; font-weight: 600; }

/* Monograma dentro del modal de ficha. */
.company-monogram--modal { width: 46px; height: 46px; flex: 0 0 46px; font-size: 16px; }

/* Métricas dentro del modal (más compactas que en pantalla completa). */
.company-metrics--modal { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.company-metrics--modal article { min-height: 0; padding: 14px 16px; }
.company-metrics--modal strong { margin: 8px 0 2px; font-size: 24px; }

/* Bloques de la ficha: zonas, últimos pedidos y ajuste de cuentas. */
.ficha-block { margin-top: 20px; }
.ficha-block > .section-kicker { margin: 0 0 10px; }

.zone-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.zone-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--canvas);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

/* Ajuste de cuentas: estructura lista, cifras en $0 hasta las reglas de dinero. */
.ficha-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.ficha-money > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--canvas); }
.ficha-money small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ficha-money strong { display: block; margin-top: 4px; font-size: 18px; letter-spacing: -0.03em; }

.modal-lead { margin: 16px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.ficha-checklist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.ficha-checklist li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.ficha-checklist svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: var(--success); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 760px) {
  /* En tarjeta el dato va a la derecha; el título de la tarjeta, a la izquierda. */
  .table-cards td .cell-stack { align-items: flex-end; text-align: right; }
  .table-cards td.cell-title .cell-stack { align-items: flex-start; text-align: left; }
  .company-metrics--modal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ficha-money { grid-template-columns: 1fr; }
  .ficha-money > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .ficha-money strong { margin-top: 0; }
}

/* =========================================================================
   Usuarios y roles · matriz de permisos real (v2.10.0)
   Los permisos salen de docs/MATRIZ-ROLES-V1.md; aquí solo se presentan.
   ========================================================================= */

/* Las tarjetas de rol ahora son botones: abren la matriz de ese rol. */
.role-list button {
  display: grid;
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
}
.role-list button:hover { background: var(--canvas); }
.role-list button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.role-list button b { display: inline-flex; align-items: center; gap: 4px; }
.role-list button b svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; }

/* Avatar de la ficha de usuario (mismo lenguaje que .person-cell > i). */
.person-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
}

/* Lista de permisos: acción a la izquierda, alcance a la derecha. */
.perm-list { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.perm-row__accion { font-size: 14px; font-weight: 600; min-width: 0; }
.perm-chip {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .01em;
  white-space: nowrap;
}
.perm-chip--si { background: var(--success-soft); color: var(--success); }
.perm-chip--limitado { background: var(--warning-soft); color: var(--warning); }
.perm-chip--no { background: var(--canvas); color: var(--muted); }
.perm-row--no .perm-row__accion { color: var(--muted); }
.perm-source { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.perm-source b { color: var(--ink-soft); font-weight: 700; }

/* Aviso de acceso suspendido dentro de la ficha. */
.ficha-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid #ffd0d3;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
}
.ficha-alert p { margin: 0; font-size: 13px; line-height: 1.5; }
.ficha-alert svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: var(--brand-dark); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Acciones sensibles de la ficha (suspender / restablecer). */
.ficha-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.ficha-actions .secondary-button { flex: 1 1 200px; justify-content: center; }

@media (max-width: 760px) {
  .perm-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .ficha-actions .secondary-button { flex: 1 1 100%; }
}

/* Toolbar de la tabla de usuarios: con 6 filtros el buscador se aplastaba.
   Se permite bajar los filtros a su propia línea antes de estrujarlo. */
.users-table-card .filter-toolbar { flex-wrap: wrap; }
.users-table-card .table-search { flex: 1 1 220px; }
.users-table-card .filter-pills { flex: 1 1 auto; overflow-x: auto; }

/* En móvil los filtros ocupan su propia línea completa: con seis roles, la tira
   compartiendo fila con el buscador quedaba demasiado angosta para deslizar. */
@media (max-width: 760px) {
  .users-table-card .filter-pills { flex: 1 0 100%; }
}

/* La tabla de usuarios vive en una columna angosta (al lado va la matriz de
   roles): se deja envolver el texto para que la acción de cada fila quede
   siempre visible, sin desplazar la tabla de lado. */
.users-table-card table th,
.users-table-card table td { white-space: normal; }
.users-table-card .role-chip,
.users-table-card .status-pill,
.users-table-card .row-actions .text-link { white-space: nowrap; }

/* =========================================================================
   Crear pedido / Mercado Flex / Login (v2.11.0)
   ========================================================================= */

/* Paso ya cumplido: se distingue del paso actual (rojo) y del pendiente. */
.step-indicator span.is-done {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--success);
}

/* Campo señalado por la validación: se ve cuál falta, no solo el aviso. */
.field--invalid > span:first-child { color: var(--brand-dark); }
.field--invalid .field-control {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.field--invalid .field-control input,
.field--invalid .field-control select,
.field--invalid .field-control textarea { color: var(--ink); }

/* Los dos formatos lado a lado dejaban 34 px para el texto: "Formato
   recomendado" y la medida salían cortados. Se apilan cuando no caben. */
.guide-format__options { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.guide-format__copy em { overflow: visible; white-space: normal; text-overflow: clip; }
.guide-format__copy small { white-space: nowrap; }

/* ---- Login: entradas rápidas de prueba (plegadas por defecto) ---- */
.login-quick {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}
.login-quick > summary {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.login-quick > summary::-webkit-details-marker { display: none; }
.login-quick > summary::after { content: " +"; }
.login-quick[open] > summary { border-bottom: 1px solid var(--line); }
.login-quick[open] > summary::after { content: " −"; }
.login-quick > summary:hover { color: var(--ink); }
.login-quick .role-pick { margin: 0; padding: 12px 14px; }

/* El aviso de error del login solo ocupa lugar cuando dice algo. */
.form-error:empty { min-height: 0; margin: 0; }

/* ---- Recaudos: cerrar entrega (portado de la demo, cierre de administración) ---- */
.evidence-upload__pick { display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.evidence-upload__file { display: block; margin-top: 8px; color: var(--success); font-size: 12px; font-weight: 700; }
[data-cierre-requisito].is-required { color: var(--warning); font-weight: 700; }
.delivery-capture .field { margin-bottom: 12px; }

/* Mejora sobre la demo: en la demo `.delivery-order` fija color blanco sobre
   fondo oscuro y `--live` solo cambia el fondo a azul claro, dejando texto
   blanco sobre claro (ilegible). Aquí el bloque activo usa texto oscuro y
   tamaños legibles (la demo los dejaba en 8-9 px). */
.delivery-order--live { color: var(--ink); border: 1px solid var(--route); }
.delivery-order--live small { color: var(--route); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.delivery-order--live strong { color: var(--ink); font-size: 17px; }
.delivery-order--live span { color: var(--ink-soft); font-size: 12px; }

/* =========================================================================
   Resultado del escaneo a pantalla completa (v2.14.0) — ver app/escaneo.mjs
   Ocupa toda la pantalla porque se lee de un vistazo, con el celular en la
   mano y el paquete en la otra. Color plano y tipografía enorme para que se
   distinga a la distancia del brazo y con sol.
   ========================================================================= */
.scan-flash {
  position: fixed;
  inset: 0;
  z-index: 400; /* por encima de modales y avisos */
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: #fff;
  cursor: pointer;
  /* Sin fundido de entrada: en bodega el resultado debe estar ahí ya. La
     opacidad la controla la clase, no una transición que pueda quedar a medias. */
  opacity: 0;
}
.scan-flash.is-visible { opacity: 1; }

/* Un color plano por resultado: se reconoce antes de leer la palabra. */
.scan-flash--ok { background: #12805c; }
.scan-flash--aviso { background: #9a6110; }
.scan-flash--info { background: #176bb5; }
.scan-flash--alto { background: #b80c15; }

.scan-flash__inner {
  display: grid;
  gap: 10px;
  justify-items: center;
  max-width: 520px;
}
/* Un golpe de escala muy corto al aparecer: se nota el cambio aunque dos
   escaneos seguidos den el mismo resultado. No retrasa la lectura. */
.scan-flash.is-visible .scan-flash__inner { animation: scan-pop .16s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes scan-pop { from { transform: scale(.92); } to { transform: scale(1); } }

.scan-flash__mark {
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  border: 5px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  font-size: 58px;
  line-height: 1;
}
.scan-flash__word {
  font-size: clamp(38px, 13vw, 68px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  text-transform: uppercase;
}
/* El código confirma QUÉ paquete fue: sin esto el verde no sirve de nada. */
.scan-flash__code {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .22);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  word-break: break-all;
}
.scan-flash__detail { font-size: 16px; font-weight: 600; opacity: .92; }
.scan-flash__streak {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .28);
  font-size: 13px;
  font-weight: 700;
  opacity: .85;
}

@media (prefers-reduced-motion: reduce) {
  .scan-flash.is-visible .scan-flash__inner { animation: none; }
}

/* Zona con el paquete que lleva más tiempo esperando: es la decisión real de
   esta pantalla ("¿a dónde mando primero?"). La demo mostraba el tiempo pero
   no señalaba cuál era la más urgente. */
.territory-zone-card--espera { border-color: var(--warning); background: var(--warning-soft); }
.territory-zone-card--espera .territory-zone-card__marker { background: var(--warning); color: #fff; }
.territory-zone-card__flag {
  display: block;
  margin-top: 3px;
  color: var(--warning);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* =========================================================================
   Novedades: mesa de trabajo (v2.16.0)
   ========================================================================= */
/* Defecto heredado de la demo: en pantallas medianas la cola se convierte en
   una tira horizontal de 4 columnas de 240 px y se esconde su encabezado. En
   un teléfono eso deja el 2º y el 3º caso FUERA de la pantalla (había que
   descubrir que se desliza de lado). En móvil vuelve a ser una lista vertical
   y el encabezado reaparece con el número de pendientes. */
@media (max-width: 760px) {
  .incident-queue { grid-template-columns: 1fr; overflow-x: visible; }
  .incident-queue__head { display: flex; }
  .queue-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .incident-actions { flex-wrap: wrap; }
  .incident-actions button { flex: 1 1 100%; justify-content: center; }
}
/* El caso abierto se distingue del resto en la cola. */
.queue-item.is-active { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }

/* Cierre de pago (portado de la demo). Estructura lista, cifras en $0 hasta
   que la dirección confirme flete, pago y cortes. */
.settlement-totals { margin: 0 0 12px; display: grid; gap: 6px; }
.settlement-totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.settlement-totals dt { margin: 0; color: var(--muted); font-size: 13px; }
.settlement-totals dd { margin: 0; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.settlement-totals__total { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.settlement-totals__total dt { color: var(--ink); font-weight: 700; }
.settlement-totals__total dd { font-size: 18px; letter-spacing: -0.03em; }
.secondary-button--full { width: 100%; justify-content: center; }

/* El celular de la vista de motorizados es una imagen, no un control. */
.rider-scan-button { pointer-events: none; user-select: none; }

/* Interruptor del sonido al escanear (v2.20.0). Vive junto al escáner porque
   quien lo apaga está recibiendo paquetes, no navegando ajustes. */
.scanner-console__acciones { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scanner-console__acciones--centro { justify-content: center; margin-bottom: 12px; }

.sonido-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.sonido-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sonido-toggle.is-on { color: var(--success); border-color: var(--success); background: var(--success-soft); }
.sonido-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Sobre la consola oscura de bodega el botón apagado necesita su propio contraste. */
.scanner-console .sonido-toggle:not(.is-on) { color: #c9c7c2; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .18); }

/* =========================================================================
   Mercado Flex · recepción de dos pasos (v2.22.0)
   Reusa la consola de escaneo de bodega; solo se agrega el lote de la sesión.
   ========================================================================= */
.flex-lote { padding: 0; }
.flex-lote__list { display: grid; }
.flex-lote__item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}
.flex-lote__item:first-child { border-top: 0; }
.flex-lote__item.is-listo { background: var(--success-soft); }
.flex-lote__n {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.flex-lote__item.is-listo .flex-lote__n { background: var(--success); }
.flex-lote__item strong { display: block; font-size: 14px; }
.flex-lote__item small { color: var(--muted); font-size: 12px; }
.flex-lote__item .primary-button { padding: 9px 14px; min-height: 40px; font-size: 13px; }
.flex-lote .empty-state--inline { margin: 8px 18px 18px; }

/* Ficha corta del paso 2 */
.flex-ficha { display: grid; gap: 12px; margin-top: 16px; }
.flex-ficha .modal-actions { margin-top: 4px; }

@media (max-width: 760px) {
  .flex-lote__item { grid-template-columns: 30px minmax(0, 1fr); }
  .flex-lote__item .primary-button,
  .flex-lote__item .status-pill { grid-column: 1 / -1; justify-content: center; }
}
