/* The Terra look in WebEngine (pilot 2026-11; the ui-design skill, .claude/skills/ui-design): the Terra Logistics admin's
   look laid over the DevExpress / Bootstrap theme and app.css - white sheets with hairlines, ink in three strengths (a
   value, a label, a detail), buttons that stay calm until they mean something, the accent blue only for the main
   action, links and focus.
   WebEngine only: App.razor links tokens.css first (every colour, light and dark) and this file last, after
   StyleLinksComponent and the scoped CSS. app.css draws much of the same with !important: a rule here that has to win
   says !important too and starts with "html", one step more specific. Nothing here changes markup or behaviour. */

/* ---- Type: Inter at a 14px base, as Terra Logistics (its site.css BASE). Every rem in app.css, Bootstrap and the
   DevExpress theme shrinks with it, which is the denser Terra Logistics scale. ---------------------------------------- */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter/Inter-VariableFont.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter/Inter-Italic-VariableFont.ttf') format('truetype');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

html:root:root {
    font-size: 14px;
    --terra-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --bs-font-sans-serif: var(--terra-font) !important;
    --bs-body-font-family: var(--terra-font) !important;
    --bs-body-font-size: 1rem !important;
}

html body {
    background-color: var(--terra-bg-page);
    color: var(--terra-text-primary);
    font-family: var(--terra-font);
}

/* ---- The theme's colours from the tokens ---------------------------------------------------------------------------
   DevExpress's bootstrap-external theme draws with Bootstrap's variables; app.css sets --action-primary (its action
   blue) on :root and its dark palette (--erp-*) and some --bs-* on .erp-dark[data-bs-theme=dark], partly !important.
   html:root:root is more specific than both. --bs-primary stays as app.css set it: the theme uses it for focus frames
   and selections that app.css keeps quiet. */
html:root:root {
    --action-primary: var(--terra-primary) !important;
    --bs-body-bg: var(--terra-bg-surface) !important;
    --bs-body-color: var(--terra-text-primary) !important;
    --bs-emphasis-color: var(--terra-text-primary) !important;
    --bs-secondary-color: var(--terra-text-muted) !important;
    --bs-secondary-bg: var(--terra-bg-surface-deep) !important;
    --bs-tertiary-bg: var(--terra-bg-surface-deep) !important;
    --bs-border-color: var(--terra-border) !important;
    --bs-success: var(--terra-success) !important;
    --bs-danger: var(--terra-danger) !important;
    --bs-warning: var(--terra-warning) !important;
}

/* The theme's greys (hover fills, header strips, disabled text) in the tokens' slate. Light only: in dark mode
   Bootstrap's dark variables and app.css's --erp-* draw those. */
html:root:root:not(.erp-dark) {
    --bs-gray-100: var(--terra-bg-surface-deep);
    --bs-gray-200: var(--terra-bg-raised);
    --bs-gray-300: var(--terra-border);
    --bs-gray-400: var(--terra-border-strong);
    --bs-gray-600: var(--terra-text-muted);
    --bs-gray-700: var(--terra-text-body);
    --bs-gray-800: var(--terra-text-secondary);
    --bs-gray-900: var(--terra-text-primary);
}

/* app.css's dark palette in the tokens' dark values: its 230-odd dark rules keep working, in the new colours */
html:root:root.erp-dark {
    --erp-surface: var(--terra-bg-surface);
    --erp-strip: var(--terra-bg-surface-header);
    --erp-hover: var(--terra-bg-hover);
    --erp-hover-neutral: var(--terra-bg-hover);
    --erp-selected: var(--terra-bg-selected);
    --erp-text: var(--terra-text-primary);
    --erp-text-emph: var(--terra-text-primary);
    --erp-text-muted: var(--terra-text-muted);
    --erp-tab-caption: var(--terra-text-label);
    --erp-tab-inactive: var(--terra-bg-raised);
    --erp-border: var(--terra-border);
    --erp-border-editor: var(--terra-border-strong);
    --erp-link: var(--terra-text-link);
    --erp-save: var(--terra-success);
    --erp-danger: var(--terra-danger-text);
    --erp-danger-button: var(--terra-danger);
    --erp-invalid: var(--terra-danger);
    --erp-on-accent: var(--terra-on-primary);
    --erp-chip-text: var(--terra-on-primary);
    --erp-float-shadow: var(--terra-shadow-md);
    --erp-backdrop: var(--terra-backdrop);
}

/* ---- The page: a white sheet on the slate page, a step in from the menu and the top bar (Terra Logistics'
   .app_a_main > :first-child): a list's filters, toolbar and grid sit on it, the filters without a box of their own. --- */
html .MainFormGridArea {
    padding: 1rem !important;
    background-color: var(--terra-bg-page) !important;
}

html .ListTemplate {
    padding: 1rem 0.75rem;
    border: 1px solid var(--terra-border);
    border-radius: 0.875rem;
    background-color: var(--terra-bg-surface);
    box-shadow: 0 1px 2px var(--terra-shadow-sm), 0 6px 20px var(--terra-shadow-sm);
}

html .ListTemplate .ListTemplateFitlerPanel {
    border-radius: 0 !important;
    background: transparent !important;
}

html .ListTemplate .ListTemplateFilterFieldsPanel {
    padding: 0 0 0.75rem;
    border: 0 !important;
}

/* Phone, filters folded: Ieškoti and the eye sit beside the first field (components.css) - level with it here, as
   the panel has no padding now, and with room for the wider Ieškoti (it ran 9px over the field) */
@media (max-width: 767.98px) {
    html .ListTemplateFilterFieldsPanel:has(.ListTemplateFilterSelectionPanel.FiltersHidden) > .ListTemplateFilterFieldsPanelControlWrapper {
        top: 0;
        right: 0;
        height: 2.75rem;
    }

    html .ListTemplateFilterSelectionPanel.FiltersHidden > [data-column-count]:first-of-type > :first-child {
        margin-right: 9.5rem !important;
        max-width: calc(100% - 9.5rem) !important;
    }
}

/* The toolbar over the grid (ListTemplateActionPanel): a strip with a hairline all round, as Terra Logistics' */
html .ListTemplate .ListTemplateActionPanel {
    min-height: 2.75rem;
    padding: 0.25rem 0.25rem 0.25rem 0.5rem;
    border: 1px solid var(--terra-border) !important;
    background: var(--terra-bg-surface);
}

/* ---- The top bar (MainFormTabs' .appUpperRow): Terra Logistics' header - 3rem high, white, a hairline under it, its
   tools as quiet icon buttons (1rem icons in label ink, a tint on hover). On a wide screen only: the phone layout keeps
   its own top bar (components.css PHONE). The page under it moves up with it (MainFormTabs writes top: 50px inline). */
@media (min-width: 768px) {
    html .appUpperRow {
        height: 3rem;
        border-bottom: 1px solid var(--terra-border);
        background-color: var(--terra-bg-surface);
    }

    html .appUpperLogo {
        top: calc((3rem - 30px) / 2);
    }

    html .MainFormContentHost {
        top: 3rem !important;
    }

        html .MainFormContentHost .MainFormGridArea {
            height: calc(100vh - 3rem) !important;
        }

    html .MainFormTabs {
        margin-top: 3rem;
    }
}

html .appUserTopInfoAction .ButtonDropdown.ButtonDropdownDefault {
    height: 2.1rem;
    border-color: transparent;
    background-color: transparent;
    color: var(--terra-text-body);
}

    html .appUserTopInfoAction .ButtonDropdown.ButtonDropdownDefault :is(i, svg) {
        font-size: 1rem;
    }

    html .appUserTopInfoAction .ButtonDropdown.ButtonDropdownDefault .ButtonDropdownSide:hover {
        background-color: var(--terra-bg-raised) !important;
        color: var(--terra-text-primary);
    }

/* ---- The side menu (.app_a_sidebar, collapsed to a 3rem rail on a wide screen): Terra Logistics' menu - the nav dark,
   muted icons that brighten on hover, the open page's group in the accent; a hovered group's name and items in a
   flyout on the second dark. Same markup and behaviour as before, only its colours and sizes. ------------------------ */
html .app_a_sidebar.app_a_background-color-3 {
    background-color: var(--terra-nav) !important;
}

html .app_a_sidebar .app_a_top-row {
    border-bottom: 1px solid var(--terra-nav-line);
    background-color: transparent;
}

    html .app_a_sidebar .app_a_top-row .app_a_navbar-toggler {
        color: var(--terra-nav-ink);
    }

html .app_a_sidebar .nav .nav-item .nav-link {
    min-height: 2.6rem;
    color: var(--terra-nav-muted);
    font-size: 0.86rem;
    font-weight: 500;
    transition: background-color 0.12s ease, color 0.12s ease;
}

    html .app_a_sidebar .nav .nav-item .nav-link:hover,
    html .app_a_sidebar .nav .nav-item .nav-link.active {
        color: var(--terra-nav-strong);
    }

    /* The rail's icons at 1.1rem (about 15px): 0.95rem was too small to make out for some people, 1.2rem too big */
    html .app_a_sidebar .nav .nav-item .nav-link > .app_icon-button {
        height: 100%;
        font-size: 1.1rem;
    }

html .app_a_sidebar .app_a_top-row .app_a_navbar-toggler {
    font-size: 1.1rem;
}

html .app_menu-link-expandable .app_menu-link-text::after {
    border-color: currentColor;
    opacity: 0.7;
}

/* The rail's hovered item and its flyout: the second dark (they were black and #41434a) */
html .app_a_collapse #app_sidebar > li.app_menu-item:hover > .app_menu-link,
html .app_a_collapse #app_sidebar > li.app_menu-item:hover > .app_menu-link > .app_menu-link-text {
    background: var(--terra-nav-2);
    color: var(--terra-nav-strong);
}

    html .app_a_collapse #app_sidebar > li.app_menu-item:hover > .app_menu-link > .app_menu-link-text {
        height: 2.6rem;
        padding-left: 1rem;
        border-bottom: 1px solid var(--terra-nav-line);
        font-size: 0.86rem;
        font-weight: 600;
        line-height: 2.6rem;
    }

html .app_a_collapse #app_sidebar > li.app_menu-item:hover > ul.app_sub-menu,
html .app_a_collapse #app_sidebar > li.app_menu-item:hover > .app_menu-link::after {
    background: var(--terra-nav-2);
}

/* The flyout's column below its items lets the page show through, as before the look (app.css: opacity 0.8) */
html .app_a_collapse #app_sidebar > li.app_menu-item:hover > .app_menu-link::after {
    opacity: 0.8;
}

html .app_a_collapse #app_sidebar ul.app_sub-menu {
    padding: 0.25rem 0.5rem;
}

    html .app_a_collapse #app_sidebar ul.app_sub-menu .nav-link {
        min-height: 2.15rem;
        padding: 0.3rem 0.6rem;
        border-radius: 0.55rem;
        font-size: 0.82rem;
    }

        html .app_a_collapse #app_sidebar ul.app_sub-menu .nav-link:hover {
            background: var(--terra-nav-hover);
            color: var(--terra-nav-ink);
        }

/* Keyboard focus: one accent ring everywhere (app.css sets the theme's focus frames to near-white); zero specificity,
   so a component can draw its own. Mouse clicks show none. */
:where(a, button, [role="button"], [role="tab"], summary, input, select, textarea, [tabindex]:not([tabindex="-1"])):focus-visible {
    outline: 2px solid var(--terra-primary);
    outline-offset: 2px;
}

/* app.css draws every focused element with ":focus { outline: 1px dotted ... !important }", which outranks the ring
   above: a dotted frame stayed on a button, a tree's expand / collapse, a tab after a mouse click. With the look: no
   frame after a click; from the keyboard, the accent ring on a control (a text box shows its focus by its own border).
   Kept low in specificity, so a component's own focus rule (the tabs', the side menu's) still wins. */
html :focus:not(:focus-visible) {
    outline: none !important;
}

html :is(a, button, [role="button"], [role="tab"], summary, [tabindex]:not([tabindex="-1"]):not(input):not(textarea)):focus-visible {
    outline: 2px solid var(--terra-primary) !important;
    outline-offset: 2px;
}

/* The side menu's toggle, items and icons: no dotted frame after a click (app.css's global ":focus { outline: 1px
   dotted ... !important }" outranks the ring above); from the keyboard, the accent ring, inside the item */
html .app_a_sidebar :is(button, a, [role="button"], .nav-link, .app_icon-button):focus:not(:focus-visible) {
    outline: none !important;
}

html .app_a_sidebar :is(button, a, [role="button"], .nav-link, .app_icon-button):focus-visible {
    outline: 2px solid var(--terra-primary) !important;
    outline-offset: -2px;
}

/* ---- Buttons --------------------------------------------------------------------------------------------------------
   Neutral by default: the surface, a hairline, label ink, semibold; a step darker on hover. The action buttons over
   lists and in forms (XButton Role="Action", "Filter") were outlined in the accent and filled with it on hover: neutral
   now, as every other secondary action. A filled colour stays for what it means: the main action (primary), Save
   (success), delete (danger) - white text on it in the light theme, dark text in the dark one (tokens.css). */
html .dxbl-btn {
    --dxbl-btn-border-radius: 0.55rem;
    font-size: 0.82rem;
    font-weight: 600;
}

/* A toolbar's or a form's button: 2.1rem high (Terra Logistics' ui-btn is-md); app.css pins the action ones at 2.2rem */
html .dxbl-btn.dxbl-btn-standalone,
html .dxbl-btn.xbutton:is([data-role="Action"], [data-role="Filter"], [data-role="SavePanelClose"]) {
    min-height: 2.1rem;
    height: 2.1rem !important;
    padding: 0.3rem 0.85rem;
}

/* Phone: a form's bottom bar is thumb-sized (components.css makes its menus 44px); its Close button too, not 2.1rem */
@media (max-width: 767.98px) {
    html .innerform-savepanel .dxbl-btn.xbutton {
        min-height: 44px;
        height: 44px !important;
    }
}

html .dxbl-btn.dxbl-btn-outline-secondary {
    --dxbl-btn-bg: var(--terra-bg-surface);
    --dxbl-btn-color: var(--terra-text-body);
    --dxbl-btn-border-color: var(--terra-border);
    --dxbl-btn-hover-bg: var(--terra-bg-surface-deep);
    --dxbl-btn-hover-background: none;
    --dxbl-btn-hover-color: var(--terra-text-primary);
    --dxbl-btn-hover-border-color: var(--terra-border-strong);
    --dxbl-btn-active-bg: var(--terra-bg-raised);
    --dxbl-btn-active-color: var(--terra-text-primary);
    --dxbl-btn-active-border-color: var(--terra-border-strong);
    --dxbl-btn-disabled-color: var(--terra-text-muted);
    --dxbl-btn-disabled-border-color: var(--terra-border-subtle);
}

html .dxbl-btn.xbutton[data-role="Action"] {
    background-color: var(--terra-bg-surface) !important;
    border-color: var(--terra-border) !important;
    color: var(--terra-text-body) !important;
}

    html .dxbl-btn.xbutton[data-role="Action"]:hover:not(.dxbl-disabled):not(:disabled) {
        background-color: var(--terra-bg-surface-deep) !important;
        border-color: var(--terra-border-strong) !important;
        color: var(--terra-text-primary) !important;
    }

/* A board's own filter panel's Ieškoti / Atnaujinti (XButton role="Filter": Kalendorius, Rampų kalendorius, Gamybos
   planavimas, Lankomumas, Darbo laiko apskaita) is its one main action: filled in the accent, as a list's Ieškoti */
html .dxbl-btn.xbutton[data-role="Filter"] {
    background-color: var(--terra-primary) !important;
    border-color: var(--terra-primary) !important;
    color: var(--terra-on-primary) !important;
}

    html .dxbl-btn.xbutton[data-role="Filter"]:hover:not(.dxbl-disabled):not(:disabled) {
        background-color: var(--terra-primary-hover) !important;
        border-color: var(--terra-primary-hover) !important;
        color: var(--terra-on-primary) !important;
    }

html .dxbl-btn.dxbl-btn-primary {
    --dxbl-btn-bg: var(--terra-primary);
    --dxbl-btn-color: var(--terra-on-primary);
    --dxbl-btn-border-color: var(--terra-primary);
    --dxbl-btn-hover-bg: var(--terra-primary-hover);
    --dxbl-btn-hover-background: none;
    --dxbl-btn-hover-color: var(--terra-on-primary);
    --dxbl-btn-hover-border-color: var(--terra-primary-hover);
}

html .dxbl-btn.dxbl-btn-success {
    --dxbl-btn-bg: var(--terra-success);
    --dxbl-btn-color: var(--terra-on-primary);
    --dxbl-btn-border-color: var(--terra-success);
    --dxbl-btn-hover-bg: color-mix(in srgb, var(--terra-success) 85%, var(--terra-text-primary));
    --dxbl-btn-hover-background: none;
    --dxbl-btn-hover-color: var(--terra-on-primary);
    --dxbl-btn-hover-border-color: color-mix(in srgb, var(--terra-success) 85%, var(--terra-text-primary));
}

html .dxbl-btn.dxbl-btn-danger {
    --dxbl-btn-bg: var(--terra-danger);
    --dxbl-btn-color: var(--terra-on-primary);
    --dxbl-btn-border-color: var(--terra-danger);
    --dxbl-btn-hover-bg: var(--terra-danger-hover);
    --dxbl-btn-hover-background: none;
    --dxbl-btn-hover-color: var(--terra-on-primary);
    --dxbl-btn-hover-border-color: var(--terra-danger-hover);
}

/* Delete as an outline: red text and a soft red line, tinted on hover */
html .dxbl-btn.dxbl-btn-outline-danger {
    --dxbl-btn-bg: var(--terra-bg-surface);
    --dxbl-btn-color: var(--terra-danger-text);
    --dxbl-btn-border-color: color-mix(in srgb, var(--terra-danger) 35%, var(--terra-bg-surface));
    --dxbl-btn-hover-bg: var(--terra-danger-bg);
    --dxbl-btn-hover-background: none;
    --dxbl-btn-hover-color: var(--terra-danger-text);
    --dxbl-btn-hover-border-color: var(--terra-danger);
}

/* Menu buttons (ButtonDropdown: Save, Actions, Print reports): neutral like the other buttons; Save (Green) is the form's
   main action, filled in the success colour (it was a green outline); Actions (Blue) is a menu, not the main action, so
   neutral too. A thin line parts the one-click side from the menu's arrow. */
html .ButtonDropdown {
    height: 2.1rem;
    border-color: var(--terra-border);
    border-radius: 0.55rem;
    background-color: var(--terra-bg-surface);
    color: var(--terra-text-body);
    font-size: 0.82rem;
    font-weight: 600;
}

    html .ButtonDropdown .ButtonDropdownSide:hover,
    html .ButtonDropdown .ButtonDropdownSide.ButtonDropdownSideBlue:hover {
        border-radius: calc(var(--terra-radius-sm) - 1px);
        background-color: var(--terra-bg-surface-deep) !important;
        color: var(--terra-text-primary);
    }

    html .ButtonDropdown .ButtonDropdownSide.StaticOneClickAction:hover {
        background-color: transparent !important;
    }

    html .ButtonDropdown .ButtonDropdownSide.MultipleSelectionAction {
        border-left: 1px solid color-mix(in srgb, currentColor 22%, transparent);
    }

    /* Its text too: dx-bridge.css (loaded before this file) paints a Blue menu's text white for the filled blue it had */
    html .ButtonDropdown.ButtonDropdownBlue,
    html .ButtonDropdown.ButtonDropdownBlue .ButtonDropdownSide,
    html .ButtonDropdown.ButtonDropdownBlue .ButtonDropdownSideText {
        border-color: var(--terra-border);
        color: var(--terra-text-body);
    }

    /* Save (Green) is a form's main action: filled in the accent, as Terra Logistics' Save. (The text's own colour too:
       app.css paints it green in dark mode, for the outline it was.) */
    html .ButtonDropdown.ButtonDropdownGreen,
    html .ButtonDropdown.ButtonDropdownGreen .ButtonDropdownSideText {
        border-color: var(--terra-primary);
        background-color: var(--terra-primary);
        color: var(--terra-on-primary);
    }

        html .ButtonDropdown.ButtonDropdownGreen .ButtonDropdownSide:is(:hover, .StaticOneClickAction:hover) {
            background-color: var(--terra-primary-hover) !important;
            color: var(--terra-on-primary);
        }

        /* Two filled halves: a light line between them (Terra Logistics' ui-split) */
        html .ButtonDropdown:is(.ButtonDropdownGreen, .ButtonDropdownBlue) .ButtonDropdownSide.MultipleSelectionAction {
            border-left-color: color-mix(in srgb, var(--terra-on-primary) 35%, transparent);
        }

/* The menu's chevron: small and light (it was a 16px compact chevron) */
html .ButtonDropdown .BtnDropdownInvokerHolder svg {
    width: 0.7rem;
    height: 0.7rem;
    stroke: currentColor;
    stroke-width: 0.8;
    opacity: 0.85;
}

/* A list's Search (the filter panel's Blue ButtonDropdown) is the list's one main action: filled in the accent, as
   Terra Logistics' Ieškoti */
html .ListTemplateFitlerPanelButtons .ButtonDropdown.ButtonDropdownBlue,
html .ListTemplateFitlerPanelButtons .ButtonDropdown.ButtonDropdownBlue .ButtonDropdownSideText {
    border-color: var(--terra-primary);
    background-color: var(--terra-primary);
    color: var(--terra-on-primary);
}

    /* Both halves' own text colour too (the neutral Blue menu above sets it, for dx-bridge.css's white) */
    html .ListTemplateFitlerPanelButtons .ButtonDropdown.ButtonDropdownBlue .ButtonDropdownSide {
        color: var(--terra-on-primary);
    }

    html .ListTemplateFitlerPanelButtons .ButtonDropdown.ButtonDropdownBlue .ButtonDropdownSide:is(:hover, .StaticOneClickAction:hover) {
        background-color: var(--terra-primary-hover) !important;
        color: var(--terra-on-primary);
    }

    /* Its magnifying glass before the text, as Terra Logistics' Ieškoti (here, not in InnerFormFilterPanel's markup: the
       glass comes and goes with the look) */
    html .ListTemplateFitlerPanelButtons .ButtonDropdown.ButtonDropdownBlue .OneClickAction .ButtonDropdownSideText::before {
        margin-right: 0.4rem;
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        content: "\f002";
    }

/* A menu button's menu. toggleDropDownMenu (Extensions.js) moves it into the body and frames it inline - white, a 15%
   black line, 6px corners - so the frame needs !important: Terra Logistics' popover card instead (the surface, a
   hairline, 0.6rem corners, its shadow). Its rows (XButton role="DropdownMenu") were black and semibold, a standalone
   button's height: Terra Logistics' menu rows - ink at medium weight, a muted icon, the plane when hovered, the accent's
   wash when pressed. A period's submenu (DropdownSubmenuPanel) the same. */
html body > div:has(> .DropDownHolder),
html .DropdownSubmenuPanel {
    padding: 0.25rem !important;
    border: 1px solid var(--terra-border) !important;
    border-radius: 0.6rem !important;
    background-color: var(--terra-bg-surface) !important;
    box-shadow: 0 4px 12px var(--terra-shadow-sm), 0 18px 40px var(--terra-shadow-md) !important;
    color: var(--terra-text-primary) !important;
}

    html body > div:has(> .DropDownHolder) .xbutton[data-role="DropdownMenu"],
    html .DropdownSubmenuPanel > .xbutton[data-role="DropdownMenu"] {
        gap: 0.5rem;
        min-height: 0;
        margin-block: 0 !important;
        padding: 0.45rem 0.65rem !important;
        border-radius: 0.4rem;
        color: var(--terra-text-primary);
        font-size: 0.85rem;
        font-weight: 500;
    }

        html body > div:has(> .DropDownHolder) .xbutton[data-role="DropdownMenu"] :is(i, .dxbl-image) {
            width: 1rem;
            color: var(--terra-text-muted);
            text-align: center;
        }

        /* Hovered: a grey deep enough to tell which row the pointer is on (the plane, bg-surface-deep, was too faint);
           a deeper grey while pressed. Ink stays ink - no accent in a menu. */
        html body > div:has(> .DropDownHolder) .xbutton[data-role="DropdownMenu"]:not(:disabled):is(:hover, :focus-visible),
        html body > div:has(> .DropDownHolder) .DropdownSubmenu.open > .DropdownSubmenuTrigger,
        html .DropdownSubmenuPanel > .xbutton[data-role="DropdownMenu"]:not(:disabled):is(:hover, :focus-visible) {
            background-color: color-mix(in srgb, var(--terra-text-primary) 8%, var(--terra-bg-surface)) !important;
            color: var(--terra-text-primary) !important;
        }

        html body > div:has(> .DropDownHolder) .xbutton[data-role="DropdownMenu"]:not(:disabled):active,
        html .DropdownSubmenuPanel > .xbutton[data-role="DropdownMenu"]:not(:disabled):active {
            background-color: color-mix(in srgb, var(--terra-text-primary) 14%, var(--terra-bg-surface)) !important;
            color: var(--terra-text-primary) !important;
        }

        html body > div:has(> .DropDownHolder) .xbutton[data-role="DropdownMenu"]:disabled {
            color: var(--terra-text-muted);
            opacity: 0.6;
        }

    /* A heading inside a menu (the "?" menu's sections): a hairline over it, the label's ink */
    html .ButtonDropdownSectionHeader {
        border-top-color: var(--terra-border);
        color: var(--terra-text-muted);
    }

/* The page open in a list's pager: the accent's wash (app.css fills it with the action blue) */
html .dxbl-pager .dxbl-btn.dxbl-pager-active-page-btn {
    background-color: var(--terra-primary-wash) !important;
    border-color: var(--terra-primary-line) !important;
    color: var(--terra-primary-hover) !important;
}

/* ---- Fields (the DevExpress text box that XTextEdit, XLookUpEdit, XDatePicker, XSpinEdit... draw) ------------------
   The surface, a line between a hairline and the strong border (an empty field still reads as one), rounder corners,
   the accent line and a soft ring when focused; read-only on the deep surface. */
html .dxbl-text-edit {
    --dxbl-text-edit-bg: var(--terra-bg-surface);
    --dxbl-text-edit-color: var(--terra-text-primary);
    --dxbl-text-edit-border-color: color-mix(in srgb, var(--terra-border), var(--terra-border-strong));
    --dxbl-text-edit-border-radius: var(--terra-radius-sm);
    --dxbl-text-edit-focus-border-color: var(--terra-primary);
    --dxbl-text-edit-focus-shadow-color: color-mix(in srgb, var(--terra-primary) 22%, transparent);
    --dxbl-text-edit-readonly-bg: var(--terra-bg-surface-deep);
    --dxbl-text-edit-readonly-color: var(--terra-text-body);
    --dxbl-text-edit-disabled-bg: var(--terra-bg-raised);
    --dxbl-text-edit-disabled-color: var(--terra-text-muted);
    --dxbl-text-edit-btn-color: var(--terra-text-muted);
    --dxbl-text-edit-btn-hover-color: var(--terra-text-primary);
    --dxbl-text-edit-border-radius: 0.55rem;
    border-radius: 0.55rem;
}

    /* The value: 0.95rem, medium, in ink; a field 2.75rem high (Terra Logistics' Input*Custom) */
    html .dxbl-text-edit .dxbl-text-edit-input {
        color: var(--terra-text-primary);
        font-size: 0.95rem;
        font-weight: 500;
    }

    /* The field's accent line and ring show its focus: no dotted frame around the value inside it from app.css's
       global ":focus { outline: 1px dotted ... !important }" */
    html .dxbl-text-edit :is(input, textarea):focus {
        outline: none !important;
    }

html .xTextEdit input {
    height: calc(2.75rem - 2px);
}

/* The label inside the field (ui_placeholder), as Terra Logistics': 0.92rem muted in the middle of an empty field, 0.7rem
   medium at the top once it floats, both 0.7rem from the field's edge. The X* editors' scripts float it with the frame
   from window.terraLabelFloat (GlobalXTextEdit.js), which reads these three values: scale 0.7 / 0.92, and a move up
   from the middle to 0.32rem under the top edge (the scale is around the label's left middle). */
html:root:root {
    --terra-label-float-scale: 0.761;
    --terra-label-float-x: 0px;
    --terra-label-float-y: -10.9px;
    --terra-label-rest-x: 0px;
}

html .ui_input-label.ui_placeholder:not(.ui_input-container > .ui_input-label) {
    top: calc(1.375rem - 0.6em - 1px) !important;
    left: 0.7rem;
    width: calc(100% - 1.4rem);
    max-width: calc(100% - 1.4rem);
    color: var(--terra-text-muted);
    font-size: 0.92rem;
    font-weight: 400;
    line-height: 1.2;
    transform-origin: left center;
}

    html .dxbl-text-edit:focus-within .ui_placeholder {
        color: var(--terra-primary-hover);
    }

/* Buttons inside a field, as Terra Logistics' (ui_input-action, ui_input-caret): 1.6rem, transparent, a muted 0.8rem
   icon that darkens on a light tint when hovered. A lookup's (XLookUpEdit: its open, add, clear and dropdown icons, 24px
   svgs) take their size from a padding; its chevron a little smaller and drawn thicker, as fa-chevron-down. */
/* The icon strip as tall as the field and from its top (app.css: top 10px !important, down to the block's bottom - the
   icons sat 5px low, and beside a multi-select's chips under the field) */
html .XLookUpSearchIconWrapper {
    top: 0 !important;
    bottom: auto;
    right: 0.3rem;
    height: 2.75rem;
    align-items: center;
    gap: 0.1rem;
}

    html .XLookUpSearchIconWrapper > svg.XLookUpSearchDropdownIcon {
        width: 1.6rem;
        height: 1.6rem;
        padding: 0.4rem;
        border-radius: 0.4rem;
        color: var(--terra-text-muted);
        cursor: pointer;
        transition: background-color 0.12s ease, color 0.12s ease;
    }

        html .XLookUpSearchIconWrapper > svg.XLookUpSearchDropdownIcon:hover {
            background-color: var(--terra-bg-surface-deep);
            color: var(--terra-text-primary);
        }

        html .XLookUpSearchIconWrapper > svg:is(.bi-chevron-compact-down, .bi-chevron-compact-up) {
            padding: 0.45rem;
            stroke: currentColor;
            stroke-width: 0.8;
        }

html .dxbl-text-edit:focus-within ~ .XLookUpSearchIconWrapper > svg:is(.bi-chevron-compact-down, .bi-chevron-compact-up) {
    color: var(--terra-primary);
}

/* DevExpress's buttons in a field (a date's calendar and clear, a combo's dropdown): the same small transparent buttons,
   Font Awesome's icons in place of DevExpress's (fa-regular fa-calendar, fa-xmark, fa-chevron-down) */
html .dxbl-text-edit .dxbl-btn-group-right {
    align-items: center;
    gap: 0.1rem;
    margin-right: 0.3rem;
}

    /* The clear button of a date (XDatePicker) sits in the box itself, not in the group (app.css paints .XDateEdit
       buttons navy) */
    html .dxbl-text-edit :is(.dxbl-btn-group-right > .dxbl-btn, .dxbl-edit-btn-clear) {
        align-self: center;
        width: 1.6rem;
        min-width: 1.6rem;
        height: 1.6rem !important;
        min-height: 0;
        padding: 0;
        border: 0 !important;
        border-radius: 0.4rem !important;
        background: transparent !important;
        box-shadow: none !important;
        color: var(--terra-text-muted) !important;
    }

        html .dxbl-text-edit :is(.dxbl-btn-group-right > .dxbl-btn, .dxbl-edit-btn-clear):hover {
            background: var(--terra-bg-surface-deep) !important;
            color: var(--terra-text-primary) !important;
        }

        html .dxbl-text-edit :is(.dxbl-btn-group-right > .dxbl-btn, .dxbl-edit-btn-clear) > svg.dxbl-image {
            display: none;
        }

        html .dxbl-text-edit :is(.dxbl-btn-group-right > .dxbl-btn, .dxbl-edit-btn-clear)::before {
            font-family: "Font Awesome 6 Free";
            font-size: 0.7rem;
            font-weight: 900;
            content: "\f078";
        }

        /* (as specific as the rule above, which they follow) */
        html dxbl-date-edit.dxbl-text-edit .dxbl-btn-group-right > .dxbl-edit-btn-dropdown::before {
            font-size: 0.8rem;
            font-weight: 400;
            content: "\f133";
        }

        html .dxbl-text-edit .dxbl-btn.dxbl-edit-btn-clear::before {
            font-size: 0.8rem;
            content: "\f00d";
        }

/* A date (XDatePicker: DevExpress's date edit, its label beside it): the same 2.75rem field and value */
html dxbl-date-edit.XDateEdit {
    height: 2.75rem;
}

    html dxbl-date-edit.XDateEdit > .dxbl-text-edit-input {
        padding-top: 1.05rem !important;
        padding-bottom: 0.2rem !important;
        padding-left: 0.7rem !important;
    }

/* A labelled field's value under its floated label (Terra Logistics' padding 1.05rem 0.7rem 0.2rem) */
html .dxbl-text-edit:has(> .ui_placeholder):not(.XLookUpEdit .dxbl-text-edit) > .dxbl-text-edit-input {
    padding-top: 1.05rem !important;
    padding-bottom: 0.2rem !important;
    padding-left: 0.7rem !important;
}

/* A lookup's value is a 20px line placed by its margins (app.css .XLookUpEdit input): the same 2.75rem field and the
   value where a text field has it */
html .XLookUpEdit .dxbl-text-edit > .dxbl-text-edit-input {
    margin-top: 13px;
    margin-bottom: 3.5px;
    margin-left: 0.7rem;
    padding: 0 !important;
}

/* A lookup painted with its row's colour (a state, a priority: ColorMember; GlobalXLookUpEdit.js writes it inline and
   as --state, and marks the input data-terra-state): instead of the whole field filled - unreadable greyed text on a
   loud colour - a dot in the colour before the value, as a state pill's. The dark theme's forced chip text goes too. */
/* The dot has a thin ring of its own colour, darker, so a pale database colour (a light yellow) still shows on white */
html .XLookUpEdit input[data-terra-state][style*="background-color"],
html [dropselector][data-terra-state] {
    --terra-state-dot: radial-gradient(circle at 0.3rem 50%, var(--state-tone, var(--state)) 0 0.24rem,
        color-mix(in srgb, var(--state-tone, var(--state)) 55%, var(--terra-text-primary)) 0.24rem 0.3rem, transparent 0.32rem);
}

html .XLookUpEdit input[data-terra-state][style*="background-color"] {
    padding-left: 0.95rem !important;
    background: var(--terra-state-dot) no-repeat !important;
    color: var(--terra-text-primary);
}

    /* Its dropdown's rows the same: a dot in the row's colour before the text, not the text filled with it */
    html [dropselector][data-terra-state] {
        margin-left: 0 !important;
        padding-inline: 0.95rem 0 !important;
        border-radius: 0 !important;
        background: var(--terra-state-dot) no-repeat !important;
        color: var(--terra-text-primary);
    }

/* A memo (XMemo): the fields' text, 0.7rem from the edge, under its floated label (DevExpress's textarea padding of
   0.25rem won over app.css's 15px, so the label sat on the first line) */
html .XMemo.dxbl-memo-edit > textarea {
    margin: 0;
    padding: 0.5rem 0.7rem !important;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
}

    html div:has(> .ui_input-label.ui_placeholder) > .XMemo.dxbl-memo-edit > textarea {
        padding-top: 1.1rem !important;
    }

/* A required field (the X* controls' *Required class): Terra Logistics' tick - a 3px accent bar inside the field's left
   edge, 0.55rem from its top and 1.65rem tall, rounded on its right; red while the field flashes its error, none when
   it is disabled. app.css drew a 2px left border instead: on the input of a text, number or date field (square inside
   the rounded box) and on the outer block of a lookup, memo or colour field (outside the box) - taken off here. */
html :is(.XTextEditRequired, .xSpinEditRequired, .XDatePickerRequired) input {
    border-left: 0 !important;
    border-radius: 0 !important;
}

html :is(.XLookUpEditRequired, .XMemoRequired, .XColorPalleteRequired) {
    border-left: 0 !important;
}

html :is(.XTextEditRequired, .xSpinEditRequired, .XDatePickerRequired, .XMemoRequired).dxbl-text-edit::before,
html .XLookUpEditRequired > div:first-child::before,
html .XColorPalleteRequired::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0.55rem;
    left: 0;
    width: 3px;
    height: 1.65rem;
    border-radius: 0 3px 3px 0;
    background-color: var(--terra-primary);
    pointer-events: none;
    transition: background-color 0.12s ease;
}

    /* The lookup's and the colour field's box sits in their block: the tick goes inside its 1px line */
    html .XLookUpEditRequired > div:first-child::before,
    html .XColorPalleteRequired::before {
        left: 1px;
    }

    html .XMemoRequired.dxbl-text-edit {
        position: relative;
    }

    /* Filled: the tick pales to the accent's line (the editors' scripts mark an input holding a value with
       data-terra-filled - window.terraTrackFilled, GlobalXTextEdit.js; a lookup counts once it holds a row's ID) */
    html :is(.XTextEditRequired, .xSpinEditRequired, .XDatePickerRequired, .XMemoRequired).dxbl-text-edit:has([data-terra-filled])::before,
    html .XLookUpEditRequired > div:first-child:has([data-terra-filled])::before {
        background-color: var(--terra-primary-line);
    }

    html :is(.XTextEditRequired, .xSpinEditRequired, .XDatePickerRequired, .XMemoRequired).dxbl-text-edit:has(.red-border-xTextEdit)::before,
    html .XLookUpEditRequired > div:first-child:has(.red-border-xTextEdit)::before,
    html .XColorPalleteRequired:has(.red-border-xColorPallete, .red-border-xColorPallet)::before {
        background-color: var(--terra-danger);
    }

    html :is(.XTextEditRequired, .xSpinEditRequired, .XDatePickerRequired, .XMemoRequired).dxbl-text-edit.dxbl-disabled::before,
    html .XLookUpEditRequired > div:first-child:has(> .dxbl-disabled)::before {
        display: none;
    }

/* ---- Field groups (FormInputCard: a .card with an h6.card-subtitle title) -------------------------------------------
   Terra Logistics' form section: a panel with a hairline and rounder corners, its title small, uppercase and spaced, in
   label ink. */
html .card:has(> .card-content-wrapper) {
    border: 1px solid var(--terra-border);
    border-radius: var(--terra-radius-md);
    background-color: var(--terra-bg-surface);
}

    html .card-content-wrapper .card-subtitle.text-muted {
        color: var(--terra-text-label) !important;
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    /* Rows of fields stacked in one group (a ContentSpannedGroup per row, as Žaliavų keitimas has): the same gap between
       the rows as between the fields of a row, instead of the rows touching */
    html .card-content-wrapper > .inputcard-contentspannedgroup + .inputcard-contentspannedgroup {
        margin-top: 7px;
    }

/* ---- Lists (ListFull's grid .ui_dxdatagrid and TreeListFull's tree list) ------------------------------------------------------------------------
   Hairlines between rows and none between cells, the header on the deep surface in label ink, semibold, the hovered
   row in the accent's wash. */

/* The list's frame: a hairline (app.css draws it #dfdfdf and in dark mode recolours only its top) */
html .ListFullWrapper {
    border-color: var(--terra-border);
}

/* A cell or text that opens something (app_a-color4; ListFull writes it inline as var(--terra-text-link, #009efb)) */
html .app_a-color4 {
    color: var(--terra-text-link);
}

html :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) {
    --dxbl-grid-bg: var(--terra-bg-grid);
    --dxbl-grid-color: var(--terra-text-primary);
    --dxbl-grid-border-color: var(--terra-border);
    --dxbl-grid-fixed-column-border-color: var(--terra-border);
    --dxbl-grid-border-radius: 0.6rem;
}

/* Terra Logistics' frame: a hairline with 0.6rem corners around the header and the rows only, filling the list's
   height, on the grid surface (raised over the sheet in the dark theme); the group panel's hint above it and the pager
   under it, outside. DevExpress's scroll viewer carries the frame and clips the header's corners. (app.css frames the
   whole grid, group panel and pager included, with !important.) */
html body :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background-color: transparent;
    font-size: 0.875rem;
}

    html body :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) > .dxbl-scroll-viewer {
        flex: 1 1 auto;
        min-height: 0;
        border: 1px solid var(--terra-border);
        border-radius: 0.6rem;
        background-color: var(--terra-bg-grid);
    }

        /* Short of rows, app.css shrinks the scroll area to the table (the table keeps its rows' height - DevExpress's
           100% filler row flipped scrolling on and off), and the frame hugs it: the totals row right on the frame's
           bottom edge and the pager under it, the list's spare height below, outside the frame. (It filled the list,
           as in Terra Logistics, which left a gap between the totals and the frame's edge - review 2026-11-17,
           UI_LOOK_DECISIONS.md 3c.) A list long enough to scroll still fills the height. */
        html body :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list):has(> .dxbl-scroll-viewer .dxbl-grid-table-no-scroll) > .dxbl-scroll-viewer {
            flex: 0 1 auto !important;
        }

    html body :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) > .dxbl-grid-bottom-panel {
        padding-top: 0.5rem !important;
        border-top: 0 !important;
    }

    html body :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) :is(th, td) {
        font-size: 0.875rem !important;
        line-height: 1.43;
    }

    /* Terra Logistics' cells: the text 0.375rem from the column's edge, the header 0.5rem and a row 0.25rem over and
       under it; the header 41px and a row at least 39px high, as Terra Logistics' with its 2rem row buttons (a cell's
       height here counts its padding). app.css gives every cell 1rem sides, no top and bottom and 2rem height with a
       long !important selector; :not(#_) makes these win (an id's weight) on the same cells. */
    html body :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) .dxbl-grid-table > :is(thead, tfoot) > tr > th:not(.dxbl-grid-header-indent-cell, .dxbl-grid-empty-header):not(#_) {
        height: 2.93rem;
        padding: 0.5rem 0.375rem !important;
    }

    html body :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) .dxbl-grid-table > :is(tbody, tfoot) > tr:not(.dxbl-grid-edit-row, .dxbl-grid-empty-row, .dxbl-grid-filter-row, .dxbl-grid-group-row, [dxbl-top-virtual-spacer-element], [dxbl-bottom-virtual-spacer-element]) > td:not(.dxbl-grid-indent-cell, .dxbl-grid-expand-button-cell, .dxbl-grid-empty-cell, .dxbl-grid-empty-data-area, .dxbl-grid-edit-form, .dxbl-grid-detail-cell):not(#_) {
        height: 2.8rem;
        padding: 0.25rem 0.375rem !important;
    }

    /* A column's filter funnel in the header's label ink, as its caption (the outline button's own ink is the text's) */
    html body :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) thead .dxbl-grid-filter-menu-funnel-btn {
        --dxbl-btn-color: var(--terra-text-label);
        color: var(--terra-text-label);
    }

    /* An image column's measuring step (app.css) takes the cell's two sides off its stored width: now 0.375rem each */
    html body :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) .dxbl-grid-table.dxbl-grid-table-content-fit-calc .listfull-image-cell::before {
        width: calc(var(--listfull-image-width) - 0.75rem - 1px);
    }

    /* "Drag a column header here to group": a quiet line, not a box */
    html body :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) .dxbl-grid-group-panel-container {
        color: var(--terra-text-muted);
        font-size: 0.8rem;
    }

    /* The pager: small separate buttons (23px, Terra Logistics' pager-container), the open page in the accent's wash */
    html body :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) .dxbl-pager {
        align-items: center;
        gap: 0.25rem;
    }

        html body :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) .dxbl-pager > .dxbl-btn,
        html body :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) .dxbl-pager .dxbl-pager-page-buttons > .dxbl-btn {
            min-width: 23px;
            height: 23px !important;
            min-height: 23px;
            margin: 0 !important;
            padding: 0.1875rem 0.25rem;
            border-radius: 0.5rem !important;
            font-size: 0.75rem;
        }

        html body :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) .dxbl-pager .dxbl-text-edit {
            height: 23px;
            min-height: 23px;
            border-radius: 0.5rem;
            font-size: 0.75rem;
        }

    /* The theme draws a cell's left border in the grid's line colour (app.css carries a copy of that rule) */
    html :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) .dxbl-grid-table > tbody > tr > td {
        border-left-color: transparent;
    }

    html :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list).dxbl-grid .dxbl-grid-table > thead .dxbl-grid-header-row > th:not(.dxbl-grid-empty-cell) {
        background-color: var(--terra-bg-surface-deep);
        color: var(--terra-text-label);
        font-weight: 600;
    }

    /* blazing-berry (an older DevExpress theme ERP still loads) lays a 5% black layer under every header cell. A pinned
       cell (the edit and tick columns) is its own stacking layer, so there the layer comes on top and darkens it;
       Terra Logistics has no such layer. */
    html :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list).dxbl-grid .dxbl-grid-table > thead .dxbl-grid-header-row > th::before {
        content: none;
    }

    /* A record's code that opens it: the link colour (Bootstrap's own blue is 2.9:1 on white) */
    html :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) tbody a {
        color: var(--terra-text-link);
    }

    html:root :is(.ui_dxdatagrid, .ui_dxdatagrid-container dxbl-tree-list) tbody tr:hover {
        --dxbl-grid-bg: var(--terra-primary-wash);
        background-color: var(--terra-primary-wash) !important;
    }

/* ---- A state's colour, toned for the theme ---------------------------------------------------------------------------
   The colours come from the database, many of them loud and pale (a light yellow): on white they hardly show, and they
   glare. --state-tone is the same colour with its lightness held inside the theme's range (oklch: hue and chroma kept):
   a too-light one darker on the light theme, a too-dark one lighter on the dark theme. The pills, their dots, the
   state chips and the lookups' dots below draw with it; a browser without relative colours keeps --state as given. */
html:root:root {
    --terra-state-l-min: 0;
    --terra-state-l-max: 0.7;
}

html:root:root.erp-dark {
    --terra-state-l-min: 0.62;
    --terra-state-l-max: 1;
}

@supports (color: oklch(from red l c h)) {
    html :is(.dxbl-grid td[class^="COLOR"] > span, .dxbl-grid td[class*=" COLOR"] > span, .list-stats-panel .list-stats-badge,
        .list-stats-panel .list-stats-mix-counts i, .state-pill, .ui_input-chip.has-state,
        .XLookUpEdit input[data-terra-state], [dropselector][data-terra-state]) {
        --state-tone: oklch(from var(--state, var(--terra-border-strong)) clamp(var(--terra-state-l-min), l, var(--terra-state-l-max)) c h);
    }
}

/* The record header's / gallery's state pill and a lookup's chosen states (components.css draws them from --state) */
html .state-pill,
html .ui_input-chip.has-state {
    border-color: color-mix(in srgb, var(--state-tone, var(--state)) 70%, var(--terra-bg-surface));
    background-color: color-mix(in srgb, var(--state-tone, var(--state)) 18%, var(--terra-bg-surface));
    color: color-mix(in srgb, var(--state-tone, var(--state)) 25%, var(--terra-text-primary));
}

    html .state-pill::before {
        background-color: var(--state-tone, var(--state));
    }

/* ---- State pills (Terra Logistics' StateBadge, .state-pill) ---------------------------------------------------------
   A cell a list paints with a colour from the database (a state, a priority: ListFull's generated COLOR… class on the
   cell, from RegisterCellColorRule / GenerateSpanCssClass) and the states of the stats strip over a list
   (ListStatsPanel's .list-stats-badge) are pills: a dot in the colour, the pill a wash of it with a border and text
   mixed from it and the ink, so pale and loud colours read alike and the text stays readable in the dark theme. The
   colour comes as --state; without one the pill is grey. Never set --state here: it would beat the generated rule. */
html .dxbl-grid td:is([class^="COLOR"], [class*=" COLOR"]) > span,
html .list-stats-panel .list-stats-badge {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    padding: 0.1rem 0.6rem 0.1rem 0.45rem;
    border: 1px solid color-mix(in srgb, var(--state-tone, var(--state, var(--terra-border-strong))) 70%, var(--terra-bg-surface));
    border-radius: 999px;
    background: color-mix(in srgb, var(--state-tone, var(--state, var(--terra-border-strong))) 18%, var(--terra-bg-surface));
    color: color-mix(in srgb, var(--state-tone, var(--state, var(--terra-text-muted))) 25%, var(--terra-text-primary));
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: 1.5;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

    html .dxbl-grid td:is([class^="COLOR"], [class*=" COLOR"]) > span::before,
    html .list-stats-panel .list-stats-badge::before {
        display: inline-block;
        width: 0.5rem;
        height: 0.5rem;
        margin-right: 0.4rem;
        border-radius: 50%;
        background: var(--state-tone, var(--state, var(--terra-text-muted)));
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--terra-shadow-ink) 18%, transparent);
        content: "";
        vertical-align: 0.02em;
    }

/* The stats strip (between the action panel and the grid, in the list's frame): its lines in the hairline (app.css
   draws them #dfdfdf, bright in the dark theme) */
html .list-stats-panel {
    border-color: var(--terra-border);
}

    html .list-stats-panel .list-stats-divider {
        background: var(--terra-border);
    }

/* The stats strip: each state's pill with its count inside it */
html .list-stats-panel .list-stats-state {
    gap: 0.4rem;
}

    html .list-stats-panel .list-stats-badge-count {
        color: var(--terra-text-primary);
        font-variant-numeric: tabular-nums;
    }

/* The states as one block (ListStatsPanel's .list-stats-mix, drawn only with the look: Terra Logistics' StateMix): a bar
   of the states in their colours, each as long as its share, and each one's count under it with a dot of its colour.
   Wider than a count's block; many states wrap their counts. */
html .list-stats-panel .list-stats-mix {
    flex: 0 1 14rem;
    min-width: 9rem;
}

    /* (the strip's blocks all as high as the highest, as Terra Logistics' summary tiles) */
    html .list-stats-panel > .list-stats-tile {
        align-self: stretch;
    }

html .list-stats-panel .list-stats-mix-bar {
    display: flex;
    gap: 2px;
    height: 0.45rem;
    margin-top: 0.3rem;
}

    html .list-stats-panel .list-stats-mix-bar > span {
        flex: 1 1 0;
        min-width: 3px;
        border-radius: 999px;
        background: var(--seg, var(--terra-border-strong));
    }

html .list-stats-panel .list-stats-mix-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem 0.6rem;
    margin: 0.25rem 0 0.1rem;
    color: var(--terra-text-body);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: 1.4;
}

    html .list-stats-panel .list-stats-mix-counts > span {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
    }

    html .list-stats-panel .list-stats-mix-counts i {
        width: 0.5rem;
        height: 0.5rem;
        border-radius: 50%;
        background: var(--state-tone, var(--state, var(--terra-text-muted)));
    }

/* ---- Tabs (DxTabs: a form's and a list's tabs) ----------------------------------------------------------------------
   A line of names on a hairline, the open one in ink, semibold and underlined in the accent, the others lighter in label
   ink, instead of grey folder tabs (app.css draws those with !important). The underline is an inset shadow inside the
   tab, not a bottom border: DevExpress's scroll viewer clips the tab's last 1-2px, which hid a border underline. */

/* An inactive tab's content stays out of sight. DevExpress hides it with inline styles (off-screen, hidden); a re-render
   while the next tab loads drops them for a moment, and the previous tab showed again under the new tab's name
   (Pardavimo dokumentai: Pardavimo pozicijos > Pagrindinė informacija > Pardavimo pozicijos). The same hiding, kept. */
html .dxbl-tabs-content-panel > .dxbl-tabs-content:not(.dxbl-active) {
    position: absolute !important;
    top: -10000px !important;
    left: -10000px !important;
    visibility: hidden !important;
}

html .dxbl-tabs .dxbl-scroll-viewer-content ul {
    border-bottom: 0 !important;
    box-shadow: inset 0 -1px 0 var(--terra-border);
}

html .dxbl-tabs .dxbl-tabs-item:is(.dxbl-active, :not(.dxbl-active)) {
    border: 0 !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    box-shadow: none;
    color: var(--terra-text-label) !important;
    font-weight: 500;
}

    html .dxbl-tabs .dxbl-tabs-item.dxbl-active {
        box-shadow: inset 0 -3px 0 var(--terra-primary);
        color: var(--terra-text-primary) !important;
        font-weight: 600;
    }

    html .dxbl-tabs .dxbl-tabs-item:not(.dxbl-active):not(.DisabledXTab):hover {
        box-shadow: inset 0 -2px 0 var(--terra-border-strong);
        color: var(--terra-text-primary) !important;
    }

    /* A tab just clicked keeps focus: DevExpress's focus rules (more specific) dropped the underline for a dotted
       outline until the focus moved elsewhere. Focused, the open tab keeps its underline; a click shows no outline
       (the tab list carries data-dx-focus-hidden then), the keyboard the accent ring - inside the tab, past the clip. */
    html .dxbl-tabs > .dxbl-tabs-tablist .dxbl-tabs-item:is(:focus, :focus-visible) {
        outline: none !important;
    }

    html .dxbl-tabs > .dxbl-tabs-tablist .dxbl-tabs-item.dxbl-active:is(:focus, :focus-visible) {
        box-shadow: inset 0 -3px 0 var(--terra-primary) !important;
    }

    html .dxbl-tabs > .dxbl-tabs-tablist:not([data-dx-focus-hidden]) .dxbl-tabs-item:focus-visible {
        outline: 2px solid var(--terra-primary) !important;
        outline-offset: -2px;
    }

    /* DevExpress's own bar under the open tab (app.css paints it white): the border above is the bar */
    html .dxbl-tabs .dxbl-tabs-item.dxbl-active::after {
        display: none !important;
    }

    html .dxbl-tabs .dxbl-tabs-item.DisabledXTab {
        color: var(--terra-text-muted) !important;
        opacity: 0.6;
    }

/* ---- Form windows (InnerFormSkeleton's .inner-form-window) ----------------------------------------------------------
   A dialog in the app's look: the surface, a hairline, rounder corners, a soft shadow; the title bar plain (no grey
   strip), a hairline under it, the title in ink, semibold. */
html .inner-form-window.ui_border-1 {
    border: 1px solid var(--terra-border) !important;
    border-radius: var(--terra-radius-lg);
    background-color: var(--terra-bg-surface) !important;
    box-shadow: 0 4px 12px var(--terra-shadow-sm), 0 18px 40px var(--terra-shadow-md);
}

    html .inner-form-window .card-header {
        border-bottom: 1px solid var(--terra-border);
        background-color: transparent;
    }

        html .inner-form-window .card-header h6 {
            color: var(--terra-text-primary);
            font-size: 1rem;
            font-weight: 700;
        }

    /* The footer (SavePanelHolder): inside the window's rounded corners (the window keeps overflow visible for its
       popups, so the footer rounds its own), under a hairline */
    html .inner-form-window .save-panel-holder {
        padding: 0.6rem 0.9rem;
        border-top: 1px solid var(--terra-border);
        border-bottom-right-radius: calc(var(--terra-radius-lg) - 1px);
        border-bottom-left-radius: calc(var(--terra-radius-lg) - 1px);
        background-color: var(--terra-bg-surface);
    }

/* The footer's buttons as Terra Logistics' (DataEdit's edit-footer): on the right, Close (neutral) then Save (the filled
   accent); a form's Print / Actions menus stay on the left. The panel lays them out as a grid of fractions; a row. */
html .innerform-savepanel > .inputcard-contentspannedgroup {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

    html .innerform-savepanel > .inputcard-contentspannedgroup > div:not(.ButtonDropdown) {
        flex: 1 1 auto;
    }

    html .innerform-savepanel > .inputcard-contentspannedgroup > .savepanel-save {
        order: 2;
    }

    html .innerform-savepanel > .inputcard-contentspannedgroup > .xbutton[data-role="SavePanelClose"] {
        flex: 0 0 auto;
        order: 1;
        width: auto !important;
    }

html .innerform-savepanel .dxbl-btn.xbutton[data-role="SavePanelClose"] {
    --dxbl-btn-bg: var(--terra-bg-surface);
    --dxbl-btn-color: var(--terra-text-body);
    --dxbl-btn-border-color: var(--terra-border);
    --dxbl-btn-hover-bg: var(--terra-bg-surface-deep);
    --dxbl-btn-hover-color: var(--terra-text-primary);
    --dxbl-btn-hover-border-color: var(--terra-border-strong);
    /* dx-bridge.css fills an outline-danger Close in red with !important: the neutral look wins here */
    background-color: var(--terra-bg-surface) !important;
    border-color: var(--terra-border) !important;
    color: var(--terra-text-body) !important;
}

    html .innerform-savepanel .dxbl-btn.xbutton[data-role="SavePanelClose"]:hover {
        background-color: var(--terra-bg-surface-deep) !important;
        border-color: var(--terra-border-strong) !important;
        color: var(--terra-text-primary) !important;
    }

/* ---- Toasts (XToast in ToastManager's .ui_toast-container) ----------------------------------------------------------
   Terra Logistics' toasts: cards stacked in the corner, tinted in their level's tone so they stand out from the page's
   white cards - the level's icon and a thick edge in the tone, the heading in ink and the message under it, a quiet
   close; along the foot a strip in the tone that runs out in the toast's DisplayTime, when it goes away (the pointer
   on the toast stops the strip and, in XToast, the time). They were filled teal, green, olive and red with white text.
   XToast's markup is the old one (the heading and its close in .ui_toast-header, the icon inside the message), so
   the icon and the close are placed on the card. */
html .ui_toast-container {
    right: 0;
    bottom: 0;
    gap: 0.5rem;
    padding: 1rem;
    pointer-events: none;
}

    html .ui_toast-container div:not(:last-child) {
        margin-bottom: 0;
    }

html .ui_toast {
    width: min(24rem, calc(100vw - 2rem));
    max-width: 100%;
    color: var(--terra-text-primary);
    pointer-events: auto;
}

html .ui_toast > :is(.ui_toast-info, .ui_toast-success, .ui_toast-warning, .ui_toast-error) {
    --tone: var(--terra-primary);
    --tone-fill: var(--tone);
    position: relative;
    padding: 0.75rem 2.95rem 0.85rem 2.5rem;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--tone-fill) 38%, var(--terra-border));
    border-left: 4px solid var(--tone-fill);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--tone-fill) 13%, var(--terra-bg-surface));
    box-shadow: 0 4px 12px var(--terra-shadow-sm), 0 18px 40px var(--terra-shadow-md);
}

html .ui_toast > .ui_toast-success {
    --tone: var(--terra-good);
}

/* The warning's tone filled is the warn colour, its icon the darker ink */
html .ui_toast > .ui_toast-warning {
    --tone: var(--terra-warning-text);
    --tone-fill: var(--terra-warning);
}

html .ui_toast > .ui_toast-error {
    --tone: var(--terra-danger);
}

html .ui_toast .ui_toast-header {
    position: static;
    display: block;
    min-height: 0;
    padding: 0;
    color: var(--terra-text-primary);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.43;
}

html .ui_toast .ui_toast-message {
    position: static;
    padding: 0;
    overflow: visible;
    color: var(--terra-text-body);
    font-size: 0.82rem;
    line-height: 1.4;
    word-break: normal;
    overflow-wrap: anywhere;
}

/* The level's icon on the left, in the tone; Font Awesome's round ones, as Terra Logistics' */
html .ui_toast .ui_toast-icon {
    top: 0.8rem;
    right: auto;
    left: 0.85rem;
    display: block;
    width: 1rem;
    height: auto;
    color: var(--tone);
    font-size: 1rem;
    line-height: 1.2;
    text-align: center;
}

html .ui_toast > .ui_toast-info .ui_toast-icon i::before {
    content: "\f05a";
}

html .ui_toast > .ui_toast-success .ui_toast-icon i::before {
    content: "\f058";
}

html .ui_toast > .ui_toast-warning .ui_toast-icon i::before {
    content: "\f071";
}

html .ui_toast > .ui_toast-error .ui_toast-icon i::before {
    content: "\f06a";
}

/* Close: a small ghost icon button at the top right (an x of Font Awesome's, as the other buttons) */
html .ui_toast .ui_toast-close {
    top: 0.45rem;
    right: 0.45rem;
    display: grid;
    place-items: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.5rem;
    color: var(--terra-text-muted);
    font-size: 0.78rem;
}

    html .ui_toast .ui_toast-close:hover {
        background: color-mix(in srgb, var(--terra-shadow-ink) 6%, transparent);
        color: var(--terra-text-primary);
    }

    html .ui_toast .ui_toast-close svg {
        display: none;
    }

    html .ui_toast .ui_toast-close-icon::before {
        font-family: "Font Awesome 6 Free";
        font-style: normal;
        font-weight: 900;
        content: "\f00d";
    }

/* The time left: full when it comes, empty when it goes */
html .ui_toast .ui_toast-timer {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--tone-fill);
    transform-origin: left center;
    animation: terra_toast-countdown var(--toast-time, 5s) linear forwards;
}

html .ui_toast:hover .ui_toast-timer {
    animation-play-state: paused;
}

@keyframes terra_toast-countdown {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (min-width: 768px) {
    html .ui_toast-container {
        right: 1rem;
        bottom: 1rem;
    }

    html .ui_toast {
        width: 20rem;
    }
}

/* ---- Rampų kalendorius (LogisticsLists/RampCalendar.razor, .ramp-calendar) and its scheduler (TerraScheduler, .tsch) --
   The page draws with its own --gantt-* variables and the scheduler with --tsch-* (terra-scheduler.css, loaded later by
   TerraLazy.js - hence "html body", one step more specific than its html.erp-dark rules): both from the tokens here, so
   light and dark follow the look. Scoped to the ramp page; the Gantt (GanttViewOrder3) shares the classes and comes next.
   The shipments' own colours (direction, a state from the database) stay data. */
html body .ramp-calendar:is(.gantt-main, .gantt-filter-panel) {
    --gantt-surface: var(--terra-bg-surface);
    --gantt-border: var(--terra-border);
    --gantt-muted-bg: var(--terra-bg-surface-deep);
    --gantt-text: var(--terra-text-primary);
    --gantt-text-muted: var(--terra-text-muted);
    --gantt-accent: var(--terra-primary);
}

html body .ramp-calendar .tsch {
    --tsch-bg: var(--terra-bg-surface);
    --tsch-header-bg: var(--terra-bg-surface-header);
    --tsch-header-text: var(--terra-text-label);
    --tsch-header-strong: var(--terra-text-primary);
    --tsch-border: var(--terra-border);
    --tsch-line: var(--terra-border-subtle);
    --tsch-line-major: var(--terra-border);
    --tsch-text: var(--terra-text-primary);
    --tsch-muted: var(--terra-text-muted);
    --tsch-accent: var(--terra-primary);
    --tsch-link: var(--terra-text-link);
    --tsch-row-hover: color-mix(in srgb, var(--terra-primary) 5%, transparent);
    --tsch-weekend: color-mix(in srgb, var(--terra-text-primary) 3%, transparent);
    --tsch-drop: color-mix(in srgb, var(--terra-primary) 9%, transparent);
    --tsch-load-track: var(--terra-bg-raised);
    --tsch-load-full: var(--terra-success);
    --tsch-load-over: var(--terra-danger);
    --tsch-incapable: var(--terra-bg-raised);
    --tsch-shadow: var(--terra-shadow-md);
    font-family: var(--terra-font);
}

/* ---- Kanban (CalendarLists/Kanban.razor; css/kanban.css) -------------------------------------------------------------
   The board draws with its own --kanban-* variables (kanban.css on :root, dark twins in dx-bridge.css on html.erp-dark):
   here from the tokens, one rule for light and dark ("html:root:root" outranks both). What its page style block and
   kanban.css hard-code - white surfaces, hairlines, the accent #2E5EAA, the done green - follows; "html body" outranks
   the page's own style block, which comes after this file. The activity-type chips and the database's status dots stay
   their own colours (data). */
html:root:root {
    --kanban-page-bg: var(--terra-bg-page);
    --kanban-card-bg: var(--terra-bg-surface);
    --kanban-cell-bg: color-mix(in srgb, var(--terra-bg-surface) 45%, transparent);
    --kanban-cell-bg-hover: color-mix(in srgb, var(--terra-bg-surface) 85%, transparent);
    --kanban-border: var(--terra-border);
    --kanban-grid-line: var(--terra-border-strong);
    --kanban-accent: var(--terra-primary);
    --kanban-text: var(--terra-text-primary);
    --kanban-text-muted: var(--terra-text-muted);
    --kanban-shadow: 0 1px 2px var(--terra-shadow-sm), 0 1px 3px var(--terra-shadow-md);
    --kanban-shadow-hover: 0 8px 20px var(--terra-shadow-md), 0 2px 6px var(--terra-shadow-sm);
    --kanban-shadow-drag: 0 16px 32px var(--terra-shadow-md), 0 4px 8px var(--terra-shadow-md);
}

html body .kanban-board {
    border-color: var(--terra-border);
}

html body :is(.kanban-swimlanes-scroll, .kanban-mode-board .kanban-board-lane .kanban-column-body) {
    scrollbar-color: var(--terra-border-strong) transparent;
}

    html body :is(.kanban-swimlanes-scroll, .kanban-mode-board .kanban-board-lane .kanban-column-body)::-webkit-scrollbar-thumb {
        background: var(--terra-border-strong);
    }

/* Surfaces: the filter panel, the lane labels outside the board mode, column headers, the view toggle */
html body :is(.kanban-filter-panel, .kanban-board:not(.kanban-mode-board) .kanban-lane-label, .kanban-column-header, .kanban-view-toggle) {
    border-color: var(--terra-border);
    background: var(--terra-bg-surface);
}

html body .kanban-lane-cards-collapsed {
    background: linear-gradient(100deg, var(--terra-bg-raised) 30%, var(--terra-bg-surface-deep) 50%, var(--terra-bg-raised) 70%);
}

html body .kanban-lane-label-clickable:hover .kanban-lane-caret {
    background: var(--terra-bg-hover);
    color: var(--terra-text-primary);
}

/* Counts and small plates */
html body :is(.kanban-lane-count, .kanban-collapsed-count, .kanban-column-count, .kb-card-avatar-more) {
    background: var(--terra-bg-raised);
    color: var(--terra-text-label);
}

html body :is(.kanban-lane-avatar, .kb-card-avatar) {
    border-color: var(--terra-bg-surface);
}

html body .kanban-column-more {
    border-color: var(--terra-border-strong);
    background: var(--terra-bg-surface-deep);
}

    html body .kanban-column-more:hover {
        border-color: var(--terra-primary);
        background: var(--terra-primary-wash);
        color: var(--terra-primary-ink);
    }

/* A card's details */
html body .kb-card-cover {
    background: var(--terra-bg-surface-deep);
}

html body :is(.kb-card-date, .kb-card-attach, .kb-card-checklist, .kanban-col-grip) {
    color: var(--terra-text-muted);
}

html body .kb-card-desc::before {
    background: var(--terra-border-strong);
}

html body .kb-card-checklist-done {
    background: var(--terra-success);
    color: var(--terra-on-primary);
}

html body .kb-card-progress {
    background: var(--terra-bg-raised);
}

html body .kb-card-progress-bar {
    background: var(--terra-border-strong);
}

html body .kb-card-progress-done {
    background: var(--terra-success);
}

html body .kanban-card-slot:hover .kanban-card {
    border-color: var(--terra-border-strong);
}

html body .kb-card-footer {
    border-top-color: var(--terra-border-subtle);
}

/* The accent: a column dragged over, the add / collapse buttons, the view toggle's open view */
html body .kanban-column-draggable.col-dragover {
    background: var(--terra-primary-wash);
    box-shadow: inset 3px 0 0 0 var(--terra-primary);
}

html body :is(.kanban-column-add-btn, .kanban-column-collapse-btn):hover {
    background: var(--terra-primary);
    color: var(--terra-on-primary);
}

html body .kanban-view-toggle .kvt {
    color: var(--terra-text-label);
}

    html body .kanban-view-toggle .kvt:hover {
        background: var(--terra-bg-hover);
        color: var(--terra-text-primary);
    }

    html body .kanban-view-toggle .kvt.active {
        background: var(--terra-primary);
        color: var(--terra-on-primary);
    }

/* ---- Dashboards ----------------------------------------------------------------------------------------------------
   The home dashboards (DashboardPanel and its views): tiles and cards as the look's sheets, a tile's icon, its
   problem line as a tag and a share as a ring (DashboardKpiTile Icon / Ring), the order stages as a state path, and
   the "needs attention" column (DashboardAttention) beside the cards. html:root:root outweighs the .erp-dark
   .Dashboard* overrides in app.css; the colours come from the tokens, so light and dark need no rules of their own. */

/* One card across the row (Cechas with a single bar: DashboardWorkshopView sizes its grid by the number of bars) */
.DashboardCols1 {
    grid-template-columns: minmax(0, 1fr);
}

html:root:root .DashboardCard,
html:root:root .DashboardKpi {
    background: var(--terra-bg-surface);
    border: 1px solid var(--terra-border);
    border-radius: var(--terra-radius-lg);
    box-shadow: 0 1px 2px var(--terra-shadow-sm);
    color: var(--terra-text-primary);
}

html:root:root .DashboardCardHeader h2,
html:root:root .DashboardKpiLabel {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--terra-text-label);
}

html:root:root .DashboardCardSubtitle,
html:root:root .DashboardKpiSub,
html:root:root .DashboardKpiDelta,
html:root:root .DashboardMuted {
    color: var(--terra-text-muted);
}

html:root:root .DashboardLink {
    color: var(--terra-text-link);
}

    html:root:root .DashboardLink:hover {
        color: var(--terra-primary-hover);
    }

/* A stopped bar's red header: its action ("Baigti prastovą") in the header's own text colour, as a small outlined
   button - the link blue above was unreadable on the red */
html:root:root .DashboardStatusAlert .DashboardBarCardAction {
    padding: 0.15rem 0.6rem;
    border: 1px solid color-mix(in srgb, currentColor 70%, transparent);
    border-radius: var(--terra-radius-pill);
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

    html:root:root .DashboardStatusAlert .DashboardBarCardAction:hover {
        border-color: currentColor;
        background-color: color-mix(in srgb, currentColor 15%, transparent);
        color: inherit;
    }

html:root:root .DashboardKpi {
    position: relative;
    gap: 0.35rem;
    padding: 0.9rem 1.1rem;
}

    html:root:root .DashboardKpi.DashboardClickable:hover {
        border-color: var(--terra-border-strong);
        box-shadow: 0 2px 8px var(--terra-shadow-md);
    }

html:root:root .DashboardKpiLabelIcon {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

html:root:root .DashboardKpiIcon {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: var(--terra-radius-sm);
    background: var(--terra-bg-raised);
    color: var(--terra-text-label);
    font-size: 0.8rem;
    letter-spacing: 0;
}

    html:root:root .DashboardKpiIcon.is-bad {
        background: var(--terra-danger-bg);
        color: var(--terra-danger-text);
    }

    html:root:root .DashboardKpiIcon.is-warn {
        background: var(--terra-warning-bg);
        color: var(--terra-warning-text);
    }

html:root:root .DashboardKpiValue {
    font-size: 1.85rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    color: var(--terra-text-primary);
}

/* The problem line (late, overdue) as a tag; good news as a green one */
html:root:root .DashboardKpiDelta.DashboardBad,
html:root:root .DashboardKpiDelta.DashboardGood,
html:root:root .DashboardStageLate.DashboardBad {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: var(--terra-radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

html:root:root .DashboardKpiDelta.DashboardBad,
html:root:root .DashboardStageLate.DashboardBad {
    background: var(--terra-danger-bg);
    border: 1px solid color-mix(in srgb, var(--terra-danger) 25%, transparent);
    color: var(--terra-danger-text) !important;
}

html:root:root .DashboardKpiDelta.DashboardGood {
    background: var(--terra-success-bg);
    border: 1px solid color-mix(in srgb, var(--terra-success) 25%, transparent);
    color: var(--terra-success-text) !important;
}

html:root:root .DashboardKpiRing {
    position: absolute;
    top: 0.9rem;
    right: 1rem;
}

/* Order stages as a state path: no proportional bar, a dot per stage joined by a line */
html:root:root .DashboardStack:has(+ .DashboardStages) {
    display: none;
}

html:root:root .DashboardStages {
    gap: 0.25rem;
}

html:root:root .DashboardStage {
    gap: 0.3rem;
    color: var(--terra-text-primary);
}

    html:root:root .DashboardStage.DashboardClickable:hover {
        background: var(--terra-bg-hover);
    }

html:root:root .DashboardStageName {
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--terra-text-secondary);
}

    html:root:root .DashboardStageName .DashboardSwatch {
        width: 0.8rem;
        height: 0.8rem;
        border-radius: 50%;
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--terra-primary) 12%, transparent);
    }

html:root:root .DashboardStageCount {
    font-size: 1.55rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    color: var(--terra-text-primary);
}

html:root:root .DashboardStageArrow {
    flex: 0 0 1.25rem;
    align-self: flex-start;
    height: 2px;
    margin-top: 1rem;
    padding: 0;
    background: var(--terra-primary-line);
}

    html:root:root .DashboardStageArrow svg {
        display: none;
    }

/* Parts of a whole (ageing): a rounded bar and hairline rows */
html:root:root .DashboardStack {
    height: 0.85rem;
    overflow: hidden;
    border-radius: var(--terra-radius-pill);
    background: var(--terra-bg-raised);
}

    html:root:root .DashboardStack span {
        border-radius: 0;
    }

html:root:root .DashboardStackRow,
html:root:root .DashboardTable td {
    border-bottom-color: var(--terra-border-subtle);
    color: var(--terra-text-primary);
}

html:root:root .DashboardTable th {
    background: var(--terra-bg-surface-header);
    border-bottom-color: var(--terra-border);
    color: var(--terra-text-label);
}

html:root:root .DashboardCardFooter {
    border-top-color: var(--terra-border-subtle);
    color: var(--terra-text-muted);
}

/* The "needs attention" column beside the cards, as tall as they are (a shorter list left an empty strip under it);
   on a phone it goes first, full width */
.DashboardAttentionLayout {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 1rem;
}

.DashboardAttentionMain {
    display: flex;
    flex: 999 1 560px;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.DashboardLookCols2 {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.DashboardAttention {
    display: flex;
    flex: 1 1 300px;
    flex-direction: column;
    gap: 0.6rem;
    box-sizing: border-box;
    padding: 1rem;
    background: var(--terra-bg-surface);
    border: 1px solid var(--terra-border);
    border-radius: var(--terra-radius-lg);
    box-shadow: 0 1px 2px var(--terra-shadow-sm);
}

/* Beside the cards it keeps to a column; in a grid cell (Mano darbas) it fills the cell */
.DashboardAttentionLayout > .DashboardAttention {
    max-width: 380px;
}

@media (max-width: 767.98px) {
    .DashboardAttentionLayout > .DashboardAttention {
        max-width: none;
    }
}

.DashboardAttentionHead {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

    .DashboardAttentionHead h2 {
        margin: 0;
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--terra-text-label);
    }

.DashboardAttentionGroup {
    margin: 0.35rem 0 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--terra-text-muted);
}

.DashboardAttentionEmpty {
    margin: 0;
    font-size: 0.82rem;
    color: var(--terra-text-muted);
}

.DashboardAttentionItem {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    box-sizing: border-box;
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--terra-border);
    border-radius: var(--terra-radius-md);
    background: var(--terra-bg-surface);
    font: inherit;
    text-align: left;
    color: var(--terra-text-primary);
}

    .DashboardAttentionItem.is-bad {
        background: var(--terra-danger-bg);
        border-color: color-mix(in srgb, var(--terra-danger) 25%, transparent);
    }

    .DashboardAttentionItem.is-warn {
        background: var(--terra-warning-bg);
        border-color: color-mix(in srgb, var(--terra-warning) 35%, transparent);
    }

button.DashboardAttentionItem {
    cursor: pointer;
}

    button.DashboardAttentionItem:hover {
        border-color: var(--terra-border-strong);
        box-shadow: 0 2px 8px var(--terra-shadow-md);
    }

/* Marker: a square for critical, a triangle for a warning, a circle for a note - shape and colour together */
.DashboardAttentionMark {
    flex: none;
    width: 0.55rem;
    height: 0.55rem;
    margin-top: 0.35rem;
    border-radius: 50%;
    background: var(--terra-text-muted);
}

.is-bad > .DashboardAttentionMark {
    border-radius: 2px;
    background: var(--terra-danger);
}

.is-warn > .DashboardAttentionMark {
    width: 0.65rem;
    border-radius: 0;
    background: var(--terra-warning-text);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.DashboardAttentionText {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.DashboardAttentionTitle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.86rem;
    font-weight: 600;
}

.is-bad .DashboardAttentionTitle {
    color: var(--terra-danger-text);
}

.is-warn .DashboardAttentionTitle {
    color: var(--terra-warning-text);
}

.DashboardAttentionDetail {
    font-size: 0.78rem;
    color: var(--terra-text-body);
}

.DashboardAttentionLink {
    flex: none;
    font-size: 0.78rem;
    white-space: nowrap;
    color: var(--terra-text-link);
}

/* Rows with meters (DashboardMeterRows): a part per row - name, meter, value, second figure */
.DashboardMeterRows {
    display: flex;
    flex-direction: column;
}

.DashboardMeterRow {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(4rem, 2fr) auto 3.5rem;
    align-items: center;
    gap: 0.75rem;
    box-sizing: border-box;
    width: 100%;
    padding: 0.5rem 0.25rem;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--terra-border-subtle);
    font: inherit;
    font-size: 0.86rem;
    text-align: left;
    color: var(--terra-text-primary);
}

    .DashboardMeterRow:last-child {
        border-bottom: 0;
    }

    button.DashboardMeterRow:hover {
        background: var(--terra-bg-hover);
    }

.DashboardMeterName {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.DashboardMeter {
    display: block;
    height: 0.6rem;
    overflow: hidden;
    border-radius: var(--terra-radius-pill);
    background: var(--terra-bg-raised);
}

    .DashboardMeter > span {
        display: block;
        height: 100%;
        min-width: 2px;
        border-radius: var(--terra-radius-pill);
    }

/* The production view's tiles beside the "needs attention" column: OEE (with its three factors) a 2 x 2 block,
   the four small tiles beside it; two columns on a narrower screen */
.DashboardLookTiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

    .DashboardLookTiles > .DashboardSpan2 {
        grid-column: span 2;
        grid-row: span 2;
    }

@media (max-width: 1199.98px) {
    .DashboardLookTiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

        .DashboardLookTiles > .DashboardSpan2 {
            grid-row: auto;
        }
}

/* ---- A record header above a list in a tab ------------------------------------------------------------------------
   A form's tab is a column of fixed height with its list taking what is left (Nurašymo aktai's lines under the
   fields). A RecordHeader on top takes that room, so the list would shrink to a sliver: with a header, the tab
   scrolls instead and its list keeps a usable height. */
.dxbl-tabs-content:has(> .rec-head) {
    overflow-y: auto;
}

    .dxbl-tabs-content:has(> .rec-head) > .ListFullLoadHost {
        flex-shrink: 0;
        min-height: 20rem;
    }

/* ---- Kalendorius (CalendarLists/Calendar.razor; its own <style> block, and components.css "calendar-week-strip") ----
   The page's style block hard-codes white surfaces, #dfdfdf hairlines, a red holiday day and a dark appointment text;
   here onto the tokens, one rule for light and dark. "html body" outranks the page's block (it comes after look.css);
   its one !important rule (the filter panel's border) needs !important here too. Font sizes are left as they are
   (Phase B). What stays data: the appointment's colour (--apt-color, the activity status's RealColor; a new one's grey),
   the priority dot's colour, and the date picker's status dots (.dot-status-1..5 mirror the statuses' colours). The
   client logo keeps its white plate on purpose (a logo stays readable on any status colour, in dark too). */
html body .SchedulerFilterFieldsPanel {
    border-color: var(--terra-border) !important;
}

/* The appointment: a tint of its status colour over the surface, the text in ink (dark: over the dark surface) */
html body .demo-sc-apt {
    --apt-surface: var(--terra-bg-surface);
    --apt-text: var(--terra-text-primary);
}

/* A holiday in the date picker */
html body .dxbl-cal-day-cell.holiday-cell {
    color: var(--terra-danger-text);
}

/* The priority dot's ring */
html body .demo-sc-apt .priority-indicator {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--terra-shadow-ink) 50%, transparent);
}

/* The phone's week strip (components.css, drawn under 768px) */
html body .calendar-week-strip button {
    border-color: var(--terra-border);
    background: var(--terra-bg-surface);
    color: var(--terra-text-primary);
}

    html body .calendar-week-strip button span:first-child {
        color: var(--terra-text-muted);
    }

    html body .calendar-week-strip button.today {
        border-color: var(--terra-primary-line);
        background: var(--terra-primary-wash);
        color: var(--terra-primary-ink);
    }

/* ---- Gamybos planavimas (ManufactoryLists/GanttViewOrder3.razor, .production-gantt) and its scheduler (TerraScheduler, .tsch) --
   The page draws with its own --gantt-* variables (light in its style block on .gantt-main, dark on html.erp-dark
   .gantt-main) and the scheduler with --tsch-* (terra-scheduler.css, loaded later by TerraLazy.js - hence "html body"):
   both from the tokens here, as the ramp calendar's section does, so light and dark follow the look. The page adds the
   production-gantt class (with the look on only) to its filter panel and to .gantt-main. What its style block still
   hard-codes - the stats' alert / warning colours, the warnings strip, the late frame, a few shadows, the calendar's
   selected range - follows below; "html body" outranks the page's own style block, which comes after this file.
   Data colours stay their own: the work states (WorkStateColour - the same palette as Operaciju suvestine's work-state
   filter), the order / product state stripes, the same-product mark palette, the time-off types, and the load chart
   (DevExpress DxChart takes System.Drawing colours, not CSS). */
html body .production-gantt:is(.gantt-main, .gantt-filter-panel) {
    --gantt-surface: var(--terra-bg-surface);
    --gantt-border: var(--terra-border);
    --gantt-border-strong: var(--terra-border-strong);
    --gantt-line: var(--terra-border-subtle);
    --gantt-muted-bg: var(--terra-bg-surface-deep);
    --gantt-text: var(--terra-text-primary);
    --gantt-text-muted: var(--terra-text-muted);
    --gantt-accent: var(--terra-primary);
}

html body .production-gantt .tsch {
    --tsch-bg: var(--terra-bg-surface);
    --tsch-header-bg: var(--terra-bg-surface-header);
    --tsch-header-text: var(--terra-text-label);
    --tsch-header-strong: var(--terra-text-primary);
    --tsch-border: var(--terra-border);
    --tsch-line: var(--terra-border-subtle);
    --tsch-line-major: var(--terra-border);
    --tsch-text: var(--terra-text-primary);
    --tsch-muted: var(--terra-text-muted);
    --tsch-accent: var(--terra-primary);
    --tsch-link: var(--terra-text-link);
    --tsch-row-hover: color-mix(in srgb, var(--terra-primary) 5%, transparent);
    --tsch-weekend: color-mix(in srgb, var(--terra-text-primary) 3%, transparent);
    --tsch-drop: color-mix(in srgb, var(--terra-primary) 9%, transparent);
    --tsch-offshift: color-mix(in srgb, var(--terra-text-muted) 14%, transparent);
    --tsch-break: color-mix(in srgb, var(--terra-warning) 28%, transparent);
    --tsch-load-track: var(--terra-bg-raised);
    --tsch-load-full: var(--terra-success);
    --tsch-load-over: var(--terra-danger);
    /* under 50 %: quiet, as the page's legend shows it with the look on (GanttViewOrder3 "Apkrova") */
    --tsch-load-idle: var(--terra-text-muted);
    --tsch-incapable: var(--terra-bg-raised);
    /* time off (the default band; its sick / vacation types keep their own colours in terra-scheduler.css) */
    --tsch-absence: color-mix(in srgb, var(--terra-warning) 18%, transparent);
    --tsch-absence-alt: color-mix(in srgb, var(--terra-warning) 7%, transparent);
    --tsch-shadow: var(--terra-shadow-md);
    font-family: var(--terra-font);
}

/* An operation past its planned end and not done: the danger token's frame, as the legend's "Vėluoja" swatch */
html body .production-gantt .tsch-event.is-late {
    outline-color: var(--terra-danger);
}

/* The view switch's open view and the load graph's lifted card: the tokens' shadows */
html body .production-gantt .gantt-segmented button.is-active {
    box-shadow: 0 1px 2px var(--terra-shadow-md), 0 0 0 1px var(--terra-shadow-sm);
}

html body .production-gantt .gantt-overlay-pane {
    box-shadow: 0 18px 40px var(--terra-shadow-md), 0 2px 6px var(--terra-shadow-sm);
}

/* The statistics strip: a count that needs attention in the danger / warning text tones */
html body .production-gantt .gantt-stat.is-alert {
    border-color: color-mix(in srgb, var(--terra-danger) 45%, var(--terra-border));
}

    html body .production-gantt .gantt-stat.is-alert .gantt-stat-value {
        color: var(--terra-danger-text);
    }

html body .production-gantt .gantt-stat.is-warn .gantt-stat-value {
    color: var(--terra-warning-text);
}

/* The legend's swatches: a hairline in ink instead of black, the late frame in the danger token */
html body .production-gantt .gantt-swatch {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--terra-text-primary) 15%, transparent);
}

html body .production-gantt .gantt-swatch.is-late {
    box-shadow: inset 0 0 0 2px var(--terra-danger);
}

/* The "outside the planning tolerance" strip: the warning tone; with none left, the success tone */
html body .production-gantt .gantt-deviations {
    border-color: color-mix(in srgb, var(--terra-warning) 55%, var(--terra-border));
    background: var(--terra-warning-bg);
}

html body .production-gantt .gantt-deviations-icon {
    color: var(--terra-warning-text);
}

html body .production-gantt .gantt-deviations.is-empty {
    border-color: color-mix(in srgb, var(--terra-success) 45%, var(--terra-border));
    background: var(--terra-success-bg);
}

    html body .production-gantt .gantt-deviations.is-empty .gantt-deviations-icon {
        color: var(--terra-success-text);
    }

/* The warnings switch's count and the strip's "Perplanuoti" (the one main action there) */
html body .production-gantt .gantt-tool-badge {
    background: var(--terra-danger);
    color: var(--terra-on-primary);
}

html body .production-gantt .gantt-action-btn.is-primary {
    border-color: var(--terra-primary);
    background: var(--terra-primary);
    color: var(--terra-on-primary);
}

    html body .production-gantt .gantt-action-btn.is-primary:hover {
        border-color: var(--terra-primary-hover);
        background: var(--terra-primary-hover);
    }

/* The legend's bar backing under the three state stripes, and the load chart's "available" line in ink */
html body .production-gantt .gantt-legend-stripes {
    background: var(--terra-border-strong);
}

html body .production-gantt .gantt-legend-line {
    border-top-color: var(--terra-text-secondary);
}

/* The date filters' calendar (a popup outside the page, so scoped by the page being open): the page painted the
   selected range darkcyan for every calendar while it was open; the accent wash instead */
html body:has(.production-gantt) .dxbl-calendar-selected-range {
    background-color: var(--terra-primary-wash) !important;
}

/* =====================================================================================================================
   g4 - look.css proposals (tokens only). Each section: what it maps, where the old colours live, and why the prefix.
   "html:root:root" (0,3,1) outranks the old rules and their html.erp-dark twins (0,2,1) in dx-bridge.css /
   components.css / app.css, and a page's own <style> block or scoped .razor.css (0,2,0), whatever their order.
   ===================================================================================================================== */


/* ---- Veiklos sritys / Dokumentu tipai: the tree + edit card layout (.af-*) and the tree list chips (.tl-chip) -----------
   ActivityFields.razor and DocumentTypes.razor (AdditionalToolsLists); the same .af-* classes are used by
   ClassificatorsLists/NewItem/DeviceGroups.razor and ItemGroups.razor (another group's windows - same rules, shared).
   Old colours: dx-bridge.css "Areas of activity window" and "Document types window reuses the .af-* layout" (hex +
   html.erp-dark twins), "Tree list status chips (BoolAsChip)". The raw <input>/<select>/<textarea> of the edit card stay
   (an X* editor there would change behaviour); here they get the field's surface, hairline and focus ring. */
html:root:root .af-tree,
html:root:root .af-detail {
    border-color: var(--terra-border);
    border-radius: var(--terra-radius-md);
    background: var(--terra-bg-surface);
    color: var(--terra-text-primary);
}

html:root:root .af-detail__hint,
html:root:root .af-head__count {
    color: var(--terra-text-muted);
}

html:root:root .af-detail__title {
    color: var(--terra-text-primary);
}

html:root:root .af-field > span {
    color: var(--terra-text-label);
}

html:root:root :is(.af-field input, .af-field select, .af-field textarea, .af-pop__row input) {
    border-color: var(--terra-border);
    border-radius: var(--terra-radius-sm);
    background: var(--terra-bg-surface);
    color: var(--terra-text-primary);
}

    html:root:root :is(.af-field input, .af-field select, .af-field textarea, .af-pop__row input):focus {
        outline: none;
        border-color: var(--terra-primary);
        box-shadow: 0 0 0 3px var(--terra-focus-ring);
    }

/* Buttons: the look's calm outline button; the one main action (+ Nauja ...) in the accent */
/* The detail panel's button row (+ Naujas, + Pogrupis, Išskleisti viską, Suskleisti) wraps to a second line when the
   panel is narrower than the buttons, instead of running past the card's edge (dx-bridge.css: nowrap) */
html:root:root .af-head {
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

html:root:root .af-btn {
    border-color: var(--terra-border);
    border-radius: var(--terra-radius-sm);
    background: var(--terra-bg-surface);
    color: var(--terra-text-label);
    font-weight: 600;
}

    html:root:root .af-btn:hover:not(:disabled) {
        border-color: color-mix(in srgb, var(--terra-border-strong) 60%, var(--terra-border));
        background: var(--terra-bg-surface-deep);
        color: var(--terra-text-primary);
    }

html:root:root .af-btn--primary {
    border-color: var(--terra-primary);
    background: var(--terra-primary);
    color: var(--terra-on-primary);
}

    html:root:root .af-btn--primary:hover:not(:disabled) {
        border-color: var(--terra-primary-hover);
        background: var(--terra-primary-hover);
        color: var(--terra-on-primary);
    }

/* Aktyvus / Neaktyvus / Gamyboje: the look's tags (components.css ui-tag) - green only for "on" */
html:root:root .tl-chip {
    border-radius: var(--terra-radius-pill);
}

html:root:root .tl-chip--on {
    background: var(--terra-success-bg);
    color: var(--terra-success-text);
}

html:root:root .tl-chip--off {
    background: var(--terra-bg-surface-deep);
    color: var(--terra-text-label);
}

html:root:root .tl-chip--info {
    background: var(--terra-primary-wash);
    color: var(--terra-primary-ink);
}


/* ---- Sistemos vartotojai: the user form's signature / QR / barcode placeholders (UserLists/NewItem/NewUser.razor) -------
   Their SVGs carry stroke="#7a7a7a" (a presentation attribute; CSS outranks it). Old twins: dx-bridge.css
   html.erp-dark .code-icon / .signature-icon. */
html:root:root :is(.signature-icon, .code-icon) {
    stroke: var(--terra-text-muted);
}


/* ---- Launchers' closed card (LauncherClosedCard: Veiklos sritys, SMS siuntimas, Zaliavu keitimas, Nustatymai, ...) -------
   Shared by every launcher window (Elements/MainForm/LauncherClosedCard), not only g4's. Old colours: dx-bridge.css
   "Launcher tab after its window was closed" (hex + html.erp-dark twins). */
html:root:root .launcher-closed {
    border-color: var(--terra-border);
    border-radius: var(--terra-radius-lg);
    background: var(--terra-bg-surface);
    color: var(--terra-text-primary);
    box-shadow: 0 1px 2px var(--terra-shadow-sm), 0 4px 12px var(--terra-shadow-sm);
}

html:root:root :is(.launcher-closed__icon, .launcher-closed__text) {
    color: var(--terra-text-muted);
}

html:root:root .launcher-closed__btn {
    border-color: var(--terra-border);
    border-radius: var(--terra-radius-sm);
    background: var(--terra-bg-surface);
    color: var(--terra-text-label);
    font-weight: 600;
}

    html:root:root .launcher-closed__btn:hover {
        background: var(--terra-bg-surface-deep);
        color: var(--terra-text-primary);
    }

html:root:root .launcher-closed__btn--primary {
    border-color: var(--terra-primary);
    background: var(--terra-primary);
    color: var(--terra-on-primary);
}

    html:root:root .launcher-closed__btn--primary:hover {
        border-color: var(--terra-primary-hover);
        background: var(--terra-primary-hover);
        color: var(--terra-on-primary);
    }


/* ---- Nustatymai (ConfigLists/Config.razor): the settings hub, its tiles and the setting pages -------------------------
   Old colours: components.css .cfg-* (hex, rgba shadows, five group colours on the tile icons, html.erp-dark twins).
   The group icons lose their five colours: a group is not a meaning, so the icon is ink on the deep surface; the
   hovered tile gets the accent hairline. The switch rows keep their shape; their colours come from the tokens. The hub's
   search is a raw <input> (kept): here it gets the field's surface, hairline and focus ring. */
html:root:root .cfg-hub__head p,
html:root:root .cfg-group__title,
html:root:root .cfg-tile__desc {
    color: var(--terra-text-muted);
}

html:root:root .cfg-hub__search {
    border-color: var(--terra-border);
    border-radius: var(--terra-radius-sm);
    background: var(--terra-bg-surface);
    color: var(--terra-text-primary);
}

    html:root:root .cfg-hub__search:focus {
        outline: none;
        border-color: var(--terra-primary);
        box-shadow: 0 0 0 3px var(--terra-focus-ring);
    }

html:root:root .cfg-tile {
    border-color: var(--terra-border);
    border-radius: var(--terra-radius-md);
    background: var(--terra-bg-surface);
    color: var(--terra-text-primary);
}

    html:root:root .cfg-tile:hover {
        border-color: var(--terra-primary-line);
        box-shadow: 0 2px 10px var(--terra-shadow-md);
    }

html:root:root :is(.cfg-tile__icon--0, .cfg-tile__icon--1, .cfg-tile__icon--2, .cfg-tile__icon--3, .cfg-tile__icon--4) {
    background: var(--terra-bg-surface-deep);
    color: var(--terra-text-label);
}

/* A settings page's head ("‹ Visi nustatymai" and the page's name) stays at the top while the page scrolls under it,
   so the way back is always in reach; on the surface, a hairline under it */
html:root:root .cfg-pagehead {
    position: sticky;
    top: 0;
    z-index: 5;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid var(--terra-border-subtle);
    background: var(--terra-bg-surface);
}

html:root:root .cfg-back {
    border-color: var(--terra-border);
    border-radius: var(--terra-radius-sm);
    background: var(--terra-bg-surface);
    color: var(--terra-text-label);
    font-weight: 600;
}

    html:root:root .cfg-back:hover {
        background: var(--terra-bg-surface-deep);
        color: var(--terra-text-primary);
    }

html:root:root .cfg-page .card {
    border-color: var(--terra-border);
    border-radius: var(--terra-radius-md);
    background: var(--terra-bg-surface);
}

html:root:root .cfg-page .card-subtitle {
    color: var(--terra-text-label) !important;
}

html:root:root .cfg-page .inputcard-contentspannedgroup > div:has(> chbox) {
    border-top-color: var(--terra-border-subtle);
}

    html:root:root .cfg-page .inputcard-contentspannedgroup > div:has(> chbox):hover {
        background: var(--terra-bg-hover);
    }

html:root:root .cfg-page chbox .dxbl-checkbox-check-element {
    background: var(--terra-border-strong) !important;
}

    html:root:root .cfg-page chbox .dxbl-checkbox-check-element::after {
        background-color: var(--terra-bg-surface) !important;
        box-shadow: 0 1px 2px var(--terra-shadow-md);
    }

html:root:root .cfg-page chbox.dxbl-checkbox-checked .dxbl-checkbox-check-element {
    background: var(--terra-primary) !important;
}

/* Dark: the surface-coloured knob is dark navy on a dark track, so a switch that is off all but vanished. The knob is
   light instead - the label colour while off, white on the accent while on. */
html:root:root.erp-dark .cfg-page chbox .dxbl-checkbox-check-element::after {
    background-color: var(--terra-text-label) !important;
}

html:root:root.erp-dark .cfg-page chbox.dxbl-checkbox-checked .dxbl-checkbox-check-element::after {
    background-color: #fff !important;
}


/* ---- Pagalba (ConfigLists/Help.razor): the help cards board -----------------------------------------------------------
   Kind Other. Old colours: the page's own <style> block (hex, rgba shadows; teal #0AA2C0 for "+" and the chosen type).
   The group's "+" and the chosen type take the accent; an inactive card's badge is a neutral tag (an unusual "no", not an
   error); delete keeps the danger tone on hover only. Font sizes untouched (Phase B). */
html:root:root .help-groups-container {
    border-color: var(--terra-border);
}

html:root:root .help-group__header {
    color: var(--terra-text-label);
}

html:root:root .help-group__add-btn {
    background: var(--terra-primary);
    color: var(--terra-on-primary);
}

    html:root:root .help-group__add-btn:hover {
        background: var(--terra-primary-hover);
    }

html:root:root .help-card {
    border-color: var(--terra-border);
    border-radius: var(--terra-radius-md);
    background: var(--terra-bg-surface);
}

    html:root:root .help-card:hover {
        border-color: var(--terra-primary-line);
        box-shadow: 0 2px 10px var(--terra-shadow-md);
    }

html:root:root .help-card--disabled {
    background: var(--terra-bg-surface-deep);
}

html:root:root .help-card__code {
    color: var(--terra-text-label);
}

html:root:root .help-card__name {
    color: var(--terra-text-primary);
}

html:root:root .help-card__desc {
    color: var(--terra-text-muted);
}

html:root:root .help-card__badge--inactive {
    background: var(--terra-bg-surface-deep);
    color: var(--terra-text-label);
}

html:root:root :is(.help-card__action-btn, .help-link-header__close, .help-type-switcher__toggle) {
    border-color: var(--terra-border);
    border-radius: var(--terra-radius-sm);
    background: var(--terra-bg-surface);
    color: var(--terra-text-label);
}

    html:root:root :is(.help-card__action-btn, .help-type-switcher__toggle):hover {
        background: var(--terra-bg-surface-deep);
        color: var(--terra-text-primary);
    }

html:root:root .help-card__action-btn--danger {
    border-color: var(--terra-border);
    color: var(--terra-text-label);
}

    html:root:root :is(.help-card__action-btn--danger, .help-link-header__close):hover {
        border-color: var(--terra-danger);
        background: var(--terra-danger-bg);
        color: var(--terra-danger-text);
    }

html:root:root .help-type-switcher__menu {
    border-color: var(--terra-border);
    border-radius: var(--terra-radius-md);
    background: var(--terra-bg-surface);
    box-shadow: 0 4px 14px var(--terra-shadow-md);
}

html:root:root .help-type-switcher__item {
    color: var(--terra-text-primary);
}

    html:root:root .help-type-switcher__item:hover {
        background: var(--terra-bg-hover);
    }

    html:root:root .help-type-switcher__item.is-active {
        background: var(--terra-primary-wash);
        color: var(--terra-primary-ink);
    }


/* ---- Monitoringas (UserLists/Monitoring.razor): the auto-refresh label, and the TV mode (/monitoring-tv) --------------
   Old colours: app.css ".monitoring-refresh-status" and "Monitoring's TV mode" (.MonitoringTv*, hex). The TV shell is
   shared with Rampu kalendorius' TV board (.RampTv* - not mapped here). Late stays red (danger), the bar's progress green
   (success); the efficiency chips keep their meaning (good / bad) in the look's tones. Sizes untouched (Phase B). */
html:root:root .monitoring-refresh-status {
    color: var(--terra-text-muted);
}

html:root:root .MonitoringTv {
    background-color: var(--terra-bg-page);
    color: var(--terra-text-primary);
}

html:root:root :is(.MonitoringTvHeader, .MonitoringTvEmpty, .MonitoringTvLane, .MonitoringTvCard) {
    border-color: var(--terra-border);
    background-color: var(--terra-bg-surface);
}

html:root:root .MonitoringTvLaneBody .MonitoringTvCard {
    border-color: var(--terra-border-subtle);
}

html:root:root .MonitoringTvLaneHead {
    border-bottom-color: var(--terra-border);
    background-color: var(--terra-bg-surface-header);
}

html:root:root :is(.MonitoringTvName, .MonitoringTvClock, .MonitoringTvKpiValue, .MonitoringTvLaneTitle h2) {
    color: var(--terra-text-primary);
}

html:root:root :is(.MonitoringTvMuted, .MonitoringTvKpiLabel, .MonitoringTvEmpty) {
    color: var(--terra-text-muted);
}

html:root:root :is(.MonitoringTvLost, .MonitoringTvBad, .MonitoringTvKpiValue.MonitoringTvBad) {
    color: var(--terra-danger-text);
}

html:root:root .MonitoringTvKpiDivider {
    background-color: var(--terra-border);
}

html:root:root .MonitoringTvExit {
    border-color: var(--terra-border);
    color: var(--terra-text-label);
}

    html:root:root .MonitoringTvExit:hover {
        background-color: var(--terra-bg-surface-deep);
    }

html:root:root .MonitoringTvCard.MonitoringTvCardLate {
    outline-color: var(--terra-danger);
}

html:root:root .MonitoringTvChip {
    background-color: var(--terra-bg-surface-deep);
    color: var(--terra-text-label);
}

html:root:root .MonitoringTvChipGood {
    background-color: var(--terra-success-bg);
    color: var(--terra-success-text);
}

html:root:root .MonitoringTvChipBad {
    background-color: var(--terra-danger-bg);
    color: var(--terra-danger-text);
}

/* Phone: the lane chips over the cards (dx-bridge.css, in a max-width media query there; harmless elsewhere - hidden) */
html:root:root .MonitoringTv .MonitoringTvPill {
    border-color: var(--terra-border);
    background: var(--terra-bg-surface);
    color: var(--terra-text-label);
}

    html:root:root .MonitoringTv .MonitoringTvPill.is-active {
        border-color: var(--terra-primary-line);
        background: var(--terra-primary-wash);
        color: var(--terra-primary-ink);
    }

html:root:root .MonitoringTvTrack {
    background-color: var(--terra-bg-surface-deep);
}

    html:root:root .MonitoringTvTrack > span {
        background-color: var(--terra-success);
    }

/* ---- Klientai > Veiklos sritys (NewClientTabs/NewClientActivityFields.razor, with the look on): a search, then each
   top-level area as a small title with its areas as pills under it - one click picks or drops an area, the chosen ones
   in the accent's wash with a tick - instead of two trees and four arrows ------------------------------------------- */
html .af-chooser {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

    html .af-chooser-head {
        color: var(--terra-text-label);
        font-size: 0.82rem;
    }

        html .af-chooser-head b {
            color: var(--terra-text-primary);
            font-variant-numeric: tabular-nums;
        }

    html .af-chooser-search {
        max-width: 26rem;
    }

    html .af-groups {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        max-height: 30rem;
        overflow: auto;
    }

    html .af-group-title {
        display: flex;
        align-items: baseline;
        gap: 0.6rem;
        margin-bottom: 0.45rem;
        color: var(--terra-text-label);
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    html .af-group-n {
        color: var(--terra-text-link);
        font-weight: 500;
        letter-spacing: 0;
        text-transform: none;
    }

    html .af-pills {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    html .af-pill {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.3rem 0.8rem;
        border: 1px solid var(--terra-border-strong);
        border-radius: var(--terra-radius-pill);
        background: var(--terra-bg-surface);
        color: var(--terra-text-primary);
        font: inherit;
        font-size: 0.85rem;
        font-weight: 500;
        line-height: 1.3;
        cursor: pointer;
    }

        html .af-pill:hover:not(:disabled) {
            border-color: var(--terra-primary-line);
            background: var(--terra-bg-hover);
        }

        html .af-pill i {
            font-size: 0.75rem;
        }

        html .af-pill small {
            color: var(--terra-text-muted);
            font-size: 0.7rem;
        }

        html .af-pill.is-whole {
            color: var(--terra-text-secondary);
        }

            html .af-pill.is-whole i {
                color: var(--terra-text-muted);
            }

        html .af-pill.is-on {
            border-color: var(--terra-primary-line);
            background: var(--terra-primary-wash);
            color: var(--terra-primary-ink);
        }

            html .af-pill.is-on i {
                color: var(--terra-primary);
            }

        html .af-pill:disabled {
            cursor: progress;
        }

    html .af-chooser-empty {
        padding: 1rem 0;
        color: var(--terra-text-muted);
        font-size: 0.875rem;
    }

/* ---- Konstruktoriaus gaminys (NewConstructorProduct): either half as the main one -----------------------------------
   The arrows on the divider (.ncp-focus, placed at the left half's width) make the list or the product the main half;
   the other half shrinks to a quarter, greys out, and a click anywhere on it (.ncp-dim-cover) brings it back. A phone
   shows one half at a time already (components.css), so none of this shows there. */
html .ncp-root .ncp-left,
html .ncp-root .ncp-right {
    transition: opacity 0.25s ease, filter 0.25s ease;
}

html .ncp-focus-1 .ncp-right,
html .ncp-focus-2 .ncp-left {
    opacity: 0.45;
    filter: grayscale(1);
}

html .ncp-dim-cover {
    position: absolute;
    inset: 0;
    z-index: 5;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

html .ncp-focus {
    position: absolute;
    top: 50%;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transform: translateY(-50%);
}

    html .ncp-focus button {
        width: 1.6rem;
        height: 2rem;
        padding: 0;
        border: 1px solid var(--terra-border-strong);
        border-radius: var(--terra-radius-sm);
        background: var(--terra-bg-surface);
        box-shadow: 0 1px 2px var(--terra-shadow-sm);
        color: var(--terra-text-body);
        font-size: 1rem;
        font-weight: 700;
        line-height: 1;
        cursor: pointer;
    }

        html .ncp-focus button:hover {
            background: var(--terra-bg-surface-deep);
            color: var(--terra-text-primary);
        }

        html .ncp-focus button.active {
            border-color: var(--terra-primary-line);
            background: var(--terra-primary-wash);
            color: var(--terra-primary);
        }

@media (max-width: 767.98px) {
    html .ncp-focus,
    html .ncp-dim-cover {
        display: none;
    }

    html .ncp-focus-1 .ncp-right,
    html .ncp-focus-2 .ncp-left {
        opacity: 1;
        filter: none;
    }
}
