/* Cellar form table — combined single-table work-order print layout.
   Moved out of CellarFormTable.razor inline <style> (global file is the reliable home for
   print-composed components; scoped .razor.css does not reach them). Selectors are already
   .cf-* / .cellar-form-table namespaced, so no extra scoping is needed. Status colors use
   --pp-status-* tokens; the table renders inside the [data-force-light] sheet (zero change).
   NOTE: .cf-hint / .cf-write-in / .cf-dip-col are defined in movement-sections.css (shared
   write-in patterns) and intentionally NOT duplicated here. */

/* ============================================
   WRAPPER - sizes header/footer to table width
   ============================================ */
.cf-wrapper {
    width: max-content;
    min-width: 100%;
}

/* ============================================
   CELLAR FORM HEADER - Matches table borders
   ============================================ */
.cf-header {
    border: 1px solid #000;
    border-bottom: none;
    font-family: Arial, sans-serif;
    font-size: 12px;
}

.cf-header-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 8px 12px;
    gap: 12px;
}

.cf-header-left {
    min-width: 0;
}

.cf-header-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--pp-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-header-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 11px;
    color: var(--pp-text-secondary);
}

.cf-header-woid {
    font-weight: 600;
    font-family: monospace;
}

.cf-header-pubid {
    color: var(--pp-text-muted);
    font-family: monospace;
}

.cf-header-status {
    padding: 1px 6px;
    border: 1px solid #000;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.cf-header-sep {
    color: var(--pp-text-faint);
}

.cf-header-center {
    display: flex;
    justify-content: center;
}

.cf-header-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.cf-header-right {
    justify-self: end;
}

.cf-header-qr {
    width: 80px;
    height: 80px;
}

.cf-header-instructions {
    padding: 4px 12px;
    border-top: 1px solid #000;
    font-size: 11px;
    color: var(--pp-text-secondary);
    white-space: pre-line;
}

/* ============================================
   CELLAR FORM TABLE - Combined workorder table
   ============================================ */
.cellar-form-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 12px;
}

.cellar-form-table th {
    padding: 6px 4px;
    background: #fff;
    border: 1px solid #000;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    text-align: center;
    vertical-align: bottom;
    line-height: 1.2;
    white-space: nowrap;
}

.cellar-form-table td {
    padding: 4px 6px;
    border: 1px solid #000;
    vertical-align: top;
    height: 40px;
}

/* Column widths */
.cf-initials { width: 22px; font-size: 9px; }
.cf-tank { width: 60px; text-align: center; }
.cf-blend { width: 80px; }
.cf-group-header { text-align: center; border-bottom: none; }
.cf-vol { width: 70px; text-align: right; }
.cf-dip { width: 55px; text-align: right; }
.cf-moved { width: 80px; text-align: right; }
.cf-received { width: 70px; text-align: right; }
.cf-notes { width: auto; min-width: 150px; }

/* Destination separator - thick left border on column 8 */
.cf-dest-start {
    border-left: 2px solid #000 !important;
}

/* Monospace for numeric columns */
.cf-mono {
    font-family: monospace;
}

/* Ditto marks */
.cf-ditto {
    font-size: 14px;
    font-weight: 700;
    color: var(--pp-text-secondary);
    display: block;
    text-align: center;
}

/* Keyword highlighting */
.cf-highlight {
    color: red;
    font-weight: 700;
}

/* Notes column styling */
.cf-notes {
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-line;
}

/* Unsupported section notice */
.cf-unsupported-notice {
    margin-bottom: 8px;
    padding: 6px 12px;
    background: var(--pp-status-warning-bg);
    border: 1px solid #fcd34d;
    border-radius: 4px;
    font-size: 11px;
    color: var(--pp-status-warning-text);
}

.cf-notice-item + .cf-notice-item {
    margin-top: 2px;
}

/* ============================================
   FOOTER SECTION - Totals, temp, lab, dates
   ============================================ */
.cf-footer-section {
    margin-top: 0;
    font-family: Arial, sans-serif;
    font-size: 11px;
}

.cf-footer-section table {
    width: 100%;
    border-collapse: collapse;
}

.cf-ftr-row td {
    border: 1px solid #000;
    padding: 4px 6px;
    vertical-align: middle;
    white-space: nowrap;
}

.cf-ftr-label {
    font-weight: 700;
    text-transform: uppercase;
}

.cf-ftr-underline {
    text-decoration: underline;
}

.cf-ftr-fill-value {
    margin-left: 6px;
    font-weight: 400;
}

/* Write-in lines for manual entry */
.cf-ftr-fill-short {
    display: inline-block;
    width: 40px;
    border-bottom: 1px solid #000;
    margin: 0 2px;
    vertical-align: bottom;
    height: 14px;
}

.cf-ftr-fill-med {
    display: inline-block;
    width: 80px;
    border-bottom: 1px solid #000;
    margin-left: 4px;
    vertical-align: bottom;
    height: 14px;
}

.cf-ftr-fill-long {
    display: inline-block;
    width: 100px;
    border-bottom: 1px solid #000;
    margin-left: 4px;
    vertical-align: bottom;
    height: 14px;
}

/* Checkbox groups */
.cf-ftr-checkbox-group {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
    white-space: nowrap;
}

.cf-ftr-checkbox {
    display: inline-block;
    width: 11px;
    height: 11px;
    border: 1px solid #000;
    background: var(--pp-bg-white);
    margin-right: 2px;
    vertical-align: middle;
    flex-shrink: 0;
}

.cf-ftr-checkbox-label {
    font-size: 10px;
}

/* Temp row - tank labels */
.cf-ftr-temp-tank {
    font-weight: 700;
    font-size: 10px;
    margin-left: 10px;
    margin-right: 2px;
}

/* Lab placeholder */
.cf-ftr-placeholder {
    text-align: center;
    color: var(--pp-text-faint);
    font-style: italic;
    font-size: 10px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .cf-header {
        border: 1px solid #000 !important;
        page-break-inside: avoid;
    }

    .cf-header-logo {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .cellar-form-table th {
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .cf-highlight {
        color: red !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .cf-unsupported-notice {
        background: var(--pp-status-warning-bg) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
