/* Fruit/press print sections (RECEIVE_FRUIT, PROCESS_FRUIT, DRAIN_AND_PRESS).
   Print-packet components render outside Blazor scoped-CSS isolation, so their
   styles must live in a global stylesheet linked from index.html. All selectors
   are scoped under .receive-fruit-section / .process-fruit-section /
   .drain-press-section to avoid colliding with the other per-section stylesheets.

   All three sections render in the shared .movement-section chrome (see
   movement-sections.css) — same header/badge/two-column frame as Transfer/Rack,
   one movement-columns block per fill/step. Only the fruit-specific inner detail
   (rf-* panel, fruit-table) and the section badge colors live here. */

/* No font-size/color overrides here: all three inherit .movement-section's
   Arial / var(--pp-font-size-sm) (11px) so a mixed packet reads as one sheet.
   Process/DrainPress previously carried a pre-convergence `font-size: 0.82rem`
   (13.12px) that made them ~19% larger than every neighbouring section. */
.process-fruit-section {
    margin: 10px 0;
}

.receive-fruit-section {
    margin: 10px 0;
}

.drain-press-section {
    margin: 10px 0;
}

.receive-fruit-section .type-badge {
    background: #dcfce7;
    color: #166534;
}

.process-fruit-section .type-badge {
    background: #ede9fe;
    color: #5b21b6;
}

.drain-press-section .type-badge {
    background: #fef3c7;
    color: #92400e;
}

/* rf-* — key/value detail panel used inside a movement-column (all three sections).
   Rigid variant (2026-07): boxed label/value cells matching the MovementVesselTable
   grid (movement-vessel-table.css) so the fruit panels read like the movement tables. */
.receive-fruit-section .rf-detail,
.process-fruit-section .rf-detail,
.drain-press-section .rf-detail {
    display: flex;
    flex-direction: column;
    border: 1px solid #000;
}

.receive-fruit-section .rf-row,
.process-fruit-section .rf-row,
.drain-press-section .rf-row {
    display: flex;
    align-items: stretch;
    font-size: 0.8rem;
    border-bottom: var(--pp-border-light);
}

.receive-fruit-section .rf-row:last-child,
.process-fruit-section .rf-row:last-child,
.drain-press-section .rf-row:last-child {
    border-bottom: none;
}

.receive-fruit-section .rf-k,
.process-fruit-section .rf-k,
.drain-press-section .rf-k {
    flex: 0 0 90px;
    padding: 3px 6px;
    background: var(--pp-bg-header);
    border-right: var(--pp-border-light);
    color: #374151;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
    display: flex;
    align-items: center;
}

.receive-fruit-section .rf-v,
.process-fruit-section .rf-v,
.drain-press-section .rf-v {
    flex: 1;
    padding: 2px 6px;
    color: #1f2937;
}

/* Write-in value cell — blank ruled cell for hand-written entries (actual bars/cycles etc.) */
.drain-press-section .rf-v.rf-write-in {
    min-height: 20px;
    background: var(--pp-bg-white);
}

.receive-fruit-section .lot-code,
.process-fruit-section .rf-detail .lot-code,
.drain-press-section .rf-detail .lot-code {
    font-family: var(--pp-font-mono);
    font-weight: 700;
}

.receive-fruit-section .rf-tons,
.drain-press-section .rf-tons {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 4px 8px;
    background: var(--pp-bg-subheader);
    border-top: var(--pp-border-light);
}

/* When the totals strip is the only child of its rf-detail box, there's no row above
   to draw the divider — the outer border carries it. */
.drain-press-section .rf-detail > .rf-tons:first-child {
    border-top: none;
}

.receive-fruit-section .rf-tons-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #166534;
}

.receive-fruit-section .rf-tons-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #14532d;
    font-variant-numeric: tabular-nums;
}

.drain-press-section .rf-tons-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #92400e;
}

.drain-press-section .rf-tons-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #78350f;
    font-variant-numeric: tabular-nums;
}

.receive-fruit-section .rf-tons-unit,
.drain-press-section .rf-tons-unit {
    font-size: 0.68rem;
    font-weight: 600;
    color: #6b7280;
    margin-left: 3px;
    text-transform: uppercase;
}

@media print {
    .receive-fruit-section .type-badge {
        background: #dcfce7 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .process-fruit-section .type-badge {
        background: #ede9fe !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .drain-press-section .type-badge {
        background: #fef3c7 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Rigid grid: keep header/label tinting on paper, matching .movement-vessel-table th */
    .fruit-table thead th,
    .receive-fruit-section .wt-table .wt-total-label,
    .receive-fruit-section .rf-k,
    .process-fruit-section .rf-k,
    .drain-press-section .rf-k {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ---- Fruit table ----
   Rigid variant matching .movement-vessel-table (movement-vessel-table.css):
   black-bordered uppercase headers, boxed cells, even-row striping. */
.fruit-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.fruit-table thead th {
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #374151;
    background: var(--pp-bg-header);
    border: 1px solid #000;
    padding: 3px 6px;
    white-space: nowrap;
    line-height: 1.2;
    vertical-align: bottom;
}

.fruit-table tbody td {
    padding: 2px 6px;
    border: var(--pp-border-light);
    white-space: nowrap;
}

.fruit-table tbody tr:nth-child(even) {
    background: var(--pp-bg-subheader);
}

.fruit-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-family: var(--pp-font-mono);
}

.fruit-table .lot-code {
    font-weight: 700;
    white-space: nowrap;
}

.fruit-table .muted {
    color: #9ca3af;
}

.fruit-table tfoot td {
    padding: 3px 6px;
    font-weight: 700;
    border: var(--pp-border-light);
    background: var(--pp-bg-subheader);
}

/* keep a fruit row intact across print page breaks */
.fruit-table tbody tr {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* ---- Weigh-tag write-in table (RECEIVE_FRUIT destination column) ----
   Blank ruled rows the cellar fills in as loads arrive, plus a total line. Inherits
   the rigid .fruit-table grid; only the write-in row height, column widths and the
   total row differ. Rows are taller than a data row because a person writes in them
   with a pen — same reasoning as .rf-write-in in the press panel. */
.receive-fruit-section .wt-table {
    margin-top: -1px; /* collapse against the rf-detail box's bottom border */
}

.receive-fruit-section .wt-table .wt-col-tag {
    width: 55%;
}

.receive-fruit-section .wt-table .wt-col-bins {
    width: 15%;
}

.receive-fruit-section .wt-table .wt-col-tons {
    width: 30%;
}

.receive-fruit-section .wt-table tbody td {
    height: 22px;
}

.receive-fruit-section .wt-table tbody tr:nth-child(even) {
    background: transparent; /* every row is blank — striping only adds noise */
}

/* Sum rule — without it the total row is visually identical to the blank rows above
   it and reads as just one more line to fill in. */
.receive-fruit-section .wt-table tfoot td {
    border-top: 2px solid #000;
}

.receive-fruit-section .wt-table .wt-total-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #166534;
    white-space: nowrap;
}

.receive-fruit-section .wt-table .wt-total-tons {
    height: 24px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #14532d;
}

/* .fruit-table tfoot td tints the whole footer; the two totals cells are written in
   by hand on an un-executed sheet, so they have to stay white. Specificity, not
   !important — this selector simply outranks the generic tfoot rule. */
.receive-fruit-section .wt-table tfoot td.write-in {
    background: var(--pp-bg-white);
}

/* Screen-only row controls. They ride in a trailing table column rather than a bar
   below the table: "+" in the header adds a row, "✕" on a row drops it — the same
   place a person looks for them. @media print drops the whole column (.no-print),
   so paper still gets exactly the three ruled columns. */
.receive-fruit-section .wt-table .wt-col-actions {
    width: 24px;
    padding: 0 2px;
    text-align: center;
    vertical-align: middle;
    border-color: transparent;
    background: transparent;
}

.receive-fruit-section .wt-table .wt-add-btn,
.receive-fruit-section .wt-table .wt-del-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 3px;
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.receive-fruit-section .wt-table .wt-add-btn {
    font-size: 15px;
    font-weight: 700;
    color: #64748b;
}

.receive-fruit-section .wt-table .wt-add-btn:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0284c7;
}

/* Sizing + chrome match .row-action-btn in movement-vessel-table.css so the two
   tables' row controls read as one vocabulary — but deliberately NOT its
   hover-to-reveal (Jeff, 2026-07-24). The movement table hides row actions behind
   hover because its rows carry real upstream data and the actions are secondary;
   here the row IS the affordance, and a control nobody hovers is a control nobody
   finds. Always visible. */
.receive-fruit-section .wt-table .wt-del-btn {
    font-size: 10px;
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #475569;
}

.receive-fruit-section .wt-table .wt-del-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* ---- Process-fruit fraction chip + instructions (inside the rf-detail panel) ---- */
.pf-fraction {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 3px;
    background: #ede9fe;
    color: #5b21b6;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

.pf-instructions {
    margin-top: 4px;
    padding: 4px 8px;
    border-left: 3px solid #7c3aed;
    background: #faf5ff;
    color: #4c1d95;
    font-size: 0.78rem;
}

/* ---- Action-level process steps (GASSING / FREE RUN PRESS / PRESS JUICE) ----
   Rendered once per section under the header, above the fill columns. No dark:
   variants by design — this sits inside #print-content ([data-force-light]).
   break-inside avoidance keeps a step off a page seam in the PDF. */
.pf-steps {
    margin: 6px 0 8px;
    padding: 6px 9px;
    border: 1px solid #ddd6fe;
    border-left: 3px solid #7c3aed;
    border-radius: 3px;
    background: #faf5ff;
    break-inside: avoid;
    page-break-inside: avoid;
}

.pf-steps-title {
    margin-bottom: 4px;
    color: #5b21b6;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pf-step {
    display: flex;
    gap: 7px;
    align-items: baseline;
    padding: 2px 0;
    break-inside: avoid;
    page-break-inside: avoid;
}

.pf-step + .pf-step {
    border-top: 1px dotted #ddd6fe;
}

.pf-step-name {
    flex: 0 0 auto;
    min-width: 8.5em;
    color: #5b21b6;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* The literal-space fallback in ProcessStepsBlock.razor. Hidden whenever this
   stylesheet loads — the flex gap above is doing the work then. It only ever
   renders when the CSS is missing, which is the case that produced
   "GASSINGNo gassing of presses…" in the PDF. */
.pf-step-sep {
    display: none;
}

.pf-step-text {
    flex: 1 1 auto;
    color: #3f3f46;
    font-size: 0.78rem;
}
