.investigations-page,
.investigations-page * {
  box-sizing: border-box;
}

.investigations-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: rgba(255,255,255,.94);
  min-height: 100%;
  padding: 4px;
}

.investigations-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.investigations-header h1 {
  margin: 0;
  font-size: 28px;
}

.investigations-header p {
  margin: 6px 0 0;
  color: rgba(255,255,255,.66);
}

.investigations-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.investigations-header-actions .input,
.investigations-header-actions input,
.investigations-header-actions select {
  min-width: 180px;
}

.investigations-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.investigation-kpi {
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

.investigation-kpi.warning { border-color: rgba(255,189,89,.26); }
.investigation-kpi.danger { border-color: rgba(255,92,92,.26); }
.investigation-kpi.success { border-color: rgba(64,215,142,.26); }

.kpi-label {
  color: rgba(255,255,255,.62);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.kpi-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
}

.kpi-sub {
  margin-top: 6px;
  color: rgba(255,255,255,.56);
  font-size: 12px;
}

.investigations-table-wrap {
  overflow: auto;
  border-radius: 18px;
}

.investigations-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1250px;
}

.investigations-table th,
.investigations-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align: top;
  text-align: left;
}

.investigations-table thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.62);
  background: rgba(255,255,255,.03);
  position: sticky;
  top: 0;
  z-index: 1;
}

.inv-number {
  font-weight: 700;
  color: #9bc6ff;
}

.inv-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.inv-sub {
  color: rgba(255,255,255,.62);
  font-size: 12px;
  line-height: 1.4;
  max-width: 310px;
}

.inv-chip-wrap {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.inv-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 11px;
}

.investigation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
}

.priority-low { border-color: rgba(175,175,175,.24); }
.priority-medium { border-color: rgba(95,158,255,.25); }
.priority-high { border-color: rgba(255,189,89,.28); }
.priority-critical { border-color: rgba(255,92,92,.32); }
.status-open, .status-active { border-color: rgba(95,158,255,.25); }
.status-suspended { border-color: rgba(255,189,89,.28); }
.status-ready_for_doj { border-color: rgba(170,121,255,.32); }
.status-closed { border-color: rgba(64,215,142,.26); }

.investigation-modal .modal-body,
.investigation-view-modal .modal-body {
  max-height: 76vh;
  overflow: auto;
}

.investigation-modal-body {
  padding-top: 4px;
}

.investigation-form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.investigation-section {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,.025);
}

.investigation-section h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.investigation-dept-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}

.inv-dept-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  cursor: pointer;
}

.inv-dept-option.locked {
  border-color: rgba(95,158,255,.28);
  background: rgba(95,158,255,.08);
}

.inv-dept-option input {
  margin: 0 0 4px;
}

.inv-dept-option small,
.field-hint {
  color: rgba(255,255,255,.55);
  font-size: 12px;
}

.investigation-view-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.investigation-view-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.investigation-view-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px 18px;
  width: 100%;
}

.investigation-view-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}

.investigation-view-grid .wide {
  grid-column: 1 / -1;
}

.view-pre {
  white-space: pre-wrap;
  line-height: 1.55;
  color: rgba(255,255,255,.88);
}

.actions-cell {
  white-space: nowrap;
}

.investigations-table-wrap::-webkit-scrollbar,
.investigation-modal .modal-body::-webkit-scrollbar,
.investigation-view-modal .modal-body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.investigations-table-wrap::-webkit-scrollbar-thumb,
.investigation-modal .modal-body::-webkit-scrollbar-thumb,
.investigation-view-modal .modal-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.16);
  border-radius: 999px;
}

.investigations-table-wrap::-webkit-scrollbar-track,
.investigation-modal .modal-body::-webkit-scrollbar-track,
.investigation-view-modal .modal-body::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04);
}

@media (max-width: 1280px) {
  .investigations-kpis,
  .investigation-view-grid,
  .investigation-view-meta,
  .investigation-dept-picker,
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .investigations-kpis,
  .investigation-view-grid,
  .investigation-view-meta,
  .investigation-dept-picker,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* SEARCH BAR */

.investigations-search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.investigations-search input {
  background: rgba(15, 25, 45, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 8px 12px;
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  width: 240px;
  outline: none;
  transition: all 0.15s ease;
}

.investigations-search input::placeholder {
  color: rgba(255,255,255,0.35);
}

.investigations-search input:focus {
  border-color: rgba(0,140,255,0.6);
  box-shadow: 0 0 0 1px rgba(0,140,255,0.4);
}

/* SELECT FILTER */

.investigations-search select {
  background: rgba(15, 25, 45, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 8px 10px;
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.investigations-search select:focus {
  border-color: rgba(0,140,255,0.6);
}

.investigations-search input:hover,
.investigations-search select:hover {
  border-color: rgba(255,255,255,0.18);
}

/* SEARCH / FILTER BAR */
.investigations-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

#investigationsSearch,
.investigations-header-actions select,
.investigations-header-actions .input {
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(15, 25, 45, 0.85);
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

#investigationsSearch {
  min-width: 260px;
}

#investigationsSearch::placeholder {
  color: rgba(255,255,255,0.38);
}

#investigationsSearch:focus,
.investigations-header-actions select:focus,
.investigations-header-actions .input:focus {
  border-color: rgba(0,140,255,0.6);
  box-shadow: 0 0 0 1px rgba(0,140,255,0.35);
}

#investigationsSearch:hover,
.investigations-header-actions select:hover,
.investigations-header-actions .input:hover {
  border-color: rgba(255,255,255,0.18);
}

.investigations-header-actions select {
  cursor: pointer;
}

@media (max-width: 900px) {
  .investigations-header-actions {
    justify-content: stretch;
  }

  #investigationsSearch,
  .investigations-header-actions select,
  .investigations-header-actions .input,
  .investigations-header-actions button {
    width: 100%;
    min-width: 100%;
  }
}