/* ============ *
 * ## Button ##
 * ============ */

.ui-button {
   cursor: pointer;
   display: flex;
   flex-direction: row;
   height: 22px;
   gap: 10px;
   padding: 0 10px;
   user-select: none;
   white-space: nowrap;
}
.ui-button[disabled] {
   cursor: default;
   pointer-events: none;
}

.ui-button .icon,
.ui-button .label {
   pointer-events: none;
}

.ui-button .icon {
   float: left;
   height: 100%;
   position: relative;
   width: 12px;
}

.ui-button .icon svg {
   float: left;
   height: 100%;
   position: relative;
   width: 100%;
}

.ui-button .label {
   float: left;
   font-size: 12px;
   line-height: 22px;
   position: relative;
   text-align: center;
   text-transform: uppercase;
}

.ui-button[disabled] .icon,
.ui-button[disabled] .label {
   opacity: .5;
}


/* =================== *
 * ## Popup Overlay ##
 * =================== */

.ui-popup-overlay {
   height: 100vh;
   left: 0;
   pointer-events: none;
   position: fixed;
   top: 0;
   width: 100vw;
   z-index: 9999;
}

.ui-popup-overlay .mouse-blocker {
   background: rgba(0,0,0,.33);
   float: left;
   height: 100%;
   opacity: 0;
   position: relative;
   width: 100%;
   z-index: 0;

   transition: opacity .25s;
}

.ui-popup-overlay.active { pointer-events: all; }
.ui-popup-overlay.active .mouse-blocker { opacity: 1; }


/* =========== *
 * ## Popup ##
 * =========== */

.ui-popup {
   background: var(--white);
   box-shadow: 0px 1px 5px 1px rgb(0 0 0 / 25%);
   display: flex;
   flex-direction: column;
   gap: 10px;
   left: 50%;
   max-width: 20vw;
   position: absolute;
   top: 50%;
}

.ui-popup .role-header,
.ui-popup .role-content,
.ui-popup .role-buttons {
   padding: 0 10px;
}

.ui-popup .role-header {
   border-style: solid;
   border-width: 0 0 1px 0;
   height: 28px;
   line-height: 27px;
   text-align: center;
   z-index: 2;

   border-color: var(--grey-light);
}

.ui-popup .role-content {
   display: flex;
   flex-direction: column;
   font-size: 14px;
   gap: 10px;
   line-height: 22px;
   max-height: 50vh;
   overflow: visible auto;
   padding-top: 10px;
   z-index: 1;
}

.ui-popup .role-content .form-constant {
   line-height: 22px;
   white-space: nowrap;
}

.ui-popup .role-header + .role-content { padding-top: 0; }

.ui-popup .role-buttons {
   border-style: solid;
   border-width: 1px 0 0 0;
   display: flex;
   gap: 10px;
   justify-content: space-between;
   padding: 9px 10px 10px 10px;
   z-index: 0;

   border-color: var(--grey-light);;
}
.ui-popup .role-buttons[num="1"] { justify-content: space-around }


/* ========= *
 * ## Row ##
 * ========= */

.ui-row {
   display: flex;
   flex-direction: row;
   font-size: 11px;
   gap: 10px;
}

.ui-row > .label {
   font-weight: bold;
   height: 22px;
   line-height: 22px;
   white-space: nowrap;
}

.ui-row > .value {
   align-items: flex-start;
   display: flex;
   flex-direction: column;
   min-width: 100px;
}


/* ==================== *
 * ## UI Info Button ##
 * ==================== */

.ui-info-button { cursor: pointer; }

.ui-info-button[type='icon'] .icon,
.ui-info-button[type='icon'] .icon svg {
   float: left;
   height: 100%;
   position: relative;
   width: 100%;
}

.ui-info-button[type='icon'] .icon svg { overflow: visible; }/* =========== *
 * ## Input ##
 * =========== */

.ui-input {
   border-radius:4px;
   display: flex;
   flex-direction: row;
   font-size: 12px;
   gap: 10px;
   height: 22px;
}

.ui-input .input-container {
   background: var(--white);
   border-color: #B0B0B0;
   border-radius: 4px;
   border-style: solid;
   border-width: 1px;
   display: flex;
   flex-direction: row;
   width: 150px;
}

.ui-input .search-tools-container {
   display: none;
   flex: 20px;
}
.ui-input .input-container.has-tools .search-tools-container { display: block; }

.ui-input .search-tools-container .tool-clear,
.ui-input .search-tools-container .tool-search {
   cursor: pointer;
   display: none;
   height: 100%;
   padding: 5px;
   width: 100%;
}

.ui-input .tool-clear svg,
.ui-input .tool-search svg {
   fill: var(--grey);
   float: left;
   height: 100%;
   position: relative;
   stroke: var(--grey);
   stroke-width: 4px;
   width: 100%;
}

.ui-input .tool-clear:hover svg,
.ui-input .tool-search:hover svg {
   fill: var(--primary);
   stroke: var(--primary);
}

.ui-input .input-container input {
   border-width: 0;
   color: var(--grey-dark);
   height: 20px;
   line-height: 20px;
   outline: none;
   padding: 0 0 0 10px;
   width: 100%;

   background: transparent;
}
.ui-input .input-container.has-tools input { width: calc(100% - 20px); }

.ui-input .input-container input::placeholder {
   color: var(--grey);
   font-style: italic;
}


/* =================== *
 * ## Input Numeric ##
 * =================== */

.ui-input-number {
   border: 1px solid var(--grey);
   display: flex;
   flex-direction: row;
   height: 22px;
   position: relative;
}

.ui-input-number .button-wrapper {
   background: var(--grey-light);
   border-left: 1px solid var(--grey);
   display: flex;
   flex-direction: column;
   width: 20px;
}

.ui-input-number .button-wrapper .button {
   cursor: pointer;
   height: 50%;
   width: 100%;
}

.ui-input-number .button-wrapper .button svg {
   fill: var(--grey-dark);
   float: left;
   height: 100%;
   position: relative;
   width: 100%;
}

.ui-input-number .button-wrapper .button:hover {
   background: var(--grey);
}

.ui-input-number .button-wrapper .button:hover svg { fill: var(--white); }

.ui-input-number .button-wrapper .button.disabled {
   background: var(--grey-lighter);
   pointer-events: none;
}
.ui-input-number .button-wrapper .button.disabled svg {
   fill: var(--grey-dark);
   opacity: .5;
}

.ui-input-number .button-wrapper .button:nth-child(2) {
   border-top: 1px solid var(--grey);
}

.ui-input-number .input,
.ui-input-number .input-placeholder {
   height: 100%;
   line-height: 20px;
   padding-left: 5px;
}

.ui-input-number .input {
   border: 0;
   width: 50px;
}

.ui-input-number .input-placeholder {
   color: var(--grey);
   display: none;
   pointer-events: none;
   position: absolute;
}

/* Hack to get rid of the default arrow buttons */
.ui-input-number input::-webkit-outer-spin-button,
.ui-input-number input::-webkit-inner-spin-button {
   -webkit-appearance: none;
   margin: 0;
}
.ui-input-number input[type=number] {
   -moz-appearance: textfield;
}

.ui-input-number[disabled] {
   opacity: .667;
   pointer-events: none !important;
}


/* ============ *
 * ## Select ##
 * ============ */

.ui-select {
   display: flex;
   flex-direction: column;
   float: left;
   font-size: 12px;
   max-width: 100%;
   min-width: 100px;
   position: relative;
}

.ui-select .button {
   border-style: solid;
   border-width: 1px;
   cursor: pointer;
   display: flex;
   flex-direction: row;
   height: 22px;
   padding: 0;

   border-color: var(--grey);
}

.ui-select .button > .icon {
   border-color: var(--grey);
   border-style: solid;
   border-width: 0 0 0 1px;
   height: 100%;
   order: 999;
   padding: 3px;
   pointer-events: none;
   width: 20px;

   background: var(--grey-light);
}

.ui-select .button .icon svg {
   fill: var(--grey-dark);
   float: left;
   height: 100%;
   position: relative;
   width: 100%;
}

.ui-select .button > .icon svg {
   transform: rotate(0deg);
   transition: transform .25s;
}

.ui-select.open .button > .icon svg {
   transform: rotate(180deg);
}

.ui-select[disabled] {
   cursor: default;
   opacity: .5;
   pointer-events: none;
}

.ui-select .button .values-container {
   flex: 1;
   overflow: hidden;
   padding: 0 10px;
}

.ui-select .values-container .values {
   display: flex;
   flex-direction: row;
   gap: 6px;
   overflow: hidden;
   position: relative;
   width: 100%;
   z-index: 0;
}
.ui-select .values-container .values.overflow:after {
   background-color: var(--white);
   content: "...";
   line-height: 20px;
   padding-left: 2px;
   position:absolute;
   right: 0;
   z-index: 1;
}

.ui-select .button .value {
   display: flex;
   flex-direction: row;
   gap: 5px;
   height: 20px;
   order: 0;
   position: relative;
}

.ui-select .button .value + .value:after {
   content: ",";
   left: -5px;
   line-height: 20px;
   pointer-events: none;
   position: absolute;
}

.ui-select .button .value .icon {
   order: 0;
}

.ui-select .button .value .label {
   flex: 1;
   font-size: 12px;
   line-height: 20px;
   order: 1;
   overflow: hidden;
   pointer-events: none;
   text-overflow: ellipsis;
   white-space: nowrap;
}

.ui-select .button .value.placeholder .label {
   color: var(--grey);
   font-style: italic;
}

.ui-select[customvalue] .button input,
.ui-select[filter] .button input {
   border-style: none;
   border-width: 0px;
   display: none;
   flex: 1;
   height: 20px;
   line-height: 20px;
   order: 0;
   width: 100%;
}

.ui-select[customvalue].open .button input,
.ui-select[filter].open .button input {
   display: block;
}

.ui-select[customvalue].open .button .values .value,
.ui-select[filter].open .button .values .value {
   display: none;
}

.ui-select .list-wrapper {
   height: 0;
   position: fixed;
   overflow: hidden;

   transition: height .25s;
}

.ui-select.reverse .list-wrapper {
   top: unset;
}

.ui-select .list-scroller {
   border-style: solid;
   border-width: 1px;
   float: left;
   max-height: 200px;
   min-width: 100%;
   overflow-x: hidden;
   overflow-y: auto;
   position: relative;

   background: #FFFFFF;
   border-color: #B0B0B0;
}

.ui-select .list,
.ui-select .list .ui-option-wrapper {
   display: flex;
   flex-direction: column;
}

.ui-select .ui-option {
   display: flex;
   flex-direction: row;
   gap: 5px;
}

.ui-select .button .value .icon,
.ui-select .ui-option .icon {
   float: left;
   order: 1;
   padding: 5px 0;
   position: relative;
}

.ui-select .ui-option .icon svg {
   fill: var(--grey-dark);
   float: left;
   height: 100%;
   position: relative;
   width: 100%;
}

.ui-select .ui-option .label { order: 2; }

.ui-select .ui-option-group .group-label,
.ui-select .ui-option,
.ui-select .no-filter-result {
   padding: 0 10px;
   white-space: nowrap;
}

.ui-select .ui-option-group .group-label {
   text-transform: uppercase;
}

.ui-select .ui-option .match.highlight {
   font-weight: bold;
   text-decoration: underline;
}

.ui-select .ui-option:not([disabled]) { cursor: pointer; }

.ui-select .ui-option:not([disabled]).filtered.target,
.ui-select .ui-option:not([disabled]):hover {
   background: #DBDBDB;
}

.ui-select .ui-option:not([disabled])[selected].filtered.target,
.ui-select .ui-option:not([disabled])[selected]:hover {
   background: var(--primary-dark);
}

.ui-select .ui-option[selected] {
   font-weight: bold;

   background: var(--primary);
   color: var(--white);
}

.ui-select .ui-option[selected] .icon svg { fill: var(--white); }
.ui-select .ui-option[disabled] {
   opacity: .5;
   pointer-events: none;
}

.ui-select .ui-option-group .group-label {
   cursor: default;
   font-weight: bold;
   user-select: none;
}

.ui-select .ui-option-group:not(:last-child) .group-list {
   border-bottom: 1px solid var(--grey-light);
}

.ui-select:not([grid]) .ui-option-group .ui-option {
   padding-left: 20px;
}

/* ## no-grid-base-layout ## */
.ui-select .ui-option-group .group-label,
.ui-select:not([grid]) .no-filter-result,
.ui-select:not([grid]) .ui-option {
   height: 24px;
   line-height: 24px;
   width: 100%;
}


/* ## grid-based-layout ## */
.ui-select[grid] .list .ui-option-wrapper {
   display: grid;
   gap: 5px;
   padding: 5px;
}

.ui-select[grid] .no-filter-result,
.ui-select[grid] .ui-option {
   background: var(--grey-light);
   border-color: var(--grey);
   border-radius: 4px;
   border-style: solid;
   border-width: 1px;
   cursor: pointer;
   display: flex;
   flex-direction: row;
   height: 22px;
}

.ui-select[grid] .no-filter-result .icon,
.ui-select[grid] .ui-option .icon {
   height: 100%;
   padding: 4px 0;
   width: 12px;
}

.ui-select[grid] .no-filter-result .label,
.ui-select[grid] .ui-option .label {
   color: var(--grey-dark);
   height: 100%;
   line-height: 20px;
   white-space: nowrap;
}

.ui-select[grid] .ui-option:hover {
   background-color: var(--grey);
   border-color: var(--grey-dark);
}

.ui-select[grid] .ui-option:hover .label {
   color: var(--white);
}
.ui-select[grid] .ui-option:hover .icon svg {
   fill: var(--white);
}

.ui-select[grid] .ui-option[selected] {
   background: var(--primary);
   border-color: var(--primary-dark);
}

.ui-select[grid] .ui-option[selected] .icon {
}

.ui-select[grid] .ui-option[selected] .label {
   color: var(--white);
   font-weight: bold;
}

.ui-select .no-filter-result {
   cursor: default;
   order: 9999;
   user-select: none;
}

.ui-select .list-scroller.scrollable .ui-option { width: calc(100% - 5px); }
