/* ==========================================================================
   INS.UI sized like DevExpress Blazor 24.2 "Fluent" (fluent-light.bs5).

   INS.SSO ran DevExpress with the Fluent theme. INS.UI 1.0.1 reproduces the
   sizes of the office-white theme used by INS.STR, which are 2px off almost
   everywhere (buttons 30/26 instead of 32/24, editors 30 instead of 32, ...).
   This file restates the Fluent metrics measured on the DevExpress build of
   this app (.dx-evidence/W0b/metrics) so that pages keep their layout.
   Colours stay INS.UI/AMECC (allowed difference).

   Loaded right after _content/INS.UI/css/ins-ui.css (index.html).
   ========================================================================== */

/* ---------- Buttons --------------------------------------------------------
   Fluent DxButton: md 14px/20px text, padding 5px 12px, weight 600 -> 32px;
   sm 12px/16px, padding 3px 8px, weight 400 -> 24px;
   lg 16px/22px, padding 7px 16px, weight 600 -> 38px;
   2px between icon and caption. */
/* font-weight is set directly: AdminLTE 3 fixes `.btn { font-weight: 400 }`, so the Bootstrap
   variable alone has no effect. */
.btn.ins-btn:not(.ins-btn-plain) {
    --bs-btn-line-height: 20px;
    --bs-btn-padding-y: 5px;
    --bs-btn-font-weight: 600;
    font-weight: 600;
    gap: 2px;
}

.btn.ins-btn.btn-sm:not(.ins-btn-plain) {
    --bs-btn-line-height: 16px;
    --bs-btn-padding-y: 3px;
    --bs-btn-font-weight: 400;
    font-weight: 400;
    gap: 2px;
}

.btn.ins-btn.btn-lg:not(.ins-btn-plain) {
    --bs-btn-line-height: 22px;
    --bs-btn-padding-y: 7px;
    --bs-btn-font-weight: 600;
    font-weight: 600;
}

/* Caption box: Fluent pads the caption 2px (md) / 4px (lg) on each side and puts 6.4px between
   icon and caption on lg buttons; sm captions have no padding. */
.btn.ins-btn:not(.btn-sm):not(.btn-lg):not(.ins-btn-plain) > .ins-btn-text {
    padding: 0 2px;
}

.btn.ins-btn.btn-lg:not(.ins-btn-plain) {
    gap: 6.4px;
}

.btn.ins-btn.btn-lg:not(.ins-btn-plain) > .ins-btn-text {
    padding: 0 4px;
}

/* Icon-only: sm is padding 3px around a 12px icon box (20px high, as wide as the glyph + 8px);
   md is padding 5px around a 20 x 20 icon box (32 x 32). */
.btn.ins-btn.ins-btn-icon-only.btn-sm:not(.ins-btn-plain) {
    --ins-btn-icon-pad: 3px;
    --ins-btn-icon-box: 12px;
}

.btn.ins-btn.ins-btn-icon-only:not(.btn-sm):not(.btn-lg):not(.ins-btn-plain) {
    --ins-btn-icon-pad: 5px;
    --ins-btn-icon-box: 20px;
}

.btn.ins-btn.ins-btn-icon-only:not(.btn-sm):not(.btn-lg):not(.ins-btn-plain) > .ins-btn-icon {
    width: 20px;
    text-align: center;
}

/* ---------- Text editors ---------------------------------------------------
   Fluent DxTextBox md: 14px/20px text, padding 5px 6px 5px 10px, 1px border,
   radius 4px -> 32px. sm: 12px/16px, padding 3px 4px 3px 6px, radius 2px -> 24px.
   DxMemo md: same paddings, the frame is 4px taller than rows x 20px + 10px. */
.ins-editor.ins-md {
    --ins-editor-pad-y: 5px;
    --ins-editor-pad-x: 10px;
}

.ins-editor.ins-md > .form-control {
    padding: 5px 6px 5px 10px;
}

/* Validation status (EditForm): Fluent puts the 16px icon 13px from the field's left edge (a 30px
   status area with 10px padding, the icon centred in 20px) and starts the text 37px from that edge.
   Right padding stays 6px (INS.UI widens it to --ins-editor-pad-x with !important). */
.ins-editor.ins-md {
    --ins-editor-status-pad: 12px;
}

.ins-editor.ins-md.ins-has-status > .form-control {
    padding-left: 36px;
}

.ins-editor.ins-md > .form-control:is(.is-invalid, .is-valid) {
    padding-right: 6px !important;
}

.ins-editor.ins-md:has(> .ins-editor-clear) > .form-control.ins-has-clear:is(.is-invalid, .is-valid) {
    padding-right: 46px !important;
}

.ins-editor.ins-sm.ins-has-status > .form-control {
    padding-left: calc(var(--ins-editor-pad-x) + var(--ins-editor-status-pad) + 1.125rem);
}

.ins-editor.ins-md.ins-memo > textarea.form-control {
    padding-top: 6px;
    padding-bottom: 6px;
}

.ins-editor.ins-sm {
    --ins-editor-line-height: 16px;
    --ins-editor-pad-y: 3px;
    --ins-editor-pad-x: 6px;
}

.ins-editor.ins-sm > .form-control {
    padding: 3px 4px 3px 6px;
    border-radius: 2px;
}

/* DevExpress only makes room for the clear button while it is shown (the editor has a value);
   INS.UI reserves it whenever ClearButtonDisplayMode is Auto. Shown, the Fluent clear button is
   a 24 x 24 box 8px right of the text area and 8px from the border: the field is 40px wider. */
.ins-editor.ins-md:not(:has(> .ins-editor-clear)) > .form-control.ins-has-clear {
    padding-right: 6px;
}

.ins-editor.ins-md > .form-control.ins-has-clear {
    padding-right: 46px;
}

.ins-editor.ins-md > .ins-editor-clear {
    right: 9px;
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ins-editor.ins-sm:not(:has(> .ins-editor-clear)) > .form-control.ins-has-clear {
    padding-right: 4px;
}

/* ---------- Check boxes ----------------------------------------------------
   Fluent DxCheckBox md: a 32px-high row, padding-left 8px, 16 x 16 box centred,
   then the caption with 8px padding; the caption is a <label>, which AdminLTE
   renders bold. */
.form-check.ins-checkbox.ins-md {
    display: flex;
    align-items: center;
    min-height: 32px;
    padding: 0 0 0 8px;
    margin-bottom: 0;
}

/* AdminLTE 3.2 ships a full Bootstrap 4 build whose .form-check-input is
   position:absolute (the local bootstrap.min.css link is a 404). With the box
   out of flow the label starts at the content origin and overlaps it — the
   input must return to the flex row. */
.form-check.ins-checkbox > .form-check-input {
    position: static;
}

.form-check.ins-checkbox.ins-md > .form-check-input {
    float: none;
    position: static;
    flex: none;
    width: 16px;
    height: 16px;
    margin: 0;
}

.form-check.ins-checkbox.ins-md > .form-check-label {
    padding-left: 8px;
    font-weight: 700;
    line-height: 20px;
}

/* ---------- Radzen editors (INS.UI.Radzen: ComboBox, SpinEdit, DateEdit) ----
   Fluent DxComboBox / DxSpinEdit / DxDateEdit md: 32px frame with a 1px border,
   text padding 5px 6px 5px 10px, and a 31px button column flush right
   (drop-down / calendar 31 x 30, spin up / down 31 x 15 each). The clear
   button is 24 x 24, 8px left of the drop-down button. */
/* same selector list as ins-ui-radzen.css, which redeclares these on .dark-mode (body) too */
:root,
[data-ins-palette],
[data-bs-theme],
.dark-mode {
    --rz-input-size-md: 32px;
    --rz-input-padding-block-md: 5px;
    --rz-input-padding-inline-md: 10px;
}

.ins-editor.ins-md .rz-dropdown:not(.rz-dropdown-chips) {
    padding: 5px 0 5px 10px;
}

.ins-editor.ins-md .rz-dropdown:not(.rz-dropdown-chips) > .rz-helper-hidden-accessible {
    padding-inline-end: 37px;
}

.ins-editor.ins-md .rz-dropdown:not(.rz-dropdown-chips) > .rz-dropdown-label {
    padding-right: 37px;
}

.ins-editor.ins-md .rz-dropdown:not(.rz-dropdown-chips):has(> .rz-dropdown-clear-icon) > .rz-helper-hidden-accessible,
.ins-editor.ins-md .rz-dropdown:not(.rz-dropdown-chips):has(> .rz-dropdown-clear-icon) > .rz-dropdown-label {
    padding-right: 69px;
    padding-inline-end: 69px;
}

.ins-editor.ins-md .rz-dropdown > .rz-dropdown-trigger {
    top: 0;
    right: 0;
    width: 31px;
    height: 100%;
}

.ins-editor.ins-md .rz-dropdown > .rz-dropdown-clear-icon {
    top: 3px;
    right: 39px;
    width: 24px;
    height: 24px;
    margin: 0;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ins-editor.ins-md .rz-numeric > .rz-numeric-input {
    height: 30px;
    line-height: 20px;
    padding: 5px 37px 5px 10px;
}

.ins-editor.ins-md .rz-numeric > .rz-numeric-button {
    right: 0;
    width: 31px;
    height: 15px;
    margin: 0;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ins-editor.ins-md .rz-numeric > .rz-numeric-up {
    top: 0;
}

.ins-editor.ins-md .rz-numeric > .rz-numeric-down {
    top: 15px;
    bottom: auto;
}

.ins-editor.ins-md .rz-datepicker > .rz-inputtext {
    height: 32px;
    line-height: 20px;
    padding: 5px 37px 5px 10px;
}

.ins-editor.ins-md .rz-datepicker > .rz-datepicker-trigger {
    top: 1px;
    right: 1px;
    width: 31px;
    height: 30px;
    margin: 0;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Popup (InsPopup) -------------------------------------------------
   Fluent DxPopup: no window border, 8px radius, 16px/24px text; header 68px
   (padding 24px 24px 12px, 20px/28px semibold title with 2px block padding,
   32 x 32 close button), no rules between header / body / footer; body padding
   0 24px (24px at the bottom when there is no footer); footer padding
   12px 24px 24px with no gap between buttons (pages space them with ml-2). */
.ins-popup-dialog {
    border: 0;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.5; /* unitless like DxPopup: content of other sizes keeps 1.5 (a 24px icon line is 36px) */
}

.ins-popup-header {
    min-height: 0;
    padding: 24px 24px 12px;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
}

.ins-popup-title {
    font-size: 20px;
    line-height: 28px;
    font-weight: 600;
    padding: 2px 0;
}

/* INS_ValidateForm (INS.DXComponents 2.0) puts its HeaderContent - <h5 class="modal-title"> - in the
   title: keep the title's 28px line (Bootstrap's .modal-title line-height 1.5 = 30px made those
   headers 2px taller than the DxPopup ones). */
.ins-popup-title .modal-title {
    line-height: inherit;
}

.ins-popup-close.btn-close {
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
}

.ins-popup-body {
    padding: 0 24px 24px;
}

.ins-popup-dialog:has(> .ins-popup-footer) > .ins-popup-body {
    padding-bottom: 0;
}

.ins-popup-footer {
    gap: 0;
    padding: 12px 24px 24px;
    border-top: 0;
}