/* ============================================
   Delivery Routes Interface Stylesheet
   Modern, clean, professional design
   ============================================ */

/* ============================================
   1. Layout Structure
   ============================================ */
.delivery-routes-layout {
  display: block;
  min-height: calc(100vh - 140px);
  padding: 1rem 0;
}

.delivery-routes-layout--single-screen {
  height: calc(100dvh - 6rem);
  min-height: calc(100dvh - 6rem);
  overflow: hidden;
}

.delivery-routes-content {
  margin-left: 481px;
  padding-left: 1rem;
}

.delivery-routes-layout--single-screen .delivery-routes-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
}

/* ============================================
   2. Header Section
   ============================================ */
.routes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.8rem;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  flex-wrap: nowrap;
  overflow-x: auto;
}

.delivery-routes-layout--single-screen .routes-header {
  flex-shrink: 0;
}

.routes-header--sticky {
  position: sticky;
  top: 0.35rem;
  z-index: 14;
}

.header-left {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: max-content;
}

.header-left h1 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.15;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
  margin-left: auto;
}

.header-action-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.header-actions .btn {
  padding: 0.42rem 0.6rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

.route-filter-bar {
  position: static;
  z-index: 12;
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.route-filter-bar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.route-filter-bar__header h3 {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4b5563;
}

.route-filter-bar__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.route-filter-chips {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
}

.route-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  background: #fff;
  color: #374151;
  padding: 0.28rem 0.62rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.route-filter-chip:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.route-filter-chip.active {
  border-color: #3d4b47;
  background: #eef2ef;
  color: #1f2624;
}

.chip-label {
  font-size: 0.78rem;
  font-weight: 600;
}

.chip-count {
  font-size: 0.72rem;
  font-weight: 700;
  background: #e5e7eb;
  color: #1f2937;
  border-radius: 9999px;
  padding: 0.08rem 0.38rem;
}

.routes-header-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.routes-header-title h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2624;
}

.routes-header-date {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.routes-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ============================================
   3. Summary Cards
   ============================================ */
.route-summary-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.route-summary-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.route-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: #e0e0e0;
}

.route-summary-card.active {
  border-color: #3d4b47;
  background: #f8f9f8;
  box-shadow: 0 4px 12px rgba(61, 75, 71, 0.15);
}

.route-summary-card.morning-route.active {
  border-color: #f5a623;
  background: #fffbf5;
}

.route-summary-card.afternoon-route.active {
  border-color: #7ed321;
  background: #f8fdf3;
}

.route-summary-card.unassigned-pool.active {
  border-color: #b8b8b8;
  background: #f9f9f9;
}

.route-summary-card.pool-service.active {
  border-color: #4a90d9;
  background: #f5f9fd;
}

.route-summary-card.courier-service.active {
  border-color: #d0021b;
  background: #fdf5f5;
}

.route-summary-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.route-summary-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: #f5f5f5;
}

.route-summary-card.morning-route .route-summary-icon {
  background: #fff3e0;
}

.route-summary-card.afternoon-route .route-summary-icon {
  background: #e8f5e9;
}

.route-summary-card.unassigned-pool .route-summary-icon {
  background: #f5f5f5;
}

.route-summary-card.pool-service .route-summary-icon {
  background: #e3f2fd;
}

.route-summary-card.courier-service .route-summary-icon {
  background: #ffebee;
}

.route-summary-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #1f2624;
}

.route-summary-count {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2624;
  line-height: 1;
}

.route-summary-meta {
  font-size: 0.85rem;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.route-summary-status {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background: #e5e7eb;
  color: #4b5563;
  display: inline-block;
  width: fit-content;
}

.route-summary-card.active .route-summary-status {
  background: #3d4b47;
  color: #fff;
}

/* ============================================
   4. Map Section
   ============================================ */
.route-map-section {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.routing-workspace {
  display: block;
}

.routing-workspace--top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
}

.routing-workspace--top .route-map-section {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.routing-workspace--top .route-map {
  min-height: 0;
  flex: 1;
}

.routing-workspace--top .map-placeholder {
  min-height: 0;
  height: 100%;
}

.map-move-control--inline {
  margin: 0;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  background: #fff;
  overflow: auto;
}

.routing-warning-fab-wrap {
  position: fixed;
  left: 493px;
  bottom: 1rem;
  z-index: 60;
}

.routing-warning-fab {
  border: 1px solid #fca5a5;
  background: #dc2626;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
  position: relative;
}

.routing-warning-fab:hover {
  background: #b91c1c;
}

.routing-warning-fab-icon {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}

.routing-warning-fab-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: #fff;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
}

.routing-warnings-modal-card {
  max-width: 680px;
  width: min(680px, 100%);
  text-align: left;
}

.routing-warnings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.routing-warnings-header h3 {
  margin: 0;
  font-size: 0.92rem;
  color: #92400e;
}

.routing-warnings-count {
  font-size: 0.74rem;
  font-weight: 700;
  color: #92400e;
  background: #fde68a;
  border-radius: 9999px;
  padding: 0.12rem 0.55rem;
}

.routing-warnings-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: min(50vh, 460px);
  overflow: auto;
  padding-right: 0.2rem;
}

.routing-warning-item {
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fff;
  padding: 0.5rem 0.65rem;
}

.routing-warning-message {
  margin: 0;
  color: #374151;
  font-size: 0.78rem;
}

.routing-warning-meta {
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.routing-warning-code {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #92400e;
  background: #fef3c7;
  border-radius: 9999px;
  padding: 0.08rem 0.4rem;
}

.routing-warning-order-link {
  font-size: 0.69rem;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
}

.routing-warning-order-number {
  margin: 0 0 0.15rem;
}

.routing-warning-order-link:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .routing-warning-fab-wrap {
    left: 1rem;
    bottom: 1rem;
  }
}

.routing-details {
  flex-shrink: 0;
  margin: 0;
}

.routing-details > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.7rem 0.9rem;
  font-weight: 600;
  color: #374151;
}

.routing-details > summary::-webkit-details-marker {
  display: none;
}

.routing-details > summary::before {
  content: "▸";
  margin-right: 0.45rem;
  color: #6b7280;
}

.routing-details[open] > summary::before {
  content: "▾";
}

.routing-details:not([open]) {
  max-height: 2.8rem;
  overflow: hidden;
}

.routing-details[open] {
  overflow: auto;
  max-height: 38vh;
  padding-bottom: 0.8rem;
}

.orders-sidebar {
  padding: 0.8rem;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 461px;
  max-width: 461px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.06);
  z-index: 20;
}

.orders-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.orders-sidebar-header h3 {
  margin: 0;
  font-size: 1rem;
}

.orders-total-count {
  font-size: 0.76rem;
  color: #6b7280;
  font-weight: 600;
}

.orders-sidebar-hint {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: #6b7280;
}

.route-locations-sidebar {
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  margin-bottom: 0.65rem;
  background: #fafafa;
}

.route-location-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.35rem 0;
  border-top: 1px solid #e5e7eb;
}

.route-location-item:first-of-type {
  border-top: none;
}

.route-location-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.route-location-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
}

.route-location-text {
  font-size: 0.68rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.orders-sidebar-groups {
  overflow: auto;
  padding-right: 0.15rem;
  flex: 1;
  min-height: 0;
}

.route-location-modal-card {
  max-width: 640px;
  text-align: left;
}

.route-create-modal-card {
  max-width: 560px;
  text-align: left;
}

.route-create-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, auto) minmax(110px, auto);
  gap: 0.5rem;
}

.route-create-form .form-input {
  width: 100%;
}

.route-create-form-actions {
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.route-location-modal-card .modal-title {
  margin-bottom: 1rem;
}

.orders-group {
  margin-bottom: 0.7rem;
}

.orders-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.orders-group-title {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.route-inline-action {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 6px;
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  cursor: pointer;
}

.route-inline-action:hover {
  background: #eef2ff;
}

.injected-stop-form {
  display: none;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.4rem;
  margin-bottom: 0.35rem;
  background: #f9fafb;
}

.injected-stop-form.visible {
  display: block;
}

.route-delete-icon-form {
  margin: 0;
}

.route-delete-icon-btn {
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: #b91c1c;
  border-radius: 6px;
  padding: 0.1rem 0.3rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

.route-delete-icon-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.orders-group-header h4 {
  margin: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #374151;
}

.orders-group-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: #1f2937;
  background: #e5e7eb;
  border-radius: 9999px;
  padding: 0.1rem 0.45rem;
}

.orders-group-driver {
  margin-left: auto;
  margin-right: 0.35rem;
}

.route-driver-select {
  min-width: 120px;
  max-width: 150px;
  padding: 0.2rem 0.3rem;
  font-size: 0.72rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
}

.route-driver-warning {
  font-size: 0.66rem;
  color: #92400e;
  background: #ffedd5;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  margin-right: 0.3rem;
}

.orders-group-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.order-list-item {
  display: grid;
  grid-template-columns: minmax(56px, auto) minmax(56px, auto) minmax(74px, auto) minmax(98px, 1fr) 20px 18px 18px;
  align-items: center;
  column-gap: 0.45rem;
  width: 100%;
  text-align: left;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0.35rem 0.45rem;
  cursor: pointer;
}

.order-list-item[data-recipient-tooltip] {
  position: relative;
}

.order-list-item[data-recipient-tooltip]::before {
  content: "";
  position: absolute;
  left: 0.8rem;
  top: calc(100% + 1px);
  border: 6px solid transparent;
  border-bottom-color: #111827;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.08s ease, transform 0.08s ease;
  pointer-events: none;
  z-index: 40;
}

.order-list-item[data-recipient-tooltip]::after {
  content: attr(data-recipient-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 12px);
  min-width: 220px;
  max-width: 290px;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: #111827;
  color: #f9fafb;
  font-size: 0.68rem;
  line-height: 1.35;
  text-align: left;
  white-space: pre-line;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.08s ease, transform 0.08s ease;
  pointer-events: none;
  z-index: 39;
}

.order-list-item[data-recipient-tooltip]:hover::before,
.order-list-item[data-recipient-tooltip]:focus-visible::before,
.order-list-item[data-recipient-tooltip]:hover::after,
.order-list-item[data-recipient-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.order-list-item:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.order-list-item.sortable-chosen,
.order-list-item.sortable-ghost,
.order-list-item.sortable-drag {
  border-color: #3b82f6;
  background: #eff6ff;
}

.order-list-item.is-selected {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
}

.order-list-item.is-focused {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.22);
}

.order-list-boundary {
  cursor: default;
  background: #f9fafb;
  border-style: dashed;
  grid-template-columns: minmax(30px, auto) minmax(74px, auto) minmax(60px, auto);
}

.order-list-inline-edit {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  border-radius: 6px;
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
  justify-self: end;
}

.order-list-inline-edit:hover {
  background: #eef2ff;
}

.order-list-stop-order {
  font-size: 0.74rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-list-eta {
  font-size: 0.68rem;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-list-number {
  font-size: 0.7rem;
  font-weight: 700;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-list-b-time,
.order-list-city {
  font-size: 0.7rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-list-b-time {
  text-align: center;
  font-weight: 600;
  color: #374151;
}

.order-list-city {
  text-align: right;
}

.order-list-lock {
  justify-self: center;
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.order-list-exclude {
  justify-self: center;
  font-size: 0.74rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  color: #b45309;
}

.order-list-exclude:hover {
  color: #92400e;
}

.order-list-injected-stop {
  cursor: default;
  background: #fffbea;
  border-color: #fde68a;
  grid-template-columns: minmax(30px, auto) minmax(90px, auto) minmax(98px, 1fr) minmax(74px, auto) 20px;
}

.order-list-item.is-excluded-route {
  background: #fffbeb;
  border-color: #fcd34d;
}

.order-list-item.is-excluded-route .order-list-lock,
.order-list-item.is-excluded-route .order-list-drag-handle {
  display: none;
}

.order-list-lock.unlocked {
  opacity: 0.55;
}

.order-list-lock.route_locked {
  opacity: 0.9;
}

.order-list-lock.position_locked {
  opacity: 1;
  color: #111827;
}

.order-list-item.is-position-locked {
  border-color: #111827;
  background: #f9fafb;
}

.order-list-item.is-position-locked .order-list-drag-handle {
  opacity: 0.3;
  pointer-events: none;
}

.order-list-drag-handle {
  justify-self: end;
  color: #9ca3af;
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: -0.08em;
  cursor: grab;
  user-select: none;
}

.order-list-drag-handle:hover {
  color: #4b5563;
}

.order-list-drag-handle:active {
  cursor: grabbing;
}

.header-actions .custom-route-form {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin: 0;
}

.header-actions .custom-route-form .form-input {
  width: auto;
  min-width: 80px;
  padding: 0.3rem 0.4rem;
  font-size: 0.74rem;
}

.header-actions .custom-route-form input[type="text"] {
  min-width: 140px;
}

.header-actions .custom-route-form input[type="time"] {
  min-width: 88px;
}

.map-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.45rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
}

.map-header-main {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.map-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.map-header-route-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.map-header-route-selector {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
}

.map-route-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.map-route-metric-card {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
}

.metric-route-label {
  font-size: 0.67rem;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
}

.metric-route-window,
.metric-route-detail {
  font-size: 0.64rem;
  color: #334155;
}

.map-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2624;
}

.map-tabs {
  display: flex;
  gap: 0.5rem;
}

.map-tab {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: #6b7280;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.map-tab:hover {
  background: #e5e7eb;
  color: #374151;
}

.map-tab.active {
  background: #3d4b47;
  color: #fff;
}

.map-container {
  min-height: 400px;
  background: #f3f4f6;
  position: relative;
}

.route-map {
  position: relative;
  min-height: 400px;
}

.route-map-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #9ca3af;
  background: rgba(255, 255, 255, 0.9);
  padding: 1.5rem 2rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.route-map-message.hidden {
  display: none;
}

.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: #9ca3af;
  gap: 1rem;
}

.map-placeholder-icon {
  font-size: 3rem;
  opacity: 0.5;
}

/* ============================================
   5. Route Tabs Container
   ============================================ */
.route-tabs-container {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

[data-route-visibility] {
  display: none;
}

[data-route-visibility].active {
  display: block;
}

/* ============================================
   6. Route Panel
   ============================================ */
.route-panel {
  padding: 1.5rem;
}

.route-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.route-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.route-info h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #1f2624;
}

.route-info-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: #6b7280;
}

.route-info-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.route-actions {
  display: flex;
  gap: 0.75rem;
}

/* Location Section */
.location-section {
  background: #f9fafb;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid #e5e7eb;
}

.location-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.location-section-header h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.location-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
}

.location-item:not(:last-child) {
  border-bottom: 1px solid #e5e7eb;
}

.location-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.location-icon.start {
  background: #dcfce7;
  color: #166534;
}

.location-icon.end {
  background: #fee2e2;
  color: #991b1b;
}

.location-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.location-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.location-address {
  font-size: 0.95rem;
  color: #1f2624;
  font-weight: 500;
}

/* Stops Section */
.stops-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stops-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.stops-header h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #374151;
}

.stops-count {
  font-size: 0.85rem;
  color: #6b7280;
  background: #e5e7eb;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

.stop-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
  cursor: grab;
}

.stop-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stop-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stop-card.drag-over {
  border-color: #3d4b47;
  background: #f8f9f8;
}

.stop-card.grouped-stop-followup {
  margin-top: -0.25rem;
  border-top: 1px dashed #d1d5db;
}

.stop-card.route-location-stop {
  cursor: default;
  background: #f9fafb;
}

.stop-card.route-location-stop:hover {
  border-color: #d1d5db;
  box-shadow: none;
}

.stop-static-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1f2937;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.stop-drag-handle {
  cursor: grab;
  color: #9ca3af;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.stop-drag-handle:hover {
  color: #6b7280;
  background: #f3f4f6;
}

.stop-drag-handle:active {
  cursor: grabbing;
}

.stop-sequence {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #3d4b47;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.stop-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.stop-title {
  font-weight: 600;
  color: #1f2624;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stop-address {
  font-size: 0.85rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stop-time {
  font-size: 0.8rem;
  color: #3d4b47;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stop-priority {
  font-size: 0.78rem;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.group-stop-note {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
}

/* High impact order styling */
.stop-card.high-impact {
  border-left: 3px solid #ef4444;
  background: #fef2f2;
}

.alert-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #ef4444;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
  margin-left: 0.5rem;
  cursor: help;
}

.stop-time.overdue {
  color: #dc2626;
  font-weight: 600;
}

.stop-route-selector {
  flex-shrink: 0;
}

.stop-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stop-route-selector select {
  min-width: 140px;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 0.85rem;
  color: #374151;
  cursor: pointer;
}

.stop-route-selector select:focus {
  outline: none;
  border-color: #3d4b47;
  box-shadow: 0 0 0 3px rgba(61, 75, 71, 0.1);
}

/* Lock toggle */
.lock-toggle {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.lock-toggle:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.lock-toggle.locked {
  background: #1f2937;
  border-color: #1f2937;
  color: #fff;
}

/* ============================================
   7. Unassigned Pool
   ============================================ */
.unassigned-pool {
  background: #f9fafb;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 2px dashed #d1d5db;
  min-height: 200px;
}

.unassigned-pool.drag-over {
  border-color: #3d4b47;
  background: #f3f4f6;
}

.unassigned-pool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.unassigned-pool-header h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #374151;
}

.unassigned-orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.unassigned-orders-grid:empty::after {
  content: "No unassigned orders";
  display: block;
  text-align: center;
  color: #9ca3af;
  padding: 3rem;
  font-style: italic;
  grid-column: 1 / -1;
}

/* Needs Decision panel */
.needs-decision-panel {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.needs-decision-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.needs-decision-panel .panel-hint {
  font-size: 0.85rem;
  color: #6b7280;
}

.needs-decision-panel .panel-orders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.summary-card.needs-decision {
  border: 1px solid #f59e0b;
  background: #fff7ed;
}

.summary-card.needs-decision.active {
  border-color: #d97706;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

/* Route list panels */
.route-list-panel {
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.route-list-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.route-list-panel .panel-orders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

/* ============================================
   8. Order Cards
   ============================================ */
.order-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: grab;
  transition: all 0.2s ease;
}

.order-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.order-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.order-card.drag-handle {
  color: #9ca3af;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  cursor: grab;
  flex-shrink: 0;
}

.order-card .order-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.order-card .order-customer {
  font-weight: 600;
  color: #1f2624;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-card .order-details {
  font-size: 0.8rem;
  color: #6b7280;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.order-card .order-time {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: #f3f4f6;
  color: #4b5563;
  font-weight: 500;
}

.order-card .order-time.urgent {
  background: #fee2e2;
  color: #991b1b;
}

.order-card .order-route-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.order-priority {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.order-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-assign {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-assign .btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
}

/* ============================================
   9. Location Form
   ============================================ */
.location-form {
  display: none;
  padding: 1rem;
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid #e5e7eb;
  margin-top: 1rem;
}

.location-form.visible {
  display: block;
}

.location-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.location-form-row:last-child {
  margin-bottom: 0;
}

.location-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.location-form label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.location-form input,
.location-form select {
  padding: 0.6rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: #1f2624;
  background: #fff;
  width: 100%;
}

.location-form input:focus,
.location-form select:focus {
  outline: none;
  border-color: #3d4b47;
  box-shadow: 0 0 0 3px rgba(61, 75, 71, 0.1);
}

.location-form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

/* ============================================
   10. Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: #3d4b47;
  color: #fff;
  border-color: #3d4b47;
}

.btn-primary:hover {
  background: #2f3a36;
  border-color: #2f3a36;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background: #fff;
  color: #374151;
  border-color: #d1d5db;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: #3d4b47;
  border-color: #3d4b47;
}

.btn-ghost:hover {
  background: rgba(61, 75, 71, 0.05);
  transform: translateY(-1px);
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
}

.btn-icon {
  padding: 0.5rem;
  width: 36px;
  height: 36px;
}

.btn-edit {
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-edit:hover {
  background: #f3f4f6;
  color: #374151;
  border-color: #9ca3af;
}

.btn-optimize {
  background: #f5a623;
  color: #fff;
  border-color: #f5a623;
}

.btn-optimize:hover {
  background: #e09000;
  border-color: #e09000;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(245, 166, 35, 0.3);
}

/* ============================================
   11. Notifications
   ============================================ */
.notification {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  max-width: 400px;
  animation: slideIn 0.3s ease;
}

.delivery-routes-toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: min(420px, calc(100vw - 2rem));
}

.delivery-routes-toast-stack .toast {
  position: static;
  right: auto;
  bottom: auto;
  margin: 0;
  min-width: 240px;
}

.delivery-routes-toast-stack .toast.success {
  background: rgba(20, 83, 45, 0.94);
}

.delivery-routes-toast-stack .toast.error {
  background: rgba(127, 29, 29, 0.94);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification.success {
  border-left: 4px solid #22c55e;
}

.notification.error {
  border-left: 4px solid #ef4444;
}

.notification.warning {
  border-left: 4px solid #f59e0b;
}

.notification.info {
  border-left: 4px solid #3b82f6;
}

.notification-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.notification.success .notification-icon {
  color: #22c55e;
}

.notification.error .notification-icon {
  color: #ef4444;
}

.notification.warning .notification-icon {
  color: #f59e0b;
}

.notification.info .notification-icon {
  color: #3b82f6;
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-weight: 600;
  color: #1f2624;
  margin-bottom: 0.25rem;
}

.notification-message {
  font-size: 0.9rem;
  color: #6b7280;
}

.notification-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.25rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.notification-close:hover {
  color: #6b7280;
}

/* ============================================
   Map Move Control
   ============================================ */
.map-move-control {
  padding: 0.65rem 0.8rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.map-move-control h4 {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1f2624;
}

.move-hint {
  font-size: 0.74rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
  display: block;
}

.move-route-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.move-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 2px solid #e5e7eb;
  transition: all 0.2s ease;
}

.move-option:hover {
  border-color: #d1d5db;
}

.move-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.move-option input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.move-option input[type="radio"]:checked + .option-label {
  font-weight: 600;
}

.move-option:has(input[type="radio"]:checked) {
  border-color: #3d4b47;
  background: #f3f4f6;
}

.option-label {
  font-size: 0.78rem;
  color: #374151;
}

.option-label.morning {
  color: #d97706;
}

.option-label.afternoon {
  color: #2563eb;
}

.option-label.pool {
  color: #3b82f6;
}

.option-label.courier {
  color: #ef4444;
}

.option-label.unassigned {
  color: #6b7280;
}

.move-status {
  padding: 0.5rem 0.6rem;
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid #e5e7eb;
}

.status-text {
  font-size: 0.75rem;
  color: #6b7280;
}

.status-text.active {
  color: #3d4b47;
  font-weight: 500;
}

/* ============================================
   Bulk Selection Styles
   ============================================ */
.move-control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.move-control-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.move-help-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.move-help-icon {
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  border: 1px solid #9ca3af;
  background: #f9fafb;
  color: #4b5563;
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
}

.move-help-content {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.35rem);
  transform: translateX(-50%);
  width: 230px;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: #111827;
  color: #f9fafb;
  font-size: 0.68rem;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 6;
}

.move-help-tooltip:hover .move-help-content,
.move-help-tooltip:focus-within .move-help-content {
  opacity: 1;
  visibility: visible;
}

.move-control-header h4 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1f2624;
}

.selection-badge {
  background: #e5e7eb;
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  min-width: 2rem;
  text-align: center;
  transition: all 0.2s ease;
}

.selection-badge.has-selection {
  background: #10b981;
  color: white;
}

.move-actions {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.move-selected-btn {
  flex: 1;
}

.move-selected-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Selection marker styles */
.marker-selected {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px #10b981, 0 6px 12px rgba(16, 185, 129, 0.4) !important;
}

/* ============================================
   Side-by-Side Routes Layout
   ============================================ */
.routes-side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.route-column {
  min-width: 0;
}

.route-column .route-panel {
  height: 100%;
}

/* Pool Section - Above Routes */
.pool-section {
  margin-bottom: 1.5rem;
  background: #f0f9ff;
  border: 2px solid #bae6fd;
}

.pool-section .pool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #e0f2fe;
  border-bottom: 1px solid #bae6fd;
}

.pool-section .pool-header h3 {
  margin: 0;
  color: #0369a1;
}

.pool-orders-droppable {
  padding: 1rem;
  min-height: 100px;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.pool-orders-droppable:empty::before {
  content: "Drag orders here to assign to Pool";
  color: #6b7280;
  font-style: italic;
  padding: 2rem;
  text-align: center;
  width: 100%;
}

/* Secondary Routes (Unassigned, Courier) */
.secondary-routes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Draggable Areas */
.stops-list-droppable,
.panel-orders-droppable {
  min-height: 100px;
  padding: 0.5rem;
  border: 2px dashed transparent;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.stops-list-droppable.empty-route,
.panel-orders-droppable:empty {
  border-color: #d1d5db;
  background: #f9fafb;
}

.stops-list-droppable.drag-over,
.panel-orders-droppable.drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}

/* Draggable Items */
.draggable-order,
.draggable-stop {
  cursor: grab;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.draggable-order:active,
.draggable-stop:active {
  cursor: grabbing;
}

.draggable-order.sortable-ghost,
.draggable-stop.sortable-ghost {
  opacity: 0.4;
  background: #f3f4f6;
}

.draggable-order.sortable-drag,
.draggable-stop.sortable-drag {
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  z-index: 1000;
}

/* Empty State Placeholders */
.empty-route-placeholder,
.droppable-placeholder {
  padding: 2rem;
  text-align: center;
  color: #6b7280;
  font-style: italic;
  border: 2px dashed #d1d5db;
  border-radius: var(--radius-sm);
  background: #f9fafb;
}

/* No Route Droppable */
.no-route-droppable {
  padding: 3rem;
  text-align: center;
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: var(--radius-md);
}

.no-route-droppable p {
  margin: 0;
  color: #6b7280;
}

.no-route-droppable .drag-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

/* ============================================
   Bulk Selection Styles
   ============================================ */
.map-time-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #374151;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background: #f3f4f6;
  transition: all 0.2s ease;
}

.map-time-toggle:hover {
  background: #e5e7eb;
}

.map-time-toggle input[type="checkbox"] {
  cursor: pointer;
}

/* Stop card time display */
.stop-time-display {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #f9fafb;
  border-radius: var(--radius-sm);
  border-left: 3px solid #d1d5db;
}

.time-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.time-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  min-width: 55px;
}

.time-value {
  font-size: 0.9rem;
  font-weight: 600;
}

.eta-value {
  color: #1f2624;
  font-size: 1rem;
}

.required-value {
  color: #4b5563;
}

.time-status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.status-ontime {
  background: #dcfce7;
  color: #166534;
}

.status-tight {
  background: #fef9c3;
  color: #854d0e;
}

.status-late {
  background: #fee2e2;
  color: #991b1b;
}

.status-early {
  background: #fee2e2;
  color: #991b1b;
}

/* Card border colors based on time status */
.stop-card.time-on-time .stop-time-display {
  border-left-color: #22c55e;
  background: #f0fdf4;
}

.stop-card.time-tight .stop-time-display {
  border-left-color: #eab308;
  background: #fefce8;
}

.stop-card.time-late .stop-time-display {
  border-left-color: #ef4444;
  background: #fef2f2;
}

/* ============================================
   Compact Density Overrides
   ============================================ */
.delivery-routes-layout {
  gap: 0.9rem;
  padding: 0.35rem 0;
}

.routes-header {
  padding: 0.55rem 0.75rem;
}

.routes-header--sticky {
  top: 0.2rem;
}

.delivery-routes-layout--single-screen .delivery-routes-content {
  gap: 0.55rem;
}

.header-left {
  gap: 0.45rem;
}

.header-left h1 {
  font-size: 1rem;
}

.header-actions {
  gap: 0.28rem;
}

.header-actions .btn {
  padding: 0.34rem 0.5rem;
  font-size: 0.74rem;
}

.header-actions .btn-optimize {
  padding-inline: 0.62rem;
}

.date-selector .date-input {
  padding: 0.24rem 0.35rem;
  font-size: 0.75rem;
  min-height: 2rem;
}

.route-filter-bar {
  padding: 0.45rem 0.65rem;
  gap: 0.35rem;
}

.route-filter-bar__header h3 {
  font-size: 0.76rem;
}

.route-filter-chips {
  gap: 0.35rem;
  padding-bottom: 0;
}

.route-filter-chip {
  padding: 0.22rem 0.52rem;
}

.chip-label {
  font-size: 0.72rem;
}

.chip-count {
  font-size: 0.66rem;
}

.orders-sidebar {
  padding: 0.55rem;
}

.orders-sidebar-header {
  margin-bottom: 0.2rem;
}

.orders-sidebar-header h3 {
  font-size: 0.88rem;
}

.orders-sidebar-hint {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
}

.orders-group {
  margin-bottom: 0.45rem;
}

.orders-group-header {
  margin-bottom: 0.22rem;
}

.orders-group-header h4 {
  font-size: 0.74rem;
}

.orders-group-count {
  font-size: 0.66rem;
}

.route-driver-select {
  min-width: 96px;
  max-width: 120px;
  font-size: 0.66rem;
}

.orders-group-list {
  gap: 0.22rem;
}

.order-list-item {
  padding: 0.27rem 0.38rem;
}

.order-list-stop-order {
  font-size: 0.68rem;
}

.order-list-b-time,
.order-list-city {
  font-size: 0.66rem;
}

.route-summary-cards {
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.summary-card,
.route-summary-card {
  padding: 0.75rem;
}

.route-map-section,
.routes-side-by-side,
.pool-section,
.route-list-panel {
  margin-bottom: 0.9rem;
}

.map-header,
.pool-section .pool-header,
.map-move-control {
  padding: 0.6rem 0.75rem;
}

.map-header h3 {
  font-size: 0.95rem;
}

.map-container,
.route-map,
.map-placeholder {
  min-height: 280px;
}

.route-panel,
.route-list-panel,
.needs-decision-panel {
  padding: 1rem;
}

.route-controls {
  margin-bottom: 0.9rem;
  padding-bottom: 0.75rem;
}

.location-section {
  padding: 0.75rem;
  margin-bottom: 0.9rem;
}

.stops-section {
  gap: 0.5rem;
}

.stops-list-droppable,
.panel-orders-droppable,
.pool-orders-droppable {
  min-height: 72px;
  padding: 0.4rem;
  gap: 0.5rem;
}

.stop-card,
.order-card {
  padding: 0.5rem 0.6rem;
  gap: 0.5rem;
}

.stop-sequence {
  width: 26px;
  height: 26px;
  font-size: 0.8rem;
}

.stop-info,
.order-card .order-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem 0.6rem;
  min-width: 0;
}

.stop-name,
.order-name {
  font-size: 0.86rem;
  font-weight: 600;
  max-width: 14rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stop-address,
.order-address {
  font-size: 0.8rem;
  max-width: 18rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-window,
.order-priority {
  font-size: 0.72rem;
  margin: 0;
}

.group-stop-note {
  margin-top: 0;
  font-size: 0.68rem;
  padding: 0.05rem 0.4rem;
}

.stop-time-display {
  margin-top: 0;
  padding: 0;
  border-left: none;
  background: transparent;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.time-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.08rem 0.4rem;
  border-radius: 9999px;
  background: #f3f4f6;
}

.time-label {
  min-width: auto;
  font-size: 0.67rem;
}

.time-value {
  font-size: 0.78rem;
}

.eta-value {
  font-size: 0.82rem;
}

.time-status-badge {
  font-size: 0.62rem;
  padding: 0.08rem 0.35rem;
}

.stop-actions,
.order-actions,
.quick-assign {
  gap: 0.3rem;
}

.quick-assign .btn,
.btn.btn-small {
  padding: 0.22rem 0.45rem;
  font-size: 0.69rem;
}

.empty-route-placeholder,
.droppable-placeholder,
.no-route-droppable {
  padding: 0.9rem;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 900px) {
  .delivery-routes-layout--single-screen {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .delivery-routes-layout--single-screen .delivery-routes-content {
    height: auto;
    overflow: visible;
  }

  .delivery-routes-content {
    margin-left: 0;
    padding-left: 0;
  }

  .route-filter-bar {
    position: static;
  }

  .routes-header--sticky {
    position: static;
  }

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

  .routing-details[open] {
    max-height: none;
  }

  .orders-sidebar {
    position: static;
    width: auto;
    max-width: none;
    top: auto;
    bottom: auto;
    left: auto;
    max-height: none;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 0.9rem;
  }

  .route-summary-cards {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .routes-side-by-side {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .secondary-routes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .route-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .routes-side-by-side {
    grid-template-columns: 1fr;
  }
  
  .secondary-routes {
    grid-template-columns: 1fr;
  }
  
  .pool-orders-droppable {
    flex-direction: column;
  }
  
  .routes-header {
    flex-direction: column;
    align-items: flex-start;
    overflow: visible;
    gap: 0.5rem;
  }

  .map-header-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .map-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .header-action-group {
    flex-wrap: wrap;
  }

  .header-actions .custom-route-form {
    flex-wrap: wrap;
  }
  
  .route-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .route-info-meta {
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .route-summary-cards {
    grid-template-columns: 1fr;
  }
  
  .unassigned-orders-grid {
    grid-template-columns: 1fr;
  }
  
  .stop-card {
    flex-wrap: wrap;
  }
  
  .stop-route-selector {
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .stop-route-selector select {
    width: 100%;
  }
  
  .location-form-row {
    grid-template-columns: 1fr;
  }

  .route-create-form-grid {
    grid-template-columns: 1fr;
  }
  
  .notification {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }

  .delivery-routes-toast-stack {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}
