/* ==========================================================================
   Akıllı Kurye & Rota Yönetim Sistemi - Modern Tasarım Stilleri
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  --primary-glow: rgba(79, 70, 229, 0.25);

  --success: #10b981;
  --success-dark: #059669;
  --success-light: #d1fae5;

  --warning: #f59e0b;
  --warning-light: #fef3c7;

  --danger: #ef4444;
  --danger-dark: #dc2626;
  --danger-light: #fee2e2;

  --info: #0284c7;
  --info-light: #e0f2fe;

  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-card-alt: #334155;
  --bg-input: #0f172a;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-color: #334155;
  --border-light: #475569;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ==========================================================================
   Header & Top Bar
   ========================================================================== */
.app-header {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 4px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.app-header-inner {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
  border: 1px solid rgba(56, 189, 248, 0.4);
  flex-shrink: 0;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.1;
}

.header-status-area {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gps-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.gps-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #10b981; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* ==========================================================================
   Main Container & Responsive Layout
   ========================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 6px 14px;
  gap: 6px;
}

/* ==========================================================================
   Birleşik Hızlı Aksiyon & Kompakt İstatistik Çubuğu (Ultra-Kompakt & Efektif)
   ========================================================================== */
.unified-command-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.command-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.command-stats-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.76rem;
  transition: all var(--transition-fast);
}

.stat-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
}

.stat-pill-icon {
  font-size: 12px;
  display: flex;
  align-items: center;
}

.stat-pill-val {
  font-size: 0.9rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1;
}

.stat-pill-lbl {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
}

.stat-pill.total { border-color: rgba(79, 70, 229, 0.35); background: rgba(79, 70, 229, 0.1); }
.stat-pill.total .stat-pill-val { color: #a5b4fc; }

.stat-pill.packages { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.1); }
.stat-pill.packages .stat-pill-val { color: #fcd34d; }

.stat-pill.pending { border-color: rgba(2, 132, 199, 0.35); background: rgba(2, 132, 199, 0.1); }
.stat-pill.pending .stat-pill-val { color: #38bdf8; }

.stat-pill.delivered { border-color: rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.1); }
.stat-pill.delivered .stat-pill-val { color: #34d399; }

.stat-pill.cancelled { border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.1); }
.stat-pill.cancelled .stat-pill-val { color: #f87171; }

/* Hızlı Müşteri Ekleme Çubuğu (Ultra-Kompakt) */
.quick-add-bar {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.quick-add-title {
  font-weight: 700;
  font-size: 0.8rem;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.quick-add-search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.quick-add-pkg-wrap, .quick-add-driver-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}

.quick-add-lbl {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
}

/* Eski sınıflar için geriye dönük uyumluluk */
.stats-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-group-left, .btn-group-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}
.btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

.btn-secondary {
  background: var(--bg-card-alt);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: #3e4f68;
  border-color: var(--border-light);
}

.btn-accent {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: white;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}
.btn-accent:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.78rem;
  border-radius: 6px;
}

/* ==========================================================================
   Content Grid (Masaüstünde Yan Yana, Mobilde Sekmeli / Dikey)
   ========================================================================== */
.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  flex: 1;
}

@media (min-width: 992px) {
  .content-grid {
    grid-template-columns: 480px 1fr;
  }
}

/* View Switcher for Mobile / Desktop */
.view-tabs {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
  margin-bottom: 6px;
}

@media (min-width: 992px) {
  .view-tabs, #mobileViewTabs {
    display: none !important;
  }
}

.view-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.view-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 6px var(--primary-glow);
}

/* Panel Containers */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.4);
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  padding: 14px;
  flex: 1;
  overflow-y: auto;
  max-height: calc(100vh - 270px);
}

/* ==========================================================================
   Delivery List & Cards
   ========================================================================== */
.delivery-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.delivery-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.delivery-card:hover {
  border-color: #4f46e5;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
  transform: translateY(-1px);
}

.delivery-card.status-delivered {
  border-left: 4px solid var(--success);
  background: rgba(16, 185, 129, 0.04);
}

.delivery-card.status-cancelled {
  border-left: 4px solid var(--danger);
  background: rgba(239, 68, 68, 0.04);
  opacity: 0.85;
}

.delivery-card.status-pending {
  border-left: 4px solid var(--warning);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-stop-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.status-delivered .stop-number { background: var(--success); }
.status-cancelled .stop-number { background: var(--danger); }
.status-pending .stop-number { background: var(--primary); }

.customer-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.customer-code-badge {
  font-size: 0.72rem;
  font-weight: 600;
  background: #1e293b;
  color: #94a3b8;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gps-verified-tag {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.distance-tag {
  background: rgba(79, 70, 229, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(79, 70, 229, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-address {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.card-address svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Card Action Bar */
.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
}

.card-main-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-order-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon-order {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: #334155;
  color: #94a3b8;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-icon-order:hover {
  background: #475569;
  color: #fff;
}

/* "Dükkanın Önündeyim" Butonu */
.btn-update-gps {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-update-gps:hover {
  background: rgba(16, 185, 129, 0.3);
  color: #fff;
  border-color: #10b981;
}

/* Teslimat Sonuç Bilgisi (Fotoğraf & İptal Sebebi) */
.card-proof-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.7);
  padding: 4px 8px;
  border-radius: 4px;
}

.card-proof-badge img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
  cursor: pointer;
}

/* ==========================================================================
   Map Styling
   ========================================================================== */
#map {
  width: 100%;
  height: 100%;
  min-height: 480px;
  background: #1e293b;
  border-radius: var(--radius-md);
  z-index: 1;
}

.map-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 500px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.map-floating-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-control-btn {
  background: rgba(30, 41, 59, 0.9);
  color: #fff;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.map-control-btn:hover {
  background: #334155;
  border-color: #4f46e5;
}

/* Leaflet DivIcon Default Reset (Çirkin beyaz kutu ve gri çerçeveyi kaldır) */
.leaflet-div-icon {
  background: transparent !important;
  border: none !important;
}

/* Leaflet Marker Taşma İzni (Sıra ve Koli Rozetleri İçin) */
.leaflet-custom-marker {
  overflow: visible !important;
}

/* Modern SVG Marker Pins (Ultra-keskin, vektörel, renkli durumlar) */
.modern-pin {
  position: relative;
  width: 32px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
  transition: transform 0.15s ease-out;
}

.modern-pin:hover {
  transform: scale(1.15) translateY(-2px);
  z-index: 1000 !important;
}

.modern-pin .pin-svg {
  display: block;
  width: 32px;
  height: 40px;
}

/* Pinin Ortasında: Toplam Koli / Paket Miktarı */
.modern-pin .pin-label-text {
  position: absolute;
  top: 5px;
  left: 0;
  width: 32px;
  height: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

/* Pinin Yanında: Kaçıncı Sırada Olduğu Rozeti */
.pin-seq-tag {
  position: absolute;
  top: -2px;
  left: 26px;
  background: rgba(15, 23, 42, 0.95);
  color: #38bdf8;
  border: 1.5px solid #38bdf8;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  line-height: 1.2;
}

.pin-seq-tag.delivered {
  color: #34d399;
  border-color: #10b981;
}

.pin-seq-tag.cancelled {
  color: #f87171;
  border-color: #ef4444;
}

.modern-pin .pin-star {
  position: absolute;
  top: -6px;
  left: -6px;
  font-size: 13px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* Kurye Canlı Marker (Mavi Nabız / Radar) */
.courier-radar-marker,
.courier-pulse-marker {
  position: relative !important;
  width: 26px !important;
  height: 26px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.courier-radar-core {
  width: 14px;
  height: 14px;
  background: #0284c7;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 12px #38bdf8;
  position: relative;
  z-index: 2;
}

.courier-radar-pulse {
  position: absolute;
  width: 38px;
  height: 38px;
  background: rgba(56, 189, 248, 0.45);
  border-radius: 50%;
  animation: radarPulse 2s infinite ease-out;
  z-index: 1;
}

@keyframes radarPulse {
  0% { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-radius: 12px !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
  padding: 4px !important;
}

.leaflet-popup-tip {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
}

.map-popup-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
  padding: 4px;
}

.map-popup-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.map-popup-addr {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.3;
}

.map-popup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

/* ==========================================================================
   Modals & Forms
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.5);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(15, 23, 42, 0.3);
}

/* Form Elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  color: #fff;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* OCR Upload & Scan Area */
.upload-drop-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 28px 16px;
  text-align: center;
  background: rgba(15, 23, 42, 0.4);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.upload-drop-zone:hover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}

.upload-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.2);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

/* OCR Progress & Scanner effect */
.ocr-progress-box {
  display: none;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.progress-bar-container {
  height: 8px;
  background: #334155;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #10b981);
  width: 0%;
  transition: width 0.3s ease;
}

.ocr-status-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

/* Memory Hit Alert */
.memory-hit-alert {
  display: none;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  align-items: center;
  gap: 10px;
}

/* Camera Preview & Photo Capture */
.camera-preview-box {
  width: 100%;
  min-height: 200px;
  max-height: 280px;
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

.camera-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  border: 1px solid #334155;
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  min-width: 260px;
  max-width: 380px;
  pointer-events: auto;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.2s ease;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

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

/* Dragging / Sortable helper */
.sortable-ghost {
  opacity: 0.3;
  background: #334155 !important;
  border: 2px dashed #6366f1 !important;
}

.drag-handle {
  cursor: grab;
  color: #64748b;
  padding: 4px;
}
.drag-handle:active {
  cursor: grabbing;
}

/* ==========================================================================
   Toplu Fatura (Batch Staging) ve Paket Miktarı Stilleri
   ========================================================================== */
.modal-container.modal-lg {
  max-width: 860px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-info { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-package {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.staging-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.staging-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  padding: 12px;
  display: grid;
  grid-template-columns: 80px 1fr 140px;
  gap: 14px;
  align-items: center;
  transition: all var(--transition-fast);
}
.staging-card:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: #475569;
}

.staging-card-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.staging-thumb {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid #475569;
  cursor: pointer;
}
.staging-thumb-placeholder {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  border-radius: var(--radius-sm);
  border: 1px dashed #475569;
  font-size: 24px;
}

.staging-card-index {
  font-size: 11px;
  font-weight: 700;
  color: #818cf8;
}

.staging-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.staging-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.staging-input-name {
  flex: 1;
  background: #0f172a;
  border: 1px solid #334155;
  color: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 700;
}
.staging-input-name:focus {
  border-color: #6366f1;
  outline: none;
}

.staging-textarea-addr {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.78rem;
  resize: vertical;
  min-height: 44px;
}
.staging-textarea-addr:focus {
  border-color: #6366f1;
  color: #fff;
  outline: none;
}

.staging-card-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pkg-stepper {
  display: flex;
  align-items: center;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  overflow: hidden;
}

.btn-pkg-step {
  background: #1e293b;
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
}
.btn-pkg-step:hover {
  background: #334155;
}

.staging-pkg-val {
  width: 44px;
  background: transparent;
  border: none;
  color: #fbbf24;
  font-weight: 800;
  text-align: center;
  font-size: 15px;
}

.btn-staging-del {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.btn-staging-del:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}

.badge-geo-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-geo-loading {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-geo-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Autocomplete Suggestion Dropdown */
.cust-suggest-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  margin-top: 4px;
}
.cust-suggest-item {
  padding: 8px 12px;
  border-bottom: 1px solid #334155;
  cursor: pointer;
  transition: background 0.15s;
}
.cust-suggest-item:last-child {
  border-bottom: none;
}
.cust-suggest-item:hover {
  background: #334155;
}

@media (max-width: 768px) {
  .staging-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .staging-card-left {
    flex-direction: row;
    justify-content: center;
  }
  .staging-card-right {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
}

/* ==========================================================================
   Canlı Filo & Şoför Takip Komuta Merkezi (Live Fleet Command Center)
   ========================================================================== */
.fleet-command-section {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 5px 10px;
  margin-bottom: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: all var(--transition-normal);
}

.fleet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  flex-wrap: wrap;
  gap: 6px;
}

.fleet-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.2px;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 5px;
}

.fleet-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulseDot 1.8s infinite;
  display: inline-block;
}

@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 4px #38bdf8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #38bdf8, 0 0 20px #0284c7; }
  100% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 4px #38bdf8; }
}

.fleet-scroll-container {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
  scrollbar-color: #38bdf8 rgba(15, 23, 42, 0.6);
}

.fleet-scroll-container::-webkit-scrollbar {
  height: 4px;
}
.fleet-scroll-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 2px;
}
.fleet-scroll-container::-webkit-scrollbar-thumb {
  background: #38bdf8;
  border-radius: 2px;
}

/* Şoför Filo Kartı */
.fleet-card {
  min-width: 205px;
  max-width: 245px;
  background: rgba(30, 41, 59, 0.8);
  border: 1.5px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  padding: 5px 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  flex-shrink: 0;
  user-select: none;
}

.fleet-card:hover {
  transform: translateY(-1px);
  border-color: #38bdf8;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
  background: rgba(30, 41, 59, 0.98);
}

.fleet-card.active {
  border-color: #38bdf8;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.3) 0%, rgba(30, 41, 59, 0.95) 100%);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35), inset 0 0 8px rgba(56, 189, 248, 0.15);
}

.fleet-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.fleet-driver-name {
  font-weight: 700;
  font-size: 0.82rem;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 5px;
}

.fleet-plate-badge {
  font-size: 9px;
  font-weight: 700;
  font-family: monospace;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #475569;
  color: #38bdf8;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.fleet-stat-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: #cbd5e1;
  flex-wrap: wrap;
}

.fleet-chip {
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.fleet-chip-pending {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.fleet-chip-delivered {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.fleet-chip-pct {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-left: auto;
}

/* Sıradaki Teslimat Kutusu */
.fleet-next-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.fleet-next-title {
  font-weight: 800;
  font-size: 8.5px;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.fleet-next-target {
  font-weight: 700;
  color: #f1f5f9;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fleet-next-sub {
  font-size: 9px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Durak Kartı Üzerindeki Sıradaki Durak Rozeti */
.badge-next-stop {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  font-weight: 800;
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 20px;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
  animation: pulseGlow 2s infinite ease-in-out;
  letter-spacing: 0.3px;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 6px rgba(56, 189, 248, 0.4); transform: scale(1); }
  50% { box-shadow: 0 0 16px rgba(56, 189, 248, 0.8), 0 0 24px rgba(2, 132, 199, 0.5); transform: scale(1.02); }
  100% { box-shadow: 0 0 6px rgba(56, 189, 248, 0.4); transform: scale(1); }
}

.driver-assigned-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 7px;
  border-radius: 6px;
}

/* ==========================================================================
   Şoför Harita Renk Lejantı (Renk Rehberi & Hızlı Filtre)
   ========================================================================== */
.map-driver-legend {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  max-width: calc(100% - 170px);
  animation: fadeIn 0.25s ease-out;
}

.legend-header {
  margin-bottom: 6px;
}

.legend-title {
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.3px;
}

.legend-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s ease;
  user-select: none;
}

.legend-chip:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.legend-chip.selected {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-name {
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
}

.legend-count {
  font-size: 10px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  color: #cbd5e1;
}

.fleet-driver-color-dot {
  transition: transform 0.2s ease;
}

.fleet-card:hover .fleet-driver-color-dot {
  transform: scale(1.2);
}

/* ==========================================================================
   Müşteri Hafızası & Rehber Tablosu Tasarımı (Customer Directory Modal)
   ========================================================================== */
.cust-dir-table th {
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.cust-dir-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

.cust-dir-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

.cust-dir-table td {
  padding: 8px 14px;
  vertical-align: middle;
}

.cust-driver-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  white-space: nowrap;
}

.cust-gps-badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.cust-gps-badge-none {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.cust-dir-filter-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cust-dir-filter-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #f8fafc;
}

.cust-dir-filter-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}


