/* LNA System styles */

body {
  background-color: #f8f9fa;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Dashboard cards */
.stat-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.stat-card .card-body {
  padding: 1.5rem;
}
.stat-card .stat-icon {
  font-size: 2.5rem;
  opacity: 0.7;
}
.stat-card .stat-number {
  font-size: 2rem;
  font-weight: 700;
}

/* Risk badges */
.badge-risk-high { background-color: #dc3545; }
.badge-risk-critical { background-color: #dc3545; }
.badge-risk-major { background-color: #fd7e14; }
.badge-risk-medium { background-color: #ffc107; color: #000; }
.badge-risk-minor { background-color: #198754; }
.badge-risk-low { background-color: #198754; }

/* Analysis type badges */
.badge-type { font-size: 0.8rem; font-weight: 500; }

/* Coverage bar */
.coverage-bar {
  height: 24px;
  border-radius: 12px;
  overflow: hidden;
}

/* Table improvements */
.table-lna th {
  background-color: #f1f3f5;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #dee2e6;
}

/* Document content preview */
.content-preview {
  max-height: 400px;
  overflow-y: auto;
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  font-family: 'Consolas', monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Sidebar filters */
.filter-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Function cards */
.function-card {
  border-left: 4px solid #0d6efd;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.function-card.no-actor { border-left-color: #dc3545; }
.function-card.no-orchestrator { border-left-color: #ffc107; }

/* Contradiction severity */
.contradiction-critical { border-left: 4px solid #dc3545; }
.contradiction-major { border-left: 4px solid #fd7e14; }
.contradiction-minor { border-left: 4px solid #198754; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
}
.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

/* --- Поиск по пунктам --- */

/* Результат поиска */
.search-result-item {
  padding: 1rem 1.25rem;
}
.search-result-item:hover {
  background-color: #f8f9fa;
}
.search-result-number .badge {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Подсветка найденной фразы */
.search-result-text mark {
  background-color: #fff3cd;
  padding: 0.1em 0.2em;
  border-radius: 3px;
  font-weight: 600;
}

/* Иерархический путь */
.hierarchy-path {
  font-size: 0.8rem;
  color: #6c757d;
  font-family: 'Consolas', monospace;
}

/* LLM-переключатель */
.llm-switch .form-check-input {
  width: 3em;
  height: 1.5em;
  cursor: pointer;
}
.llm-switch .form-check-input:checked {
  background-color: #6f42c1;
  border-color: #6f42c1;
}
.llm-switch .form-check-label {
  cursor: pointer;
}
.llm-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6f42c1, #0d6efd);
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.llm-switch .form-check-input:checked ~ .form-check-label .llm-icon-wrapper {
  background: linear-gradient(135deg, #6f42c1, #e040fb);
  box-shadow: 0 0 10px rgba(111, 66, 193, 0.5);
}

/* LLM-ответ */
.llm-answer-card {
  border-left: 4px solid #0d6efd;
}
.llm-answer-card .card-header {
  background-color: #e8f0fe;
  border-bottom: 1px solid #d0e0fc;
}
.llm-answer-text {
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Текст результата поиска */
.search-result-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #333;
}

/* --- Autocomplete-фильтры --- */

.autocomplete-filter {
  position: relative;
}

.autocomplete-filter .autocomplete-input {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.selected-chips:empty + .autocomplete-input {
  border-radius: 0.375rem;
}

.selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 6px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-bottom: none;
  border-radius: 0.375rem 0.375rem 0 0;
  min-height: 0;
}

.selected-chips:empty {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #0d6efd;
  color: #fff;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.chip-remove:hover {
  color: #fff;
}

.autocomplete-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  background: #fff;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 0.375rem 0.375rem;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.autocomplete-dropdown.show {
  display: block;
}

.autocomplete-item {
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background-color: #0d6efd;
  color: #fff;
}

.autocomplete-empty {
  padding: 8px 12px;
  color: #6c757d;
  font-size: 0.85rem;
  text-align: center;
}

/* --- Login page --- */

.login-page {
  background: linear-gradient(135deg, #1a1c2c 0%, #2d3436 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 1rem;
}

.login-card {
  border: none;
  border-radius: 12px;
}

.login-logo {
  font-size: 3rem;
  color: #0d6efd;
}
