@charset "UTF-8";

@import url( https://fonts.googleapis.com/css?family=Roboto:300,400 );
@import url( "normalize.css" );
@import url( "pikaday.css" );
@import url( "boxicons.css" );

:root {
    
    --theme-app-color-grey-50: hsl(210, 20%, 98%);
    --theme-app-color-grey-100: hsl(220, 20%, 96%);
    --theme-app-color-grey-200: hsl(220, 14%, 90%);
    --theme-app-color-grey-300: hsl(216, 13%, 83%);
    --theme-app-color-grey-400: hsl(217, 11%, 65%);
    --theme-app-color-grey-500: hsl(220, 9%, 46%);
    --theme-app-color-grey-600: hsl(220, 10%, 34%);
    --theme-app-color-grey-700: hsl(222, 14%, 26%);
    --theme-app-color-grey-800: hsl(218, 28%, 17%);
    --theme-app-color-grey-900: hsl(222, 47%, 10%);
    --theme-app-color-grey-950: hsl(225, 69%, 4%);
    
    /* Colors */
    --color-text:            var( --theme-app-color-grey-900 ); /*#212529;*/
    --color-text-secondary:  var( --theme-app-color-grey-700 ); /*#5a6570;*/
    --color-text-faint:      var( --theme-app-color-grey-500 ); /*#9ba5ae;*/
    --color-text-disabled:   var( --theme-app-color-grey-300 ); /*rgba(33, 37, 41, 0.5);*/
    --color-text-muted:      rgba(33, 37, 41, 0.4);
    
    --color-primary:         #277ee5;
    --color-primary-dark:    #0a4e9e;
    --color-primary-light:   #327eff;
    --color-primary-lighter: #7894ff;
    --color-primary-lightest:#f8f9ff;
    
    --color-accent:          #f9a825;
    --color-accent-dark:     #cc8006;
    
    --color-success:         light-dark( rgba(  12, 136,  22, 1 ), rgba(  96, 195, 131, 1 ) );
    --color-success-dark:    #00778c;
    
    --color-error:           #d32f2f;
    --color-error-dark:      #962020;    
    --color-error-bg:        #6c1717;
    
    --color-warning-bg:      #f9a825;
    
    --color-white:           #ffffff;
    
    --color-bg:              #f2f2f2;
    --color-bg-faint:        #f9f9f9;
    --color-bg-input:        #fcfcfc;
    
    --color-divider:         #e6e6e6;
    --color-divider-dark:    #d9d9d9;
    
    --color-border-input:    #b3b3b3;
    --color-border-faint:    rgba(33, 37, 41, 0.25);
    
    --color-overlay:         rgba(255, 255, 255, 0.5);
    
    --color-placeholder:     rgba(33, 37, 41, 0.5);
    --color-input-text:      #5a6570;
    --color-white-tint:      rgba(255, 255, 255, 0.95);

    /* Shadows */
    --shadow-card:      2px 0px 10px 5px rgba(33, 37, 41, 0.1);
    --shadow-top-bar:   0px 3px 5px 0 rgba(128, 128, 128, 0.5);
    --shadow-left-bar:  3px 0px 5px -1px rgba(128, 128, 128, 0.5);
    --shadow-right-bar: -3px 0px 5px -1px rgba(128, 128, 128, 0.5);
    --shadow-dialog:    0 0.5em 0.5em rgba(33, 37, 41, 0.3);
    --shadow-input:     0px 1px 1px rgba(33, 37, 41, 0.095) inset;
    --shadow-module:    0px 4px 4px rgba(33, 37, 41, 0.095);

    /* Typography */
    --font-base:  Roboto, Arial, sans-serif;
    --font-brand: "Dejavu Sans Extralight", Arial, sans-serif;
    --font-mono:  monospace, monospace;

    /* Type scale - rem-based (relative to the root only, so it doesn't compound through
       nesting the way the %/em sizes historically used through this file could). Values
       chosen to match the sizes already dominant in this file, not invented from scratch. */
    --font-size-xs:   0.75rem;   /* 12px - by far the most common "small/caption" size */
    --font-size-sm:   0.875rem;
    --font-size-base: 1rem;
    --font-size-lg:   1.25rem;

    /* Fluid between a 400px and 1200px viewport, landing exactly on the prior fixed values
       (1.5rem / 1.75rem) at the top end. Left as fixed rem below --font-size-lg: that's mostly
       small, dense UI text (table headers, badges) paired with fixed-size icons/padding, where
       independently scaling the text would drift them out of alignment rather than help. */
    --font-size-xl:   clamp( 1.25rem, 1.125rem + 0.5vw, 1.5rem );
    --font-size-2xl:  clamp( 1.5rem, 1.375rem + 0.5vw, 1.75rem );

    /* Input */
    --input-placeholder-color: light-dark( rgba( 33, 37, 41, 0.4 ), rgba(206, 217, 228, 0.75) );

    --input-default-border-color: light-dark( rgba( 160, 160, 160, 0.80 ), rgba( 255, 255, 255, 0.25 ) );
    --input-hover-border-color: light-dark( rgba( 100, 100, 100, 0.95 ), rgba( 255, 255, 255, 0.45 ) );

    --input-focus-border-color: light-dark( rgba( 70, 130, 213, 1 ), rgba(  70, 130, 213, 1 ) );
    --input-focus-box-shadow-color: light-dark( rgba( 214, 228, 246, 1 ), rgba(  37,  62,  95, 1 ) );

    --input-required-border-color: light-dark( rgba( 202, 140,  10, 1 ), rgba( 253, 214, 105, 1 ) );
    --input-required-box-shadow-color: light-dark( rgba( 253, 243, 200, 1 ), rgba( 110,  70,   5, 1 ) );

    --input-invalid-border-color: light-dark( rgba( 163,  45,  45, 1 ), rgba( 240, 149, 149, 1 ) );
    --input-invalid-box-shadow-color: light-dark( rgba( 252, 235, 235, 1 ), rgba( 121,  31,  31, 1 ) );

    --input-readonly-border-color: light-dark( rgba( 160, 160, 160, 0.35 ), rgba( 255, 255, 255, 0.10 ) );
    --input-readonly-background: light-dark( rgba(   0,   0,   0, 0.03 ), rgba( 255, 255, 255, 0.03 ) );

    --input-disabled-border-color: light-dark( rgba( 160, 160, 160, 0.25 ), rgba( 255, 255, 255, 0.07 ) );
    --input-disabled-background: light-dark( rgba(   0,   0,   0, 0.05 ), rgba( 255, 255, 255, 0.05 ) );
}

html { 
    box-sizing: border-box; 
}

html, 
body { 
    
    height: 100dvh;
    overflow: hidden;
}

*, 
*:before, 
*:after { 
    
    box-sizing: inherit; 
    
    margin: 0; 
    padding: 0;     
}

*:focus { 
    outline: none; 
}

input:invalid { 
    box-shadow: none; 
}

body {

    font: normal 100%/1.5 var( --font-base );
    background: var( --color-bg );
}

ul, 
ol { 
    list-style: none; 
}

hr {
    
    height: 1px;
    
    border: 0;  
    background: #bfbfbf;
    background-image: linear-gradient( to right, var( --color-divider ), #bfbfbf, var( --color-divider ) );
    
    margin: 0.5em 0;
}

iframe {
    
    width: 100%;
    
    border: none;
    
    margin: 0;
    padding: 0 0.5em;
}

pre.break { 
    white-space: pre-wrap; 
}

.img-resizable { 
    
    display: block; 
    
    height: auto; 
    max-width: 100%; 
}

[role=button], 
[role=treeitem], 
[role=menuitem] { 
    cursor: pointer; 
}

/*
 * The Átomo framework's own compiled UI JS (atomo.ui.dist.js) still renders a handful of
 * icons via a `data-icon="<char>"` attribute + this pseudo-element, for widgets whose markup
 * is template-generated (Tree, Dialog, Tab, Datagrid, Searcher, Filter, Lookup, Form). Its
 * icon constants have been repointed at Boxicons codepoints; nothing project-authored (JSP,
 * our own JS) uses this attribute anymore — those all use real `<i class="bx bx-*">` elements.
 */
[data-icon]:before {

  content: attr( data-icon );

  font-family: "boxicons" !important;
  font-style: normal !important;
  font-weight: normal !important;
  font-variant: normal !important;
  text-transform: none !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes uil-ring-anim {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes background-fade-in {
    from { background-color: rgba(255,255,255,0); }
    to   { background-color: rgba(255,255,255,0.9); }
}

@keyframes scale-down {
    from { transform: scale(3); }
    to   { transform: scale(1); }
}

@keyframes scale-up {
    from { transform: scale(1); }
    to   { transform: scale(3); }
}

@keyframes scale-up-down {
    0%   { transform: scale(1); opacity: 1; }
    25%  { transform: scale(2); opacity: 0.5; }
    50%  { transform: scale(2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes ui-anim-slide-top    { from { top: -50%;    opacity: 0; } to { top: 0;    opacity: 1; } }
@keyframes ui-anim-slide-right  { from { right: -50%;  opacity: 0; } to { right: 0;  opacity: 1; } }
@keyframes ui-anim-slide-bottom { from { bottom: -50%; opacity: 0; } to { bottom: 0; opacity: 1; } }
@keyframes ui-anim-slide-left   { from { left: -50%;   opacity: 0; } to { left: 0;   opacity: 1; } }

@keyframes ui-anim-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-anim-fade-out { from { opacity: 1; } to { opacity: 0; } }

@keyframes ui-toast-right  { from { right: -1em;  opacity: 0; } to { right: 0;  opacity: 1; } }
@keyframes ui-toast-left   { from { left: -1em;   opacity: 0; } to { left: 0;   opacity: 1; } }
@keyframes ui-toast-top    { from { top: -50%;    opacity: 0; } to { top: 10%;  opacity: 1; } }
@keyframes ui-toast-bottom { from { bottom: -1em; opacity: 0; } to { bottom: 0; opacity: 1; } }
@keyframes ui-toast-fade   { from { opacity: 1; }              to { opacity: 0; }             }

@keyframes background-warning-pulse {
    0%, 100% { background-color: var(--color-primary); }
    50%       { background-color: var(--color-accent); }
}

@keyframes pulse {
    from { box-shadow: 0 0 0 0 var(--color-accent); }
    to   { box-shadow: 0 0 0 45px rgba(249, 168, 37, 0); }
}

@keyframes highlight {
    0%, 100% { background-color: var(--color-primary); }
    50%       { border-color: var(--color-accent-dark); background-color: var(--color-accent); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 0 var(--color-accent); }
    50%       { box-shadow: 0 0 20px var(--color-accent); }
}

@keyframes open {
    from { opacity: 0; transform: scale3d(1.1, 1.1, 1); }
    to   { opacity: 1; transform: scale3d(1, 1, 1); }
}

@keyframes close {
    from { opacity: 1; }
    to   { opacity: 0; transform: scale3d(0.9, 0.9, 1); }
}

/* Animation utility classes */
.scale-down         { animation: scale-down 0.3s linear; }
.scale-up           { animation: scale-up 0.3s linear; }
.background-fade-in { animation: background-fade-in 0.3s linear; }
.fade-in            { animation: ui-anim-fade-in 0.3s linear; }
.fade-out           { animation: ui-anim-fade-out 0.3s linear; }

.ui-anim-loader {

    width: 5em;
    height: 5em;
    
    border: 0.5em solid var(--color-bg);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    
    animation: spin 1.5s linear infinite;
    
    margin: 0 auto;

    &.is-small { 

        width: 2.5em; 
        height: 2.5em; 

        border-width: 0.25em; 
    }

    &.is-large { 

        width: 7.5em; 
        height: 7.5em; 

        border-width: 0.75em; 
    }

    &.is-x-large { 

        width: 10em;
        height: 10em; 

        border-width: 1em;
    }
}

.uil-ring-css > div {
    
    display: block;
  
    width: 160px;
    height: 160px;
  
    border-radius: 80px;
    box-shadow: 0 6px 0 0 var(--color-primary);
    
    animation: uil-ring-anim 1s linear infinite;
    
    margin: 0 auto;
}

.ui-anim-bg-warning-pulse { animation: background-warning-pulse 2s infinite; }

.is-hidden           { display: none !important; }
.is-invisible        { visibility: hidden; }
.is-overflown        { overflow: auto; }
.is-transparent      { background: transparent; border: none; box-shadow: none; }
.is-half-translucent { opacity: 0.5; }
.is-readonly         { opacity: 0.6; }
.is-disabled         { opacity: 0.4; cursor: not-allowed; }
.is-typeless-list    { list-style-type: none; }
.is-right-aligned    { text-align: right; }
.is-center-aligned   { text-align: center; }
.is-left-aligned     { text-align: left; }
.is-circle           { border-radius: 50%; }
.is-not-selectable   { user-select: none; }
.is-required         { border-color: var(--color-error); }
.is-wrappable        { white-space: normal !important; }
.is-not-wrappable    { white-space: nowrap !important; }

/* Spacing */
.is-spaceless        { padding: 0; margin: 0; }
.is-spaceless-top    { padding-top: 0; margin-top: 0; }
.is-spaceless-right  { padding-right: 0; margin-right: 0; }
.is-spaceless-bottom { padding-bottom: 0; margin-bottom: 0; }
.is-spaceless-left   { padding-left: 0; margin-left: 0; }

.is-default-padded { padding: 0.25em; }
.is-x2-padded      { padding: 0.5em; }
.is-x3-padded      { padding: 0.75em; }
.is-x4-padded      { padding: 1em; }
.is-x5-padded      { padding: 1.25em; }
.is-x6-padded      { padding: 1.5em; }

.is-x2-l-padded { padding-left: 0.5em; }
.is-x3-l-padded { padding-left: 0.75em; }
.is-x4-l-padded { padding-left: 1em; }
.is-x5-l-padded { padding-left: 1.25em; }
.is-x6-l-padded { padding-left: 1.5em; }

.is-x2-r-padded { padding-right: 0.5em; }
.is-x3-r-padded { padding-right: 0.75em; }
.is-x4-r-padded { padding-right: 1em; }
.is-x5-r-padded { padding-right: 1.25em; }
.is-x6-r-padded { padding-right: 1.5em; }

.is-default-margin        { margin: 0.25em; }
.is-default-margin-top    { margin-top: 0.25em; }
.is-default-margin-right  { margin-right: 0.25em; }
.is-default-margin-bottom { margin-bottom: 0.25em; }
.is-default-margin-left   { margin-left: 0.25em; }

.is-x2-margin { margin: 0.5em; }
.is-x3-margin { margin: 0.75em; }
.is-x4-margin { margin: 1em; }
.is-x5-margin { margin: 1.25em; }
.is-x6-margin { margin: 1.5em; }

/* Display */
.is-block        { display: block; }
.is-inline       { display: inline; }
.is-inline-block { display: inline-block; }
.is-flex         { display: flex; }

.is-flex-column-oriented { display: flex; flex-flow: column nowrap; }
.is-flex-row-oriented    { display: flex; flex-flow: row nowrap; }
.is-flex-centered        { align-items: center; justify-content: center; }
.is-flex-end-justified   { justify-content: flex-end; }
.is-flex-start-justified { justify-content: flex-start; }

.items-stretch  { align-items: stretch; }
.items-start    { align-items: flex-start; }
.items-center   { align-items: center; }
.items-end      { align-items: flex-end; }
.items-baseline { align-items: baseline; }

.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around  { justify-content: space-around; }

.flex        { display: flex; }
.inline-flex { display: inline-flex; }
.flex-c      { display: flex; flex-flow: column nowrap; }
.flex-r      { display: flex; flex-flow: row nowrap; }

.flex-c-h-full {
    
    display: flex;

    min-height: 0 !important; /* flexbox nested-scroll fix */
    height: 100%;
  
    flex-flow: column nowrap;
}

.flex-r-full {
    
    display: flex;
    flex-flow: row nowrap;
    
    min-width: 0 !important; /* flexbox nested-scroll fix */
    width: 100%;
}

/* Viewport sizing */
.is-viewport { width: 100%; min-width: 100%; height: 100%; min-height: 100%; }

.is-viewport-width-10  { width: 10vh; }   .is-viewport-height-10  { height: 10vh; }
.is-viewport-width-20  { width: 20vh; }   .is-viewport-height-20  { height: 20vh; }
.is-viewport-width-30  { width: 30vh; }   .is-viewport-height-30  { height: 30vh; }
.is-viewport-width-40  { width: 40vh; }   .is-viewport-height-40  { height: 40vh; }
.is-viewport-width-50  { width: 50vh; }   .is-viewport-height-50  { height: 50vh; }
.is-viewport-width-60  { width: 60vh; }   .is-viewport-height-60  { height: 60vh; }
.is-viewport-width-70  { width: 70vh; }   .is-viewport-height-70  { height: 70vh; }
.is-viewport-width-80  { width: 80vh; }   .is-viewport-height-80  { height: 80vh; }
.is-viewport-width-90  { width: 90vh; }   .is-viewport-height-90  { height: 90vh; }
.is-viewport-width-100 { width: 100vh; }  .is-viewport-height-100 { height: 100vh; }

.is-relative-width-1  { width: 2rem; }    .is-relative-height-1  { height: 2rem; }
.is-relative-width-2  { width: 4rem; }    .is-relative-height-2  { height: 4rem; }
.is-relative-width-3  { width: 6rem; }    .is-relative-height-3  { height: 6rem; }
.is-relative-width-4  { width: 8rem; }    .is-relative-height-4  { height: 8rem; }
.is-relative-width-5  { width: 10rem; }   .is-relative-height-5  { height: 10rem; }
.is-relative-width-6  { width: 12rem; }   .is-relative-height-6  { height: 12rem; }
.is-relative-width-7  { width: 14rem; }   .is-relative-height-7  { height: 14rem; }
.is-relative-width-8  { width: 16rem; }   .is-relative-height-8  { height: 16rem; }
.is-relative-width-9  { width: 18rem; }   .is-relative-height-9  { height: 18rem; }
.is-relative-width-10 { width: 20rem; }   .is-relative-height-10 { height: 20rem; }

/* Sizing constraints */
.min-h-0      { min-height: 0 !important; }
.min-h-full   { min-height: 100%; }
.min-h-screen { min-height: 100vh; }
.max-h-full   { max-height: 100%; }
.max-h-screen { max-height: 100vh; }
.min-w-0      { min-width: 0; }
.min-w-full   { min-width: 100%; }

.max-w-xxs { max-width: 10rem; }
.max-w-xs  { max-width: 20rem; }
.max-w-sm  { max-width: 30rem; }
.max-w-md  { max-width: 40rem; }
.max-w-lg  { max-width: 50rem; }
.max-w-xl  { max-width: 60rem; }
.max-w-2xl { max-width: 70rem; }
.max-w-3xl { max-width: 80rem; }
.max-w-4xl { max-width: 90rem; }
.max-w-5xl { max-width: 100rem; }
.max-w-full { max-width: 100%; }

/* Positioning */
.is-layer          { position: absolute !important; }
.is-inner-layer    { position: relative !important; }
.is-layer-hidden   { top: -9999px; left: -9999px; }
.is-layer-top      { top: 0; }
.is-layer-left     { left: 0; }
.is-layer-right    { right: 0; }
.is-layer-bottom   { bottom: 0; }
.is-layer-viewport { top: 0; bottom: 0; left: 0; right: 0; }
.is-layer-center   { left: 50%; transform: translate(-50%, -50%); }
.is-layer-top-right    { top: 0; right: 0; }
.is-layer-bottom-right { bottom: 0; right: 0; }
.is-layer-top-left     { top: 0; left: 0; }
.is-layer-bottom-left  { bottom: 0; left: 0; }
.is-layer-fixed    { position: fixed; }

.static   { position: static; }
.fixed    { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.sticky   { position: sticky; }

.pin-t { top: 0; }      
.pin-r { right: 0; }
.pin-b { bottom: 0; }   
.pin-l { left: 0; }
.pin-y { top: 0; bottom: 0; }
.pin-x { right: 0; left: 0; }
.pin   { top: 0; right: 0; bottom: 0; left: 0; }
.pin-none { top: auto; right: auto; bottom: auto; left: auto; }

/* Z-index */
.is-base-layer    { z-index: auto; }
.is-mid-layer     { z-index: 10; }
.is-top-layer     { z-index: 20; }
.is-front-layer   { z-index: 30; }
.is-topmost-layer { z-index: 40; }

/* Typography */
.italic       { font-style: italic; }
.roman        { font-style: normal; }
.uppercase    { text-transform: uppercase; }
.lowercase    { text-transform: lowercase; }
.capitalize   { text-transform: capitalize; }
.normal-case  { text-transform: none; }
.underline    { text-decoration: underline; }
.line-through { text-decoration: line-through; }
.no-underline { text-decoration: none; }

.antialiased          { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.subpixel-antialiased { -webkit-font-smoothing: auto; -moz-osx-font-smoothing: auto; }

.text-left    { text-align: left; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-justify { text-align: justify; }

.align-baseline    { vertical-align: baseline; }
.align-top         { vertical-align: top; }
.align-middle      { vertical-align: middle; }
.align-bottom      { vertical-align: bottom; }
.align-text-top    { vertical-align: text-top; }
.align-text-bottom { vertical-align: text-bottom; }

.whitespace-normal   { white-space: normal; }
.whitespace-no-wrap  { white-space: nowrap; }
.whitespace-pre      { white-space: pre; }
.whitespace-pre-line { white-space: pre-line; }
.whitespace-pre-wrap { white-space: pre-wrap; }

.break-words  { word-wrap: break-word; }
.break-normal { word-wrap: normal; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.is-xxx-large { font-size: 421.875%; }
.is-xx-large  { font-size: 337.5%; }
.is-x-large   { font-size: 225%; }
.is-large     { font-size: 150%; }
.is-small     { font-size: 75%; }
.is-x-small   { font-size: 50%; }

/* Float / overflow */
.right    { float: right !important; }
.left     { float: left !important; }
.no-float { float: none !important; }

.no-pseudo:before, .no-pseudo:after { content: none; }
.no-before:before, .no-after:after  { content: none; }

.scroll    { overflow: auto !important; }
.scroll-y  { overflow-y: auto !important; }
.scroll-x  { overflow-x: auto !important; }
.no-scroll   { overflow: hidden !important; }
.no-scroll-y { overflow-y: hidden !important; }
.no-scroll-x { overflow-x: hidden !important; }


.ui-grid { 
    width: 100%; 
}

.ui-row {
    
    &:before { 
      
        content: ""; 
        display: table; 
    }
  
    &:after { 
      
        content: ""; 
      
        display: table; 
        clear: both; 
    }
}

.ui-column-1-3, 
.ui-column {

    position: relative;
    float: left;
    
    margin-left: 0.8%;
    margin-right: 0.8%;  
}

.ui-gapless-column-1-3, 
.ui-gapless-column {
    
    position: relative;
    float: left;
}

.ui-column             { width: 6.7333333333%; }
.ui-gapless-column     { width: 8.3333333333%; }
.ui-column-1           { width: 6.7333333333%; }
.ui-gapless-column-1   { width: 8.3333333333%; }
.ui-column-2           { width: 15.0666666667%; }
.ui-gapless-column-2   { width: 16.6666666667%; }
.ui-column-3           { width: 23.4%; }
.ui-gapless-column-3   { width: 25%; }
.ui-column-4           { width: 31.7333333333%; }
.ui-gapless-column-4   { width: 33.3333333333%; }
.ui-column-5           { width: 40.0666666667%; }
.ui-gapless-column-5   { width: 41.6666666667%; }
.ui-column-6           { width: 48.4%; }
.ui-gapless-column-6   { width: 50%; }
.ui-column-7           { width: 56.7333333333%; }
.ui-gapless-column-7   { width: 58.3333333333%; }
.ui-column-8           { width: 65.0666666667%; }
.ui-gapless-column-8   { width: 66.6666666667%; }
.ui-column-9           { width: 73.4%; }
.ui-gapless-column-9   { width: 75%; }
.ui-column-10          { width: 81.7333333333%; }
.ui-gapless-column-10  { width: 83.3333333333%; }
.ui-column-11          { width: 90.0666666667%; }
.ui-gapless-column-11  { width: 91.6666666667%; }
.ui-column-12          { width: 98.4%; }
.ui-gapless-column-12  { width: 100%; }
.ui-column-1-3         { width: 31.7333333333%; }
.ui-gapless-column-1-3 { width: 33.3333333333%; }


.ui-btn {
  
    height: stretch;
    height: -webkit-fill-available;
    
    display: grid;
    grid-auto-flow: column dense;
    place-items: center;
    justify-content: center;
    gap: 0.375em;

    font: normal 100% / 200% var( --font-base );
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;

    color: var( --color-white );
    background-color: var( --color-primary );
    
    
    border: none;
    border-radius: 0.5rem;
  
    padding: 0 0.375em;
    margin: 0;
  
    transition: background-color 0.3s ease-in-out, 
                outline 0.3s ease-in-out;
    
    user-select: none;
    appearance: none;
    outline: none;
    
    cursor: pointer;

    > i {
        
        font-size: 125%;
        
        margin: 0;
        padding-block: 0.25rem;
    }

    &:hover { 
        background-color: var(--color-primary-light); 
    }
    
    &:focus { 
        outline: 0.15em solid rgba( 120, 148, 255, 0.5 ); 
    }

    &:active, 
    &.is-active { 
        box-shadow: 0 0 4px 2px rgba( 33, 37, 41, 0.3 ) inset; 
    }

    &.is-active {
        
        background-color: var( --color-primary-lighter );
        border-color: #0033f8;
    
        &:hover { 
            background-color: var( --color-primary-lighter ); 
            border-color: #0033f8; 
        }
    }

    &.is-disabled, 
    &[disabled] { 
        
        opacity: 0.5; 
        
        pointer-events: none; 
        cursor: not-allowed;         
    }
    
    &.is-transparent { 
        
        background-color: transparent; 
        border: none; 
        box-shadow: none; 
    }

    &.is-highlighted { 
        
        animation: highlight 3s ease-in-out infinite, 
                   glow 3s ease-in-out infinite; 
    }

    &.is-primary {
        
        background-color: var( --color-success );
        border-color: var( --color-success-dark );        
        color: contrast-color( var( --color-success ) );
    
        &:hover { 
            background-color: #26dfff; 
        }
    }

    &.is-secondary {
        
        background-color: var( --color-accent );
        border-color: var( --color-accent-dark );
        color: contrast-color( var( --color-accent ) );
        
        &:hover {
            background-color: #fbc66f; 
        }
    }
    
    &.is-success {
        
        background-color: var( --color-success );
        color: contrast-color( var( --color-success ) );
    }

    &.is-error {
        
        /*
        background-color: var( --color-error );
        border-color: var( --color-error-dark );
        color: contrast-color( var( --color-error ) );
        */
        
        background-color: transparent;
        border: 1px solid var( --color-error );
        color: var( --color-error );
        
        &:hover {         
            
            /*
            background-color: #e06e6e; 
            */
            
            border-color: var( --color-error-dark );
            color: var( --color-error-dark );
        }
    }

    > * { margin: 0; padding: 0; }
}

button[name=delete] {
    
    background-color: var( --color-error );
    border-color: var( --color-error-dark );
    color: contrast-color( var( --color-error ) );
    
    &:hover { 
        background-color: #e06e6e; 
    }
}

.ui-btn[data-toggle=sidepanel] {
    
    position: relative;
    
    &:after { display: none; }

    &.is-animated:after {
        
        content: "";

        width: 20%;
        height: 20%;

        display: inline-block;

        background: var(--color-primary-lighter);
        border-radius: 50%;

        position: absolute;
        right: 20%;
        top: 30%;

        animation: scale-up-down 0.9s infinite cubic-bezier(0.39, 0.58, 0.57, 1);
    }
}

.ui-badge {
    
    display: inline-block;
    
    min-width: 0.5em;
    
    color: var(--color-white);
    background: #bfbfbf;
    border-radius: 0.5em;
    
    font: inherit;
    text-align: center;
    white-space: nowrap;
        
    margin: 0;
    padding: 0 0.5em;

    &.is-default     { background-color: var(--color-primary-lighter); }
    &.is-success     { background-color: var(--color-primary); }
    &.is-warning     { background-color: var(--color-accent); }
    &.is-error       { background-color: var(--color-error); }
    &.is-highlighted { background-color: var(--color-primary-lighter); border-color: #0033f8; }
}

.ui-notification-badge {
    
    position: relative !important;

    &:after {
      
        content: attr(data-custom-attr-count);
        
        width: 16px;
        height: 16px;
    
        font-size: 70%;
        line-height: 16px;
        text-align: center;
        vertical-align: middle;
        white-space: nowrap;
    
        background-color: var(--color-error);
        border-radius: 50%;
        color: var(--color-white);
        box-shadow: 0 2px 1px rgba(0,0,0,0.25), 0 2px 3px rgba(0,0,0,0.25), 0 4px 8px rgba(0,0,0,0.25);
    
        position: absolute;
        bottom: 5%;
        right: 5%;
    }
}

/*
.ui-toolbar {
    
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
    vertical-align: middle;

    &.is-right-oriented { justify-content: flex-end; }

    .ui-btn {
        
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;

        &:first-child  { margin-left: 0; }
        &:not(:last-child) { border-right: none; }
    }
}
*/

.ui-toolbar {

    --toolbar-gap: 0.45rem;
    --toolbar-divider-color: light-dark( rgba(   0,   0,   0, 0.15 ), rgba( 255, 255, 255, 0.15 ) );
    --toolbar-divider-width: 0.01rem;
    --toolbar-divider-height: 1.25rem;
    --toolbar-padding-inline: 0.25rem;
    --toolbar-padding-block: 0.5rem;

    display: flex;
    flex-flow: row wrap;
    align-items: center;
    justify-content: flex-start;
    gap: var( --toolbar-gap );
    
    padding-inline: var( --toolbar-padding-inline );
    padding-block: var( --toolbar-padding-block );

    /* ── Orientations ───────────────────────────────────────────── */

    &.is-right-oriented  { 
        justify-content: flex-end; 
    }
    
    &.is-center-oriented { 
        justify-content: center; 
    }
    
    &.is-fill { 
        
        .ui-toolbar-group, 
        .ui-btn {
            flex: 1; 
        } 
    }

    /* ── Divider — standalone element ───────────────────────────── */

    .ui-toolbar-divider {
        display: inline-flex;
        align-self: center;
        width: var( --toolbar-divider-width );
        height: var( --toolbar-divider-height );
        background: var( --toolbar-divider-color );
        margin: 0 0.25rem;
        flex-shrink: 0;
        border: none;
    }

    /* ── Group ──────────────────────────────────────────────────── */

    .ui-toolbar-group {

        display: inline-flex;
        align-items: center;
        gap: 0;
        flex-shrink: 0;

        /* Fused border between adjacent buttons inside a group */
        .ui-btn:not( :last-child ) {
            border-right: none;
        }

        /* Rounded corners only on group edges */
        .ui-btn:not( :first-child ):not( :last-child ) {
            border-radius: 0;
        }

        .ui-btn:first-child:not( :last-child ) {
            border-top-right-radius: 0;
            border-bottom-right-radius: 0;
        }

        .ui-btn:last-child:not( :first-child ) {
            border-top-left-radius: 0;
            border-bottom-left-radius: 0;
        }

        /* Divider between groups — using a pseudo-element on the group itself */
        &:not( :last-child )::after {
            content: '';
            display: inline-flex;
            align-self: center;
            width: var( --toolbar-divider-width );
            height: var( --toolbar-divider-height );
            background: var( --toolbar-divider-color );
            margin: 0 0.25rem;
            flex-shrink: 0;
        }
    }

    > .ui-btn {
        flex-shrink: 0;
    }
}

.ui-modal {

    width: 100%;
    height: 100%;
  
    background: var(--color-overlay);
    
    position: fixed;
    inset: 0;
  
    .ui-modal-wrapper {
        
        display: flex;
        
        width: 90.5%;
        
        position: absolute;
        top: 50%;
        left: 50%;
        
        /* Subpixel offset avoids blurry text on Chrome. */
        transform: translate(calc(-50% + 0.5px), calc(-50% + 0.5px));        
    }
}

.ui-dialog,
.ui-toast {
    
    overflow: hidden;
    
    background-color: var(--color-white);
    border-radius: 0.1em;
    box-shadow: var(--shadow-dialog);
}

.ui-dialog {
    
    display: flex;
    flex-direction: column;
    
    width: 100%;
    max-height: 90vh;

    border: none;
    
    animation-duration: 0.3s;
    animation-fill-mode: forwards;

    &.is-open   { animation-name: open; }
    &.is-closed { animation-name: close; }

    &.is-transparent { background-color: transparent; border: none; box-shadow: none; }

    .ui-dialog-header,
    .ui-dialog-body,
    .ui-dialog-footer { width: 100%; }

    .ui-dialog-header {

        display: grid;
        grid-auto-flow: column;
        grid-template-columns: 1fr;
        grid-auto-columns: minmax( 40px, max-content );
        
        font-size: var( --font-size-xl );
        
        background: var(--color-white);        
        border-bottom: 1px solid var(--color-divider);
        color: #bfbfbf;
        
        margin: 0;
        padding-block: 0.25rem;
        
        user-select: none;

        h1 {
            
            font-size: var( --font-size-xl ); 
            
            margin: 0;
            padding: 0.25rem;            
        }

        .close {
            
            background: transparent;            
            border: none;
            box-shadow: none;
            color: #bfbfbf;

            text-align: center;
            
            margin: 0;
            padding: 0;            
            
            &:hover { background: none; }
        }
    }

    .ui-dialog-body   { display: flex; flex-direction: column; height: 100%; overflow: auto; }

    .ui-dialog-footer {
        
        background: var(--color-bg);
        border-top: 1px solid var(--color-divider);
        text-align: right;
        padding: 0.375em;
    }

    /* Variants */
    &.is-success .ui-dialog-body,
    &.is-warning .ui-dialog-body,
    &.is-error   .ui-dialog-body { padding: 1em; }

    &.is-default .ui-dialog-header,
    &.is-default .ui-dialog-header .ui-btn,
    &.is-success .ui-dialog-header,
    &.is-success .ui-dialog-header .ui-btn,
    &.is-warning .ui-dialog-header,
    &.is-warning .ui-dialog-header .ui-btn,
    &.is-error   .ui-dialog-header,
    &.is-error   .ui-dialog-header .ui-btn { color: var(--color-white); }

    &.is-default .ui-dialog-header { background: var(--color-primary-lighter); }
    &.is-success .ui-dialog-header { background: var(--color-primary); }

    &.is-warning {
        
        border-color: var(--color-accent);
        
        .ui-dialog-header { background: var(--color-accent); }
        .ui-dialog-footer { background: var(--color-bg); }
    }

    &.is-error {
    
        border-color: var(--color-error-bg);
        
        .ui-dialog-header { background: var(--color-error); }
    }
}

/* Native <dialog> element */
dialog {
    
    width: 100%;
    max-height: 90vh;

    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);

    position: relative;

    margin: auto;

    &, &::backdrop {
      
        opacity: 0;
        transition: display 0.3s allow-discrete, 
                    overlay 0.3s allow-discrete, 
                    opacity 0.3s,
                    transform 0.3s;

        transition-timing-function: ease-in-out;
    }

    &[open] {
      
        display: grid;
        grid-template-rows: min-content 1fr min-content;

        opacity: 1;

        &::backdrop { 
            opacity: 0.7; 
        }
    }

    @starting-style {

        &[open], 
        &[open]::backdrop { 
          opacity: 0;
        }

        &[open] { 
          transform: translateY( 1rem ); 
        }
    }

    > .header, 
    > .body, 
    > .footer { 
        width: 100%; 
    }

    > .header {
        
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr min-content;

        font-size: var( --font-size-lg );

        background: var(--color-primary);
        border-bottom: 1px solid var(--color-divider);
        color: var(--color-white);
        
        user-select: none;
        
        margin: 0;
        padding: 0 0.25em;
        
        .close {
        
            background: transparent;
            border: none;
            outline: none;
            box-shadow: none;
            color: var(--color-white);

            font-size: var( --font-size-lg );
            text-align: center;
            vertical-align: middle;

            margin: 0;
            padding: 0;

            cursor: pointer;

            &:hover { 
                background: none; 
            }
        }
    }

    > .body  { 
        
        height: 100%;
        
        display: flex; 
        flex-direction: column; 
        
        overflow: auto; 
    }
    
    > .footer { 
        padding: 0.375em; 
    }

    &::backdrop { 
        background-color: rgba(0, 0, 0, 0.25); 
    }
}

.ui-toast {
    
    position: fixed;
    
    min-width: 25%;
    max-width: 50%;
    
    border-left: 0.5em solid var(--color-primary);
    
    cursor: pointer;
    
    animation-duration: 0.3s;
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    
    padding: 1em;
    margin: 0.5em;

    .ui-toast-header {

        font-size: var( --font-size-xl );
        line-height: 150%;

        margin: 0; 
        padding: 0; 
    }
    
    .tips ul li { 
        
        font-weight: 600; 
        margin: 0 0.5em; 
    }

    &.top { 
        
        top: 1%;    
        animation-name: ui-anim-slide-top; 
    }
  
    &.right { 
        
        right: 1%;  
        animation-name: ui-anim-slide-right; 
    }
  
    &.bottom { 
        
        bottom: 1%; 
        animation-name: ui-anim-slide-bottom; 
    }
    
    &.left { 
        
        left: 1%;   
        animation-name: ui-anim-slide-left; 
    }

    &.center { 
        
        left: 50%;
        transform: translate(-50%, -50%); 
    }
    
    &.center-y { 
        
        top: 50%;  
        transform: translateY(-50%); 
    }
  
    &.center-x { 
        
        left: 50%; 
        transform: translateX(-50%); 
    }

    &.fade-in { 
        animation-name: ui-anim-fade-in; 
    }
  
    &.fade-out { 
        animation-name: ui-anim-fade-out; 
    }

    &.is-default { 
        border-color: #456cff; 
    }
  
    &.is-success { 
        border-color: var(--color-primary-dark); 
    }
  
    &.is-warning { 
        border-color: var(--color-accent); 
    }
  
    &.is-error { 
        border-color: var(--color-error-bg); 
    }
}


/* ═══════════════════════════════════════════════════════════════
   TOOLTIP
   ═══════════════════════════════════════════════════════════════ */

.tooltip {
    
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid;
    border-image-slice: 1;
    color: var(--color-text);
    
    font-size: 60%;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
  
    opacity: 0;
  
    transition: opacity scale 2s;
    
    padding: 0.5rem;
  
    position: absolute;
    top: -9999px;
    left: -9999px;

    &:after {
        
        content: "";

        width: 0;
        height: 0;

        border: solid 0.5rem transparent;

        z-index: -1;

        position: absolute;
        left: calc(50% - 0.5rem);
    }

    &.top {
    
        border-image-source: linear-gradient(to bottom, rgba(33, 37, 41, 0.25), var(--color-white) 95%);
        box-shadow: 0px 3px 5px 0px rgba(33, 37, 41, 0.25);
        animation: ui-anim-fade-in 0.2s forwards;
    
        &:after { 
            
            top: 98.1%; 
            border-top-color: rgba(255, 255, 255, 0.9); 
        }
    }

    &.right {
        
        border-image-source: linear-gradient(to left, rgba(33, 37, 41, 0.25), var(--color-white) 95%);
        box-shadow: 0px 3px 5px 0px rgba(33, 37, 41, 0.25);
        animation: ui-anim-fade-in 0.2s forwards;
        
        &:after { 
            
            left: -1rem; 
            top: calc(50% - 0.5rem); 
            
            border-right-color: rgba(255, 255, 255, 0.9); 
        }
    }

    &.bottom {
        
        border-image-source: linear-gradient(to top, rgba(33, 37, 41, 0.25), var(--color-white) 95%);
        box-shadow: 0px -3px 5px 0px rgba(33, 37, 41, 0.25);
        animation: ui-anim-fade-in 0.2s forwards;
    
        &:after { 
            
            bottom: 100%;
            border-bottom-color: rgba(255, 255, 255, 0.9); 
        }
    }

    &.left {
      
        border-image-source: linear-gradient(to right, rgba(33, 37, 41, 0.25), var(--color-white) 95%);
        box-shadow: 0px 3px 5px 0px rgba(33, 37, 41, 0.25);
        animation: ui-anim-fade-in 0.2s forwards;
    
        &:after { 
        
            left: 99.9%; 
            top: calc(50% - 0.5rem); 
        
            border-left-color: rgba(255, 255, 255, 0.9); 
        }
    }
}


/* ═══════════════════════════════════════════════════════════════
   SIDE NAVIGATION
   ═══════════════════════════════════════════════════════════════ */

.ui-side-navigation {
    
    min-height: 100dvh;
    height: 100dvh;
    width: 30%;
    
    display: flex;
    flex-direction: column;

    background: var(--color-white);
    border-right: 1px solid var(--color-divider);
    
    position: fixed;
    top: 0;
    left: 0;
    
    overflow: hidden;
    
    transition: none;

    .title, 
    .subtitle { 
        font-weight: normal; 
    }

    &.right {
        
        box-shadow: var(--shadow-right-bar);
        border-right: none;
        border-left: 1px solid var(--color-divider);
        left: auto;
        right: 0;

        .title, 
        .subtitle { 
            padding-left: 0.5em; 
        }
    }

    &.left { 
        box-shadow: var(--shadow-left-bar); 
    }

    .header {

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

        .close { 

            width: auto;
            height: fit-content;

            position: absolute; 
            top: 0; 
            right: 0; 

            background: none; 
            border: none; 
            box-shadow: none; 
        }
    }  
  
    .main .group .group-item .ui-badge { 
        min-width: auto; 
    }

    .ui-data-list li:hover {
        
        color: var(--color-text);
        background: #eff1f3;
        
        .ui-btn { 
            color: var(--color-text); 
        }
    }
}

.user-image {
          
    width: 8rem;
    height: 8rem;

    background: var(--color-white);
    border: 0.25rem solid var(--color-divider);

    aspect-ratio: 16 / 9;
    object-fit: cover;

    vertical-align: middle;
    text-align: center;

    &.is-small {

        width: 2rem;
        height: 2rem;
        
        border-width: 0.15rem;
    }
}

.user-data {

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    padding: 1.5em;

    .user-name { 

        display: inline-block; 
        padding: 0 0.5rem; 
    }
}


/* ═══════════════════════════════════════════════════════════════
   MULTIPAGE MENU
   ═══════════════════════════════════════════════════════════════ */

.aui-multipage-menu {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100%;
  background: var(--color-white);
  border-right: 1px solid var(--color-divider);
  overflow: hidden;
  transition: none;

  .title, .subtitle { font-weight: normal; }

  .header {
    display: flex;
    flex-direction: column;
    background: var(--color-primary);
    color: var(--color-white);
    position: relative;
    margin: 0;
    padding: 0;
  }

  .main {
    height: 100%;
    overflow-y: auto;

    > .title, > .subtitle { border-bottom: 1px solid var(--color-divider); margin: 0; padding: 0.5em 0; }
    > .subtitle { border-bottom: none; padding: 0.5em 0.5em; }

    > .group {
      margin: 0;
      padding: 0;

      .group-item {
        display: flex;
        align-items: center;
        color: var(--color-text-secondary);
        vertical-align: middle;
        cursor: pointer;
        user-select: none;
        transition: background-color 0.5s ease;
        padding: 0.5em 0;

        &.is-disabled { cursor: no-drop; }

        > * { padding: 0 0.5em; }

        .icon        { display: flex; }
        .text        { width: 100%; }
        .description { display: block; }

        &:not(.is-disabled):hover { background: #eff1f3; }
      }

      &.justified .group-item { justify-content: space-between; }
    }
  }

  .section {
    position: absolute;
    inset: 0;
    background: var(--color-white);

    .header {
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      justify-content: flex-start;
      align-items: center;
      background: var(--color-white);
      border-bottom: 1px solid var(--color-divider);
      color: var(--color-text-secondary);
      margin: 0;
      padding: 0;

      > .ui-btn {
        width: 2em;
        display: flex;
        border: none;
        border-radius: 50%;
        box-shadow: none;
        color: var(--color-white);
        padding: 1em;
        margin: 1em;
        &:hover { color: var(--color-text-secondary); }
      }

      > .title { flex-grow: 1; text-align: center; color: inherit; }
    }
  }
}


/* ═══════════════════════════════════════════════════════════════
   FORM
   ═══════════════════════════════════════════════════════════════ */
/* ── Input group (inline addons) ────────────────────────────────── */

/* Kept outside .ui-form: usages like the Datagrid's cell content wrap
   (see app.ui.theme.css) have no .ui-form ancestor, so a rule scoped
   under .ui-form would never match there and the group would fall back
   to display:block, stacking its children instead of laying them out
   on the grid. */
.ui-input-group {

    width: 100%;

    display: grid;
    grid-auto-flow: column;
    grid-template-columns: 1fr;
    grid-auto-columns: minmax( 40px, max-content );

    > *:not( :first-child ) {

        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }

    > *:not( :last-child ) {

        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

    .ui-input:not(:last-child) {
        border-right: none;
    }
}

/* ── Base input ─────────────────────────────────────────────────── */

/* Kept outside .ui-form, same reason as .ui-input-group above: this is
   used standalone (e.g. the Datagrid builds raw .ui-input elements with
   no .ui-form ancestor), and a rule scoped under .ui-form would leave
   those unstyled - no border, no padding, no min-height. */
.ui-input {
    
    --ui-input-transitions: border-color 0.15s, 
                            box-shadow 0.15s;

    width: 100%;
    max-width: 100%;

    background: var( --color-background-primary );
    border: 1px solid var( --input-default-border-color );
    border-radius: 0.25rem;
    color: var( --color-text-primary );

    outline: none;

    padding: 0.25rem;

    transition: var( --ui-input-transitions );

    &:not( textarea ) {
        min-height: 2rem;
    }

    &:not( [readonly], [disabled] ):hover:not( :focus ) {
        border-color: var( --input-hover-border-color );
    }

    &::placeholder {
        color: var( --input-placeholder-color );
    }

    /* ── State: required ──────────────────────────────────── */

    &[required] {
        border: 1px solid var( --input-required-border-color );
    }

    /* ── State: invalid ───────────────────────────────────── */

    &.is-invalid {
        border: 1px solid var( --input-invalid-border-color );
    }

    /* ── State: readonly / disabled ───────────────────────── */

    &[readonly] {

        background: var( --input-readonly-background );
        border-color: var( --input-readonly-border-color );
    }

    &[disabled] {

        background: var( --input-disabled-background );
        border-color: var( --input-disabled-border-color );

        cursor: not-allowed;
    }

    /* ── State: focus ─────────────────────────────────────── */

    &:not( [readonly], [disabled] ):focus {

        --_border:     var( --input-focus-border-color );
        --_shadow:     var( --input-focus-box-shadow-color );

        &:is( [required], .is-required ) {
            --_border: var( --input-required-border-color );
            --_shadow: var( --input-required-box-shadow-color );
        }

        &.is-invalid {
            --_border: var( --input-invalid-border-color );
            --_shadow: var( --input-invalid-box-shadow-color );
        }

        border: 1px solid var( --_border );
        box-shadow: 0 0 0 3px var( --_shadow );
    }

    /* ── Checkbox / radio ─────────────────────────────────── */

    &:is( select ) {

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    &[type=checkbox],
    &[type=radio] {

        --ui-input-transitions: border-color 0.15s, 
                                box-shadow 0.15s,
                                transform 0.15s;
        
        display: inline-flex;

        width: 1.25rem;
        height: 1.25rem;
        min-height: max-content;

        accent-color: var( --color-primary );
        background: transparent;
        box-shadow: none;

        padding: 0;
        
        cursor: pointer;
        
        &:hover,
        &:focus {
            transform: scale( 1.15 );
        }
    }

    /* ── Color picker ─────────────────────────────────────── */

    &[type=color] {

        appearance: none;
        background: var( --color-accent );
        border: none;

        padding: 0;

        cursor: pointer;

        &::-webkit-color-swatch-wrapper { padding: 0; }
        &::-webkit-color-swatch         { border: none; border-radius: 0; }
        &::-moz-color-swatch            { border: none; }
        &::-moz-focus-inner             { border: none; padding: 0; }
    }

    /* ── Range slider ─────────────────────────────────────── */

    &[type=range] {
        appearance: none;
        background: transparent;
        border: none;
        padding: 0;
        cursor: pointer;

        &:focus { outline: none; }

        &:focus::-webkit-slider-thumb,
        &:focus::-moz-range-thumb {
            outline: max( 2px, 0.2em ) solid rgba( 70, 130, 213, 0.5 );
            outline-offset: 0.125rem;
        }

        &[readonly]::-webkit-slider-thumb,
        &[disabled]::-webkit-slider-thumb,
        &[readonly]::-moz-range-thumb,
        &[disabled]::-moz-range-thumb {
            background-color: var( --color-background-secondary );
        }

        &::-webkit-slider-runnable-track,
        &::-moz-range-track {
            height: 0.5rem;
            background-color: var( --color-border-secondary );
            border-radius: 0.5rem;
        }

        &::-webkit-slider-thumb {
            appearance: none;
            width: 1rem;
            height: 1rem;
            background-color: var( --color-primary );
            border-radius: 50%;
            margin-top: -0.25rem;
        }

        &::-moz-range-thumb {
            width: 1rem;
            height: 1rem;
            background-color: var( --color-primary );
            border: none;
            border-radius: 50%;
        }
    }
}

/* ── Textarea ───────────────────────────────────────────────────── */

textarea.ui-input {
    height: auto;
    padding: 0.5rem 0.75rem;
    resize: vertical;
    overflow: auto;
}

/* ── Form group (input + button row) ──────────────────────────────── */

.ui-form-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    .ui-input { flex: 1; }
}

/* ── Select readonly ───────────────────────────────────────────────── */

select.ui-input[readonly] {
    pointer-events: none;
    cursor: not-allowed;
    touch-action: none;
}

.ui-form {

    /* ── Layout ─────────────────────────────────────────────────── */

    width: 100%;
    position: relative;

    /* ── Fieldset ───────────────────────────────────────────────── */

    fieldset {
        border: 0.5px solid var( --color-border-tertiary );
        margin: 0 0 0.5rem 0;
        padding: 0.25rem;
    }

    /* ── Label ──────────────────────────────────────────────────── */

    label {
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: var( --font-size-xs );
        text-transform: uppercase;
        margin-bottom: 0.25rem;

        &.inline {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
        }
    }

    /* ── Layered form variant ───────────────────────────────────── */

    &.ui-form-layered {
        display: block;
        width: 100%;
        height: 100%;
        overflow: auto;
    }
}

/* ── Password toggle ────────────────────────────────────────── */

.ui-password-group {

    position: relative;

    .ui-password-toggler {

        width: min-content;
        height: stretch;
        height: -webkit-fill-available;

        display: flex;
        justify-content: center;
        align-items: center;

        padding-inline: 0.25rem;

        position: absolute;
        top: 0;
        right: 0;

        z-index: 1;

        cursor: pointer;
        
        &.is-visible { opacity: 0.35; }
        
        > i {
            font-size: 125%;
        }
    }
}

.ui-form-layered {
    
    > :is( .ui-label, [class^=ui-input], .ui-checkbox, .ui-radio, .ui-btn, .ui-fieldset ) { 
        position: absolute; 
    }
}

.ui-form-filter .ui-form {
    
    position: static;

    .ui-input-group {
        
        width: 100%;
        
        display: flex;
        flex-flow: row nowrap;
        justify-content: flex-start;
        align-items: flex-start;
    
        margin: 0.25em 0;
        padding: 0;
    
        position: static;

        .ui-input {
            
            width: auto;
            
            &.value { 
                flex-grow: 2;
            }
            
            &[disabled], 
            &[readonly] { 
                border: 1px solid var(--color-text-faint); 
            }
        }
    }
}


/* ═══════════════════════════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════════════════════════ */

.ui-table {
    
    font-size: 1em;
    text-align: center;
    
    border-collapse: collapse;
    
    padding: 1em;
    margin: 0;

    th,
    td { 
        
        border: 1px solid var(--color-divider); 
        
        padding: 0.5em; 
        margin: 0; 
    }

    thead {
        
        th {

            font-size: var( --font-size-xs );
            font-weight: bold;
            text-transform: uppercase;

            background: linear-gradient(180deg, var(--color-bg-faint), var(--color-bg));
            color: var(--color-text);
        }
    }

    tbody {
        
        tr {
        
            background-color: var(--color-white);

            &:nth-child(even) { 
                background-color: var(--color-bg-faint);
            }

            td { 
                color: var(--color-text); 
            }
        }
    }
}


/* ═══════════════════════════════════════════════════════════════
   CARD
   ═══════════════════════════════════════════════════════════════ */

.ui-card {
    
    height: 100%;
  
    display: flex;
    flex-direction: column;
    
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
    
    transition: box-shadow 0.3s;
    
    margin: 0;
    padding: 0;
  

    &:hover { 
        box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.3); 
    }

    .ui-card-image { 
        margin: 0; 
    }

    .ui-card-header, 
    .ui-card-body, 
    .ui-card-footer { 
        
        padding: 1rem; 
        padding-bottom: 0; 
    }

    .ui-card-body { 
        flex: 1 1 auto; 
    }

    .ui-card-header:last-child,
    .ui-card-body:last-child,
    .ui-card-footer:last-child { 
        padding-bottom: 0.8rem; 
    }

    .title, 
    .subtitle { 
        font-weight: 300; 
    }
    
    .title { 
        font-weight: 400; 
    }
    
    .subtitle { 
        color: var(--color-text-faint); 
    }
}


/* ═══════════════════════════════════════════════════════════════
   TAB
   ═══════════════════════════════════════════════════════════════ */

.ui-tab {
    
    min-height: 100%;

    .ui-tab-header {
        
        display: flex;
        flex-shrink: 0;
                
        border-bottom: 1px solid var(--color-divider);
        
        position: relative;

        .ui-tab-nav-wrap {
            
            display: flex;
            flex-grow: 1;
            
            align-items: flex-end;
            
            overflow: hidden;

            .ui-tab-nav { 
                
                display: flex; 
                white-space: nowrap; 
                
                padding: 0; 
            }
        }

        .ui-tab-nav-item {
            
            display: inline-flex;
            justify-content: space-between;
            align-items: center;
        
            white-space: nowrap;
            text-align: center;
      
            cursor: pointer;
      
            user-select: none;
      
            position: relative;
            
            padding: 0.25em 0.5em;

            &.is-selected { 
                
                background: var(--color-white); 
                font-weight: bold; 
            }

            &.is-disabled {
                
                color: rgba(90, 101, 112, 0.6);
                border-color: rgba(90, 101, 112, 0.6);
                
                cursor: not-allowed;
                
                * { 
                    cursor: not-allowed; 
                }
                
                a { 
                    display: none; 
                }
            }

            &:not(.is-selected):not(.is-disabled):hover:after { 
                background: var(--color-primary-lightest); width: 100%; 
            }

            &:after {

                content: ".";
                
                height: 2px;
                width: 0%;

                color: transparent;
                background: transparent;
                
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
        
                margin: auto;
                
                transition: width 0.5s;
            }

            &.is-selected:after { 
                
                width: 100%; 
                background: var(--color-primary-lighter);                 
            }

            .bx {
                font-size: 75%;
            }

            .ui-btn { 
                color: var(--color-text); 
            }
            
            * { 
                padding: 0 0.25em; 
            }
        }

        .ui-tab-dropdown {
            
            max-height: 15em;
            
            display: none;
            flex-direction: column;
            
            position: absolute;
            right: 0;
            
            background: var(--color-white);
            border: 1px solid rgba(0, 0, 0, 0.12);
            box-shadow: var(--shadow-dialog);

            font-size: var( --font-size-xs );
            
            overflow-x: hidden;
            overflow-y: auto;
      
            z-index: 1;

      .ui-tab-nav-item {
        position: relative;
        min-width: 2.5em;
        display: inline-flex;
        justify-content: space-between;
        align-items: center;
        text-align: center;
        cursor: pointer;
        user-select: none;
        white-space: nowrap;
        padding: 0.5em 0.75em;

        &:not(.is-selected):hover { background: #95bcf3; color: var(--color-white); }

        &.is-selected {
          background: var(--color-white);
          border-bottom: none;
          border-left: 2px solid var(--color-primary-lighter);
          font-weight: bold;
        }

        &:after            { content: none; }
        &:not(:last-child) { border-bottom: 1px solid var(--color-divider); }

        .ui-btn {
          display: inline-flex;
          align-items: center;
          background: none;
          border: none;
          box-shadow: none;
          color: var(--color-text);
          font-size: 75%;
          text-decoration: none;
          outline: none;
          padding-left: 0.5em;
        }
      }
    }

    .ui-toolbar { flex-shrink: 0; }

    .ui-btn { line-height: 2; border: none; background: transparent; color: var(--color-text); padding: 0; }
  }

  .ui-tab-panels {
    display: flex;
    position: relative;

    .ui-tab-panel {
      width: 100%;
      position: absolute;
      top: -99999px;
      left: -99999px;

      &.is-selected { position: relative; top: 0; left: 0; }
    }
  }
}


/* ═══════════════════════════════════════════════════════════════
   DATA GRID
   ═══════════════════════════════════════════════════════════════ */

.ui-dg .ui-dg-body,
.ui-dg .ui-dg-head,
.ui-dg .ui-dg-title,
.ui-dg { 
    width: 100%; 
    position: relative; 
}

.ui-dg {
    
    --dg-background-color: rgba( 33, 37, 41, 0.03 );
    --dg-row-background-color: rgba( 120, 148, 255, 0.75 );
    --dg-row-selected-background-color: rgba( 120, 148, 255, 0.75 );
    
    display: flex;
    flex-direction: column;
    flex: 1;

    background-color: var( --dg-background-color );
    border-bottom: none;

    overflow: hidden;

    table {
        
        border-collapse: collapse;
        border-spacing: 0;
        border: 1px solid var(--color-bg);

        tr {

            td {
                
                border-width: 1px;
                border-style: solid;
                border-color: var(--color-bg);
                color: var(--color-text-secondary);
                
                vertical-align: middle;
                
                cursor: default;
                
                padding: 0.25em;

                div {
                    
                    overflow: hidden;
                    white-space: nowrap;
                    text-overflow: ellipsis;

                    * { 
                        
                        width: 100%; 
                        
                        margin: 0; 
                        padding: 0; 
                    }

                    .ui-input, 
                    .ui-input-group, 
                    .ui-input-password,
                    .ui-checkbox, 
                    .ui-radio, 
                    .ui-btn {
                        position: relative; 
                    }
                    
                    .ui-btn {
                        
                        width: stretch;
                        width: -webkit-fill-available;
                        border-radius: 0;
                    }
                }
            }
        }
    }

    .ui-dg-title {
      
        display: inline-block;
    
        border-bottom: 1px solid var(--color-bg);
        border-top: 1px solid var(--color-white);
        
        padding: 0.25em;
    }

    .ui-dg-head {
        
        overflow: hidden;
        user-select: none;

        .ui-dg-head-wrap { 
            float: left; 
            padding-right: 2.5em; 
        }
    }

    thead td > div {

        font-size: var( --font-size-xs );
        font-weight: bold;
        
        text-transform: uppercase;
    
        padding-top: 0.25em;
        padding-bottom: 0.25em;
    }

    thead th, 
    thead td {
        
        background: linear-gradient( 180deg, var( --color-bg-faint ), var(--color-bg ) );
        border: 1px solid var( --color-divider );
        border-collapse: collapse;
        color: var( --color-text-secondary );
    }

    tbody td > div {
        font-size: var( --font-size-xs );
    }

  tr:nth-child(odd)  { background-color: var(--color-white); }
  tr:nth-child(even) { background-color: var(--color-bg); }
  tr.is-marked       { font-weight: bold; }

  .ui-dg-body {
      
    flex: 1;
    overflow: auto;
    min-height: 10rem;

    tr > * { cursor: pointer; }

    .ui-dg-body-placeholder {
        
      min-height: inherit;
      
      display: flex;
      align-items: center;
      justify-content: center;

      h2 { color: var(--color-text-faint); font-weight: 100; }
    }
  }
  
  &:not( .is-not-hover ) {
    
    tr.is-selected,
    .ui-dg-body table tr:hover {

      transition: background-color 300ms;
      background: rgba(120, 148, 255, 0.75);
    }

    tr.is-selected td,
    .ui-dg-body table tr:hover td {
              
      border-color: var( --dg-row-selected-background-color );      
      color: color-contrast( var( --dg-row-selected-background-color ) );
      
      font-weight: 600;
      
      transform: scale( 1.01 );
      
      transition: border-color 0.2s ease-in-out, 
                  color 0.2s ease-in-out,
                  font-weight 0.1s ease-in-out,
                  transform 0.1s ease-in-out;
    }
  }
}

:not(.ui-dialog-body):not(.ui-lookup) > .ui-dg .ui-dg-body { max-height: 35rem; }


.ui-dg-resizer {
  width: auto !important;
  color: var(--color-text-disabled);
  display: none;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  cursor: w-resize;
  background: linear-gradient(180deg, var(--color-bg-faint), var(--color-bg));

  &:before { display: flex; height: 100%; align-items: center; vertical-align: middle; }
}


/* ─── Editable Data Grid ──────────────────────────────────────── */

.ui-editable-dg {
    
    .ui-dg-head {
        
        tr {
            
            td {                
                
                &.is-required {
                    border-bottom: 2px solid var( --color-accent ); 
                }
            }
        }
    }

    .ui-dg-body {
        
        tr {
            
            height: 2rem;

            td {

                padding-inline: 0.25rem;

                div {
                    
                    vertical-align: middle;

                    label[role=button] {
                        
                        white-space: nowrap;
                        overflow: hidden;
                        text-overflow: ellipsis;

                        padding: 0 0.5rem;

                        &::before { 
                            padding: 0 0.5rem; 
                        }
                    }

                    *:not(button, .ui-btn, [role=button]) { 
                        
                        border: none !important; 
                        background: none !important; 
                        box-shadow: none !important;
                    }
                }
            }
        }
    }

  .ui-dg-body tr.is-selected {
      
    background: rgba( 120, 148, 255, 1 );

    td {
        
        border-color: rgba( 120, 148, 255, 0.1 );

        &:not( .ui-dg-nr ) div { 
            text-align: center; 
        }

        div {

            input:disabled, select:disabled, textarea:disabled { 
              
                color: var( --color-text-disabled ); 
                cursor: not-allowed; 
            }
        }

        &:focus-within {
          
            background: var( --color-white );
            border-color: var( --color-border-faint );
            box-shadow: inset 0 0 4px var( --color-border-faint );
        }
    }

    &.is-invalid {
        
        background: rgba(249, 168, 37, 0.5);
        box-shadow: inset 0px 0px 20px 14px rgba(154, 97, 4, 0.5);

        td {
            
            border-color: rgba( 249, 168, 37, 0.5 );

            div {
                
                color: var(--color-text) !important;
            
                input, select, textarea                         { color: var(--color-text) !important; }
                input::placeholder, select::placeholder, textarea::placeholder { color: rgba(33, 37, 41, 0.25) !important; }
                input:disabled, select:disabled, textarea:disabled { color: var(--color-text-disabled) !important; }
            }
        }
    }

    &:hover td div {
      input, select, textarea       { color: white; }
      input:focus, select:focus, textarea:focus { color: var(--color-text); }
    }
  }

  .ui-dg-body tr td.ui-dg-nr {
      
        > div {
            
            display: flex;            
            justify-content: flex-end;
            align-items: center;
            
            font-variant-numeric: tabular-nums;
            font-weight: 200;
            
            .ui-dg-nr-icon { 
                padding-right: 0.25em; 
            }
        }
  }
  .ui-dg-body tr.is-added   .ui-dg-nr   { box-shadow: inset 0.25em 0 0 var(--color-primary-lighter); }
  .ui-dg-body tr.is-edited  .ui-dg-nr   { box-shadow: inset 0.25em 0 0 var(--color-accent); }
  .ui-dg-body tr.is-removed .ui-dg-nr   { box-shadow: inset 0.25em 0 0 var(--color-error); }

  &:not(.is-not-hover) .ui-dg-body tr {
    height: 2em;

    &.is-selected:not(:hover) .ui-input:not(:focus) {
      color: var(--color-white);
      &::placeholder { color: var(--color-white); }
    }
  }

  tr, tr td, tr td div, tr td div * { padding: 0; }
  /*
  tr td, tr td div, tr td div *     { height: inherit; }
  */

  .ui-checkbox { width: auto; margin: 0 auto; }

  /*
  .ui-form-group {
    display: flex;
    flex-flow: row wrap;

    .ui-input { flex: 1; min-width: 0; }
    .ui-btn   { flex: 0 0 40px; height: inherit; }
  }
  */
}

.ui-editable-dg-text-dialog .ui-dialog-body { height: 40vh; padding: 0.5em; margin: 0; }


/* ═══════════════════════════════════════════════════════════════
   DATA LIST
   ═══════════════════════════════════════════════════════════════ */

.ui-data-list {
  display: flex;
  flex-wrap: wrap;
  align-content: baseline;
  align-items: baseline;
  width: 100%;
  height: 100%;
  font-size: var( --font-size-xs );
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 0;

  .no-data {
    position: relative;
    top: 50%;
    bottom: 0;
    width: 100%;
    color: rgba(33, 37, 41, 0.25);
    font-size: 225%;
    vertical-align: middle;
    text-align: center;
  }

  > .title {
    font-size: 150%;
    font-weight: normal;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-divider-dark);
    overflow: auto;
    margin: 0;
    padding: 0.15em;

    > .ui-badge { font-size: 50%; vertical-align: middle; }
  }

  li {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    vertical-align: middle;
    cursor: pointer;
    margin: 0;
    padding: calc(0.5em / 2);

    > * { align-self: center; }

    .ui-btn[name=cancel], .ui-btn[name=reload] { background: none; border: none; box-shadow: none; color: var(--color-text-faint); }

    &:hover .ui-btn[name=cancel], &:hover .ui-btn[name=reload] { color: var(--color-white); }
  }

  li:not(.is-inline) > .ui-data-list-item {
    height: 100%;
    display: flex;
    flex-direction: column;
    vertical-align: middle;
    margin: calc(0.5em / 2) 0;
    padding: 0.5em;

    > * { align-self: baseline; }

    .title, .description { margin: 0; padding: 0; }
    .appendix > *:not(:first-child) { margin: 0 0.5em; }
  }

  li .ui-data-list-item + .ui-data-list-item { padding-left: 0.5em; }

  li.is-inline {
    flex-wrap: wrap;
    vertical-align: middle;

    > *                    { vertical-align: middle; }
    > *:not(:first-child)  { padding-left: 0.5em; }
  }

  &:not(.is-not-hover) {
    li:hover       { background: var(--color-bg-faint); }
    li.is-selected { background: var(--color-primary-lighter); color: var(--color-white); }
    li.is-focused  { background: var(--color-primary-lightest); color: var(--color-white); }
  }

  li.priority {
    border-left-style: solid;
    border-left-width: 0.5em;

    &.is-default { border-left-color: transparent; }
    &.is-warning { border-left-color: var(--color-accent); }
    &.is-error   { border-left-color: var(--color-error-bg); }
  }
}

.ui-data-list-wrapper {
    
    height: 100%;
    display: flex;
    flex-direction: column;

    .ui-data-list { 
        flex-grow: 2; 
    }
    
    .ui-value-search { 
        
      width: auto; 
      
      margin: 0.25em;
      padding: 0.25rem;
    }
}

.ui-checkable-data-list {
  border: none;
  margin: 0;
  padding: 0;

  li {
    border: none;
    vertical-align: middle;
    padding: 0.25em;

    > .ui-data-list-item:first-child { width: 1%; }
    &.is-check-all { text-transform: uppercase; padding: 1em 0.25em; }
  }
}


/* ═══════════════════════════════════════════════════════════════
   TREE
   ═══════════════════════════════════════════════════════════════ */

.ui-tree {
  
    width: 100%;
    
    min-height: 100%;
    height: 100%;

    display: grid;
    align-items: center;
    align-content: start;
    
    overflow: auto;
    color: var( --color-text );

    .ui-tree-text { 
        user-select: none; 
    }

    .ui-tree-root {
        
        padding: 0;
        
        > .ui-tree-title, 
        > .ui-tree-text { 
            
            display: inline-block; 
            padding: 0 0 0.25em 0; 
        }
    }

    .ui-tree-branch {
      
        vertical-align: middle;
        white-space: nowrap;

        .ui-tree-opener, 
        .ui-tree-icon {
        
            display: inline-block;
            
            text-align: center;
            vertical-align: middle;
            
            user-select: none;
            
            cursor: pointer;
        }

        .ui-tree-icon { 
            margin-right: 0.25em; 
        }

        > .ui-tree-text, 
        > .ui-tree-title { 
        
            padding-left: 0.5em; 
            white-space: nowrap;
        }
    }

    .ui-tree-leaf {

        display: flex;

        font-size: var( --font-size-xs );

        cursor: pointer;
    
        padding-right: 0.5em;
        margin: 0.25em 0;

        > .ui-tree-title, 
        > .ui-tree-subtitle, 
        > .ui-tree-text {
            
            flex: 1;
            align-items: center;
            
            line-clamp: 3; 
            
            overflow: hidden;
    }

    > .ui-tree-text, > .ui-tree-title { padding-left: 0.5em; }
    > .ui-tree-subtitle { margin-left: 0.5em; }

    &.is-selected,
    &.is-focused, 
    &:hover {
      
        background: var( --color-primary-lighter );
        color: var( --color-white );
        
        transition: background 0.3s ease, color 0.3s ease;
        
        .ui-tree-text { 
            color: inherit; 
        }
    }
  }

  i { font-style: normal; display: inline-block; padding: 0 0.2em; margin-right: -1.2em; }

  ul {
    list-style-type: none;
    padding: 0 0.2em;
    margin: 0;

    li > ul { padding-left: 0.5em; li { padding-left: 1em; } }

    li .ui-btn {
      font-size: var( --font-size-xs );
      text-align: center;
      vertical-align: top;
      background: none;
      border: none;
      box-shadow: none;
      color: var(--color-text);
      outline: none;

      &:active { outline: none; border: none; }
      &:hover  { color: inherit; background: none; }
    }
  }

  .ui-tree-search .ui-form {
    display: flex;
    flex-flow: row nowrap;
    .ui-btn { border: none; box-shadow: none; }
  }
  
    .ui-value-search { 
        
      width: auto; 
      
      margin: 0.25em;
      padding: 0.25rem;
    }
}

.ui-tree.sigem-ui-categories-tree {
  font-size: 0.9em;

  .ui-tree-leaf {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-divider);
    border-left: 2px solid var(--color-divider);
    border-radius: 0;
    color: var(--color-text-secondary);
    font-size: 0.9em;
    overflow: hidden;
    transition: none;
    padding: 0.5em;
    margin: 0;

    &:hover, &.is-selected {
      background: var(--color-primary-lighter);
      border-left: 2px solid var(--color-primary);
      color: var(--color-white);
      .ui-badge { background: var(--color-white); color: var(--color-primary); }
    }

    .ui-badge { white-space: nowrap; }
  }
}


/* ═══════════════════════════════════════════════════════════════
   TIMELINE
   ═══════════════════════════════════════════════════════════════ */

.ui-inline-timeline-wrapper .ui-inline-timeline .ui-inline-timeline-title,
.ui-horizontal-timeline-wrapper .ui-horizontal-timeline .ui-timeline-group .ui-timeline-item .ui-timeline-date,
.ui-horizontal-timeline-wrapper .ui-horizontal-timeline .ui-timeline-group .ui-timeline-title,
.ui-timeline .ui-timeline-group .ui-timeline-item .ui-timeline-date,
.ui-timeline .ui-timeline-group .ui-timeline-title {
  flex-shrink: 0;
  width: 5rem;
  color: var(--color-white);
  background-color: var(--color-primary);
  text-align: center;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
}

.ui-inline-timeline-wrapper .ui-inline-timeline .ui-inline-timeline-item .ui-inline-timeline-date .ui-inline-timeline-month,
.ui-horizontal-timeline-wrapper .ui-horizontal-timeline .ui-timeline-group .ui-timeline-item .ui-timeline-date .ui-timeline-month,
.ui-timeline .ui-timeline-group .ui-timeline-item .ui-timeline-date .ui-timeline-month {
  display: block;
  font-size: var( --font-size-xs );
  text-transform: uppercase;
}

.ui-timeline {
  display: flex;
  flex-flow: column nowrap;
  position: relative;
  padding-bottom: 1.5rem;

  &:before { content: ""; width: 2px; background-color: var(--color-primary); position: absolute; top: 0; bottom: 0; left: 4rem; }
  &:after  { content: ""; width: 1rem; height: 1rem; background-color: var(--color-white); border-radius: 50%; box-shadow: 0 0 0 3px var(--color-primary); position: absolute; bottom: 0; left: 3.55rem; }

  .ui-timeline-group {
    display: flex;
    flex-flow: column nowrap;
    align-items: baseline;
    padding: 1.5rem;
    z-index: 2;

    &:first-of-type { padding-top: 0; }

    .ui-timeline-item {
      width: 100%;
      display: flex;
      flex-flow: row nowrap;
      position: relative;

      &:not(:last-of-type) { margin-bottom: 1rem; }

      &:before { content: ""; width: 100%; height: 2px; background-color: var(--color-primary); position: absolute; top: 50%; left: 0; z-index: -1; }

      .ui-timeline-date { align-self: center; }
      .ui-timeline-day  { font-size: var( --font-size-xl ); font-weight: 700; display: block; }

      .ui-timeline-post {
        flex-grow: 1;

        .ui-timeline-content {
          background-color: var(--color-white);
          border-radius: 2px;
          border-left: 3px solid var(--color-primary);
          box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 1px 2px 0 rgba(0, 0, 0, 0.24);
          padding: 1.5rem;
          margin-left: 0.5rem;
        }
      }
    }
  }
}

.ui-horizontal-timeline-wrapper {
  width: 100%;
  overflow: auto;
  padding: 0.5rem;

  .ui-horizontal-timeline {
    height: 25em;
    display: flex;
    flex-direction: row;
    position: relative;

    .ui-timeline-group {
      flex: 1;
      display: flex;
      flex-direction: row;
      position: relative;

      .ui-timeline-title { width: auto; top: 50%; position: absolute; transform: translateY(-50%); z-index: 2; }

      .ui-timeline-item {
        width: 25rem;
        flex-shrink: 1;
        position: relative;

        .ui-timeline-date {
          width: auto;
          align-self: center;
          top: 50%; left: 50%;
          position: absolute;
          transform: translate(-50%, -50%);
          .ui-timeline-day { font-size: var( --font-size-base ); font-weight: 700; display: block; }
        }

        .ui-timeline-post {
          display: flex;
          min-height: 10rem;
          position: absolute;
          transform: translateX(-50%);
          left: 50%;
          padding: 1em;
          z-index: 2;

          .ui-timeline-content {
            width: 25rem;
            max-height: 10rem;
            overflow: auto;
            position: relative;
            background-color: var(--color-white);
            border-radius: 2px;
            border-top: none;
            border-bottom: 3px solid var(--color-primary);
            box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 1px 2px 0 rgba(0, 0, 0, 0.24);
            text-align: center;
            padding: 1rem;
          }
        }

        &:nth-child(even) {
          .ui-timeline-post { bottom: 0; .ui-timeline-content { border-bottom: none; border-top: 3px solid var(--color-primary); } }
          &:after { top: 50%; bottom: auto; }
        }

        &:before { content: ""; position: absolute; top: 50%; left: 0; transform: translateY(-50%); width: 100%; height: 2px; background: var(--color-primary); }
        &:after  { content: ""; width: 2px; height: 40%; background-color: var(--color-primary); position: absolute; top: auto; bottom: 50%; left: 50%; transform: translateX(-50%); }
      }
    }
  }
}

.ui-inline-timeline-wrapper {
  width: 100%;
  overflow-x: scroll;
  overflow-y: hidden;
  white-space: nowrap;
  padding: 0.5rem;

  .ui-inline-timeline {
    display: inline-block;
    position: relative;

    .ui-inline-timeline-title { height: 100%; width: auto; display: block; }

    .ui-inline-timeline-item {
      display: inline-block;
      position: relative;
      padding-left: 1.5em;
      padding-right: 1.5em;
      margin-right: -5px;

      .ui-inline-timeline-date {
        color: var(--color-white);
        background-color: var(--color-primary);
        text-align: center;
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        top: 50%; left: 50%;
        position: absolute;
        transform: translate(-50%, -50%);
        .ui-inline-timeline-day { font-size: var( --font-size-base ); font-weight: 700; display: block; }
      }

      .ui-inline-timeline-post {
        width: 25rem;
        max-height: 10rem;
        position: relative;
        overflow: hidden;
        background-color: var(--color-white);
        border-radius: 2px;
        border-top: none;
        border-bottom: 3px solid var(--color-primary);
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 1px 2px 0 rgba(0, 0, 0, 0.24);
        text-align: center;
        padding: 1rem;
        margin-bottom: 65%;
        margin-top: 0;
        z-index: 2;
      }

      &:nth-child(even) {
        .ui-inline-timeline-post { margin-top: 65%; margin-bottom: 0; border-bottom: none; border-top: 3px solid var(--color-primary); }
        &:after { top: 50%; bottom: auto; }
      }

      &:before { content: ""; position: absolute; top: 50%; left: 0; transform: translateY(-50%); width: 100%; height: 2px; background: var(--color-primary); }
      &:after  { content: ""; width: 2px; height: 40%; background-color: var(--color-primary); position: absolute; top: auto; bottom: 50%; left: 50%; transform: translateX(-50%); }
    }

    &:before { content: ""; width: 1rem; height: 1rem; background-color: var(--color-white); border-radius: 50%; box-shadow: 0 0 0 3px var(--color-primary); position: absolute; top: 49.5%; left: 0; transform: translateY(-50%); z-index: 2; }
    &:after  { content: ""; width: 1rem; height: 1rem; background-color: var(--color-primary); border-radius: 50%; box-shadow: 0 0 0 3px var(--color-white); position: absolute; top: 49.5%; transform: translate(-50%, -50%); z-index: 2; }
  }
}


/* ═══════════════════════════════════════════════════════════════
   LOOKUP
   ═══════════════════════════════════════════════════════════════ */

.ui-lookup {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;

  .ui-lookup-header, .ui-lookup-footer { background: var(--color-bg); text-align: right; padding: 0.375em; }

  .ui-lookup-header {
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
    align-items: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--color-bg);
  }

  .ui-lookup-footer { border-top: 1px solid var(--color-divider); }
}


/* ═══════════════════════════════════════════════════════════════
   QUERY BUILDER
   ═══════════════════════════════════════════════════════════════ */

.ui-qb {
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  display: flex;
  flex-wrap: nowrap;
  flex-direction: column;

  > section { flex: 1 1 auto; }

  .ui-qb-structure {
    flex: 1;
    max-width: 100%;
    background: var(--color-bg);
    overflow: auto;
    white-space: nowrap;
    padding: 1.5em;

    .ui-qb-actions {
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      justify-content: center;
      position: absolute;
      inset: 0;
      background: rgba(33, 37, 41, 0.5);

      .ui-toolbar {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;

        &.is-vertical {
          flex-direction: column;
          button { border: none; margin: 0; }
          :last-child { border-bottom: 1px solid #148f77; }
        }

        button { height: 2em; font-size: 0.75em; line-height: 1.5; border-left: none; box-shadow: none; }
      }
    }

    .groups, .aggregations, .connections {
      position: relative;
      border: none;
      background: var(--color-primary);
      color: var(--color-white);
      text-align: center;
      margin: 0;
      padding: 0.5em 1.5em;

      &.is-disabled { background: var(--color-text); }
    }

    .aggregations { background: var(--color-primary-lighter); }
  }

  .qb-output {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0;
    padding: 0;

    table {
      width: auto;

      &:not(.is-not-hover) tr.is-selected,
      &:not(.is-not-hover) tbody tr:hover {
        transition: background 0.3s;
        background: var(--color-primary-lighter);
      }

      &:not(.is-not-hover) tr.is-selected td,
      &:not(.is-not-hover) tbody tr:hover td {
        transition: border-color 0.3s, color 0.3s;
        border-color: var(--color-primary-lighter);
        color: var(--color-white);
      }

      tr.is-marked { font-weight: bold; }

      th, td { border: none; border-spacing: 0.1em; white-space: nowrap; }
    }
  }
}


/* ═══════════════════════════════════════════════════════════════
   CONTAINER
   ═══════════════════════════════════════════════════════════════ */

.ui-container {
    
    height: 100dvh;
    
    display: grid;
    grid-auto-rows: max-content 1fr;
    
    color: var(--color-text);
    
    margin: 0;
    padding: 0;
    
    overflow: hidden;    

    > .ui-container-top {
      
        height: 100%;
      
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;

        background: var(--color-primary);
        box-shadow: var(--shadow-top-bar);

        vertical-align: middle;
        
        overflow: hidden;
    
        margin: 0;
        padding: 0;

        > .title {

            font-size: var( --font-size-xl );
            font-weight: 100;

            color: var(--color-white);
            
            margin: 0; 
            padding: 0; 
        }

        .ui-btn {
            gap: 0.5rem;
        }
  }

  > .ui-container-body {
      
        display: flex;
        height: 100%;
        min-height: 100%;
        
        
        margin: 0;
        padding: 0;
        
        overflow: hidden;

    > .ui-container-left, 
    > .ui-container-right {
        
        height: 100%;
        min-height: 100%;
        
        margin: 0;
        padding: 0;
        
        overflow: auto;
    }

    > .ui-container-right { 
        
        flex: 1;
        
        padding-left: 0.5em; 
        padding-top: 0.5em; 
    }

    > .ui-container-left {
        
        width: 30dvw;

        display: grid;
        grid-auto-rows: max-content 1fr;

        background: white;
        border-right: none;
        box-shadow: var(--shadow-left-bar);
        
        overflow: hidden;

        > .header {
            
            position: relative;
            background: var(--color-primary);
            box-shadow: var(--shadow-top-bar);

            > h1 {

                font-size: var( --font-size-xl );
                font-weight: 100;

                color: var( --color-white );
                
                margin: 0; 
                padding: 0; 
            }
            
            > .close { 
                
                height: 100%;
                
                color: var(--color-white); 
                
                position: absolute; 
                top: 0; 
                right: 0; 
            }
      }

      > .main { flex-grow: 1; overflow-x: auto; }
    }
  }

  .ui-container-right {
    height: 100%;
    overflow: hidden;

    > .ui-tab {
      min-height: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
      overflow: hidden;

      > .ui-tab-panels { overflow: auto; }
    }
  }

  .ui-side-navigation {
    &.right { border-left: none !important; }
    &.left  { border-right: none !important; }
  }
}


/* ═══════════════════════════════════════════════════════════════
   MODULE
   ═══════════════════════════════════════════════════════════════ */

.ui-module {
  padding: 0;
  margin: 0 auto;

  .ui-tab  { margin-top: 0.5em; }
  .ui-tabs .ui-tab-nav { margin-left: 0; }

  .ui-level {
    background: var(--color-white);
    border: 1px solid var(--color-divider-dark);
    box-shadow: var(--shadow-module);
    margin-bottom: 0.15em;

    &:first-of-type .ui-level-header {
      background-color: var(--color-white);
      position: sticky;
      top: 0;
      z-index: 1;
      box-shadow: var(--shadow-module);
    }

    .ui-level-header {
        
      border-bottom: 1px solid var( --color-divider-dark );

      .ui-caption { font-size: 50%; }

      .ui-level-title {

            font-size: var( --font-size-lg );

            background-color: var(--color-white);
            border-bottom: 1px solid var(--color-divider-dark);
            
            overflow: auto;
            
            margin: 0;
            padding: 0.15em;
        }
        
        .ui-toolbar {
            
            .ui-btn {
                
                &[name=save] {
                    light-dark( rgba(  45, 138,  78, 1 ), rgba(  96, 195, 131, 1 ) )
                }
            }
        }
    }

    .ui-level-body {
      .ui-form .ui-grid {
        padding-bottom: 0.5em;

        .ui-row {
          padding: 0.25em 0;
          .ui-column > .ui-row { padding: 0; }
        }
      }

      p { position: relative; font-size: 105%; line-height: 1.5em; margin-bottom: 1.5em; }
    }

    & ~ .ui-level { margin-top: 0.5rem; margin-left: 0.5rem; }
    & + .ui-tab   { margin-left: 0.5rem; }
  }

  .ui-form-filter {
      
    max-height: 50vh;
    
    font-size: 75%;
    
    margin: 0;
    padding: 0.375em;

    form { 
        
        border: none; 
        
        .ui-input-group {
            padding: 0.25rem;
        }
        
        .ui-input, 
        .ui-btn { 
            height: 2.2rem; 
        }
    }    
  }

  .ui-dialog-body .ui-dg { height: 100%; }
}

.ui-caption {
    
    display: inline-block;
    
    color: var(--color-text-faint);
    
    text-align: right;
    vertical-align: middle;
    
    margin: 0;
    padding: 0 0.5em;

    > .ui-badge { 
        margin-left: 0.5rem; 
    }
}

.ui-level-section-title {
    
    border-bottom: 1px solid;
    border-image: linear-gradient(90deg, var(--color-border-input) 0%, var(--color-bg) 100%);
    border-image-slice: 1;

    font-size: var( --font-size-lg );
    line-height: 125%;
    font-weight: 300;
    white-space: nowrap;    
    text-overflow: ellipsis;
    text-transform: uppercase;
    
    overflow: hidden;
    
    margin: 0.5rem 0 0.25rem 0;
    padding-top: 0.5rem;
}

.ui-side-panel {
    
    width: 30%;
    height: 100%;

    border: none !important;
    box-shadow: -8px 0px 22px -12px rgba(33, 37, 41, 0.75);
    
    overflow: auto;
}

.ui-overlay {
    
    position: relative;

    &:before {
        content: "";

        height: 100%;
        width: 100%;
        
        display: block;
        position: absolute;
        inset: 0;

        background: rgba( 255, 255, 255, 0.5 );
    }
}

.ui-loader-wrapper {
    
    text-align: center;
    overflow: hidden;

    .ui-loader {
      
        display: block;
    
        width: 5rem;
        height: 5rem;
        
        border: 0.05rem solid var( --color-divider-dark );
        border-top: 0.05rem solid var( --color-primary );
        border-right: 0.05rem solid var( --color-primary );
        border-radius: 50%;
        
        overflow: hidden;
        
        margin: 0 auto;
        
        animation: spin 2s linear infinite;

        &.is-x-small { 
            
            width: 1.5rem; 
            height: 1.5rem; 
        }
        
        &.is-small { 
            
            width: 2.5rem; 
            height: 2.5rem; 
        }
        
        &.is-large { 
            
            width: 7.5em;  
            height: 7.5em; 
        }
        
        &.is-x-large { 
            
            width: 10em;   
            height: 10em; 
        }
    }
}

.ui-view {
    
    width: 100%;
    
    background: var( --color-white );
    border: 1px solid var( --color-divider );
    box-shadow: 0 0.05em 0.05em rgba( 33, 37, 41, 0.1 );
    
    margin: 0;
    padding: 0.5em 0;

    h1, 
    p { 
        
        margin: 0; 
        padding: 0; 
    }
}

.log-viewer {
    
    background: var( --color-white );

    .log-block {
        
        p {
            font-size: var( --font-size-2xl );
        }

        table {
            
            width: 100%;

            table-layout: fixed;

            font-size: 1rem;
            text-align: center;

            border-collapse: collapse;

            padding: 1rem;
            margin: 0;

            &:not( :first-child ) { 
                margin-top: 1.5rem; 
            }

            th, 
            td { 

                border: 1px solid var( --color-divider ); 

                padding: 0.5rem; 
                margin: 0; 
            }

            .log-header td {

                font-size: var( --font-size-xs );
                font-weight: bold;
                text-transform: uppercase;

                background: linear-gradient( 180deg, var( --color-bg-faint ), var( --color-bg ) );
                color: var( --color-text );
            }

            tbody {

                text-align: left;

                tr:not( .header ) { 
                    background-color: var( --color-white ); 
                }
                
                tr:nth-child( odd ) { 
                    background-color: #ececec; 
                }
                
                tr:not( .log-header, .error, .warn, .debug ):nth-child( 2n ) { 
                    background-color: var( --color-bg-faint ); 
                }

                tr:not( .log-header ) td {

                    color: var( --color-text );

                    &.CallerData, 
                    &.Message { 
                        overflow: auto; 
                    }

                    &.Exception { 

                        font-family: monospace; 

                        background: #5b0024; 
                        color: #fff; 
                    }
                }

                tr td {

                    &.CallerData, 
                    &.Message { 
                        width: 35%; 
                    }
                }

                tr.debug { 
                    
                    background-color: #9c27b0; 
                    
                    td { 
                        color: var( --color-white ); 
                    } 
                }
                
                tr.error { 
                    
                    background-color: #f50057; 
                    
                    td { 
                        color: var( --color-white ); 
                    } 
                }
                
                tr.warn  { 
                    
                    background-color: #ffc400; 
                    
                    td { 
                        color: var( --color-white ); 
                    } 
                }
            }
        }
    }
}

#SIGEM_APP_HELPER .ui-data-list {
    
    .title { 
        
        font-size: 150%; 
        
        padding-top: 0.5em; 
        padding-left: 0.25em;
    }

    li {
        
        color: currentColor;
        
        text-decoration: none;
        text-transform: uppercase;
        
        &::before { 
            
            vertical-align: middle; 
            padding-right: 0.5em; 
        }
    }
}

#VIEWER_USER_LOGS {
    
    overflow: auto;

    li {
        
        cursor: default;
    
        &:hover, 
        &.is-selected { 
            
            background: var( --color-white );
            color: var( --color-text ); 
        }
    }
}

#VIEWER_USER_NOTIFICATIONS li,
#VIEWER_USER_REQUESTED_SERVICES li {
    
    border-bottom: 1px solid var(--color-divider);
    justify-content: space-between;

    &.is-selected, &:hover {
        
        color: var(--color-text);
        background: #eff1f3;
    
        .ui-btn { color: var(--color-text); }
    }
}

.sigem-ui-sections section.sigem-ui-section {
    
    height: inherit;
    overflow: auto;

    &:first-child { white-space: nowrap; overflow: hidden; }

    &:not(:last-child) { background: var(--color-white); border-right: 1px solid var(--color-divider); }

    &.ui-column + &.ui-column { margin-left: 0; }

    .sigem-ui-section-title {

        font-size: var( --font-size-xl );

        background-color: var(--color-white);
        border-bottom: 1px solid var(--color-divider);
        
        overflow: auto;
        
        margin: 0;
        padding: 0.15em;
    }
}

.ui-data-list.sigem-ui-data-list {
    
    li { 
        border-bottom: 1px solid var(--color-divider); 
    }

    &.sigem-ui-data-list-history li {
        
        font-size: 1.2em;
        cursor: text;
        
        margin: 0;
        padding: 1em 0;

        &:hover, &:hover > * { 
            
            color: var(--color-text); 
            background: transparent; 
        }
    }
}

@media( max-width: 600px ) {
    
    .ui-form [data-tooltip] {
        
        display: flex;
        align-items: center;

        &:before, &:after { position: static; visibility: visible; display: block; opacity: 1; box-shadow: none; }
        &:before { background: transparent; color: #3d3d3d; white-space: normal; }
        &:after  { display: none; }

        &[data-position=top]:before,
        &[data-position=right]:before,
        &[data-position=bottom]:before,
        &[data-position=left]:before { transform: none; padding: 0; margin: 0; }
        
        .bx { margin: 0 0.5rem; }
    }
}

@media( max-width: 767px ) {
    
    .ui-row,
    .ui-column + .ui-column,
    .ui-gapless-column + .ui-gapless-column { 
      
        margin: 0; 
        padding: 0; 
    }

    .ui-row { 
        padding: 0.5em; 
    }

    .ui-column-1, 
    .ui-column-2, 
    .ui-column-3,
    .ui-column-4, 
    .ui-column-5, 
    .ui-column-6,
    .ui-column-7, 
    .ui-column-8, 
    .ui-column-9,
    .ui-column-10, 
    .ui-column-11, 
    .ui-column-12,
    .ui-column-1-3,
    .ui-gapless-column-1, 
    .ui-gapless-column-2, 
    .ui-gapless-column-3,
    .ui-gapless-column-4, 
    .ui-gapless-column-5, 
    .ui-gapless-column-6,
    .ui-gapless-column-7, 
    .ui-gapless-column-8, 
    .ui-gapless-column-9,
    .ui-gapless-column-10, 
    .ui-gapless-column-11, 
    .ui-gapless-column-12,
    .ui-gapless-column-1-3 { 
      
        display: block; 
      
        width: 100%; 
      
        margin: 0; 
        padding: 0;
    }

    .ui-form .ui-label { 
        display: block; 
    }

    .ui-modal .ui-modal-wrapper { 
        width: 90% !important; 
    }
}

.drop-zone {

    width: 100%;
    min-height: 200px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;

    text-align: center;

    border: 3px dashed color-mix( in hsl, var( --color-primary ) 50%, white 50% );
    border-radius: 0.5rem;                
    color: #777;

    cursor: pointer;

    transition: background-color 0.3s ease-in-out,
                border 0.3s ease-in-out;

    margin-block: 1rem;
    padding: 1.5rem;

    &:hover,
    &.over {

        background-color: color-mix( in hsl, var( --color-primary ) 10%, white );
        border-color: var( --color-primary );
    }
}

.user-photo-preview {

    display: none;

    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;

    background-position: center center;
    background-size: cover;

    padding: 0.5rem 0;

    position: relative;

    .image-preview {

        width: 15rem;
        height: 15rem;

        border-radius: 100vw;

        object-fit: cover;
    }
}

.resizable {
    position: relative;
}

.resizer {

    &.horizontal {

        width: 0.25rem;
        height: 100%;

        display: grid;
        align-items: center;
        justify-content: center;

        background: transparent;

        padding: 0 0.25rem;

        position: absolute;
        right: 0;
        top: 0;

        cursor: ew-resize;
    }
}

.resizer:hover {
    background: rgba( 0, 0, 0, 0.1 );
}         