/* Bilgin Teknik - Mobil Öncelikli Özel CSS */
:root {
  --bt-primary: #1e3a8a;       /* Koyu Lacivert */
  --bt-primary-dark: #0f172a;  /* Gece Mavisi / Slate 900 */
  --bt-accent: #2563eb;        /* Canlı Mavi */
  --bt-accent-light: #60a5fa;  /* Açık Mavi */
  --bt-bg: #f8fafc;            /* Açık Gri / Arka Plan */
  --bt-card-bg: #ffffff;
  --bt-text: #1e293b;
  --bt-text-muted: #64748b;
  --bt-border: #e2e8f0;
  --bt-success: #10b981;
  --bt-warning: #f59e0b;
  --bt-danger: #ef4444;
  --bt-nav-height: 64px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bt-bg);
  color: var(--bt-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sayfa Gövdesi - Mobil Alt Menü Payı */
body.has-bottom-nav {
  padding-bottom: calc(var(--bt-nav-height) + 16px);
}

/* Üst Başlık (Top Navbar) */
.bt-navbar {
  background: linear-gradient(135deg, var(--bt-primary-dark) 0%, var(--bt-primary) 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.15);
  position: sticky;
  top: 0;
  z-index: 1030;
  padding: 0.75rem 1rem;
}

.bt-navbar .navbar-brand {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bt-navbar .navbar-brand .logo-icon {
  width: 32px;
  height: 32px;
  background: #ffffff;
  color: var(--bt-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.bt-navbar .nav-btn {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s ease;
  text-decoration: none;
}

.bt-navbar .nav-btn:hover,
.bt-navbar .nav-btn:active {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Bildirim Rozeti */
.badge-notification {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.65rem;
  padding: 0.25em 0.5em;
  border-radius: 10px;
  background-color: var(--bt-danger);
  border: 2px solid var(--bt-primary-dark);
}

/* Mobil Alt Navigasyon (Bottom Navigation Bar) */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bt-nav-height);
  background: #ffffff;
  border-top: 1px solid var(--bt-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1040;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--bt-text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 6px 0;
  transition: all 0.2s ease;
  position: relative;
}

.mobile-bottom-nav .nav-item i {
  font-size: 1.35rem;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.mobile-bottom-nav .nav-item.active {
  color: var(--bt-accent);
  font-weight: 700;
}

.mobile-bottom-nav .nav-item.active i {
  transform: translateY(-2px);
  color: var(--bt-accent);
}

.mobile-bottom-nav .nav-item .badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 18px);
  font-size: 0.65rem;
  padding: 0.2em 0.45em;
}

/* Kartlar ve Görsel Bileşenler */
.card-custom {
  background: var(--bt-card-bg);
  border: 1px solid var(--bt-border);
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
  overflow: hidden;
  margin-bottom: 1rem;
}

.card-custom:active, .card-custom:hover {
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.card-custom .card-header-clean {
  padding: 1rem;
  border-bottom: 1px solid var(--bt-border);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-custom .card-body-clean {
  padding: 1rem;
}

/* İstatistik Kartları */
.stat-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--bt-border);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-card .stat-title {
  font-size: 0.8rem;
  color: var(--bt-text-muted);
  font-weight: 500;
  margin-bottom: 2px;
}

.stat-card .stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--bt-text);
  line-height: 1.2;
}

/* İş Kartları (Mobil Dostu) */
.job-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--bt-border);
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  text-decoration: none;
  color: inherit;
  display: block;
}

.job-card:active {
  transform: scale(0.99);
}

.job-card.border-urgent {
  border-left: 4px solid var(--bt-danger);
}

.job-card.border-high {
  border-left: 4px solid #f97316;
}

.job-card.border-normal {
  border-left: 4px solid var(--bt-accent);
}

.job-card.border-low {
  border-left: 4px solid var(--bt-text-muted);
}

.job-card .job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.job-card .job-code {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bt-accent);
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
}

.job-card .job-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bt-text);
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.job-card .job-customer {
  font-size: 0.85rem;
  color: var(--bt-text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.job-card .job-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--bt-border);
  font-size: 0.8rem;
}

/* Büyük Dokunmatik Butonlar */
.btn-touch {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  border-radius: 12px;
  font-size: 0.95rem;
  padding: 0.65rem 1.25rem;
  transition: all 0.15s ease;
}

.btn-touch:active {
  transform: scale(0.98);
}

.btn-primary-custom {
  background-color: var(--bt-accent);
  border-color: var(--bt-accent);
  color: #ffffff;
}

.btn-primary-custom:hover, .btn-primary-custom:active {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.btn-call {
  background-color: #10b981;
  color: #ffffff;
  border: none;
}

.btn-call:hover, .btn-call:active {
  background-color: #059669;
  color: #ffffff;
}

.btn-map {
  background-color: #0284c7;
  color: #ffffff;
  border: none;
}

.btn-map:hover, .btn-map:active {
  background-color: #0369a1;
  color: #ffffff;
}

/* Öncelik Rozetleri */
.badge-priority-low {
  background-color: #e2e8f0;
  color: #475569;
}

.badge-priority-normal {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-priority-high {
  background-color: #ffedd5;
  color: #c2410c;
}

.badge-priority-urgent {
  background-color: #fee2e2;
  color: #b91c1c;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Fotoğraf Galerisi ve Önizleme */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid var(--bt-border);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-thumb .badge-type {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 0.6rem;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  padding: 2px 4px;
  border-radius: 4px;
}

/* Zaman Tüneli (Timeline) */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 7px;
  width: 2px;
  background: var(--bt-border);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bt-accent);
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.timeline-content {
  background: #ffffff;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--bt-border);
}

.timeline-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--bt-text-muted);
}

/* Çevrimdışı Uyarı Çubuğu */
.offline-banner {
  display: none;
  background-color: #ef4444;
  color: #ffffff;
  text-align: center;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.offline-banner.active {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Masaüstü Ekran İyileştirmesi */
@media (min-width: 992px) {
  body.has-bottom-nav {
    padding-bottom: 2rem;
  }
  
  .mobile-bottom-nav {
    display: none;
  }
  
  .desktop-sidebar {
    display: block;
  }
}

@media (max-width: 991.98px) {
  .desktop-sidebar {
    display: none;
  }
}
