/**
 * Restore EPIC theme after Bootstrap 5.3.8
 * Matches previous navy table header / primary buttons UI
 */

:root {
  --epic-navy: #1a1549;
  --epic-navy-hover: #99103b;
  --bs-primary: #1a1549;
  --bs-primary-rgb: 26, 21, 73;
}

/* ---------- Primary buttons (BS5 CSS variables) ---------- */
.btn-primary,
.btn-primary.themesBtnsColored,
a.btn-primary,
button.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: #1a1549;
  --bs-btn-border-color: #1a1549;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #99103b;
  --bs-btn-hover-border-color: #99103b;
  --bs-btn-focus-shadow-rgb: 26, 21, 73;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #99103b;
  --bs-btn-active-border-color: #99103b;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #1a1549;
  --bs-btn-disabled-border-color: #1a1549;
  background-color: #1a1549 !important;
  border-color: #1a1549 !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
  background-color: #99103b !important;
  border-color: #99103b !important;
  color: #fff !important;
}

/* ---------- Table header: navy + white (BS5 cell bg override) ---------- */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: #1a1549;
  --bs-table-striped-bg: #f8f9fa;
  --bs-table-striped-color: #1a1549;
  --bs-table-hover-bg: #f6f6f7;
  --bs-table-hover-color: #1a1549;
  --bs-table-border-color: rgba(0, 0, 0, 0.08);
  color: #1a1549;
}

.table thead,
.table thead.thead-bg,
.thead-bg {
  background-color: #1a1549 !important;
  color: #fff !important;
}

.table > thead > tr > th,
.table thead tr th,
.table thead.thead-bg th,
.thead-bg th,
table.dataTable thead th,
table.dataTable > thead > tr > th {
  background-color: #1a1549 !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  font-weight: 500 !important;
  vertical-align: middle;
  --bs-table-bg: #1a1549;
  --bs-table-color: #fff;
  --bs-table-accent-bg: transparent;
  box-shadow: none !important;
}

/* DataTables sort icons stay visible on navy header */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc,
table.dataTable thead .sorting_asc_disabled,
table.dataTable thead .sorting_desc_disabled {
  color: #fff !important;
  background-color: #1a1549 !important;
}

.table > tbody > tr > td,
.table > tbody > tr > th,
table.dataTable tbody td {
  color: #1a1549 !important;
  background-color: #fff;
  border-color: rgba(0, 0, 0, 0.08) !important;
  vertical-align: middle;
  box-shadow: none !important;
}

/* Zebra striping like previous UI */
.table-striped > tbody > tr:nth-of-type(odd) > *,
.table-striped > tbody > tr:nth-of-type(2n+1) > *,
.table tbody tr.odd > td,
table.dataTable tbody tr.odd > td {
  background-color: #f8f9fa !important;
  --bs-table-bg-type: #f8f9fa;
  box-shadow: none !important;
}

.table-striped > tbody > tr:nth-of-type(even) > *,
.table tbody tr.even > td,
table.dataTable tbody tr.even > td {
  background-color: #fff !important;
  box-shadow: none !important;
}

.table-bordered,
.table-bordered > :not(caption) > * > * {
  border-color: rgba(0, 0, 0, 0.08) !important;
}

.table-bordered {
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* Action icons / red accents stay visible */
.table td .btn-xs,
.table td a.btn-xs {
  color: #99103b;
}

/* ---------- Cards / filter box ---------- */
.card,
.card-table,
.roundeds,
.border-box {
  border: 1px solid #ddd;
  border-radius: 7px;
  background-color: #fff;
  overflow: hidden;
}

.card-table .card-body {
  background-color: #fff;
}

/* ---------- Labels / form feel ---------- */
label {
  color: #1a1549 !important;
}

.form-control,
.form-select,
select.form-control {
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  color: #495057;
}

.form-control:focus,
.form-select:focus,
select.form-control:focus {
  border-color: #1a1549;
  box-shadow: 0 0 0 0.2rem rgba(26, 21, 73, 0.2);
}

/* DataTables length/filter controls */
.dataTables_length select,
.dataTables_filter input {
  padding: 5px 11px;
  border-radius: 4px;
  border: 1px solid #aaa;
  background-color: #fff;
  color: #333;
}

/* ---------- Section headers (Report Details, etc.) ---------- */
.bordered-box {
  border: 1px solid #ddd !important;
  padding: 0 !important;
  margin-bottom: 12px !important;
  background: #fff;
  overflow: hidden;
}

.bordered-box > h5.title,
.bordered-box h5.title.bg-danger,
h5.title.bg-danger.p-10 {
  background-color: #1a1549 !important;
  color: #fff !important;
  margin: 0 0 12px 0 !important;
  padding: 10px 15px !important;
  font-size: 1rem;
  font-weight: 600;
  border: 0;
}

.bg-danger {
  background-color: #1a1549 !important;
  color: #fff !important;
}

.p-100 h4 {
  border-bottom: 1px solid #ddd;
  line-height: 40px;
  font-weight: 600;
  color: #2c3038;
}

/* ---------- BS4-style horizontal form (label left / field right) ---------- */
.form-group {
  margin-bottom: 1.25rem !important;
  display: block;
  width: 100%;
}

.form-group::after,
.bordered-box::after,
#inputFormRow::after {
  display: table;
  clear: both;
  content: "";
}

.form-horizontal .form-group > label,
.bordered-box .form-group > label {
  padding-top: 7px;
  margin-bottom: 0;
  font-weight: 400;
  color: #1a1549 !important;
}

/* Float columns like Bootstrap 4 inside form rows */
@media (min-width: 576px) {
  .form-group > [class*="col-sm-"],
  .form-group > [class*="col-md-"],
  .form-group > label[class*="col-sm-"],
  .form-group > label[class*="col-md-"],
  #inputFormRow > [class*="col-sm-"],
  #nRow > [class*="col-sm-"],
  .condition-box-1 .form-group > [class*="col-"] {
    float: left;
    position: relative;
    min-height: 1px;
    padding-right: 15px;
    padding-left: 15px;
    box-sizing: border-box;
  }

  .form-group > .col-sm-2,
  #inputFormRow > .col-sm-2 { width: 16.666667%; }
  .form-group > .col-sm-3,
  #inputFormRow > .col-sm-3 { width: 25%; }
  .form-group > .col-sm-4,
  #inputFormRow > .col-sm-4,
  .form-group > label.col-sm-4 { width: 33.333333%; }
  .form-group > .col-sm-5 { width: 41.666667%; }
  .form-group > .col-sm-6 { width: 50%; }
  .form-group > .col-sm-8,
  #inputFormRow > .col-sm-8,
  #nRow > .col-sm-8 { width: 66.666667%; }
  .form-group > .col-sm-12,
  .form-group > .col-md-12,
  #inputFormRow > .col-sm-12 { width: 100%; float: left; }

  /* Outer form-group wrappers stay full width blocks */
  .bordered-box > .form-group.col-sm-12,
  .bordered-box > .form-group.col-md-12,
  .bordered-box > .form-groups,
  .condition-box-1 > .form-group.col-md-12,
  .col-lg-12 > .form-group.col-sm-12 {
    float: none !important;
    width: 100% !important;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
  }
}

/* Inputs / textareas inside breach form */
.bordered-box .form-control,
.bordered-box select.form-control,
.bordered-box input.form-control {
  width: 100%;
  max-width: 100%;
  border: 1px solid #ced4da;
  border-radius: 5px;
  background-color: #fff;
  color: #495057;
}

.bordered-box select.form-control,
.bordered-box input.form-control:not([type="hidden"]) {
  height: 36px !important;
}

.bordered-box textarea.form-control {
  height: auto !important;
  min-height: 100px;
}

.bordered-box .error {
  color: #ff0000;
  font-weight: bold;
}

/* Dynamic who-involved row buttons */
#inputFormRow .btn,
#nRow .btn {
  margin-top: 0;
}

.btn-danger {
  --bs-btn-bg: #99103b;
  --bs-btn-border-color: #99103b;
  background-color: #99103b !important;
  border-color: #99103b !important;
  color: #fff !important;
}

.btn-info {
  --bs-btn-bg: #17a2b8;
  --bs-btn-border-color: #17a2b8;
  background-color: #17a2b8 !important;
  border-color: #17a2b8 !important;
  color: #fff !important;
}

/* Submit / close maroon accents used on breach pages */
.themeredbutton,
a.themeredbutton.btn-danger {
  background-color: #99103b !important;
  border-color: #99103b !important;
  color: #fff !important;
}
