/* Section reorder navigator — Print Workstation left-column "Reorder" tab.
   Relocated out of WorkOrderPrint.razor's <style> block (where it sat inside the
   preview pane's flex row) so the preview pane can always show the scaled sheet.
   All rules are scoped under .reorder-panel to avoid leaking the generic class
   names (position-badge / section-name / arrow-btn …) into the rest of the app.
   Dark mode is class-based (.dark on <html>). */

.reorder-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #ffffff;
    color: #334155;
}

.dark .reorder-panel {
    background: #262626; /* neutral-800 */
    color: #d4d4d4;
}

/* Header — sticky title row + Reset button */
.reorder-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 2;
}

.dark .reorder-panel-header {
    background: #1f1f1f;
    border-bottom-color: #404040;
}

.reorder-panel-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.05em;
}

.dark .reorder-panel-title {
    color: #a3a3a3;
}

.reorder-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.reorder-reset-btn:hover:not(:disabled) {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.reorder-reset-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dark .reorder-reset-btn {
    background: #404040;
    border-color: #525252;
    color: #d4d4d4;
}

.dark .reorder-reset-btn:hover:not(:disabled) {
    background: #450a0a;
    border-color: #b91c1c;
    color: #fca5a5;
}

.reorder-reset-icon {
    width: 13px;
    height: 13px;
}

/* Empty state */
.reorder-panel-empty {
    padding: 24px 16px;
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
}

.dark .reorder-panel-empty {
    color: #737373;
}

/* Section list */
.reorder-panel-sections {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reorder-panel .reorder-section-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.reorder-panel .reorder-section-row:hover {
    background: #f8fafc;
}

.dark .reorder-panel .reorder-section-row {
    background: #2d2d2d;
    border-color: #404040;
}

.dark .reorder-panel .reorder-section-row:hover {
    background: #353535;
}

.reorder-panel .reorder-section-row.section-hidden {
    opacity: 0.5;
}

.reorder-panel .position-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #e2e8f0;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    flex-shrink: 0;
}

.dark .reorder-panel .position-badge {
    background: #525252;
    color: #e5e5e5;
}

.reorder-panel .section-arrows {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reorder-panel .arrow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.1s ease;
}

.reorder-panel .arrow-btn svg {
    width: 14px;
    height: 14px;
    color: #64748b;
}

.reorder-panel .arrow-btn:hover:not(:disabled) {
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.reorder-panel .arrow-btn:hover:not(:disabled) svg {
    color: #0284c7;
}

.reorder-panel .arrow-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.dark .reorder-panel .arrow-btn {
    background: #404040;
    border-color: #525252;
}

.dark .reorder-panel .arrow-btn svg {
    color: #a3a3a3;
}

.dark .reorder-panel .arrow-btn:hover:not(:disabled) {
    background: #1e3a5f;
    border-color: #0ea5e9;
}

.reorder-panel .section-name {
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .reorder-panel .section-name {
    color: #d4d4d4;
}

.reorder-panel .section-name-hidden {
    text-decoration: line-through;
}

.reorder-panel .hidden-tag {
    font-size: 9px;
    font-weight: 600;
    color: #d97706;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.reorder-panel .eye-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
    transition: all 0.1s ease;
}

.reorder-panel .eye-toggle-btn svg {
    width: 14px;
    height: 14px;
    color: #94a3b8;
}

.reorder-panel .eye-toggle-btn:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.reorder-panel .eye-toggle-btn:hover svg {
    color: #64748b;
}

.dark .reorder-panel .eye-toggle-btn:hover {
    background: #404040;
    border-color: #525252;
}

/* Hint */
.reorder-panel-hint {
    padding: 8px 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
}

.dark .reorder-panel-hint {
    border-top-color: #404040;
    color: #737373;
}

/* Per-Blend source-lot composition panel */
.reorder-panel-composition {
    padding: 8px 10px 12px 10px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dark .reorder-panel-composition {
    border-top-color: #404040;
}

.reorder-panel-composition-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
    margin-bottom: 4px;
}

.dark .reorder-panel-composition-section-title {
    color: #a3a3a3;
}

/* Lighter legend chrome inside the (narrower) panel context. */
.reorder-panel-composition .source-lot-legend {
    box-shadow: none;
    border-color: #e2e8f0;
}

.reorder-panel-composition .source-lot-legend__list {
    padding: 6px 8px;
    gap: 4px;
}

.reorder-panel-composition .source-lot-legend__entry {
    font-size: 11px;
    gap: 6px;
}

.reorder-panel-composition .source-lot-legend__lot {
    min-width: 95px;
    font-size: 10.5px;
}

.reorder-panel-composition .source-lot-legend__pct {
    min-width: 42px;
    font-size: 10.5px;
    padding: 1px 5px;
}

.reorder-panel-composition .source-lot-legend__chips {
    font-size: 10.5px;
    gap: 3px;
}
