/* Модалка поверх всего */
#ganttModal.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#ganttModal .modal-content { background: #fff; border-radius: 8px; }

/* Повышаем z-index внутренних выпадающих списков, чтобы не перекрывались канвой */
.gantt_cal_light, .gantt_combo, .gantt_select, .select2-container { z-index: 1100 !important; }
/* Стили для дашборда службы строительного контроля */

/* Принудительный сброс стилей для модальных окон при проблемах */
.modal.reset-modal {
    display: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

/* Сброс стилей body при проблемах с модальными окнами */
body.reset-body {
    overflow: auto !important;
    padding-right: 0 !important;
}

/* Стили для восстановления интерфейса только при проблемах */
.dashboard-container.blurred,
.main-content.blurred,
.content-section.blurred {
    filter: none !important;
    backdrop-filter: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
}

.dashboard-container.disabled,
.main-content.disabled,
.content-section.disabled {
    pointer-events: auto !important;
    opacity: 1 !important;
    filter: none !important;
}

/* Восстановление модальных окон только при проблемах */
.modal.reset-modal {
    display: none !important;
}

.modal.show {
    display: flex !important;
}

/* Основные переменные */
:root {
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  
  --sidebar-width: 250px;
  --header-height: 60px;
  --border-radius: 8px;
  --box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
}

/* Общие стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--light-color);
  color: var(--dark-color);
  line-height: 1.6;
}

/* Заголовок */
.dashboard-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: white;
  border-bottom: 1px solid #dee2e6;
  z-index: 1000;
  box-shadow: var(--box-shadow);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 20px;
}

.header-left h1 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 4px;
}

/* Улучшение мобильной типографики и переносов */
@media (max-width: 420px) {
  .header-left h1 {
    font-size: 1.125rem;
    line-height: 1.2;
    word-break: break-word;
  }
  .section-header h2 {
    font-size: 1.125rem;
    line-height: 1.2;
    word-break: break-word;
  }
  .stat-card .stat-number {
    font-size: 1.75rem;
  }
  .stat-card .stat-label {
    font-size: 0.9rem;
    line-height: 1.2;
    word-break: break-word;
  }
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.role-badge {
  background: var(--primary-color);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.header-right {
  display: flex;
  gap: 10px;
}

/* Специальные кнопки в заголовке */
/* Кнопки в шапке: единый светлый secondary */
#backToObjectsBtn,
#themeToggle {
  background: linear-gradient(135deg, #eef2f7 0%, #dde6f1 100%);
  color: #2b3a49;
  border: 1px solid #c9d6e4;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(41, 121, 255, 0.12);
}

#backToObjectsBtn:hover,
#themeToggle:hover {
  background: linear-gradient(135deg, #e6eef8 0%, #d3e2f6 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(41, 121, 255, 0.18);
}

#logoutBtn {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

#logoutBtn:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Основной контент */
.dashboard-main {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* Боковая панель - модернизированная */
.dashboard-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  border-right: 1px solid #e0e0e0;
  position: fixed;
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.sidebar-nav ul {
  list-style: none;
  padding: 24px 0;
  margin: 0;
}

.sidebar-nav li {
  margin: 0;
  padding: 0 16px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: #333;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 14px;
  border-radius: 8px;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  position: relative;
}

.nav-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: #666;
  transition: color 0.3s ease;
}

.nav-link span {
  flex: 1;
}

.nav-link:hover {
  background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
  color: #2979ff;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(41, 121, 255, 0.15);
}

.nav-link:hover i {
  color: #2979ff;
}

.nav-link.active {
  background: linear-gradient(135deg, #2979ff 0%, #1565c0 100%);
  color: white;
  border-left-color: #5ca4ff;
  box-shadow: 0 4px 12px rgba(41, 121, 255, 0.25);
  transform: translateX(4px);
}

.nav-link.active i {
  color: white;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: #5ca4ff;
  border-radius: 0 2px 2px 0;
}

/* Контентная область - компактная */
.dashboard-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 16px 20px;
  overflow-y: auto;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

/* Заголовки секций - компактные с измененным расположением */
.section-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-color);
  gap: 20px;
}

.section-header h2 {
  color: var(--primary-color);
  font-size: 1.6rem;
  margin: 0;
  flex-shrink: 0;
}

/* Стили для элементов управления в секциях - компактные с высокой специфичностью */
.section-actions {
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  flex-shrink: 0 !important;
}

/* Стили для панели фильтров */
.filters-panel {
  margin: 15px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.filters-panel .section-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.filters-panel select,
.filters-panel input[type="text"] {
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  background: #ffffff;
  color: #495057;
  transition: all 0.2s ease;
}

.filters-panel select:hover,
.filters-panel input[type="text"]:hover {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.filters-panel select:focus,
.filters-panel input[type="text"]:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.filters-panel .btn {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 4px;
}

/* Стили для таблицы журнала входного контроля */
.input-control-list {
  margin-top: 20px;
}

.input-control-table-container {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: auto;
  max-height: 600px;
}

.input-control-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Montserrat', sans-serif;
}

.input-control-table thead {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.input-control-table thead th {
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.input-control-table thead th:last-child {
  border-right: none;
}

.input-control-table tbody tr {
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s ease;
}

.input-control-table tbody tr:hover {
  background-color: #f8f9fa;
}

.input-control-table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

.input-control-table tbody tr:nth-child(even):hover {
  background-color: #e9ecef;
}

.input-control-table tbody td {
  padding: 10px 8px;
  font-size: 13px;
  vertical-align: middle;
  border-right: 1px solid #e9ecef;
}

.input-control-table tbody td:last-child {
  border-right: none;
}

.input-control-table .source-badge,
.input-control-table .quality-badge,
.input-control-table .status-badge,
.input-control-table .validation-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-control-table .actions {
  white-space: nowrap;
}

.input-control-table .actions .btn {
  margin-right: 4px;
  padding: 4px 8px;
  font-size: 11px;
}

.input-control-table .actions .btn:last-child {
  margin-right: 0;
}

/* Стили для статусов превышения */
.input-control-table .status-badge.status-normal {
  background: #28a745;
  color: white;
}

.input-control-table .status-badge.status-excess {
  background: #ffc107;
  color: #212529;
}

.input-control-table .status-badge.status-critical_excess {
  background: #dc3545;
  color: white;
}

#gantt-section .section-actions {
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
}

#gantt-section .section-actions select {
  padding: 8px 12px !important;
  border: 2px solid #e0e0e0 !important;
  border-radius: 6px !important;
  font-family: 'Montserrat', sans-serif !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
  color: #333 !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  cursor: pointer !important;
  min-width: 140px !important;
}

.section-actions select:hover {
  border-color: #2979ff !important;
  background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(41, 121, 255, 0.15) !important;
}

.section-actions select:focus {
  outline: none !important;
  border-color: #2979ff !important;
  box-shadow: 0 0 0 3px rgba(41, 121, 255, 0.1) !important;
  background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%) !important;
}

/* Компактные кнопки для всех секций */
.section-actions .btn {
  padding: 8px 12px !important;
  font-size: 12px !important;
  border-radius: 6px !important;
  min-width: auto !important;
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
}

/* Унифицированный стиль контурных иконок */
.icon {
  font-size: 16px;
  color: #5a6b7b;
}

.btn:hover .icon {
  color: #ffffff;
}

.section-actions .btn-sm {
  padding: 6px 10px !important;
  font-size: 11px !important;
  border-radius: 5px !important;
}

/* Специальные стили для кнопок в диаграмме Ганта */
#gantt-section .section-actions .btn {
  padding: 8px 12px !important;
  font-size: 12px !important;
  border-radius: 6px !important;
  min-width: auto !important;
}

/* Специальные стили для фильтров диаграммы Ганта - компактные с высокой специфичностью */
#gantt-section #ganttObjectFilter,
#gantt-section #ganttScale {
  padding: 8px 12px !important;
  border: 2px solid #e0e0e0 !important;
  border-radius: 6px !important;
  font-family: 'Montserrat', sans-serif !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
  color: #333 !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  cursor: pointer !important;
  min-width: 140px !important;
}

#gantt-section #ganttObjectFilter:hover,
#gantt-section #ganttScale:hover {
  border-color: #2979ff !important;
  background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(41, 121, 255, 0.15) !important;
}

#gantt-section #ganttObjectFilter:focus,
#gantt-section #ganttScale:focus {
  outline: none !important;
  border-color: #2979ff !important;
  box-shadow: 0 0 0 3px rgba(41, 121, 255, 0.1) !important;
  background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%) !important;
}

/* Статистические карточки - компактные */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  display: flex;
  align-items: center;
  gap: 15px;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stat-icon {
  font-size: 3.0rem; /* увеличение иконок в статистике */
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light-color);
  border-radius: 50%;
}

/* увеличиваем сами FA-иконки внутри кружка статистики */
.stat-icon .icon { font-size: 1em; }

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.stat-label {
  color: var(--secondary-color);
  font-size: 0.9rem;
}

/* Быстрые действия - компактные */
.quick-actions {
  background: white;
  padding: 16px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 24px;
}

.quick-actions h3 {
  margin-bottom: 12px;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

/* Кнопки быстрых действий - модернизированные */
.action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(41, 121, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.action-btn:hover::before {
  left: 100%;
}

.action-btn:hover {
  background: linear-gradient(135deg, #2979ff 0%, #1565c0 100%);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(41, 121, 255, 0.3);
  border-color: #2979ff;
}

.action-icon { font-size: 18px; transition: transform 0.3s ease; }

.action-btn:hover .action-icon {
  transform: scale(1.1);
}

.action-text {
  font-weight: 500;
  flex: 1;
}

/* Последние активности - компактные */
.recent-activities {
  background: white;
  padding: 16px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.recent-activities h3 {
  margin-bottom: 12px;
  color: var(--primary-color);
}

.activities-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--light-color);
  border-radius: var(--border-radius);
}

.activity-icon { font-size: 1.1rem; width: 20px; text-align: center; }

.activity-text {
  flex: 1;
}

.activity-time {
  color: var(--secondary-color);
  font-size: 0.9rem;
}

/* Фильтры - модернизированные */
.filters {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  flex-wrap: wrap;
  align-items: center;
}

.filters select,
.filters input {
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 400;
  background: white;
  color: #333;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filters select:focus,
.filters input:focus {
  outline: none;
  border-color: #2979ff;
  box-shadow: 0 0 0 3px rgba(41, 121, 255, 0.1);
  transform: translateY(-1px);
}

.filters input {
  flex: 1;
  min-width: 200px;
}

.filters input::placeholder {
  color: #999;
  font-style: italic;
}

.filters select {
  min-width: 160px;
  cursor: pointer;
}

.filters select:hover {
  border-color: #2979ff;
}

/* Общие стили для таблиц */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  font-family: 'Montserrat', sans-serif;
}

.data-table thead {
  background: linear-gradient(135deg, #bcd3ee 0%, #5ca4ff 100%);
  color: white;
}

.data-table thead th {
  padding: 16px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #2979ff;
}

.data-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.3s ease;
}

.data-table tbody tr:nth-child(even) {
  background: #f0f7ff;
}

.data-table tbody tr:hover {
  background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 100%);
  transform: scale(1.01);
  box-shadow: 0 2px 8px rgba(41, 121, 255, 0.15);
}

.data-table tbody td {
  padding: 14px 12px;
  font-size: 14px;
  vertical-align: middle;
  font-family: 'Montserrat', sans-serif;
  color: #333;
}

.data-table .no-data {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 40px 20px;
  background: #f8f9fa;
}

/* Списки */
.objects-list,
.violations-list,
.works-list {
  display: grid;
  gap: 15px;
}

/* Карточки объектов */
.object-card {
  background: white;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

/* Сетка карточек объектов: 3 в ряд на десктопе */
.objects-list { grid-template-columns: repeat(3, minmax(280px, 1fr)); }
.violations-list { grid-template-columns: repeat(3, minmax(280px, 1fr)); }
.works-list { grid-template-columns: repeat(3, minmax(280px, 1fr)); }

@media (max-width: 1200px) {
  .objects-list { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .violations-list { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .works-list { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
}

@media (max-width: 700px) {
  .objects-list { grid-template-columns: 1fr; }
  .violations-list { grid-template-columns: 1fr; }
  .works-list { grid-template-columns: 1fr; }
}

.object-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.object-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.object-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--primary-color);
}

.object-status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.object-status.planned { background: var(--warning-color); color: white; }
.object-status.active { background: var(--success-color); color: white; }
.object-status.completed { background: var(--secondary-color); color: white; }
.object-status.paused { background: var(--info-color); color: white; }

.object-progress {
  margin-bottom: 15px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.9rem;
  color: var(--secondary-color);
  margin-top: 5px;
}

.object-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.object-actions {
  display: flex;
  gap: 10px;
}

/* Карточки нарушений */
.violation-card {
  background: white;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border-left: 4px solid var(--warning-color);
  transition: var(--transition);
}

/* Окантовка по статусу для обогащенных карточек */
.violation-card.enriched.status-resolved {
  border-left: 4px solid var(--success-color) !important;
  border-right: 4px solid #28a745 !important;
}

.violation-card.enriched.status-open {
  border-left: 4px solid var(--warning-color) !important;
  border-right: 4px solid #ffc107 !important;
}

.violation-card.enriched.status-overdue {
  border-left: 4px solid var(--danger-color) !important;
  border-right: 4px solid #dc3545 !important;
}

.violation-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.violation-card.critical { border-left-color: var(--danger-color); }
.violation-card.high { border-left-color: var(--warning-color); }
.violation-card.medium { border-left-color: var(--info-color); }
.violation-card.low { border-left-color: var(--success-color); }

.violation-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.violation-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--dark-color);
}

.violation-severity {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.violation-severity.critical { background: var(--danger-color); color: white; }
.violation-severity.high { background: var(--warning-color); color: white; }
.violation-severity.medium { background: var(--info-color); color: white; }
.violation-severity.low { background: var(--success-color); color: white; }

.violation-description {
  color: var(--secondary-color);
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.violation-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.violation-actions {
  display: flex;
  gap: 10px;
}

/* Карточки работ */
.work-card {
  background: white;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.work-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.work-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.work-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--primary-color);
}

.work-status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.work-status.completed { background: var(--success-color); color: white; }
.work-status.pending { background: var(--warning-color); color: white; }
.work-status.verified { background: var(--info-color); color: white; }
.work-status.rejected { background: var(--danger-color); color: white; }

.work-description {
  color: var(--secondary-color);
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.work-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 15px;
  font-size: 0.9rem;
}

.work-actions {
  display: flex;
  gap: 10px;
}

/* Карта */
.map-container {
  height: 500px;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
}

/* Отчеты */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.report-card {
  background: white;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.report-card h3 {
  margin-bottom: 15px;
  color: var(--primary-color);
}

.chart-container {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light-color);
  border-radius: var(--border-radius);
  color: var(--secondary-color);
}

/* Модальные окна */
/* Модальные окна - модернизированные */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(8px);
  }
}

.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 720px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid #e0e0e0;
  animation: modalSlideIn 0.3s ease-out;
  position: relative;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 2px solid #f0f0f0;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 16px 16px 0 0;
}

.modal-header h2 {
  color: #2979ff;
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 20px;
}

.modal-body {
  padding: 28px;
  background: white;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 28px;
  border-top: 2px solid #f0f0f0;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 0 0 16px 16px;
}

/* Формы - модернизированные */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Montserrat', sans-serif;
  background: white;
  color: #333;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2979ff;
  box-shadow: 0 0 0 3px rgba(41, 121, 255, 0.1);
  transform: translateY(-1px);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #999;
  font-style: italic;
}

/* Кнопки - модернизированные */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #2979ff 0%, #1565c0 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(41, 121, 255, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(41, 121, 255, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #eef2f7 0%, #dde6f1 100%);
  color: #2b3a49;
  box-shadow: 0 4px 12px rgba(41, 121, 255, 0.12);
  border: 1px solid #c9d6e4;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #e6eef8 0%, #d3e2f6 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(41, 121, 255, 0.18);
}

/* Повышенная специфичность для кнопок в секциях (каскад vs themes.css) */
.section-actions .btn.btn-secondary {
  background: linear-gradient(135deg, #eef2f7 0%, #dde6f1 100%) !important;
  color: #2b3a49 !important;
  border: 1px solid #c9d6e4 !important;
}

.section-actions .btn.btn-secondary:hover {
  background: linear-gradient(135deg, #e6eef8 0%, #d3e2f6 100%) !important;
}

.section-actions .btn.btn-secondary .icon { color: #5a6b7b; }
.section-actions .btn.btn-secondary:hover .icon { color: #ffffff; }
.title-icon {
  margin-right: 10px;
  color: #2979ff;
}

/* Заголовок: выравнивание иконки с текстом */
.header-left h1 .title-icon {
  vertical-align: -2px;
  font-size: 1.0em; /* слегка выше высоты заглавной буквы */
}

.btn-success {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
  border-radius: 5px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
  border-radius: 10px;
}

/* Уведомления */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: var(--border-radius);
  color: white;
  font-weight: bold;
  z-index: 3000;
  animation: slideIn 0.3s ease-out;
}

.notification-success { background: var(--success-color); }
.notification-error { background: var(--danger-color); }
.notification-warning { background: var(--warning-color); }
.notification-info { background: var(--info-color); }

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

/* Адаптивность */
/* Адаптивность для заголовков секций */
@media (max-width: 1200px) {
  .section-header {
    gap: 16px;
  }
  
  .section-header h2 {
    font-size: 1.4rem;
  }
}

@media (max-width: 768px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .section-header h2 {
    font-size: 1.3rem;
  }
}

/* Адаптивность для элементов управления */
@media (max-width: 1200px) {
  .section-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .section-actions select,
  #ganttObjectFilter,
  #ganttScale {
    min-width: 120px;
    font-size: 11px;
    padding: 6px 10px;
  }
  
  .section-actions .btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  .dashboard-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1001;
  }
  
  .dashboard-sidebar.open {
    transform: translateX(0);
  }
  
  .dashboard-content {
    margin-left: 0;
  }
  
  .nav-link {
    padding: 16px 20px;
    font-size: 15px;
  }
  
  .nav-link i {
    font-size: 18px;
    width: 24px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .actions-grid {
    grid-template-columns: 1fr;
  }
  
  .filters {
    flex-direction: column;
  }
  
  .modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .section-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .section-actions select,
  #ganttObjectFilter,
  #ganttScale {
    min-width: auto;
    width: 100%;
  }
}

/* Темная тема */
[data-theme="dark"] {
  --light-color: #2d3748;
  --dark-color: #e2e8f0;
  --secondary-color: #a0aec0;
}

[data-theme="dark"] body {
  background-color: #1a202c;
  color: var(--dark-color);
}

/* Темная тема для боковой панели */
[data-theme="dark"] .dashboard-sidebar {
  background: linear-gradient(180deg, #2d3748 0%, #1a202c 100%);
  border-right-color: #4a5568;
}

[data-theme="dark"] .nav-link {
  color: #e2e8f0;
}

[data-theme="dark"] .nav-link i {
  color: #a0aec0;
}

[data-theme="dark"] .nav-link:hover {
  background: linear-gradient(135deg, #2a4365 0%, #2c5282 100%);
  color: #90cdf4;
}

[data-theme="dark"] .nav-link:hover i {
  color: #90cdf4;
}

[data-theme="dark"] .nav-link.active {
  background: linear-gradient(135deg, #2979ff 0%, #1565c0 100%);
  color: white;
}

[data-theme="dark"] .nav-link.active i {
  color: white;
}

/* Темная тема для кнопок */
[data-theme="dark"] .action-btn {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  border-color: #4a5568;
  color: #e2e8f0;
}

[data-theme="dark"] .action-btn:hover {
  background: linear-gradient(135deg, #2979ff 0%, #1565c0 100%);
  color: white;
}

[data-theme="dark"] .close-btn {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  border-color: #4a5568;
  color: #a0aec0;
}

[data-theme="dark"] .close-btn:hover {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
}

[data-theme="dark"] .dashboard-header,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .quick-actions,
[data-theme="dark"] .recent-activities,
[data-theme="dark"] .object-card,
[data-theme="dark"] .violation-card,
[data-theme="dark"] .work-card,
[data-theme="dark"] .report-card,
[data-theme="dark"] .modal-content {
  background: var(--light-color);
  color: var(--dark-color);
}

/* Темная тема для таблиц и фильтров */
[data-theme="dark"] .filters {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  border-color: #4a5568;
}

[data-theme="dark"] .filters select,
[data-theme="dark"] .filters input {
  background: #4a5568;
  border-color: #4a5568;
  color: #e2e8f0;
}

[data-theme="dark"] .filters select:focus,
[data-theme="dark"] .filters input:focus {
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

[data-theme="dark"] .filters input::placeholder {
  color: #a0aec0;
}

[data-theme="dark"] .data-table,
[data-theme="dark"] #workLogTable {
  background: #2d3748;
  border-color: #4a5568;
}

[data-theme="dark"] .data-table thead,
[data-theme="dark"] #workLogTable thead {
  background: linear-gradient(135deg, #2a4365 0%, #3182ce 100%);
}

[data-theme="dark"] .data-table tbody tr:nth-child(even),
[data-theme="dark"] #workLogTable tbody tr:nth-child(even) {
  background: #2a4365;
}

[data-theme="dark"] .data-table tbody tr:hover,
[data-theme="dark"] #workLogTable tbody tr:hover {
  background: linear-gradient(135deg, #2c5282 0%, #2a4365 100%);
}

[data-theme="dark"] .data-table tbody td,
[data-theme="dark"] #workLogTable tbody td {
  color: #e2e8f0;
}

[data-theme="dark"] .data-table .no-data,
[data-theme="dark"] #workLogTable .no-data {
  background: #1a202c;
  color: #a0aec0;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
  background: #4a5568;
  border-color: #718096;
  color: var(--dark-color);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
  border-color: var(--primary-color);
}

/* Стили для обогащенных карточек нарушений */
.violation-card.enriched {
  position: relative;
  border-left-width: 6px;
}

.violation-card.enriched .violation-object-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e9ecef;
}

.violation-card.enriched .violation-type-badge {
  display: inline-block;
  background: var(--info-color);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-right: 8px;
}

.violation-card.enriched .violation-category {
  display: inline-block;
  background: var(--warning-color);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 4px;
}

.violation-card.enriched .violation-work-info {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
  margin: 10px 0;
  border-left: 3px solid var(--primary-color);
}

.violation-card.enriched .work-name,
.violation-card.enriched .work-type {
  margin: 4px 0;
  font-size: 0.9rem;
}

.violation-card.enriched .violation-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.violation-card.enriched .meta-item {
  font-size: 0.85rem;
  padding: 4px 0;
}

.violation-card.enriched .meta-item.time-info.overdue {
  color: var(--danger-color);
  font-weight: bold;
}

.violation-card.enriched .meta-item.location-info {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--secondary-color);
}

/* Отключаем старые индикаторы приоритета - теперь используем стили статуса */
.violation-card.enriched .violation-priority-indicator {
  display: none;
}

/* Стили для модального окна работ объекта */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: var(--border-radius);
  width: 80%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  color: var(--dark-color);
}

.modal-header .close {
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: var(--secondary-color);
}

.modal-header .close:hover {
  color: var(--dark-color);
}

.modal-body {
  padding: 20px;
}

/* Темная тема для обогащенных карточек */
[data-theme="dark"] .violation-card.enriched .violation-work-info {
  background: #2d3748;
  border-left-color: #4299e1;
}

[data-theme="dark"] .violation-card.enriched .violation-object-title {
  color: #4299e1;
  border-bottom-color: #4a5568;
}

/* Темная тема для окантовки по статусу */
[data-theme="dark"] .violation-card.enriched.status-resolved {
  border-left-color: #48bb78 !important;
  border-right-color: #38a169 !important;
}

/* ChatModal стили */
.chat-modal-header {
  background: #1f2937;
  color: #fff;
}

.chat-modal-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
}

.chat-tabs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-tab {
  padding: 12px;
  border-radius: 8px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  cursor: pointer;
}

.chat-tab.active {
  background: #0b5ed7;
}

.chat-messages {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  height: 360px;
  overflow-y: auto;
}

.chat-empty {
  color: var(--secondary-color);
}

.chat-message {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
}

.chat-message .meta {
  font-size: 12px;
  color: var(--secondary-color);
  margin-bottom: 4px;
}

.chat-message .text {
  font-size: 14px;
}

.chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.chat-input {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
}

@media (max-width: 768px) {
  .chat-modal-body {
    grid-template-columns: 1fr;
  }
}

[data-theme="dark"] .violation-card.enriched.status-open {
  border-left-color: #f6e05e !important;
  border-right-color: #d69e2e !important;
}

[data-theme="dark"] .violation-card.enriched.status-overdue {
  border-left-color: #f56565 !important;
  border-right-color: #e53e3e !important;
}

/* Темная тема для модальных окон */
[data-theme="dark"] .modal {
  background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .modal-content {
  background: #2d3748;
  border-color: #4a5568;
  color: #e2e8f0;
}

[data-theme="dark"] .modal-header {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  border-bottom-color: #4a5568;
}

[data-theme="dark"] .modal-header h2 {
  color: #4299e1;
}

[data-theme="dark"] .modal-body {
  background: #2d3748;
}

[data-theme="dark"] .modal-footer {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  border-top-color: #4a5568;
}

[data-theme="dark"] .form-group label {
  color: #e2e8f0;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
  background: #4a5568;
  border-color: #4a5568;
  color: #e2e8f0;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

[data-theme="dark"] .violation-info-section,
[data-theme="dark"] .edit-fields-section,
[data-theme="dark"] .geolocation-section {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  border-left-color: #4299e1;
}

[data-theme="dark"] .violation-info-section h4,
[data-theme="dark"] .edit-fields-section h4,
[data-theme="dark"] .geolocation-section h4 {
  color: #4299e1;
}

[data-theme="dark"] .info-item {
  border-bottom-color: #4a5568;
}

[data-theme="dark"] .info-item label {
  color: #a0aec0;
}

/* Темная тема для элементов управления в секциях */
[data-theme="dark"] .section-actions select {
  background: #4a5568;
  border-color: #4a5568;
  color: #e2e8f0;
}

[data-theme="dark"] .section-actions select:hover {
  border-color: #4299e1;
  background: #2a4365;
}

[data-theme="dark"] .section-actions select:focus {
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
  background: #2a4365;
}

[data-theme="dark"] #ganttObjectFilter,
[data-theme="dark"] #ganttScale {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  border-color: #4a5568;
  color: #e2e8f0;
}

[data-theme="dark"] #ganttObjectFilter:hover,
[data-theme="dark"] #ganttScale:hover {
  border-color: #4299e1;
  background: linear-gradient(135deg, #2a4365 0%, #2c5282 100%);
}

/* Стили для select'ов в модальных окнах - компактные */
#ganttModalScale,
#foremanSelect {
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 500;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  color: #333;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  width: 100%;
}

#ganttModalScale:hover,
#foremanSelect:hover {
  border-color: #2979ff;
  background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(41, 121, 255, 0.15);
}

#ganttModalScale:focus,
#foremanSelect:focus {
  outline: none;
  border-color: #2979ff;
  box-shadow: 0 0 0 3px rgba(41, 121, 255, 0.1);
  background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%);
}

/* Темная тема для select'ов в модальных окнах */
[data-theme="dark"] #ganttModalScale,
[data-theme="dark"] #foremanSelect {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  border-color: #4a5568;
  color: #e2e8f0;
}

[data-theme="dark"] #ganttModalScale:hover,
[data-theme="dark"] #foremanSelect:hover {
  border-color: #4299e1;
  background: linear-gradient(135deg, #2a4365 0%, #2c5282 100%);
}

[data-theme="dark"] #ganttModalScale:focus,
[data-theme="dark"] #foremanSelect:focus {
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
  background: linear-gradient(135deg, #2a4365 0%, #2c5282 100%);
}

/* Специальные модальные окна - модернизированные */
.edit-violation-modal {
  max-width: 600px;
  width: 90%;
}

.violation-info-section,
.edit-fields-section,
.geolocation-section {
  margin-bottom: 28px;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 12px;
  border-left: 4px solid #2979ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.violation-info-section h4,
.edit-fields-section h4,
.geolocation-section h4 {
  margin: 0 0 16px 0;
  color: #2979ff;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
  font-family: 'Montserrat', sans-serif;
}

.info-item:last-child {
  border-bottom: none;
}

.info-item label {
  font-weight: 500;
  color: #666;
  margin-right: 16px;
  font-size: 14px;
}

.info-value {
  font-weight: 600;
  color: #333;
  text-align: right;
  flex: 1;
  font-size: 14px;
}

.violation-info-section,
.edit-fields-section,
.geolocation-section {
  margin-bottom: 25px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.violation-info-section h4,
.edit-fields-section h4,
.geolocation-section h4 {
  margin: 0 0 15px 0;
  color: var(--primary-color);
  font-size: 1.1rem;
  font-weight: 600;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #e0e0e0;
}

.info-item:last-child {
  border-bottom: none;
}

.info-item label {
  font-weight: 500;
  color: var(--secondary-color);
  margin-right: 15px;
}

.info-value {
  font-weight: 600;
  color: var(--dark-color);
  text-align: right;
  flex: 1;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--dark-color);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

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

.checkbox-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  font-weight: 500;
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin-right: 10px;
  margin-top: 2px;
}

.geolocation-info {
  margin-top: 8px;
  padding: 8px 12px;
  background: #e3f2fd;
  border-radius: 4px;
  border-left: 3px solid var(--info-color);
}

.geolocation-info small {
  color: var(--info-color);
  font-weight: 500;
}

.current-location {
  margin-top: 15px;
  padding: 12px;
  background: #e8f5e8;
  border-radius: 6px;
  border-left: 3px solid var(--success-color);
}

.current-location label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--success-color);
}

.location-coords {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--dark-color);
  font-weight: 600;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.modal-actions .btn {
  min-width: 120px;
}

/* Темная тема для модального окна редактирования */
[data-theme="dark"] .violation-info-section,
[data-theme="dark"] .edit-fields-section,
[data-theme="dark"] .geolocation-section {
  background: #2d3748;
  border-left-color: #4299e1;
}

[data-theme="dark"] .info-item {
  border-bottom-color: #4a5568;
}

[data-theme="dark"] .info-item label {
  color: #a0aec0;
}

[data-theme="dark"] .info-value {
  color: var(--light-color);
}

[data-theme="dark"] .form-group label {
  color: var(--light-color);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
  background: #4a5568;
  border-color: #4a5568;
  color: var(--light-color);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus {
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

[data-theme="dark"] .geolocation-info {
  background: #2a4365;
  border-left-color: #3182ce;
}

[data-theme="dark"] .geolocation-info small {
  color: #90cdf4;
}

[data-theme="dark"] .current-location {
  background: #2f855a;
  border-left-color: #38a169;
}

[data-theme="dark"] .current-location label {
  color: #68d391;
}

[data-theme="dark"] .location-coords {
  color: var(--light-color);
}

[data-theme="dark"] .modal-actions {
  border-top-color: #4a5568;
}

/* Старые стили удалены - теперь используется стандартная система QRTTNModal */

/* Старые стили удалены - теперь используется стандартная система QRTTNModal */

/* Стили для выпадающего списка статусов */
.status-dropdown {
  display: inline-block;
  margin-left: 8px;
}

.status-select {
  padding: 6px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  background: white;
  color: var(--dark-color);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 180px;
}

.status-select:hover {
  border-color: var(--primary-color);
}

.status-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.status-select option {
  padding: 8px 12px;
  background: white;
  color: var(--dark-color);
}

.status-select option:disabled {
  color: #999;
  background: #f5f5f5;
}

/* Темная тема для выпадающего списка */
[data-theme="dark"] .status-select {
  background: #4a5568;
  border-color: #4a5568;
  color: var(--light-color);
}

[data-theme="dark"] .status-select:hover {
  border-color: #4299e1;
}

[data-theme="dark"] .status-select:focus {
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

[data-theme="dark"] .status-select option {
  background: #4a5568;
  color: var(--light-color);
}

[data-theme="dark"] .status-select option:disabled {
  color: #666;
  background: #2d3748;
}

/* Стили для модального окна изменения статуса */
.status-change-modal {
  max-width: 500px;
  width: 90%;
}

.status-selection-section {
  margin-bottom: 25px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid var(--success-color);
}

.status-selection-section h4 {
  margin: 0 0 15px 0;
  color: var(--success-color);
  font-size: 1.1rem;
  font-weight: 600;
}

.status-current {
  font-weight: bold;
  color: var(--primary-color);
  text-transform: uppercase;
}

/* Темная тема для модального окна изменения статуса */
[data-theme="dark"] .status-selection-section {
  background: #2d3748;
  border-left-color: #38a169;
}

[data-theme="dark"] .status-selection-section h4 {
  color: #68d391;
}

[data-theme="dark"] .status-current {
  color: #4299e1;
}

/* Стили для ролей пользователей в чате */
.user-role {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
  margin-left: 8px;
  text-transform: uppercase;
}

.user-role.system {
  background: #6c757d;
  color: white;
}

.user-role.admin {
  background: #dc3545;
  color: white;
}

.user-role.customer_control {
  background: #007bff;
  color: white;
}

.user-role.foreman {
  background: #28a745;
  color: white;
}

.user-role.control_inspector {
  background: #ffc107;
  color: #212529;
}

.user-role.user {
  background: #e9ecef;
  color: #495057;
}

/* Темная тема для ролей пользователей */
[data-theme="dark"] .user-role.system {
  background: #6c757d;
  color: white;
}

[data-theme="dark"] .user-role.admin {
  background: #dc3545;
  color: white;
}

[data-theme="dark"] .user-role.customer_control {
  background: #007bff;
  color: white;
}

[data-theme="dark"] .user-role.foreman {
  background: #28a745;
  color: white;
}

[data-theme="dark"] .user-role.control_inspector {
  background: #ffc107;
  color: #212529;
}

[data-theme="dark"] .user-role.user {
  background: #495057;
  color: #e9ecef;
}

/* Стили для журнала работ - модернизированные бейджи */
.status-badge {
  padding: 4px 8px;
  border-radius: 16px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

/* Компактные кнопки действий только с иконками */
.action-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 12px;
  margin: 0 2px;
}

.action-icon-btn.view {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  color: white;
}

.action-icon-btn.view:hover {
  background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.action-icon-btn.verify {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
}

.action-icon-btn.verify:hover {
  background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.action-icon-btn i {
  font-size: 11px;
}

/* Компактные координаты */
.coordinates-compact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 12px;
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.2px;
}

.coordinates-compact.no-coords {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  border: 1px solid #f1aeb5;
}

.coordinates-compact i {
  font-size: 8px;
}

.status-badge.status-in_progress {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  color: #856404;
  border: 1px solid #f0d000;
}

.status-badge.status-completed {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
  border: 1px solid #28a745;
}

.status-badge.status-verified {
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  color: #0c5460;
  border: 1px solid #17a2b8;
}

.status-badge.status-rejected {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  border: 1px solid #dc3545;
}

.status-badge.status-pending {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  color: #856404;
  border: 1px solid #ffc107;
}

.status-badge.status-no-coords {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  border: 1px solid #dc3545;
}

.status-badge i {
  font-size: 8px;
  margin-right: 2px;
}

/* Темная тема для компактных элементов */
[data-theme="dark"] .action-icon-btn.view {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  color: #e2e8f0;
}

[data-theme="dark"] .action-icon-btn.view:hover {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}

[data-theme="dark"] .action-icon-btn.verify {
  background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
  color: #e2e8f0;
}

[data-theme="dark"] .action-icon-btn.verify:hover {
  background: linear-gradient(135deg, #2f855a 0%, #276749 100%);
}

[data-theme="dark"] .coordinates-compact.no-coords {
  background: linear-gradient(135deg, #742a2a 0%, #5c1a1a 100%);
  color: #fed7d7;
  border-color: #e53e3e;
}

/* Стили для таблицы журнала работ - модернизированные */
#workLogTable {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  font-family: 'Montserrat', sans-serif;
}

#workLogTable thead {
  background: linear-gradient(135deg, #bcd3ee 0%, #5ca4ff 100%);
  color: white;
}

#workLogTable thead th {
  padding: 16px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #2979ff;
}

#workLogTable tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.3s ease;
}

#workLogTable tbody tr:nth-child(even) {
  background: #f0f7ff;
}

/* Скрытие атрибуции Leaflet карты */
.leaflet-control-attribution {
  display: none !important;
}

/* Альтернативно: можно обрезать карту снизу */
.map-container {
  overflow: hidden;
  position: relative;
}

.map-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: var(--bg-color, #ffffff);
  z-index: 1000;
}

#workLogTable tbody tr:hover {
  background: linear-gradient(135deg, #e3f2fd 0%, #f0f7ff 100%);
  transform: scale(1.01);
  box-shadow: 0 2px 8px rgba(41, 121, 255, 0.15);
}

#workLogTable tbody td {
  padding: 14px 12px;
  font-size: 14px;
  vertical-align: middle;
  font-family: 'Montserrat', sans-serif;
  color: #333;
}

#workLogTable .no-data {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 40px 20px;
  background: #f8f9fa;
}

/* Темная тема для элементов управления во всех секциях */
[data-theme="dark"] .section-actions select {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
  border-color: #4a5568 !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .section-actions select:hover {
  border-color: #4299e1 !important;
  background: linear-gradient(135deg, #2a4365 0%, #2c5282 100%) !important;
}

[data-theme="dark"] .section-actions select:focus {
  border-color: #4299e1 !important;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1) !important;
  background: linear-gradient(135deg, #2a4365 0%, #2c5282 100%) !important;
}

/* Специальные стили для диаграммы Ганта в темной теме */
[data-theme="dark"] #gantt-section .section-actions select {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
  border-color: #4a5568 !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] #gantt-section .section-actions select:hover {
  border-color: #4299e1 !important;
  background: linear-gradient(135deg, #2a4365 0%, #2c5282 100%) !important;
}

[data-theme="dark"] #gantt-section .section-actions select:focus {
  border-color: #4299e1 !important;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1) !important;
  background: linear-gradient(135deg, #2a4365 0%, #2c5282 100%) !important;
}

[data-theme="dark"] #gantt-section #ganttObjectFilter,
[data-theme="dark"] #gantt-section #ganttScale {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
  border-color: #4a5568 !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] #gantt-section #ganttObjectFilter:hover,
[data-theme="dark"] #gantt-section #ganttScale:hover {
  border-color: #4299e1 !important;
  background: linear-gradient(135deg, #2a4365 0%, #2c5282 100%) !important;
}

[data-theme="dark"] #gantt-section #ganttObjectFilter:focus,
[data-theme="dark"] #gantt-section #ganttScale:focus {
  border-color: #4299e1 !important;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1) !important;
  background: linear-gradient(135deg, #2a4365 0%, #2c5282 100%) !important;
}


/* Стили для бейджей валидации координат */
.validation-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.validation-badge.validated-inside {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.validation-badge.validated-nearby {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.validation-badge.validated-far {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.validation-badge.no-coordinates {
    background: #e2e3e5;
    color: #6c757d;
    border: 1px solid #d6d8db;
}

.validation-badge.not-validated {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

/* Стили для бейджей источников данных */
.source-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.source-badge.source-ocr {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.source-badge.source-qr {
    background: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #e1bee7;
}

.source-badge.source-unknown {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Стили для статусов превышения объемов */
.status-normal {
    color: #28a745;
    font-weight: 600;
}

.status-warning {
    color: #ffc107;
    font-weight: 600;
}

.status-danger {
    color: #dc3545;
    font-weight: 600;
}

/* Темная тема для бейджей */
[data-theme="dark"] .validation-badge.validated-inside {
    background: #1e4d2b;
    color: #a3d9a4;
    border-color: #2d5a3d;
}

[data-theme="dark"] .validation-badge.validated-nearby {
    background: #4d3d00;
    color: #ffd700;
    border-color: #6b5b00;
}

[data-theme="dark"] .validation-badge.validated-far {
    background: #4d1a1a;
    color: #ff6b6b;
    border-color: #6b2a2a;
}

[data-theme="dark"] .validation-badge.no-coordinates {
    background: #3a3a3a;
    color: #a0a0a0;
    border-color: #4a4a4a;
}

[data-theme="dark"] .validation-badge.not-validated {
    background: #2a2a2a;
    color: #888888;
    border-color: #3a3a3a;
}

[data-theme="dark"] .source-badge.source-ocr {
    background: #1a237e;
    color: #90caf9;
    border-color: #283593;
}

[data-theme="dark"] .source-badge.source-qr {
    background: #4a148c;
    color: #ce93d8;
    border-color: #6a1b9a;
}

[data-theme="dark"] .source-badge.source-unknown {
    background: #b71c1c;
    color: #ffcdd2;
    border-color: #d32f2f;
}

/* Темная тема для панели фильтров */
[data-theme="dark"] .filters-panel {
    background: #2d3748;
    border-color: #4a5568;
}

[data-theme="dark"] .filters-panel select,
[data-theme="dark"] .filters-panel input[type="text"] {
    background: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
}

[data-theme="dark"] .filters-panel select:hover,
[data-theme="dark"] .filters-panel input[type="text"]:hover {
    border-color: #63b3ed;
    box-shadow: 0 0 0 0.2rem rgba(99, 179, 237, 0.25);
}

[data-theme="dark"] .filters-panel select:focus,
[data-theme="dark"] .filters-panel input[type="text"]:focus {
    border-color: #63b3ed;
    box-shadow: 0 0 0 0.2rem rgba(99, 179, 237, 0.25);
}

/* Темная тема для таблицы журнала входного контроля */
[data-theme="dark"] .input-control-table-container {
    background: #2d3748;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    overflow: auto;
    max-height: 600px;
}

[data-theme="dark"] .input-control-table tbody tr {
    border-bottom-color: #4a5568;
}

[data-theme="dark"] .input-control-table tbody tr:hover {
    background-color: #4a5568;
}

[data-theme="dark"] .input-control-table tbody tr:nth-child(even) {
    background-color: #4a5568;
}

[data-theme="dark"] .input-control-table tbody tr:nth-child(even):hover {
    background-color: #718096;
}

[data-theme="dark"] .input-control-table tbody td {
    color: #e2e8f0;
    border-right-color: #4a5568;
}

/* Темная тема для статусов превышения */
[data-theme="dark"] .input-control-table .status-badge.status-normal {
    background: #38a169;
    color: white;
}

[data-theme="dark"] .input-control-table .status-badge.status-excess {
    background: #d69e2e;
    color: #1a202c;
}

[data-theme="dark"] .input-control-table .status-badge.status-critical_excess {
    background: #e53e3e;
    color: white;
}

