/* ============================================
   SaleCRM Custom Theme - Primary Color #1e40af
   ============================================ */

:root {
  --bs-primary: #1e40af !important;
  --bs-primary-rgb: 30, 64, 175 !important;
  --bs-link-color: #1e40af !important;
  --bs-link-hover-color: #1e3a8a !important;
}

/* Primary overrides */
.bg-primary, .btn-primary, .bg-gradient-primary,
.text-primary, .border-primary, .link-primary,
.btn-outline-primary, .badge.bg-primary,
.alert-primary, .list-group-item-primary,
.table-primary, .progress-bar.bg-primary,
.pagination .page-item.active .page-link,
.nav-pills .nav-link.active,
.sidenav[data-color="primary"] .nav-link.active,
.text-gradient.text-primary {
  --bs-btn-bg: #1e40af !important;
  --bs-btn-border-color: #1e40af !important;
  --bs-btn-color: #fff !important;
}

.bg-primary { background-color: #1e40af !important; }
.bg-gradient-primary { background-image: linear-gradient(310deg, #1e40af 0%, #3b82f6 100%) !important; }
.btn-primary {
  background-color: #1e40af !important;
  border-color: #1e40af !important;
}
.btn-primary:hover {
  background-color: #1e3a8a !important;
  border-color: #1e3a8a !important;
}
.btn-outline-primary {
  color: #1e40af !important;
  border-color: #1e40af !important;
}
.btn-outline-primary:hover {
  background-color: #1e40af !important;
  color: #fff !important;
}
.text-primary { color: #1e40af !important; }
.border-primary { border-color: #1e40af !important; }
.link-primary { color: #1e40af !important; }
.link-primary:hover { color: #1e3a8a !important; }

/* Sidebar - navbar ile menu arasında boşluk yok */
#sidenav-main {
  left: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.g-sidenav-show .sidenav.fixed-start + .main-content {
  margin-left: 250px !important; /* 250px sidebar, boşluksuz */
}
/* Mobilde sidebar gizliyken main-content boşluk bırakmasın */
@media (max-width: 1199.98px) {
  .g-sidenav-show .sidenav.fixed-start + .main-content {
    margin-left: 0 !important;
  }
}

/* Sidebar active state - match primary (#1e40af) */
#sidenav-main .nav-link.active {
  background-color: #EFF6FF !important;
  border-left: 3px solid #1e40af !important;
  color: #1e40af !important;
}
#sidenav-main .nav-link.active .nav-link-text,
#sidenav-main .nav-link.active i {
  color: #1e40af !important;
}

/* btn-warning butonları primary mavi yap (tüm menü sayfalarında) */
.btn-warning,
.btn.btn-warning,
button.btn-warning,
a.btn-warning {
  background-color: #1e40af !important;
  border-color: #1e40af !important;
  color: #fff !important;
}
.btn-warning:hover,
.btn.btn-warning:hover,
button.btn-warning:hover,
a.btn-warning:hover {
  background-color: #1e3a8a !important;
  border-color: #1e3a8a !important;
  color: #fff !important;
}
.btn-outline-warning {
  color: #1e40af !important;
  border-color: #1e40af !important;
}
.btn-outline-warning:hover {
  background-color: #1e40af !important;
  color: #fff !important;
  border-color: #1e40af !important;
}

/* ============================================
   SmartHR-style Data Tables (tıpkı sayfadaki gibi)
   https://smarthr.co.in/demo/html/template/data-tables
   Bordered tablo, beyaz arka plan, net kenarlıklar
   ============================================ */

/* Tablo container - SmartHR kart - sayfa küçülünce yatay scroll */
.smarthr-dashboard .card .table-responsive,
.smarthr-dashboard .table-responsive,
.table-responsive {
  border-radius: 8px;
  overflow-x: auto !important;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #E9EDF4;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  display: block !important;
}

/* DataTables sayfalarında: sadece tablo scroll olsun, üst (ara/length) ve alt (info/paginate) sabit kalsın */
.table-responsive:has(.dataTables_wrapper),
.smarthr-dashboard .table-responsive:has(.dataTables_wrapper) {
  overflow-x: visible !important;
}

/* Tablo min-width - sağ sütunların görünmesi için yatay scroll zorunlu */
.table-responsive table,
.table-responsive table.dataTable,
.smarthr-dashboard .table-responsive table,
.smarthr-dashboard .table-responsive table.dataTable,
table.dataTable {
  min-width: 1000px !important;
}

/* DataTables scrollX - sadece tablo alanı yatay kayar, ara butonları ve numaratör sabit */
.dataTables_wrapper .dataTables_scroll,
.dataTables_wrapper .dataTables_scrollBody {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* Tüm tablolar - SmartHR bordered stili */
.smarthr-dashboard .table,
.smarthr-dashboard table.dataTable,
.smarthr-dashboard .table.table-striped,
.smarthr-dashboard .table.table-hover {
  margin-bottom: 0 !important;
  border-collapse: collapse;
  background: #fff !important;
  width: 100% !important;
}

/* Hücre kenarlıkları - SmartHR gibi tüm hücrelerde border */
.smarthr-dashboard .table thead th,
.smarthr-dashboard .table tbody td,
.smarthr-dashboard .table tbody th,
.smarthr-dashboard table.dataTable thead th,
.smarthr-dashboard table.dataTable tbody td,
.smarthr-dashboard table.dataTable tbody th {
  border: 1px solid #E9EDF4 !important;
  padding: 12px 14px !important;
  vertical-align: middle !important;
}

/* Tablo başlıkları - SmartHR stili (açık gri arka plan) */
.smarthr-dashboard .table thead th,
.smarthr-dashboard table.dataTable thead th {
  background: #F4F6FA !important;
  color: #202C4B !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

/* Tablo gövde - tüm satırlar aynı açık renk */
.smarthr-dashboard .table tbody td,
.smarthr-dashboard table.dataTable tbody td {
  background: #fff !important;
  color: #6B7280 !important;
  font-size: 13px !important;
}

/* Zebra striping kaldırıldı - hepsi aynı renk */
.smarthr-dashboard .table-striped tbody tr:nth-of-type(odd) td,
.smarthr-dashboard .table-striped tbody tr:nth-of-type(even) td,
.smarthr-dashboard .table-striped > tbody > tr > *,
.smarthr-dashboard table.dataTable.stripe tbody tr.odd td,
.smarthr-dashboard table.dataTable.stripe tbody tr.even td,
.smarthr-dashboard table.dataTable.display tbody tr.odd td,
.smarthr-dashboard table.dataTable.display tbody tr.even td {
  background: #fff !important;
}

/* Sadece hover'da renk değişimi */
.smarthr-dashboard .table tbody tr:hover td,
.smarthr-dashboard table.dataTable tbody tr:hover td,
.smarthr-dashboard .table-striped tbody tr:hover td,
.smarthr-dashboard table.dataTable.hover tbody tr:hover td,
.smarthr-dashboard table.dataTable.display tbody tr:hover td {
  background: #F8FAFC !important;
}

/* DataTables wrapper genel */
.smarthr-dashboard .dataTables_wrapper {
  font-size: 13px;
}

/* Sayfa başına X kayıt / Ara... - sabit kalır, scroll olmaz, padding */
.smarthr-dashboard .dataTables_wrapper .dataTables_length,
.smarthr-dashboard .dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 15px;
  padding: 6px 16px 6px 0 !important;
  margin-left: 0;
  margin-right: 0;
}

/* DataTables length select - dar, kompakt */
.smarthr-dashboard .dataTables_wrapper .dataTables_length select {
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  padding: 6px 24px 6px 8px;
  font-size: 13px;
  color: #374151;
  max-width: 75px !important;
  width: auto !important;
}

.smarthr-dashboard .dataTables_wrapper .dataTables_length select:focus {
  border-color: #1e40af !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.15) !important;
}

/* DataTables arama kutusu - focus turuncu değil mavi */
.smarthr-dashboard .dataTables_wrapper .dataTables_filter input,
.smarthr-dashboard .table-responsive input[type="search"],
.smarthr-dashboard input#tableSearch {
  border: 1px solid #E5E7EB !important;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
}

.smarthr-dashboard .dataTables_wrapper .dataTables_filter input:focus,
.smarthr-dashboard .table-responsive input[type="search"]:focus,
.smarthr-dashboard input#tableSearch:focus {
  border-color: #1e40af !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.15) !important;
}

/* Tablo sayfalarındaki tüm input/select focus - turuncu yerine primary mavi */
.smarthr-dashboard .form-control:focus,
.smarthr-dashboard .form-select:focus,
.smarthr-dashboard input:focus,
.smarthr-dashboard select:focus {
  border-color: #1e40af !important;
  box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.15) !important;
}

/* ========== PAGINATION - Primary mavi (#1e40af) + padding ========== */
.smarthr-dashboard .dataTables_wrapper .dataTables_paginate,
.dataTables_wrapper .dataTables_paginate {
  padding: 12px 16px 12px 0 !important;
}

.smarthr-dashboard .dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 6px !important;
  margin: 0 2px !important;
  padding: 6px 12px !important;
  border: 1px solid #E5E7EB !important;
  background: #fff !important;
  color: #374151 !important;
  transition: all 0.2s ease !important;
}

.smarthr-dashboard .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #EEF2FF !important;
  border-color: #93C5FD !important;
  color: #1e40af !important;
}

/* Aktif sayfa - primary mavi */
.smarthr-dashboard .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.smarthr-dashboard .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: #1e40af !important;
  border-color: #1e40af !important;
  color: #fff !important;
}

.smarthr-dashboard .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.smarthr-dashboard .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  background: #F9FAFB !important;
  border-color: #E5E7EB !important;
  color: #9CA3AF !important;
  cursor: not-allowed !important;
}

/* DataTables info metni (30 kayıttan 1 - 10 arası gösteriliyor) + padding */
.smarthr-dashboard .dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_info {
  color: #9CA3AF !important;
  font-size: 12px !important;
  padding: 12px 16px 12px 16px !important;
}

/* Bootstrap pagination (sayfa numaraları) - primary */
.smarthr-dashboard .pagination .page-item.active .page-link {
  background-color: #1e40af !important;
  border-color: #1e40af !important;
  color: #fff !important;
}

.smarthr-dashboard .pagination .page-link {
  color: #1e40af;
}

.smarthr-dashboard .pagination .page-link:hover {
  background-color: #EEF2FF !important;
  color: #1e40af !important;
  border-color: #93C5FD !important;
}

/* Global DataTables zebra override - tüm sayfalar için */
table.dataTable.stripe tbody tr.odd td,
table.dataTable.stripe tbody tr.even td,
table.dataTable.display tbody tr.odd td,
table.dataTable.display tbody tr.even td {
  background: #fff !important;
}
table.dataTable tbody tr:hover td {
  background: #F8FAFC !important;
}

/* Panel başlıkları - Satış Fırsatları Listesi ile aynı stil (Potansiyel Müşteriler, Müşteri Paneli, Teklifler, Ürün Yönetimi) */
.panel-title {
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #495057 !important;
  margin: 0 !important;
}

/* Tablo satırları height 0 olduğunda tamamen gizle - padding/border görünmesin */
/* NOT: tr.child hariç - DataTables Responsive açılan detay satırları gizlenmesin */
html body table tbody tr[style*="height: 0px"],
html body table tbody tr[style*="height:0px"],
html body table tbody tr[style*="height: 0"],
html body table tbody tr[style*="height:0"],
html body table.dataTable tbody tr[style*="height: 0px"],
html body table.dataTable tbody tr[style*="height:0px"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

