/* Color Palette Variables */
:root {
  --primary-light: #f4f6ff;
  --primary-yellow: #f3c623;
  --primary-orange: #eb8317;
  --primary-dark: #10375c;
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --medium-gray: #6c757d;
  --success-green: #198754;
  --danger-red: #dc3545;
  --shadow-light: rgba(16, 55, 92, 0.1);
  --shadow-medium: rgba(16, 55, 92, 0.15);
  --shadow-dark: rgba(16, 55, 92, 0.25);
}

/* Base Styles */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif !important;
  background-color: var(--primary-light) !important;
  color: var(--primary-dark) !important;
  line-height: 1.6 !important;
}

/* Navbar Styles */
.navbar.navbar-custom {
  background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--primary-orange) 100%) !important;
  box-shadow: 0 4px 20px var(--shadow-medium) !important;
  padding: 1rem 0 !important;
}

.navbar.navbar-custom .navbar-brand {
  color: var(--primary-dark) !important;
  font-weight: 800 !important;
  font-size: 1.75rem !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
}

.navbar.navbar-custom .navbar-brand:hover,
.navbar.navbar-custom .navbar-brand:focus {
  color: var(--white) !important;
  transform: translateY(-2px) !important;
  text-decoration: none !important;
}

.navbar.navbar-custom .brand-text {
  font-weight: 800 !important;
  letter-spacing: -0.5px !important;
}

.navbar.navbar-custom .navbar-nav .nav-link {
  color: var(--primary-dark) !important;
  font-weight: 600 !important;
  margin: 0 0.5rem !important;
  padding: 0.75rem 1.25rem !important;
  border-radius: 0.75rem !important;
  transition: all 0.3s ease !important;
  position: relative !important;
}

.navbar.navbar-custom .navbar-nav .nav-link:hover,
.navbar.navbar-custom .navbar-nav .nav-link:focus {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: var(--white) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 15px var(--shadow-light) !important;
}

.navbar.navbar-custom .navbar-nav .nav-link.active {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: var(--primary-dark) !important;
  box-shadow: 0 4px 15px var(--shadow-light) !important;
}

/* User Menu Button */
.navbar.navbar-custom .btn-user-menu {
  background-color: var(--primary-dark) !important;
  color: var(--white) !important;
  border: none !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: 0.75rem !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 10px var(--shadow-light) !important;
}

.navbar.navbar-custom .btn-user-menu:hover,
.navbar.navbar-custom .btn-user-menu:focus {
  background-color: var(--primary-light) !important;
  color: var(--primary-dark) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 20px var(--shadow-medium) !important;
  border-color: transparent !important;
}

.navbar.navbar-custom .btn-admin-menu {
  background-color: var(--primary-dark) !important;
  color: var(--white) !important;
  border: none !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: 0.75rem !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 10px rgba(16, 55, 92, 0.3) !important;
}

.navbar.navbar-custom .btn-admin-menu:hover,
.navbar.navbar-custom .btn-admin-menu:focus {
  background-color: #0f3460 !important;
  color: var(--white) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 20px rgba(16, 55, 92, 0.4) !important;
  border-color: transparent !important;
}

/* Login Button */
.navbar.navbar-custom .btn-login {
  background-color: var(--primary-dark) !important;
  color: var(--white) !important;
  border: none !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: 0.75rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 10px var(--shadow-light) !important;
  display: inline-block !important;
}

.navbar.navbar-custom .btn-login:hover,
.navbar.navbar-custom .btn-login:focus {
  background-color: var(--primary-light) !important;
  color: var(--primary-dark) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 20px var(--shadow-medium) !important;
  text-decoration: none !important;
}

/* Dropdown Menu */
.navbar.navbar-custom .dropdown-menu {
  border: none !important;
  box-shadow: 0 8px 30px var(--shadow-medium) !important;
  border-radius: 0.75rem !important;
  padding: 0.75rem 0 !important;
  background-color: var(--white) !important;
  margin-top: 0.5rem !important;
}

.navbar.navbar-custom .dropdown-item {
  padding: 0.75rem 1.5rem !important;
  font-weight: 500 !important;
  color: var(--primary-dark) !important;
}

.navbar.navbar-custom .dropdown-item:hover,
.navbar.navbar-custom .dropdown-item:focus {
  background-color: var(--primary-light) !important;
  color: var(--primary-dark) !important;
}

.navbar.navbar-custom .dropdown-divider {
  margin: 0.5rem 1rem !important;
  border-color: var(--primary-light) !important;
}

/* Mobile Navbar Toggle */
.navbar.navbar-custom .navbar-toggler {
  border: 2px solid var(--primary-dark) !important;
  padding: 0.5rem !important;
  border-radius: 0.5rem !important;
}

.navbar.navbar-custom .navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(16, 55, 92, 0.25) !important;
}

.navbar.navbar-custom .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2816, 55, 92, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Alert Styles */
.alert {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 4px 20px var(--shadow-light);
  border-left: 4px solid;
}

.alert-success {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  border-left-color: var(--success-green);
}

.alert-error,
.alert-danger {
  background-color: #fef2f2;
  color: #dc2626;
  border-left-color: var(--danger-red);
}

.alert-warning {
  background-color: #fffbeb;
  color: #d97706;
  border-left-color: var(--primary-orange);
}

.alert-info {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  border-left-color: var(--primary-yellow);
}

/* Footer */
.footer {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #0d2a47 100%);
  color: var(--primary-light);
}

.footer span {
  font-weight: 500;
  opacity: 0.9;
}

/* Button Styles */
.btn.btn-primary {
  background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--primary-orange) 100%) !important;
  border: none !important;
  color: var(--primary-dark) !important;
  font-weight: 600 !important;
  padding: 0.75rem 2rem !important;
  border-radius: 0.75rem !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px var(--shadow-light) !important;
}

.btn.btn-primary:hover,
.btn.btn-primary:focus {
  background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-yellow) 100%) !important;
  color: var(--primary-dark) !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 6px 25px var(--shadow-medium) !important;
  border-color: transparent !important;
}

.btn.btn-secondary {
  background-color: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
  color: var(--white) !important;
  font-weight: 600 !important;
  padding: 0.75rem 2rem !important;
  border-radius: 0.75rem !important;
  transition: all 0.3s ease !important;
}

.btn.btn-secondary:hover,
.btn.btn-secondary:focus {
  background-color: var(--primary-light) !important;
  border-color: var(--primary-light) !important;
  color: var(--primary-dark) !important;
  transform: translateY(-2px) !important;
}

.btn.btn-success {
  background: #16a34a !important;
  border: none !important;
  color: var(--white) !important;
  font-weight: 600 !important;
  padding: 0.75rem 2rem !important;
  border-radius: 0.75rem !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3) !important;
}

.btn.btn-success:hover,
.btn.btn-success:focus {
  background: linear-gradient(135deg, var(--success-green, #16a34a) 0%, var(--success-green-light, #4ade80) 100%) !important;
  color: var(--success-dark, #064e3b) !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 6px 25px rgba(22, 163, 74, 0.45) !important;
  border-color: transparent !important;
}

.btn.btn-grey {
  background-color: var(--medium-gray) !important;
  border-color: var(--medium-gray) !important;
  color: var(--white) !important;
  font-weight: 600 !important;
  padding: 0.75rem 2rem !important;
  border-radius: 0.75rem !important;
  transition: all 0.3s ease !important;
}

.btn.btn-grey:hover,
.btn.btn-grey:focus {
  background-color: var(--light-gray) !important;
  border-color: var(--light-gray) !important;
  color: var(--white) !important;
  transform: translateY(-2px) !important;
}

/* Added danger button styling for logout confirmation */
.btn.btn-danger {
  background-color: var(--danger-red) !important;
  border-color: var(--danger-red) !important;
  color: var(--white) !important;
  font-weight: 600 !important;
  padding: 0.75rem 2rem !important;
  border-radius: 0.75rem !important;
  transition: all 0.3s ease !important;
}

.btn.btn-danger:hover,
.btn.btn-danger:focus {
  background-color: #c82333 !important;
  border-color: #c82333 !important;
  color: var(--white) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3) !important;
}

/* Card Styles */
.card {
  border: none;
  border-radius: 1.25rem;
  box-shadow: 0 4px 25px var(--shadow-light);
  background-color: var(--white);
}


.card-header {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
  border-bottom: 2px solid var(--primary-yellow);
  border-radius: 1.25rem 1.25rem 0 0 !important;
  font-weight: 600;
  color: var(--primary-dark);
}

/* Form Styles */
.form-control {
  border: 2px solid var(--primary-light);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: var(--white);
}

.form-control:focus {
  border-color: var(--primary-yellow);
  box-shadow: 0 0 0 0.2rem rgba(243, 198, 35, 0.25);
  background-color: var(--white);
}

.form-label {
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.form-label .badge {
  font-size: 0.7rem;
  vertical-align: middle;
}

/* Invalid form control styling */
.form-control.is-invalid {
  border-color: var(--danger-red) !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.form-control.is-invalid:focus {
  border-color: var(--danger-red) !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Field Error Styles */
.field-error {
  color: var(--danger-red) !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  display: flex !important;
  align-items: center !important;
  margin-top: 0.5rem !important;
  padding: 0.5rem 0.75rem !important;
  background-color: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  border-radius: 0.5rem !important;
  animation: slideIn 0.3s ease-out, shake 0.5s ease-in-out !important;
}

.field-error i {
  margin-right: 0.5rem !important;
  font-size: 1rem !important;
}

/* Modal Styles */
.modal-content {
  border: none !important;
  border-radius: 1.25rem !important;
  box-shadow: 0 10px 50px var(--shadow-dark) !important;
  background-color: var(--white) !important;
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%) !important;
  border-bottom: 2px solid var(--primary-yellow) !important;
  border-radius: 1.25rem 1.25rem 0 0 !important;
  padding: 1.5rem !important;
}

.modal-title {
  color: var(--primary-dark) !important;
  font-weight: 700 !important;
  font-size: 1.25rem !important;
}

.modal-body {
  padding: 2rem 1.5rem !important;
  color: var(--primary-dark) !important;
  font-size: 1.1rem !important;
  line-height: 1.6 !important;
}

.modal-footer {
  border-top: none !important;
  padding: 1rem 1.5rem 1.5rem !important;
  gap: 1rem !important;
}

.modal-backdrop {
  background-color: rgba(16, 55, 92, 0.5) !important;
}

.modal-xl {
    max-width: 1140px;
}

.modal-lg {
    max-width: 900px;
}

.modal-body .form-control,
.modal-body .form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    transition: all 0.3s ease;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 0.2rem rgba(243, 198, 35, 0.25);
}

.modal-body textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.btn-close {
  background-color: transparent !important;
  border: none !important;
  font-size: 1.25rem !important;
  opacity: 0.7 !important;
  transition: all 0.3s ease !important;
}

.btn-close:hover,
.btn-close:focus {
  opacity: 1 !important;
  transform: scale(1.1) !important;
}

/* Dashboard Styles */
.dashboard-container {
  width: 95%;
  margin: 0 auto;
  padding: 0 1rem;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 100vh;
  position: relative;
  z-index: 0 !important;
}

.dashboard-header {
  background: linear-gradient(135deg, var(--white) 0%, var(--primary-light) 100%);
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 4px 25px var(--shadow-light);
  margin-bottom: 2rem;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.dashboard-title {
  color: var(--primary-dark) !important;
  font-weight: 800 !important;
  font-size: 2.5rem !important;
  margin-bottom: 0.5rem !important;
  display: flex;
  align-items: center;
}

.dashboard-subtitle {
  color: var(--medium-gray) !important;
  font-size: 1.1rem !important;
  margin-bottom: 0 !important;
}

/* Stats Cards */
.stats-card {
  background: linear-gradient(135deg, var(--white) 0%, var(--primary-light) 100%);
  border: 2px solid transparent;
  border-radius: 1.25rem;
  display: flex !important;
  align-items: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  padding: 1.5rem;
  box-shadow: 0 4px 20px var(--shadow-light);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  gap: 1rem;
}

.stats-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--primary-orange) 100%);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.stats-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 50px var(--shadow-medium);
  border-color: var(--primary-yellow);
}

.stats-card:hover::before {
  transform: scaleX(1);
}

.stats-card.selected {
  border: 2px solid var(--primary-orange) !important;
  box-shadow: 0 8px 30px rgba(235, 131, 23, 0.3) !important;
  transform: translateY(-5px) scale(1.02) !important;
}

.stats-card.selected::before {
  transform: scaleX(1) !important;
  background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-yellow) 100%) !important;
  height: 6px !important;
}

.stats-icon {
  width: 70px;
  height: 70px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--primary-orange) 100%);
  box-shadow: 0 4px 15px var(--shadow-light);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.stats-icon.active {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.stats-icon.completed {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.stats-icon.pending {
  background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.stats-content {
  flex: 1;
  text-align: left;
}

.stats-content h3 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 0;
  line-height: 1;
}

.stats-content p {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--medium-gray);
  margin: 0.25rem 0 0 0;
  letter-spacing: 0.5px;
}

/* Investigations Section */
.investigations-section {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: var(--white);
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 4px 25px var(--shadow-light);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
  flex-direction: column;
  align-items: flex-start;
}

.section-header h2 {
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 0;
  display: flex;
  align-items: center;
}

.section-divider {
    border-bottom: 2px solid var(--primary-yellow);
    padding-bottom: 0.5rem;
}

.section-divider h6 {
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 0;
}

.search-filter-controls {
  position: relative;
  z-index: 10;
}

.search-filter-wrapper {
  background: linear-gradient(135deg, var(--white) 0%, var(--primary-light) 100%);
  border: 2px solid var(--primary-light);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 20px var(--shadow-light);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.search-filter-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--primary-orange) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.search-filter-wrapper:hover::before {
  opacity: 1;
}

.search-filter-wrapper:focus-within {
  border-color: var(--primary-yellow);
  box-shadow: 0 8px 30px rgba(243, 198, 35, 0.2);
  transform: translateY(-2px);
}

.search-filter-wrapper:focus-within::before {
  opacity: 1;
}

/* Enhanced Form Labels */
.search-filter-wrapper .form-label {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  letter-spacing: 0.3px;
}

.search-filter-wrapper .form-label i {
  color: var(--primary-orange);
  margin-right: 0.5rem;
}

/* Enhanced Select Styling */
.search-filter-wrapper .form-select {
  border: 2px solid var(--primary-light);
  border-radius: 0.75rem;
  background: var(--white);
  transition: all 0.3s ease;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
}

.search-filter-wrapper .form-select:focus {
  border-color: var(--primary-yellow);
  transform: translateY(-1px);
}

.custom-dropdown-select {
  border-radius: 0.75rem !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 16px 12px !important;
  padding-right: 2.5rem !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

.custom-rounded-input {
  border-radius: 0.75rem !important;
}
.custom-rounded-input-group .input-group-text:first-child {
  border-radius: 0.75rem 0 0 0.75rem !important;
}
.custom-rounded-input-group .form-control {
  border-radius: 0 !important;
}
.custom-rounded-input-group .btn:last-child {
  border-radius: 0 0.75rem 0.75rem 0 !important;
}

/* Search Results Info */
#search-results-info {
  background: rgba(243, 198, 35, 0.1);
  border: 1px solid rgba(243, 198, 35, 0.2);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  animation: slideDown 0.3s ease-out;
}

#search-results-info .bi-info-circle {
  color: var(--primary-orange);
  margin-left: 0.5rem;
}

/* Filter Tags */
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-tag {
  background: var(--primary-yellow);
  color: var(--primary-dark);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.3s ease-out;
}

.filter-tag .remove-tag {
  cursor: pointer;
  color: var(--primary-dark);
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.filter-tag .remove-tag:hover {
  opacity: 1;
}

/* Section Title Enhancement */
.section-title {
  margin-bottom: 0;
}

.section-title h2 {
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
}

.section-subtitle {
  color: var(--medium-gray);
  font-size: 1rem;
  margin: 0;
  font-weight: 400;
}

/* Quick Filters */
.quick-filters {
  background: var(--light-gray);
  border-radius: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--primary-light);
}

.filter-label {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  margin-right: 0.5rem;
}

.filter-btn {
  border-radius: 1.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
  border-width: 2px;
}

.filter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
  background: var(--primary-yellow) !important;
  border-color: var(--primary-yellow) !important;
  color: var(--primary-dark) !important;
  font-weight: 600;
}

.filter-btn i {
  font-size: 0.8rem;
}

/* View Controls */
.view-controls {
  background: var(--white);
  border-radius: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--primary-light);
  box-shadow: 0 2px 10px var(--shadow-light);
}

.view-toggle .btn-group .btn {
  border-color: var(--primary-light);
  color: var(--medium-gray);
  background: var(--white);
  transition: all 0.3s ease;
}

.view-toggle .btn-group .btn:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.view-toggle .btn-check:checked + .btn {
  background: var(--primary-yellow);
  border-color: var(--primary-yellow);
  color: var(--primary-dark);
}

.results-summary {
  font-weight: 500;
}

.progress-info {
  width: 150px;
}
.progress-info small {
  margin: 0;
  font-size: 0.75rem;
}

.progress {
  height: 6px;
  border-radius: 3px;
  background-color: var(--primary-light);
}

.progress-bar {
  background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--primary-orange) 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.empty-state {
  text-align: center;
  padding: 6rem 2rem;
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--white) 0%, var(--primary-light) 100%);
  border-radius: 0.5rem;
  border: 2px dashed var(--primary-yellow);
  position: relative;
  overflow: hidden;
}

.empty-state::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(243, 198, 35, 0.1) 0%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
}

.empty-icon {
  font-size: 5rem;
  color: var(--primary-orange);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
  animation: bounce 2s ease-in-out infinite;
}

.empty-state h3 {
  color: var(--primary-dark);
  margin-bottom: 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.empty-state p {
  color: var(--medium-gray);
  margin-bottom: 2.5rem;
  font-size: 1.2rem;
  position: relative;
  z-index: 1;
}

.empty-state .btn {
  position: relative;
  z-index: 1;
}

/* Table Base */
.custom-investigations-table {
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow-light);
}

/* Header */
.custom-investigations-table thead th {
  font-size: 0.9rem;
  letter-spacing: 0.2px;
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  text-align: center;
  padding: 0.75rem;
}

/* Cells */
.custom-investigations-table th, 
.custom-investigations-table td {
  vertical-align: middle;
  white-space: nowrap;
  border: 0.5px solid #dee2e6;
  padding: 0.75rem;
}

/* Text muted inside cells */
.custom-investigations-table td .text-muted {
  white-space: normal;
  color: #6c757d;
  font-size: 0.85rem;
}

/* Row hover effect */
.custom-investigations-table tbody tr:hover {
  background-color: #f1f7ff;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

/* Progress bar styling */
.custom-investigations-table .progress {
  background-color: #e9ecef;
  border-radius: 0.25rem;
}
.custom-investigations-table .progress-bar {
  border-radius: 0.25rem;
  transition: width 0.3s ease;
}

/* Action buttons */
.custom-investigations-table td .btn {
  min-width: 36px;
  border-radius: 0.35rem;
  transition: all 0.2s ease;
}
.custom-investigations-table td .btn:hover {
  transform: scale(1.05);
}

.badge {
  font-size: 0.85rem;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.badge:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Custom Why Tree Styles */
.why-tree-container {
    min-height: 500px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 20px;
    background-color: #f8f9fa;
}

.tree-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-badge {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    display: inline-block;
}

/* Root cause highlighting */
.jstree-node.root-cause > .jstree-anchor {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107;
    font-weight: bold;
}

/* Verified node */
.jstree-node.verified > .jstree-anchor {
    border-left: 4px solid #28a745;
}

/* Node by cause type */
.jstree-node.cause-physical > .jstree-anchor {
    color: #0d6efd;
}

.jstree-node.cause-human > .jstree-anchor {
    color: #dc3545;
}

.jstree-node.cause-system > .jstree-anchor {
    color: #6c757d;
}

.jstree-node.cause-procedure > .jstree-anchor {
    color: #fd7e14;
}

.jstree-node.cause-environmental > .jstree-anchor {
    color: #198754;
}

/* Context menu styling */
.jstree-contextmenu {
    z-index: 1050 !important;
}

/* Tree action buttons */
.tree-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* Node info panel */
.node-info-panel {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 20px;
    margin-top: 20px;
}

.node-info-empty {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 40px;
}


.investigation-progress-wrapper {
    background: linear-gradient(135deg, #ffffff 0%, #f4f6ff 100%);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.progress-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 0 0 auto;
    z-index: 2;
    transition: all 0.3s ease;
}

.step-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    border: 3px solid #e9ecef;
    transition: all 0.3s ease;
    font-size: 24px;
    color: #6c757d;
}

.progress-step.active .step-icon {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
    animation: pulse-active 2s ease-in-out infinite;
}

.progress-step.completed .step-icon {
    background: #198754;
    border-color: #198754;
    color: white;
}

.step-content {
    margin-top: 12px;
    text-align: center;
    min-width: 100px;
}

.step-title {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 2px;
}

.progress-step:not(.active):not(.completed) .step-title {
    color: #6c757d;
}

.step-subtitle {
    font-size: 12px;
    color: #6c757d;
    font-weight: 400;
}

.progress-line {
    flex: 1;
    height: 3px;
    background: #e9ecef;
    margin: 0 8px;
    position: relative;
    top: -30px;
    transition: background 0.3s ease;
}

.progress-line.completed {
    background: #198754;
}

/* Responsive */
@media (max-width: 768px) {
    .phase-body {
        padding: 1rem;
    }
    
    .section-body {
        padding: 1rem;
    }
    
    .phase-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .phase-title {
        font-size: 1.1rem;
    }
}

/* Animation for active step */
@keyframes pulse-active {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(13, 110, 253, 0.25);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .progress-stepper {
        flex-direction: column;
        align-items: flex-start;
    }

    .progress-step {
        flex-direction: row;
        width: 100%;
        margin-bottom: 16px;
    }

    .step-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
        margin-right: 12px;
    }

    .step-content {
        margin-top: 0;
        text-align: left;
        min-width: auto;
        flex: 1;
    }

    .progress-line {
        display: none;
    }

    /* Vertical connector line for mobile */
    .progress-step:not(:last-child)::after {
        content: '';
        position: absolute;
        left: 20px;
        top: 50px;
        width: 2px;
        height: 40px;
        background: #e9ecef;
    }

    .progress-step.completed:not(:last-child)::after {
        background: #198754;
    }
}

@media (max-width: 576px) {
    .investigation-progress-wrapper {
        padding: 16px 12px;
    }

    .step-title {
        font-size: 13px;
    }

    .step-subtitle {
        font-size: 11px;
    }
}

/* Scroll Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar.navbar-custom {
    padding: 0.75rem 0;
  }

  .navbar.navbar-custom .navbar-brand {
    font-size: 1.5rem;
  }

  .navbar.navbar-custom .navbar-collapse.collapse:not(.show) {
    display: none !important;
  }

  .navbar.navbar-custom .navbar-collapse.collapse.show {
    display: flex !important;
  }

  .navbar.navbar-custom .navbar-nav {
    width: 100%;
    text-align: center;
    margin-top: 1rem;
  }

  .navbar.navbar-custom .navbar-nav .nav-link {
    margin: 0.25rem 0;
    text-align: center;
    padding: 0.75rem 1rem;
  }

  .navbar.navbar-custom .btn-admin-menu,
  .navbar.navbar-custom .btn-login {
    width: 100%;
    margin-top: 1rem;
  }

  .navbar.navbar-custom .dropdown-menu {
    width: 100% !important;
    margin-top: 0.5rem !important;
  }

  .modal-dialog {
    margin: 1rem !important;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem !important;
  }

  .modal-footer {
    flex-direction: column !important;
  }

  .modal-footer .btn {
    width: 100% !important;
    margin-bottom: 0.5rem !important;
  }

  .dashboard-container {
    padding: 0 0.5rem;
    min-height: auto;
  }

  .dashboard-header {
    padding: 1.5rem;
    text-align: center;
  }

  .dashboard-title {
    font-size: 2rem !important;
    flex-direction: column;
    gap: 0.5rem;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .investigations-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stats-card {
    margin-bottom: 1rem;
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .stats-content {
    text-align: center;
  }

  .stats-content h3 {
    font-size: 1.5rem;
  }

  .investigation-card .card-header {
    padding: 0.75rem 1rem;
  }

  .investigation-card .card-body {
    padding: 1rem;
  }

  .investigation-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 576px) {
  .navbar.navbar-custom .navbar-brand {
    font-size: 1.25rem;
  }

  .navbar.navbar-custom .brand-text {
    display: none;
  }

  .dashboard-header {
    padding: 1rem;
  }

  .dashboard-title {
    font-size: 1.75rem !important;
  }

  .investigations-section {
    padding: 1rem;
  }

  .empty-state {
    padding: 2rem 1rem;
  }

  .empty-icon {
    font-size: 3rem;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

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

/* Loading Spinner Animation for HTMX requests */
.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Loading State Styles */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Error animation */
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.1;
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Explicit main content styling to ensure visibility */
#main-content {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 400px !important;
  position: relative;
  z-index: 1;
}

.container-fluid {
  display: block !important;
  visibility: visible !important;
  width: 100%;
}


.interview-card-compact {
    border-left: 4px solid #0d6efd;
    transition: all 0.2s ease;
}

.interview-card-compact:hover {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
    transform: translateX(2px);
}

/* Avatar Circle */
.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-circle i {
    font-size: 24px;
    color: white;
}

/* Badge Soft Variants */
.badge-soft-primary {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    border: 1px solid rgba(13, 110, 253, 0.2);
}

.badge-soft-secondary {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.2);
}

/* Interview Meta */
.interview-meta {
    line-height: 1.8;
}

.interview-meta i {
    width: 16px;
    font-size: 14px;
}

.question-block {
    padding-left: 0.5rem;
    border-left: 3px solid #e9ecef;
    transition: border-color 0.2s;
}

.question-block:hover {
    border-left-color: #0d6efd;
}

.question-answer {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-top: 0.5rem;
}

/* Compact spacing */
.interview-card-compact .card-body {
    padding: 1rem !important;
}

.interview-card-compact h6 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.interview-card-compact .small {
    font-size: 0.8rem;
}

/* Button group adjustments */
.interview-card-compact .btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .interview-card-compact .col-md-4 {
        margin-bottom: 1rem;
    }
    
    .interview-card-compact .col-md-4:last-child {
        margin-bottom: 0;
    }
    
    .interview-card-compact .d-flex.flex-column.align-items-end {
        align-items: start !important;
    }
}

.facts-category-container {
    min-height: 200px;
}

.nav-pills .nav-link {
    color: var(--primary-dark);
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.nav-pills .nav-link:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--primary-orange) 100%);
    color: var(--primary-dark);
    font-weight: 600;
}

.nav-pills .nav-link .badge {
    background: var(--primary-dark) !important;
    font-weight: 600;
}

.nav-pills .nav-link.active .badge {
    background: var(--white) !important;
    color: var(--primary-dark);
}

.list-group-item {
    border: 1px solid #e9ecef;
    border-radius: 8px !important;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background: var(--primary-light);
    border-color: var(--primary-yellow);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.fact-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}


#timeline-table {
    font-size: 0.875rem;
    border-collapse: separate;
    border-spacing: 0;
}

#timeline-table thead th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

/* Row Styling */
.timeline-row {
    transition: background-color 0.2s ease;
}

.timeline-row:hover {
    background-color: #f8f9fa;
}

.timeline-row td {
    padding: 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
}

/* Row Number Badge */
.timeline-row .badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35em 0.65em;
}

/* Form Controls - Subtle Focus */
#timeline-table .form-control,
#timeline-table .form-select {
    font-size: 0.875rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#timeline-table .form-control:focus,
#timeline-table .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
}

#timeline-table textarea.form-control {
    resize: vertical;
    min-height: 60px;
}

/* Buttons - Minimal Style */
#add-row-btn {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
    border-color: #0d6efd;
    color: #0d6efd;
    transition: all 0.15s ease;
}

#add-row-btn:hover {
    background-color: #0d6efd;
    color: white;
}

.remove-row-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.remove-row-btn:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* ============================================
   PROTECTION SYSTEMS (Phase 2.3)
   ============================================ */

.protection-list {
    display: grid;
    gap: 1rem;
}

.protection-card {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.protection-card:hover {
    border-color: var(--primary-yellow);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.protection-status {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border-left: 3px solid var(--primary-yellow);
}

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

.status-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.status-item.status-active {
    border-color: var(--primary-orange);
    background: linear-gradient(135deg, #fff8e1 0%, #ffffff 100%);
    font-weight: 600;
}

.status-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.status-label {
    font-size: 0.85rem;
    color: #495057;
    line-height: 1.3;
}

.status-item.status-active .status-label {
    color: var(--primary-dark);
    font-weight: 600;
}

/* Status Color Indicators */
.status-item.status-active:has(.text-success) {
    border-left: 4px solid #28a745;
}

.status-item.status-active:has(.text-warning) {
    border-left: 4px solid #ffc107;
}

.status-item.status-active:has(.text-danger) {
    border-left: 4px solid #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
    .status-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PHASE 3: ROOT CAUSE ANALYSIS
   ============================================ */

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--primary-yellow);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #ffffff;
    flex-shrink: 0;
}

.stat-card .stat-icon.bg-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

.stat-card .stat-icon.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
}

.stat-card .stat-icon.bg-success {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
}

.stat-card .stat-icon.bg-info {
    background: linear-gradient(135deg, #0dcaf0 0%, #0aa2c0 100%);
}

.stat-card .stat-content {
    flex: 1;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--medium-gray);
    margin-top: 0.25rem;
    font-weight: 500;
}

.root-causes-preview {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    border-left: 4px solid var(--primary-orange);
}

.root-causes-preview .list-group-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: #ffffff;
}

.root-causes-preview .list-group-item:last-child {
    margin-bottom: 0;
}

.action-summary-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.action-summary-card:hover {
    border-color: var(--primary-yellow);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.summary-header {
    background: linear-gradient(135deg, var(--primary-light) 0%, #e9ecef 100%);
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--primary-yellow);
}

.summary-body {
    padding: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

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

.summary-item strong {
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.report-generation-box {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border: 2px solid #b3d9ff;
    border-radius: 10px;
    padding: 2rem;
}


/* Password strength indicator */
.password-strength {
    margin-top: 0.5rem;
}

.password-strength .progress {
    height: 5px;
    background-color: var(--bg-secondary);
}

.password-strength small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

/* Action Priority Colors in Table */
.table tr[data-priority="critical"] {
    border-left: 4px solid #dc3545;
}

.table tr[data-priority="high"] {
    border-left: 4px solid #ffc107;
}

/* Responsive */
@media (max-width: 768px) {
    .action-summary-card {
        margin-bottom: 1rem;
    }
}


/* NEW */

/* Investigation Header */
.investigation-header {
    background: var(--white);
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
}

.investigation-header h2 {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.investigation-header p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.investigation-header .badge {
    font-weight: 500;
    font-size: 0.8125rem;
}

/* Investigation Details Collapsible Card */
.investigation-details-card {
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.investigation-details-header {
    background: #f9fafb;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.investigation-details-header:hover {
    background: #f3f4f6;
}

.investigation-details-header h6 {
    margin: 0;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.9375rem;
}

.investigation-details-header .toggle-icon {
    font-size: 1rem;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.investigation-details-header[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.investigation-details-body {
    padding: 1.5rem;
}

/* Clean Metadata Display */
.investigation-details-body .row {
    margin-bottom: 0;
}

.investigation-details-body h6 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.investigation-details-body small.text-muted {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #9ca3af;
}

.investigation-details-body strong {
    font-weight: 500;
    color: var(--primary-dark);
}

.investigation-details-body .badge {
    font-weight: 500;
    font-size: 0.75rem;
}

.investigation-details-body i.bi {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Progress Stepper - Cleaner */
.investigation-progress-wrapper {
    margin-bottom: 1.5rem;
}

.progress-stepper {
    pointer-events: none;
}

.progress-step .step-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
}

.progress-step .step-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.progress-step .step-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
}

/* Phase Tabs - Clean, No Hover */
.investigation-tabs-wrapper {
    background: var(--white);
    border-radius: 0.5rem 0.5rem 0 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 0;
    border: 1px solid #e5e7eb;
    border-bottom: none;
}

.investigation-tabs {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0;
    margin-bottom: 0;
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
}

.investigation-tabs::-webkit-scrollbar {
    height: 3px;
}

.investigation-tabs::-webkit-scrollbar-track {
    background: #f9fafb;
}

.investigation-tabs::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.investigation-tabs .nav-link {
    color: #6b7280;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.875rem 1.25rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    transition: none;
    white-space: nowrap;
}

.investigation-tabs .nav-link:hover {
    /* NO HOVER EFFECT */
    background: transparent;
    color: #6b7280;
}

.investigation-tabs .nav-link.active {
    background: var(--white);
    color: var(--primary-dark);
    border-bottom-color: var(--primary-dark);
    font-weight: 600;
}

.investigation-tabs .nav-link.disabled {
    background: transparent;
    color: #d1d5db;
    cursor: not-allowed;
    pointer-events: none;
}

.investigation-tabs .nav-link i {
    margin-right: 0.375rem;
    font-size: 0.875rem;
}

.investigation-tabs .nav-link .badge {
    font-size: 0.6875rem;
    margin-left: 0.375rem;
    padding: 0.125rem 0.375rem;
    font-weight: 500;
}

.investigation-tabs .nav-link.active .badge {
    background: var(--primary-dark);
    color: var(--white);
}

.investigation-tabs .nav-link.disabled .badge {
    background: #e5e7eb;
    color: #9ca3af;
}

/* Tab Content Container - Cleaner */
.investigation-tab-content {
    background: var(--white);
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    min-height: 400px;
    border: 1px solid #e5e7eb;
    border-top: none;
}

.investigation-tab-content .tab-pane {
    animation: none; /* Remove animation */
}

/* Phase Section - Cleaner */
.phase-section {
    margin-bottom: 2rem;
}

.phase-section:last-child {
    margin-bottom: 0;
}

.phase-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.phase-section-header h5 {
    margin: 0;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 1rem;
}

.phase-section-header .badge {
    margin-left: 0.5rem;
    font-weight: 500;
    font-size: 0.75rem;
}

/* Nested Tabs (4P, RCA sections) - BLACK/GRAY ONLY, NO HOVER */
.investigation-tab-content .nav-tabs {
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.investigation-tab-content .nav-tabs .nav-link {
    color: #9ca3af;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    transition: none;
}

.investigation-tab-content .nav-tabs .nav-link:hover {
    /* NO HOVER - keep same */
    background: transparent;
    color: #9ca3af;
}

.investigation-tab-content .nav-tabs .nav-link.active {
    background: transparent;
    color: #000000; /* Pure black when active */
    border-bottom-color: #000000;
    font-weight: 600;
}

.investigation-tab-content .nav-tabs .nav-link .badge {
    font-size: 0.6875rem;
    font-weight: 500;
}

.investigation-tab-content .nav-tabs .nav-link.active .badge {
    background: #000000;
    color: var(--white);
}

/* Locked Phase State */
.phase-locked-message {
    text-align: center;
    padding: 3rem 2rem;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 0.5rem;
}

.phase-locked-message i {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.phase-locked-message h5 {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.phase-locked-message p {
    color: #6b7280;
    margin: 0;
    font-size: 0.875rem;
}

/* Button Standardization - ALL btn-sm */
.investigation-tab-content .btn,
.phase-section-header .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.investigation-tab-content .btn i,
.phase-section-header .btn i {
    font-size: 0.875rem;
}

/* Phase Completion Alert - Cleaner */
.phase-completion-alert {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.phase-completion-alert.warning {
    background: #fef3c7;
    border-color: #fcd34d;
}

.phase-completion-alert i {
    font-size: 1rem;
}

.phase-completion-alert span {
    font-size: 0.875rem;
    color: var(--primary-dark);
}

/* Tables - Clean & Professional */
.investigation-tab-content table {
    font-size: 0.875rem;
    border-collapse: separate;
    border-spacing: 0;
}

.investigation-tab-content thead th {
    background-color: #f9fafb;
    color: #374151;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    border-top: 1px solid #e5e7eb;
}

.investigation-tab-content thead th:first-child {
    border-left: 1px solid #e5e7eb;
}

.investigation-tab-content thead th:last-child {
    border-right: 1px solid #e5e7eb;
}

.investigation-tab-content tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.investigation-tab-content tbody tr:first-child td {
    border-top: none;
}

.investigation-tab-content tbody td:first-child {
    border-left: 1px solid #e5e7eb;
}

.investigation-tab-content tbody td:last-child {
    border-right: 1px solid #e5e7eb;
}

.investigation-tab-content tbody tr:hover {
    background-color: #f9fafb;
}

.investigation-tab-content tbody tr:last-child td {
    border-bottom: 1px solid #e5e7eb;
}

.investigation-tab-content tbody tr:last-child td:first-child {
    border-bottom-left-radius: 0.375rem;
}

.investigation-tab-content tbody tr:last-child td:last-child {
    border-bottom-right-radius: 0.375rem;
}

.investigation-tab-content .table .badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Empty State - Cleaner */
.empty-state-box {
    text-align: center;
    padding: 3rem 2rem;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 0.5rem;
}

.empty-state-box i {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.empty-state-box .fw-semibold {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 1rem;
}

.empty-state-box small {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .investigation-header {
        padding: 1rem;
    }

    .investigation-header h2 {
        font-size: 1.125rem;
    }

    .investigation-tabs .nav-link {
        font-size: 0.8125rem;
        padding: 0.75rem 1rem;
    }

    .investigation-tab-content {
        padding: 1rem;
    }

    .phase-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .phase-section-header .btn {
        width: 100%;
    }

    .phase-completion-alert {
        flex-direction: column;
        text-align: center;
    }

    .phase-completion-alert .btn {
        width: 100%;
    }
}

/* Remove old styles */
.phase-container {
    display: none !important;
}

