/* Compact, identical styling for every header utility icon; module navigation is untouched. */
.client-name-link {
  color: inherit !important;
  font-weight: normal !important;
  text-decoration: none !important;
  text-transform: none !important;
}
.client-name-link:hover,
.client-name-link:focus {
  color: inherit !important;
  font-weight: normal !important;
  text-decoration: none !important;
}
.client-balance-zero {
  color: #495057;
}

.header-right > .notifications {
  display: inline-flex !important;
  align-items: center;
  gap: 2px;
  margin: 0 3px 0 0 !important;
  padding: 0;
  vertical-align: middle;
  white-space: nowrap;
}
.header-right > .notifications > li {
  display: flex;
  align-items: center;
  float: none !important;
  margin: 0 !important;
  padding: 0;
}
.header-right > .notifications > li .notification-icon {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 28px !important;
  min-width: 28px;
  height: 30px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid transparent !important;
  border-radius: 5px !important;
  background: transparent !important;
  color: #647180 !important;
  line-height: 1 !important;
  text-decoration: none;
  vertical-align: middle;
  box-shadow: none !important;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.header-right > .notifications > li .notification-icon i {
  display: block;
  margin: 0 !important;
  color: currentColor !important;
  font-size: 15px;
  line-height: 1 !important;
}
.header-right > .notifications > li .notification-icon:hover,
.header-right > .notifications > li .notification-icon:focus-visible {
  background: #eef5fb !important;
  border-color: #d5e6f5 !important;
  color: #1976b9 !important;
  outline: none;
}
/* Keep the dark navigation outline visible without adding width to every menu item. */
html.dark .header.header-nav-menu .header-nav-main nav > ul > li > a {
  border: 0 !important;
  box-shadow: inset 0 0 0 1px #2f373d !important;
}

html.dark .header-right > .notifications > li .notification-icon,
html.header-dark .header-right > .notifications > li .notification-icon {
  background: transparent !important;
  border-color: transparent !important;
  color: #cbd2da !important;
}
html.dark .header-right > .notifications > li .notification-icon:hover,
html.dark .header-right > .notifications > li .notification-icon:focus-visible,
html.header-dark .header-right > .notifications > li .notification-icon:hover,
html.header-dark .header-right > .notifications > li .notification-icon:focus-visible {
  background: #36424e !important;
  border-color: #506273 !important;
  color: #9bd3ff !important;
}

/* Keep all four utility controls visually identical, including the dark-mode button. */
.header-right > .notifications > li > #darkModeToggle,
.header-right > .notifications > li > #search,
.header-right > .notifications > li > #task,
.header-right > .notifications > li > #bell {
  background-color: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 5px !important;
}
html.dark .header-right > .notifications > li > #darkModeToggle,
html.dark .header-right > .notifications > li > #search,
html.dark .header-right > .notifications > li > #task,
html.dark .header-right > .notifications > li > #bell,
html.header-dark .header-right > .notifications > li > #darkModeToggle,
html.header-dark .header-right > .notifications > li > #search,
html.header-dark .header-right > .notifications > li > #task,
html.header-dark .header-right > .notifications > li > #bell {
  background-color: transparent !important;
  border-color: transparent !important;
}
@media only screen and (max-width: 767px) {
  .header-right > .notifications {
    margin: 8px 8px 0 0 !important;
  }
}

/* Bare icon appearance: match the edge controls, with a background only on hover. */
.header-right > .notifications > li > #darkModeToggle,
.header-right > .notifications > li > #search,
.header-right > .notifications > li > #task,
.header-right > .notifications > li > #bell {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.header-right > .notifications > li > #darkModeToggle:hover,
.header-right > .notifications > li > #search:hover,
.header-right > .notifications > li > #task:hover,
.header-right > .notifications > li > #bell:hover,
.header-right > .notifications > li > #darkModeToggle:focus-visible,
.header-right > .notifications > li > #search:focus-visible,
.header-right > .notifications > li > #task:focus-visible,
.header-right > .notifications > li > #bell:focus-visible {
  background: #eef5fb !important;
  border-color: #d5e6f5 !important;
}
html.dark .header-right > .notifications > li > #darkModeToggle:hover,
html.dark .header-right > .notifications > li > #search:hover,
html.dark .header-right > .notifications > li > #task:hover,
html.dark .header-right > .notifications > li > #bell:hover,
html.dark .header-right > .notifications > li > #darkModeToggle:focus-visible,
html.dark .header-right > .notifications > li > #search:focus-visible,
html.dark .header-right > .notifications > li > #task:focus-visible,
html.dark .header-right > .notifications > li > #bell:focus-visible {
  background: #36424e !important;
  border-color: #506273 !important;
}
/* Customer list balance summary button and list totals modal. */
.client-list-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}
.client-list-actions > .btn {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
  white-space: nowrap;
}
.client-totals-dialog {
  max-width: 640px;
}
.client-totals-modal .modal-body {
  padding: 22px 30px;
}
.client-total-row {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.client-total-row:last-child {
  margin-bottom: 0;
}
.client-total-label {
  text-align: right;
  font-weight: 600;
  line-height: 1.45;
}
.client-total-value {
  min-height: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 3px;
  padding: 9px 16px;
  border: 1px solid #c7cbd0;
  border-radius: 4px;
  background: #e9ecef;
  font-size: 18px;
  font-weight: 700;
  text-align: right;
}
.client-total-debt { color: #f0443e; }
.client-total-credit { color: #218838; }
.client-total-line { display: block; }
.client-totals-modal .modal-footer {
  background: #f6f7f8;
}
@media (max-width: 767px) {
  .client-list-actions { flex-wrap: wrap; }
  .client-list-actions > .btn { flex: 1 1 100%; }
  .client-totals-modal .modal-body { padding: 18px 16px; }
  .client-total-row {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 18px;
  }
  .client-total-label { text-align: left; }
  .client-total-value { font-size: 16px; }
}

/* Mobile/tablet fixes, 04.11.2026 */
@media (max-width: 1199px) {
  #userbox .dropdown-menu { box-sizing: border-box; width: 100%; min-width: 100%; max-width: 100%; left: 0; right: auto; }
  .client-list-actions { flex-wrap: wrap; }
  .client-list-actions > .btn { flex: 1 1 auto; min-width: max-content; white-space: nowrap; }
  html.dark .header.header-nav-menu .header-nav-main nav > ul > li > a { box-shadow: none !important; }
  html.dark .header.header-nav-menu .header-nav-main nav > ul > li { border-color: #35383d !important; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  .client-list-actions > .btn { font-size: 12px; padding: 8px 6px; }
  .client-list-actions { gap: 5px; }
}
@media (max-width: 767px) {
  .client-list-actions > .btn { flex: 1 1 100%; }
}

/* Teklif detay ve ürün grubu modalı mobil taşma düzeltmeleri */
.hesaplus-offer-products-scroll { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hesaplus-offer-products-scroll > table { width: 100%; min-width: 650px; margin-bottom: 0; }
#list #grup_ekle_urun, #list .select2-container { width: 100% !important; max-width: 100%; }
#list .select2-container .select2-selection { box-sizing: border-box; }
#list .select2-dropdown { max-width: 100%; box-sizing: border-box; }
#list .modal-body { min-width: 0; }
@media (max-width: 767px) {
  #list .modal-dialog { width: auto; max-width: calc(100% - 24px); margin: 12px auto; }
  #list .modal-content, #list .modal-body, #list .modal-footer { min-width: 0; }
  #list .select2-container .select2-selection__rendered { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* 05.11.2026: Satış detayındaki salt okunur alanlar mobil/tablette
   alt alta dizilirken her input grubu arasında yeterli boşluk bırak. */
@media (max-width: 991.98px) {
  .hp-sale-detail-fields > .form-group.row {
    margin-bottom: 0 !important;
  }
  .hp-sale-detail-fields > .form-group.row > [class*="col-"] {
    margin-bottom: 18px !important;
  }
  .hp-sale-detail-fields > .form-group.row > [class*="col-"] > label {
    display: block;
    line-height: 1.4;
    margin-bottom: 8px !important;
  }
}

/* 05.11.2026: Masaüstünde bildirim menüsü doğrudan zil ikonuna
   bağlansın; Popper'ın inline translate konumu sola kaydırmasın. */
@media (min-width: 768px) {
  .header-right > .notifications > li > #bell + .notification-menu {
    position: absolute !important;
    top: 100% !important;
    right: -6px !important;
    left: auto !important;
    transform: none !important;
    will-change: auto !important;
  }
  .header-right > .notifications > li > #bell + .notification-menu::before {
    right: 17px;
  }
}


/* 05.11.2026: Mobil üst menü kullanıcı kutusunda profil resmi taşmasın */
@media (max-width: 767px) {
  #userbox {
    max-width: calc(100vw - 96px);
    margin-right: 8px;
  }
  #userbox > a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 50px;
    max-width: 100%;
  }
  #userbox .profile-picture {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    overflow: hidden;
    border-radius: 50%;
  }
  #userbox .profile-picture img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    border-radius: 50%;
  }
  #userbox .profile-info {
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
  }
  #userbox .name,
  #userbox .role {
    max-width: 100%;
  }
  #userbox .custom-caret {
    margin-left: 2px;
    flex: 0 0 auto;
  }
}

/* 05.11.2026 — Bootstrap Datepicker: tarih aralığı takvimi filtrelerin ve
   Select2 kutularının altında kalmasın (tüm modüllerde ortak çözüm). */
.datepicker.datepicker-dropdown {
  z-index: 1100 !important;
}
@media (max-width: 767px) {
  .datepicker.datepicker-dropdown {
    max-width: calc(100vw - 16px);
    box-sizing: border-box;
  }
}
