.ops-page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ops-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  min-height: calc(100vh - 120px);
}

.ops-map-wrap {
  min-width: 0;
  position: relative;
}

.ops-map {
  width: 100%;
  height: calc(100vh - 120px);
  min-height: 480px;
}

.ops-map-wrap .route-measure-control {
  margin-top: 0;
}

.ops-map-wrap .route-measure-btn {
  width: 34px;
  height: 34px;
  line-height: 34px;
  text-align: center;
  font-size: 1rem;
  color: #334155;
  background: #fff;
}

.ops-map-wrap .route-measure-btn:hover,
.ops-map-wrap .route-measure-btn.is-active {
  color: #1d4ed8;
  background: #eff6ff;
}

.ops-map-wrap .route-measure-btn.is-active {
  box-shadow: inset 0 0 0 2px #2563eb;
}

.ops-map-wrap .leaflet-container.route-measure-active {
  cursor: crosshair;
}

.ops-map-wrap .route-measure-panel {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1000;
  width: min(280px, calc(100% - 24px));
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 12px;
}

.ops-map-wrap .route-measure-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.ops-map-wrap .route-measure-total,
.ops-map-wrap .route-measure-segment {
  font-size: 0.82rem;
  color: #334155;
  margin-bottom: 4px;
}

.ops-map-wrap .route-measure-segment {
  color: #64748b;
}

.ops-map-wrap .route-measure-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin: 8px 0;
}

.ops-map-wrap .route-measure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ops-map-wrap .route-measure-point-label {
  background: transparent;
  border: 0;
}

.ops-map-wrap .route-measure-point-label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
}

.ops-map-wrap .leaflet-control-layers {
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.ops-map-wrap .leaflet-container.ops-geocode-tag-active {
  cursor: crosshair;
}

.ops-geocode-panel {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 1100;
  width: min(320px, calc(100% - 24px));
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.ops-geocode-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.85rem;
}

.ops-geocode-close {
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
}

.ops-geocode-panel-body {
  padding: 12px;
}

.ops-geocode-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.ops-geocode-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}

.ops-geocode-input {
  margin-bottom: 8px;
}

.ops-geocode-hint,
.ops-geocode-coords {
  font-size: 0.78rem;
  color: #475569;
  margin-bottom: 6px;
}

.ops-geocode-hint {
  color: #64748b;
}

.ops-geocode-coords {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #1d4ed8;
}

.ops-geocode-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 12px 12px;
}

/* Google Places dropdown above Leaflet map/panel */
.pac-container {
  z-index: 1200 !important;
  font-family: inherit;
}

.ops-geocode-marker {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ea580c;
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.25));
}

.ops-customer-marker {
  background: transparent;
  border: 0;
}

.ops-customer-marker-inner {
  width: 30px;
  height: 30px;
  border-radius: 999px 999px 999px 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}

.ops-customer-marker-inner i {
  transform: rotate(45deg);
  font-size: 0.85rem;
}

.ops-customer-marker--fins {
  background: #dc2626;
}

.ops-customer-marker--sponji {
  background: #2563eb;
}

.ops-branch-marker {
  background: transparent;
  border: none;
}

.ops-branch-marker-inner {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #0f766e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.35);
  border: 2px solid #fff;
}

.ops-branch-marker-inner i {
  font-size: 1rem;
}

.ops-branch-marker-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #f59e0b;
  color: #111827;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  border: 1px solid #fff;
}

.ops-branch-popup {
  min-width: 260px;
  max-width: 340px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.ops-branch-popup-title {
  display: block;
  margin-bottom: 4px;
  color: #0f172a;
  font-size: 0.95rem;
}

.ops-branch-popup-summary {
  margin-bottom: 10px;
  color: #475569;
}

.ops-branch-popup-section + .ops-branch-popup-section {
  margin-top: 10px;
}

.ops-branch-popup-section-title {
  font-weight: 700;
  color: #0f766e;
  margin-bottom: 6px;
}

.ops-branch-popup-list {
  max-height: 160px;
  overflow-y: auto;
}

.ops-moving-popup-row {
  padding: 8px 0;
  border-top: 1px solid #e2e8f0;
}

.ops-moving-popup-row:first-child {
  border-top: none;
  padding-top: 0;
}

.ops-moving-popup-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.ops-moving-popup-route {
  color: #0f172a;
  font-weight: 600;
}

.ops-moving-popup-meta {
  color: #64748b;
  font-size: 0.76rem;
  margin-top: 4px;
}

.ops-moving-popup-products-wrap {
  margin-top: 4px;
}

.ops-moving-popup-products-label {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.ops-moving-popup-products {
  margin: 0;
  padding-left: 16px;
  color: #334155;
  font-size: 0.76rem;
}

.ops-moving-popup-products li {
  margin: 1px 0;
}

.ops-moving-popup-products-empty {
  color: #94a3b8;
  font-size: 0.76rem;
}

.ops-moving-popup-empty {
  color: #94a3b8;
  font-size: 0.78rem;
  font-style: italic;
}

.ops-customer-coords {
  font-size: 0.75rem;
  color: #64748b;
}

.ops-customer-popup {
  min-width: 220px;
  max-width: 280px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.ops-customer-popup strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
}

.ops-popup-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px;
  margin-bottom: 4px;
}

.ops-popup-row--products {
  align-items: start;
}

.ops-popup-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.ops-popup-label {
  color: #64748b;
  font-size: 0.75rem;
}

.ops-popup-value {
  color: #334155;
  word-break: break-word;
}

.ops-popup-total {
  color: #0f172a;
}

.ops-reco-tag-row {
  padding: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ops-side-panel {
  border-left: 1px solid #e5e7eb;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
  min-height: 0;
}

.ops-toolbar {
  padding: 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.ops-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.ops-stats-grid--tab {
  border-bottom: 0;
  padding-top: 0;
}

.ops-stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
}

.ops-stat-label {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ops-stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 4px;
}

.ops-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 10;
}

.ops-tab-btn {
  flex: 1;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #334155;
  font-weight: 800;
  font-size: 0.78rem;
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ops-tab-btn.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.ops-tab-panel {
  display: none;
  flex: 1;
  min-height: 0;
}

.ops-tab-panel.is-active {
  display: flex;
  flex-direction: column;
}

.ops-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  padding: 12px 14px 8px;
  margin: 0;
}

.ops-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-right: 10px;
}

.ops-section-header .ops-section-title {
  flex: 1;
  padding-right: 0;
}

.ops-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  flex-shrink: 0;
}

.ops-icon-btn:hover {
  background: #f8fafc;
  color: #0f172a;
}

.ops-icon-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ops-icon-btn.is-spinning i {
  animation: ops-spin 0.8s linear infinite;
}

@keyframes ops-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.ops-driver-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px 14px;
}

body.page-active-drivers .ops-content {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

body.page-active-drivers .ops-tab-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

body.page-active-drivers .ops-side-panel {
  min-width: 0;
}

/* Recommendations tab — aligned with on_fleet ops-live */
.ops-reco-list {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.ops-reco-loading,
.ops-reco-empty-state {
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 28, 46, 0.1);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  color: #5b6b7c;
}

.ops-reco-summary {
  border-radius: 14px;
  border: 1px solid rgba(15, 28, 46, 0.1);
  background: #f8fafc;
  padding: 14px;
}

.ops-reco-summary-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.ops-reco-summary-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 800;
  color: #0f1c2e;
}

.ops-reco-summary-stats {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #5b6b7c;
}

.ops-reco-summary-stats strong {
  color: #0f1c2e;
}

.ops-reco-summary-note {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: #8a97a6;
  line-height: 1.45;
}

.ops-reco-summary-note strong {
  color: #0f1c2e;
}

.ops-reco-auto-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 9px;
  background: #059669;
  color: #fff;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ops-reco-auto-all-btn:hover:not(:disabled) {
  background: #047857;
}

.ops-reco-auto-all-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ops-reco-task-card {
  border-radius: 14px;
  border: 1px solid rgba(15, 28, 46, 0.1);
  background: #fff;
  padding: 14px;
  transition: border-color 0.15s ease;
}

.ops-reco-task-card:hover {
  border-color: rgba(11, 110, 153, 0.28);
}

.ops-reco-task-title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f1c2e;
}

.ops-reco-task-line {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #5b6b7c;
  line-height: 1.45;
}

.ops-reco-status--success {
  font-weight: 700;
  color: #047857;
}

.ops-reco-status--danger {
  font-weight: 700;
  color: #b91c1c;
}

.ops-reco-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.ops-reco-action-btn {
  border: 1px solid rgba(15, 28, 46, 0.12);
  border-radius: 8px;
  background: #fff;
  color: #5b6b7c;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ops-reco-action-btn:hover {
  background: #f8fafc;
  border-color: rgba(15, 28, 46, 0.2);
  color: #0f1c2e;
}

.ops-reco-assign-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(15, 28, 46, 0.12);
}

.ops-reco-autopick {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(236, 253, 245, 0.72);
}

.ops-reco-autopick-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.ops-reco-autopick-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 6px;
  background: #059669;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ops-reco-autopick-name {
  font-size: 13px;
  font-weight: 800;
  color: #0f1c2e;
}

.ops-reco-autopick-meta {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: #5b6b7c;
}

.ops-reco-driver-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a97a6;
}

.ops-reco-assign-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

.ops-reco-driver {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(15, 28, 46, 0.12);
  border-radius: 8px;
  background: #fff;
  color: #0f1c2e;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
}

.ops-reco-driver:focus {
  border-color: #2a9bc0;
  box-shadow: 0 0 0 3px rgba(11, 110, 153, 0.15);
}

.ops-reco-assign {
  flex-shrink: 0;
  min-width: 92px;
  border: 0;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ops-reco-assign--auto {
  background: #0b6e99;
}

.ops-reco-assign--auto:hover:not(:disabled) {
  background: #095a7d;
}

.ops-reco-assign--manual {
  background: #0f1c2e;
}

.ops-reco-assign--manual:hover:not(:disabled) {
  background: #1e293b;
}

.ops-reco-assign:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ops-reco-assign-hint {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 600;
  color: #8a97a6;
}

.ops-reco-empty-drivers {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(15, 28, 46, 0.12);
  font-size: 11.5px;
  font-weight: 600;
  color: #8a97a6;
}

.ops-driver-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ops-driver-card:hover,
.ops-driver-card.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.ops-driver-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ops-driver-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ops-journey-play-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ops-journey-play-btn:hover,
.ops-journey-play-btn.is-active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

.ops-journey-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  z-index: 1100;
  width: min(360px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  touch-action: none;
}

.ops-journey-panel.is-dragging {
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.24);
  user-select: none;
}

.ops-journey-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  cursor: grab;
  user-select: none;
}

.ops-journey-panel.is-dragging .ops-journey-header {
  cursor: grabbing;
}

.ops-journey-drag-hint {
  display: inline-flex;
  align-items: center;
  color: #94a3b8;
  font-size: 0.9rem;
  margin-right: 4px;
  flex-shrink: 0;
  margin-top: 1px;
}

.ops-journey-header-title {
  flex: 1;
  min-width: 0;
}

.ops-journey-panel.is-minimized {
  max-height: none;
  width: min(320px, calc(100% - 24px));
}

.ops-journey-panel.is-minimized .ops-journey-toolbar,
.ops-journey-panel.is-minimized .ops-journey-legend,
.ops-journey-panel.is-minimized .ops-journey-timeline {
  display: none;
}

.ops-journey-panel.is-minimized .ops-journey-header {
  border-bottom: none;
}

.ops-journey-header-actions {
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  flex-shrink: 0;
}

.ops-journey-minimize {
  border: 0;
  background: transparent;
  font-size: 1rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 2px 4px;
}

.ops-journey-minimize:hover {
  color: #0f172a;
}

.ops-journey-subtitle {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}

.ops-journey-close {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
}

.ops-journey-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.ops-journey-speed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: #64748b;
  margin-left: auto;
}

.ops-journey-speed .form-select {
  width: 64px;
  min-height: 30px;
  padding-top: 2px;
  padding-bottom: 2px;
}

.ops-journey-clock {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  min-width: 48px;
  text-align: right;
}

.ops-journey-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.ops-journey-legend-item {
  font-size: 0.72rem;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ops-journey-legend-item::before {
  content: '';
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.ops-journey-legend--history::before {
  background: #2563eb;
}

.ops-journey-legend--planned::before {
  background: repeating-linear-gradient(
    90deg,
    #f59e0b 0,
    #f59e0b 4px,
    transparent 4px,
    transparent 7px
  );
}

.ops-journey-timeline {
  overflow: auto;
  padding: 10px 14px 14px;
  max-height: min(420px, 55vh);
}

.ops-journey-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.ops-journey-item:last-child {
  border-bottom: 0;
}

.ops-journey-item.is-active {
  background: #eff6ff;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 8px;
}

.ops-journey-time {
  font-size: 0.75rem;
  font-weight: 700;
  color: #334155;
}

.ops-journey-label {
  font-size: 0.82rem;
  color: #0f172a;
  font-weight: 600;
}

.ops-journey-detail {
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 2px;
}

.ops-journey-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  margin-top: 4px;
}

.ops-journey-badge--history {
  background: #dbeafe;
  color: #1d4ed8;
}

.ops-journey-badge--planned {
  background: #ffedd5;
  color: #c2410c;
}

.ops-journey-badge--current {
  background: #dcfce7;
  color: #15803d;
}

.ops-journey-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
}

.ops-journey-marker--history {
  background: #2563eb;
}

.ops-journey-marker--planned {
  background: #f59e0b;
}

.ops-journey-marker--delivered {
  background: #16a34a;
}

.ops-journey-marker--current {
  background: #0ea5e9;
}

.ops-journey-playback-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1d4ed8;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.ops-driver-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.92rem;
}

.ops-driver-meta {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 4px;
}

.ops-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ops-status-dot.online {
  background: #16a34a;
}

.ops-status-dot.offline {
  background: #94a3b8;
}

.ops-status-dot.delivery {
  background: #2563eb;
}

.ops-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #166534;
  background: #dcfce7;
  border-radius: 999px;
  padding: 4px 10px;
}

.ops-live-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  animation: ops-pulse 1.4s infinite;
}

@keyframes ops-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.ops-toast-container {
  position: fixed;
  top: 78px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.ops-toast {
  background: #0f172a;
  color: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  animation: ops-toast-in 0.2s ease;
}

.ops-toast strong {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

.ops-toast span {
  font-size: 0.88rem;
}

.ops-toast-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}

.ops-toast-assign {
  background: #1d4ed8;
}

.ops-toast-dashboard {
  background: #0f766e;
}

.ops-toast-gps {
  background: #7c3aed;
}

.ops-toast.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

@keyframes ops-toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ops-driver-popup {
  font-size: 0.82rem;
  line-height: 1.45;
  min-width: 180px;
}

.ops-driver-popup-row {
  margin-top: 4px;
}

.ops-driver-popup-tasks {
  color: #475569;
  font-size: 0.76rem;
  margin-top: 2px;
  margin-bottom: 2px;
}

.ops-driver-marker {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
}

.ops-driver-marker.is-online {
  background: #16a34a;
}

.ops-driver-marker.is-delivery {
  background: #ea580c;
}

.ops-empty {
  color: #64748b;
  font-size: 0.88rem;
  text-align: center;
  padding: 16px 8px;
}

@media (max-width: 991px) {
  .ops-content {
    grid-template-columns: 1fr;
  }

  body.page-active-drivers .ops-content {
    grid-template-columns: 1fr;
  }

  .ops-side-panel {
    max-height: none;
    border-left: 0;
    border-top: 1px solid #e5e7eb;
  }

  .ops-map {
    height: 50vh;
    min-height: 320px;
  }
}
