:root {
  --sidebar-w: 156px;
  --sidebar-collapsed: 52px;
  --bg-sidebar: #0b1120;
  --bg-active: #1e293b;
  --bg-main: #f1f5f9;
  --accent: #0ea5e9;
  --accent-2: #6366f1;
  --sidebar-text: #cbd5e1;
  --sidebar-text-dim: #8b9bb4;
  --text: #0f172a;
  --muted: #64748b;
  --card: #ffffff;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  /* Densidad notebook — tipografía compacta */
  --fs: 11px;
  --fs-form: 0.78rem;
  --fs-table: 0.72rem;
  --fs-label: 0.62rem;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: var(--fs);
  background: var(--bg-main);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.35;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* ?? Sidebar ?? */
.sidebar {
  width: var(--sidebar-w);
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(99, 102, 241, 0.16), transparent 60%),
    linear-gradient(180deg, #0f172a 0%, #0b1120 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s ease;
  overflow: hidden;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  align-self: flex-start;
  z-index: 40;
}

.layout.collapsed .sidebar {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px;
  margin-bottom: 0;
}

.sidebar-header-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.btn-toggle {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(14, 165, 233, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-toggle:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.45);
}

.btn-toggle:active {
  transform: translateY(0);
}

.sidebar-brand {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: linear-gradient(90deg, #fff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity 0.2s;
}

.sidebar-version {
  margin-left: 0;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 1px 4px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.dash-version {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #cbd5e1;
  user-select: none;
  padding: 3px 8px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.35);
}

.layout.collapsed .sidebar-header-text,
.layout.collapsed .sidebar-brand,
.layout.collapsed .sidebar-version,
.layout.collapsed .nav-label,
.layout.collapsed .nav-group-caret,
.layout.collapsed .sidebar-hint {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.nav-bell {
  position: relative;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-left: 0;
  border: none;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.nav-bell:hover {
  background: rgba(148, 163, 184, 0.28);
}

.nav-bell--alerta {
  background: rgba(245, 158, 11, 0.22);
}

.nav-bell-icon {
  font-size: 0.92rem;
  line-height: 1;
}

.nav-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px #0f172a;
}

.layout.collapsed .nav-bell {
  margin-left: 0;
}

.modal-notif {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 56px 16px 16px 72px;
}

.modal-notif[hidden] {
  display: none !important;
}

.modal-notif-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
}

.modal-notif-box {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.modal-notif-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 8px;
  border-bottom: 1px solid #e2e8f0;
}

.modal-notif-head h3 {
  margin: 0;
  font-size: 1.05rem;
  flex: 1;
}

.modal-notif-close {
  border: none;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.modal-notif-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.modal-notif-hint {
  margin: 0;
  padding: 8px 16px 4px;
  color: #64748b;
  font-size: 0.8rem;
}

.modal-notif-lista {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px 14px;
}

.modal-notif-vacio {
  margin: 18px 8px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

.notif-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notif-item {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.notif-item--nueva {
  border-color: #fbbf24;
  background: #fffbeb;
}

.notif-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 4px;
  font-size: 0.72rem;
  color: #64748b;
}

.notif-item-user {
  font-weight: 600;
  color: #334155;
}

.notif-item-accion {
  margin: 0;
  font-size: 0.86rem;
  color: #0f172a;
  line-height: 1.35;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
  min-height: auto;
}

.notif-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2200;
  width: min(380px, calc(100vw - 32px));
  border-radius: 16px;
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  transition:
    opacity 0.32s ease,
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  cursor: pointer;
}

.notif-toast[hidden] {
  display: none !important;
}

.notif-toast--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.notif-toast-glow {
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.45),
    rgba(45, 122, 90, 0.35),
    rgba(251, 191, 36, 0.4)
  );
  filter: blur(10px);
  opacity: 0.75;
  z-index: 0;
  animation: notif-toast-pulse 2.4s ease-in-out infinite;
}

.notif-toast-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border-radius: 16px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.96) 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 18px 40px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.notif-toast-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.15rem;
  background: linear-gradient(145deg, #e0f2fe 0%, #d1fae5 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  animation: notif-toast-ring 0.7s ease 0.15s both;
}

.notif-toast-body {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.notif-toast-title {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0ea5e9;
}

.notif-toast-msg {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}

.notif-toast-meta {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: #64748b;
}

.notif-toast-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.notif-toast-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

@keyframes notif-toast-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.02);
  }
}

@keyframes notif-toast-ring {
  0% {
    transform: scale(0.7) rotate(-12deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.08) rotate(4deg);
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .notif-toast {
    right: 12px;
    left: 12px;
    bottom: 14px;
    width: auto;
  }

  .modal-notif {
    padding: 12px;
    align-items: center;
    justify-content: center;
  }
}

.sidebar-nav {
  padding: 4px 6px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  margin-bottom: 1px;
  border-radius: 6px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.64rem;
  font-weight: 500;
  line-height: 1.2;
  transition: background 0.18s ease, color 0.18s ease, transform 0.1s ease;
}

.nav-item:hover {
  background: rgba(148, 163, 184, 0.1);
  color: #fff;
}

.nav-item:active {
  transform: scale(0.99);
}

.nav-item.nav-item--disabled,
span.nav-item--disabled {
  opacity: 0.42;
  color: var(--muted, #94a3b8);
  cursor: not-allowed;
  pointer-events: none;
  user-select: none;
}

.nav-item.nav-item--disabled:hover,
span.nav-item--disabled:hover {
  background: transparent;
  color: var(--muted, #94a3b8);
  transform: none;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.95), rgba(99, 102, 241, 0.95));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.3);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  border-radius: 0 4px 4px 0;
  background: #fff;
}

.nav-icon {
  font-size: 0.78rem;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.12);
  transition: background 0.18s ease;
}

.nav-item:hover .nav-icon {
  background: rgba(148, 163, 184, 0.2);
}

.nav-item.active .nav-icon {
  background: rgba(255, 255, 255, 0.18);
}

.layout.collapsed .nav-item {
  justify-content: center;
  padding: 7px 6px;
  gap: 0;
}

.layout.collapsed .nav-item.active::before {
  display: none;
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: inherit;
  letter-spacing: 0.01em;
}

.nav-group {
  margin: 2px 0;
}

.nav-group-toggle {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.64rem;
  font-weight: 500;
  color: var(--sidebar-text);
  text-align: left;
  margin-bottom: 0;
}

.nav-group-caret {
  margin-left: auto;
  font-size: 0.55rem;
  color: var(--sidebar-text-dim);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.nav-group.open > .nav-group-toggle .nav-group-caret {
  transform: rotate(90deg);
}

.nav-group-items {
  display: none;
  margin: 1px 0 3px 8px;
  padding-left: 5px;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
}

.nav-group.open > .nav-group-items {
  display: block;
}

.nav-group-items .nav-item {
  font-size: 0.68rem;
  padding: 5px 8px;
}

.layout.collapsed .nav-group-caret {
  display: none;
}

.layout.collapsed .nav-group-items {
  display: block;
  margin-left: 0;
  padding-left: 0;
  border-left: none;
}

.sidebar-hint {
  font-size: 0.7rem;
  color: var(--sidebar-text-dim);
  text-align: center;
  padding: 12px;
}

/* ?? Main ?? */
.main {
  flex: 1;
  padding: 12px 16px 20px;
  overflow-x: auto;
  max-width: 100%;
}

.topbar {
  display: none;
}

.global-search-form {
  max-width: 720px;
}

.global-search-wrap {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.global-search-input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  font-size: 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.global-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.global-search-btn {
  flex-shrink: 0;
  padding-left: 18px;
  padding-right: 18px;
}

.global-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 420px;
  overflow: auto;
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  padding: 10px 0;
}

.global-search-dropdown[hidden] {
  display: none !important;
}

.global-search-empty {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.global-search-grupo {
  padding: 4px 0 8px;
  border-bottom: 1px solid #f1f5f9;
}

.global-search-grupo:last-of-type {
  border-bottom: none;
}

.global-search-grupo-titulo {
  padding: 6px 16px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.global-search-grupo-lista {
  list-style: none;
  margin: 0;
  padding: 0;
}

.global-search-hit {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
  color: inherit;
}

.global-search-hit:hover {
  background: #f8fafc;
}

.global-search-hit-titulo {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.global-search-hit-detalle {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

.global-search-ver-todos {
  display: block;
  padding: 12px 16px 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border-top: 1px solid #f1f5f9;
}

.global-search-ver-todos:hover {
  text-decoration: underline;
}

.buscar-grupo {
  margin-bottom: 16px;
}

.buscar-grupo-titulo {
  font-size: 1.05rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.buscar-grupo-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 999px;
}

.buscar-lista {
  list-style: none;
  margin: 0;
  padding: 0;
}

.buscar-item {
  display: block;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.buscar-item:hover {
  border-color: var(--accent);
  background: #f8fafc;
}

.buscar-item-titulo {
  display: block;
  font-weight: 600;
}

.buscar-item-detalle {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.page-header {
  margin-bottom: 10px;
}

.page-header h1 {
  font-size: 1.2rem;
  font-weight: 700;
}

.subtitle {
  color: var(--muted);
  margin-top: 2px;
  font-size: 0.8rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.card h2 {
  font-size: 0.92rem;
  margin-bottom: 10px;
  color: var(--text);
}

/* ?? Forms ?? */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px 10px;
  align-items: end;
}

.form-grid--viajes {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.field label,
.field .label {
  display: block;
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  max-width: none;
  min-height: 1.85rem;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: var(--fs-form);
  font-family: inherit;
  background: #fff;
  color: var(--text);
  box-sizing: border-box;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.input-fecha {
  width: 100%;
  max-width: none;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.flatpickr-calendar {
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  border-radius: 10px;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--accent);
  border-color: var(--accent);
}

.flatpickr-day.selected:hover,
.flatpickr-day:hover {
  background: #0284c7;
  border-color: #0284c7;
}

.flatpickr-months .flatpickr-month {
  height: 40px;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
  font-weight: 600;
}

.row-bultos-choferes {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 38%);
  gap: 16px 24px;
  align-items: start;
}

.row-bultos-choferes > .field-bultos,
.row-bultos-choferes > .field-choferes {
  margin: 0;
  min-width: 0;
}

.bultos-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.bultos-row--4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(4.75rem, 1fr));
  gap: 8px 10px;
  align-items: end;
  width: 100%;
}

.bultos-row--extras {
  display: grid;
  grid-template-columns: repeat(7, minmax(4.4rem, 5.6rem));
  gap: 8px 10px;
  align-items: end;
  width: max-content;
  max-width: 100%;
}

.detalle-bultos-field .bultos-row--extras {
  max-width: none;
}

@media (max-width: 900px) {
  .bultos-row--extras {
    grid-template-columns: repeat(4, minmax(4.4rem, 5.6rem));
  }
}

.field-inline {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.field-inline label {
  font-size: 0.75rem;
  color: var(--muted);
  min-height: 2.6em;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  line-height: 1.2;
}

.field-inline input {
  width: 100%;
  max-width: none;
  min-height: 2rem;
  height: 2rem;
  box-sizing: border-box;
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding: 4px 8px;
  font-size: var(--fs-form);
}

.field-inline input.reembolso-cant {
  width: 2.75rem;
  max-width: 2.75rem;
  min-width: 2.75rem;
  text-align: center;
}

.reembolso-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  min-height: 2rem;
  height: 2rem;
}

.reembolso-cant {
  flex: 0 0 2.75rem !important;
  width: 2.75rem !important;
  max-width: 2.75rem !important;
  min-width: 2.75rem !important;
  text-align: center !important;
}

.reembolso-result,
.hint-reembolso-total {
  margin: 0;
  padding: 0 2px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent, #3f4a32);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 2rem;
  flex: 1 1 auto;
  min-width: 4.5rem;
  overflow: visible;
}

.field-devolucion input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.field-bolso-pasajero input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.field-reembolso .reembolso-inline {
  min-height: 2rem;
}

.bultos-row--extras .field-reembolso {
  grid-column: span 2;
  min-width: 0;
  max-width: none;
}

.detalle-bultos-field .bultos-row--4 {
  max-width: 28rem;
}

.form-grid--viajes-inline .field-bultos .label {
  display: block;
  margin-bottom: 6px;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 4px;
}

/* ?? Buttons ?? */
.btn {
  padding: 7px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #0284c7;
}

.btn-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
}

.btn-pdf {
  background: #dc2626;
  color: #fff;
  border: 1px solid #b91c1c;
}

.btn-pdf:hover {
  background: #b91c1c;
  color: #fff;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.paginacion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.paginacion-info {
  font-size: 0.85rem;
  color: var(--muted, #64748b);
}

.paginacion-nums {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.paginacion-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: var(--text, #0f172a);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.paginacion-num:hover {
  border-color: var(--accent, #2563eb);
  color: var(--accent, #2563eb);
}

.paginacion-num.is-active {
  background: var(--accent, #2563eb);
  border-color: var(--accent, #2563eb);
  color: #fff;
  cursor: default;
}

.paginacion-ellipsis {
  padding: 0 4px;
  color: var(--muted, #64748b);
  font-weight: 600;
}

.paginacion .btn.is-disabled,
.paginacion .btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.modal-entrega {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-entrega[hidden] {
  display: none !important;
}

.modal-entrega-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-entrega-box {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.modal-entrega-box h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.modal-entrega-hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.modal-entrega-box .field {
  margin-bottom: 12px;
}

.modal-entrega-box .form-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* Confirmación de cambio de estado (Encomiendas) */
.modal-confirm-estado {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-confirm-estado[hidden] {
  display: none !important;
}

.modal-confirm-estado-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
}

.modal-confirm-estado-box {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px 26px 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  text-align: center;
  animation: modalConfirmIn 0.18s ease-out;
}

@keyframes modalConfirmIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-confirm-estado-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.modal-confirm-estado-box h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: #0f172a;
}

.modal-confirm-estado-msg {
  margin: 0 0 6px;
  font-size: 0.98rem;
  color: #334155;
  line-height: 1.45;
}

.modal-confirm-estado-meta {
  margin: 0 0 18px;
  font-size: 0.82rem;
  color: #64748b;
}

.modal-confirm-estado-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Aviso diario: crear plantilla de viajes */
.modal-aviso-plantilla {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-aviso-plantilla[hidden],
.modal-aviso-plantilla.is-closed {
  display: none !important;
}

.modal-aviso-plantilla-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 17, 32, 0.55);
  backdrop-filter: blur(3px);
}

.modal-aviso-plantilla-box {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  overflow: hidden;
  background: linear-gradient(165deg, #ffffff 0%, #f0f9ff 55%, #f8fafc 100%);
  border: 1px solid #dbeafe;
  border-radius: 18px;
  padding: 28px 26px 22px;
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.32);
  text-align: center;
  animation: avisoPlantillaIn 0.22s ease-out;
}

.modal-aviso-plantilla-accent {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #0284c7, #0ea5e9 50%, #38bdf8);
}

@keyframes avisoPlantillaIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-aviso-plantilla-icon {
  width: 56px;
  height: 56px;
  margin: 4px auto 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0369a1;
  background: linear-gradient(145deg, #e0f2fe, #bae6fd);
  border: 1px solid #7dd3fc;
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.18);
}

.modal-aviso-plantilla-kicker {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0284c7;
}

.modal-aviso-plantilla-box h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.modal-aviso-plantilla-msg {
  margin: 0 0 20px;
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.5;
}

.modal-aviso-plantilla-msg strong {
  color: #0c4a6e;
  font-weight: 650;
}

.modal-aviso-plantilla-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-aviso-plantilla-actions .btn {
  min-width: 7.5rem;
}

.modal-confirm-estado-actions .btn {
  min-width: 7.5rem;
}

.detalle-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 20px;
  width: 100%;
  margin: 0;
  padding: 10px 18px 14px 36px;
  border-left: 4px solid var(--accent);
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  box-sizing: border-box;
}

.detalle-footer-row .form-actions--inline {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-top: none;
  padding: 0;
  margin: 0;
  grid-column: unset;
}

.detalle-entrega-panel {
  flex: 0 1 auto;
  width: min(520px, 100%);
  margin: 0 0 0 auto;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: none;
}

.detalle-entrega-panel--activo {
  border-color: #86efac;
  background: #f0fdf4;
  box-shadow: none;
}

.detalle-entrega-head {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1px;
  flex: 0 0 auto;
  min-width: 5.5rem;
  margin: 0;
  padding: 0;
  border: none;
  text-align: left;
}

.detalle-entrega-panel--activo .detalle-entrega-head {
  border-bottom: none;
}

.detalle-entrega-titulo {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.detalle-entrega-panel--activo .detalle-entrega-titulo {
  color: #14532d;
}

.entrega-resumen {
  display: block;
  margin: 0;
  font-size: 0.72rem;
  color: #166534;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.form-entrega-pedido {
  width: 100%;
}

.pedido-fields--entrega {
  display: grid;
  grid-template-columns: auto minmax(10rem, 0.5fr) 5.5rem auto;
  align-items: end;
  column-gap: 12px;
  width: 100%;
}

.pedido-fields--entrega > .field {
  margin: 0;
  min-width: 0;
}

.pedido-fields--entrega .field-entrega-nombre {
  width: 100%;
  max-width: 14rem;
}

.pedido-fields--entrega .field-entrega-dni {
  width: 5.5rem;
}

.pedido-fields--entrega > .field > label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2px;
}

.pedido-fields--entrega .field-entrega-nombre > label {
  text-align: left;
}

.pedido-fields--entrega .field-entrega-dni > label {
  text-align: right;
}

.pedido-fields--entrega > .field > input {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 8px;
  font-size: 0.8rem;
  min-height: 0;
  height: 2rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.pedido-fields--entrega .field-entrega-nombre > input {
  text-align: left;
}

.pedido-fields--entrega .field-entrega-dni > input {
  text-align: right;
}

.pedido-fields--entrega > .field > input:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

.pedido-fields--entrega .field-entrega-accion {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding-bottom: 0;
}

.pedido-fields--entrega .field-entrega-accion .btn {
  padding: 5px 12px;
  font-size: 0.75rem;
  height: 2rem;
  white-space: nowrap;
}

.detalle-entrega-bloqueado {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.entrega-badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.15);
  color: #14532d;
  font-size: 0.92rem;
}

.dash-kpi-deposito {
  border-left-color: #8b5cf6;
}

.dash-estados-resumen {
  margin-bottom: 16px;
}

.dash-estados-resumen h2 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.dash-estados-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.dash-estado-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.dash-estado-nombre {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.dash-estado-cant {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.dash-grid--charts {
  grid-template-columns: 1.4fr 0.9fr;
  gap: 12px;
  margin-bottom: 16px;
  max-width: 920px;
}

.dash-grid--charts .dash-charts {
  padding: 12px 14px;
}

.dash-grid--charts .dash-charts h2 {
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.dash-chart-box {
  min-height: 0;
  max-width: 100%;
}

.dash-chart-box canvas,
.dash-chart-box--wide canvas {
  max-height: 140px !important;
  width: 100% !important;
}

@media (max-width: 960px) {
  .dash-grid--charts {
    grid-template-columns: 1fr;
    max-width: none;
  }
  .pedido-fields--entrega {
    grid-template-columns: 1fr 1fr auto;
  }
  .pedido-fields--entrega .detalle-entrega-head {
    grid-column: 1 / -1;
  }
  .detalle-footer-row {
    flex-direction: column;
    align-items: stretch;
  }
  .detalle-entrega-panel {
    margin-left: 0;
    width: 100%;
    max-width: none;
  }
}


.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.inline-form {
  display: inline;
}

/* ?? Table ?? */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-table);
}

th,
td {
  padding: 4px 6px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

th {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: #f8fafc;
}

tbody tr:hover {
  background: #f8fafc;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.empty {
  color: var(--muted);
  padding: 12px 0;
}

/* ?? Alerts ?? */
.alerts {
  margin-bottom: 10px;
}

.alert {
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.82rem;
}

.alert-success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* ?? May?sculas y totales ?? */
.input-mayus {
  text-transform: uppercase;
}

.card-tarifas {
  border-left: 4px solid var(--accent);
}

.form-tarifas {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  width: fit-content;
  max-width: 100%;
}

.form-tarifas .field {
  margin: 0;
  flex: 0 0 auto;
}

.form-tarifas .field label {
  font-size: 0.75rem;
  margin-bottom: 3px;
}

.form-tarifas .field input,
.form-tarifas .field input.input-tarifa-num {
  width: 7.5rem;
  padding: 6px 10px;
  font-size: 0.85rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.form-tarifas .form-actions {
  grid-column: unset;
  flex: 0 0 auto;
  padding-top: 0;
  margin: 0;
  display: flex;
  align-items: flex-end;
}

.form-tarifas .form-actions .btn {
  padding: 6px 14px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.precio-hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.6rem;
  line-height: 1.2;
}

.field-inline .precio-hint {
  display: inline;
  margin-left: 2px;
}

.subtotal-line {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.field-total-viaje {
  grid-column: 1 / -1;
}

.total-viaje {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 4px;
}

.total-cell {
  font-weight: 600;
  color: #0369a1;
}

.total-readonly {
  display: inline-block;
  padding: 8px 12px;
  background: #f0f9ff;
  border-radius: 6px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.footer-total td {
  background: #f1f5f9;
  border-top: 2px solid #cbd5e1;
  padding: 14px 12px;
}

.edit-hint {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.pedidos-lista {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pedido-card {
  border-left: 4px solid var(--accent);
}

.pedido-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.pedido-card-header h2 {
  font-size: 1.1rem;
  margin: 0;
}

.total-viaje-card {
  font-size: 1rem;
  color: var(--muted);
}

.total-viaje-card strong {
  color: var(--accent);
  font-size: 1.25rem;
}

.pedido-actions {
  grid-column: 1 / -1;
}

.form-eliminar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.card-total-dia {
  text-align: right;
  font-size: 1.1rem;
}

.card-total-dia p {
  margin: 0;
}

/* —— Viajes: búsqueda y tabla editable —— */
.card-search .search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.search-bar--filtros .field label,
.search-bar--filtros .field .label {
  font-size: 0.62rem;
  margin-bottom: 2px;
  font-weight: 600;
  color: var(--muted);
}

.search-bar--filtros .field input,
.search-bar--filtros .field select,
.search-bar--filtros .filtro-estado {
  width: 100%;
  min-width: 0;
  min-height: 1.75rem;
  padding: 3px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 500;
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
}

.search-bar--filtros .field input:focus,
.search-bar--filtros .filtro-estado:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

.card-search .field {
  min-width: 118px;
  flex: 0 1 130px;
}

.card-search .field-filtro-transporte,
.card-search .field-filtro-estado,
.card-search .field-filtro-pago {
  min-width: 190px;
  flex: 1 1 220px;
  max-width: 280px;
}

.card-search .field-filtro-cliente {
  min-width: 180px;
  flex: 0 1 220px;
  max-width: 260px;
}

.card-search .field-filtro-chofer {
  min-width: 150px;
  flex: 0 1 180px;
  max-width: 220px;
}

/* Encomiendas: una sola línea — cliente largo, resto chico */
.search-bar--viajes {
  flex-wrap: nowrap;
  gap: 6px;
}

.search-bar--viajes .field-filtro-fecha {
  flex: 0 0 96px;
  min-width: 88px;
  max-width: 104px;
}

.search-bar--viajes .field-filtro-cliente {
  flex: 1 1 240px;
  min-width: 180px;
  max-width: 340px;
}

.search-bar--viajes .field-filtro-lugar,
.search-bar--viajes .field-filtro-transporte,
.search-bar--viajes .field-filtro-estado,
.search-bar--viajes .field-filtro-pago {
  flex: 0 1 108px;
  min-width: 88px;
  max-width: 128px;
}

.search-bar--viajes .field-acciones-filtro {
  flex: 0 0 auto;
  min-width: auto;
}

.search-bar--viajes .filtros-acciones .btn {
  padding: 4px 8px;
  font-size: 0.72rem;
}

.card-search .field-acciones-filtro {
  min-width: auto;
  flex: 0 0 auto;
}

.filtros-acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.filtros-acciones .btn,
.field-acciones-filtro .btn {
  padding: 4px 10px;
  font-size: 0.72rem;
  border-radius: 5px;
  min-height: 1.75rem;
  line-height: 1.2;
}

.repartos-filtro-btns {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.search-hint {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.table-editable .row-form,
.table-lineas .row-form {
  display: contents;
}

.table-lineas th,
.table-lineas td {
  vertical-align: middle;
}

.table-lineas .cell-actions {
  white-space: nowrap;
  width: 100px;
}

.table-listado tbody tr:hover {
  background: #f8fafc;
}

.table-listado td {
  padding: 12px;
}

.table-viajes .col-expand {
  width: 28px;
  padding-right: 0;
  color: var(--muted);
}

.table-viajes .col-chk {
  width: 36px;
  text-align: center;
  vertical-align: middle;
  padding-left: 4px;
  padding-right: 4px;
}

.table-viajes .col-chk input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  cursor: pointer;
  accent-color: #2563eb;
}

.barra-estado-masivo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
}

.barra-estado-masivo[hidden] {
  display: none !important;
}

.barra-estado-masivo-count {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e40af;
  margin-right: 4px;
}

.barra-estado-masivo .estado-picker {
  background: #fff;
}

.barra-estado-masivo .estado-select {
  min-width: 11rem;
}

.barra-estado-masivo .btn {
  min-height: 2rem;
}

.fila-grupo--seleccionada {
  background: rgba(37, 99, 235, 0.14) !important;
  outline: 1px solid rgba(37, 99, 235, 0.25);
}

.fila-expand-icon {
  display: inline-block;
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.15s ease;
}

.fila-pedido {
  cursor: pointer;
}

.fila-pedido--activa {
  background: #eff6ff !important;
}

.fila-pedido--activa .fila-expand-icon {
  transform: rotate(90deg);
  color: var(--accent);
}

.fila-grupo {
  cursor: pointer;
  background: rgba(100, 116, 139, 0.1);
  font-weight: 600;
}

.fila-grupo:hover {
  background: rgba(100, 116, 139, 0.16);
}

.fila-grupo--abierta .fila-expand-icon {
  transform: rotate(90deg);
}

.fila-pedido--grupo td:nth-child(3) {
  padding-left: 0.75rem;
}

.grupo-meta {
  font-weight: 500;
  font-size: 0.85em;
  color: var(--muted);
  margin-left: 6px;
}

.grupo-meta--cadete {
  display: block;
  margin-top: 2px;
  margin-left: 0;
  color: #9a3412;
  font-weight: 600;
}

.grupo-meta.resumen-destacado {
  font-weight: 700;
  color: #0c4a6e;
  margin-left: 8px;
  vertical-align: middle;
}

.cell-grupo-estado {
  white-space: nowrap;
}

.cell-grupo-estado .estado-form--grupo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.grupo-estado-hint {
  font-size: 0.85rem;
  font-weight: 700;
  color: #b45309;
  cursor: help;
}

.cell-grupo-loc {
  max-width: 14rem;
  font-size: 0.9em;
  color: var(--muted);
}

.col-grupo-skip,
.col-grupo-vacio {
  color: #cbd5e1;
}

.col-grupo-cliente strong {
  color: #0f172a;
}

.grupo-estado-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cell-grupo-bultos .bultos-compact {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.25;
  color: #64748b;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
}

.table-viajes .cell-grupo-bultos {
  vertical-align: middle;
}

.pedido-linea-grid .pl-bultos {
  font-weight: 500;
  color: #64748b;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  line-height: 1.25;
}

.cell-grupo-ingreso {
  white-space: nowrap;
  vertical-align: middle;
}

.ingreso-estado-wrap--grupo {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px;
}

.fila-grupo--abierta {
  border-bottom: 1px solid #cbd5e1;
}

.fila-pedido-subhead > td {
  padding: 0 !important;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.cell-pedido-subhead {
  border-left: 3px solid #94a3b8;
}

.fila-pedido--grupo > td {
  padding: 0 !important;
  background: #fafbfc;
  border-bottom: 1px solid #e8edf2;
}

.fila-pedido--grupo:hover > td {
  background: #f1f5f9;
}

.fila-pedido--grupo.fila-pedido--activa > td {
  background: #eff6ff !important;
}

.cell-pedido-linea {
  padding: 0 !important;
  border-left: 3px solid #cbd5e1;
}

.pedido-linea-grid {
  display: grid;
  grid-template-columns:
    5.25rem
    4.75rem
    4.25rem
    4.5rem
    minmax(9rem, 2fr)
    minmax(9.5rem, 1.5fr)
    6.75rem
    minmax(2rem, 1fr)
    7.75rem
    minmax(9rem, 1.1fr);
  align-items: stretch;
  width: 100%;
  min-width: 72rem;
  font-size: 0.8rem;
  column-gap: 12px;
}

.pedido-linea-grid--head {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.pedido-linea-grid--head > span {
  padding: 7px 4px;
  white-space: nowrap;
}

.pedido-linea-grid .pl-item {
  min-width: 0;
  padding: 9px 4px;
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pedido-linea-grid .pl-spacer {
  padding: 0;
  min-width: 0;
}

.pedido-linea-grid .pl-pedido {
  font-weight: 600;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.pedido-linea-grid .pl-loc {
  color: #64748b;
}

.pedido-linea-grid .pl-total {
  font-weight: 700;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  padding-left: 1.25rem;
  padding-right: 0.35rem;
}

.table-viajes .col-cobra-chofer[hidden],
.table-viajes .cell-grupo-importe[hidden] {
  display: none !important;
}


.table-viajes .cell-grupo-importe .switch-toggle--lista {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 1.75rem;
  margin: 0;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  vertical-align: middle;
}

.table-viajes .cell-grupo-importe .switch-toggle--lista:has(input:checked) {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
}

.table-viajes .cell-grupo-importe .switch-toggle--lista input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.table-viajes .cell-grupo-importe .switch-slider {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #94a3b8;
  transition: background 0.2s ease;
}

.table-viajes .cell-grupo-importe .switch-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}

.table-viajes .cell-grupo-importe .switch-toggle--lista:has(input:checked) .switch-slider {
  background: #2563eb;
}

.table-viajes .cell-grupo-importe .switch-toggle--lista:has(input:checked) .switch-slider::after {
  transform: translateX(16px);
}

.table-viajes .cell-grupo-importe .switch-text {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  line-height: 1;
}

.table-viajes .cell-grupo-importe .switch-toggle--lista:has(input:checked) .switch-text {
  color: #1e40af;
}

.table-viajes .cell-grupo-importe .switch-text-on {
  display: none;
}

.table-viajes .cell-grupo-importe .switch-toggle--lista:has(input:checked) .switch-text-on {
  display: inline;
}

.table-viajes .cell-grupo-importe .switch-toggle--lista:has(input:checked) .switch-text-off {
  display: none;
}

.table-viajes .cell-grupo-importe .switch-toggle--lista.is-saving {
  opacity: 0.6;
  pointer-events: none;
}

.table-viajes th:nth-child(8),
.table-viajes .cell-grupo-total {
  min-width: 5.75rem;
  padding-left: 1.25rem;
  padding-right: 0.75rem;
  text-align: right;
}

.table-viajes .pedido-linea-grid--head .pl-align-num {
  padding-left: 1.25rem;
  padding-right: 0.35rem;
}

.pedido-linea-grid .pl-align-num,
.pedido-linea-grid .pl-align-end {
  text-align: right;
}

.pedido-linea-grid .pl-acciones {
  overflow: visible;
  white-space: nowrap;
  justify-content: flex-start;
  padding: 6px 0;
  gap: 6px;
  min-width: 7.75rem;
}

.pedido-linea-grid .acciones-toolbar--solo-links {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  width: max-content;
}

.fila-pedido--grupo .pedido-linea-grid .btn-accion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.25rem;
  padding: 5px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.15;
  border-radius: 6px;
  flex: 0 0 auto;
}

.fila-pedido--grupo .pedido-linea-grid .btn-accion--ver {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.fila-pedido--grupo .pedido-linea-grid .btn-accion--ver:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

.fila-pedido--grupo .pedido-linea-grid .btn-accion--editar {
  background: #0ea5e9;
  color: #fff;
  border: 1px solid #0284c7;
  box-shadow: none;
}

.fila-pedido--grupo .pedido-linea-grid .btn-accion--editar:hover {
  background: #0284c7;
  border-color: #0369a1;
  box-shadow: 0 1px 3px rgba(14, 165, 233, 0.35);
}

.pedido-linea-grid .pl-ingreso {
  overflow: visible;
  white-space: nowrap;
  justify-content: flex-end;
}

.pedido-linea-grid .pl-ingreso .ingreso-estado-wrap {
  max-width: none;
  justify-content: flex-end;
}

.fila-pedido--grupo .col-oculto-grupo {
  padding: 0;
  width: 0;
  max-width: 0;
  overflow: hidden;
  border: none;
  font-size: 0;
  line-height: 0;
}

.fila-pedido--grupo td:nth-child(3) {
  color: var(--muted);
  font-size: 0.85em;
}

.ingreso-estado-wrap {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 11rem;
}

.ingreso-estado-wrap .badge-estado {
  flex-shrink: 0;
}

.btn-estado-revert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}

.btn-estado-revert:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.estado-revert-form {
  margin: 0;
  display: inline-flex;
}

.acciones-toolbar--solo-links {
  gap: 6px;
}

.fila-detalle--grupo > td {
  padding: 0 !important;
  background: #f8fafc;
  border-left: 3px solid var(--accent);
  border-bottom: 2px solid #e2e8f0;
}

.fila-detalle--grupo .detalle-bultos-form {
  padding: 14px 16px 16px 20px;
  border-left: none;
  background: transparent;
}

.fila-detalle--grupo .detalle-meta-pedido {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 8px 16px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.85rem;
}

.fila-detalle--grupo .detalle-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px 24px;
  margin-top: 12px;
}

.fila-detalle--grupo .detalle-entrega-panel {
  flex: 1 1 16rem;
  min-width: 0;
}

.resumen-destacado {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(14, 165, 233, 0.15);
  color: #0c4a6e;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#totalDiaViajes.resumen-destacado {
  background: rgba(34, 197, 94, 0.18);
  color: #14532d;
}

.fila-detalle td {
  padding: 0 !important;
  background: #fff;
  border-bottom: 2px solid #e2e8f0;
}

.detalle-bultos-form {
  padding: 16px 18px 8px 36px;
  border-left: 4px solid var(--accent);
  background: #f8fafc;
}

.detalle-meta-pedido {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  width: 100%;
  margin: 0 0 12px;
  padding: 8px 10px;
  font-size: 0.82rem;
  color: var(--text);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
}

.detalle-meta-pedido strong {
  color: var(--muted);
  font-weight: 600;
  margin-right: 4px;
}

.form-grid--viajes-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 20px;
}

.form-grid--viajes-inline .field-bultos {
  flex: 1 1 320px;
  grid-column: unset;
  margin: 0;
}

.form-grid--viajes-inline .field-total-viaje--inline {
  grid-column: unset;
  flex: 0 0 auto;
  margin: 0;
}

.form-grid--viajes-inline .field-total-viaje--inline .total-viaje {
  font-size: 1.5rem;
  margin-top: 2px;
}

.form-grid--viajes-inline .field:not(.field-bultos):not(.field-total-viaje) {
  flex: 0 0 auto;
  min-width: 7rem;
  margin: 0;
}

.form-grid--viajes-inline .form-actions--inline {
  flex: 1 1 100%;
  grid-column: unset;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  margin: 8px 0 0;
  border-top: 1px solid #e2e8f0;
}

.label-ref {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #334155;
  font-size: 0.85rem;
}

.detalle-bultos-msg {
  font-size: 0.85rem;
  color: var(--muted);
}

.detalle-bultos-msg--ok {
  color: #047857;
}

.detalle-bultos-msg--error {
  color: #b91c1c;
}

.table-liq-libro .fila-liq {
  cursor: pointer;
}

.table-liq-libro .fila-liq:hover {
  background: #f8fafc;
}

.table-liq-libro .fila-liq.fila-pedido--activa {
  background: #eff6ff !important;
}

.table-liq-libro .fila-liq.fila-pedido--activa .fila-expand-icon {
  transform: rotate(90deg);
  color: var(--accent);
}

.detalle-liq-panel {
  padding: 14px 16px 16px 36px;
  border-left: 4px solid var(--accent);
  background: #f8fafc;
}

.detalle-liq-titulo {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.table-wrap--nested {
  margin: 0;
}

.table-liq-detalle {
  font-size: 0.85rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.table-liq-detalle th,
.table-liq-detalle td {
  padding: 8px 10px;
}

.table-liq-detalle .bultos-compact {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.detalle-liq-cargando,
.detalle-liq-vacio,
.detalle-liq-error {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.detalle-liq-error {
  color: #b91c1c;
}

.detalle-pendiente-panel {
  padding-bottom: 18px;
}

.detalle-pedido-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px 20px;
  margin: 0 0 16px;
}

.detalle-pedido-item {
  margin: 0;
}

.detalle-pedido-item--wide {
  grid-column: 1 / -1;
}

.detalle-pedido-item dt {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.detalle-pedido-item dd {
  margin: 0;
  font-size: 0.92rem;
  color: #1e293b;
}

.detalle-pendiente-acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.badge-concepto {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-cobro {
  background: #ecfdf5;
  color: #047857;
}

.badge-concepto.badge-pago {
  background: #fef2f2;
  color: #b91c1c;
}

.form-grid--config {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.form-grid--config .field-chofer-config {
  grid-column: 1 / -1;
  min-width: 240px;
}

.form-grid--config .field-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 6px 0 0;
}

.form-grid--config .field-cadete-config {
  grid-column: 1 / -1;
}

.form-grid--config .input-nuevo-cadete {
  margin-top: 8px;
}

.row-cadete-transporte {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  grid-column: 1 / -1;
}

.row-cadete-transporte .field-cadete {
  flex: 1 1 220px;
  min-width: 180px;
}

.row-cadete-transporte .field-transporte {
  flex: 0 0 auto;
  min-width: 100px;
}

.input-readonly {
  background: var(--surface-2, #f3f4f6);
  color: var(--text);
  cursor: default;
}

#comision[readonly] {
  background: var(--surface-2, #f3f4f6);
}

.config-dia-hint {
  grid-column: 1 / -1;
  margin: 0;
}

/* ?? Formulario nuevo pedido ?? */
.card-pedido {
  border-top: 3px solid var(--accent);
}

.pedido-form-head {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.pedido-form-head h2 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.pedido-form-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.form-pedido {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pedido-section {
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
}

.pedido-section--resumen,
.pedido-section--operacion {
  margin-top: 0.5rem;
}

.pedido-section--operacion {
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
  border-color: #bae6fd;
}

.pedido-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.pedido-section-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px;
  align-items: end;
}

.pedido-section-grid--uniform {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: none;
}

.pedido-section-grid--uniform .field,
.pedido-section-grid--uniform .field select,
.pedido-section-grid--uniform .field input:not([type="hidden"]):not([type="radio"]) {
  width: 100%;
}

.pedido-section-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 32rem;
}

.filtro-transporte {
  font-weight: 600;
}

.field-transporte-elegir select {
  min-width: 6rem;
}

.pedido-banner strong {
  color: #0c4a6e;
}

@media (max-width: 560px) {
  .pedido-section-grid--compact {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

.pedido-section-grid .field-span-full {
  grid-column: 1 / -1;
}

.pedido-section-grid .field-span-2 {
  grid-column: span 2;
}

.pedido-section .field select,
.pedido-section .field input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]),
.pedido-resumen-card select,
.pedido-resumen-card input:not([type="hidden"]),
.pedido-operacion-card select,
.pedido-operacion-card input:not([type="hidden"]):not([type="radio"]) {
  width: 100%;
  max-width: none;
  min-height: 1.85rem;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: var(--fs-form);
  font-family: inherit;
  background: var(--card);
  box-sizing: border-box;
}

.pedido-section .field select:focus,
.pedido-section .field input:focus,
.pedido-resumen-card select:focus,
.pedido-resumen-card input:focus,
.pedido-operacion-card select:focus,
.pedido-operacion-card input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.pedido-banner {
  margin: 10px 0 0;
  padding: 8px 12px;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #0369a1;
  background: #e0f2fe;
  border-radius: 7px;
  border-left: 3px solid var(--accent);
}

.pedido-banner[hidden] {
  display: none !important;
}

.row-bultos-choferes--pedido {
  grid-column: unset;
  margin: 0;
}

.pedido-bultos-panel {
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.row-bultos-choferes--pedido > .field-choferes {
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

/* Cadete + choferes: m?s espacio y layout moderno */
.pedido-operacion {
  display: grid;
  grid-template-columns: 1.35fr 1.35fr minmax(8rem, 0.75fr);
  gap: 8px;
  align-items: stretch;
}

.pedido-operacion--4 {
  grid-template-columns: 1.4fr 1fr 0.85fr minmax(7rem, 0.7fr);
}

.pedido-operacion-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  min-width: 0;
}

.pedido-operacion-card label,
.pedido-operacion-card > .label {
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.pedido-operacion-card .field-hint {
  font-size: 0.65rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.3;
}

.pedido-operacion-card--cadete,
.pedido-operacion-card--choferes {
  min-height: 0;
}

.pedido-operacion-card--choferes .input-choferes,
.pedido-operacion--4 .input-choferes,
.pedido-operacion--4 .cadete-nombre,
.pedido-operacion--4 input[type="text"],
.pedido-operacion--4 input[type="number"] {
  min-height: 2.1rem;
  font-size: var(--fs-form);
  width: 100%;
}

.field-comision-inline {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-comision-inline label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.pedido-operacion-card--total {
  background: var(--card);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.12);
  justify-content: center;
  text-align: right;
}

.pedido-operacion-card--total .total-viaje {
  font-size: 1.35rem;
  margin: 0;
  line-height: 1.2;
  font-weight: 700;
}

.pedido-resumen {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr 1.1fr;
  gap: 10px;
  align-items: stretch;
}

.pedido-resumen-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  min-width: 0;
}

.pedido-resumen-card label,
.pedido-resumen-card > .label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.pedido-resumen-card .field-hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.3;
}

.pedido-resumen-card--transporte select {
  font-weight: 600;
  font-size: 0.92rem;
}

.pedido-resumen-card--cadete .cadete-row-label,
.pedido-resumen-card--cadete > label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.cadete-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cadete-nombre {
  flex: 1;
  min-width: 0;
}

.factor-comision-group {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.factor-comision-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
  min-width: 1.9rem;
  padding: 5px 7px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
  line-height: 1;
}

.factor-comision-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.factor-comision-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Compat radios viejos (por si queda algún template) */
.factor-comision-btn input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.factor-comision-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  padding: 5px 7px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.factor-comision-btn input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.factor-comision-btn:hover span {
  border-color: var(--accent);
}

.pedido-resumen-card--total {
  background: var(--card);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.12);
  justify-content: center;
  text-align: right;
}

.pedido-resumen-card--total .total-viaje {
  font-size: 1.35rem;
  margin: 0;
  line-height: 1.2;
}

.pedido-section--pago-actions {
  padding: 12px 14px;
}

.pedido-pago-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.pedido-pago-fields {
  flex: 1;
  min-width: 16rem;
}

.pedido-pago-fields .pedido-section-title {
  margin-bottom: 8px;
}

.pedido-section-grid--pago {
  max-width: 28rem;
}

.form-actions--pedido {
  grid-column: unset;
  padding-top: 0;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-lg {
  padding: 7px 14px;
  font-size: 0.84rem;
}

@media (max-width: 960px) {
  .pedido-section-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pedido-section-grid .field-span-2 {
    grid-column: 1 / -1;
  }

  .pedido-resumen,
  .pedido-operacion {
    grid-template-columns: 1fr 1fr;
  }

  .pedido-resumen-card--total,
  .pedido-operacion-card--total {
    grid-column: 1 / -1;
    text-align: left;
  }

  .row-bultos-choferes--pedido {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .pedido-section-grid {
    grid-template-columns: 1fr;
  }

  .pedido-resumen,
  .pedido-operacion {
    grid-template-columns: 1fr;
  }

  .pedido-section {
    padding: 12px;
  }

  .pedido-pago-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.detalle-item--full {
  grid-column: 1 / -1;
}

.card-resumen-config {
  margin-top: 16px;
  border-left: 4px solid var(--accent);
}

.card-listado-config {
  margin-top: 16px;
}

.card-listado-config h2,
.card-resumen-config h2 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.table-configuraciones td:nth-child(5) {
  max-width: 280px;
  word-break: break-word;
}

@media (max-width: 640px) {
  .form-grid--config .field-chofer-config {
    grid-column: span 1;
  }
}

.card-search--contable .card-search-contable-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
}

.card-search--contable .card-search-filtros {
  flex: 1 1 360px;
  min-width: 0;
}

.card-search--contable .card-search-filtros h2 {
  margin-bottom: 12px;
}

.contable-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0 2px;
}

.contable-subnav-item {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  transition: background 0.15s ease, color 0.15s ease;
}

.contable-subnav-item:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.contable-subnav-item.active {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.cierre-cajas-subnav {
  margin-top: -4px;
  margin-bottom: 12px;
}

.contable-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.contable-hub-card {
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.contable-hub-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}

.contable-hub-card h2 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  color: #1e293b;
}

.contable-hub-card p {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.35;
}

.cierre-caja-bloque {
  margin-bottom: 18px;
}

.cierre-caja-bloque:last-child {
  margin-bottom: 0;
}

.detalle-cierre-panel {
  padding: 16px 18px 18px 28px;
  border-left: 4px solid #0ea5e9;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 0 0 10px 10px;
}

.fila-cierre-detalle > td {
  padding: 0 !important;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.cierre-detalle-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cierre-detalle-linea {
  margin: 0;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: #475569;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  line-height: 1.5;
}

.cierre-detalle-linea strong {
  color: #0f172a;
}

.cierre-detalle-linea-total {
  font-weight: 700;
  color: #0369a1;
  font-variant-numeric: tabular-nums;
}

.cierre-detalle-subtitulo {
  margin: 4px 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.cierre-pedidos-table,
.cierre-movimientos-table {
  margin: 0;
}

.cierre-pedidos-table thead th {
  background: #fff;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #94a3b8;
  white-space: nowrap;
}

.cierre-pedidos-table tbody td {
  white-space: nowrap;
  vertical-align: middle;
}

.cierre-pedidos-table tbody tr:hover td {
  background: #f8fafc;
}

.cierre-pedidos-table .cell-acciones {
  text-align: right;
  padding-right: 12px;
}

.cierre-pedidos-table tfoot td {
  background: #f1f5f9;
  border-top: 2px solid #e2e8f0;
}

.table-caja .fila-cierre-hist.fila-grupo--abierta td {
  background: #e0f2fe;
  border-bottom-color: #bae6fd;
}

.card-armar-caja {
  border-left: 4px solid #0ea5e9;
}

.armar-caja-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0 0 0.5rem;
  padding: 0.35rem 0.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  border-radius: 8px;
}
.armar-caja-toggle:hover {
  background: #f0f9ff;
}
.armar-caja-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.card-armar-caja.is-collapsed .armar-caja-toggle-icon {
  transform: rotate(0deg);
}
.armar-caja-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1 1 auto;
}
.armar-caja-toggle-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}
.armar-caja-toggle-meta {
  font-size: 0.85rem;
  color: var(--muted);
}
.armar-caja-toggle-meta strong {
  color: #0369a1;
}
.armar-caja-toggle-label {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0369a1;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #e0f2fe;
}
.card-armar-caja.is-collapsed .armar-caja-head--resumen {
  margin-bottom: 0;
}
.card-armar-caja.is-collapsed .armar-caja-body {
  display: none;
}

.armar-caja-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.armar-caja-head h2 {
  margin: 0;
}

.armar-caja-operador {
  flex: 1 1 100%;
  margin: -2px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.armar-caja-operador strong {
  color: #0369a1;
}

.armar-caja-operador .field-hint {
  margin-left: 8px;
}

.armar-caja-subtotal {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 0;
}

.card-resumen-cierres-diario {
  padding: 12px 16px;
}

.card-resumen-cierres-diario h2 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.resumen-cierres-diario-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.resumen-cierres-diario-item {
  min-width: 9.5rem;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.78rem;
  color: var(--muted);
}

.resumen-cierres-diario-fecha {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.resumen-cierres-diario-line strong {
  color: #0f172a;
  font-weight: 600;
}

.resumen-cierres-diario-line--total {
  margin-top: 2px;
  padding-top: 2px;
  border-top: 1px solid #e2e8f0;
}

.resumen-cierres-diario-line--total strong {
  color: #0369a1;
}

.armar-caja-subtotal-item {
  white-space: nowrap;
}

.armar-caja-subtotal-sep {
  margin: 0 8px;
  color: #94a3b8;
}

.armar-caja-subtotal strong {
  color: #0f172a;
  font-size: 1.15rem;
}

.armar-caja-subtotal-item--total strong {
  color: #0369a1;
}

.form-actions--caja,
.form-actions--caja-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 12px;
}

.form-inline-caja {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.filtro-cobro-estado {
  min-width: 7.5rem;
  min-height: 1.75rem;
  font-size: 0.74rem;
  padding: 2px 6px;
}

.table-caja .fila-caja--cero td {
  color: #94a3b8;
}

.table-caja .fila-cierre-revertido td {
  opacity: 0.72;
}

.detalle-caja-pedidos {
  padding: 8px 4px 4px;
}

.detalle-caja-pedidos .form-inline-caja {
  display: inline;
}

.caja-estados-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 14rem;
}

.caja-forma-pago-bar {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.form-forma-pago-sel {
  margin: 0;
}

.form-forma-pago-sel label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}

.form-forma-pago-sel .filtro-estado {
  min-width: 10rem;
}

.pago-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 2px;
  background: #fff;
  border: 1px solid #e2e8f0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pago-picker:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.pago-picker--efectivo { border-left: 3px solid #10b981; }
.pago-picker--transferencia { border-left: 3px solid #3b82f6; }
.pago-picker--tarjeta { border-left: 3px solid #8b5cf6; }
.pago-picker--cta-cte { border-left: 3px solid #f59e0b; }

.pago-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 7px 32px 7px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  cursor: pointer;
  min-width: 148px;
  line-height: 1.2;
}

.pago-select:focus {
  outline: none;
}

.pago-picker--efectivo .pago-select { color: #047857; }
.pago-picker--transferencia .pago-select { color: #1e40af; }
.pago-picker--tarjeta .pago-select { color: #5b21b6; }
.pago-picker--cta-cte .pago-select { color: #92400e; }

.form-forma-pago-sel .pago-picker {
  vertical-align: middle;
}

.table-caja .fila-caja-grupo {
  cursor: pointer;
}

.table-caja .fila-caja-detalle-oculta,
.table-caja .fila-caja-detalle[hidden] {
  display: none !important;
}

.table-caja tr.fila-caja--retirado > td {
  background: #ecfdf5;
}

.table-caja tr.fila-caja--retirado:hover > td {
  background: #d1fae5;
}

.table-caja .badge-retirado {
  background: #059669;
  color: #fff;
  border-color: #047857;
}

.table-caja tr.fila-caja--fuera-cobro > td {
  opacity: 0.62;
  background: #f8fafc;
}

.table-caja .badge-estado--fuera-cobro {
  outline: 1px dashed #94a3b8;
}

.table-caja .fila-caja--mixto .grupo-estado-hint {
  margin-left: 4px;
}

.texto-egreso {
  color: #b91c1c;
  font-weight: 600;
}

.texto-ingreso {
  color: #047857;
  font-weight: 600;
}

.table-caja tr.fila-caja-egreso > td {
  background: #fef2f2;
}

.table-caja tr.fila-caja-ingreso > td {
  background: #ecfdf5;
}

.badge-egreso-caja {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.badge-ingreso-caja {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}

.caja-ajustes-block {
  margin: 0 0 16px;
}

.caja-ajustes-titulo {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.table-caja-ajustes td {
  font-size: 0.85rem;
}

.table-caja td .badge-estado + .badge-estado {
  margin-left: 4px;
}

.card-resumen-forma--inline {
  flex: 0 0 auto;
  min-width: 200px;
  max-width: 280px;
  margin: 0;
  padding: 0 0 0 16px;
  border-left: 4px solid var(--accent);
  background: transparent;
  box-shadow: none;
}

.card-resumen-forma h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 10px;
}

.resumen-forma-grid--inline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resumen-forma-grid--inline .resumen-forma-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.resumen-forma-grid--inline .resumen-forma-label {
  display: inline;
  margin-bottom: 0;
  font-size: 0.8rem;
}

.resumen-forma-grid--inline .resumen-forma-item strong {
  font-size: 0.9rem;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .card-resumen-forma--inline {
    flex: 1 1 100%;
    max-width: none;
    padding: 16px 0 0;
    border-left: none;
    border-top: 4px solid var(--accent);
  }
}

.total-cobro-foot {
  color: #047857;
}

.total-pago-foot {
  color: #b91c1c;
}

.total-sep {
  color: var(--muted);
  font-weight: 400;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.badge-estado {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-pago {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-pago--pendiente {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-pago--ok {
  background: #d1fae5;
  color: #047857;
}

.badge-pago--efectivo {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #6ee7b7;
}

.badge-pago--transferencia {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.table-caja td .badge-pago + .badge-pago {
  margin-left: 4px;
}

.pago-switch-3 {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  overflow: hidden;
  background: #f8fafc;
  vertical-align: middle;
}

.pago-switch-3__btn {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 4px 8px;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.pago-switch-3__btn + .pago-switch-3__btn {
  border-left: 1px solid #e2e8f0;
}

.pago-switch-3__btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.pago-switch-3__btn.is-active[data-fp="EFECTIVO"] {
  background: #059669;
  color: #fff;
}

.pago-switch-3__btn.is-active[data-fp=""] {
  background: #94a3b8;
  color: #fff;
}

.pago-switch-3__btn.is-active[data-fp="TRANSFERENCIA"] {
  background: #2563eb;
  color: #fff;
}

.pago-picker.is-disabled,
label.is-disabled[for="forma_pago_aplicar"] {
  opacity: 0.45;
  pointer-events: none;
}

.pago-picker.is-disabled .pago-select {
  cursor: not-allowed;
}

.detalle-pago-panel {
  margin: 0;
  padding: 12px 18px 16px 36px;
  border-top: 1px dashed #cbd5e1;
  border-left: 4px solid var(--accent);
  background: #f8fafc;
}

.detalle-pago-ok {
  font-size: 0.9rem;
  color: #047857;
}

.form-pago-viajes {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  max-width: none;
}

.form-pago-viajes .field-forma-pago-accion .label {
  visibility: hidden;
}

.form-pago-viajes .field-forma-pago-accion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.form-pago-pedido-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 8px;
}

.form-pago-pedido-row select {
  min-width: 180px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.detalle-pago-msg {
  font-size: 0.85rem;
  color: var(--muted);
}

.pedido-section-grid--pago {
  max-width: 24rem;
}

.field-forma-pago-pedido select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cell-acciones {
  width: 1%;
  white-space: nowrap;
}

.acciones-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn-accion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  border: none;
  line-height: 1.2;
  flex-shrink: 0;
}

.btn-accion--ver {
  background: #e2e8f0;
  color: #334155;
}

.btn-accion--ver:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.btn-accion--editar {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(14, 165, 233, 0.35);
}

.btn-accion--editar:hover {
  background: #0284c7;
  color: #fff;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.4);
}

.btn-accion--borrar {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-accion--borrar:hover {
  background: #fecaca;
  color: #991b1b;
}

.col-acciones {
  white-space: nowrap;
}

.col-acciones .form-borrar-inline {
  display: inline;
  margin: 0;
}

.table-configuraciones .col-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.table-configuraciones tr.fila-activa {
  background: #e0f2fe;
}

.table-configuraciones tr.fila-activa td {
  border-color: #bae6fd;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.btn-icon svg {
  width: 17px;
  height: 17px;
}

.btn-icon--editar {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(14, 165, 233, 0.35);
}

.btn-icon--editar:hover {
  background: #0284c7;
  color: #fff;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.4);
}

.btn-icon--borrar {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-icon--borrar:hover {
  background: #fecaca;
  color: #991b1b;
}

.estado-form {
  margin: 0;
  display: flex;
  align-items: center;
}

.estado-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 2px;
  background: #fff;
  border: 1px solid #e2e8f0;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.estado-picker:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* Colores bien distintos por estado (combo Encomiendas / pedidos) */
.estado-picker--pendiente {
  background: #fff7ed;
  border-color: #fb923c;
  border-left: 4px solid #ea580c;
}
.estado-picker--preparado {
  background: #eef2ff;
  border-color: #818cf8;
  border-left: 4px solid #4f46e5;
}
.estado-picker--retirado {
  background: #ecfeff;
  border-color: #22d3ee;
  border-left: 4px solid #0891b2;
}
.estado-picker--en-transporte {
  background: #e0f2fe;
  border-color: #38bdf8;
  border-left: 4px solid #0284c7;
}
.estado-picker--en-deposito {
  background: #fdf4ff;
  border-color: #e879f9;
  border-left: 4px solid #c026d3;
}
.estado-picker--en-reparto {
  background: #fef9c3;
  border-color: #facc15;
  border-left: 4px solid #ca8a04;
}
.estado-picker--cobrado {
  background: #fff1f2;
  border-color: #fb7185;
  border-left: 4px solid #e11d48;
}
.estado-picker--entregado {
  background: #ecfdf5;
  border-color: #34d399;
  border-left: 4px solid #059669;
}
.estado-picker--liquidacion,
.estado-picker--liquidación {
  background: #f1f5f9;
  border-color: #94a3b8;
  border-left: 4px solid #475569;
}

.estado-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 7px 32px 7px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #334155;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  cursor: pointer;
  min-width: 148px;
  line-height: 1.2;
}

.estado-select:focus {
  outline: none;
}

.estado-picker--pendiente .estado-select { color: #9a3412; }
.estado-picker--preparado .estado-select { color: #3730a3; }
.estado-picker--retirado .estado-select { color: #0e7490; }
.estado-picker--en-transporte .estado-select { color: #0369a1; }
.estado-picker--en-deposito .estado-select { color: #a21caf; }
.estado-picker--en-reparto .estado-select { color: #854d0e; }
.estado-picker--cobrado .estado-select { color: #be123c; }
.estado-picker--entregado .estado-select { color: #047857; }
.estado-picker--liquidacion .estado-select,
.estado-picker--liquidación .estado-select { color: #334155; }

/* Badges alineados a la misma paleta */
.badge-pendiente {
  background: #ffedd5;
  color: #9a3412;
}
.badge-preparado {
  background: #e0e7ff;
  color: #3730a3;
}
.badge-retirado {
  background: #cffafe;
  color: #0e7490;
  border: 1px solid #67e8f9;
}
.badge-en-transporte {
  background: #bae6fd;
  color: #0369a1;
}
.badge-en-deposito {
  background: #fae8ff;
  color: #a21caf;
}
.badge-en-reparto {
  background: #fef08a;
  color: #854d0e;
}
.badge-cobrado {
  background: #ffe4e6;
  color: #be123c;
}
.badge-entregado {
  background: #d1fae5;
  color: #047857;
}
.badge-liquidacion,
.badge-liquidación {
  background: #e2e8f0;
  color: #334155;
}

.table-listado .cell-acciones {
  text-align: right;
  padding-right: 16px;
}

.table-listado thead th:last-child {
  text-align: right;
  padding-right: 16px;
}

.table-editable .input-cell {
  width: 100%;
  min-width: 100px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fafafa;
}

.table-editable .input-cell:focus {
  background: #fff;
  border-color: var(--accent);
  outline: none;
}

.table-editable .input-num {
  max-width: 110px;
  text-align: right;
}

.table-editable td {
  vertical-align: middle;
}

/* ?? Liquidaci?n (mismo estilo que Viajes/Pedidos) ?? */
.form-grid--toolbar {
  margin-bottom: 16px;
}

.field-check .chk-todos {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.col-chk {
  width: 44px;
  text-align: center;
}

.col-chk input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.liq-seleccion {
  margin-top: 8px;
  margin-bottom: 0;
}

.field select {
  appearance: auto;
  cursor: pointer;
}

.field-cliente .input-nuevo-cliente {
  margin-top: 8px;
}

.col-debe {
  color: #1e40af;
}

.col-haber {
  color: #9d174d;
}

.col-saldo {
  font-weight: 600;
  color: #0f172a;
}

.card-header-row,
.page-header--actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-header-row {
  margin-bottom: 12px;
  align-items: center;
}

.page-header--actions > div:first-child {
  flex: 1 1 12rem;
  min-width: 0;
}

.page-header--actions .page-header-actions {
  flex: 0 0 auto;
  margin-left: auto;
  justify-content: flex-end;
}

.page-header--actions .subtitle {
  margin-top: 4px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.detalle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px 16px;
  margin: 0;
}

.detalle-item {
  margin: 0;
}

.detalle-item dt {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 2px;
}

.detalle-item dd {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text);
}

.detalle-hint {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.detalle-item--total {
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.detalle-item--total .total-viaje {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.cell-acciones .acciones-toolbar {
  min-width: 280px;
}

.field-choferes .label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.field-choferes-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row-bultos-choferes .field-choferes-body {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
}

.choferes-checklist {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}

.check-row input {
  width: auto;
  margin: 0;
}

.field-chofer-nuevo {
  flex: 1;
  min-width: min(100%, 220px);
  margin: 0;
}

.field-chofer-nuevo label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.field-choferes .field-hint {
  font-size: 0.7rem;
  color: var(--muted);
  margin: 6px 0 0;
  width: 100%;
}

@media (max-width: 720px) {
  .row-bultos-choferes {
    grid-template-columns: 1fr;
  }
}

.card-header-row h2 {
  margin-bottom: 0;
}

#libro-liquidaciones,
#filtros-liquidacion {
  scroll-margin-top: 16px;
}

.fila-pedido[id^="pedido-"],
.fila-detalle[id^="detalle-"],
.fila-grupo[id^="grupo-pedido-"] {
  scroll-margin-top: 80px;
}

.fila-grupo:focus,
.fila-grupo:focus-visible,
.fila-grupo--focus,
.fila-grupo--focus > td,
.fila-pedido:focus,
.fila-pedido:focus-visible,
.fila-pedido--activa:focus,
.fila-pedido--activa:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

@media (max-width: 640px) {
  .layout:not(.collapsed) .sidebar {
    position: fixed;
    z-index: 100;
    height: 100vh;
  }

  .main {
    padding: 0 16px 16px;
  }

  .topbar {
    margin: 0 -16px 16px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .global-search-wrap {
    flex-direction: column;
  }

  .global-search-btn {
    width: 100%;
  }
}

/* ?? Dashboard ?? */
.dash-hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: var(--radius);
  color: #f8fafc;
  box-shadow: var(--shadow);
}

.dash-title {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
  width: 100%;
}

.dash-hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dash-subtitle {
  color: #94a3b8;
  font-size: 0.8rem;
}

.dash-fecha-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dash-fecha-form label {
  font-size: 0.85rem;
  color: #cbd5e1;
}

.dash-fecha-form input {
  width: 110px;
  padding: 5px 8px;
  border: 1px solid #475569;
  border-radius: 6px;
  background: #334155;
  color: #f8fafc;
  font-size: 0.82rem;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.dash-kpi {
  background: var(--card);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--accent);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-kpi-ok { border-left-color: #22c55e; }
.dash-kpi-warn { border-left-color: #f59e0b; }
.dash-kpi-money { border-left-color: #6366f1; }
.dash-kpi-alert { border-left-color: #0ea5e9; }
.dash-kpi-danger { border-left-color: #ef4444; }

.dash-kpi-label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.dash-kpi-money .dash-kpi-value {
  font-size: 1.1rem;
}

.dash-kpi-link {
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  margin-top: 2px;
}

.dash-kpi-link:hover {
  text-decoration: underline;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
}

.dash-charts h2,
.dash-movimientos h2 {
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.dash-chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dash-chart-box {
  min-height: 0;
}

.dash-chart-box h3 {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}

.dash-feed {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dash-feed-item {
  display: grid;
  grid-template-columns: 48px 24px 1fr;
  align-items: center;
  gap: 6px;
  padding: 7px 0;
  border-bottom: 1px solid #e2e8f0;
}

.dash-feed-item:last-child {
  border-bottom: none;
}

.dash-feed-time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dash-feed-icon {
  font-size: 0.9rem;
  text-align: center;
}

.dash-feed-text {
  font-size: 0.82rem;
  line-height: 1.3;
}

.dash-empty {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 8px 0;
}

@media (max-width: 960px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }

  .dash-chart-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .dash-hero {
    padding: 18px 16px;
  }

  .dash-kpi-value {
    font-size: 1.5rem;
  }
}

/* ?? Login ?? */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1e293b 0%, #0ea5e9 100%);
  padding: 20px;
}

.login-card {
  background: var(--card);
  width: 100%;
  max-width: 360px;
  padding: 22px 20px;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22);
}

.login-brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.login-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.login-brand {
  font-size: 1.35rem;
  text-align: center;
  color: var(--text);
  margin: 0;
}

.login-version {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
}

.login-subtitle {
  text-align: center;
  color: var(--muted);
  margin: 6px 0 22px;
  font-size: 0.92rem;
}

.login-form .field {
  margin-bottom: 16px;
}

.login-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.login-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
}

.login-form input:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

.login-btn {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

/* ?? Caja de usuario en el men? ?? */
.sidebar-user {
  margin: 6px 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--sidebar-text);
}

.sidebar-user-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 3px 8px rgba(99, 102, 241, 0.3);
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 0.62rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-rol {
  font-size: 0.55rem;
  color: var(--sidebar-text-dim);
}

.sidebar-logout {
  flex-shrink: 0;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.85rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.layout.collapsed .sidebar-user {
  margin: 8px auto 14px;
  padding: 6px;
  background: none;
  border: none;
}

.layout.collapsed .sidebar-user-info,
.layout.collapsed .sidebar-logout {
  display: none;
}

/* ?? Usuarios y permisos ?? */
.permisos-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 14px 0;
}

.permisos-fieldset legend {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0 6px;
}

.permisos-fieldset--disabled {
  opacity: 0.5;
}

.permisos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px 16px;
  margin-top: 8px;
}

.permiso-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

.usuarios-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.usuario-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.usuario-item.open {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.12);
}

.usuario-item-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background 0.15s ease;
}

.usuario-item-head:hover {
  background: #f1f5f9;
}

.usuario-item.open .usuario-item-head {
  background: #eff6ff;
}

.usuario-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.usuario-head-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.usuario-head-name {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
}

.usuario-head-sub {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.usuario-head-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.usuario-caret {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.usuario-item.open .usuario-caret {
  transform: rotate(90deg);
}

.usuario-detalle {
  display: none;
  padding: 18px 16px;
  border-top: 1px solid #e2e8f0;
}

.usuario-item.open .usuario-detalle {
  display: block;
}

.usuario-item-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #cbd5e1;
}

@media (max-width: 560px) {
  .usuario-head-sub {
    display: none;
  }
}

.reset-password-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.reset-password-form input {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.88rem;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
}

.badge-admin {
  background: #0ea5e9;
  color: #fff;
}

.badge-chofer {
  background: #f59e0b;
  color: #fff;
}

.badge-user {
  background: #e2e8f0;
  color: var(--text);
}

.badge-off {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-super {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

.super-aviso {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 14px 16px;
  color: #1e3a8a;
  font-size: 0.92rem;
}

.super-aviso p + p {
  margin-top: 6px;
}

.empty-hint {
  color: var(--muted);
  font-size: 0.82rem;
}

/* —— Notebook / laptop density (1366×768, 1440×900) —— */
@media (max-height: 900px) {
  .main {
    padding: 8px 12px 14px;
  }

  .page-header {
    margin-bottom: 6px;
  }

  .page-header h1 {
    font-size: 1.1rem;
  }

  .card {
    padding: 10px 12px;
    margin-bottom: 8px;
  }

  .dash-hero {
    padding: 10px 12px;
    margin-bottom: 8px;
  }

  .dash-kpis {
    margin-bottom: 8px;
  }

  .dash-kpi-value {
    font-size: 1.2rem;
  }

  .dash-kpi-money .dash-kpi-value {
    font-size: 1rem;
  }

  th,
  td {
    padding: 4px 6px;
  }
}

@media (max-width: 1440px) {
  :root {
    --sidebar-w: 148px;
    --sidebar-collapsed: 48px;
    --fs: 10.5px;
    --fs-form: 0.76rem;
    --fs-table: 0.7rem;
    --fs-label: 0.6rem;
  }

  .main {
    padding: 8px 10px 12px;
    min-width: 0;
  }

  .card {
    padding: 10px 12px;
    margin-bottom: 8px;
  }

  .page-header h1 {
    font-size: 1.15rem;
  }

  .page-header .subtitle {
    font-size: 0.78rem;
  }

  .card-search .field {
    min-width: 100px;
    flex: 0 1 118px;
  }

  .card-search .field-filtro-transporte,
  .card-search .field-filtro-estado,
  .card-search .field-filtro-pago {
    min-width: 170px;
    flex: 1 1 200px;
    max-width: 260px;
  }

  .card-search .field-filtro-cliente {
    min-width: 160px;
    flex: 0 1 200px;
    max-width: 240px;
  }

  .card-search .field-filtro-chofer {
    min-width: 140px;
    flex: 0 1 170px;
    max-width: 200px;
  }

  .search-bar--viajes {
    flex-wrap: wrap;
  }

  .search-bar--viajes .field-filtro-fecha {
    flex: 0 1 110px;
    min-width: 100px;
    max-width: 130px;
  }

  .search-bar--viajes .field-filtro-cliente {
    flex: 1 1 200px;
    min-width: 160px;
    max-width: none;
  }

  .search-bar--viajes .field-filtro-lugar,
  .search-bar--viajes .field-filtro-transporte,
  .search-bar--viajes .field-filtro-estado,
  .search-bar--viajes .field-filtro-pago {
    flex: 0 1 120px;
    min-width: 100px;
    max-width: 150px;
  }

  .card-search .field-acciones-filtro {
    flex: 0 0 auto;
    min-width: auto;
  }

  .card-search .search-bar {
    gap: 6px;
  }

  .search-bar--filtros .field input,
  .search-bar--filtros .field select,
  .search-bar--filtros .filtro-estado {
    min-height: 1.65rem;
    padding: 2px 5px;
    font-size: 0.7rem;
  }

  .btn,
  .btn-primary,
  .btn-secondary {
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .filtros-acciones .btn,
  .field-acciones-filtro .btn {
    padding: 3px 8px;
    font-size: 0.68rem;
    min-height: 1.65rem;
  }

  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    font-size: var(--fs-table);
  }

  th,
  td {
    padding: 3px 5px;
  }
}

@media (max-width: 1366px) {
  :root {
    --sidebar-w: 142px;
    --fs: 10px;
  }

  .form-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px 8px;
  }

  .pedido-section-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pedido-operacion {
    grid-template-columns: 1fr 1fr minmax(7rem, 0.7fr);
  }

  .pedido-fields {
    gap: 6px 8px;
  }

  .table-viajes th,
  .table-viajes td,
  .table-listado th,
  .table-listado td {
    padding: 3px 4px;
  }
}

@media (max-width: 1100px) {
  .pedido-section-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pedido-operacion {
    grid-template-columns: 1fr 1fr;
  }

  .pedido-operacion-card--total {
    grid-column: 1 / -1;
    text-align: left;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ?? Tipograf?a compacta formularios/listados ?? */
.form-tarifas .field input,
.form-tarifas .field label {
  font-size: var(--fs-form);
}
.form-tarifas .field label {
  font-size: var(--fs-label);
}
.table-listado,
.table-lineas {
  font-size: var(--fs-table);
}
.field-contrareembolso {
  margin-top: 8px;
  max-width: 12rem;
}
.input-readonly {
  background: #f1f5f9 !important;
  color: #475569;
}
.input-hora-parada {
  min-height: 1.7rem;
  padding: 2px 4px;
  font-size: var(--fs-form);
}
.card-parada-dia {
  margin-bottom: 12px;
}
.parada-dia-titulo {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.parada-dia-nombre {
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: #0f172a;
}
.parada-dia-fecha {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}
.form-actions--reporte {
  display: flex;
  gap: 8px;
  padding: 12px 0 24px;
}

/* ?? L?nea de tiempo de estados (horizontal) ?? */
.timeline-pedido {
  margin: 10px 0 14px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  width: 100%;
  flex: 1 1 100%;
}
.timeline-titulo {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}
.timeline-lista {
  list-style: none;
  margin: 0;
  padding: 4px 0 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0;
  border: none;
  overflow-x: auto;
}
.timeline-item {
  position: relative;
  flex: 1 1 0;
  min-width: 5.75rem;
  max-width: 11rem;
  padding: 16px 6px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  font-size: var(--fs-form);
}
.timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 3px;
  left: calc(50% + 6px);
  width: calc(100% - 12px);
  height: 2px;
  background: #cbd5e1;
  z-index: 0;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--accent);
  z-index: 1;
}
.timeline-estado {
  font-weight: 600;
  color: #0f172a;
  line-height: 1.2;
  margin-top: 2px;
}
.timeline-fecha,
.timeline-hora {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.72rem;
  line-height: 1.25;
}
.timeline-item--vacio {
  color: var(--muted);
  font-style: italic;
  max-width: none;
  flex: 1 1 auto;
  align-items: flex-start;
  text-align: left;
  padding-left: 14px;
}
.timeline-item--vacio::before {
  left: 0;
  transform: none;
  background: #94a3b8;
  box-shadow: none;
}
.timeline-item--vacio::after {
  display: none;
}

@media (max-width: 900px) {
  .pedido-operacion--4 {
    grid-template-columns: 1fr;
  }
  .bultos-row--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pedido-section-grid--uniform {
    grid-template-columns: 1fr 1fr;
  }
}

.form-grid--cadeteria-ancha {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.form-grid--cadeteria-ancha .field-cadete-config,
.form-grid--cadeteria-ancha .field-chofer-config {
  grid-column: span 2;
  min-width: 280px;
}
.form-grid--cadeteria-ancha .field input,
.form-grid--cadeteria-ancha .field select {
  min-height: 2.2rem;
  font-size: var(--fs-form);
}

/* ?? Campos uniformes (pedidos / localidades / clientes) ?? */
.pedido-fields,
.form-localidad .pedido-fields,
.form-cliente .pedido-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 10px;
  align-items: end;
}

/* Entrega en Viajes: anula el grid 4 columnas iguales */
.detalle-entrega-panel .pedido-fields.pedido-fields--entrega {
  display: grid;
  grid-template-columns: auto minmax(10rem, 0.5fr) 5.5rem auto;
  gap: 6px 12px;
  align-items: end;
  width: 100%;
}

.detalle-entrega-panel .pedido-fields--entrega .field-entrega-nombre {
  width: 100%;
  max-width: 14rem;
}

.detalle-entrega-panel .pedido-fields--entrega .field-entrega-dni {
  width: 5.5rem;
  max-width: 5.5rem;
}

.detalle-entrega-panel .pedido-fields--entrega .field-entrega-nombre > input {
  width: 100%;
  max-width: 14rem;
  text-align: left;
}

.detalle-entrega-panel .pedido-fields--entrega .field-entrega-dni > input {
  width: 5.5rem;
  max-width: 5.5rem;
  text-align: right;
}

.pedido-fields--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 28rem;
}

.pedido-fields--pago {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 42rem;
}

@media (max-width: 720px) {
  .pedido-fields--pago {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

.pedido-fields > .field,
.form-localidad .pedido-fields > .field,
.form-cliente .pedido-fields > .field {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
}

.pedido-fields > .field > label,
.form-localidad .pedido-fields > .field > label,
.form-cliente .pedido-fields > .field > label {
  min-height: 1.15em;
  line-height: 1.2;
}

.pedido-fields > .field > input,
.pedido-fields > .field > select,
.pedido-fields > .field > textarea,
.pedido-fields > .field .reembolso-inline > input:not(.reembolso-cant),
.form-localidad .pedido-fields > .field > input,
.form-localidad .pedido-fields > .field > select,
.form-cliente .pedido-fields > .field > input,
.form-cliente .pedido-fields > .field > select {
  width: 100%;
  max-width: none;
  min-height: 2rem;
  height: 2rem;
  padding: 4px 8px;
  font-size: var(--fs-form);
  box-sizing: border-box;
}

.pedido-fields > .field .reembolso-inline > input.reembolso-cant {
  width: 2.75rem;
  max-width: 2.75rem;
  min-width: 2.75rem;
  min-height: 2rem;
  height: 2rem;
  padding: 4px 6px;
  font-size: var(--fs-form);
  box-sizing: border-box;
  text-align: center;
}

.form-cliente .pedido-fields > .field-check {
  justify-content: flex-end;
  padding-bottom: 0;
  min-height: 2rem;
}

.form-cliente .pedido-fields > .field-check .label-check {
  min-height: 2rem;
  height: 2rem;
  padding: 0 2px;
}

.form-cliente .pedido-fields > .field-nueva-localidad {
  grid-column: span 2;
  align-self: stretch;
}

.pedido-fields > .field-span-2 {
  grid-column: span 2;
}

.pedido-fields > .field-span-full {
  grid-column: 1 / -1;
}

.pedido-fields .factor-comision-group {
  display: flex;
  gap: 4px;
  height: 2rem;
  align-items: stretch;
}

.pedido-fields .factor-comision-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 2rem;
  font-size: var(--fs-form);
}

.pedido-fields .factor-comision-btn span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  font-size: var(--fs-form);
}

.pedido-fields .field-total-align .total-viaje,
.pedido-fields .field-subtotal-bultos .total-readonly {
  min-height: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  padding: 0 8px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 5px;
}

.form-localidad .form-actions {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .pedido-fields,
  .form-localidad .pedido-fields,
  .form-cliente .pedido-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pedido-fields > .field-span-2 {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .pedido-fields,
  .form-localidad .pedido-fields,
  .form-cliente .pedido-fields {
    grid-template-columns: 1fr;
  }
  .pedido-fields > .field-span-2,
  .pedido-fields > .field-span-full {
    grid-column: 1;
  }
}

/* ?? Cadete / comisi?n-chofer / total ?? */
.pedido-operacion-layout {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.pedido-operacion-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pedido-operacion-main--row {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}

.pedido-operacion-main--row .pedido-operacion-box--cadete {
  flex: 1 1 22rem;
  min-width: 18rem;
}

.pedido-operacion-main--row .pedido-operacion-box--chofer {
  flex: 1 1 12rem;
  min-width: 10rem;
  display: flex;
  align-items: flex-end;
}

.pedido-fields--cadete-box {
  grid-template-columns: 1.4fr 0.7fr 1.1fr;
  max-width: none;
  align-items: end;
}

.pedido-fields--cadete-box > .field-compact {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
}

.pedido-fields--cadete-box > .field-compact > label {
  min-height: 1.1em;
  margin-bottom: 2px;
}

.pedido-fields--cadete-box > .field-compact > input,
.pedido-fields--cadete-box > .field-compact .factor-comision-group {
  height: 2rem;
  min-height: 2rem;
  box-sizing: border-box;
}

.pedido-fields--cadete-box > .field-comision-cadete {
  position: relative;
}

.pedido-fields--cadete-box > .field-comision-cadete .field-hint[hidden] {
  display: none !important;
}

.pedido-fields--cadete-box > .field-comision-cadete .field-hint:not([hidden]) {
  display: block;
  margin: 4px 0 0;
  font-size: 0.72rem;
  color: #0369a1;
  font-weight: 600;
}

.pedido-operacion-box {
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.pedido-fields--box {
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  max-width: 22rem;
}

.pedido-operacion-box .field-compact label {
  font-size: 0.58rem;
}

.pedido-operacion-box .field-compact input {
  min-height: 1.7rem;
  height: 1.7rem;
  padding: 3px 6px;
  font-size: 0.72rem;
}

.pedido-operacion-box .field-hint {
  font-size: 0.58rem;
  margin-top: 2px;
}

.pedido-operacion-total {
  flex: 0 0 11.5rem;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding: 10px 14px;
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  border: 1px solid #7dd3fc;
  border-radius: 10px;
  min-width: 10rem;
}

.pedido-operacion-total > .label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.pedido-operacion-total .total-viaje {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.15;
  color: #0c4a6e;
  letter-spacing: -0.02em;
}

@media (max-width: 900px) {
  .pedido-operacion-layout {
    flex-direction: column;
  }
  .pedido-operacion-total {
    flex: 1 1 auto;
    width: 100%;
    align-items: flex-end;
  }
  .pedido-fields--box,
  .pedido-fields--cadete {
    max-width: none;
  }
}

.pedido-operacion-main {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
}

.pedido-operacion-box--cadete {
  flex: 1 1 18rem;
  min-width: 0;
}

.pedido-operacion-box--chofer {
  flex: 0 1 14rem;
  min-width: 11rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pedido-fields--cadete-box {
  grid-template-columns: 1.4fr 0.7fr 1.1fr;
  max-width: none;
  align-items: end;
}

.pedido-operacion-box--chofer .field-compact {
  width: 100%;
}

@media (max-width: 900px) {
  .pedido-operacion-main {
    flex-direction: column;
  }
  .pedido-operacion-box--cadete,
  .pedido-operacion-box--chofer {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }
  .pedido-fields--cadete-box {
    grid-template-columns: 1fr 1fr;
  }
}

/* ?? Viajes: estado, pago, acciones y combo m?s compactos ?? */
.table-viajes .badge-estado {
  padding: 1px 5px;
  font-size: 0.58rem;
  letter-spacing: 0.01em;
}

.table-viajes .badge-pago {
  padding: 2px 6px;
  font-size: 0.58rem;
}

.badge-ingreso,
.table-viajes .badge-ingreso {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.58rem;
  font-weight: 600;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.badge-ingreso--web,
.table-viajes .badge-ingreso--web {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-ingreso--chofer,
.table-viajes .badge-ingreso--chofer {
  background: #fef3c7;
  color: #92400e;
}

/* Colores distintos y estables por chofer (hash del nombre → 0..7) */
.badge-ingreso--chofer-0,
.table-viajes .badge-ingreso--chofer-0 {
  background: #ccfbf1;
  color: #0f766e;
}
.badge-ingreso--chofer-1,
.table-viajes .badge-ingreso--chofer-1 {
  background: #fef3c7;
  color: #92400e;
}
.badge-ingreso--chofer-2,
.table-viajes .badge-ingreso--chofer-2 {
  background: #ffe4e6;
  color: #9f1239;
}
.badge-ingreso--chofer-3,
.table-viajes .badge-ingreso--chofer-3 {
  background: #d1fae5;
  color: #065f46;
}
.badge-ingreso--chofer-4,
.table-viajes .badge-ingreso--chofer-4 {
  background: #e0f2fe;
  color: #075985;
}
.badge-ingreso--chofer-5,
.table-viajes .badge-ingreso--chofer-5 {
  background: #ffedd5;
  color: #9a3412;
}
.badge-ingreso--chofer-6,
.table-viajes .badge-ingreso--chofer-6 {
  background: #e2e8f0;
  color: #334155;
}
.badge-ingreso--chofer-7,
.table-viajes .badge-ingreso--chofer-7 {
  background: #fce7f3;
  color: #9d174d;
}

.table-viajes .col-ingreso {
  white-space: nowrap;
  font-size: 0.65rem;
}

.table-viajes .acciones-toolbar {
  gap: 4px;
  padding: 2px;
  border-radius: 8px;
}

.table-viajes .btn-accion {
  padding: 3px 8px;
  font-size: 0.65rem;
  border-radius: 6px;
  line-height: 1.2;
}

.table-viajes .estado-picker {
  border-radius: 6px;
  padding: 1px;
}

.table-viajes .estado-select {
  padding: 3px 22px 3px 6px;
  font-size: 0.65rem;
  min-width: 7.5rem;
  max-width: 9.5rem;
  background-size: 8px;
  background-position: right 6px center;
  border-radius: 5px;
}

.table-viajes .estado-picker--pendiente,
.table-viajes .estado-picker--en-transporte,
.table-viajes .estado-picker--en-deposito,
.table-viajes .estado-picker--entregado,
.table-viajes .estado-picker--cobrado,
.table-viajes .estado-picker--preparado,
.table-viajes .estado-picker--retirado,
.table-viajes .estado-picker--en-reparto {
  border-left-width: 2px;
}

.table-viajes td.cell-acciones,
.table-viajes .col-pago {
  padding-top: 3px;
  padding-bottom: 3px;
}

.table-viajes th,
.table-viajes td {
  vertical-align: middle;
}

.th-orden {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.45rem;
  margin: -0.2rem -0.3rem;
  border-radius: 6px;
  border: 1px solid transparent;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.th-orden:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-decoration: none;
}
.th-orden--activo {
  color: #0369a1;
  background: color-mix(in srgb, var(--accent) 22%, #fff);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: inset 0 -2px 0 var(--accent);
  font-weight: 700;
}
.th-orden-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1em;
  font-size: 0.85em;
  line-height: 1;
  opacity: 0.75;
}
.th-orden--activo .th-orden-icon {
  opacity: 1;
  color: var(--accent);
}

/* Checks en formularios (factura, domicilio) */
.field-check {
  display: flex;
  align-items: flex-end;
  padding-bottom: 0;
}

.label-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.label-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.campo-requerido label::after {
  content: " *";
  color: #b33;
}

.label-opcional {
  font-weight: 500;
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.clientes-leyenda {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.badge-cliente-app {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: middle;
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.table-clientes tbody tr.cliente-fila-app {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.08), transparent 55%);
}

.table-clientes tbody tr.cliente-fila-app:hover {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.04) 55%);
}

.table-clientes .cell-actions {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
  text-align: right;
  padding-right: 10px;
}

.table-clientes .acciones-cliente {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.table-clientes .form-borrar-cliente {
  display: inline-flex;
  margin: 0;
  padding: 0;
}

.table-clientes .acciones-cliente .btn-accion {
  padding: 3px 8px;
  font-size: 0.62rem;
  border-radius: 5px;
  min-height: 22px;
  line-height: 1.1;
  box-shadow: none;
}

/* Notificaciones WhatsApp */
.table-notificaciones .cell-check {
  width: 36px;
  text-align: center;
}

.table-notificaciones .cell-tel {
  white-space: nowrap;
}

.notif-envio-fields {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr);
  gap: 10px 14px;
  align-items: start;
  margin-bottom: 14px;
  max-width: 52rem;
}

.notif-envio-fields > .field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  min-width: 0;
}

.notif-envio-fields > .field > label {
  min-height: 1.15em;
  line-height: 1.2;
}

.notif-envio-fields .field-notif-estado select {
  width: 100%;
  min-height: 2rem;
  height: 2rem;
  box-sizing: border-box;
  font-size: var(--fs-form);
}

.notif-envio-fields .field-notif-mensaje .input-mensaje-notif {
  width: 100%;
  min-height: 5.25rem;
  height: auto;
  resize: vertical;
  padding: 8px 10px;
  font-size: var(--fs-form);
  box-sizing: border-box;
  line-height: 1.35;
}

.form-actions--notif {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.card-repartos-pdf .field-hint {
  margin-top: 0;
  margin-bottom: 10px;
}

.table-repartos .cell-domicilio {
  max-width: 16rem;
  white-space: normal;
  line-height: 1.3;
  word-break: break-word;
  vertical-align: middle;
}

.table-repartos {
  width: 100%;
  min-width: 720px;
  table-layout: auto;
}

.table-repartos th,
.table-repartos td {
  padding: 4px 5px;
  vertical-align: middle;
}

.table-repartos th {
  white-space: nowrap;
  font-size: 0.68rem;
}

.table-repartos .cell-check--reparto {
  min-width: 3.6rem;
  width: 3.6rem;
  text-align: center;
  vertical-align: middle;
}

.table-repartos .label-check--reparto-col {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #3f4a36;
}

.badge-reparto,
.badge-zona,
.badge-envio {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1.2;
  vertical-align: middle;
}

.badge-reparto--camino {
  background: #dcfce7;
  color: #166534;
}

.badge-reparto--dom-rosario {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-reparto--retirar {
  background: #f5e6c8;
  color: #92400e;
}

.badge-reparto--reparto {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-zona--bsas {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-zona--ryz {
  background: #dcfce7;
  color: #15803d;
}

.badge-zona--rcba {
  background: #ffedd5;
  color: #c2410c;
}

.badge-envio--domicilio {
  background: #dbeafe;
  color: #1e40af;
  margin-right: 4px;
}

.badge-envio--sin {
  background: #fef08a;
  color: #854d0e;
  margin-right: 4px;
}

.badge-domicilio {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #1e3a5f;
  background: #e0f2fe;
  border-radius: 4px;
  vertical-align: middle;
}

.card-repartos-deposito .notif-envio-fields--deposito {
  grid-template-columns: 1fr;
  max-width: 40rem;
  margin-bottom: 10px;
}

.table-repartos tr.fila-ruta {
  background: #f0fdf4;
}

.table-repartos tr.fila-ruta td {
  background: transparent;
}

.table-repartos tr.fila-van-reparto td:first-child {
  box-shadow: inset 3px 0 0 #6b8f3c;
}

.table-repartos tr.fila-retirar-deposito {
  background: #fffbeb;
}

.table-repartos tr.fila-retirar-deposito td {
  background: transparent;
}

.km-sin-ubicar {
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.reparto-pedido-nro {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1e40af;
  letter-spacing: 0.01em;
}

.reparto-grupo-meta {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
}

.fila-reparto-parada.fila-reparto-grupo {
  cursor: pointer;
}

.fila-reparto-parada .col-expand {
  width: 1.5rem;
  text-align: center;
  color: var(--muted);
}

.fila-reparto-parada--abierta .fila-expand-icon {
  transform: rotate(90deg);
  display: inline-block;
}

.fila-reparto-pedido {
  background: rgba(15, 23, 42, 0.03);
}

.fila-reparto-pedido td {
  font-size: 0.92em;
}

.reparto-pedido-nro {
  font-weight: 700;
  margin-right: 0.4rem;
}

.reparto-grupo-pedidos,
.reparto-grupo-detalle {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reparto-grupo-detalle--dom li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
}

.repartos-paradas-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 6px;
}

.repartos-filtros-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 12px;
}

.repartos-filtros-head h2 {
  margin: 0;
}

.repartos-filtros-acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.repartos-filtros-acciones .field-hint {
  margin: 0;
  margin-right: 4px;
}

.repartos-paradas-head h2 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 12rem;
}

.repartos-paradas-head .field-mostrar-repartos {
  margin: 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.repartos-paradas-head .field-mostrar-repartos label {
  display: inline;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.repartos-paradas-head .field-mostrar-repartos .filtro-estado {
  width: auto;
  min-width: 11rem;
  min-height: 2rem;
}

.repartos-vista-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  margin: 0 0 10px;
  padding: 0;
}

.repartos-vista-toolbar .field-hint {
  margin: 0 0 6px;
  align-self: center;
}

#tablaRepartos tbody tr.fila-reparto-oculta {
  display: none !important;
}

.fila-reparto-grupo td {
  vertical-align: top;
}

.cell-pedidos-reparto {
  min-width: 7rem;
}

/* Repartos / tablas densas en notebook */
@media (max-width: 1366px) {
  .table-repartos {
    min-width: 680px;
  }

  .table-repartos .badge-reparto,
  .table-repartos .badge-zona,
  .table-repartos .badge-envio {
    font-size: 0.58rem;
    padding: 1px 5px;
  }

  .table-repartos .cell-domicilio {
    max-width: 11rem;
    font-size: 0.68rem;
  }

  .table-repartos .cell-tel {
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .card-repartos-deposito .notif-envio-fields--deposito {
    max-width: none;
  }

  .form-actions--notif {
    flex-wrap: wrap;
    gap: 6px;
  }
}

@media (max-width: 1100px) {
  .table-repartos {
    min-width: 640px;
  }

  .badge-reparto--dom-rosario,
  .badge-reparto--retirar {
    white-space: normal;
    max-width: 6.5rem;
    text-align: center;
  }

  .badge-zona {
    white-space: normal;
    max-width: 6rem;
    text-align: center;
    line-height: 1.15;
  }
}

@media (max-width: 700px) {
  .notif-envio-fields {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .card-search .field {
    min-width: 100%;
    flex: 1 1 100%;
  }
}

/* Formulario clientes */
.form-cliente .cliente-form-section {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.form-cliente .cliente-form-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.cliente-form-title {
  margin: 0 0 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-cliente .pedido-fields--cliente {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 12px;
  align-items: end;
  max-width: 52rem;
}

.form-cliente .pedido-fields--cliente > .field {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
}

.form-cliente .pedido-fields--cliente > .field > label {
  min-height: 1.15em;
  line-height: 1.2;
}

.form-cliente .pedido-fields--cliente > .field > input,
.form-cliente .pedido-fields--cliente > .field > select {
  width: 100%;
  max-width: none;
  min-height: 2rem;
  height: 2rem;
  padding: 4px 8px;
  font-size: var(--fs-form);
  box-sizing: border-box;
}

.form-cliente .pedido-fields--cliente > .field-span-2 {
  grid-column: span 2;
}

.form-cliente .pedido-fields--cliente > .field-span-full {
  grid-column: 1 / -1;
}

.form-cliente .pedido-fields--cliente > .field-check {
  justify-content: flex-start;
  min-height: auto;
  padding-bottom: 0;
}

.form-cliente .pedido-fields--cliente > .field-check > label:first-child {
  min-height: 1.15em;
  line-height: 1.2;
}

.form-cliente .pedido-fields--cliente > .field-check .label-check--input {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  box-sizing: border-box;
  font-weight: 600;
  width: 100%;
}

.form-actions--cliente {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  align-items: center;
}

@media (max-width: 900px) {
  .form-cliente .pedido-fields--cliente {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .form-cliente .pedido-fields--cliente {
    grid-template-columns: 1fr;
  }
  .form-cliente .pedido-fields--cliente > .field-span-2,
  .form-cliente .pedido-fields--cliente > .field-span-full {
    grid-column: 1;
  }
}

/* �� Dashboard acumulados �� */
.dash-kpi-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}
.dash-acumulados {
  margin-top: 1rem;
}
.dash-kpis--acum {
  margin-bottom: 0.75rem;
}

/* Bultos por estado — pipeline */
.dash-bultos-estados {
  margin: 1rem 0 16px;
  padding: 16px 18px 18px;
  max-width: 920px;
}
.dash-bultos-estados-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin-bottom: 14px;
}
.dash-bultos-estados-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}
.dash-bultos-estados-sub {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.dash-bultos-pipeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  position: relative;
}
.dash-bultos-pipeline::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 11px;
  height: 2px;
  background: linear-gradient(90deg, #e2e8f0, #cbd5e1, #e2e8f0);
  z-index: 0;
}
.dash-bultos-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 0 4px;
  min-width: 0;
}
.dash-bultos-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #94a3b8;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
  flex-shrink: 0;
}
.dash-bultos-num {
  font-size: 1.35rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.dash-bultos-label {
  font-size: 0.62rem;
  font-weight: 650;
  line-height: 1.25;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  max-width: 100%;
  overflow-wrap: break-word;
}
.dash-bultos-step.is-empty .dash-bultos-num {
  color: #94a3b8;
  font-weight: 600;
}
.dash-bultos-step--pendiente .dash-bultos-dot { background: #f59e0b; box-shadow: 0 0 0 1px #fde68a; }
.dash-bultos-step--preparado .dash-bultos-dot { background: #6366f1; box-shadow: 0 0 0 1px #c7d2fe; }
.dash-bultos-step--retirado .dash-bultos-dot { background: #d97706; box-shadow: 0 0 0 1px #fde68a; }
.dash-bultos-step--en-transporte .dash-bultos-dot { background: #0ea5e9; box-shadow: 0 0 0 1px #bae6fd; }
.dash-bultos-step--en-deposito .dash-bultos-dot { background: #8b5cf6; box-shadow: 0 0 0 1px #ddd6fe; }
.dash-bultos-step--en-reparto .dash-bultos-dot { background: #16a34a; box-shadow: 0 0 0 1px #bbf7d0; }
.dash-bultos-step--entregado .dash-bultos-dot { background: #059669; box-shadow: 0 0 0 1px #a7f3d0; }

.dash-bultos-step--pendiente .dash-bultos-num { color: #b45309; }
.dash-bultos-step--preparado .dash-bultos-num { color: #4338ca; }
.dash-bultos-step--retirado .dash-bultos-num { color: #b45309; }
.dash-bultos-step--en-transporte .dash-bultos-num { color: #0369a1; }
.dash-bultos-step--en-deposito .dash-bultos-num { color: #6d28d9; }
.dash-bultos-step--en-reparto .dash-bultos-num { color: #15803d; }
.dash-bultos-step--entregado .dash-bultos-num { color: #047857; }

@media (max-width: 720px) {
  .dash-bultos-pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
  }
  .dash-bultos-pipeline::before {
    display: none;
  }
  .dash-bultos-step {
    align-items: flex-start;
    text-align: left;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
  }
  .dash-bultos-num {
    font-size: 1.2rem;
    order: 2;
  }
  .dash-bultos-label {
    order: 3;
    flex: 1 1 auto;
    font-size: 0.68rem;
  }
}

.dash-acum-estados-title {
  margin: 0.5rem 0 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}
.dash-estado-chip--acum {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-estado-importe {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
}

/* �� Plantilla viajes form �� */
.form-plantilla-viajes .plantilla-fields {
  display: grid;
  gap: 10px 14px;
  align-items: end;
  margin-bottom: 12px;
}
.form-plantilla-viajes .plantilla-fields--top {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.form-plantilla-viajes .plantilla-fields--ops {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr);
}
.form-plantilla-viajes .field-hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 4px 0 0;
}
.form-plantilla-viajes .input-nuevo-cadete {
  margin-top: 6px;
}
@media (max-width: 900px) {
  .form-plantilla-viajes .plantilla-fields--top,
  .form-plantilla-viajes .plantilla-fields--ops {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .form-plantilla-viajes .plantilla-fields--top,
  .form-plantilla-viajes .plantilla-fields--ops {
    grid-template-columns: 1fr;
  }
}

/* �� Pedidos: patente + carga r�pida �� */
.pedido-form-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.btn-carga-rapida {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}
.btn-carga-rapida:hover,
.btn-carga-rapida.is-active {
  background: #f59e0b;
  color: #fff;
  border-color: #d97706;
}
.patente-nueva-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.pedido-fields--viaje {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.pedido-fields--viaje > .field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
}

.pedido-fields--viaje > .field > label {
  margin-bottom: 2px;
}

.pedido-fields--viaje > .field > input,
.pedido-fields--viaje > .field > select {
  width: 100%;
  height: 2rem;
  min-height: 2rem;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .pedido-fields--viaje {
    grid-template-columns: 1fr;
  }
}

.campo-desde-plantilla > label,
.campo-desde-plantilla > .label {
  color: #1d4ed8;
}
.campo-desde-plantilla input,
.campo-desde-plantilla select {
  border-color: #93c5fd !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.form-pedido--rapida .pedido-section:first-of-type {
  border: 1px solid #93c5fd;
  border-radius: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #f8fbff, #fff);
}

/* Bultos compactos / alineados */
.pedido-fields--bultos {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-items: end;
}
.pedido-fields--bultos .field-bulto input.input-bulto,
.pedido-fields--bultos .reembolso-cant {
  max-width: 4.5rem;
  width: 100%;
  text-align: center;
}
.pedido-fields--bultos .field-subtotal-bultos {
  grid-column: span 1;
}
@media (max-width: 1100px) {
  .pedido-fields--bultos {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .pedido-fields--bultos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pedido-operacion-main--row {
    flex-direction: column;
  }
}

/* �� Carga r�pida (formulario aparte, tonos suaves) �� */
.card-carga-rapida {
  background: linear-gradient(165deg, #f0fdf9 0%, #f8fffc 40%, #ffffff 100%);
  border: 1px solid #a7f3d0;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.08);
}
.cr-bolt {
  color: #059669;
}
.form-carga-rapida {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cr-block {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #d1fae5;
  background: rgba(255, 255, 255, 0.72);
}
.cr-block--plantilla {
  background: linear-gradient(135deg, rgba(209, 250, 229, 0.55), rgba(255, 255, 255, 0.9));
  border-color: #6ee7b7;
}
.cr-block--cliente {
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.55), rgba(255, 255, 255, 0.9));
  border-color: #7dd3fc;
}
.cr-block--bultos {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.45), rgba(255, 255, 255, 0.92));
  border-color: #fcd34d;
}
.cr-block-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #065f46;
}
.cr-block--cliente .cr-block-title { color: #075985; }
.cr-block--bultos .cr-block-title { color: #92400e; }
.cr-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
  align-items: end;
}
.cr-fields--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cr-fields--bultos {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.cr-fields .field-span-2 { grid-column: span 2; }
.cr-fields .field input,
.cr-fields .field select {
  height: 2rem;
  min-height: 2rem;
  width: 100%;
  box-sizing: border-box;
}
.cr-banner {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  font-size: 0.8rem;
  font-weight: 600;
}
.cr-banner--warn {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}
.cr-datos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px dashed #86efac;
}
.cr-datos--cliente {
  border-color: #7dd3fc;
  background: rgba(240, 249, 255, 0.7);
}
.cr-dato {
  min-width: 0;
}
.cr-dato--wide {
  grid-column: span 2;
}
.cr-dato-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  margin-bottom: 2px;
}
.cr-dato-valor {
  display: block;
  font-size: 0.88rem;
  font-weight: 650;
  color: #134e4a;
  word-break: break-word;
}
.cr-datos--cliente .cr-dato-valor { color: #0c4a6e; }
.cr-factor {
  margin-top: 2px;
}
.cr-total-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #fde68a;
}
.cr-subtotal strong,
.cr-total strong {
  display: block;
  font-size: 1.05rem;
  color: #78350f;
}
.cr-total strong {
  font-size: 1.25rem;
  color: #065f46;
}
.btn-cr-guardar {
  margin-left: auto;
  background: #059669;
  border-color: #047857;
}
.btn-cr-guardar:hover {
  background: #047857;
}
@media (max-width: 900px) {
  .cr-fields--bultos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cr-datos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .cr-fields,
  .cr-fields--3,
  .cr-fields--bultos { grid-template-columns: 1fr 1fr; }
  .cr-dato--wide { grid-column: span 2; }
  .btn-cr-guardar { width: 100%; margin-left: 0; }
}

/* Pedidos: env�o a domicilio resaltado y alineado */
.form-pedido .pedido-fields > .field-envio-domicilio {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-self: end;
  min-width: 0;
}
.form-pedido .pedido-fields > .field-envio-domicilio > label:first-child {
  margin-bottom: 2px;
}
.form-pedido .field-envio-domicilio .label-check--input {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 2rem;
  min-height: 2rem;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #86efac;
  border-radius: 6px;
  background: linear-gradient(180deg, #ecfdf5, #f0fdf4);
  box-sizing: border-box;
  font-weight: 700;
  font-size: 0.74rem;
  color: #065f46;
  cursor: pointer;
}
.form-pedido .field-envio-domicilio .label-check--input:has(input:checked) {
  border-color: #059669;
  background: linear-gradient(180deg, #bbf7d0, #d1fae5);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.form-pedido .field-envio-domicilio .label-check--input input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #059669;
}

/* Switch: mostrar importe al chofer en la app */
.form-pedido .field-mostrar-importe .switch-toggle,
.form-carga-rapida .field-mostrar-importe .switch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 2rem;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
}
.form-pedido .field-mostrar-importe .switch-toggle:has(input:checked),
.form-carga-rapida .field-mostrar-importe .switch-toggle:has(input:checked) {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
}
.form-pedido .field-mostrar-importe .switch-toggle input,
.form-carga-rapida .field-mostrar-importe .switch-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.form-pedido .field-mostrar-importe .switch-slider,
.form-carga-rapida .field-mostrar-importe .switch-slider {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #94a3b8;
  transition: background 0.2s ease;
}
.form-pedido .field-mostrar-importe .switch-slider::after,
.form-carga-rapida .field-mostrar-importe .switch-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}
.form-pedido .field-mostrar-importe .switch-toggle:has(input:checked) .switch-slider,
.form-carga-rapida .field-mostrar-importe .switch-toggle:has(input:checked) .switch-slider {
  background: #2563eb;
}
.form-pedido .field-mostrar-importe .switch-toggle:has(input:checked) .switch-slider::after,
.form-carga-rapida .field-mostrar-importe .switch-toggle:has(input:checked) .switch-slider::after {
  transform: translateX(18px);
}
.form-pedido .field-mostrar-importe .switch-text,
.form-carga-rapida .field-mostrar-importe .switch-text {
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  line-height: 1.2;
}
.form-pedido .field-mostrar-importe .switch-toggle:has(input:checked) .switch-text,
.form-carga-rapida .field-mostrar-importe .switch-toggle:has(input:checked) .switch-text {
  color: #1e40af;
}
.form-pedido .field-mostrar-importe .switch-text-on,
.form-carga-rapida .field-mostrar-importe .switch-text-on {
  display: none;
}
.form-pedido .field-mostrar-importe .switch-toggle:has(input:checked) .switch-text-on,
.form-carga-rapida .field-mostrar-importe .switch-toggle:has(input:checked) .switch-text-on {
  display: inline;
}
.form-pedido .field-mostrar-importe .switch-toggle:has(input:checked) .switch-text-off,
.form-carga-rapida .field-mostrar-importe .switch-toggle:has(input:checked) .switch-text-off {
  display: none;
}

/* Movimientos de liquidación en pantallas Envío en ruta / Ros-Córdoba */
.card-movs-reparto {
  margin-bottom: 1rem;
}
.movs-reparto-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.movs-reparto-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.movs-reparto-sub {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
}
.empty--compact {
  margin: 0;
  padding: 0.6rem 0;
}
.table-movs-reparto tr.fila-caja-egreso > td {
  background: #fef2f2;
}
.table-movs-reparto tr.fila-caja-ingreso > td {
  background: #ecfdf5;
}
.modal-caja-liq-box {
  width: min(460px, 100%);
  padding: 0;
  overflow: hidden;
}
.modal-caja-liq-header {
  padding: 1.15rem 1.35rem 0.85rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid #e2e8f0;
}
.modal-caja-liq-header h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.modal-caja-liq-header .modal-entrega-hint {
  margin: 0;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.4;
}
.modal-caja-liq-form {
  padding: 1rem 1.35rem 1.25rem;
}
.modal-caja-liq-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.4rem;
}
.modal-caja-liq-switch {
  width: 100%;
  max-width: none;
}
.modal-caja-liq-switch .pago-switch-3__btn {
  flex: 1;
}
.modal-caja-liq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 480px) {
  .modal-caja-liq-grid {
    grid-template-columns: 1fr;
  }
  .movs-reparto-head {
    flex-direction: column;
  }
}
.modal-caja-liq-importe {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.modal-caja-liq-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.btn-egreso-caja {
  background: #b91c1c;
  border-color: #b91c1c;
}
.btn-egreso-caja:hover {
  background: #991b1b;
  border-color: #991b1b;
}
.btn-ingreso-caja {
  background: #047857;
  border-color: #047857;
}
.btn-ingreso-caja:hover {
  background: #065f46;
  border-color: #065f46;
}

/* Grupos de envío (envios-DDMMYY) */
.envio-grupo-block {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.envio-grupo-block--inbox {
  background: #fff7ed;
  border-color: #fed7aa;
}
.envio-grupo-block.is-drop-target {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
  background: #eff6ff;
}
.envio-grupo-head {
  margin-bottom: 0.65rem;
}
.envio-grupo-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.envio-grupo-sub {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: #64748b;
}
.envio-drag-hint {
  display: inline-block;
  margin-left: 0.4rem;
  color: #94a3b8;
  letter-spacing: -0.12em;
  cursor: grab;
  user-select: none;
}
.fila-grupo--draggable {
  cursor: grab;
}
.fila-grupo--draggable.is-dragging {
  opacity: 0.55;
}
.envio-grupo-dropzone {
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  padding: 1rem !important;
  text-align: center;
  background: #fff;
}
.envio-grupos-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 1rem 0 0.35rem;
}
.form-nuevo-envio-grupo--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.form-nuevo-envio-grupo--inline input[type="text"] {
  min-width: 14rem;
  max-width: 22rem;
}
.form-inline-caja.form-nuevo-envio-grupo {
  display: inline-flex;
  margin: 0;
}

/* Barra Crear grupo */
.card-nuevo-envio-grupo {
  padding: 0.85rem 1.1rem;
}
.nuevo-envio-grupo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
}
.nuevo-envio-grupo-copy {
  flex: 1 1 14rem;
  min-width: 0;
}
.nuevo-envio-grupo-copy h2 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}
.nuevo-envio-grupo-copy .field-hint {
  margin: 0;
}
.form-nuevo-envio-grupo--bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.65rem;
  margin: 0;
  flex: 1 1 18rem;
  justify-content: flex-end;
}
.field-nuevo-envio-nombre {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 22rem;
  margin: 0;
}
.field-nuevo-envio-nombre label {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.input-nuevo-envio-grupo {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: #fff;
  box-sizing: border-box;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
.input-nuevo-envio-grupo::placeholder {
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0;
}
.input-nuevo-envio-grupo:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}
.btn-nuevo-envio-grupo {
  min-height: 2.35rem;
  padding-left: 1.1rem;
  padding-right: 1.1rem;
  white-space: nowrap;
}

/* Combo elegir / crear grupo (modal Repartos) */
.field-select-envio-grupo label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.select-envio-grupo {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.55rem 2.4rem 0.55rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 600;
  color: #0f172a;
  background-color: #f8fafc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
.select-envio-grupo:hover {
  border-color: #94a3b8;
  background-color: #fff;
}
.select-envio-grupo:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
  background-color: #fff;
}
.select-envio-grupo optgroup {
  font-weight: 700;
  color: #334155;
  background: #f1f5f9;
}
.select-envio-grupo option {
  font-weight: 500;
  padding: 0.35rem;
}

@media (max-width: 640px) {
  .form-nuevo-envio-grupo--bar {
    justify-content: stretch;
  }
  .field-nuevo-envio-nombre {
    max-width: none;
    flex: 1 1 100%;
  }
  .btn-nuevo-envio-grupo {
    width: 100%;
  }
}

.envio-grupo-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.envio-grupos-cerrados {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

/* Pestañas Repartos */
.repartos-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.35rem;
  background: #f1f5f9;
  border-radius: 10px;
}
.repartos-tab {
  flex: 1 1 auto;
  text-align: center;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  color: #334155;
  text-decoration: none;
  background: transparent;
}
.repartos-tab:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.repartos-tab.is-active {
  background: #2563eb;
  color: #fff;
}
.envio-inbox-ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.envio-inbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  cursor: grab;
}
.envio-grupo-row.is-drop-target td {
  background: #dbeafe !important;
}
.fila-totales-grupos td {
  background: #f8fafc;
  border-top: 2px solid #cbd5e1;
}
.table-grupos-envio .badge-estado {
  white-space: nowrap;
}
