/* ============================================================
   Bottling print section — cellar-facing MVP (landscape, two-col).
   Scoped under .bottling-section to avoid collisions.
   Uses --pp-* tokens defined in app.css.
   ============================================================ */

.bottling-section {
    background: var(--pp-bg-white);
    border: var(--pp-border-heavy);
    font-family: Arial, sans-serif;
    font-size: var(--pp-font-size-sm);
    page-break-inside: avoid;
}

/* Header bar — mirrors .movement-section .form-header */
.bottling-section .form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--pp-spacing-sm) var(--pp-spacing-lg);
    background: var(--pp-bg-header);
    border-bottom: var(--pp-border);
}

.bottling-section .job-label {
    display: flex;
    align-items: center;
    gap: var(--pp-spacing-sm);
    font-size: var(--pp-font-size-md);
}

.bottling-section .status-label {
    display: flex;
    align-items: center;
    gap: var(--pp-spacing-md);
    font-size: var(--pp-font-size-sm);
    color: var(--pp-text-secondary);
}

.bottling-section .status-text { white-space: nowrap; }

.bottling-section .section-indicator {
    font-size: var(--pp-font-size-xs);
    color: var(--pp-text-muted);
}

/* Type badge — amber, distinct from FILTER/TRANSFER */
.bottling-section .type-badge.bottling-badge {
    display: inline-block;
    padding: 2px var(--pp-spacing-sm);
    border-radius: var(--pp-radius-sm);
    font-size: var(--pp-font-size-xs);
    font-weight: 700;
    letter-spacing: 0.5px;
    background: #fef3c7;
    color: #78350f;
}

.bottling-section .same-lot-badge {
    margin-left: var(--pp-spacing-sm);
    padding: 1px var(--pp-spacing-sm);
    background: #ecfdf5;
    color: #065f46;
    border-radius: var(--pp-radius-sm);
    font-size: var(--pp-font-size-xs);
    font-weight: 600;
}

/* ---- Two-column landscape layout ---- */

.bottling-section .bottling-columns {
    display: flex;
    gap: 2px;
    background: #000;
}

.bottling-section .bottling-column {
    flex: 1;
    background: var(--pp-bg-white);
    min-width: 0; /* allow tables to shrink */
}

.bottling-section .column-header {
    padding: var(--pp-spacing-xs) var(--pp-spacing-md);
    font-size: var(--pp-font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bottling-section .drain-header {
    background: #fee2e2;
    color: #991b1b;
}

.bottling-section .fill-header {
    background: #dcfce7;
    color: #166534;
}

.bottling-section .bottling-empty {
    padding: var(--pp-spacing-md);
    color: var(--pp-text-muted);
    font-style: italic;
}

/* ---- Source column content ---- */

.bottling-section .bottling-drain-block {
    padding: var(--pp-spacing-md);
    border-bottom: var(--pp-border-light);
}

.bottling-section .bottling-drain-block:last-child {
    border-bottom: none;
}

.bottling-section .lot-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--pp-spacing-sm);
    margin-bottom: 2px;
    font-size: var(--pp-font-size-md);
}

.bottling-section .lot-header .highlight-yellow {
    background: #fff3a3;
    padding: 0 4px;
    font-weight: 700;
}

.bottling-section .lot-header .separator {
    color: var(--pp-text-muted);
}

.bottling-section .lot-volume {
    margin-bottom: var(--pp-spacing-sm);
    font-size: var(--pp-font-size-xs);
    color: var(--pp-text-muted);
}

.bottling-section .bottling-vessel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--pp-font-size-sm);
}

.bottling-section .bottling-vessel-table th,
.bottling-section .bottling-vessel-table td {
    padding: 4px 8px;
    border: 1px solid #ddd;
    text-align: left;
}

.bottling-section .bottling-vessel-table th {
    background: var(--pp-bg-header);
    font-weight: 600;
}

.bottling-section .bottling-vessel-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ---- Bottle column content ---- */

.bottling-section .bottle-format-card {
    padding: var(--pp-spacing-md);
    border-bottom: var(--pp-border-light);
    page-break-inside: avoid;
}

.bottling-section .bottle-format-card:last-child {
    border-bottom: none;
}

.bottling-section .bottle-format-hero {
    display: flex;
    align-items: baseline;
    gap: var(--pp-spacing-sm);
    margin-bottom: var(--pp-spacing-sm);
    padding-bottom: var(--pp-spacing-xs, 4px);
    border-bottom: var(--pp-border-light);
}

.bottling-section .bottle-format-size {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
}

.bottling-section .bottle-format-type {
    font-size: var(--pp-font-size-xs);
    color: var(--pp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bottling-section .bottle-format-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--pp-font-size-sm);
}

.bottling-section .bottle-format-table th,
.bottling-section .bottle-format-table td {
    padding: 4px 8px;
    border: 1px solid #ddd;
    text-align: left;
}

.bottling-section .bottle-format-table th {
    font-weight: 600;
    color: var(--pp-text-muted);
    background: #fafafa;
    width: 26%;
}

.bottling-section .bottle-format-table td.big {
    font-size: var(--pp-font-size-md);
    font-weight: 700;
}

/* ---- Print ---- */

@media print {
    .bottling-section {
        border: 3px solid #000 !important;
    }

    .bottling-section .form-header {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .bottling-section .type-badge.bottling-badge,
    .bottling-section .same-lot-badge,
    .bottling-section .drain-header,
    .bottling-section .fill-header,
    .bottling-section .bottling-vessel-table th,
    .bottling-section .bottle-format-table th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .bottling-section .bottle-format-card {
        break-inside: avoid;
    }
}

/* ---- Dark mode ---- */

@media (prefers-color-scheme: dark) {
    .bottling-section .bottling-vessel-table th,
    .bottling-section .bottle-format-table th { background: #1f2937; color: #d1d5db; }
    .bottling-section .bottling-vessel-table th,
    .bottling-section .bottling-vessel-table td,
    .bottling-section .bottle-format-table th,
    .bottling-section .bottle-format-table td { border-color: #374151; }
}
