/* =============================================================================
   cockpit.css — Sprint 12A PR #2 / Cockpit primitives extract.
   ADR-018 §D3 — first-class Cockpit primitives.

   Source: extracted verbatim from the inline <style> block in
   Pages/Receiving/Index.cshtml (the legacy /Receiving/Cockpit-Legacy page),
   which was the proven UX pattern Dean walked through against the four-quadrant
   scaffold on 2026-05-18 and chose as the daily-driver canvas.

   This file is loaded globally via _ModernLayout.cshtml. The .cockpit__*
   selectors are namespaced to avoid clashes with other shells. Subsequent
   v1 Control Centers (Sprints 13-18) compose these primitives with their own
   queue + preview adapters per ADR-018 §D3.

   Zero visual change from the legacy page is the explicit guarantee of this
   extraction. If a future PR tweaks the look, do it deliberately + update ADR-018.
   ============================================================================= */

.cockpit {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1rem;
    height: calc(100vh - 280px);
    min-height: 500px;
}

.cockpit__queue {
    background: var(--surface-card, rgba(255,255,255,0.03));
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cockpit__queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}

.cockpit__queue-title {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-primary); margin: 0; display: flex; align-items: center; gap: 0.5rem;
}
.cockpit__queue-title i { color: var(--cherry-red, #cf3339); font-size: 0.8rem; }

.cockpit__queue-count {
    font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
    background: var(--surface-hover, rgba(255,255,255,0.05));
    padding: 0.15rem 0.5rem; border-radius: 20px;
}

.cockpit__search { position: relative; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06)); }
.cockpit__search-icon { position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.75rem; }
.cockpit__search-input {
    width: 100%; padding: 0.45rem 0.75rem 0.45rem 2rem; font-size: 0.85rem;
    background: var(--surface-input, rgba(255,255,255,0.05)); border: 1px solid var(--border-default, rgba(255,255,255,0.1));
    border-radius: 6px; color: var(--text-primary); outline: none;
}
.cockpit__search-input:focus { border-color: var(--cherry-red, #cf3339); box-shadow: 0 0 0 2px rgba(207, 51, 57, 0.15); }

.cockpit__queue-list { flex: 1; overflow-y: auto; padding: 0.5rem; }
.cockpit__group { margin-bottom: 0.25rem; }

.cockpit__group-label {
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted); padding: 0.4rem 0.5rem; display: flex; align-items: center; gap: 0.4rem;
}
.cockpit__group-label--danger { color: var(--status-danger, #ef4444); }
.cockpit__group-label--warning { color: var(--warning, #f59e0b); }
.cockpit__group-label--info { color: var(--info, #3b82f6); }

.cockpit__card {
    padding: 0.6rem 0.75rem; margin-bottom: 0.3rem; border-radius: 8px; cursor: pointer;
    border: 1px solid transparent; transition: all 0.15s;
}
.cockpit__card:hover { background: var(--surface-hover, rgba(255,255,255,0.04)); border-color: var(--border-default, rgba(255,255,255,0.1)); }
.cockpit__card--active { background: var(--cherry-red, #cf3339) !important; border-color: var(--cherry-red, #cf3339) !important; }
.cockpit__card--active * { color: #fff !important; }
.cockpit__card--overdue { border-left: 3px solid var(--status-danger, #ef4444); }
.cockpit__card-row { display: flex; justify-content: space-between; align-items: center; }
.cockpit__card-po { font-weight: 700; font-size: 0.85rem; color: var(--text-primary); }
.cockpit__card-vendor { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.15rem; }
.cockpit__card-meta { display: flex; gap: 0.75rem; margin-top: 0.25rem; font-size: 0.7rem; }
.cockpit__card-meta span { color: var(--text-muted); }
.cockpit__card-meta strong { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }

.cockpit__empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 1rem; color: var(--text-muted); font-size: 0.85rem; text-align: center; }

.cockpit__main {
    background: var(--surface-card, rgba(255,255,255,0.03)); border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-radius: 10px; overflow: hidden; display: flex; flex-direction: column;
}

.cockpit__welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; padding: 3rem; text-align: center; }
.cockpit__welcome-icon { font-size: 3rem; color: var(--text-muted); margin-bottom: 1rem; opacity: 0.4; }
.cockpit__welcome-title { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin: 0 0 0.5rem; }
.cockpit__welcome-sub { font-size: 0.85rem; color: var(--text-muted); max-width: 400px; margin: 0 0 2rem; }
.cockpit__welcome-stats { display: flex; gap: 2rem; }
.cockpit__stat { display: flex; flex-direction: column; align-items: center; }
.cockpit__stat-value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cockpit__stat-label { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-top: 0.2rem; }

.cockpit__preview-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}
.cockpit__preview-po { font-weight: 700; font-size: 1.1rem; color: var(--text-primary); }
.cockpit__preview-status {
    font-size: 0.6rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 10px; text-transform: uppercase;
}

.cockpit__preview-info {
    display: flex; gap: 1.5rem; padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    flex-wrap: wrap;
}
.cockpit__preview-field { display: flex; flex-direction: column; }
.cockpit__preview-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.1rem; }
.cockpit__preview-value { font-size: 0.85rem; color: var(--text-primary); font-weight: 500; }
.cockpit__preview-value--mono { font-variant-numeric: tabular-nums; font-weight: 700; }

.cockpit__preview-lines { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.cockpit__preview-lines-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 1.25rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-primary);
}
.cockpit__preview-lines-header i { color: var(--cherry-red, #cf3339); margin-right: 0.4rem; }
.cockpit__preview-table-wrap { flex: 1; overflow-y: auto; }

html:not(.dark) .cockpit__queue,
html:not(.dark) .cockpit__main { background: #fff; border-color: #e2e8f0; }
html:not(.dark) .cockpit__card:hover { background: #f8fafc; }
html:not(.dark) .cockpit__search-input { background: #fff; border-color: #e2e8f0; }

/* =============================================================================
   Cockpit Tab Shell — Sprint 12A PR #4 / ADR-018 §D2.
   Tab bar that sits between the page _ScreenHeader and the per-tab canvas.
   Subtle, Linear-grade — the underline + tone-colored badge does the work.
   ============================================================================= */

.cockpit-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
    margin: 0 0 1rem;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.cockpit-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted, #71717a);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.cockpit-tab:hover {
    color: var(--text-primary, #f1f5f9);
    background: var(--surface-hover, rgba(255,255,255,0.03));
}

.cockpit-tab:focus-visible {
    outline: 2px solid var(--brand-fg, #0ea5e9);
    outline-offset: -2px;
    background: var(--brand-soft, rgba(14,165,233,0.08));
}

.cockpit-tab--active {
    color: var(--text-primary, #f1f5f9);
    border-bottom-color: var(--cherry-red, #cf3339);
    font-weight: 600;
}
.cockpit-tab--active:hover {
    background: transparent;
}

.cockpit-tab__icon {
    font-size: 0.78rem;
    opacity: 0.85;
}
.cockpit-tab--active .cockpit-tab__icon {
    color: var(--cherry-red, #cf3339);
    opacity: 1;
}

.cockpit-tab__label {
    line-height: 1;
}

.cockpit-tab__badge {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
    background: var(--surface-card, rgba(255,255,255,0.06));
    color: var(--text-muted, #a1a1aa);
}
.cockpit-tab__badge--danger {
    background: rgba(239,68,68,0.18);
    color: var(--status-danger, #ef4444);
}
.cockpit-tab__badge--warning {
    background: rgba(245,158,11,0.18);
    color: var(--warning, #f59e0b);
}
.cockpit-tab__badge--info {
    background: rgba(59,130,246,0.18);
    color: var(--info, #3b82f6);
}

/* Per-tab placeholder body shown by tabs that haven't shipped real content yet.
   Lands in PR #5/#6/#7 — these styles wrap the "Coming in PR #N" stubs. */
.cockpit-tab-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted, #71717a);
    background: var(--surface-card, rgba(255,255,255,0.03));
    border: 1px dashed var(--border-subtle, rgba(255,255,255,0.08));
    border-radius: 10px;
    min-height: 360px;
}
.cockpit-tab-placeholder__icon {
    font-size: 2.5rem;
    opacity: 0.35;
    margin-bottom: 1rem;
    color: var(--cherry-red, #cf3339);
}
.cockpit-tab-placeholder__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
    margin: 0 0 0.4rem;
}
.cockpit-tab-placeholder__sub {
    font-size: 0.875rem;
    max-width: 460px;
    line-height: 1.5;
}
.cockpit-tab-placeholder__chip {
    display: inline-block;
    margin-top: 1.2rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: var(--brand-soft, rgba(207,51,57,0.12));
    color: var(--cherry-red, #cf3339);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

html:not(.dark) .cockpit-tab__badge {
    background: #f1f5f9;
    color: #64748b;
}
html:not(.dark) .cockpit-tab-placeholder {
    background: #fff;
    border-color: #e2e8f0;
}

/* =============================================================================
   Sprint 12A PR #5.1 — Cockpit KPI band (ADR-018 §D3, third leg).
   The persistent KPI strip above the tab bar. Always visible across every tab.
   Luxury treatment: dark gradient tiles, tone top-accent, large tabular value,
   tracked uppercase label, inline 7-day sparkline, hover lift+glow.
   ============================================================================= */

.cockpit-kpi-band {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}

.cockpit-kpi-band__header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 0.25rem 0.6rem 0.25rem;
}
.cockpit-kpi-band__eyebrow {
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em;
    color: var(--text-muted); text-transform: uppercase;
}
.cockpit-kpi-band__status {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.cockpit-kpi-band__live {
    display: inline-flex; align-items: center; gap: 0.35rem;
    color: var(--success, #10b981); font-weight: 700;
}
.cockpit-kpi-band__live-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--success, #10b981);
    box-shadow: 0 0 0 0 rgba(16,185,129,0.6);
    animation: cockpit-pulse-live 2.4s ease-out infinite;
}
@keyframes cockpit-pulse-live {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(16,185,129,0);   }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0);     }
}
.cockpit-kpi-band__refresh {
    color: var(--text-muted); font-weight: 600;
}

.cockpit-kpi-band__tiles {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.6rem;
}

/* responsive — collapse to 4 columns on narrow viewports, then 2 */
@media (max-width: 1280px) {
    .cockpit-kpi-band__tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .cockpit-kpi-band__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cockpit-kpi-tile {
    position: relative;
    display: flex; flex-direction: column;
    padding: 0.85rem 0.95rem 0.7rem 0.95rem;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%),
        var(--surface-card, rgba(255,255,255,0.025));
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-radius: 10px;
    overflow: hidden;
    color: inherit; text-decoration: none;
    text-align: left;
    font-family: inherit;
    cursor: default;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
button.cockpit-kpi-tile {
    appearance: none; -webkit-appearance: none;
    background-color: transparent;
}

/* tone top-accent (3px stripe along the top edge) */
.cockpit-kpi-tile::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--cockpit-kpi-tone, transparent);
    opacity: 0.85;
}

.cockpit-kpi-tile--danger   { --cockpit-kpi-tone: var(--status-danger, #ef4444); --cockpit-kpi-value: var(--status-danger, #ef4444); }
.cockpit-kpi-tile--warning  { --cockpit-kpi-tone: var(--warning, #f59e0b); --cockpit-kpi-value: var(--warning, #f59e0b); }
.cockpit-kpi-tile--info     { --cockpit-kpi-tone: var(--info, #3b82f6); --cockpit-kpi-value: var(--info, #3b82f6); }
.cockpit-kpi-tile--success  { --cockpit-kpi-tone: var(--success, #10b981); --cockpit-kpi-value: var(--success, #10b981); }
.cockpit-kpi-tile--brand    { --cockpit-kpi-tone: var(--cherry-red, #cf3339); --cockpit-kpi-value: var(--cherry-red, #cf3339); }
.cockpit-kpi-tile--neutral  { --cockpit-kpi-tone: rgba(255,255,255,0.15); --cockpit-kpi-value: var(--text-primary); }

.cockpit-kpi-tile--clickable { cursor: pointer; }
.cockpit-kpi-tile--clickable:hover {
    transform: translateY(-1px);
    border-color: var(--cockpit-kpi-tone, var(--border-default, rgba(255,255,255,0.18)));
    box-shadow: 0 6px 18px -10px rgba(0,0,0,0.7), 0 0 0 1px var(--cockpit-kpi-tone, transparent) inset;
}
.cockpit-kpi-tile--clickable:focus-visible {
    outline: 2px solid var(--cockpit-kpi-tone, var(--cherry-red, #cf3339));
    outline-offset: 2px;
}

.cockpit-kpi-tile__label {
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 0.4rem;
    line-height: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cockpit-kpi-tile__value-row {
    display: flex; align-items: baseline; gap: 0.25rem;
    line-height: 1;
}
.cockpit-kpi-tile__value {
    font-size: 1.85rem; font-weight: 700;
    color: var(--cockpit-kpi-value, var(--text-primary));
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.cockpit-kpi-tile__unit {
    font-size: 0.7rem; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.cockpit-kpi-tile__target {
    margin-top: 0.2rem;
    font-size: 0.6rem; color: var(--text-muted);
    letter-spacing: 0.04em;
}
.cockpit-kpi-tile__spark {
    width: 100%; height: 22px; margin-top: 0.4rem;
    color: var(--cockpit-kpi-tone, var(--text-muted));
    opacity: 0.78;
}

/* The drill-scroll pulse applied to .cockpit__group on workload-tile click. */
.cockpit__group--drill-pulse {
    animation: cockpit-drill-pulse 700ms ease-out 1;
}
@keyframes cockpit-drill-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(207,51,57,0.55); border-radius: 8px; }
    100% { box-shadow: 0 0 0 14px rgba(207,51,57,0); border-radius: 8px; }
}

/* =============================================================================
   Sprint 12A PR #5.1 — Tab bar polish.
   Heavier weight, more vertical padding, cherry-red 2px underline on active.
   Only applies to the cockpit-tabs primitive (not nav tabs elsewhere).
   ============================================================================= */

.cockpit-tabs {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    padding: 0 0.25rem;
    gap: 0.25rem;
}
.cockpit-tab {
    padding: 0.7rem 1.1rem !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}
.cockpit-tab:hover {
    color: var(--text-primary);
}
.cockpit-tab--active {
    color: var(--text-primary) !important;
    border-bottom-color: var(--cherry-red, #cf3339);
    font-weight: 700 !important;
}
.cockpit-tab__icon {
    font-size: 0.85rem;
    margin-right: 0.45rem;
}

/* =============================================================================
   Sprint 12A PR #5.1 — Sidebar auto-collapse on Control Center pages.
   When body has .is-control-center, the sidebar defaults to its collapsed
   icon-rail state (cockpit.js applies sidebar.classList.add('collapsed') on
   init unless the user has explicitly expanded). This reclaims ~170px of
   horizontal real estate for the workspace canvas.
   ============================================================================= */

body.is-control-center .app-container {
    /* No structural change — sidebar-nav.js handles collapsing the sidebar
       element. This rule exists so future Control Center surfaces have a
       stable hook for any layout tweaks specific to CC pages. */
}

/* =============================================================================
   Sprint 12A PR #5.2 — Cockpit page header (anchored title bar).
   Replaces the in-band eyebrow text. Renders ABOVE the KPI band.
   ============================================================================= */

.cockpit-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0 0.25rem 1rem 0.25rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}
.cockpit-page-header__title-block { flex: 1; min-width: 0; }
.cockpit-page-header__title-row { display: flex; align-items: baseline; gap: 0.6rem; }
.cockpit-page-header__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.cockpit-page-header__divider { color: var(--text-muted); font-size: 1rem; opacity: 0.5; }
.cockpit-page-header__scope { font-size: 0.95rem; color: var(--text-secondary); font-weight: 500; }
.cockpit-page-header__subtitle {
    margin: 0.2rem 0 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.cockpit-page-header__actions {
    display: flex; align-items: center; gap: 1rem;
    font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.cockpit-page-header__live {
    display: inline-flex; align-items: center; gap: 0.4rem;
    color: var(--success, #10b981); font-weight: 700;
}
.cockpit-page-header__live-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--success, #10b981);
    box-shadow: 0 0 0 0 rgba(16,185,129,0.55);
    animation: cockpit-pulse-live 2.4s ease-out infinite;
}
.cockpit-page-header__refresh { color: var(--text-muted); font-weight: 600; }
.cockpit-page-header__voice {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: var(--cherry-red, #cf3339);
    color: #fff;
    border: 0;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
}
.cockpit-page-header__voice i { font-size: 0.85rem; }
.cockpit-page-header__voice:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cockpit-page-header__voice:active { transform: translateY(0); }

/* =============================================================================
   Sprint 12A PR #5.2 — KPI band hero refinement.
   With page header above, the band itself becomes a stripe of hero tiles.
   Bigger values (2.05rem), more breathing room, sub-text under each value.
   Used in HERO mode (4 tiles, configured by the page).
   ============================================================================= */

.cockpit-kpi-band--hero .cockpit-kpi-band__header { padding-bottom: 0.4rem; }
.cockpit-kpi-band--hero .cockpit-kpi-band__tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.85rem; }
.cockpit-kpi-band--hero .cockpit-kpi-tile { padding: 1rem 1.1rem 0.9rem 1.1rem; }
.cockpit-kpi-band--hero .cockpit-kpi-tile__label { font-size: 0.6rem; letter-spacing: 0.12em; margin-bottom: 0.55rem; }
.cockpit-kpi-band--hero .cockpit-kpi-tile__value { font-size: 2.05rem; }
.cockpit-kpi-band--hero .cockpit-kpi-tile__spark { height: 26px; margin-top: 0.55rem; }

@media (max-width: 980px) {
    .cockpit-kpi-band--hero .cockpit-kpi-band__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cockpit-kpi-tile__subtext {
    margin-top: 0.3rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    line-height: 1.3;
    min-height: 0.95rem;
}

/* =============================================================================
   Sprint 12A PR #5.2 — Next Up priority preview pane.
   ============================================================================= */

.cockpit-next-up {
    background: var(--surface-card, rgba(255,255,255,0.025));
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-radius: 10px;
    overflow: hidden;
    display: flex; flex-direction: column;
}

.cockpit-next-up__header {
    padding: 1rem 1.15rem 0.9rem 1.15rem;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    background: linear-gradient(180deg, rgba(207,51,57,0.04), transparent 80%);
    position: relative;
}
.cockpit-next-up__header::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: var(--cockpit-next-tone, rgba(255,255,255,0.1));
}
.cockpit-next-up--danger  .cockpit-next-up__header { --cockpit-next-tone: var(--status-danger, #ef4444); background: linear-gradient(180deg, rgba(239,68,68,0.06), transparent 80%); }
.cockpit-next-up--warning .cockpit-next-up__header { --cockpit-next-tone: var(--warning, #f59e0b); background: linear-gradient(180deg, rgba(245,158,11,0.04), transparent 80%); }
.cockpit-next-up--neutral .cockpit-next-up__header { --cockpit-next-tone: var(--cherry-red, #cf3339); }

.cockpit-next-up__priority-row {
    display: flex; align-items: center; gap: 0.65rem;
    margin-bottom: 0.55rem;
}
.cockpit-next-up__priority-chip {
    padding: 2px 8px;
    background: var(--cherry-red, #cf3339);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    border-radius: 3px;
}
.cockpit-next-up__urgency {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--status-danger, #ef4444);
}
.cockpit-next-up__urgency--neutral { color: var(--text-muted); }

.cockpit-next-up__title-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
    margin-bottom: 0.7rem;
}
.cockpit-next-up__title-block { min-width: 0; flex: 1; }
.cockpit-next-up__po-row { display: flex; align-items: center; gap: 0.5rem; }
.cockpit-next-up__po {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.cockpit-next-up__status { font-size: 0.55rem; }

.cockpit-next-up__vendor-row {
    margin-top: 0.25rem;
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}
.cockpit-next-up__vendor { font-weight: 600; text-transform: uppercase; color: var(--text-primary); }
.cockpit-next-up__dot { color: var(--text-muted); }
.cockpit-next-up__meta { color: var(--text-muted); }
.cockpit-next-up__meta--value { color: var(--text-primary); font-variant-numeric: tabular-nums; font-weight: 600; }

.cockpit-next-up__actions {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.cockpit-next-up__action {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.15s, transform 0.15s, border-color 0.15s, background 0.15s;
    border: 0;
}
.cockpit-next-up__action i { font-size: 0.85rem; }
.cockpit-next-up__action--primary {
    background: var(--cherry-red, #cf3339);
    color: #fff;
}
.cockpit-next-up__action--primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cockpit-next-up__action--secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-default, rgba(255,255,255,0.15));
}
.cockpit-next-up__action--secondary:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.cockpit-next-up__action--ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
}
.cockpit-next-up__action--ghost:hover { color: var(--text-secondary); }

.cockpit-next-up__meta-row {
    display: flex; flex-wrap: wrap; gap: 1.25rem;
    margin-top: 0.5rem;
    padding-top: 0.55rem;
    border-top: 1px dashed var(--border-subtle, rgba(255,255,255,0.05));
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.cockpit-next-up__meta-label { color: var(--text-muted); margin-right: 0.35rem; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.6rem; }

.cockpit-next-up__lines { padding: 0.95rem 1.15rem 0.6rem 1.15rem; flex: 1; min-height: 0; overflow: auto; }
.cockpit-next-up__lines-header {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.6rem; letter-spacing: 0.12em; color: var(--text-muted);
    margin-bottom: 0.45rem;
}
.cockpit-next-up__lines-count { font-weight: 700; color: var(--text-secondary); letter-spacing: 0.04em; text-transform: none; font-size: 0.7rem; }
.cockpit-next-up__lines-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.cockpit-next-up__th {
    text-align: left;
    padding: 0.4rem 0.5rem 0.4rem 0;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}
.cockpit-next-up__th--right { text-align: right; }
.cockpit-next-up__th--part { width: 110px; }
.cockpit-next-up__row { border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.04)); }
.cockpit-next-up__row:last-child { border-bottom: 0; }
.cockpit-next-up__td { padding: 0.5rem 0.5rem 0.5rem 0; color: var(--text-secondary); }
.cockpit-next-up__td--part { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace); color: var(--text-primary); font-weight: 500; }
.cockpit-next-up__td--desc { color: var(--text-primary); }
.cockpit-next-up__td--right { text-align: right; font-variant-numeric: tabular-nums; }
.cockpit-next-up__td--mono { font-variant-numeric: tabular-nums; color: var(--text-primary); font-weight: 600; }
.cockpit-next-up__td--more { color: var(--text-muted); font-style: italic; padding: 0.5rem 0; }

.cockpit-next-up__footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.55rem 1.15rem;
    border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    font-size: 0.7rem;
    background: rgba(255,255,255,0.012);
}
.cockpit-next-up__up-next-label { color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.58rem; margin-right: 0.35rem; }
.cockpit-next-up__up-next-link { color: var(--text-secondary); text-decoration: none; }
.cockpit-next-up__up-next-link:hover { color: var(--text-primary); }
.cockpit-next-up__up-next-empty { color: var(--text-muted); }
.cockpit-next-up__keys { color: var(--text-muted); font-size: 0.6rem; letter-spacing: 0.05em; }
.cockpit-next-up__keys kbd {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 3px;
    padding: 0px 4px;
    font-size: 0.58rem;
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    color: var(--text-secondary);
    margin: 0 1px;
}

.cockpit-next-up--empty .cockpit-next-up__empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 3.5rem 1.5rem; text-align: center;
}
.cockpit-next-up__empty-icon { font-size: 2.4rem; color: var(--success, #10b981); margin-bottom: 0.8rem; opacity: 0.7; }
.cockpit-next-up__empty-title { margin: 0 0 0.3rem; font-size: 1.05rem; font-weight: 600; color: var(--text-primary); }
.cockpit-next-up__empty-sub { margin: 0; font-size: 0.78rem; color: var(--text-muted); max-width: 320px; line-height: 1.5; }

/* =============================================================================
   Sprint 12A PR #5.2 — AI Suggestions strip.
   ============================================================================= */

.cockpit-ai-strip {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, rgba(124,77,255,0.07), rgba(124,77,255,0.02));
    border: 1px solid rgba(124,77,255,0.22);
    border-radius: 10px;
}
.cockpit-ai-strip__header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.55rem; }
.cockpit-ai-strip__sparkle { color: #b39dff; font-size: 0.85rem; }
.cockpit-ai-strip__label { font-size: 0.62rem; letter-spacing: 0.14em; color: #b39dff; font-weight: 700; text-transform: uppercase; }
.cockpit-ai-strip__items { display: grid; gap: 0.35rem; }
.cockpit-ai-strip__item {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.4rem 0.2rem;
    font-size: 0.82rem;
    color: var(--text-primary);
}
.cockpit-ai-strip__item-icon { color: #b39dff; font-size: 0.85rem; width: 1rem; text-align: center; opacity: 0.85; }
.cockpit-ai-strip__item-text { flex: 1; }
.cockpit-ai-strip__item-action {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.7rem;
    background: transparent;
    color: #b39dff;
    border: 1px solid rgba(124,77,255,0.45);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cockpit-ai-strip__item-action:hover { background: rgba(124,77,255,0.12); border-color: #b39dff; color: #fff; }

/* =============================================================================
   Sprint 12A PR #5.2 — Queue card polish (pill + days-overdue urgency line).
   ============================================================================= */

.cockpit__card-pill {
    font-size: 0.55rem;
    text-transform: none !important;
    letter-spacing: 0.04em !important;
    padding: 2px 7px !important;
    border-radius: 4px !important;
}
.cockpit__card-meta--urgency {
    color: var(--status-danger, #ef4444) !important;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.cockpit__card-meta--urgency strong { color: var(--status-danger, #ef4444); }

/* Active card gets a thicker cherry left-border so it pops as "selected". */
.cockpit__card.cockpit__card--active {
    background: var(--cherry-red, #cf3339) !important;
    border-color: var(--cherry-red, #cf3339) !important;
}
.cockpit__card.cockpit__card--active.cockpit__card--overdue {
    border-left: 4px solid #fff !important;
}

/* The legacy welcome 4-stat strip is removed in PR #5.2 (data lives in the
   KPI band now). Hide the wrapper so any stragglers from older renders don't
   show through during a stale-cache moment. */
.cockpit__main #mainWelcome .cockpit__welcome-stats { display: none; }

/* =============================================================================
   Sprint 12A PR #7 — Orphan preview surfaces.
   - cockpit__preview-notes  : "Receiving notes" block above the candidate list.
   - cockpit__candidates*    : AI-suggested candidate-PO cards.

   The orphan preview is intentionally lighter than PO/ASN previews — no
   manifest table, just receipt facts + notes + 0-3 ranked candidates. Each
   candidate gets a per-signal reason chip strip + a 1-click Match CTA.
   ============================================================================= */

.cockpit__preview-notes {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    margin-top: 0.75rem;
}
.cockpit__preview-notes-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.55);
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.cockpit__preview-notes-body {
    color: var(--text-primary, #fff);
    font-size: 0.875rem;
    line-height: 1.5;
}

.cockpit__candidates {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
}
.cockpit__candidates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--text-primary, #fff);
    font-size: 0.875rem;
}
.cockpit__candidates-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.cockpit__candidates-empty {
    background: rgba(255,255,255,0.02);
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    color: rgba(255,255,255,0.55);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}
.cockpit__candidates-empty i { font-size: 1.5rem; color: rgba(255,255,255,0.4); }
.cockpit__candidates-empty-sub { color: rgba(255,255,255,0.45); font-size: 0.8rem; display:block; margin-top: 0.1rem; }

.cockpit__candidate {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 120ms ease, background 120ms ease;
}
.cockpit__candidate:hover {
    border-color: rgba(207, 51, 57, 0.45);
    background: rgba(207, 51, 57, 0.04);
}
.cockpit__candidate-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}
.cockpit__candidate-titleblock { display: flex; flex-direction: column; gap: 0.2rem; }
.cockpit__candidate-best {
    align-self: flex-start;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffd166;
    background: rgba(255, 209, 102, 0.12);
    border: 1px solid rgba(255, 209, 102, 0.3);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.25rem;
}
.cockpit__candidate-po {
    font-family: var(--font-mono, ui-monospace, "SF Mono", monospace);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary, #fff);
    letter-spacing: 0.02em;
}
.cockpit__candidate-vendor {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
}
.cockpit__candidate-score {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-family: var(--font-mono, ui-monospace, "SF Mono", monospace);
    min-width: 78px;
    justify-content: center;
}
.cockpit__candidate-score-value { font-weight: 800; font-size: 1.25rem; }
.cockpit__candidate-score-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
}
.cockpit__candidate-score--strong {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    color: #4ade80;
}
.cockpit__candidate-score--medium {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.32);
    color: #fbbf24;
}
.cockpit__candidate-score--weak {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.28);
    color: #cbd5e1;
}

.cockpit__candidate-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.875rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
}
.cockpit__candidate-meta i { margin-right: 0.3rem; opacity: 0.65; }
.cockpit__candidate-status {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.75);
}

.cockpit__candidate-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.cockpit__candidate-reason {
    font-size: 0.7rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    color: rgba(255,255,255,0.78);
    font-weight: 600;
}

.cockpit__candidate-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.2rem;
}
.cockpit__candidate-actions .btn-p--sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
}

/* =============================================================================
   PRODUCTION CC primitives — Sprint 13.5 PR #5b.1
   Siemens-style routing stepper, live progress bar, action verb tray,
   exception lane row, activity feed entry, AI snapshot strip.
   All dark-theme native — use the same CSS variables cockpit.css uses
   (--text-primary / --text-muted / --cherry-red / --status-* / --border-subtle).
   ============================================================================= */

/* --- Stepper (routing) --- */
.cockpit__stepper { display:flex; align-items:center; }
.cockpit__step {
    display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
    min-width: 64px;
}
.cockpit__step-pip {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-weight: 600; font-size: 0.85rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
    color: var(--text-muted, rgba(255,255,255,0.55));
}
.cockpit__step-label {
    font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-muted, rgba(255,255,255,0.55));
    font-weight: 500;
}
.cockpit__step-line {
    flex: 1; height: 2px; min-width: 30px;
    background: var(--border-subtle, rgba(255,255,255,0.08));
}
.cockpit__step--done .cockpit__step-pip {
    background: var(--status-success, #16a34a);
    border-color: var(--status-success, #16a34a);
    color: #fff;
}
.cockpit__step--done .cockpit__step-label { color: var(--status-success, #16a34a); }
.cockpit__step--active .cockpit__step-pip {
    background: var(--cherry-red, #cf3339);
    border-color: var(--cherry-red, #cf3339);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(207, 51, 57, 0.18);
}
.cockpit__step--active .cockpit__step-label { color: var(--cherry-red, #cf3339); font-weight: 600; }
.cockpit__step--pending .cockpit__step-pip { /* default muted style */ }

/* --- Progress bar --- */
.cockpit__progress-track {
    height: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
    border-radius: 999px;
    overflow: hidden;
}
.cockpit__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--cherry-red, #cf3339) 0%, #ff5a5f 100%);
    transition: width 0.32s cubic-bezier(0.2, 0, 0, 1);
    border-radius: 999px;
}

/* --- Action verb tray --- */
.cockpit__action-tray button.btn-p { padding: 0.5rem 0.85rem; font-size: 0.8rem; }
.cockpit__verb {
    text-transform: uppercase; letter-spacing: 0.04em;
    font-size: 0.7rem; font-weight: 600;
    padding: 0.45rem 0.9rem !important;
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
    border-radius: 4px;
    background: transparent;
    color: var(--text-primary, #fff);
    cursor: pointer;
    transition: all 0.16s ease;
}
.cockpit__verb:hover { border-color: var(--cherry-red, #cf3339); color: var(--cherry-red, #cf3339); background: rgba(207, 51, 57, 0.06); }
.cockpit__verb--released   { color: var(--info, #3b82f6); border-color: rgba(59, 130, 246, 0.35); }
.cockpit__verb--released:hover   { background: rgba(59, 130, 246, 0.1); border-color: var(--info, #3b82f6); }
.cockpit__verb--inprogress { color: var(--warning, #f59e0b); border-color: rgba(245, 158, 11, 0.35); }
.cockpit__verb--inprogress:hover { background: rgba(245, 158, 11, 0.1); border-color: var(--warning, #f59e0b); }
.cockpit__verb--onhold     { color: var(--warning, #f59e0b); border-color: rgba(245, 158, 11, 0.35); }
.cockpit__verb--onhold:hover     { background: rgba(245, 158, 11, 0.1); }
.cockpit__verb--completed  { color: var(--status-success, #16a34a); border-color: rgba(22, 163, 74, 0.35); }
.cockpit__verb--completed:hover  { background: rgba(22, 163, 74, 0.1); border-color: var(--status-success, #16a34a); }
.cockpit__verb--cancelled  { color: var(--status-danger, #ef4444); border-color: rgba(239, 68, 68, 0.35); }
.cockpit__verb--cancelled:hover  { background: rgba(239, 68, 68, 0.1); border-color: var(--status-danger, #ef4444); }

/* --- Exception lane (used by Exceptions tab) --- */
.cockpit-tab-pane { padding: 1.5rem 1rem; }
.cockpit__exception-lane { display: flex; flex-direction: column; gap: 0.5rem; }
.cockpit__exception-lane-header {
    display: flex; align-items: center; justify-content: space-between;
    color: var(--text-secondary, rgba(255,255,255,0.7));
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}
.cockpit__exception-lane-header .muted { color: var(--text-muted, rgba(255,255,255,0.5)); font-size: 0.75rem; }
.cockpit__exception {
    display: grid; grid-template-columns: 12px 1fr auto;
    gap: 0.75rem; align-items: center;
    padding: 0.75rem 1rem;
    background: var(--surface-card, rgba(255,255,255,0.03));
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
    border-radius: 6px;
    text-decoration: none; color: inherit;
    transition: border-color 0.16s ease;
}
.cockpit__exception:hover { border-color: var(--cherry-red, #cf3339); }
.cockpit__exception--critical { border-left: 3px solid var(--status-danger, #ef4444); }
.cockpit__exception--warning  { border-left: 3px solid var(--warning, #f59e0b); }
.cockpit__exception--info     { border-left: 3px solid var(--info, #3b82f6); }
.cockpit__exception-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--border-subtle, rgba(255,255,255,0.2));
}
.cockpit__exception--critical .cockpit__exception-dot { background: var(--status-danger, #ef4444); }
.cockpit__exception--warning  .cockpit__exception-dot { background: var(--warning, #f59e0b); }
.cockpit__exception--info     .cockpit__exception-dot { background: var(--info, #3b82f6); }
.cockpit__exception-body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.cockpit__exception-line1 { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.cockpit__exception-eyebrow {
    font-family: 'Inter', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem; font-weight: 600;
    color: var(--cherry-red, #cf3339);
}
.cockpit__exception-headline {
    font-size: 0.9rem; font-weight: 600;
    color: var(--text-primary, #fff);
}
.cockpit__exception-subtext {
    font-size: 0.8rem;
    color: var(--text-secondary, rgba(255,255,255,0.7));
}
.cockpit__exception-score {
    font-family: 'Inter', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600; font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    color: var(--text-muted, rgba(255,255,255,0.6));
}

/* --- Activity feed (used by Activity tab) --- */
.cockpit__activity-feed { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.cockpit__activity-entry {
    display: grid; grid-template-columns: 32px 1fr auto;
    gap: 0.75rem; align-items: flex-start;
    padding: 0.75rem 1rem;
    background: var(--surface-card, rgba(255,255,255,0.03));
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
    border-radius: 6px;
}
.cockpit__activity-icon {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 600;
    background: rgba(255,255,255,0.05);
    color: var(--text-muted, rgba(255,255,255,0.6));
}
.cockpit__activity-icon--human  { background: rgba(59,130,246,0.1);  color: var(--info, #3b82f6); }
.cockpit__activity-icon--ai     { background: rgba(207,51,57,0.1);   color: var(--cherry-red, #cf3339); }
.cockpit__activity-icon--system { background: rgba(255,255,255,0.05); color: var(--text-muted, rgba(255,255,255,0.6)); }
.cockpit__activity-body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.cockpit__activity-line1 {
    font-size: 0.85rem;
    color: var(--text-primary, #fff);
}
.cockpit__activity-line1 strong { font-weight: 600; }
.cockpit__activity-line1 .muted { color: var(--text-muted, rgba(255,255,255,0.55)); margin: 0 0.35rem; }
.cockpit__activity-line1 a {
    color: var(--cherry-red, #cf3339);
    text-decoration: none;
    font-family: 'Inter', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
}
.cockpit__activity-line1 a:hover { text-decoration: underline; }
.cockpit__activity-snippet {
    font-size: 0.8rem;
    color: var(--text-secondary, rgba(255,255,255,0.7));
}
.cockpit__activity-time {
    font-family: 'Inter', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.7rem;
    color: var(--text-muted, rgba(255,255,255,0.45));
    margin-top: 0.15rem;
}

/* --- AI snapshot strip (under the workspace) --- */
.cockpit__ai-strip {
    margin: 1rem 1.25rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(180deg, rgba(207,51,57,0.05) 0%, rgba(207,51,57,0.01) 100%);
    border: 1px solid rgba(207, 51, 57, 0.18);
    border-radius: 8px;
    display: grid; gap: 0.75rem;
}
.cockpit__ai-summary { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.cockpit__ai-icon {
    width: 24px; height: 24px; border-radius: 6px;
    background: var(--cherry-red, #cf3339);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
}
.cockpit__ai-label {
    font-size: 0.7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--cherry-red, #cf3339);
}
.cockpit__ai-text {
    font-size: 0.85rem;
    color: var(--text-primary, #fff);
}
.cockpit__ai-suggestions {
    display: grid; gap: 0.5rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.cockpit__ai-card {
    padding: 0.75rem 1rem;
    background: var(--surface-card, rgba(255,255,255,0.03));
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
    border-left-width: 3px;
    border-radius: 6px;
    display: flex; flex-direction: column; gap: 0.25rem;
}
.cockpit__ai-card--critical { border-left-color: var(--status-danger, #ef4444); }
.cockpit__ai-card--warning  { border-left-color: var(--warning, #f59e0b); }
.cockpit__ai-card--info     { border-left-color: var(--info, #3b82f6); }
.cockpit__ai-card--success  { border-left-color: var(--status-success, #16a34a); }
.cockpit__ai-card-headline {
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-primary, #fff);
}
.cockpit__ai-card-subtext {
    font-size: 0.8rem;
    color: var(--text-secondary, rgba(255,255,255,0.7));
}
.cockpit__ai-card-action {
    align-self: flex-start;
    margin-top: 0.25rem;
    font-size: 0.7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--cherry-red, #cf3339);
    text-decoration: none;
}
.cockpit__ai-card-action:hover { text-decoration: underline; }

/* ============================================================================
   SPRINT 13.6 PR #3 — FORM DENSITY UTILITIES
   ----------------------------------------------------------------------------
   Replaces the most-repeated inline `data-csp-style` overrides surfaced by
   docs/research/form-density-audit-2026-05-25.md. All values reference
   wwwroot/css/design-tokens-v2.json (asymmetric scale 4/6/12/20/40/48/96 px;
   tri-state semantic colors; default radius 4 px on inputs).
   NO hardcoded hex or rgba — every color resolves through tokens.css v3.0.
   ============================================================================ */

/* Replaces inline `margin-bottom: 1rem;` on form rows (16 px → 12 px = scale 3,
   conforms to the asymmetric "form chrome" density). Used across
   Quality/Fai/Create.cshtml, CIP/Details.cshtml inline forms,
   StockReceipts/_ReceiptCoreFields.cshtml and ~80 other sites. */
.form-stack-tight { margin-bottom: 12px; }
.form-stack-tight:last-child { margin-bottom: 0; }

/* Replaces inline `display: grid; grid-template-columns: repeat(N, 1fr); gap: 16px;`
   appearing 40+ times in Admin/Items.cshtml inline add form and the FAI
   AS9102 classification block. Gap = 20 px (scale 5 = asymmetric row gap). */
.form-grid--2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.form-grid--3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.form-grid--4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 768px) {
    .form-grid--2, .form-grid--3, .form-grid--4 { grid-template-columns: 1fr; }
}

/* Replaces ~80 hand-coded `background: rgba(...); border: 1px solid rgba(...);
   color: ...; padding: 1rem 1.25rem;` callout cards in Periods/Close.cshtml,
   Help/Index.cshtml, and the "alerts above forms" pattern. Semantic tokens
   only — no decorative color. (design-tokens-v2.json: color.semantic, tri-state.) */
.callout {
    padding: 12px 20px;
    border-radius: 6px;
    border: 1px solid var(--color-border-1);
    background: var(--color-surface-2);
    color: var(--color-text-1);
    font-size: 14px;
    line-height: 1.55;
}
.callout--success {
    background: var(--color-success-50);
    color: var(--color-success-700);
    border-color: var(--color-success-400);
}
.callout--warning {
    background: var(--color-warning-50);
    color: var(--color-warning-700);
    border-color: var(--color-warning-500);
}
.callout--danger {
    background: var(--color-danger-50);
    color: var(--color-danger-700);
    border-color: var(--color-danger-500);
}
.callout--info {
    background: var(--color-info-50);
    color: var(--color-info-700);
    border-color: var(--color-info-500);
}

/* Replaces ad-hoc `width:48-200px; height:48-200px; opacity:0.5`
   sizing on empty-state SVGs in AccessDenied.cshtml, Webhooks list,
   Admin/Sites.cshtml. Caps at 96 px (asymmetric scale 24) so wide-viewport
   illustrations don't overflow their card. */
.svg-icon--empty-state {
    max-width: 96px;
    max-height: 96px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 12px;
    opacity: 0.5;
    color: var(--color-text-3);
}

/* Replaces ~50 inline `width: 100%; padding: 0.5rem; border: 1px solid
   var(--border-color, #cbd5e1); border-radius: 0.375rem;` overrides on
   AssetImport/Upload, Quality/Fai/Create, StockReceipts. Radius 4 px
   (scale "4") per design-tokens-v2.json input default. */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--color-border-1);
    border-radius: 4px;
    background: var(--color-surface-1);
    color: var(--color-text-1);
    font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-color: var(--color-border-2);
}
.form-textarea {
    min-height: 60px;
    resize: vertical;
}

/* Replaces inline `display: block; font-weight: 500; margin-bottom: 0.25rem;`
   on the 30+ form labels in Quality/Fai/Create, AssetImport/Upload, and other
   Sprint 13.5/13.6 ships. */
.form-label-tight {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--color-text-1);
    font-size: 14px;
}

/* Replaces inline `display: flex; gap: 0.5rem;` on form button rows
   in Quality/Fai/Create and AssetImport/Upload. */
.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Replaces the 76 `data-csp-style="flex: 1;"` instances on
   .form-group children in Pages/Assets/_AssetMesIotSafetyTabs.cshtml.
   Scopes to .form-row so we do not affect form-groups outside flex rows. */
.form-row > .form-group--equal { flex: 1; }

/* Replaces the 30 inline `<th>` width overrides in Pages/Admin/Items.cshtml.
   Width classes addressable by column index — keep the visual rhythm of
   the data-table without inline styles. */
.data-table--items th.col-w-50  { width: 50px; }
.data-table--items th.col-w-70  { width: 70px; }
.data-table--items th.col-w-90  { width: 90px; }
.data-table--items th.col-w-100 { width: 100px; }
.data-table--items th.col-w-120 { width: 120px; }
.data-table--items th.col-min-180 { min-width: 180px; }
.data-table--items th.col-right { text-align: right; }
.data-table--items td.col-ellipsis { max-width: 220px; }
.data-table--items td.col-ellipsis > div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.data-table--items td.col-num {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
/* End Sprint 13.6 PR #3 utilities */

/* =============================================================================
   Sprint 12.7 PR #2 — Controller Control Center source-to-GL chain trace
   ----------------------------------------------------------------------
   The chain partial (_CockpitChainTrace.cshtml) renders ChainStep[] from
   IControllerCockpitService as a vertical timeline. Used as the right-pane
   preroll on the Drilldown tab of /Controller. Designed to stay readable
   for 50+ steps (deep CIP cost histories with many depreciation periods).
============================================================================= */
.cockpit-chain {
    padding: 20px 24px 24px 24px;
    color: var(--text-primary);
    height: 100%;
    overflow-y: auto;
}
.cockpit-chain__header {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
}
.cockpit-chain__header--unresolved {
    color: var(--text-muted);
}
.cockpit-chain__title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: var(--text-primary);
}
.cockpit-chain__subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
}
.cockpit-chain__narration {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
}
.cockpit-chain__empty {
    text-align: center;
    padding: 60px 24px 24px 24px;
    color: var(--text-muted);
}
.cockpit-chain__empty-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    opacity: 0.5;
    margin-bottom: 14px;
}
.cockpit-chain__empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-secondary);
}
.cockpit-chain__empty-text {
    font-size: 0.85rem;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.5;
}
.cockpit-chain__empty-text code {
    background: var(--surface-2, rgba(255,255,255,0.05));
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.78rem;
}
.cockpit-chain__steps {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cockpit-chain__step {
    display: flex;
    gap: 14px;
    position: relative;
    padding: 12px 0;
}
/* Vertical rail line connecting bullets. */
.cockpit-chain__step:not(:last-child) .cockpit-chain__step-rail::after {
    content: "";
    position: absolute;
    left: 11px; /* center of 24px bullet (12px) - 1px half-line = 11px */
    top: 36px;  /* below the bullet */
    bottom: -8px;
    width: 2px;
    background: var(--border-subtle, rgba(255,255,255,0.10));
}
.cockpit-chain__step-rail {
    flex: 0 0 24px;
    position: relative;
}
.cockpit-chain__step-bullet {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2, rgba(255,255,255,0.06));
    color: var(--text-secondary);
    font-size: 0.7rem;
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.10));
}
.cockpit-chain__step--asset .cockpit-chain__step-bullet,
.cockpit-chain__step--cipproject .cockpit-chain__step-bullet {
    background: var(--accent-brand, #c8102e);
    color: white;
    border-color: var(--accent-brand, #c8102e);
}
.cockpit-chain__step--journalentry .cockpit-chain__step-bullet {
    background: var(--accent-info, #3b82f6);
    color: white;
    border-color: var(--accent-info, #3b82f6);
}
.cockpit-chain__step-body {
    flex: 1;
    min-width: 0;
}
.cockpit-chain__step-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
.cockpit-chain__step-link:hover .cockpit-chain__step-headline {
    color: var(--accent-brand, #c8102e);
    text-decoration: underline;
}
.cockpit-chain__step-eyebrow {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.cockpit-chain__step-headline {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}
.cockpit-chain__step-subtext {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.cockpit-chain__step-meta {
    display: flex;
    gap: 12px;
    margin-top: 5px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.cockpit-chain__step-amount {
    font-weight: 600;
    color: var(--text-primary);
}
.cockpit-chain__step-narration {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 6px 0 0 0;
    line-height: 1.4;
}
.cockpit-chain__step-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.cockpit-chain__step-chip {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--surface-2, rgba(255,255,255,0.05));
    color: var(--text-secondary);
    font-family: var(--font-mono, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}
/* Controller Drilldown tab — search form above the queue. */
.cockpit-drill-form {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
}
.cockpit-drill-form__input {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.9rem;
    background: var(--surface-2, rgba(255,255,255,0.04));
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.10));
    border-radius: 4px;
    color: var(--text-primary);
}
.cockpit-drill-form__input::placeholder {
    color: var(--text-muted);
}
.cockpit-drill-form__submit {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--accent-brand, #c8102e);
    border: 1px solid var(--accent-brand, #c8102e);
    color: white;
    border-radius: 4px;
    cursor: pointer;
}
.cockpit-drill-form__submit:hover {
    filter: brightness(1.1);
}
/* End Sprint 12.7 PR #2 chain-trace styles */

/* =========================================================================
   B8 PR-PRO-9 — Transaction Drawer styles (2026-05-28)
   ========================================================================= */

/* Clickable rows in BOM/Routing grids */
.txn-grid tbody tr.txn-row {
    cursor: pointer;
    transition: background var(--v2-motion-fast, 100ms) ease;
}
.txn-grid tbody tr.txn-row:hover {
    background: rgba(207, 51, 57, 0.06); /* cherry hint */
}
.txn-grid tbody tr.txn-row--selected {
    background: rgba(207, 51, 57, 0.12);
    box-shadow: inset 3px 0 0 var(--v2-brand, #cf3339);
}

/* Drawer body sections */
.txn-section {
    margin-bottom: 1.25rem;
}
.txn-section:last-child {
    margin-bottom: 0;
}
.txn-section-title {
    font-family: var(--v2-font-sans, 'Inter', sans-serif);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--v2-text-muted, #94a3b8);
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--v2-border, rgba(148, 163, 184, 0.15));
}

/* Suggested action banner */
.txn-action-banner {
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
}
.txn-action-verb {
    font-family: var(--v2-font-sans, 'Inter', sans-serif);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.txn-action-verb i {
    margin-right: 0.35rem;
}
.txn-action-desc {
    font-size: 0.8rem;
    color: var(--v2-text-muted, #94a3b8);
    line-height: 1.4;
}

/* Key-value detail grid */
.txn-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 1rem;
}
.txn-kv {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.txn-k {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--v2-text-muted, #94a3b8);
    font-weight: 500;
}
.txn-v {
    font-size: 0.85rem;
    font-weight: 500;
}
.txn-v.mono {
    font-family: var(--v2-font-mono, 'Inter', monospace);
    font-feature-settings: "tnum" 1, "cv11" 1;
}

/* Quantity rows */
.txn-qty-grid {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.txn-qty-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.82rem;
}
.txn-qty-row:nth-child(odd) {
    background: rgba(255,255,255,0.02);
}
.txn-qty-label {
    color: var(--v2-text-muted, #94a3b8);
    font-size: 0.78rem;
}
.txn-qty-value {
    font-family: var(--v2-font-mono, 'Inter', monospace);
    font-feature-settings: "tnum" 1, "cv11" 1;
    font-weight: 600;
}
.txn-qty--danger .txn-qty-value { color: var(--v2-status-cancelled, #ef4444); }
.txn-qty--warning .txn-qty-value { color: var(--v2-status-onhold, #f59e0b); }
.txn-qty--success .txn-qty-value { color: var(--v2-status-completed, #22c55e); }

/* History placeholder */
.txn-history-placeholder {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--v2-text-muted, #94a3b8);
    font-size: 0.8rem;
    font-style: italic;
}
.txn-history-placeholder i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Footer note */
.txn-footer-note {
    font-size: 0.7rem;
    color: var(--v2-text-muted, #94a3b8);
    margin-left: 0.75rem;
}

/* Drawer foot layout */
#txn-drawer .ds-drawer__foot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =========================================================================
   B8 PR-PRO-10 — Mode Toggle Bar (2026-05-28)
   ========================================================================= */

.cockpit-mode-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--v2-border, rgba(148, 163, 184, 0.15));
    background: rgba(255,255,255,0.015);
}
.cockpit-mode-label {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--v2-text-muted, #94a3b8);
}
.cockpit-mode-toggle {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    padding: 2px;
}
.cockpit-mode-pill {
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    color: var(--v2-text-muted, #94a3b8);
    text-decoration: none;
    transition: all var(--v2-motion-fast, 100ms) ease;
    cursor: pointer;
    white-space: nowrap;
}
.cockpit-mode-pill:hover {
    color: var(--v2-text-primary, #e2e8f0);
    background: rgba(255,255,255,0.06);
}
.cockpit-mode-pill--active {
    color: #fff;
    background: var(--v2-brand, #cf3339);
    font-weight: 600;
}
.cockpit-mode-pill--active:hover {
    background: var(--v2-brand, #cf3339);
    filter: brightness(1.1);
}
.cockpit-mode-pill i {
    margin-right: 0.3rem;
    font-size: 0.7rem;
}
.cockpit-mode-hint {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--v2-text-muted, #94a3b8);
    font-style: italic;
}
