/*!
 * -------------------------------------------------------------------------
 * metademands plugin for GLPI
 * Copyright (C) 2018-2026 by the metademands Development Team.
 *
 * https://github.com/InfotelGLPI/metademands
 * -------------------------------------------------------------------------
 *
 * LICENSE
 *
 * This file is part of metademands.
 *
 * metademands is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * metademands is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with metademands. If not, see <http://www.gnu.org/licenses/>.
 * --------------------------------------------------------------------------
 */

/* Share of the theme's own colours blended into the fixed colours of this stylesheet, and
   the stripes drawn over two of them. Those colours were picked against a white background,
   so under a light palette nothing is blended in and each one is used exactly as it was
   picked; under a dark one enough is blended in for it to sit on a dark background without
   losing what makes it recognisable, and the stripes fade to a hint.

   This is the one place a dark palette is named: `data-glpi-theme-dark` is set on <html> by
   GLPI itself, so every dark palette is covered, including the ones added later. */
:root {
    --md-dark-bg-mix: 0%;
    --md-dark-fg-mix: 0%;
    --md-invalid-bg: #ffdddd;
    --md-stripe: rgba(255, 255, 255, .5);
}

:root[data-glpi-theme-dark="1"] {
    --md-dark-bg-mix: 80%;
    --md-dark-fg-mix: 55%;
    --md-invalid-bg: color-mix(in srgb, #dc3545, var(--tblr-bg-surface) 72%);
    --md-stripe: rgba(255, 255, 255, .06);
}

.metademands_tickettask {
    padding: 5px;
    border: solid 1px #D5D5D5;

    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
}

.informations a[target="_blank"]::before {
    font-family: tabler-icons;
    content: "";
    padding-right: 4px;
}

.metademands_show_values {
    padding: 10px;
    margin: 0px 0px 10px 0px;
    border: solid 1px #D5D5D5;

    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
}

.metademands_show_custom_fields {
    margin-left: auto;
    margin-right: auto;
    /*width: 60%;*/
    /*border-bottom: 1px dashed black;*/
}

.metademands_show_custom_fields td {
    width: 50%;
}

.metademands_duplication {
    padding: 5px;
    font-weight: bold;
    color: red;
    margin-bottom: 10px;
}

.metademands_wizard_rank {
    max-width: 1250px;
    margin: 10px auto 50px !important;
    display: block;
    /*position: relative;line-height: 1.4em;*/
}

/* Form laid out by public/scripts/wizard_layout.js: the width of the mockup, for the title
   and the blocks alike */
.metademands_wizard_rank:has(.md-wizard-layout) {
    max-width: 1180px;
}


.metademands_wizard_title {
    font-size: 18px;
    text-align: center;
    margin-bottom: 0px;
    color: black;
}

.tbl-center {
    text-align: center;
}

.metademands_wizard_img {
    vertical-align: middle;
}

.metademands_wizard_button {
    height: 35px;
    border-top: 2px outset black;
}

.metademand_previous_button {
    float: left;
    margin: 10px;
}

a.metademand_middle_button {
    position: relative;
    left: 50%;
}

/* Hide all steps by default: */
.tab-sc {
    display: none;
}

@media (max-width: 768px) {
    a.metademand_middle_button {
        display: none;
    }
}

.metademand_next_button {
    float: right;
}

.metademands_tree {
    border-bottom: 1px solid #888888;
    border-left: 1px solid #888888;
    float: left;
    height: 10px;
    width: 10px;
    margin-right: 5px;
}

.metademand_metademandtasks {
    background-color: color-mix(in srgb, #aaccf6, var(--tblr-bg-surface) var(--md-dark-bg-mix, 0%));
}

.metademand_metademandfollowup_grey {
    background-color: color-mix(in srgb, #D5D5D5, var(--tblr-bg-surface) var(--md-dark-bg-mix, 0%));
}

.metademand_metademandfollowup_red {
    background-color: color-mix(in srgb, #cf9b9b, var(--tblr-bg-surface) var(--md-dark-bg-mix, 0%));
}

.metademands_wizard {
    margin: 0 auto;
    display: table;
    padding: 5px;
    text-align: left;
    font-size: 14px;
    width: 900px;
    background-color: var(--tblr-bg-surface, #fff);
}

.metademands_wizard_form {
    width: auto;
    margin: 0 auto;
}

.metademands_wizard_form td {
    padding: 5px;
}

.metademands_wizard_red {
    margin-left: 5px;
    color: red;
}

.metademands_wizard_comments {
    font-size: 11px;
}

.metademands_wizard_border {
    border-bottom: #CCC;
    border-bottom-style: solid;
    margin-bottom : 10px;
}

.metademands_wizard_label2 {
    background-color: antiquewhite;
    margin-top : 10px;
    font-size: 13px;
    border: 1px #CCC dashed;
    padding-left: 5px;
}


.metademands_wizard_informations {
    margin-top : 10px!important;
    font-size: 13px;
    border: 1px #CCC dashed;
    padding-left: 5px;
}

.metademands_img img {
    vertical-align: middle;
    border-style: none;
    max-width: 100%;
    /*width: 100%;*/
}

.basket-data {
    margin-bottom: 15px;
    padding: 0.5rem 0.5rem;
}

@media (min-width: 1600px) {
    .basket-data {
        min-width: 550px;
    }
}


.basket-title {
    margin-bottom: 5px !important;
}

button.clear-basket {
    color: #CCC;
    border: none;
    background: none;
}

.speech {
    position: relative;
    /*max-width: 30em;*/
    margin: 5px;
    background-color: var(--tblr-bg-surface, #fff);
    padding: 1.125em 1.5em;
    font-size: 12px;
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, .3), 0 0.0625rem 0.125rem rgba(0, 0, 0, .2);
    /* float: left; */
    display: inline-block;
    vertical-align: top;
    margin-top: 15px;
}

.mydraft-withouttitle {
    float: right;
    display: inline;
    color: #898787;
    z-index: 1000;
    position: relative;
    top: 10px;
    right: -10px;
}

.mydraft-withtitle {
    float: right;
    display: inline;
    color: #898787;
    z-index: 1000;
    position: relative;
}

.mydraft-text {
    margin-top: 15px;
    color: #949191;
    font-size: 12px;
}

.mydraft-fa {
    /*color: #FFF;*/
}

.mydraft-comment {
    color: #949191;
    font-size: 11px;
}

.input-draft {
    background-color: var(--tblr-bg-surface-tertiary, var(--tblr-bg-surface, #f8f9fa));
    position: absolute;
    right: 0;
    display: table;
    border-collapse: separate;
    float: right;
    z-index: 2;
}

.draft {
    position: relative;
    width: 300px;
    margin: 1%;
    background-color: var(--tblr-bg-surface, #fff);
    padding: 1.125em 1.5em;
    font-size: 12px;
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, .3), 0 0.0625rem 0.125rem rgba(0, 0, 0, .2);
    /* float: left; */
    display: table-cell;
    vertical-align: top;
    margin-top: 15px;
}

.draft::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    bottom: 100%;
    /*left: 1.5em;*/
    right: 25px;
    border: .75rem solid transparent;
    border-top: none;
    border-bottom-color: #fff;
    filter: drop-shadow(0 -0.0625rem 0.0625rem rgba(0, 0, 0, .1));
}

.draftcloseButton {
    position: absolute;
    right: 5px;
    border: 0;
    background-color: var(--tblr-bg-surface, #FFF);
    font-size: 9px;
    top: 5px;
}

.speech::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    bottom: 100%;
    left: 1.5em;
    border: .75rem solid transparent;
    border-top: none;
    border-bottom-color: #fff;
    filter: drop-shadow(0 -0.0625rem 0.0625rem rgba(0, 0, 0, .1));
}

.speechcloseButton {
    position: absolute;
    right: 5px;
    border: 0;
    background-color: var(--tblr-bg-surface, #FFF);
    font-size: 9px;
    top: 5px;
}

.titlespeech {
    margin-right: 5px;
    font-weight: bold;
}

.tooltip_group_text {
    margin-left: 90px;
}

.preview-md {
    position: relative;
}

/* Floating block number of the designer preview. The colour used to be printed as a
   <style> block for each block; it now travels as a variable set on the block card. */
.md-preview-tag::before {
    content: attr(data-title);
    background: var(--md-preview-color, #6c757d);
    position: absolute;
    padding: 0 20px;
    color: #fff;
    right: 0;
    top: 0;
    z-index: 1000;
}

/*.select2-selection.select2-selection--single, .select2-container .select2-selection.select2-selection--single, .select2-container .select2-selection.select2-selection--single {*/
/*    width: 100% !important;*/
/*    max-width:100%!important*/
/*}*/

.md-title {
    /*margin-top: 10px!important;*/
}

.md-bottom {
    margin-bottom: 10px;
}

/* step  by step */
.tab-step {
    display: none;
}

.alertelt .alertelttext {
    visibility: hidden;
    color: red;
    text-align: left;
    padding-top: 5px;
    z-index: 1;
}

.alertelt.active .alertelttext {
    visibility: visible;
}

.buttonelt-title {
    word-wrap: break-word;
    white-space: pre-wrap;
    padding-top: 10px!important;
    font-weight: unset;
}

/* Not on a checked radio / checkbox: the forced background hides its checked state, the
   choice looked lost once the submission was blocked by another mandatory field */
input.invalid:not(:checked) {
    background-color: var(--md-invalid-bg, #ffdddd)!important;
}

/* On the box of a select2, not on its container: the container takes the whole row, the
   red outline went around the empty space next to the list */
.invalid + .select2-container .select2-selection,
textarea.invalid,
.invalid + .form-select[multiple],
.invalid + .form-select[size]:not([size="1"]) {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}


/* Make circles that indicate the steps of the form: */
.step_wizard {
    height: 15px;
    width: 15px;
    margin: 0 2px;
    background-color: #c3c9d2;
    border: none;
    /*border-radius: 50%;*/
    display: inline-block;
    opacity: 0.5;
}

.step_wizard.active {
    opacity: 1;
}

.mt-2 {
    margin-top: unset!important;
}

.timeline-item.ITILInterticketfollowup .timeline-content, .timeline-item.ITILInterticketfollowup .timeline-content {
    background-color: #E8DCCA;
    color: #425B64;
    border-color: #ccc;
    /*background-image: url(../pics/timeline/followup.png);*/
    background-repeat: no-repeat;
}

.itil-footer .action-interticketfollowup {
    background-color: #E8DCCA;
    color: #425b64;
}

.timeline-item.PluginMetademandsInterticketfollowup  .timeline-content {
    background-color: #E8DCCA;
    color: #425B64;
    border-color: #E8DCCA;
    border-left: 1em transparent solid;
}
.tab_cadre_fixe .styleLargeTitle, .tab_cadre_navigation_center .styleLargeTitle {
    font-size: 18px;
}

.tab_cadre_navigation_center {
    margin: 10px auto 5px auto;
    padding: 4px;
    border: 1px solid #aaaaaa;
    background-color: var(--tblr-bg-surface, #ffffff);
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    -o-border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
}

.metademand-label {
    font-size: 1em!important;
    line-height: 32px!important;
    /*font-weight: bold!important;*/
}

.md-color:before {
    opacity: 0.1;
}


/*Used in OrderFollowUp*/
#freetable_table select:not(.form-control), #freetable_table input:not(.submit):not(.form-control):not([type=submit]):not([type=color]):not([type=reset]):not([type=checkbox]):not([type=radio]):not(.select2-search__field):not(.numInput):not(.tox-textfield) {
    width: 100%;
}
#wizard_form.formCustomDraft .form-sc-group {
    display: inline-block;
    float: right;
    margin-top: 3px;
}
#wizard_form.formCustomDraft .boutons_draft {
    display: inline-block;
    text-align : center;
}

#wizard_form.formCustomDraft .boutons_draft .update_draft,
#wizard_form.formCustomDraft .boutons_draft .delete_draft{
    margin: 5px;
    /*font-size: 15px;*/
}

#wizard_form .addlineFI:hover{
    cursor:pointer;
}

.step_wizard_div {
    margin-top: 10px;
}

.linkedtooption {
    border: 3px #d1cece dashed;
    background-color: color-mix(in srgb, #efefef, var(--tblr-bg-surface) var(--md-dark-bg-mix, 0%));
    background-image: repeating-linear-gradient(45deg, transparent, transparent 35px, var(--md-stripe, rgba(255,255,255,.5)) 35px, var(--md-stripe, rgba(255,255,255,.5)) 70px);
}

.metatooption {
    border: 3px #aaccf6 dashed;
    background-color: color-mix(in srgb, #aaccf6, var(--tblr-bg-surface) var(--md-dark-bg-mix, 0%));
    background-image: repeating-linear-gradient(45deg, transparent, transparent 35px, var(--md-stripe, rgba(255,255,255,.5)) 35px, var(--md-stripe, rgba(255,255,255,.5)) 70px);
}

.treegrid-indent {
    /*width: 0px;*/
    /*height: 16px;*/
    display: inline-block;
    position: relative;
}

.select2-container .select2-selection--single {
    max-width: 500px !important;
}

/* Dropdowns sized by their text (no width option, like the GLPI object ones: a ticket, a
   software...): a long label stays in its column, cut with an ellipsis, instead of running over
   the field on its right. With the comment icon, core wraps the select2 in a .btn-group, whose
   flex items do not shrink below their content unless allowed to. */
[id-field] .btn-group,
[id-field] .select2-container {
    max-width: 100%;
}

[id-field] .btn-group > .select2-container {
    min-width: 0;
}

.md_buttonelt {
    max-width: 200px;
    min-width: 200px;
    border: 1px solid #000;
    margin-right: 5px;
    margin-top: 5px !important;
    padding-top: 10px;
    padding-bottom: 10px;
    min-height: 130px;
    font-weight: unset;
    font-size: 13px;
}

.my_items {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.tooltipelt .tooltipelttext {
    visibility: hidden;
    color: red;
    text-align: left;
    padding-top: 5px;
    z-index: 1;
}

.tooltipelt.active .tooltipelttext {
    visibility: visible;
}

.alertelt .alertelttext {
    visibility: hidden;
    color: red;
    text-align: left;
    padding-top: 5px;
    z-index: 1;
}

.alertelt.active .alertelttext {
    visibility: visible;
}

.buttonelt-title {
    word-wrap: break-word;
    white-space: pre-wrap;
    padding-top: 10px !important;
    font-weight: unset;
}

.md_buttonelt:hover,
.md_buttonelt:focus,
.md_buttonelt:active {
    background-color: #CCC !important;
    color: white;
}

.md_buttonelt_color {
    background-color: #CCC !important;
    color: white;
}

.tabfieldcontent:not(.active) {
    display: none;
}

.tablinks.active {
    font-weight: 700;
    border-left-color: #bdbdbd !important;
    border-left-width: 5px;
    border-right-color: transparent !important;
    border-right-color: #bdbdbd !important;
}

.tabs-container {
    position: relative;
}

.scrollable-tabs {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scrollable-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tabs .nav-item {
    flex-shrink: 0;
}

.scrollable-tabs {
    margin-right: 30px;
    margin-left: 30px;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: unset;
    border: none;
    color: #878080;
    font-size: 1.2rem;
    padding: 5px 10px;
    cursor: pointer;
    z-index: 999;
}

.scroll-left {
    left: 0;
}
.scroll-right {
    right: 0;
}

/* Style the tab content */
.tabfieldcontent {
    /*display: none;*/
    animation: fadeEffect 1s;
    padding-top: 15px;
    /*border: 1px solid #ccc;*/
}

/* Fade in tabs */
@-webkit-keyframes fadeEffect {
    from {opacity: 0;}
    to {opacity: 1;}
}

@keyframes fadeEffect {
    from {opacity: 0;}
    to {opacity: 1;}
}

.nav-tabs .nav-link.active {
    background: var(--tblr-bg-surface, #ffffff);
    border-bottom: unset !important;
}

.info-alert-info {
    color: #80abe4;
}

.info-alert-warning {
    color: #f76707;
}

.info-alert-danger {
    color: #d63939;
}

select.chained-select {
    width: 85%;
    /*padding: 10px;*/
    margin: 2px 0;
    font-size: 1em;
}

.ios-switch-sm {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}

.ios-switch-sm input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-switch-sm .slider {
    background-color: #dc3545;
    border-radius: 22px;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.ios-switch-sm .slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
    z-index: 2;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.ios-switch-sm .checkmark-on,
.ios-switch-sm .checkmark-off {
    position: absolute;
    font-size: 12px;
    color: white;
    top: 4px;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1;
}

.ios-switch-sm .checkmark-on {
    left: 6px;
    opacity: 0;
}

.ios-switch-sm .checkmark-off {
    right: 6px;
    opacity: 1;
}

.ios-switch-sm input:checked + .slider {
    background-color: #28a745;
}

.ios-switch-sm input:checked + .slider::before {
    transform: translateX(20px);
}

.ios-switch-sm input:checked + .slider .checkmark-on {
    opacity: 1;
}

.ios-switch-sm input:checked + .slider .checkmark-off {
    opacity: 0;
}

.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}

.modal-box {
    background: var(--tblr-bg-surface, white); padding: 20px; border-radius: 8px; max-width: 400px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); text-align: center;
}

.modal-buttons { margin-top: 15px; }

.modal-buttons button { margin: 0 10px; padding: 6px 16px; }

.md-cat-icon-stack {
    display: inline-block;
    position: relative;
    vertical-align: middle;
    width: 70px;
    height: 70px;
}

.md-cat-icon-stack i {
    font-size: 3em;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.md-cat-icon-stack i.sm-size {
    font-size: 1em;
}

.md-fav-icon-stack {
    display: inline-block;
    position: relative;
    vertical-align: middle;
    /*width: 1.3em;*/

    i {
        font-size: 2em;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);

        &.sm-size {
            font-size: 1em;
        }
    }
}

.mobile-only { display: none; }
.desktop-only { display: inline; }

@media (max-width: 768px) {
    .mobile-only { display: inline; }
    .desktop-only { display: none; }
}

/* Text fields carry a size attribute (35 / 70 characters) wider than a phone screen. */
.md-wizard input.form-control {
    max-width: 100%;
}

/* "Wizard creation" tab (templates/field_list.html.twig): blocks stacked as cards, one compact
   row per field, preview of the selected block next to them. */
.md-builder .md-search {
    min-width: 260px;
}

.md-builder .md-sticky {
    position: sticky;
    top: 1rem;
}

.md-builder .md-block .card-header [aria-expanded="false"] .md-chevron {
    transform: rotate(-90deg);
}

.md-builder .md-fields {
    min-height: 2.5rem; /* an empty block still accepts a dropped field */
}

.md-builder .md-field {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--tblr-border-color);
    background: var(--tblr-bg-surface);
    cursor: pointer;
}

.md-builder .md-field:hover {
    background: var(--tblr-bg-surface-secondary);
}

.md-builder .md-field.is-selected {
    background: var(--tblr-primary-lt);
    box-shadow: inset 3px 0 0 var(--tblr-primary);
}

/* Inactive field (Field.is_active): greyed out, its badges stay readable */
.md-builder .md-field.md-field-inactive .md-type,
.md-builder .md-field.md-field-inactive .md-label {
    opacity: .5;
}

.md-builder .md-field.md-field-inactive .md-title {
    text-decoration: line-through;
}

.md-builder .md-field-placeholder {
    border: 1px dashed var(--tblr-primary);
    background: var(--tblr-primary-lt);
}

.md-builder .md-grip {
    cursor: grab;
    color: var(--tblr-secondary);
}

.md-builder.md-filtering .md-grip {
    visibility: hidden; /* no drag and drop while the list is filtered */
}

.md-builder .md-type {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: var(--tblr-bg-surface-secondary);
    color: var(--tblr-secondary);
}

.md-builder .md-label {
    flex: 1 1 auto;
    min-width: 0;
}

/* Same weight as the labels of the form (.col-form-label), shown in the preview next to it */
.md-builder .md-label .md-title {
    display: block;
    font-weight: var(--tblr-font-weight-medium, 500);
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.md-builder .md-label .md-meta {
    font-size: .78rem;
    color: var(--tblr-secondary);
}

.md-builder .md-badges {
    max-width: 50%;
}

.md-builder .md-actions {
    opacity: .4;
    transition: opacity .15s;
}

.md-builder .md-field:hover .md-actions,
.md-builder .md-field.is-selected .md-actions {
    opacity: 1;
}

.md-builder .md-add-here {
    width: 100%;
    padding: .5rem;
    border: 1px dashed var(--tblr-border-color);
    border-radius: 0 0 var(--tblr-border-radius) var(--tblr-border-radius);
    background: transparent;
    color: var(--tblr-secondary);
}

.md-builder .md-add-here:hover {
    border-color: var(--tblr-primary);
    color: var(--tblr-primary);
}

/* Label renamed in place: the button shows on the line hovered */
.md-builder .md-title-line {
    min-width: 0;
}

.md-builder .md-title-line .md-title {
    min-width: 0;
}

.md-builder .md-rename {
    flex: none;
    opacity: 0;
    transition: opacity .15s;
}

.md-builder .md-field:hover .md-rename,
.md-builder .md-rename:focus-visible {
    opacity: 1;
}

.md-builder .md-rename-input {
    max-width: 28rem;
}

/* Parameters of a field, edited in a panel under its line */
.md-builder .md-field.is-editing {
    background: var(--tblr-primary-lt);
}

.md-builder .md-field-panel {
    padding: .75rem 1rem 1rem;
    border-bottom: 1px solid var(--tblr-border-color);
    background: var(--tblr-bg-surface-secondary);
    box-shadow: inset 3px 0 0 var(--tblr-primary);
}

.md-builder .md-field-panel-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
}

.md-builder .md-field-panel-title {
    min-width: 0;
    overflow: hidden;
    font-weight: var(--tblr-font-weight-bold, 600);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.md-builder .md-field-panel-body > form > .card:first-of-type {
    margin-top: 0 !important;
}

.md-builder .md-preview {
    max-height: calc(100vh - 8rem);
    overflow: auto;
}

.md-builder .md-preview [id-field] {
    cursor: pointer;
    border-radius: 6px;
    padding: .25rem .5rem;
}

.md-builder .md-preview [id-field]:hover {
    background: var(--tblr-bg-surface-secondary);
}

/* The 32px line height of the wizard labels spreads the narrow preview column: the label sits
   right above its input, as in a regular GLPI form */
.md-builder .md-preview .metademand-label {
    line-height: 1.4 !important;
    padding-bottom: .25rem;
}

.md-builder .md-preview .md-preview-selected {
    outline: 2px solid var(--tblr-primary);
    outline-offset: 2px;
}

/* Custom values of a field (templates/fields/field_customvalue_list.html.twig and
   field_customvalue_add.html.twig): the value takes the room left on its line instead of a
   fixed width that cut the long ones. */
.md-customvalue-name {
    flex: 2 1 280px;
    min-width: 200px;
}

.md-customvalue-comment {
    flex: 1 1 260px;
    min-width: 220px;
}

/* "Child creation" tab (templates/task_list.html.twig): one card per child, indented under
   its parent ticket by --md-depth. */
.md-children .md-child {
    padding-left: calc(1rem + var(--md-depth, 0) * 1.75rem);
}

/* Visibilities of the blocks in step-by-step mode (templates/forms/step_by_block.html.twig):
   numbered steps linked by a line, a stripe of the colour of who fills the block in */
.md-visibilities .md-visibility-step {
    flex: none;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--tblr-primary-lt);
    color: var(--tblr-primary);
    font-weight: var(--tblr-font-weight-bold, 600);
    font-size: .8125rem;
}

.md-visibilities .md-visibility-step-end {
    background: var(--tblr-green-lt);
    color: var(--tblr-green);
}

.md-visibilities .md-visibility-groups {
    box-shadow: inset 4px 0 0 var(--tblr-blue);
}

.md-visibilities .md-visibility-supervisor {
    box-shadow: inset 4px 0 0 var(--tblr-orange);
}

.md-visibilities .md-visibility-all {
    box-shadow: inset 4px 0 0 var(--tblr-green);
}

.md-visibilities .md-visibility.list-group-item-action {
    color: var(--tblr-body-color);
    cursor: pointer;
}

.md-visibilities .md-visibility-delete .btn,
.md-visibilities .md-visibility-delete button {
    color: var(--tblr-red);
}

/* Visibility tab (templates/group.html.twig): a green stripe on the allowed groups, a red
   one on the excluded groups */
.md-visibility-groups .md-group-allowed {
    box-shadow: inset 4px 0 0 var(--tblr-green);
}

.md-visibility-groups .md-group-excluded {
    box-shadow: inset 4px 0 0 var(--tblr-red);
}

/* A row opening the form of its child: the hand cursor of the legacy .pointer class, without
   its opacity of .7 which greyed the whole row until hovered */
.md-children .md-child.list-group-item-action {
    cursor: pointer;
}

/* A stripe on the left: green for the children always created, purple for the conditional
   ones (templates/task_list.html.twig) */
.md-children .md-child-always {
    box-shadow: inset 4px 0 0 var(--tblr-green);
}

/* The children always created stand out with the look of a hovered row: a clickable row
   (.list-group-item-action) keeps a grey text until hovered */
.md-children .md-child-always,
.md-children .md-child-always.list-group-item-action {
    color: var(--tblr-body-color);
    background-color: var(--tblr-list-group-action-hover-bg, var(--tblr-bg-surface-secondary));
}

.md-children .md-child-conditional {
    box-shadow: inset 4px 0 0 var(--tblr-purple);
}

.md-children .md-type {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: var(--tblr-bg-surface-secondary);
    color: var(--tblr-secondary);
}

/* Wizard (templates/wizard_metademands.html.twig), laid out by public/scripts/wizard_layout.js:
   blocks as numbered cards, labels right above their input, sticky actions, summary of the
   blocks for a one page form, stepper for a step by step form, yes / no buttons. */
.md-wizard-layout [bloc-id^="bloc"].card {
    margin-bottom: 1rem;
    box-shadow: var(--tblr-box-shadow-card, 0 1px 2px rgba(0, 0, 0, .05));
}

/* Header of a block: the title-block field sits in its own field wrapper (a padded column),
   both marked by wizard_layout.js. The header spans the whole card. */
.md-wizard-layout .md-block-header-wrap {
    padding: 0 !important;
    margin: 0 !important;
}

.md-wizard-layout .md-block-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 0 !important;
    padding: .85rem 1.25rem;
}

/* Fold chevron: on the far right of the header, after the count of the mandatory fields */
.md-wizard-layout .md-block-header [data-metademands-collapse] {
    top: 50%;
    right: 1rem !important;
    transform: translateY(-50%);
}

.md-wizard-layout .md-block-header .card-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0;
    font-size: 1.05rem;
}

/* Fields of a block: more room between the rows than the legacy 10px of .md-bottom */
.md-wizard-layout [id-field].md-bottom {
    margin-bottom: 1.25rem;
}

.md-wizard-layout .metademand-label {
    line-height: 1.4 !important;
    padding-top: 0;
    padding-bottom: .35rem;
    font-weight: var(--tblr-font-weight-medium, 500);
}

/* Next to the title of a block: its mandatory fields (templates/wizard_layout.js) */
.md-wizard-layout .md-block-meta {
    margin-left: auto;
    margin-right: 1.5rem; /* clear of the fold chevron, on the far right */
    color: var(--tblr-secondary);
    font-size: .8rem;
    white-space: nowrap;
    cursor: default;
}

.md-wizard-layout .md-block-meta[title]:not([title=""]) {
    cursor: pointer;
}

.md-wizard-layout .md-block-meta.is-complete {
    color: var(--tblr-success);
}

/* Title of the form (templates/wizard/metademand_title.html.twig) */
.md-title-card .card-body {
    padding: 1rem 1.25rem;
}

.md-title-visual {
    flex: none;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--tblr-primary-lt);
    color: var(--tblr-primary);
    font-size: 26px;
}

.md-title-visual.md-title-illustration {
    width: 70px;
    height: 70px;
    overflow: hidden;
    background: transparent;
}

.md-title-visual.md-title-illustration > *,
.md-title-visual.md-title-illustration svg,
.md-title-visual.md-title-illustration img {
    max-width: 100%;
    max-height: 100%;
}

.md-title-text {
    flex: 1 1 auto;
    min-width: 0;
}

.md-title-name {
    margin: 0;
    font-size: 1.35rem;
    font-weight: var(--tblr-font-weight-bold, 600);
}

.md-title-comment {
    margin-top: .2rem;
    font-size: .875rem;
    /* Two lines at most, as on the cards of the forms (.md-choice-comment): the whole comment
       in the tooltip */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.md-title-comment p {
    margin: 0;
}

.md-title-requester {
    flex: none;
    text-align: right;
    line-height: 1.5;
}

@media (max-width: 767.98px) {
    .md-title-requester {
        text-align: left;
    }
}

/* Choice of the type (templates/wizard/metademand_types.html.twig) and of the form
   (templates/wizard/metademands_list.html.twig): clickable cards, the icon in a tile tinted
   from its own colour */
.md-choice-card {
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.md-choice-card:hover,
.md-choice-card:focus-visible {
    color: inherit;
    text-decoration: none;
    border-color: var(--tblr-primary);
    box-shadow: 0 .25rem .75rem rgba(var(--tblr-primary-rgb, 32, 107, 196), .12);
    transform: translateY(-2px);
}

.md-choice-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    color: var(--tblr-primary);
    background: color-mix(in srgb, currentColor 12%, transparent);
    font-size: 24px;
}

.md-choice-text {
    flex: 1 1 auto;
    min-width: 0;
}

.md-choice-name {
    margin: 0 0 .25rem;
    font-size: 1rem;
    font-weight: var(--tblr-font-weight-bold, 600);
    line-height: 1.35;
}

/* The comment of the designer: three lines at most, the whole one in the tooltip of the card */
.md-choice-comment {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    font-size: .8125rem;
    line-height: 1.45;
}

.md-choice-comment p {
    margin: 0;
}

.md-choice-chevron {
    flex: none;
    align-self: center;
    color: var(--tblr-secondary);
    font-size: 1.1rem;
    transition: transform .15s ease, color .15s ease;
}

.md-choice-card:hover .md-choice-chevron {
    color: var(--tblr-primary);
    transform: translateX(2px);
}

/* Search of a form: the results drop over the cards instead of pushing them down */
.md-form-search {
    position: relative;
    max-width: 640px;
}

.md-form-search .results {
    position: absolute;
    z-index: 10;
    top: calc(100% + .25rem);
    left: 0;
    right: 0;
    max-height: 60vh;
    overflow: auto;
    background: var(--tblr-bg-surface);
    box-shadow: var(--tblr-box-shadow-dropdown, 0 .5rem 1rem rgba(0, 0, 0, .15));
}

.md-form-search .results:empty {
    display: none;
}

/* Most used forms: shortcuts as chips */
.md-most-used-item {
    border: 1px solid var(--tblr-border-color);
    background: var(--tblr-bg-surface);
    color: var(--tblr-body-color);
}

.md-most-used-item:hover {
    border-color: var(--tblr-primary);
    color: var(--tblr-primary);
}

/* Choice of the form from a drop-down (display by list of the configuration) */
.md-form-select {
    max-width: 720px;
}

/* "Your forms" (templates/wizard/models_and_drafts.html.twig): a button on the right of the
   title, its panel opening right under it instead of the middle of the card */
.md-title-forms {
    position: relative;
    flex: none;
    align-self: center;
}

.md-title-forms .mydraft-withtitle {
    float: none;
    display: block;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
}

.md-forms-toggle {
    white-space: nowrap;
}

/* The panel: tabs on a grey band, a scrolling body, the lists as plain rows. Its lists are
   legacy tables whose rows are reloaded through Ajax (ajax/deleteform.php...), hence the
   styling instead of a new markup. */
.md-title-forms #divnavforms {
    top: calc(100% + .5rem);
    right: 0;
    width: min(560px, 92vw);
    margin-top: 0 !important;
    padding: 0;
    overflow: hidden;
    background: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    box-shadow: var(--tblr-box-shadow-dropdown, 0 .5rem 1rem rgba(0, 0, 0, .15));
}

#divnavforms .nav-tabs {
    padding: .25rem .75rem 0;
    background: var(--tblr-bg-surface-secondary);
    border-bottom: 1px solid var(--tblr-border-color);
}

#divnavforms .md-forms-close {
    margin: 0 .25rem .25rem 0;
}

#divnavforms .tab-content {
    max-height: 60vh;
    overflow: auto;
    padding: .75rem 1rem 1rem;
}

/* Section headings: "New model", "Your private models"... */
#divnavforms .card-header,
#divnavforms .tab_cadre_fixe th {
    padding: .5rem 0 .35rem;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--tblr-border-color);
    color: var(--tblr-secondary);
    font-size: .75rem;
    font-weight: var(--tblr-font-weight-bold, 600);
    letter-spacing: .05em;
    text-align: left;
    text-transform: uppercase;
}

#divnavforms .card-header .red {
    color: var(--tblr-danger);
}

#divnavforms .tab_cadre_fixe {
    width: 100%;
    margin: 0 0 1rem;
    border: 0;
    border-collapse: collapse;
    background: none;
    box-shadow: none;
}

#divnavforms .tab_cadre_fixe td {
    padding: .45rem .25rem;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--tblr-border-color-translucent, var(--tblr-border-color));
    vertical-align: middle;
}

#divnavforms .tab_cadre_fixe tr:last-child td {
    border-bottom: 0;
}

/* Actions of a row: narrow cells on the right */
#divnavforms .tab_cadre_fixe td:not(:first-child):not([colspan]) {
    width: 1%;
    white-space: nowrap;
}

/* The "new model / draft" cell: the name and its buttons on one line */
#divnavforms .tab_cadre_fixe td[colspan].center {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    padding: .75rem 0;
    text-align: left;
    border-bottom: 0;
}

#divnavforms .tab_cadre_fixe td[colspan].center > br {
    display: none;
}

/* The name on its own line, the buttons together under it */
#divnavforms .tab_cadre_fixe td[colspan].center > .form-control {
    flex: 1 1 100%;
    width: auto;
}

/* Free table (templates/fields/field_freetable.html.twig): kept in its card, scrolling when
   its columns need more room; its inputs take the width of their column rather than the
   fixed "size" of their attribute */
.md-freetable-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.md-freetable-scroll > table {
    margin-bottom: 0;
}

/* A table needs the whole width of its block, whatever the "row display" of its field */
[id-field][class*="col-md-"]:has(.md-freetable-scroll) {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
}

/* Small minimums so that the columns and their buttons fit in the card: the scrolling is
   only a last resort for a table with many columns */
.md-freetable-scroll td input[type="text"],
.md-freetable-scroll td select {
    width: 100%;
    min-width: 5rem;
}

.md-freetable-scroll td input[type="date"],
.md-freetable-scroll td input[type="time"] {
    width: 100%;
    min-width: 8.5rem;
}

/* Second label of a field (templates/fields/field_wrapper.html.twig): a help under the field,
   small and grey, the rich text of the designer kept */
.md-field-help {
    display: flex;
    align-items: flex-start;
    gap: .4rem;
    margin-top: .35rem;
    color: var(--tblr-secondary);
    font-size: .8rem;
    line-height: 1.45;
}

.md-field-help > .ti {
    flex: none;
    margin-top: .1rem;
    font-size: .95rem;
}

.md-field-help > div {
    min-width: 0;
}

.md-field-help p {
    margin: 0 0 .25rem;
}

.md-field-help ul,
.md-field-help ol {
    margin: 0 0 .25rem;
    padding-left: 1.1rem;
}

/* Title field (templates/fields/field_display_title.html.twig): a section heading inside its
   block, small capitals over a thin line, in the colour chosen by the designer if any */
.md-section-title {
    margin: .5rem 0 1rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid var(--tblr-border-color);
}

.md-section-title-text {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    color: var(--md-section-color, var(--tblr-secondary));
    font-size: .75rem;
    font-weight: var(--tblr-font-weight-bold, 600);
    letter-spacing: .05em;
    line-height: 1.4;
    text-transform: uppercase;
}

.md-section-title-text > i {
    font-size: 1rem;
}

.md-section-title-comment {
    margin-top: .25rem;
    color: var(--tblr-secondary);
    font-size: .8rem;
}

/* Information, warning and alert boxes (templates/fields/field_display_information.html.twig):
   the icon on the left of the first line, the name as the title of the box */
.alert.md-info {
    --md-info-accent: var(--tblr-azure, #4299e1);
    --md-info-text-mix: 55%;
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .75rem 1rem;
    /* Tinted box, as in the mockup: light background, soft border, dark text of the kind.
       Mixed with the theme colours, so it also reads in dark mode */
    background: color-mix(in srgb, var(--md-info-accent) 9%, var(--tblr-bg-surface));
    border: 1px solid color-mix(in srgb, var(--md-info-accent) 28%, var(--tblr-bg-surface));
    border-radius: var(--tblr-border-radius);
    color: color-mix(in srgb, var(--md-info-accent) var(--md-info-text-mix), var(--tblr-body-color));
    box-shadow: none;
}

.alert.md-info.alert-warning {
    --md-info-accent: var(--tblr-yellow, #f59f00);
    --md-info-text-mix: 50%;
}

.alert.md-info.alert-danger {
    --md-info-accent: var(--tblr-red, #d63939);
    --md-info-text-mix: 60%;
}

.alert.md-info .md-info-icon {
    color: var(--md-info-accent);
}

.alert.md-info .md-info-icon {
    flex: none;
    font-size: 1.35rem;
    line-height: 1.2;
}

.alert.md-info .md-info-icon:empty {
    display: none;
}

.alert.md-info .md-info-body {
    flex: 1 1 auto;
    min-width: 0;
}

.alert.md-info .md-info-title {
    font-weight: var(--tblr-font-weight-bold, 600);
    margin-bottom: .15rem;
}

.alert.md-info .md-info-text > :last-child {
    margin-bottom: 0;
}

/* One page form: the blocks are numbered (hidden ones are not counted, nor the information
   of the form above them) */
.md-wizard-layout .tab-nostep {
    counter-reset: md-block;
}

.md-wizard-layout .tab-nostep > [bloc-id^="bloc"]:not([data-md-form-information]) {
    counter-increment: md-block;
}

/* md-numbered: set by wizard_layout.js when several blocks are shown */
.md-wizard-layout .tab-nostep.md-numbered > [bloc-id^="bloc"] .md-block-header .card-title::before {
    content: counter(md-block);
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--tblr-primary-lt);
    color: var(--tblr-primary);
    font-size: .8rem;
    font-weight: 600;
}

/* One page form: summary on the right. The legacy step flow sets an inline display on
   .tab-nostep, hence the !important, skipped when it hides it. */
.md-wizard-layout .md-summary {
    display: none;
}

@media (min-width: 992px) {
    .md-wizard-layout .tab-nostep.md-has-summary:not([style*="none"]) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 260px;
        column-gap: 1rem;
        align-items: start;
    }

    .md-wizard-layout .tab-nostep.md-has-summary > * {
        grid-column: 1;
    }

    .md-wizard-layout .tab-nostep.md-has-summary > .md-summary {
        display: block;
        grid-column: 2;
        grid-row: 1 / span 200;
        position: sticky;
        top: 1rem;
        align-self: start;
    }
}

.md-wizard-layout .md-summary-list .list-group-item {
    border-left: 3px solid transparent;
    padding: .5rem .75rem;
    font-size: .875rem;
}

.md-wizard-layout .md-summary-list .list-group-item.active {
    border-left-color: var(--tblr-primary);
    background: var(--tblr-primary-lt);
    color: var(--tblr-primary);
    font-weight: 500;
}

.md-wizard-layout .md-summary-list .list-group-item {
    align-items: flex-start !important;
}

.md-wizard-layout .md-summary > .card-header .card-title {
    color: var(--tblr-secondary);
    font-size: .75rem;
    font-weight: var(--tblr-font-weight-bold, 600);
    letter-spacing: .05em;
    text-transform: uppercase;
}

.md-wizard-layout .md-summary-text {
    flex: 1 1 auto;
    min-width: 0;
}

.md-wizard-layout .md-summary-missing {
    font-size: .75rem;
}

.md-wizard-layout .md-summary-missing:empty {
    display: none !important;
}

.md-wizard-layout .md-summary-number {
    flex: none;
    min-width: 1.25rem;
    color: var(--tblr-secondary);
    font-weight: 600;
}

.md-wizard-layout .md-summary-count {
    flex: none;
    font-size: .75rem;
    white-space: nowrap;
}

/* Step by step form: the tab bar becomes a numbered stepper, the circles a progress bar */
.md-wizard-layout .tabs-container {
    background: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    padding: .5rem 0;
    margin-bottom: .5rem;
}

.md-wizard-layout #fieldslist {
    counter-reset: md-step;
    gap: .25rem;
    border: 0;
}

.md-wizard-layout #fieldslist .nav-link.tablinks {
    counter-increment: md-step;
    border: 0 !important;
    border-radius: var(--tblr-border-radius);
    padding: .4rem .75rem;
    color: var(--tblr-secondary);
    font-weight: 500;
    background: transparent;
    white-space: nowrap;
}

.md-wizard-layout #fieldslist .nav-link.tablinks::before {
    content: counter(md-step);
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    margin-right: .5rem;
    border: 2px solid var(--tblr-border-color);
    border-radius: 50%;
    background: var(--tblr-bg-surface);
    font-size: .8rem;
    font-weight: 600;
    vertical-align: middle;
}

.md-wizard-layout #fieldslist .nav-link.tablinks.md-step-done {
    color: var(--tblr-body-color);
}

.md-wizard-layout #fieldslist .nav-link.tablinks.md-step-done::before {
    content: "\2713";
    border-color: var(--tblr-green);
    background: var(--tblr-green);
    color: #fff;
}

.md-wizard-layout #fieldslist .nav-link.tablinks.active {
    background: var(--tblr-primary-lt);
    color: var(--tblr-primary);
    font-weight: 600;
}

.md-wizard-layout #fieldslist .nav-link.tablinks.active::before {
    content: counter(md-step);
    border-color: var(--tblr-primary);
    background: var(--tblr-primary);
    color: #fff;
}

/* Block of a later actor, out of reach from the tab bar (see
   plugin_metademands_wizard_refreshStepTabs() in scripts/metademands.js) */
.md-wizard-layout #fieldslist .nav-link.tablinks.disabled {
    opacity: .5;
}

.md-wizard-layout .md-steps-progress {
    margin-bottom: 1rem;
}

.md-wizard-layout .md-steps-progress .md-steps-text {
    margin-bottom: .25rem;
}

/* Footer: keyed on the attribute printed by the server, not on the md-wizard-layout class
   added by public/scripts/wizard_layout.js. GLPI loads the plugin modules at the end of the
   page, so until then the legacy buttons showed under the loading spinner. */
.md-wizard[data-md-wizard-layout] .step_wizard_div {
    display: none;
}

/* Actions always reachable at the bottom of the screen */
.md-wizard[data-md-wizard-layout] .form-sc-group {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin-top: 1rem;
    padding: .5rem 1rem;
    background: var(--tblr-bg-surface);
    border-top: 1px solid var(--tblr-border-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .06);
}

/* "Save as draft" on the left, then the sections / step, the navigation on the right */
.md-wizard[data-md-wizard-layout] .form-sc-group > .center > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: .5rem;
    margin-top: 0 !important;
}

.md-wizard[data-md-wizard-layout] .form-sc-group #nextMsg {
    order: -3;
    flex: 1 0 100%;
    margin-bottom: .25rem;
}

.md-wizard[data-md-wizard-layout] .form-sc-group #div_save_draft {
    order: -2;
    float: none !important;
    margin: 0 !important;
}

.md-wizard[data-md-wizard-layout] .form-sc-group #button_save_draft {
    background: transparent;
    border-color: transparent;
    color: var(--tblr-secondary);
    box-shadow: none;
}

.md-wizard[data-md-wizard-layout] .form-sc-group #button_save_draft:hover {
    background: var(--tblr-bg-surface-secondary);
    color: var(--tblr-body-color);
}

.md-wizard[data-md-wizard-layout] .form-sc-group .md-footer-state {
    order: -1;
    margin-right: auto;
    color: var(--tblr-secondary);
    font-size: .875rem;
}

.md-wizard[data-md-wizard-layout] .form-sc-group #prevBtn {
    margin-right: 0 !important;
    background: var(--tblr-bg-surface);
    border-color: var(--tblr-border-color-dark, #dadfe5);
    color: var(--tblr-body-color);
}

.md-wizard[data-md-wizard-layout] .form-sc-group #nextBtn,
.md-wizard[data-md-wizard-layout] .form-sc-group #nextBtn2 {
    margin-right: 0 !important;
}

/* Step by step form whose steps filled already break the conditions: no "Next" */
.md-wizard[data-md-wizard-layout].md-conditions-blocked .form-sc-group #nextBtn,
.md-wizard[data-md-wizard-layout].md-conditions-blocked .form-sc-group #nextBtn2 {
    display: none !important;
}

/* In place of the send button, while the request does not meet the conditions */
.md-wizard[data-md-wizard-layout] .form-sc-group .md-conditions-message {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .9rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    background: var(--tblr-bg-surface-secondary);
    color: var(--tblr-secondary);
    font-size: .875rem;
    cursor: default;
}

/* With mandatory fields left, the message leads to the first of them */
.md-wizard[data-md-wizard-layout] .form-sc-group .md-conditions-message.is-actionable {
    cursor: pointer;
}

.md-wizard[data-md-wizard-layout] .form-sc-group .md-conditions-message.is-actionable:hover {
    color: var(--tblr-body-color);
}

/* The last step sends the request */
.md-wizard[data-md-wizard-layout] .form-sc-group #nextBtn[data-md-title-kind="submit"] {
    background: var(--tblr-success);
    border-color: var(--tblr-success);
    color: var(--tblr-success-fg, #fff);
}

/* Yes / no field of the "buttons" display (Fields\Yesno::BUTTONS_DISPLAY), in the wizard and
   in the preview: the original select stays in the form, out of sight. select2 may insert its
   box before or after the buttons, hence the general sibling. */
select.md-yesno-buttons[data-md-yesno] ~ .select2-container {
    display: none !important;
}

select.md-yesno-buttons[data-md-yesno]:not(.select2-hidden-accessible) {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Neutral buttons, the chosen answer filled with the primary colour */
.md-yesno .btn {
    min-width: 4.5rem;
    background: var(--tblr-bg-surface);
    border-color: var(--tblr-border-color-dark, #dadfe5);
    color: var(--tblr-body-color);
    font-weight: var(--tblr-font-weight-medium, 500);
    box-shadow: none;
}

.md-yesno .btn:hover {
    background: var(--tblr-bg-surface-secondary);
}

.md-yesno .btn.active,
.md-yesno .btn.active:hover {
    background: var(--tblr-primary);
    border-color: var(--tblr-primary);
    color: var(--tblr-primary-fg, #fff);
}

.md-yesno.is-invalid .btn:not(.active) {
    border-color: var(--tblr-danger);
}

/* Column titles as written, not in capitals (Tabler card tables): display order of the
   references of a basket field (templates/fields/field_basket_order.html.twig) */
.table.md-plain-headers thead th {
    text-transform: none;
}

/* Active / inactive switch of the field form (templates/field_form.html.twig): only the
   indicator matching the switch is shown */
.md-active-switch input:checked ~ .md-active-off,
.md-active-switch input:not(:checked) ~ .md-active-on {
    display: none;
}

/* Type picker of the new field form (templates/field_form.html.twig,
   public/scripts/field_type_picker.js): the types by family, as cards */
.md-type-group {
    margin-bottom: 1rem;
}

.md-type-group-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
    color: var(--tblr-secondary);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.md-type-group-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--tblr-border-color);
}

.md-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: .5rem;
}

.md-type-card {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    padding: .625rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius-lg, 8px);
    background: var(--tblr-bg-surface);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .12s, box-shadow .12s;
}

.md-type-card:hover,
.md-type-card:focus-visible {
    border-color: var(--tblr-primary);
    box-shadow: 0 0 0 .2rem var(--tblr-primary-lt);
    outline: 0;
}

.md-type-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2.125rem;
    height: 2.125rem;
    border-radius: var(--tblr-border-radius-lg, 8px);
    font-size: 1.15rem;
    background: var(--tblr-bg-surface-secondary);
    color: var(--tblr-secondary);
}

.md-type-name {
    display: block;
    font-weight: 600;
}

.md-type-desc {
    display: block;
    margin-top: .0625rem;
    color: var(--tblr-secondary);
    font-size: .8rem;
}

.md-type-family-text .md-type-icon { background: var(--tblr-blue-lt); color: var(--tblr-blue); }
.md-type-family-choice .md-type-icon { background: var(--tblr-purple-lt); color: var(--tblr-purple); }
.md-type-family-glpi .md-type-icon { background: var(--tblr-teal-lt); color: var(--tblr-teal); }
.md-type-family-date .md-type-icon { background: var(--tblr-orange-lt); color: var(--tblr-orange); }
.md-type-family-advanced .md-type-icon { background: var(--tblr-pink-lt); color: var(--tblr-pink); }

/* The type chosen, above the settings of the new field */
.md-type-chosen {
    display: flex;
    align-items: center;
    gap: .625rem;
    margin-bottom: 1rem;
    padding: .625rem .75rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius-lg, 8px);
    background: var(--tblr-bg-surface-secondary);
}

.md-field-more {
    padding: .5rem .75rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius-lg, 8px);
}

.md-field-more > summary {
    cursor: pointer;
}

/* Buttons of the field form: no display utility, which would beat the hidden attribute set
   while the type of a new field is chosen */
.md-field-footer {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}

/* Option form of a field (templates/field_option_form.html.twig, field_option_link.html.twig,
   public/scripts/fieldoption_valuetocheck.js): its condition, then its actions as cards */
.md-option-form .md-action-green { --md-action: var(--tblr-green); --md-action-lt: var(--tblr-green-lt); }
.md-option-form .md-action-red { --md-action: var(--tblr-red); --md-action-lt: var(--tblr-red-lt); }
.md-option-form .md-action-blue { --md-action: var(--tblr-blue); --md-action-lt: var(--tblr-blue-lt); }
.md-option-form .md-action-azure { --md-action: var(--tblr-azure); --md-action-lt: var(--tblr-azure-lt); }
.md-option-form .md-action-purple { --md-action: var(--tblr-purple); --md-action-lt: var(--tblr-purple-lt); }
.md-option-form .md-action-indigo { --md-action: var(--tblr-indigo); --md-action-lt: var(--tblr-indigo-lt); }
.md-option-form .md-action-orange { --md-action: var(--tblr-orange); --md-action-lt: var(--tblr-orange-lt); }
.md-option-form .md-action-teal { --md-action: var(--tblr-teal); --md-action-lt: var(--tblr-teal-lt); }
.md-option-form .md-action-secondary { --md-action: var(--tblr-secondary); --md-action-lt: var(--tblr-secondary-lt); }

.md-option-step-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 1.25rem 0 .625rem;
    font-weight: 600;
}

.md-option-form > .md-option-step-title:first-of-type {
    margin-top: 0;
}

.md-option-step-number {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--tblr-primary);
    color: var(--tblr-primary-fg, #fff);
    font-size: .8rem;
}

.md-option-condition {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
}

.md-option-condition-label {
    color: var(--tblr-secondary);
}

.md-option-condition .dropdown-valuetocheck {
    flex: 1 1 16rem;
    min-width: 16rem;
}

.md-option-condition .select2-container {
    max-width: 100%;
}

.md-option-negation-help {
    display: none;
}

.md-option-negated .md-option-negation-help {
    display: block;
}

.md-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: .5rem;
}

.md-action-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .5rem 2rem .5rem .625rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius-lg, 8px);
    background: var(--tblr-bg-surface);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .12s, box-shadow .12s, background-color .12s;
}

.md-action-card:hover,
.md-action-card:focus-visible {
    border-color: var(--md-action);
    outline: 0;
}

.md-action-card.active {
    border-color: var(--md-action);
    background: var(--md-action-lt);
    box-shadow: 0 0 0 1px var(--md-action) inset;
}

.md-action-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--tblr-border-radius-lg, 8px);
    background: var(--md-action-lt);
    color: var(--md-action);
    font-size: 1.1rem;
}

.md-action-card.active .md-action-icon {
    background: var(--md-action);
    color: #fff;
}

.md-action-name {
    font-weight: 500;
    line-height: 1.2;
}

.md-action-check {
    position: absolute;
    top: .5rem;
    right: .5rem;
    color: var(--md-action);
    visibility: hidden;
}

.md-action-card.active .md-action-check {
    visibility: visible;
}

.md-action-panel {
    margin-top: .75rem;
    padding: .75rem 1rem;
    border: 1px solid var(--tblr-border-color);
    border-left: 3px solid var(--md-action);
    border-radius: var(--tblr-border-radius-lg, 8px);
}

.md-action-panel-title {
    display: flex;
    float: none;
    align-items: center;
    gap: .5rem;
    width: auto;
    margin: 0 0 .25rem;
    padding: 0;
    font-size: .95rem;
    font-weight: 600;
}

.md-action-panel-title .md-action-icon {
    width: 1.625rem;
    height: 1.625rem;
    font-size: .95rem;
}

.md-action-row {
    display: grid;
    grid-template-columns: minmax(10rem, 14rem) 1fr;
    align-items: center;
    gap: .75rem;
    margin-top: .5rem;
}

.md-action-row-label {
    color: var(--tblr-secondary);
}

.md-action-panel .select2-container {
    width: 100% !important;
}

.md-option-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    margin-top: 1.25rem;
    padding-top: .75rem;
    border-top: 1px solid var(--tblr-border-color);
}

.md-option-summary {
    flex: 1;
    min-width: 0;
}

/* Options of a field (templates/field_option_options.html.twig): one rule per option */
.md-rule {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.md-rule-check {
    flex: 0 0 1.25rem;
}

.md-rule-cond {
    display: flex;
    flex: 0 1 16rem;
    align-items: center;
    gap: .5rem;
    min-width: 10rem;
}

.md-rule-op {
    min-width: 1.75rem;
    font-size: .9rem;
}

.md-rule-value {
    font-weight: 600;
}

.md-rule-actions {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: .25rem;
}

.md-rule-action {
    white-space: normal;
    text-align: left;
}

.md-rule-edit {
    opacity: 0;
    transition: opacity .12s;
}

.md-rule:hover .md-rule-edit {
    opacity: 1;
}

.md-rule-none {
    background: var(--tblr-bg-surface-secondary);
}

.md-rule-none .md-rule-cond,
.md-rule-none .md-rule-arrow {
    opacity: .6;
}

/* A type not offered: a second title in a block (field_type_picker.js) */
.md-type-card:disabled {
    cursor: not-allowed;
    opacity: .6;
}

.md-type-card:disabled:hover {
    border-color: var(--tblr-border-color);
    box-shadow: none;
}

.md-type-desc.md-type-taken {
    color: var(--tblr-orange);
}

/* Child object of a metademand (templates/task_form.html.twig, forms/child_tags_panel.html.twig,
   public/scripts/child_object_form.js): the object as a card, then its settings beside the tags */
.md-child-form .md-type-grid {
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.md-child-family-ticket .md-type-icon { background: var(--tblr-blue-lt); color: var(--tblr-blue); }
.md-child-family-task .md-type-icon { background: var(--tblr-teal-lt); color: var(--tblr-teal); }
.md-child-family-mail .md-type-icon { background: var(--tblr-orange-lt); color: var(--tblr-orange); }
.md-child-family-meta .md-type-icon { background: var(--tblr-purple-lt); color: var(--tblr-purple); }

/* Step 1: the buttons of the form wait for the object */
.md-child-picking .form-button-separator {
    display: none !important;
}

.md-child-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20rem;
    gap: 1rem;
    align-items: start;
}

.md-child-layout.md-child-no-tags {
    grid-template-columns: minmax(0, 1fr);
}

.md-child-layout.md-child-no-tags .md-child-tags,
.md-child-layout.md-child-no-tags [data-md-tag-unknown] {
    display: none !important;
}

.md-child-section {
    margin-bottom: .75rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius-lg, 8px);
}

.md-child-section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius-lg, 8px) var(--tblr-border-radius-lg, 8px) 0 0;
    background: var(--tblr-bg-surface-secondary);
    font-size: .875rem;
    font-weight: 600;
}

details.md-child-section > summary {
    cursor: pointer;
    list-style: none;
}

details.md-child-section:not([open]) > summary {
    border-bottom: 0;
    border-radius: var(--tblr-border-radius-lg, 8px);
}

.md-child-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-left: auto;
    font-weight: 400;
}

.md-child-section-body {
    padding: .75rem;
}

.md-child-options .select2-container,
.md-child-actors .select2-container {
    width: 100% !important;
}

.md-child-actors {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr) minmax(0, 1fr);
    gap: .5rem .75rem;
    align-items: center;
}

.md-child-actors-head {
    color: var(--tblr-secondary);
    font-size: .7rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.md-child-actors-label {
    font-weight: 600;
}

.md-child-actors > div {
    display: flex;
    align-items: center;
    gap: .25rem;
    min-width: 0;
}

.md-child-actors > div > span {
    flex: 1;
    min-width: 0;
}

.md-child-tags {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius-lg, 8px);
    background: var(--tblr-bg-surface);
}

.md-child-tags-head {
    padding: .625rem .75rem;
    border-bottom: 1px solid var(--tblr-border-color);
}

.md-child-tags-title {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-weight: 600;
}

.md-child-tags-into {
    margin-top: .125rem;
    color: var(--tblr-secondary);
    font-size: .75rem;
}

.md-child-tags-into b {
    color: var(--tblr-primary);
}

.md-child-tags-list {
    overflow: auto;
    padding: .25rem 0;
}

.md-child-tags-group-title {
    margin: .5rem .75rem .25rem;
    color: var(--tblr-secondary);
    font-size: .7rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.md-child-tag {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .125rem .75rem;
    cursor: pointer;
}

.md-child-tag:hover,
.md-child-tag:focus-visible {
    background: var(--tblr-primary-lt);
    outline: 0;
}

.md-child-tag code {
    flex: 0 0 auto;
    font-size: .75rem;
}

.md-child-tag-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: .8125rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.md-child-tag-copy {
    visibility: hidden;
}

.md-child-tag:hover .md-child-tag-copy,
.md-child-tag:focus-within .md-child-tag-copy {
    visibility: visible;
}

.md-child-tag-sub {
    padding-left: 1.75rem;
}

/* The text the tags go into */
.md-child-target {
    border-radius: var(--tblr-border-radius, 6px);
    box-shadow: 0 0 0 .2rem var(--tblr-primary-lt);
}

@media (max-width: 991px) {
    .md-child-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .md-child-tags {
        position: static;
        max-height: 22rem;
    }
}

/* Unknown tags of a child object: no display utility, which would beat its hidden attribute */
.md-child-unknown {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}
