html, body {
    height: 100%;
}

app {
    display: block;
    height: 100%;
}

/*.header-logo {
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: url('../images/Logo.svg');
    mask: url('../images/Logo.svg');
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    width: 28px;
    height: 24px;
}*/

.header-logo {
    background-image: url(../images/Logo.svg);
    width: 200px;
    height: 44px;
    background-position: left center;
    background-size: contain;
    background-repeat: no-repeat;
}

[data-ice-theme="dark"] .header-logo,
[data-bs-theme="dark"] .header-logo {
    background-image: url(../images/Logo-dark.svg);
}

#blazor-error-ui {
    background: inherit;
    bottom: 0;
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 100001;
}

.workbench-operations-grid {
    height: 55vh;
    overflow: auto;
}

.workbench-operations-grid .dxbl-grid {
    height: 49vh !important;
}

.workbench-components-grid {
    height: 17.5vh;
}

.workbench-components-grid .dxbl-grid {
    height: 18vh !important;
}

/* WorkBench right action panel compact spacing */
.workbench-button-panel .dxbl-fl-group-content,
.workbench-button-panel .dxbl-fl-item-content,
.workbench-button-panel .dxbl-fl-item {
    padding: 2px !important;
}

.workbench-button-panel .workbench-operation-buttons .dxbl-fl-group-content,
.workbench-button-panel .workbench-operation-buttons .dxbl-fl-item-content {
    gap: 4px !important;
}

/* External Operation Delivery highlight group rows */
.eod-green-groups .dxbl-group-row,
.eod-green-groups .dxbl-grid-group-row {
    background-color: #e8f5e9 !important;
}

.eod-green-groups .dxbl-group-row .dxbl-group-cell,
.eod-green-groups .dxbl-grid-group-row .dxbl-group-cell {
    font-weight: 600;
}

.workorder-planning-main {
    --workorder-planning-gap: 8px;
    height: calc(100dvh - 140px);
    min-height: 0;
    overflow: hidden;
}

dxbl-drag-hint.workorder-planning-drag-hint,
.dxbl-grid-row-drag-hint.workorder-planning-drag-hint {
    width: auto !important;
    max-width: 320px !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

.workorder-planning-group-drop-target.workorder-planning-group-drop-hover {
    outline: 2px solid var(--dxbl-primary, #0d6efd);
    outline-offset: -2px;
}

.workorder-planning-main,
.workorder-planning-main > .dxbl-row,
.workorder-planning-grid-area,
.workorder-planning-grid-area > .dxbl-row,
.workorder-planning-top-row,
.workorder-planning-top-row > .dxbl-row,
.workorder-planning-bottom-row,
.workorder-planning-bottom-row > .dxbl-row,
.workorder-planning-top-row > .dxbl-row > .dxbl-fl-group,
.workorder-planning-bottom-row > .dxbl-row > .dxbl-fl-group,
.workorder-planning-grid-panel,
.workorder-planning-grid-panel > .dxbl-row,
.workorder-planning-grid-panel .dxbl-fl-item,
.workorder-planning-grid-panel .dxbl-fl-ctrl,
.workorder-planning-grid-panel .nested-frame,
.workorder-planning-grid-panel .nested-content,
.workorder-planning-grid-panel .grid-content {
    min-height: 0 !important;
}

.workorder-planning-main > .dxbl-row {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    height: calc(100% + 8px);
    overflow: hidden;
}

.workorder-planning-filter {
    flex: 0 0 auto;
    overflow: visible;
}

.workorder-planning-filter > .dxbl-row {
    justify-content: flex-start;
    min-height: 0 !important;
}

.workorder-planning-filter > .dxbl-row > .dxbl-fl-item {
    flex: 0 1 380px !important;
    width: min(100%, 380px) !important;
    max-width: 380px !important;
}

.workorder-planning-grid-area {
    flex: 1 1 auto !important;
    overflow: hidden;
}

.workorder-planning-grid-area > .dxbl-row {
    display: grid;
    grid-template-rows: minmax(0, 1.08fr) minmax(0, 1fr);
    gap: var(--workorder-planning-gap);
    height: calc(100% + 8px);
    overflow: hidden;
}

.workorder-planning-top-row,
.workorder-planning-bottom-row {
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden;
}

.workorder-planning-top-row > .dxbl-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--workorder-planning-gap);
    height: calc(100% + 8px);
    overflow: hidden;
}

.workorder-planning-top-row > .dxbl-row > .workorder-planning-grid-panel {
    width: 100% !important;
    max-width: 100% !important;
}

.workorder-planning-bottom-row > .dxbl-row,
.workorder-planning-top-row > .dxbl-row > .dxbl-fl-group,
.workorder-planning-bottom-row > .dxbl-row > .dxbl-fl-group {
    height: 100%;
    overflow: hidden;
}

.workorder-planning-top-row .workorder-planning-planned-panel {
    order: 2;
}

.workorder-planning-top-row .workorder-planning-unplanned-panel {
    order: 1;
}

.workorder-planning-grid-panel {
    height: 100%;
    overflow: hidden;
}

.workorder-planning-grid-panel > .dxbl-row {
    display: flex;
    flex-direction: column;
    height: calc(100% + 8px);
    overflow: hidden;
}

.workorder-planning-grid-panel > .dxbl-row > .dxbl-fl-item {
    flex: 1 1 0 !important;
    height: 100%;
    overflow: hidden;
}

.workorder-planning-grid-panel .dxbl-fl-ctrl,
.workorder-planning-grid-panel .nested-frame,
.workorder-planning-grid-panel .nested-content,
.workorder-planning-grid-panel .grid-content {
    height: 100%;
    overflow: hidden;
}

.workorder-planning-grid-panel .nested-frame {
    display: flex;
    flex-direction: column;
}

.workorder-planning-grid-panel .nested-content {
    flex: 1 1 0;
}

.workorder-planning-grid-panel .grid-content {
    overflow: auto;
}

.workorder-planning-grid-panel .dxbl-grid,
.workorder-planning-grid-panel .dxbl-grid-root,
.workorder-planning-grid-panel .workorder-planning-pivot,
.workorder-planning-grid-panel .workorder-planning-pivot-table,
.workorder-planning-grid-panel .dxbl-pivot-grid,
.workorder-planning-grid-panel .dxbl-pivotgrid,
.workorder-planning-grid-panel .dxbl-pivottable {
    height: 100% !important;
    min-height: 0 !important;
}

.workorder-planning-grid-panel .dxbl-grid-table {
    height: auto !important;
    min-height: 0 !important;
}

.workorder-planning-grid-panel .dxbl-grid,
.workorder-planning-grid-panel .workorder-planning-pivot-table,
.workorder-planning-grid-panel .dxbl-pivot-grid,
.workorder-planning-grid-panel .dxbl-pivotgrid,
.workorder-planning-grid-panel .dxbl-pivottable {
    overflow: auto;
}

.workorder-planning-pivot {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 6px;
    height: 100%;
    min-height: 0;
}

.workorder-planning-pivot-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.workorder-planning-pivot-record-count {
    font-size: 12px;
    opacity: 0.8;
}

.workorder-planning-pivot-table {
    min-height: 0;
    overflow: auto;
}

.workorder-pivot-progress-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 120px;
}

.workorder-pivot-progress-track {
    position: relative;
    flex: 1 1 auto;
    min-width: 72px;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background-color: var(--dxbl-disabled-color, rgba(0, 0, 0, 0.15));
}

.workorder-pivot-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2383e2 0%, #20a464 100%);
}

.workorder-pivot-progress-text {
    min-width: 50px;
    text-align: right;
    white-space: nowrap;
    font-size: 11px;
}

/* ==========================================================================
   Work Order Planning V2 (Modern Workspace) Styles
   ========================================================================== */

.workorder-planning-v2-main {
    --workorder-planning-gap: 8px;
    height: calc(100dvh - 140px);
    min-height: 0;
    overflow: hidden;
}

.workorder-planning-v2-main > .dxbl-row {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--workorder-planning-gap) !important;
    height: 100% !important;
    overflow: hidden !important;
}

.workorder-planning-v2-main .workorder-planning-v2-kpi-row {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
    overflow: visible !important;
}

.workorder-planning-v2-main .workorder-planning-v2-kpi-row > .dxbl-row,
.workorder-planning-v2-main .workorder-planning-v2-kpi-row .dxbl-fl-item,
.workorder-planning-v2-main .workorder-planning-v2-kpi-row .dxbl-fl-ctrl {
    height: auto !important;
    min-height: 0 !important;
}

.workorder-planning-v2-main .workorder-planning-workspace-area {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
}

.workorder-planning-v2-main .workorder-planning-workspace-area > .dxbl-row,
.workorder-planning-v2-main .workorder-planning-workspace-area .dxbl-fl-item,
.workorder-planning-v2-main .workorder-planning-workspace-area .dxbl-fl-ctrl {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.workorder-planning-v2-workspace-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    gap: 8px;
}

.workspace-top-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 8px 12px;
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.workspace-main-content {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px 12px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.global-search-wrapper {
    min-width: 280px;
    max-width: 400px;
}

.global-search-dxtext .dxbl-text-edit {
    border-radius: 6px;
    background: #f8fafc;
    border-color: #cbd5e1;
}

.global-search-dxtext .dxbl-text-edit:focus-within {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ==========================================================================
   Left Panel: Unplanned Work Orders Pool
   ========================================================================== */

.workspace-unplanned-pool {
    display: flex;
    flex-direction: column;
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pool-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--bs-border-color, #e9ecef);
    background: #f8fafc;
}

.pool-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.pool-title {
    font-weight: 700;
    font-size: 13px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pool-count-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    background: #e2e8f0;
    color: #475569;
}

.pool-search-box {
    margin-bottom: 6px;
}

.pool-search-input {
    font-size: 12px;
    border-radius: 6px;
}

.pool-priority-pills {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.priority-pill {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #64748b;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.priority-pill.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

.priority-pill-critical.active {
    background: #dc3545;
    border-color: #dc3545;
}

.priority-pill-high.active {
    background: #fd7e14;
    border-color: #fd7e14;
}

.priority-pill-normal.active {
    background: #0d6efd;
    border-color: #0d6efd;
}

.pool-cards-list {
    flex: 1 1 0;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background 0.15s ease;
}

.workspace-unplanned-pool.pool-dragover,
.pool-cards-list.pool-dragover {
    background-color: rgba(13, 110, 253, 0.08) !important;
    outline: 2px dashed #0d6efd !important;
    outline-offset: -2px;
}

.pool-empty-state {
    text-align: center;
    padding: 40px 10px;
    color: #64748b;
}

.empty-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.empty-text {
    font-size: 12px;
}

.unplanned-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0d6efd;
    border-radius: 6px;
    padding: 8px 10px;
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.unplanned-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.unplanned-card.card-priority-critical {
    border-left-color: #dc3545;
}

.unplanned-card.card-priority-high {
    border-left-color: #fd7e14;
}

.unplanned-card.card-priority-normal {
    border-left-color: #0d6efd;
}

.unplanned-card.card-priority-low {
    border-left-color: #94a3b8;
}

.unplanned-card.card-overdue {
    background: rgba(220, 53, 69, 0.03);
}

.unplanned-card.card-selected,
.planned-wo-card.card-selected {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.35) !important;
    background: #f0f7ff !important;
}

.card-select-check,
.card-select-toggle,
.card-select-dxcheck {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.card-select-dxcheck .dxbl-checkbox-check {
    width: 16px;
    height: 16px;
}

.pool-bulk-action-bar {
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 6px 8px;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bulk-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: #0369a1;
}

.bulk-main-stat {
    font-size: 11.5px;
    font-weight: 700;
    color: #0369a1;
}

.bulk-mini-stats-row {
    font-size: 10.5px;
    font-weight: 600;
    margin-top: 2px;
}

.bulk-mat-pill {
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.bulk-mat-pill.pill-ready {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.bulk-mat-pill.pill-missing {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.bulk-op-stat {
    font-size: 10px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.bulk-btns-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.unplanned-card.card-dragging,
.planned-wo-card.card-dragging,
.gantt-op-block.block-dragging {
    opacity: 0.45 !important;
    border-style: dashed !important;
}

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-wo-no {
    font-weight: 700;
    font-size: 12px;
    color: #0f172a;
}

.card-so-badge {
    font-size: 9.5px;
    font-weight: 600;
    color: #0284c7;
    background: #e0f2fe;
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid #bae6fd;
    white-space: nowrap;
    /* A work order made for several orders lists them all; the card keeps its width and the title shows the rest. */
    display: inline-block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.card-priority-badge {
    font-size: 10px;
}

.card-part-name {
    font-size: 11px;
    color: #334155;
    margin: 2px 0 1px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.card-customer-row {
    font-size: 10px;
    color: #475569;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-customer-row .customer-icon {
    font-size: 10.5px;
    color: #64748b;
    flex-shrink: 0;
}

.card-bottom-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #64748b;
}

.card-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px dashed #e2e8f0;
}

.card-quick-plan-btn {
    font-size: 10px;
    padding: 1px 6px;
}

.card-drag-hint {
    font-size: 10px;
    color: #94a3b8;
}

/* ==========================================================================
   Right Panel: Interactive Work Center Timeline / Gantt
   ========================================================================== */

/* ==========================================================================
   Right Panel: Day-Based Work Order Planning Board & Capacity Panel
   ========================================================================== */

.workspace-day-board {
    display: flex;
    flex-direction: column;
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.board-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--bs-border-color, #e9ecef);
    background: #f8fafc;
    flex-shrink: 0;
}

.board-nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.board-current-period {
    font-weight: 600;
    font-size: 12px;
    color: #1e293b;
    margin-left: 6px;
}

.board-capacity-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: #64748b;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-normal { background-color: #10b981; }
.dot-optimum { background-color: #f59e0b; }
.dot-overload { background-color: #ef4444; }

.board-view-modes {
    display: flex;
    gap: 4px;
}

/* Day Columns Grid */
.day-columns-container {
    flex: 1 1 0;
    overflow-x: auto;
    overflow-y: hidden;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    min-height: 0;
}

.day-columns-grid {
    display: grid;
    width: max-content;
    min-width: 100%;
    height: 100%;
    gap: 1px;
    background: #e2e8f0;
}

.day-column {
    background: #ffffff;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: var(--planning-day-min, 175px);
    overflow: hidden;
}

.day-today {
    background: rgba(13, 110, 253, 0.02);
}

.day-weekend {
    background: #fbfcfe;
}

.day-column-header {
    padding: 8px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
    flex-shrink: 0;
}

.day-today .day-column-header {
    background: rgba(13, 110, 253, 0.1);
}

.day-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.day-name {
    font-weight: 700;
    font-size: 12px;
    color: #1e293b;
}

.day-date {
    font-size: 11px;
    color: #64748b;
}

.day-today-pill {
    font-size: 9px;
    padding: 1px 4px;
}

.day-summary-badge {
    font-size: 10px;
    color: #475569;
    margin-top: 3px;
    display: flex;
    justify-content: center;
    gap: 4px;
    font-weight: 500;
}

.day-column-body {
    flex: 1 1 0;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: background 0.15s ease;
}

.day-column-body.slot-dragover {
    background: rgba(13, 110, 253, 0.15) !important;
    outline: 2px dashed #0d6efd !important;
    outline-offset: -2px;
}

/* Planned Work Order Cards */
.planned-wo-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #0d6efd;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.planned-wo-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.planned-wo-card.card-priority-critical { border-left-color: #dc3545; }
.planned-wo-card.card-priority-high { border-left-color: #fd7e14; }
.planned-wo-card.card-priority-normal { border-left-color: #0d6efd; }
.planned-wo-card.card-priority-low { border-left-color: #94a3b8; }
.planned-wo-card.card-overdue { background: #fef2f2; }

.planned-wo-card.drop-target-above {
    border-top: 3px solid #0d6efd !important;
    transform: translateY(2px);
}

.planned-wo-card.drop-target-below {
    border-bottom: 3px solid #0d6efd !important;
    transform: translateY(-2px);
}

.planned-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.planned-card-seq-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
    padding-bottom: 2px;
    border-bottom: 1px dashed #e2e8f0;
}

.planned-card-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.btn-seq-nav {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 8.5px;
    line-height: 1;
    padding: 1px 4px !important;
    min-width: 0 !important;
    cursor: pointer;
    border-radius: 3px;
}

.btn-seq-nav:hover:not(:disabled) {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-seq-nav:disabled {
    opacity: 0.25;
    cursor: default;
}

.btn-unplan-x {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 8.5px;
    line-height: 1;
    padding: 1px 4px !important;
    min-width: 0 !important;
    cursor: pointer;
    border-radius: 3px;
}

.btn-unplan-x:hover {
    background: #fca5a5;
    color: #991b1b;
}

.planned-card-title {
    display: flex;
    align-items: center;
    gap: 4px;
}

.planned-seq-badge {
    font-size: 8.5px;
    font-weight: 600;
    padding: 1px 4px;
    background: #f8fafc;
    color: #475569;
}

.planned-wo-no {
    font-weight: 700;
    font-size: 11px;
    color: #0f172a;
}

/* Opens the work order in a tab of its own; the number itself still selects the card (Sura, 22.11.2026). */
.card-open-wo {
    border: none;
    background: transparent;
    padding: 0 2px;
    font-size: 11px;
    line-height: 1;
    color: var(--bs-primary, #2563eb);
    opacity: 0.6;
    cursor: pointer;
}

.card-open-wo:hover,
.card-open-wo:focus-visible {
    opacity: 1;
    text-decoration: underline;
}

/* Produced of planned on a planning card; a card showed only the order quantity (Sura, 22.11.2026). */
.card-production-progress {
    height: 3px;
    margin: 4px 0 2px;
    border-radius: 2px;
    background: rgba(148, 163, 184, 0.35);
    overflow: hidden;
    display: flex;
}

.card-production-progress-fill {
    height: 100%;
    background: #16a34a;
}

.card-production-progress-scrap {
    height: 100%;
    background: #dc2626;
}

.card-scrap-qty {
    color: #dc2626;
    font-weight: 600;
}

.card-awaiting-receipt {
    display: inline-block;
    margin: 2px 0;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    color: #166534;
    background: #dcfce7;
}

.day-remaining-qty,
.kpi-remaining {
    color: #b45309;
}

[data-ice-theme="dark"] .card-awaiting-receipt,
[data-bs-theme="dark"] .card-awaiting-receipt {
    color: #bbf7d0;
    background: rgba(22, 163, 74, 0.25);
}

.planned-card-part-name {
    font-size: 11px;
    color: #334155;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.planned-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #64748b;
    margin-bottom: 3px;
}

.card-material-status-row {
    margin-bottom: 4px;
}

.badge-mat-ready {
    background-color: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 8px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    display: inline-block;
}

.badge-mat-partial {
    background-color: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-size: 8px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    display: inline-block;
}

.badge-mat-missing {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.25);
    font-size: 8px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    display: inline-block;
}

.planned-card-ops {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding-top: 4px;
    border-top: 1px dashed #e2e8f0;
}

.op-mini-tag {
    font-size: 8px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 1px 4px;
    white-space: nowrap;
}

.card-op-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: 2px 0;
}

.card-op-mini-pill {
    font-size: 8px;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: 3px;
    padding: 0 4px;
}

.day-empty-drop-target {
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 12px 6px;
    text-align: center;
    background: #fafafa;
}

/* ==========================================================================
   Bottom Panel: Synchronized Work Center Capacity Load Matrix
   ========================================================================== */

/* Bottom-Left: Work Center Names (Under Unplanned Pool) */
.workspace-capacity-wc-labels {
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cap-wc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    height: 30px;
}

.cap-wc-header-title {
    font-weight: 700;
    font-size: 11px;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cap-standard-hint {
    color: #64748b;
    font-size: 9.5px;
}

.cap-wc-labels-list {
    display: flex;
    flex-direction: column;
    max-height: 190px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.cap-wc-label-row {
    height: 38px;
    min-height: 38px;
    padding: 3px 10px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cap-wc-label-row:last-child {
    border-bottom: none;
}

.cap-wc-label-row.row-total-factory {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f1f5f9;
    border-bottom: 2px solid #cbd5e1;
}

.cap-wc-label-row.row-total-factory .cap-wc-name {
    color: #0f172a;
    font-weight: 700;
}

.cap-wc-name {
    font-weight: 600;
    font-size: 10px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cap-wc-code {
    font-size: 8px;
    color: #94a3b8;
}

/* Bottom-Right: Synchronized Capacity Load Cells (Under Day Board) */
.workspace-capacity-matrix-grid {
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cap-matrix-header-spacer {
    height: 30px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 10px;
    color: #64748b;
    font-weight: 600;
    flex-shrink: 0;
    width: max-content;
    min-width: 100%;
}

.cap-matrix-body-scroll {
    max-height: 190px;
    overflow-y: auto;
    overflow-x: visible;
    scrollbar-width: thin;
    width: max-content;
    min-width: 100%;
}

.cap-matrix-days-grid {
    display: grid;
    width: max-content;
    min-width: 100%;
    gap: 1px;
    background: #e2e8f0;
}

.cap-day-column {
    background: #ffffff;
    display: flex;
    flex-direction: column;
    min-width: var(--planning-day-min, 175px);
}

.cap-day-column.cell-today {
    background: rgba(13, 110, 253, 0.02);
}

.cap-day-column.cell-weekend {
    background: #fbfcfe;
}

.cap-cell-wrapper {
    height: 38px;
    min-height: 38px;
    padding: 3px 6px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cap-cell-wrapper:last-child {
    border-bottom: none;
}

.cap-cell-wrapper.row-total-factory {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f1f5f9;
    border-bottom: 2px solid #cbd5e1;
}

.cap-cell-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cap-cell-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
}

.cap-qty-text {
    color: #334155;
    font-weight: 600;
}

.cap-tfoot-row {
    background: #f1f5f9;
    border-top: 2px solid #cbd5e1;
}

.capacity-badge {
    font-size: 8px;
    font-weight: 700;
    padding: 0 3px;
    border-radius: 3px;
}

.badge-cap-normal {
    background-color: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.badge-cap-optimum {
    background-color: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.badge-cap-overload {
    background-color: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    animation: pulse 1.5s infinite;
}

.badge-cap-empty {
    background-color: transparent;
    color: #94a3b8;
}

.capacity-bar-track {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.capacity-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.fill-cap-normal { background-color: #10b981; }
.fill-cap-optimum { background-color: #f59e0b; }
.fill-cap-overload { background-color: #ef4444; }

.workorder-planning-v2-kpi-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 4px;
    width: 100%;
}

.workorder-kpi-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background-color: var(--bs-card-bg, #ffffff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.workorder-kpi-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.kpi-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
}

.kpi-card-unplanned .kpi-icon-wrapper {
    background-color: rgba(255, 152, 0, 0.12);
    color: #f57c00;
}

.kpi-card-planned .kpi-icon-wrapper {
    background-color: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
}

.kpi-card-delayed .kpi-icon-wrapper {
    background-color: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

.kpi-card-delayed.kpi-card-alert {
    border-color: rgba(220, 53, 69, 0.4);
    background-color: rgba(220, 53, 69, 0.03);
}

.kpi-card-progress .kpi-icon-wrapper {
    background-color: rgba(25, 135, 84, 0.12);
    color: #198754;
}

.kpi-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bs-secondary-color, #6c757d);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 2px;
}

.kpi-main-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--bs-body-color, #212529);
}

.kpi-sub-value {
    font-size: 11px;
    color: var(--bs-secondary-color, #6c757d);
    white-space: nowrap;
}

.kpi-progress-bar-wrapper {
    flex: 1 1 auto;
    height: 6px;
    background-color: var(--bs-tertiary-bg, #e9ecef);
    border-radius: 999px;
    overflow: hidden;
    margin-left: 4px;
}

.kpi-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0d6efd, #198754);
    border-radius: inherit;
    transition: width 0.3s ease;
}

.workorder-planning-v2-pivot.pivot-collapsed {
    height: auto !important;
}

.workorder-planning-v2-pivot.pivot-collapsed .workorder-planning-pivot-table {
    display: none !important;
}

/* Dark theme overrides for Work Order Planning V2 */
[data-ice-theme="dark"] .workorder-kpi-card {
    background-color: #242526;
    border-color: #383a3d;
}

[data-ice-theme="dark"] .kpi-main-value {
    color: #e4e6eb;
}

[data-ice-theme="dark"] .kpi-label,
[data-ice-theme="dark"] .kpi-sub-value {
    color: #b0b3b8;
}

[data-ice-theme="dark"] .kpi-progress-bar-wrapper {
    background-color: #3a3b3c;
}

/* Bootstrap utilities (bg-light, text-dark, border*, *-subtle, table-light)
   read CSS variables that the DX dark theme leaves at their LIGHT values;
   re-point them once per scope instead of fighting their !important rules. */
[data-ice-theme="dark"] .workorder-planning-v2-workspace-container,
[data-ice-theme="dark"] .v2-popup-body {
    --bs-border-color: #383a3d;
    --bs-light-rgb: 47, 48, 49;
    --bs-dark-rgb: 228, 230, 235;
    --bs-info-rgb: 8, 60, 90;
    --bs-warning-bg-subtle: rgba(245, 158, 11, 0.12);
    --bs-warning-border-subtle: rgba(245, 158, 11, 0.35);
    --bs-warning-text-emphasis: #fcd34d;
    --bs-info-bg-subtle: rgba(56, 189, 248, 0.12);
    --bs-info-border-subtle: rgba(56, 189, 248, 0.35);
    --bs-info-text-emphasis: #7dd3fc;
}

/* Panels and toolbars */
[data-ice-theme="dark"] .workspace-top-filter-bar,
[data-ice-theme="dark"] .workspace-unplanned-pool,
[data-ice-theme="dark"] .workspace-day-board,
[data-ice-theme="dark"] .workspace-capacity-wc-labels,
[data-ice-theme="dark"] .workspace-capacity-matrix-grid {
    background: #242526;
    border-color: #383a3d;
}

[data-ice-theme="dark"] .pool-header,
[data-ice-theme="dark"] .board-toolbar,
[data-ice-theme="dark"] .cap-wc-header,
[data-ice-theme="dark"] .cap-matrix-header-spacer {
    background: #2f3031;
    border-color: #383a3d;
}

[data-ice-theme="dark"] .pool-title,
[data-ice-theme="dark"] .board-current-period {
    color: #e4e6eb;
}

[data-ice-theme="dark"] .pool-count-badge {
    background: #3a3b3c;
    color: #c9ccd1;
}

[data-ice-theme="dark"] .board-capacity-legend,
[data-ice-theme="dark"] .cap-standard-hint,
[data-ice-theme="dark"] .cap-matrix-header-spacer,
[data-ice-theme="dark"] .pool-empty-state {
    color: #b0b3b8;
}

[data-ice-theme="dark"] .cap-wc-header-title {
    color: #c9ccd1;
}

[data-ice-theme="dark"] .priority-pill {
    background: #2f3031;
    border-color: #4a4b4d;
    color: #b0b3b8;
}

[data-ice-theme="dark"] .global-search-dxtext .dxbl-text-edit {
    background: #2f3031;
    border-color: #4a4b4d;
}

[data-ice-theme="dark"] .global-search-dxtext .dxbl-text-edit:focus-within {
    background: #242526;
}

/* Day board grid */
[data-ice-theme="dark"] .day-columns-container {
    background: #242526;
    border-bottom-color: #383a3d;
}

[data-ice-theme="dark"] .day-columns-grid,
[data-ice-theme="dark"] .cap-matrix-days-grid {
    background: #383a3d;
}

[data-ice-theme="dark"] .day-column,
[data-ice-theme="dark"] .cap-day-column {
    background: #242526;
}

[data-ice-theme="dark"] .day-weekend,
[data-ice-theme="dark"] .cap-day-column.cell-weekend {
    background: #222324;
}

[data-ice-theme="dark"] .day-today,
[data-ice-theme="dark"] .cap-day-column.cell-today {
    background: rgba(13, 110, 253, 0.08);
}

[data-ice-theme="dark"] .day-column-header {
    background: #2f3031;
    border-bottom-color: #383a3d;
}

[data-ice-theme="dark"] .day-today .day-column-header {
    background: rgba(13, 110, 253, 0.22);
}

[data-ice-theme="dark"] .day-name {
    color: #e4e6eb;
}

[data-ice-theme="dark"] .day-date,
[data-ice-theme="dark"] .day-summary-badge {
    color: #b0b3b8;
}

[data-ice-theme="dark"] .day-column.day-non-working,
[data-ice-theme="dark"] .cap-day-column.day-non-working {
    background: repeating-linear-gradient(
        -45deg,
        #202122,
        #202122 10px,
        #28292b 10px,
        #28292b 20px
    ) !important;
    border-color: #383a3d !important;
}

[data-ice-theme="dark"] .day-empty-drop-target {
    background: #202122;
    border-color: #4a4b4d;
}

/* Cards */
[data-ice-theme="dark"] .unplanned-card,
[data-ice-theme="dark"] .planned-wo-card {
    background: #2b2c2e;
    border-top-color: #4a4b4d;
    border-right-color: #4a4b4d;
    border-bottom-color: #4a4b4d;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

[data-ice-theme="dark"] .card-wo-no,
[data-ice-theme="dark"] .planned-wo-no {
    color: #e4e6eb;
}

[data-ice-theme="dark"] .card-part-name,
[data-ice-theme="dark"] .planned-card-part-name {
    color: #c9ccd1;
}

[data-ice-theme="dark"] .card-customer-row {
    color: #b0b3b8;
}

[data-ice-theme="dark"] .card-customer-row .customer-icon {
    color: #8a8d91;
}

[data-ice-theme="dark"] .card-bottom-row,
[data-ice-theme="dark"] .planned-card-meta {
    color: #b0b3b8;
}

[data-ice-theme="dark"] .card-drag-hint {
    color: #8a8d91;
}

[data-ice-theme="dark"] .card-actions-row,
[data-ice-theme="dark"] .planned-card-seq-row,
[data-ice-theme="dark"] .planned-card-ops {
    border-color: #3f4143;
}

[data-ice-theme="dark"] .unplanned-card.card-overdue {
    background: rgba(220, 53, 69, 0.1);
}

[data-ice-theme="dark"] .planned-wo-card.card-overdue {
    background: rgba(220, 53, 69, 0.12);
}

[data-ice-theme="dark"] .unplanned-card.card-selected,
[data-ice-theme="dark"] .planned-wo-card.card-selected {
    background: rgba(13, 110, 253, 0.18) !important;
}

[data-ice-theme="dark"] .planned-seq-badge {
    background: #3a3b3c;
    color: #c9ccd1;
}

[data-ice-theme="dark"] .btn-seq-nav {
    background: #3a3b3c;
    border-color: #4a4b4d;
    color: #c9ccd1;
}

[data-ice-theme="dark"] .btn-seq-nav:hover:not(:disabled) {
    background: #4a4b4d;
    color: #e4e6eb;
}

[data-ice-theme="dark"] .btn-unplan-x {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

[data-ice-theme="dark"] .btn-unplan-x:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fecaca;
}

[data-ice-theme="dark"] .card-so-badge {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.35);
    color: #7dd3fc;
}

[data-ice-theme="dark"] .op-mini-tag {
    background: #3a3b3c;
    border-color: #4a4b4d;
    color: #c9ccd1;
}

[data-ice-theme="dark"] .card-op-mini-pill {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

[data-ice-theme="dark"] .badge-mat-ready { color: #34d399; }
[data-ice-theme="dark"] .badge-mat-partial { color: #fbbf24; }
[data-ice-theme="dark"] .badge-mat-missing { color: #f87171; }

/* Pool bulk selection bar */
[data-ice-theme="dark"] .pool-bulk-action-bar {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
}

[data-ice-theme="dark"] .bulk-info-row,
[data-ice-theme="dark"] .bulk-main-stat {
    color: #7dd3fc;
}

[data-ice-theme="dark"] .bulk-mat-pill.pill-ready {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

[data-ice-theme="dark"] .bulk-mat-pill.pill-missing {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

[data-ice-theme="dark"] .bulk-op-stat {
    background: #3a3b3c;
    border-color: #4a4b4d;
    color: #c9ccd1;
}

/* Capacity matrix */
[data-ice-theme="dark"] .cap-wc-label-row,
[data-ice-theme="dark"] .cap-cell-wrapper {
    border-bottom-color: #383a3d;
}

[data-ice-theme="dark"] .cap-wc-label-row.row-total-factory,
[data-ice-theme="dark"] .cap-cell-wrapper.row-total-factory {
    background: #2f3031;
    border-bottom-color: #4a4b4d;
}

[data-ice-theme="dark"] .cap-wc-label-row.row-total-factory .cap-wc-name {
    color: #e4e6eb;
}

[data-ice-theme="dark"] .cap-wc-name {
    color: #c9ccd1;
}

[data-ice-theme="dark"] .cap-wc-code {
    color: #8a8d91;
}

[data-ice-theme="dark"] .cap-qty-text {
    color: #c9ccd1;
}

[data-ice-theme="dark"] .capacity-bar-track {
    background: #3a3b3c;
}

[data-ice-theme="dark"] .badge-cap-normal { color: #34d399; }
[data-ice-theme="dark"] .badge-cap-optimum { color: #fbbf24; }
[data-ice-theme="dark"] .badge-cap-overload { color: #f87171; }
[data-ice-theme="dark"] .badge-cap-empty { color: #8a8d91; }

[data-ice-theme="dark"] .cap-cell-non-working {
    background-color: rgba(58, 59, 60, 0.5);
    color: #8a8d91;
}

/* Non-working / holiday badges */
[data-ice-theme="dark"] .non-working-badge {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

[data-ice-theme="dark"] .holiday-special-badge {
    background-color: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fcd34d;
}

/* Due-date lens paints card backgrounds with !important light tints */
[data-ice-theme="dark"] .lens-duedate .card-risk-overdue { background: rgba(239, 68, 68, 0.12) !important; }
[data-ice-theme="dark"] .lens-duedate .card-risk-imminent { background: rgba(245, 158, 11, 0.12) !important; }
[data-ice-theme="dark"] .lens-duedate .card-risk-ontime { background: rgba(16, 185, 129, 0.12) !important; }

/* Routing flow popup content */
[data-ice-theme="dark"] .routing-kpi-pill {
    background: #2f3031;
    border-color: #4a4b4d;
}

[data-ice-theme="dark"] .routing-kpi-pill .kpi-title {
    color: #b0b3b8;
}

[data-ice-theme="dark"] .routing-section-title {
    color: #e4e6eb;
}

[data-ice-theme="dark"] .routing-stepper-track {
    background: #242526;
    border-color: #383a3d;
}

[data-ice-theme="dark"] .routing-stepper-node {
    background: #2f3031;
    border-color: #4a4b4d;
}

[data-ice-theme="dark"] .routing-stepper-node.node-completed {
    background: rgba(25, 135, 84, 0.18);
    border-color: rgba(25, 135, 84, 0.45);
}

[data-ice-theme="dark"] .routing-stepper-node.node-inprogress {
    background: rgba(13, 110, 253, 0.18);
    border-color: rgba(13, 110, 253, 0.45);
}

[data-ice-theme="dark"] .routing-stepper-node .node-name {
    color: #e4e6eb;
}

[data-ice-theme="dark"] .routing-stepper-node .node-wc {
    color: #b0b3b8;
}

[data-ice-theme="dark"] .stepper-line {
    color: #4a4b4d;
}

[data-ice-theme="dark"] .routing-ops-table th,
[data-ice-theme="dark"] .routing-ops-table td {
    color: #c9ccd1;
}

[data-ice-theme="dark"] .v2-popup-body .table-light {
    --bs-table-bg: #2f3031;
    --bs-table-color: #c9ccd1;
    --bs-table-border-color: #383a3d;
}

[data-ice-theme="dark"] .routing-progress-track {
    background: #3a3b3c;
}

/* BOM drilldown popup content */
[data-ice-theme="dark"] .bom-kpi-summary-card {
    background: #2f3031;
    border-color: #4a4b4d;
}

[data-ice-theme="dark"] .bom-kpi-label {
    color: #b0b3b8;
}

[data-ice-theme="dark"] .bom-kpi-val {
    color: #e4e6eb;
}

[data-ice-theme="dark"] .bom-progress-bar-track {
    background: #3a3b3c;
}

[data-ice-theme="dark"] .bom-components-table th {
    background: #2f3031;
    color: #c9ccd1;
    border-bottom-color: #4a4b4d;
}

[data-ice-theme="dark"] .bom-components-table td {
    border-bottom-color: #383a3d;
}

[data-ice-theme="dark"] .bom-components-table tr:hover {
    background-color: #313234;
}

[data-ice-theme="dark"] .bom-comp-code {
    color: #e4e6eb;
}

[data-ice-theme="dark"] .bom-comp-name {
    color: #b0b3b8;
}

[data-ice-theme="dark"] .badge-supply-stock {
    background-color: rgba(56, 189, 248, 0.15);
    color: #7dd3fc;
}

[data-ice-theme="dark"] .badge-supply-po {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

[data-ice-theme="dark"] .badge-supply-prod {
    background-color: rgba(167, 139, 250, 0.18);
    color: #c4b5fd;
}

@media (max-width: 1200px) {
    .workorder-planning-v2-kpi-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Nested batch grids are edited directly in cells; keep New and hide Detail View navigation. */
.nested-frame .xaf-grid-batchedit-mode button[data-action-id="ListViewShowObject"] {
    display: none !important;
}

@media (max-width: 1200px) {
    .workorder-planning-main {
        height: calc(100dvh - 120px);
    }
}

@media (max-width: 992px) {
    .workorder-planning-top-row > .dxbl-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .workorder-planning-main {
        height: calc(100dvh - 96px);
    }
}

/* V2 planning board on narrow panes (a side-by-side preview, a small laptop):
   first a slimmer pool and narrower day columns, below 860px the pool stacks
   above the board as a horizontal card strip and the capacity name column is
   left to the cell tooltips. */
@media (max-width: 1150px) {
    .workorder-planning-v2-workspace-container {
        --planning-day-min: 140px;
    }

    .workspace-main-content {
        grid-template-columns: 230px minmax(0, 1fr);
        gap: 6px 8px;
    }

    .global-search-wrapper {
        min-width: 170px;
    }

    /* KPIs stay on one compact row instead of a 2x2 block that eats the board's height. */
    .workorder-planning-v2-kpi-container {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    .workorder-planning-v2-kpi-container .workorder-kpi-card {
        padding: 6px 8px;
        gap: 6px;
    }

    .workorder-planning-v2-kpi-container .kpi-icon-wrapper {
        display: none;
    }

    .workorder-planning-v2-kpi-container .kpi-label {
        font-size: 9.5px;
        letter-spacing: 0.2px;
    }

    .workorder-planning-v2-kpi-container .kpi-main-value {
        font-size: 16px;
    }

    /* Buttons wrap as whole buttons, never split their caption over two lines. */
    .workspace-top-filter-bar .dxbl-btn,
    .board-toolbar .dxbl-btn {
        white-space: nowrap;
    }

    .board-toolbar {
        flex-wrap: wrap;
        gap: 6px;
        padding: 6px 8px;
    }

    .board-current-period {
        white-space: nowrap;
    }

    .board-capacity-legend {
        display: none;
    }

    .pool-title-row {
        flex-wrap: wrap;
        gap: 4px;
    }

    .pool-count-badge {
        white-space: nowrap;
    }
}

@media (max-width: 860px) {
    /* Too narrow to fit pool, board and capacity into one fixed-height frame: the
       workspace scrolls vertically and the board keeps a usable height. */
    .workorder-planning-v2-workspace-container {
        overflow-y: auto;
    }

    .workspace-main-content {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(340px, auto) auto;
        flex: 0 0 auto;
        overflow: visible;
    }

    .workspace-day-board {
        min-height: 340px;
    }

    .workorder-planning-v2-kpi-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .workspace-top-filter-bar .d-flex {
        flex-wrap: wrap;
    }

    .workspace-top-filter-bar .border-start {
        border-left: none !important;
        padding-left: 0 !important;
        margin-left: 0 !important;
    }

    .global-search-wrapper {
        flex: 1 1 100%;
        max-width: none;
    }

    .workspace-unplanned-pool {
        height: auto;
        max-height: 300px;
    }

    .pool-cards-list {
        flex: 0 0 auto;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .pool-cards-list .unplanned-card {
        min-width: 230px;
        max-width: 260px;
        flex: 0 0 auto;
    }

    .workspace-capacity-wc-labels {
        display: none;
    }
}

/* ── CRP Capacity Load Analysis ─────────────────────────────────────── */
.crp-analysis-main {
    height: calc(100dvh - 180px);
}

.crp-matrix {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 6px;
}

.crp-matrix-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.crp-matrix-runinfo {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--bs-body-color, #445);
}

.crp-matrix-legend {
    display: flex;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--bs-secondary-color, #556);
}

.crp-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.crp-legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.15));
}

.crp-matrix-empty {
    padding: 24px;
    text-align: center;
    color: var(--bs-secondary-color, #778);
    font-style: italic;
}

.crp-matrix-scroll {
    overflow: auto;
    flex: 1 1 auto;
    border: 1px solid var(--bs-border-color, #dde);
    border-radius: 6px;
}

.crp-matrix-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    table-layout: fixed;
    font-size: 0.78rem;
}

.crp-matrix-table th,
.crp-matrix-table td {
    border-right: 1px solid var(--bs-border-color, #e3e6ee);
    border-bottom: 1px solid var(--bs-border-color, #e3e6ee);
    padding: 4px 6px;
    white-space: nowrap;
    box-sizing: border-box;
}

.crp-matrix-colhead {
    background: var(--bs-tertiary-bg, #f8fafc);
    color: var(--bs-secondary-color, #475569);
    font-weight: 600;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 5;
    cursor: pointer;
    width: 86px;
    min-width: 86px;
    max-width: 86px;
    font-size: 11.5px;
    letter-spacing: 0.3px;
    padding: 6px 4px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 2px solid var(--bs-border-color, #e2e8f0) !important;
}

.crp-colhead-selected {
    outline: 2px solid #4f46e5;
    outline-offset: -2px;
    background: #e0e7ff !important;
}

.crp-matrix-rowhead-header {
    background: var(--bs-tertiary-bg, #f8fafc);
    color: var(--bs-secondary-color, #475569);
    position: sticky;
    left: 0;
    top: 0;
    z-index: 10;
    text-align: left;
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    padding: 6px 10px !important;
    font-weight: 600;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
    border-right: 2px solid var(--bs-border-color, #cbd5e1) !important;
    border-bottom: 2px solid var(--bs-border-color, #e2e8f0) !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crp-matrix-rowhead {
    background: var(--bs-body-bg, #fbfcfe);
    position: sticky;
    left: 0;
    z-index: 4;
    cursor: pointer;
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 5px 8px !important;
    border-right: 2px solid var(--bs-border-color, #cbd5e1) !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.04);
}

.crp-row-wc .crp-matrix-rowhead {
    font-weight: 600;
    background: var(--bs-secondary-bg, #f1f5f9);
}

.crp-matrix-rowhead-machine {
    padding-left: 22px !important;
    font-weight: 400;
    background: var(--bs-body-bg, #ffffff);
}

.crp-rowhead-code {
    font-weight: 600;
    font-size: 11.5px;
}

.crp-rowhead-name {
    color: var(--bs-secondary-color, #64748b);
    margin-left: 4px;
    font-weight: 400;
    font-size: 11px;
}

.crp-expander {
    display: inline-block;
    width: 14px;
    color: var(--bs-secondary-color, #64748b);
    font-size: 11px;
    cursor: pointer;
}

.crp-matrix-cell {
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    width: 86px;
    min-width: 86px;
    max-width: 86px;
    font-family: var(--bs-font-monospace, monospace);
    font-size: 11.5px;
    padding: 4px 2px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.1s ease;
}

.crp-matrix-table tr:hover td:not(.crp-matrix-rowhead) {
    filter: brightness(0.96);
}

.crp-row-wc:hover .crp-matrix-rowhead,
.crp-row-machine:hover .crp-matrix-rowhead {
    background: #e2e8f0 !important;
}

.crp-cell-empty {
    background: var(--bs-tertiary-bg, #f8fafc);
    color: var(--bs-tertiary-color, #cbd5e1);
    cursor: default;
}

.crp-cell-idle {
    background: var(--bs-body-bg, #ffffff);
    color: #94a3b8;
}

.crp-cell-ok {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #047857 !important;
    font-weight: 500;
}

.crp-cell-warning {
    background: rgba(245, 158, 11, 0.14) !important;
    color: #b45309 !important;
    font-weight: 600;
}

.crp-cell-overload {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #b91c1c !important;
    font-weight: 700;
}

.crp-cell-selected {
    outline: 2px solid #4f46e5 !important;
    outline-offset: -2px;
}

.crp-chart {
    flex: 0 0 auto;
    border: 1px solid var(--bs-border-color, #dde);
    border-radius: 6px;
    padding: 8px 10px 4px 10px;
}

.crp-chart-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bs-body-color, #445);
    margin-bottom: 4px;
    min-height: 1em;
}

.crp-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 110px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.crp-chart-bucket {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    width: 86px;
    min-width: 86px;
    max-width: 86px;
}

.crp-chart-bar-area {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 86px;
}

.crp-chart-bar-capacity {
    width: 16px;
    background: var(--bs-secondary-bg, #c9d4e8);
    border-radius: 2px 2px 0 0;
}

.crp-chart-bar-load {
    width: 16px;
    background: var(--bs-success, #4d8f56);
    border-radius: 2px 2px 0 0;
}

.crp-chart-bar-overload {
    background: var(--bs-danger, #c4453a);
}

.crp-chart-bucket-label {
    font-size: 0.65rem;
    color: var(--bs-secondary-color, #667);
    margin-top: 2px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .crp-analysis-main {
        height: calc(100dvh - 96px);
    }
}

/* ── CRP Gantt (read-only) ──────────────────────────────────────────── */
.crp-gantt {
    display: flex;
    flex-direction: column;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    gap: 8px;
}

.crp-gantt-scroll {
    overflow: auto;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    border: 1px solid var(--bs-border-color, #dde);
    border-radius: 6px;
    padding-bottom: 4px;
    scrollbar-gutter: stable;
}

.crp-gantt-axis {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 6;
    background: var(--bs-tertiary-bg, #f8fafc);
    border-bottom: 2px solid var(--bs-border-color, #cbd5e1);
    height: 46px;
}

.crp-gantt-rowhead {
    flex: 0 0 240px;
    min-width: 240px;
    max-width: 240px;
    padding: 4px 8px;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 2px solid var(--bs-border-color, #cbd5e1);
    background: var(--bs-body-bg, #fbfcfe);
    position: sticky;
    left: 0;
    z-index: 3;
}

.crp-gantt-axis .crp-gantt-rowhead {
    z-index: 10;
    background: var(--bs-tertiary-bg, #f8fafc);
}

/* K-71: the component sizes the track - 400 px a working day, 40 px a day nobody works. */
.crp-gantt-axis-track,
.crp-gantt-track {
    position: relative;
    flex: 0 0 auto;
}

.crp-gantt-dayhead {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 1px solid var(--bs-border-color, #cbd5e1);
    overflow: hidden;
    white-space: nowrap;
}

.crp-gantt-dayhead-date {
    display: block;
    padding: 4px 6px 0;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--bs-body-color, #334155);
}

.crp-gantt-dayhead-sub {
    display: block;
    padding: 5px 0 0;
    font-size: 0.66rem;
    color: var(--bs-secondary-color, #667);
}

.crp-gantt-dayhead-rest {
    background: var(--bs-secondary-bg, #eef1f7);
    text-align: center;
}

.crp-gantt-dayhead-rest .crp-gantt-dayhead-date {
    padding: 4px 0 0;
    font-size: 0.62rem;
    font-weight: 500;
}

/* An hour of the working window, in the axis's second row. */
.crp-gantt-tick {
    position: absolute;
    top: 26px;
    padding-left: 3px;
    border-left: 1px solid var(--bs-border-color, #cbd5e1);
    font-size: 0.66rem;
    line-height: 16px;
    color: var(--bs-secondary-color, #667);
    white-space: nowrap;
}

/* A day's column in a lane: its border, and a line every hour (--crp-hour is the hour's width). */
.crp-gantt-daycol {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 1px solid var(--bs-border-color, #cbd5e1);
    background-image: repeating-linear-gradient(to right,
        transparent 0,
        transparent calc(var(--crp-hour) - 1px),
        var(--crp-gantt-hourline, rgba(15, 23, 42, 0.07)) calc(var(--crp-hour) - 1px),
        var(--crp-gantt-hourline, rgba(15, 23, 42, 0.07)) var(--crp-hour));
}

.crp-gantt-daycol-rest {
    background: var(--bs-secondary-bg, #eef1f7);
}

.crp-gantt-lane {
    display: flex;
    border-bottom: 1px solid var(--bs-border-color-translucent, #f0f2f7);
}

.crp-gantt-lane-wc .crp-gantt-rowhead {
    background: var(--bs-secondary-bg, #eef1f7);
    font-weight: 600;
}

.crp-gantt-lane-wc .crp-gantt-track {
    min-height: 8px;
    background: var(--bs-tertiary-bg, #f7f8fb);
}

.crp-gantt-rowhead-machine {
    padding-left: 14px;
}

.crp-gantt-bar {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 5px;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.7rem;
    line-height: 13px;
    padding: 1px 3px;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.crp-gantt-bar-wo {
    background: var(--bs-primary, #3b6fd4);
}

.crp-gantt-bar-mrp {
    background: #d99114;
}

/* Two lines: the work order, then the operation and its hours. */
.crp-gantt-bar-line {
    position: relative;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

/* The part of the bar beyond the machine's capacity for the day. */
.crp-gantt-bar-overflow,
.crp-gantt-swatch-overflow {
    background: repeating-linear-gradient(135deg, #dc2626 0 6px, #b91c1c 6px 12px);
}

.crp-gantt-bar-overflow {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* An expanded machine: a bar too short for its label has it beside the bar. */
.crp-gantt-bar-beside {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 0.7rem;
    line-height: 13px;
    color: var(--bs-body-color, #334155);
    white-space: nowrap;
    overflow: hidden;
}

/* ▸ / ▾ opens a machine into a row per operation; the toolbar opens or closes them all. */
.crp-gantt-rowhead-toggle {
    cursor: pointer;
}

.crp-gantt-rowhead-toggle:hover {
    background: var(--bs-tertiary-bg, #f1f5f9);
}

.crp-gantt-toolbar-end {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* The day's load that does not fit in the working window at all. */
.crp-gantt-marker {
    position: absolute;
    z-index: 2;
    border-radius: 5px;
    background: #b91c1c;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.crp-gantt-bar-line:first-child {
    font-weight: 600;
}

.crp-gantt-bar-detail {
    opacity: 0.9;
}

/* The machine's load / capacity for the day, coloured by the load matrix's crp-cell-* classes. */
.crp-gantt-daycell {
    position: absolute;
    top: 4px;
    border-radius: 4px;
    font-family: var(--bs-font-monospace, monospace);
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

.crp-analysis-gantt-panel {
    height: 100%;
}

/* ── CRP karanlik tema düzeltmeleri ─────────────────────────────────────
   DX fluent-dark bazi Bootstrap degiskenlerini ACIK degerlerde birakir
   (secondary-bg, border-color ve *-bg-subtle/-text-emphasis paletleri).
   theme-detect.js <html data-ice-theme> damgasini basar; bu blok yalniz
   CRP yuzeyleri icin karanliga uygun degerleri saglar. */
[data-ice-theme="dark"] .crp-matrix-scroll,
[data-ice-theme="dark"] .crp-chart,
[data-ice-theme="dark"] .crp-gantt-scroll {
    border-color: #4a4a4a;
}

[data-ice-theme="dark"] .crp-matrix-table th,
[data-ice-theme="dark"] .crp-matrix-table td {
    border-color: #454545;
}

[data-ice-theme="dark"] .crp-matrix-colhead,
[data-ice-theme="dark"] .crp-matrix-rowhead-header {
    background: #3a3a3a;
    color: #fff;
}

[data-ice-theme="dark"] .crp-matrix-rowhead {
    background: #2f2f2f;
}

[data-ice-theme="dark"] .crp-row-wc .crp-matrix-rowhead,
[data-ice-theme="dark"] .crp-gantt-lane-wc .crp-gantt-rowhead {
    background: #3a3a3a;
}

[data-ice-theme="dark"] .crp-cell-idle {
    background: #2c2c2c;
}

[data-ice-theme="dark"] .crp-cell-empty {
    background: #242424;
    color: rgba(255, 255, 255, 0.28);
}

/* The light rules colour these cells with !important, so the dark ones must too (K-49). */
[data-ice-theme="dark"] .crp-cell-ok {
    background: #17391c !important;
    color: #7fd18b !important;
}

[data-ice-theme="dark"] .crp-cell-warning {
    background: #46350c !important;
    color: #ecc36a !important;
}

[data-ice-theme="dark"] .crp-cell-overload {
    background: #4a1c18 !important;
    color: #f1948a !important;
}

[data-ice-theme="dark"] .crp-legend-swatch {
    border-color: rgba(255, 255, 255, 0.25);
}

[data-ice-theme="dark"] .crp-gantt-axis {
    background: #3a3a3a;
    border-bottom-color: #4a4a4a;
}

[data-ice-theme="dark"] .crp-gantt-rowhead {
    background: #2f2f2f;
    border-right-color: #4a4a4a;
}

[data-ice-theme="dark"] .crp-gantt-lane {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-ice-theme="dark"] .crp-gantt-daycol {
    --crp-gantt-hourline: rgba(255, 255, 255, 0.07);
    border-left-color: #4a4a4a;
}

[data-ice-theme="dark"] .crp-gantt-daycol-rest,
[data-ice-theme="dark"] .crp-gantt-dayhead-rest {
    background: #262626;
}

[data-ice-theme="dark"] .crp-gantt-dayhead,
[data-ice-theme="dark"] .crp-gantt-tick {
    border-left-color: #4a4a4a;
}

[data-ice-theme="dark"] .crp-gantt-rowhead-toggle:hover {
    background: #3a3a3a;
}

[data-ice-theme="dark"] .crp-gantt-lane-wc .crp-gantt-track {
    background: #2c2c2c;
}

/* ==========================================================================
   Work Order Planning V2 - Routing Flow & Interactive Mini Gantt
   ========================================================================== */

button.card-routing-flow,
.card-routing-flow {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 3px 6px;
    margin-top: 5px;
    cursor: pointer;
    flex-wrap: wrap;
    transition: all 0.15s ease;
    width: 100%;
    text-align: left;
    outline: none;
}

button.card-routing-flow:hover,
.card-routing-flow:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-routing-modal-open {
    background: transparent;
    border: none;
    padding: 1px 4px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    opacity: 0.75;
}

.btn-routing-modal-open:hover {
    opacity: 1;
    transform: scale(1.15);
    background: rgba(13, 110, 253, 0.12);
}

.routing-step {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 9.5px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    line-height: 1.2;
}

.routing-step.step-planned {
    background: #e2e8f0;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.routing-step.step-in-progress {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.routing-step.step-completed {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.routing-step .step-seq {
    font-weight: 700;
    font-size: 8.5px;
    opacity: 0.85;
}

.routing-step .step-wc {
    font-weight: 600;
}

.step-arrow {
    font-size: 8px;
    color: #94a3b8;
    margin: 0 1px;
}

.routing-flow-info-icon {
    font-size: 10px;
    margin-left: auto;
    opacity: 0.65;
}

/* Routing Flow Modal Styles */
.routing-modal-container {
    padding: 4px;
}

.routing-modal-header-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
}

.routing-kpi-pill {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.routing-kpi-pill .kpi-title {
    font-size: 10px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
}

.routing-kpi-pill .kpi-val {
    font-size: 13px;
    font-weight: 700;
}

.routing-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.routing-stepper-track {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.routing-stepper-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 140px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    transition: all 0.2s ease;
}

.routing-stepper-node.node-completed {
    border-color: #86efac;
    background: #f0fdf4;
}

.routing-stepper-node.node-inprogress {
    border-color: #93c5fd;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}

.routing-stepper-node .node-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #0d6efd;
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.routing-stepper-node.node-completed .node-circle {
    background: #198754;
}

.routing-stepper-node.node-planned .node-circle {
    background: #64748b;
}

.routing-stepper-node .node-name {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 4px;
}

.routing-stepper-node .node-wc {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 6px;
}

.node-status-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
}

.stepper-line {
    font-size: 16px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stepper-line.line-completed {
    color: #198754;
}

.routing-ops-table {
    font-size: 12px;
}

.routing-ops-table th {
    font-weight: 600;
    font-size: 11.5px;
    color: #475569;
    padding: 6px 8px;
}

.routing-ops-table td {
    padding: 6px 8px;
}

.routing-progress-track {
    height: 14px;
    background: #e2e8f0;
}

/* Inline Card Ops Drawer */
.card-inline-ops-drawer {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 8px;
    margin-top: 5px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.03);
    animation: iceDrawerSlideDown 0.15s ease-out;
}

.inline-op-item {
    font-size: 11px;
}

.inline-op-item:last-child {
    border-bottom: none !important;
}

@keyframes iceDrawerSlideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Work Order Planning V2: Color Lens & Card Styling
   ========================================================================== */

/* 1. Material Lens */
.lens-material .card-mat-ready {
    border-left-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.04);
}
.lens-material .card-mat-partial {
    border-left-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.04);
}
.lens-material .card-mat-missing {
    border-left-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.04);
}

/* 2. Due Date Risk Lens */
.lens-duedate .card-risk-overdue {
    border-left-color: #ef4444 !important;
    background: #fff1f2 !important;
}
.lens-duedate .card-risk-imminent {
    border-left-color: #f59e0b !important;
    background: #fffbeb !important;
}
.lens-duedate .card-risk-ontime {
    border-left-color: #10b981 !important;
    background: #f0fdf4 !important;
}

/* 3. Customer Lens */
.lens-customer .card-cust-0 { border-left-color: #3b82f6 !important; }
.lens-customer .card-cust-1 { border-left-color: #8b5cf6 !important; }
.lens-customer .card-cust-2 { border-left-color: #10b981 !important; }
.lens-customer .card-cust-3 { border-left-color: #f59e0b !important; }
.lens-customer .card-cust-4 { border-left-color: #ec4899 !important; }
.lens-customer .card-cust-5 { border-left-color: #06b6d4 !important; }
.lens-customer .card-cust-6 { border-left-color: #6366f1 !important; }
.lens-customer .card-cust-7 { border-left-color: #14b8a6 !important; }

/* ==========================================================================
   Work Order Planning V2: Card Density Modes
   ========================================================================== */

.density-compact .unplanned-card,
.density-compact .planned-wo-card {
    padding: 3px 6px !important;
    min-height: 44px;
}

.density-compact .card-customer-row {
    display: none !important;
}

.density-compact .planned-card-part-name,
.density-compact .card-part-name {
    font-size: 10px !important;
    margin-bottom: 2px !important;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.density-compact .planned-card-seq-row {
    margin-bottom: 1px !important;
    padding-bottom: 1px !important;
}

.density-compact .planned-card-meta,
.density-compact .card-meta-row {
    font-size: 9px !important;
    margin-bottom: 0 !important;
}

.density-compact .card-material-status-row {
    margin-bottom: 1px !important;
}

.density-compact .badge-mat-ready,
.density-compact .badge-mat-partial,
.density-compact .badge-mat-missing,
.density-compact .card-so-badge {
    font-size: 7.5px !important;
    padding: 0 3px !important;
}

/* ==========================================================================
   BOM Material Shortage Drilldown Modal
   ========================================================================== */

.bom-kpi-summary-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
}

.bom-kpi-item {
    display: flex;
    flex-direction: column;
}

.bom-kpi-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.bom-kpi-val {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.bom-progress-wrapper {
    flex: 1;
    min-width: 160px;
}

.bom-progress-bar-track {
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 4px;
}

.bom-progress-bar-fill {
    height: 100%;
    background: #10b981;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.bom-progress-bar-fill.fill-shortage {
    background: #ef4444;
}

.bom-progress-bar-fill.fill-partial {
    background: #f59e0b;
}

.bom-components-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.bom-components-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 2px solid #cbd5e1;
    font-size: 11px;
}

.bom-components-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.bom-components-table tr:hover {
    background-color: #f8fafc;
}

.bom-comp-code {
    font-weight: 600;
    color: #0f172a;
}

.bom-comp-name {
    font-size: 11px;
    color: #475569;
}

.badge-supply-stock {
    background-color: #e0f2fe;
    color: #0284c7;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.badge-supply-po {
    background-color: #fef3c7;
    color: #d97706;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.badge-supply-prod {
    background-color: #f3e8ff;
    color: #7c3aed;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ==========================================================================
   Production Working Calendar & Non-Working Days / Holidays
   ========================================================================== */
.day-column.day-non-working {
    background: repeating-linear-gradient(
        -45deg,
        #f8fafc,
        #f8fafc 10px,
        #f1f5f9 10px,
        #f1f5f9 20px
    ) !important;
    border-color: #cbd5e1 !important;
}

.day-header.header-non-working {
    background-color: #e2e8f0 !important;
    color: #64748b !important;
    border-bottom: 2px solid #cbd5e1 !important;
}

.non-working-badge {
    background-color: #fee2e2;
    color: #b91c1c;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #fca5a5;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 130px;
    display: inline-block;
}

.holiday-special-badge {
    background-color: #fef3c7;
    color: #b45309;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #fcd34d;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 140px;
    display: inline-block;
}

.cap-day-column.day-non-working {
    background: repeating-linear-gradient(
        -45deg,
        #f8fafc,
        #f8fafc 10px,
        #f1f5f9 10px,
        #f1f5f9 20px
    ) !important;
}

.cap-cell-non-working {
    background-color: rgba(241, 245, 249, 0.7);
    color: #94a3b8;
    font-size: 10px;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-date-picker-wrapper {
    min-width: 140px;
    max-width: 155px;
}

.nav-date-picker-wrapper .dxbl-edit {
    height: 28px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
}

/* ==========================================================================
   MRP Run Visual Cockpit & Workspace
   Aligned with Product & Work Order Structure Explorers (compact object & grid heights)
   ========================================================================== */

.mrp-run-detail-main {
    --mrp-gap: 6px;
    height: calc(100dvh - 90px);
    min-height: 0;
    overflow: hidden;
}

.mrp-run-detail-main > .dxbl-row {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--mrp-gap) !important;
    height: 100% !important;
    overflow: hidden !important;
}

.mrp-run-detail-main > .dxbl-row > .dxbl-fl-group {
    margin-top: 0;
    margin-bottom: 0;
}

.mrp-run-detail-main .mrp-run-workspace-area {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
}

.mrp-run-detail-main .mrp-run-workspace-area > .dxbl-row,
.mrp-run-detail-main .mrp-run-workspace-area .dxbl-fl-item,
.mrp-run-detail-main .mrp-run-workspace-area .dxbl-fl-ctrl {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.mrp-run-workspace-root {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    gap: 6px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

/* ── Top Cockpit Control Bar: Selector, Run MRP ───────────────────────────── */
.mrp-cockpit-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
    padding: 6px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
}

.mrp-control-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 300px;
}

.mrp-control-label {
    font-weight: 600;
    font-size: 12px;
    color: var(--bs-secondary-color, #475569);
    margin-bottom: 0;
    white-space: nowrap;
}

.mrp-run-combobox {
    min-width: 260px;
    max-width: 460px;
    flex: 1;
}

.mrp-control-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mrp-empty-workspace {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--bs-card-bg, #ffffff);
    border: 2px dashed var(--bs-border-color, #cbd5e1);
    border-radius: 8px;
    text-align: center;
}

.mrp-empty-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.mrp-empty-workspace h3 {
    font-size: 1.15rem;
    color: var(--bs-body-color, #1e293b);
    margin-bottom: 6px;
    font-weight: 600;
}

.mrp-empty-workspace p {
    font-size: 0.9rem;
    color: var(--bs-secondary-color, #64748b);
    max-width: 480px;
    margin-bottom: 14px;
}

/* The cockpits' "criteria changed" (Bakim-Modul-Plani-V2_1-Ek M97) borrows the MRP empty state, whose box fills the MRP
   workspace's height (flex 1 1 0, min-height 0). Under the bar of a cockpit that sizes by content the same rule shrank it
   to nothing - the icon stood on the top border and the text below the bottom one (tour, 19.10.2026): it takes its own
   height here. */
.mrp-empty-workspace.cockpit-criteria-changed {
    flex: 0 0 auto;
    min-height: auto;
    margin-top: 8px;
    padding: 28px 20px;
}

.mrp-empty-workspace.cockpit-criteria-changed .mrp-empty-icon {
    font-size: 32px;
    line-height: 1;
}

.mrp-empty-workspace.cockpit-criteria-changed p {
    margin-bottom: 0;
}

/* ── Top Header Ribbon ───────────────────────────────────────────────────── */
.mrp-header-ribbon {
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
    padding: 6px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    flex: 0 0 auto;
}

.mrp-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.mrp-header-info-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1 1 auto;
}

.mrp-run-no-badge {
    font-size: 14px;
    font-weight: 700;
    color: var(--bs-body-color, #1e293b);
    letter-spacing: -0.2px;
}

.mrp-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    line-height: 1.3;
}

.status-completed {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status-running {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    animation: pulse-glow 2s infinite ease-in-out;
}

.status-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-draft {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.02); }
}

.mrp-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--bs-secondary-color, #475569);
    background: var(--bs-tertiary-bg, #f1f5f9);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid var(--bs-border-color, #e2e8f0);
}

.mrp-chip-duration {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
    font-weight: 600;
}

.mrp-chip-cleanup {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.mrp-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── MRP Operating Workflow Stepper ───────────────────────────────────────── */
.mrp-workflow-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
    padding: 3px 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    flex: 0 0 auto;
}

.mrp-step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    transition: all 0.15s ease-in-out;
    flex: 1;
    border: 1px solid transparent;
}

.mrp-step-item:hover {
    background: var(--bs-tertiary-bg, #f8fafc);
    border-color: var(--bs-border-color, #e2e8f0);
}

.mrp-step-item.active {
    background: rgba(13, 110, 253, 0.08);
    border-color: #bfdbfe;
    box-shadow: 0 1px 2px rgba(13, 110, 253, 0.08);
}

.mrp-step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bs-tertiary-bg, #e2e8f0);
    color: var(--bs-secondary-color, #475569);
    font-weight: 700;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mrp-step-item.active .mrp-step-num {
    background: #0d6efd;
    color: #ffffff;
}

.mrp-step-info {
    display: flex;
    flex-direction: column;
}

.mrp-step-title {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--bs-body-color, #1e293b);
    line-height: 1.2;
}

.mrp-step-desc {
    font-size: 10px;
    color: var(--bs-secondary-color, #64748b);
    margin-top: 1px;
}

.mrp-step-divider {
    color: var(--bs-border-color, #cbd5e1);
    font-size: 12px;
    user-select: none;
}

/* ── Proposal Merge Center Styles ────────────────────────────────────────── */
.mrp-merge-group-card {
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--bs-card-bg, #ffffff);
    margin-bottom: 10px;
    padding: 10px;
    transition: border-color 0.15s ease;
}

.mrp-merge-group-card:hover {
    border-color: #0d6efd;
}

.mrp-merge-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--bs-border-color, #f1f5f9);
}

.mrp-merge-part-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--bs-body-color, #0f172a);
}

.mrp-merge-highlight-badge {
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    background: #e0f2fe;
    color: #0369a1;
}

/* ── KPI Grid ────────────────────────────────────────────────────────────── */
.mrp-kpi-grid {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-bottom: 2px;
    flex: 0 0 auto;
}

.mrp-kpi-card {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.mrp-kpi-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.mrp-kpi-card.active {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2);
    background: rgba(13, 110, 253, 0.04);
}

.mrp-kpi-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    flex-shrink: 0;
}

.mrp-kpi-demands .mrp-kpi-icon-wrapper {
    background: #eff6ff;
    color: #2563eb;
}

.mrp-kpi-supplies .mrp-kpi-icon-wrapper {
    background: #ecfdf5;
    color: #059669;
}

.mrp-kpi-proposals-wo .mrp-kpi-icon-wrapper {
    background: #fffbeb;
    color: #d97706;
}

.mrp-kpi-proposals-pr .mrp-kpi-icon-wrapper {
    background: #f5f3ff;
    color: #7c3aed;
}

.mrp-kpi-diagnostics .mrp-kpi-icon-wrapper {
    background: #f8fafc;
    color: #475569;
}

.mrp-kpi-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mrp-kpi-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--bs-secondary-color, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mrp-kpi-val-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 1px;
}

.mrp-kpi-val {
    font-size: 17px;
    font-weight: 700;
    color: var(--bs-body-color, #0f172a);
    font-family: var(--bs-font-monospace, monospace);
    line-height: 1.2;
}

.mrp-kpi-sub {
    font-size: 10.5px;
    color: var(--bs-secondary-color, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Tab Navigation ──────────────────────────────────────────────────────── */
.mrp-tabs-container {
    border-bottom: 2px solid var(--bs-border-color, #e2e8f0);
    margin-bottom: 2px;
    position: relative;
    z-index: 5;
    flex: 0 0 auto;
}

.mrp-tabs-container .dxbl-tabs {
    font-size: 12.5px;
}

.mrp-tabs-container .dxbl-tabs-item-link {
    padding: 6px 12px !important;
}

.mrp-tab-body {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Tab Panel & Table ───────────────────────────────────────────────────── */
.mrp-panel {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
    padding: 8px 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.mrp-toolbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.mrp-toolbar-left,
.mrp-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mrp-search-box {
    width: 250px;
}

.mrp-filter-chips {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mrp-chip {
    background: var(--bs-tertiary-bg, #f1f5f9);
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 16px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--bs-secondary-color, #475569);
    cursor: pointer;
    transition: all 0.15s ease;
}

.mrp-chip:hover {
    background: var(--bs-border-color, #e2e8f0);
}

.mrp-chip.active {
    background: #0d6efd;
    color: #ffffff;
    border-color: #0d6efd;
}

.mrp-chip.chip-overdue.active {
    background: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}

.mrp-chip.chip-urgent.active {
    background: #ffc107;
    border-color: #ffc107;
    color: #000000;
}

.mrp-selected-count-badge {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* ── Table Styling ───────────────────────────────────────────────────────── */
.mrp-table-wrapper {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
}

.mrp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.mrp-table thead th {
    position: sticky;
    top: 0;
    background: var(--bs-tertiary-bg, #f8fafc);
    color: var(--bs-secondary-color, #475569);
    font-weight: 600;
    font-size: 12px;
    padding: 6px 10px;
    border-bottom: 2px solid var(--bs-border-color, #e2e8f0);
    text-align: left;
    white-space: nowrap;
    z-index: 2;
}

.mrp-table tbody td {
    padding: 5px 10px;
    border-bottom: 1px solid var(--bs-border-color, #f1f5f9);
    color: var(--bs-body-color, #1e293b);
    vertical-align: middle;
    font-size: 12px;
}

.mrp-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.mrp-table tbody tr.selected-row {
    background: rgba(59, 130, 246, 0.12) !important;
}

.mrp-urgency-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.mrp-badge-overdue {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.mrp-badge-urgent {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.mrp-badge-normal {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.mrp-action-btns {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.mrp-icon-btn {
    background: transparent;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mrp-icon-btn:hover {
    background: var(--bs-tertiary-bg, #f1f5f9);
    transform: scale(1.08);
}

/* ── Pegging Tree Styling ────────────────────────────────────────────────── */
.mrp-pegging-tree-container {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.mrp-tree-card {
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 6px;
    background: var(--bs-card-bg, #ffffff);
    padding: 8px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.mrp-tree-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
}

.mrp-node-type-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.mrp-badge-demand {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.mrp-badge-wo {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.mrp-badge-pr {
    background: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

.mrp-badge-stock {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.mrp-tree-ref {
    font-weight: 700;
    color: var(--bs-body-color, #0f172a);
}

.mrp-tree-part {
    color: var(--bs-secondary-color, #475569);
}

.mrp-tree-qty {
    font-weight: 600;
    color: var(--bs-body-color, #0f172a);
}

.mrp-tree-date {
    font-size: 11px;
    color: var(--bs-secondary-color, #64748b);
}

.mrp-tree-children {
    margin-left: 18px;
    margin-top: 6px;
    padding-left: 8px;
    border-left: 2px dashed var(--bs-border-color, #cbd5e1);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mrp-tree-child-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 11.5px;
}

.mrp-tree-line,
.mrp-tree-subline {
    color: #94a3b8;
    font-weight: bold;
}

.mrp-tree-child-badge {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--bs-border-color, #e2e8f0);
}

.mrp-tree-subchildren {
    margin-left: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 3px;
}

.mrp-tree-subchild-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

/* ── Dark Theme Overrides ────────────────────────────────────────────────── */
[data-ice-theme="dark"] .mrp-cockpit-control-bar,
[data-ice-theme="dark"] .mrp-empty-workspace,
[data-ice-theme="dark"] .mrp-header-ribbon,
[data-ice-theme="dark"] .mrp-workflow-stepper,
[data-ice-theme="dark"] .mrp-kpi-card,
[data-ice-theme="dark"] .mrp-panel,
[data-ice-theme="dark"] .mrp-tree-card {
    background: var(--bs-card-bg, #1e293b);
    border-color: var(--bs-border-color, #334155);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

[data-ice-theme="dark"] .mrp-control-label,
[data-ice-theme="dark"] .mrp-empty-workspace h3 {
    color: #f1f5f9;
}

[data-ice-theme="dark"] .mrp-run-no-badge,
[data-ice-theme="dark"] .mrp-kpi-val,
[data-ice-theme="dark"] .mrp-tree-ref,
[data-ice-theme="dark"] .mrp-table td {
    color: #f1f5f9;
}

[data-ice-theme="dark"] .mrp-meta-chip,
[data-ice-theme="dark"] .mrp-chip {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

[data-ice-theme="dark"] .mrp-table-wrapper,
[data-ice-theme="dark"] .mrp-table th,
[data-ice-theme="dark"] .mrp-table td {
    border-color: #334155;
}

[data-ice-theme="dark"] .mrp-table th {
    background: #0f172a;
    color: #94a3b8;
}

[data-ice-theme="dark"] .mrp-table tbody tr:hover {
    background: #334155;
}

[data-ice-theme="dark"] .mrp-table tbody tr.selected-row {
    background: #1e3a8a !important;
}

/* ==========================================================================
   CRP Cockpit Styles
   ========================================================================== */
.crp-run-detail-main {
    height: calc(100dvh - 120px) !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.crp-run-detail-main .crp-run-workspace-area {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
}

.crp-run-detail-main .crp-run-workspace-area > .dxbl-row,
.crp-run-detail-main .crp-run-workspace-area .dxbl-fl-item,
.crp-run-detail-main .crp-run-workspace-area .dxbl-fl-ctrl {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.crp-cockpit-workspace-root {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    gap: 6px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.crp-date-box {
    width: 125px;
}

.crp-wc-combobox {
    min-width: 160px;
    max-width: 260px;
}

.crp-tab-body {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.crp-panel {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
    padding: 8px 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-ice-theme="dark"] .crp-panel {
    background: var(--bs-card-bg, #1e293b);
    border-color: var(--bs-border-color, #334155);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Ürün Yapısı (Product Structure Explorer) Styles
   ========================================================================== */

.product-structure-main {
    --structure-gap: 4px;
    height: calc(100dvh - 140px);
    min-height: 0;
    overflow: hidden;
}

.product-structure-main > .dxbl-row {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--structure-gap) !important;
    height: 100% !important;
    overflow: hidden !important;
}

/* Keep the native XAF search editors clear of the tab strip. */
.product-structure-main .structure-search-criteria {
    flex: 0 0 auto;
    min-width: 0;
    padding-top: 12px;
    padding-bottom: 4px;
}

/* The filter captions sit above their editors (the editors keep their width and show the whole value); the Search
   button has no caption, so the row lines up on the editors' bottom edge. */
.product-structure-main .structure-search-criteria > .dxbl-row {
    align-items: flex-end;
}
/* Empty KPI content must not leave an extra flex gap before a search. */
.product-structure-main .product-structure-kpi-row:not(:has(.product-structure-kpi-container)) {
    display: none;
}

.product-structure-main > .dxbl-row > .dxbl-fl-group {
    margin-top: 0;
    margin-bottom: 0;
}
.product-structure-main .product-structure-kpi-row {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
    overflow: visible !important;
}

.product-structure-main .product-structure-kpi-row > .dxbl-row,
.product-structure-main .product-structure-kpi-row .dxbl-fl-item,
.product-structure-main .product-structure-kpi-row .dxbl-fl-ctrl {
    height: auto !important;
    min-height: 0 !important;
}

.product-structure-main .product-structure-workspace-area {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
}

.product-structure-main .product-structure-workspace-area > .dxbl-row,
.product-structure-main .product-structure-workspace-area .dxbl-fl-item,
.product-structure-main .product-structure-workspace-area .dxbl-fl-ctrl {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.product-structure-kpi-container {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 2px;
}

.structure-kpi-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.structure-kpi-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.structure-kpi-card .kpi-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    flex-shrink: 0;
}

.kpi-card-levels .kpi-icon-wrapper { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.kpi-card-components .kpi-icon-wrapper { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.kpi-card-operations .kpi-icon-wrapper { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.kpi-card-duration .kpi-icon-wrapper { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.kpi-card-alternates .kpi-icon-wrapper { background: rgba(236, 72, 153, 0.1); color: #ec4899; }
.kpi-card-wo .kpi-icon-wrapper { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.kpi-card-ops .kpi-icon-wrapper { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.kpi-card-overload .kpi-icon-wrapper { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.kpi-card-util .kpi-icon-wrapper { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.kpi-card-msg .kpi-icon-wrapper { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.structure-kpi-card.cursor-pointer { cursor: pointer; }
.structure-kpi-card.active {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2) !important;
}

.structure-kpi-card .kpi-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.structure-kpi-card .kpi-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--bs-secondary-color, #64748b);
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.structure-kpi-card .kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.structure-kpi-card .kpi-main-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--bs-body-color, #1e293b);
    font-family: var(--bs-font-monospace, monospace);
}

.structure-kpi-card .kpi-sub-value {
    font-size: 11px;
    color: var(--bs-secondary-color, #94a3b8);
    white-space: nowrap;
}

.product-structure-workspace-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    gap: 8px;
}

.structure-top-filter-bar {
    padding: 8px 12px;
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.structure-top-filter-bar .filter-label {
    font-size: 12px;
    color: var(--bs-secondary-color, #475569);
}

.part-picker-combo {
    min-width: 220px;
    max-width: 320px;
}

.revision-picker-combo {
    width: 90px;
}

.effective-date-dxedit {
    width: 130px;
}

.tree-search-dxtext {
    min-width: 200px;
}

.structure-main-content {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    gap: 8px;
    overflow: hidden;
}

/* Product structure on a narrow screen (3g, 01.12.2026). The rules follow the width of the page's own content area,
   not the window (a container query), so the open navigation pane counts too. The tool row wraps at any width: its
   Bootstrap gap/wrap utilities are not loaded in this app. */
.product-structure-main {
    container-name: product-structure;
    container-type: inline-size;
}

.structure-top-filter-bar,
.structure-top-filter-bar > div,
.structure-top-filter-bar > div > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.structure-top-filter-bar .dxbl-btn {
    white-space: nowrap;
}

@container product-structure (max-width: 1100px) {
    /* Filters: two to a row instead of five squeezed into one. */
    .product-structure-main .structure-search-criteria > .dxbl-row {
        flex-wrap: wrap !important;
        row-gap: 8px;
    }

    .product-structure-main .structure-search-criteria > .dxbl-row > .dxbl-fl-item {
        flex: 1 1 calc(50% - 12px) !important;
        max-width: none !important;
        width: auto !important;
    }

    .product-structure-main .structure-search-criteria > .dxbl-row > .dxbl-fl-item-h {
        flex: 0 0 auto !important;
    }

    /* Summary cards move to a second row rather than running off the edge. */
    .product-structure-main .product-structure-kpi-container {
        flex-wrap: wrap;
    }

    .product-structure-main .structure-kpi-card {
        flex: 1 1 170px;
    }

    /* Tree above the details: the page scrolls instead of squeezing the tree beside a 360px panel. */
    /* DevExpress' layout row wraps: a column taller than the screen moved the tree into a second column off to the
       right. One column, and it scrolls. */
    .product-structure-main > .dxbl-row.dxbl-row {
        flex-wrap: nowrap !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    .product-structure-main > .dxbl-row > .dxbl-fl-group {
        flex: 0 0 auto !important;
    }

    .product-structure-main .product-structure-workspace-area.product-structure-workspace-area,
    .product-structure-main .product-structure-workspace-area.product-structure-workspace-area > .dxbl-row,
    .product-structure-main .product-structure-workspace-area.product-structure-workspace-area .dxbl-fl-item,
    .product-structure-main .product-structure-workspace-area.product-structure-workspace-area .dxbl-fl-ctrl,
    .product-structure-main .product-structure-workspace-container {
        flex: 0 0 auto !important;
        height: auto !important;
        overflow: visible !important;
    }

    .product-structure-main .structure-main-content {
        flex: 0 0 auto;
        flex-direction: column !important;
        overflow: visible;
    }

    .product-structure-main .structure-tree-panel {
        flex: 0 0 auto;
        height: 60vh;
        min-height: 360px;
    }

    .product-structure-main .structure-inspector-panel,
    .product-structure-main .structure-inspector-panel.collapsed {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .product-structure-main .structure-inspector-panel .inspector-body {
        flex: 0 0 auto;
        overflow-y: visible;
    }

    /* Collapsed under the tree it is a full-width bar that still says what it is. */
    .product-structure-main .structure-inspector-panel.collapsed .inspector-header {
        justify-content: space-between;
        padding: 8px 12px;
    }

    .product-structure-main .structure-inspector-panel.collapsed .inspector-header > div,
    .product-structure-main .structure-inspector-panel.collapsed .inspector-title {
        display: flex;
    }
}

@container product-structure (max-width: 640px) {
    .product-structure-main .structure-search-criteria > .dxbl-row > .dxbl-fl-item,
    .product-structure-main .structure-search-criteria > .dxbl-row > .dxbl-fl-item-h {
        flex: 1 1 100% !important;
    }

    .product-structure-main .structure-kpi-card {
        flex: 1 1 100%;
    }

    .product-structure-main .tree-search-dxtext {
        min-width: 0;
        width: 100%;
    }
}

.structure-tree-panel {
    flex: 1 1 70%;
    min-height: 0;
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.structure-table-container,
.structure-treelist-container {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.structure-treelist {
    font-size: 13px;
}

.structure-treelist .dxbl-grid-table td,
.structure-treelist .dxbl-table td {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

.structure-table {
    font-size: 12.5px;
}

.structure-table thead th {
    position: sticky;
    top: 0;
    background: var(--bs-tertiary-bg, #f8fafc);
    color: var(--bs-secondary-color, #475569);
    font-weight: 600;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
    padding: 8px 10px;
    border-bottom: 2px solid var(--bs-border-color, #e2e8f0);
    z-index: 2;
}

.structure-table tbody tr {
    transition: background-color 0.15s ease;
}

.structure-table tbody td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--bs-border-color, #f1f5f9);
}

/* The work order tree's order links: five columns in the details panel, so a size smaller and tighter than the cost table
   above them (Aykut, 06.11.2026). */
.structure-links-table {
    font-size: 11px;
}

.structure-links-table thead th {
    font-size: 11px;
    padding: 4px 6px;
}

.structure-links-table tbody td,
.structure-links-table tfoot td {
    padding: 3px 6px;
}

.structure-links-table tfoot td {
    border-top: 1px solid var(--bs-border-color, #e2e8f0);
}

.structure-links-customer {
    max-width: 90px;
}

.structure-row.row-root {
    background-color: rgba(59, 130, 246, 0.04) !important;
    font-weight: 600;
}

.structure-row.row-operation {
    background-color: rgba(16, 185, 129, 0.04);
}

.structure-row.row-selected {
    background-color: rgba(59, 130, 246, 0.12) !important;
    border-left: 3px solid #3b82f6;
}

.btn-tree-toggle {
    width: 22px;
    height: 22px;
    font-size: 11px;
    line-height: 1;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s, color 0.15s;
}

.btn-tree-toggle:hover {
    background-color: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
}

.tree-leaf-spacer {
    display: inline-block;
    width: 22px;
}

.node-icon-badge {
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-alt-badge {
    background-color: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
    font-weight: 600;
    font-size: 11px;
    border-radius: 12px;
    transition: all 0.2s;
}

.btn-alt-badge:hover {
    background-color: #7c3aed;
    color: #ffffff;
}

.structure-inspector-panel {
    flex: 0 0 32%;
    min-width: 360px;
    max-width: 460px;
    min-height: 0;
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.25s ease;
}

.structure-inspector-panel.collapsed {
    flex: 0 0 45px;
    min-width: 45px;
    max-width: 45px;
}

.structure-inspector-panel.collapsed .inspector-body,
.structure-inspector-panel.collapsed .inspector-title {
    display: none;
}

.inspector-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
}

.inspector-hero-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(147, 197, 253, 0.05));
}

/* Product structure inspector (right panel). The markup's Bootstrap spacing and alignment utilities
   (justify-content-between, p-3, mb-2, gap-2, border-bottom, bg-*) are not loaded in this app, so labels ran into
   their values and headings overlapped (3g, 01.12.2026). The panel is laid out here with its own classes:
   a label column and a value column per row, titled sections, coloured type badges. */
.structure-inspector-panel .inspector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--bs-border-color, #e2e8f0);
}

.structure-inspector-panel .inspector-header > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Collapsed to 45px the header keeps only the expand button, centred: with the icon and the padding beside it the
   button fell outside the strip and the panel could not be opened again. */
.structure-inspector-panel.collapsed .inspector-header {
    justify-content: center;
    padding: 8px 0;
    border-bottom: 0;
}

.structure-inspector-panel.collapsed .inspector-header > div {
    display: none;
}

.structure-inspector-panel .inspector-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.structure-inspector-panel .inspector-body {
    padding: 12px 14px 16px;
}

.structure-inspector-panel .main-product-section > div:first-child,
.structure-inspector-panel .selected-element-section > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.structure-inspector-panel .section-heading {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--bs-secondary-color, #64748b);
    margin: 0 0 6px;
}

.structure-inspector-panel .main-product-section > div:first-child .section-heading,
.structure-inspector-panel .selected-element-section > div:first-child .section-heading {
    font-size: 12px;
    color: var(--bs-body-color, #0f172a);
    margin: 0;
}

.structure-inspector-panel .inspector-hero-card {
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
}

.structure-inspector-panel .inspector-hero-card > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 8px;
}

.structure-inspector-panel .inspector-hero-card > div:first-child > div {
    display: flex;
    gap: 4px;
}

.structure-inspector-panel .inspector-hero-code {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    overflow-wrap: anywhere;
}

.structure-inspector-panel .inspector-hero-name {
    font-size: 13px;
    margin-top: 2px;
    color: var(--bs-secondary-color, #475569);
}

.structure-inspector-panel .inspector-section {
    margin-bottom: 14px;
}

.structure-inspector-panel .inspector-row {
    display: grid !important;
    grid-template-columns: minmax(0, 44%) minmax(0, 1fr);
    column-gap: 12px;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid var(--bs-border-color-translucent, #eef2f7);
    font-size: 13px;
}

.structure-inspector-panel .inspector-row:last-child {
    border-bottom: 0;
}

.structure-inspector-panel .inspector-row > :first-child {
    color: var(--bs-secondary-color, #64748b);
    font-size: 12.5px;
}

.structure-inspector-panel .inspector-row > :last-child {
    justify-self: end;
    text-align: right;
    font-weight: 600;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.structure-inspector-panel .stock-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 6px;
}

.structure-inspector-panel .stock-card {
    padding: 8px 10px;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 6px;
    background: var(--bs-tertiary-bg, #f8fafc);
}

.structure-inspector-panel .stock-card > div:first-child {
    color: var(--bs-secondary-color, #64748b);
    margin-bottom: 2px;
}

.structure-inspector-panel .stock-card > div:last-child {
    font-size: 16px;
    font-weight: 700;
}

.structure-inspector-panel .inspector-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.structure-inspector-panel .inspector-actions > * {
    flex: 1 1 0;
}

.structure-inspector-panel .inspector-divider {
    border: 0;
    border-top: 1px solid var(--bs-border-color, #e2e8f0);
    margin: 16px 0;
    opacity: 1;
}

.structure-inspector-panel .inspector-empty {
    padding: 16px 12px;
    text-align: center;
    color: var(--bs-secondary-color, #64748b);
    border: 1px dashed var(--bs-border-color, #cbd5e1);
    border-radius: 8px;
    background: var(--bs-tertiary-bg, #f8fafc);
    font-size: 13px;
}

.structure-inspector-panel .inspector-empty > div:first-child {
    font-size: 20px;
    margin-bottom: 4px;
}

.structure-inspector-panel .inspector-note {
    padding: 8px 10px;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 6px;
    background: var(--bs-tertiary-bg, #f8fafc);
    color: var(--bs-secondary-color, #475569);
    font-size: 13px;
}

.structure-inspector-panel .badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.structure-inspector-panel .badge.bg-primary { background-color: #2563eb; color: #fff; }
.structure-inspector-panel .badge.bg-secondary { background-color: #64748b; color: #fff; }
.structure-inspector-panel .badge.bg-info { background-color: #bae6fd; color: #075985; }
.structure-inspector-panel .badge.bg-success { background-color: #16a34a; color: #fff; }
.structure-inspector-panel .badge.bg-light { background-color: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

[data-ice-theme="dark"] .structure-inspector-panel .stock-card,
[data-ice-theme="dark"] .structure-inspector-panel .inspector-empty,
[data-ice-theme="dark"] .structure-inspector-panel .inspector-note {
    background: #0f172a;
    border-color: #334155;
}

[data-ice-theme="dark"] .structure-inspector-panel .badge.bg-light { background-color: #1e293b; color: #cbd5e1; border-color: #334155; }
[data-ice-theme="dark"] .structure-inspector-panel .badge.bg-info { background-color: #0c4a6e; color: #bae6fd; }

.ice-bg-indigo {
    background-color: #6366f1 !important;
}

.ice-bg-purple {
    background-color: #8b5cf6 !important;
}

.ice-bg-teal {
    background-color: #0d9488 !important;
}

.structure-row.row-routing-alt {
    background-color: rgba(139, 92, 246, 0.04);
}

.structure-row.row-recipe-alt {
    background-color: rgba(13, 148, 136, 0.04);
}

.structure-row.row-unassigned-group {
    background-color: rgba(100, 116, 139, 0.04);
}

.icon-routing-alt {
    background-color: rgba(139, 92, 246, 0.15);
    color: #7c3aed;
}

.icon-recipe-alt {
    background-color: rgba(13, 148, 136, 0.15);
    color: #0f766e;
}

.icon-unassigned-group {
    background-color: rgba(100, 116, 139, 0.15);
    color: #475569;
}

/* Dark Theme Overrides */
[data-ice-theme="dark"] .structure-kpi-card,
[data-ice-theme="dark"] .structure-top-filter-bar,
[data-ice-theme="dark"] .structure-tree-panel,
[data-ice-theme="dark"] .structure-inspector-panel {
    background: var(--bs-card-bg, #1e293b);
    border-color: var(--bs-border-color, #334155);
}

[data-ice-theme="dark"] .structure-table thead th {
    background: #0f172a;
    color: #94a3b8;
    border-color: #334155;
}

[data-ice-theme="dark"] .structure-table tbody td {
    border-color: #334155;
}

[data-ice-theme="dark"] .structure-row.row-root {
    background-color: rgba(59, 130, 246, 0.12) !important;
}

[data-ice-theme="dark"] .structure-row.row-operation {
    background-color: rgba(16, 185, 129, 0.1);
}

[data-ice-theme="dark"] .structure-row.row-selected {
    background-color: rgba(59, 130, 246, 0.25) !important;
}

[data-ice-theme="dark"] .stock-card {
    background: #0f172a !important;
    border-color: #334155 !important;
}

.main-product-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(99, 102, 241, 0.03));
    border-color: rgba(59, 130, 246, 0.2) !important;
}

[data-ice-theme="dark"] .main-product-card {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3) !important;
}

/* The frame around the tab bodies (it was a DxLoadingPanel until 25.09.2026). */
.crp-cockpit-workspace-root .crp-tab-frame {
    width: 100%;
    position: relative;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.crp-tab-body {
    width: 100%;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.crp-panel {
    width: 100%;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
}

.crp-matrix-split-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    gap: 12px;
    overflow: hidden !important;
}

.crp-matrix-top-pane {
    flex: 1 1 50% !important;
    min-height: 200px;
    max-height: 60%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: auto;
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.crp-matrix-bottom-pane {
    flex: 1 1 50% !important;
    min-height: 200px;
    max-height: 60%;
    display: flex;
    flex-direction: column;
    background: var(--bs-card-bg, #ffffff);
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    padding: 8px;
    overflow: hidden;
}

.crp-cockpit-grid {
    font-size: 12.5px !important;
}

/* The CRP cockpit's grids wear the MRP cockpit's table (user request 22.09.2026): the same row height,
   hover and selection tint. Their header and cell lines are the load matrix's above them (user requests
   24.09.2026): headers in the captions' own case, one colour, a line between rows and between columns, a
   heavier line under the header. DevExpress keeps the sorting, paging and multi-page selection the
   leveling buttons work on. */
.crp-cockpit-grid .dxbl-grid-table th,
.crp-cockpit-grid .dxbl-table th {
    background: var(--bs-tertiary-bg, #f8fafc) !important;
    color: var(--bs-secondary-color, #475569) !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    padding: 6px 10px !important;
    border-top: 0 !important;
    border-left: 0 !important;
    border-right: 1px solid var(--bs-border-color, #e3e6ee) !important;
    border-bottom: 2px solid var(--bs-border-color, #e3e6ee) !important;
    white-space: nowrap;
}

.crp-cockpit-grid .dxbl-grid-table td,
.crp-cockpit-grid .dxbl-table td {
    padding: 5px 10px !important;
    font-size: 12px !important;
    vertical-align: middle !important;
    border-top: 0 !important;
    border-left: 0 !important;
    border-right: 1px solid var(--bs-border-color, #e3e6ee) !important;
    border-bottom: 1px solid var(--bs-border-color, #e3e6ee) !important;
}

/* The wrapper draws the outer edge. */
.crp-cockpit-grid .dxbl-grid-table tr > th:last-child,
.crp-cockpit-grid .dxbl-grid-table tr > td:last-child {
    border-right: 0 !important;
}

.crp-cockpit-grid .dxbl-grid-table tbody tr:hover > td {
    background-color: rgba(59, 130, 246, 0.05) !important;
}

.crp-cockpit-grid .dxbl-grid-table tbody tr[aria-selected="true"] > td {
    background-color: rgba(59, 130, 246, 0.12) !important;
}

/* Notices in the soft tints of the cockpits' KPI icons (user request 24.09.2026): green of "Overall
   Utilization", red of "Overloaded Centers", amber and blue of the structure cards. Bootstrap's alerts
   come out in the DevExpress theme as solid colours with dark text on them. The MRP and CRP cockpits
   show every result here and nowhere else - no XAF toast beside it.
   A 4px stripe in the notice's own colour on its left edge tells the four kinds apart at a glance
   (user decision 25.09.2026). It is written after border-color, which paints all four sides. */
.ice-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.ice-notice-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
    border-left: 4px solid #10b981;
    color: #047857;
}

.ice-notice-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    border-left: 4px solid #ef4444;
    color: #b91c1c;
}

.ice-notice-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
    border-left: 4px solid #f59e0b;
    color: #b45309;
}

.ice-notice-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.25);
    border-left: 4px solid #3b82f6;
    color: #1d4ed8;
}

/* A notice with a heading and a list rather than one sentence and a close button. */
.ice-notice-block {
    display: block;
}

/* A result can take several lines (a leveling step's linked orders, approval warnings). */
.ice-notice-text {
    white-space: pre-line;
}

.ice-notice .btn-close {
    flex-shrink: 0;
    font-size: 10px;
    padding: 4px;
    opacity: 0.55;
}

.ice-notice .btn-close:hover {
    opacity: 0.9;
}

[data-ice-theme="dark"] .ice-notice-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    border-left-color: #34d399;
    color: #6ee7b7;
}

[data-ice-theme="dark"] .ice-notice-danger {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.4);
    border-left-color: #f87171;
    color: #fca5a5;
}

[data-ice-theme="dark"] .ice-notice-warning {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.4);
    border-left-color: #fbbf24;
    color: #fcd34d;
}

[data-ice-theme="dark"] .ice-notice-info {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.4);
    border-left-color: #60a5fa;
    color: #93c5fd;
}

[data-ice-theme="dark"] .ice-notice .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Small helpers of the CRP cockpit's MRP-style toolbars and cells */
.crp-site-combobox {
    min-width: 140px;
    max-width: 240px;
}

.crp-pane-toolbar {
    flex: 0 0 auto;
    padding: 6px 8px 0;
}

/* Nothing sits on its right, so the filters take the row instead of wrapping at their own width. */
.crp-pane-toolbar .mrp-toolbar-left {
    flex: 1 1 auto;
}

.crp-matrix-body {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
}

.crp-cell-muted {
    color: var(--bs-secondary-color, #64748b);
    font-size: 11px;
}

.crp-toolbar-note {
    font-size: 11.5px;
    color: var(--bs-secondary-color, #64748b);
}

.crp-chip-clear {
    background: none;
    border: 0;
    padding: 0 0 0 4px;
    color: inherit;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

[data-ice-theme="dark"] .crp-matrix-top-pane,
[data-ice-theme="dark"] .crp-matrix-bottom-pane {
    background: var(--bs-card-bg, #1e293b);
    border-color: var(--bs-border-color, #334155);
}

[data-ice-theme="dark"] .crp-cockpit-grid .dxbl-grid-table th,
[data-ice-theme="dark"] .crp-cockpit-grid .dxbl-table th {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

[data-ice-theme="dark"] .crp-cockpit-grid .dxbl-grid-table td,
[data-ice-theme="dark"] .crp-cockpit-grid .dxbl-table td {
    border-color: #334155 !important;
    color: #f1f5f9;
}

[data-ice-theme="dark"] .crp-cockpit-grid .dxbl-grid-table tbody tr:hover > td {
    background-color: #334155 !important;
}

[data-ice-theme="dark"] .crp-cockpit-grid .dxbl-grid-table tbody tr[aria-selected="true"] > td {
    background-color: #1e3a8a !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ICE HOME DASHBOARD / OPERATIONS COCKPIT
   ═══════════════════════════════════════════════════════════════════════════ */
.ice-dashboard-main,
.ice-dashboard-main.dxbl-fl-group,
.ice-dashboard-main > .dxbl-row,
.ice-dashboard-main .dxbl-fl-group,
.ice-dashboard-main .dxbl-fl-item,
.ice-dashboard-main .dxbl-fl-ctrl,
.ice-dashboard-workspace-area,
.ice-dashboard-workspace-area.dxbl-fl-group,
.ice-dashboard-workspace-area > .dxbl-row,
.ice-dashboard-workspace-area .dxbl-fl-item,
.ice-dashboard-workspace-area .dxbl-fl-ctrl {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.ice-dashboard-workspace {
    margin-top: 0;
    padding: 8px clamp(10px, 2vw, 20px) 20px;
    background-color: var(--bs-body-bg, #f8fafc);
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-wrap: anywhere;
}

/* The dashboard's layout group is the container the narrow-screen padding asks about, so the
   navigation pane counts. */
.ice-dashboard-workspace-area.dxbl-fl-group {
    container-type: inline-size;
}

/* ── Header Strip ── */
.ice-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 0 6px 0;
    margin-top: 0;
    border-bottom: 1px solid var(--bs-border-color, #e2e8f0);
}

.ice-dashboard-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ice-dashboard-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--bs-heading-color, #0f172a);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ice-dashboard-icon {
    font-size: 22px;
}

.ice-dashboard-subtitle {
    font-size: 13px;
    color: var(--bs-secondary-color, #64748b);
}

.ice-dashboard-last-updated {
    font-size: 12px;
    color: var(--bs-tertiary-color, #94a3b8);
}

/* Wraps so that Refresh stays inside the sticky header on a phone (375px pushed it off screen). */
.ice-dashboard-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ice-dashboard-site-select,
.ice-dashboard-autorefresh-select {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.ice-site-combobox {
    width: 180px;
    min-width: 0;
}

.ice-autorefresh-combobox {
    width: 110px;
    min-width: 0;
}

/* ── Urgent Alert Banner ── */
.ice-dashboard-alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 5px solid #ef4444;
    border-radius: 10px;
    padding: 10px 16px;
    box-shadow: 0 4px 12px -2px rgba(239, 68, 68, 0.12), 0 2px 4px -1px rgba(239, 68, 68, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ice-dashboard-alert-banner:hover {
    box-shadow: 0 6px 16px -2px rgba(239, 68, 68, 0.18), 0 3px 6px -1px rgba(239, 68, 68, 0.08);
}

.ice-alert-icon-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ice-alert-icon {
    font-size: 20px;
}

.ice-alert-text-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.ice-alert-title {
    font-weight: 700;
    font-size: 13px;
    color: #991b1b;
}

.ice-alert-description {
    font-size: 13px;
    color: #b91c1c;
}

.ice-alert-action-btn {
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 4px 12px !important;
    border-radius: 6px !important;
}

/* ── Filter Chips ── */
.ice-dashboard-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ice-filter-chip {
    border: 1px solid var(--bs-border-color, #cbd5e1);
    background: var(--bs-card-bg, #ffffff);
    color: var(--bs-secondary-color, #475569);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.ice-filter-chip:hover {
    background: var(--bs-tertiary-bg, #f1f5f9);
    border-color: #94a3b8;
}

.ice-filter-chip.active {
    background: #0d6efd;
    color: #ffffff;
    border-color: #0d6efd;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.25);
}

.ice-filter-chip-btn {
    border-radius: 20px !important;
    padding: 4px 14px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: all 0.15s ease-in-out !important;
}

/* ── Quick Action Workbench ── */
.ice-dashboard-quick-actions-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--bs-card-bg, #ffffff);
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: box-shadow 0.2s ease;
}

.ice-quick-actions-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--bs-secondary-color, #475569);
}

.ice-quick-action-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ice-quick-action-separator {
    width: 1px;
    height: 24px;
    background-color: var(--bs-border-color, #cbd5e1);
    margin: 0 4px;
}

.ice-cockpit-quick-btn {
    font-weight: 600 !important;
}

/* ── KPI Counter Grid & Cards (Compact Executive Strip) ──
   As many cards in a row as fit, the rest on the next rows; the cards stretch to fill the row. */
.ice-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(176px, 100%), 1fr));
    gap: 8px;
}

.ice-kpi-card {
    background: var(--bs-card-bg, #ffffff);
    border-radius: 8px;
    padding: 8px 14px;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    border-left-width: 4px;
}

.ice-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.ice-kpi-card.kpi-danger {
    border-left-color: #ef4444;
}

.ice-kpi-card.kpi-warning {
    border-left-color: #f59e0b;
}

.ice-kpi-card.kpi-info {
    border-left-color: #3b82f6;
}

.ice-kpi-card.kpi-secondary {
    border-left-color: #64748b;
}

.kpi-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.kpi-card-icon {
    font-size: 14px;
}

.kpi-card-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--bs-heading-color, #0f172a);
}

.ice-kpi-card.kpi-danger .kpi-card-value {
    color: #dc2626;
}

.ice-kpi-card.kpi-warning .kpi-card-value {
    color: #d97706;
}

.ice-kpi-card.kpi-info .kpi-card-value {
    color: #2563eb;
}

.kpi-card-label {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--bs-secondary-color, #475569);
}

.kpi-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
}

.kpi-card-arrow-btn {
    font-size: 11px !important;
    font-weight: 700 !important;
    opacity: 0.6;
    transition: opacity 0.15s ease, transform 0.15s ease;
    text-decoration: none !important;
}

.ice-kpi-card:hover .kpi-card-arrow-btn {
    opacity: 1;
    transform: translateX(3px);
}

/* Badges. The case comes from here, not from the text: "Today" and "Overdue" share their keys with
   ordinary labels, so their translations are title case ("Bugün", "Gecikmiş"). */
.kpi-badge-danger, .kpi-badge-warning, .kpi-badge-info, .kpi-badge-secondary {
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.kpi-badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.kpi-badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.kpi-badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

.kpi-badge-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

/* ── Work Order Status & Visual Charts Grid (3D Depth & Elevation) ── */
/* As many charts in a row as fit (three on a desktop), one on a phone. The columns take their width
   from the screen: a chart takes its width from its column, so a column sized from the chart would
   keep whatever width the chart last drew at. */
.ice-dashboard-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
    gap: 16px;
}

.ice-dashboard-chart-card {
    background: var(--bs-card-bg, #ffffff);
    border-radius: 10px;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ice-dashboard-chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.10), 0 4px 8px -2px rgba(0, 0, 0, 0.05);
}

.ice-dashboard-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bs-tertiary-bg, #f8fafc);
    border-bottom: 1px solid var(--bs-border-color, #e2e8f0);
}

.ice-dashboard-chart-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--bs-heading-color, #1e293b);
}

.ice-dashboard-chart-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    background: #dbeafe;
    color: #1e40af;
}

.ice-dashboard-chart-body {
    padding: 6px 12px 10px 12px;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 218px;
}

/* Empty Chart State */
.ice-chart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 171px;
    width: 100%;
    color: var(--bs-secondary-color, #94a3b8);
    gap: 8px;
    text-align: center;
}

.ice-chart-empty-icon {
    font-size: 32px;
    opacity: 0.5;
    line-height: 1;
}

.ice-chart-empty-text {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--bs-secondary-color, #64748b);
}

/* ── Operational Micro-Lists ── */
/* As many lists in a row as fit (four on a wide desktop), one on a phone; a list wider than its
   card scrolls inside the card. */
.ice-micro-lists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 16px;
}

.ice-micro-card {
    background: var(--bs-card-bg, #ffffff);
    border-radius: 10px;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ice-micro-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.10), 0 4px 8px -2px rgba(0, 0, 0, 0.05);
}

.ice-micro-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bs-tertiary-bg, #f8fafc);
    border-bottom: 1px solid var(--bs-border-color, #e2e8f0);
}

.ice-micro-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--bs-heading-color, #1e293b);
}

.ice-micro-view-all {
    background: none;
    border: none;
    color: #0d6efd;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.ice-micro-view-all:hover {
    background: rgba(13, 110, 253, 0.08);
    text-decoration: underline;
}

.ice-micro-view-all-btn {
    font-size: 12px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    padding: 0 !important;
}

.ice-micro-view-all-btn:hover {
    text-decoration: underline !important;
}

.ice-row-link-btn {
    font-size: 12px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    padding: 0 !important;
    text-align: left !important;
    white-space: normal !important;
}

.ice-row-link-btn:hover {
    text-decoration: underline !important;
}

.ice-notification-time {
    font-size: 11px;
    color: var(--bs-secondary-color, #64748b);
    margin-top: 2px;
}

.ice-notification-subject {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ice-micro-table {
    width: 100%;
    margin-bottom: 0;
    font-size: 12px;
}

.ice-micro-table .badge {
    white-space: normal;
}

.ice-micro-table th {
    background: var(--bs-tertiary-bg, #f8fafc);
    color: var(--bs-secondary-color, #64748b);
    font-weight: 600;
    font-size: 12px;
    padding: 7px 8px;
    border-bottom: 1px solid var(--bs-border-color, #e2e8f0);
}

.ice-micro-table td {
    padding: 7px 8px;
    vertical-align: middle;
    border-bottom: 1px solid var(--bs-border-color, #f1f5f9);
}

.ice-clickable-row {
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.ice-clickable-row:hover {
    background-color: rgba(13, 110, 253, 0.05) !important;
}

.ice-part-code {
    font-weight: 600;
    color: var(--bs-heading-color, #1e293b);
}

.ice-part-name {
    font-size: 11px;
    color: var(--bs-secondary-color, #64748b);
}

.ice-micro-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: #16a34a;
    font-size: 13px;
    font-weight: 500;
}

.ice-empty-icon {
    font-size: 18px;
}

/* ── Narrow screens: less padding, and two cards side by side on a phone (user request 30.11.2026) ── */
@container (max-width: 767px) {
    .ice-dashboard-workspace-area .ice-dashboard-workspace {
        padding: 8px 12px 16px 12px;
    }

    .ice-dashboard-workspace-area .ice-kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
    }
}

/* ── Dark Theme Overrides ── */
[data-ice-theme="dark"] .ice-dashboard-workspace {
    background-color: var(--bs-body-bg, #0f172a);
}

[data-ice-theme="dark"] .ice-dashboard-alert-banner {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    border-left-color: #ef4444;
}

[data-ice-theme="dark"] .ice-alert-title {
    color: #fca5a5;
}

[data-ice-theme="dark"] .ice-alert-description {
    color: #fca5a5;
}

/* --bs-heading-color is not defined by the dark theme, so the title fell back to its light colour. */
[data-ice-theme="dark"] .ice-dashboard-title {
    color: #f1f5f9;
}

[data-ice-theme="dark"] .ice-quick-action-separator {
    background-color: #334155;
}

[data-ice-theme="dark"] .ice-dashboard-chart-card {
    background: #1e293b;
    border-color: #334155;
}

[data-ice-theme="dark"] .ice-dashboard-chart-header {
    background: #0f172a;
    border-color: #334155;
}

[data-ice-theme="dark"] .ice-dashboard-chart-title {
    color: #e2e8f0;
}

[data-ice-theme="dark"] .ice-dashboard-chart-badge {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

[data-ice-theme="dark"] .ice-filter-chip {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

[data-ice-theme="dark"] .ice-filter-chip:hover {
    background: #334155;
    color: #e2e8f0;
}

[data-ice-theme="dark"] .ice-dashboard-quick-actions-bar {
    background: #1e293b;
    border-color: #334155;
}

[data-ice-theme="dark"] .ice-kpi-card {
    background: #1e293b;
    border-color: #334155;
}

[data-ice-theme="dark"] .kpi-card-value {
    color: #f1f5f9;
}

[data-ice-theme="dark"] .ice-kpi-card.kpi-danger .kpi-card-value {
    color: #f87171;
}

[data-ice-theme="dark"] .ice-kpi-card.kpi-warning .kpi-card-value {
    color: #fbbf24;
}

[data-ice-theme="dark"] .ice-kpi-card.kpi-info .kpi-card-value {
    color: #60a5fa;
}

[data-ice-theme="dark"] .kpi-card-label {
    color: #94a3b8;
}

[data-ice-theme="dark"] .kpi-badge-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

[data-ice-theme="dark"] .kpi-badge-warning {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fde68a;
}

[data-ice-theme="dark"] .kpi-badge-info {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

[data-ice-theme="dark"] .kpi-badge-secondary {
    background-color: #334155;
    color: #cbd5e1;
}

[data-ice-theme="dark"] .ice-micro-card {
    background: #1e293b;
    border-color: #334155;
}

[data-ice-theme="dark"] .ice-micro-card-header {
    background: #0f172a;
    border-color: #334155;
}

[data-ice-theme="dark"] .ice-micro-card-title {
    color: #e2e8f0;
}

[data-ice-theme="dark"] .ice-micro-table th {
    background: #0f172a;
    color: #94a3b8;
    border-color: #334155;
}

[data-ice-theme="dark"] .ice-micro-table td {
    border-color: #334155;
    color: #cbd5e1;
}

[data-ice-theme="dark"] .ice-clickable-row:hover {
    background-color: rgba(59, 130, 246, 0.12) !important;
}

[data-ice-theme="dark"] .ice-part-code {
    color: #f1f5f9;
}

[data-ice-theme="dark"] .ice-part-name {
    color: #94a3b8;
}

/* ── Cockpit colours that used to be inline (K-49) ──────────────────────────────────────── */
.mrp-qty-demand,
.mrp-qty-negative {
    color: #dc3545;
}

.mrp-qty-supply,
.mrp-qty-positive {
    color: #198754;
}

.mrp-qty-withheld {
    color: #fd7e14;
}

.mrp-qty-proposed {
    color: #0d6efd;
}

.mrp-log-time {
    font-size: 11px;
    color: #6c757d;
}

.structure-kpi-card .kpi-icon-wrapper.kpi-icon-overload,
.mrp-kpi-icon-wrapper.kpi-icon-overload {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.structure-kpi-card .kpi-icon-wrapper.kpi-icon-balanced,
.mrp-kpi-icon-wrapper.kpi-icon-balanced {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* ── MRP and CRP cockpits, the dashboard, the CRP matrix and their popups in the dark theme ──
   (UAT-054, K-49) DevExpress' Blazing Dark leaves Bootstrap's light, white and dark colours at
   their light-theme values and native controls light: bg-light and bg-white panels stayed white
   under the theme's white text, text-dark badges read grey on blue, table-light and table-success
   rows glared, step numbers were white on white. These screens and their popups (rendered outside
   the screen, hence ice-cockpit-popup) re-point the variables and override the utilities that
   bypass them; the ICE classes that only had light colours get their dark tints. */
[data-ice-theme="dark"] :is(.mrp-run-workspace-root, .crp-cockpit-workspace-root, .ice-dashboard-workspace, .crp-matrix, .ice-cockpit-popup) {
    --bs-light-rgb: 30, 41, 59;
    --bs-dark-rgb: 15, 23, 42;
    color-scheme: dark;
}

[data-ice-theme="dark"] :is(.mrp-run-workspace-root, .crp-cockpit-workspace-root, .ice-dashboard-workspace, .crp-matrix, .ice-cockpit-popup) .bg-white {
    background-color: #1e293b !important;
}

[data-ice-theme="dark"] :is(.mrp-run-workspace-root, .crp-cockpit-workspace-root, .ice-dashboard-workspace, .crp-matrix, .ice-cockpit-popup) .badge.bg-light {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

[data-ice-theme="dark"] :is(.mrp-run-workspace-root, .crp-cockpit-workspace-root, .ice-dashboard-workspace, .crp-matrix, .ice-cockpit-popup) .badge.bg-success {
    background-color: #15803d !important;
}

[data-ice-theme="dark"] :is(.mrp-run-workspace-root, .crp-cockpit-workspace-root, .ice-dashboard-workspace, .crp-matrix, .ice-cockpit-popup) .badge.bg-danger {
    background-color: #b91c1c !important;
}

[data-ice-theme="dark"] :is(.mrp-run-workspace-root, .crp-cockpit-workspace-root, .ice-dashboard-workspace, .crp-matrix, .ice-cockpit-popup) .text-danger {
    color: #fca5a5 !important;
}

[data-ice-theme="dark"] :is(.mrp-run-workspace-root, .crp-cockpit-workspace-root, .ice-dashboard-workspace, .crp-matrix, .ice-cockpit-popup) .text-primary {
    color: #c4b5fd !important;
}

[data-ice-theme="dark"] :is(.mrp-run-workspace-root, .crp-cockpit-workspace-root, .ice-dashboard-workspace, .crp-matrix, .ice-cockpit-popup) .text-info {
    color: #7dd3fc !important;
}

[data-ice-theme="dark"] :is(.mrp-run-workspace-root, .crp-cockpit-workspace-root, .ice-dashboard-workspace, .crp-matrix, .ice-cockpit-popup) code {
    color: #f9a8d4;
}

[data-ice-theme="dark"] :is(.mrp-run-workspace-root, .crp-cockpit-workspace-root, .ice-dashboard-workspace, .crp-matrix, .ice-cockpit-popup) .table-light {
    --bs-table-bg: #0f172a;
    --bs-table-color: #cbd5e1;
    --bs-table-border-color: #334155;
    --bs-table-striped-bg: #0f172a;
    --bs-table-hover-bg: #1e293b;
    color: #cbd5e1;
}

[data-ice-theme="dark"] :is(.mrp-run-workspace-root, .crp-cockpit-workspace-root, .ice-dashboard-workspace, .crp-matrix, .ice-cockpit-popup) .table-success {
    --bs-table-bg: #064e3b;
    --bs-table-color: #d1fae5;
    --bs-table-border-color: #065f46;
    color: #d1fae5;
}

[data-ice-theme="dark"] :is(.mrp-run-workspace-root, .crp-cockpit-workspace-root, .ice-dashboard-workspace, .crp-matrix, .ice-cockpit-popup) .btn-outline-secondary {
    --bs-btn-color: #cbd5e1;
    --bs-btn-border-color: #475569;
    --bs-btn-hover-color: #f1f5f9;
    --bs-btn-hover-bg: #334155;
    --bs-btn-hover-border-color: #64748b;
    --bs-btn-active-color: #f1f5f9;
    --bs-btn-active-bg: #334155;
    --bs-btn-active-border-color: #64748b;
    color: #cbd5e1;
    border-color: #475569;
}

[data-ice-theme="dark"] .mrp-step-num {
    background: #334155;
    color: #cbd5e1;
}

[data-ice-theme="dark"] .mrp-step-item.active .mrp-step-num {
    background: #0d6efd;
    color: #ffffff;
}

[data-ice-theme="dark"] .mrp-status-pill.status-completed,
[data-ice-theme="dark"] .mrp-badge-normal,
[data-ice-theme="dark"] .mrp-badge-stock {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.35);
}

[data-ice-theme="dark"] .mrp-status-pill.status-running,
[data-ice-theme="dark"] .mrp-badge-demand {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.35);
}

[data-ice-theme="dark"] .mrp-status-pill.status-error,
[data-ice-theme="dark"] .mrp-badge-overdue {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.35);
}

[data-ice-theme="dark"] .mrp-badge-urgent,
[data-ice-theme="dark"] .mrp-badge-wo {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.35);
}

[data-ice-theme="dark"] .mrp-badge-pr {
    background: rgba(139, 92, 246, 0.18);
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.35);
}

[data-ice-theme="dark"] .mrp-merge-highlight-badge {
    background: rgba(14, 165, 233, 0.18);
    color: #7dd3fc;
}

[data-ice-theme="dark"] .mrp-kpi-demands .mrp-kpi-icon-wrapper {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

[data-ice-theme="dark"] .mrp-kpi-supplies .mrp-kpi-icon-wrapper {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

[data-ice-theme="dark"] .mrp-kpi-proposals-wo .mrp-kpi-icon-wrapper {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

[data-ice-theme="dark"] .mrp-kpi-proposals-pr .mrp-kpi-icon-wrapper {
    background: rgba(139, 92, 246, 0.18);
    color: #c4b5fd;
}

[data-ice-theme="dark"] .mrp-kpi-diagnostics .mrp-kpi-icon-wrapper {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
}

[data-ice-theme="dark"] .mrp-merge-group-card {
    background: #1e293b;
    border-color: #334155;
}

[data-ice-theme="dark"] .mrp-icon-btn {
    color: #e2e8f0;
    border-color: #475569;
}

[data-ice-theme="dark"] .mrp-qty-demand,
[data-ice-theme="dark"] .mrp-qty-negative {
    color: #fca5a5;
}

[data-ice-theme="dark"] .mrp-qty-supply,
[data-ice-theme="dark"] .mrp-qty-positive {
    color: #86efac;
}

[data-ice-theme="dark"] .mrp-qty-withheld {
    color: #fdba74;
}

[data-ice-theme="dark"] .mrp-qty-proposed {
    color: #93c5fd;
}

[data-ice-theme="dark"] .mrp-log-time {
    color: #94a3b8;
}

[data-ice-theme="dark"] .structure-kpi-card .kpi-icon-wrapper.kpi-icon-overload,
[data-ice-theme="dark"] .mrp-kpi-icon-wrapper.kpi-icon-overload {
    color: #f87171;
}

[data-ice-theme="dark"] .structure-kpi-card .kpi-icon-wrapper.kpi-icon-balanced,
[data-ice-theme="dark"] .mrp-kpi-icon-wrapper.kpi-icon-balanced {
    color: #34d399;
}

/* ── Cockpit success buttons ───────────────────────────────────────────────────
   Run MRP / Run CRP and the approvals wear the success notice's tone (.ice-notice-success), a
   step darker: the notice's translucent emerald at 20% instead of 10% as the fill, and the
   notice's own text colour (user request 25.09.2026). The first try filled the button with that
   text colour and came out far too dark. Translucent, so the button sits on the white card and
   on the dark one alike; CockpitVisualConventionTests keeps it tied to the notice. */
:is(.mrp-run-workspace-root, .crp-cockpit-workspace-root, .maintenance-cockpit, .ice-cockpit-popup) .dxbl-btn-success {
    --dxbl-btn-bg: rgba(16, 185, 129, 0.2);
    --dxbl-btn-border-color: rgba(16, 185, 129, 0.45);
    --dxbl-btn-color: #047857;
    --dxbl-btn-hover-bg: rgba(16, 185, 129, 0.3);
    --dxbl-btn-hover-border-color: rgba(16, 185, 129, 0.6);
    --dxbl-btn-hover-color: #065f46;
    --dxbl-btn-active-bg: rgba(16, 185, 129, 0.4);
    --dxbl-btn-active-border-color: rgba(16, 185, 129, 0.7);
    --dxbl-btn-active-color: #064e3b;
    --dxbl-btn-focus-bg: rgba(16, 185, 129, 0.2);
    --dxbl-btn-focus-shadow-color: rgba(16, 185, 129, 0.35);
    --dxbl-btn-disabled-bg: rgba(16, 185, 129, 0.08);
    --dxbl-btn-disabled-border-color: rgba(16, 185, 129, 0.2);
    --dxbl-btn-disabled-color: rgba(4, 120, 87, 0.55);
}

[data-ice-theme="dark"] :is(.mrp-run-workspace-root, .crp-cockpit-workspace-root, .maintenance-cockpit, .ice-cockpit-popup) .dxbl-btn-success {
    --dxbl-btn-bg: rgba(16, 185, 129, 0.25);
    --dxbl-btn-border-color: rgba(16, 185, 129, 0.5);
    --dxbl-btn-color: #6ee7b7;
    --dxbl-btn-hover-bg: rgba(16, 185, 129, 0.35);
    --dxbl-btn-hover-border-color: rgba(16, 185, 129, 0.65);
    --dxbl-btn-hover-color: #a7f3d0;
    --dxbl-btn-active-bg: rgba(16, 185, 129, 0.45);
    --dxbl-btn-active-border-color: rgba(16, 185, 129, 0.75);
    --dxbl-btn-active-color: #d1fae5;
    --dxbl-btn-focus-bg: rgba(16, 185, 129, 0.25);
    --dxbl-btn-disabled-bg: rgba(16, 185, 129, 0.1);
    --dxbl-btn-disabled-border-color: rgba(16, 185, 129, 0.2);
    --dxbl-btn-disabled-color: rgba(110, 231, 183, 0.5);
}

/* ── Dashboard charts ──────────────────────────────────────────────────────────────
   The shapes take their colours from DashboardChartPalette: soft, solid tones that read on the
   white and on the dark card (user request 25.09.2026, after a saturated and a pastel round).
   Everything around them follows the theme here. DevExtreme writes the colour of each text it
   draws into the element's inline style at the moment it draws, so a chart drawn in one theme
   kept that theme's text after a switch - the dark axis labels vanished on the dark card
   (YI-023). Only an !important rule wins over an inline style.
   The numbers are plain text beside the shapes: white would not read on the light tones, and the
   coloured box DevExtreme draws behind each one made the charts look busy. */
.ice-dashboard-workspace .dxc-labels-group .dxc-labels rect {
    fill-opacity: 0;
}

.ice-dashboard-workspace .dxc-labels-group text {
    fill: #334155 !important;
    font-weight: 600 !important;
}

.ice-dashboard-workspace .dxc-arg-elements text,
.ice-dashboard-workspace .dxc-val-elements text {
    fill: #64748b !important;
}

.ice-dashboard-workspace .dxc-val-grid path {
    stroke: #e2e8f0;
}

.ice-dashboard-workspace .dxc-arg-line path,
.ice-dashboard-workspace .dxc-val-line path {
    stroke: #cbd5e1;
}

/* Each rendered chart point opens its underlying filtered list. */
.ice-dashboard-workspace .ice-dashboard-drill-chart .dxc-series .dxc-markers path,
.ice-dashboard-workspace .ice-dashboard-drill-chart .dxc-series .dxc-markers rect {
    cursor: pointer;
}

/* A donut's slices are parted by a line in the card's colour. */
.ice-dashboard-workspace .ice-dashboard-donut .dxc-series .dxc-markers path {
    stroke: #ffffff;
    stroke-width: 2px;
}

.ice-dashboard-workspace .dxbl-chart-legend-def-icon {
    rx: 3px;
    ry: 3px;
}

[data-ice-theme="dark"] .ice-dashboard-workspace .dxc-labels-group text {
    fill: #e2e8f0 !important;
}

[data-ice-theme="dark"] .ice-dashboard-workspace .dxc-arg-elements text,
[data-ice-theme="dark"] .ice-dashboard-workspace .dxc-val-elements text {
    fill: #94a3b8 !important;
}

[data-ice-theme="dark"] .ice-dashboard-workspace .dxc-val-grid path {
    stroke: #334155;
}

[data-ice-theme="dark"] .ice-dashboard-workspace .dxc-arg-line path,
[data-ice-theme="dark"] .ice-dashboard-workspace .dxc-val-line path {
    stroke: #475569;
}

[data-ice-theme="dark"] .ice-dashboard-workspace .ice-dashboard-donut .dxc-series .dxc-markers path {
    stroke: #1e293b;
}

/* ── Shop Floor Terminal / Dijital Atölye Visual UI ─────────────────────────────
   Touch-first, responsive shop-floor operator workspace for industrial terminals,
   tablets, and desktop screens. Min 48-52px touch targets, high contrast, dark mode. */
.shopfloor-terminal-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: #f4f7fb;
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding: 12px;
    border-radius: 10px;
    box-sizing: border-box;
    gap: 12px;
}

/* Top Sticky Control Ribbon */
.shopfloor-top-ribbon {
    background: var(--ice-surface);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--ice-track);
}

.shopfloor-top-ribbon .ribbon-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Operator Badge */
.operator-badge-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 6px 14px;
    min-height: 44px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.operator-badge-box:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.operator-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--ice-selected-bg);
    border: 1px solid #bfdbfe;
    color: var(--ice-link);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.operator-info {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.operator-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #64748b;
    font-weight: 700;
}

.operator-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ice-text-max);
}

.operator-switch-icon {
    font-size: 15px;
    color: #64748b;
    margin-left: 4px;
}

/* Barcode Scanner Box */
.barcode-search-box {
    display: flex;
    align-items: center;
    flex: 1 1 320px;
    min-height: 44px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 4px 8px 4px 12px;
    gap: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.barcode-search-box:focus-within {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.barcode-icon {
    font-size: 18px;
    opacity: 0.85;
}

.barcode-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-weight: 600;
    background: transparent;
    color: var(--ice-text-strong);
}

.barcode-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.btn-clear-search {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
}

.btn-clear-search:hover {
    color: #475569;
}

.btn-scan-submit {
    font-weight: 600;
}

.operator-barcode-search-box,
.serial-barcode-search-box {
    width: 100%;
    min-width: 0;
}

.operator-barcode-search-box .barcode-input,
.serial-barcode-search-box .barcode-input {
    min-width: 0;
}

.operator-barcode-search-box .btn-scan-submit,
.serial-barcode-search-box .btn-scan-submit {
    flex-shrink: 0;
}

/* Search Criteria Group Box (XAF LayoutGroup above Terminal) & Ribbon Filters */
.shopfloor-terminal-search-criteria.dxbl-fl-group > .dxbl-group,
.shopfloor-terminal-search-criteria > .dxbl-group,
.shopfloor-terminal-search-criteria > .card {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
    overflow: hidden;
}

.shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-header,
.shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-fl-group-header,
.shopfloor-terminal-search-criteria > .card > .card-header {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 1px solid #cbd5e1 !important;
    padding: 8px 16px !important;
}

.shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-header .dxbl-text,
.shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-header span,
.shopfloor-terminal-search-criteria > .card > .card-header * {
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

.shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-body-wrapper,
.shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-body,
.shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-body-wrapper > .dxbl-group-body,
.shopfloor-terminal-search-criteria > .dxbl-group .dxbl-fl-group-content,
.shopfloor-terminal-search-criteria > .card > .card-body {
    background: #ffffff !important;
}

.shopfloor-terminal-search-criteria label,
.shopfloor-terminal-search-criteria .dxbl-fl-item-caption {
    color: #334155 !important;
    font-weight: 600 !important;
    font-size: 12.5px !important;
}

.shopfloor-terminal-search-criteria .dxbl-text-edit {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    border-radius: 6px !important;
}

.shopfloor-refresh-control {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.shopfloor-refresh-button {
    width: 100%;
}

.shopfloor-refresh-button.dxbl-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.22) !important;
}

.shopfloor-refresh-button.dxbl-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
    border-color: #1e40af !important;
}

[data-ice-theme="dark"] .shopfloor-terminal-search-criteria.dxbl-fl-group > .dxbl-group,
[data-ice-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group,
[data-bs-theme="dark"] .shopfloor-terminal-search-criteria.dxbl-fl-group > .dxbl-group,
[data-bs-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group {
    background: linear-gradient(180deg, #1e293b 0%, #162032 100%) !important;
    border-color: #334155 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

[data-ice-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-header,
[data-bs-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-header {
    background: linear-gradient(180deg, #263449 0%, #1e293b 100%) !important;
    border-bottom-color: #334155 !important;
}

[data-ice-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-header .dxbl-text,
[data-ice-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-header span,
[data-bs-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-header .dxbl-text,
[data-bs-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-header span {
    color: #e2e8f0 !important;
}

[data-ice-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-body-wrapper,
[data-ice-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-body,
[data-ice-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-body-wrapper > .dxbl-group-body,
[data-ice-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group .dxbl-fl-group-content,
[data-bs-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-body-wrapper,
[data-bs-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-body,
[data-bs-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group > .dxbl-group-body-wrapper > .dxbl-group-body,
[data-bs-theme="dark"] .shopfloor-terminal-search-criteria > .dxbl-group .dxbl-fl-group-content {
    background: #1e293b !important;
}

[data-ice-theme="dark"] .shopfloor-terminal-search-criteria label,
[data-ice-theme="dark"] .shopfloor-terminal-search-criteria .dxbl-fl-item-caption,
[data-bs-theme="dark"] .shopfloor-terminal-search-criteria label,
[data-bs-theme="dark"] .shopfloor-terminal-search-criteria .dxbl-fl-item-caption {
    color: #cbd5e1 !important;
}

[data-ice-theme="dark"] .shopfloor-terminal-search-criteria .dxbl-text-edit,
[data-bs-theme="dark"] .shopfloor-terminal-search-criteria .dxbl-text-edit {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

.ribbon-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-label {
    font-size: 13px;
    color: #475569;
    font-weight: 600;
}

.filter-combo {
    width: 140px;
}

/* Status Chips */
.shopfloor-terminal-container .status-filter-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 3px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    vertical-align: baseline;
}

.shopfloor-terminal-container .dot-Started { background: #22c55e; }
.shopfloor-terminal-container .dot-SetupStarted { background: #f59e0b; }
.shopfloor-terminal-container .dot-Released { background: #cbd5e1; }
.shopfloor-terminal-container .dot-PartiallyReported { background: #ef4444; }
.shopfloor-terminal-container .dot-SetupCompleted { background: #8b5cf6; }
.shopfloor-terminal-container .dot-PartiallyCanceled { background: #f97316; }
.shopfloor-terminal-container .dot-Canceled { background: #94a3b8; }
.shopfloor-terminal-container .dot-Reported { background: #3b82f6; }

.status-chips-label {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    font-weight: 700;
}

.status-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chip:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.chip.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.chip-inprogress.active {
    background: #16a34a;
    border-color: #16a34a;
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.25);
}

.chip-setup.active {
    background: #d97706;
    border-color: #d97706;
    box-shadow: 0 1px 3px rgba(217, 119, 6, 0.25);
}

.chip-stopped.active {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.25);
}

.chip-reported.active {
    background: #475569;
    border-color: #475569;
    box-shadow: 0 1px 3px rgba(71, 85, 105, 0.25);
}

/* Alerts */
.shopfloor-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}

.shopfloor-alert.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
}

.shopfloor-alert.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #16a34a;
}

.shopfloor-alert.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
}

.alert-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    margin-left: auto;
    color: inherit;
}

/* Main Body Layout */
.shopfloor-body {
    display: flex;
    gap: 14px;
    flex: 1;
    min-height: 0;
}

/* Left Operations Pane */
.shopfloor-operations-pane {
    flex: 1 1 54%;
    display: flex;
    flex-direction: column;
    background: var(--ice-surface);
    border-radius: 12px;
    border: 1px solid var(--ice-track);
    padding: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 12px;
}

.pane-title {
    font-size: 16px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-count {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-text-action {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}

.btn-text-action:hover {
    text-decoration: underline;
    background: rgba(37, 99, 235, 0.06);
}

.operations-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding-right: 4px;
    flex: 1;
}

.shopfloor-terminal-container .operation-card-section {
    flex: 0 0 auto;
    min-width: 0;
}

.shopfloor-terminal-container .operation-group {
    padding: 10px;
    border: 1px solid var(--bs-primary-border-subtle, #c7d2fe);
    border-inline-start: 4px solid #6366f1;
    border-radius: 12px;
    background: var(--bs-tertiary-bg, #f8fafc);
}

.shopfloor-terminal-container .operation-group-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
    margin-bottom: 8px;
    color: var(--bs-primary-text-emphasis, #3730a3);
    font-size: 12px;
}

.shopfloor-terminal-container .operation-group-title {
    min-width: 0;
    overflow-wrap: anywhere;
}

.shopfloor-terminal-container .operation-group-count {
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--bs-primary-bg-subtle, #e0e7ff);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.shopfloor-terminal-container .operation-group-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* Operation Card */
.operation-card {
    background: #ffffff;
    border: 1.5px solid #dbe3ee;
    border-left: 5px solid #94a3b8;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    user-select: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.shopfloor-terminal-container .operation-card {
    padding: 9px 12px;
    gap: 6px;
}

.shopfloor-terminal-container .operation-card > .card-header {
    padding: 4px 6px;
}

.shopfloor-terminal-container .operation-card > .card-body {
    padding: 2px 6px;
}

.shopfloor-terminal-container .operation-card > .card-footer {
    padding: 6px 6px 0;
    margin-top: 0;
}

.operation-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
}

.operation-card.selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.operation-card.status-running-card {
    border-left: 6px solid #16a34a;
}

.operation-card.status-setup-card {
    border-left: 6px solid #d97706;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-wo-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.op-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.wo-no {
    font-weight: 700;
    color: var(--ice-text-max);
    font-size: 15px;
}

.wo-seq {
    color: var(--ice-text-muted);
    font-weight: 600;
    font-size: 13px;
}

.card-status-badge .badge {
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-running { background: #dcfce7; color: #15803d; }
.badge-setup { background: #fef3c7; color: #b45309; }
.badge-reported { background: #f1f5f9; color: #475569; }
.badge-stopped { background: #fee2e2; color: #b91c1c; }
.badge-ready { background: #f1f5f9; color: #334155; }

.shopfloor-terminal-container .sub-table .badge-secondary {
    background-color: #fef3c7;
    color: #92400e;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 rgba(22, 163, 74, 0.4);
    animation: pulse 1.5s infinite;
}

.pulse-dot.setup {
    background: #d97706;
    box-shadow: 0 0 0 rgba(217, 119, 6, 0.4);
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.part-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.part-code {
    font-size: 14px;
    color: #1e293b;
}

.part-name {
    font-size: 13px;
    color: var(--ice-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.op-name-row {
    font-size: 13px;
    color: #334155;
    display: flex;
    gap: 12px;
}

.shopfloor-terminal-container .card-active-resources {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px 12px;
    margin-top: 4px;
    min-width: 0;
}

.shopfloor-terminal-container .active-resource-row {
    display: flex;
    flex: 1 1 260px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.shopfloor-terminal-container .active-resource-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ice-text-label);
    white-space: nowrap;
}

.shopfloor-terminal-container .active-resource-items {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 6px;
    min-width: 0;
}

.shopfloor-terminal-container .active-resource-tag {
    padding: 3px 7px;
    border-radius: 6px;
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    max-width: calc((100% - 6px) / 2);
    overflow-wrap: anywhere;
}

.shopfloor-terminal-container .active-resource-tag:only-child {
    max-width: 100%;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 6px;
    margin-top: 4px;
}

.qty-info {
    display: flex;
    gap: 10px;
    color: #475569;
}

.wc-machine-info {
    display: flex;
    gap: 6px;
}

.mch-tag, .wc-tag {
    background: var(--ice-surface-well);
    border: 1px solid var(--ice-track);
    padding: 2px 7px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    color: var(--ice-text-secondary);
}

/* Right Action Pane */
.shopfloor-action-pane {
    flex: 1 1 46%;
    display: flex;
    flex-direction: column;
    background: var(--ice-surface);
    border-radius: 12px;
    border: 1px solid var(--ice-track);
    padding: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow-y: auto;
    gap: 14px;
}

/* The queue and the action pad scroll inside the screen. Unbounded, the terminal grew with every card - 73 on the
   Armoni site, 11,000 px - so the queue never scrolled on its own and the action pad left the screen as the page
   scrolled (tour, 11.10.2026). The 410 px leave room for the view's criteria and the ribbon above the panes. */
.shopfloor-operations-pane,
.shopfloor-action-pane {
    max-height: max(480px, calc(100vh - 410px));
}

.operations-card-list,
.machine-status-pane {
    min-height: 0;
}

.action-pad-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    text-align: center;
    padding: 40px;
}

.action-pad-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Selected Op Hero */
.selected-op-hero {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selected-op-hero.hero-running {
    background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}

.selected-op-hero.hero-setup {
    background: linear-gradient(180deg, #fefce8 0%, #fef3c7 100%);
    border-color: #fde047;
}

.hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-wo-label {
    font-size: 11.5px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 700;
}

.hero-wo-no {
    font-size: 18px;
    color: var(--ice-text-max);
    margin: 0 6px;
}

.hero-seq {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.status-pill {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-pill-running { background: #22c55e; color: #ffffff; }
.status-pill-setup { background: #eab308; color: #78350f; }
.status-pill-reported { background: #64748b; color: #ffffff; }
.status-pill-stopped { background: #dc2626; color: #ffffff; }
.status-pill-ready { background: #94a3b8; color: #ffffff; }

.hero-part {
    font-size: 15px;
    color: #334155;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
}

.hero-part-code {
    font-weight: 700;
    color: #0f172a;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 13.5px;
}

/* Hero Stopwatch */
.hero-stopwatch-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: var(--ice-surface-deep);
    border: 1px solid #cbd5e1;
    border-left: 4px solid #16a34a;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 4px 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.stopwatch-icon { font-size: 18px; }
.stopwatch-label { font-size: 13px; color: #475569; font-weight: 600; }
.stopwatch-timer {
    font-size: 17px;
    font-weight: 800;
    color: #15803d;
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
}
.stopwatch-operator { font-size: 12.5px; color: #64748b; }

/* Hero Stats Grid */
.hero-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 4px;
}

.stat-card {
    background: var(--ice-surface-deep);
    border: 1px solid var(--ice-track);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em; color: #64748b; font-weight: 700; }
.stat-val { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-rem { color: #2563eb; }
.stat-exec { color: #059669; }
.stat-recv { color: #d97706; }
.stat-req { color: #475569; }

/* Touch Action Buttons Grid (Min 50px Touch-Optimized, Harmonized Industrial Palette) */
.touch-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
    gap: 8px;
}

.touch-btn {
    min-height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: transform 0.1s ease, filter 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    user-select: none;
    text-align: center;
    line-height: 1.2;
}

.touch-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.touch-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    box-shadow: none;
}

.touch-btn .btn-icon {
    font-size: 15px;
    flex-shrink: 0;
}

/* Button Color Variants - Semantic Industrial Groups */
.btn-start-production { background: #16a34a; }
.btn-start-production:hover:not(:disabled) { background: #15803d; }

.btn-stop-production { background: #d97706; }
.btn-stop-production:hover:not(:disabled) { background: #b45309; }

.btn-start-setup { background: #0284c7; }
.btn-start-setup:hover:not(:disabled) { background: #0369a1; }

.btn-stop-setup { background: #475569; }
.btn-stop-setup:hover:not(:disabled) { background: #334155; }

.btn-approve { background: #059669; }
.btn-approve:hover:not(:disabled) { background: #047857; }

/* The quality check wears the state of the operation's in-process inspection. */
.btn-ipqc-waiting { background: #d97706; }
.btn-ipqc-active { background: #0284c7; }
.btn-ipqc-hold { background: #b91c1c; }
.btn-ipqc-passed { background: #0f766e; }
.btn-ipqc:hover:not(:disabled) { filter: brightness(0.92); }
.btn-ipqc .btn-ipqc-state {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    opacity: 0.92;
}

.btn-scrap { background: #dc2626; }
.btn-scrap:hover:not(:disabled) { background: #b91c1c; }

.btn-receive { background: #2563eb; }
.btn-receive:hover:not(:disabled) { background: #1d4ed8; }

.btn-manual-issue { background: #4f46e5; }
.btn-manual-issue:hover:not(:disabled) { background: #4338ca; }

.btn-tool { background: #475569; }
.btn-tool:hover:not(:disabled) { background: #334155; }

.btn-group-operations, .btn-ungroup { background: #64748b; }
.btn-group-operations:hover:not(:disabled), .btn-ungroup:hover:not(:disabled) { background: #475569; }

/* PLM documents at the operation (P3.5): drawing, model, NC program */
.btn-plm-document { background: #0f766e; }
.btn-plm-document:hover:not(:disabled) { background: #115e59; }
.plm-terminal-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.plm-terminal-kind {
    min-height: 48px; padding: 8px 18px; font-size: 15px; font-weight: 600; border-radius: 8px;
    border: 1px solid var(--bs-border-color, #cbd5e1); background: var(--bs-body-bg, #fff); color: var(--bs-body-color, #0f172a);
}
.plm-terminal-kind.active { background: #0f766e; border-color: #0f766e; color: #fff; }
.touch-btn.plm-terminal-open { min-height: 48px; min-width: 120px; flex: 0 0 auto; background: #0f766e; }
[data-ice-theme="dark"] .plm-terminal-kind { border-color: #334155; background: #1e293b; color: #e2e8f0; }
[data-ice-theme="dark"] .plm-terminal-kind.active { background: #0f766e; color: #fff; }

/* Sub Details Tabs */
.op-details-section {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 4px;
    background: var(--ice-surface);
}

.shopfloor-terminal-container .op-details-section {
    flex: 1 1 auto;
    min-height: 360px;
}

.tabs-nav {
    display: flex;
    flex-wrap: wrap;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tab-nav-btn {
    flex: 1 1 auto;
    background: none;
    border: none;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tab-nav-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.tab-nav-btn.active {
    color: #2563eb;
    background: #ffffff;
    border-bottom-color: #2563eb;
}

.tab-content-area {
    padding: 12px;
    flex: 1 1 auto;
    min-height: 300px;
    max-height: clamp(360px, 50vh, 720px);
    overflow-y: auto;
}

.tab-empty {
    color: #94a3b8;
    text-align: center;
    padding: 24px;
    font-size: 13px;
    border: 1px dashed var(--ice-track);
    border-radius: 8px;
    background: var(--ice-surface-inset);
}

.sub-table-responsive {
    overflow-x: auto;
}

.sub-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sub-table th, .sub-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: middle;
}

.sub-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.sub-text {
    font-size: 11.5px;
    color: #64748b;
}

.btn-sub-action {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.btn-sub-action:hover:not(:disabled) {
    background: #e2e8f0;
    border-color: #94a3b8;
}

/* A disabled sub-action looked enabled: Complete Inspection with a line still open took the tap and did nothing. */
.btn-sub-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-sub-receive {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.btn-sub-receive:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

/* Modals & Popup Shared Elements */
.last-op-box {
    --bs-light-rgb: 236, 253, 245;
    --bs-border-color: #a7f3d0;
}

.touch-modal-body {
    padding: 16px;
    min-width: 0;
}

.modal-intro {
    margin: 0 0 12px;
    padding: 9px 13px;
    border-radius: 8px;
    background: var(--ice-surface-inset);
    border: 1px solid #e2e8f0;
    border-left: 4px solid #3b82f6;
    color: var(--ice-text-soft);
    font-size: 13.5px;
    line-height: 1.45;
}

.approve-op-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #cbd5e1;
    border-left: 4px solid #2563eb;
}

.approve-op-summary .summary-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 12px;
    font-size: 13.5px;
}

.approve-op-summary .summary-line .label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

/* Terminal material sources share the touch popup actions and keep narrow layouts inside the viewport. */
.material-source-popup {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 80vh;
    overflow-y: auto;
}

.material-source-summary,
.material-source-row {
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 10px;
    padding: 12px 14px;
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #1e293b);
    min-width: 0;
}

.material-source-summary {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #cbd5e1;
    border-left: 4px solid #2563eb;
}

.material-source-part,
.material-source-identity,
.material-source-balances,
.material-source-entry {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.material-source-part > strong {
    font-size: 16px;
    color: #0f172a;
}

.material-source-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.material-source-metrics > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
}

.material-source-metrics span,
.material-source-hint,
.material-source-identity small {
    font-size: 12px;
    color: #64748b;
}

.material-source-metrics strong {
    font-size: 14px;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.material-source-tabs {
    flex-wrap: wrap;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.material-source-search {
    width: 100%;
    min-height: 42px;
    padding: 8px 14px;
    border: 1.5px solid var(--bs-border-color, #cbd5e1);
    border-radius: 8px;
    background: var(--bs-body-bg, #f8fafc);
    color: inherit;
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.material-source-search:focus {
    outline: none;
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.material-source-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 38vh;
    overflow-y: auto;
    min-height: 80px;
}

.material-source-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(160px, 0.85fr);
    gap: 12px;
    font-size: 13px;
    transition: border-color 0.15s ease;
}

.material-source-row:hover {
    border-color: #94a3b8;
}

.material-source-entry label {
    font-weight: 600;
}

.material-source-quantity-input {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.material-source-quantity-input > .w-100 {
    flex: 1;
    min-width: 0;
    width: 0 !important;
}

.material-source-fill {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 10px;
    font-size: 13px;
}

.material-source-undo {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 6px 12px;
    font-size: 13px;
}

.material-source-row.undo-pending {
    border-color: #d97706;
    border-left: 4px solid #d97706;
    background: #fffbeb;
}

.material-source-undo-note {
    color: var(--ice-tone-warning-fg);
    font-size: 12px;
}

.material-source-total {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-border-firm);
    font-size: 14px;
}

.material-source-hint,
.material-source-empty {
    margin: 0;
}

.material-source-empty {
    padding: 20px;
    text-align: center;
    color: #64748b;
    border: 1px dashed var(--ice-border-firm);
    border-radius: 8px;
    background: var(--ice-surface-inset);
}

@media (max-width: 640px) {
    .material-source-row { grid-template-columns: 1fr; }
    .material-source-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .material-source-tabs .tab-nav-btn { flex-basis: 45%; }
}

[data-ice-theme="dark"] .material-source-popup {
    --bs-border-color: #334155;
    color: #e2e8f0;
}

[data-ice-theme="dark"] .material-source-summary {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
    border-left-color: #3b82f6;
}

[data-ice-theme="dark"] .material-source-part > strong,
[data-ice-theme="dark"] .material-source-metrics strong {
    color: #f8fafc;
}

[data-ice-theme="dark"] .material-source-metrics > div,
[data-ice-theme="dark"] .material-source-row,
[data-ice-theme="dark"] .material-source-total,
[data-ice-theme="dark"] .material-source-search,
[data-ice-theme="dark"] .material-source-empty {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-ice-theme="dark"] .material-source-row.undo-pending {
    background: #451a03;
    border-color: #b45309;
}

.byproduct-receipt-popup {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 80vh;
    overflow-y: auto;
    color: var(--bs-body-color, #1e293b);
}

.byproduct-receipt-summary {
    border: 1px solid #cbd5e1;
    border-left: 4px solid #16a34a;
    border-radius: 10px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.byproduct-receipt-product,
.byproduct-receipt-field,
.byproduct-receipt-metrics > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.byproduct-receipt-product > strong { font-size: 16px; color: #0f172a; }
.byproduct-receipt-product > small,
.byproduct-receipt-metrics span { font-size: 12px; color: #64748b; }
.byproduct-receipt-field > label { font-weight: 600; font-size: 13.5px; }
.byproduct-receipt-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.byproduct-receipt-metrics > div {
    gap: 2px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
}

.byproduct-receipt-metrics strong {
    font-size: 14px;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.byproduct-receipt-quantity {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.byproduct-receipt-quantity > .w-100 { flex: 1; min-width: 0; width: 0 !important; }
.byproduct-receipt-quantity > .btn-touch-secondary {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 6px 14px;
}

.byproduct-receipt-tracking {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 12px;
}

.byproduct-receipt-serials {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 120px;
    overflow-y: auto;
}

.byproduct-receipt-serials > span {
    border: 1px solid var(--bs-border-color, #cbd5e1);
    background: #f8fafc;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12.5px;
    font-weight: 600;
}

[data-ice-theme="dark"] .byproduct-receipt-popup {
    color: #e2e8f0;
}

[data-ice-theme="dark"] .byproduct-receipt-summary {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
    border-left-color: #22c55e;
}

[data-ice-theme="dark"] .byproduct-receipt-product > strong,
[data-ice-theme="dark"] .byproduct-receipt-metrics strong {
    color: #f8fafc;
}

[data-ice-theme="dark"] .byproduct-receipt-metrics > div,
[data-ice-theme="dark"] .byproduct-receipt-previous,
[data-ice-theme="dark"] .byproduct-receipt-serials > span {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.byproduct-receipt-previous {
    border: 1px solid var(--bs-border-color, #cbd5e1);
    border-radius: 10px;
    padding: 8px 12px;
    margin: 4px 0;
    background: var(--ice-surface-inset);
}

.byproduct-receipt-history-toggle {
    border: 0;
    background: transparent;
    color: inherit;
    font-weight: 700;
    font-size: 13.5px;
    padding: 6px 4px;
    text-align: start;
    width: 100%;
    cursor: pointer;
}

.byproduct-receipt-history-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--bs-border-color, #cbd5e1);
}

.byproduct-receipt-history-row > .btn-touch-secondary {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 12px;
    font-size: 12.5px;
}

.byproduct-receipt-history-info {
    flex: 1;
    min-width: min(100%, 220px);
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-wrap: anywhere;
}

.byproduct-receipt-history-info small { opacity: .8; }

.byproduct-receipt-undo-confirm {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    background: #fef2f2;
    border-radius: 8px;
    margin-top: 6px;
}

[data-ice-theme="dark"] .byproduct-receipt-undo-confirm {
    background: rgba(127, 29, 29, 0.25);
    border-color: rgba(248, 113, 113, 0.4);
    border-left-color: #ef4444;
}

.byproduct-receipt-undo-confirm .modal-actions-touch { margin-top: 4px; }

/* Inventory History Tab */
.inventory-history-note {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-track);
    font-size: 12.5px;
    color: #64748b;
}

.inventory-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
}

.inventory-history-row {
    padding: 10px 12px;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    background: #f8fafc;
    overflow-wrap: anywhere;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inventory-history-heading,
.inventory-history-values {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
}

.inventory-history-heading {
    justify-content: space-between;
}

.inventory-history-heading time {
    font-size: 12px;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.inventory-history-part {
    font-size: 13px;
    color: var(--ice-text-secondary);
}

.inventory-history-values {
    margin-top: 2px;
    font-size: 12.5px;
}

.inventory-history-values > strong {
    background: var(--ice-selected-bg);
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 1px 8px;
    font-variant-numeric: tabular-nums;
}

.inventory-history-values > span {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1px 8px;
    color: #475569;
}

.inventory-history-row small {
    display: inline-block;
    font-size: 11.5px;
    color: #64748b;
}

.inventory-history-row.is-undo {
    border-inline-start: 4px solid #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

[data-ice-theme="dark"] .inventory-history-note,
[data-ice-theme="dark"] .inventory-history-row {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-ice-theme="dark"] .inventory-history-values > strong {
    border-color: rgba(96, 165, 250, 0.35);
    color: #93c5fd;
}

[data-ice-theme="dark"] .inventory-history-values > span {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

[data-ice-theme="dark"] .inventory-history-row.is-undo {
    background: rgba(127, 29, 29, 0.22);
    border-color: rgba(248, 113, 113, 0.35);
    border-inline-start-color: #ef4444;
}

/* Tool Usage Popup */
.tool-usage-popup {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 80vh;
    overflow-y: auto;
    color: var(--bs-body-color, #1e293b);
}

.tool-usage-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #2563eb;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    overflow-wrap: anywhere;
}

.tool-usage-summary > strong {
    font-size: 15px;
    color: #0f172a;
}

.tool-usage-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-track);
}

.tool-usage-toolbar > button,
.tool-usage-add-btn {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 6px 14px;
    font-size: 13px;
}

.tool-usage-hint {
    flex: 1;
    min-width: min(100%, 200px);
    font-size: 12.5px;
    color: #64748b;
}

.tool-usage-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.tool-usage-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    padding: 12px 14px;
    border: 1px solid var(--bs-border-color, #cbd5e1);
    border-radius: 10px;
    background: var(--bs-body-bg, #fff);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tool-usage-row.tool-usage-row-used {
    border-color: #86efac;
    border-left: 4px solid #16a34a;
    background: #f0fdf4;
}

.tool-usage-selection {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.tool-usage-selection > label {
    font-weight: 600;
    font-size: 13px;
}

.tool-usage-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.tool-usage-state .form-check {
    min-height: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    font-weight: 600;
}

.tool-usage-state .form-check-input {
    flex-shrink: 0;
    margin-top: 0;
}

.tool-usage-state small {
    font-size: 12px;
    color: #64748b;
}

.tool-usage-remove {
    align-self: center;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 6px 12px;
    font-size: 13px;
}

.tool-usage-empty {
    padding: 22px 12px;
    text-align: center;
    color: #64748b;
    border: 1px dashed var(--bs-border-color, #cbd5e1);
    border-radius: 8px;
    background: var(--ice-surface-inset);
}

[data-ice-theme="dark"] .tool-usage-popup {
    --bs-border-color: #475569;
    color: #e2e8f0;
}

[data-ice-theme="dark"] .tool-usage-summary {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
    border-left-color: #3b82f6;
}

[data-ice-theme="dark"] .tool-usage-summary > strong {
    color: #f8fafc;
}

[data-ice-theme="dark"] .tool-usage-toolbar,
[data-ice-theme="dark"] .tool-usage-row,
[data-ice-theme="dark"] .tool-usage-empty {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-ice-theme="dark"] .tool-usage-row.tool-usage-row-used {
    background: rgba(6, 78, 59, 0.35);
    border-color: #059669;
    border-left-color: #22c55e;
}

@media (max-width: 480px) {
    .tool-usage-row { padding: 10px; gap: 8px; }
    .tool-usage-toolbar > button { width: 100%; }
}

.operator-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
}

.operator-select-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.operator-select-card:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.op-card-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--ice-selected-bg);
    border: 1px solid #bfdbfe;
    color: var(--ice-link);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.op-card-name {
    font-size: 14px;
    display: block;
    color: var(--ice-text-max);
}

.op-card-code {
    font-size: 11px;
    color: #64748b;
}

/* Touch Stepper */
.touch-stepper-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.btn-step {
    min-width: 48px;
    height: 48px;
    background: #f1f5f9;
    border: 1px solid var(--ice-border-firm);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ice-text);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-step:hover {
    background: #e2e8f0;
}

/* A DxSpinEdit, the number editor XAF uses: the box is its root, the digits its input. */
.stepper-input {
    flex: 1 1 80px;
    min-width: 0;
    width: 80px;
    height: 48px;
}

.stepper-input input {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.btn-step-max {
    height: 48px;
    padding: 0 14px;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    color: var(--ice-link);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.btn-step-max:hover {
    background: #dbeafe;
}

/* Touch Toggle Group */
.touch-button-group {
    display: flex;
    gap: 8px;
}

.touch-button-group.vertical {
    flex-direction: column;
}

.btn-toggle {
    flex: 1;
    min-height: 44px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    padding: 8px 12px;
}

.btn-toggle:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-toggle.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.btn-toggle.btn-toggle-ok.active {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
}

.btn-toggle.btn-toggle-warning.active {
    background: #d97706;
    border-color: #d97706;
    color: #ffffff;
}

.btn-toggle.btn-toggle-danger.active {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.btn-toggle.btn-toggle-neutral.active {
    background: #475569;
    border-color: #475569;
    color: #ffffff;
}

.modal-actions-touch {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-actions-touch.vertical {
    flex-direction: column;
}

.btn-touch-primary, .btn-touch-secondary, .btn-touch-link {
    min-height: 48px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 16px;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: filter 0.15s ease, background-color 0.15s ease;
}

.btn-touch-primary {
    flex: 2;
    color: #ffffff;
}

.btn-touch-primary:hover:not(:disabled) {
    filter: brightness(0.95);
}

.btn-touch-secondary {
    flex: 1;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-touch-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.btn-touch-success { background: #16a34a; }
.btn-touch-warning { background: #d97706; }
.btn-touch-danger { background: #dc2626; }
.btn-touch-info { background: #0284c7; }
.btn-touch-purple { background: #4f46e5; }
.btn-touch-indigo { background: #4f46e5; }
.btn-touch-secondary-action { background: #475569; }

.btn-touch-link {
    background: none;
    color: #64748b;
    border: none;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
    .shopfloor-body {
        flex-direction: column;
    }
    .shopfloor-operations-pane,
    .shopfloor-action-pane {
        flex: 1 1 100%;
    }
    .touch-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .shopfloor-terminal-container {
        padding: 6px;
    }
    .ribbon-row.main-row {
        flex-direction: column;
        align-items: stretch;
    }
    .operator-badge-box, .barcode-search-box {
        width: 100%;
    }
    .ribbon-filters {
        width: 100%;
        justify-content: space-between;
    }
    .touch-actions-grid {
        grid-template-columns: 1fr;
    }
    .btn-approve {
        grid-column: span 1;
    }
}

/* Dark Theme Support */
[data-ice-theme="dark"] .shopfloor-terminal-container {
    background-color: #0f172a;
    color: #f1f5f9;
}

[data-ice-theme="dark"] .shopfloor-top-ribbon,
[data-ice-theme="dark"] .shopfloor-operations-pane,
[data-ice-theme="dark"] .shopfloor-action-pane,
[data-ice-theme="dark"] .operation-card,
[data-ice-theme="dark"] .op-details-section {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-ice-theme="dark"] .barcode-search-box,
[data-ice-theme="dark"] .operator-badge-box {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

[data-ice-theme="dark"] .barcode-search-box:focus-within {
    background-color: #0f172a;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

[data-ice-theme="dark"] .operator-avatar,
[data-ice-theme="dark"] .op-card-avatar {
    border-color: rgba(96, 165, 250, 0.35);
}

[data-ice-theme="dark"] .selected-op-hero {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
    color: #f1f5f9;
}

[data-ice-theme="dark"] .selected-op-hero.hero-running {
    background: linear-gradient(180deg, rgba(6, 78, 59, 0.55) 0%, #0f172a 100%);
    border-color: #059669;
}

[data-ice-theme="dark"] .selected-op-hero.hero-setup {
    background: linear-gradient(180deg, rgba(120, 53, 15, 0.45) 0%, #0f172a 100%);
    border-color: #d97706;
}

[data-ice-theme="dark"] .chip {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

[data-ice-theme="dark"] .chip.active {
    background: #2563eb;
    border-color: #3b82f6;
    color: #ffffff;
}

[data-ice-theme="dark"] .badge-count {
    background: rgba(37, 99, 235, 0.25);
    color: #93c5fd;
}

[data-ice-theme="dark"] .operation-card:hover {
    border-color: #64748b;
}

[data-ice-theme="dark"] .operation-card.selected {
    background: rgba(30, 58, 138, 0.45);
    border-color: #3b82f6;
}

[data-ice-theme="dark"] .shopfloor-terminal-container .operation-group {
    background: #0f172a;
    border-color: #6366f1;
}

[data-ice-theme="dark"] .shopfloor-terminal-container .operation-group-header {
    color: #c7d2fe;
}

[data-ice-theme="dark"] .shopfloor-terminal-container .operation-group-count {
    background: #312e81;
    color: #e0e7ff;
}

[data-ice-theme="dark"] .shopfloor-terminal-container .active-resource-tag {
    background: #064e3b;
    color: #a7f3d0;
}

[data-ice-theme="dark"] .wo-no,
[data-ice-theme="dark"] .hero-wo-no,
[data-ice-theme="dark"] .part-code,
[data-ice-theme="dark"] .operator-name,
[data-ice-theme="dark"] .op-card-name {
    color: #ffffff;
}

[data-ice-theme="dark"] .hero-part-code {
    background: #334155;
    color: #f8fafc;
}

[data-ice-theme="dark"] .part-name,
[data-ice-theme="dark"] .hero-part-name,
[data-ice-theme="dark"] .wo-seq,
[data-ice-theme="dark"] .hero-seq,
[data-ice-theme="dark"] .op-name-row {
    color: #94a3b8;
}

[data-ice-theme="dark"] .stat-card,
[data-ice-theme="dark"] .hero-stopwatch-bar,
[data-ice-theme="dark"] .tab-nav-btn.active,
[data-ice-theme="dark"] .tab-empty {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

[data-ice-theme="dark"] .stopwatch-timer {
    background: rgba(22, 163, 74, 0.2);
    color: #86efac;
}

[data-ice-theme="dark"] .modal-intro,
[data-ice-theme="dark"] .approve-op-summary {
    background: #0f172a;
    border-color: #334155;
    border-left-color: #3b82f6;
    color: #e2e8f0;
}

[data-ice-theme="dark"] .btn-step-max {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(96, 165, 250, 0.4);
}

[data-ice-theme="dark"] .last-op-box {
    --bs-light-rgb: 6, 46, 35;
    --bs-border-color: #065f46;
    color: #d1fae5;
}

[data-ice-theme="dark"] .tabs-nav {
    background: #0f172a;
    border-color: #334155;
}

[data-ice-theme="dark"] .tab-nav-btn {
    color: #94a3b8;
}

[data-ice-theme="dark"] .tab-nav-btn:hover {
    background: #1e293b;
    color: #f1f5f9;
}

[data-ice-theme="dark"] .sub-table th {
    background: #0f172a;
    color: #94a3b8;
}

[data-ice-theme="dark"] .sub-table td {
    border-color: #334155;
    color: #e2e8f0;
}

[data-ice-theme="dark"] .btn-sub-action {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-ice-theme="dark"] .btn-sub-receive {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(96, 165, 250, 0.4);
    color: #93c5fd;
}

[data-ice-theme="dark"] .btn-toggle,
[data-ice-theme="dark"] .btn-step,
[data-ice-theme="dark"] .btn-touch-secondary,
[data-ice-theme="dark"] .operator-select-card {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-ice-theme="dark"] .btn-toggle.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

[data-ice-theme="dark"] .btn-toggle.btn-toggle-ok.active {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
}

[data-ice-theme="dark"] .btn-toggle.btn-toggle-warning.active {
    background: #d97706;
    border-color: #d97706;
    color: #ffffff;
}

[data-ice-theme="dark"] .btn-toggle.btn-toggle-danger.active {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

[data-ice-theme="dark"] .btn-toggle.btn-toggle-neutral.active {
    background: #475569;
    border-color: #64748b;
    color: #ffffff;
}

/* Hide XAF grids until their initial column widths have been fitted. */
dxbl-grid[xaf-grid-owner-dxgridlisteditorbase="DevExpress.ExpressApp.Blazor.Editors.DxGridListEditor"]:not(.ice-grid-auto-fit-ready) {
    visibility: hidden;
}

/* General ledger transfer preview (D-13): the document whose voucher stands beside the list is marked clearly. */
.ice-gl-preview-documents .dxbl-grid-selected-row > td {
    background: rgba(59, 130, 246, 0.16) !important;
    font-weight: 600;
}

[data-ice-theme="dark"] .ice-gl-preview-documents .dxbl-grid-selected-row > td {
    background: #1e3a8a !important;
}

/* ── Downtime capture and machine status (Durus-OEE-Plani-V1_1 §7.1-7.2) ── */
.ribbon-downtime-btn {
    min-height: 44px;
    border: 1px solid #991b1b;
    border-radius: 10px;
    background: #dc2626;
    color: #ffffff;
    font-weight: 700;
    font-size: 13.5px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2);
    transition: background-color 0.15s ease;
}

.ribbon-downtime-btn:hover { background: #b91c1c; }

.ribbon-fullscreen-btn {
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    font-size: 13.5px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ribbon-fullscreen-btn:hover { background: #f1f5f9; border-color: #94a3b8; }

[data-ice-theme="dark"] .ribbon-fullscreen-btn {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #334155;
}

/* Full screen on the terminal: over the application's header (1030) and under the terminal's own windows - DevExpress
   opens its popups from 1050 up, so the board's 2000 would have hidden them. The panes get the room the header had. */
.shopfloor-terminal-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1040;
    overflow-y: auto;
}

/* The application's logo where full screen hides the header: the terminal and the machine status board. */
.ice-fullscreen-logo {
    flex: 0 0 200px;
}

/* XAF hides the header logo while the navigation is collapsed; a full-screen view has no navigation, so its logo stays. */
.app:not(.main-ribbon-template).collapse-toggle .header-logo.ice-fullscreen-logo {
    display: block;
}

.shopfloor-terminal-fullscreen .shopfloor-operations-pane,
.shopfloor-terminal-fullscreen .shopfloor-action-pane {
    max-height: max(480px, calc(100vh - 190px));
}

.pane-view-toggle {
    display: flex;
    gap: 6px;
}

.btn-resume { background: #16a34a; }
.btn-resume:hover:not(:disabled) { background: #15803d; }

.btn-downtime { background: #dc2626; }
.btn-downtime:hover:not(:disabled) { background: #b91c1c; }

.btn-downtime-list { background: #475569; }
.btn-downtime-list:hover:not(:disabled) { background: #334155; }

.downtime-reason-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 8px;
}

.downtime-reason-tile {
    min-height: 54px;
    border: 1.5px solid var(--downtime-reason-color, #6b7280);
    border-left-width: 7px;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.downtime-reason-tile:hover {
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}

.downtime-reason-tile.selected {
    background: var(--downtime-reason-color, #6b7280);
    color: #ffffff;
}

.downtime-reason-alternatives {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.downtime-popup-tabs {
    display: flex;
    gap: 8px;
}

.downtime-unclassified-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.downtime-unclassified-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    background: #f8fafc;
}

.downtime-unclassified-row.active {
    border-color: #2563eb;
    border-left-color: #2563eb;
    background: #eff6ff;
}

.machine-status-pane {
    flex: 1;
    overflow-y: auto;
}

.machine-status-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.machine-status-tiles-large {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.machine-status-empty {
    padding: 24px;
    text-align: center;
    color: var(--ice-text-quiet);
}

.machine-status-tile {
    --machine-state-color: #64748b;
    border-radius: 12px;
    border: 1.5px solid var(--machine-state-color);
    border-top-width: 8px;
    background: var(--ice-surface);
    color: var(--ice-text-strong);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    min-height: 130px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.machine-status-clickable { cursor: pointer; }
.machine-status-clickable:hover { box-shadow: 0 3px 10px rgba(15, 23, 42, 0.14); }

.machine-state-running { --machine-state-color: #16a34a; }
.machine-state-setup { --machine-state-color: #0284c7; }
.machine-state-down { --machine-state-color: var(--machine-reason-color, #dc2626); }
.machine-state-planneddown { --machine-state-color: var(--machine-reason-color, #64748b); }
.machine-state-idle { --machine-state-color: #ca8a04; }
.machine-state-offshift { --machine-state-color: #94a3b8; }

/* The state badge drops under the code when both do not fit, and breaks its own text only where a line
   of its own is still too narrow: "Außerhalb der Schicht" is wider than a 190px terminal tile, ran off its
   edge and squeezed the machine code onto three lines (downtime UAT-055, K-12). */
.machine-status-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 2px 6px;
}

.machine-status-code { font-size: 15px; }

.machine-status-state {
    background: var(--machine-state-color);
    color: #ffffff;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    max-width: 100%;
    text-align: center;
}

.machine-status-name,
.machine-status-workcenter,
.machine-status-part,
.machine-status-operators {
    color: var(--ice-text-label);
}

.machine-status-job {
    font-weight: 600;
    color: var(--ice-text-bright);
}

.machine-status-elapsed {
    font-size: 18px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.machine-status-reason {
    font-weight: 700;
    color: var(--machine-state-color);
}

.machine-status-tiles-large .machine-status-tile { font-size: 15px; min-height: 160px; }
.machine-status-tiles-large .machine-status-code { font-size: 20px; }
.machine-status-tiles-large .machine-status-elapsed { font-size: 26px; }

/* The machine's OEE so far today on the TV board (OEE licence, Durus-OEE-Plani-V1_1 §7.2). */
.machine-status-oee {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.machine-status-tiles-large .machine-status-oee { font-size: 18px; }

.machine-status-board {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px;
}

.machine-status-board-tv {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: var(--ice-surface-well);
    padding: 16px 20px;
    overflow-y: auto;
}

.machine-status-board-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.machine-status-board-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Side by side: a combo box takes the whole width it is given, so the two stacked (tour, 11.10.2026). */
.machine-status-board-site,
.machine-status-board-workcenter {
    flex: 0 0 300px;
    width: 300px;
}

.machine-status-board-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.machine-status-count {
    border-left: 6px solid var(--machine-state-color);
    background: var(--ice-surface);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 14px;
}

.machine-status-board-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.machine-status-board-clock {
    font-size: 26px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

[data-ice-theme="dark"] .downtime-reason-tile,
[data-ice-theme="dark"] .machine-status-tile,
[data-ice-theme="dark"] .machine-status-count {
    background: #1e293b;
    color: #f1f5f9;
}

[data-ice-theme="dark"] .downtime-reason-tile.selected {
    background: var(--downtime-reason-color, #6b7280);
    color: #ffffff;
}

[data-ice-theme="dark"] .downtime-unclassified-row {
    background: #0f172a;
    border-color: #334155;
    border-left-color: #f59e0b;
    color: #e2e8f0;
}

[data-ice-theme="dark"] .downtime-unclassified-row.active {
    background: rgba(30, 58, 138, 0.45);
    border-color: #3b82f6;
    border-left-color: #3b82f6;
}

[data-ice-theme="dark"] .machine-status-board-tv {
    color: #f1f5f9;
}

/* "Report Fault" on a machine tile and the stop window's maintenance request box (Bakim-Modul-Plani-V2_0 M6). */
.machine-status-fault-button {
    margin-top: auto;
    align-self: flex-start;
    border: 1px solid #d97706;
    border-radius: 8px;
    background: #fffbeb;
    color: var(--ice-tone-warning-fg);
    font-weight: 700;
    font-size: 12px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.machine-status-fault-button:hover { background: #fef3c7; }

.downtime-maintenance-request {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: var(--ice-tone-warning-fg);
    cursor: pointer;
}

.downtime-maintenance-request .form-check-input {
    width: 1.35em;
    height: 1.35em;
    margin: 0;
}

[data-ice-theme="dark"] .downtime-maintenance-request {
    background: rgba(120, 53, 15, 0.35);
    border-color: rgba(245, 158, 11, 0.45);
}

[data-ice-theme="dark"] .machine-status-fault-button {
    background: #451a03;
    border-color: #f59e0b;
}

/* Open maintenance and the next planned maintenance stop on a machine tile (Bakim-Modul-Plani-V2_0 B4.4). */
.machine-status-maintenance,
.machine-status-planned-maintenance {
    color: #334155;
    font-weight: 600;
    font-size: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 3px 8px;
}

/* An order under way that stops the machine; one that leaves it running keeps the calm colour above. */
.machine-status-maintenance-stopping {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
    font-weight: 700;
}

[data-ice-theme="dark"] .machine-status-maintenance,
[data-ice-theme="dark"] .machine-status-planned-maintenance {
    color: #cbd5e1;
    background: #0f172a;
    border-color: #334155;
}

[data-ice-theme="dark"] .machine-status-maintenance-stopping {
    color: #fca5a5;
    background: rgba(127, 29, 29, 0.3);
    border-color: rgba(248, 113, 113, 0.4);
}

/* Operator checks due on a machine tile, and the tile's buttons in one row (Bakim-Modul-Plani-V2_1 M49). */
.machine-status-checks {
    color: var(--ice-danger-text);
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
}

.machine-status-actions {
    margin-top: auto;
    padding-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.machine-status-actions .machine-status-fault-button {
    margin-top: 0;
}

.machine-status-check-button {
    border: 1px solid #dc2626;
    border-radius: 8px;
    background: #fef2f2;
    color: var(--ice-tone-danger-fg);
    font-weight: 700;
    font-size: 12px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.machine-status-check-button:hover { background: #fee2e2; }

[data-ice-theme="dark"] .machine-status-checks {
    background: rgba(127, 29, 29, 0.3);
    border-color: rgba(248, 113, 113, 0.4);
}

[data-ice-theme="dark"] .machine-status-check-button {
    background: #450a0a;
    border-color: #f87171;
}

/* The operator check window (M50): one block per step, a problem step marked. */
.operator-check-plan {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #cbd5e1;
    border-left: 4px solid #2563eb;
}

.operator-check-plan-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 15.5px;
    color: var(--ice-text-title);
}

.operator-check-remaining {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 999px;
    padding: 2px 9px;
    font-weight: 700;
    font-size: 12px;
}

.operator-check-plan-detail {
    color: var(--bs-secondary-color, #64748b);
    font-size: 13px;
    margin-top: 2px;
}

.operator-check-step {
    border: 1px solid var(--bs-border-color, #cbd5e1);
    border-left: 4px solid #94a3b8;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.operator-check-step-ok {
    border-color: #86efac;
    border-left-color: #16a34a;
    background: #f0fdf4;
}

.operator-check-step-problem {
    border-color: #f59e0b;
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.operator-check-step-text {
    font-weight: 700;
    font-size: 15px;
    color: var(--ice-text-title);
}

.operator-check-required {
    color: #b91c1c;
    margin-left: 4px;
}

.operator-check-results {
    margin-bottom: 0;
}

.operator-check-extras {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.operator-check-extras .form-control {
    flex: 1 1 220px;
}

.operator-check-photo {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--bs-border-color, #cbd5e1);
    background: #f8fafc;
    border-radius: 8px;
    padding: 7px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    max-width: 260px;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: background-color 0.15s ease;
}

.operator-check-photo:hover {
    background: #f1f5f9;
}

.operator-check-photo-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

[data-ice-theme="dark"] .operator-check-plan {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
    border-left-color: #3b82f6;
}

[data-ice-theme="dark"] .operator-check-remaining {
    background: rgba(127, 29, 29, 0.35);
    border-color: rgba(248, 113, 113, 0.45);
    color: #fecaca;
}

[data-ice-theme="dark"] .operator-check-step {
    background: #0f172a;
    border-color: #334155;
    border-left-color: #64748b;
    color: #e2e8f0;
}

[data-ice-theme="dark"] .operator-check-step-ok {
    background: rgba(6, 78, 59, 0.35);
    border-color: #059669;
    border-left-color: #22c55e;
}

[data-ice-theme="dark"] .operator-check-step-problem {
    background: #451a03;
    border-color: #f59e0b;
    border-left-color: #f59e0b;
}

[data-ice-theme="dark"] .operator-check-photo {
    background: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
}
/* ---- Maintenance terminal (Bakim-Modul-Plani-V2_1 M57): tablet first, the shop floor terminal's touch buttons ---- */
.maintenance-terminal {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px;
    font-size: 15px;
    background: #f4f7fb;
    border-radius: 10px;
}

/* Full screen like the shop floor terminal: over the application's header, under DevExpress's windows (1050 up). */
.maintenance-terminal-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1040;
    overflow-y: auto;
    background: #f4f7fb;
    padding: 12px 16px;
    border-radius: 0;
}

.maintenance-terminal-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    background: var(--ice-surface);
    border: 1px solid var(--ice-track);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.maintenance-terminal-who {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--ice-track);
    border-radius: 10px;
    padding: 6px 14px;
    background: #f8fafc;
}

.maintenance-terminal-who-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    font-size: 18px;
}

.maintenance-terminal-who-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--bs-secondary-color, #64748b);
}

.maintenance-terminal-search {
    flex: 1 1 360px;
    border: 1.5px solid #cbd5e1;
    box-shadow: none;
    background: #f8fafc;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.maintenance-terminal-search:focus-within {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.maintenance-terminal-search .maintenance-terminal-find {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 6px 16px;
    border-radius: 8px;
    background: #2563eb;
}

.maintenance-terminal-search .maintenance-terminal-find:hover {
    background: #1d4ed8;
}

.maintenance-terminal-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.maintenance-terminal-clock {
    font-size: 17px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 68px;
    text-align: center;
    padding: 7px 12px;
    border-radius: 8px;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-track);
    color: var(--ice-text-strong);
}

.maintenance-terminal-meta .btn-touch-secondary {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    white-space: nowrap;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #334155;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.maintenance-terminal-meta .btn-touch-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.maintenance-terminal-timer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    border: 1px solid #93c5fd;
    border-left: 4px solid #2563eb;
    border-radius: 10px;
    padding: 8px 14px;
    background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 100%);
    color: #1e3a8a;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
}

.maintenance-terminal-timer-icon {
    font-size: 20px;
}

.maintenance-terminal-timer-text {
    flex: 1 1 260px;
    font-weight: 600;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.maintenance-terminal-timer-elapsed {
    margin-left: 6px;
    padding: 2px 9px;
    border-radius: 6px;
    background: #dbeafe;
    color: var(--ice-link-hover);
    font-size: 17px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.maintenance-terminal-timer .maintenance-terminal-timer-stop {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 6px 16px;
}

.maintenance-terminal-count {
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: #dbeafe;
    color: #1e40af;
}

.maintenance-terminal-empty {
    color: var(--bs-secondary-color, #64748b);
    margin: 0;
}

.maintenance-terminal-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    min-height: 112px;
    border: 1px solid #dbe3ee;
    border-left: 5px solid #94a3b8;
    border-radius: 10px;
    padding: 11px 14px;
    background: #ffffff;
    color: inherit;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.maintenance-terminal-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.maintenance-terminal-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 15.5px;
    color: var(--ice-text-strong);
}

.maintenance-terminal-card-equipment {
    font-weight: 600;
    font-size: 14px;
    color: var(--ice-text-bright);
}

.maintenance-terminal-card-text {
    font-size: 13.5px;
    color: var(--bs-secondary-color, #475569);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.maintenance-terminal-card-meta {
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px dashed var(--ice-track);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: var(--bs-secondary-color, #64748b);
}

.maintenance-terminal-card.maintenance-terminal-priority-urgent { border-left-color: #dc2626; }
.maintenance-terminal-card.maintenance-terminal-priority-high { border-left-color: #d97706; }
.maintenance-terminal-card.maintenance-terminal-priority-normal { border-left-color: #2563eb; }
.maintenance-terminal-card.maintenance-terminal-priority-low { border-left-color: #94a3b8; }

.maintenance-terminal-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11.5px;
    font-weight: 700;
    background: #e2e8f0;
    color: #334155;
    border: 1px solid transparent;
}

.maintenance-terminal-badge.maintenance-terminal-priority-urgent { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.maintenance-terminal-badge.maintenance-terminal-priority-high { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.maintenance-terminal-badge.maintenance-terminal-priority-normal { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.maintenance-terminal-badge.maintenance-terminal-status-inprogress { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.maintenance-terminal-badge.maintenance-terminal-status-released { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.maintenance-terminal-badge.maintenance-terminal-status-completed,
.maintenance-terminal-badge.maintenance-terminal-status-closed { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.maintenance-terminal-badge.maintenance-terminal-stops { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.maintenance-terminal-label {
    display: inline-block;
    min-width: 110px;
    font-size: 13px;
    font-weight: 600;
    color: var(--bs-secondary-color, #64748b);
}

.maintenance-terminal-description {
    margin: 0;
    white-space: pre-line;
    font-size: 14px;
    color: var(--ice-text-secondary);
    background: var(--ice-surface-deep);
    border: 1px solid var(--ice-track);
    border-radius: 8px;
    padding: 8px 12px;
}

.maintenance-terminal-photo {
    position: relative;
    overflow: hidden;
    margin: 0;
}

.maintenance-terminal-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.maintenance-terminal-row:hover {
    border-color: #cbd5e1;
}

.maintenance-terminal-row > .btn-touch-secondary,
.maintenance-terminal-row > .btn-touch-primary {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 6px 14px;
}

.maintenance-terminal-row-mine {
    border-left: 4px solid #2563eb;
    background: #f8fbff;
}

.maintenance-terminal-row-button {
    width: 100%;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.maintenance-terminal-row-button:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.maintenance-terminal-row-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1 1 260px;
}

.maintenance-terminal-row-meta {
    font-size: 12.5px;
    color: var(--bs-secondary-color, #64748b);
}

.maintenance-terminal-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.maintenance-terminal-row-actions .btn-touch-primary,
.maintenance-terminal-row-actions .btn-touch-secondary {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 6px 14px;
    border-radius: 8px;
}

.maintenance-terminal-location {
    min-width: 200px;
}

.maintenance-terminal-quantity {
    width: 150px;
}

.maintenance-terminal-hint {
    font-size: 13px;
    color: var(--bs-secondary-color, #64748b);
}

.maintenance-terminal-hours {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    padding: 3px 10px;
    border-radius: 6px;
    background: var(--ice-selected-bg);
    color: var(--ice-link);
    border: 1px solid #dbeafe;
}

.maintenance-terminal-dialog {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.maintenance-terminal-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

/* V2.1 C9: the maintenance terminal in the shop floor terminal's frame - the work queue on the left, the selected order or
   equipment on the right. The panes scroll inside the screen as on the shop floor, under the terminal's own header. */
.maintenance-terminal .shopfloor-operations-pane {
    flex: 1 1 38%;
}

.maintenance-terminal .shopfloor-action-pane {
    flex: 1 1 62%;
}

.maintenance-terminal .shopfloor-operations-pane,
.maintenance-terminal .shopfloor-action-pane {
    max-height: max(480px, calc(100vh - 260px));
}

.maintenance-terminal-fullscreen .shopfloor-operations-pane,
.maintenance-terminal-fullscreen .shopfloor-action-pane {
    max-height: max(480px, calc(100vh - 170px));
}

.maintenance-terminal .pane-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.maintenance-terminal .pane-view-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.maintenance-terminal .pane-view-toggle .chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    text-align: left;
}

.maintenance-terminal .pane-view-toggle .chip:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.maintenance-terminal .pane-view-toggle .chip.active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.maintenance-terminal-chip-count {
    font-size: 11.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
}

.maintenance-terminal-queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    background: #f4f7fb;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px;
}

.maintenance-terminal-tab-content .maintenance-terminal-queue-list {
    background: transparent;
    border: 0;
    padding: 0;
}

.maintenance-terminal-queue-list .maintenance-terminal-card {
    min-height: 0;
    flex-shrink: 0;
}

/* The team's cards name their people, a running timer beside its person (V2.1 Ek C12). */
.maintenance-terminal-card-crew {
    font-size: 12.5px;
    color: var(--bs-secondary-color, #475569);
    background: var(--ice-surface-inset);
    border-radius: 6px;
    padding: 3px 8px;
}

.maintenance-terminal-running {
    color: #15803d;
    font-weight: 600;
}

.maintenance-terminal-dialog-error {
    margin: 8px 0 0;
    color: var(--ice-danger-text);
    font-weight: 600;
}

.maintenance-terminal-card.selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.maintenance-terminal .selected-op-hero {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    padding: 14px 16px;
    gap: 10px;
}

.maintenance-terminal .selected-op-hero.hero-running {
    background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}

.maintenance-terminal .hero-part-code {
    background: #e2e8f0;
    color: #0f172a;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 13.5px;
}

.maintenance-terminal-hero-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.maintenance-terminal-hero-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    font-size: 12.5px;
    color: var(--bs-secondary-color, #64748b);
}

.maintenance-terminal-hero-facts > span {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 3px 10px;
}

.maintenance-terminal .hero-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 10px;
}

.maintenance-terminal .hero-stats-grid .stat-card {
    border-color: var(--ice-border-cool);
    padding: 9px 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.maintenance-terminal .hero-stats-grid .stat-val {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

/* Harmonized touch action buttons: utility buttons stay calm, primary actions keep semantic accents. */
.maintenance-terminal-actions-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.maintenance-terminal-actions-grid .touch-btn {
    min-height: 48px;
    border-radius: 10px;
    font-size: 13.5px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.maintenance-terminal-actions-grid .btn-approve {
    grid-column: span 1;
    background: #0d9488;
}

.maintenance-terminal-actions-grid .btn-approve:hover:not(:disabled) {
    background: #0f766e;
}

.maintenance-terminal-actions-grid .maintenance-terminal-btn-utility {
    background: #f8fafc;
    color: var(--ice-text);
    border: 1px solid var(--ice-border-firm);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.maintenance-terminal-actions-grid .maintenance-terminal-btn-utility:hover:not(:disabled) {
    background: var(--ice-surface-hover);
    border-color: var(--ice-border-muted);
    color: var(--ice-text-max);
}

.maintenance-terminal-tabs {
    border-color: #dbe3ee;
    border-radius: 12px;
}

.maintenance-terminal-tabs .tabs-nav {
    flex-wrap: wrap;
    background: #f8fafc;
    padding: 4px 6px 0;
    gap: 4px;
    border-bottom: 1px solid #e2e8f0;
}

.maintenance-terminal-tabs .tab-nav-btn {
    flex: 1 0 auto;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 8px 8px 0 0;
    padding: 9px 12px;
    font-size: 13px;
}

.maintenance-terminal-tab-count {
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
}

.maintenance-terminal-tab-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--ice-surface);
}

.maintenance-terminal-tab-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #334155;
    margin: 6px 0 2px;
}

/* Checklist steps inside Maintenance Terminal */
.maintenance-terminal .operator-check-step {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 4px;
}

.maintenance-terminal .operator-check-step.operator-check-step-done {
    border-left-color: #16a34a;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.maintenance-terminal .operator-check-step.operator-check-step-problem {
    border-color: #fcd34d;
    border-left-color: #d97706;
    background: #fffbeb;
}

/* Under an order the equipment tab starts with the equipment itself. */
.maintenance-terminal-equipment-summary {
    border-left: 4px solid #3b82f6;
    background: #f0f7ff;
}

/* On a tablet held upright the queue sits above the order: kept short so the buttons stay in reach,
   and the order grows with its tab so the page scrolls instead of the tab's few rows. */
@media (max-width: 1024px) {
    .maintenance-terminal .shopfloor-operations-pane {
        max-height: 40vh;
    }

    .maintenance-terminal .shopfloor-action-pane {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .maintenance-terminal .pane-view-toggle {
        grid-template-columns: 1fr;
    }
}

[data-ice-theme="dark"] .maintenance-terminal,
[data-ice-theme="dark"] .maintenance-terminal-fullscreen {
    background: #0f172a;
    color: #f1f5f9;
}

[data-ice-theme="dark"] .maintenance-terminal-header {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

[data-ice-theme="dark"] .maintenance-terminal-who,
[data-ice-theme="dark"] .maintenance-terminal-card,
[data-ice-theme="dark"] .maintenance-terminal-row {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-ice-theme="dark"] .maintenance-terminal-who-icon {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(96, 165, 250, 0.3);
}

[data-ice-theme="dark"] .maintenance-terminal-search {
    background: #0f172a;
    border-color: #334155;
}

[data-ice-theme="dark"] .maintenance-terminal-search:focus-within {
    background: #0f172a;
    border-color: #60a5fa;
}

[data-ice-theme="dark"] .maintenance-terminal-meta .btn-touch-secondary {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

[data-ice-theme="dark"] .maintenance-terminal-meta .btn-touch-secondary:hover {
    background: #243247;
    border-color: #475569;
}

[data-ice-theme="dark"] .maintenance-terminal .pane-view-toggle .chip {
    background: #162032;
    border-color: #334155;
    color: #cbd5e1;
}

[data-ice-theme="dark"] .maintenance-terminal .pane-view-toggle .chip:hover {
    background: #243247;
    border-color: #475569;
}

[data-ice-theme="dark"] .maintenance-terminal .pane-view-toggle .chip.active {
    background: #1e3a8a;
    border-color: #3b82f6;
    color: #eff6ff;
}

[data-ice-theme="dark"] .maintenance-terminal-queue-list {
    background: #162032;
    border-color: #334155;
}

[data-ice-theme="dark"] .maintenance-terminal-card-top,
[data-ice-theme="dark"] .maintenance-terminal-card-equipment,
[data-ice-theme="dark"] .maintenance-terminal-tab-title {
    color: #f1f5f9;
}

[data-ice-theme="dark"] .maintenance-terminal-card-crew {
    color: #cbd5e1;
}

[data-ice-theme="dark"] .maintenance-terminal-selected-hero,
[data-ice-theme="dark"] .maintenance-terminal .selected-op-hero {
    background: #162032;
    border-color: #334155;
}

[data-ice-theme="dark"] .maintenance-terminal .selected-op-hero.hero-running {
    background: rgba(20, 83, 45, 0.45);
    border-color: #16a34a;
}

[data-ice-theme="dark"] .maintenance-terminal .hero-part-code {
    background: #334155;
    color: #f1f5f9;
}

[data-ice-theme="dark"] .maintenance-terminal-description,
[data-ice-theme="dark"] .maintenance-terminal-hero-facts > span {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

[data-ice-theme="dark"] .maintenance-terminal .hero-stats-grid .stat-card {
    background: #1e293b;
}

[data-ice-theme="dark"] .maintenance-terminal-actions-grid .maintenance-terminal-btn-utility {
    background: #162032;
}

[data-ice-theme="dark"] .maintenance-terminal-tabs {
    border-color: #334155;
}

[data-ice-theme="dark"] .maintenance-terminal-tabs .tabs-nav {
    background: #162032;
    border-bottom-color: #334155;
}

[data-ice-theme="dark"] .maintenance-terminal-row {
    background: #162032;
    border-color: #334155;
}

[data-ice-theme="dark"] .maintenance-terminal-row-mine {
    border-left-color: #60a5fa;
    background: rgba(30, 58, 138, 0.25);
}

[data-ice-theme="dark"] .maintenance-terminal-row-button:hover {
    background: #243247;
    border-color: #475569;
}

[data-ice-theme="dark"] .maintenance-terminal-hours {
    border-color: rgba(96, 165, 250, 0.35);
}

[data-ice-theme="dark"] .maintenance-terminal .operator-check-step {
    background: #162032;
    border-color: #334155;
    border-left-color: #475569;
}

[data-ice-theme="dark"] .maintenance-terminal .operator-check-step.operator-check-step-done {
    background: rgba(20, 83, 45, 0.3);
    border-color: #166534;
    border-left-color: #22c55e;
}

[data-ice-theme="dark"] .maintenance-terminal .operator-check-step.operator-check-step-problem {
    background: rgba(120, 53, 15, 0.35);
    border-color: #b45309;
    border-left-color: #f59e0b;
}

[data-ice-theme="dark"] .maintenance-terminal-equipment-summary {
    border-left-color: #60a5fa;
    background: rgba(30, 58, 138, 0.28);
}

[data-ice-theme="dark"] .maintenance-terminal-running {
    color: #4ade80;
}

[data-ice-theme="dark"] .maintenance-terminal-card.selected {
    background: #1e3a8a;
    border-color: #3b82f6;
}

[data-ice-theme="dark"] .maintenance-terminal-card:hover {
    border-color: #64748b;
}

[data-ice-theme="dark"] .maintenance-terminal-who-label,
[data-ice-theme="dark"] .maintenance-terminal-hero-facts,
[data-ice-theme="dark"] .maintenance-terminal-empty,
[data-ice-theme="dark"] .maintenance-terminal-card-text,
[data-ice-theme="dark"] .maintenance-terminal-card-meta,
[data-ice-theme="dark"] .maintenance-terminal-label,
[data-ice-theme="dark"] .maintenance-terminal-row-meta,
[data-ice-theme="dark"] .maintenance-terminal-hint {
    color: #cbd5e1;
}

[data-ice-theme="dark"] .maintenance-terminal-timer {
    background: #172554;
    border-color: #1d4ed8;
    border-left-color: #60a5fa;
    color: #dbeafe;
}

[data-ice-theme="dark"] .maintenance-terminal-timer-elapsed {
    background: #1e3a8a;
}

[data-ice-theme="dark"] .maintenance-terminal-count,
[data-ice-theme="dark"] .maintenance-terminal-badge {
    background: #334155;
    color: #e2e8f0;
}

[data-ice-theme="dark"] .maintenance-terminal-badge.maintenance-terminal-priority-urgent,
[data-ice-theme="dark"] .maintenance-terminal-badge.maintenance-terminal-stops { background: #7f1d1d; color: #fecaca; border-color: #991b1b; }
[data-ice-theme="dark"] .maintenance-terminal-badge.maintenance-terminal-priority-high { background: #78350f; color: #fde68a; border-color: #92400e; }
[data-ice-theme="dark"] .maintenance-terminal-badge.maintenance-terminal-priority-normal { background: #1e3a8a; color: #bfdbfe; border-color: #1d4ed8; }
[data-ice-theme="dark"] .maintenance-terminal-badge.maintenance-terminal-status-inprogress { background: #14532d; color: #bbf7d0; border-color: #166534; }
[data-ice-theme="dark"] .maintenance-terminal-badge.maintenance-terminal-status-released { background: #312e81; color: #c7d2fe; border-color: #4338ca; }

/* An XAF form in a dialog: DevExpress's form layout pulls its rows 6 px past their container, and the dialog body has only
   4 px above and below, so every short dialog form overflowed by 2 px and drew a scroll bar beside its fields (the AI
   assistant, popup audit 29.11.2026). The selector repeats DevExpress's own chain to outrank it; list dialogs,
   confirmations and the cockpits' own dialogs carry no XAF form and keep their padding. */
.dxbl-modal > .dxbl-modal-root > .dxbl-popup > .dxbl-modal-content > .dxbl-modal-body:has(> .main .detail-view-content > .dxbl-fl) {
    padding-top: 6px;
    padding-bottom: 6px;
}

/* A DevExpress dialog keeps its theme margin (1.75rem) on both sides and a MaxWidth in vw does not count it: on a 375 px
   phone "95vw" ran 37 px past the screen and cut the close button off (SSH-K-18). On a phone the margins come out of the width. */
@media (max-width: 576px) {
    .dxbl-modal-root > .dxbl-popup {
        margin-inline: 0.5rem !important;
        max-width: calc(100vw - 1rem) !important;
    }
}

/* ---- Service terminal (Satis-Sonrasi-Modul-Plani-V2_0 Faz 1b), in the maintenance terminal's frame (SSH screen tour,
   30.10.2026): my visits on the left, the selected visit on the right; a narrow screen stacks them. ---- */
.service-terminal {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px;
    font-size: 15px;
}

/* Full screen like the maintenance terminal: over the application's header, under DevExpress's windows (1050 up). */
.service-terminal-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1040;
    overflow-y: auto;
    background: var(--bs-body-bg, #ffffff);
    padding: 12px 16px;
}

.service-terminal-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.service-terminal .shopfloor-operations-pane {
    flex: 1 1 38%;
}

.service-terminal .shopfloor-action-pane {
    flex: 1 1 62%;
}

.service-terminal .shopfloor-operations-pane,
.service-terminal .shopfloor-action-pane {
    max-height: max(480px, calc(100vh - 220px));
}

.service-terminal-fullscreen .shopfloor-operations-pane,
.service-terminal-fullscreen .shopfloor-action-pane {
    max-height: max(480px, calc(100vh - 140px));
}

.service-terminal .pane-header {
    flex-wrap: wrap;
    gap: 8px;
}

.service-terminal-queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.service-terminal-queue-list .service-terminal-card {
    flex-shrink: 0;
}

.service-terminal-card.selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.service-terminal-hero-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Four boxes to a row while they fit, two on a phone: "Kullanılan Malzemeler" was cut off at 375 px. */
.service-terminal .hero-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.service-terminal .hero-stats-grid .stat-val {
    font-size: 14px;
}

.service-terminal-description {
    margin: 0;
    white-space: pre-line;
}

.service-terminal-tabs .tabs-nav {
    flex-wrap: wrap;
}

.service-terminal-tabs .tab-nav-btn {
    flex: 1 0 auto;
    white-space: nowrap;
}

.service-terminal-tab-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-terminal-meta .btn-touch-secondary {
    white-space: nowrap;
}

.service-terminal-count {
    border-radius: 999px;
    padding: 0 9px;
    font-size: 13px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.25);
}

.service-terminal-running {
    color: #15803d;
    font-weight: 600;
}

/* On a tablet held upright or a phone the list sits above the visit: kept short so the buttons stay in reach. */
@media (max-width: 1024px) {
    .service-terminal .shopfloor-operations-pane {
        max-height: 40vh;
    }

    .service-terminal .shopfloor-action-pane {
        max-height: none;
    }
}

.service-terminal-who {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 10px;
    padding: 6px 14px;
    background: #f8fafc;
}

.service-terminal-who-icon {
    font-size: 22px;
}

.service-terminal-who-label {
    display: block;
    font-size: 12px;
    color: var(--bs-secondary-color, #64748b);
}

.service-terminal-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-terminal-clock {
    font-size: 20px;
    font-weight: 600;
}

.service-terminal-timer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    border: 1px solid #93c5fd;
    border-radius: 10px;
    padding: 8px 12px;
    background: #eff6ff;
    color: #1e3a8a;
}

.service-terminal-timer-text {
    flex: 1 1 200px;
}

.service-terminal-timer-elapsed {
    margin-left: 8px;
    font-size: 18px;
}

.service-terminal-outcomes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.service-terminal-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-left-width: 5px;
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--bs-body-bg, #ffffff);
    color: inherit;
    min-height: 96px;
    cursor: pointer;
}

.service-terminal-card:hover {
    border-color: #94a3b8;
}

.service-terminal-card.service-terminal-priority-urgent { border-left-color: #dc2626; }
.service-terminal-card.service-terminal-priority-high { border-left-color: #f59e0b; }
.service-terminal-card.service-terminal-priority-normal { border-left-color: #3b82f6; }
.service-terminal-card.service-terminal-priority-low { border-left-color: #94a3b8; }

.service-terminal-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.service-terminal-card-customer {
    font-weight: 600;
}

.service-terminal-card-window,
.service-terminal-card-address,
.service-terminal-card-product,
.service-terminal-hint,
.service-terminal-empty {
    color: var(--bs-secondary-color, #64748b);
    font-size: 14px;
}

.service-terminal-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    background: #e2e8f0;
    color: #334155;
}

.service-terminal-badge.service-terminal-status-started { background: #dcfce7; color: #166534; }
.service-terminal-badge.service-terminal-status-planned { background: #e0e7ff; color: #3730a3; }

.service-terminal-photo {
    position: relative;
    overflow: hidden;
    margin: 0;
}

.service-terminal-photo-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.service-terminal-facts {
    display: grid;
    grid-template-columns: minmax(120px, max-content) 1fr;
    gap: 6px 14px;
    margin: 0;
}

.service-terminal-facts dt {
    font-weight: 600;
    color: var(--bs-secondary-color, #64748b);
}

.service-terminal-facts dd {
    margin: 0;
}

.service-terminal-multiline {
    white-space: pre-wrap;
}

.service-terminal-phone {
    display: inline-block;
    margin-left: 8px;
    font-weight: 600;
}

.service-terminal-section {
    margin: 8px 0 0;
    font-size: 16px;
}

.service-terminal-rows {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.service-terminal-rows li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
    padding: 8px 10px;
}

.service-terminal-rows li.service-terminal-mine {
    border-left: 4px solid #3b82f6;
}

.service-terminal-remove {
    margin-left: auto;
    min-height: 36px;
    min-width: 44px;
}

.service-terminal-dialog {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* The shop floor's search box grows along its row (flex 1 1 320px); in the window's column that would be its height. */
.service-terminal-dialog .service-terminal-search {
    flex: 0 0 auto;
}

.service-terminal-label {
    font-weight: 600;
    margin-top: 4px;
}

.service-terminal-choices {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 40vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.service-terminal-choice {
    width: 100%;
    text-align: left;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--bs-body-bg, #ffffff);
    color: inherit;
    min-height: 44px;
}

.service-terminal-choice.active {
    border-color: #3b82f6;
    background: #eff6ff;
}

.service-terminal-form-frame {
    width: 100%;
    height: 70vh;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 4px;
    background: #fff;
}

.service-terminal-dialog-error {
    color: #b91c1c;
    margin: 0;
}

/* A phone held upright: the facts under their labels, the list's chips across the row. */
@media (max-width: 768px) {
    .service-terminal {
        padding: 4px;
        font-size: 16px;
    }

    .service-terminal-facts {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .service-terminal-facts dd {
        margin-bottom: 8px;
    }

    .service-terminal .pane-view-toggle .chip {
        flex: 1 1 30%;
        text-align: center;
    }
}

[data-ice-theme="dark"] .service-terminal-who,
[data-ice-theme="dark"] .service-terminal-card,
[data-ice-theme="dark"] .service-terminal-rows li,
[data-ice-theme="dark"] .service-terminal-choice {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-ice-theme="dark"] .service-terminal-timer {
    background: #172554;
    border-color: #1d4ed8;
    color: #dbeafe;
}

[data-ice-theme="dark"] .service-terminal-who-label,
[data-ice-theme="dark"] .service-terminal-card-window,
[data-ice-theme="dark"] .service-terminal-card-address,
[data-ice-theme="dark"] .service-terminal-card-product,
[data-ice-theme="dark"] .service-terminal-hint,
[data-ice-theme="dark"] .service-terminal-empty,
[data-ice-theme="dark"] .service-terminal-facts dt {
    color: #cbd5e1;
}

[data-ice-theme="dark"] .service-terminal-badge {
    background: #334155;
    color: #e2e8f0;
}

[data-ice-theme="dark"] .service-terminal-badge.service-terminal-status-started { background: #14532d; color: #bbf7d0; }
[data-ice-theme="dark"] .service-terminal-badge.service-terminal-status-planned { background: #312e81; color: #c7d2fe; }

[data-ice-theme="dark"] .service-terminal-fullscreen {
    background: #0f172a;
    color: #f1f5f9;
}

[data-ice-theme="dark"] .service-terminal-card.selected {
    background: #1e3a8a;
    border-color: #3b82f6;
}

[data-ice-theme="dark"] .service-terminal-running {
    color: #4ade80;
}

[data-ice-theme="dark"] .service-terminal-choice.active {
    background: #1e3a8a;
    border-color: #3b82f6;
}

[data-ice-theme="dark"] .service-terminal-dialog-error {
    color: #fca5a5;
}

/* ---- OEE cockpit (Durus-OEE-Plani-V1_1 §9, G4.1) ---- */
.oee-cockpit {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px;
}

.oee-cockpit-note {
    font-size: 13px;
    color: var(--bs-secondary-color, #64748b);
}

.oee-good { color: #15803d; }
.oee-fair { color: #b45309; }
.oee-poor { color: #b91c1c; }

.oee-gauges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.oee-gauge {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 260px;
    flex: 1;
}

.oee-gauge-caption { width: 110px; font-size: 13px; }
.oee-gauge-value { width: 60px; text-align: right; font-variant-numeric: tabular-nums; }

.oee-gauge-track {
    position: relative;
    flex: 1;
    height: 14px;
    border-radius: 7px;
    background: var(--ice-track);
    overflow: hidden;
}

.oee-gauge-fill {
    height: 100%;
    background: #6366f1;
}

.oee-gauge-fill.oee-good { background: #16a34a; }
.oee-gauge-fill.oee-fair { background: #f59e0b; }
.oee-gauge-fill.oee-poor { background: #dc2626; }

.oee-gauge-reference {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 85%;
    border-left: 2px dashed var(--ice-text-strong);
}

.oee-gauge-legend {
    font-size: 12px;
    color: var(--bs-secondary-color, #64748b);
}

.oee-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 12px;
}

.oee-card {
    background: var(--bs-body-bg, #ffffff);
    border: 1px solid var(--ice-track);
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 0;
}

.oee-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
}

.oee-card h5 {
    font-size: 13px;
    font-weight: 600;
    margin: 8px 0 4px;
}

.oee-table,
.oee-waterfall-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.oee-table th,
.oee-table td,
.oee-waterfall-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

.oee-table th { color: var(--bs-secondary-color, #64748b); font-weight: 600; text-align: left; }
.oee-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.oee-clickable { cursor: pointer; }
.oee-clickable:hover { background: rgba(99, 102, 241, .08); }

.oee-bar {
    height: 10px;
    border-radius: 5px;
    background: var(--ice-border-soft);
    overflow: hidden;
}

.oee-bar-fill { height: 100%; background: #6366f1; }
.oee-bar-total { background: #64748b; }
.oee-bar-loss { background: #f59e0b; }
.oee-bar-good { background: #16a34a; }
.oee-bar-breakdown { background: #dc2626; }
.oee-bar-unexplained { background: #94a3b8; }
.oee-bar-setup { background: #0ea5e9; }

.oee-bar-label { font-size: 12px; margin-bottom: 2px; }
.oee-waterfall-caption { width: 42%; }
.oee-waterfall-bar { width: 38%; }
.oee-waterfall-loss .oee-waterfall-caption { padding-left: 18px; color: var(--bs-secondary-color, #64748b); }

.oee-heat-scroll { overflow-x: auto; }

.oee-heat-table {
    border-collapse: separate;
    border-spacing: 2px;
    font-size: 12px;
}

.oee-heat-table th {
    font-weight: 600;
    padding: 2px 6px;
    white-space: nowrap;
    text-align: left;
}

.oee-heat-cell {
    min-width: 38px;
    height: 26px;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}

.oee-heat-good { background: #bbf7d0; color: #14532d; }
.oee-heat-fair { background: #fde68a; color: #78350f; }
.oee-heat-poor { background: #fecaca; color: #7f1d1d; }
.oee-heat-idle { background: #f1f5f9; }
.oee-heat-none { background: #f8fafc; }

.oee-issue-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
}

/* A machine's day as it went (G4.4): one bar per production day, stretches placed by time. */
.oee-timeline-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 3px 0;
}

.oee-timeline-day { width: 88px; font-size: 12px; white-space: nowrap; }

.oee-timeline-bar {
    position: relative;
    flex: 1;
    height: 18px;
    border-radius: 4px;
    background: var(--ice-surface-well);
    overflow: hidden;
}

.oee-timeline-seg { position: absolute; top: 0; bottom: 0; }
.oee-seg-running { background: #16a34a; }
.oee-seg-setup { background: #0ea5e9; }
.oee-seg-breakdown { background: #dc2626; }
.oee-seg-otherloss { background: #f97316; }
.oee-seg-shortstop { background: #facc15; }
.oee-seg-unexplained { background: #94a3b8; }
.oee-seg-break { background: #cbd5e1; }
.oee-seg-plannedstop { background: #a78bfa; }
.oee-seg-notplanned { background: var(--ice-surface-inset); }

.oee-timeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
    font-size: 12px;
}

.oee-timeline-key { display: inline-flex; align-items: center; gap: 4px; }

.oee-timeline-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid var(--ice-track);
}

[data-ice-theme="dark"] .oee-card {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-ice-theme="dark"] .oee-table th,
[data-ice-theme="dark"] .oee-table td,
[data-ice-theme="dark"] .oee-waterfall-table td {
    border-bottom-color: #334155;
}

[data-ice-theme="dark"] .oee-table th { color: #cbd5e1; }
[data-ice-theme="dark"] .oee-good { color: #4ade80; }
[data-ice-theme="dark"] .oee-fair { color: #fbbf24; }
[data-ice-theme="dark"] .oee-poor { color: #f87171; }
[data-ice-theme="dark"] .oee-heat-idle,
[data-ice-theme="dark"] .oee-heat-none { background: #0f172a; }
[data-ice-theme="dark"] .oee-heat-good { background: #166534; color: #dcfce7; }
[data-ice-theme="dark"] .oee-heat-fair { background: #92400e; color: #fef3c7; }
[data-ice-theme="dark"] .oee-heat-poor { background: #991b1b; color: #fee2e2; }

/* ---- Cockpit tokens and shared primitives -----------------------------------------------------------------------
   The shop floor and maintenance screens draw from one palette: each colour is a token here, and the dark theme
   re-points the tokens instead of repeating every rule under [data-ice-theme="dark"]. A token names a role with its
   light and dark value as a pair - two tokens may share a light value and part in the dark. A colour used once or
   twice stays a literal beside its dark rule. The ice-* classes are the pieces the cockpits share. ---- */
:root {
    --ice-surface: #ffffff;
    --ice-surface-deep: #ffffff;
    --ice-surface-muted: #f8fafc;
    --ice-surface-inset: #f8fafc;
    --ice-surface-sunken: #f1f5f9;
    --ice-surface-well: #f1f5f9;
    --ice-surface-raised: #f1f5f9;
    --ice-surface-hover: #f1f5f9;
    --ice-track: #e2e8f0;
    --ice-chip-bg: #f1f5f9;
    --ice-selected-bg: #eff6ff;

    --ice-border: #e2e8f0;
    --ice-border-firm: #cbd5e1;
    --ice-border-emphasis: #cbd5e1;
    --ice-border-soft: #eef2f7;
    --ice-border-cool: #dbe3ee;
    --ice-border-muted: #94a3b8;
    --ice-border-faint: #94a3b8;
    --ice-focus: #2563eb;
    --ice-focus-soft: #3b82f6;

    --ice-text-strong: #0f172a;
    --ice-text-title: #0f172a;
    --ice-text-max: #0f172a;
    --ice-text: #1e293b;
    --ice-text-bright: #1e293b;
    --ice-text-secondary: #334155;
    --ice-text-soft: #334155;
    --ice-text-label: #475569;
    --ice-text-muted: #64748b;
    --ice-text-quiet: #64748b;
    --ice-text-faint: #94a3b8;
    --ice-link: #1d4ed8;
    --ice-link-hover: #1d4ed8;
    --ice-danger-text: #b91c1c;

    --ice-tone-neutral-bg: #f1f5f9;
    --ice-tone-neutral-fg: #475569;
    --ice-tone-danger-bg: #fee2e2;
    --ice-tone-danger-fg: #991b1b;
    --ice-tone-warning-bg: #fef3c7;
    --ice-tone-warning-fg: #92400e;
    --ice-tone-success-bg: #dcfce7;
    --ice-tone-success-fg: #166534;
    --ice-tone-success-soft-bg: #f0fdf4;
    --ice-tone-success-soft-fg: #15803d;
    --ice-tone-success-soft-border: #bbf7d0;
    --ice-tone-danger-soft-bg: #fef2f2;
    --ice-tone-danger-soft-fg: #991b1b;
    --ice-tone-danger-soft-border: #fecaca;
    --ice-tone-accent-bg: #eef2ff;
    --ice-tone-accent-fg: #4338ca;
    --ice-tone-info-bg: #e0f2fe;
    --ice-tone-info-fg: #075985;

    --ice-signal-good: #16a34a;
    --ice-signal-warn: #d97706;
    --ice-signal-bad: #dc2626;
    --ice-signal-info: #64748b;
}

:root[data-ice-theme="dark"] {
    --ice-surface: #1e293b;
    --ice-surface-deep: #0f172a;
    --ice-surface-muted: #162032;
    --ice-surface-inset: #0f172a;
    --ice-surface-sunken: #334155;
    --ice-surface-well: #0f172a;
    --ice-surface-raised: #1e293b;
    --ice-surface-hover: #243247;
    --ice-track: #334155;
    --ice-chip-bg: #162032;
    --ice-selected-bg: rgba(37, 99, 235, 0.2);

    --ice-border: #334155;
    --ice-border-firm: #334155;
    --ice-border-emphasis: #475569;
    --ice-border-soft: #334155;
    --ice-border-cool: #334155;
    --ice-border-muted: #475569;
    --ice-border-faint: #64748b;
    --ice-focus: #3b82f6;
    --ice-focus-soft: #60a5fa;

    --ice-text-strong: #f1f5f9;
    --ice-text-title: #f8fafc;
    --ice-text-max: #ffffff;
    --ice-text: #e2e8f0;
    --ice-text-bright: #f1f5f9;
    --ice-text-secondary: #cbd5e1;
    --ice-text-soft: #e2e8f0;
    --ice-text-label: #cbd5e1;
    --ice-text-muted: #94a3b8;
    --ice-text-quiet: #cbd5e1;
    --ice-text-faint: #64748b;
    --ice-link: #93c5fd;
    --ice-link-hover: #bfdbfe;
    --ice-danger-text: #fca5a5;

    --ice-tone-neutral-bg: #334155;
    --ice-tone-neutral-fg: #cbd5e1;
    --ice-tone-danger-bg: #7f1d1d;
    --ice-tone-danger-fg: #fecaca;
    --ice-tone-warning-bg: #78350f;
    --ice-tone-warning-fg: #fde68a;
    --ice-tone-success-bg: #14532d;
    --ice-tone-success-fg: #bbf7d0;
    --ice-tone-success-soft-bg: #064e3b;
    --ice-tone-success-soft-fg: #a7f3d0;
    --ice-tone-success-soft-border: #047857;
    --ice-tone-danger-soft-bg: rgba(220, 38, 38, 0.16);
    --ice-tone-danger-soft-fg: #fecaca;
    --ice-tone-danger-soft-border: #b91c1c;
    --ice-tone-accent-bg: #312e81;
    --ice-tone-accent-fg: #e0e7ff;
    --ice-tone-info-bg: #0c4a6e;
    --ice-tone-info-fg: #bae6fd;
}

/* A badge is neutral unless a tone says otherwise (ice-badge-neutral names the default where code picks a tone). */
.ice-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--ice-tone-neutral-bg);
    color: var(--ice-tone-neutral-fg);
}

.ice-badge.ice-badge-danger { background: var(--ice-tone-danger-bg); color: var(--ice-tone-danger-fg); }
.ice-badge.ice-badge-warning { background: var(--ice-tone-warning-bg); color: var(--ice-tone-warning-fg); }
.ice-badge.ice-badge-success { background: var(--ice-tone-success-bg); color: var(--ice-tone-success-fg); }
.ice-badge.ice-badge-accent { background: var(--ice-tone-accent-bg); color: var(--ice-tone-accent-fg); }
.ice-badge.ice-badge-info { background: var(--ice-tone-info-bg); color: var(--ice-tone-info-fg); }
.ice-badge.ice-badge-success-outline {
    background: var(--ice-tone-success-soft-bg);
    color: var(--ice-tone-success-soft-fg);
    border: 1px solid var(--ice-tone-success-soft-border);
}

.ice-code-chip {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    font-family: var(--bs-font-monospace, monospace);
    background: var(--ice-chip-bg);
    color: var(--ice-text-secondary);
    border: 1px solid var(--ice-border);
}

.ice-count-inline {
    display: inline-block;
    min-width: 22px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    background: var(--ice-tone-neutral-bg);
    color: var(--ice-tone-neutral-fg);
}

.ice-count-inline.active { background: var(--ice-tone-accent-bg); color: var(--ice-tone-accent-fg); }

/* A figure over its meter: a technician's load, a compliance, the breakdown hours against the worst equipment. */
.ice-meter-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    min-width: 72px;
}

.ice-progress {
    width: 72px;
    height: 4px;
    background: var(--ice-track);
    border-radius: 999px;
    overflow: hidden;
}

.ice-progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.25s ease;
}

.ice-progress-fill.info { background: var(--ice-signal-info); }
.ice-progress-fill.good { background: var(--ice-signal-good); }
.ice-progress-fill.warn { background: var(--ice-signal-warn); }
.ice-progress-fill.bad { background: var(--ice-signal-bad); }

.ice-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ice-live-dot-danger { background: var(--ice-signal-bad); }
.ice-live-dot-good { background: var(--ice-signal-good); }

/* The quick filters over a grid: the pressed one carries the selection's blue, and each shows its count. */
.ice-filter-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.ice-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 5px 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--ice-border);
    background: var(--ice-surface);
    color: var(--ice-text-label);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ice-pill:hover { border-color: var(--ice-border-emphasis); color: var(--ice-text-strong); }
.ice-pill:focus-visible { outline: 2px solid var(--ice-focus); outline-offset: 1px; }

.ice-pill.active {
    background: var(--ice-selected-bg);
    border-color: var(--ice-focus);
    color: var(--ice-link);
}

.ice-pill-count {
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    background: var(--ice-tone-neutral-bg);
    color: var(--ice-tone-neutral-fg);
}

.ice-pill.active .ice-pill-count { background: var(--ice-focus); color: #ffffff; }

/* An empty list, table or chart (CockpitEmptyState). */
.ice-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 26px 16px;
    font-size: 13px;
    text-align: center;
    color: var(--ice-text-muted);
    background: var(--ice-surface-muted);
    border: 1px dashed var(--ice-border-firm);
    border-radius: 8px;
}

.ice-empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ice-surface-raised);
    color: var(--ice-text-muted);
    font-size: 18px;
    line-height: 1;
}

/* ---- Maintenance cockpit (Bakim-Modul-Plani-V2_1 K16, M69; V2.1 Ek M91): the manager's morning in the MRP and CRP
   cockpits' language - their control bar, header ribbon, KPI cards and tabs (the mrp-* families) - with the period's
   indicators on the ribbon and the board's status columns below. The page scrolls in its view: unlike the MRP cockpit,
   whose tables scroll inside, it has no grid to hold the height. ---- */
.maintenance-cockpit {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px;
}

/* DevExpress editors fill their container: the bar's editors get fixed widths so they share one row. */
.mrp-control-bar-left > .maintenance-cockpit-site { flex: 0 0 260px; width: 260px; }
.mrp-control-bar-left > .maintenance-cockpit-date { flex: 0 0 130px; width: 130px; }
.maintenance-cockpit-toolbar .maintenance-cockpit-craft { flex: 0 0 200px; width: 200px; }

.maintenance-cockpit .mrp-meta-chip {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

.maintenance-cockpit-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ice-text-soft);
}

.maintenance-cockpit-hint,
.maintenance-cockpit-sub {
    font-size: 12px;
    color: var(--ice-text-muted);
}

.maintenance-cockpit-lines { white-space: pre-line; }

.maintenance-cockpit-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--ice-text-soft);
    cursor: pointer;
}

.maintenance-cockpit-checkbox {
    width: 15px;
    height: 15px;
    accent-color: #475569;
    cursor: pointer;
}

/* The period's indicators: one strip under the ribbon's facts, what each measures on hover. */
.maintenance-cockpit-indicators {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    row-gap: 6px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e2e8f0;
}

.maintenance-cockpit-indicator {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 4px 10px;
    border-left: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: help;
    transition: background-color 0.15s ease;
}

.maintenance-cockpit-indicator:first-child { padding-left: 6px; border-left: 0; }
.maintenance-cockpit-indicator:hover { background: #f8fafc; }

/* The after-sales cockpit (Satis-Sonrasi-Faz2-Plani 2.6): an indicator whose requests a click lists. */
.after-sales-cockpit-indicator-link {
    background: transparent;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.after-sales-cockpit-indicator-link:hover .maintenance-cockpit-indicator-value { text-decoration: underline; }

.maintenance-cockpit-indicator-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ice-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.maintenance-cockpit-indicator-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--ice-text-strong);
    font-family: var(--bs-font-monospace, monospace);
    line-height: 1.3;
}

.maintenance-cockpit-indicator-detail {
    font-size: 10.5px;
    color: var(--ice-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Eight cards of what is open now: one row on a desktop screen, two on a tablet. auto-fit, not auto-fill: auto-fill
   kept an empty ninth track and squeezed the cards to 158px. A card is a button, so it takes the page's text rather
   than the browser's button face; its caption may take a second line instead of losing its end. */
.maintenance-cockpit-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.maintenance-cockpit .mrp-kpi-card {
    height: 100%;
    font: inherit;
    color: inherit;
    text-align: left;
}

.maintenance-cockpit .mrp-kpi-label {
    white-space: normal;
    line-height: 1.25;
    color: #64748b;
}

/* A long detail goes under the count rather than losing its end. */
.maintenance-cockpit .mrp-kpi-val-row { flex-wrap: wrap; row-gap: 0; }
.maintenance-cockpit .mrp-kpi-val { white-space: nowrap; color: #0f172a; }
.maintenance-cockpit .mrp-kpi-sub { color: #64748b; }

.maintenance-cockpit .mrp-kpi-card.alert .mrp-kpi-val { color: #b91c1c; }

/* Each card's soft tint, as the MRP cockpit's: a pale fill and the icon in the tint's own colour. */
.maintenance-cockpit-kpi-requests .mrp-kpi-icon-wrapper { background: #eff6ff; color: #2563eb; }
.maintenance-cockpit-kpi-orders .mrp-kpi-icon-wrapper { background: #eef2ff; color: #4f46e5; }
.maintenance-cockpit-kpi-close .mrp-kpi-icon-wrapper { background: #ecfdf5; color: #059669; }
.maintenance-cockpit-kpi-tasks .mrp-kpi-icon-wrapper { background: #f5f3ff; color: #7c3aed; }
.maintenance-cockpit-kpi-due .mrp-kpi-icon-wrapper { background: #fffbeb; color: #d97706; }
.maintenance-cockpit-kpi-stops .mrp-kpi-icon-wrapper { background: #fef2f2; color: #dc2626; }
.maintenance-cockpit-kpi-technicians .mrp-kpi-icon-wrapper { background: #ecfeff; color: #0891b2; }
.maintenance-cockpit-kpi-checks .mrp-kpi-icon-wrapper { background: #f8fafc; color: #475569; }

/* Tab body surface card matching .mrp-panel */
.maintenance-cockpit-panel {
    min-height: 220px;
    background: var(--ice-surface);
    border: 1px solid var(--ice-track);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.maintenance-cockpit-tab-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.maintenance-cockpit-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: var(--ice-surface-muted);
    border: 1px solid var(--ice-track);
    border-radius: 6px;
}

.maintenance-cockpit-toolbar-left,
.maintenance-cockpit-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.maintenance-cockpit-toolbar-right {
    margin-left: auto;
}

.maintenance-cockpit-selection-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.maintenance-cockpit-selection-pill.has-selection {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.maintenance-cockpit-column-empty {
    color: var(--ice-border-faint);
    font-size: 13px;
    padding: 16px 8px;
    text-align: center;
    border: 1px dashed var(--ice-track);
    border-radius: 6px;
}

.maintenance-cockpit-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--ice-track);
    border-radius: 6px;
}

.maintenance-cockpit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.maintenance-cockpit-table th,
.maintenance-cockpit-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
    color: #1e293b;
}

.maintenance-cockpit-table tbody tr:last-child td {
    border-bottom: 0;
}

.maintenance-cockpit-table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid #e2e8f0;
}

.maintenance-cockpit-table tbody tr:hover td {
    background: #f8fafc;
}

.maintenance-cockpit-table th.maintenance-cockpit-num,
.maintenance-cockpit-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.maintenance-cockpit-nowrap { white-space: nowrap; }
.maintenance-cockpit-text { max-width: 360px; white-space: pre-line; }
.maintenance-cockpit-row-overdue td { background: rgba(239, 68, 68, .05); }
.maintenance-cockpit-row-overdue td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
.maintenance-cockpit-row-selected td { background: rgba(59, 130, 246, .06); }
.maintenance-cockpit-missing { color: var(--ice-text-muted); font-style: italic; }

.maintenance-cockpit-cell-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.maintenance-cockpit-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    justify-content: flex-end;
}

.maintenance-cockpit-actions .dxbl-btn { white-space: nowrap; }

.maintenance-cockpit-link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: #2563eb;
    text-decoration: underline dotted;
    white-space: nowrap;
    cursor: pointer;
}

.maintenance-cockpit-link:hover {
    color: #1d4ed8;
    text-decoration: underline solid;
}

.maintenance-cockpit-line-active {
    font-weight: 700;
}

.maintenance-cockpit-running-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    background: #f0fdf4;
    color: var(--ice-tone-success-fg);
    border: 1px solid #bbf7d0;
    cursor: pointer;
}

.maintenance-cockpit-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 10px;
    overflow-x: auto;
}

.maintenance-cockpit-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 180px;
    padding: 10px;
    background: var(--ice-surface-muted);
    border: 1px solid #e2e8f0;
    border-top: 3px solid #64748b;
    border-radius: 8px;
}

.maintenance-cockpit-column-released { border-top-color: #6366f1; }
.maintenance-cockpit-column-inprogress { border-top-color: #16a34a; }
.maintenance-cockpit-column-completed { border-top-color: #0ea5e9; }

.maintenance-cockpit-column-focused {
    border-color: #94a3b8;
    border-top-color: #0ea5e9;
    box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.25);
}

.maintenance-cockpit-column-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--ice-track);
    font-size: 13px;
    font-weight: 600;
    color: var(--ice-text);
}

.maintenance-cockpit-column-title { flex: 1; }

.maintenance-cockpit-count {
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--ice-track);
    color: var(--ice-text-secondary);
}

.maintenance-cockpit-order {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    font-size: 13px;
    background: var(--ice-surface);
    color: var(--ice-text-bright);
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    transition: box-shadow 0.12s ease, border-color 0.12s ease;
}

.maintenance-cockpit-order:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.06);
}

.maintenance-cockpit-order.maintenance-cockpit-order-urgent { border-left: 3px solid #ef4444; }
.maintenance-cockpit-order.maintenance-cockpit-order-high { border-left: 3px solid #f59e0b; }

.maintenance-cockpit-order.selected {
    border-color: #6366f1;
    box-shadow: inset 0 0 0 1px #6366f1;
}

.maintenance-cockpit-order-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.maintenance-cockpit-order-head .ice-badge {
    margin-left: auto;
}

.maintenance-cockpit-order-equipment {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-weight: 500;
}

.maintenance-cockpit-order-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
    font-size: 11.5px;
    color: var(--ice-text-muted);
}

.maintenance-cockpit-meta-item + .maintenance-cockpit-meta-item::before {
    content: "·";
    margin-right: 6px;
    color: var(--ice-border-emphasis);
}

.maintenance-cockpit-dialog {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    color: var(--ice-text);
}

.maintenance-cockpit-dialog-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: var(--ice-surface-muted);
    border: 1px solid var(--ice-track);
    border-radius: 6px;
}

.maintenance-cockpit-dialog-subject,
.maintenance-cockpit-dialog-text { margin: 0; }
.maintenance-cockpit-dialog-text { white-space: pre-line; }
.maintenance-cockpit-field { font-size: 13px; font-weight: 600; margin-top: 4px; color: var(--ice-text); }

/* ── Dark Mode ([data-ice-theme="dark"]) for Maintenance Cockpit ── */
[data-ice-theme="dark"] .maintenance-cockpit .mrp-cockpit-control-bar,
[data-ice-theme="dark"] .maintenance-cockpit .mrp-header-ribbon,
[data-ice-theme="dark"] .maintenance-cockpit .mrp-kpi-card,
[data-ice-theme="dark"] .maintenance-cockpit-panel {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-ice-theme="dark"] .maintenance-cockpit .mrp-kpi-card:hover {
    background: #243247;
    border-color: #475569;
}

[data-ice-theme="dark"] .maintenance-cockpit .mrp-kpi-card.active {
    background: rgba(59, 130, 246, 0.14);
    border-color: #60a5fa;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.3);
}

[data-ice-theme="dark"] .maintenance-cockpit .mrp-tabs-container {
    border-bottom-color: #334155;
}

[data-ice-theme="dark"] .maintenance-cockpit .mrp-meta-chip {
    background: #162032;
    border-color: #334155;
    color: #cbd5e1;
}

[data-ice-theme="dark"] .maintenance-cockpit .mrp-kpi-val {
    color: #f1f5f9;
}

[data-ice-theme="dark"] .maintenance-cockpit .mrp-kpi-label,
[data-ice-theme="dark"] .maintenance-cockpit .mrp-kpi-sub,
[data-ice-theme="dark"] .maintenance-cockpit-indicator-label,
[data-ice-theme="dark"] .maintenance-cockpit-indicator-detail,
[data-ice-theme="dark"] .maintenance-cockpit-hint,
[data-ice-theme="dark"] .maintenance-cockpit-sub,
[data-ice-theme="dark"] .maintenance-cockpit-missing,
[data-ice-theme="dark"] .maintenance-cockpit-order-meta {
    color: #94a3b8;
}

[data-ice-theme="dark"] .maintenance-cockpit-label,
[data-ice-theme="dark"] .maintenance-cockpit-check,
[data-ice-theme="dark"] .maintenance-cockpit-column-header,
[data-ice-theme="dark"] .maintenance-cockpit-table td,
[data-ice-theme="dark"] .maintenance-cockpit-dialog,
[data-ice-theme="dark"] .maintenance-cockpit-field {
    color: #e2e8f0;
}

[data-ice-theme="dark"] .maintenance-cockpit-toolbar,
[data-ice-theme="dark"] .maintenance-cockpit-dialog-card {
    color: #cbd5e1;
}

[data-ice-theme="dark"] .maintenance-cockpit-selection-pill {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

[data-ice-theme="dark"] .maintenance-cockpit-selection-pill.has-selection {
    background: rgba(59, 130, 246, 0.2);
    border-color: #60a5fa;
    color: #bfdbfe;
}

[data-ice-theme="dark"] .maintenance-cockpit-order {
    border-color: #334155;
}

[data-ice-theme="dark"] .maintenance-cockpit-order:hover {
    border-color: #475569;
}

[data-ice-theme="dark"] .maintenance-cockpit-order.maintenance-cockpit-order-urgent { border-left: 3px solid #f87171; }
[data-ice-theme="dark"] .maintenance-cockpit-order.maintenance-cockpit-order-high { border-left: 3px solid #fbbf24; }
[data-ice-theme="dark"] .maintenance-cockpit-order.selected {
    border-color: #818cf8;
    box-shadow: inset 0 0 0 1px #818cf8;
}
[data-ice-theme="dark"] .maintenance-cockpit-order-meta { border-top-color: #26354d; }

/* The dark theme leaves --bs-border-color light: the indicator strip names its own. */
[data-ice-theme="dark"] .maintenance-cockpit-indicators,
[data-ice-theme="dark"] .maintenance-cockpit-indicator { border-color: #334155; }
[data-ice-theme="dark"] .maintenance-cockpit-indicator:hover { background: #243247; }
[data-ice-theme="dark"] .maintenance-cockpit .mrp-kpi-card.alert .mrp-kpi-val { color: #f87171; }

[data-ice-theme="dark"] .maintenance-cockpit-kpi-requests .mrp-kpi-icon-wrapper { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
[data-ice-theme="dark"] .maintenance-cockpit-kpi-orders .mrp-kpi-icon-wrapper { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
[data-ice-theme="dark"] .maintenance-cockpit-kpi-close .mrp-kpi-icon-wrapper { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
[data-ice-theme="dark"] .maintenance-cockpit-kpi-tasks .mrp-kpi-icon-wrapper { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }
[data-ice-theme="dark"] .maintenance-cockpit-kpi-due .mrp-kpi-icon-wrapper { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
[data-ice-theme="dark"] .maintenance-cockpit-kpi-stops .mrp-kpi-icon-wrapper { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
[data-ice-theme="dark"] .maintenance-cockpit-kpi-technicians .mrp-kpi-icon-wrapper { background: rgba(6, 182, 212, 0.15); color: #67e8f9; }
[data-ice-theme="dark"] .maintenance-cockpit-kpi-checks .mrp-kpi-icon-wrapper { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }

[data-ice-theme="dark"] .maintenance-cockpit-column {
    border-color: #334155;
}

[data-ice-theme="dark"] .maintenance-cockpit-column-planned { border-top-color: #94a3b8; }
[data-ice-theme="dark"] .maintenance-cockpit-column-released { border-top-color: #818cf8; }
[data-ice-theme="dark"] .maintenance-cockpit-column-inprogress { border-top-color: #4ade80; }
[data-ice-theme="dark"] .maintenance-cockpit-column-completed { border-top-color: #38bdf8; }
[data-ice-theme="dark"] .maintenance-cockpit-column-focused {
    border-color: #475569;
    border-top-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3);
}

[data-ice-theme="dark"] .maintenance-cockpit-table thead th {
    background: #162032;
    color: #cbd5e1;
    border-bottom-color: #334155;
}
[data-ice-theme="dark"] .maintenance-cockpit-table th,
[data-ice-theme="dark"] .maintenance-cockpit-table td { border-bottom-color: #26354d; }
[data-ice-theme="dark"] .maintenance-cockpit-table tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }
[data-ice-theme="dark"] .maintenance-cockpit-row-overdue td { background: rgba(248, 113, 113, .10); }
[data-ice-theme="dark"] .maintenance-cockpit-row-selected td { background: rgba(129, 140, 248, .12); }
[data-ice-theme="dark"] .maintenance-cockpit-link { color: #93c5fd; }
[data-ice-theme="dark"] .maintenance-cockpit-link:hover { color: #bfdbfe; }

[data-ice-theme="dark"] .maintenance-cockpit-running-pill { background: #14532d; border-color: #166534; }

/* ---- Maintenance analysis cockpit (Bakim-Modul-Plani-V2_1-Ek M92, M93): the maintenance cockpit's MRP family - control
   bar, header ribbon, KPI cards, tabs - over chart cards and the analysis grid. The KPI cards inform and open nothing; the
   charts open the orders behind a bar, a point or a slice. ---- */
.maintenance-analysis {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px;
}

/* DevExpress editors fill their container: the bar's editors get fixed widths so they share one row. */
.mrp-control-bar-left > .maintenance-analysis-site { flex: 0 0 220px; width: 220px; }
.mrp-control-bar-left > .maintenance-analysis-class { flex: 0 0 160px; width: 160px; }
.mrp-control-bar-left > .maintenance-analysis-equipment { flex: 0 0 180px; width: 180px; }
.mrp-control-bar-left > .maintenance-analysis-date { flex: 0 0 130px; width: 130px; }
.mrp-control-bar-left > .maintenance-analysis-grouping { flex: 0 0 100px; width: 100px; }

.maintenance-analysis .mrp-meta-chip {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #334155;
}

.maintenance-analysis-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
}

.maintenance-analysis .mrp-kpi-card {
    height: 100%;
    cursor: help;
}

.maintenance-analysis .mrp-kpi-card:hover {
    transform: none;
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05);
}

.maintenance-analysis .mrp-kpi-label {
    white-space: normal;
    line-height: 1.25;
}

.maintenance-analysis .mrp-kpi-val-row { flex-wrap: wrap; row-gap: 0; }
.maintenance-analysis .mrp-kpi-val { white-space: nowrap; }

.maintenance-analysis-kpi-mttr .mrp-kpi-icon-wrapper { background: #fef2f2; color: #dc2626; }
.maintenance-analysis-kpi-mtbf .mrp-kpi-icon-wrapper { background: #ecfdf5; color: #059669; }
.maintenance-analysis-kpi-compliance .mrp-kpi-icon-wrapper { background: #fffbeb; color: #d97706; }
.maintenance-analysis-kpi-corrective .mrp-kpi-icon-wrapper { background: #f5f3ff; color: #7c3aed; }
.maintenance-analysis-kpi-checks .mrp-kpi-icon-wrapper { background: #ecfeff; color: #0891b2; }
.maintenance-analysis-kpi-cost .mrp-kpi-icon-wrapper { background: #eef2ff; color: #4f46e5; }

.maintenance-analysis-hint-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--ice-surface-muted);
    border: 1px solid var(--ice-track);
    border-radius: 6px;
}

.maintenance-analysis-hint-icon {
    font-size: 13px;
    color: var(--ice-text-muted);
    flex-shrink: 0;
}

.maintenance-analysis-hint {
    margin: 0;
    font-size: 12px;
    color: var(--ice-text-muted);
}

.maintenance-analysis-chart .ice-empty-state {
    min-height: 220px;
}

/* Two charts a row on a desktop screen, one on a tablet. */
.maintenance-analysis-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
    gap: 10px;
}

.maintenance-analysis-chart {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 10px 14px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.maintenance-analysis-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--ice-surface-sunken);
}

/* Chart titles in normal case, as the user asked for the cockpits' headers (M93). */
.maintenance-analysis-chart-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ice-text-strong);
}

.maintenance-analysis-chart-meta {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    background: var(--ice-surface-sunken);
    color: var(--ice-text-label);
    white-space: nowrap;
}

/* A Pareto bar's tooltip: the code with its name, which the bar's label leaves out (tour, 19.10.2026). */
.maintenance-analysis-tooltip {
    padding: 2px 4px;
    font-size: 12px;
}

.maintenance-analysis-tooltip-title {
    font-weight: 600;
}

.maintenance-analysis-panel {
    background: var(--ice-surface);
    border: 1px solid var(--ice-track);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.maintenance-analysis-table {
    display: flex;
    flex-direction: column;
}

.maintenance-analysis-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: var(--ice-surface-muted);
    border-bottom: 1px solid var(--ice-track);
}

.maintenance-analysis-toolbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.maintenance-analysis-equip-name {
    font-weight: 500;
    color: var(--ice-text);
}

.maintenance-analysis-drill-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 8px;
    border-radius: 999px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    background: #fef2f2;
    color: var(--ice-danger-text);
    border: 1px solid #fecaca;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.maintenance-analysis-drill-pill:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.maintenance-analysis-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ice-text);
}

.maintenance-analysis-zero {
    color: var(--ice-border-faint);
}

.maintenance-analysis-grid {
    border: 0;
    font-size: 13px;
}

.maintenance-analysis-grid .dxbl-grid-header-row {
    background: var(--ice-surface-muted);
    color: #475569;
    font-weight: 600;
}

.maintenance-analysis-grid .dxbl-grid-footer-row {
    background: var(--ice-surface-muted);
    font-weight: 700;
    color: #0f172a;
    border-top: 1px solid #cbd5e1;
}

.maintenance-analysis-row-breakdown td:first-child {
    box-shadow: inset 3px 0 0 #f59e0b;
}

/* The chart texts follow the theme as the dashboard's do: DevExtreme writes the colour of each text into its inline
   style when it draws, and only an !important rule wins over that after a theme switch (YI-023). */
.maintenance-analysis .dxc-labels-group .dxc-labels rect {
    fill-opacity: 0;
}

.maintenance-analysis .dxc-labels-group text {
    fill: #334155 !important;
    font-weight: 600 !important;
}

.maintenance-analysis .dxc-arg-elements text,
.maintenance-analysis .dxc-val-elements text,
.maintenance-analysis .dxc-legend text,
.maintenance-analysis .dxc-val-title text {
    fill: #64748b !important;
}

.maintenance-analysis .dxc-val-grid path {
    stroke: #e2e8f0;
}

.maintenance-analysis .dxc-arg-line path,
.maintenance-analysis .dxc-val-line path {
    stroke: #cbd5e1;
}

/* Each bar, point and slice opens the orders behind it. */
.maintenance-analysis .maintenance-analysis-drill-chart .dxc-series .dxc-markers path,
.maintenance-analysis .maintenance-analysis-drill-chart .dxc-series .dxc-markers rect {
    cursor: pointer;
}

.maintenance-analysis .maintenance-analysis-donut .dxc-series .dxc-markers path {
    stroke: #ffffff;
    stroke-width: 2px;
}

/* ── Dark Mode ([data-ice-theme="dark"]) for Maintenance Analysis Cockpit ── */
[data-ice-theme="dark"] .maintenance-analysis .mrp-cockpit-control-bar,
[data-ice-theme="dark"] .maintenance-analysis .mrp-header-ribbon,
[data-ice-theme="dark"] .maintenance-analysis .mrp-kpi-card,
[data-ice-theme="dark"] .maintenance-analysis-panel {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-ice-theme="dark"] .maintenance-analysis .mrp-kpi-card:hover {
    background: #243247;
    border-color: #475569;
}

[data-ice-theme="dark"] .maintenance-analysis .mrp-tabs-container {
    background: #162032;
    border-color: #334155;
}

[data-ice-theme="dark"] .maintenance-analysis .mrp-tab-btn {
    color: #94a3b8;
}

[data-ice-theme="dark"] .maintenance-analysis .mrp-tab-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.04);
}

[data-ice-theme="dark"] .maintenance-analysis .mrp-tab-btn.active {
    background: #1e293b;
    color: #60a5fa;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

[data-ice-theme="dark"] .maintenance-analysis .mrp-meta-chip {
    background: #162032;
    border-color: #334155;
    color: #cbd5e1;
}

[data-ice-theme="dark"] .maintenance-analysis .mrp-meta-chip strong,
[data-ice-theme="dark"] .maintenance-analysis .mrp-ribbon-title,
[data-ice-theme="dark"] .maintenance-analysis .mrp-kpi-val {
    color: #f1f5f9;
}

[data-ice-theme="dark"] .maintenance-analysis .mrp-kpi-label,
[data-ice-theme="dark"] .maintenance-analysis .mrp-kpi-sub,
[data-ice-theme="dark"] .maintenance-analysis .mrp-meta-chip i {
    color: #94a3b8;
}

[data-ice-theme="dark"] .maintenance-analysis-kpi-mttr .mrp-kpi-icon-wrapper { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
[data-ice-theme="dark"] .maintenance-analysis-kpi-mtbf .mrp-kpi-icon-wrapper { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
[data-ice-theme="dark"] .maintenance-analysis-kpi-compliance .mrp-kpi-icon-wrapper { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
[data-ice-theme="dark"] .maintenance-analysis-kpi-corrective .mrp-kpi-icon-wrapper { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }
[data-ice-theme="dark"] .maintenance-analysis-kpi-checks .mrp-kpi-icon-wrapper { background: rgba(6, 182, 212, 0.15); color: #67e8f9; }
[data-ice-theme="dark"] .maintenance-analysis-kpi-cost .mrp-kpi-icon-wrapper { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }

/* The dark theme leaves --bs-border-color and the card colour light: the chart cards name their own. */
[data-ice-theme="dark"] .maintenance-analysis-chart {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

[data-ice-theme="dark"] .maintenance-analysis-drill-pill {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(248, 113, 113, 0.35);
}

[data-ice-theme="dark"] .maintenance-analysis-drill-pill:hover {
    background: rgba(239, 68, 68, 0.28);
    border-color: #f87171;
}

[data-ice-theme="dark"] .maintenance-analysis-grid .dxbl-grid-header-row,
[data-ice-theme="dark"] .maintenance-analysis-grid .dxbl-grid-footer-row {
    color: #e2e8f0;
    border-color: #334155;
}

[data-ice-theme="dark"] .maintenance-analysis .dxc-labels-group text {
    fill: #e2e8f0 !important;
}

[data-ice-theme="dark"] .maintenance-analysis .dxc-arg-elements text,
[data-ice-theme="dark"] .maintenance-analysis .dxc-val-elements text,
[data-ice-theme="dark"] .maintenance-analysis .dxc-legend text,
[data-ice-theme="dark"] .maintenance-analysis .dxc-val-title text {
    fill: #94a3b8 !important;
}

[data-ice-theme="dark"] .maintenance-analysis .dxc-val-grid path {
    stroke: #334155;
}

[data-ice-theme="dark"] .maintenance-analysis .dxc-arg-line path,
[data-ice-theme="dark"] .maintenance-analysis .dxc-val-line path {
    stroke: #475569;
}

[data-ice-theme="dark"] .maintenance-analysis .maintenance-analysis-donut .dxc-series .dxc-markers path {
    stroke: #1e293b;
}
/* T-19: a day a planned stop took capacity from - the matrix cell, the Gantt day row and the Gantt band over the
   stop's hours. Last in the file on purpose: the load colours set the background shorthand with !important, which
   would clear the hatch. */
.crp-cell-stopped,
.crp-gantt-stopband,
.crp-gantt-stopband-swatch {
    background-image: repeating-linear-gradient(135deg, rgba(100, 116, 139, 0.30) 0 4px, transparent 4px 8px) !important;
}

.crp-cell-stopped {
    color: #475569;
}

/* A day the loaded CRP run did not calculate (outside its horizon): hatched the other way
   and paler than a planned stop, so the two never read alike. */
.crp-cell-not-calculated {
    background-color: #f8fafc !important;
    background-image: repeating-linear-gradient(45deg, rgba(148, 163, 184, 0.22) 0 3px, transparent 3px 7px) !important;
    color: #94a3b8 !important;
    cursor: default;
}

.crp-colhead-not-calculated {
    color: #94a3b8;
    font-style: italic;
}

[data-ice-theme="dark"] .crp-cell-not-calculated {
    background-color: #2a2a2a !important;
    background-image: repeating-linear-gradient(45deg, rgba(148, 163, 184, 0.18) 0 3px, transparent 3px 7px) !important;
    color: #64748b !important;
}

[data-ice-theme="dark"] .crp-colhead-not-calculated {
    color: #64748b;
}

.crp-gantt-stopband,
.crp-gantt-stopband-swatch {
    background-color: rgba(100, 116, 139, 0.12);
}

.crp-gantt-stopband {
    position: absolute;
    bottom: 2px;
    border-left: 1px solid rgba(100, 116, 139, 0.55);
    border-right: 1px solid rgba(100, 116, 139, 0.55);
    border-radius: 3px;
}

[data-ice-theme="dark"] .crp-cell-stopped,
[data-ice-theme="dark"] .crp-gantt-stopband,
[data-ice-theme="dark"] .crp-gantt-stopband-swatch {
    background-image: repeating-linear-gradient(135deg, rgba(203, 213, 225, 0.22) 0 4px, transparent 4px 8px) !important;
}

[data-ice-theme="dark"] .crp-cell-stopped {
    color: #cbd5e1;
}

[data-ice-theme="dark"] .crp-gantt-stopband,
[data-ice-theme="dark"] .crp-gantt-stopband-swatch {
    background-color: rgba(203, 213, 225, 0.08);
}

/* ---- Quality dashboard (E-5 F1) ---- */
.qd-dashboard {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 8px;
}

.qd-area h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px 0;
}

.qd-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
}

.qd-card {
    background: var(--bs-body-bg, #ffffff);
    border: 1px solid #e2e8f0;
    border-top: 4px solid #6366f1;
    border-radius: 8px;
    padding: 10px 12px;
}

.qd-card-attention { border-top-color: #dc2626; }
.qd-card-clickable { cursor: pointer; }
.qd-card-clickable:hover { box-shadow: 0 2px 8px rgba(15, 23, 42, .12); }

.qd-card-caption {
    font-size: 12px;
    color: var(--bs-secondary-color, #64748b);
}

.qd-card-value {
    font-size: 26px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.qd-card-attention .qd-card-value { color: #b91c1c; }

.qd-card-parts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 12px;
    color: var(--bs-secondary-color, #64748b);
}

.qd-card-error {
    font-size: 12px;
    color: #b91c1c;
}

[data-ice-theme="dark"] .qd-card {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-ice-theme="dark"] .qd-card-attention { border-top-color: #f87171; }
[data-ice-theme="dark"] .qd-card-attention .qd-card-value { color: #f87171; }

.qd-charts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 10px;
}

.qd-chart {
    background: var(--bs-body-bg, #ffffff);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 0;
}

[data-ice-theme="dark"] .qd-chart {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.qd-tooltip { padding: 4px 8px; font-size: 12px; }

.qac-coverage { display: flex; flex-direction: column; gap: 8px; }
.qac-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qac-note { font-size: 12px; color: var(--bs-secondary-color, #64748b); }
.qac-scroll { overflow-x: auto; }
.qac-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.qac-table th, .qac-table td { border: 1px solid #e2e8f0; padding: 4px 6px; text-align: center; vertical-align: top; min-width: 52px; }
.qac-table th.qac-audited { text-align: left; min-width: 180px; white-space: nowrap; }
.qac-table td { white-space: normal; }
.qac-chip { display: inline-block; margin: 1px; padding: 1px 6px; border-radius: 10px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.qac-planned { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.qac-created { background: #dbeafe; color: #1d4ed8; }
.qac-completed { background: #dcfce7; color: #15803d; }
.qac-overdue { background: #fee2e2; color: #b91c1c; }
[data-ice-theme="dark"] .qac-table th, [data-ice-theme="dark"] .qac-table td { border-color: #334155; }

/* Quality dashboard areas side by side, each as wide as its cards (27.10.2026). */
.qd-areas { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 28px; }
.qd-areas > .qd-area { flex: 0 1 auto; max-width: 100%; }
.qd-areas .qd-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.qd-areas .qd-card { width: 200px; }

/* PLM viewer, restricted pages (docs/PLM-PDM-Plani.md P1.7): server-rendered page images under a small zoom bar. */
.ice-plm-pages { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ice-plm-pages-toolbar { display: flex; align-items: center; gap: 8px; }
.ice-plm-pages-zoom { min-width: 48px; text-align: center; }
.ice-plm-pages-notice { color: var(--bs-secondary-color, #6c757d); }
.ice-plm-pages-scroll { max-height: 70vh; overflow: auto; background: var(--bs-tertiary-bg, #f1f3f5); padding: 12px; text-align: center; }
.ice-plm-page { display: block; margin: 0 auto 12px auto; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); user-select: none; }
/* PLM 3D and DXF viewer (docs/PLM-PDM-Plani.md P2.2-P2.5) */
.ice-plm-model { display: flex; gap: 8px; width: 100%; min-height: 70vh; }
.ice-plm-model-host { flex: 1 1 auto; min-width: 0; display: flex; }
.plm3d { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 4px; }
.plm3d-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 6px; border-bottom: 1px solid var(--bs-border-color, #dee2e6); background: var(--bs-tertiary-bg, #f8f9fa); }
.plm3d-btn { font-size: 0.8rem; padding: 2px 8px; border: 1px solid var(--bs-border-color, #ced4da); border-radius: 3px; background: var(--bs-body-bg, #fff); color: var(--bs-body-color, #212529); cursor: pointer; }
.plm3d-btn:hover, .plm3d-btn.active { background: var(--bs-primary, #5f368d); color: #fff; }
.plm3d-sep { width: 1px; align-self: stretch; background: var(--bs-border-color, #dee2e6); margin: 0 4px; }
.plm3d-range { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; margin: 0 4px; }
.plm3d-range input[type=range] { width: 110px; }
/* A fixed height: a 540-part tree stretched the canvas to 12,000 px and the model was drawn out of sight (P2 UAT-007). */
.plm3d-body { display: flex; flex: 1 1 auto; height: 60vh; min-height: 360px; }
.plm3d-tree { width: 260px; flex: 0 0 260px; overflow: auto; border-right: 1px solid var(--bs-border-color, #dee2e6); font-size: 0.8rem; background: var(--bs-body-bg, #fff); }
.plm3d-tree-title { font-weight: 600; padding: 6px; border-bottom: 1px solid var(--bs-border-color, #dee2e6); }
.plm3d-tree-list, .plm3d-tree-list ul { list-style: none; margin: 0; padding: 0; }
.plm3d-tree-row { display: flex; align-items: center; gap: 4px; padding: 2px 4px; cursor: pointer; white-space: nowrap; }
.plm3d-tree-row:hover { background: var(--bs-tertiary-bg, #f1f3f5); }
.plm3d-tree-row.selected { background: rgba(30, 136, 229, 0.18); }
.plm3d-tree-name { overflow: hidden; text-overflow: ellipsis; }
.plm3d-unmapped { margin-left: auto; font-size: 0.7rem; color: #b26a00; border: 1px solid #f0b75a; border-radius: 3px; padding: 0 4px; }
.plm3d-stage { position: relative; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.plm3d-stage canvas { display: block; }
.plm3d-status { position: absolute; left: 8px; top: 8px; padding: 4px 8px; border-radius: 3px; background: rgba(255, 255, 255, 0.9); color: #212529; font-size: 0.85rem; }
.plm3d-measure { position: absolute; left: 8px; bottom: 8px; padding: 2px 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.85); color: #b71c1c; font-size: 0.85rem; }
.plm3d-measure:empty, .plm3d-status:empty { display: none; }
.plmdxf-canvas { position: absolute; inset: 0; }
.plmdxf-watermark { position: absolute; inset: 0; pointer-events: none; background-repeat: repeat; }
.plmdxf-swatch { width: 10px; height: 10px; border: 1px solid #888; display: inline-block; }
/* NC program viewer (P3.3): the program as text beside its approximate backplot */
.plmnc-text { width: 42%; flex: 0 0 42%; display: flex; flex-direction: column; border-right: 1px solid var(--bs-border-color, #dee2e6); min-width: 0; }
.plmnc-code { flex: 1 1 auto; margin: 0; overflow: auto; font-family: Consolas, "Courier New", monospace; font-size: 0.8rem; line-height: 1.35; user-select: none; background: var(--bs-body-bg, #fff); }
.plmnc-line { white-space: pre; padding: 0 8px; cursor: pointer; }
.plmnc-line:hover { background: rgba(21, 101, 192, 0.08); }
.plmnc-line.selected { background: rgba(211, 47, 47, 0.15); }
.plmnc-no { display: inline-block; width: 4.5em; color: #9e9e9e; text-align: right; margin-right: 10px; }
.plmnc-g { color: #1565c0; font-weight: 600; }
.plmnc-m { color: #ad1457; font-weight: 600; }
.plmnc-axis { color: #2e7d32; }
.plmnc-word { color: #6d4c41; }
.plmnc-comment { color: #757575; font-style: italic; }
.plmnc-hint { position: absolute; left: 8px; top: 8px; padding: 4px 8px; border-radius: 3px; background: rgba(255, 255, 255, 0.9); color: #5d4037; font-size: 0.8rem; max-width: 90%; }
[data-ice-theme="dark"] .plmnc-g { color: #64b5f6; }
[data-ice-theme="dark"] .plmnc-m { color: #f48fb1; }
[data-ice-theme="dark"] .plmnc-axis { color: #81c784; }
[data-ice-theme="dark"] .plmnc-word { color: #bcaaa4; }
[data-ice-theme="dark"] .plmnc-comment { color: #9e9e9e; }
/* Redline (P4.4): the pages under a drawing layer */
.plmredline { display: flex; flex-direction: column; gap: 8px; }
.plmredline-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 2; padding: 6px 0; background: var(--bs-body-bg, #fff); }
.plmredline-tool.active { background: var(--bs-primary, #0d6efd); color: #fff; border-color: var(--bs-primary, #0d6efd); }
.plmredline-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; }
.plmredline-color.active { border-color: var(--bs-body-color, #212529); }
.plmredline-hint { color: #6c757d; font-size: 0.8rem; margin-left: 8px; }
.plmredline-pages { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.plmredline-number { font-size: 0.75rem; color: #6c757d; }
.plmredline-page { position: relative; width: 100%; max-width: 1100px; border: 1px solid var(--bs-border-color, #dee2e6); background: #fff; }
.plmredline-image, .plmredline-canvas { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; }
.plmredline-canvas { cursor: crosshair; touch-action: none; }
.plmredline-page .plmdxf-watermark { position: absolute; inset: 0; pointer-events: none; }
.ice-plm-part-panel { width: 300px; flex: 0 0 300px; font-size: 0.85rem; border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 4px; padding: 8px; overflow: auto; max-height: 75vh; }
.ice-plm-part-panel h6 { font-size: 0.9rem; margin: 8px 0 4px 0; }
.ice-plm-part-panel table { width: 100%; }
.ice-plm-part-panel td { padding: 1px 4px; vertical-align: top; }
.ice-plm-part-panel .ice-plm-unmapped { color: #b26a00; }

/* ---- Quality Cockpit & Shop-Floor Inspection Terminal ---- */
.quality-cockpit {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 6px;
    min-height: calc(100vh - 115px);
}

.quality-cockpit-fullscreen {
    position: fixed;
    inset: 0;
    /* Under DevExpress popups (1050 up): at 1200 the site list and every dialog opened behind the full screen (Sura, 16.11.2026). */
    z-index: 1040;
    background: var(--ice-surface);
    padding: 12px 16px;
    overflow-y: auto;
    height: 100vh;
}

.qc-control-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.qc-control-left,
.qc-control-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.qc-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    line-height: 1;
}

.mrp-control-bar-left > .qc-site-combo,
.qc-control-left > .qc-site-combo,
.qc-site-combo {
    flex: 0 0 250px;
    width: 250px;
    max-width: 260px;
    min-width: 210px;
}

.qc-barcode-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--ice-surface);
    border: 1px solid var(--ice-border-firm);
    border-radius: 8px;
    padding: 3px 6px 3px 10px;
    height: 30px;
    box-sizing: border-box;
    min-width: 240px;
    flex: 1 1 320px;
    max-width: 520px;
}

.qc-barcode-input {
    border: 0;
    outline: none;
    background: transparent;
    color: inherit;
    font-size: 13px;
    width: 100%;
    min-width: 140px;
}

.qc-barcode-clear {
    border: 0;
    background: transparent;
    color: var(--ice-text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
}

.qc-barcode-btn {
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
    border: 0;
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
    font-size: 12.5px;
    border-radius: 6px;
    padding: 4px 12px;
    cursor: pointer;
}

.qc-barcode-btn:hover {
    background: #1d4ed8;
}

.qc-checkbox-label .form-check-input {
    margin: 0;
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

.qc-checkbox-label {
    white-space: nowrap;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    margin: 0 4px;
}

.qc-kpi-grid {
    align-items: stretch;
}

.quality-cockpit .mrp-kpi-card {
    height: 100%;
    min-height: 58px;
    margin: 0;
    padding: 8px 12px;
    font: inherit;
    color: inherit;
    text-align: left;
    align-items: center;
    box-sizing: border-box;
}

.quality-cockpit .mrp-kpi-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
    flex: 1 1 auto;
    gap: 2px;
}

.quality-cockpit .mrp-kpi-label {
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ice-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: left;
}

.quality-cockpit .mrp-kpi-val-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 0;
    width: 100%;
    min-height: 21px;
}

.quality-cockpit .mrp-kpi-val {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    color: var(--ice-text-title);
}

.quality-cockpit .mrp-kpi-sub {
    font-size: 11px;
    line-height: 1.2;
    color: var(--ice-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quality-cockpit .mrp-kpi-card.qc-kpi-alert .mrp-kpi-val {
    color: var(--ice-danger-text);
}

.qc-kpi-iqc .mrp-kpi-icon-wrapper { background: #eff6ff; color: #2563eb; }
.qc-kpi-ipqc .mrp-kpi-icon-wrapper { background: #fffbeb; color: #d97706; }
.qc-kpi-oqc .mrp-kpi-icon-wrapper { background: #ecfdf5; color: #059669; }
.qc-kpi-active .mrp-kpi-icon-wrapper { background: #f5f3ff; color: #7c3aed; }
.qc-kpi-ncr .mrp-kpi-icon-wrapper { background: #fef2f2; color: #dc2626; }
.qc-kpi-quarantine .mrp-kpi-icon-wrapper { background: #fff7ed; color: #ea580c; }
.qc-kpi-done .mrp-kpi-icon-wrapper { background: #f0fdf4; color: #16a34a; }

[data-ice-theme="dark"] .qc-kpi-iqc .mrp-kpi-icon-wrapper { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
[data-ice-theme="dark"] .qc-kpi-ipqc .mrp-kpi-icon-wrapper { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
[data-ice-theme="dark"] .qc-kpi-oqc .mrp-kpi-icon-wrapper { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
[data-ice-theme="dark"] .qc-kpi-active .mrp-kpi-icon-wrapper { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }
[data-ice-theme="dark"] .qc-kpi-ncr .mrp-kpi-icon-wrapper { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
[data-ice-theme="dark"] .qc-kpi-quarantine .mrp-kpi-icon-wrapper { background: rgba(249, 115, 22, 0.15); color: #fdba74; }
[data-ice-theme="dark"] .qc-kpi-done .mrp-kpi-icon-wrapper { background: rgba(34, 197, 94, 0.15); color: #86efac; }

.qc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 8px;
}

.qc-workspace-split {
    display: grid;
    grid-template-columns: minmax(460px, 500px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    flex: 1;
    min-height: 560px;
}

@media (max-width: 1100px) {
    .qc-workspace-split {
        grid-template-columns: 1fr;
    }
}

.qc-queue-pane {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--ice-surface);
    border: 1px solid var(--ice-border);
    border-radius: 10px;
    padding: 10px;
    max-height: calc(100vh - 240px);
    min-height: 520px;
}

.quality-cockpit-fullscreen .qc-queue-pane {
    max-height: calc(100vh - 185px);
}

.qc-queue-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.qc-tab-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--ice-border-firm);
    background: var(--ice-surface-muted);
    color: var(--ice-text-secondary);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.qc-tab-pill.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
}

.qc-tab-count {
    background: rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    padding: 0 6px;
    font-size: 11px;
}

.qc-tab-pill.active .qc-tab-count {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.qc-status-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.qc-status-chip {
    border: 1px solid var(--ice-border);
    background: transparent;
    color: var(--ice-text-label);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
}

.qc-status-chip.active {
    background: var(--ice-selected-bg);
    border-color: var(--ice-focus-soft);
    color: var(--ice-link);
}

.qc-queue-filter-row {
    display: flex;
    align-items: center;
    border: 1px solid var(--ice-border);
    border-radius: 7px;
    padding: 3px 8px;
    background: var(--ice-surface-inset);
}

.qc-queue-filter-input {
    border: 0;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 12.5px;
    color: inherit;
}

.qc-queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 2px;
    flex: 1;
}

.qc-queue-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--ice-border);
    border-left: 4px solid var(--ice-signal-info);
    border-radius: 8px;
    padding: 9px 11px;
    background: var(--ice-surface);
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.qc-queue-card:hover {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    border-color: var(--ice-border-muted);
}

.qc-queue-card.selected {
    border-color: var(--ice-focus);
    border-left-color: var(--ice-focus);
    background: var(--ice-selected-bg);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.14);
}

.qc-queue-card.has-alert {
    border-left-color: var(--ice-signal-bad);
}

.qc-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.qc-card-no {
    font-size: 13.5px;
    color: var(--ice-text-title);
}

.qc-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.qc-stage-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.qc-stage-badge-lg {
    font-size: 12.5px;
    padding: 3px 10px;
}

.qc-stage-iqc {
    background: #dbeafe;
    color: #1e40af;
}

.qc-stage-ipqc {
    background: var(--ice-tone-warning-bg);
    color: var(--ice-tone-warning-fg);
}

.qc-stage-oqc {
    background: var(--ice-tone-success-bg);
    color: var(--ice-tone-success-fg);
}

.qc-card-part {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ice-text-bright);
    overflow-wrap: anywhere;
}

.qc-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 11.5px;
    color: var(--ice-text-muted);
}

.qc-card-desc {
    font-size: 12px;
    color: var(--ice-text-label);
    background: var(--ice-surface-inset);
    border-radius: 5px;
    padding: 4px 7px;
}

.qc-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.qc-progress-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.qc-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--ice-track);
    border-radius: 999px;
    overflow: hidden;
}

.qc-progress-fill {
    height: 100%;
    border-radius: 999px;
}

.qc-progress-fill.success {
    background: var(--ice-signal-good);
}

.qc-progress-fill.danger {
    background: var(--ice-signal-bad);
}

.qc-progress-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--ice-text-muted);
    font-variant-numeric: tabular-nums;
}

.qc-card-indicators {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* Right Detail Pane */
.qc-detail-pane {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--ice-surface);
    border: 1px solid var(--ice-border);
    border-radius: 10px;
    padding: 12px 14px;
    min-height: 520px;
}

.qc-detail-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid var(--ice-border);
    padding-bottom: 10px;
}

.qc-detail-header-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.qc-detail-title-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.qc-detail-no {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.qc-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.qc-detail-meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 12.5px;
    color: #334155;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-border);
    border-radius: 7px;
    padding: 6px 10px;
}

.qc-signal-alert {
    background: var(--ice-tone-danger-soft-bg);
    border: 1px solid var(--ice-tone-danger-soft-border);
    border-left: 4px solid var(--ice-signal-bad);
    color: var(--ice-tone-danger-soft-fg);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12.5px;
}

.qc-documents-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.qc-documents-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--ice-text-label);
}

.qc-doc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.qc-doc-chip:hover {
    background: #dbeafe;
}

.qc-doc-name {
    font-weight: 400;
    color: #334155;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qc-detail-subtabs {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.qc-subtab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--ice-border-firm);
    background: var(--ice-surface-muted);
    color: var(--ice-text-secondary);
    border-radius: 7px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.qc-subtab-btn.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.qc-subtab-btn.has-open-ncr:not(.active) {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #b45309;
}

.qc-subtab-badge {
    background: rgba(15, 23, 42, 0.1);
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 11.5px;
}

.qc-subtab-btn.active .qc-subtab-badge {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.qc-detail-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Line Execution Cards */
.qc-line-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--ice-border-firm);
    border-left: 4px solid var(--ice-focus-soft);
    border-radius: 9px;
    padding: 10px 12px;
    background: var(--ice-surface);
}

.qc-line-card.qc-line-pass {
    border-left-color: var(--ice-signal-good);
}

.qc-line-card.qc-line-fail {
    border-left-color: var(--ice-signal-bad);
    background: #fffafa;
}

.qc-line-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.qc-line-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.qc-line-seq {
    background: var(--ice-chip-bg);
    color: var(--ice-text-label);
    font-weight: 700;
    font-size: 12px;
    padding: 2px 7px;
    border-radius: 5px;
}

.qc-line-char-code {
    font-size: 14px;
    color: var(--ice-text-title);
}

.qc-line-char-name {
    font-size: 13.5px;
    color: var(--ice-text-secondary);
}

.qc-spec-pill {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.qc-line-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qc-sample-pill {
    font-size: 12px;
    font-weight: 600;
    color: var(--ice-text-muted);
}

/* Which quantity checkpoint an in-process inspection is (Atolye-IPQC plan, phase 2). */
.qc-checkpoint-pill {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--ice-tone-accent-bg);
    color: var(--ice-tone-accent-fg);
}

.qc-card-checkpoint {
    margin: 2px 0 4px;
}

/* Who measured the line and when (Atolye-IPQC plan 4.1). */
.qc-inspected-pill {
    font-size: 12px;
    color: var(--ice-text-muted);
}

/* The shop floor terminal measures with the cockpit's panel at touch size (plan 4.4). */
.qc-line-touch .qc-num-input {
    width: 140px;
}

.qc-line-touch .qc-num-input input {
    font-size: 18px;
}

.qc-line-touch .qc-attr-btn {
    padding: 10px 16px;
    font-size: 15px;
}

.badge-ipqc-waiting { background: var(--ice-tone-warning-bg); color: var(--ice-tone-warning-fg); }
.badge-ipqc-active { background: var(--ice-tone-accent-bg); color: var(--ice-tone-accent-fg); }
.badge-ipqc-passed { background: var(--ice-tone-success-bg); color: var(--ice-tone-success-fg); }
.badge-ipqc-hold { background: var(--ice-tone-danger-soft-bg); color: var(--ice-tone-danger-soft-fg); }

.terminal-ipqc {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.terminal-ipqc-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.terminal-ipqc-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.terminal-ipqc-progress {
    color: var(--ice-text-muted);
    font-weight: 600;
}

.terminal-ipqc-operator {
    flex: 1 1 240px;
    min-width: 200px;
}

.terminal-ipqc-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.terminal-ipqc-pending {
    color: var(--ice-text-muted);
    font-size: 12px;
    font-weight: 600;
}

.terminal-ipqc-documents {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--ice-border-firm);
    border-radius: 8px;
    padding: 10px 12px;
}

.terminal-ipqc-ncr-note,
.terminal-ipqc-hold {
    border: 1px solid var(--ice-tone-danger-soft-border);
    background: var(--ice-tone-danger-soft-bg);
    color: var(--ice-tone-danger-soft-fg);
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 600;
}

.terminal-ipqc-hold {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* Completing makes the results final: the window shows what will be recorded before it does. */
.terminal-ipqc-confirm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 600;
}

.terminal-ipqc-confirm.is-pass {
    border: 1px solid var(--ice-tone-success-soft-border);
    background: var(--ice-tone-success-soft-bg);
    color: var(--ice-tone-success-soft-fg);
}

.terminal-ipqc-confirm.is-fail {
    border: 1px solid var(--ice-tone-danger-soft-border);
    background: var(--ice-tone-danger-soft-bg);
    color: var(--ice-tone-danger-soft-fg);
}

.terminal-ipqc-confirm-actions {
    display: flex;
    gap: 8px;
}

.qc-icon-btn {
    border: 1px solid var(--ice-border-firm);
    background: var(--ice-surface-muted);
    border-radius: 6px;
    padding: 2px 7px;
    font-size: 12px;
    cursor: pointer;
}

.qc-line-gauge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    background: var(--ice-surface-inset);
    border-radius: 6px;
    padding: 5px 8px;
}

.qc-gauge-label {
    font-weight: 600;
    color: var(--ice-text-label);
}

.qc-gauge-select {
    border: 1px solid var(--ice-border-firm);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12.5px;
    background: var(--ice-surface-deep);
    color: var(--ice-text-strong);
    min-width: 240px;
}

.qc-gauge-warning {
    color: var(--ice-danger-text);
    font-weight: 600;
    font-size: 12px;
}

.qc-line-alerts {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qc-spc-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
}

.qc-reaction-banner {
    background: var(--ice-tone-danger-soft-bg);
    border: 1px solid var(--ice-tone-danger-soft-border);
    color: var(--ice-tone-danger-soft-fg);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
}

/* A line reopened for correction says so, with who, why and the result it had (IPQC exercises, 01.11.2026). */
.qc-line-correction {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
}

.qc-line-reopen {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px dashed #f59e0b;
    border-radius: 6px;
    background: #fffbeb;
}

.qc-line-reopen-label {
    font-weight: 600;
    font-size: 13px;
}

.qc-line-reopen-input {
    flex: 1 1 260px;
    min-width: 200px;
}

/* Inline Measurements Grid */
.qc-measurements-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.qc-sample-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--ice-border-firm);
    background: var(--ice-surface-inset);
    border-radius: 8px;
    padding: 5px 8px;
}

.qc-sample-box.sample-ok {
    border-color: #22c55e;
    background: var(--ice-tone-success-soft-bg);
}

.qc-sample-box.sample-nok {
    border-color: #ef4444;
    background: var(--ice-tone-danger-soft-bg);
}

.qc-sample-index {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ice-text-muted);
}

.qc-num-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* A DxSpinEdit, the number editor XAF uses: the box is its root, the digits its input. */
.qc-num-input {
    width: 96px;
}

.qc-num-input input {
    font-size: 13.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.qc-num-uom {
    font-size: 11.5px;
    color: var(--ice-text-muted);
}

.qc-attr-toggle {
    display: inline-flex;
    gap: 4px;
}

.qc-attr-btn {
    border: 1px solid var(--ice-border-firm);
    background: var(--ice-surface);
    color: var(--ice-text-label);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.qc-attr-ok.active {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
}

.qc-attr-nok.active {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.qc-add-sample-btn {
    border: 1px dashed var(--ice-border-muted);
    background: transparent;
    color: var(--ice-text-secondary);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.qc-add-sample-btn:hover {
    border-color: var(--ice-focus);
    color: var(--ice-focus);
}

.qc-line-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.qc-line-notes-wrap {
    flex: 1 1 240px;
}

.qc-line-notes-input {
    width: 100%;
    border: 1px solid var(--ice-border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12.5px;
    background: var(--ice-surface-inset);
    color: inherit;
}

.qc-line-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.qc-line-ncrs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
    border-top: 1px dashed var(--ice-border);
}

.qc-ncr-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--ice-tone-danger-soft-border);
    background: var(--ice-tone-danger-soft-bg);
    color: var(--ice-tone-danger-soft-fg);
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 12px;
    cursor: pointer;
}

/* NCR & Disposition Cards */
.qc-quarantine-banner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
    padding: 10px 14px;
}

.qc-quarantine-banner.hold {
    background: var(--ice-tone-danger-soft-bg);
    border: 1px solid var(--ice-tone-danger-soft-border);
    border-left: 4px solid var(--ice-signal-bad);
    color: var(--ice-tone-danger-soft-fg);
}

.qc-quarantine-banner.ready {
    background: var(--ice-tone-success-soft-bg);
    border: 1px solid var(--ice-tone-success-soft-border);
    border-left: 4px solid var(--ice-signal-good);
    color: var(--ice-tone-success-fg);
}

.qc-quarantine-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
}

.qc-ncr-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--ice-border-firm);
    border-left: 4px solid #f59e0b;
    border-radius: 9px;
    padding: 12px 14px;
    background: var(--ice-surface);
}

.qc-ncr-card.focused {
    border-color: var(--ice-focus);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.14);
}

.qc-ncr-card-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.qc-ncr-title-group,
.qc-ncr-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.qc-ncr-no {
    font-size: 14.5px;
    color: var(--ice-text-title);
}

.qc-ncr-line-ref {
    font-size: 12.5px;
    color: var(--ice-text-label);
    font-weight: 600;
}

.qc-capa-chip {
    border: 1px solid #bae6fd;
    background: #f0f9ff;
    color: #0369a1;
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.qc-ncr-description-box {
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-border);
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 13px;
}

.qc-ncr-description-box p {
    margin: 4px 0;
}

.qc-ncr-audit {
    color: var(--ice-text-muted);
    font-size: 11.5px;
}

.qc-ncr-disposition-grid {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

@media (max-width: 960px) {
    .qc-ncr-disposition-grid {
        grid-template-columns: 1fr;
    }
}

.qc-ncr-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qc-ncr-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ice-text-label);
}

.qc-text-input {
    border: 1px solid var(--ice-border-firm);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 13px;
    background: var(--ice-surface-deep);
    color: var(--ice-text-strong);
    width: 100%;
}

.qc-ncr-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.qc-gauge-combo {
    flex: 0 1 320px;
    width: 320px;
    max-width: 380px;
}

.qc-dialog-body {
    padding: 4px 2px;
    gap: 14px;
}

.qc-dialog-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #2563eb;
    border-radius: 8px;
}

.qc-dialog-banner.qc-dialog-banner-danger {
    background: #fef2f2;
    border-color: #fecaca;
    border-left-color: #dc2626;
}

.qc-dialog-banner-icon {
    font-size: 18px;
    line-height: 1.2;
    flex-shrink: 0;
}

.qc-dialog-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12.5px;
    color: var(--ice-text-secondary);
    line-height: 1.35;
}

.qc-dialog-banner-text strong {
    font-size: 13px;
    color: var(--ice-text-title);
}

.qc-dialog-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 560px) {
    .qc-dialog-grid-2 {
        grid-template-columns: 1fr;
    }
}

.qc-dialog-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.qc-dialog-field .qc-dialog-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    margin: 0;
}

.qc-req-star {
    color: var(--ice-signal-bad);
    font-weight: 700;
}

.qc-op-preview-card {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 10px 12px;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-border);
    border-radius: 8px;
}

.qc-op-preview-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12.5px;
}

.qc-op-preview-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ice-text-muted);
}

[data-ice-theme="dark"] .qc-dialog-banner {
    background: rgba(37, 99, 235, 0.16);
    border-color: #1d4ed8;
    border-left-color: #60a5fa;
}

[data-ice-theme="dark"] .qc-dialog-banner.qc-dialog-banner-danger {
    background: rgba(220, 38, 38, 0.16);
    border-color: #b91c1c;
    border-left-color: #f87171;
}

[data-ice-theme="dark"] .qc-dialog-field .qc-dialog-label {
    color: #f8fafc;
}

[data-ice-theme="dark"] .qc-op-preview-card {
    color: #f1f5f9;
}

.qc-dialog-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qc-dialog-subject {
    font-weight: 700;
    padding: 6px 10px;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-border);
    border-radius: 6px;
}

.qc-dialog-label {
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: -4px;
}

/* Dark theme: the surfaces, borders and texts above follow their tokens. What stays here has no token pair - the
   panes' text colour, which the light theme inherits, the IQC badge, the blue and amber chips and banners, and a
   failed line, whose light tint would glare on the dark card. */
[data-ice-theme="dark"] .quality-cockpit-fullscreen,
[data-ice-theme="dark"] .qc-queue-pane,
[data-ice-theme="dark"] .qc-detail-pane,
[data-ice-theme="dark"] .qc-queue-card,
[data-ice-theme="dark"] .qc-line-card,
[data-ice-theme="dark"] .qc-ncr-card,
[data-ice-theme="dark"] .qc-barcode-box,
[data-ice-theme="dark"] .qc-detail-meta-strip,
[data-ice-theme="dark"] .qc-line-gauge-row,
[data-ice-theme="dark"] .qc-ncr-description-box,
[data-ice-theme="dark"] .qc-sample-box {
    color: #f1f5f9;
}

[data-ice-theme="dark"] .qc-stage-iqc {
    background: #1e3a8a;
    color: #bfdbfe;
}

[data-ice-theme="dark"] .qc-spec-pill,
[data-ice-theme="dark"] .qc-doc-chip,
[data-ice-theme="dark"] .qc-capa-chip {
    background: rgba(37, 99, 235, 0.16);
    border-color: #1d4ed8;
    color: #93c5fd;
}

[data-ice-theme="dark"] .qc-doc-chip:hover {
    background: rgba(37, 99, 235, 0.28);
}

[data-ice-theme="dark"] .qc-doc-name {
    color: #cbd5e1;
}

[data-ice-theme="dark"] .qc-spc-banner {
    background: rgba(245, 158, 11, 0.15);
    border-color: #b45309;
    color: #fcd34d;
}

[data-ice-theme="dark"] .qc-subtab-btn.has-open-ncr:not(.active) {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

[data-ice-theme="dark"] .qc-line-card.qc-line-fail {
    background: var(--ice-surface);
}

/* XAF modified cells must tint the dark surface instead of mixing primary with white.
   Root + attribute specificity also wins when the XAF stylesheet loads later. */
:root[data-ice-theme="dark"] {
    --bs-primary-transparent-bg: rgb(from var(--bs-primary) r g b / 0.30);
    --fluent-primary-transparent-bg: rgb(from var(--dxds-primary-70) r g b / 0.30);
}

/* Only the cloned list-search layout: keep row-major order and collapse ordinary rows on phones.
   Range rows deliberately keep their lower/upper bounds together. */
.ice-search-popup-layout { min-width: 0; }
.ice-search-popup-layout .dxbl-fl-group { min-width: 0; }
/* The form layout gives every caption the width of the longest one; one long switch caption
   ("IPQC Geçmeden Üretim Bildirimi Yapılamaz") left every editor of the quality parameter search
   67px wide. Cap the caption and let a long one wrap; short captions stay as they are. */
.ice-search-popup-layout .dxbl-fl-cpt {
    max-width: 160px !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
}
@media (max-width: 600px) {
    .ice-search-popup-row > .dxbl-row > .dxbl-fl-group {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    .ice-search-popup-range > .dxbl-row > .dxbl-fl-group {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        width: 50% !important;
    }
    .ice-search-popup-range .dxbl-fl-cpt {
        min-height: 2.5em;
        line-height: 1.25;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    /* The rows stack here, but the window kept the desktop plan's fixed height (SearchPopupWindowController): on a
       420 px phone the sales order search stayed 360 px tall and scrolled its fields while half the screen stood
       empty (popup audit, 29.11.2026). The window follows its content; the controller's max height still caps it. */
    .dxbl-modal-root > .dxbl-popup:has(.ice-search-popup-layout) {
        height: auto !important;
    }
}

/* The notification message (NotificationNotice, F-017): one small card in the corner, there until it is closed.
   Above the page and below XAF's windows, so an open dialog is never covered by it. */
.ice-notification-notice {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    max-width: min(22rem, calc(100vw - 2rem));
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.3;
    color: var(--bs-body-color, #212529);
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-left: 4px solid var(--bs-primary, #0d6efd);
    border-radius: 0.375rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.18);
}
.ice-notification-notice__text { flex: 1 1 auto; min-width: 0; }
.ice-notification-notice__title { font-weight: 600; }
.ice-notification-notice__subject {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    opacity: 0.85;
}
.ice-notification-notice__show { flex: 0 0 auto; white-space: nowrap; }
.ice-notification-notice__close {
    flex: 0 0 auto;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    font-size: 1.125rem;
    line-height: 1;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 0.25rem;
    opacity: 0.65;
    cursor: pointer;
}
.ice-notification-notice__close:hover,
.ice-notification-notice__close:focus-visible { opacity: 1; background: rgba(127, 127, 127, 0.2); }
/* The dark theme leaves --bs-border-color at its light value. */
[data-ice-theme="dark"] .ice-notification-notice {
    border-color: rgba(255, 255, 255, 0.2);
    border-left-color: var(--bs-primary, #0d6efd);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.5);
}

/* ── Warehouse terminal (Barkod-Lot planı, Faz 4) ───────────────────────────────────────────────────────────────
   Single-column focused flow in ICE's terminal family (--ice-* tokens): elevated header & mode strip, focused
   barcode scan hero, stepped transfer flow, progress-driven document cards and responsive stock/line tables. */
.warehouse-terminal {
    container-type: inline-size;
    container-name: warehouse-terminal;
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #f4f7fb;
    color: var(--ice-text);
    font-size: 15px;
    box-sizing: border-box;
}

.warehouse-terminal-fullscreen {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1040;
    overflow-y: auto;
    border-radius: 0;
    padding: 14px 18px;
}

/* Header card & segmented mode navigation */
.wt-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    background: var(--ice-surface);
    border: 1px solid var(--ice-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.wt-header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wt-brand {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.wt-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--ice-selected-bg);
    border: 1px solid #bfdbfe;
    color: var(--ice-focus);
}

.wt-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wt-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ice-text-strong);
}

.wt-operator-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--ice-text-muted);
}

.wt-operator-name {
    font-weight: 600;
    color: var(--ice-text-secondary);
}

.wt-site-chip {
    font-size: 11px;
}

.wt-header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.wt-clock {
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 66px;
    text-align: center;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-border);
    color: var(--ice-text-strong);
}

.wt-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px;
    border-radius: 10px;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-border);
}

.wt-mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 130px;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ice-text-secondary);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.wt-mode-btn:only-child {
    flex: 0 1 220px;
}

.wt-mode-btn svg {
    flex-shrink: 0;
}

.wt-mode-btn:focus-visible,
.wt-btn:focus-visible,
.wt-doc-card:focus-visible,
.wt-choice-card:focus-visible,
.wt-pill-toggle:focus-visible {
    outline: 2px solid var(--ice-focus);
    outline-offset: 2px;
}

.wt-mode-btn:hover:not(.active) {
    background: var(--ice-surface-hover);
    color: var(--ice-text-strong);
}

.wt-mode-btn.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

.wt-mode-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: var(--ice-tone-accent-bg);
    color: var(--ice-tone-accent-fg);
}

.wt-mode-btn.active .wt-mode-count {
    background: rgba(255, 255, 255, 0.24);
    color: #ffffff;
}

/* Scoped terminal buttons (isolated from modal .btn-touch-* flex ratios) */
.wt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: 9px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.wt-btn:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    box-shadow: none;
}

.wt-btn-primary {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.wt-btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.wt-btn-success {
    background: #16a34a;
    border-color: #15803d;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(22, 163, 74, 0.26);
}

.wt-btn-success:hover:not(:disabled) {
    background: #15803d;
}

.wt-btn-secondary {
    background: var(--ice-surface-inset);
    border-color: var(--ice-border-firm);
    color: var(--ice-text-strong);
}

.wt-btn-secondary:hover:not(:disabled) {
    background: var(--ice-surface-hover);
    border-color: var(--ice-border-muted);
}

.wt-btn-ghost {
    background: var(--ice-surface);
    border-color: var(--ice-border-firm);
    color: var(--ice-text-secondary);
}

.wt-btn-ghost:hover:not(:disabled) {
    background: var(--ice-surface-hover);
    color: var(--ice-text-strong);
    border-color: var(--ice-border-muted);
}

.wt-meta-btn {
    min-height: 40px;
    padding: 7px 13px;
    font-size: 13.5px;
}

.wt-btn-compact {
    min-height: 34px;
    padding: 5px 12px;
    font-size: 13px;
    border-radius: 7px;
}

/* Focused barcode scan hero card */
.wt-scan-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    background: var(--ice-surface);
    border: 1.5px solid var(--ice-border);
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wt-scan-card:focus-within {
    border-color: var(--ice-focus-soft);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06);
}

.wt-scan-card-confirm {
    border-color: #22c55e;
}

.wt-scan-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.wt-step-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--ice-selected-bg);
    color: var(--ice-focus);
}

.wt-step-pill-confirm {
    background: var(--ice-tone-success-bg);
    color: var(--ice-tone-success-fg);
}

.wt-step-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.wt-scan-key-hint {
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-border);
    color: var(--ice-text-muted);
    font-family: var(--bs-font-monospace, monospace);
}

.wt-scan-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
}

.wt-scan-field {
    display: flex;
    align-items: center;
    flex: 1 1 320px;
    min-width: 0;
    max-width: 100%;
    min-height: 52px;
    padding: 4px 10px 4px 14px;
    gap: 10px;
    border-radius: 10px;
    background: var(--ice-surface-inset);
    border: 1.5px solid var(--ice-border-firm);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.wt-scan-field:focus-within {
    background: var(--ice-surface);
    border-color: var(--ice-focus);
}

.wt-scan-icon {
    display: inline-flex;
    color: var(--ice-focus);
    flex-shrink: 0;
}

.wt-scan-input {
    flex: 1 1 auto;
    width: 0;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--ice-text-strong);
    font-size: 18px;
    font-weight: 600;
    padding: 6px 0;
}

.wt-scan-input::placeholder {
    color: var(--ice-text-faint);
    font-weight: 400;
}

.wt-scan-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--ice-text-muted);
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

.wt-scan-clear:hover {
    background: var(--ice-surface-hover);
    color: var(--ice-text-strong);
}

.wt-scan-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex: 0 0 auto;
}

.wt-scan-submit {
    min-height: 52px;
    min-width: 122px;
    font-size: 15px;
    padding: 0 20px;
}

.wt-scan-camera {
    min-height: 52px;
    padding: 0 16px;
}

/* Dismissible feedback alerts (4px semantic stripe) */
.wt-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
}

.wt-alert-danger {
    background: var(--ice-tone-danger-soft-bg);
    border-color: var(--ice-tone-danger-soft-border);
    border-left: 4px solid var(--ice-signal-bad);
    color: var(--ice-tone-danger-soft-fg);
}

.wt-alert-success {
    background: var(--ice-tone-success-soft-bg);
    border-color: var(--ice-tone-success-soft-border);
    border-left: 4px solid var(--ice-signal-good);
    color: var(--ice-tone-success-soft-fg);
}

.wt-alert-icon {
    display: inline-flex;
    flex-shrink: 0;
}

.wt-alert-text {
    flex: 1 1 auto;
    line-height: 1.4;
}

.wt-alert-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: currentColor;
    opacity: 0.72;
    cursor: pointer;
    flex-shrink: 0;
}

.wt-alert-close:hover {
    opacity: 1;
    background: rgba(15, 23, 42, 0.08);
}

/* Shared card container */
.wt-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    background: var(--ice-surface);
    border: 1px solid var(--ice-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.wt-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.wt-section-title {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--ice-text-strong);
}

.wt-section-sub {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--ice-text-muted);
}

.wt-sub {
    font-size: 13px;
    color: var(--ice-text-muted);
}

.wt-card-footer {
    padding-top: 8px;
    border-top: 1px solid var(--ice-border-soft);
    font-size: 13px;
    color: var(--ice-text-muted);
}

/* Shelf Transfer 3-step stepper */
.wt-stepper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.wt-stepper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
}

.wt-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 13px;
    border-radius: 10px;
    background: var(--ice-surface-inset);
    border: 1.5px solid var(--ice-border);
    min-width: 0;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.wt-step-now {
    background: var(--ice-selected-bg);
    border-color: var(--ice-focus);
}

.wt-step-done {
    background: var(--ice-tone-success-soft-bg);
    border-color: var(--ice-tone-success-soft-border);
}

.wt-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--ice-track);
    color: var(--ice-text-secondary);
}

.wt-step-now .wt-step-num {
    background: var(--ice-focus);
    color: #ffffff;
}

.wt-step-done .wt-step-num {
    background: var(--ice-signal-good);
    color: #ffffff;
}

.wt-step-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wt-step-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ice-text-muted);
}

.wt-step-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--ice-text-strong);
    word-break: break-word;
}

.wt-step-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ice-text-faint);
    font-size: 18px;
    font-weight: 600;
}

/* Active form & quantity confirmation cards */
.wt-form-card {
    border-left: 4px solid var(--ice-focus);
}

.wt-form-card-confirm {
    border-left-color: var(--ice-signal-good);
}

.wt-form-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.wt-form-identity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.wt-code-lg {
    font-size: 13.5px;
    padding: 3px 8px;
}

.wt-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    align-items: end;
}

.wt-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wt-field-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ice-text-label);
}

.wt-qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wt-qty-input {
    width: 170px;
    max-width: 100%;
}

.wt-qty-input .dxbl-text-edit-input,
.wt-qty-input input {
    text-align: right;
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.wt-unit-chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-border);
    font-size: 14px;
    font-weight: 600;
    color: var(--ice-text-secondary);
}

.wt-readonly-value {
    display: flex;
    align-items: center;
    min-height: 44px;
}

.wt-text-input {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1.5px solid var(--ice-border-firm);
    background: var(--ice-surface-inset);
    color: var(--ice-text-strong);
    font-size: 15px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.wt-text-input:focus {
    background: var(--ice-surface);
    border-color: var(--ice-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.wt-package-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--ice-border-soft);
}

.wt-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wt-pill-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 40px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--ice-border-firm);
    background: var(--ice-surface-inset);
    color: var(--ice-text-secondary);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wt-pill-toggle:hover:not(.active) {
    background: var(--ice-surface-hover);
    border-color: var(--ice-border-muted);
    color: var(--ice-text-strong);
}

.wt-pill-toggle.active {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
}

.wt-pill-sub {
    opacity: 0.85;
    font-weight: 500;
}

.wt-form-hint {
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-border-soft);
    font-size: 13px;
    color: var(--ice-text-muted);
}

.wt-confirm-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.wt-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Document selection & disambiguation choice grids */
.wt-doc-grid,
.wt-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

.wt-doc-card,
.wt-choice-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 13px 15px;
    border-radius: 10px;
    border: 1.5px solid var(--ice-border);
    background: var(--ice-surface-inset);
    color: var(--ice-text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.wt-doc-card:hover,
.wt-choice-card:hover {
    background: var(--ice-surface);
    border-color: var(--ice-focus-soft);
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.wt-doc-card-top,
.wt-choice-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.wt-doc-no,
.wt-choice-title {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--ice-text-strong);
}

.wt-doc-card-meta,
.wt-choice-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--ice-text-muted);
}

.wt-doc-card-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.wt-doc-arrow {
    color: var(--ice-text-faint);
    font-weight: 700;
    transition: transform 0.15s ease, color 0.15s ease;
}

.wt-doc-card:hover .wt-doc-arrow {
    color: var(--ice-focus);
    transform: translateX(2px);
}

/* Progress bar */
.wt-progress-track {
    flex: 1 1 auto;
    height: 7px;
    border-radius: 999px;
    background: var(--ice-track);
    overflow: hidden;
}

.wt-progress-lg {
    height: 9px;
    max-width: 320px;
}

.wt-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--ice-focus);
    transition: width 0.25s ease;
}

.wt-progress-done {
    background: var(--ice-signal-good);
}

.wt-doc-progress-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.wt-progress-label {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ice-text-secondary);
}

/* Active document hero card */
.wt-doc-hero {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-left: 4px solid var(--ice-focus);
}

.wt-doc-hero-ready {
    border-left-color: var(--ice-signal-good);
}

.wt-doc-hero-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 320px;
    min-width: 0;
}

.wt-doc-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.wt-doc-hero-no {
    font-size: 20px;
    font-weight: 700;
    color: var(--ice-text-strong);
}

.wt-doc-hero-sub {
    font-size: 14px;
    color: var(--ice-text-muted);
}

.wt-doc-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Welcome & empty states */
.wt-welcome-card {
    align-items: center;
    text-align: center;
    padding: 34px 20px;
    gap: 10px;
}

.wt-welcome-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--ice-selected-bg);
    color: var(--ice-focus);
    margin-bottom: 4px;
}

.wt-welcome-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--ice-text-strong);
}

.wt-welcome-hint {
    margin: 0;
    max-width: 520px;
    font-size: 14px;
    color: var(--ice-text-muted);
}

.wt-welcome-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
}

.wt-guide-pill {
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-border);
    color: var(--ice-text-secondary);
}

.wt-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 28px 16px;
    color: var(--ice-text-muted);
}

.wt-empty-state p {
    margin: 0;
    font-size: 14.5px;
}

.wt-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-border);
    color: var(--ice-text-faint);
}

/* Stock Query found hero & KPI strip */
.wt-found-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
}

.wt-found-heading {
    font-size: 20px;
    font-weight: 700;
    color: var(--ice-text-strong);
}

.wt-found-detail {
    font-size: 14px;
    color: var(--ice-text-muted);
}

.wt-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.wt-kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-border);
}

.wt-kpi-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ice-text-muted);
}

.wt-kpi-val {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ice-text-strong);
}

.wt-kpi-unit {
    font-size: 13px;
    font-weight: 600;
    color: var(--ice-text-muted);
}

.wt-kpi-free .wt-kpi-val {
    color: var(--ice-tone-success-soft-fg);
}

.wt-kpi-reserved .wt-kpi-val {
    color: var(--ice-tone-warning-fg);
}

/* Stock that is not usable - under inspection, in quarantine, blocked - stands apart from what is free. */
.wt-kpi-held .wt-kpi-val {
    color: var(--ice-tone-danger-soft-fg);
}

/* Stock & document tables (normal-case headers per CockpitVisualConventionTests) */
.wt-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--ice-border);
}

.wt-table {
    margin-bottom: 0;
    font-size: 14.5px;
    color: var(--ice-text);
    --bs-table-bg: transparent;
    --bs-table-color: var(--ice-text);
    --bs-border-color: var(--ice-border);
}

.wt-table thead th {
    --bs-table-bg: var(--ice-surface-inset);
    --bs-table-color: var(--ice-text-label);
    background-color: var(--ice-surface-inset);
    color: var(--ice-text-label);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    padding: 10px 12px;
    border-bottom: 1.5px solid var(--ice-border);
}

.wt-table thead th.wt-num {
    text-align: right;
}

.wt-qty-val {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
}

.wt-table tbody td {
    padding: 10px 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--ice-border-soft);
}

.wt-table tbody tr:last-child td {
    border-bottom: none;
}

.wt-row-clickable {
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.wt-table tbody tr.wt-row-clickable:hover > td {
    --bs-table-bg: var(--ice-surface-hover);
    background-color: var(--ice-surface-hover);
}

.wt-table tbody tr.wt-row-done > td {
    --bs-table-bg: var(--ice-tone-success-soft-bg);
    background-color: var(--ice-tone-success-soft-bg);
}

.wt-table tbody tr.wt-row-done.wt-row-clickable:hover > td {
    filter: brightness(0.97);
}

.wt-table tbody tr.wt-row-held > td {
    --bs-table-bg: var(--ice-tone-danger-soft-bg);
    background-color: var(--ice-tone-danger-soft-bg);
}

.wt-num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.wt-col-action {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.wt-cell-part {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.wt-cell-part-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.wt-cell-lot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.wt-loc-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    background: var(--ice-surface-inset);
    border: 1px solid var(--ice-border);
    color: var(--ice-text-secondary);
    white-space: nowrap;
}

.wt-qty-free strong {
    color: var(--ice-tone-success-soft-fg);
}

.wt-open-qty {
    color: var(--ice-focus);
}

.wt-picks-text {
    font-family: var(--bs-font-monospace, monospace);
    font-size: 12.5px;
    color: var(--ice-text-secondary);
}

/* Dark theme polish for surfaces outside --ice-* tokens */
[data-ice-theme="dark"] .warehouse-terminal {
    background: #0f172a;
}

[data-ice-theme="dark"] .wt-brand-icon {
    border-color: rgba(59, 130, 246, 0.35);
}

[data-ice-theme="dark"] .wt-mode-btn.active {
    background: #3b82f6;
    border-color: #60a5fa;
}

[data-ice-theme="dark"] .wt-btn-primary {
    background: #3b82f6;
    border-color: #60a5fa;
}

[data-ice-theme="dark"] .wt-btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

[data-ice-theme="dark"] .wt-pill-toggle.active {
    background: #3b82f6;
    border-color: #60a5fa;
}

[data-ice-theme="dark"] .wt-alert-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

[data-ice-theme="dark"] .wt-table thead th {
    color: var(--ice-text-label);
}

/* Responsive breakpoints via container query (handles squeezed XAF sidebar and tablets/phones alike) */
@container warehouse-terminal (max-width: 820px) {
    .wt-stepper {
        grid-template-columns: 1fr;
    }

    .wt-step-arrow {
        display: none;
    }

    .wt-doc-hero-actions {
        width: 100%;
    }

    .wt-doc-hero-actions .wt-btn {
        flex: 1 1 auto;
    }
}

@container warehouse-terminal (max-width: 640px) {
    .warehouse-terminal {
        padding: 8px;
        gap: 10px;
    }

    .wt-header,
    .wt-scan-card,
    .wt-card {
        padding: 12px;
    }

    .wt-scan-key-hint {
        display: none;
    }

    .wt-scan-row {
        flex-direction: column;
    }

    .wt-scan-field {
        width: 100%;
        flex: 0 0 auto;
    }

    .wt-scan-actions {
        width: 100%;
    }

    .wt-scan-submit {
        flex: 2 1 auto;
    }

    .wt-scan-camera {
        flex: 1 1 auto;
    }

    .wt-modes {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wt-mode-btn {
        flex: none;
        min-width: 0;
        gap: 5px;
        padding: 8px 6px;
        font-size: 12.5px;
        white-space: normal;
        text-align: center;
    }

    .wt-mode-btn svg {
        width: 15px;
        height: 15px;
    }

    .wt-mode-btn:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .wt-loc-chip {
        white-space: normal;
        word-break: break-word;
        font-size: 12px;
    }

    .wt-confirm-actions {
        width: 100%;
    }

    .wt-confirm-actions .wt-btn {
        flex: 1 1 auto;
    }

    /* Stack wide tables into touch-friendly cards on handheld/phone widths */
    .wt-table-wrap {
        border: none;
        overflow: visible;
    }

    .wt-table thead {
        display: none;
    }

    .wt-table tbody {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .wt-table tbody tr {
        display: flex;
        flex-direction: column;
        padding: 10px 12px;
        border-radius: 10px;
        border: 1px solid var(--ice-border);
        background: var(--ice-surface-inset);
    }

    .wt-table tbody tr.wt-row-done {
        background: var(--ice-tone-success-soft-bg);
        border-color: var(--ice-tone-success-soft-border);
    }

    .wt-table tbody tr.wt-row-held {
        background: var(--ice-tone-danger-soft-bg);
        border-color: var(--ice-tone-danger-soft-border);
    }

    .wt-table tbody tr > td,
    .wt-table tbody tr.wt-row-done > td,
    .wt-table tbody tr.wt-row-held > td,
    .wt-table tbody tr.wt-row-clickable:hover > td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 4px 0;
        border-bottom: 1px dashed var(--ice-border-soft);
        --bs-table-bg: transparent;
        background-color: transparent;
        text-align: right;
    }

    .wt-table tbody td:last-child {
        border-bottom: none;
    }

    .wt-table tbody td::before {
        content: attr(data-label);
        font-size: 12px;
        font-weight: 600;
        color: var(--ice-text-muted);
        text-align: left;
        flex-shrink: 0;
    }

    .wt-table tbody td.wt-col-action {
        width: 100%;
        justify-content: flex-end;
        padding-top: 6px;
    }

    .wt-table tbody td.wt-col-action::before {
        content: none;
    }

    .wt-cell-part {
        align-items: flex-end;
        text-align: right;
    }
}

/* Quality characteristic: the conditional required marks. Unit of Measure is required only for
   numeric characteristics and Default Chart Type only while SPC is enabled, but XAF's model-level
   required mark cannot change per record, so these two members carry no RuleRequiredField. The
   appearance rules disable each editor exactly while its requirement does not apply, so the star
   follows the editor's live enabled state. */
.xaf-quality-characteristic-form dxbl-form-layout-item:not(:has(.dxbl-text-edit.dxbl-disabled)) > label.xaf-item-unit::after,
.xaf-quality-characteristic-form dxbl-form-layout-item:not(:has(.dxbl-text-edit.dxbl-disabled)) > label.xaf-item-defaultcharttype::after {
    content: "*";
}

/* Shop floor terminal: narrow screens, the queue header, full screen with the criteria (Sura, 15.11.2026). */
.shopfloor-terminal-container {
    container-type: inline-size;
    container-name: shopfloor-terminal;
}

.shopfloor-terminal-container .pane-header {
    flex-wrap: wrap;
    gap: 8px 12px;
}

.shopfloor-terminal-container .pane-title {
    white-space: nowrap;
    flex-shrink: 0;
}

.shopfloor-terminal-container .btn-text-action:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    background: none;
    text-decoration: none;
}

/* The viewport rule at 1024 px misses a terminal squeezed by the navigation; the container decides instead. */
@container shopfloor-terminal (max-width: 1100px) {
    .shopfloor-body {
        flex-direction: column;
    }
    .shopfloor-operations-pane,
    .shopfloor-action-pane {
        flex: 1 1 auto;
        max-height: none;
    }
    .operations-card-list {
        max-height: 60vh;
    }
    .touch-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@container shopfloor-terminal (max-width: 640px) {
    .ribbon-row.main-row {
        flex-direction: column;
        align-items: stretch;
    }
    .operator-badge-box,
    .barcode-search-box {
        width: 100%;
        /* Their row basis (320 px) would become a height in the column. */
        flex: 0 0 auto;
    }
    .touch-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* Full screen takes the search criteria along: Site, Work Center and Refresh stayed under the terminal before. */
.shopfloor-terminal-detail-main:has(.shopfloor-terminal-fullscreen) {
    position: fixed;
    inset: 0;
    /* The layout group's own 6 px margin left a strip of the page above it. */
    margin: 0;
    z-index: 1040;
    overflow-y: auto;
    padding: 8px 12px;
    background-color: #f4f7fb;
}

.shopfloor-terminal-detail-main:has(.shopfloor-terminal-fullscreen) .shopfloor-terminal-fullscreen {
    position: static;
    inset: auto;
    z-index: auto;
    overflow: visible;
}

.shopfloor-terminal-detail-main:has(.shopfloor-terminal-fullscreen) .shopfloor-operations-pane,
.shopfloor-terminal-detail-main:has(.shopfloor-terminal-fullscreen) .shopfloor-action-pane {
    max-height: max(420px, calc(100vh - 300px));
}

[data-ice-theme="dark"] .shopfloor-terminal-detail-main:has(.shopfloor-terminal-fullscreen),
[data-bs-theme="dark"] .shopfloor-terminal-detail-main:has(.shopfloor-terminal-fullscreen) {
    background-color: #0f172a;
}

/* Refresh keeps the width it had before the criteria rows were evened out (Sura, 15.11.2026). */
.shopfloor-terminal-search-criteria .shopfloor-refresh-button {
    width: auto;
    min-width: 140px;
}

/* ── Dialog footer (IceDialogFooter) ──
   Every custom dialog's footer is drawn like XAF's own dialog footer (measured 22.11.2026 in the Run CRP dialog):
   accept first, then cancel, right-aligned, 4px apart. The popup's FooterContentTemplate keeps XAF's footer
   padding. The cockpits wrote their footers with Bootstrap utilities (justify-content-end, gap-2) that this app
   does not load, which left the CRP footer on the left and every pair of buttons touching. */
.ice-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    width: 100%;
}

/* XAF's dialog buttons are toolbar buttons: 3px side padding and at least 40px wide. */
.ice-dialog-footer > .dxbl-btn.dxbl-sm {
    padding-left: 3px;
    padding-right: 3px;
    min-width: 40px;
}

.ice-dialog-footer-note {
    margin-right: auto;
    color: var(--ice-text-muted);
    font-size: 12px;
}

/* ── OEE cockpit on the cockpits' parts (decision 23.11.2026) ──
   The OEE cockpit wears the maintenance analysis cockpit's bar, ribbon and tiles. Its eight read-only tiles wrap like the
   analysis tiles; the scored four (OEE, availability, performance, quality) carry the good / fair / poor colour on the value. */
.oee-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.oee-kpi-grid .mrp-kpi-card {
    cursor: default;
}

.oee-kpi-grid .mrp-kpi-card:hover {
    transform: none;
}

.oee-kpi-grid .oee-kpi-main .mrp-kpi-val {
    font-size: 1.15rem;
}

/* The filters keep fixed widths in the bar, as the maintenance analysis cockpit's do. The OEE cockpit has more of them
   and two list buttons besides: the criteria take the first row, the buttons and Refresh the second, on the right. */
.oee-cockpit .mrp-control-bar-left { flex-basis: 100%; }
.oee-cockpit .mrp-control-bar-right { margin-left: auto; }
.mrp-control-bar-left > .oee-cockpit-site { flex: 0 0 170px; width: 170px; }
.mrp-control-bar-left > .oee-cockpit-workcenter,
.mrp-control-bar-left > .oee-cockpit-machine { flex: 0 0 130px; width: 130px; }
.mrp-control-bar-left > .oee-cockpit-date { flex: 0 0 110px; width: 110px; }
.mrp-control-bar-left > .oee-cockpit-period { flex: 0 0 85px; width: 85px; }

/* The quality dashboard's site box in the shared control bar. */
.mrp-control-bar-left > .qd-site { flex: 0 0 260px; width: 260px; }
