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

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

/* HEADER */
.arrest-reports-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.arrest-reports-header-copy {
  min-width: 280px;
  flex: 1 1 420px;
}

.arrest-reports-header h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
}

.arrest-reports-header p {
  margin: 6px 0 0;
  opacity: .72;
  line-height: 1.5;
}

.arrest-reports-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 1 1 720px;
  min-width: 0;
}

.arrest-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 360px;
  min-width: 260px;
  max-width: 420px;
}

.arrest-search-wrap span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  pointer-events: none;
  opacity: .58;
  font-size: 14px;
}

.arrest-search-wrap .input,
#arrestReportsSearch {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 14px 0 40px !important;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  outline: none;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.04));
  color: rgba(255,255,255,.96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.arrest-search-wrap .input::placeholder,
#arrestReportsSearch::placeholder {
  color: rgba(255,255,255,.46);
}

#arrestReportsStatusFilter {
  flex: 0 0 240px;
  min-width: 220px;
  width: 240px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  outline: none;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.04));
  color: rgba(255,255,255,.96);
}

#openCreateArrestReportBtn {
  flex: 0 0 auto;
  height: 44px;
  border-radius: 12px;
  white-space: nowrap;
}

/* STATS */
.arrest-reports-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.arrest-reports-stats .stat-card {
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
  box-shadow: 0 14px 30px rgba(0,0,0,.18);
}

.arrest-reports-stats .stat-label {
  margin-bottom: 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .68;
}

.arrest-reports-stats .stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

/* TABLE */
.arrest-reports-table-card {
  padding: 0;
  overflow: hidden;
}

.arrest-reports-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.arrest-reports-table thead th {
  padding: 14px 14px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.arrest-reports-table tbody tr {
  background: rgba(8, 20, 48, .68);
}

.arrest-reports-table tbody tr + tr td {
  border-top: 1px solid rgba(255,255,255,.06);
}

.arrest-reports-table tbody td {
  padding: 16px 14px;
  text-align: center;
  vertical-align: middle;
  line-height: 1.4;
  word-break: break-word;
}

.arrest-reports-table th:nth-child(1),
.arrest-reports-table td:nth-child(1) {
  width: 64px;
}

.arrest-reports-table th:nth-child(2),
.arrest-reports-table td:nth-child(2) {
  width: 170px;
}

.arrest-reports-table th:nth-child(5),
.arrest-reports-table td:nth-child(5) {
  width: 128px;
}

.arrest-reports-table th:nth-child(6),
.arrest-reports-table td:nth-child(6),
.arrest-reports-table th:nth-child(7),
.arrest-reports-table td:nth-child(7),
.arrest-reports-table th:nth-child(8),
.arrest-reports-table td:nth-child(8) {
  width: 92px;
}

.arrest-reports-table th:nth-child(9),
.arrest-reports-table td:nth-child(9),
.actions-cell {
  width: 190px;
}

.arrest-reports-table td:nth-child(3),
.arrest-reports-table td:nth-child(4),
.responsible-cell {
  white-space: normal;
}

.responsible-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.empty-state-cell {
  padding: 26px 16px !important;
  text-align: center;
  opacity: .68;
}

/* STATUS */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.success {
  color: #86efac;
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.18);
}

.status-badge.warning {
  color: #fcd34d;
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.18);
}

.status-badge.muted {
  color: #cbd5e1;
  background: rgba(148,163,184,.12);
  border-color: rgba(148,163,184,.18);
}

/* ACTIONS */
.table-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.table-actions button {
  min-width: 0;
  width: auto;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

/* MODAL CREATE / EDIT */
.arrest-report-modal {
  width: min(1650px, 96vw);
  max-height: 92vh;
}

.arrest-report-modal .modal-body {
  overflow: auto;
  max-height: calc(92vh - 140px);
}

.arrest-report-modal-body {
  padding-top: 10px;
}

.arrest-report-editor-grid {
  display: grid;
  grid-template-columns: 1.18fr .92fr;
  gap: 18px;
  align-items: stretch;
}

.arrest-report-editor-left,
.arrest-report-editor-right {
  min-width: 0;
}

.arrest-report-editor-left,
.arrest-report-editor-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.arrest-report-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px 16px;
}

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

/* EDITOR */
.report-editor-shell {
  display: flex;
  flex-direction: column;
  min-height: 720px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.20);
}

.editor-toolbar button {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.95);
  cursor: pointer;
  transition: .15s ease;
}

.editor-toolbar button:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.14);
}

.editor-separator {
  width: 1px;
  align-self: stretch;
  margin: 0 2px;
  background: rgba(255,255,255,.08);
}

.arrest-report-content-editor {
  flex: 1;
  min-height: 620px;
  padding: 18px;
  overflow: auto;
  outline: none;
  color: rgba(255,255,255,.95);
  font-size: 14px;
  line-height: 1.65;
  white-space: normal;
  word-break: break-word;
}

.arrest-report-content-editor:empty::before {
  content: attr(data-placeholder);
  color: rgba(255,255,255,.40);
  pointer-events: none;
}

.arrest-report-content-editor h1,
.arrest-report-content-editor h2,
.arrest-report-content-editor h3,
.report-render h1,
.report-render h2,
.report-render h3 {
  margin: 0 0 12px;
  line-height: 1.25;
}

.arrest-report-content-editor h1,
.report-render h1 {
  font-size: 28px;
}

.arrest-report-content-editor h2,
.report-render h2 {
  font-size: 22px;
}

.arrest-report-content-editor p,
.report-render p {
  margin: 0 0 12px;
}

.arrest-report-content-editor ul,
.arrest-report-content-editor ol,
.report-render ul,
.report-render ol {
  margin: 0 0 12px 22px;
}

.arrest-report-content-editor blockquote,
.report-render blockquote {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-left: 3px solid rgba(59,130,246,.9);
  border-radius: 0 10px 10px 0;
  background: rgba(255,255,255,.04);
}

.arrest-report-content-editor hr,
.report-render hr {
  margin: 14px 0;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.12);
}

.arrest-report-content-editor img,
.report-render img {
  max-width: 100%;
  border-radius: 12px;
}

/* SUBSECTIONS */
.arrest-report-subsection {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.02);
}

.subsection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.subsection-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.95);
}

.chip span {
  display: block;
  line-height: 1.25;
  word-break: break-word;
}

.chip button {
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.72);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.chip.static {
  padding-right: 12px;
}

.empty-inline {
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed rgba(255,255,255,.10);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.58);
}

.charge-builder-grid {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
}

.arrest-charge-qty-input,
#arrestChargeQty {
  height: 44px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  outline: none;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.04));
  color: rgba(255,255,255,.96);
  text-align: center;
}

.arrest-charges-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.charge-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.05);
}

.charge-row strong {
  display: inline-block;
  margin-bottom: 4px;
}

.muted-text {
  opacity: .68;
  line-height: 1.45;
}

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

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

.evidence-upload-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.file-btn {
  cursor: pointer;
}

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

.evidence-card {
  display: flex;
  flex-direction: column;
  min-height: 240px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.05);
}

.evidence-preview {
  width: 100%;
  height: 170px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}

.evidence-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: rgba(0,0,0,.18);
}

.evidence-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.evidence-title {
  font-weight: 700;
  line-height: 1.3;
}

.evidence-meta {
  font-size: 12px;
  opacity: .62;
  word-break: break-word;
}

/* MODAL VIEW */
.arrest-report-view-modal {
  width: min(1600px, 96vw);
  max-height: 92vh;
}

.arrest-report-view-modal .modal-body {
  overflow: auto;
  max-height: calc(92vh - 100px);
}

.arrest-report-view-layout {
  display: grid;
  grid-template-columns: 1.45fr .6fr;
  gap: 20px;
  align-items: stretch;
}

.arrest-report-view-main,
.arrest-report-view-comments {
  min-width: 0;
}

.arrest-report-view-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.arrest-report-view-comments {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 720px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.02);
}

.arrest-report-view-comments h3,
.arrest-report-view-block h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.arrest-report-view-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
}

.meta-line {
  line-height: 1.45;
  opacity: .92;
}

.arrest-report-view-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.02);
}

.report-render {
  max-width: 100%;
  overflow-x: auto;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.95);
  line-height: 1.65;
}

/* COMMENTS */
.comments-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.comment-item {
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.05);
}

.comment-author {
  margin-bottom: 6px;
  font-weight: 800;
}

.comment-text {
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-date {
  margin-top: 8px;
  font-size: 12px;
  opacity: .58;
}

.comment-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.comment-composer .input,
#arrestReportCommentInput {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  outline: none;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.04));
  color: rgba(255,255,255,.96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.comment-composer .input::placeholder,
#arrestReportCommentInput::placeholder {
  color: rgba(255,255,255,.46);
}

.comment-composer .btn-primary {
  height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  white-space: nowrap;
}

/* DELETE MODAL */
.arrest-delete-modal {
  width: min(480px, 92vw);
}

.delete-modal-text {
  margin: 0;
  color: rgba(255,255,255,.86);
  line-height: 1.6;
}

/* SAFE INPUTS */
.arrest-reports-page select,
.arrest-reports-page input,
.arrest-reports-page textarea,
.arrest-report-modal select,
.arrest-report-modal input,
.arrest-report-view-modal input {
  width: 100%;
}

/* SCROLLBARS */
.arrest-report-modal .modal-body::-webkit-scrollbar,
.arrest-report-view-modal .modal-body::-webkit-scrollbar,
.comments-list::-webkit-scrollbar,
.report-render::-webkit-scrollbar,
.arrest-report-content-editor::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.arrest-report-modal .modal-body::-webkit-scrollbar-thumb,
.arrest-report-view-modal .modal-body::-webkit-scrollbar-thumb,
.comments-list::-webkit-scrollbar-thumb,
.report-render::-webkit-scrollbar-thumb,
.arrest-report-content-editor::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255,255,255,.14);
}

.arrest-report-modal .modal-body::-webkit-scrollbar-track,
.arrest-report-view-modal .modal-body::-webkit-scrollbar-track,
.comments-list::-webkit-scrollbar-track,
.report-render::-webkit-scrollbar-track,
.arrest-report-content-editor::-webkit-scrollbar-track {
  background: transparent;
}

/* RESPONSIVE */
@media (max-width: 1400px) {
  .arrest-report-editor-grid {
    grid-template-columns: 1fr;
  }

  .report-editor-shell {
    min-height: 520px;
  }

  .arrest-report-content-editor {
    min-height: 420px;
  }

  .arrest-report-view-layout {
    grid-template-columns: 1fr;
  }

  .arrest-report-view-comments {
    min-height: 420px;
  }
}

@media (max-width: 1100px) {
  .arrest-reports-header {
    align-items: stretch;
  }

  .arrest-reports-header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .arrest-search-wrap {
    flex: 1 1 100%;
    max-width: none;
  }

  #arrestReportsStatusFilter {
    flex: 1 1 260px;
    width: 100%;
  }
}

@media (max-width: 980px) {
  .arrest-reports-stats {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .arrest-report-form-grid,
  .evidence-upload-grid,
  .totals-grid,
  .arrest-evidence-grid,
  .charge-builder-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .comment-composer {
    grid-template-columns: 1fr;
  }

  .comment-composer .btn-primary {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .arrest-reports-stats {
    grid-template-columns: 1fr;
  }

  .charge-row {
    flex-direction: column;
  }

  .table-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .table-actions button {
    width: 100%;
  }

  .editor-toolbar {
    gap: 4px;
  }

  .editor-toolbar button {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
  }
}