/* Clients Page Styles */

/* Отключение глобального скролла на странице клиентов */
body.clients-index {
  overflow: hidden !important;
  height: 100vh !important;
  position: fixed !important;
  width: 100% !important;
}

/* Фиксированная высота навбара для расчетов */
.navbar {
  height: 56px !important; /* Фиксированная высота */
}

/* Content Wrapper */
.content-wrapper {
  background-color: var(--bg-white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 110px); /* 56px навбар + отступы сверху и снизу */
  max-height: calc(100vh - 110px);
  margin: 10px 10px 15px 10px;
  padding: 10px 15px;
  overflow: hidden;
}

.content-wrapper h5 {
  margin: 5px 0 15px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #4a5568;
  letter-spacing: 0.01em;
  position: relative;
  display: inline-block;
}

.content-wrapper h5:after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background-color: #4a90e2;
  border-radius: 2px;
}

/* Оптимизация для DataTables */
.dataTables_wrapper {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important; /* Важно для корректной работы flex-scroll */
}

/* Стили для контейнера таблицы клиентов */
#clients-table_wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 15px;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: var(--border-radius-md, 8px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
  background-color: white;
  min-height: 0; /* Важно для корректной работы flex-scroll */
  overflow: hidden; /* Предотвращаем выход контента за границы */
}

/* Верхняя панель с кнопками и поиском */
#clients-table_wrapper .dt-layout-row:first-child {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  flex-shrink: 0; /* Запрещаем сжатие */
}

/* Контейнер прокрутки таблицы */
#clients-table_wrapper .dt-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
  max-height: calc(100vh - 300px); /* Базовое значение */
}

#clients-table_wrapper thead {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
}

#clients-table thead th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #4a5568;
  border-bottom: 2px solid #e2e8f0;
  padding: 10px 8px;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
}

/* Тело таблицы */
#clients-table_wrapper .dt-scroll-body {
  overflow: unset !important;
  min-width: 100%;
}

/* Отключаем фиксированную высоту скролла */
.dt-scroll-body {
  max-height: none !important;
}

/* Стили для контейнера таблицы */
.table-responsive {
  width: 100%;
  margin-bottom: 0;
  overflow: unset;
}

/* Сама таблица */
#clients-table {
  width: 100% !important;
  margin: 0 !important;
  table-layout: fixed;
}

/* Нижняя панель с пагинацией и информацией */
#clients-table_wrapper .dt-layout-row:last-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  margin-top: 0.5rem !important;
  border-top: 1px solid var(--border-color-light, #f0f0f0);
  flex-shrink: 0;
  background: white;
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  gap: 1rem;
}

/* Стили для поиска */
.dt-search {
  margin-left: auto !important;
  flex-shrink: 0; /* Запрещаем сжатие */
}

/* Стили для кнопок */
.dt-buttons {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0; /* Запрещаем сжатие */
}

/* Адаптивность */
@media (max-width: 768px) {
  #clients-table_wrapper .dt-layout-row:first-child {
    flex-direction: column;
    align-items: stretch;
  }

  .dt-search {
    margin-left: 0 !important;
    width: 100%;
  }

  .dt-buttons {
    width: 100%;
    justify-content: space-between;
  }
}

/* Компактные стили для таблицы */
#clients-table th,
#clients-table td {
  padding: 5px 8px;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis; /* Добавляем многоточие при переполнении */
}


#clients-table tbody tr {
  border-bottom: 1px solid #f0f2f5;
  transition: all 0.2s ease;
}

#clients-table tbody tr:hover {
  background-color: rgba(74, 144, 226, 0.05);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Компактные стили для панели инструментов */
.dt-layout-cell {
  padding: 3px 0 !important;
}

.dt-buttons .btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dt-buttons .btn-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* Сокращаем высоту верхних панелей инструментов */
.dt-layout {
  padding: 0 !important;
}

.dt-info, .dt-paging {
  margin-top: 10px !important; /* Уменьшаем отступ */
  font-size: 0.8rem !important;
  padding: 3px 0 !important;
}

/* Оптимизация для маленьких экранов */
@media (max-width: 768px) {
  .content-wrapper {
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
    margin: 5px;
    padding: 5px 10px;
  }
  
  .dt-scroll-body {
    height: calc(100vh - 25vh) !important; /* 75% высоты экрана для мобильных */
    min-height: 100px !important;
  }
  
  .content-wrapper h5 {
    margin: 3px 0 8px 0;
    font-size: 1rem;
    height: 20px;
  }
  
  .dt-layout-row:first-child,
  .dt-layout-row:last-child {
    height: 35px;
  }
  
  .dt-buttons .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* Page Header */
.clients-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.clients-title {
  font-size: var(--font-xl);
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 0;
}

.clients-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

/* Table Container */
.clients-table-container {
  overflow-x: auto;
  margin-bottom: var(--spacing-lg);
}

/* Client Info */
.client-info-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.client-info-card {
  background-color: var(--bg-white);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-md);
  border: 1px solid var(--border-color);
  transition: box-shadow var(--transition-fast);
}

.client-info-card:hover {
  box-shadow: var(--shadow-md);
}

.client-info-title {
  font-size: var(--font-md);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--dark-color);
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--border-color);
}

.client-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.client-info-item {
  padding: var(--spacing-xs) 0;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border-color);
}

.client-info-label {
  font-weight: 600;
  color: var(--dark-color);
}

.client-info-value {
  color: var(--secondary-color);
}

/* Client Filter Sidebar */
.filter-sidebar {
  background-color: var(--bg-white);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-md);
  border: 1px solid var(--border-color);
  height: 100%;
}

.filter-sidebar-title {
  font-size: var(--font-md);
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  color: var(--dark-color);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.filter-section {
  margin-bottom: var(--spacing-md);
}

.filter-section-title {
  font-size: var(--font-sm);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--dark-color);
}

.filter-controls {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  background-color: var(--primary-light);
  color: var(--primary-color);
  border-radius: var(--border-radius-md);
  padding: calc(var(--spacing-xs) / 2) var(--spacing-sm);
  font-size: var(--font-xs);
  margin-right: var(--spacing-xs);
  margin-bottom: var(--spacing-xs);
}

.filter-badge i {
  cursor: pointer;
}

.filter-actions {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: calc(var(--spacing-xs) / 2) var(--spacing-sm);
  border-radius: var(--border-radius-md);
  font-size: var(--font-xs);
  font-weight: 600;
  text-align: center;
}

.status-badge-primary {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.status-badge-success {
  background-color: rgba(40, 167, 69, 0.1);
  color: var(--success-color);
}

.status-badge-danger {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
}

/* Table Loading Indicator */
.clients-table-loading {
  display: none;
}

/* Основной стиль для индикатора загрузки */
/* #table-loading-indicator {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  z-index: 9999 !important;
  background-color: rgba(255, 255, 255, 0.8) !important;
} */

#debt-loading-indicator,
#table-loading-indicator,
.loading-indicator,
#loader,
.spinner-border,
#loading,
.table-loading-indicator {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Client Filtering */
#streetSelect,
#houseSelect {
  width: 100%;
}

/* Print Table Styles */
.print-table-custom {
  width: 100%;
}

#print-table_wrapper .dt-paging {
  float: right;
  text-align: right;
}

/* Client Information Section */
.client-card-title {
  font-weight: bold;
  color: var(--dark-color);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.table-responsive {
  min-width: 100%;
  border: none;
  margin-bottom: 0;
}

.table-responsive .table {
  table-layout: fixed;
  width: 100%;
  margin-bottom: 0;
}

.table-responsive .table td {
  padding: 10px 15px !important;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color-light, #f0f0f0);
}

.table-responsive .table td:first-child {
  white-space: normal !important;
  background-color: white;
  border-right: 1px solid var(--border-color-light, #f0f0f0);
  padding-right: 25px !important;
}

.table-responsive .table td:first-child strong {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  line-height: 1.3;
  gap: 8px;
  color: var(--dark-color);
}

.table-responsive .table td:first-child .fa-solid {
  min-width: 16px;
  text-align: center;
  color: #4a90e2;
  margin-right: 0 !important;
}

.table-responsive .table td:last-child {
  width: auto;
  word-break: break-word;
  padding-left: 25px !important;
}

/* Client Phone Button */
.client-phone-button {
  padding: 3px 8px !important;
  font-size: 10px !important;
  border-color: #4a90e2;
  color: #4a90e2;
  line-height: 1.2;
  border-radius: var(--border-radius-sm, 4px);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.client-phone-button strong {
  font-weight: 500;
  margin-left: 0;
}

.client-phone-button .icon {
  font-size: 9px;
  margin-right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.client-phone-button:hover {
  background-color: #4a90e2;
  color: white;
  border-color: #3a80d2;
}

/* Client Badge */
.client-badge {
  color: white !important;
  background-color: #4a90e2 !important;
  padding: 0.25em 0.5em;
}

/* Client Icons */
.client-icons {
  margin-right: 15px !important;
  color: #4a90e2 !important;
}

/* Client Progress Bar */
.client-progress-bar {
  background-color: #4a90e2 !important;
  color: white;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  font-weight: 500;
  font-size: 0.85em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-bar.bg-danger {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  font-weight: 500;
  font-size: 0.85em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Прогресс бар в информационной секции */
.progress {
  height: 1.5rem;
  margin-top: 1rem;
  border-radius: var(--border-radius-md);
  background-color: #f0f0f0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 0.5rem;
}

/* Исправление для телефонов */
.phone-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color-light, #f0f0f0) !important;
  padding: 8px 10px;
  background-color: white;
}

.phone-number {
  font-size: 0.95em;
  font-weight: 500;
  color: var(--dark-color);
  display: flex;
  align-items: center;
}

.phone-type {
  font-size: 0.75em;
  white-space: nowrap;
  background-color: #4a90e2 !important;
  border-radius: var(--border-radius-sm, 4px);
  padding: 3px 8px;
}

.phone-numbers {
  display: none;
}

.phone-numbers.visible {
  display: table-row-group;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .clients-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .content-wrapper {
    padding: var(--spacing-sm);
  }
  
  .clients-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .filter-sidebar {
    margin-bottom: var(--spacing-md);
  }
  
  .client-info-section {
    grid-template-columns: 1fr;
  }
  
  .card-body h5 {
    font-size: 1.1em;
  }

  .btn-sm {
    font-size: 10px;
  }

  .table-responsive {
    margin-bottom: 10px;
  }

  .table td {
    padding: 8px;
  }

  .phone-type {
    margin-top: 5px;
  }

  .phone-info {
    flex-direction: column;
  }

  .phone-number {
    margin-bottom: 5px;
  }

  /* Клиентская информация на мобильных устройствах */
  .table-responsive .table td:first-child {
    width: 150px;
  }
  
  .table-responsive .table td:first-child strong {
    font-size: 0.9em;
  }
  
  .nowrap {
    font-size: 0.9em;
    /* white-space: nowrap !important; */
  }
  
  /* Улучшенная читаемость на мобильных */
  .table-responsive .table td {
    padding: 8px 10px !important;
  }
  
  /* Убираем фон у первого столбца для более чистого вида */
  .table-responsive .table td:first-child {
    background-color: transparent;
    border-right: none;
  }
}

/* Текст в одну строку */
.nowrap {
  white-space: nowrap;
}

/* Исправления для строки Дата подключения */
.text-sm-left strong {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.text-sm-left .fa-solid + .nowrap {
  margin-left: 8px;
}

/* Специальные стили для таблицы информации о клиенте */
.client-info-table {
  width: 100%;
}

.client-info-table td:first-child {
  width: 200px !important;
  position: relative;
}


/* Исправление для кнопки фильтра */
.filter-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 31px !important;
  min-width: 31px !important;
  padding: 0.25rem 0.5rem !important;
  margin-right: 5px !important;
  line-height: 1.5 !important;
  vertical-align: middle !important;
}

.filter-button i {
  margin: 0 !important;
  font-size: 0.9rem !important;
}

.dt-buttons .btn.btn-secondary.btn-outline-primary {
  background-color: transparent !important;
  color: #4a90e2 !important;
  border-color: #4a90e2 !important;
}

.dt-buttons .btn.btn-secondary.btn-outline-primary:hover {
  background-color: #4a90e2 !important;
  color: white !important;
}

/* Стили для кнопок пагинации */
.dt-paging .page-link,
.dt-paging-button a {
  padding: 0.2rem 0.4rem !important;
  font-size: 0.7rem !important;
  line-height: 1.3 !important;
  border-radius: 0.2rem !important;
}

.dt-paging .page-item,
.dt-paging-button {
  margin: 0 1px !important;
}

.dt-paging .pagination {
  margin-bottom: 0 !important;
}

/* Стили для пагинации */
.dt-paging-button a {
  min-width: 28px !important;
  height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 4px !important;
  font-weight: 500;
  color: #4a5568 !important;
  background-color: #f7fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
  font-size: 0.75rem !important;
  padding: 0.15rem !important;
}

/* Информация о количестве записей */
.dt-info {
  display: block !important;
  font-size: 0.8rem !important;
  color: #666;
  white-space: nowrap;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 1;
  min-width: 150px;
}

/* Отступы для пагинации и информации */
.dt-layout-row:last-child {
  margin-top: 8px !important;
  padding-top: 8px !important;
}

.dt-info, .dt-paging {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.2;
}

/* Компактные стили для кнопок пагинации */
.dt-paging .pagination {
  margin: 0 !important;
  gap: 4px;
}

.dt-paging-button.active a {
  background-color: #4a90e2 !important;
  color: white !important;
  border-color: #3182ce !important;
  box-shadow: 0 1px 2px rgba(66, 153, 225, 0.36) !important;
}

/* Стиль для выпадающего меню "Выбрать столбцы" */
div.dt-button-collection {
  max-height: none !important;
  overflow: visible !important;
  z-index: 2000 !important;
}

div.dt-button-collection .dt-button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: 0;
  border: none;
  margin: 0;
  white-space: nowrap;
}

div.dt-button-collection .dt-button.active {
  background-color: #4a90e2 !important;
  color: white !important;
}

div.dt-button-collection .dt-button:hover {
  background-color: #f0f0f0;
}



/* Замена цвета для btn-outline-primary */
.btn-outline-primary {
  color: #4a90e2 !important;
  border-color: #4a90e2 !important;
}

.btn-outline-primary:hover {
  background-color: #4a90e2 !important;
  color: white !important;
}

/* Радикальное устранение синего прямоугольника при фокусе */
nav, .navbar, .navbar-brand, .navbar a, .navbar button, .navbar-toggler, 
.navbar-nav, .nav-item, .nav-link, .dropdown-toggle, .dropdown-menu {
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

html, body {
  -webkit-tap-highlight-color: transparent !important;
  height: 100%;
  margin: 0;
}

*:focus {
  outline: 0 !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

*:visited {
  outline: 0 !important;
}

*:active {
  outline: 0 !important;
}

/* Устранение синего прямоугольника при фокусе */
a:focus, 
button:focus, 
input:focus, 
.btn:focus,
.dt-paging-button a:focus,
.page-link:focus,
.page-item a:focus,
*:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Отключение подсветки при наведении на строки таблицы */
.table-hover tbody tr:hover,
#clients-table tbody tr:hover,
.table tbody tr:hover {
  background-color: transparent !important;
}

/* Стили для фильтров и печати */
#debtFilter {
  display: flex;
  padding-top: 10px;
  padding-bottom: 10px;
}

#clients-table tbody tr {
  cursor: pointer;
}

#clients-table tbody tr:hover {
  background-color: rgba(74, 144, 226, 0.1);
}

#clients-table td a,
#clients-table td button {
  cursor: auto !important;
}

.dt-search input {
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  border-radius: 8px !important;
  padding: 12px 45px 12px 40px !important;
  transition: all 0.2s ease !important;
  background: white url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23718096" width="18px" height="18px"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>') no-repeat 14px center;
  width: 350px !important;
}

.dt-search input:focus {
  border-color: #4299e1 !important;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15) !important;
}

div.dt-container div.dt-layout-start > *:not(:last-child) {
  margin-right: 0;
}

.dataTables_length label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dataTables_length select {
  height: 38px;
  background-color: #f7fafc;
  border-radius: 6px !important;
  font-weight: 500;
  color: #4a5568;
  padding: 0 10px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
}

.dataTables_length select:hover {
  border-color: #4a90e2 !important;
}

/* Адаптивность таблицы */
@media (max-width: 768px) {
  .dataTables_wrapper .top-start {
    flex-direction: column;
    gap: 8px;
  }

  .dt-search input {
    width: 100% !important;
  }

  .dataTables_length {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .btn-outline-primary {
    width: 100%;
  justify-content: center;
}

  .dt-paging .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
  }

  .dt-paging-button.page-item .page-link {
    padding: 4px 8px !important;
    min-width: 28px;
    margin: 2px;
  }
}

/* Гамбургер и слайдер */
#filter-toggle {
  border-radius: 50%;
  padding: 10px;
  background-color: transparent;
  border: none;
}

.navbar-toggler-icon {
  width: 30px;
  height: 3px;
  background-color: #333;
  display: block;
  margin: 6px 0;
}

/* Стили для слайдера (выезжающее меню) */
.sidebar {
  position: fixed;
  top: 0;
  right: -300px; /* Меню скрыто за пределами экрана */
  height: 100%;
  width: 300px;
  background-color: #f8f9fa;
  transition: 0.3s;
  z-index: 1000;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
}

.sidebar-content {
  padding: 20px;
}

.sidebar .btn-close {
  font-size: 30px;
  color: #333;
  background: transparent;
  border: none;
  cursor: pointer;
}

.sidebar.show {
  right: 0;
}

#clients-table_wrapper .dt-search,
#clients-table_wrapper .dt-search input {
  margin-left: 0 !important;
}

/* Стили для модального окна */
.modal-custom {
  max-width: 90%; /* Увеличиваем ширину модалки для больших таблиц */
}

.modal-content {
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: none; /* Убираем стандартную рамку Bootstrap */
}

.modal-header-custom {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  padding: 15px 20px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.modal-header-custom .modal-title {
  font-weight: 600;
  color: #333;
}

.modal-header-custom .close {
  font-size: 24px;
  color: #666;
  opacity: 1;
  transition: color 0.3s ease;
}

.modal-header-custom .close:hover {
  color: #333;
}

.modal-body-custom {
  padding: 20px;
  background-color: #fff;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* Стили для таблицы в модалке */
.print-table-custom {
  border-collapse: collapse;
  font-size: 14px;
  color: #333;
  width: 100%;
}

.print-table-custom thead th {
  background-color: #f1f3f5;
  color: #555;
  font-weight: 600;
  padding: 12px 15px;
  border: 1px solid #d0d0d0;
  text-align: left;
}

.print-table-custom tbody td {
  padding: 10px 15px;
  border: 1px solid #e0e0e0;
  vertical-align: middle;
}

.print-table-custom tbody tr:nth-child(even) {
  background-color: #fafafa; /* Чередуем фон для читаемости */
}

.print-table-custom tbody tr:hover {
  background-color: rgba(74, 144, 226, 0.1); /* Лёгкий ховер-эффект */
}

/* Дополнительные стили для кнопок пагинации в таблице для печати */
#print-table_wrapper .dt-paging {
  float: right;
  text-align: right;
}

/* Адаптивность для модальных окон */
@media (max-width: 768px) {
  .modal-custom {
    max-width: 95%;
  }

  .print-table-custom {
    font-size: 12px;
  }

  .print-table-custom thead th,
  .print-table-custom tbody td {
    padding: 8px 10px;
  }
}

/* Стили для печати */
@media print {
  .modal-dialog {
    width: 100% !important;
    margin: 0 !important;
  }

  .modal-content {
    box-shadow: none;
    border-radius: 0;
  }

  .modal-header-custom {
    display: none; /* Скрываем заголовок при печати */
  }

  .modal-body-custom {
    padding: 0;
  }

  .print-table-custom {
  width: 100%;
  }

  .print-table-custom thead th,
  .print-table-custom tbody td {
    border: 1px solid #000; /* Чёрные границы для печати */
  }

  .print-table-custom tbody tr:nth-child(even) {
    background-color: #fff; /* Убираем чередование фона при печати */
  }

  .dt-buttons {
    display: none; /* Скрываем кнопки при печати */
  }
}

/* Красивые бейджи для статусов */
.badge-danger, .badge-success {
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  border-radius: 0.35rem;
  letter-spacing: 0.03em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.badge-danger {
  background-color: #f56565;
  border: 1px solid #e53e3e;
}

.badge-success {
  background-color: #48bb78;
  border: 1px solid #38a169;
}

.badge-primary {
  background-color: #4a90e2;
  border: 1px solid #3182ce;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  border-radius: 0.35rem;
  margin: 0 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

/* Улучшенная пагинация */
.dt-paging-button a {
  min-width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  font-weight: 500;
  color: #4a5568 !important;
  background-color: #f7fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.dt-paging-button.active a {
  background-color: #4a90e2 !important;
  color: white !important;
  border-color: #3182ce !important;
  box-shadow: 0 1px 3px rgba(66, 153, 225, 0.36) !important;
}

.dt-paging-button a:hover {
  background-color: #edf2f7 !important;
  border-color: #cbd5e0 !important;
  color: #2d3748 !important;
}

.dt-paging-button.active a:hover {
  background-color: #3182ce !important;
  color: white !important;
}

/* Улучшенный поиск */
.dt-search input {
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  border-radius: 8px !important;
  padding: 12px 45px 12px 40px !important;
  transition: all 0.2s ease !important;
  background: white url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23718096" width="18px" height="18px"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>') no-repeat 14px center;
}

.dt-search input:focus {
  border-color: #4299e1 !important;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15) !important;
}

/* Select для страниц */
.dataTables_length select {
  height: 38px;
  background-color: #f7fafc;
  border-radius: 6px !important;
  font-weight: 500;
  color: #4a5568;
  padding: 0 10px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
}

.dataTables_length select:hover {
  border-color: #4a90e2 !important;
}


/* Responsive adjustments */
@media (max-width: 768px) {
  #clients-table_wrapper {
    padding: 10px;
    border-radius: 8px;
  }
  
  .dt-buttons .btn-sm {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }
  
  .dt-paging-button a {
    min-width: 28px !important;
    height: 28px !important;
    font-size: 0.75rem !important;
  }
}

/* Стили для иконок в кнопках */
.dt-button i.fa-solid,
.btn i.fa-solid {
  margin-right: 0; /* По умолчанию без отступа */
}

/* Отступ для иконок, когда рядом есть текст (проверяем на наличие следующего узла) */
button span i.fa-solid,
a span i.fa-solid,
.dt-button span i.fa-solid {
  margin-right: 6px !important;
}

/* Специальный случай для кнопок, где иконка вне span, но есть текст */
.btn:not(:empty) > i.fa-solid:first-child:not(:only-child) {
  margin-right: 6px !important;
}

#filter-icon {
  margin-right: 0 !important;
}

/* Стили для иконок в кнопках danger */
.btn-danger i.fa-solid {
  color: white !important;
}

/* Стили для иконок в кнопках danger-outline */
.btn-outline-danger i.fa-solid {
  color: #dc3545 !important; /* Красный цвет по умолчанию */
}

/* При наведении на outline-danger кнопку иконка становится белой */
.btn-outline-danger:hover i.fa-solid {
  color: white !important;
}

#filter-icon {
  margin-right: 0 !important;
}

/* Улучшенные бейджи для статусов долга */
.badge-debt, .badge-no-debt {
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  border-radius: 0.35rem;
  letter-spacing: 0.03em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.badge-debt {
  background-color: #f56565;
  border: 1px solid #e53e3e;
  color: white;
}

.badge-debt i.fa-coins {
  color: #ffeb3b; /* Золотой цвет для монет */
  margin-right: 4px;
  text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3);
}

.badge-debt:hover {
  background-color: #e53e3e;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(229, 62, 62, 0.2);
}

.badge-no-debt {
  background-color: #48bb78;
  border: 1px solid #38a169;
  color: white;
}

.badge-no-debt i.fa-coins {
  color: #ffeb3b; /* Золотой цвет для монет */
  margin-right: 4px;
  text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3);
}

.badge-no-debt:hover {
  background-color: #38a169;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(56, 161, 105, 0.2);
}

/* Стили для улучшенных хлебных крошек (breadcrumb) */
.enhanced-breadcrumb {
  margin-bottom: 0 !important;
}

.enhanced-breadcrumb .breadcrumb {
  border: 1px solid var(--border-color-light, #e0e0e0);
  padding: 10px 15px;
  background-color: #f8f9fa !important;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-size: 0.9rem;
}

.enhanced-breadcrumb .breadcrumb-item {
  display: flex;
  align-items: center;
}

.enhanced-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  content: "\f054" !important; /* FontAwesome стрелка вправо */
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900;
  color: #adb5bd;
  font-size: 0.7rem;
  margin: 0 10px;
}

.enhanced-breadcrumb .breadcrumb-item a {
  color: #4a90e2;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
  text-decoration: none;
}

.enhanced-breadcrumb .breadcrumb-item a:hover {
  color: #2c6cb9;
  text-decoration: none;
}

.enhanced-breadcrumb .breadcrumb-item.active {
  color: #6c757d;
  font-weight: 500;
}

.enhanced-breadcrumb .breadcrumb-item i {
  margin-right: 6px;
  color: #4a90e2;
}

.enhanced-breadcrumb .breadcrumb-item.active i {
  color: #6c757d;
}

/* На мобильных устройствах */
@media (max-width: 768px) {
  .enhanced-breadcrumb .breadcrumb {
    padding: 8px 10px;
    font-size: 0.8rem;
  }
  
  .enhanced-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    margin: 0 5px;
  }
}

/* Стили для больших разрешений (более 1700px) */
@media (min-width: 1700px) {
  .container-fluid {
    margin: 0 auto;
  }
  
  .card {
    margin-bottom: 1.5rem;
  }
  
  .card-header {
    padding: 0.75rem 1.25rem;
  }
  
  .card-header h5.mb-0 {
    font-size: 1.1rem;
  }
  
  .table-responsive td {
    padding: 0.5rem 1rem !important;
    font-size: 1rem;
  }
  
  .table-responsive td:first-child {
    width: 250px;
  }
  
  .btn-sm {
    font-size: 0.85rem;
    padding: 0.3rem 0.7rem;
  }
  
  .task-list {
    max-height: 400px;
  }
  
  .task-item {
    margin-bottom: 0.75rem;
  }
  
  .task-body {
    padding: 1rem;
    font-size: 1rem;
  }
  
  .modal-dialog {
    max-width: 600px;
  }
  
  .modal-title {
    font-size: 1.3rem;
  }
  
  .modal-body {
    padding: 1.5rem;
}

.progress {
    height: 15px;
  }
  
  .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.7rem;
  }
  
  .breadcrumb {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
  }
  
  .breadcrumb-item i {
    font-size: 1.1rem;
  }
}

/* Стили для лейблов задач */
.task-badge {
  color: white !important;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  margin-right: 8px;
}

.task-badge:hover {
  transform: scale(1.05);
  color: white !important;
}

.task-actions {
  gap: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Стили для выпадающего меню задач */
.dropdown-menu {
  min-width: 120px !important;
  padding: 0.25rem !important;
  border-radius: 6px !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.dropdown-menu li {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dropdown-item.task-dropdown-item {
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  margin: 2px 0;
  transition: all 0.2s ease;
  color: #2c3e50;
  display: flex;
  align-items: center;
}

.dropdown-item.task-dropdown-item:hover {
  background-color: rgba(74, 144, 226, 0.1);
  color: #4a90e2;
}

.dropdown-item.task-dropdown-item i {
  font-size: 0.75rem;
  margin-right: 5px;
  color: #4a90e2;
}

.task-menu {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: transparent;
  transition: all 0.2s ease;
}

.task-menu:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.task-menu i {
  font-size: 0.8rem;
  color: #6c757d;
}

/* Адаптивность для разных размеров экрана */
@media (min-height: 1101px) {
  #clients-table_wrapper .dt-scroll {
    max-height: calc(100vh - 25vh) !important; /* Для очень больших экранов */
  }
}

@media (max-height: 1100px) {
  #clients-table_wrapper .dt-scroll {
    max-height: calc(100vh - 30vh) !important; /* Для очень больших экранов */
  }
}

@media (max-height: 900px) {
  #clients-table_wrapper .dt-scroll {
    max-height: calc(100vh - 35vh) !important; /* Для средних экранов */
  }
}

@media (max-height: 800px) {
  #clients-table_wrapper .dt-scroll {
    max-height: calc(100vh - 40vh) !important; /* Для небольших экранов */
  }
}

@media (max-height: 700px) {
  #clients-table_wrapper .dt-scroll {
    max-height: calc(100vh - 45vh) !important; /* Для очень маленьких экранов */
  }
}


/* Фиксированный заголовок таблицы DataTables */
.dt-scroll-head {
  position: sticky !important;
  top: 0 !important;
  z-index: 20 !important;
  overflow: visible !important;
  border-bottom: none !important;
  opacity: 1 !important;
  background-color: white !important;
}

.dt-scroll-headInner {
  width: 100% !important;
  overflow: hidden !important;
  opacity: 1 !important;
}

.dt-scroll-head table {
  margin-bottom: 0 !important;
  opacity: 1 !important;
}

.dt-scroll-head th {
  background-color: #f8f9fa !important;
  border-bottom: 2px solid #e2e8f0 !important;
  font-weight: 600 !important;
  color: #4a5568 !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  opacity: 1 !important;
}

/* Убираем заголовок внутри тела таблицы */
.dt-scroll-body thead {
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
  display: none !important;
}

/* Настраиваем скролл для содержимого таблицы */
.dt-scroll-body {
  overflow-y: auto !important;
  max-height: calc(100vh - 280px) !important;
}

/* Стили для кнопки удаления в таблице для печати */
.delete-row-btn {
  padding: 4px 8px !important;
  font-size: 0.75rem !important;
  margin: 0 !important;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background-color: #dc3545;
  border-color: #dc3545;
  color: white;
  transition: all 0.2s ease;
}

.delete-row-btn:hover {
  background-color: #bd2130;
  border-color: #bd2130;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.delete-row-btn .fa-trash {
  font-size: 0.7rem;
}


