/*
 * dlight-admin UI components: buttons, chips, read-only values and previews, one pattern for every admin screen.
 *
 *   .dl-btn                 base: same height, radius, font and spacing everywhere
 *   .dl-btn--primary        the main action of the screen (Salvar, Adicionar, Pesquisar, Entrar)
 *   .dl-btn--secondary      supporting actions (Cancelar, Fechar, Ver no site, Exportar)
 *   .dl-btn--danger         destructive link inside a form (Remover): outline, lighter than the main action
 *   .dl-btn--danger-solid   confirming a destruction (Sim, tenho certeza)
 *   .dl-btn--sm             compact variant (pagination, "mostrar tudo")
 *   .dl-chip                filter options (years of the date filter); .active = selected
 *
 * Colours come from the DlightConfig variables (--bs-primary, --bs-hover-primary).
 */

.btn.dl-btn {
  --dl-btn-bg: transparent;
  --dl-btn-color: var(--bs-gray-800);
  --dl-btn-border: transparent;
  --dl-btn-hover-bg: var(--dl-btn-bg);
  --dl-btn-hover-color: var(--dl-btn-color);
  --dl-btn-hover-border: var(--dl-btn-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  margin: 0;
  padding: 0 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  border: 1px solid var(--dl-btn-border);
  border-radius: 0.5rem;
  background: var(--dl-btn-bg);
  background-image: none;
  color: var(--dl-btn-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn.dl-btn:hover,
.btn.dl-btn:focus-visible,
.btn.dl-btn.show {
  background: var(--dl-btn-hover-bg);
  color: var(--dl-btn-hover-color);
  border-color: var(--dl-btn-hover-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn.dl-btn:focus-visible {
  outline: 2px solid rgba(var(--bs-primary-rgb), 0.45);
  outline-offset: 2px;
}

.btn.dl-btn:active {
  box-shadow: none;
}

.btn.dl-btn i,
.btn.dl-btn .fa,
.btn.dl-btn .fas {
  font-size: 0.875rem;
}

.btn.dl-btn--primary {
  --dl-btn-bg: var(--bs-primary);
  --dl-btn-color: #fff;
  --dl-btn-border: var(--bs-primary);
  --dl-btn-hover-bg: var(--bs-hover-primary, var(--bs-primary));
  --dl-btn-hover-color: #fff;
  --dl-btn-hover-border: var(--bs-hover-primary, var(--bs-primary));
}

.btn.dl-btn--secondary {
  --dl-btn-bg: #fff;
  --dl-btn-color: var(--bs-gray-800);
  --dl-btn-border: var(--bs-gray-300);
  --dl-btn-hover-bg: var(--bs-gray-100);
  --dl-btn-hover-color: var(--bs-gray-900);
  --dl-btn-hover-border: var(--bs-gray-400);
}

.btn.dl-btn--danger {
  --dl-btn-bg: #fff;
  --dl-btn-color: var(--bs-danger);
  --dl-btn-border: rgba(244, 67, 53, 0.45);
  --dl-btn-hover-bg: var(--bs-danger);
  --dl-btn-hover-color: #fff;
  --dl-btn-hover-border: var(--bs-danger);
}

.btn.dl-btn--danger-solid {
  --dl-btn-bg: var(--bs-danger);
  --dl-btn-color: #fff;
  --dl-btn-border: var(--bs-danger);
  --dl-btn-hover-bg: #d9362b;
  --dl-btn-hover-color: #fff;
  --dl-btn-hover-border: #d9362b;
}

.btn.dl-btn--sm {
  min-height: 32px;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
}

/* Main button + dropdown toggle (Salvar ▾). */
.dl-btn-split {
  display: flex;
  width: 100%;
}

.dl-btn-split > .dl-btn:first-child {
  flex: 1 1 auto;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.dl-btn-split > .dl-btn.dropdown-toggle-split {
  flex: 0 0 44px;
  padding: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}

/* Stack of actions in the side column. */
.dl-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dl-actions > .btn.dl-btn,
.dl-actions > .dl-btn-split {
  width: 100%;
}

/* Filter options. */
.btn.dl-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 3.5rem;
  margin: 0;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  border: 1px solid rgba(var(--bs-primary-rgb), 0.45);
  border-radius: 999px;
  background: transparent;
  background-image: none;
  color: var(--bs-primary);
  box-shadow: none;
}

.btn.dl-chip:hover,
.btn.dl-chip:focus-visible {
  background: rgba(var(--bs-primary-rgb), 0.1);
  color: var(--bs-primary);
  border-color: var(--bs-primary);
  box-shadow: none;
}

.btn.dl-chip.active {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}

.btn.dl-chip--back {
  border-color: var(--bs-gray-300);
  color: var(--bs-gray-700);
}

/* Dark mode. */
.dark-version .btn.dl-btn--secondary {
  --dl-btn-bg: transparent;
  --dl-btn-color: rgba(255, 255, 255, 0.85);
  --dl-btn-border: rgba(255, 255, 255, 0.25);
  --dl-btn-hover-bg: rgba(255, 255, 255, 0.08);
  --dl-btn-hover-color: #fff;
  --dl-btn-hover-border: rgba(255, 255, 255, 0.4);
}

.dark-version .btn.dl-btn--danger {
  --dl-btn-bg: transparent;
}

.dark-version .btn.dl-chip--back {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.85);
}

/* E-mail preview (Admin → Emails). */
.dl-email-preview {
  display: block;
  width: 100%;
  height: 65vh;
  min-height: 420px;
  border: 1px solid var(--bs-gray-300);
  border-radius: 0.5rem;
  background: #fff;
  resize: vertical;
}

/* Notification preview (Admin → Notifications). */
.dl-notification-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.dl-notification-preview__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.dl-notification-preview__grid > div {
  width: 100%;
  max-width: 420px;
  text-align: left;
}

.dl-notification-preview__dropdown {
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: #fff;
}

.dl-notification-preview__row {
  min-height: 60px;
}

.dl-notification-preview__avatar {
  width: 40px;
  height: 40px;
}

.dl-notification-preview__dropdown .dropdown-item {
  white-space: normal;
  cursor: default;
}

.dl-notification-preview__description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.dl-notification-preview .min-width-0 {
  min-width: 0;
}

/* Read-only values of the admin keep their natural size. */
.dl-readonly-value {
  align-self: flex-start;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Rich read-only blocks (panels, previews) use the full width of the card. */
.dl-readonly-value--wide {
  align-self: stretch;
  width: 100%;
}

.dl-readonly-value img[src$="icon-yes.svg"],
.dl-readonly-value img[src$="icon-no.svg"],
.dl-readonly-value img[src$="icon-unknown.svg"],
.readonly img[src$="icon-yes.svg"],
.readonly img[src$="icon-no.svg"],
.readonly img[src$="icon-unknown.svg"] {
  width: 1rem;
  height: 1rem;
}

.dl-bool {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
}

.dl-bool i {
  font-size: 0.75rem;
}

.dl-bool--yes {
  background: rgba(76, 175, 80, 0.12);
  color: #2e7d32;
}

.dl-bool--no {
  background: rgba(244, 67, 53, 0.1);
  color: #c62828;
}

.dl-bool--unknown {
  background: var(--bs-gray-200);
  color: var(--bs-gray-700);
}

/* Notification control panel (Admin → Notificações → a published notification). */
.dl-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.dl-panel__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.dl-panel__metric,
.dl-panel__card {
  border: 1px solid var(--bs-gray-200);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  background: #fff;
}

.dl-panel__metric-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--bs-gray-900);
}

.dl-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.dl-panel__json {
  max-height: 320px;
  overflow: auto;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: var(--bs-gray-100);
  font-size: 0.8125rem;
  white-space: pre-wrap;
}

.dl-panel details summary {
  cursor: pointer;
}

.dl-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dl-timeline__step {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding-bottom: 1rem;
}

.dl-timeline__step:last-child {
  padding-bottom: 0;
}

.dl-timeline__step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 0.6875rem;
  top: 1.5rem;
  bottom: 0;
  width: 2px;
  background: var(--bs-gray-200);
}

.dl-timeline__dot {
  flex: 0 0 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid var(--bs-gray-300);
  background: #fff;
  font-size: 0.6875rem;
  color: #fff;
}

.dl-timeline__step--done .dl-timeline__dot {
  border-color: var(--bs-primary);
  background: var(--bs-primary);
  color: var(--dl-on-primary, #fff);
}

.dl-timeline__step--current .dl-timeline__dot {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.15);
}

.dl-timeline__step--warning .dl-timeline__dot {
  border-color: var(--bs-danger);
  background: var(--bs-danger);
}

.dark-version .dl-panel__metric,
.dark-version .dl-panel__card,
.dark-version .dl-timeline__dot {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Page header of form screens: where you are and what you are doing. */
.dl-page-header__trail {
  color: var(--bs-gray-500);
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
}

.dl-page-header__trail a {
  color: inherit;
}

.dl-page-header__trail a:hover {
  color: var(--bs-primary);
}

.dl-page-header + * {
  margin-top: 0;
}

/* Callouts (warnings inside a card). */
.dl-callout {
  display: flex;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.dl-callout > i {
  margin-top: 0.125rem;
  font-size: 1rem;
}

.dl-callout--danger {
  background: rgba(244, 67, 53, 0.08);
  border: 1px solid rgba(244, 67, 53, 0.25);
  color: #a52a21;
}

/* Delete confirmation. */
.dl-delete-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dl-delete-summary__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem 0.375rem 0.375rem;
  border: 1px solid var(--bs-gray-200);
  border-radius: 999px;
}

.dl-delete-summary__count {
  min-width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.375rem;
  border-radius: 999px;
  background: rgba(244, 67, 53, 0.1);
  color: #c62828;
  font-size: 0.8125rem;
  font-weight: 600;
}

.dl-delete-list summary {
  cursor: pointer;
}

.dl-delete-list ul {
  padding-left: 1.25rem;
}

/* Always keep the vertical scrollbar: the theme styles it (scrollbar.css, 10px), and a
   styled scrollbar takes layout space whenever it appears, so short screens were wider
   than long ones and everything aligned to the right (the notification bell, the side
   column) shifted between screens. The track is transparent, so on short screens the
   reserved space is invisible. (scrollbar-gutter does not reserve space for styled
   scrollbars, hence overflow-y.) */
html {
  overflow-y: scroll;
}

/* Password screens: the password rules under the field, as a compact list. */
.dl-password-field__help ul {
  margin: 0;
  padding-left: 1.1rem;
}

.dl-password-field__choices ul,
.dl-password-field__choices div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dl-password-field__choices label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
}

.dl-password-field__help li + li {
  margin-top: 0.125rem;
}

/* Django 5.1+ "password-based authentication: disabled": hide the password fields and
   show the "unset-password" button instead of "set-password" (Django does the same
   with :has on its own markup). */
.btn.dl-unset-password {
  display: none;
}

form:has(input[name="usable_password"][value="false"]:checked) .dl-password-field--secret {
  display: none;
}

body:has(input[name="usable_password"][value="false"]:checked) .btn.dl-set-password {
  display: none;
}

body:has(input[name="usable_password"][value="false"]:checked) .btn.dl-unset-password {
  display: inline-flex;
}

/* Change form sections: pills with room around each label, wrapping when there
   are many; a selector in the style of the Save button in narrow windows
   (see changeform/horizontal_tabs.html). */
.dl-tabs .nav-pills {
  gap: 0.25rem;
}

.dl-tabs .nav-pills .nav-item {
  flex: 0 1 auto;
}

.dl-tabs .nav-pills .nav-link {
  white-space: nowrap;
}

.dl-tabs .dl-tab-select {
  display: none;
}

/* A tab whose fields have errors (issue #47): red label and a counter. */
.dl-tabs .nav-link.dl-tab--error,
.dl-tab-select .dropdown-item.dl-tab--error {
  color: var(--bs-danger, #d93025);
}

.dl-tab-errors {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.375rem;
  padding: 0 0.375rem;
  border-radius: 999px;
  background: var(--bs-danger, #d93025);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
}

/* Fields with errors: the Material inputs only colour the underline, which is easy to miss. */
.errorlist,
.errorlist li,
.help-block.text-red li {
  color: var(--bs-danger, #d93025);
  font-size: 0.8125rem;
  font-weight: 600;
}

.errors .input-group .form-control,
.errors .select2-selection,
.errors .form-control,
.input-group.is-invalid .form-control {
  border-bottom: 2px solid var(--bs-danger, #d93025) !important;
}

.dl-tabs--compact .dl-tab-select {
  display: flex;
  margin-top: 1.5rem;
}

.dl-tabs--compact .nav-wrapper {
  display: none;
}

.dl-tab-select .dl-tab-select__current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-start;
  text-align: left;
  font-weight: 600;
  min-width: 0;
}

.dl-tab-select .dl-tab-select__current > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dl-tab-select .dl-tab-select__label {
  font-weight: 400;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-gray-600);
}

.dl-tab-select > .dl-btn--secondary.dropdown-toggle-split {
  border-left: 1px solid var(--bs-gray-300);
}

.dl-tab-select .dropdown-item.active,
.dl-tab-select .dropdown-item:active {
  background: var(--bs-gray-100);
  color: var(--bs-gray-900);
  font-weight: 600;
}

.dl-tab-select .dropdown-item.active::after {
  content: "\2713";
  float: right;
  color: var(--bs-primary);
}

.dark-version .dl-tab-select .dl-tab-select__label {
  color: rgba(255, 255, 255, 0.6);
}

.dark-version .dl-tab-select > .dl-btn--secondary.dropdown-toggle-split {
  border-left-color: rgba(255, 255, 255, 0.25);
}

/* Change list actions: Django's actions.js shows and hides the "select all N" question,
   the "all selected" note and "clear selection" with the .hidden class (admin/actions.html). */
.actions .hidden {
  display: none !important;
}

.actions .question a,
.actions .clear a {
  font-weight: 600;
}

/* The bar of actions (admin/actions.html, 0.30): while rows are chosen, a white bar that floats at the bottom of
   the screen over the list (sticky: it settles under the table at the end), like the accept bar of the terms.
   Same height, radius and borders as the filter bar (filters.css); it does not push the table down. */
.dl-bulk-dock {
  position: sticky;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 0 1rem;
  pointer-events: none; /* the dock is as wide as the list; only the bar takes clicks */
}

/* Phones (bottom menu): the card scrolls, not the page, so sticky put the bar in the middle of the screen. There the
   bar takes the place of the bottom menu while rows are chosen: the menu goes away and the bar floats where it was,
   the same card as on wide screens; with no row chosen ("×" or the last box) the menu comes back. Nothing to navigate
   to in the middle of a choice, and the room of the menu goes to the list. No slide from the edge: the menu is
   simply swapped, and the bar comes in as on wide screens. The end of the list gets the room of the bar so its last
   rows can come out from under it. */
.container-height-mobile .dl-bulk-dock {
  position: fixed;
  right: 0;
  bottom: calc(0.625rem + env(safe-area-inset-bottom));
  left: 0;
  z-index: 1023;
  padding: 0 0.625rem;
}

.container-height-mobile .dl-bulk-dock .dl-bulk {
  width: 100%;
  margin: 0;
}

/* The lamp button sits inside the footer, so it goes away too. Both ways a cross-fade: the menu fades out while the
   bar comes in, and fades back in (its icons rising a little) while the bar goes (.is-leaving, actions.html).
   Opacity on the footer, never a transform: that would make the footer the box of its fixed panels, and the bell's
   panel, hidden under the screen, slid through it. The icons (plain links) can move. */
.footer-mobile {
  transition: opacity 0.3s ease-out, visibility 0s, bottom 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-mobile .iconNavBottomBar {
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

body:has(.container-height-mobile #actions-container:not(.d-none):not(.is-leaving)) .footer-mobile {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.22s ease-in, visibility 0s 0.22s, bottom 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

body:has(.container-height-mobile #actions-container:not(.d-none):not(.is-leaving)) .footer-mobile .iconNavBottomBar {
  transform: translateY(6px);
}

.container-height-mobile .dl-changelist-card:has(#actions-container:not(.d-none)) {
  padding-bottom: 3rem; /* the bar is taller than the menu it replaces */
}

.dl-bulk {
  --dl-b-height: 40px;
  flex-wrap: wrap; /* two lines: the numbers on top, the action below */
  --dl-b-radius: 0.5rem;
  --dl-b-bg: #fff;
  --dl-b-border: var(--bs-gray-300, #d4d4d4);
  --dl-b-text: var(--bs-gray-800, #262626);
  --dl-b-muted: var(--bs-secondary-color, #737373);
  display: flex;
  align-items: center;
  gap: 0.5rem 1.25rem;
  width: min(100%, 52rem);
  margin: 0.75rem 0;
  padding: 0.625rem 0.75rem 0.75rem;
  border: 1px solid var(--dl-b-border);
  border-radius: 0.875rem;
  background: var(--dl-b-bg);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.06);
  pointer-events: auto;
  animation: dl-bulk-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes dl-bulk-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

/* "×" or the last box: the bar goes as it came, then the bottom menu of phones comes back. */
.dl-bulk.is-leaving {
  animation: dl-bulk-out 0.24s ease-in forwards;
  pointer-events: none;
}

@keyframes dl-bulk-fade-in {
  from {
    opacity: 0;
  }
}

@keyframes dl-bulk-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes dl-bulk-out {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.dark-version .dl-bulk {
  --dl-b-bg: #1d1d1d;
  --dl-b-border: #404040;
  --dl-b-text: rgba(255, 255, 255, 0.85);
  --dl-b-muted: #a3a3a3;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.6);
}

/* The line on top: the count, "select all N" or "clear selection", and "×" at the end. */
.dl-bulk__head {
  display: flex;
  flex: 1 1 100%;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}

.dl-bulk__selection {
  display: flex;
  padding: 0.25rem 0.25rem 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.125rem 0.75rem;
  min-width: 0;
  color: var(--dl-b-text);
  font-size: 0.875rem;
}

.dl-bulk .action-counter {
  font-weight: 600;
  white-space: nowrap;
}

.dl-bulk .all {
  font-weight: 600; /* "Todos os 240 selecionados" is the state now, like the counter */
}

.dl-bulk .question a,
.dl-bulk .clear a {
  color: var(--bs-primary);
  font-size: 0.8125rem;
}

.dl-bulk__run {
  display: flex;
  flex: 1 1 100%; /* the line below, the whole width */
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  min-width: 0;
}

.dl-bulk__field {
  flex: 1 1 auto;
  min-width: 12rem;
}

.dl-bulk select.dl-bulk__select {
  display: block;
  width: 100%;
  height: var(--dl-b-height);
  padding: 0 2.25rem 0 0.75rem;
  border: 1px solid var(--dl-b-border);
  border-radius: var(--dl-b-radius);
  background: var(--dl-b-bg) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right 0.75rem center / 12px 12px;
  color: var(--dl-b-text);
  font-size: 0.875rem;
  appearance: none;
  -webkit-appearance: none;
}

.dl-bulk .select2-container {
  width: 100% !important;
}

.dl-bulk .select2-container--default .select2-selection--single {
  display: flex;
  align-items: center;
  height: var(--dl-b-height);
  padding: 0 2rem 0 0.75rem;
  border: 1px solid var(--dl-b-border);
  border-radius: var(--dl-b-radius);
  background: var(--dl-b-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dl-bulk .select2-container--default:hover .select2-selection {
  border-color: var(--bs-gray-400, #a3a3a3);
}

.dl-bulk .select2-container--default.select2-container--focus .select2-selection,
.dl-bulk .select2-container--default.select2-container--open .select2-selection,
.dl-bulk select.dl-bulk__select:focus {
  outline: none;
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.18);
}

.dl-bulk .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding: 0;
  color: var(--dl-b-text);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.dl-bulk .select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--dl-b-muted);
}

.dl-bulk .select2-container--default .select2-selection--single .select2-selection__arrow {
  top: 50%;
  right: 0.5rem;
  height: 20px;
  transform: translateY(-50%);
}

.dl-bulk .dl-bulk__submit {
  flex: 0 0 auto;
  height: var(--dl-b-height);
  margin: 0;
  padding: 0 1.125rem;
}

.dl-bulk__close {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: -0.25rem 0 -0.25rem 0;
  padding: 0;
  border: 0;
  border-radius: var(--dl-b-radius);
  background: transparent;
  color: var(--dl-b-muted);
  cursor: pointer;
}

.dl-bulk__close:hover,
.dl-bulk__close:focus-visible {
  background: var(--bs-gray-100, #f5f5f5);
  color: var(--dl-b-text);
}

.dark-version .dl-bulk__close:hover {
  background: #262626;
}

@media (max-width: 767.98px) {
  .dl-bulk-dock {
    padding: 0 0.5rem;
  }

  .container-height-mobile .dl-bulk-dock {
    padding: 0 0.625rem;
  }

  .dl-bulk__field {
    min-width: 0; /* the select gives way: "Executar" and "×" always fit */
  }

  .dl-bulk .dl-bulk__submit {
    padding: 0 0.875rem;
  }

}

/* ------------------------------------------------------------------ interface fixes (issue #54) */

/* 1. Side menu: every item the same height, collapsed or not, so the active highlight lines up. */
.sidenav .navbar-nav > .nav-item > .nav-link {
  min-height: 40px;
  display: flex;
  align-items: center;
}

/* Only the collapsed menu of a wide screen: on a phone the open menu has the same body class, and the
   Dashboard ended up centred while the other items stayed on the left (0.29.6). */
@media (min-width: 1200px) {
  .g-sidenav-hidden .sidenav:not(:hover) .navbar-nav > .nav-item > .nav-link {
    justify-content: center;
  }
}

/* Bell of the top bar (0.29.4): the panel never wider than the screen, and the list inside it scrolls,
   so the empty message stays in the panel. 50vh is the panel's height (material-dashboard.css) less its
   padding. */
.notification-content-desktop {
  max-width: calc(100vw - 1rem);
}

.dl-bell-desktop-list {
  max-height: calc(50vh - 1rem);
}

/* Nothing to list: only as tall as the message, not half the screen of grey. */
.notification-content-desktop:has(> [data-dl-bell-empty]:not([hidden])) {
  min-height: 0;
}

/* Side menu icons in the primary colour, when the site or the project chooses it (0.29.5; grey is the
   default). In dark mode, the primary lightened until it reads on the dark menu. The id and !important
   beat the theme's own !important rules: white icons in dark mode, near-black on the current page. */
#sidenav-main .dl-sidenav-icon--primary {
  color: var(--bs-primary) !important;
}

.dark-version #sidenav-main .dl-sidenav-icon--primary {
  color: var(--dl-primary-dark) !important;
}

/* Long names in the side menu end in "…" instead of crossing its edge; the link's title shows the whole
   name on hover (0.29.4). A flex item does not shrink below its text without min-width: 0. */
.sidenav .nav-link > .text-truncate {
  min-width: 0;
}

/* The signed-in user at the bottom of the side menu (0.29.6). The menu is a column: the list of apps
   takes the room left and scrolls by itself, so the user card stays at the bottom. Only the dlight's own
   sidenav.html has data-dl-sidenav-user; a project that overrides the template keeps its layout. The
   theme's .navbar wraps and centres its items: on one column, stretched, the card never goes to the side. */
#sidenav-main[data-dl-sidenav-user] {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  overflow-y: hidden;
}

#sidenav-main[data-dl-sidenav-user] > * {
  min-width: 0;
}

#sidenav-main[data-dl-sidenav-user] > .navbar-collapse {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.dl-sidenav-user {
  position: relative;
  flex: 0 0 auto;
  padding: 0.5rem 0.75rem 0.75rem;
}

/* The card: the person, and the logout over its right side only on hover or focus (always on touch
   screens, which have no hover). The opaque --dl-user-card lets the button cover the end of the text. */
.dl-sidenav-user__card {
  --dl-user-card: #f7f7f8;
  --dl-user-card-hover: #f0f0f2;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 0.875rem;
  background: var(--dl-user-card);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.dark-version .dl-sidenav-user__card {
  --dl-user-card: #262626;
  --dl-user-card-hover: #2e2e2e;
  border-color: rgba(255, 255, 255, 0.07);
}

.dl-sidenav-user__card:is(:hover, :focus-within) {
  --dl-user-card: var(--dl-user-card-hover);
}

.dl-sidenav-user__toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
  padding: 0.625rem 0.75rem;
  border: 0;
  border-radius: inherit;
  background: transparent;
  text-align: left;
}

.dl-sidenav-user__toggle:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

.dl-sidenav-user__avatar {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
}

.dl-sidenav-user__avatar--lg {
  width: 2.5rem;
  height: 2.5rem;
}

.dl-sidenav-user__avatar > .avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.dark-version .dl-sidenav-user__avatar > .avatar {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.dl-sidenav-user__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.dl-sidenav-user__name {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.dl-sidenav-user__detail {
  font-size: 0.75rem;
  opacity: 0.6;
}

.dl-sidenav-user__logout {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  margin: 0;
  padding-left: 1.25rem;
  background: linear-gradient(to right, transparent, var(--dl-user-card) 1.25rem);
  border-radius: 0 0.5rem 0.5rem 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(0.25rem);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.dl-sidenav-user__card:is(:hover, :focus-within) .dl-sidenav-user__logout {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
}

.dl-sidenav-user__logout button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  font-size: 0.875rem;
  opacity: 0.65;
  transition: background-color 0.15s ease, opacity 0.15s ease, color 0.15s ease;
}

.dl-sidenav-user__logout button:is(:hover, :focus-visible) {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545 !important;
  opacity: 1;
}

@media (hover: none) {
  .dl-sidenav-user__logout {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%);
  }

  .dl-sidenav-user__toggle {
    padding-right: 3rem;
  }
}

/* The person at the top of the panel: the whole name and e-mail, which the card cuts, and the role. */
.dl-sidenav-user__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.625rem 0.5rem 0.75rem;
  margin-bottom: 0.375rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dark-version .dl-sidenav-user__head {
  border-color: rgba(255, 255, 255, 0.08);
}

.dl-sidenav-user__role {
  align-self: flex-start;
  margin-top: 0.375rem;
  padding: 0.0625rem 0.5rem;
  border-radius: 50rem;
  background: rgba(var(--bs-primary-rgb), 0.12);
  color: var(--bs-primary);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.dark-version .dl-sidenav-user__role {
  color: var(--dl-primary-dark);
}

/* The account options: a panel floating above the card, as wide as it, opened by the card. */
.dl-sidenav-user__menu {
  position: absolute;
  z-index: 2;
  right: 0.75rem;
  bottom: calc(100% - 0.125rem);
  left: 0.75rem;
  max-height: min(60vh, 26rem);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.375rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.375rem);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}

.dl-sidenav-user__menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.dark-version .dl-sidenav-user__menu {
  border-color: rgba(255, 255, 255, 0.08);
  background: #262626;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.dl-sidenav-user__menu .nav {
  flex-direction: column;
  flex-wrap: nowrap;
}

.dl-sidenav-user__menu .nav-item {
  width: 100%;
}

/* The items keep the markup of profile_options.html (and of the projects' additional options): a
   .nav-link with a .sidenav-mini-icon and a .sidenav-normal, whose ms-3 ps-1 spacing is undone here. */
.dl-sidenav-user__menu .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.3;
  white-space: normal;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.dl-sidenav-user__menu .nav-link:is(:hover, :focus-visible) {
  background: rgba(0, 0, 0, 0.05);
}

.dark-version .dl-sidenav-user__menu .nav-link:is(:hover, :focus-visible) {
  background: rgba(255, 255, 255, 0.08);
}

.dl-sidenav-user__menu .nav-link .sidenav-mini-icon {
  display: inline-flex;
  flex: 0 0 1.125rem;
  justify-content: center;
  margin: 0;
  font-size: 0.8125rem;
  opacity: 0.55;
}

.dl-sidenav-user__menu .nav-link .sidenav-normal {
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
}

/* Logout is the card's button and the last item of the panel; the one of profile_options.html stays in
   the HTML for overridden sidenavs. */
.dl-sidenav-user__menu .nav-item:has(> #logout-form) {
  display: none;
}

.dl-sidenav-user__divider {
  height: 1px;
  margin: 0.375rem 0.625rem;
  background: rgba(0, 0, 0, 0.08);
  list-style: none;
}

.dark-version .dl-sidenav-user__divider {
  background: rgba(255, 255, 255, 0.08);
}

.dl-sidenav-user__divider + .dl-sidenav-user__divider {
  display: none; /* the project adds no options */
}

.dl-sidenav-user__signout form {
  margin: 0;
}

.dl-sidenav-user__menu .dl-sidenav-user__signout .nav-link {
  border: 0;
  background: none;
  color: var(--bs-danger, #e53935) !important; /* the theme forces the links white in dark mode */
  text-align: left;
}

.dark-version .dl-sidenav-user__menu .dl-sidenav-user__signout .nav-link {
  color: #ff6b6b !important;
}

.dl-sidenav-user__menu .dl-sidenav-user__signout .nav-link .sidenav-mini-icon {
  opacity: 1;
}

.dl-sidenav-user__menu .dl-sidenav-user__signout .nav-link:is(:hover, :focus-visible) {
  background: rgba(229, 57, 53, 0.08);
}

/* Collapsed menu: only the avatar, centred; the options and the logout come back on hover. Only on a
   wide screen: on a phone the menu opens whole, with the same body class. */
@media (min-width: 1200px) {
  .g-sidenav-hidden .sidenav:not(:hover) .dl-sidenav-user :is(.dl-sidenav-user__text, .dl-sidenav-user__logout),
  .g-sidenav-hidden .sidenav:not(:hover) .dl-sidenav-user #ProfileNav {
    display: none !important;
  }

  .g-sidenav-hidden .sidenav:not(:hover) .dl-sidenav-user__card {
    border-color: transparent;
    background: transparent;
  }

  .g-sidenav-hidden .sidenav:not(:hover) .dl-sidenav-user__toggle {
    justify-content: center;
    padding-right: 0.75rem;
  }
}

/* Collapsed side menu expands on hover (issue #53) over the page, instead of pushing it: the
   content keeps the collapsed margin, and the menu opens after a short pause so that just
   crossing it with the mouse does not open it. */
@media (min-width: 1200px) {
  .g-sidenav-hidden .navbar-vertical.fixed-start:hover + .main-content {
    margin-left: 6.25rem; /* the collapsed margin of the theme */
  }

  .g-sidenav-hidden .navbar-vertical.fixed-start {
    transition: max-width 0.2s ease 0.15s, box-shadow 0.2s ease 0.15s;
  }

  .g-sidenav-hidden .navbar-vertical.fixed-start:hover {
    z-index: 1040;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.15);
  }
}

/* 2. Date inputs: as wide as the other fields, and the label never over the typed value. */
.input-group-static .datetimepicker,
.input-group-static .datetimepickerTime,
input[data-flatpickr-wrapper] {
  width: 100%;
  min-width: 10rem;
}

.input-group.input-group-static > label {
  position: static;
  transform: none;
  margin-bottom: 0.25rem;
}

/* 3. The close button of the side menu on phones and tablets. */
.dl-sidenav-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.125rem;
  cursor: pointer;
}

.dl-sidenav-close:hover,
.dl-sidenav-close:focus-visible {
  background: rgba(0, 0, 0, 0.06);
}

/* 4. The dashboard calendar (0.30): one frame, the card's. Before: the padding of the card, the gutter of the row
   around it and a border around the grid, three layers in a narrow column, and the title on two lines. Now the
   header has the usual room, the title stays on one line (smaller in a narrow card), the arrows are the quiet
   buttons of the rest, the grid goes edge to edge with lines only between the days, and today is a circle in the
   theme's colour. Without the card (phone), the same grid with its border. */
.card-calendar,
.dl-calendar-board {
  --dl-cal-line: var(--bs-gray-200, #e5e5e5);
  --dl-cal-muted: var(--bs-secondary-color, #737373);
  --dl-cal-text: var(--bs-gray-800, #262626);
  container-type: inline-size;
}

.dark-version .card-calendar,
.dark-version .dl-calendar-board {
  --dl-cal-line: #333;
  --dl-cal-muted: #a3a3a3;
  --dl-cal-text: rgba(255, 255, 255, 0.85);
}

.row > .card.card-calendar {
  padding: 0;
  overflow: hidden;
}

.card.card-calendar > .card-body {
  padding: 1rem 0 0 !important;
}

.card-calendar .fc .fc-toolbar.fc-header-toolbar {
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.card.card-calendar .fc .fc-toolbar.fc-header-toolbar {
  padding: 0 1rem;
}

.card-calendar .fc .fc-toolbar-chunk:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.card-calendar .fc .fc-toolbar-title {
  overflow: hidden;
  color: var(--dl-cal-text);
  font-size: 1rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-calendar .fc .fc-toolbar-title::first-letter {
  text-transform: uppercase;
}

@container (max-width: 260px) {
  .card-calendar .fc .fc-toolbar-title {
    font-size: 0.9375rem;
  }
}

.card-calendar .fc .fc-button-group {
  gap: 0.25rem;
}

/* 0.32: the next events under the card's grid use the card's full width (the theme indents every ul). */
.card-calendar .dl-calendar__upcoming {
  padding-left: 0;
}

.card-calendar .dl-calendar__upcoming li {
  padding-left: 0;
}

.card-calendar .fc .fc-button-primary,
.card-calendar .fc .fc-button-primary:not(:disabled):active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0 !important;
  padding: 0;
  border: 1px solid var(--dl-cal-line) !important;
  border-radius: 0.5rem !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--dl-cal-muted) !important;
}

.card-calendar .fc .fc-button-primary:hover,
.card-calendar .fc .fc-button-primary:focus-visible {
  border-color: rgba(var(--bs-primary-rgb), 0.4) !important;
  background: rgba(var(--bs-primary-rgb), 0.08) !important;
  color: var(--bs-primary) !important;
}

/* The grid: lines between the days only; the card is the frame. */
.card.card-calendar .fc .fc-scrollgrid,
.card.card-calendar .fc-theme-standard td,
.card.card-calendar .fc-theme-standard th {
  border: 0 !important;
}

.card.card-calendar .fc .fc-daygrid-day {
  border-top: 1px solid var(--dl-cal-line) !important;
}

.card.card-calendar .fc .fc-daygrid-day + .fc-daygrid-day {
  border-left: 1px solid var(--dl-cal-line) !important;
}

.card-calendar:not(.card) .fc .fc-scrollgrid {
  border: 1px solid var(--dl-cal-line) !important;
  border-radius: 0.5rem;
  overflow: hidden;
}

.card-calendar .fc .fc-col-header-cell-cushion {
  padding: 0.375rem 0;
  color: var(--dl-cal-muted);
  font-size: 0.6875rem;
  font-weight: 600;
}

.card-calendar .fc .fc-daygrid-day-top {
  justify-content: center;
  padding-top: 0.25rem;
}

.card-calendar .fc .fc-daygrid-day-number {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 1.75rem !important;
  height: 1.75rem;
  padding: 0 !important;
  border-radius: 50%;
  color: var(--dl-cal-text);
  font-size: 0.8125rem;
}

.card-calendar .fc .fc-day-other .fc-daygrid-day-number {
  color: var(--dl-cal-muted);
  opacity: 0.6;
}

.card-calendar .fc .fc-daygrid-day.fc-day-today {
  background: transparent;
}

.card-calendar .fc .fc-day-today .fc-daygrid-day-number {
  background: var(--bs-primary);
  color: #fff;
  font-weight: 600;
}

/* Room for the events of the future, less empty height today. */
.card-calendar .fc .fc-daygrid-body-unbalanced .fc-daygrid-day-events {
  min-height: 1rem;
}

/* The admin's Calendário screen (0.32): the same look as the home card. Plain buttons with a line (the current
   view in the theme's colour), today as a circle, events in the text colour (the theme paints every <a>), the
   grid with lines only between the days. */
.dl-calendar-board .fc .fc-toolbar.fc-header-toolbar {
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.dl-calendar-board .fc .fc-toolbar-title {
  color: var(--dl-cal-text);
  font-size: 1.125rem;
  font-weight: 600;
}

.dl-calendar-board .fc .fc-toolbar-title::first-letter {
  text-transform: uppercase;
}

.dl-calendar-board .fc .fc-button-group {
  gap: 0.25rem;
}

.dl-calendar-board .fc .fc-button-primary,
.dl-calendar-board .fc .fc-button-primary:disabled,
.dl-calendar-board .fc .fc-button-primary:not(:disabled):active {
  height: 2rem;
  margin: 0 !important;
  padding: 0 0.75rem;
  border: 1px solid var(--dl-cal-line) !important;
  border-radius: 0.5rem !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--dl-cal-text) !important;
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: none;
}

.dl-calendar-board .fc .fc-prev-button,
.dl-calendar-board .fc .fc-next-button {
  width: 2rem;
  padding: 0;
}

.dl-calendar-board .fc .fc-button-primary:disabled {
  opacity: 0.45;
}

.dl-calendar-board .fc .fc-button-primary:hover,
.dl-calendar-board .fc .fc-button-primary:focus-visible {
  border-color: rgba(var(--bs-primary-rgb), 0.4) !important;
  background: rgba(var(--bs-primary-rgb), 0.08) !important;
  color: var(--bs-primary) !important;
}

.dl-calendar-board .fc .fc-button-primary.fc-button-active,
.dl-calendar-board .fc .fc-button-primary.fc-button-active:hover {
  border-color: var(--bs-primary) !important;
  background: rgba(var(--bs-primary-rgb), 0.12) !important;
  color: var(--bs-primary) !important;
}

.dl-calendar-board .fc .fc-scrollgrid,
.dl-calendar-board .fc-theme-standard td,
.dl-calendar-board .fc-theme-standard th {
  border-color: var(--dl-cal-line) !important;
}

.dl-calendar-board .fc .fc-scrollgrid {
  border-radius: 0.5rem;
  overflow: hidden;
}

.dl-calendar-board .fc .fc-col-header-cell-cushion {
  padding: 0.5rem 0;
  color: var(--dl-cal-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.dl-calendar-board .fc .fc-daygrid-day-top {
  justify-content: center;
  padding-top: 0.25rem;
}

.dl-calendar-board .fc .fc-daygrid-day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0 !important;
  border-radius: 50%;
  color: var(--dl-cal-text);
  font-size: 0.8125rem;
}

.dl-calendar-board .fc .fc-day-other .fc-daygrid-day-number {
  color: var(--dl-cal-muted);
  opacity: 0.6;
}

.dl-calendar-board .fc .fc-day-today,
.dl-calendar-board .fc .fc-timegrid-col.fc-day-today {
  background: transparent !important;
}

.dl-calendar-board .fc .fc-day-today .fc-daygrid-day-number {
  background: var(--bs-primary);
  color: #fff;
  font-weight: 600;
}

/* Timed events (a dot, the time and the title): the text colour, not the link colour; all-day ones keep their
   coloured bar with white text. */
.dl-calendar-board .fc .fc-daygrid-dot-event,
.dl-calendar-board .fc .fc-daygrid-dot-event:hover,
.dl-calendar-board .fc .fc-list-event a {
  color: var(--dl-cal-text);
}

.dl-calendar-board .fc .fc-daygrid-dot-event .fc-event-time {
  color: var(--dl-cal-muted);
  font-weight: 400;
}

.dl-calendar-board .fc .fc-daygrid-dot-event .fc-event-title {
  font-weight: 500;
}

.dl-calendar-board .fc .fc-daygrid-event {
  margin-top: 2px;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  white-space: normal;
}

.dl-calendar-board .fc .fc-daygrid-block-event .fc-event-main {
  padding: 1px 4px;
}

.dl-calendar-board .dl-calendar__layer {
  border-color: var(--dl-cal-line);
  color: var(--dl-cal-text);
}

/* The links of the person: the address in a field, copy and revoke beside it. */
.dl-calendar-board .dl-feed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.dl-calendar-board .dl-feed input {
  flex: 1 1 18rem;
  min-width: 0;
  font-family: var(--bs-font-monospace, monospace);
  font-size: 0.75rem;
}

/* Delete confirmation in a modal (issue #2): the page's two columns, stacked. */
.dl-delete-modal {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dl-delete-modal .card {
  box-shadow: none;
}

.dl-delete-modal .card-body {
  padding: 0;
}

.dl-delete-modal__actions .col-xl-3,
.dl-delete-modal__actions [class*="col-"] {
  width: 100%;
  max-width: 100%;
  flex: 1 1 auto;
  margin-top: 0 !important;
}

.dl-delete-modal__actions .dl-actions {
  flex-direction: row;
  justify-content: flex-end;
}

.dl-delete-modal__actions .dl-actions .btn.dl-btn {
  width: auto;
}

/* Inline rows: a trash button instead of the "Remover?" checkbox, and a bar to bring them back (issue #22). */
.dl-inline-trash__checkbox {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none;
}

.dl-inline-trash {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--bs-danger, #d93025);
  cursor: pointer;
}

.dl-inline-trash:hover,
.dl-inline-trash:focus-visible {
  background: rgba(217, 48, 37, 0.1);
}

.dl-inline-restore {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(217, 48, 37, 0.08);
  color: var(--bs-danger, #d93025);
  font-size: 0.8125rem;
  font-weight: 600;
}

.dl-inline-restore[hidden] {
  display: none;
}

/* "Você tem N alterações não salvas" when switching tabs (issue #23). */
.dl-unsaved-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 1080;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: #344767;
  color: #fff;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, 1rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dl-unsaved-toast--show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Permissions of users and groups (issue #48). Built from the theme's pieces: form-switch, dl-chip,
   dl-callout and the list headers. The layout follows the width of the component (container queries):
   a table with one column per action when there is room, a list of switches when there is not. */
.dl-callout--info {
  background: rgba(var(--bs-primary-rgb), 0.06);
  border: 1px solid rgba(var(--bs-primary-rgb), 0.2);
  color: var(--bs-gray-800);
}

.dl-perms {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.dl-perms__help > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--bs-secondary-color, #737373);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.dl-perms__help > summary::-webkit-details-marker {
  display: none;
}

.dl-perms__help[open] > summary {
  margin-bottom: 0.5rem;
  color: var(--bs-primary);
}

.dl-perms__help-list {
  display: grid;
  gap: 0.375rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

.dl-perms__help-term {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 7.5rem;
  font-weight: 700;
}

.dl-perms__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.dl-perms__search {
  flex: 1 1 14rem;
}

.dl-perms__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dl-perms__count {
  margin-left: auto;
  white-space: nowrap;
}

.dl-perms__empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
}

.dl-perms__app {
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.dark-version .dl-perms__app {
  background: transparent;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* The header of an app looks like the tabs bar of the change form. */
.dl-perms__app-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  background: #f5f5f5;
  cursor: pointer;
  list-style: none;
}

.dark-version .dl-perms__app-head {
  background: #171717;
}

.dl-perms__app[open] > .dl-perms__app-head {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.dl-perms__app-head::-webkit-details-marker {
  display: none;
}

.dl-perms__chevron {
  font-size: 0.75rem;
  color: var(--bs-secondary-color, #737373);
  transition: transform 0.15s ease;
}

.dl-perms__app[open] .dl-perms__chevron {
  transform: rotate(90deg);
}

.dl-perms__app-name {
  flex: 1;
  min-width: 0;
}

.dl-perms__pill {
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--bs-secondary-color, #737373);
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

.dl-perms__app.has-checked > .dl-perms__app-head .dl-perms__pill,
.dl-perms__model.is-partial .dl-perms__pill {
  background: rgba(var(--bs-primary-rgb), 0.12);
  color: var(--bs-primary);
}

.dl-perms__switch .form-check-label {
  margin-left: 0.25rem;
  white-space: nowrap;
}

/* Rows: one column for the model, one per action, one for "Tudo". Fluid, so nothing is cut. */
.dl-perms__head,
.dl-perms__model {
  display: grid;
  grid-template-columns: minmax(8rem, 2fr) repeat(5, minmax(3.5rem, 1fr));
  align-items: center;
  column-gap: 0.5rem;
  padding: 0.5rem 1rem;
}

.dl-perms__head {
  padding-top: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--bs-secondary-color, #737373);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dl-perms__head > span:not(.dl-perms__head-name) {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
}

.dl-perms__model {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.15s ease;
}

.dl-perms__model:last-child {
  border-bottom: 0;
}

.dl-perms__model:hover {
  background: rgba(0, 0, 0, 0.015);
}

.dl-perms__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dl-perms__actions {
  display: contents;
}

.dl-perms__cell {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 2.25rem;
  border-radius: 0.5rem;
  transition: background 0.3s ease;
}

.dl-perms__cell .form-check {
  display: flex;
  align-items: center;
  padding-left: 0;
  min-height: 0;
}

.dl-perms__cell .form-check-input {
  float: none;
  margin: 0;
}

/* In the table the column header names the action: the labels are for screen readers. */
.dl-perms__cell .form-check-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* "Tudo" with part of the row ticked: the theme's switch colour, half-way. */
.dl-perms .form-switch .form-check-input:indeterminate {
  background-color: rgba(66, 66, 74, 0.45);
  background-image: none;
  border-color: transparent;
}

.dl-perms .form-switch .form-check-input:indeterminate:after {
  transform: translateX(11px);
  border-color: #42424a;
}

.dl-perms__cell.is-flash {
  background: rgba(var(--bs-primary-rgb), 0.15);
}

.dl-perms__na {
  color: var(--bs-gray-400);
}

.dl-perms__others {
  grid-column: 1 / -1;
  padding: 0.5rem 0 0.25rem;
}

.dl-perms__others-title {
  margin: 0 0 0.375rem;
  color: var(--bs-secondary-color, #737373);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dl-perms__others-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.375rem 1rem;
}

.dl-perms__other {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0;
  min-height: 2rem;
}

.dl-perms__other .form-check-input {
  float: none;
  flex: 0 0 auto;
  margin: 0;
}

.dl-perms__other .form-check-label {
  margin: 0;
}

.dl-perms [hidden] {
  display: none !important;
}

/* Narrow (the component, not the window): the model on top, "Tudo" at its right, the actions as a
   two-column list of labelled switches with 44px touch targets. */
@container (max-width: 40rem) {
  .dl-perms__head {
    display: none;
  }

  .dl-perms__model {
    grid-template-columns: 1fr auto;
    row-gap: 0.25rem;
    padding: 0.75rem;
  }

  .dl-perms__cell--all {
    grid-column: 2;
    grid-row: 1;
  }

  .dl-perms__actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem 0.75rem;
  }

  .dl-perms__cell {
    justify-content: flex-start;
    min-height: 2.75rem;
  }

  .dl-perms__cell .form-check,
  .dl-perms__cell--all .form-check {
    gap: 0.5rem;
  }

  .dl-perms__cell .form-check-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0;
    font-size: 0.875rem;
  }

  .dl-perms__cell .form-check-label i {
    width: 1rem;
    color: var(--bs-secondary-color, #737373);
    text-align: center;
  }

  .dl-perms__cell .dl-perms__na {
    display: none;
  }

  .dl-perms__cell:has(.dl-perms__na) {
    display: none;
  }

  .dl-perms__others-list {
    grid-template-columns: 1fr;
  }

  .dl-perms__other {
    min-height: 2.75rem;
  }

  .dl-perms__count {
    margin-left: 0;
  }

  .dl-perms__help-list li {
    display: flex;
    flex-direction: column;
  }
}

/* Notifications of the admin bell: "Nova" on the ones that arrived since the bell was last opened
   (bell.js: data-dl-bell-unviewed), a primary tint and a bold title on the ones not read yet
   (data-dl-bell-unread). Clicking one, or reading all, clears both. */
.dl-admin-bell__new {
  display: none;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--bs-primary);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* On the item: bell.js also puts data-dl-bell-unviewed="<count>" on the bell itself. */
[data-dl-bell-item-root][data-dl-bell-unviewed] .dl-admin-bell__new {
  display: inline-block;
}

[data-dl-bell-item-root][data-dl-bell-unread] > .dl-admin-bell__link {
  background: rgba(var(--bs-primary-rgb), 0.08);
}

[data-dl-bell-item-root][data-dl-bell-unread] .dl-admin-bell__title {
  font-weight: 700;
  color: var(--bs-gray-900, #212121);
}

.dark-version [data-dl-bell-item-root][data-dl-bell-unread] .dl-admin-bell__title {
  color: #fff;
}

/* Notification bell of the admin: no badge when nothing is new. The badge carries the theme's
   .d-flex (display: flex !important), which beat the [hidden] set by bell.js and the template:
   it showed "0", and an empty pill after opening the bell. */
[data-dl-bell-badge][hidden] {
  display: none !important;
}

/* One notification in the admin bell (dlight_admin/notifications/admin_bell_item.html). */
.dl-admin-bell__link {
  transition: all 0.3s ease;
}

.dl-admin-bell__row {
  min-height: 60px;
  cursor: pointer;
}

.dl-admin-bell__avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
}

.dl-admin-bell__avatar img {
  width: 40px;
  height: 40px;
  object-fit: cover;
}

.dl-admin-bell__body {
  min-width: 0;
}

.dl-admin-bell__text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* Footer on phones: one line (© year, brand, version). "All rights reserved." and the footer links
   took two more rows of a small screen, and they stay on tablets and desktops. */
@media (max-width: 575.98px) {
  .dl-footer__long,
  .dl-footer__links {
    display: none;
  }
}

/* Page on phones (bottom menu). The theme gave the content a fixed height (90vh) with the menu's room
   (9vh) inside it: a page taller than the screen spilled out of the box, and its end (the Salvar and
   Remover buttons, the last cards of the dashboard) stayed behind the menu with no way to scroll to it.
   A minimum height keeps short pages filling the screen; the room for the menu, iPhone safe area
   included, is now at the end of the page. */
.container-height-mobile {
  height: auto !important;
  min-height: 90vh;
  padding-bottom: calc(8.5vh + 2rem + env(safe-area-inset-bottom) + 1rem) !important;
}

/* "Notificações" in the bottom bar of phones: an item of the bar like the others. It used to be the
   theme's floating button (fixed at 1% of the screen, 1.25rem icon, white circle turned off with
   utilities), so it sat higher than the others by an amount that changed with the screen height. */
.fixed-plugin-notification .fixed-plugin-button-notification.dl-nav-bell {
  position: static;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  font-size: inherit;
  z-index: auto;
}

.dl-nav-bell__icon {
  position: relative;
  display: inline-flex;
}

.dl-nav-bell__badge {
  top: 0;
  left: calc(100% + 0.75rem);
}

/* Buttons of the list header on phones ("+" and Exportar): side by side, icon only, the same 44px
   square (touch target), beside the title. They were stacked full width and doubled the header height. */
.dl-header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Phones: the buttons of the header (44px) touched the card under it (0.30); the same room as between the cards. */
#navbarBlur:has(.dl-header-tools .dl-btn) {
  margin-bottom: 1rem !important;
}

.dl-header-tools .dl-btn {
  width: 2.75rem !important;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  justify-content: center;
}

/* No arrow: tapping Exportar always opens the formats, and both buttons keep the same size. */
.dl-header-tools .dl-export .dropdown-toggle::after {
  display: none;
}

.dl-header-tools .dl-export {
  margin-top: 0 !important;
}

.dl-header-tools .dl-export__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.dl-header-tools .dl-export .dropdown-menu {
  min-width: 10rem;
}

/* ======================================================================================
   Contrast (0.25). Values measured with the WCAG formula; 4.5:1 for text, 3:1 for borders
   and focus rings. The theme computes, from each site's primary colour:
   --dl-on-primary / --dl-on-primary-hover: white or near-black, whichever reads on it
     (white on the default #1acc8d was 2.1:1; near-black is 9.5:1);
   --dl-primary-dark: the primary lightened until it reads as text on the dark surfaces.
   Filled backgrounds keep the real primary colour.
   ====================================================================================== */

/* Text on the primary colour, both modes. */
.btn.dl-btn--primary {
  --dl-btn-color: var(--dl-on-primary, #fff);
  --dl-btn-hover-color: var(--dl-on-primary-hover, #fff);
}

.btn.dl-chip.active,
.dl-admin-bell__new,
.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn.bg-gradient-primary,
.btn.bg-gradient-primary:hover,
.btn.bg-gradient-primary:focus,
.badge.bg-primary,
.bg-primary .iconNavBottomBar,
.bg-primary.text-white,
.icon-shape.bg-primary,
.icon-shape.bg-primary *,
.icon-shape.bg-gradient-primary,
.icon-shape.bg-gradient-primary *,
.bg-primary.asw-menu-header .asw-menu-title,
.bg-primary.asw-menu-reset {
  color: var(--dl-on-primary, #fff) !important;
}

.page-item.active .page-link {
  color: var(--dl-on-primary, #fff) !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  color: var(--dl-on-primary, #fff);
}

/* Toast headers (Django messages): white on the light green/orange/red was 2.4 to 3.7:1. */
.toast-header.bg-success,
.toast-header.bg-warning,
.toast-header.bg-danger,
.toast-header.bg-success *,
.toast-header.bg-warning *,
.toast-header.bg-danger * {
  color: #0a0a0a !important;
}

/* ---------------------------------------------------------------------- dark mode */

/* Grey text utilities: #737373 on #1d1d1d was 3.6:1. */
.dark-version .text-secondary,
.dark-version .text-muted,
.dark-version .text-body {
  color: #a3a3a3 !important;
}

.dark-version .text-info {
  color: #76abf1 !important;
}

.dark-version .text-primary {
  color: var(--dl-primary-dark, var(--bs-primary)) !important;
}

/* .text-dark inside the dark surfaces (the class swap of the toggle does not run on reload). */
.dark-version :is(.card, .sidenav, .dropdown-menu, .modal-content, .main-content, .navbar, footer) .text-dark:not(.bg-white *, .bg-light *) {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Links in content: primary instead of the white of the body text, so they stand out. */
.dark-version .card-body a:not(.btn):not(.dropdown-item):not(.nav-link):not(.page-link),
.dark-version .dl-callout a {
  color: var(--dl-primary-dark, var(--bs-primary));
}

/* Menus. */
.dark-version .dropdown-menu {
  --bs-dropdown-color: #d4d4d4;
  --bs-dropdown-link-color: #d4d4d4;
  --bs-dropdown-link-hover-color: #fff;
  --bs-dropdown-link-hover-bg: #262626;
  --bs-dropdown-link-active-color: #fff;
  --bs-dropdown-header-color: #a3a3a3;
  --bs-dropdown-link-disabled-color: #8a8a8a;
  --bs-dropdown-border-color: #404040;
  border: 1px solid #404040;
}

.dark-version .dropdown .dropdown-menu .dropdown-item:hover,
.dark-version .dropdown .dropdown-menu .dropdown-item:focus {
  background-color: #262626 !important;
  color: #fff !important;
}

.dark-version .breadcrumb {
  --bs-breadcrumb-item-active-color: #a3a3a3;
  --bs-breadcrumb-divider-color: #8a8a8a;
}

.dark-version .nav-pills .nav-link:not(.active) {
  color: #a3a3a3;
}

.dark-version .pagination {
  --bs-pagination-bg: transparent;
  --bs-pagination-color: #d4d4d4;
  --bs-pagination-border-color: #404040;
  --bs-pagination-hover-bg: #262626;
  --bs-pagination-hover-color: #fff;
  --bs-pagination-disabled-bg: transparent;
  --bs-pagination-disabled-color: #8a8a8a;
}

.dark-version .popover {
  --bs-popover-bg: #262626;
  --bs-popover-body-color: #d4d4d4;
  --bs-popover-header-bg: #1d1d1d;
  --bs-popover-header-color: #fff;
  --bs-popover-border-color: #404040;
}

/* Modals (delete confirmation, related objects): white title on a white modal. */
.dark-version .modal {
  --bs-modal-bg: #1d1d1d;
  --bs-modal-color: rgba(255, 255, 255, 0.8);
  --bs-modal-border-color: #404040;
  --bs-modal-header-border-color: #404040;
  --bs-modal-footer-border-color: #404040;
}

.dark-version .modal .btn-close,
.dark-version .modal .close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.dark-version .modal .text-dark {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Toasts: the body is bg-white in the template, with the light text of dark mode on it. */
.dark-version .toast {
  --bs-toast-bg: #1d1d1d;
  --bs-toast-color: rgba(255, 255, 255, 0.8);
  --bs-toast-border-color: #404040;
}

.dark-version .toast .toast-body.bg-white {
  background: #1d1d1d !important;
}

/* Fields: borders at .04 were invisible (1.1:1); state colours show again. */
.dark-version .input-group.input-group-outline .form-control {
  border-color: rgba(255, 255, 255, 0.4) !important;
}

.dark-version .input-group .is-valid {
  border-color: var(--bs-form-valid-border-color) !important;
}

.dark-version .input-group .is-invalid {
  border-color: var(--bs-form-invalid-border-color) !important;
}

.dark-version .form-control::placeholder,
.dark-version .form-select::placeholder {
  color: #8f8f8f;
}

/* select2 (filters and paginated selects) had no dark rules: light text on a white list. */
.dark-version .select2-container--default .select2-selection--single,
.dark-version .select2-container--default .select2-selection--multiple,
.dark-version .select2-dropdown {
  background-color: #1d1d1d;
  border-color: #404040;
  color: rgba(255, 255, 255, 0.8);
}

.dark-version .select2-container--default .select2-selection--single .select2-selection__rendered,
.dark-version .select2-container--default .select2-selection--multiple .select2-selection__rendered,
.dark-version .select2-results__option {
  color: rgba(255, 255, 255, 0.8);
}

.dark-version .select2-container--default .select2-selection--single .select2-selection__placeholder,
.dark-version .select2-container--default .select2-search--inline .select2-search__field::placeholder {
  color: #8f8f8f;
}

.dark-version .select2-container--default .select2-search--dropdown .select2-search__field,
.dark-version .select2-container--default .select2-search--inline .select2-search__field {
  background-color: #171717;
  border-color: #404040;
  color: rgba(255, 255, 255, 0.8);
}

.dark-version .select2-container--default .select2-results__option--selected {
  background-color: #262626;
}

.dark-version .select2-container--default .select2-results__option--disabled {
  color: #8a8a8a;
}

/* dlight components. */
.dark-version .dl-callout--info {
  color: rgba(255, 255, 255, 0.8);
}

.dark-version .dl-callout--danger,
.dark-version .dl-callout--danger li,
.dark-version .dl-callout--danger i,
.dark-version .dl-delete-summary__count {
  color: #f28b82;
}

.dark-version .dl-bool--yes {
  color: #81c784;
}

.dark-version .dl-bool--no {
  color: #ef9a9a;
}

.dark-version .dl-panel__metric-value {
  color: #fff;
}

.dark-version .btn.dl-btn--secondary,
.dark-version .btn.dl-chip--back {
  border-color: rgba(255, 255, 255, 0.45);
}

.dark-version .btn.dl-btn--danger {
  border-color: rgba(244, 67, 53, 0.8);
}

.dark-version .btn.dl-btn:focus-visible,
.dark-version .btn.dl-chip:focus-visible,
.dark-version .form-control:focus-visible {
  outline: 2px solid var(--dl-primary-dark, var(--bs-primary));
  outline-offset: 2px;
}

/* Export link page (export/status.html): one centred card, not stuck to the left of a wide screen. */
.dl-export-status-wrap {
  display: flex;
  justify-content: center;
}

@media (min-width: 768px) {
  .dl-export-status-wrap {
    padding-top: clamp(0rem, 8vh, 4rem);
  }
}

.dl-export-status-wrap .dl-export-status {
  width: 100%;
  max-width: 34rem;
}

.dl-export-status .card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.dl-export-status .card-body > .btn.dl-btn {
  width: 100%;
  max-width: 18rem;
  margin-top: 0.5rem;
}

/* Close button of the toasts (0.29.6): only the icon. The button also had Bootstrap's .btn-close, whose
   own X (a background image) was drawn under the icon's, a blurred double X. */
.toast .toast-header .btn-close {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  margin-left: 0.5rem !important;
  border-radius: 0.375rem;
  background: none;
  opacity: 0.7;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.toast .toast-header .btn-close > i {
  font-size: 0.875rem;
  line-height: 1;
}

.toast .toast-header .btn-close:is(:hover, :focus-visible) {
  background: rgba(0, 0, 0, 0.08);
  opacity: 1;
}

.toast .toast-header .btn-close:focus {
  box-shadow: none;
}

.toast .toast-header .btn-close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

/* Change form, wide screens (0.29.9): the side column (Save, Delete, other actions and the recent actions)
   stays in sight under the top bar while the form scrolls; a long form no longer needs a trip back up to
   save. When the recent actions do not fit, only they scroll, inside their card: the buttons never leave. */
.dl-form-aside {
  position: sticky;
  /* 3.25rem: where the column starts, level with the card, just below the sticky top bar (0.30). 4.5rem pushed
     it 20px below the card on load, the edit page included. */
  top: var(--dl-aside-top, 3.25rem);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--dl-aside-top, 3.25rem) - 1rem);
}

.dl-form-aside > #dlight-actions {
  flex: 0 0 auto;
}

/* The card of the list reaches the footer (0.30): the row of the page takes the room the footer leaves, and the
   card fills it. With the fixed 85vh, a short list left a gap above the footer that grew with the screen. */
.container-height-desktop > .row:has(> [class*="col-"] > .dl-changelist-card) {
  flex: 1 0 auto;
  padding-bottom: 0.75rem; /* a breath between the card and the footer's text */
}

.container-height-desktop .dl-changelist-card {
  height: 100%;
}

/* The buttons of the list in its column (0.30): the same spacing as Save and Delete on the edit page. */
.dl-list-aside-tools .dl-export {
  margin-top: 0.75rem !important;
}

.dl-list-aside-tools .dl-export:first-child {
  margin-top: 0 !important;
}

/* The column of the list (0.30): a long model name in "Adicionar ..." wraps inside the button. */
.dl-form-aside .btn.dl-btn {
  height: auto;
  min-height: 2.75rem;
  white-space: normal;
  text-align: center;
}

.dl-form-aside > .dl-recent-actions {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  min-height: 0;
}

.dl-form-aside > .dl-recent-actions > .card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.dl-form-aside > .dl-recent-actions .card-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Terms of use (0.30): what changed from the previous version, in the admin's version page. */
.dl-terms-diff__item { margin: 0 0 0.75rem; padding: 0.125rem 0 0.125rem 0.75rem; border-left: 3px solid; }
.dl-terms-diff__item--added { border-color: #2fbf71; }
.dl-terms-diff__item--removed { border-color: #e5484d; }
.dl-terms-diff__item--removed .dl-terms-diff__text { text-decoration: line-through; opacity: 0.75; }
.dl-terms-diff__item--changed { border-color: #f5b83d; }
.dl-terms-diff__del { background: rgba(229, 72, 77, 0.18); text-decoration: line-through; }
.dl-terms-diff__ins { background: rgba(47, 191, 113, 0.22); text-decoration: none; }

/* The checkboxes of the rows in the colour of the theme, like the one of the header (0.30; native blue before). */
#result_list input.action-select {
  accent-color: var(--bs-primary);
}

/* Pagination on phones (admin/pagination.html, 0.30): the whole width, big previous and next (44px, for a thumb),
   "Página 1 de 3" and the count between them; a tap on the page opens the phone's picker (a select over it). */
.dl-pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.dl-pager__step {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 2.75rem;
  border: 1px solid var(--bs-gray-300, #d4d4d4);
  border-radius: 0.625rem;
  background: #fff;
  color: var(--bs-gray-800, #262626);
  font-size: 0.875rem;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dl-pager__step:active {
  background: var(--bs-gray-100, #f5f5f5);
}

.dl-pager__step.is-disabled {
  color: var(--bs-gray-400, #a3a3a3);
  background: transparent;
  box-shadow: none;
}

.dl-pager__info {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  min-width: 0;
  text-align: center;
}

.dl-pager__page {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  color: var(--bs-gray-800, #262626);
  font-size: 0.9375rem;
}

.dl-pager__page.has-jump {
  background: var(--bs-gray-100, #f5f5f5);
}

.dl-pager__page i {
  color: var(--bs-secondary-color, #737373);
  font-size: 0.625rem;
}

/* The select covers the page, invisible: the tap opens the phone's own list of pages. */
.dl-pager__jump {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  font-size: 16px; /* no zoom on iOS */
  cursor: pointer;
}

.dl-pager__count {
  color: var(--bs-secondary-color, #737373);
  font-size: 0.75rem;
}

.dl-pager__extra {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.dark-version .dl-pager__step {
  border-color: #404040;
  background: #1d1d1d;
  color: rgba(255, 255, 255, 0.85);
}

.dark-version .dl-pager__step.is-disabled {
  background: transparent;
  color: #5c5c5c;
}

.dark-version .dl-pager__page {
  color: rgba(255, 255, 255, 0.85);
}

.dark-version .dl-pager__page.has-jump {
  background: #262626;
}

/* Phones, the list (0.30). The card scrolls the rows, and its 80vh plus the header and the room of the bottom menu
   were taller than the screen: the page scrolled too, the sticky header (transparent) went over the card, and on
   short screens the card ended under the bottom menu. The card now takes exactly the room between the header
   (84px: 8px + 60px + 16px) and the menu (8.5vh), and the page has nothing left to scroll. */
.container-height-mobile:has(.dl-changelist-card) {
  min-height: 0;
  padding-bottom: calc(8.5vh + env(safe-area-inset-bottom)) !important;
}

/* min and max, not height: with a definite height the h-100 inside the card took it, and the rows overflowed
   under the pagination. */
.container-height-mobile .dl-changelist-card.min-max-height-80-viewheight {
  min-height: calc(100vh - 8.5vh - env(safe-area-inset-bottom) - 6rem) !important;
  max-height: calc(100vh - 8.5vh - env(safe-area-inset-bottom) - 6rem) !important;
  min-height: calc(100dvh - 8.5vh - env(safe-area-inset-bottom) - 6rem) !important;
  max-height: calc(100dvh - 8.5vh - env(safe-area-inset-bottom) - 6rem) !important;
}

/* The sticky header of phones over a page that scrolls: the colour of the page behind it, never transparent. */
body:has(.container-height-mobile) #navbarBlur {
  background-color: #f5f5f5;
}

.dark-version:has(.container-height-mobile) #navbarBlur {
  background-color: #171717;
}

/* Phones: scrolling down puts the bottom menu away, scrolling up brings it back (dlight/js/bottom_nav.js sets
   html.dl-nav-hidden). The menu goes down by its bottom, never a transform: that would make the footer the box of
   its fixed panels (the bell's, hidden under the screen), dragged through the screen. The lamp, fixed on its own,
   goes down with it. The list takes the room, and the toasts follow the menu. The side menu, open on a phone
   (body.g-sidenav-pinned), puts it away the same way: nothing to tap by mistake under it. */
html.dl-nav-hidden .footer-mobile,
body.g-sidenav-pinned .footer-mobile {
  bottom: calc(-8.5vh - env(safe-area-inset-bottom) - 2px) !important;
  box-shadow: none !important;
}

.footer-mobile .fixed-plugin-button {
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

/* The icons fade and sink a little as the menu goes, and rise back as it comes: the motion reads as one. */
html.dl-nav-hidden .footer-mobile .iconNavBottomBar,
body.g-sidenav-pinned .footer-mobile .iconNavBottomBar {
  opacity: 0;
  transform: translateY(10px);
}

html.dl-nav-hidden .footer-mobile .fixed-plugin-button,
body.g-sidenav-pinned .footer-mobile .fixed-plugin-button {
  opacity: 0;
  transform: translateX(-50%) translateY(calc(4.5rem + env(safe-area-inset-bottom))) !important;
  pointer-events: none;
}

.container-height-mobile:has(.dl-changelist-card),
.container-height-mobile .dl-changelist-card.min-max-height-80-viewheight {
  transition: min-height 0.42s cubic-bezier(0.4, 0, 0.2, 1), max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1), padding-bottom 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

html.dl-nav-hidden .container-height-mobile:has(.dl-changelist-card) {
  padding-bottom: env(safe-area-inset-bottom) !important;
}

html.dl-nav-hidden .container-height-mobile .dl-changelist-card.min-max-height-80-viewheight {
  min-height: calc(100vh - env(safe-area-inset-bottom) - 6rem) !important;
  max-height: calc(100vh - env(safe-area-inset-bottom) - 6rem) !important;
  min-height: calc(100dvh - env(safe-area-inset-bottom) - 6rem) !important;
  max-height: calc(100dvh - env(safe-area-inset-bottom) - 6rem) !important;
}

.dl-toasts.is-mobile {
  transition: bottom 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

html.dl-nav-hidden .dl-toasts.is-mobile {
  bottom: calc(env(safe-area-inset-bottom) + 0.625rem) !important;
}

/* The drawer of a list row's details (0.30, the eye of list_fit.js): the lamp's and the bell's drawer, but out of
   the bottom menu, so it goes over it. */
.fixed-plugin-details .card {
  z-index: 1023;
}

#overlayDetails {
  z-index: 1022;
}

/* Toasts (admin/includes/toasts.html, 0.30): a white card with a status icon, the message and "×", a thin line for
   the time left. Before: the whole header in the green/orange/red of the theme, bold, and on phones over the bottom
   menu. */
.dl-toasts {
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dl-toasts.is-mobile {
  right: 0;
  bottom: calc(8.5vh + env(safe-area-inset-bottom) + 0.5rem) !important;
  left: 0;
  width: 100%;
  padding: 0 0.625rem !important;
}

.toast.dl-toast {
  --dl-t-accent: var(--bs-primary);
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: min(24rem, 100%);
  margin: 0;
  padding: 0.875rem 0.5rem 0.875rem 0.875rem;
  overflow: hidden;
  border: 1px solid var(--bs-gray-200, #e5e5e5);
  border-radius: 0.875rem;
  background: #fff;
  color: var(--bs-gray-800, #262626);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.06);
}

.dl-toasts.is-mobile .toast.dl-toast {
  width: 100%;
}

.toast.dl-toast:not(.show) {
  display: none;
}

.toast.dl-toast.showing,
.toast.dl-toast.show {
  animation: dl-toast-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes dl-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.dl-toast--success {
  --dl-t-accent: #16a34a;
}

.dl-toast--danger {
  --dl-t-accent: #dc2626;
}

.dl-toast--warning {
  --dl-t-accent: #d97706;
}

.dl-toast--info {
  --dl-t-accent: #2563eb;
}

.dl-toast__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  overflow: hidden;
  border-radius: 50%;
  background: color-mix(in srgb, var(--dl-t-accent) 14%, transparent);
  color: var(--dl-t-accent);
  font-size: 0.875rem;
}

.dl-toast__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dl-toast__text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
  padding-top: 0.3125rem;
}

.dl-toast__title {
  color: var(--bs-gray-900, #171717);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
}

.dl-toast__message {
  color: var(--bs-gray-700, #404040);
  font-size: 0.875rem;
  line-height: 1.35rem;
  overflow-wrap: anywhere;
}

.dl-toast__title + .dl-toast__message {
  color: var(--bs-secondary-color, #737373);
  font-size: 0.8125rem;
}

.dl-toast__subtitle {
  color: var(--bs-secondary-color, #737373);
  font-size: 0.75rem;
}

.dl-toast__close {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--bs-secondary-color, #737373);
  cursor: pointer;
}

.dl-toast__close:hover,
.dl-toast__close:focus-visible {
  outline: none;
  background: var(--bs-gray-100, #f5f5f5);
  color: var(--bs-gray-800, #262626);
}

/* The time left: a line of the colour of the kind that empties until the toast goes. */
.dl-toast__timer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--dl-t-accent);
  opacity: 0.55;
  transform-origin: left;
  animation-name: dl-toast-timer;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.toast.dl-toast:hover .dl-toast__timer {
  animation-play-state: paused;
}

@keyframes dl-toast-timer {
  to {
    transform: scaleX(0);
  }
}

.dark-version .toast.dl-toast {
  border-color: #333;
  background: #1d1d1d;
  color: rgba(255, 255, 255, 0.85);
}

.dark-version .dl-toast__title {
  color: #fff;
}

.dark-version .dl-toast__message {
  color: rgba(255, 255, 255, 0.8);
}

.dark-version .dl-toast__close:hover {
  background: #262626;
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .toast.dl-toast,
  .dl-toast__timer {
    animation: none !important;
  }

  /* Less motion is not no motion: what slides fades in place instead (like iOS with "Reduce motion"). */
  .footer-mobile .iconNavBottomBar,
  .footer-mobile .fixed-plugin-button,
  .container-height-mobile,
  .container-height-mobile .dl-changelist-card,
  .dl-toasts.is-mobile {
    transition: opacity 0.3s ease !important;
  }

  .footer-mobile {
    transition: opacity 0.3s ease, visibility 0s, bottom 0s !important;
  }

  html.dl-nav-hidden .footer-mobile,
  body.g-sidenav-pinned .footer-mobile {
    opacity: 0;
    transition: opacity 0.3s ease, bottom 0s 0.3s !important; /* fades, then leaves */
  }

  html.dl-nav-hidden .footer-mobile .iconNavBottomBar,
  body.g-sidenav-pinned .footer-mobile .iconNavBottomBar {
    transform: none;
  }

  body:has(.container-height-mobile #actions-container:not(.d-none):not(.is-leaving)) .footer-mobile {
    transition: opacity 0.22s ease, visibility 0s 0.22s !important;
  }

  .dl-bulk {
    animation-name: dl-bulk-fade-in !important;
  }

  .dl-bulk.is-leaving {
    animation-name: dl-bulk-fade-out !important;
  }
}
