:root {
  --navy: #0b1739;

  --primary: #2563eb;

  --bg: #f4f7fb;

  --text: #172033;

  --muted: #70809a;

  --sidebar: 270px;
}

/* Embarques: listado operativo compacto inspirado en la vista CRM. */
.shipments-page {
  color: #1e293b;
}
.shipments-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.shipments-page-header h2 {
  font-size: 28px;
  font-weight: 650;
  color: #0f172a;
  margin: 2px 0 4px;
}
.shipments-page-header p {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}
.shipments-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: #3b82f6;
}
.shipments-primary-button {
  min-height: 40px;
  border-radius: 9px;
  padding-inline: 16px;
  box-shadow: 0 5px 14px #2563eb33;
}
.shipments-funnel {
  display: grid;
  grid-template-columns: repeat(4, minmax(155px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.shipment-stage {
  --stage-color: #3b82f6;
  background: #fff;
  border: 1px solid #e5eaf0;
  border-radius: 11px;
  padding: 14px;
  box-shadow: 0 1px 3px #0f172a08;
}
.shipment-stage-green {
  --stage-color: #10b981;
}
.shipment-stage-purple {
  --stage-color: #8b5cf6;
}
.shipment-stage-amber {
  --stage-color: #f59e0b;
}
.shipment-stage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #64748b;
  font-size: 12px;
}
.shipment-stage-icon {
  color: var(--stage-color);
  font-size: 16px;
}
.shipment-stage > strong {
  display: block;
  font-size: 22px;
  color: #0f172a;
  margin-top: 2px;
}
.shipment-stage-bar {
  display: block;
  height: 4px;
  background: #eef2f7;
  border-radius: 9px;
  margin: 10px 0 7px;
  overflow: hidden;
}
.shipment-stage-bar i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--stage-color);
}
.shipment-stage small {
  font-size: 10px;
  color: #94a3b8;
}
.shipments-panel {
  border-radius: 14px;
  overflow: visible;
}
.shipments-toolbar {
  display: grid;
  grid-template-columns: minmax(250px, 1.7fr) minmax(180px, 1fr) minmax(
      150px,
      0.8fr
    ) minmax(170px, 0.9fr) auto auto;
  gap: 10px;
  padding: 16px;
}
.shipments-toolbar > .btn {
  height: 40px;
  white-space: nowrap;
}
.shipments-search {
  position: relative;
}
.shipments-search > i {
  position: absolute;
  left: 13px;
  top: 11px;
  color: #94a3b8;
  z-index: 2;
}
.shipments-search input {
  padding-left: 36px;
}
.shipments-toolbar .form-control,
.shipments-toolbar .form-select,
.shipments-extra-filters .form-control {
  height: 40px;
  border-color: #dbe3ec;
  border-radius: 8px;
  background-color: #f8fafc;
  font-size: 12px;
}
.shipments-extra-filters {
  display: none;
  grid-template-columns: repeat(2, minmax(160px, 220px)) auto;
  align-items: end;
  gap: 12px;
  padding: 0 16px 16px;
}
.shipments-extra-filters.is-open {
  display: grid;
}
.shipments-extra-filters label {
  font-size: 11px;
  color: #64748b;
}
.shipments-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid #edf1f5;
  background: #fbfcfe;
  border-radius: 14px 14px 0 0;
}
.shipments-list-head strong {
  font-size: 13px;
}
.shipments-list-head span {
  font-size: 11px;
  color: #94a3b8;
  margin-left: 10px;
}
.shipments-refresh-button {
  width: 34px;
  height: 34px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
}
.shipments-panel .table {
  min-width: 1040px;
}
.shipments-panel .table thead th {
  padding: 11px 14px;
  border-bottom-color: #edf1f5;
  background: #fff;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.shipments-panel .table tbody td {
  padding: 12px 14px;
  border-bottom-color: #f0f3f6;
  color: #475569;
  font-size: 12px;
  vertical-align: middle;
}
.shipments-panel .table tbody tr:hover {
  background: #f8fbff;
}
.shipment-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.shipment-name-cell > span:last-child {
  display: flex;
  flex-direction: column;
}
.shipment-name-cell small {
  font-size: 10px;
  color: #94a3b8;
}
.shipment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #eaf2ff;
  color: #2563eb;
  display: grid;
  place-items: center;
  flex: none;
}
.shipment-cell-title,
.shipment-reference-cell > strong {
  display: block;
  color: #1e293b;
  font-weight: 650;
}
.shipments-panel td > small,
.shipment-reference-cell small,
.shipment-finance-cell small {
  display: block;
  color: #94a3b8;
  font-size: 10px;
  margin-top: 3px;
}
.shipment-date {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 2px 0;
}
.shipment-date span {
  width: 27px;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 700;
}
.shipment-date strong {
  font-size: 11px;
  color: #334155;
}
.shipment-finance-cell > strong {
  display: block;
  color: #1e293b;
}
.shipment-finance-cell > strong small {
  display: inline;
  font-weight: 400;
}
.shipment-finance-cell > span {
  display: block;
  margin-top: 3px;
}
.shipment-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 99px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.shipment-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
}
.shipments-panel .shipment-detail-button {
  font-size: 12px;
  color: #1e293b;
}
.shipments-panel .btn-sm {
  width: 32px;
  height: 32px;
  padding: 0;
  border-color: transparent;
  border-radius: 8px;
}
.shipments-panel .btn-sm:hover {
  background: #eaf2ff;
  color: #2563eb;
}
.shipments-panel > .card-body {
  overflow: hidden;
  border-radius: 0 0 14px 14px;
}
@media (max-width: 1100px) {
  .shipments-toolbar {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .shipments-search {
    grid-column: 1/-1;
  }
  .shipments-funnel {
    overflow-x: auto;
    display: flex;
  }
  .shipment-stage {
    min-width: 190px;
    flex: 1;
  }
  .shipments-extra-filters.is-open {
    grid-template-columns: 1fr 1fr auto;
  }
}
@media (max-width: 640px) {
  .shipments-page-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .shipments-primary-button {
    width: 100%;
  }
  .shipments-toolbar {
    grid-template-columns: 1fr;
  }
  .shipments-search {
    grid-column: auto;
  }
  .shipments-extra-filters.is-open {
    grid-template-columns: 1fr;
  }
  .shipments-funnel {
    margin-right: -20px;
  }
  .shipments-list-head span {
    display: block;
    margin: 3px 0 0;
  }
}

.shipments-page .shipment-name-cell {
  gap: 0;
}
.shipments-page .shipment-operation-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
  max-width: 250px;
}
.shipments-page .shipment-operation-tags span {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 99px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 9px;
  line-height: 1.2;
}
.shipments-page .shipment-operation-tags span.is-primary {
  background: #eaf2ff;
  color: #2563eb;
}
.shipments-page .shipment-date {
  display: grid;
  grid-template-columns: 27px max-content;
  align-items: center;
  gap: 7px;
  margin: 3px 0;
  white-space: nowrap;
}
.shipments-page .shipment-date span {
  width: auto;
}
.shipments-page .shipment-date strong {
  white-space: nowrap;
}
.shipments-page #shipmentAdditionalOperations {
  min-height: 86px;
}
.shipments-page .shipments-panel tbody tr.shipment-alert-red > td {
  --bs-table-bg: #fee2e2;
  --bs-table-hover-bg: #fecaca;
  background-color: var(--bs-table-bg);
}
.shipments-page .shipments-panel tbody tr.shipment-alert-orange > td {
  --bs-table-bg: #ffedd5;
  --bs-table-hover-bg: #fed7aa;
  background-color: var(--bs-table-bg);
}
.shipments-page .shipments-panel tbody tr.shipment-alert-yellow > td {
  --bs-table-bg: #fef9c3;
  --bs-table-hover-bg: #fef08a;
  background-color: var(--bs-table-bg);
}
.shipments-page .shipments-panel tbody tr.shipment-alert-green > td {
  --bs-table-bg: #dcfce7;
  --bs-table-hover-bg: #bbf7d0;
  background-color: var(--bs-table-bg);
}
.shipments-page .shipments-panel tbody tr.shipment-alert-white > td {
  --bs-table-bg: #ffffff;
  --bs-table-hover-bg: #f8fafc;
  background-color: var(--bs-table-bg);
}
.shipments-page .shipments-panel tbody tr.shipment-alert-red:hover > td,
.shipments-page .shipments-panel tbody tr.shipment-alert-orange:hover > td,
.shipments-page .shipments-panel tbody tr.shipment-alert-yellow:hover > td,
.shipments-page .shipments-panel tbody tr.shipment-alert-green:hover > td,
.shipments-page .shipments-panel tbody tr.shipment-alert-white:hover > td {
  background-color: var(--bs-table-hover-bg);
}
.parameters-page {
  position: relative;
}
.parameters-page form {
  display: grid;
  gap: 18px;
}
.parameters-section {
  overflow: hidden;
}
.parameters-section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.parameters-section-heading h3 {
  margin: 0 0 3px;
  font-size: 18px;
  font-weight: 700;
}
.parameters-section-heading p {
  margin: 0;
  color: #64748b;
}
.parameters-section-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: #eaf2ff;
  color: #2563eb;
  font-size: 20px;
}
.parameters-scale {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: #64748b;
}
.parameters-scale span {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.parameters-scale .is-red {
  background: #fee2e2;
  color: #b91c1c;
}
.parameters-scale .is-orange {
  background: #ffedd5;
  color: #c2410c;
}
.parameters-scale .is-yellow {
  background: #fef9c3;
  color: #854d0e;
}
.parameters-scale small {
  margin-left: 6px;
}
.parameters-actions {
  display: flex;
  justify-content: flex-end;
}
.shipment-notification-preview summary {
  cursor: pointer;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
}
.shipment-notification-preview-body {
  width: 100%;
  min-height: 260px;
  max-height: 320px;
  overflow: auto;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
}
.shipment-notification-history {
  color: #64748b;
}
.shipment-attachment-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 7px;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  cursor: pointer;
}
.shipment-attachment-option:hover {
  background: #f8fafc;
}
.shipment-attachment-option span {
  display: flex;
  flex: 1;
  justify-content: space-between;
  gap: 10px;
}
.shipment-attachment-option small {
  color: #64748b;
  white-space: nowrap;
}
@media (max-width: 767.98px) {
  .parameters-scale {
    flex-wrap: wrap;
  }
  .parameters-scale small {
    flex-basis: 100%;
    margin-left: 0;
  }
}
.shipments-page .shipment-finance-cell > span,
.shipments-page .shipment-finance-cell > strong {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  white-space: nowrap;
}
.shipments-page .shipment-finance-cell i {
  width: 14px;
  color: #94a3b8;
}
.shipments-page .shipment-finance-cell > strong {
  font-weight: 700;
}
.shipments-page .shipment-finance-cell > strong.is-positive {
  color: #059669;
}
.shipments-page .shipment-finance-cell > strong.is-negative {
  color: #dc2626;
}
.shipments-page .shipment-finance-cell > strong.is-neutral {
  color: #64748b;
}
.shipments-page .shipment-finance-cell > strong.is-positive i {
  color: #10b981;
}
.shipments-page .shipment-finance-cell > strong.is-negative i {
  color: #ef4444;
}
.shipments-page .shipment-finance-cell > strong.is-neutral i {
  color: #94a3b8;
}
.shipments-page .shipment-finance-cell > strong small {
  font-size: 10px;
  font-weight: 500;
}
.shipments-page .shipment-multiselect {
  min-width: 0;
}
.shipments-page .shipment-multiselect-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  text-align: left;
  overflow: hidden;
  border-color: #dbe3ec;
  border-radius: 8px;
  background-color: #f8fafc;
  font-size: 12px;
}
.shipments-page .shipment-multiselect-toggle:focus,
.shipments-page .shipment-multiselect-toggle.show {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px #3b82f617;
}
.shipments-page
  .shipment-multiselect.has-selection
  .shipment-multiselect-toggle {
  background: #fff;
  color: #2563eb;
  border-color: #bfdbfe;
}
.shipments-page .shipment-multiselect-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
}
.shipments-page .shipment-multiselect-menu {
  width: max(100%, 240px);
  max-width: 320px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 14px 34px #0f172a1f;
}
.shipments-page .shipment-multiselect-options {
  max-height: 230px;
  overflow: auto;
  padding: 2px;
}
.shipments-page .shipment-multiselect-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 7px;
  color: #475569;
  font-size: 12px;
  cursor: pointer;
}
.shipments-page .shipment-multiselect-option:hover {
  background: #f8fafc;
  color: #1e293b;
}
.shipments-page .shipment-multiselect-option .form-check-input {
  flex: none;
  margin: 0;
}
.shipments-page .shipment-multiselect-clear {
  font-size: 10px;
  padding: 7px 5px 2px;
}
.shipments-page .shipment-client-search i {
  position: absolute;
  left: 11px;
  top: 9px;
  color: #94a3b8;
}
.shipments-page .shipment-client-search input {
  height: 36px;
  padding-left: 32px;
  font-size: 12px;
}
.shipments-page .shipment-client-results {
  max-height: 180px;
  overflow: auto;
  margin-top: 6px;
  color: #94a3b8;
  font-size: 11px;
}
.shipments-page .shipment-client-result {
  display: block;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: #fff;
  color: #475569;
  text-align: left;
  font-size: 12px;
}
.shipments-page .shipment-client-result:hover {
  background: #f8fafc;
  color: #2563eb;
}
.shipments-page .shipment-client-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.shipments-page .shipment-client-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 7px;
  border-radius: 99px;
  background: #eaf2ff;
  color: #2563eb;
  font-size: 10px;
  cursor: pointer;
}
.shipments-page .shipment-client-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shipments-page .shipment-client-chip i {
  font-size: 12px;
}
.shipments-page .shipment-client-chip:hover {
  background: #dbeafe;
}

.app-autocomplete-menu {
  z-index: 1080;
  top: 100%;
  max-height: 16rem;
  overflow-y: auto;
  background: var(--bs-body-bg);
}

.app-autocomplete.is-loading .app-autocomplete-search {
  padding-right: 2.5rem;
  background-image: var(--bs-form-select-bg-img);
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;

  background: var(--bg);

  color: var(--text);

  font-family: Inter, system-ui, "Segoe UI", sans-serif;
}

.app-shell {
  display: flex;

  min-height: 100vh;
}

.sidebar {
  position: fixed;

  inset: 0 auto 0 0;

  width: var(--sidebar);

  background: linear-gradient(180deg, var(--navy), #071027);

  color: #fff;

  display: flex;

  flex-direction: column;

  z-index: 1040;

  transition: transform 0.25s;
}

.sidebar-brand {
  height: 82px;

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 0 24px;

  color: #fff;

  text-decoration: none;

  font-size: 1.35rem;

  font-weight: 750;
}

.sidebar-brand small,
.login-page h1 span {
  color: #71a1ff;
}

.brand-mark {
  width: 42px;

  height: 42px;

  display: grid;

  place-items: center;

  border-radius: 13px;

  background: linear-gradient(135deg, #3b82f6, #1d4ed8);

  color: #fff;

  font-size: 1.25rem;

  box-shadow: 0 8px 22px #2563eb55;
}

.sidebar-nav {
  padding: 12px;

  overflow-y: auto;

  scrollbar-width: none;

  -ms-overflow-style: none;

  flex: 1;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.nav-label {
  padding: 18px 13px 7px;

  color: #7181a5;

  font-size: 0.68rem;

  font-weight: 700;

  letter-spacing: 0.12em;

  text-transform: uppercase;
}

.sidebar .nav-link {
  display: flex;

  align-items: center;

  gap: 13px;

  color: #aebbd4;

  border-radius: 10px;

  padding: 11px 13px;

  margin: 3px 0;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: #fff;

  background: #ffffff14;
}

.sidebar .nav-link.active {
  box-shadow: inset 3px 0 #4f8cff;
}

.sidebar-footer {
  padding: 20px 24px;

  color: #7483a4;

  font-size: 0.8rem;

  border-top: 1px solid #ffffff0d;
}

.app-main {
  margin-left: var(--sidebar);

  min-height: 100vh;

  display: flex;

  flex-direction: column;

  width: calc(100% - var(--sidebar));
}

.topbar {
  height: 82px;

  background: #ffffffdd;

  backdrop-filter: blur(10px);

  border-bottom: 1px solid #e7ecf3;

  display: flex;

  align-items: center;

  padding: 0 30px;

  position: sticky;

  top: 0;

  z-index: 1020;
}

.topbar h1 {
  font-size: 1.15rem;

  margin: 0;

  font-weight: 700;
}

.sidebar-toggle {
  font-size: 1.5rem;

  margin-right: 12px;

  display: none;
}

.user-menu {
  display: flex;

  align-items: center;

  gap: 10px;

  border: 0;
}

.user-avatar {
  width: 36px;

  height: 36px;

  border-radius: 50%;

  display: grid;

  place-items: center;

  background: #dbeafe;

  color: #1d4ed8;

  font-weight: 800;
}

.content {
  padding: 30px;

  flex: 1;
}

.app-footer {
  padding: 16px 30px;

  color: var(--muted);

  font-size: 0.8rem;
}

.metric-card,
.panel-card {
  background: #fff;

  border: 1px solid #e8edf5;

  border-radius: 16px;

  box-shadow: 0 5px 18px #17203308;
}

.metric-card {
  padding: 20px;

  display: flex;

  align-items: center;

  gap: 15px;
}

.metric-card span {
  display: block;

  color: var(--muted);

  font-size: 0.8rem;
}

.metric-card strong {
  display: block;

  font-size: 1.65rem;
}

.metric-icon {
  width: 48px;

  height: 48px;

  border-radius: 14px;

  display: grid;

  place-items: center;

  font-size: 1.25rem;
}

.metric-icon.blue {
  background: #dbeafe;

  color: #2563eb;
}

.metric-icon.green {
  background: #dcfce7;

  color: #16a34a;
}

.metric-icon.amber {
  background: #fef3c7;

  color: #d97706;
}

.metric-icon.purple {
  background: #f3e8ff;

  color: #9333ea;
}

.empty-state {
  text-align: center;

  padding: 42px 20px;
}

.empty-state > i {
  font-size: 3rem;

  color: #7ca5f8;
}

.empty-state h3,
.empty-state h2 {
  font-size: 1.15rem;

  margin: 14px 0 7px;
}

.empty-state p {
  color: var(--muted);

  max-width: 500px;

  margin: 0 auto 20px;
}

.status-list {
  list-style: none;

  padding: 0;

  margin: 0;
}

.status-list li {
  display: flex;

  gap: 11px;

  align-items: center;

  padding: 11px 0;

  border-bottom: 1px solid #eef1f6;
}

.status-list i {
  color: #22c55e;
}

.status-list .pending {
  color: var(--muted);
}

.status-list .pending i {
  color: #cbd5e1;
}

.login-page {
  background:
    radial-gradient(circle at 20% 10%, #1e3a72 0, transparent 38%),
    linear-gradient(145deg, #071027, #102653);
}

.login-card {
  border-radius: 22px;
}

.login-page .brand-mark {
  display: grid;
}

.form-control,
.input-group-text {
  padding: 0.72rem 0.85rem;

  border-color: #dfe5ee;
}

.btn-primary {
  background: #2563eb;

  border-color: #2563eb;
}

.sidebar-backdrop {
  display: none;
}

.module-loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(244, 247, 251, 0.72);
  backdrop-filter: blur(2px);
}

.module-loader.is-active {
  display: flex;
}

.module-loader-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border: 1px solid #e3e9f2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 35px rgba(23, 32, 51, 0.14);
  color: var(--text);
  font-weight: 600;
}

.table-sort-controls {
  background: #f8fafc;
  border-color: #e2e8f0 !important;
}

.table-sort-controls .form-label {
  color: #64748b;
}

.table-sort-dropdown .table-sort-menu {
  width: min(430px, calc(100vw - 32px));
}

.table-sort-menu .form-label {
  color: #64748b;
  margin-bottom: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .app-main {
    transition: none !important;
  }
}

/* Barra lateral retráctil en escritorio */
.sidebar,
.app-main {
  transition:
    width 0.25s ease,
    margin-left 0.25s ease,
    transform 0.25s ease;
}

.sidebar-toggle {
  display: inline-grid;
  place-items: center;
}

@media (min-width: 993px) {
  body.sidebar-collapsed .sidebar {
    width: 78px;
  }

  body.sidebar-collapsed .sidebar:hover,
  body.sidebar-collapsed .sidebar:focus-within {
    width: var(--sidebar);
    box-shadow: 12px 0 30px rgba(7, 16, 39, 0.22);
  }

  body.sidebar-collapsed .app-main {
    margin-left: 78px;
    width: calc(100% - 78px);
  }

  body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 0;
  }

  body.sidebar-collapsed
    .sidebar:not(:hover):not(:focus-within)
    .sidebar-brand-text,
  body.sidebar-collapsed .sidebar:not(:hover):not(:focus-within) .nav-link-text,
  body.sidebar-collapsed
    .sidebar:not(:hover):not(:focus-within)
    .sidebar-footer-text,
  body.sidebar-collapsed .sidebar:not(:hover):not(:focus-within) .nav-label {
    display: none;
  }

  body.sidebar-collapsed .sidebar:not(:hover):not(:focus-within) .sidebar-nav {
    padding: 12px 10px;
  }

  body.sidebar-collapsed .sidebar:not(:hover):not(:focus-within) .nav-link {
    justify-content: center;
    gap: 0;
    padding: 13px;
  }

  body.sidebar-collapsed .sidebar:not(:hover):not(:focus-within) .nav-link i {
    font-size: 1.2rem;
  }

  body.sidebar-collapsed
    .sidebar:not(:hover):not(:focus-within)
    .sidebar-footer {
    display: flex;
    justify-content: center;
    padding: 20px 0;
  }

  body.sidebar-collapsed .sidebar:hover .sidebar-brand,
  body.sidebar-collapsed .sidebar:focus-within .sidebar-brand {
    justify-content: flex-start;
    padding: 0 24px;
  }
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar-open .sidebar {
    transform: none;
  }

  .sidebar-backdrop {
    position: fixed;

    inset: 0;

    background: #07102799;

    z-index: 1030;
  }

  .sidebar-open .sidebar-backdrop {
    display: block;
  }

  .app-main {
    margin-left: 0;

    width: 100%;
  }

  .sidebar-toggle {
    display: block;
  }

  .content {
    padding: 20px;
  }

  .topbar {
    padding: 0 18px;
  }
}

/* Mantiene los multiselects de embarques sobre el panel del listado. */
.shipments-page #shipmentsFilters {
  position: relative;
  z-index: 30;
}
.shipments-page #shipmentsFilters .shipments-panel,
.shipments-page #shipmentsFilters .card-body,
.shipments-page #shipmentsFilters form,
.shipments-page .shipments-toolbar {
  position: relative;
  overflow: visible;
}
.shipments-page #shipmentsTable {
  position: relative;
  z-index: 1;
}
.shipments-page .shipment-multiselect-menu {
  z-index: 1090;
}

@media (min-width: 1101px) {
  .shipments-page .shipments-toolbar {
    grid-template-columns: minmax(250px, 1.7fr) minmax(180px, 1fr) minmax(
        150px,
        0.8fr
      ) minmax(170px, 0.9fr) auto auto auto;
  }
}

.shipments-toolbar .table-sort-dropdown > .btn {
  height: 40px;
  white-space: nowrap;
}

.accounting-dashboard-date {
  padding: 9px 14px;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  color: #64748b;
  background: #fff;
  font-size: 13px;
}
.accounting-dashboard-toolbar {
  grid-template-columns: repeat(2, minmax(150px, 0.7fr)) repeat(
      2,
      minmax(190px, 1fr)
    ) auto auto;
}
.accounting-dashboard-filter-note {
  margin: -4px 2px 16px;
  color: #64748b;
  font-size: 12px;
}
.accounting-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.accounting-metric-card {
  min-width: 0;
}
.accounting-metric-card strong {
  overflow-wrap: anywhere;
}
.accounting-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #edf1f5;
}
.accounting-panel-heading h3 {
  margin: 0 0 3px;
  color: #1e293b;
  font-size: 15px;
  font-weight: 700;
}
.accounting-panel-heading p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
}
.accounting-chart-legend {
  display: flex;
  gap: 12px;
  color: #64748b;
  font-size: 11px;
}
.accounting-chart-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.accounting-chart-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.accounting-chart-legend .invoice,
.accounting-chart-bars .invoice {
  background: #2563eb;
}
.accounting-chart-legend .cost,
.accounting-chart-bars .cost {
  background: #f59e0b;
}
.accounting-chart {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 12px;
  min-height: 260px;
  padding: 24px 20px 18px;
}
.accounting-chart-period {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  min-width: 36px;
}
.accounting-chart-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 190px;
  border-bottom: 1px solid #dbe3ec;
}
.accounting-chart-bars span {
  width: min(22px, 36%);
  min-height: 2px;
  border-radius: 5px 5px 0 0;
}
.accounting-chart-period small {
  margin-top: 8px;
  color: #64748b;
  font-size: 10px;
}
.accounting-due-list {
  max-height: 320px;
  overflow-y: auto;
}
.accounting-due-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid #edf1f5;
}
.accounting-due-item:last-child {
  border-bottom: 0;
}
.accounting-due-item strong,
.accounting-due-item span {
  display: block;
}
.accounting-due-item strong {
  color: #1e293b;
  font-size: 12px;
}
.accounting-due-item span {
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
}
.accounting-due-item .is-overdue {
  color: #dc2626;
  font-weight: 600;
}
.accounting-empty {
  width: 100%;
  padding: 28px 20px;
  color: #94a3b8;
  text-align: center;
  font-size: 12px;
}
.accounting-loss-table th {
  color: #64748b;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 600;
}
.accounting-loss-table td {
  color: #475569;
  font-size: 12px;
}
.accounting-loss-table a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}
@media (max-width: 1100px) {
  .accounting-dashboard-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .accounting-dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 575px) {
  .accounting-dashboard-toolbar,
  .accounting-dashboard-metrics {
    grid-template-columns: 1fr;
  }
  .accounting-panel-heading,
  .accounting-due-item {
    align-items: flex-start;
  }
  .accounting-chart {
    overflow-x: auto;
    justify-content: flex-start;
  }
  .accounting-chart-period {
    flex: 0 0 50px;
  }
}

.shipment-multiselect-helper,
.app-multi-autocomplete-clear {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #fff;
  color: #64748b;
}
.shipment-multiselect-helper:hover,
.app-multi-autocomplete-clear:hover {
  background: #eaf2ff;
  border-color: #bfdbfe;
  color: #2563eb;
}
.app-multi-autocomplete-menu {
  width: max(100%, 280px);
}
.app-multi-autocomplete-search i {
  position: absolute;
  left: 11px;
  top: 9px;
  color: #94a3b8;
}
.app-multi-autocomplete-input {
  height: 36px;
  padding-left: 32px;
  font-size: 12px;
}
.app-multi-autocomplete-results {
  max-height: 190px;
  overflow: auto;
  color: #94a3b8;
  font-size: 11px;
}
.app-multi-autocomplete-result {
  display: block;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: #fff;
  color: #475569;
  text-align: left;
  font-size: 12px;
}
.app-multi-autocomplete-result:hover {
  background: #f8fafc;
  color: #2563eb;
}
.app-multi-autocomplete-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.app-multi-autocomplete-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 7px;
  border-radius: 99px;
  background: #eaf2ff;
  color: #2563eb;
  font-size: 10px;
  cursor: pointer;
}
.app-multi-autocomplete-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-multi-autocomplete-chip i {
  font-size: 12px;
}
.app-multi-autocomplete-chip:hover {
  background: #dbeafe;
}
.app-multi-autocomplete.is-loading .app-multi-autocomplete-input {
  background-color: #f8fafc;
}
.app-multiselect-search i {
  position: absolute;
  left: 11px;
  top: 9px;
  color: #94a3b8;
}
.app-multiselect-search input {
  height: 36px;
  padding-left: 32px;
  font-size: 12px;
}
.shipment-multiselect-option.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.app-multiselect-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.app-multiselect-selected:empty {
  display: none;
}
.app-multiselect-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 7px;
  border: 0;
  border-radius: 99px;
  background: #eaf2ff;
  color: #2563eb;
  font-size: 10px;
}
.app-multiselect-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-multiselect-chip:hover {
  background: #dbeafe;
}
.app-multiselect-chip i {
  font-size: 12px;
}
.modal .app-multiselect .shipment-multiselect-menu {
  z-index: 1095;
}
.metric-icon.red {
  background: #fee2e2;
  color: #dc2626;
}
.shipment-finance-form {
  background: #fbfcfe;
}
.shipment-finance-form .form-label {
  font-size: 11px;
  color: #64748b;
}
.shipment-finance-preview {
  padding: 7px 10px;
  border-radius: 8px;
  background: #f1f5f9;
}
.shipment-finance-table {
  min-width: 920px;
}
.shipment-finance-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #94a3b8;
  white-space: nowrap;
}
.shipment-finance-table td {
  font-size: 12px;
}
.shipment-finance-table td > strong,
.shipment-finance-table td > small {
  display: block;
}
.shipment-finance-table td > small {
  margin-top: 3px;
  color: #94a3b8;
}
.shipment-finance-table .btn-sm {
  width: 31px;
  height: 31px;
  padding: 0;
  border: 0;
  border-radius: 8px;
}
.shipment-finance-table .btn-sm:hover {
  background: #eaf2ff;
}

/* Pantallas operativas */
.operational-page-title h2 {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.15;
}
.package-reception .reception-client-summary,
.package-reception #receptionPackageDetail,
.package-reception #receptionPackageDetail .card-body {
  min-width: 0;
}
.package-reception .reception-tracking-value,
.package-reconciliation .operational-tracking,
.package-reconciliation .operational-tracking strong,
.package-reconciliation .operational-tracking small {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.package-reconciliation .reconciliation-table {
  width: 100%;
  table-layout: fixed;
}
.package-reconciliation .reconciliation-table th,
.package-reconciliation .reconciliation-table td {
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
}
.package-reconciliation .reconciliation-table th:first-child {
  width: 50%;
}
.package-reconciliation .reconciliation-table th:nth-child(2),
.package-reconciliation .reconciliation-table th:nth-child(3) {
  width: 25%;
}

.branch-deliveries,
.branch-deliveries .card,
.branch-deliveries #branchDeliveriesTable .table-responsive {
  min-width: 0;
}

.branch-deliveries-header {
  align-items: center;
}

.branch-deliveries #branchDeliveriesTable .table td,
.branch-deliveries #branchDeliveriesTable .table th {
  vertical-align: middle;
}

@media (max-width: 575.98px) {
  .package-reception .form-label,
  .package-reconciliation .form-label {
    margin-bottom: 0.25rem;
    font-size: 0.82rem;
  }
  .package-reception #receivePackageButton {
    width: 100%;
  }
  .package-reconciliation .reconciliation-table th,
  .package-reconciliation .reconciliation-table td {
    padding: 0.45rem 0.5rem;
    font-size: 0.78rem;
  }

  .package-reception .row,
  .package-reconciliation .row,
  .branch-deliveries .row {
    --bs-gutter-x: 0.75rem;
  }

  .package-reception .card-body,
  .package-reconciliation .card-body,
  .branch-deliveries .card-body {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .package-reconciliation #reconciliationSummary .card-body {
    padding: 0.65rem 0.75rem;
  }

  .package-reconciliation #reconciliationSummary span {
    font-size: 0.8rem;
  }

  .branch-deliveries-header {
    align-items: stretch;
  }

  .branch-deliveries-header #newBranchDelivery {
    width: 100%;
  }

  .branch-deliveries #branchDeliveriesTable .table-responsive {
    overflow: visible;
  }

  .branch-deliveries #branchDeliveriesTable .table thead {
    display: none;
  }

  .branch-deliveries #branchDeliveriesTable .table,
  .branch-deliveries #branchDeliveriesTable .table tbody,
  .branch-deliveries #branchDeliveriesTable .table tr,
  .branch-deliveries #branchDeliveriesTable .table td {
    display: block;
    width: 100%;
  }

  .branch-deliveries #branchDeliveriesTable .table tbody tr {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--bs-border-color);
  }

  .branch-deliveries #branchDeliveriesTable .table tbody tr:last-child {
    border-bottom: 0;
  }

  .branch-deliveries #branchDeliveriesTable .table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    border: 0;
    text-align: right;
    white-space: normal;
  }

  .branch-deliveries #branchDeliveriesTable .table tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
  }

  .branch-deliveries #branchDeliveriesTable .table tbody td[data-label="Progreso"] > div {
    width: min(68%, 15rem);
  }

  .branch-deliveries #branchDeliveriesTable .table tbody td[colspan] {
    display: block;
    padding: 2rem 0;
    text-align: center;
  }

  .branch-deliveries #branchDeliveriesTable .table tbody td[colspan]::before {
    content: none;
  }

  .branch-deliveries .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .branch-deliveries .modal-dialog {
    margin: 0.5rem;
  }

  .branch-deliveries .modal-body,
  .branch-deliveries .modal-header,
  .branch-deliveries .modal-footer {
    padding: 0.85rem;
  }
}
