/*
 * The job page's Customer & Paperwork tab (approved on public/mockups/customer-paperwork-tab.html, 2026-11-07):
 * Customer Information, Estimates, Invoices, Documents and Forms in one tab. Jump tiles across the top, the customer
 * pinned on the left, the paperwork down the right. Same tokens and dark-theme glow as the Overview and Workflow tabs.
 * Markup: templates/jobs/job/_paperwork_tab.html.twig. Loaded after redesign.css (theme.yaml).
 * Every class here carries the tab's pk- prefix, so nothing else on the site picks these styles up.
 */

/* Section colours: one per part of the tab, shared by its tile and its heading icon. */
.pk-tone-customer { --pk-tone: #0ea5e9; }
.pk-tone-estimates { --pk-tone: #8b5cf6; }
.pk-tone-invoices { --pk-tone: #ec4899; }
.pk-tone-documents { --pk-tone: #f59e0b; }
.pk-tone-forms { --pk-tone: #10b981; }

/* Section icon */
.pk-icon {
    width: 1.9rem; height: 1.9rem; border-radius: 9px; flex: none;
    display: inline-grid; place-items: center;
    color: var(--pk-tone); background: color-mix(in srgb, var(--pk-tone) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--pk-tone) 55%, transparent);
}
.pk-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shell #pane-paperwork .section-heading:has(> .pk-icon) { display: flex; align-items: center; gap: 0.55rem; }
[data-bs-theme="dark"] .pk-icon { color: color-mix(in srgb, var(--pk-tone) 80%, #fff); background: #000; border-color: var(--pk-tone); box-shadow: 0 0 12px -2px var(--pk-tone), inset 0 0 8px -3px var(--pk-tone); }
[data-bs-theme="dark"] .pk-icon svg { filter: drop-shadow(0 0 3px var(--pk-tone)); }

/* Jump tiles: every section of the tab at a glance, and a link to it */
.shell .pk-jump { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
.shell .pk-jump__tile {
    display: flex; align-items: center; gap: 0.75rem; min-width: 0;
    padding: 0.75rem 0.95rem; border-radius: 14px;
    background: var(--bs-paper); border: 1px solid var(--bs-line);
    color: var(--bs-text); text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.shell .pk-jump__tile:hover, .shell .pk-jump__tile:focus-visible { border-color: var(--pk-tone); color: var(--bs-text); }
.shell .pk-jump__tile .pk-icon { width: 2.4rem; height: 2.4rem; border-radius: 11px; }
.shell .pk-jump__tile .pk-icon svg { width: 20px; height: 20px; }
.shell .pk-jump__title { display: block; font-size: 0.95rem; font-weight: 800; line-height: 1.15; }
.shell .pk-jump__sub { display: block; font-size: 0.78rem; color: var(--bs-muted); margin-top: 0.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-bs-theme="dark"] .shell .pk-jump__tile { background: #000; }
[data-bs-theme="dark"] .shell .pk-jump__tile:hover { box-shadow: 0 0 16px -6px var(--pk-tone); }
@media (max-width: 900px) {
    .shell .pk-jump { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
}

/* Two columns: the customer (who) on the left, the paperwork (what) on the right */
.shell .pk-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 1rem; align-items: start; }
.shell .pk-grid--no-side { grid-template-columns: minmax(0, 1fr); }
.shell .pk-side, .shell .pk-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
/* Sticky, but never taller than the screen: with the Receiving card above it, the customer column can be longer than
   a laptop's viewport, so it scrolls on its own (as the customer record's rail does, redesign.css .crec-rail). */
.shell .pk-side { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; scrollbar-width: thin; }
@media (max-width: 1100px) {
    .shell .pk-grid { grid-template-columns: minmax(0, 1fr); }
    .shell .pk-side { position: static; }
}

/* Sections: the moved panels keep their own markup; here they only lose the old full-tab spacing. */
.shell .pk-section { display: flex; flex-direction: column; gap: 1rem; min-width: 0; scroll-margin-top: 1rem; }
/* Up to 860px the app bar is fixed across the top (app.css .appbar): a section jumped to stops below it. */
@media (max-width: 860px) {
    .shell .pk-section { scroll-margin-top: calc(56px + var(--sandbox-banner-height) + 1rem); }
}
.shell .pk-section > .panel,
.shell .pk-section > .form-card { margin: 0 !important; max-width: none; }
.shell .pk-section .form-card--full { max-width: none; }
/* The customer column is narrow: its detail grid and message buttons stack to one column. */
.shell .pk-side .detail-grid { grid-template-columns: minmax(0, 1fr); }

/* Customer details: each one has a small tinted icon to the left of its label and value (a phone by the phone
   number, the WhatsApp bubble by the WhatsApp number, and so on). The icon sits in the <dt>, positioned into
   the row's left gutter, so the list stays valid dt/dd markup. Glyphs: _partials/_cx_icon, jobs/job/_icon,
   reference/customer/_contact_icon. */
.pk-field { --pk-field-tone: #64748b; position: relative; padding-inline-start: 2.4rem; min-height: 1.85rem; }
.pk-field--email { --pk-field-tone: #6366f1; }
.pk-field--phone { --pk-field-tone: #0ea5e9; }
.pk-field--whatsapp { --pk-field-tone: #22c55e; }
.pk-field--address-main { --pk-field-tone: #10b981; }
.pk-field--address-billing { --pk-field-tone: #f59e0b; }
.pk-field--address-delivery { --pk-field-tone: #3b82f6; }
.pk-field--notes { --pk-field-tone: #8b5cf6; }
.pk-field__ico {
    position: absolute; inset-inline-start: 0; top: 0.1rem;
    width: 1.8rem; height: 1.8rem; border-radius: 8px;
    display: grid; place-items: center;
    color: var(--pk-field-tone); background: color-mix(in srgb, var(--pk-field-tone) 13%, transparent);
}
.pk-field__ico svg { width: 15px; height: 15px; }
[data-bs-theme="dark"] .pk-field__ico { color: color-mix(in srgb, var(--pk-field-tone) 80%, #fff); background: #000; border: 1px solid color-mix(in srgb, var(--pk-field-tone) 70%, transparent); box-shadow: 0 0 10px -3px var(--pk-field-tone); }
