:root {
    --bg: #f5efe6;
    --panel: #fff9f2;
    --panel-strong: #ffffff;
    --text: #2e2119;
    --muted: #7f6758;
    --line: #dfcfbc;
    --primary: #5c3418;
    --primary-soft: #e8d4c0;
    --accent: #95a86a;
    --warning: #b87a20;
    --danger: #a23a28;
    --shadow: 0 18px 45px rgba(70, 36, 10, 0.12);
    --radius: 20px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(circle at top left, rgba(149, 168, 106, 0.18), transparent 30%), linear-gradient(180deg, #f7f1e9 0%, #f0e5d8 100%);
    color: var(--text);
}
html.sig-cacao-preboot body [data-auth="private"] { display: none !important; }
html.sig-cacao-preboot body #login-card { display: grid !important; }
body.session-locked .shell {
    grid-template-columns: 1fr;
}
body.session-locked .sidebar,
body.session-locked .topbar,
body.session-locked .view {
    display: none !important;
}
body.session-locked .content {
    min-height: 100vh;
    align-content: center;
    justify-content: center;
    max-width: 560px;
    margin: 0 auto;
}
body.session-locked #login-card {
    display: grid !important;
}
body.session-locked .login-panel {
    background: var(--panel);
    border: 1px solid rgba(92, 52, 24, 0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
button, input, select, textarea { font: inherit; }
textarea {
    width: 100%;
    min-height: 96px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fffdf9;
    color: var(--text);
    resize: vertical;
}
.shell { min-height: 100vh; display: grid; grid-template-columns: 310px 1fr; }
.sidebar {
    padding: 28px;
    background: linear-gradient(180deg, #4b2f1e 0%, #2d1a11 100%);
    color: #f9efe3;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.sidebar h1, .topbar h2, .panel h3, .panel h2 { margin: 0; }
.eyebrow { margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; opacity: 0.85; }
.muted { color: inherit; opacity: 0.75; }
.nav { display: grid; gap: 12px; }
.nav-group {
    display: grid;
    gap: 8px;
}
.nav-group + .nav-group {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-group-label {
    padding: 0 2px;
    color: rgba(249, 239, 227, 0.72);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.nav-group.is-active .nav-group-label {
    color: rgba(249, 239, 227, 0.94);
}
.nav-link, button {
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}
.nav-link { text-align: left; background: rgba(255, 255, 255, 0.08); color: inherit; }
.nav-link.active, button { background: var(--primary); color: #fff7f1; }
.secondary { background: rgba(255, 255, 255, 0.12); color: inherit; }
.danger { background: var(--danger); color: #fff; }
.ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--line);
}
button:hover, .nav-link:hover { transform: translateY(-1px); }
.content {
    padding: 24px;
    display: grid;
    gap: 16px;
    align-content: start;
    grid-auto-rows: min-content;
}
.flash-stack {
    position: sticky;
    top: 12px;
    z-index: 30;
    display: grid;
    gap: 10px;
}
.flash-stack:empty {
    display: none !important;
}
.flash-message {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(92, 52, 24, 0.12);
    background: rgba(255, 249, 242, 0.96);
    box-shadow: 0 16px 35px rgba(70, 36, 10, 0.14);
    backdrop-filter: blur(10px);
}
.flash-message.error {
    border-color: rgba(162, 58, 40, 0.22);
    background: rgba(255, 241, 239, 0.98);
}
.flash-message.success {
    border-color: rgba(149, 168, 106, 0.28);
    background: rgba(243, 247, 235, 0.98);
}
.flash-message.warning {
    border-color: rgba(184, 122, 32, 0.28);
    background: rgba(252, 246, 232, 0.98);
}
.flash-copy {
    display: grid;
    gap: 4px;
}
.flash-copy strong {
    font-size: 0.92rem;
}
.flash-copy span {
    color: var(--muted);
    line-height: 1.45;
}
.flash-close {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--primary);
    padding: 8px 10px;
}
.topbar, .panel {
    background: var(--panel);
    border: 1px solid rgba(92, 52, 24, 0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.topbar {
    padding: 20px 22px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.pill { background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 8px 14px; font-weight: 600; }
.small-pill {
    padding: 4px 10px;
    font-size: 0.76rem;
}
.panel { padding: 18px; overflow: auto; align-self: start; }
.detail-card-spaced {
    margin-top: 12px;
}
.process-panel {
    padding: 16px 18px;
    display: grid;
    gap: 14px;
    background: linear-gradient(180deg, rgba(255, 250, 244, 0.98) 0%, rgba(247, 240, 231, 0.98) 100%);
}
.process-stage-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}
.process-stage-stack,
.process-stage-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.process-stage-pill,
.process-stage-hint {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 700;
}
.process-stage-pill {
    background: rgba(92, 52, 24, 0.12);
    color: var(--primary);
}
.process-stage-hint {
    background: rgba(149, 168, 106, 0.16);
    color: #55633d;
}
.process-header {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: start;
}
.process-summary {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
    max-width: 70ch;
}
.process-toggle {
    background: rgba(92, 52, 24, 0.06);
    color: var(--primary);
    border: 1px solid rgba(92, 52, 24, 0.12);
}
.process-intel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.process-intel-card {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
}
.process-intel-card strong {
    color: var(--primary);
    font-size: 0.88rem;
}
.process-intel-card span {
    color: var(--muted);
    line-height: 1.4;
}
.process-details {
    display: grid;
    gap: 14px;
    padding-top: 14px;
    border-top: 1px dashed rgba(92, 52, 24, 0.18);
}
.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}
.process-route {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.process-route-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
    font-size: 0.88rem;
}
.process-route-item.is-done {
    background: rgba(149, 168, 106, 0.12);
    color: #55633d;
    border-color: rgba(149, 168, 106, 0.34);
}
.process-route-item.is-current {
    background: rgba(92, 52, 24, 0.12);
    color: var(--primary);
    border-color: rgba(92, 52, 24, 0.28);
    font-weight: 700;
}
.process-route-index {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(92, 52, 24, 0.08);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
}
.process-step {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    min-height: 56px;
}
.process-step-index {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
    flex: 0 0 auto;
}
.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.process-metric {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
}
.process-metric strong {
    color: var(--primary);
    font-size: 0.92rem;
}
.process-metric span {
    color: var(--muted);
    line-height: 1.45;
}
.module-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    grid-column: 1 / -1;
}
.module-step-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(92, 52, 24, 0.1);
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.module-step-text {
    color: var(--muted);
    font-weight: 600;
}
.panel-heading { margin-bottom: 14px; }
.panel-grid-2 {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.kpi-card, .detail-card {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
}
.kpi-card strong { display: block; font-size: 1.65rem; margin-top: 10px; }
.detail-card { min-height: 140px; white-space: pre-wrap; }
.producer-detail-card {
    min-height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(248, 241, 232, 0.88) 100%);
}
.producer-panel {
    display: grid;
    gap: 14px;
}
.producer-form-grid {
    gap: 12px;
}
.producer-form-intro {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(92, 52, 24, 0.10);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(245, 237, 227, 0.86) 100%);
}
.producer-form-intro strong {
    color: var(--primary);
    font-size: 0.96rem;
}
.producer-form-intro span {
    color: var(--muted);
    line-height: 1.5;
}
.producer-form-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.95fr);
    gap: 12px;
}
.producer-form-shell-main {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.95fr);
}
.producer-form-shell-compact {
    grid-template-columns: 1fr;
}
.producer-form-card {
    display: grid;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 20px;
    border: 1px solid rgba(92, 52, 24, 0.10);
    background: rgba(255, 255, 255, 0.82);
}
.producer-form-card-primary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(251, 245, 237, 0.92) 100%);
}
.producer-form-card-soft {
    background: linear-gradient(180deg, rgba(255, 253, 249, 0.92) 0%, rgba(244, 236, 227, 0.92) 100%);
}
.producer-form-card-header {
    display: grid;
    gap: 4px;
}
.producer-form-card-header h4 {
    margin: 0;
    font-size: 1.08rem;
}
.producer-field-grid {
    display: grid;
    gap: 12px;
}
.producer-field-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.producer-field-span-2 {
    grid-column: span 2;
}
.producer-centers-field {
    padding: 14px 16px;
}
.producer-center-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}
.producer-tip-card {
    display: grid;
    gap: 5px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px dashed rgba(92, 52, 24, 0.16);
    background: rgba(248, 241, 232, 0.84);
}
.producer-tip-card strong {
    color: var(--primary);
    font-size: 0.9rem;
}
.producer-tip-card span {
    color: var(--muted);
    line-height: 1.45;
    font-size: 0.92rem;
}
.producer-detail-modal-dialog {
    width: min(860px, calc(100vw - 32px));
}
.producer-detail-modal-body {
    display: grid;
    gap: 16px;
}
.producer-modal-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.producer-modal-card {
    display: grid;
    gap: 10px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(92, 52, 24, 0.10);
    background: rgba(255, 255, 255, 0.92);
}
.producer-modal-card-wide {
    grid-column: 1 / -1;
}
.producer-modal-lines {
    display: grid;
    gap: 8px;
    color: var(--text);
    line-height: 1.45;
}
.producer-modal-lines span strong {
    color: var(--primary);
}
.producer-modal-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.producer-modal-metrics div {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(92, 52, 24, 0.10);
    background: linear-gradient(180deg, rgba(255, 253, 249, 0.95) 0%, rgba(245, 237, 227, 0.9) 100%);
}
.producer-modal-metrics span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.producer-modal-metrics strong {
    font-size: 1.08rem;
    color: var(--text);
}
.producer-modal-section-title {
    display: grid;
    gap: 4px;
}
.producer-modal-section-title h4 {
    margin: 0;
    font-size: 1rem;
}
.producer-modal-farms-list {
    display: grid;
    gap: 10px;
}
.producer-modal-farm-item {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(92, 52, 24, 0.10);
    background: rgba(255, 255, 255, 0.9);
}
.producer-modal-farm-item span,
.producer-modal-empty {
    color: var(--muted);
    line-height: 1.45;
}
.producer-modal-empty {
    padding: 16px;
    border-radius: 14px;
    border: 1px dashed rgba(92, 52, 24, 0.16);
    background: rgba(248, 241, 232, 0.78);
}
.lot-panel-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}
.lot-panel-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.lot-panel-actions button[disabled] {
    opacity: 0.58;
    cursor: not-allowed;
}
.lot-form-grid {
    gap: 14px;
}
.lot-form-intro {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(92, 52, 24, 0.10);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(245, 237, 227, 0.86) 100%);
}
.lot-form-intro strong {
    color: var(--primary);
    font-size: 0.96rem;
}
.lot-form-intro span {
    color: var(--muted);
    line-height: 1.5;
}
.lot-summary-card {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(92, 52, 24, 0.10);
    background: rgba(255, 255, 255, 0.82);
    color: var(--muted);
    line-height: 1.55;
}
.lot-summary-content {
    display: grid;
    gap: 10px;
}
.lot-summary-main {
    display: grid;
    gap: 4px;
}
.lot-summary-main strong {
    color: var(--primary);
    font-size: 1rem;
}
.lot-summary-main span {
    color: var(--muted);
    font-size: 0.95rem;
}
.lot-summary-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.92rem;
}
.lot-summary-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(92, 52, 24, 0.06);
}
.lot-form-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
.lot-form-card {
    display: grid;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(92, 52, 24, 0.10);
    background: rgba(255, 255, 255, 0.82);
}
.lot-form-card-primary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(251, 245, 237, 0.92) 100%);
}
.lot-form-card-soft {
    background: linear-gradient(180deg, rgba(255, 253, 249, 0.92) 0%, rgba(244, 236, 227, 0.92) 100%);
}
.lot-form-card-header {
    display: grid;
    gap: 4px;
}
.lot-form-card-header h4 {
    margin: 0;
    font-size: 1.06rem;
}
.lot-field-grid {
    display: grid;
    gap: 12px;
}
.lot-field-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.lot-guide-card {
    margin-top: 2px;
}
.lot-history-panel {
    margin-top: 14px;
}
.lot-history-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}
.lot-history-dialog {
    width: 100%;
}
.lot-history-detail-card {
    min-height: 320px;
    white-space: normal;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 241, 232, 0.92) 100%);
}
.inventory-card {
    display: grid;
    gap: 12px;
}
.inventory-card-amount {
    color: var(--primary);
    font-weight: 700;
}
.inventory-card-breakdown {
    display: grid;
    gap: 8px;
}
.inventory-card-line {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(0, 1fr);
    gap: 4px 12px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid rgba(92, 52, 24, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
}
.inventory-card-line span {
    color: var(--muted);
    font-size: 0.84rem;
}
.inventory-card-line strong {
    margin: 0;
    font-size: 0.98rem;
}
.inventory-card-line small {
    grid-column: 2;
    color: var(--muted);
}
.inventory-balance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.inventory-balance-chip {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
}
.inventory-balance-chip span {
    color: var(--muted);
    font-size: 0.8rem;
}
.inventory-balance-chip strong {
    color: var(--primary);
    font-size: 0.98rem;
}
.inventory-balance-chip small {
    color: var(--muted);
}
.table-subtext {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}
.commercial-summary-panel {
    display: grid;
    gap: 18px;
}
.commercial-legacy-hidden {
    display: none !important;
}
.commercial-workspace {
    display: grid;
    gap: 18px;
}
.commercial-workspace-legacy {
    gap: 20px;
}
.commercial-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.commercial-workspace-legacy .commercial-toolbar {
    position: sticky;
    top: 12px;
    z-index: 3;
    padding: 12px;
    border: 1px solid rgba(92, 52, 24, 0.08);
    border-radius: 18px;
    background: rgba(255, 252, 248, 0.94);
    box-shadow: 0 12px 26px rgba(70, 36, 10, 0.08);
}
.commercial-toolbar button {
    min-width: 164px;
}
.commercial-toolbar-priority {
    gap: 10px;
}
.commercial-toolbar-priority .commercial-primary-launch {
    min-width: 220px;
    box-shadow: 0 14px 24px rgba(92, 52, 24, 0.18);
}
.commercial-command-deck {
    display: grid;
    gap: 14px;
}
.commercial-command-deck-secondary {
    padding: 16px 18px;
    border: 1px solid rgba(92, 52, 24, 0.08);
    border-radius: 22px;
    background: rgba(255, 252, 248, 0.84);
}
.commercial-monitor-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}
.commercial-watch-launcher {
    display: grid;
    gap: 12px;
    min-height: 0;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(92, 52, 24, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 239, 231, 0.96) 100%);
    box-shadow: 0 12px 28px rgba(92, 52, 24, 0.06);
}
.commercial-watch-launcher-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}
.commercial-watch-launcher-copy {
    display: grid;
    gap: 4px;
}
.commercial-watch-launcher-copy strong {
    font-size: 1.04rem;
    color: var(--text);
}
.commercial-watch-launcher-count {
    display: grid;
    gap: 2px;
    justify-items: end;
    text-align: right;
}
.commercial-watch-launcher-count span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.commercial-watch-launcher-count strong {
    color: var(--primary);
    font-size: 1.7rem;
    line-height: 1;
}
.commercial-watch-launcher-meta {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
    min-height: 48px;
}
.commercial-watch-launcher button {
    justify-self: start;
    min-width: 150px;
}
.commercial-quick-cards .kpi-grid {
    gap: 12px;
}
.commercial-quick-cards .kpi-card {
    padding: 14px 16px;
}
.commercial-quick-cards .kpi-card strong {
    font-size: 1.35rem;
    margin-top: 6px;
}
.commercial-queue-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}
.commercial-queue-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
    padding: 12px 14px;
    gap: 8px;
    white-space: normal;
}
.commercial-queue-card > .stack,
#commercial-watch-sales-slot,
#commercial-watch-purchases-slot,
#commercial-watch-documents-slot,
#commercial-watch-sales,
#commercial-watch-purchases,
#commercial-watch-documents {
    display: grid;
    gap: 8px;
    align-content: start;
    grid-auto-rows: min-content;
}
.commercial-shell-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.86fr);
    gap: 12px;
    align-items: start;
}
.commercial-shell-grid.legacy-modal-layout {
    grid-template-columns: 1fr;
}
.commercial-shell-grid.legacy-modal-layout .commercial-detail-host {
    display: none;
}
.commercial-main-stack {
    display: grid;
    gap: 10px;
    min-width: 0;
}
.commercial-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.commercial-tab {
    border: 1px solid rgba(92, 52, 24, 0.14);
    background: rgba(255, 255, 255, 0.78);
    color: var(--primary);
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 700;
}
.commercial-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.commercial-tab-panels {
    display: grid;
}
.commercial-tab-panel {
    display: none;
    gap: 10px;
}
.commercial-tab-panel.active {
    display: grid;
}
.commercial-filter-bar {
    padding: 14px 16px;
    border: 1px solid rgba(92, 52, 24, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
}
.commercial-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
}
.commercial-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    grid-column: 1 / -1;
}
.commercial-tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 2px 0 0;
}
.commercial-tab-header h3 {
    margin: 2px 0 0;
}
.commercial-detail-host {
    display: grid;
    gap: 14px;
    align-content: start;
    position: sticky;
    top: 24px;
}
.commercial-detail-host .detail-card {
    min-height: 460px;
}
.commercial-watch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 14px;
}
.commercial-watch-card {
    min-height: 100%;
    white-space: normal;
}
.commercial-panel-shell {
    align-items: start;
}
.commercial-form-panel,
.commercial-table-panel {
    display: grid;
    gap: 14px;
    min-width: 0;
}
.commercial-table-panel .table-scroll {
    box-shadow: inset 0 0 0 1px rgba(92, 52, 24, 0.02);
}
.commercial-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.commercial-form-grid textarea {
    min-height: 96px;
}
.commercial-table-panel .panel-heading,
.commercial-form-panel .panel-heading {
    margin-bottom: 0;
}
.table-scroll {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.84);
}
.table-scroll table {
    min-width: 100%;
}
.commercial-process-note {
    align-content: start;
}
.commercial-mini-card {
    background: rgba(255, 255, 255, 0.82);
}
.commercial-detail-card {
    white-space: normal;
    min-height: 320px;
}
.commercial-modal-open {
    overflow: hidden;
}
.commercial-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
}
.commercial-modal[hidden] {
    display: none !important;
}
.commercial-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 12, 0.56);
    backdrop-filter: blur(3px);
}
.commercial-modal-dialog {
    position: relative;
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    overflow: auto;
    margin: 20px auto;
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 252, 248, 0.98);
    border: 1px solid rgba(92, 52, 24, 0.12);
    box-shadow: 0 28px 64px rgba(45, 28, 17, 0.26);
}
.commercial-modal-dialog-lg {
    width: min(980px, calc(100vw - 32px));
}
.commercial-modal-dialog-xl {
    width: min(1180px, calc(100vw - 32px));
}
.commercial-modal-header {
    display: grid;
    gap: 4px;
    margin-bottom: 18px;
    padding-right: 32px;
}
.commercial-modal-header h3 {
    margin: 0;
}
.commercial-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(92, 52, 24, 0.12);
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    font-size: 1.45rem;
    line-height: 1;
    padding: 0;
}
.commercial-modal-form {
    display: grid;
    gap: 14px;
}
.commercial-watch-list {
    display: grid;
    gap: 12px;
}
.commercial-mini-sheet {
    display: grid;
    gap: 10px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(92, 52, 24, 0.10);
    background: rgba(255, 252, 248, 0.98);
}
.commercial-mini-sheet-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.commercial-mini-sheet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.commercial-detail-modal-body {
    display: grid;
    gap: 16px;
}
.commercial-detail-modal-body .commercial-detail-shell {
    gap: 14px;
}
.commercial-inline-actions {
    display: flex;
    justify-content: flex-start;
}
.commercial-preview-note {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(92, 52, 24, 0.08);
    background: #f7f1ea;
    color: var(--muted);
    line-height: 1.55;
}
.commercial-item-summary,
.commercial-item-metric {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.84);
}
.commercial-item-summary span,
.commercial-item-metric span {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}
.commercial-item-summary strong,
.commercial-item-metric strong {
    font-size: 1rem;
}
.commercial-add-line-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-radius: 20px;
    border: 1px solid rgba(92, 52, 24, 0.14);
    background: linear-gradient(135deg, rgba(255, 250, 244, 0.98), rgba(247, 239, 231, 0.95));
    box-shadow: 0 10px 24px rgba(92, 52, 24, 0.08);
}
.commercial-add-line-copy {
    display: grid;
    gap: 4px;
    max-width: 560px;
}
.commercial-add-line-copy strong {
    color: var(--text);
    font-size: 1rem;
}
.commercial-add-line-button {
    min-width: 220px;
    white-space: nowrap;
    box-shadow: 0 10px 18px rgba(92, 52, 24, 0.12);
}
.commercial-entry-zone {
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(92, 52, 24, 0.14);
    background: linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(247, 239, 231, 0.92));
}
.commercial-entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.commercial-entry-field {
    display: grid;
    gap: 8px;
}
.commercial-entry-label {
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.commercial-entry-input {
    background: #ffffff !important;
    border: 2px solid rgba(92, 52, 24, 0.18) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 2px 8px rgba(92, 52, 24, 0.04);
    color: var(--text) !important;
    font-size: 1rem;
}
.commercial-entry-input:hover {
    border-color: rgba(92, 52, 24, 0.28) !important;
}
.commercial-entry-input:focus {
    outline: none;
    border-color: rgba(92, 52, 24, 0.62) !important;
    box-shadow: 0 0 0 4px rgba(92, 52, 24, 0.12);
}
.commercial-entry-input::placeholder {
    color: #a18874;
}
.commercial-entry-hint {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}
.commercial-entry-hint strong {
    color: var(--text);
}
.commercial-detail-shell {
    display: grid;
    gap: 16px;
}
.commercial-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.commercial-metric strong {
    font-size: 1rem;
}
.commercial-inline-note {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(92, 52, 24, 0.08);
    background: #f7f1ea;
    color: var(--muted);
    line-height: 1.5;
}
.commercial-pending-sale-card {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 20px;
    border: 1px solid rgba(92, 52, 24, 0.12);
    background: rgba(255, 252, 248, 0.98);
    box-shadow: 0 12px 28px rgba(92, 52, 24, 0.06);
}
.commercial-pending-sale-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.commercial-pending-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.commercial-pending-sale-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.commercial-pending-sale-grid > div {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(92, 52, 24, 0.05);
    border: 1px solid rgba(92, 52, 24, 0.08);
}
.commercial-pending-sale-grid span,
.commercial-next-step span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.commercial-pending-sale-grid strong,
.commercial-next-step strong {
    color: var(--text);
    font-size: 1rem;
}
.commercial-next-step {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(149, 168, 106, 0.12);
    border: 1px solid rgba(149, 168, 106, 0.28);
}
.commercial-sale-queue-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.commercial-queue-card .panel-heading {
    margin-bottom: 6px;
}
.commercial-queue-card .panel-heading h3 {
    margin: 0;
}
.commercial-queue-card .alert-item,
.commercial-queue-card .commercial-mini-card {
    padding: 10px 12px;
}
.commercial-closure-shell {
    display: grid;
    gap: 18px;
}
.commercial-closure-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.commercial-step-card {
    display: grid;
    gap: 6px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(92, 52, 24, 0.12);
    background: rgba(255, 252, 248, 0.96);
}
.commercial-step-card.ready {
    border-color: rgba(149, 168, 106, 0.36);
    background: rgba(149, 168, 106, 0.12);
}
.commercial-step-card.pending {
    border-color: rgba(199, 124, 47, 0.34);
    background: rgba(243, 227, 183, 0.32);
}
.commercial-step-card strong {
    color: var(--text);
}
.commercial-step-card div {
    color: var(--muted);
    line-height: 1.45;
}
.commercial-chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.commercial-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(92, 52, 24, 0.08);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 700;
}
.commercial-detail-table {
    width: 100%;
    border-collapse: collapse;
}
.commercial-detail-table th,
.commercial-detail-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.commercial-detail-table th {
    white-space: nowrap;
}
.commercial-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.commercial-ledger-section {
    display: grid;
    gap: 12px;
}
.commercial-ledger-section-title {
    color: var(--primary);
    font-weight: 700;
}
.customer-allocation-input {
    min-width: 120px;
}
.commercial-filter-bar input,
.commercial-filter-bar select {
    background: #fffefb;
}
.table-spaced { margin-top: 14px; }
.trace-card-secondary {
    margin-top: 10px;
    padding-top: 16px;
    border-top: 1px dashed rgba(92, 52, 24, 0.18);
}
.trace-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}
.trace-card {
    display: grid;
    gap: 16px;
}
.trace-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.trace-metric {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
}
.trace-metric span,
.trace-highlight-label {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}
.trace-metric strong {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: var(--text);
}
.trace-metric small {
    color: var(--muted);
    line-height: 1.45;
}
.trace-highlight {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(92, 52, 24, 0.12);
    background: linear-gradient(180deg, rgba(247, 241, 234, 0.95) 0%, rgba(255, 255, 255, 0.88) 100%);
}
.trace-highlight strong {
    display: block;
    margin-top: 6px;
    font-size: 1rem;
}
.trace-timeline {
    display: grid;
    gap: 12px;
}
.trace-event {
    position: relative;
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 12px;
}
.trace-event:not(.is-last)::after {
    content: "";
    position: absolute;
    top: 22px;
    left: 8px;
    width: 2px;
    height: calc(100% + 8px);
    background: rgba(92, 52, 24, 0.18);
}
.trace-marker {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--primary-soft);
    border: 3px solid rgba(92, 52, 24, 0.18);
    margin-top: 16px;
}
.trace-event.warning .trace-marker {
    background: #f3e3b7;
    border-color: rgba(184, 122, 32, 0.28);
}
.trace-event.danger .trace-marker {
    background: #f1c8c0;
    border-color: rgba(162, 58, 40, 0.28);
}
.trace-event.success .trace-marker {
    background: rgba(149, 168, 106, 0.24);
    border-color: rgba(149, 168, 106, 0.34);
}
.trace-body {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
}
.trace-event-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    flex-wrap: wrap;
}
.trace-event-top strong {
    color: var(--text);
}
.trace-event-top span,
.trace-route,
.trace-notes,
.trace-empty {
    color: var(--muted);
    line-height: 1.45;
}
.trace-route {
    font-weight: 600;
}
.trace-notes {
    padding: 10px 12px;
    border-radius: 12px;
    background: #f7f1ea;
    border: 1px solid rgba(92, 52, 24, 0.08);
}
.trace-empty {
    padding: 16px;
    border-radius: 14px;
    border: 1px dashed var(--line);
    background: rgba(255, 255, 255, 0.58);
}
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.full-row { grid-column: 1 / -1; }
.checklist-field {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(92, 52, 24, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}
.field-label-inline {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.checklist-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid rgba(92, 52, 24, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--text);
    cursor: pointer;
}
.checklist-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}
.checklist-option span {
    font-weight: 600;
}
.checklist-option:has(input:checked) {
    border-color: rgba(92, 52, 24, 0.38);
    background: rgba(232, 212, 192, 0.48);
    box-shadow: inset 0 0 0 1px rgba(92, 52, 24, 0.08);
}
.checklist-option:has(input:checked) span {
    color: var(--primary);
}
.form-field {
    display: grid;
    gap: 6px;
    align-content: start;
}
.form-field.is-readonly input,
.form-field.is-readonly textarea {
    background: #f3ede5;
}
.field-label {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
}
.field-required {
    color: var(--danger);
    font-weight: 800;
}
.field-meta {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.4;
}
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-actions-inline { margin-top: 14px; }
input, select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fffdf9;
    color: var(--text);
}
input::placeholder,
textarea::placeholder {
    color: #9f8a7a;
}
.auto-generated-field {
    background: linear-gradient(180deg, #f8f2ea, #f2e8db);
    border-style: dashed;
    color: var(--primary);
    font-weight: 700;
    cursor: default;
}
.auto-generated-field:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(92, 52, 24, 0.08);
}
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 0.95rem;
    vertical-align: top;
}
.stack { display: grid; gap: 10px; }
.help-toggle-panel {
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #f9efe3;
    font-weight: 600;
}
.switch-control {
    position: relative;
    display: inline-flex;
    width: 64px;
    height: 36px;
    align-items: center;
}
.switch-control input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.switch-slider {
    position: relative;
    width: 64px;
    height: 36px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: background 160ms ease, border-color 160ms ease;
}
.switch-slider::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #fff7f1;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    transition: transform 160ms ease;
}
.switch-control input:checked + .switch-slider {
    background: rgba(149, 168, 106, 0.32);
    border-color: rgba(149, 168, 106, 0.4);
}
.switch-control input:checked + .switch-slider::after {
    transform: translateX(28px);
}
.alert-item {
    background: rgba(149, 168, 106, 0.13);
    border-left: 4px solid var(--accent);
    padding: 14px 16px;
    border-radius: 12px;
}
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.action-row button { padding: 8px 10px; }
.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
}
.badge.warning { background: #f3e3b7; color: var(--warning); }
.badge.danger { background: #f1c8c0; color: var(--danger); }
.hidden { display: none !important; }
.view {
    display: none;
    gap: 16px;
    align-content: start;
    grid-auto-rows: min-content;
}
.view.active { display: grid; }
.login-panel { display: grid; gap: 14px; }
body:not(.session-locked) #login-card,
body:not(.session-locked) #login-card.hidden {
    display: none !important;
}
.field-note {
    grid-column: 1 / -1;
    margin: -2px 0 2px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}
.guide-card {
    grid-column: 1 / -1;
    padding: 14px 16px;
    border-radius: 16px;
    background: #f7f1ea;
    border: 1px solid var(--line);
    color: var(--muted);
    line-height: 1.5;
}
.guide-card strong {
    color: var(--text);
}
body.help-disabled .field-note,
body.help-disabled .field-meta,
body.help-disabled .guide-card,
body.help-disabled .process-summary,
body.help-disabled .process-details,
body.help-disabled .process-toggle,
body.help-disabled .process-grid,
body.help-disabled .process-stage-hint {
    display: none !important;
}
.line-editor {
    grid-column: 1 / -1;
    display: grid;
    gap: 12px;
    min-width: 0;
}
.line-editor-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.line-editor .table-scroll {
    border: none;
    border-radius: 0;
    background: transparent;
}
.line-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
}
.line-table th,
.line-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.line-table input,
.line-table select {
    min-width: 110px;
}
.line-editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}
.line-editor-total {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    margin-left: auto;
    color: var(--muted);
    font-weight: 700;
}
.line-editor-total strong {
    color: var(--primary);
    font-size: 1.05rem;
}
.line-empty {
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.5);
}
.table-empty {
    text-align: center;
    color: var(--muted);
}
.table-empty-seeded {
    padding: 18px 12px;
    background: rgba(255, 255, 255, 0.56);
}
.metric-callout {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fffdf9;
}
.metric-callout strong {
    font-size: 1.1rem;
}
@media (max-width: 980px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { padding-bottom: 18px; }
    .topbar { flex-direction: column; align-items: flex-start; }
    .process-header { flex-direction: column; }
    .process-stage-row { align-items: flex-start; }
    .process-stage-actions { width: 100%; }
    .panel-grid-2 { grid-template-columns: 1fr; }
    .producer-form-shell,
    .producer-field-grid-2,
    .producer-modal-summary-grid { grid-template-columns: 1fr; }
    .producer-field-span-2 { grid-column: auto; }
    .lot-panel-heading { flex-direction: column; align-items: flex-start; }
    .lot-history-panel-header { flex-direction: column; align-items: flex-start; }
    .lot-summary-meta { align-items: flex-start; }
    .lot-field-grid-4 { grid-template-columns: 1fr; }
    .commercial-shell-grid { grid-template-columns: 1fr; }
    .commercial-detail-host { position: static; }
    .commercial-tab-header { flex-direction: column; align-items: flex-start; }
    .commercial-toolbar button { min-width: 0; width: 100%; }
    .commercial-workspace-legacy .commercial-toolbar { position: static; }
    .commercial-monitor-strip { grid-template-columns: 1fr; }
    .commercial-queue-strip { grid-template-columns: 1fr; }
    .commercial-modal-dialog,
    .commercial-modal-dialog-lg,
    .commercial-modal-dialog-xl { width: calc(100vw - 20px); margin: 10px auto; padding: 18px; }
    .commercial-watch-grid { grid-template-columns: 1fr; }
    .commercial-form-grid { grid-template-columns: 1fr; }
    .commercial-entry-grid,
    .commercial-pending-sale-grid,
    .commercial-closure-steps { grid-template-columns: 1fr; }
    .commercial-pending-sale-top,
    .commercial-add-line-card { flex-direction: column; align-items: stretch; }
    .commercial-pending-badges { justify-content: flex-start; }
    .commercial-add-line-button { width: 100%; min-width: 0; }
    .line-editor-total { margin-left: 0; }
    .commercial-filter-actions { justify-content: stretch; }
    .commercial-filter-actions button { width: 100%; }
}
