:root {
    --bg: #f6f6ff;
    --surface: #ffffff;
    --surface-soft: #f0edff;
    --sidebar: #2164ae;
    --sidebar-muted: #c9def5;
    --text: #25243d;
    --muted: #6d6b86;
    --border: #e3e3f5;
    --primary: #6847f5;
    --primary-dark: #5333d7;
    --success: #197a52;
    --danger: #b42318;
    --radius: 15px;
    --shadow: 0 4px 18px rgba(48, 39, 105, .08);
}
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
body { margin: 0; min-height: 100vh; font-size: 14px; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 210px; padding: 14px; overflow-y: auto; color: white; background: var(--sidebar); z-index: 20; }
.brand { display: flex; justify-content: center; align-items: center; min-height: 142px; padding: 9px; overflow: hidden; color: inherit; background: white; border-radius: 12px; text-decoration: none; box-shadow: 0 8px 22px rgba(8, 47, 91, .18); }
.brand-logo { display: block; width: auto; max-width: 100%; height: 124px; object-fit: contain; }
.nav { margin-top: 12px; }
.nav-section { margin: 18px 10px 6px; color: var(--sidebar-muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.nav-group { display: grid; gap: 1px; }
.nav-divider { height: 1px; margin: 7px 10px; border: 0; background: rgba(255,255,255,.18); }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #f5f9ff; text-decoration: none; }
.nav-link:hover { background: rgba(255,255,255,.15); }
.app-main { width: 100%; min-width: 0; margin-left: 210px; }
.topbar { display: flex; align-items: center; min-height: 50px; padding: 0 18px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); }
.topbar-spacer { flex: 1; }
.language-switcher { margin-right: 10px; }
.language-switcher select { width: 58px; min-height: 30px; padding: 4px 7px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: white; font-size: 11px; font-weight: 800; }
.user-name { margin-right: 14px; font-weight: 650; }
.menu-button { display: none; border: 0; background: transparent; font-size: 22px; }
.content { width: calc(100% - 36px); max-width: 1600px; margin: 0 auto; padding: 18px 0 40px; }
.content.content-browse { width: calc(100% - 24px); max-width: none; margin-left: 8px; margin-right: 16px; }
.page-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-actions { display: flex; align-items: flex-start; gap: 10px; }
.page-heading h1 { margin: 5px 0 8px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.03em; }
.page-heading p, .muted { margin: 0; color: var(--muted); line-height: 1.6; }
.eyebrow { color: var(--primary); font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.feature-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px; }
.feature-card h2 { margin: 14px 0 8px; }
.feature-card p { margin: 0; color: var(--muted); }
.toolbar { display: flex; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
input { width: 100%; min-height: 42px; padding: 9px 13px; color: var(--text); background: white; border: 1px solid #cecede; border-radius: 8px; outline: none; }
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(104,71,245,.13); }
.toolbar input { max-width: 420px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.button-primary { color: white; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 4px 10px rgba(104,71,245,.2); }
.button-secondary { color: var(--text); background: white; border-color: var(--border); }
.button-wide { width: 100%; margin-top: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #fafaff; font-size: 12px; letter-spacing: .03em; text-transform: uppercase; }
tbody tr:hover { background: #faf9ff; }
.status-badge { display: inline-flex; align-items: center; padding: 5px 9px; color: #5f5d75; background: #efeff7; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-active { color: var(--success); background: #e7f7f0; }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 18px; padding: 16px 20px; }
.pagination a { color: var(--primary); font-weight: 700; text-decoration: none; }
.empty-state { padding: 48px 24px; text-align: center; }
.empty-state h2 { margin-top: 0; }
.empty-state p { color: var(--muted); }
.empty-cell { color: var(--muted); text-align: center; }
.table-link { color: var(--text); text-decoration: none; }
.table-link:hover { color: var(--primary); }
.table-detail-link { color: var(--primary); font-size: 12px; font-weight: 700; white-space: nowrap; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.detail-card { padding: 24px; }
.detail-card-wide { grid-column: 1 / -1; }
.detail-card h2 { margin: 0 0 18px; font-size: 19px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin: 0; }
.detail-list div { min-width: 0; }
.detail-list dt { margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.record-list { display: grid; gap: 12px; }
.record { padding: 15px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fcfcff; }
.record-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-weight: 750; }
.record p { margin: 4px 0 0; color: var(--muted); }
.form-card { padding: 26px; }
.readonly-field { display: grid; gap: 5px; margin-bottom: 24px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: #fafaff; }
.readonly-field span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.readonly-field small { color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-field { display: grid; gap: 7px; }
.form-field-wide { grid-column: 1 / -1; }
.form-field label { font-weight: 700; }
.form-field select, .form-field textarea { width: 100%; padding: 10px 13px; color: var(--text); background: white; border: 1px solid #cecede; border-radius: 8px; font: inherit; outline: none; }
.form-field select { min-height: 42px; }
.form-field textarea { resize: vertical; }
.form-field select:focus, .form-field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(104,71,245,.13); }
.form-field-checkbox { align-content: end; }
.checkbox-label { display: flex; align-items: center; gap: 10px; min-height: 42px; }
.checkbox-label input { width: 18px; min-height: 18px; accent-color: var(--primary); }
.field-error { color: var(--danger); font-size: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }
.notice { margin-bottom: 18px; padding: 12px 14px; border-radius: 9px; background: var(--surface-soft); }
.notice-error { color: var(--danger); background: #fff0ef; }
.login-page { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top right, #e7e0ff, transparent 42%), var(--bg); }
.login-card { width: min(430px, 100%); padding: 34px; background: white; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 18px 50px rgba(47,39,99,.13); }
.brand-login { margin-bottom: 34px; }
.login-card h1 { margin: 0 0 8px; font-size: 30px; }
.form-stack { display: grid; gap: 9px; margin-top: 26px; }
.form-stack label { margin-top: 6px; font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Zwarty obszar roboczy firm — układ zgodny z dotychczasowym ekranem Streamlit. */
.workspace-heading h1 { margin: 0 0 10px; font-size: 21px; letter-spacing: -.02em; }
.workspace-tabs { display: flex; gap: 18px; margin-bottom: 14px; border-bottom: 1px solid #d6d6e8; }
.workspace-tab { padding: 7px 0 8px; color: var(--muted); font-size: 12px; text-decoration: none; }
.workspace-tab-active { color: var(--primary-dark); border-bottom: 2px solid var(--primary); }
.workspace-tab-disabled { cursor: default; }
.company-browser { padding-bottom: 12px; border-bottom: 1px solid #d6d6e8; }
.company-browser-selected { margin-bottom: 8px; }
.compact-filter { margin-bottom: 8px; }
.compact-checkbox { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.compact-checkbox input, .assignment-grid input[type="checkbox"] { width: 15px; min-height: 15px; margin: 0; accent-color: var(--primary); }
.compact-label, .table-caption { display: block; margin: 0 0 5px; color: var(--muted); font-size: 11px; }
.company-picker { width: 100%; min-height: 36px; padding: 6px 10px; border-radius: 7px; background: #f9f9ff; }
.picker-hint { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.filter-panel { position: relative; margin-bottom: 10px; padding: 9px 11px 11px; border: 1px solid var(--border); border-radius: 8px; background: #fafaff; }
.filter-panel > summary { cursor: pointer; color: var(--primary-dark); font-size: 12px; font-weight: 700; }
.filter-panel-reset { position: absolute; top: 8px; right: 11px; color: var(--primary-dark); font-size: 10px; text-decoration: none; }
.filter-panel-reset:hover { text-decoration: underline; }
.company-product-filters { display: grid; grid-template-columns: minmax(250px, 2.15fr) minmax(150px, 1.25fr) minmax(150px, 1.05fr) minmax(280px, 2fr); gap: 9px; align-items: start; margin-top: 9px; }
.company-product-filters > label, .autocomplete-multiselect > label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.company-product-query input { width: 100%; min-height: 36px; }
.autocomplete-multiselect { position: relative; display: grid; gap: 4px; min-width: 0; }
.autocomplete-control { display: flex; align-items: center; gap: 4px; width: 100%; min-height: 36px; padding: 3px 7px; overflow: hidden; background: white; border: 1px solid #cecede; border-radius: 7px; cursor: text; }
.autocomplete-control:focus-within, .autocomplete-control[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(104,71,245,.10); }
.autocomplete-selections { display: contents; }
.autocomplete-chip { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 72%; padding: 3px 5px 3px 7px; color: #37306b; background: #eeeaff; border: 1px solid #d5ccff; border-radius: 5px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.autocomplete-chip > span { overflow: hidden; text-overflow: ellipsis; }
.autocomplete-chip button { flex: 0 0 auto; width: 15px; height: 15px; padding: 0; color: #6255a8; background: transparent; border: 0; border-radius: 50%; font: 700 14px/13px Arial, sans-serif; cursor: pointer; }
.autocomplete-chip button:hover { color: white; background: #7764db; }
.autocomplete-control > input { flex: 1 1 85px; min-width: 70px; min-height: 26px; padding: 2px; border: 0; outline: 0; box-shadow: none; background: transparent; }
.autocomplete-control > input:focus { border: 0; outline: 0; box-shadow: none; }
.autocomplete-options { position: absolute; z-index: 35; top: calc(100% + 4px); left: 0; width: max(100%, 270px); max-height: 275px; overflow-y: auto; border: 1px solid #cecede; border-radius: 8px; background: white; box-shadow: 0 12px 30px rgba(47,39,99,.18); }
.autocomplete-options[hidden] { display: none; }
.autocomplete-options button { display: block; width: 100%; padding: 8px 10px; color: var(--text); text-align: left; background: white; border: 0; border-bottom: 1px solid #eeeef6; font: inherit; font-size: 11px; cursor: pointer; }
.autocomplete-options button:hover, .autocomplete-options button.is-active { color: var(--primary-dark); background: #eeeaff; }
.autocomplete-empty { display: block; padding: 9px 10px; color: var(--muted); font-size: 11px; }
.company-product-caption { margin: 0 0 6px; }
.company-product-results { max-height: 720px; }
.company-product-table { min-width: 1150px; }
.company-product-table th:first-child, .company-product-table td:first-child { min-width: 210px; }
.company-product-table td a { color: var(--primary-dark); }
.dashboard-caption { margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.dashboard-filters { grid-template-columns: 2.2fr 2fr .8fr .8fr; margin-bottom: 10px; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 9px; }
.dashboard-metrics div { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: white; }
.dashboard-metrics strong { font-size: 18px; }
.dashboard-metrics span { color: var(--muted); font-size: 10px; }
.dashboard-details { margin: 8px 0; font-size: 11px; }
.dashboard-details summary { cursor: pointer; color: var(--primary-dark); font-weight: 700; }
.dashboard-details pre { padding: 9px; overflow: auto; border-radius: 7px; background: white; white-space: pre-wrap; }
.dashboard-table { min-width: 1900px; }
.dashboard-table th, .dashboard-table td { padding: 6px 7px; }
.dashboard-col-customer { width: 58px; min-width: 58px; max-width: 58px; text-align: center; white-space: normal; }
.dashboard-col-importance { width: 64px; min-width: 64px; max-width: 64px; text-align: center; white-space: normal; }
.dashboard-table .dashboard-col-customer { width: 58px; min-width: 58px; max-width: 58px; white-space: normal; line-height: 1.15; }
.dashboard-table .dashboard-col-importance { width: 64px; min-width: 64px; max-width: 64px; white-space: normal; line-height: 1.15; }
.dashboard-summary-cell, .dashboard-text-cell { min-width: 210px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-date { width: 125px; min-height: 30px; padding: 4px 6px; font-size: 11px; }
.dashboard-select { color: var(--primary); font-size: 18px; text-decoration: none; }
.dashboard-row-selected { background: #f0edff; }
.dashboard-save-row { display: flex; align-items: center; gap: 10px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.dashboard-save-row .section-save:disabled { cursor: default; opacity: .45; }
.dashboard-selection { display: grid; grid-template-columns: 1.5fr 1.5fr .7fr; gap: 8px; margin: 8px 0; padding: 9px; border: 1px solid var(--border); border-radius: 8px; background: white; font-size: 12px; }
.dashboard-textarea-label { display: grid; gap: 5px; margin-top: 10px; color: var(--muted); font-size: 11px; font-weight: 700; }
.dashboard-textarea-label textarea { width: 100%; padding: 9px; border: 1px solid #cecede; border-radius: 8px; color: var(--text); background: white; font: 12px/1.45 ui-monospace, Consolas, monospace; resize: vertical; }
.dashboard-textarea-label textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(104,71,245,.13); }
.workspace-section { padding: 10px 0; border-bottom: 1px solid #d6d6e8; }
.workspace-section h2 { margin: 0 0 7px; font-size: 14px; }
.dense-table-wrap { width: 100%; overflow: auto; border: 1px solid #d9d9e9; border-radius: 7px; background: white; }
.dense-table { min-width: 850px; table-layout: auto; font-size: 11px; }
.dense-table th, .dense-table td { max-width: 330px; padding: 6px 8px; border-right: 1px solid #e1e1ef; border-bottom: 1px solid #e1e1ef; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; }
.dense-table th { color: #7b7990; background: #fafaff; font-size: 10px; font-weight: 550; letter-spacing: 0; }
.dense-table tr:last-child td { border-bottom: 0; }
.dense-table th:last-child, .dense-table td:last-child { border-right: 0; }
.content-browse .dense-table.column-resizable > thead > tr:first-child > th { position: relative; padding-right: 13px; }
.column-resize-handle { position: absolute; z-index: 5; top: 0; right: -4px; width: 9px; height: 100%; min-height: 25px; cursor: col-resize; touch-action: none; user-select: none; }
.column-resize-handle::after { position: absolute; top: 18%; bottom: 18%; left: 4px; width: 1px; content: ""; background: transparent; }
.column-resize-handle:hover::after, .column-resize-handle:focus-visible::after, body.is-resizing-column .column-resize-handle.is-active::after { background: var(--primary); }
.column-resize-handle:focus-visible { outline: 2px solid rgba(104,71,245,.3); outline-offset: -2px; }
body.is-resizing-column { cursor: col-resize; user-select: none; }
.dense-table.column-widths-fixed > thead > tr > th,
.dense-table.column-widths-fixed > tbody > tr > td { min-width: 0 !important; max-width: none !important; }
.company-data-table { min-width: 1050px; }
.company-data-table th:first-child, .company-data-table td:first-child { min-width: 210px; }
.cell-number { text-align: right; font-variant-numeric: tabular-nums; }
.cell-center { text-align: center; }
.section-save { width: 100%; min-height: 30px; margin-top: 7px; padding: 5px 10px; color: var(--text); background: #fff; border: 1px solid #cecede; border-radius: 7px; font: inherit; font-size: 11px; }
.section-save:not(:disabled):hover { color: var(--primary-dark); border-color: #a99af9; background: #faf9ff; }
.section-save:disabled { color: #aaa9b9; cursor: default; background: #f8f8fb; }
.staged-values { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.staged-editable { cursor: cell; }
.staged-editable:hover { background: #f0edff; box-shadow: inset 0 0 0 1px #d1c8ff; }
.staged-editable.is-dirty { background: #fff8d8; }
.staged-editable.is-editing { min-width: 150px; padding: 2px; overflow: visible; }
.cell-editor { width: 100%; min-width: 140px; min-height: 27px; padding: 3px 5px; border: 1px solid var(--primary); border-radius: 4px; font: inherit; background: white; }
textarea.cell-editor { min-height: 50px; resize: vertical; }
.compact-notice { margin: 5px 0; padding: 10px 12px; color: #155ca2; background: #deedff; border-radius: 6px; font-size: 11px; }
.compact-notice-error { color: var(--danger); background: #fff0ef; }
.compact-notice-warning { color: #76510b; background: #fff4cf; }
.notice-success { color: var(--success); background: #e7f7f0; }
.notice-warning { color: #76510b; background: #fff4cf; }
.compact-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.compact-page-header h1 { margin: 0 0 4px; font-size: 21px; }
.compact-page-header p, .backup-folder { margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.compact-details { margin: 10px 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; background: white; font-size: 11px; }
.compact-details summary { cursor: pointer; color: var(--primary-dark); font-weight: 700; }
.details-body { padding-top: 7px; }
.details-body p { margin: 4px 0; line-height: 1.45; }
.backup-table-section { margin-top: 12px; }
.backup-table-section h2 { margin: 0 0 7px; font-size: 14px; }
.backup-table-section .dense-table { min-width: 720px; }
.backup-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.backup-status-grid .notice { margin: 0; }
.read-only-note { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.assignment-grid { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); gap: 10px; align-items: start; }
.assignment-table { max-height: 285px; }
.assignment-table .dense-table { min-width: 480px; }
.assignment-actions { display: grid; gap: 5px; padding-top: 22px; }
.assignment-actions button { min-height: 30px; padding: 4px; border: 1px solid #d5d5e4; border-radius: 6px; background: white; }
.assignment-actions button:last-child { color: white; background: var(--primary); }
.compact-form { display: grid; gap: 10px; }
.form-section { display: grid; gap: 9px; padding: 10px 0 12px; border-bottom: 1px solid #d6d6e8; }
.form-section h2 { margin: 0 0 2px; font-size: 14px; }
.form-section h3 { margin: 4px 0 0; font-size: 12px; }
.compact-form label { display: grid; gap: 4px; color: var(--text); font-size: 11px; font-weight: 600; }
.compact-form input, .compact-form select, .compact-form textarea { width: 100%; min-height: 34px; padding: 6px 8px; color: var(--text); border: 1px solid #cecede; border-radius: 6px; background: white; font: inherit; font-weight: 400; }
.compact-form textarea { height: 58px; min-height: 58px; resize: vertical; }
.compact-form .toggle-field { display: flex; align-items: center; align-self: end; gap: 7px; min-height: 34px; }
.compact-form .toggle-field input { width: 16px; min-height: 16px; }
.form-row { display: grid; gap: 9px; align-items: end; }
.form-row-company { grid-template-columns: 2.2fr 1.25fr 1.25fr .75fr .65fr; }
.tax-number-control { display: flex; gap: 5px; align-items: stretch; }
.tax-number-control input { min-width: 0; }
.tax-check-button { flex: 0 0 auto; min-width: 55px; padding: 4px 9px; border: 1px solid #a99af9; border-radius: 5px; color: var(--primary-dark); background: #faf9ff; font: inherit; font-size: 10px; font-weight: 700; }
.tax-check-button:hover { background: #eeeaff; }
.tax-check-button:disabled { cursor: wait; opacity: .65; }
.tax-check-result { margin: 0 0 2px; padding: 7px 9px; border-radius: 6px; font-size: 11px; }
.tax-check-available { color: var(--success); background: #e7f7f0; }
.tax-check-existing { color: var(--danger); background: #fff0ef; }
.form-row-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.invoice-wz-section { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 9px; align-items: end; margin-top: 2px; padding: 10px; border: 1px solid #d6d6e8; border-radius: 7px; background: #f7fbff; }
.invoice-wz-heading { align-self: center; }
.invoice-wz-heading h3, .invoice-wz-heading p { margin: 0; }
.invoice-wz-heading h3 { margin-bottom: 3px; font-size: 12px; }
.invoice-transport-section { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; align-items: end; margin-top: 2px; padding: 10px; border: 1px solid #d6d6e8; border-radius: 7px; background: #fafaff; }
.invoice-transport-toggle .toggle-field { justify-content: flex-start; }
.invoice-lines-table { min-width: 1540px; }
.invoice-batch-input { min-width: 135px; }
.invoice-date-input { min-width: 130px; }
.invoice-wz-edit-summary { padding-bottom: 10px; }
.invoice-wz-edit-summary .detail-grid { margin: 0; }
.invoice-wz-edit-form { margin-top: 10px; }
.invoice-wz-edit-table { min-width: 980px; }
.invoice-line-error { display: block; margin-top: 3px; white-space: normal; }
.invoice-wz-edit-actions { justify-content: flex-start; }
.invoice-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 7px; }
.invoice-actions .button { min-height: 30px; padding: 5px 10px; font-size: 11px; }
.invoice-select-cell { width: 38px; min-width: 38px; max-width: 38px; padding: 2px 4px !important; text-align: center; }
input[type="radio"].invoice-select { appearance: auto; width: 14px; height: 14px; min-height: 14px; padding: 0; margin: 0; border: 0; background: transparent; box-shadow: none; accent-color: var(--primary); vertical-align: middle; }
input[type="radio"].invoice-select:focus { box-shadow: none; }
.form-row-location { grid-template-columns: 2.2fr 1fr 1.2fr 1.2fr; }
.form-row-location-short { grid-template-columns: 2fr 2.4fr 1.2fr; }
.compact-submit { justify-self: start; min-height: 34px; padding: 6px 16px; }
.compact-form .errorlist { margin: 0; padding: 0; color: var(--danger); list-style: none; font-size: 10px; }
.compact-search { display: flex; gap: 7px; margin-bottom: 7px; }
.compact-search input { min-height: 34px; }
.commercial-main-row { grid-template-columns: 2.2fr 2.2fr .7fr .8fr; }
.commercial-search-row { grid-template-columns: 1.4fr 1.4fr .8fr; }
.commercial-existing { max-height: 260px; }
.commercial-browser { max-height: 620px; }
.specification-upload-section { max-width: 900px; }
.specification-upload-form { display: grid; grid-template-columns: minmax(320px, 1fr) auto; gap: 10px; align-items: end; }
.specification-upload-form label { display: grid; gap: 4px; font-size: 11px; font-weight: 600; }
.specification-upload-form input { min-height: 36px; padding: 6px 8px; border: 1px solid #cecede; border-radius: 6px; background: white; }
.specification-review-shell { max-width: 1400px; margin-top: 12px; }
.specification-review-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.specification-review-heading h2, .specification-review-heading p { margin: 0; }
.specification-review-heading p { color: var(--muted); font-size: 10px; }
.specification-profile-badge { padding: 6px 9px; border-radius: 6px; color: #165a85; background: #e7f4ff; font-size: 10px; }
.specification-company-confirmation { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.specification-match-summary { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 10px; align-items: center; margin: 8px 0; }
.specification-match-label { font-size: 10px; font-weight: 700; }
.specification-identity-field span { display: flex; justify-content: space-between; gap: 8px; }
.specification-identity-field span small { color: var(--primary-dark); font-weight: 700; }
.specification-identity-field em { overflow: hidden; color: var(--muted); font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.specification-matches { display: grid; gap: 5px; }
.specification-matches-horizontal { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.specification-match { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: #fbfbfd; font-size: 9px; }
.specification-match strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.specification-match span { flex: 0 0 auto; color: var(--muted); }
.specification-match-best { border-color: #a99af9; background: #f5f2ff; }
.specification-approval-section { padding: 10px; border: 1px solid #a99af9; border-radius: 7px; background: #fbfaff; }
.specification-approval-form { display: grid; gap: 8px; }
.specification-approval-form [hidden] { display: none !important; }
.specification-mode-bar { display: flex; align-items: center; gap: 14px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }
.specification-mode-bar > span { font-size: 10px; font-weight: 700; }
.specification-approval-form #id_link_mode { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }
.specification-approval-form #id_link_mode label { display: flex; align-items: center; gap: 5px; }
.specification-approval-form #id_link_mode input { width: auto; min-height: 0; }
.specification-existing-choice label, .specification-paired-row label, .specification-document-row label { display: grid; gap: 3px; min-width: 0; }
.specification-data-matrix, .specification-document-row { margin: 0; padding: 8px 10px 6px; border: 1px solid var(--border); border-radius: 6px; }
.specification-data-matrix legend, .specification-document-row legend { padding: 0 6px; font-size: 10px; font-weight: 700; }
.specification-paired-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 5px 0; border-bottom: 1px solid #e8e7f0; }
.specification-paired-row:last-child { border-bottom: 0; }
.specification-document-row { display: grid; grid-template-columns: 1.3fr 1.3fr .7fr .8fr; gap: 10px; }
.specification-readonly-field { display: grid; gap: 3px; min-width: 0; }
.specification-readonly-field span { font-size: 10px; font-weight: 600; }
.specification-readonly-field output { display: flex; align-items: center; min-height: 34px; overflow: hidden; padding: 5px 8px; border: 1px solid #d9d8e4; border-radius: 6px; color: #45435a; background: #f1f1f6; text-overflow: ellipsis; white-space: nowrap; }
.specification-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.specification-submit-row small { color: var(--muted); }
.specification-diagnostics { margin-top: 9px; border-top: 1px solid var(--border); }
.specification-diagnostics summary { padding: 8px 2px 2px; color: var(--primary-dark); font-size: 10px; font-weight: 700; cursor: pointer; }
.specification-diagnostics-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); gap: 10px; margin-top: 7px; }
.specification-diagnostics textarea { width: 100%; height: 420px; padding: 9px; border: 1px solid var(--border); border-radius: 6px; background: #fbfbfd; color: var(--text); font: 10px/1.4 Consolas, monospace; resize: vertical; }
.specification-evidence-list { display: grid; gap: 6px; align-content: start; }
.specification-evidence-list label { display: grid; gap: 3px; }
.reference-field-section { display: grid; gap: 6px; margin: 0; padding: 7px 0 1px; border: 0; border-top: 1px solid var(--border); }
.reference-field-section legend { padding: 0 7px 0 0; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.reference-field-section:first-of-type { padding-top: 3px; border-top: 0; }
.reference-sample-table { min-width: 1595px; table-layout: fixed; }
.reference-sample-table th:nth-child(1) { width: 34px; }
.reference-sample-table th:nth-child(2) { width: 260px; }
.reference-sample-table th:nth-child(3) { width: 205px; }
.reference-sample-table th:nth-child(4) { width: 180px; }
.reference-sample-table th:nth-child(5) { width: 215px; }
.reference-sample-table th:nth-child(6) { width: 92px; }
.reference-sample-table th:nth-child(7) { width: 80px; }
.reference-sample-table th:nth-child(8) { width: 105px; }
.reference-sample-table th:nth-child(9) { width: 110px; }
.reference-sample-table th:nth-child(10) { width: 72px; }
.reference-sample-table th:nth-child(11) { width: 100px; }
.reference-sample-table th:nth-child(12) { width: 62px; }
.reference-sample-table th:nth-child(13) { width: 58px; }
.reference-sample-table th:nth-child(14) { width: 118px; }
.reference-inline-input { display: none; width: 100%; height: 24px !important; min-height: 24px !important; padding: 1px 4px !important; border: 1px solid #bbb9cf; border-radius: 4px; background: white; font-size: 10px; }
.reference-inline-save, .reference-inline-cancel { display: none; }
.reference-inline-edit, .reference-inline-save, .reference-inline-cancel { height: 24px !important; min-height: 24px !important; padding: 2px 7px !important; font-size: 9px; }
.reference-sample-table tr.is-editing .reference-display { display: none; }
.reference-sample-table tr.is-editing .reference-inline-input { display: block; }
.reference-sample-table tr.is-editing .reference-inline-edit { display: none; }
.reference-sample-table tr.is-editing .reference-inline-save,
.reference-sample-table tr.is-editing .reference-inline-cancel { display: inline-flex; }
.reference-sample-table tr.is-editing td { overflow: visible; }
.rule-editor-section { padding-bottom: 8px; }
.rule-editor-form { gap: 7px; }
.rule-editor-header { display: grid; grid-template-columns: 1fr 2.5fr .6fr; gap: 7px; }
.rule-editor-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 7px; }
.rule-editor-body textarea { height: 62px; min-height: 62px; font: 10px/1.35 Consolas, monospace; }
.rule-editor-actions { display: flex; gap: 7px; align-items: center; }
.rule-list-section { padding-top: 8px; }
.rule-table-wrap { max-height: 590px; }
.rule-table { min-width: 1200px; table-layout: fixed; }
.rule-table th:nth-child(1), .rule-table td:nth-child(1) { width: 58px; }
.rule-table th:nth-child(2), .rule-table td:nth-child(2) { width: 130px; }
.rule-table th:nth-child(3), .rule-table td:nth-child(3) { width: 230px; }
.rule-table th:nth-child(4), .rule-table td:nth-child(4) { width: 370px; }
.rule-table th:nth-child(5), .rule-table td:nth-child(5) { width: 300px; }
.rule-table th:nth-child(6), .rule-table td:nth-child(6) { width: 78px; }
.rule-table code { display: block; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.searchable-select-source { display: none !important; }
.searchable-select { position: relative; width: 100%; }
.searchable-select-input { width: 100%; }
.searchable-select-options {
    display: none; position: fixed; z-index: 1000; max-height: 260px; overflow-y: auto;
    background: #fff; border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 12px 30px rgba(24, 22, 58, .16); padding: 4px;
}
.searchable-select-options.is-open { display: block; }
.searchable-select-option {
    display: block; width: 100%; border: 0; border-radius: 6px; background: transparent;
    color: var(--ink); padding: 7px 9px; text-align: left; cursor: pointer;
}
.searchable-select-option:hover, .searchable-select-option.is-active { background: #eeeaff; }
.searchable-select-empty { color: var(--muted); padding: 8px 9px; }
.table-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; }
.commercial-filters { margin-bottom: 8px; }
.commercial-hierarchy-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.labelling-heading h1 { margin-bottom: 3px; font-size: 18px; }
.labelling-caption { margin: 0 0 4px; font-size: 10px; }
.labelling-workspace { padding-top: 4px; }
.labelling-filters { grid-template-columns: minmax(230px, 1.25fr) 80px 130px minmax(220px, 1fr) minmax(250px, 1.1fr) auto; gap: 6px; align-items: end; }
.labelling-filters label { gap: 2px; font-size: 10px; }
.labelling-filters input, .labelling-filters select { min-height: 30px; padding-top: 4px; padding-bottom: 4px; }
.labelling-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0; }
.labelling-summary .table-caption { margin: 0; }
.labelling-table { max-height: calc(100vh - 245px); min-height: 340px; }
.labelling-grid-table { min-width: 1390px; table-layout: fixed; }
.labelling-grid-table th { position: sticky; top: 0; z-index: 3; }
.labelling-grid-table th, .labelling-grid-table td { height: 30px; padding: 2px 4px; }
.labelling-change-column { width: 48px; }
.labelling-id-column { width: 62px; }
.labelling-path-column { width: 390px; }
.labelling-language-column { width: 54px; }
.labelling-phrase-column { width: 245px; }
.labelling-status-column { width: 132px; }
.labelling-row-check { width: 15px; min-height: 15px; margin: 0; accent-color: var(--primary); }
.labelling-grid-input { width: 100%; min-height: 24px; height: 24px; padding: 2px 5px; border-color: transparent; border-radius: 4px; background: transparent; font-size: 10px; }
.labelling-grid-table tr:hover .labelling-grid-input, .labelling-grid-input:focus { border-color: #cecede; background: white; }
.labelling-grid-input:focus { box-shadow: 0 0 0 2px rgba(104,71,245,.12); }
.labelling-grid-input[readonly] { color: #77758a; cursor: not-allowed; }
.labelling-grid-table tr.is-dirty td { background: #fff8d8; }
.labelling-grid-table tr.is-dirty .labelling-grid-input { border-color: #e5c967; background: #fffdf4; }
.labelling-row-inactive td { color: #8e8c9d; background: #f6f6f8; }
.labelling-language-badge { display: inline-flex; min-width: 28px; justify-content: center; padding: 2px 5px; color: #433a80; border: 1px solid #d8d1ff; border-radius: 4px; background: #f1eeff; font-size: 9px; font-weight: 800; }
.labelling-status { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 6px; border-radius: 999px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.labelling-status-ready { color: #176b49; background: #e4f5ec; }
.labelling-status-missing { color: #8a5b04; background: #fff1c7; }
.labelling-status-overflow { color: var(--danger); background: #ffe6e3; }
.labelling-savebar { position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 44px; padding: 6px 8px; border: 1px solid #d9d9e9; border-top: 0; border-radius: 0 0 7px 7px; background: rgba(250,250,255,.96); box-shadow: 0 -3px 10px rgba(48,39,105,.06); font-size: 11px; backdrop-filter: blur(8px); }
.labelling-savebar .button { min-height: 30px; padding: 5px 10px; font-size: 10px; }
.labelling-savebar button:disabled { cursor: default; opacity: .45; }
.labelling-workspace .table-caption { margin: 3px 0; }
@media (max-width: 1100px) {
    .labelling-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .labelling-summary { align-items: flex-start; flex-direction: column; gap: 2px; }
}
.ingredient-create-section { max-width: 1100px; }
.ingredient-browser-hierarchy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ingredient-browser-status { grid-template-columns: 1fr 1fr auto; align-items: end; }
.ingredient-browser-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ingredient-browser-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.ingredient-browser-caption .table-caption { margin: 0; }
.ingredient-browser-legend { display: flex; gap: 4px; font-size: 9px; line-height: 1; }
.ingredient-browser-legend span { padding: 2px 5px; border: 1px solid #d9d9e9; border-radius: 999px; white-space: nowrap; }
.ingredient-legend-selectable, .ingredient-browser-table .ingredient-selectable td { background: #e8f5e9; }
.ingredient-legend-unselectable, .ingredient-browser-table .ingredient-unselectable td { background: #fce8e8; }
.ingredient-legend-inactive, .ingredient-browser-table .ingredient-inactive td { color: #573000; background: #f7c978; }
.ingredient-browser-table .ingredient-inactive td { font-weight: 600; }
.ingredient-browser-table .ingredient-inactive td:first-child { box-shadow: inset 5px 0 0 #c86500; }
.ingredient-legend-inactive { border-color: #c86500 !important; }
.ingredient-browser-table { max-height: 65vh; }
.ingredient-browser-table .dense-table { min-width: 760px; }
.ingredient-browser-table .dense-table th, .ingredient-browser-table .dense-table td { height: 25px; padding: 3px 6px; }
.ingredient-browser-table .dense-table th { position: sticky; top: 0; z-index: 1; }
.ingredient-browser-table .dense-table th:nth-child(2), .ingredient-browser-table .dense-table td:nth-child(2) { max-width: 640px; min-width: 340px; }
.ingredient-allergen-editor { max-width: 980px; }
.ingredient-allergen-inherit { display: flex !important; grid-template-columns: auto 1fr; align-items: center; justify-content: start; gap: 7px !important; }
.ingredient-allergen-inherit input { width: auto; }
.ingredient-allergen-choices { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 5px 12px; margin: 8px 0; padding: 10px; border: 1px solid var(--border); border-radius: 7px; }
.ingredient-allergen-choices legend { padding: 0 5px; font-weight: 700; }
.ingredient-allergen-choices label { display: flex; flex-direction: row; align-items: center; gap: 6px; font-weight: 500; }
.ingredient-allergen-choices input { width: auto; }
.ingredient-allergen-choices small { color: var(--muted); }
@media (max-width: 900px) {
    .ingredient-browser-hierarchy, .ingredient-browser-status { grid-template-columns: 1fr; }
    .ingredient-allergen-choices { grid-template-columns: 1fr; }
}
.ingredient-create-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact-form label.ingredient-group-toggle { display: inline-flex; width: max-content; align-items: center; gap: 6px; }
.compact-form .ingredient-group-toggle input[type="checkbox"] { flex: 0 0 auto; width: 14px; height: 14px; min-height: 14px; padding: 0; margin: 0; border-radius: 3px; accent-color: var(--primary); }
.ingredient-create-field { grid-template-rows: auto 1fr auto auto; }
.ingredient-field-guidance { display: block; min-height: 76px; box-sizing: border-box; font-weight: 400; }
.ingredient-comment-field textarea { min-height: 68px; resize: vertical; }
.ingredient-name-rule { line-height: 1.45; }
.ingredient-name-rule code { font-size: 10px; font-weight: 700; }
.ingredient-existing-names { padding: 8px 10px; border: 1px solid #dedbea; border-radius: 7px; background: #faf9ff; }
.ingredient-existing-names-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 10px; }
.ingredient-existing-names-heading span { color: var(--muted); }
.ingredient-existing-names ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px; max-height: 180px; margin: 7px 0 0; padding: 0; overflow-y: auto; list-style: none; }
.ingredient-existing-names li { padding: 4px 6px; border-radius: 4px; background: white; font-size: 10px; overflow-wrap: anywhere; }
.ingredient-name-editor { max-width: 760px; margin-bottom: 10px; }
.ingredient-name-editor h3 { margin-top: 0; }
.ingredient-name-editor-actions { display: flex; gap: 8px; }
.ingredient-create-submit { width: 100%; min-height: 36px; }

@media (max-width: 900px) {
    .ingredient-existing-names ul { grid-template-columns: 1fr; }
    .ingredient-field-guidance { min-height: 0; }
}

.ciqual-workspace { padding: 9px 11px; }
.ciqual-heading { align-items: center; margin-bottom: 5px; }
.ciqual-heading-copy { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ciqual-heading h1 { margin: 0; font-size: 18px; }
.ciqual-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.ciqual-meta-bar { display: flex; align-items: center; gap: 12px; min-height: 26px; padding: 3px 0; border-top: 1px solid #eceaf4; border-bottom: 1px solid #eceaf4; }
.ciqual-meta-bar > a { margin-left: auto; font-size: 10px; white-space: nowrap; }
.ciqual-rules { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin: 0; font-size: 9px; }
.ciqual-rules span { padding: 3px 7px; border: 1px solid #d8d5e8; border-radius: 999px; background: #f7f6fc; }
.ciqual-rules code { font-size: 9px; }
.ciqual-source { margin: 3px 0 5px; color: var(--muted); font-size: 9px; }
.ciqual-summary { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; margin: 0; font-size: 9px; }
.ciqual-filter { display: flex; align-items: center; gap: 4px; }
.ciqual-filter label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; }
.ciqual-filter select { min-height: 26px; padding: 3px 24px 3px 7px; font-size: 10px; }
.ciqual-table-wrap { max-height: calc(100vh - 205px); }
.ciqual-table { min-width: 1040px; table-layout: fixed; }
.ciqual-table th { position: sticky; top: 0; z-index: 2; }
.ciqual-table td { padding: 5px 7px; vertical-align: top; }
.ciqual-table th:nth-child(1) { width: 24%; }
.ciqual-table th:nth-child(2) { width: 22%; }
.ciqual-table th:nth-child(3) { width: 31%; }
.ciqual-table th:nth-child(4) { width: 11%; }
.ciqual-table th:nth-child(5) { width: 12%; }
.ciqual-table td > span, .ciqual-table td > small { display: block; margin-top: 3px; }
.ciqual-product-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ciqual-row-ready td { background: #fff8df; }
.ciqual-row-imported td { background: #e8f5e9; }
.ciqual-status { display: inline-flex !important; width: fit-content; padding: 3px 6px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.ciqual-status-pending { color: #8b4a00; background: #ffe3b2; }
.ciqual-status-ready { color: #725500; background: #fff0aa; }
.ciqual-status-imported { color: #176b49; background: #cfeede; }
.ciqual-warning { color: #a13c25; font-weight: 700; }
.ciqual-warning-list small { display: block; margin-top: 3px; }
.ciqual-mapping-notes { margin-top: 4px; }
.ciqual-mapping-notes summary { width: fit-content; color: var(--muted); cursor: pointer; font-size: 9px; }
.ciqual-mapping-notes textarea { min-height: 45px; margin-top: 3px; }
.ciqual-actions { display: flex; align-items: stretch; gap: 4px; flex-wrap: wrap; }
.ciqual-actions .mini-action { flex: 1 1 auto; white-space: nowrap; }
.ciqual-done { color: #176b49; font-weight: 800; }
.ciqual-table .searchable-select-input { min-height: 31px; padding: 5px 7px; font-size: 10px; }
.ciqual-nutrition summary { cursor: pointer; font-weight: 700; }
.ciqual-nutrition ul { min-width: 230px; margin: 5px 0 0; padding: 0; list-style: none; }
.ciqual-nutrition li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 2px 0; border-bottom: 1px solid #eceaf4; }
.ciqual-nutrition li small { grid-column: 1 / -1; color: var(--muted); }
@media (max-width: 1100px) {
    .ciqual-heading-copy { display: block; }
    .ciqual-meta-bar { align-items: flex-start; flex-wrap: wrap; }
    .ciqual-meta-bar > a { margin-left: 0; }
}
.mini-action-primary { color: white; border-color: var(--primary); background: var(--primary); }

/* Zwarty kreator receptury produktu. */
.recipe-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.recipe-heading h1 { margin: 0; }
.recipe-builder { display: grid; gap: 8px; }
.recipe-classification-row { display: grid; grid-template-columns: minmax(370px, 1.45fr) minmax(150px, .6fr) minmax(260px, 1.2fr) minmax(260px, 1.2fr); gap: 7px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: white; }
.recipe-identity-fields { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(130px, .48fr); gap: 7px; min-width: 0; }
.recipe-field { display: grid; min-width: 0; gap: 3px; }
.recipe-field > span, .recipe-measurement-field > span, .recipe-sample-size-field > span, .recipe-post-batch-field > span { color: var(--muted); font-size: 10px; font-weight: 700; }
.recipe-field input, .recipe-field select, .recipe-measurement-field select { width: 100%; min-height: 30px; padding: 4px 7px; color: var(--text); background: white; border: 1px solid #cecede; border-radius: 5px; font: inherit; font-size: 11px; }
.recipe-storage-control { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 5px; min-width: 0; color: inherit; font-size: inherit; font-weight: inherit; }
.recipe-storage-icon { display: inline-grid; width: 28px; height: 30px; place-items: center; border: 1px solid #bad4ea; border-radius: 5px; background: #eef7ff; font-size: 15px; line-height: 1; }
.recipe-storage-icon.is-confidential { border-color: #efd38a; background: #fff7dc; }
.recipe-category-field .searchable-select { width: 100%; }
.recipe-category-field .searchable-select-input { min-height: 30px; padding: 4px 7px; border-radius: 5px; font-size: 11px; }
.recipe-workbench-section, .recipe-composition-section { border: 1px solid var(--border); border-radius: 8px; background: white; }
.recipe-strip-heading { display: flex; min-height: 36px; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 8px; border-bottom: 1px solid var(--border); }
.recipe-strip-heading h2 { margin: 0; font-size: 13px; }
.recipe-strip-heading p { margin: 1px 0 0; color: var(--muted); font-size: 9px; }
.recipe-map-link { min-height: 27px; padding: 3px 8px; font-size: 10px; }
.recipe-workbench { display: flex; min-height: 118px; align-items: flex-start; gap: 8px; padding: 8px; overflow-x: auto; }
.recipe-workbench-empty { min-height: 118px; padding: 49px 12px; color: var(--muted); text-align: center; font-size: 10px; }
.recipe-workbench:not(:empty) + .recipe-workbench-empty { display: none; }
.recipe-workbench .recipe-workbench-item { position: relative; flex: 0 0 104px; width: 104px; max-width: 104px; min-height: 100px; }
.recipe-workbench .product-map-overview-card { animation: none; }
.recipe-workbench .product-map-bubble { cursor: pointer; }
.recipe-workbench .recipe-workbench-item .product-map-bubble-label { width: 104px; margin-top: 5px; font-size: 9px; line-height: 1.15; }
.recipe-producer-badge { position: absolute; top: -3px; left: 10px; z-index: 2; display: grid; width: 24px; height: 24px; place-items: center; overflow: hidden; padding: 2px; color: #3f3b69; background: white; border: 1px solid #cbc7e4; border-radius: 6px; box-shadow: 0 2px 7px rgba(37, 36, 61, .22); font-size: 7px; font-weight: 800; line-height: 1; }
.recipe-producer-badge.has-logo { padding: 2px; }
.recipe-producer-badge img { display: block; width: 100%; height: 100%; object-fit: contain; }
.recipe-workbench-remove { position: absolute; top: -3px; right: 5px; z-index: 2; display: grid; width: 20px; height: 20px; place-items: center; padding: 0; color: #6d6b86; background: white; border: 1px solid #cecede; border-radius: 50%; font-size: 15px; line-height: 1; }
.recipe-workbench-remove:hover { color: white; background: var(--danger); border-color: var(--danger); }
.recipe-measurement-field, .recipe-sample-size-field, .recipe-post-batch-field { display: flex; align-items: center; gap: 6px; }
.recipe-measurement-field select { width: 54px; }
.recipe-sample-size-input { display: flex; align-items: center; gap: 4px; }
.recipe-sample-size-input input { width: 92px; min-height: 27px; padding: 3px 6px; border: 1px solid #cecede; border-radius: 4px; font: inherit; font-size: 10px; }
.recipe-sample-size-input > span { min-width: 15px; color: var(--muted); font-size: 10px; font-weight: 700; }
.recipe-post-batch-input { display: flex; align-items: center; gap: 4px; }
.recipe-post-batch-input input { width: 62px; min-height: 27px; padding: 3px 6px; border: 1px solid #cecede; border-radius: 4px; font: inherit; font-size: 10px; }
.recipe-post-batch-input > span { min-width: 15px; color: var(--muted); font-size: 10px; font-weight: 700; }
.recipe-table-wrap { overflow-x: auto; }
.recipe-table {
    --recipe-grid-line: #d9ddea;
    --recipe-col-order: 34px;
    --recipe-col-ingredient: 255px;
    --recipe-col-declared: 80px;
    --recipe-col-function: 145px;
    --recipe-col-labelling: 150px;
    --recipe-col-omit: var(--recipe-col-declared);
    --recipe-col-drag: 40px;
    --recipe-col-pre-batch: 68px;
    --recipe-col-post-batch: 68px;
    --recipe-col-calculation-basis: 56px;
    --recipe-col-nutrient: 45px;
    --recipe-col-action: 26px;
    min-width: 1282px;
    table-layout: fixed;
}
.recipe-table col.recipe-col-order { width: var(--recipe-col-order); }
.recipe-table col.recipe-col-ingredient { width: var(--recipe-col-ingredient); }
.recipe-table col.recipe-col-declared { width: var(--recipe-col-declared); }
.recipe-table col.recipe-col-function { width: var(--recipe-col-function); }
.recipe-table col.recipe-col-labelling { width: var(--recipe-col-labelling); }
.recipe-table col.recipe-col-omit { width: var(--recipe-col-omit); }
.recipe-table col.recipe-col-drag { width: var(--recipe-col-drag); }
.recipe-table col.recipe-col-pre-batch { width: var(--recipe-col-pre-batch); }
.recipe-table col.recipe-col-post-batch { width: var(--recipe-col-post-batch); }
.recipe-table col.recipe-col-calculation-basis { width: var(--recipe-col-calculation-basis); }
.recipe-table col.recipe-col-nutrient { width: var(--recipe-col-nutrient); }
.recipe-table col.recipe-col-action { width: var(--recipe-col-action); }
.recipe-table th, .recipe-table td { height: 27px; padding: 2px 5px; }
.recipe-table thead tr > th + th,
.recipe-table tbody tr > td + td,
.recipe-table tfoot tr > td + td {
    border-left: 1px solid var(--recipe-grid-line);
}
.recipe-table th { font-size: 9px; }
.recipe-table thead th[rowspan] { vertical-align: middle; }
.recipe-nutrition-group { text-align: center; border-left: 1px solid var(--border); }
.recipe-nutrition-headings th { padding: 2px 1px; text-align: center; white-space: normal; line-height: 1.05; }
.recipe-nutrition-headings .recipe-pre-value-column, .recipe-nutrition-headings .recipe-post-value-column { width: var(--recipe-col-pre-batch); min-width: var(--recipe-col-pre-batch); max-width: var(--recipe-col-pre-batch); padding: 3px 3px; white-space: normal; }
.recipe-nutrition-headings .recipe-process-unit-column { width: var(--recipe-col-calculation-basis); min-width: var(--recipe-col-calculation-basis); max-width: var(--recipe-col-calculation-basis); padding: 3px 2px; white-space: nowrap; }
.recipe-nutrition-headings .recipe-pre-value-column { border-left: 1px solid var(--border); }
.recipe-nutrition-headings th:nth-child(4), .recipe-table tbody td:nth-child(11) { border-left: 1px solid var(--border); }
.recipe-table tbody select, .recipe-table tbody input { width: 100%; min-height: 23px; height: 23px; padding: 2px 5px; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 3px; font: inherit; font-size: 10px; }
.recipe-table tbody input[data-nutrient] { min-width: 24px; padding-right: 2px; padding-left: 2px; text-align: right; }
.recipe-table tbody tr:hover select, .recipe-table tbody tr:hover input, .recipe-table tbody select:focus, .recipe-table tbody input:focus { background: white; border-color: #cecede; }
.recipe-order-column { width: var(--recipe-col-order); }
.recipe-ingredient-column { width: var(--recipe-col-ingredient); min-width: var(--recipe-col-ingredient); max-width: var(--recipe-col-ingredient); }
.recipe-declared-column { width: var(--recipe-col-declared); min-width: var(--recipe-col-declared); text-align: center; white-space: nowrap; }
.recipe-function-column { width: var(--recipe-col-function); min-width: var(--recipe-col-function); padding-left: 10px !important; }
.recipe-table tbody td:nth-child(5) { padding-left: 10px; }
.recipe-labelling-column { width: var(--recipe-col-labelling); min-width: var(--recipe-col-labelling); }
.recipe-omit-column { width: var(--recipe-col-omit); min-width: var(--recipe-col-omit); text-align: center; white-space: normal; }
.recipe-drag-column { width: var(--recipe-col-drag); min-width: var(--recipe-col-drag); }
.recipe-process-control-cell { padding: 6px 3px !important; vertical-align: middle !important; text-transform: none; }
.recipe-process-control-cell > label { display: grid; width: 100%; justify-items: stretch; gap: 3px; text-align: left; }
.recipe-process-control-cell .recipe-measurement-field > span { line-height: 1.1; white-space: normal; }
.recipe-process-control-cell .recipe-sample-size-input, .recipe-process-control-cell .recipe-post-batch-input { display: block; width: 100%; }
.recipe-process-control-cell .recipe-sample-size-input input, .recipe-process-control-cell .recipe-post-batch-input input { width: 100%; min-width: 0; text-align: left; }
.recipe-process-control-cell .recipe-sample-size-input > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.recipe-process-control-cell .recipe-post-batch-input > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.recipe-process-control-cell .recipe-measurement-field select { width: 100%; min-height: 27px; padding: 2px 5px; font-size: 10px; text-align: right; text-align-last: right; }
.recipe-action-column { width: 34px; }
.recipe-row-number { color: var(--muted); text-align: center; font-size: 10px; }
.recipe-pre-value-cell { width: var(--recipe-col-pre-batch); min-width: var(--recipe-col-pre-batch); max-width: var(--recipe-col-pre-batch); }
.recipe-post-value-cell { width: var(--recipe-col-post-batch); min-width: var(--recipe-col-post-batch); max-width: var(--recipe-col-post-batch); }
.recipe-process-unit-cell { width: var(--recipe-col-calculation-basis); min-width: var(--recipe-col-calculation-basis); max-width: var(--recipe-col-calculation-basis); }
.recipe-pre-value-cell input[data-ingredient-value] { width: 100%; text-align: right; font-size: 10px; font-weight: 400; }
.recipe-post-value-cell { color: #6d6b86; background: #f5f5f9; text-align: right; font-variant-numeric: tabular-nums; }
.recipe-post-value-cell output { font: inherit; font-size: 10px; font-weight: 400; }
.recipe-process-unit-cell { padding-right: 5px !important; text-align: right; }
.recipe-process-unit-cell .recipe-unit-fill { width: 100%; text-align: right; }
.recipe-post-total { display: block; color: #6d6b86; text-align: right; font-variant-numeric: tabular-nums; }
.recipe-total, .recipe-total-unit { display: block; text-align: right; font-variant-numeric: tabular-nums; }
.recipe-total-unit { color: var(--primary-dark); }
.recipe-post-batch-input input.is-invalid { color: var(--danger); background: #fff0ef; border-color: var(--danger); }
.recipe-declared-cell { text-align: center; }
.recipe-omit-cell { text-align: center; }
.recipe-table tbody :is(.recipe-declared-checkbox, .recipe-omit-checkbox) { width: 14px; min-width: 14px; height: 14px; min-height: 14px; padding: 0; vertical-align: middle; accent-color: var(--primary); }
.recipe-table tbody select[data-additive-function].needs-value { color: #8a5200; background: #fff7e6; border-color: #d99a32; }
.recipe-value-drag { display: block; width: 34px; height: 22px; margin: 0 auto; padding: 0; color: #625b91; background: #f2efff; border: 1px solid #cbc7e4; border-radius: 4px; cursor: ew-resize; font-size: 10px; font-weight: 800; line-height: 20px; text-align: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.recipe-value-drag:hover, .recipe-value-drag:focus-visible, .recipe-value-drag.is-dragging { color: white; background: var(--primary); border-color: var(--primary); outline: none; }
.recipe-value-drag.is-dragging { cursor: grabbing; box-shadow: 0 0 0 2px rgba(104, 71, 245, .18); }
.recipe-unit-fill { min-width: 22px; height: 22px; padding: 0 3px; color: var(--primary-dark); background: transparent; border: 1px solid transparent; border-radius: 3px; font-size: 10px; font-weight: 800; }
.recipe-unit-fill:hover, .recipe-unit-fill:focus-visible { border-color: #cbc7e4; background: #f2efff; outline: none; }
.recipe-remove { width: 22px; height: 22px; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 50%; font-size: 16px; line-height: 1; }
.recipe-remove:hover:not(:disabled) { color: var(--danger); background: #fff0ef; }
.recipe-remove:disabled { opacity: .2; cursor: default; }
.recipe-table tfoot td { height: 34px; padding-top: 8px; background: #fafaff; font-size: 10px; vertical-align: middle; }
.recipe-total-label { padding-right: 8px !important; text-align: right; font-weight: 800; text-transform: uppercase; }
.recipe-total { font-weight: 800; }
.recipe-nutrition-total { color: #3f3b69; text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }
.recipe-nutrition-total.is-estimate { color: #8a5200; }
.recipe-total.is-complete { color: var(--success); }
.recipe-table-actions { display: flex; align-items: center; gap: 9px; padding: 4px 5px 5px; }
.recipe-nutrition-warning { margin-left: auto; color: #8a5200; font-size: 9px; font-weight: 650; }
.recipe-information-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(620px, 1.2fr); gap: 8px; margin-top: 8px; align-items: stretch; }
.recipe-labelling-section, .recipe-product-nutrition-section { padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: white; }
.recipe-labelling-section h2 { margin: 0 0 6px; font-size: 13px; }
.recipe-labelling-section p { margin: 3px 0; font-size: 11px; line-height: 1.45; }
.recipe-allergen-summary { margin-top: 12px; padding-top: 9px; border-top: 1px solid #e3e1eb; }
.recipe-labelling-section .recipe-allergen-note { margin-top: 7px; color: var(--muted); font-size: 9px; }
.recipe-product-nutrition-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 7px; }
.recipe-product-nutrition-heading h2 { margin: 0; font-size: 13px; }
.recipe-product-nutrition-controls { display: flex; align-items: end; gap: 7px; }
.recipe-product-nutrition-controls label { display: grid; gap: 3px; color: var(--muted); font-size: 9px; font-weight: 700; }
.recipe-product-nutrition-controls select, .recipe-product-nutrition-controls input { min-height: 25px; padding: 3px 6px; color: var(--text); background: white; border: 1px solid #cecede; border-radius: 4px; font: inherit; font-size: 10px; }
.recipe-product-nutrition-controls select { width: 70px; }
.recipe-portion-input { display: grid; grid-template-columns: 76px 20px; align-items: center; gap: 4px; }
.recipe-portion-input input { width: 76px; min-width: 0; }
.recipe-portion-input > span { color: var(--text); font-size: 10px; }
.recipe-product-nutrition-table-wrap { overflow-x: auto; }
.recipe-product-nutrition-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.recipe-product-nutrition-table th, .recipe-product-nutrition-table td { padding: 3px 6px; border-top: 1px solid var(--border); text-align: right; font-variant-numeric: tabular-nums; }
.recipe-product-nutrition-table thead th { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.recipe-product-nutrition-table th:first-child { width: 38%; text-align: left; }
.recipe-product-nutrition-table tbody th { font-weight: 600; }
.recipe-product-nutrition-table tbody tr:nth-child(3) th, .recipe-product-nutrition-table tbody tr:nth-child(5) th { padding-left: 16px; font-weight: 500; }
.recipe-product-nutrition-table td:last-child { font-weight: 800; }
.recipe-rws-note { margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.35; }
@media (max-width: 1050px) { .recipe-information-grid { grid-template-columns: 1fr; } }
.recipe-claims-section { padding: 9px 11px 11px; border: 1px solid var(--border); border-radius: 8px; background: white; }
.recipe-claims-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.recipe-claims-heading h2 { margin: 0; font-size: 13px; }
.recipe-claims-heading p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.recipe-claims-warning { max-width: 520px; color: #8a5200; font-size: 9px; font-weight: 650; text-align: right; }
.recipe-claims-grid { display: grid; grid-template-columns: minmax(245px, 1.15fr) repeat(3, minmax(210px, 1fr)); gap: 9px; }
.recipe-claim-card { min-width: 0; padding: 9px 10px; border: 1px solid #e2e0ec; border-radius: 7px; background: #fcfcff; }
.recipe-claim-card h3, .recipe-claim-card h4 { margin: 0; color: #34324b; font-size: 10px; }
.recipe-origin-content { display: flex; align-items: center; gap: 11px; margin-top: 7px; }
.recipe-origin-pie { display: grid; flex: 0 0 86px; width: 86px; height: 86px; place-items: center; border-radius: 50%; background: #ecebf3; box-shadow: inset 0 0 0 1px rgba(42, 39, 70, .08); }
.recipe-origin-pie::after { content: ''; grid-area: 1 / 1; width: 42px; height: 42px; border-radius: 50%; background: #fcfcff; box-shadow: 0 0 0 1px rgba(42, 39, 70, .06); }
.recipe-origin-pie > span { z-index: 1; grid-area: 1 / 1; color: var(--muted); font-size: 10px; font-weight: 800; }
.recipe-origin-legend { display: grid; flex: 1 1 auto; gap: 3px; margin: 0; padding: 0; list-style: none; color: #4d4a65; font-size: 9px; }
.recipe-origin-legend li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 5px; }
.recipe-origin-swatch { width: 8px; height: 8px; border-radius: 2px; }
.recipe-origin-value { font-weight: 800; font-variant-numeric: tabular-nums; }
.recipe-claim-note { min-height: 12px; margin: 5px 0 0; color: var(--muted); font-size: 8px; }
.recipe-claim-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.recipe-claim-title output { color: #153f75; font-size: 11px; font-weight: 850; font-variant-numeric: tabular-nums; }
.recipe-protein-card .recipe-claim-gauge, .recipe-fibre-card .recipe-claim-gauge { margin-top: 27px; }
.recipe-claim-gauge { position: relative; display: flex; height: 15px; overflow: visible; border: 1px solid #d7d5e2; border-radius: 4px; background: #ecebf3; }
.recipe-claim-range:first-child { border-radius: 3px 0 0 3px; }
.recipe-claim-range:nth-last-of-type(2) { border-radius: 0 3px 3px 0; }
.recipe-claim-range.is-low { background: #f3d9d4; }
.recipe-claim-range.is-medium { background: #f4df9d; }
.recipe-claim-range.is-high { background: #b9ddbd; }
.recipe-claim-marker { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1px; background: #083b78; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.8); }
.recipe-claim-scale { position: relative; display: flex; justify-content: space-between; height: 15px; margin-top: 3px; color: var(--muted); font-size: 8px; font-variant-numeric: tabular-nums; }
.recipe-claim-scale span:not(:first-child):not(:last-child) { position: absolute; transform: translateX(-50%); }
.recipe-add-row { min-height: 24px; padding: 2px 8px; color: var(--primary-dark); background: white; border: 1px solid #cbc7e4; border-radius: 4px; font-size: 10px; font-weight: 700; }
.recipe-add-row:disabled { opacity: .45; cursor: default; }
.recipe-balance { color: var(--muted); font-size: 9px; }
.recipe-balance.is-error { color: var(--danger); font-weight: 700; }
.recipe-balance.is-complete { color: var(--success); font-weight: 700; }
.recipe-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 1px; }
.recipe-footer p { margin: 0; color: var(--muted); font-size: 9px; }
.recipe-footer-actions { display: flex; gap: 5px; }
.recipe-footer-actions .button { min-height: 28px; padding: 4px 9px; font-size: 10px; }

@media (max-width: 900px) {
    .recipe-classification-row { grid-template-columns: 1fr; }
    .recipe-identity-fields { grid-template-columns: minmax(190px, 1fr) minmax(130px, .55fr); }
    .recipe-footer { align-items: stretch; flex-direction: column; }
    .recipe-footer-actions { justify-content: flex-end; }
    .recipe-claims-grid { grid-template-columns: 1fr; }
}
.demand-heading h1 { margin-bottom: 3px; font-size: 18px; }
.demand-customer-section { display: grid; gap: 6px; padding-top: 2px; }
.demand-customer-picker { max-width: 100%; }
.demand-existing-table { max-height: 330px; }
.demand-existing-table .dense-table, .demand-review-table .dense-table { min-width: 1450px; }
.demand-existing-table .dense-table th, .demand-existing-table .dense-table td,
.demand-review-table .dense-table th, .demand-review-table .dense-table td { padding: 4px 6px; }
.demand-add-section { padding-top: 9px; }
.demand-source-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.demand-create-form { gap: 7px; }
.demand-quantity-row { grid-template-columns: .7fr 1.4fr 1.4fr; }
.demand-price-row { grid-template-columns: 1.2fr .7fr 2fr; }
.demand-search-section { padding-top: 2px; }
.demand-search-filters { grid-template-columns: 2.2fr 2.2fr .9fr 1.3fr; gap: 7px; align-items: end; margin-top: 7px; }
.demand-year-filter { display: grid; grid-template-columns: 1fr; gap: 3px; }
.demand-year-filter .toggle-field { min-height: 18px; }
.demand-review-table { max-height: 650px; }
.compact-warning-text { color: #76510b; }
.packaging-heading h1 { margin-bottom: 3px; font-size: 18px; }
.packaging-company-section { display: grid; gap: 6px; padding-top: 2px; }
.packaging-table { max-height: 520px; }
.packaging-table .dense-table { min-width: 2200px; }
.packaging-table .dense-table th, .packaging-table .dense-table td { padding: 4px 6px; }
.packaging-table .dense-table th:nth-child(2), .packaging-table .dense-table td:nth-child(2) { min-width: 210px; }
.packaging-create-section { padding-top: 9px; }
.packaging-header-row { grid-template-columns: 2.2fr 2.2fr .7fr; }
.packaging-level-row { grid-template-columns: 1.1fr 1.5fr 2.1fr 2fr; }
.quotation-heading h1 { margin-bottom: 3px; font-size: 18px; }
.quote-relation-picker { padding-top: 2px; }
.quote-create-section { padding-top: 7px; }
.quote-link-row, .quote-two-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quote-three-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quote-comment-row { grid-template-columns: 4fr .7fr; }
.qin-filters { grid-template-columns: .7fr 1.4fr 1.8fr 1.8fr 1.8fr; gap: 7px; align-items: end; }
.qin-supplier-active-section { padding-top: 6px; }
.qin-supplier-active-section .table-caption { margin-bottom: 3px; }
.qin-supplier-active-table { max-height: 210px; }
.qin-supplier-active-table .dense-table { min-width: 1550px; }
.qin-supplier-active-table .dense-table th,
.qin-supplier-active-table .dense-table td { height: 25px; padding: 3px 5px; }
.qin-supplier-active-table .dense-table th:nth-child(2),
.qin-supplier-active-table .dense-table td:nth-child(2) { min-width: 230px; max-width: 230px; }
.qin-supplier-active-table .dense-table th:nth-child(3),
.qin-supplier-active-table .dense-table td:nth-child(3) { min-width: 190px; max-width: 190px; }
.qin-supplier-active-table .dense-table th:nth-child(15),
.qin-supplier-active-table .dense-table td:nth-child(15) { min-width: 230px; max-width: 230px; }
.qout-source-filters { grid-template-columns: .8fr 1.35fr 1.8fr 1.8fr; gap: 7px; align-items: end; margin-bottom: 7px; }
.qout-browse-filters { grid-template-columns: .65fr 1.1fr 1.45fr 1.55fr 1.1fr 1.15fr; gap: 7px; align-items: end; }
.quotation-rate-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 5px 0; color: var(--muted); font-size: 11px; }
.quotation-rate-bar .table-caption { margin: 0 auto 0 0; }
.quotation-rate-bar form { margin: 0; }
.quotation-total-cell, .project-value-cell, .margin-percent-cell { font-weight: 650; }
.sample-company-picker { grid-template-columns: .75fr 2fr .75fr 2fr; gap: 7px; align-items: end; }
.sample-relation-row { grid-template-columns: 1.4fr 2fr 1.4fr; }
.sample-date-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sample-filters { grid-template-columns: 1.35fr 1.7fr 1.35fr 1fr 1.35fr 1fr 1fr 1.15fr 1fr; gap: 7px; align-items: end; }
.sample-search { grid-column: span 3; }
.sample-table .dense-table { min-width: 1900px; }
.sample-table { max-height: 720px; }
.sample-existing { max-height: 260px; }
.sample-existing .dense-table { min-width: 1450px; }
.interaction-company-picker { grid-template-columns: .8fr 2.5fr; gap: 7px; align-items: end; }
.interaction-link-row { grid-template-columns: 1fr 1fr; }
.interaction-new-thread-row { grid-template-columns: 3fr 1fr; }
.interaction-main-row { grid-template-columns: 1.1fr 1fr 1fr .8fr; }
.interaction-history-table { max-height: 235px; }
.interaction-history-table .dense-table { min-width: 1400px; }
.interaction-filters { grid-template-columns: 1.5fr 1.5fr 1fr 1fr 1fr 1fr 1.1fr 1.5fr; gap: 7px; align-items: end; }
.interaction-thread-create { grid-template-columns: 3fr 1fr auto; align-items: end; margin-top: 8px; }
.interaction-table { max-height: 720px; }
.interaction-table .dense-table { min-width: 2100px; }
.quote-source-table { max-height: 340px; }
.quote-source-table .dense-table { min-width: 1450px; }
.quotation-table { max-height: 650px; }
.quotation-table .dense-table { min-width: 3220px; }
.quotation-select-cell { width: 40px; min-width: 40px; max-width: 40px; padding: 2px 4px !important; text-align: center; }
input[type="checkbox"].quotation-select { appearance: auto; width: 14px; height: 14px; min-height: 14px; padding: 0; margin: 0; border: 0; border-radius: 2px; background: transparent; box-shadow: none; accent-color: var(--primary); vertical-align: middle; }
input[type="checkbox"].quotation-select:focus { box-shadow: none; }
.quotation-actions { display: flex; gap: 7px; }
.quotation-actions .section-save { width: auto; min-width: 220px; }
.quotation-table .dense-table th, .quotation-table .dense-table td,
.quote-source-table .dense-table th, .quote-source-table .dense-table td { padding: 4px 6px; }
.mini-action { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 7px; color: var(--primary-dark); background: white; border: 1px solid #cfcbe7; border-radius: 5px; font: inherit; font-size: 10px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.quote-source-caption { margin-bottom: 4px; }

/* Dashboard: zwarty układ wzorowany na tabeli Streamlit. */
.workspace-heading + .dashboard-caption { margin-top: -5px; margin-bottom: 7px; }
.dashboard-filters.compact-form { display: grid; grid-template-columns: 2.2fr 2fr .85fr .85fr; gap: 8px; align-items: end; margin-bottom: 5px; }
.dashboard-filters.compact-form label { gap: 2px; }
.dashboard-filters.compact-form input,
.dashboard-filters.compact-form select { min-height: 30px; height: 30px; padding: 4px 7px; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; margin: 4px 0 6px; padding: 0 2px; }
.dashboard-metrics div { display: flex; flex-direction: column; gap: 1px; padding: 2px 0; border: 0; border-radius: 0; background: transparent; }
.dashboard-metrics span { order: 0; color: var(--muted); font-size: 9px; }
.dashboard-metrics strong { order: 1; font-size: 20px; font-weight: 500; line-height: 1.1; }
.dashboard-details { margin: 4px 0 6px; padding: 5px 8px; border: 1px solid #d1d5e4; border-radius: 5px; background: transparent; }
.dashboard-details pre { margin-bottom: 0; }
.dashboard-table-wrap { height: 560px; max-height: 560px; border-radius: 5px; }
.dashboard-table.dashboard-table { width: 2250px; min-width: 2250px; table-layout: fixed; font-size: 10px; }
.dashboard-table.dashboard-table th,
.dashboard-table.dashboard-table td { height: 27px; max-height: 27px; padding: 3px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.15; }
.dashboard-table.dashboard-table thead th { position: sticky; top: 0; z-index: 2; height: 28px; white-space: normal; }
.dashboard-table .dashboard-col-select { width: 42px; min-width: 42px; max-width: 42px; text-align: center; }
.dashboard-table .dashboard-col-company { width: 190px; min-width: 190px; max-width: 190px; }
.dashboard-table .dashboard-col-customer { width: 50px; min-width: 50px; max-width: 50px; text-align: right; }
.dashboard-table .dashboard-col-thread { width: 180px; min-width: 180px; max-width: 180px; }
.dashboard-table .dashboard-col-status { width: 54px; min-width: 54px; max-width: 54px; }
.dashboard-table .dashboard-col-importance { width: 54px; min-width: 54px; max-width: 54px; text-align: right; }
.dashboard-table .dashboard-col-contact { width: 120px; min-width: 120px; max-width: 120px; }
.dashboard-table .dashboard-col-phone { width: 150px; min-width: 150px; max-width: 150px; }
.dashboard-table .dashboard-col-last-date { width: 76px; min-width: 76px; max-width: 76px; }
.dashboard-table .dashboard-col-next-date { width: 104px; min-width: 104px; max-width: 104px; }
.dashboard-table .dashboard-col-subject { width: 260px; min-width: 260px; max-width: 260px; }
.dashboard-table .dashboard-col-note { width: 310px; min-width: 310px; max-width: 310px; }
.dashboard-table .dashboard-col-summary { width: 300px; min-width: 300px; max-width: 300px; }
.dashboard-table .dashboard-col-score { width: 58px; min-width: 58px; max-width: 58px; text-align: right; }
.dashboard-table .dashboard-col-due { width: 57px; min-width: 57px; max-width: 57px; }
.dashboard-table .dashboard-col-count { width: 52px; min-width: 52px; max-width: 52px; text-align: right; }
.dashboard-date { width: 98px; min-height: 21px; height: 21px; padding: 1px 3px; border-radius: 3px; font-size: 9px; }
.dashboard-select { display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1px solid #8b91a7; border-radius: 3px; color: white; background: white; font-size: 10px; font-weight: 800; line-height: 1; text-decoration: none; }
.dashboard-select span { display: grid; place-items: center; width: 100%; height: 100%; }
.dashboard-row-selected .dashboard-select { border-color: var(--primary); background: var(--primary); }
.dashboard-row-selected { background: #eeeaff; }
.dashboard-save-row { margin-top: 4px; }
.dashboard-save-row .section-save { width: 220px; min-height: 27px; margin-top: 0; }
.dashboard-ai { padding-top: 8px; }

@media (max-width: 820px) {
    .sidebar { width: 20rem; max-width: 88vw; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 16px 0 40px rgba(19,16,53,.22); }
    .sidebar.sidebar-open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .menu-button { display: block; }
    .topbar { padding: 0 16px; }
    .content { width: min(100% - 26px, 900px); padding-top: 30px; }
    .content.content-browse { width: min(100% - 26px, 900px); margin-left: auto; margin-right: auto; }
    .feature-card { align-items: flex-start; flex-direction: column; }
    .toolbar { flex-wrap: wrap; }
    .toolbar input { max-width: none; }
    .user-name { display: none; }
    .detail-grid, .detail-list, .form-grid, .backup-status-grid { grid-template-columns: 1fr; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .form-field-wide { grid-column: auto; }
    .assignment-grid { grid-template-columns: 1fr; }
    .assignment-actions { grid-template-columns: repeat(3, auto); padding-top: 0; }
    .form-row-company, .form-row-three, .invoice-wz-section, .invoice-transport-section, .form-row-location, .form-row-location-short, .commercial-main-row, .commercial-search-row, .commercial-hierarchy-row, .labelling-filters, .labelling-editor-row, .ingredient-create-row, .demand-source-picker, .demand-quantity-row, .demand-price-row, .demand-search-filters, .packaging-header-row, .packaging-level-row, .quote-link-row, .quote-two-row, .quote-three-row, .quote-comment-row, .qin-filters, .qout-source-filters, .qout-browse-filters, .sample-company-picker, .sample-relation-row, .sample-date-row, .sample-filters, .interaction-company-picker, .interaction-link-row, .interaction-new-thread-row, .interaction-main-row, .interaction-filters, .interaction-thread-create, .dashboard-filters.compact-form, .specification-upload-form, .specification-match-summary, .specification-matches-horizontal, .specification-paired-row, .specification-document-row, .specification-diagnostics-grid, .rule-editor-header, .rule-editor-body { grid-template-columns: 1fr; }
    .specification-review-heading, .specification-company-confirmation, .specification-mode-bar, .specification-submit-row { align-items: flex-start; flex-direction: column; }
    .sample-search { grid-column: auto; }
}
@media (max-width: 700px) {
    .company-product-filters { grid-template-columns: 1fr; }
}
.database-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border: 1px solid #a5b4fc;
    border-radius: 3px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .035em;
}

.database-badge-production {
    border-color: #93c5fd;
    background: #eaf4ff;
    color: #1e5a96;
}
.confidential-security-note {
    display: grid;
    gap: 14px;
}

.confidential-security-note .workspace-section {
    margin: 0;
}

.confidential-security-list {
    display: grid;
    gap: 9px;
    margin: 12px 0 0;
    padding-left: 24px;
    color: #334155;
    line-height: 1.55;
}

.confidential-security-statement {
    margin: 12px 0 0;
    padding: 16px 18px;
    border-left: 4px solid #2164ae;
    border-radius: 0 8px 8px 0;
    background: #f4f8fc;
    color: #17324d;
    font-weight: 650;
    line-height: 1.6;
}
.composition-heading h1 {
    margin-top: .45rem;
}

.composition-product-summary dl {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
}

.composition-product-summary dl > div {
    min-width: 0;
}

.composition-product-summary dt {
    color: var(--muted, #667085);
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: .25rem;
    text-transform: uppercase;
}

.composition-product-summary dd {
    font-weight: 600;
    margin: 0;
}

.composition-table-wrap {
    margin-top: 1rem;
}

.composition-table select,
.composition-table input[type="text"],
.composition-table input[type="number"] {
    min-width: 9rem;
    width: 100%;
}

.composition-table th:first-child,
.composition-table td:first-child {
    min-width: 20rem;
}

.composition-table th:nth-child(2),
.composition-table td:nth-child(2) {
    min-width: 22rem;
}

.composition-primary-badge {
    color: #087443;
    display: block;
    font-weight: 700;
    margin-top: .3rem;
}

.composition-delete-field {
    display: none;
}

.composition-actions {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.composition-actions [data-add-component] {
    margin-right: auto;
}

.composition-total-valid {
    color: #087443;
}

.app-info-heading .eyebrow { display: block; margin-bottom: 7px; }
.app-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.app-info-card { padding: 22px; }
.app-info-card-wide { grid-column: 1 / -1; }
.app-info-card h2 { margin: 0 0 10px; font-size: 18px; }
.app-info-card p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
.app-info-card > code, .app-info-environment > code { display: inline-block; margin-top: 10px; padding: 5px 8px; border: 1px solid #dedbea; border-radius: 6px; background: #f8f7fc; color: #302c4e; }
.app-info-card-heading { display: flex; align-items: flex-start; gap: 12px; }
.app-info-card-heading h2 { margin-bottom: 4px; }
.app-info-card-heading p { margin-top: 0; }
.app-info-step { display: grid; flex: 0 0 30px; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: white; background: var(--primary); font-weight: 800; }
.app-info-kicker { display: block; margin-bottom: 7px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.app-info-command-block { display: grid; gap: 6px; margin-top: 16px; padding: 12px 14px; overflow-x: auto; border: 1px solid #d9d4ee; border-radius: 8px; background: #29263c; color: #f7f6ff; }
.app-info-command-block span { color: #bdb8d3; font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.app-info-command-block code { color: inherit; white-space: nowrap; }
.app-info-command-short { width: max-content; min-width: 120px; }
.app-info-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0 0; }
.app-info-facts div { min-width: 0; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fafaff; }
.app-info-facts dt { margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.app-info-facts dd { margin: 0; overflow-wrap: anywhere; }
.app-info-environment + .app-info-environment { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.app-info-environment strong { display: block; }
.app-info-callout { padding: 10px 12px; border-left: 3px solid #d69b20; background: #fff8e6; color: #62470d !important; }
.app-info-list { display: grid; gap: 8px; margin: 12px 0 0; padding-left: 21px; color: #403d55; line-height: 1.5; }
.app-info-security-note { margin-top: 0; }
.app-info-workflow ol { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; counter-reset: app-info-workflow; }
.app-info-workflow li { position: relative; min-width: 0; padding: 38px 12px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fafaff; counter-increment: app-info-workflow; }
.app-info-workflow li::before { position: absolute; top: 10px; left: 12px; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; content: counter(app-info-workflow); color: white; background: var(--primary); font-size: 10px; font-weight: 800; }
.app-info-workflow strong, .app-info-workflow span { display: block; }
.app-info-workflow span { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }

@media (max-width: 900px) {
    .composition-product-summary dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .app-info-workflow ol { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .app-info-grid, .app-info-facts { grid-template-columns: 1fr; }
    .app-info-card-wide { grid-column: auto; }
}
