/* PRA Monitor table styling.
 *
 * Styles the CustomTable contract classes (py_modules/templates/
 * dash_templates/custom_table.py) for this dashboard. Table headers
 * share one look across the dashboard's tables; the header band, sort
 * buttons, filter row and pagination footer are defined here rather
 * than inline in the template.
 */

/* --- component styling ------------------------------------------------- */

.pra-component-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.8;
  margin: 0 0 8px;
}

.pra-component-subtitle {
  font-size: 14px;
  line-height: 1.8;
  margin: 0 0 8px;
  font-style: italic;
}

/* The card header row: the component's title on the left, its version on
 * the right. Title and subtitle have different font sizes, so their line
 * boxes have different heights; left as they are, the columns stretch to
 * the tallest and the smaller text sits at the top of its box, visibly
 * high. `align-items: baseline` puts both texts on the reading line the
 * eye compares (their text baselines, not their boxes' middles), and the
 * last column's auto left margin pushes the version to the card's right
 * edge — where it stays even if the two ever wrap onto separate lines.
 * The columns themselves are sized to their text (width="auto"), so the
 * push is the only thing distributing them. */
.pra-component-header {
  align-items: baseline;
  padding-left: 6px;
}

.pra-component-header > *:last-child {
  margin-left: auto;
}

/* The filter column strips the 12px gutter padding and the 4px of border
   the other cards keep, so this heading gives them back: the "Filters"
   title then sits 20px from the column's edge — the same margin the other
   cards' headings have (their 8px border + 12px padding). Putting it on
   the header row rather than the column leaves the panel's own rows at
   their 8px inset. */
#settings-filters-column .pra-component-header {
  padding-left: 8px;
}

/* --- header band ------------------------------------------------------- */

.pra-ct-header-row {
  background-color: #fdca00;
  border-bottom: 1px solid #d5d7da;
  font-weight: bold;
}

.pra-ct-header-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  height: 100%;
  min-height: 26px;
  padding: 3px 2px 3px 4px;
  font-weight: 600;
}

.pra-ct-header-label {
  min-width: 0;
  /* one step below the cell preset so the longest header word
     ("Geneesmiddel") still fits its column next to the sort key */
  font-size: 11px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* the global button style (yellow border) does not apply to the sort key */
.pra-ct-header-cell .pra-ct-sort {
  border: none !important;
  background: transparent !important;
  color: #041a2f;
  line-height: 1;
  padding: 0;
  font-size: 9px;
  cursor: pointer;
}

.pra-ct-header-cell .pra-ct-sort:hover {
  color: #fdca00;
}

/* --- filter row -------------------------------------------------------- */

.pra-ct-filter-row {
  background-color: #f4f5f6;
  border-bottom: 1px solid #d5d7da;
  padding-top: 2px;
  padding-bottom: 2px;
}

.pra-ct-filter-input {
  width: 100%;
  border: 1px solid #d5d7da;
  border-radius: 3px;
  font-size: 11px;
  padding: 1px 4px;
  text-align: left;
}

.pra-ct-filter-input::placeholder {
  font-style: italic;
  color: #9aa0a6;
  opacity: 1;
}

.pra-ct-filter-menu .dropdown-toggle {
  position: relative;
  width: 100%;
  border: 1px solid #d5d7da !important;
  background-color: white !important;
  color: #333333 !important;
  border-radius: 3px;
  font-size: 11px;
  /* room on the right for the pinned caret, text starts at the left */
  padding: 1px 12px 1px 4px;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
}

/* the caret stays inside the box, whatever the label length */
.pra-ct-filter-menu .dropdown-toggle::after {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}

.pra-ct-filter-toggle-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: italic;
  color: #9aa0a6;
}

.pra-ct-filter-menu .dropdown-menu {
  padding: 6px 8px;
}

/* search box at the top of a checklist filter menu */
.pra-ct-checklist-search {
  width: 100%;
  border: 1px solid #d5d7da;
  border-radius: 3px;
  font-size: 11px;
  padding: 1px 4px;
  margin-bottom: 6px;
}

.pra-ct-checklist-search::placeholder {
  font-style: italic;
  color: #9aa0a6;
  opacity: 1;
}

.pra-ct-filter-checklist {
  font-size: 11px;
  max-height: 220px;
  overflow-y: auto;
  white-space: nowrap;
}

/* --- pagination footer ------------------------------------------------- */

.pra-ct-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
}

.pra-ct-footer .pra-ct-page-btn {
  border: 1px solid #fdca00 !important;
  background-color: white !important;
  color: #041a2f !important;
  border-radius: 4px;
  padding: 0 10px;
  line-height: 1.7;
  font-weight: 600;
}

.pra-ct-footer .pra-ct-page-btn:hover {
  background-color: #fdca00 !important;
}

.pra-ct-page-info {
  font-size: 11px;
  color: #555555;
}

/* --- drug name formatting ---------------------------------------------- */

.pra-drug-molecule {
  font-style: italic;
}

.pra-drug-brand {
  font-style: normal;
}

/* --- Extra filters: the colour-coded date options ---------------------- */

/* Each option in the Extra filters dropdowns ends with a box filled in the
   colour of the rows it keeps — the same palette the Notificatie Centrum
   paints those cells with (Settings.NOTIFICATIE_CELL_COLORS). The box's
   size and its place at the right edge live with the template's own
   classes; only the colour is the page's. */
.pra-date-bucket--week {
  background-color: #cfe2ff;
}

.pra-date-bucket--month {
  background-color: #d1e7dd;
}

.pra-date-bucket--next-month {
  background-color: #fff3cd;
}

.pra-date-bucket--future {
  background-color: #e2d9f3;
}
