:root {
    --odd-color: transparent;
    --even-color: rgba(128,128,128,0.06);
    --item-selected-color: white;
}

[data-bs-theme="darkly"] {
    --odd-color: gray;
    --even-color: black;
    --item-selected-color: white;
}

[data-bs-theme="Blazing Dark"] {
    --odd-color: gray;
    --even-color: black;
    --item-selected-color: white;
}

html, body {
    height: 100%;
}

app {
    display: block;
    height: 100%;
}

.header-logo {
    background-image: url('../images/logologin.png');
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    width: 190px;
    height: 40px;
}

#blazor-error-ui {
    background: inherit;
    bottom: 0;
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 100001;
}

.tree-list /* Target all styles within the tree-list component */
.tree-list-container {
    width: 100%; /* Enable responsive behavior */
}

.dx-column {
    box-sizing: border-box; /* Ensure padding/border don't affect width */
}

/* Row Styles */
.dx-row {
    color: #222; /* Darker gray for better contrast */
    font-size: 14px; /* Standard font size */
}

.bold-header .dx-treelist-headers .dx-row .dx-column-lines .dx-header-row .dx-treelist-table .dx-treelist-table-fixed .dx-treelist-content .dx-treelist-scroll-container {
    font-weight: bold !important;
}

.tree-list .dx-row:nth-child(even) {
  background-color: #f5f5f5; /* Light gray background color for even rows */
}

.dx-row:last-child {
    background-color: #f5f5f5; /* Very light gray background */
    border-bottom: 1px solid #ddd; /* Light gray border on bottom */
}

/* Selection & Hover Styles */
.dx-selection .dx-row {
    background-color: #4285f4; /* Google blue (primary) */
    color: #fff; /* White font color for contrast */
}

.dx-row:hover {
    background-color: #e6e6e6; /* Lighter gray on hover */
}

/* Expanded Row Styles */
.dx-treelist-expanded .dx-row {
    border-left: 3px solid #4285f4; /* Thicker left border for expanded rows */
    padding-left: 20px; /* Increased indent for hierarchy */
}

/* Row Border Styles */
.dx-row {
    border-bottom: 1px solid #ddd; /* Light gray border between rows */
}

/* Header Row Styles */
.dx-header-row {
    background-color: #f0f0f0; /* Light gray background for headers */
    color: #555; /* Dark gray font color */
    font-weight: bold; /* Bold font for headers */
    padding: 5px 10px; /* Add some padding for visual separation */
    border-bottom: 1px solid #ddd; /* Light gray border on bottom */
}

/* Select All Checkbox Styles (optional) */
.dx-header-row .dx-select-checkbox {
    background-color: #fff; /* White background */
    border-color: #ccc; /* Light gray border */
}

.dx-header-row .dx-checkbox-hover-on.dx-select-checkbox {
    background-color: #e6e6e6; /* Light gray background on hover */
}

/* Existing styles for tree list container and controls */
.tree-list-container {
    display: flex;
    flex-direction: column; /* Stack controls and tree list vertically */
    width: 100%; /* Ensure the container takes full width */
}

.tree-list-controls {
    display: flex; /* Arrange buttons horizontally */
    margin-bottom: 5px; /* Add some spacing below buttons */
}

.dx-expand-all-button {
    text-indent: -9999px;
    width: 20px; /* Set a fixed width for buttons */
    height: 20px; /* Set a fixed height for buttons */
    background-repeat: no-repeat; /* Prevent image tiling */
    background-position: center center; /* Center image within button */
    background-size: cover;
    border: none; /* Remove the border */
    /* Set background image for expand and collapse buttons */
    background-image: url('../../images/plus-svgrepo-com.svg') !important; /* Expand icon */
    margin-right: 5px; /* Add margin to right of each button */
}

.dx-collapse-all-button {
    text-indent: -9999px;
    width: 23px; /* Set a fixed width for buttons */
    height: 20px; /* Set a fixed height for buttons */
    background-size: cover;
    background-repeat: no-repeat; /* Prevent image tiling */
    background-position: center center; /* Center image within button */
    border: none; /* Remove the border */
    /* Set background image for expand and collapse buttons */
    background-image: url('../../images/minus-circle-svgrepo-com.svg') !important; /* Expand icon */
    margin-right: 5px; /* Add margin to right of each button */
}

.dx-AutoFit-button {
    text-indent: -9999px;
    width: 23px; /* Set a fixed width for buttons */
    height: 20px; /* Set a fixed height for buttons */
    background-size: cover;
    background-repeat: no-repeat; /* Prevent image tiling */
    background-position: center center; /* Center image within button */
    border: none; /* Remove the border */
    /* Set background image for expand and collapse buttons */
    background-image: url('../../images/resize-double-arrows-svgrepo-com.svg') !important; /* Expand icon */
    margin-right: 5px; /* Add margin to right of each button */
}

.logoncontainer {
    display: flex;
    width: 100%;
    height: 100%;
    background-color: #5156be;
}

.logonleft,
.logonright {
    flex: 1;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    position: relative;
    top: 0;
    width: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.logonleft {
    flex: 25%;
    float: left;
    left: 0;
    background-color: ghostwhite;
}

.logonright {
    flex: 75%;
    float: right;
    right: 0;
    background-image: url('../../images/auth-bg.jpg');
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.logondivider {
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 576px) {
    .hideinmob {
        display: none;
    }
}

/* Editors and captions */
.dxbl-text-edit {
    border-radius: 8px;
    padding: 6px 2px ;
}

.dxbl-fl .dxbl-fl-item.dxbl-fl-item-horizontal > .dxbl-fl-cpt {
    padding: 10px;
}

/* List and dialogs */
.dxbl-dropdown > .dxbl-dropdown-dialog, .dxbl-itemlist-dropdown > .dxbl-dropdown-dialog {
    border: thick;
    border-radius: 8px;
}

html:not(.dxSafari) .dxbl-list-box-render-container > .dxbl-scroll-viewer > .dxbl-scroll-viewer-content > table > tbody > tr.dxbl-list-box-item-selected:not(.dxbl-list-box-item-disabled) > td, html:not(.dxSafari) .dxbl-list-box > .dxbl-scroll-viewer > .dxbl-scroll-viewer-content > table > tbody > tr.dxbl-list-box-item-selected:not(.dxbl-list-box-item-disabled) > td {
    background-color: var(--dxbl-list-box-item-selected-bg,unset);
    color: var(--item-selected-color) !important;
}

.logon-toolbar button {
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    background-color: cornflowerblue;
    border: none;
}

.logon-viewsite .dxbl-text-edit-input {
    border-radius: 8px;
}

.logon-main {
    max-width: 400px;
    min-width: 400px;
    width: 400px;
    border-radius: 8px;
    background-color: transparent;
    border: none !important;
    box-shadow: none !important;
}

.logon-slogan-text {
    position: absolute;
    bottom: 20px;
    font-size: 1.5vw;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 1px 15% 1px 15%;
    background-color: cornflowerblue;
}

.dxbl-tabs > .dxbl-tabs-tablist.dxbl-tabs-tablist-scrollable {
    background-color: transparent;
}

.bg-overlay {
    inset: 0;
    opacity: 0.3;
    background-color: #000;
}

.dxbl-toolbar.dxbl-toolbar-adaptive > .dxbl-btn-toolbar > div > .dxbl-toolbar-item > .dxbl-btn {
    border-radius: 8px;
    padding: 10px;
}

.dxbl-btn-secondary {
    border-radius: 8px;
    padding: 10px;
}

.dxbl-btn-primary {
    border-radius: 8px;
    padding: 10px;
}

/* Grid */
tr:nth-child(odd) {
    background-color: var(--odd-color, transparent);
}

tr:nth-child(even) {
    background-color: var(--even-color, rgba(128,128,128,0.06));
}

    /* Selected item in lookup/dropdown lists - MUST override nth-child rules */
    tr:nth-child(odd).dxbl-grid-data-row.dxbl-grid-selected,
    tr:nth-child(even).dxbl-grid-data-row.dxbl-grid-selected,
    tr:nth-child(odd).dxbl-grid-data-row.dxbl-grid-focused,
    tr:nth-child(even).dxbl-grid-data-row.dxbl-grid-focused {
        background-color: #4285f4 !important;
        color: white !important;
    }

/* Selected/focused items in item list dropdowns */
.dxbl-itemlist-item.dxbl-itemlist-selected,
.dxbl-itemlist-item.dxbl-itemlist-focused {
    background-color: #4285f4 !important;
    color: white !important;
}

    .dxbl-itemlist-item.dxbl-itemlist-selected *,
    .dxbl-itemlist-item.dxbl-itemlist-focused * {
        color: white !important;
    }

.dxbl-grid-header-row {
    background-color: rgba(128,128,128,0.08) !important;
}


/* Grid */

.app .main-content > .grid-content, .xaf-masterdetail-listview > .grid-content {
    border-radius: 8px;
}

dxbl-grid-header-content {
    padding: 6px 0
}

.dxbl-grid .dxbl-grid-table > tbody > tr > td > .dxbl-checkbox, .dxbl-grid .dxbl-grid-table > tfoot > tr > td > .dxbl-checkbox, .dxbl-grid .dxbl-grid-table > thead > tr > td > .dxbl-checkbox {
    padding: 6px 0;
}

.time-span-editor {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.time-span-editor .dxbs-spin-edit {
    width: 100px;
}

.dx-toolbar {
    z-index: 10;
    background-color: inherit;
    position: relative;
    padding: 5px 10px;
}

.dx-gantt {
    height: 100% !important;
}

    .dx-gantt .dx-toolbar-items-container {
        overflow: visible;
    }
    /*.dx-gantt .dx-treelist {
        width: 40% !important;*/ /* Adjust percentage as needed */
        /*min-width: 400px !important;
    }*/

.dx-gantt-splitter {
    width: 8px !important;
    background-color: #f0f0f0 !important;
}

.dx-treelist-container .dx-treelist-table .dx-column-indicators {
    min-width: 300px;
}

body:not(.dxbl-theme-fluent) .logon-main div[data-item-name="PasswordHint"] + .xaf-static-text {
    opacity: 0.5;
    font-size: 0.75rem;
}

.dxbl-theme-fluent.xaf-size-s .logon-main div[data-item-name="LogonText"] + .xaf-static-text {
    font-size: var(--dxds-font-size-caption-1);
    line-height: var(--dxds-line-height-caption-1);
    font-weight: var(--dxds-font-weight-caption-1);
}

.dxbl-theme-fluent.xaf-size-m .logon-main div[data-item-name="LogonText"] + .xaf-static-text {
    font-size: var(--dxds-font-size-body-1);
    line-height: var(--dxds-line-height-body-1);
    font-weight: var(--dxds-font-weight-body-1);
}

.dxbl-theme-fluent.xaf-size-s .logon-main .xaf-static-text {
    font-size: var(--dxds-font-size-caption-2);
    line-height: var(--dxds-line-height-caption-2);
    font-weight: var(--dxds-font-weight-caption-2);
}

.dxbl-theme-fluent.xaf-size-m .logon-main .xaf-static-text {
    font-size: var(--dxds-font-size-caption-1);
    line-height: var(--dxds-line-height-caption-1);
    font-weight: var(--dxds-font-weight-caption-1);
}

/* ── Workflow Graph Visualization ── */

.dxbl-modal-body:has(.workflow-graph) {
    overflow: hidden !important;
}

/* Root wrapper — height set by JS autoSize */
.workflow-graph {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%);
}

.workflow-graph-warning {
    border-radius: 8px;
    margin: 8px 12px 0;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.15);
}

/* Header + toolbar on ONE line */
.workflow-graph-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 8px 14px;
    flex-shrink: 0;
    border-bottom: 1px solid #eaecf3;
    background: #f7f8fb;
}

.workflow-graph-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1f2a44;
    white-space: nowrap;
}

.workflow-graph-subtitle {
    font-size: 0.85rem;
    color: #55607a;
    white-space: nowrap;
}

.workflow-graph-toolbar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 4px 0;
    background: transparent;
    border: none;
}

/* Diagram mode selector (segmented control) */
.workflow-graph-mode-selector {
    display: flex;
    flex-direction: row;
    gap: 0;
    background: #e8ecf4;
    border-radius: 8px;
    padding: 2px;
    flex-shrink: 0;
    margin-left: auto;
}

.workflow-graph-mode-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #555e73;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    line-height: 1.3;
}

    .workflow-graph-mode-btn:hover {
        color: #2d3550;
        background: rgba(255, 255, 255, 0.5);
    }

    .workflow-graph-mode-btn.active {
        background: #ffffff;
        color: #1f2a44;
        font-weight: 600;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
    }

.workflow-graph-mode-icon {
    font-size: 0.9rem;
}

.workflow-graph-mode-label {
    font-size: 0.78rem;
}

.workflow-graph-toolbar .btn {
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.82rem;
    flex: 0 0 auto;
    white-space: nowrap;
}

.workflow-graph-toolbar-separator {
    width: 1px;
    height: 20px;
    background: #d4dbe8;
    margin: 0 2px;
    flex: 0 0 auto;
}

/* Content column */
.workflow-graph-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Diagram — explicit pixel height set by JS autoSize */
.workflow-graph-diagram {
    background: #ffffff;
    border-bottom: 1px solid #eaecf3;
    overflow: hidden;
    position: relative;
}

    .workflow-graph-diagram svg {
        width: 100%;
        height: 100%;
    }

/* Details panel – compact horizontal strip at bottom */
.workflow-graph-details {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 24px;
    align-items: flex-start;
    padding: 10px 16px;
    max-height: 160px;
    overflow-y: auto;
    flex-shrink: 0;
    border-left: 4px solid #6f42c1;
    background: linear-gradient(90deg, rgba(111, 66, 193, 0.06), transparent 60%);
    border-top: 1px solid #eaecf3;
}

.workflow-graph-details-title {
    width: 100%;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1f2a44;
    margin-bottom: 0;
}

.workflow-graph-details-item {
    flex: 1 1 220px;
    min-width: 180px;
    font-size: 0.88rem;
}

.workflow-graph-details ul {
    margin: 4px 0 0;
    padding-left: 1.1rem;
}

.workflow-graph-details-rule {
    font-size: 0.82rem;
    color: #6b7280;
}

.workflow-graph-details-availability {
    font-size: 0.82rem;
    color: #3b5bdb;
}

.workflow-graph-details-hidden {
    display: none;
}

/* Fullscreen overlay (covers entire viewport) */
.workflow-graph-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #f7f8fb;
}

.workflow-graph-no-scroll {
    overflow: hidden;
}

/* SVG node polish */
.workflow-graph-diagram svg .node rect,
.workflow-graph-diagram svg .node polygon {
    rx: 8px;
    ry: 8px;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.10));
}

.workflow-graph-diagram svg .edgePath path {
    stroke: #5c6f91;
}

.workflow-graph-diagram svg .edgeLabel {
    font-size: 12px;
    fill: #2a334d;
}

/* Current node pulse glow */
.workflow-graph-diagram svg .currentNode rect,
.workflow-graph-diagram svg .currentNode polygon {
    filter: drop-shadow(0 0 10px rgba(111, 66, 193, 0.50));
    animation: workflowPulse 2.2s ease-in-out infinite;
}

@keyframes workflowPulse {
    0% {
        filter: drop-shadow(0 0 6px rgba(111, 66, 193, 0.30));
    }

    50% {
        filter: drop-shadow(0 0 16px rgba(111, 66, 193, 0.65));
    }

    100% {
        filter: drop-shadow(0 0 6px rgba(111, 66, 193, 0.30));
    }
}