/*
 * Settled cases are highlighted in two places: the cases list and the dashboard cases widget.
 *
 * THE COLOUR IS DEFINED ONCE, BELOW. Change --case-settled-bg and both views follow.
 *
 * What counts as settled is decided in PHP, also in one place:
 * casesClass::isSettled() (App/businessLogic/casesClass.php).
 *
 * Plain CSS on purpose - the neighbouring files are compiled from .less, this one has no .less
 * counterpart so a LESS rebuild cannot overwrite it.
 */
:root {
  --case-settled-bg: #E8F3EC;
}

:root[data-bs-theme="dark"] {
  --case-settled-bg: #1F3A2B;
}

/*
 * Cases list. The class reaches the <tr> through the markRow key on the row data - see
 * metronicDatatable.js handleCreatedRow().
 *
 * The inset box-shadow is not decoration: .table-striped paints its odd rows with
 * "box-shadow: inset 0 0 0 9999px #f9f9f9" rather than a background, and a shadow covers the
 * background underneath it. Without overriding the shadow every second settled row would keep its
 * stripe. The background-color still matters for tables without striping.
 */
table.table.dataTable > tbody > tr.case-settled-row > td {
  background-color: var(--case-settled-bg) !important;
  box-shadow: inset 0 0 0 9999px var(--case-settled-bg) !important;
}

/* Dashboard cases widget, desktop and mobile card alike. */
.cases-widget .btn.btn-custom-cases-list.case-settled {
  background: var(--case-settled-bg);
}
