/* Planning feature — global styles.
   Rules here target DevExpress popup/dropdown elements which render in a portal
   outside the owning component, so Blazor CSS isolation (.razor.css) cannot reach them. */

/* PlanningSessionDetailView — asset color dropdown sizing */
.dxbl-dropdown-dialog:has(.asset-color-dropdown) {
    width: fit-content !important;
    min-width: auto !important;
}

.dxbl-dropdown-body.asset-color-dropdown {
    width: fit-content !important;
    min-width: auto !important;
}

/* CreatePlanningSessionDialog — popup layout */
.create-planning-dialog-body {
    padding: 16px 20px 4px;
}

.create-planning-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    width: 100%;
}

.create-planning-dialog-footer .dxbl-btn {
    min-width: 96px;
}

.planning-assets-loader {
    position: relative;
    min-height: 220px;
}

.planning-assets-placeholder {
    min-height: 220px;
}

/* SplitRequestDialog — quantity-split UI. DxPopup renders in a portal, so these live
   here (a scoped .razor.css cannot reach them). */
.split-dialog-body {
    padding: 16px 20px 4px;
}

/* Footer buttons: right-aligned row matching the create-planning dialog. */
.split-dialog-footer {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    width: 100%;
}

.split-dialog-footer .dxbl-btn {
    flex: 0 0 auto;
    min-width: 96px;
}

/* Plain-language intro callout. */
.split-intro {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--lara-text-secondary, #5b6670);
    background: var(--lara-surface-secondary, #f6f8fa);
    border-left: 3px solid var(--lara-primary);
    padding: 9px 12px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 16px;
}

/* Numbered step headers. */
.split-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--lara-text, #39424C);
    margin: 0 0 10px;
}

.split-step-n {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--lara-primary);
    color: #fff;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

/* Part-count row: slider fills, compact number box. The descendant selector beats
   DevExpress's .dxbl-text-edit { width:100% } (equal specificity, loaded later). */
.split-parts-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.split-range {
    flex: 1 1 auto;
    min-width: 0;
    accent-color: var(--lara-primary);
    height: 4px;
}

.split-parts-row .split-parts-count {
    width: 96px;
    flex: 0 0 96px;
}

/* Item card. */
.split-item {
    background: var(--lara-surface-secondary, #f7f9fb);
    border: 1px solid var(--lara-border-light, #e7ebef);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}

.split-item-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.split-item-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--lara-text, #39424C);
    display: flex;
    align-items: center;
    gap: 8px;
}

.split-sku {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--lara-primary);
    background: rgba(31, 58, 143, 0.08);
    border-radius: 4px;
    padding: 2px 6px;
    letter-spacing: .3px;
}

.split-item-total {
    font-size: 12px;
    color: var(--lara-text-secondary, #5b6670);
    text-align: right;
    white-space: nowrap;
    line-height: 1.3;
}

.split-item-total b {
    font-size: 14px;
    color: var(--lara-text, #39424C);
}

/* The proportional bar + per-part inputs now live in the reusable LaraAllocationBar
   component (css/allocation-bar.css). */

/* Dimensionless item: assign the whole item to one part. */
.split-whole {
    display: flex;
    align-items: center;
    gap: 8px;
}

.split-whole-label {
    font-size: 12px;
    color: var(--lara-text-secondary, #8a939c);
}

.split-whole-select {
    height: 30px;
    border: 1px solid var(--lara-border, #d6dadf);
    border-radius: 6px;
    padding: 0 8px;
    color: var(--lara-text, #39424C);
}

.split-error {
    margin-top: 12px;
}

/* ============================================================================
   PlanningWindowSelector — ribbon chip + visual 0-24h timeline popup (mockup #2).
   Lives here (not a new stylesheet) because this file is already linked and the
   DevExpress dropdown body renders in a portal outside the component subtree.
   All classes are pw-* / planning-window-* prefixed. Palette mirrors lara-theme.css.
   ============================================================================ */

.planning-window-selector {
    min-width: 150px;
}

.pw-pop {
    width: 360px;
    font-family: 'proxima-nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    color: #39424C;
    font-size: 13px;
    line-height: 1.4;
}

.pw-pop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px 9px;
    border-bottom: 1px solid #E1E6EB;
    background: #F4F6F8;
}

.pw-pop-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #5B6470;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.pw-pop-title .oi {
    color: #0C3D82;
    font-size: 12px;
}

.pw-mode {
    display: inline-flex;
    background: #EFF2F5;
    border: 1px solid #D6DCE0;
    border-radius: 6px;
    padding: 2px;
}

.pw-mode-btn {
    font-size: 11px;
    padding: 3px 9px;
    border: none;
    background: transparent;
    border-radius: 4px;
    color: #5B6470;
    line-height: 1.4;
    cursor: pointer;
}

.pw-mode-btn:hover {
    color: #0C3D82;
}

.pw-mode-btn.pw-on {
    background: #0C3D82;
    color: #FFFFFF;
}

.pw-body {
    padding: 18px 16px 14px;
}

.pw-track-wrap {
    position: relative;
    padding: 0 4px;
}

.pw-dur-float {
    position: absolute;
    top: -2px;
    transform: translateX(-50%);
    background: #0C3D82;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 11px;
    border-radius: 12px;
    white-space: nowrap;
    z-index: 4;
}

.pw-dur-float::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -4px;
    transform: translateX(-50%) rotate(45deg);
    width: 7px;
    height: 7px;
    background: #0C3D82;
}

.pw-track {
    position: relative;
    height: 16px;
    margin-top: 32px;
}

.pw-rail {
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
    height: 6px;
    background: #EFF2F5;
    border: 1px solid #E1E6EB;
    border-radius: 12px;
}

.pw-tinted {
    position: absolute;
    top: -1px;
    height: 18px;
    background: rgba(65, 137, 241, 0.2);
    border-radius: 4px;
    pointer-events: none;
}

.pw-band {
    position: absolute;
    top: 5px;
    height: 6px;
    background: #0C3D82;
    border-radius: 12px;
    pointer-events: none;
}

/* Two native range inputs overlap the rail; only their thumbs are interactive so both handles
   stay grabbable. The visible rail/band/thumbs are drawn by us. */
.pw-range {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 16px;
    margin: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.pw-range:focus {
    outline: none;
}

.pw-range::-webkit-slider-runnable-track {
    background: none;
    border: none;
    height: 16px;
}

.pw-range::-moz-range-track {
    background: none;
    border: none;
    height: 16px;
}

.pw-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 3px solid #0C3D82;
    box-sizing: border-box;
    cursor: grab;
}

.pw-range::-moz-range-thumb {
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 3px solid #0C3D82;
    box-sizing: border-box;
    cursor: grab;
}

.pw-range:active::-webkit-slider-thumb {
    cursor: grabbing;
}

.pw-range:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(65, 137, 241, 0.3);
}

.pw-range:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 3px rgba(65, 137, 241, 0.3);
}

.pw-ruler {
    position: relative;
    height: 18px;
    margin: 6px 4px 0;
}

.pw-ruler span {
    position: absolute;
    top: 3px;
    font-size: 11px;
    color: #939DA7;
    transform: translateX(-50%);
}

.pw-ruler .pw-ruler-s {
    left: 0;
    transform: none;
}

.pw-ruler .pw-ruler-e {
    transform: translateX(-100%);
}

.pw-fields {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.pw-field {
    flex: 1;
    min-width: 0;
}

.pw-field-lbl {
    font-size: 11px;
    color: #939DA7;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin: 0 0 5px 2px;
}

.pw-time {
    width: 100%;
}

.pw-fld-arrow {
    color: #939DA7;
    padding-bottom: 7px;
    flex: 0 0 auto;
}

.pw-durfield {
    flex: 0 0 104px;
    width: 104px;
}

.pw-step {
    display: flex;
    align-items: center;
    height: 32px;
    border: 1px solid #D6DCE0;
    border-radius: 6px;
    overflow: hidden;
    background: #FFFFFF;
}

.pw-step button {
    width: 28px;
    flex: 0 0 28px;
    height: 100%;
    border: none;
    background: #F4F6F8;
    color: #5B6470;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pw-step button:first-child {
    border-right: 1px solid #E1E6EB;
}

.pw-step button:last-child {
    border-left: 1px solid #E1E6EB;
}

.pw-step button:hover {
    color: #0C3D82;
}

.pw-step-val {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #0C3D82;
}

.pw-presets {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 16px;
    padding-top: 13px;
    border-top: 1px solid #E1E6EB;
}

.pw-pre-lbl {
    font-size: 11px;
    color: #939DA7;
}

.pw-pre {
    font-size: 11px;
    padding: 4px 10px;
    border: 1px solid #D6DCE0;
    border-radius: 12px;
    color: #5B6470;
    background: #FFFFFF;
    cursor: pointer;
}

.pw-pre:hover {
    border-color: #0858CA;
    color: #0C3D82;
}

.pw-pre.pw-on {
    border-color: #0C3D82;
    color: #0C3D82;
    background: rgba(65, 137, 241, 0.2);
    font-weight: 600;
}

.pw-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

/* Relative mode: per-side -1d / -1h [expr] +1h / +1d steppers. */
.pw-rel-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pw-rel {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pw-rel-btn {
    height: 30px;
    min-width: 36px;
    padding: 0 8px;
    border: 1px solid #D6DCE0;
    border-radius: 6px;
    background: #F4F6F8;
    color: #5B6470;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex: 0 0 auto;
}

.pw-rel-btn:hover {
    border-color: #0858CA;
    color: #0C3D82;
}

.pw-rel-input {
    flex: 1 1 auto;
    min-width: 0;
}

.pw-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border-top: 1px solid #E1E6EB;
    background: #F4F6F8;
}

.pw-foot-note {
    font-size: 11px;
    color: #939DA7;
}
