/* ==========================================================================================
   OrNsoft theme — shared form control fixes (1.3.0)
   Owned by lot A; lots B and C rely on it. Tokens only.

   Why this file exists: the platform's pickers are not native controls. bootstrap-select
   renders a <button class="btn dropdown-toggle"> whose .filter-option is absolutely
   positioned with padding:inherit; once the theme sets the button padding to "0 12px"
   (ornsoft-perfex.css) the inherited top padding is 0, so the selected text sits on the top
   border while the caret stays centred. The same widget, when the <select> carries
   .form-control (custom fields do), copies that class onto its wrapper, which then draws a
   second border and height around the button. Date custom fields are Bootstrap 3 table-layout
   input groups that collapse in narrow columns. These rules put all of that back in shape.

   Icons: the bundled Font Awesome has no regular-style plus / lock / shield-halved / sliders /
   key glyphs (they render as an empty box). Views must use fa-solid for those.

   Specificity: the generic rules stay at body.admin + two classes, so the task modal rules in
   tasks.css (body.admin #task-modal …, an id) keep winning inside the task modal. Nothing here
   uses !important except where it answers an !important of the base.
   ========================================================================================== */

/* --- 0. card titles --------------------------------------------------------------------- */

/* The theme maps every admin h2 / h3 to a page-heading step (24px); a card title rendered as
   an h2 or h3 stays at the kit's card-title size (16px / 700, h3 letter-spacing). */
body.admin .ons-card h2.ons-card__title,
body.admin .ons-card h3.ons-card__title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-h3);
  line-height: var(--lh-tight);
  color: var(--fg);
}

/* --- 1. bootstrap-select trigger: a 38px control with the value centred ------------------ */

body.admin .bootstrap-select > .dropdown-toggle,
body.admin .bootstrap-select > .btn.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: var(--ctl-h);
  padding: 0 10px 0 12px;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

/* Back in the flow: the button's own align-items:center does the vertical centring. */
body.admin .bootstrap-select > .dropdown-toggle .filter-option {
  position: static;
  float: none;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: auto;
  padding: 0;
  top: auto;
  left: auto;
  text-align: left;
  overflow: hidden;
}

body.admin .bootstrap-select > .dropdown-toggle .filter-option-inner,
body.admin .bootstrap-select > .dropdown-toggle .filter-option-inner-inner {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The placeholder reads as a placeholder. */
body.admin .bootstrap-select > .dropdown-toggle.bs-placeholder .filter-option-inner-inner {
  color: var(--fg-faint);
}

/* The caret becomes the kit's chevron, on the same centre line, inside the control. */
body.admin .bootstrap-select > .dropdown-toggle .bs-caret {
  position: static;
  flex: none;
  display: inline-flex;
  align-items: center;
  margin: 0;
}

body.admin .bootstrap-select > .dropdown-toggle .caret {
  position: static;
  top: auto;
  right: auto;
  width: 7px;
  height: 7px;
  margin: -3px 2px 0 0;
  border: 0;
  border-right: 1.5px solid var(--fg-muted);
  border-bottom: 1.5px solid var(--fg-muted);
  transform: rotate(45deg);
  vertical-align: middle;
}

body.admin .bootstrap-select.open > .dropdown-toggle .caret,
body.admin .bootstrap-select.show > .dropdown-toggle .caret {
  margin-top: 3px;
  transform: rotate(225deg);
}

/* The trigger never tints on hover like a button: it is a field. */
body.admin .bootstrap-select > .dropdown-toggle:hover {
  background-color: var(--bg-surface);
  border-color: var(--fg-faint);
  box-shadow: none;
}

body.admin .bootstrap-select > .dropdown-toggle:focus,
body.admin .bootstrap-select.open > .dropdown-toggle {
  border-color: var(--border-focus);
  box-shadow: var(--ring);
  outline: 0 !important; /* bootstrap-select pins a focus outline with !important */
}

body.admin .bootstrap-select.disabled > .dropdown-toggle,
body.admin .bootstrap-select > .dropdown-toggle.disabled {
  background-color: var(--bg-sunken);
  color: var(--fg-secondary);
  opacity: 1;
}

body.admin .has-error .bootstrap-select > .dropdown-toggle {
  border-color: var(--danger);
}

/* Dropdown panel: one surface, list rows at the kit's density. */
body.admin .bootstrap-select .dropdown-menu {
  min-width: 100%;
  padding: 4px;
}

body.admin .bootstrap-select .dropdown-menu li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--fg);
  font-size: var(--fs-sm);
  white-space: normal;
}

body.admin .bootstrap-select .dropdown-menu li a:hover,
body.admin .bootstrap-select .dropdown-menu li.active a,
body.admin .bootstrap-select .dropdown-menu li a:focus {
  background: var(--bg-hover);
  color: var(--fg);
}

body.admin .bootstrap-select .dropdown-menu li.selected a {
  background: var(--accent-soft);
  color: var(--accent-soft-fg, var(--fg));
  font-weight: var(--fw-semibold);
}

body.admin .bootstrap-select .dropdown-menu .text-muted,
body.admin .bootstrap-select .dropdown-menu small {
  color: var(--fg-muted);
}

body.admin .bootstrap-select .bs-searchbox {
  padding: 4px 4px 6px;
}

/* --- 2. .simple-bootstrap-select (the base's borderless variant) ------------------------ */

/* Inside cards and side panels the borderless variant would read as loose text; it gets the
   control frame back. The base forces a transparent background with !important. */
body.admin .ons-card .simple-bootstrap-select .bootstrap-select > .dropdown-toggle,
body.admin .ons-sticky .simple-bootstrap-select .bootstrap-select > .dropdown-toggle {
  padding: 0 10px 0 12px;
  border: 1px solid var(--border-strong);
  background-color: var(--bg-surface) !important;
  color: var(--fg) !important;
}

/* --- 3. a <select class="selectpicker form-control"> copies .form-control to its wrapper -- */

body.admin .bootstrap-select.form-control,
body.admin .bootstrap-select.form-control:focus {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* The multiple / tags pickers wrap onto several lines; they keep a minimum height instead. */
body.admin .bootstrap-select.show-tick > .dropdown-toggle,
body.admin select[multiple] + .dropdown-toggle {
  min-height: var(--ctl-h);
}

/* --- 4. input groups (select + button, date + calendar icon) ---------------------------- */

/* Bootstrap 3 lays an input group out as a table. When the field is a bootstrap-select, the
   plugin also gives its wrapper the .input-group-btn class (width:1%), so the picker shrinks to
   its label (~86px) next to the addon. Any group holding a picker or a select is a flex row
   instead: the field takes the remaining width, the addon / button keeps its natural width.
   Global (settings pages, modals, cards), no colours involved, so it holds in both themes. */
/* .input-group-select is also carried by the .form-group WRAPPER of a select + add-button
   field (div.form-group.input-group-select > label + div.input-group.input-group-select): only
   the inner .input-group becomes a row, the wrapper stays a block so the label sits above. */
body.admin .input-group:has(> .bootstrap-select),
body.admin .input-group:has(> select),
body.admin .input-group.input-group-select {
  display: flex;
  align-items: stretch;
  width: 100%;
}

body.admin .input-group > .bootstrap-select,
body.admin .input-group > .bootstrap-select.input-group-btn,
body.admin .input-group:has(> select) > select {
  display: block;
  flex: 1 1 auto;
  width: auto !important; /* bootstrap-select writes an inline width:100% */
  min-width: 0;
  float: none;
}

body.admin .input-group > .bootstrap-select > .dropdown-toggle {
  width: 100%;
}

body.admin .input-group:has(> .bootstrap-select) > .input-group-addon,
body.admin .input-group:has(> .bootstrap-select) > .input-group-btn:not(.bootstrap-select),
body.admin .input-group:has(> select) > .input-group-addon,
body.admin .input-group:has(> select) > .input-group-btn {
  display: flex;
  align-items: stretch;
  flex: none;
  width: auto;
}

/* Inside cards, side panels and modals every group (text / date inputs too) is a flex row:
   the table layout collapses in a narrow column. */
body.admin .ons-card .input-group,
body.admin .ons-sticky .input-group,
body.admin .modal-body .input-group.date {
  display: flex;
  align-items: stretch;
  width: 100%;
}

body.admin .ons-card .input-group > .form-control,
body.admin .ons-sticky .input-group > .form-control,
body.admin .modal-body .input-group.date > .form-control {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  float: none;
}

body.admin .ons-card .input-group > .input-group-addon,
body.admin .ons-card .input-group > .input-group-btn:not(.bootstrap-select),
body.admin .ons-sticky .input-group > .input-group-addon,
body.admin .ons-sticky .input-group > .input-group-btn:not(.bootstrap-select),
body.admin .modal-body .input-group.date > .input-group-addon {
  display: flex;
  align-items: stretch;
  width: auto;
  flex: none;
}

body.admin .ons-card .input-group > .input-group-addon,
body.admin .ons-sticky .input-group > .input-group-addon,
body.admin .modal-body .input-group.date > .input-group-addon,
body.admin .input-group:has(> .bootstrap-select) > .input-group-addon {
  align-items: center;
  height: var(--ctl-h);
  margin-left: -1px;
}

body.admin .input-group:has(> .bootstrap-select) > .input-group-btn:not(.bootstrap-select) > .btn,
body.admin .input-group:has(> select) > .input-group-btn > .btn,
body.admin .ons-card .input-group > .input-group-btn:not(.bootstrap-select) > .btn,
body.admin .ons-sticky .input-group > .input-group-btn:not(.bootstrap-select) > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--ctl-h);
  min-width: var(--ctl-h);
  margin-left: -1px;
}

/* A picker followed by a button or addon: square the joined corners. */
body.admin .input-group > .bootstrap-select:not(:last-child) > .dropdown-toggle {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* --- 5. custom fields rows ---------------------------------------------------------------- */

/* The admin's "edit this field" pencil sits in the corner of its field instead of pushing the
   label down a line. */
body.admin .custom-fields-form-row > [class*="col-"] {
  position: relative;
}

body.admin .custom-fields-form-row .custom-field-inline-edit-link {
  position: absolute;
  top: 0;
  right: 15px;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: var(--r-sm);
  color: var(--fg-faint);
  font-size: 11px;
  opacity: 0;
  transition: opacity var(--dur-fast);
}

body.admin .custom-fields-form-row > [class*="col-"]:hover .custom-field-inline-edit-link,
body.admin .custom-fields-form-row .custom-field-inline-edit-link:focus-visible {
  opacity: 1;
}

body.admin .custom-fields-form-row .custom-field-inline-edit-link:hover {
  background: var(--bg-hover);
  color: var(--fg);
}

body.admin .custom-fields-form-row .control-label {
  overflow-wrap: anywhere;
}

/* In a side panel (narrow column, wide viewport) Bootstrap's col-md-4 / col-md-6 squeeze the
   fields into three truncated columns: a 2-column grid with full labels instead. A field an
   admin configured as full width (col-md-12) and every textarea keep the whole row. */
body.admin .ons-sticky .custom-fields-form-row,
body.admin aside.ons-card .custom-fields-form-row,
body.admin .ons-cf-grid .custom-fields-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
  margin: 0;
}

body.admin .ons-sticky .custom-fields-form-row::before,
body.admin .ons-sticky .custom-fields-form-row::after,
body.admin aside.ons-card .custom-fields-form-row::before,
body.admin aside.ons-card .custom-fields-form-row::after,
body.admin .ons-cf-grid .custom-fields-form-row::before,
body.admin .ons-cf-grid .custom-fields-form-row::after {
  content: none;
}

body.admin .ons-sticky .custom-fields-form-row > [class*="col-"],
body.admin aside.ons-card .custom-fields-form-row > [class*="col-"],
body.admin .ons-cf-grid .custom-fields-form-row > [class*="col-"] {
  width: auto;
  float: none;
  padding: 0;
  min-width: 0;
}

body.admin .ons-sticky .custom-fields-form-row > .col-md-12,
body.admin .ons-sticky .custom-fields-form-row > [class*="col-"]:has(textarea),
body.admin aside.ons-card .custom-fields-form-row > .col-md-12,
body.admin aside.ons-card .custom-fields-form-row > [class*="col-"]:has(textarea),
body.admin .ons-cf-grid .custom-fields-form-row > .col-md-12,
body.admin .ons-cf-grid .custom-fields-form-row > [class*="col-"]:has(textarea) {
  grid-column: 1 / -1;
}

body.admin .ons-sticky .custom-fields-form-row .custom-field-inline-edit-link,
body.admin aside.ons-card .custom-fields-form-row .custom-field-inline-edit-link,
body.admin .ons-cf-grid .custom-fields-form-row .custom-field-inline-edit-link {
  right: 0;
}

/* --- 6. date / time inputs ---------------------------------------------------------------- */

/* The platform puts .datepicker on the INPUT; ornsoft-perfex.css styles the calendar widget
   separately (.xdsoft_datetimepicker). Inside cards and panels the input is a plain control. */
body.admin .ons-card input.datepicker,
body.admin .ons-card input.datetimepicker,
body.admin .ons-sticky input.datepicker,
body.admin .ons-sticky input.datetimepicker {
  height: var(--ctl-h);
  margin: 0;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}

body.admin .ons-card .input-group.date .calendar-icon,
body.admin .ons-sticky .input-group.date .calendar-icon {
  color: var(--fg-muted);
  font-size: 13px;
}

/* --- 7. TinyMCE frame inside cards --------------------------------------------------------- */

body.admin .ons-card .tox.tox-tinymce {
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
}

body.admin .ons-card .tox.tox-tinymce.tox-edit-focus,
body.admin .ons-card .tox.tox-tinymce:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--ring);
}

/* A textarea waiting for its editor (tinymce-manual) already looks like the editor frame. */
body.admin .ons-card textarea.tinymce {
  min-height: 150px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  line-height: var(--lh-body);
  resize: vertical;
}

/* --- 8. form rhythm inside cards and side panels ------------------------------------------ */

body.admin .ons-card .form-group > .control-label,
body.admin .ons-card .form-group > label,
body.admin .ons-sticky .form-group > .control-label,
body.admin .ons-sticky .form-group > label {
  display: block;
  margin-bottom: 6px;
}

body.admin .ons-card .form-group,
body.admin .ons-sticky .form-group {
  margin-bottom: 16px;
}

/* Tags (tagit / tagsinput) take the control shape. */
body.admin .ons-card .tagit,
body.admin .ons-sticky .tagit,
body.admin .ons-card .bootstrap-tagsinput,
body.admin .ons-sticky .bootstrap-tagsinput {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: var(--ctl-h);
  margin: 0;
  padding: 4px 6px;
  border: 1px solid var(--border-strong);
  border-width: 1px !important; /* the base zeroes it with !important */
  border-radius: var(--r-md);
  background: var(--bg-surface);
  box-shadow: none;
}

body.admin .ons-card .tagit:focus-within,
body.admin .ons-sticky .tagit:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--ring);
}

body.admin .ons-card .tagit li.tagit-choice,
body.admin .ons-sticky .tagit li.tagit-choice {
  margin: 0;
  padding: 0 22px 0 8px;
  height: 24px;
  line-height: 24px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--neutral-soft);
  color: var(--fg);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

body.admin .ons-card .tagit li.tagit-new,
body.admin .ons-sticky .tagit li.tagit-new {
  margin: 0;
  padding: 0 4px;
}

body.admin .ons-card .tagit li.tagit-new input,
body.admin .ons-sticky .tagit li.tagit-new input {
  height: 24px;
  margin: 0;
  padding: 0 4px;
  border: 0 !important; /* the base draws a 2px start border with !important */
  box-shadow: none;
  outline: 0;
  font-size: var(--fs-sm);
  background: transparent;
  color: var(--fg);
}

/* Platform checkboxes (awesome-bootstrap-checkbox) in cards: no stray vertical margins, the
   stack around them sets the rhythm. The box itself is the platform's (label::before). */
body.admin .ons-card .checkbox,
body.admin .ons-sticky .checkbox {
  margin-top: 0;
  margin-bottom: 0;
}

body.admin .ons-card .checkbox label,
body.admin .ons-sticky .checkbox label {
  font-weight: var(--fw-regular);
  color: var(--fg);
  line-height: 1.35;
}

/* --- 8b. modal chrome ------------------------------------------------------------------------- */

/* The platform's compiled utility build paints .modal-header white (and rounds it at 1rem);
   the theme's modal rules set padding and borders but no background, so in dark mode every
   modal head stayed a white slab. Header, footer and title take the surface tokens in both
   themes; the selectors sit at body.admin/body.customers + class (beats the bare utility). */
body.admin .modal-content > .modal-header,
body.admin .modal-content .modal-header,
body.customers .modal-content .modal-header {
  background-color: var(--bg-surface);
  border-bottom-color: var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  color: var(--fg);
}

body.admin .modal-content .modal-footer,
body.customers .modal-content .modal-footer {
  background-color: var(--bg-subtle);
  border-top-color: var(--border);
  color: var(--fg-secondary);
}

body.admin .modal-content .modal-title,
body.customers .modal-content .modal-title {
  color: var(--fg);
}

body.admin .modal-content .modal-header .close,
body.customers .modal-content .modal-header .close {
  color: var(--fg-muted);
}

body.admin .modal-content .modal-header .close:hover,
body.customers .modal-content .modal-header .close:hover {
  color: var(--fg);
}

[data-theme="dark"] body.admin .modal-content .modal-header,
[data-theme="dark"] body.customers .modal-content .modal-header {
  background-color: var(--bg-surface);
  border-bottom-color: var(--border);
}

[data-theme="dark"] body.admin .modal-content .modal-footer,
[data-theme="dark"] body.customers .modal-content .modal-footer {
  background-color: var(--bg-subtle);
  border-top-color: var(--border);
}

/* --- 8c. upload drop zones ------------------------------------------------------------------ */

/* Dropzone's own stylesheet paints the zone white with a grey dashed border, which stays a white
   block in dark mode. Every platform drop zone (the .dropzone forms, the expense form's
   #dropzoneDragArea, the customer attachments and task attachment forms) takes the kit's quiet
   dashed surface, like the project Files zone (files.css keeps its own, more specific look). */
body.admin form.dropzone,
body.admin div.dropzone,
body.admin #dropzoneDragArea,
body.admin form#client-attachments-upload,
body.admin form#task-attachment {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--bg-sunken);
  color: var(--fg-muted);
}

body.admin form.dropzone:hover,
body.admin form.dropzone.dz-drag-hover,
body.admin #dropzoneDragArea:hover,
body.admin #dropzoneDragArea.dz-drag-hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

body.admin .dropzone .dz-message,
body.admin #dropzoneDragArea .dz-message,
body.admin #dropzoneDragArea.dz-message {
  color: var(--fg-muted);
}

body.admin .dropzone .dz-message span,
body.admin .dropzone .dz-message button,
body.admin #dropzoneDragArea span {
  color: var(--fg-muted);
  background: transparent;
}

body.admin .dropzone .dz-preview .dz-image,
body.admin .dropzone .dz-preview.dz-file-preview .dz-image {
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

body.admin .dropzone .dz-preview .dz-details,
body.admin .dropzone .dz-preview .dz-filename span,
body.admin .dropzone .dz-preview .dz-size span {
  color: var(--fg);
  background: transparent;
}

/* --- 8d. native controls ------------------------------------------------------------------- */

/* Native checkboxes, radios, file pickers, scrollbars and date widgets follow the theme: the
   browser draws its dark variants when the page declares a dark colour scheme, and ticked
   controls take the accent. */
body.admin,
body.customers {
  accent-color: var(--accent);
}

[data-theme="dark"] body.admin,
[data-theme="dark"] body.customers {
  color-scheme: dark;
}

/* The platform's drawn checkboxes / radios (label::before box, label::after tick) take the
   token surface, border and accent instead of a fixed white box and blue fill. */
body.admin .checkbox label::before,
body.admin .radio label::before,
body.customers .checkbox label::before,
body.customers .radio label::before {
  background-color: var(--bg-surface);
  border-color: var(--border-strong);
  box-shadow: none;
}

body.admin .checkbox label::after {
  color: var(--fg);
}

body.admin .radio label::after {
  background-color: var(--accent);
}

body.admin .checkbox input[type="checkbox"]:checked + label::before,
body.admin .checkbox input[type="radio"]:checked + label::before,
body.customers .checkbox input[type="checkbox"]:checked + label::before {
  background-color: var(--accent);
  border-color: var(--accent);
}

body.admin .checkbox input[type="checkbox"]:checked + label::after,
body.admin .checkbox input[type="radio"]:checked + label::after,
body.customers .checkbox input[type="checkbox"]:checked + label::after {
  color: var(--accent-fg);
}

body.admin .checkbox-danger input[type="checkbox"]:checked + label::before {
  background-color: var(--danger);
  border-color: var(--danger);
}

body.admin .checkbox-success input[type="checkbox"]:checked + label::before {
  background-color: var(--success);
  border-color: var(--success);
}

body.admin .checkbox input[type="checkbox"]:disabled + label::before,
body.admin .radio input[type="radio"]:disabled + label::before {
  background-color: var(--bg-sunken);
}

body.admin .checkbox input[type="checkbox"]:focus-visible + label::before,
body.admin .radio input[type="radio"]:focus-visible + label::before {
  box-shadow: var(--ring);
}

body.admin input[type="file"]::file-selector-button,
body.customers input[type="file"]::file-selector-button {
  height: calc(var(--ctl-h-sm, 32px) - 4px);
  margin-right: 10px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  color: var(--fg);
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  cursor: pointer;
}

body.admin input[type="file"]::file-selector-button:hover,
body.customers input[type="file"]::file-selector-button:hover {
  background: var(--bg-hover);
}

body.admin input[type="file"].form-control {
  display: flex;
  align-items: center;
  padding: 3px 4px;
  color: var(--fg-secondary);
}

/* The platform's placeholder photo (a light silhouette on white) turns into a dark disc with a
   light silhouette in dark mode instead of a white disc. */
[data-theme="dark"] body.admin img[src*="user-placeholder"],
[data-theme="dark"] body.customers img[src*="user-placeholder"] {
  filter: invert(0.88) hue-rotate(180deg);
}

/* --- 8e. status labels coloured from the database --------------------------------------------- */

/* Ticket and lead status labels carry the colour an admin picked, inline (color, a 40 % border
   and a near-white 4 % background). The near-white background is a light chip on a dark card,
   and pale picks (grey Closed / Future) fall under 2:1 on white. The admin's colour is kept as
   currentColor and mixed with the theme tokens: tinted soft background, readable text through
   -webkit-text-fill-color (currentColor stays the admin's colour for the tint and border). */
body.admin .label[class*="ticket-status-"],
body.admin a[id^="tableLeadsStatus-"],
body.admin .label[class*="lead-status-"],
body.customers .label[class*="ticket-status-"] {
  background: color-mix(in oklab, currentColor 12%, var(--bg-surface)) !important;
  border-color: color-mix(in oklab, currentColor 35%, transparent) !important;
  -webkit-text-fill-color: color-mix(in oklab, currentColor 55%, var(--fg));
  border-radius: var(--r-sm);
  font-weight: var(--fw-semibold);
}

/* --- 8f. empty data tables --------------------------------------------------------------------- */

/* The platform's "No entries found" row becomes the kit's empty state (icon tile, title). */
body.admin table.dataTable td.dataTables_empty,
body.customers table.dataTable td.dataTables_empty {
  padding: 40px 16px !important;
  text-align: center !important; /* the table theme left-aligns every cell */
  white-space: normal;
  background: transparent !important;
  color: var(--fg);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
}

body.admin table.dataTable td.dataTables_empty::before,
body.customers table.dataTable td.dataTables_empty::before {
  content: "\f01c"; /* inbox, Font Awesome solid */
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-sunken);
  color: var(--fg-muted);
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 20px;
}

body.admin table.dataTable tbody tr:has(> td.dataTables_empty):hover > td {
  background: transparent !important;
}

/* --- 8g. invoice "Record payment" panel ------------------------------------------------------- */

/* The platform template ships a green Save and a red Cancel; the design system has one solid
   primary and a neutral secondary (the credit note refund panel next to it already does). */
body.admin #record_payment_form .panel-footer .btn-success {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

body.admin #record_payment_form .panel-footer .btn-success:hover,
body.admin #record_payment_form .panel-footer .btn-success:focus {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-fg);
}

body.admin #record_payment_form .panel-footer .btn-danger {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--fg);
}

body.admin #record_payment_form .panel-footer .btn-danger:hover,
body.admin #record_payment_form .panel-footer .btn-danger:focus {
  background: var(--bg-hover);
  border-color: var(--fg-faint);
  color: var(--fg);
}

/* --- 9. dark mode ---------------------------------------------------------------------------- */

[data-theme="dark"] body.admin .bootstrap-select > .dropdown-toggle:hover {
  background-color: var(--bg-surface);
}

[data-theme="dark"] body.admin .bootstrap-select .dropdown-menu li.selected a {
  background: var(--accent-soft);
  color: var(--fg);
}

[data-theme="dark"] body.admin .ons-card textarea.tinymce {
  background: var(--bg-surface);
  color: var(--fg);
}
