: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-item[data-pending]::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-radius: 50%;
  background: #ed6849;
  box-shadow: 0 0 0 2px #292929;
}

.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%;
}

/* Variante de frase completa: conserva el color y el punto de aviso, pero en
   caja normal y a tamaño legible — una oración en mayúsculas a 10px no se lee. */
.demo-chip--warn {
  align-items: flex-start;
  max-width: 72ch;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
}

.demo-chip--warn span {
  flex: 0 0 auto;
  margin-top: 6px;
}

.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: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--muted);
  background: #f3f2ee;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.modal-close:hover { background: var(--line); color: var(--ink); }
.modal-close:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.modal-close svg { width: 20px; height: 20px; }

.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;
}

.special-freight-toggle { margin: 14px 0 8px; color: var(--brand-dark); font-weight: 700; }
.special-freight-fields:not([hidden]) { margin-bottom: 18px; }

.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);
}

/* Decisión de novedad (Cliente Empresa): tarjetas-radio grandes y sobrias.
   Una decisión por fila, legible de un vistazo y cómoda para el pulgar.
   Reutiliza los tokens del sistema; nada de tarjetas exageradas ni gradientes. */
.decision-choices {
  display: grid;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0 0 4px;
}
.decision-choices .field-legend {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  padding: 0;
  margin: 0 0 4px;
}
.decision-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--paper);
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.decision-card:hover {
  border-color: var(--muted);
}
.decision-card input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
  accent-color: var(--brand);
}
.decision-card__body {
  display: grid;
  gap: 2px;
}
.decision-card__body strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.decision-card__body small {
  font-size: 12px;
  color: var(--muted);
}
.decision-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.decision-card:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
/* Acción primaria en reposo hasta que la decisión (y su dato obligatorio) están
   listos: se ve claramente inhabilitada, sin competir con "Cancelar". */
.modal-actions .primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.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; container-type: inline-size; container-name: whlist; }

.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__availability.is-waiting { border-color: #d08a15; }

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

/* Bodega responsive: la tarjeta de inventario usa un grid de 5 columnas fijas en
   escritorio cuyo mínimo (~800px) DESBORDA cuando su CONTENEDOR es más angosto —
   ocurre en móvil, en tablet y también en escritorio cuando la barra lateral
   estrecha el contenido. El botón "Ver detalle" quedaba fuera de la vista y el
   contenedor lo recortaba (había que reducir el zoom para alcanzarlo). Se usa una
   consulta de CONTENEDOR (no de viewport, que no ve la barra lateral): mientras el
   contenedor no dé para el grid ancho, la tarjeta se apila y el botón queda a lo
   ancho, visible y táctil, sin desbordamiento horizontal. */
@container whlist (max-width: 800px) {
  .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: 44px; }
}

.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);
}

.module-metrics--one {
  grid-template-columns: 1fr;
}

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

.motos-resumen-title {
  margin: 8px 0 2px;
  font-size: 15px;
}

.motos-resumen-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.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);
}

/* Flujo D · zona de evidencia del Motorizado: táctil, clara y agrupada.
   Cada prueba es una tarjeta compacta con un botón grande para el dedo,
   en vez de un <input type=file> genérico difícil de tocar. */
.evidence-group {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  background: #faf9f6;
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 12px);
}
.evidence-group__title {
  margin: 0;
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.evidence-upload--novedad {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 0;
  margin: 0;
  padding: 14px;
  text-align: left;
  background: white;
  border-style: solid;
}
.evidence-upload--novedad .evidence-upload__icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--brand);
}
.evidence-upload--novedad strong {
  flex: 1 1 160px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
}
.evidence-upload--novedad .evidence-upload__pick {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 16px;
  font-size: 13px;
}
/* El <input type=file> real está en .sr-only (enfocable por teclado). Cuando
   recibe foco, el foco visible se dibuja sobre el disparador táctil grande. */
.evidence-upload--novedad:focus-within .evidence-upload__pick {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
/* Confirmación del archivo elegido: nombre visible + tarjeta en verde éxito. */
.evidence-upload--novedad .evidence-upload__file {
  flex: 1 1 100%;
  margin-top: 0;
}

.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: 15px;
}

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

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

/* Flujo A · bandeja de trabajo: estado -> cliente -> problema -> meta.
   Lo primero que salta a la vista es a QUIÉN y QUÉ pasó, no la guía. */
.queue-item__estado {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
/* Cada estado se distingue por ICONO + texto + color (no solo color), para no
   depender de la percepción cromática. */
.queue-item__estado-icon {
  display: inline-flex;
  flex: 0 0 auto;
}
.queue-item__estado-icon svg { width: 12px; height: 12px; }
/* Esperando respuesta -> requiere acción pendiente de la Cliente Empresa. */
.queue-item__estado--pendiente {
  color: #9a2a12;
  background: var(--warning-soft, #fff2e6);
}
/* Respondida -> la respuesta quedó registrada. */
.queue-item__estado--respondida {
  color: #1d4ed8;
  background: #e6efff;
}
/* Retorno pendiente -> la operación sigue en curso (aún no cerrada). */
.queue-item__estado--retorno-pendiente {
  color: #92600a;
  background: #fdf3d8;
}
/* Retorno recibido -> operación finalizada / recibida en bodega. */
.queue-item__estado--retorno-recibido {
  color: #1c6b3a;
  background: #e7f6ec;
}
.queue-item__buyer {
  padding-right: 42px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}
.queue-item__reason {
  color: var(--ink, #23201b);
  font-size: 13px;
  font-weight: 600;
}
.queue-item__meta {
  color: var(--muted);
  font-size: 12px;
}

/* ── Bandeja HUMANO PRIMERO (v2.17.0) ────────────────────────────────────── */
.incidents-inbox {
  width: 100%;
  max-width: 100%;
  padding: 0;
  overflow-x: hidden;
}

.incidents-inbox__section {
  border-bottom: 1px solid var(--line);
}

.incidents-inbox__section--history .incident-queue__head {
  background: transparent;
}

.incidents-inbox__section--history .queue-item {
  opacity: 0.75;
}

.incident-queue__head--dim strong {
  color: var(--muted);
}

.incidents-inbox__empty {
  padding: 20px 16px;
  color: var(--muted);
  font-size: 14px;
}

/* Tarjeta motorizado: botón + decisión en un bloque vertical.
   Clase propia (.incident-card): Mi Ruta redefine .queue-card como grid de dos
   columnas más abajo, y al compartir nombre esa regla ganaba por orden de fuente
   y colapsaba la 2ª columna a 0px → estado/destinatario/motivo se salían del
   viewport en móvil. Con nombre propio la bandeja mantiene su apilado vertical. */
.incident-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-bottom: 1px solid var(--line);
}

.incident-card .queue-item {
  border-bottom: none;
}

.incident-card .incident-actions--status {
  padding: 0 16px 14px;
}
/* Cuando la decisión aparece PRIMERO (motorizado + tienda respondió) */
.incident-card .incident-actions--status:first-child {
  padding: 14px 16px 0;
}
.incident-card .incident-actions--status + .queue-item {
  border-top: 1px solid var(--line);
}

/* ── Hoja de detalle en modal (novedad-sheet) ─────────────────────────────── */
.novedad-sheet {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 4px 4px;
  overflow-x: hidden;
  max-width: 100%;
}

.novedad-sheet__buyer {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: break-word;
}

.novedad-sheet__buyer-label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.novedad-sheet__problem {
  margin: 0;
  color: #9a2a12;
  font-size: 16px;
  font-weight: 700;
}

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

.novedad-sheet__meta > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: white;
  min-width: 0;
  overflow: hidden;
}

.novedad-sheet__meta small {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.novedad-sheet__meta strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.novedad-sheet__actions-row {
  display: flex;
  gap: 12px;
}

.novedad-sheet__comment {
  margin: 0;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
  background: var(--paper, #faf9f5);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--line-strong);
}

.novedad-sheet__reported {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.incident-evidence {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.incident-evidence > strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.incident-evidence .secondary-button--small {
  justify-content: flex-start;
  white-space: normal;
  word-break: break-word;
}

.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: 22px;
}

/* Flujo B · el detalle abre con el PROBLEMA en palabras, no con la guía. */
.incident-detail__problem {
  margin: 6px 0 0;
  color: #9a2a12;
  font-size: 15px;
  font-weight: 700;
}

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

.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: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

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

.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: 11px;
  text-align: right;
}

/* Flujo E · la decisión del Cliente Empresa NO se esconde en letra chica:
   ocupa el pie de la novedad como tarjeta de estado, legible de un vistazo. */
.incident-actions--status {
  display: block;
  padding-top: 16px;
}
.incident-actions--status .route-novelty {
  margin: 0;
}

.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) {
  /* Altura compartida de la barra inferior fija. El scroll real de la app lo
     lleva el documento (html/body); las pantallas se pintan dentro de
     .main-content, y .mobile-nav es un hermano position:fixed que solapa el
     borde inferior. Por eso la holgura debe vivir en .main-content, no en el
     body: la clase `is-authenticated` no existe en el DOM (el login se conmuta
     con [hidden]), así que la regla anterior no reservaba ni un píxel. */
  :root { --mobile-nav-h: 66px; }
  .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);
    /* La holgura inferior debe superar la nav fija (var + safe-area) para que la
       última acción (p. ej. "Responder novedad") quede por encima de ella. */
    padding: 22px 16px calc(var(--mobile-nav-h) + env(safe-area-inset-bottom) + 24px);
    scroll-padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom) + 24px);
  }
  .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: var(--mobile-nav-h);
    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%;
}
/* El QR no es un icono: sin el trazo global de `svg` (stroke: currentColor;
   stroke-width: 1.8), que pintaba un borde grueso en cada módulo y en el fondo
   hasta dejarlo como un bloque negro imposible de escanear. */
.qr-svg {
  stroke: none;
}

/* 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; }
.route-novelty {
  display: grid;
  gap: 4px;
  margin: 0 12px 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f5f4ef;
  border: 1px solid var(--line-strong);
  color: #262626;
  font-size: 13px;
  line-height: 1.4;
}
.route-novelty strong { font-size: 16px; font-weight: 800; }
.route-novelty small { color: #625f57; font-size: 12.5px; }
/* Flujo E · a QUÉ cliente pertenece la decisión, resaltado dentro de la ruta. */
.route-novelty__who { color: #262626 !important; font-weight: 600; }
.route-novelty--decidida {
  border-left: 4px solid #1c8c4c;
  background: #eef8f1;
}
.route-novelty--return {
  border-left: 4px solid #c65425;
  background: #fff1e8;
  color: #5c260d;
}
.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; }
/* DEC-062 · novedad operativa normal: aviso ámbar discreto, no bloquea la entrega.
   Distinto del naranja de retorno definitivo (.route-novelty--return). */
.stop-row__badge {
  display: inline-flex; align-items: center; gap: 4px;
  max-width: 100%; margin-top: 4px; padding: 2px 8px;
  border-radius: 999px; font-size: 11.5px; font-weight: 800; line-height: 1.4;
  white-space: nowrap;
}
.stop-row__badge svg { width: 13px; height: 13px; flex: 0 0 auto; }
.stop-row__badge--novedad { color: var(--warning); background: var(--warning-soft); border: 1px solid #f0dcb4; }
.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; }

/* Reprogramar (responder novedad): la fecha se ve de un vistazo — etiqueta con
   ícono de calendario y campo nativo a ancho completo, sin overflow en móvil. */
.field--fecha .field-date-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.field--fecha .field-date-label__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
}
.field--fecha input[type="date"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--ink);
  background: #fafafa;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.field--fecha input[type="date"]:focus {
  background: #fff;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
  outline: none;
}

/* 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;
  }

  /* RC1-UI-RESPONSIVE-MOVIL: los botones de acción de cada parada de "Mi ruta"
     (Avisar/Entregado/Novedad/Devuelto) son <button> dentro de
     .courier-stop-list, así que heredaban por error el layout de fila de
     ".courier-stop-list button" (pensado para otra lista, ver arriba en este
     archivo): quedaban en una sola línea con el texto sin espacio, que se
     salía del botón y se montaba sobre el ícono del siguiente. Se restaura
     aquí su propio layout (ícono arriba, texto abajo, centrado y truncado)
     solo en este rango móvil; en escritorio hay ancho de sobra y no se toca. */
  .courier-stop-list .stop-act {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 4px 8px;
    min-height: 78px;
    text-align: center;
  }

  .courier-stop-list .stop-act > span:not(.action-icon) {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: transparent;
    border-radius: 0;
  }
}

/* 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; }
/* Flujo C · encabezado humano de "Responder novedad": cliente y problema
   primero (para decidir en <2s), la guía como dato secundario. */
.modal-lead--novedad { display: grid; gap: 3px; color: var(--ink); }
.modal-lead--novedad b { font-size: 17px; font-weight: 800; }
.modal-lead--novedad .modal-lead__problema { color: #9a2a12; font-size: 14px; font-weight: 700; }
.modal-lead--novedad .modal-lead__guia { color: var(--muted); font-size: 12.5px; }
.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; }
.recuperar-clave-estado { margin: 12px 0; color: var(--brand-dark); font-size: 13px; }
.recuperar-clave-estado.is-ok { color: var(--success); }

/* ---- 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, SIN cifras: el
   servidor todavía no entrega el saldo neto de un cliente ni de un motorizado,
   así que cada renglón dice "Pendiente de conexión" en vez de un $0 falso. */
.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; }
/* El estado honesto no es un número: se lee como etiqueta, no como cifra. */
.settlement-pending { color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: normal; letter-spacing: 0; text-align: right; }
.settlement-totals__total .settlement-pending { font-size: 14px; }
.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; }
}

/* ============================================================
   RC1-UX-MOBILE-CLOSURE — Bloque MOTORIZADO
   UX/layout solo; sin lógica ni backend.
   ============================================================ */

/* 1. Botones de parada (Avisar/Entregado/Novedad/Devuelto)
      Touch targets más cómodos en phones pequeños. */
@media (max-width: 480px) {
  .stop-act {
    min-height: 90px;
    gap: 6px;
    padding: 10px 4px;
    font-size: 10px;
  }
  .action-icon {
    width: 34px;
    height: 34px;
  }
  .stop-row__main {
    padding: 14px;
  }
  .stop-row__info strong {
    font-size: 16px;
  }
}

/* 2. Modal de novedad/reprogramación
      font-size 16px evita zoom automático en iOS.
      Botón de confirmación prominente para operación en calle. */
@media (max-width: 760px) {
  .modal-form select,
  .modal-form input[type="date"] {
    font-size: 16px;
    min-height: 50px;
  }
  .modal-form textarea {
    font-size: 15px;
  }
  /* Detalle opcional: visualmente secundario */
  .modal-form .field:has(textarea) {
    opacity: 0.75;
  }
  .modal-lead {
    font-size: 13px;
    margin-bottom: 12px;
  }
  .modal-actions .primary-button {
    min-height: 52px;
    font-size: 16px;
    font-weight: 800;
  }
}

/* 3. Cámara QR: maximizar la vista de cámara, reducir espacio muerto superior. */
@media (max-width: 720px) {
  .qr-camera-dialog__head {
    margin-bottom: 10px;
    gap: 10px;
  }
  /* La etiqueta en caps (ej. "ESCANEAR") es redundante cuando la cámara es visible */
  .qr-camera-dialog__head p {
    display: none;
  }
  .qr-camera-dialog__head h2 {
    font-size: 17px;
  }
  .qr-camera-dialog__viewer,
  .qr-camera-dialog__video {
    min-height: calc(50svh - 2rem);
    max-height: 56svh;
  }
  /* Texto de ayuda: más compacto para ganar espacio de cámara */
  .qr-camera-dialog__help {
    margin: 8px 0 10px;
    font-size: 10px;
  }
}

/* ============================================================
   RC1-UX-MOBILE-CLOSURE — Bloque BODEGA
   UX/layout solo; sin lógica ni backend.
   ============================================================ */

/* 1. Scanner de bodega: frame más compacto, instrucción secundaria oculta. */
@media (max-width: 640px) {
  .scanner-frame {
    min-height: 180px; /* 230px → 180px: reduce espacio muerto */
  }
  .scanner-frame small {
    /* La instrucción ya está en el campo manual-scan; evitar doble lectura */
    display: none;
  }
  /* Tarjetas de acción (Flex / Ver zonas): padding más compacto */
  .warehouse-action-card {
    padding: 12px;
    gap: 10px;
  }
}

/* 2. Inventario de bodega: tarjeta más legible en móvil. */
@media (max-width: 760px) {
  /* La sub-nota de disponibilidad es secundaria en pantallas pequeñas */
  .warehouse-order__availability small {
    display: none;
  }
  .warehouse-order__availability strong {
    font-size: 12px;
  }
  /* "Ver detalle" como botón de acción claro */
  .warehouse-order__detail {
    min-height: 44px;
  }
}

/* RC1-UX-MOBILE-CLOSURE — Hallazgos físicos MOTORIZADO (staging 2026-09-12) */

/* Fix 1: Barra demo oculta en móvil — no visible en operación normal */
@media (max-width: 760px) {
  #dev-bar { display: none; }
}

/* Fix 3a: Avatar con ícono de rol en lugar de iniciales */
.profile-avatar--icon { font-size: 0; line-height: 1; }
.profile-avatar--icon svg { width: 18px; height: 18px; color: white; }

/* Fix 3b: Nombre visible en cabecera móvil de forma compacta */
@media (max-width: 760px) {
  .topbar__actions { gap: 0; }
  .profile-button { gap: 6px; }
  .profile-copy { display: grid; gap: 1px; }
  .profile-copy small { display: none; }
  .profile-copy strong { font-size: 11px; font-weight: 700; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 72px; }
}

/* ============================================================
   AJUSTE FINAL UX MOTORIZADO — CLARIDAD EXTREMA EN MÓVIL
   Solo CSS/UX; sin lógica ni backend. (2026-09-12)
   ============================================================ */

/* --- Navegación inferior: mayor legibilidad en móvil ----------- */
.mobile-nav__item {
  position: relative;
  font-size: 11px;
  font-weight: 600;
  min-width: 52px;
  min-height: 56px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.mobile-nav__item[data-pending]::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d84925;
  box-shadow: 0 0 0 2px #fff;
}

.mobile-nav__item svg {
  width: 22px;
  height: 22px;
}

.mobile-nav__item span,
.mobile-nav__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 56px;
}

/* Touch target mínimo 48px (WCAG 2.5.5) */
.mobile-nav__item a,
.mobile-nav__item button {
  min-height: 48px;
  min-width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* --- Tipografía general motorizado en móvil ------------------- */
@media (max-width: 760px) {
  /* Títulos de página */
  .page-heading__title,
  .module-page h1 {
    font-size: clamp(20px, 5vw, 26px);
    font-weight: 700;
    line-height: 1.2;
  }

  /* Kicker / etiqueta sobre el título */
  .page-heading__kicker {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
  }

  /* Subtexto / descripción */
  .page-heading__copy {
    font-size: 14px;
    font-weight: 400;
  }

  /* Labels en tarjetas de parada */
  .stop-row__main,
  .stop-row__label {
    font-size: 15px;
    font-weight: 600;
  }

  .stop-row__sub {
    font-size: 13px;
  }

  /* Botones de acción operativa (Entregar, Novedad, Devuelto, etc.) */
  .stop-actions button,
  .stop-actions .primary-button,
  .stop-actions .secondary-button {
    font-size: 14px;
    font-weight: 600;
    min-height: 44px;
    padding: 10px 14px;
  }

  /* Botón primario general en móvil */
  .primary-button {
    font-size: 15px;
    font-weight: 700;
    min-height: 48px;
    padding: 12px 20px;
  }

  /* Botón secundario general en móvil */
  .secondary-button {
    font-size: 14px;
    font-weight: 600;
    min-height: 44px;
    padding: 10px 16px;
  }

  /* Texto vivo/estado (live-indicator) */
  .live-indicator {
    font-size: 12px;
    font-weight: 600;
  }

  /* Estado vacío: texto más visible */
  .empty-state p {
    font-size: 15px;
    font-weight: 500;
  }

  /* Ruta del motorizado: número de parada más grande */
  .courier-command h3 {
    font-size: 18px;
    font-weight: 700;
  }

  /* Consola de escaneo: campo más grande */
  .manual-scan input {
    font-size: 16px; /* previene zoom en iOS */
    min-height: 48px;
    padding: 12px 14px;
  }

  .manual-scan .primary-button {
    min-height: 48px;
  }

  /* Sección de resultado del escaneo */
  .scan-result strong {
    font-size: 15px;
    font-weight: 700;
  }

  .scan-result small {
    font-size: 12px;
  }
}

/* --- Responsive: sin scroll horizontal en ningún ancho -------- */
@media (max-width: 412px) {
  .stop-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .stop-actions button {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }
}

/* --- Menú lateral motorizado: secciones más legibles ----------- */
.nav-section__title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-item {
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ============================================================
   CIERRE UX/UI — MOTORIZADO + BODEGA + GLOBAL (2026-09-12)
   Solo CSS/UI. Sin backend, RPC ni logica de negocio.
   ============================================================ */

/* --- Control de tamanio de letra en el sidebar --------------- */
.font-size-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 10px;
  gap: 10px;
}

.font-size-control__label {
  font-size: 11px;
  color: #777;
  font-weight: 500;
  line-height: 1.3;
}

.font-size-control__options {
  display: flex;
  gap: 4px;
}

.font-size-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid #3a3a3a;
  background: #1a1a1a;
  color: #aaa;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.font-size-btn:nth-child(1) { font-size: 11px; }
.font-size-btn:nth-child(2) { font-size: 14px; }
.font-size-btn:nth-child(3) { font-size: 16px; }

.font-size-btn:hover {
  background: #2a2a2a;
  border-color: #555;
  color: #eee;
}

.font-size-btn.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

/* --- Bodega UX: mejoras de legibilidad y jerarquia ----------- */

/* KPIs: numero mas grande y etiqueta mas legible */
.warehouse-kpis strong {
  font-size: 32px;
}

.warehouse-kpis small,
.warehouse-kpis span {
  font-size: 11px;
}

/* Tarjetas de accion (Flex / Ver zonas): boton mas prominente */
.warehouse-action-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.warehouse-action-card p {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.warehouse-action-card .secondary-button {
  min-height: 44px;
  font-weight: 600;
  white-space: nowrap;
}

/* Tarjeta de inventario: guia mas legible */
.warehouse-order__guide span {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.warehouse-order__destination strong {
  font-size: 15px;
  font-weight: 700;
}

.warehouse-order__destination span {
  font-size: 13px;
}

/* Consola de escaneo de bodega: accion principal claramente visible */
@media (max-width: 760px) {
  .warehouse-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .warehouse-workspace {
    grid-template-columns: 1fr;
  }

  .warehouse-next-actions {
    display: none; /* Las tarjetas de accion secundarias van al menu; en movil no caben con la consola */
  }
}

/* En movil bodega: consola de escaneo full-width */
@media (max-width: 760px) {
  .scanner-console {
    border-radius: var(--radius-md);
  }

  /* Instrucion de escaneo: texto mas claro */
  .manual-scan > span {
    font-size: 13px;
    color: var(--muted);
  }

  /* Resultado de escaneo: estado prominente */
  .scan-result strong {
    font-size: 15px;
    font-weight: 700;
  }
}

/* --- Tipografia global: base mas legible para todos los roles -- */

/* Peso ligeramente mayor en textos clave */
strong, b, th, dt { font-weight: 700; }

/* Seccion-kicker: mas legible */
.section-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

/* Labels de formulario: mas peso */
label, .field-label {
  font-weight: 600;
}

/* Inputs: siempre 16px en movil para prevenir zoom iOS */
@media (max-width: 760px) {
  input:not([type=checkbox]):not([type=radio]),
  select,
  textarea {
    font-size: 16px;
  }
}

/* Contraste de texto mutado: ligeramente mas oscuro para legibilidad */
.muted, small, .section-kicker {
  color: var(--muted);
}

/* Pill de estado: texto ligeramente mas grueso */
.status-pill {
  font-weight: 600;
}

/* Responsive largo: en pantallas muy estrechas evitar overflow */
@media (max-width: 360px) {
  .warehouse-action-card {
    grid-template-columns: 32px 1fr;
  }
  .warehouse-action-card .secondary-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* ============================================================
   PASADA SENIOR — MOTORIZADO + BODEGA + GLOBAL (2026-09-12)
   Solo CSS/UI. Sin backend, RPC ni logica de negocio.
   ============================================================ */

/* --- QA: la barra "Vista de conexion (demo)" nunca se muestra al
   operador normal, en ningun rol ni tamano de pantalla. La capacidad
   de forzar estados sigue disponible por codigo (setSim/getSim en
   lecturas.mjs), que es lo que usan las pruebas; aqui solo se oculta
   la interfaz. No se crea ningun sistema nuevo. -------------------- */
.dev-bar { display: none !important; }

/* --- FIX compartido: botones de accion de cada parada -----------
   Los <button> de accion (Avisar/Entregado/Novedad/Devuelto) viven
   dentro de .courier-stop-list y heredaban por error el grid de
   ".courier-stop-list button", que colapsaba la etiqueta a 0px en
   tablet/escritorio (solo se veia el icono). Se restaura su layout
   propio —icono arriba, etiqueta debajo— en todos los tamanos. */
.courier-stop-list .stop-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
}
.courier-stop-list .stop-act > span:not(.action-icon) {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Escala global de tamano de letra ---------------------------
   Centralizada: una sola variable (--ui-scale) aplicada con zoom al
   documento entero. Escala TODO lo visible de forma proporcional
   —titulos, subtitulos, textos, botones, labels, formularios, tablas,
   tarjetas, modales, menu lateral y navegacion inferior— sin reglas
   por elemento. "Normal" mantiene el diseno base premium; "Grande"
   sube ~13% (perceptible de verdad) y "Pequena" baja ~8%. */
html[data-font-size="large"] { --ui-scale: 1.13; }
html[data-font-size="small"]  { --ui-scale: 0.92; }
body { zoom: var(--ui-scale, 1); }

/* En telefonos pequenos "Grande" se atenua un poco para conservar
   >=320px utiles y evitar scroll horizontal o textos cortados. */
@media (max-width: 480px) {
  html[data-font-size="large"] { --ui-scale: 1.09; }
}

/* --- MOTORIZADO "Mis pedidos": escritorio senior ----------------
   En movil/tablet se mantiene el apilado vertical (base). En
   escritorio se reparte el ancho: la lista de paradas ocupa la
   columna principal y el resumen "Ruta de hoy" pasa a un panel
   lateral compacto y fijo, en lugar de una franja negra ancha y
   vacia. Cada parada se vuelve una fila horizontal (info a la
   izquierda, acciones a la derecha con ancho fijo). */
@media (min-width: 960px) {
  #miruta-datos {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
  }
  #miruta-datos > .courier-command {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 104px;
    padding: 22px;
  }
  #miruta-datos > .courier-command .courier-command__route {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  #miruta-datos > .courier-command .live-indicator { margin-left: auto; }
  /* La lista (o el estado vacio) ocupa la columna principal. */
  #miruta-datos > .courier-command + * {
    grid-column: 1;
    grid-row: 1;
    margin-top: 0;
  }

  /* Parada como fila horizontal: info flexible + 4 acciones de ancho
     fijo (proporcionadas, ni gigantes ni perdidas). */
  #miruta-datos .stop-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
  }
  #miruta-datos .stop-row__main { border-right: 1px solid var(--line); }
  #miruta-datos .stop-row__actions {
    grid-template-columns: repeat(4, 80px);
    border-top: 0;
  }
  #miruta-datos .stop-act {
    min-height: 0;
    padding: 12px 6px;
  }
}

/* --- BODEGA: escritorio ancho -----------------------------------
   Logica propia de bodega (no copia de motorizado): el inventario es
   la columna principal y, al lado, la consola para recibir/escanear
   queda siempre visible como panel fijo. En movil/tablet se mantiene
   el apilado (inventario primero, luego escaneo, por el reorden del
   markup). */
@media (min-width: 1080px) {
  .module-page[aria-labelledby="warehouse-heading"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
    column-gap: 22px;
    row-gap: 18px;
    align-items: start;
  }
  .module-page[aria-labelledby="warehouse-heading"] > * { margin-bottom: 0; }
  .module-page[aria-labelledby="warehouse-heading"] > #bodega-aviso:empty { display: none; }
  .module-page[aria-labelledby="warehouse-heading"] > .page-heading,
  .module-page[aria-labelledby="warehouse-heading"] > #bodega-aviso,
  .module-page[aria-labelledby="warehouse-heading"] > #bodega-kpis {
    grid-column: 1 / -1;
  }
  .module-page[aria-labelledby="warehouse-heading"] > #bodega-datos { grid-column: 1; }
  .module-page[aria-labelledby="warehouse-heading"] > .warehouse-workspace {
    grid-column: 2;
    grid-template-columns: 1fr;
    position: sticky;
    top: 104px;
  }
}

/* Recaudo (contraentrega) del pedido en cada parada de Mi ruta: el motorizado
   custodio necesita ver cuánto cobrar en la puerta. Oculto no se pinta. */
.stop-row__cod { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.stop-row__cod--cobrar { color: var(--success); }
.stop-row__cod svg { width: 13px; height: 13px; stroke: currentColor; fill: none; }
/* ---- Caja real (RC1-COVERAGE-ADMIN-FINANCE-V2) ---------------------------
   Tres bloques en orden de pregunta: cuánto hay -> cuadra -> qué pasó.
   Sin gráficas: las cifras que se muestran son exactas o no se muestran. */
.caja-block { margin-top: 18px; }
.caja-block > [id] { padding: 0 20px 20px; }

/* Saldo por cuenta: la respuesta a "¿cuánto hay?" */
.caja-accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.caja-account {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff;
}
.caja-account__id { display: grid; gap: 2px; min-width: 0; }
.caja-account__id small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.caja-account__id strong { font-size: 14px; overflow-wrap: anywhere; }
.caja-account__amount { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.caja-manage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.caja-manage-hint { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.caja-manage-card { align-items: flex-start; }
.caja-manage-card.is-inactive { background: var(--surface-soft, #f6f7f8); }
.caja-manage-card .secondary-button { flex: none; }
.caja-manage-status { font-size: 12px; color: var(--muted); }
.caja-manage-card:not(.is-inactive) .caja-manage-status { color: var(--success); }
.caja-accounts__total {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.caja-accounts__total small { color: var(--muted); font-size: 12px; }
.caja-accounts__total strong { font-size: 22px; font-variant-numeric: tabular-nums; }

/* Filtros del historial */
.caja-filters { padding: 0 20px 14px; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field--inline { display: grid; gap: 4px; min-width: 150px; }
.field--inline > span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.field--inline input, .field--inline select {
  height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; font: inherit; font-size: 13px; color: var(--ink);
}

/* Diferencia del corte: nunca solo color — signo, palabra e icono. */
.diff-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.diff-pill svg { width: 13px; height: 13px; }
.diff-pill--ok { color: var(--success); background: var(--success-soft); }
.diff-pill--off { color: var(--warning); background: var(--warning-soft); }
.diff-reason { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; line-height: 1.4; }

/* Movimientos: el signo del tipo se dice con texto, el color solo acompaña. */
.mov-amount { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.mov-amount--entra { color: var(--success); }
.mov-amount--sale { color: var(--brand-dark); }
.mov-amount--neutro { color: var(--ink); }
.evidence-dot { display: inline-flex; align-items: center; gap: 4px; color: var(--success); font-size: 11px; font-weight: 700; }
.evidence-dot svg { width: 12px; height: 12px; }

/* Aviso de página cortada: se dice en voz alta, no se disimula. */
.caja-note--warn {
  padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--warning); font-weight: 600;
}

/* ===================== CIERRE FINANCIERO / DINERO (RC-1) ===================== */
/* Claridad operativa extrema: números grandes, una sola lectura, sin ruido. */

/* --- Modal FINALIZAR ENTREGA --- */
.cierre-order {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
  margin: 4px 0 14px; padding: 14px; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--canvas);
}
.cierre-order > div { min-width: 0; }
.cierre-order small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.cierre-order strong { display: block; margin-top: 3px; color: var(--ink); font-size: 14px; font-weight: 800; word-break: break-word; }
.cierre-order__cod { grid-column: 1 / -1; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.cierre-order__cod.is-cobrar strong { color: var(--success); font-size: 22px; }
.field--tight { margin-top: 8px; }

/* --- Mi dinero: tres números grandes (motorizado) --- */
.money-hero { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.money-hero__tile {
  min-width: 0; padding: 18px 16px; border: 1px solid var(--line);
  border-radius: var(--radius-lg); background: var(--paper); border-top: 4px solid var(--line-strong);
}
.money-hero__tile small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.money-hero__tile strong { display: block; margin: 6px 0 4px; color: var(--ink); font-size: 30px; font-weight: 850; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.money-hero__tile span { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; }
.money-hero__tile--hold { border-top-color: var(--brand); }
.money-hero__tile--owed { border-top-color: var(--success); }
.money-hero__tile--net { border-top-color: var(--route); }

/* --- Historial de entregas (motorizado) --- */
.hist-list { display: flex; flex-direction: column; }
.hist-row { padding: 14px 18px; border-top: 1px solid var(--line); }
.hist-row:first-child { border-top: 0; }
.hist-row__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hist-row__top > strong { color: var(--ink); font-size: 13px; font-weight: 850; letter-spacing: -0.01em; }
.hist-row__date { color: var(--muted); font-size: 11px; }
.hist-row__top .cuadre-pill { margin-left: auto; }
.hist-row__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; margin-top: 10px; }
.hist-row__grid > div { min-width: 0; }
.hist-row__grid small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.hist-row__grid b { display: block; margin-top: 2px; color: var(--ink); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; word-break: break-word; }

/* --- Estado de cuadre (pastilla) --- */
.cuadre-pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.cuadre-pill.is-ok { color: var(--success); background: var(--success-soft); }
.cuadre-pill.is-warn { color: var(--warning); background: var(--warning-soft); }
.cuadre-pill.is-muted { color: var(--muted); background: var(--canvas); }
/* Cobro directo: el cliente recibió el recaudo; se distingue del cuadre normal. */
.cuadre-pill.is-directo { color: var(--route); background: var(--route-soft); }

/* --- Estado de cuenta del cliente empresa --- */
.money-statement {
  margin-bottom: 16px; padding: 18px 20px; border: 1px solid var(--line);
  border-radius: var(--radius-lg); background: var(--paper);
}
.money-statement__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.money-statement__head svg { width: 20px; height: 20px; color: var(--brand); }
.money-statement__head h3 { margin: 0; font-size: 14px; }
.money-statement__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; }
.money-statement__row span { color: var(--muted); font-size: 13px; }
.money-statement__row b { color: var(--ink); font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.money-statement__row--neg b { color: var(--muted); }
.money-statement__row--total { margin-top: 4px; padding-top: 12px; border-top: 2px solid var(--line-strong); }
.money-statement__row--total span { color: var(--ink); font-size: 14px; font-weight: 800; }
.money-statement__row--total b { color: var(--success); font-size: 26px; letter-spacing: -0.02em; }
.money-statement__note { margin: 8px 0 0; color: var(--muted); font-size: 11px; }

/* --- Bloque de dinero en el detalle del pedido --- */
.order-money {
  margin: 14px 0; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--canvas);
}
.order-money__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.order-money__head svg { width: 16px; height: 16px; color: var(--brand); }
.order-money__head h3 { margin: 0; font-size: 13px; }
.order-money__head .cuadre-pill { margin-left: auto; }
.order-money__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.order-money__grid > div { min-width: 0; }
.order-money__grid small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.order-money__grid strong { display: block; margin-top: 2px; color: var(--ink); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; word-break: break-word; }

/* CIERRE 3 — Vista previa de la guía dentro del modal. */
.guia-preview { margin: 6px 0 14px; }
.guia-preview .shipping-label { max-width: 420px; margin: 0 auto; }
.guia-preview-format { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.guia-format-chip { flex: 1 1 160px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); cursor: pointer; font-size: 12px; font-weight: 700; color: var(--ink); }
.guia-format-chip input { accent-color: var(--brand); }
.guia-format-chip:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.guia-format-chip:focus-within { outline: 2px solid var(--brand); outline-offset: 1px; }
.modal-actions--guia { display: flex; flex-wrap: wrap; gap: 10px; }
.modal-actions--guia .secondary-button,
.modal-actions--guia .primary-button { flex: 1 1 auto; min-height: 44px; justify-content: center; }
@media (max-width: 480px) {
  .modal-actions--guia .primary-button,
  .modal-actions--guia .secondary-button { flex-basis: 100%; }
}

@media (max-width: 720px) {
  .money-hero { grid-template-columns: 1fr; gap: 10px; }
  .money-hero__tile { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 12px; padding: 15px 16px; }
  .money-hero__tile small { grid-column: 1; }
  .money-hero__tile strong { grid-column: 2; grid-row: 1 / 3; margin: 0; font-size: 26px; }
  .money-hero__tile span { grid-column: 1; }
  .hist-row__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cierre-order__cod.is-cobrar strong { font-size: 20px; }
}

@media (max-width: 760px) {
  .caja-block > [id] { padding: 0 14px 16px; }
  .caja-filters { padding: 0 14px 12px; }
  .field--inline { min-width: 0; flex: 1 1 140px; }
  .caja-accounts { grid-template-columns: 1fr; }
  .caja-manage-grid { grid-template-columns: 1fr; }
  .caja-account__amount { font-size: 17px; }
  .caja-accounts__total strong { font-size: 20px; }
}


/* ============================================================================
   DINERO — Admin / Superadmin / Finanzas (claridad financiera extrema)
   La cifra manda: etiqueta en mayúsculas pequeñas arriba, valor grande en el
   medio, y debajo la frase que explica por qué es esa cifra. El color nunca
   es el único portador del significado (siempre hay palabra).
   ========================================================================== */
.dinero-hero {
  display: grid; gap: 14px; padding: 0 20px 18px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.dinero-hero--modal { padding: 0 0 4px; grid-template-columns: 1fr; }

.dinero-card {
  display: grid; gap: 6px; align-content: start;
  padding: 18px 18px 16px; border-radius: var(--radius-md);
  border: 1px solid var(--line); background: #fff;
  border-left: 5px solid var(--line-strong);
}
.dinero-card small {
  color: var(--muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; line-height: 1.3;
}
.dinero-card strong {
  font-size: 30px; line-height: 1.05; font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.dinero-card span { color: var(--muted); font-size: 12.5px; line-height: 1.4; }

.dinero-card--debemos { border-left-color: var(--brand); background: var(--brand-soft); }
.dinero-card--debemos strong { color: var(--brand-dark); }
.dinero-card--nos-deben { border-left-color: var(--route); background: var(--route-soft); }
.dinero-card--nos-deben strong { color: var(--route); }
.dinero-card--ok { border-left-color: var(--success); background: var(--success-soft); }
.dinero-card--ok strong { color: var(--success); }
.dinero-card--alerta { border-left-color: var(--warning); background: var(--warning-soft); }
.dinero-card--alerta strong { color: var(--warning); }

/* Frase de cierre: la lectura de 3 segundos, en una sola línea. */
.dinero-frase {
  margin: 0; padding: 0 20px 18px;
  font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--ink);
}
.dinero-frase--sub { font-weight: 500; color: var(--ink-soft); }

/* Cadena "de dónde sale": los eslabones y el signo entre ellos, para que nadie
   tenga que hacer la resta de cabeza. */
.dinero-chain {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px;
  padding: 0 20px 14px;
}
.dinero-chain__op {
  align-self: center; color: var(--muted); font-size: 20px; font-weight: 700; line-height: 1;
}
.dinero-chain__item {
  display: grid; gap: 4px; flex: 1 1 150px; min-width: 0;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}
.dinero-chain__item small {
  color: var(--muted); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; line-height: 1.3;
}
.dinero-chain__item strong { font-size: 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dinero-chain__item.is-total { border-color: var(--ink); background: var(--canvas); }
.dinero-chain__item.is-total strong { font-size: 21px; }

.dinero-cell { font-variant-numeric: tabular-nums; }
.dinero-cell--debemos { color: var(--brand-dark); }

.dinero-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 20px 18px; }

/* Estado de cuadre: siempre con palabra, el color solo refuerza. */
.cuadre-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.cuadre-pill--ok { color: var(--success); background: var(--success-soft); border-color: rgba(24, 130, 75, .3); }
.cuadre-pill--warn { color: var(--warning); background: var(--warning-soft); border-color: rgba(154, 97, 16, .3); }
.cuadre-pill--mute { color: var(--muted); background: var(--canvas); }

@media (max-width: 720px) {
  .dinero-hero { grid-template-columns: 1fr; padding: 0 16px 16px; }
  .dinero-card strong { font-size: 26px; }
  .dinero-frase { padding: 0 16px 16px; font-size: 14px; }
  .dinero-chain { padding: 0 16px 14px; }
  .dinero-chain__item { flex: 1 1 100%; }
  .dinero-chain__op { align-self: flex-start; }
  .dinero-actions { padding: 0 16px 16px; }
  .dinero-actions > button { flex: 1 1 100%; }
}

/* ============================================================================
   CIERRE QA — VISOR DE EVIDENCIAS + RESPONSIVE ESCALA DE TEXTO (v2.38.3)
   Solo CSS/UI. Sin backend, RPC ni lógica de negocio.
   ============================================================================ */

/* --- Bug 1: Visor de evidencia — imagen completa sin recorte --------------------
   Causa raíz: sin esta regla el <img class="evidencia-foto"> renderizaba a su
   tamaño natural (ej: 1920×1080 px), desbordando el modal horizontal y
   verticalmente. La foto ahora se escala para caber entera, sin distorsión.
   No se usa overflow:hidden ni librería de zoom. */
.evidencia-foto {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 60vh;
  max-height: 60svh;
  margin: 8px auto 0;
}

/* En el sheet modal móvil (max-height: 88svh) el encabezado y el botón
   consumen ~140px, así que la foto puede usar hasta 52svh cómodamente. */
@media (max-width: 700px) {
  .evidencia-foto { max-height: 52svh; }
}

/* --- Bug 2: Escala de texto A+ — contención horizontal en contenedores flex ----
   Con zoom > 1 el ancho efectivo de la ventana se reduce proporcionalmente.
   Las filas de botones sin flex-wrap y los textos sin overflow-wrap pueden
   salirse de su contenedor y quedar recortados por overflow:hidden del body.
   Corrección mínima: wrapping en modal-actions y overflow-wrap en textos largos. */
.modal-actions {
  flex-wrap: wrap;
}
.novedad-sheet__actions-row {
  flex-wrap: wrap;
}

/* Números COP y nombres largos deben partir línea antes de salir del borde */
.modal-heading h2,
.stop-row__info strong,
.warehouse-kpis strong {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* En zoom A+ (≤480px, scale 1.09) el ancho efectivo baja a ~293px en 320px.
   La cabecera del modal en fila ya tenía flex-wrap en ≤420px; extendemos el
   umbral para cubrir el rango 421-500px con zoom alto. */
@media (max-width: 500px) {
  .modal-heading--row { align-items: flex-start; flex-wrap: wrap; }
  .modal-heading--row .status-pill { margin-left: 56px; }
}

/* ============================================================================
   CIERRE QA — NOVEDADES RESPONSIVE CON A+ (v2.38.4)
   Solo CSS/UI. Sin backend, RPC ni lógica de negocio.
   ============================================================================ */

/* --- Bug: Modal sheet desborda ancho en A+ ----------------------------------------
   Causa raíz: el sheet móvil usa `width: 100vw; max-width: 100vw` (línea 4927).
   Con `body { zoom: var(--ui-scale, 1) }` ese valor de 100vw se multiplica por
   el zoom en pantalla: 320px × 1.09 = 349px → desbordamiento de 29px.
   El cierre queda en right=336px, el contenido en right=323px — todo fuera del
   viewport de 320px.

   Fix: en móvil, dividir 100vw entre --ui-scale para que el modal renderice
   exactamente 100vw en pantalla independientemente del zoom:
     CSS width = 320px / 1.09 ≈ 293.6px  →  pantalla = 293.6 × 1.09 = 320px ✓
   Con scale = 1 (A normal): 320 / 1 = 320px — sin cambio ✓
   Con scale = 0.92 (A-): 320 / 0.92 = 347.8px → 347.8 × 0.92 = 320px ✓        */
@media (max-width: 700px) {
  .modal {
    width: calc(100vw / var(--ui-scale, 1));
    max-width: calc(100vw / var(--ui-scale, 1));
  }
}

/* ── Novedades · Validación de evidencias EXTREMADAMENTE clara (v2.38.5) ──────
   Reutiliza el lenguaje visual existente: rojo (--brand) = falta / error,
   verde (--success, ya aplicado por .has-evidence) = correcto. No inventa
   colores nuevos. Todo se lee en <2 s: qué pasó (banner), qué falta (tarjetas
   rojas), qué hago (subir la prueba marcada).                                  */

/* Alerta principal: banner rojo prominente dentro del formulario. No es un toast
   chico; ocupa el ancho y salta a la vista al tocar "Registrar novedad". */
.novedad-evd-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border: 1.5px solid var(--brand);
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.novedad-evd-alert[hidden] { display: none; }
.novedad-evd-alert__icon {
  display: inline-flex;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--brand);
}
.novedad-evd-alert__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.novedad-evd-alert__body strong {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}
.novedad-evd-alert__body small {
  font-size: 12px;
  line-height: 1.35;
  color: var(--brand-dark);
}

/* Tarjeta de evidencia que falta: borde rojo + fondo muy suave + aviso "Falta
   esta evidencia". Las ya cargadas conservan su verde (.has-evidence) y NO se
   marcan. is-missing gana sobre el fondo blanco base de la tarjeta. */
.evidence-upload--novedad.is-missing {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.evidence-upload--novedad.is-missing .evidence-upload__icon {
  color: var(--brand-dark);
}
.evidence-upload__missing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 100%;
  margin-top: 2px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}
.evidence-upload__missing[hidden] { display: none; }
.evidence-upload__missing svg { flex: 0 0 auto; }

/* Mi dinero de Tienda: resumen breve y tarjetas legibles antes del corte móvil global. */
.store-money__verdict { margin: 0; padding: 18px 20px 12px; font-size: clamp(20px, 2.4vw, 28px); font-weight: 800; line-height: 1.2; }
.store-money__summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0 20px 20px; }
.store-money__more { margin: 0 20px 20px; min-height: 44px; }
.money-statement__cta { margin-top: 12px; }
@media (max-width: 900px) {
  .store-money .table-wrap { overflow: visible; }
  .store-money .table-cards, .store-money .table-cards tbody { display: block; width: 100%; white-space: normal; }
  .store-money .table-cards thead { display: none; }
  .store-money .table-cards tr { display: block; margin: 0 0 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
  .store-money .table-cards td { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border: 0; text-align: right; overflow-wrap: anywhere; }
  .store-money .table-cards td::before { content: attr(data-label); flex: 0 0 42%; color: var(--muted); font-size: 11px; font-weight: 700; text-align: left; text-transform: uppercase; }
  .store-money .table-cards td.cell-title, .store-money .table-cards td.row-actions { justify-content: flex-start; text-align: left; }
  .store-money .table-cards td.cell-title::before, .store-money .table-cards td.row-actions::before { content: ""; flex: 0 0 0; }
  .store-money .table-cards td.row-actions .text-link { min-height: 44px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; }
  .store-money__summary { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .store-money__verdict { padding: 16px 16px 10px; }
  .store-money__summary { padding: 0 16px 16px; }
}

/* ============================================================
   MARCO DE PEDIDO — punto único (v2.38.14)
   Un bloque que representa UN pedido lleva la clase `order-card`
   (tarjeta) u `order-row` (fila de una lista). Para cambiar cómo se
   separa un pedido del siguiente, se ajustan SOLO estos tokens.
   Neutro a propósito: rojo/verde/azul/ámbar quedan para estado,
   alerta y acción. No se aplica a KPIs, Caja, cuentas ni modales.
   ============================================================ */
:root {
  --order-frame-color: var(--line-strong);
  --order-frame-width: 2px;
  --order-divider-width: 1px;
  --order-frame: var(--order-frame-width) solid var(--order-frame-color);
  --order-divider: var(--order-divider-width) solid var(--order-frame-color);
}

/* :where() deja la especificidad baja: estados como .stop-row.is-dragging
   siguen pudiendo cambiar el color del borde. */
:where(.main-content) .order-card:not(tr) { border: var(--order-frame); }
.main-content .order-row { border-bottom: var(--order-divider); }
.main-content .order-row:last-child { border-bottom: 0; }

@media (max-width: 760px) {
  :root { --order-divider-width: 2px; }
  /* En móvil las tablas de pedidos se apilan como tarjetas; en escritorio
     siguen siendo tabla y conservan su densidad. */
  :where(.main-content) tr.order-card { border: var(--order-frame); }
}
@media (max-width: 900px) {
  .main-content .store-money tr.order-card { border: var(--order-frame); }
}

/* ============================================================
   BARRA INFERIOR MÓVIL — siempre una sola fila (v2.38.14)
   Las columnas salen del número real de accesos del rol (+ "Más"),
   no de un repeat() fijo: un acceso extra ya no baja a otra fila.
   ============================================================ */
@media (max-width: 760px) {
  .mobile-nav {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    column-gap: 4px;
  }
  .mobile-nav__item { min-width: 0; }
  .mobile-nav__item small {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* Sección activa: color + barra superior + peso, no solo color. */
  .mobile-nav__item.is-active { font-weight: 800; }
  .mobile-nav__item.is-active::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 26%;
    right: 26%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--brand);
  }
  .mobile-nav__item:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: var(--radius-sm); }
}

/* ============================================================
   MI DINERO (Tienda) — un solo margen interior (v2.38.14)
   Cada bloque interno ya trae su margen (20px; 16px en móvil). El
   padding genérico de .surface se sumaba y descuadraba las notas.
   ============================================================ */
.store-money .caja-block { padding: 0; overflow: hidden; }
.store-money .caja-block > .caja-note { margin: 0 20px 16px; }
/* El botón vive dentro del contenedor con id, que ya aporta el margen. */
.store-money [id] > .store-money__more { margin: 12px 0 0; }
.store-money .caja-block > .table-wrap { padding: 0 20px 8px; }
@media (max-width: 900px) {
  /* Tarjeta: la etiqueta toma el espacio libre y la cifra nunca se parte;
     un ::before vacío no debe sumar el gap y correr título y acción. */
  .store-money .table-cards td { overflow-wrap: normal; }
  /* La etiqueta nunca baja de un tercio: un valor largo se ajusta en líneas
     en vez de montarse sobre ella. */
  .store-money .table-cards td::before { flex: 1 0 34%; }
  .store-money .table-cards td.cell-title::before,
  .store-money .table-cards td.row-actions::before { display: none; }
}
@media (max-width: 480px) {
  .store-money .caja-block > .caja-note { margin-inline: 16px; }
  .store-money .caja-block > .table-wrap { padding-inline: 16px; }
  .store-money .caja-block > [id] { padding: 0 16px 16px; }
  .store-money .surface__head--padded { padding-inline: 16px; }
  .store-money .store-money__more { width: 100%; }
}

/* ============================================================
   CUENTAS — una puerta, dos vistas (v2.38.16)
   Pestañas Tiendas | Motorizados sobre el lienzo de la página: se
   reusa .filter-pills con un marco propio para que se lean como
   navegación y no como filtro. Activo = fondo tinta + texto.
   ============================================================ */
.cuentas-tabs {
  display: inline-flex;
  max-width: 100%;
  margin: 0 0 16px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.cuentas-tabs .filter-pill {
  min-height: 40px;
  padding: 8px 18px;
  font-size: 13px;
}
.cuentas-tabs .filter-pill.is-active {
  color: var(--paper);
  background: var(--ink);
  box-shadow: none;
}
.cuentas-tabs .filter-pill:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 760px) {
  /* Tarjeta de fila: el título con avatar (Tiendas, Motorizados, Usuarios)
     se lee a la izquierda, como ya ocurre con .cell-stack. */
  .table-cards td.cell-title .person-cell > span { text-align: left; }
  /* Un ::before vacío sigue sumando el gap: título y acciones se corrían
     respecto a las etiquetas y a la segunda fila de botones. */
  .table-cards td.cell-title::before,
  .table-cards td.row-actions::before { display: none; }
}

/* ==========================================================================
   Caja por período (v2.38.18) — prefijo cj- propio para no chocar con reglas
   antiguas de Caja. Jerarquía: resultado → tendencia → recaudo → cierre →
   pedidos → movimientos. Sin sombras decorativas; el color solo dice algo.
   ========================================================================== */
.cj-acciones { flex-wrap: wrap; justify-content: flex-end; }

.cj-periodo { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 18px; padding: 14px 16px; }
.cj-periodo__presets { display: flex; flex-wrap: wrap; gap: 6px; }
.cj-preset { min-height: 38px; padding: 0 14px; color: var(--ink-soft); background: var(--canvas); border: 1px solid transparent; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background 150ms ease, color 150ms ease; }
.cj-preset:hover { background: #e9e9e6; }
.cj-preset.is-active { color: #fff; background: var(--ink); }
.cj-periodo__label { margin: 0; justify-self: end; color: var(--ink); font-size: 15px; font-weight: 750; letter-spacing: -0.01em; text-align: right; }
.cj-periodo__label::first-letter { text-transform: uppercase; }
.cj-periodo__fechas { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; grid-column: 1 / -1; }
.cj-periodo__fechas[hidden] { display: none; }
.cj-fecha { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.cj-fecha input { min-height: 40px; padding: 0 10px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 14px; text-transform: none; }
.cj-fecha__ayuda { color: var(--muted); font-size: 12px; padding-bottom: 10px; }
.cj-periodo__error { grid-column: 1 / -1; margin: 0; }

.cj-resultado { margin-top: 18px; }
.cj-ecuacion { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1.25fr); align-items: stretch; gap: 10px; }
.cj-termino { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); }
.cj-termino small { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.cj-termino strong { margin: 8px 0 4px; font-size: clamp(20px, 2vw, 26px); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; white-space: nowrap; }
.cj-termino span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.cj-signo { align-self: center; color: var(--muted-light); font-size: 22px; font-style: normal; font-weight: 700; text-align: center; }
.cj-termino--utilidad { color: #fff; background: var(--ink); border-color: var(--ink); }
.cj-termino--utilidad small, .cj-termino--utilidad span { color: #c9c9c5; }
.cj-termino--utilidad strong { color: #fff; font-size: clamp(26px, 2.6vw, 36px); }
.cj-termino--utilidad.is-perdida { background: var(--brand-dark); border-color: var(--brand-dark); }
.cj-termino--utilidad.is-perdida small, .cj-termino--utilidad.is-perdida span { color: #ffd9dc; }
.cj-nota { margin: 10px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.cj-fila { display: grid; gap: 18px; margin-top: 18px; align-items: start; }
.cj-fila--analisis { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.cj-fila--cierre { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.cj-fila > .caja-block { margin-top: 0; height: 100%; }
.cj-head { align-items: flex-start; flex-wrap: wrap; }
.cj-head h3 { margin: 0; }
.cj-head p:not(.section-kicker) { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }

.cj-toggle { display: inline-flex; padding: 3px; background: var(--canvas); border-radius: 999px; }
.cj-toggle button { min-height: 32px; padding: 0 14px; color: var(--muted); background: transparent; border: 0; border-radius: 999px; font-size: 12.5px; font-weight: 750; cursor: pointer; }
.cj-toggle button.is-active { color: var(--ink); background: #fff; box-shadow: 0 1px 2px rgba(17, 17, 17, .12); }

.cj-chart__leyenda { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 700; }
.cj-chart__leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.cj-chart__leyenda i { width: 10px; height: 10px; border-radius: 3px; }
.cj-chart__leyenda .is-fletes { background: #b9bab6; }
.cj-chart__leyenda .is-utilidad { background: var(--success); }
.cj-chart__leyenda b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.cj-chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; height: 210px; }
.cj-chart__col { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 6px; min-width: 0; }
.cj-chart__plot { display: flex; flex-direction: column; min-height: 0; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0, transparent 49px, #f1f1ef 50px); }
.cj-chart__pos { display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.cj-chart__neg { display: flex; align-items: flex-start; justify-content: center; gap: 4px; border-top: 1px solid var(--line-strong); }
.cj-chart__bar { display: block; width: min(14px, 36%); border-radius: 4px 4px 0 0; }
.cj-chart__neg .cj-chart__bar { border-radius: 0 0 4px 4px; }
.cj-chart__bar--fletes { background: #b9bab6; }
.cj-chart__bar--utilidad { background: var(--success); }
.cj-chart__bar--perdida { background: #d92d20; }
.cj-chart__bar--ghost { height: 0; }
.cj-chart__col small { overflow: hidden; color: var(--muted); font-size: 11px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.cj-chart__col.is-actual small { color: var(--ink); font-weight: 800; }
.cj-chart__col.is-actual .cj-chart__plot { background-color: #fafaf8; }
.cj-chart-vacio { display: grid; place-items: center; align-content: center; gap: 4px; min-height: 180px; padding: 16px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-md); }
.cj-chart-vacio p { margin: 0; color: var(--ink-soft); font-weight: 700; }

.cj-recaudo-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cj-recaudo-total small { color: var(--muted); font-size: 12px; font-weight: 700; }
.cj-recaudo-total strong { font-size: 24px; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.cj-medios { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
.cj-medio-fila { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-rows: auto 4px; align-items: center; column-gap: 12px; row-gap: 6px; padding: 8px 0; }
.cj-medio-fila.is-vacio { opacity: .5; }
.cj-medio-fila__nombre strong, .cj-medio-fila__valor strong { display: block; font-size: 14px; }
.cj-medio-fila__nombre small, .cj-medio-fila__valor small { display: block; color: var(--muted); font-size: 11.5px; }
.cj-medio-fila__valor { text-align: right; font-variant-numeric: tabular-nums; }
.cj-medio-fila__barra { grid-column: 2 / -1; height: 4px; overflow: hidden; background: var(--canvas); border-radius: 999px; }
.cj-medio-fila__barra i { display: block; height: 100%; background: var(--ink-soft); border-radius: inherit; }

.cj-medio { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; color: #fff; border-radius: 10px; font-size: 16px; font-weight: 900; letter-spacing: -0.04em; }
.cj-medio svg { width: 18px; height: 18px; stroke: currentColor; }
.cj-medio--efectivo { background: var(--success); }
.cj-medio--nequi { color: #ff2d8a; background: #200020; }
.cj-medio--daviplata { background: #e4002b; }
.cj-medio--llave { background: #0f5d63; }
.cj-medio--transferencia { background: var(--route); }
.cj-medio-inline { display: inline-flex; align-items: center; gap: 8px; }
.cj-medio-inline .cj-medio { width: 24px; height: 24px; border-radius: 7px; font-size: 12px; }
.cj-medio-inline .cj-medio svg { width: 14px; height: 14px; }

.cj-cierre-estado { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.cj-cierre-estado p { flex: 1 1 240px; margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.cj-estado { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.cj-estado svg { width: 14px; height: 14px; }
.cj-estado--cerrado { color: var(--success); background: var(--success-soft); }
.cj-estado--abierto { color: var(--route); background: var(--route-soft); }
.cj-estado--sin { color: var(--warning); background: var(--warning-soft); }
.cj-cerrar-dia { margin-left: auto; }

.cj-tabla .cj-num { text-align: right; font-variant-numeric: tabular-nums; }
.cj-tabla .cell-title small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 500; white-space: normal; }
.cj-tabla .cj-motivo { font-style: italic; }
.cj-tabla .cj-actor { display: block; color: var(--muted); font-size: 12px; }
.cj-ver { min-height: 36px; padding: 6px 12px; font-size: 12.5px; }

.cj-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 14px; }
.cj-pager__info { margin: 0; color: var(--muted); font-size: 12.5px; }
.cj-pager__info b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cj-pager__nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.cj-pager__num, .cj-pager__step { min-width: 36px; min-height: 36px; padding: 0 10px; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.cj-pager__num:hover, .cj-pager__step:hover:not(:disabled) { border-color: var(--ink); }
.cj-pager__num.is-active { color: #fff; background: var(--ink); border-color: var(--ink); }
.cj-pager__step:disabled { color: var(--muted-light); cursor: default; }
.cj-pager__gap { padding: 0 4px; color: var(--muted); }
.cj-pager__pos { display: none; }
.cj-cuando { display: inline-grid; gap: 2px; }

.cj-filtros { padding-top: 0; }
.cj-fuera { margin-top: 18px; padding: 16px 0 0; border-top: 1px solid var(--line); }
.cj-fuera p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.cj-fuera .dinero-actions { padding: 0; }

@media (max-width: 1180px) {
  .cj-ecuacion { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cj-signo { display: none; }
  .cj-termino--utilidad { grid-column: 1 / -1; order: -1; }
  .cj-termino small[data-signo]::before { content: attr(data-signo) " "; }
}
@media (max-width: 1080px) {
  .cj-fila--analisis, .cj-fila--cierre { grid-template-columns: minmax(0, 1fr); }
  .cj-periodo { grid-template-columns: minmax(0, 1fr); }
  .cj-periodo__label { justify-self: start; text-align: left; }
}
@media (max-width: 760px) {
  .cj-acciones { width: 100%; display: grid; grid-template-columns: 1fr; }
  .cj-acciones .primary-button { order: -1; }
  /* Los cinco accesos siempre visibles (el activo nunca queda fuera de pantalla). */
  .cj-preset { flex: 1 1 auto; min-height: 44px; padding: 0 12px; }
  .cj-periodo__fechas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cj-fecha__ayuda { grid-column: 1 / -1; padding: 0; }
  .cj-fecha input { width: 100%; min-width: 0; min-height: 44px; }
  .cj-ecuacion { grid-template-columns: minmax(0, 1fr); gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
  .cj-termino { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; padding: 12px 16px; border: 0; border-radius: 0; border-top: 1px solid var(--line); }
  .cj-termino strong { margin: 0; font-size: 18px; }
  .cj-termino span { flex-basis: 100%; }
  .cj-termino--utilidad { flex-direction: column; align-items: flex-start; padding: 18px 16px; border-top: 0; }
  .cj-termino--utilidad span { flex-basis: auto; }
  .cj-termino--utilidad strong { margin: 6px 0 2px; font-size: 32px; }
  .cj-chart { height: 170px; gap: 3px; }
  .cj-chart__col small { font-size: 10px; }
  .cj-chart__leyenda b { flex-basis: 100%; margin-left: 0; }
  .cj-pager { flex-direction: column; align-items: stretch; }
  /* En celular: ‹ Anterior · Página 2 de 4 · Siguiente › en una sola fila. */
  .cj-pager__nav { flex-wrap: nowrap; justify-content: space-between; }
  .cj-pager__num, .cj-pager__gap { display: none; }
  .cj-pager__pos { display: block; color: var(--ink-soft); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .cj-pager__step { min-height: 44px; min-width: 44px; }
  /* La tarjeta apila título, tipo y motivo en vez de apretarlos en columnas. */
  .cj-tabla td.cell-title { flex-direction: column; align-items: flex-start; gap: 2px; }
  .cj-cuando { justify-items: end; text-align: right; }
  .cj-cerrar-dia { width: 100%; margin-left: 0; }
  /* Tarjeta compacta de Caja: 2–3 líneas por pedido o movimiento, no una por dato. */
  .cj-tabla--compacta tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t v" "h m" "f a"; align-items: center; gap: 6px 12px; padding: 12px 14px; margin-bottom: 10px; }
  .cj-tabla--compacta td { display: block; min-width: 0; padding: 0; text-align: left; }
  .cj-tabla--compacta td::before { display: none; }
  .cj-tabla--compacta td.cell-title { grid-area: t; align-self: start; margin: 0; padding: 0; border: 0; font-size: 14px; }
  .cj-tabla--compacta .cj-c-valor { grid-area: v; align-self: start; font-weight: 800; text-align: right; }
  .cj-tabla--compacta .cj-c-hora { grid-area: h; color: var(--muted); font-size: 12.5px; }
  .cj-tabla--compacta .cj-c-medio { grid-area: m; justify-self: end; font-size: 12.5px; }
  .cj-tabla--compacta .cj-c-flete { grid-area: f; color: var(--muted); font-size: 12.5px; }
  .cj-tabla--compacta td.cj-c-flete { text-align: left; }
  .cj-tabla--compacta .cj-c-flete::before { display: inline; content: "Flete "; color: inherit; font-size: inherit; font-weight: 600; letter-spacing: 0; text-transform: none; }
  .cj-tabla--compacta .cj-c-accion { grid-area: a; }
  .cj-tabla--compacta .cj-ver { width: auto; min-height: 44px; }
}

/* ── Comprobantes de cuadre (v2.38.19) ─────────────────────────────────────────
   Documento financiero sobrio: tipografía y aire hacen la jerarquía, no el color.
   Verde solo para "Confirmado"; los números van tabulares y alineados a la
   derecha. Prefijo propio `cq-` para no chocar con tablas de otros módulos.   */

.cq-page { max-width: 920px; margin: 0 auto; padding-bottom: 32px; }
.cq-volver { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 14px; padding: 0 16px 0 12px; color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.cq-volver svg, .cq-ok svg, .cq-estado svg, .cq-nota svg, .cq-mov__cero svg, .cq-vacio-estado svg, .cq-flujo__flecha svg, .cq-fila__tipo svg, .cq-acciones svg, .cq-fila__acciones svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cq-volver svg { width: 18px; height: 18px; }
.cq-volver:hover { border-color: var(--line-strong); }
.cq-volver:focus-visible, .cq-tab:focus-visible, .cq-pager button:focus-visible, .cq-pend summary:focus-visible { outline: 3px solid var(--route); outline-offset: 2px; }

.cq-ok { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; padding: 14px 16px; color: var(--success); background: var(--success-soft); border: 1px solid rgba(24, 130, 75, 0.22); border-radius: var(--radius-md); }
.cq-ok svg { flex: none; width: 22px; height: 22px; margin-top: 1px; }
.cq-ok strong { display: block; font-size: 15px; }
.cq-ok span { color: var(--ink-soft); font-size: 13.5px; }

/* Documento */
.cq-doc { padding: 32px 36px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 1px 2px rgba(17, 17, 17, 0.04); }
.cq-doc__cabeza { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.cq-marca { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cq-marca img { flex: none; width: 48px; height: 48px; object-fit: cover; border: 1px solid var(--line); border-radius: 12px; }
.cq-marca strong { display: block; font-size: 18px; letter-spacing: -0.01em; }
.cq-marca small { display: block; color: var(--muted); font-size: 12.5px; }
.cq-doc__id { text-align: right; }
.cq-doc__id small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.cq-doc__id h2 { margin: 2px 0 0; font-size: 30px; font-weight: 850; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.cq-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; margin: 20px 0 24px; }
.cq-meta div { min-width: 0; }
.cq-meta dt, .cq-mov__datos dt { color: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.cq-meta dd, .cq-mov__datos dd { margin: 4px 0 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.cq-estado { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 12px; color: var(--success); background: var(--success-soft); border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.cq-estado svg { width: 14px; height: 14px; stroke-width: 2.6; }

.cq-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 24px; padding: 22px 24px; background: var(--canvas); border-radius: 14px; }
.cq-hero__frase { grid-column: 1; margin: 0; color: var(--ink-soft); font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }
.cq-hero__valor { grid-column: 2; grid-row: 1 / span 2; margin: 0; color: var(--ink); font-size: 40px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cq-hero__apoyo { grid-column: 1; margin: 0; color: var(--muted); font-size: 13.5px; }

.cq-kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.cq-kicker b { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 8px; color: var(--ink); background: var(--canvas); border-radius: 999px; font-size: 12px; letter-spacing: 0; }

/* Cómo se realizó */
.cq-mov { margin-top: 28px; }
.cq-mov__cabeza { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; margin-bottom: 14px; }
.cq-mov__medio { display: inline-flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 800; }
.cq-mov__medio .cj-medio { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; }
.cq-mov__medio .cj-medio svg { width: 22px; height: 22px; }
.cq-flujo { display: grid; grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr); align-items: stretch; gap: 10px; }
.cq-flujo__parte { min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.cq-flujo__parte strong { display: block; font-size: 15.5px; font-weight: 800; overflow-wrap: anywhere; }
.cq-flujo__parte small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.cq-flujo__flecha { display: grid; place-items: center; color: var(--muted); }
.cq-flujo__flecha svg { width: 22px; height: 22px; }
.cq-mov__datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 14px 0 0; }
.cq-mov__datos dd { font-variant-numeric: tabular-nums; }
.cq-mov__cero { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 14px 16px; color: var(--ink-soft); background: var(--canvas); border-radius: var(--radius-md); font-size: 14px; }
.cq-mov__cero svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--success); }

/* Pedidos */
.cq-bloque { margin-top: 28px; }
.cq-t-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); }
.cq-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.cq-t thead th { padding: 10px 14px; color: var(--muted); background: var(--canvas); font-size: 11.5px; font-weight: 800; letter-spacing: 0.05em; text-align: left; text-transform: uppercase; }
.cq-t tbody th, .cq-t td { padding: 12px 14px; border-bottom: 0; font-weight: 500; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.cq-t tbody th, .cq-t td small { white-space: normal; }
.cq-t tbody th { color: var(--ink); background: transparent; border-bottom: 0; font-size: 14px; letter-spacing: 0; text-transform: none; }
.cq-t tbody th strong { font-size: 14.5px; }
.cq-t__guia strong { display: block; font-weight: 800; overflow-wrap: anywhere; }
.cq-t__guia small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.cq-t .cq-t__num { text-align: right; font-variant-numeric: tabular-nums; }
.cq-t td.cq-t__num > span, .cq-t td.cq-t__num > strong { white-space: nowrap; }
.cq-t td small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 500; }
.cq-t__res strong { font-weight: 850; }
.cq-t__res--fe small { color: var(--ink-soft); }
.cq-vacio { margin: 0; padding: 16px; color: var(--muted); background: var(--canvas); border-radius: var(--radius-md); }

/* Totales */
.cq-sum { max-width: 460px; margin: 0 0 0 auto; }
.cq-sum__fila { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cq-sum__fila dt { color: var(--ink-soft); font-size: 14.5px; }
.cq-sum__fila dt small { display: block; color: var(--muted); font-size: 12.5px; }
.cq-sum__fila dd { margin: 0; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cq-sum__fila--total { margin-top: 2px; padding-top: 14px; border-top: 2px solid var(--ink); border-bottom: 0; }
.cq-sum__fila--total dt { color: var(--ink); font-size: 16px; font-weight: 800; }
.cq-sum__fila--total dd { font-size: 22px; font-weight: 900; }
.cq-nota { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; padding: 10px 12px; color: var(--warning); background: var(--warning-soft); border-radius: 10px; font-size: 13.5px; }
.cq-nota svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }

/* Pendientes: aparte y plegables */
.cq-pend { margin-top: 24px; background: #fcfcfb; border: 1px solid var(--line); border-radius: var(--radius-md); }
.cq-pend summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 16px; font-size: 14px; font-weight: 800; list-style: none; cursor: pointer; border-radius: var(--radius-md); }
.cq-pend summary::-webkit-details-marker { display: none; }
.cq-pend summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 160ms ease; }
.cq-pend[open] summary::after { transform: rotate(-135deg); }
.cq-pend summary b { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 8px; color: var(--warning); background: var(--warning-soft); border-radius: 999px; font-size: 12.5px; }
.cq-pend p { margin: 0 16px 10px; color: var(--muted); font-size: 13.5px; }
.cq-pend ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 20px; margin: 0; padding: 0 16px 14px; list-style: none; }
.cq-pend li { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.cq-pend li strong { overflow-wrap: anywhere; }
.cq-pend li span { flex: none; color: var(--muted); }
.cq-pend__mas { color: var(--muted); }

.cq-traza { margin-top: 28px; padding-top: 16px; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; }
.cq-traza p { margin: 0 0 4px; }
.cq-traza strong { color: var(--ink-soft); }

.cq-acciones { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.cq-acciones button, .cq-fila__acciones button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; }
.cq-acciones svg, .cq-fila__acciones svg { width: 18px; height: 18px; }
.cq-wa { color: #0e6b3b; }
.cq-wa:hover { border-color: #9fd3b3; }

/* Historial */
.cq-filtros { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) auto; align-items: end; gap: 12px; margin-bottom: 16px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); }
.cq-tabs { display: inline-flex; grid-column: 1 / -1; justify-self: start; gap: 4px; max-width: 100%; padding: 4px; background: var(--canvas); border-radius: 12px; }
.cq-tab { min-height: 44px; padding: 0 18px; color: var(--muted); background: transparent; border: 0; border-radius: 9px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.cq-tab.is-active { color: var(--ink); background: var(--paper); box-shadow: 0 1px 2px rgba(17, 17, 17, 0.1); }
.cq-campo { display: grid; gap: 6px; min-width: 0; }
.cq-campo span { color: var(--ink-soft); font-size: 12.5px; font-weight: 700; }
.cq-campo input { width: 100%; min-width: 0; min-height: 44px; padding: 0 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; font-size: 15px; }
.cq-campo input:focus-visible { outline: 3px solid rgba(23, 107, 181, 0.35); border-color: var(--route); }
.cq-filtros__acciones { display: flex; gap: 8px; }
.cq-filtros__acciones button { min-height: 44px; }
.cq-filtros .field-error { grid-column: 1 / -1; margin: 0; }

.cq-lista { margin: 0; padding: 0; overflow: hidden; list-style: none; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); }
.cq-fila { display: grid; grid-template-columns: 40px minmax(0, 1.5fr) minmax(0, 0.8fr) auto; align-items: center; gap: 12px 16px; padding: 14px 16px; border-top: 1px solid var(--line); }
.cq-fila:first-child { border-top: 0; }
.cq-fila__tipo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; }
.cq-fila__tipo svg { width: 20px; height: 20px; }
.cq-fila__tipo--tienda { color: var(--route); background: var(--route-soft); }
.cq-fila__tipo--motorizado { color: var(--ink-soft); background: var(--canvas); }
.cq-fila__id { display: grid; gap: 1px; min-width: 0; }
.cq-fila__num { color: var(--muted); font-size: 12.5px; font-weight: 800; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.cq-fila__id strong { font-size: 15.5px; font-weight: 800; overflow-wrap: anywhere; }
.cq-fila__id small { color: var(--muted); font-size: 13px; }
.cq-fila__valor { text-align: right; }
.cq-fila__valor strong { display: block; font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cq-fila__valor small { color: var(--muted); font-size: 12.5px; }
.cq-fila__acciones { display: flex; gap: 8px; }
.cq-fila__acciones button { min-height: 44px; padding: 0 14px; }

.cq-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 14px; }
.cq-pager__info { margin: 0; color: var(--muted); font-size: 13px; }
.cq-pager__info b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cq-pager__nav { display: flex; align-items: center; gap: 8px; }
.cq-pager__nav span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.cq-pager__nav button { min-width: 44px; min-height: 44px; padding: 0 14px; color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.cq-pager__nav button:disabled { cursor: default; opacity: 0.45; }

.cq-vacio-estado { padding: 40px 20px; text-align: center; background: var(--paper); border: 1px dashed var(--line-strong); border-radius: var(--radius-md); }
.cq-vacio-estado svg { width: 36px; height: 36px; color: var(--muted); }
.cq-vacio-estado h3 { margin: 10px 0 6px; font-size: 18px; }
.cq-vacio-estado p { max-width: 440px; margin: 0 auto 14px; color: var(--muted); }
.cq-vacio-estado button { min-height: 44px; }

/* Revisión antes de confirmar (modal ancho, acciones siempre visibles) */
.modal:has(.cq-rev) { width: min(800px, 100%); }
.cq-rev .modal-heading { margin-bottom: 16px; }
.cq-rev .modal-heading h2 { overflow-wrap: anywhere; }
.cq-rev__sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.cq-rev .cq-hero { margin-bottom: 8px; }
.cq-rev .cq-hero__valor { font-size: 34px; }
.cq-rev .cq-sum { max-width: none; margin: 0 0 20px; }
.cq-rev__pedidos .cq-t-wrap { max-height: 340px; overflow: auto; }
.cq-rev__pedidos .cq-t thead th { position: sticky; top: 0; z-index: 1; }
.cq-rev .cq-pend { margin-top: 16px; }
.cq-rev .modal-form { margin-top: 20px; }
.cq-rev__acciones { position: sticky; bottom: -28px; z-index: 2; margin: 20px -28px -28px; padding: 14px 28px; background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--line); }
.cq-rev__acciones .primary-button { min-height: 48px; }

/* M2 · Cuadre del Motorizado: dos saldos separados, modalidad, cuentas. */
.m2-saldos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.m2-saldos div { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--canvas); }
.m2-saldos dt { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.m2-saldos dd { margin: 4px 0 0; font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.m2-form { display: grid; gap: 14px; }
.m2-modos { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.m2-cuentas { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.m2-cuentas .field-legend { margin: 0 0 4px; padding: 0; color: var(--ink); font-size: 13px; font-weight: 700; }
.m2-cuentas__filas { display: grid; gap: 10px; }
.m2-fila { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 8px 10px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.m2-fila .field { margin: 0; min-width: 0; }
.m2-fila__soporte { grid-column: 1 / -1; }
.m2-fila__quitar { align-self: center; min-height: 44px; }
.m2-cuentas__pie { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.m2-suma { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.m2-suma--ok { color: var(--success); }
.m2-suma--warn { color: var(--warning); }
.m2-usadas { margin-top: 14px; }
.m2-usadas ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.m2-usadas li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.m2-usadas li strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cq-sum__fila--pendiente dd { color: var(--warning); }
.cq-meta dd small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }

@media (max-width: 559px) {
  .m2-saldos { grid-template-columns: minmax(0, 1fr); }
  .m2-fila { grid-template-columns: minmax(0, 1fr); }
  .m2-fila__quitar { justify-self: start; }
  .m2-cuentas__pie { flex-direction: column; align-items: stretch; }
}

@media (max-width: 900px) {
  .cq-fila { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .cq-fila__acciones { grid-column: 1 / -1; }
  .cq-fila__acciones button { flex: 1 1 0; }
}

@media (max-width: 980px) {
  .cq-filtros { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cq-campo--buscar, .cq-filtros__acciones { grid-column: 1 / -1; }
  .cq-filtros__acciones button { flex: 1 1 0; }
}

@media (max-width: 760px) {
  .cq-filtros { padding: 12px; gap: 10px; }
  .cq-campo input[type="date"] { padding: 0 8px; font-size: 14px; }
  .cq-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-self: stretch; }
  .cq-tab { padding: 0 8px; }
}

@media (max-width: 860px) {
  /* La tabla se vuelve tarjetas: guía arriba, cifras en dos columnas y el
     resultado de la fila al final, destacado. */
  .cq-t-wrap { overflow: visible; border: 0; border-radius: 0; }
  .cq-t thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cq-t, .cq-t tbody { display: block; width: 100%; }
  .cq-t tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin-bottom: 10px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); }
  .cq-t tbody th { display: flex; flex-wrap: wrap; grid-column: 1 / -1; align-items: baseline; justify-content: space-between; gap: 2px 10px; padding: 0; border: 0; }
  .cq-t tbody th small { margin: 0; }
  .cq-t td { display: block; min-width: 0; padding: 0; border: 0; }
  .cq-t .cq-t__num { text-align: left; }
  .cq-t td::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
  .cq-t td.cq-t__res { display: flex; flex-wrap: wrap; grid-column: 1 / -1; align-items: baseline; justify-content: space-between; gap: 0 12px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
  .cq-t td.cq-t__res::before { margin: 0; }
  .cq-t td.cq-t__res strong { font-size: 17px; }
  .cq-t td.cq-t__res small { flex-basis: 100%; text-align: right; }
  .cq-rev__pedidos .cq-t-wrap { max-height: none; }
}

@media (max-width: 720px) {
  .cq-doc { display: flex; flex-direction: column; padding: 20px 16px; border-radius: 14px; }
  /* Móvil: primero qué pasó y cuánto; después el detalle. */
  .cq-doc > * { order: 3; }
  .cq-doc > .cq-doc__cabeza { order: 0; }
  .cq-doc > .cq-hero { order: 1; margin-top: 16px; }
  .cq-doc > .cq-meta { order: 2; }
  .cq-doc__id h2 { font-size: 24px; }
  .cq-meta { grid-template-columns: 1fr 1fr; gap: 14px 16px; }
  .cq-hero { grid-template-columns: 1fr; padding: 18px; }
  .cq-hero__valor { grid-column: 1; grid-row: auto; margin-top: 4px; font-size: 36px; }
  .cq-flujo { grid-template-columns: 1fr; }
  .cq-flujo__flecha { height: 24px; transform: rotate(90deg); }
  .cq-sum { max-width: none; }
  .cq-acciones { display: grid; grid-template-columns: 1fr; }

  .cq-rev__acciones { bottom: calc(-24px - env(safe-area-inset-bottom)); display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 16px -20px calc(-24px - env(safe-area-inset-bottom)); padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
  .cq-rev .cq-hero__valor { font-size: 30px; }
}

@media (max-width: 420px) {
  .cq-doc__cabeza { flex-direction: column; align-items: flex-start; }
  .cq-doc__id { text-align: left; }
  .cq-meta { gap: 12px; }
  .cq-meta div:first-child { grid-column: 1 / -1; }
  .cq-doc__cabeza { gap: 12px; padding-bottom: 14px; }
  .cq-meta { margin: 16px 0 18px; }
  .cq-hero__valor { font-size: 32px; }
  .cq-fila__acciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .cq-fila__acciones button { padding: 0 8px; font-size: 13px; }
  .cq-rev__acciones { grid-template-columns: 1fr; }
  .cq-rev__acciones .secondary-button { order: 2; }
}

@media (max-width: 360px) {
  .cq-filtros { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .mobile-nav, #mobile-nav, .cq-volver, .cq-acciones, .cq-ok, .toast-region { display: none !important; }
  .cq-page { max-width: none; padding: 0; }
  .cq-doc { padding: 0; border: 0; box-shadow: none; }
  .cq-pend { break-inside: avoid; }
  .cq-t tr { break-inside: avoid; }
}

/* ============================================================
   MOTORIZADO · Mis pedidos — acciones de parada y secuencia
   Solo presentación (sin lógica). Neutraliza lo que heredaban de
   ".courier-stop-list button > span" (círculo rosado también en la
   etiqueta) y del grid fijo de 4 columnas (celda gris vacía y
   "Avisar" solo pegado a la esquina). Las acciones se reparten en
   tercios iguales y se centran: 3 acciones llenan la franja; una sola
   queda en el centro con el mismo tamaño. Profundidad sutil: icono
   en círculo con borde, luz superior y sombra corta; al presionar
   baja 1px y la sombra se reduce (transform, sin layout shift).
   ============================================================ */
.courier-stop-list .stop-row__actions {
  --stop-act-gap: 6px;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: var(--stop-act-gap);
  padding: 6px 8px 8px;
  background: linear-gradient(180deg, #fbfbfa, #f4f4f2);
  border-top: 1px solid var(--line);
}
.courier-stop-list .stop-row__actions > .stop-act {
  flex: 0 1 calc((100% - 2 * var(--stop-act-gap)) / 3);
  /* Nunca más angosto que su etiqueta: si falta espacio, cede el vecino. */
  min-width: max-content;
  min-height: 68px;
  gap: 6px;
  padding: 7px 4px 6px;
  color: var(--brand-dark);
  background: transparent;
  border: 0;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .005em;
  transition: background-color .15s ease;
}
.courier-stop-list .stop-row__actions > .stop-act > .action-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--brand);
  background: linear-gradient(180deg, #ffffff 0%, #fff3f3 100%);
  border: 1px solid rgba(238, 27, 36, .26);
  border-radius: 50%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    0 1px 1px rgba(16, 24, 40, .06),
    0 3px 8px -2px rgba(184, 12, 21, .22);
  transition: transform .12s ease, box-shadow .12s ease;
}
.courier-stop-list .stop-row__actions > .stop-act > .action-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}
.courier-stop-list .stop-row__actions > .stop-act > span:not(.action-icon) {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  overflow: visible;
  color: inherit;
  background: none;
  border-radius: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.15;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}
@media (hover: hover) {
  .courier-stop-list .stop-row__actions > .stop-act:hover { background: rgba(238, 27, 36, .05); }
  .courier-stop-list .stop-row__actions > .stop-act:hover > .action-icon { border-color: rgba(238, 27, 36, .42); }
}
.courier-stop-list .stop-row__actions > .stop-act:active { transform: none; }
.courier-stop-list .stop-row__actions > .stop-act:active > .action-icon {
  transform: translateY(1px);
  box-shadow: inset 0 1px 2px rgba(184, 12, 21, .14), 0 1px 1px rgba(16, 24, 40, .05);
}
.courier-stop-list .stop-row__actions > .stop-act:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* Secuencia de parada (01, 02…): identificador rápido, legible de un
   vistazo, sin competir con el nombre del Destinatario. */
.courier-stop-list .stop-row__main > .stop-row__num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #c8101a;
  background: var(--brand-soft);
  border: 1px solid rgba(238, 27, 36, .22);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  line-height: 1;
}
@media (max-width: 640px) {
  .courier-stop-list .stop-row__main { grid-template-columns: 32px minmax(0, 1fr) auto 10px; }
}

/* Escritorio: la columna de acciones mantiene un ancho fijo en todas
   las tarjetas (con 1 o 3 acciones) para que la información no salte. */
@media (min-width: 960px) {
  #miruta-datos .courier-stop-list .stop-row__actions {
    width: 276px;
    align-items: center;
    padding: 10px;
    border-top: 0;
  }
  #miruta-datos .courier-stop-list .stop-row__actions > .stop-act {
    min-height: 68px;
    padding: 7px 4px 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .courier-stop-list .stop-row__actions > .stop-act,
  .courier-stop-list .stop-row__actions > .stop-act > .action-icon { transition: none; }
}

/* ============================================================
   CREAR FLEX · mini guía Full Envíos (DEC-056/057/058)
   Mobile-first. La mini guía es ADICIONAL a la etiqueta de Mercado
   Libre. Su tamaño impreso es PROVISIONAL (≈70×50 mm sigue
   pendiente de decisión): no es una medida canónica.
   ============================================================ */
.flex-fe-layout { display: grid; gap: 16px; align-items: start; }
.flex-fe-form { display: grid; gap: 14px; }
.flex-fe-form .field { margin: 0; }
.flex-fe-form select { width: 100%; min-width: 0; }
.flex-fe-dato { display: flex; justify-content: space-between; gap: 12px; margin: 0;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.flex-fe-dato span { color: var(--muted); }
.flex-fe-dato strong { min-width: 0; overflow-wrap: anywhere; text-align: right; }
.flex-fe-submit { width: 100%; min-height: 48px; justify-content: center; }
.flex-fe-resultado { display: grid; gap: 14px; }
.flex-fe-resultado .eyebrow { display: flex; align-items: center; gap: 6px; margin: 0; }
.flex-fe-resumen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.flex-fe-resumen div { min-width: 0; }
.flex-fe-resumen dt { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.flex-fe-resumen dd { margin: 2px 0 0; font-weight: 800; overflow-wrap: anywhere; }
.flex-fe-acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.flex-fe-acciones button { min-height: 48px; justify-content: center; }
.flex-fe-mini { width: 100%; max-width: 320px; margin: 0 auto; padding: 10px; color: #000;
  background: #fff; border: 2px solid #000; border-radius: 6px; }
.flex-fe-mini__top { display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 6px; border-bottom: 2px solid #000; }
.flex-fe-mini__top strong { font-size: 22px; font-weight: 900; letter-spacing: .08em; }
.flex-fe-mini__top span { font-size: 11px; font-weight: 700; }
.flex-fe-mini__body { display: flex; gap: 10px; align-items: center; padding-top: 8px; }
.flex-fe-mini .flex-fe-mini__qr { flex: none; grid-column: auto; grid-row: auto; width: 96px;
  height: 96px; margin: 0; box-shadow: none; }
.flex-fe-mini__datos { display: grid; gap: 3px; min-width: 0; font-size: 12px; }
.flex-fe-mini__code { font-size: 15px; font-weight: 900; overflow-wrap: anywhere; }
@media (max-width: 359px) {
  .flex-fe-resumen { grid-template-columns: 1fr 1fr; }
  .flex-fe-resumen div:last-child { grid-column: 1 / -1; }
  .flex-fe-mini .flex-fe-mini__qr { width: 84px; height: 84px; }
}
@media (min-width: 768px) {
  .flex-fe-layout { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
  .flex-fe-submit { width: auto; justify-self: start; }
}
/* Imprimir: el PDF lo genera la app (flex-pdf.mjs, Carta 2 × 5). No se usa la
   impresión del navegador sobre la página. */
.flex-fe-lote-abrir { flex: none; min-height: 44px; }
.flex-imprimir { display: grid; gap: 12px; margin-top: 16px; }
.flex-imprimir__estado { margin: 16px 0; color: var(--muted); }
.flex-imprimir__todos,
.flex-imprimir__fila { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.flex-imprimir__todos { padding: 0 12px; font-weight: 700; border: 1px solid var(--line); border-radius: var(--radius-sm, 8px); }
.flex-imprimir__todos input,
.flex-imprimir__fila input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--brand); }
.flex-imprimir__lista { display: grid; margin: 0; padding: 0; list-style: none; max-height: min(46vh, 420px); overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm, 8px); }
.flex-imprimir__lista li + li { border-top: 1px solid var(--line); }
.flex-imprimir__fila { padding: 0 12px; }
.flex-imprimir__fila span { min-width: 0; overflow-wrap: anywhere; }
.flex-imprimir__pie { position: sticky; bottom: 0; display: grid; gap: 4px; justify-items: stretch; padding-top: 8px; background: #fff; }
.flex-imprimir__pie button { min-height: 48px; justify-content: center; }
.flex-imprimir__pie small { color: var(--muted); text-align: center; }
/* DEC-059 · Motorizado «Recibir en bodega» (ámbar): registra la llegada física,
   distinto de «Tomar pedido». No toma custodia. */
.moto-recibir { margin-top: 16px; }
.moto-recibir .moto-recibir__tag { color: #f0b429; }
.moto-recibir .moto-recibir__tag i { background: #f0b429; }
.primary-button.moto-recibir__boton { background: #f0b429; border-color: #f0b429; color: #1f1600; }
.primary-button.moto-recibir__boton:hover { background: #e0a21c; border-color: #e0a21c; }
@media (max-width: 559px) {
  .page-heading--module .flex-fe-lote-abrir { width: 100%; justify-content: center; }
}

/* ============================================================
   MI RUTA — ORDEN MANUAL (DEC-061)
   Columna estrecha a la derecha de cada parada: subir, mango de
   arrastre y bajar. Mango discreto, sin rediseñar Avisar/Entregado/
   Novedad. Los <button> viven dentro de .courier-stop-list, así que
   se anula aquí la grilla heredada de ".courier-stop-list button".
   ============================================================ */
.stop-row--orden {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: stretch;
  -webkit-touch-callout: none;
}
.stop-row--orden > .stop-row__main { grid-column: 1; grid-row: 1; min-width: 0; -webkit-user-select: none; user-select: none; }
.stop-row--orden > .stop-order { grid-column: 2; grid-row: 1; }
.stop-row--orden > .stop-row__actions,
.stop-row--orden > .route-novelty { grid-column: 1 / -1; }

.stop-order {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fbfbfa;
  border-left: 1px solid var(--line);
}
.courier-stop-list .stop-order > button,
.stop-order > button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0;
  color: var(--muted-light);
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}
.courier-stop-list .stop-order > .stop-order__drag,
.stop-order > .stop-order__drag {
  flex: 1 1 auto;
  min-height: 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-right: 0;
  cursor: grab;
}
.stop-order svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.stop-order .stop-order__drag svg { fill: currentColor; stroke: none; }
.stop-order > button:disabled { opacity: .35; cursor: default; }
.stop-order > button:focus-visible { position: relative; z-index: 1; outline: 3px solid rgba(37, 99, 235, .35); outline-offset: -3px; }
@media (hover: hover) {
  .stop-order > button:not(:disabled):hover { color: var(--ink); background: #f1f1ef; }
}

/* Guía del pedido encima del nombre del Destinatario: pequeña y apagada. */
.stop-row__guia {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Escritorio: info | orden | acciones en una sola fila; novedad debajo. */
@media (min-width: 960px) {
  #miruta-datos .stop-row--orden { grid-template-columns: minmax(0, 1fr) 44px auto; }
  #miruta-datos .stop-row--orden > .stop-row__main { border-right: 0; }
  #miruta-datos .stop-row--orden > .stop-order { border-right: 1px solid var(--line); }
  #miruta-datos .stop-row--orden > .stop-row__actions { grid-column: 3; grid-row: 1; }
  #miruta-datos .stop-row--orden > .route-novelty { grid-column: 1 / -1; grid-row: 2; }
}

/* La fila lateral depende del ancho real de la columna, no de la pantalla:
   a 1024 px la lista mide ~340 px y las acciones dejaban la info en 0.
   Sin ancho suficiente: datos arriba, acciones debajo (como en móvil). */
#miruta-datos .courier-stop-list { container: miruta / inline-size; }
@container miruta (max-width: 639px) {
  #miruta-datos .stop-row:not(.stop-row--orden) { display: block; }
  #miruta-datos .stop-row--orden { grid-template-columns: minmax(0, 1fr) 44px; }
  #miruta-datos .stop-row__main,
  #miruta-datos .stop-row--orden > .stop-order { border-right: 0; }
  #miruta-datos .stop-row--orden > .stop-row__actions,
  #miruta-datos .stop-row--orden > .route-novelty { grid-column: 1 / -1; grid-row: auto; }
  #miruta-datos .courier-stop-list .stop-row__actions {
    width: auto;
    align-items: stretch;
    padding: 6px 8px 8px;
    border-top: 1px solid var(--line);
  }
}

/* =========================================================================
   Recepción Continua «Recibir paquetes» (SPEC-003 · DEC-060/064)
   ========================================================================= */
/* Con la cámara continua abierta el resultado es una BANDA arriba: no tapa la
   cámara (el aviso a pantalla completa, z-index 400, la taparía) y no captura
   toques, así el operador sigue escaneando. Sin cámara, el aviso de siempre. */
.scan-flash.scan-flash--banda {
  inset: 0 0 auto 0;
  padding: calc(10px + env(safe-area-inset-top)) 16px 12px;
  pointer-events: none;
  cursor: default;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.scan-flash--banda .scan-flash__inner {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-items: start;
  gap: 2px 12px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  text-align: left;
}
.scan-flash--banda .scan-flash__mark {
  grid-row: span 3;
  width: 48px;
  height: 48px;
  border-width: 3px;
  font-size: 26px;
}
.scan-flash--banda .scan-flash__word { font-size: 22px; }
.scan-flash--banda .scan-flash__code { padding: 2px 10px; font-size: 13px; }
.scan-flash--banda .scan-flash__detail { font-size: 13px; }
.scan-flash--banda .scan-flash__streak { display: none; }

/* Consola de recepción: el campo es la entrada del lector USB en PC. */
.recepcion-entrada > span { color: #a2a29d; font-size: 11px; text-align: left; }
.recepcion-entrada input { min-height: 48px; font-size: 15px; }
.recepcion-entrada .primary-button { min-width: 112px; min-height: 48px; }

.recepcion-escaneos { display: grid; gap: 12px; margin-top: 14px; }
.recepcion-escaneos:empty { display: none; }
.recepcion-cola {
  justify-self: start;
  padding: 4px 10px;
  color: #d9d9d4;
  background: #202020;
  border: 1px solid #383838;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.recepcion-bloque {
  padding: 12px;
  background: #171717;
  border: 1px solid #2b2b2b;
  border-radius: var(--radius-sm);
}
/* «Por revisar»: rechazos que requieren atención. Borde ámbar para que no se
   confunda con el historial de aciertos. */
.recepcion-bloque--revisar { border-color: #f0b429; }
.recepcion-bloque__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.recepcion-bloque__head h3 { margin: 0; color: #fff; font-size: 13px; font-weight: 800; }
.recepcion-bloque__head .secondary-button { min-height: 44px; padding: 8px 14px; font-size: 12px; }
.recepcion-bloque ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }

.recepcion-fila {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 10px;
  padding: 8px 10px;
  color: #fff;
  background: #202020;
  border-radius: var(--radius-sm);
  border-left: 4px solid #505050;
}
.recepcion-fila__marca {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 900;
}
.recepcion-fila__texto { display: grid; min-width: 0; }
.recepcion-fila__texto strong {
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recepcion-fila__texto small { color: #a2a29d; font-size: 11px; }
.recepcion-fila__palabra { font-size: 12px; font-weight: 900; letter-spacing: .02em; text-align: right; }
.recepcion-fila__detalle { grid-column: 2 / -1; color: #d9d9d4; font-size: 12px; line-height: 1.35; }
/* Nunca solo color: cada fila lleva símbolo y palabra. */
.recepcion-fila--ok { border-left-color: #12805c; }
.recepcion-fila--ok .recepcion-fila__marca { background: #12805c; }
.recepcion-fila--aviso { border-left-color: #f0b429; }
.recepcion-fila--aviso .recepcion-fila__marca { background: #f0b429; color: #1f1600; }
.recepcion-fila--alto { border-left-color: #e5484d; }
.recepcion-fila--alto .recepcion-fila__marca { background: #b80c15; }

/* Cámara continua: «Terminar» abajo, a mano, y aviso fijo «N por revisar». */
.qr-camera-dialog__terminar { width: 100%; min-height: 52px; font-size: 15px; }
.qr-camera-dialog__revisar {
  margin: 12px 0 0;
  padding: 10px 12px;
  color: #1f1600;
  background: #f0b429;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 900;
}

/* Bloque del Motorizado: ámbar = llegada a bodega, nunca «Tomar» (verde). El
   botón usa la clase existente .moto-recibir__boton. */
.moto-recibir__nota { margin: -6px 0 0; color: #f0b429; font-size: 12px; font-weight: 700; }

@media (max-width: 720px) {
  .recepcion-entrada > div { grid-template-columns: minmax(0, 1fr) auto; }
  .recepcion-entrada .primary-button { min-width: 96px; }
  .recepcion-fila { grid-template-columns: 28px minmax(0, 1fr); }
  .recepcion-fila__palabra { grid-column: 2; text-align: left; }
}

/* Pulido de lanzamiento: PROD limpio, STAGING conserva sus herramientas de QA.
   [data-no-prod] solo se ve con canal STAGING o LOCAL (main.mjs marcarCanal:
   LOCAL exige localhost sin build); todo lo demás se oculta (falla cerrado). */
html:not([data-canal="STAGING"]):not([data-canal="LOCAL"]) [data-no-prod] {
  display: none !important;
}

/* [data-demo-only]: material de demostración (entradas rápidas por rol, aviso
   demo, nota de acceso). Solo LOCAL; STAGING, PROD y canal desconocido lo
   ocultan (falla cerrado). Una futura DEMO solo añade :not([data-canal="DEMO"]). */
html:not([data-canal="LOCAL"]) [data-demo-only] {
  display: none !important;
}

.login-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
}

.login-legal > [data-firma]:not([hidden]) + [data-app-version]::before {
  content: "·";
  margin-right: 8px;
}

.sidebar-health .version-pill {
  justify-self: start;
  margin-left: 0;
}

html[data-canal="STAGING"] .version-pill {
  color: #f5a524;
  background: rgba(245, 165, 36, .12);
  border-color: rgba(245, 165, 36, .35);
}
