.production-planner-page {
    width: 100%;
}

.production-planner-toolbar {
    width: 100%;
}

.production-planner-loading,
.production-planner-loading-inner {
    min-height: 60vh;
}

.production-planner-shell {
    width: 100%;
    min-height: calc(100vh - 290px);
    overflow: hidden;
}

.production-planner-scheduler {
    width: 100%;
    height: calc(100vh - 290px);
    min-height: 460px;
}

.production-planner-shell .b-toolbar.b-dock-bottom {
    border-top: 1px solid var(--b-border-color, #d8d8d8);
}

.production-planner-datefield.b-open .b-field-inner::before,
.production-planner-datefield .b-field-inner:focus-within::before {
    background-color: rgba(45, 66, 117, 1);
}

.production-planner-datefield.b-open .b-label,
.production-planner-datefield.b-open label,
.production-planner-datefield:focus-within .b-label,
.production-planner-datefield:focus-within label {
    color: rgba(45, 66, 117, 1) !important;
}

.production-planner-datefield.b-open .b-fieldtrigger,
.production-planner-datefield:focus-within .b-fieldtrigger {
    color: rgba(45, 66, 117, 1) !important;
}

.production-planner-datepicker {
    --datepicker-selected-cell-background-color: rgba(45, 66, 117, 1);
}

.production-planner-datepicker .b-datepicker-monthbutton,
.production-planner-datepicker .b-datepicker-yearbutton {
    color: rgba(45, 66, 117, 1) !important;
}

.production-planner-datepicker .b-weeks-container .b-calendar-cell.b-selected-date:not(.b-in-range) > .b-datepicker-cell-inner {
    background-color: rgba(45, 66, 117, 1);
    border-color: rgba(45, 66, 117, 1);
}

.production-planner-datepicker .b-monthpicker .b-monthpicker-content button.b-monthpicker-month:hover,
.production-planner-datepicker .b-yearpicker .b-yearpicker-content button.b-yearpicker-year:hover {
    background-color: rgba(45, 66, 117, 0.15);
    border-color: transparent;
}

.production-planner-datepicker .b-monthpicker .b-monthpicker-content button.b-monthpicker-month.b-selected,
.production-planner-datepicker .b-yearpicker .b-yearpicker-content button.b-yearpicker-year.b-selected {
    color: #fff;
    background-color: rgba(45, 66, 117, 1);
    border-color: rgba(45, 66, 117, 1);
}

/* Event card shell — matches the demo's b-sch-event-wrap + b-sch-event-content rules */
.production-planner-shell .b-sch-event-wrap {
    --b-sch-event-box-shadow: var(--b-elevation-1);
    --b-sch-event-border-radius: 2px;
}

.production-planner-shell .b-sch-event {
    border-radius: 2px;
}

.production-planner-shell .b-sch-event-content {
    position: relative;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-evenly;
    padding: 6px 8px 5px;
}

.production-planner-shell .b-event-content-inner {
    position: relative;
    min-width: 0;
    text-align: left;
}

.production-planner-shell .b-event-header {
    display: flex;
    font-weight: 600;
    gap: 8px;
}

.production-planner-shell .b-event-header span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-planner-shell .b-event-header > i {
    padding-inline-start: 4px;
}

.production-planner-shell .b-event-pin {
    font-size: 0.95em;
    opacity: 1;
    flex: 0 0 auto;
    align-self: center;
    padding-inline-start: 2px;
}

.production-planner-shell .b-event-pin-dispenser {
    color: #d9480f;
}

.production-planner-shell .b-event-pin-bay {
    color: #1d4ed8;
}

.production-planner-shell .b-event-pin-next {
    color: #7c3aed;
}

.production-planner-shell .b-event-footer {
    display: flex;
    justify-content: flex-start;
    font-weight: 400;
    font-size: 0.8em;
    opacity: 0.7;
    gap: 8px;
    min-width: 0;
}

.production-planner-shell .b-event-footer .b-meta {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-planner-shell .b-event-accent-label {
    font-weight: 700;
    letter-spacing: 0.02em;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-planner-shell .b-event-note {
    font-size: 11px;
    opacity: 0.85;
    line-height: 1.2;
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.production-planner-shell .b-event-note:empty {
    display: none;
}

/* Event colour classes — tonal "indented" look without the left stripe */
.production-planner-shell .b-sch-event {
    color: #333333;
}

.production-planner-shell .b-sch-event.event-planned-fill {
    background: color-mix(in srgb, #2e7d32, white 90%);
    border: 1px solid color-mix(in srgb, #2e7d32, white 55%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.production-planner-shell .b-sch-event.event-planned-fill-optimised {
    background: color-mix(in srgb, #1b4f8a, white 90%);
    border: 1px solid color-mix(in srgb, #1b4f8a, white 55%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.production-planner-shell .b-sch-event.event-planned-fill-historical {
    opacity: 0.55;
    filter: saturate(0.8);
}

.production-planner-shell .b-sch-event.event-executed-fill {
    background: #2e7d32;
    color: #ffffff;
    border-left: 0;
}

.production-planner-shell .b-sch-event.event-maintenance-window {
    background: color-mix(in srgb, #c00000, white 88%);
    border-left: 0;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 6px,
        rgba(192, 0, 0, 0.10) 6px,
        rgba(192, 0, 0, 0.10) 12px
    );
}

.production-planner-shell .b-sch-event.event-accent-1 {
    box-shadow: inset 4px 0 0 #0b7285;
}

.production-planner-shell .b-sch-event.event-accent-2 {
    box-shadow: inset 4px 0 0 #5f3dc4;
}

.production-planner-shell .b-sch-event.event-accent-3 {
    box-shadow: inset 4px 0 0 #e67700;
}

.production-planner-shell .b-sch-event.event-accent-4 {
    box-shadow: inset 4px 0 0 #c2255c;
}

.production-planner-shell .b-sch-event.event-accent-5 {
    box-shadow: inset 4px 0 0 #2b8a3e;
}

.production-planner-shell .b-sch-event.event-accent-6 {
    box-shadow: inset 4px 0 0 #1c7ed6;
}

/* Resource column cell — leading icon + subtitle, mimics the demo's resourceInfo look */
.production-planner-shell .bp-resource-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 0;
}

.production-planner-shell .bp-resource-icon {
    width: 2.2em;
    height: 2.2em;
    flex: 0 0 2.2em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: color-mix(in srgb, #5052ba, white 88%);
    color: #5052ba;
    font-size: 0.95em;
}

/* Hide Bryntum's built-in leaf/folder icons in the resource column — we render our own */
.production-planner-shell .b-tree-cell .b-icon-tree-leaf,
.production-planner-shell .b-tree-cell .b-icon-tree-folder,
.production-planner-shell .b-tree-cell .b-icon-tree-folder-open,
.production-planner-shell .b-tree-cell .b-tree-icon {
    display: none;
}

/* Leaf rows get a folder glyph from a :before pseudo — suppress that too */
.production-planner-shell .b-tree-leaf-cell .b-tree-cell-inner::before {
    content: none;
}

/* Recolour the expand/collapse chevron and any remaining tree icons */
.production-planner-shell {
    --b-tree-expander-color: #5052ba;
    --b-tree-icon-color: #5052ba;
}

.production-planner-shell .b-tree-expander,
.production-planner-shell .b-icon-tree-expand,
.production-planner-shell .b-icon-tree-collapse {
    color: #5052ba;
}

.production-planner-shell .bp-resource-text {
    line-height: 1.15;
    min-width: 0;
    flex: 1;
}

.production-planner-shell .bp-resource-name {
    font-weight: 600;
    color: var(--b-neutral-10, #1a1a1a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-planner-shell .bp-resource-sub {
    font-size: 0.8em;
    color: var(--b-neutral-65, #a6a6a6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tooltip — Bryntum renders tooltips in a floating popup outside the shell,
   so these selectors are deliberately unscoped. Light text for dark popup background. */
.bryntum-tooltip {
    min-width: 220px;
    max-width: 360px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.35;
}

.bryntum-tooltip-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: #ffffff;
}

.bryntum-tooltip-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.bryntum-tooltip-row {
    font-size: 12px;
    margin-bottom: 3px;
    color: rgba(255, 255, 255, 0.92);
}

.bryntum-tooltip-row strong {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-right: 4px;
}

.bryntum-tooltip-link {
    color: #9fd3ff;
    text-decoration: none;
}

.bryntum-tooltip-link:hover {
    text-decoration: underline;
}

.bryntum-tooltip-row-sub {
    padding-inline-start: 12px;
    color: rgba(255, 255, 255, 0.85);
}

.bryntum-tooltip-desc {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}
