/* ============================================================
   GNT tuning of the Fluent theme. Registered via
   DxResourceManager.RegisterTheme + AddFilePaths in App.razor.

   SetCustomAccentColor("#B70E0C") derives the light end of the
   primary scale poorly (primary-10 turns neutral grey, primary-20
   jumps to a saturated salmon). The light steps are pinned to calm
   neutral greys here; DevExpress uses them for grid selection, active
   filter buttons, toasts and the filter builder.
   https://docs.devexpress.com/Blazor/405705
   ============================================================ */

:root,
.dxbl-theme-fluent-mode-light {
    --dxds-primary-10: #e6e6e6;
    --dxds-primary-20: #dcdcdc;
    --dxds-primary-30: #d2d2d2;
    /* Order duration and progress strips. Same red as the Fluent accent,
       planned and progress blue aligned with the VISIO machine states. */
    --gnt-order-duration-bar: #b70e0c;
    --gnt-order-duration-bar-planned: #0284c7;
    --gnt-order-progress-bar: #0284c7;
    --gnt-search-glyph-color: #6b7280;
    /* Stock states (FachBelegungsStatus): storage overview compartments and KWZ card stock. */
    --gnt-stock-ok-bg: #dcfce7;
    --gnt-stock-ok-border: #16a34a;
    --gnt-stock-ok-color: #14532d;
    --gnt-stock-low-bg: #fef3c7;
    --gnt-stock-low-border: #d97706;
    --gnt-stock-low-color: #78350f;
    --gnt-stock-empty-bg: #fee2e2;
    --gnt-stock-empty-border: #b70e0c;
    --gnt-stock-empty-color: #7f1d1d;
    /* Duration inputs and the total duration summary (operation / operation resource dialogs).
       Pastel blue like the desktop total duration display. */
    --gnt-duration-unit-color: #6b7280;
    --gnt-duration-sep-color: #9ca3af;
    --gnt-duration-summary-bg: #e0f2fe;
    --gnt-duration-summary-border: #bae6fd;
    --gnt-duration-summary-color: #075985;
}

/* Fluent paints the focused row with the full accent and white text.
   A light surface + dark text keeps line-art icons and status dots
   readable; the accent bar marks the row instead. */
.dxbl-grid {
    --dxbl-grid-focus-bg: var(--dxds-color-surface-primary-deep-rest);
    --dxbl-grid-focus-color: var(--dxds-color-content-neutral-default-rest);
    --dxbl-grid-selection-focus-dark-bg: var(--dxds-color-surface-primary-deep-rest);
    --dxbl-grid-selection-focus-dark-color: var(--dxds-color-content-neutral-default-rest);
}

/* Zebra rows (class set by GntGridChrome.ApplyAlternatingDataRow).
   A quarter of the DevExpress subdued surface token, so the stripe stays
   barely visible and well below the focused-row grey. */
.dxbl-grid .gnt-grid-alt-row {
    --dxbl-grid-row-bg: color-mix(in srgb, var(--dxds-color-surface-neutral-subdued-rest) 25%, #ffffff);
}

.dxbl-grid .dxbl-grid-focused-row > td:first-child {
    box-shadow: inset 3px 0 0 var(--dxds-color-surface-primary-default-rest);
}

/* Grid bar buttons (CrudPage toolbar): Secondary with a 1px border, so the
   button edge lines up with the grid edge. Fluent toolbar items have no
   outline mode; the search item keeps its text box chrome. */
.center-crud-toolbar .dxbl-toolbar-group > dxbl-toolbar-item:not(.center-crud-toolbar__search-item) > .dxbl-btn,
.center-crud-toolbar .dxbl-toolbar-group > dxbl-toolbar-item:not(.center-crud-toolbar__search-item) > .dxbl-toolbar-item-tmpl > .dxbl-btn {
    border: 1px solid var(--dxds-color-border-neutral-default-rest);
    border-radius: 0.25rem;
}

/* Bordered buttons of one toolbar group would otherwise touch each other. */
.center-crud-toolbar .dxbl-toolbar-group {
    gap: 0.25rem;
}

.center-crud-toolbar .dxbl-toolbar-group > dxbl-toolbar-item:not(.center-crud-toolbar__search-item) > .dxbl-btn:hover,
.center-crud-toolbar .dxbl-toolbar-group > dxbl-toolbar-item:not(.center-crud-toolbar__search-item) > .dxbl-toolbar-item-tmpl > .dxbl-btn:hover {
    border-color: var(--dxds-color-border-neutral-default-hovered);
}

/* Rows are picked, not edited: arrow instead of the I-beam over cell text.
   Covers DxTreeList too (its root also carries .dxbl-grid). */
.dxbl-grid .dxbl-grid-table > tbody > tr > td {
    cursor: default;
}

/* CPU-capture hint in the 3D viewer. Colour lives in the theme so the module CSS stays layout-only. */
.gnt-3d-alert {
    color: var(--dxds-color-content-warning-default-rest);
    background: var(--dxds-color-surface-warning-subdued-rest);
    border-color: var(--dxds-color-border-warning-default-rest);
}

/* Duration inputs (Std / Min / Sek) and the total duration summary panel. */
.bde-duration-input-row .bde-duration-input-row__unit {
    color: var(--gnt-duration-unit-color);
}

.bde-duration-input-row .bde-duration-input-row__sep {
    color: var(--gnt-duration-sep-color);
}

.bde-duration-summary {
    color: var(--gnt-duration-summary-color);
    background: var(--gnt-duration-summary-bg);
    border: 1px solid var(--gnt-duration-summary-border);
}

/* Pointer tooltip over the 3D stream (gizmo handles, snap features). */
.gnt-3d-stage__cursor-tip {
    color: var(--dxds-color-content-neutral-default-rest);
    background: var(--dxds-color-surface-neutral-default-rest);
    border-color: var(--dxds-color-border-neutral-default-rest);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* I-beam only where text can be typed; read-only combos and check boxes keep the arrow. */
.dxbl-grid .dxbl-grid-table > tbody > tr > td :is(
    input:not([readonly], [disabled], [type="checkbox"], [type="radio"], [type="button"], [type="submit"],
              [type="reset"], [type="range"], [type="color"], [type="file"], [type="image"]),
    textarea:not([readonly], [disabled]),
    [contenteditable="true"]) {
    cursor: text;
}