:root {
  --ink: #12221d;
  --muted: #63706b;
  --surface: #ffffff;
  --line: #dce3df;
  --accent: #0e7a5f;
  --accent-dark: #075945;
  --wash: #eef5f1;
  --warm: #f4efe6;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: #f5f7f5; font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
.topbar { height: 68px; padding: 0 max(24px, calc((100vw - 1120px) / 2)); display: flex; align-items: center; justify-content: space-between; color: white; background: var(--ink); }
.brand { font-weight: 750; letter-spacing: .02em; text-decoration: none; }
.brand-group { display:flex; align-items:center; gap:16px; }
.home-button { display:inline-flex; align-items:center; gap:7px; min-height:36px; padding:7px 13px; border:1px solid #d9ebe4; border-radius:9px; color:#0b5f48; background:#f5fbf8; box-shadow:0 3px 10px rgba(0,0,0,.12); font-size:13px; font-weight:850; text-decoration:none; transition:background-color .16s ease,border-color .16s ease,transform .16s ease,box-shadow .16s ease; }
.home-button span { font-size:16px; line-height:1; }
.home-button:hover { color:#074c3a; border-color:#fff; background:#fff; transform:translateY(-1px); box-shadow:0 5px 14px rgba(0,0,0,.18); }
.account { display: flex; align-items: center; gap: 18px; font-size: 13px; color: #dfe8e3; }
.account form { margin: 0; }
.link-button { padding: 0; border: 0; color: white; background: transparent; text-decoration: underline; cursor: pointer; }
.page { max-width: 1120px; margin: 0 auto; padding: 44px 24px 72px; }
.page-auth { min-height: 100vh; display: grid; place-items: center; }
.auth-card, .form-card, .status-panel { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 16px 45px rgba(18, 34, 29, .07); }
.auth-card { width: min(440px, 100%); padding: 40px; }
.auth-card h1, .form-card h1, .hero h1 { margin: 7px 0 8px; line-height: 1.2; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.muted { margin-top: 0; color: var(--muted); }
.stacked-form { display: grid; gap: 10px; margin-top: 26px; }
.stacked-form p { display: grid; gap: 6px; margin: 0 0 6px; }
.stacked-form ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
label { font-weight: 650; }
input, select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #bcc8c2; border-radius: 9px; background: white; font: inherit; }
textarea { width: 100%; padding: 9px 11px; border: 1px solid #bcc8c2; border-radius: 9px; background: white; font: inherit; resize: vertical; }
input:focus, select:focus { outline: 3px solid rgba(14, 122, 95, .15); border-color: var(--accent); }
.primary { min-height: 44px; padding: 10px 17px; border: 0; border-radius: 9px; color: white; background: var(--accent); font-weight: 750; cursor: pointer; }
.primary:hover { background: var(--accent-dark); }
.button { display: inline-flex; align-items: center; text-decoration: none; }
.form-error, .errorlist { padding: 10px 12px; border-radius: 8px; color: #8c2d21; background: #fff0ed; }
.hero { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 32px; }
.hero h1 { font-size: clamp(28px, 4vw, 42px); max-width: 720px; }
.role-badge { flex: none; padding: 7px 12px; border-radius: 999px; color: var(--accent-dark); background: #d9eee6; font-weight: 750; }
.nav-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.nav-card { min-height: 145px; padding: 22px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; transition: transform .15s, box-shadow .15s; }
a.nav-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(18, 34, 29, .08); }
.nav-card strong { font-size: 19px; }
.nav-card span { margin-top: 5px; color: var(--muted); }
.nav-card.accent { color: white; border-color: var(--accent); background: var(--accent); }
.nav-card.accent span { color: #d7efe8; }
.nav-card.pending { background: #f1f3f2; }
.status-panel { margin-top: 24px; padding: 24px; box-shadow: none; }
.status-panel.standalone { margin-top: 18px; }
.status-panel h2 { margin-top: 0; }
.status-row { padding: 13px 0; display: flex; justify-content: space-between; border-top: 1px solid var(--line); }
.status-row b { color: var(--muted); }
.status-row .ready { color: var(--accent); }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 20px; }
.section-heading h1 { margin: 8px 0 0; }
.back-link { color: var(--accent-dark); font-size: 13px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: white; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; letter-spacing: .04em; background: var(--wash); }
tbody tr:last-child td { border-bottom: 0; }
.form-card { max-width: 620px; margin-top: 18px; padding: 28px; box-shadow: none; }
.form-card.wide { max-width: 780px; }
.message { margin-bottom: 18px; padding: 11px 14px; border-radius: 9px; color: var(--accent-dark); background: #d9eee6; }
.hero.compact { margin-top: 18px; }
.hero.compact h1 { font-size: clamp(25px, 3vw, 34px); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0; }
.metric { min-height: 104px; padding: 17px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; background: white; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { font-size: 19px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.flat { border: 0; border-radius: 0; box-shadow: none; }
.section-heading.small { align-items: center; margin-bottom: 8px; }
.section-heading.small h2 { margin: 0; }
.secondary, .danger { min-height: 42px; padding: 9px 15px; border-radius: 8px; cursor: pointer; }
.secondary { border: 1px solid var(--line); background: white; text-decoration: none; }
.danger { border: 0; color: white; background: #a83a2c; font-weight: 700; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.two-column .form-card { width: 100%; max-width: none; }
.danger-zone { border-color: #e7b6af; }
.order-delete-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-color: #ead4cf; background: #fffafa; }
.order-delete-panel h2 { margin: 0 0 4px; font-size: 17px; }
.order-delete-panel span { color: var(--muted); font-size: 13px; }
.order-delete-page { max-width: 760px; margin: 0 auto; }
.order-delete-card { max-width: 720px; }
.danger-text { color: #9b3327; }
.order-delete-summary { margin: 0 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.order-delete-summary > div { padding: 14px; display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.order-delete-summary span { color: var(--muted); font-size: 12px; }
.order-delete-warning { margin: 16px 28px 0; padding: 12px 14px; color: #8a3429; border-radius: 9px; background: #fff0ed; }
.owner-profit-panel { border-color: #c9ddd5; background: #fbfefd; }
.owner-profit-panel .section-heading > div { display: grid; gap: 2px; }
.owner-profit-panel .section-heading h2 { margin: 0; }
.profit-status-line { margin: 12px 0 16px; padding: 11px 13px; display: flex; justify-content: space-between; gap: 14px; border-radius: 10px; color: #225b49; background: #e8f5f0; }
.profit-status-line span { font-weight: 800; }
.profit-status-line small { color: var(--muted); }
.profit-metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.profit-metric { min-height: 94px; padding: 14px; display: grid; align-content: space-between; gap: 7px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.profit-metric span, .profit-metric small { color: var(--muted); font-size: 12px; }
.profit-metric strong { font-size: 17px; }
.profit-metric.fee { border-color: #e6c894; background: #fffaf0; }
.profit-metric.result { color: white; border-color: var(--accent); background: var(--accent); }
.profit-metric.result span, .profit-metric.result small { color: #d9f0e8; }
.profit-warning { margin: 14px 0 0; padding: 10px 12px; border-radius: 9px; color: #7b5716; background: #fff3c9; }
.receipt-profit-line { color: #7b5716; }
.cost-editor-layout .form-card { align-self: start; }
.cost-suggestion-panel { margin-top: 18px; }
.cost-breakdown-row { padding: 12px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); }
.cost-breakdown-row div { display: grid; gap: 3px; }
.cost-breakdown-row small { color: var(--muted); }
.cost-warning { margin: 14px 0; padding: 12px; display: grid; gap: 5px; border: 1px solid #e2c98f; border-radius: 10px; color: #735a1e; background: #fff9e8; }
.alert-list { margin: 18px 0; padding: 18px; border: 1px solid #e2c98f; border-radius: 12px; background: #fff9e8; }
.alert-list.blocking { border-color: #e6aaa1; background: #fff0ed; }
.alert-row { padding: 10px 0; display: grid; grid-template-columns: minmax(150px, .45fr) 1fr auto; gap: 12px; border-top: 1px solid rgba(18, 34, 29, .1); }
.alert-row:first-of-type { border-top: 0; }
.alert-row em { color: #9d3124; font-style: normal; font-weight: 700; }
.review-layout { display: grid; grid-template-columns: minmax(430px, 1fr) minmax(440px, 1fr); gap: 18px; align-items: start; }
.source-pane { position: sticky; top: 16px; height: calc(100vh - 32px); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: white; }
.source-pane iframe { width: 100%; height: 100%; border: 0; }
.review-form { max-width: none; margin: 0; }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.compact-list { margin-top: 0; }
.action-strip { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }
.action-strip .button { padding: 9px 13px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.metric small { display: block; margin-top: .4rem; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.single-review { width: min(1880px, calc(100vw - 24px)); margin-left: 50%; transform: translateX(-50%); grid-template-columns: minmax(380px, .78fr) minmax(0, 1.35fr); gap: 12px; }
.page:has(.single-review) { max-width: none; padding: 18px 12px 36px; }
.pi-review-heading { margin: 3px 0 10px; align-items: center; }
.pi-review-heading h1 { margin: 0; max-width: min(900px, 65vw); overflow: hidden; font-size: 18px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.pi-review-heading .eyebrow, .pi-review-heading .muted { display: none; }
.review-progress { min-width: 220px; padding: 6px 12px; display: grid; border: 1px solid var(--line); border-radius: 8px; background: white; }
.review-progress span { color: var(--muted); font-size: 13px; }
.source-pane-title { height: 42px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.source-pane-title a { color: var(--accent-dark); font-size: 13px; }
.source-pane iframe { height: calc(100% - 42px); }
.single-review .source-pane { top: 8px; height: calc(100vh - 154px); min-height: 620px; border-radius: 9px; }
.single-review .review-form { position: sticky; top: 8px; height: calc(100vh - 154px); min-height: 620px; padding: 18px 20px; overflow-y: auto; border-radius: 9px; }
.review-form .stacked-form { margin-top: 0; }
.review-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.review-section:first-of-type { padding-top: 0; }
.review-section-title { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.review-section-title > div { display: flex; align-items: center; gap: 10px; }
.review-section-title h2 { margin: 0; font-size: 19px; }
.review-section-title > div > span { color: var(--accent); font-weight: 800; }
.section-state { padding: 4px 9px; border-radius: 999px; color: #735a1e; background: #fff2c2; font-size: 12px; font-weight: 750; }
.section-state.confirmed { color: var(--accent-dark); background: #d9eee6; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-grid > .full-width { grid-column: 1 / -1; }
.review-subheading { margin: 4px 0 -4px; padding-bottom: 7px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; letter-spacing: .04em; }
.review-field { padding: 9px 10px; display: grid; gap: 5px; align-content: start; border: 1px solid var(--line); border-left-width: 5px; border-radius: 8px; background: white; transition: border-color .15s, background .15s; }
.review-field input, .review-field select { min-height: 38px; padding: 6px 9px; }
.review-field.full-width { grid-column: 1 / -1; }
.review-field small { color: var(--muted); }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-status { flex: none; min-width: 70px; padding: 4px 8px; display: inline-flex; justify-content: center; align-items: center; gap: 4px; border-radius: 6px; color: white; font-size: 11px; font-weight: 800; white-space: nowrap; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .1); }
.field-status::before { font-size: 13px; }
.status-normal { background: #14805f; }
.status-normal::before { content: "✓"; }
.status-review { background: #c78610; }
.status-review::before { content: "!"; }
.status-must-fix { background: #c24132; }
.status-must-fix::before { content: "×"; }
.status-corrected { background: #2477a5; }
.status-corrected::before { content: "✓"; }
.state-normal { border-left-color: #14805f; background: #f7fcfa; }
.state-review { border-left-color: #c78610; background: #fffaf0; }
.state-must-fix { border-left-color: #c24132; background: #fff6f4; }
.state-corrected { border-left-color: #2477a5; background: #f4faff; }
.country-suggestion { margin-top: 12px; padding: 11px 13px; border: 1px solid #d7b45c; border-radius: 10px; color: #665019; background: #fff8dd; }
.section-explanation { margin: -4px 0 10px; color: var(--muted); font-size: 13px; }
.line-card-list { display: grid; gap: 15px; }
.line-card { padding: 16px; border: 1px solid var(--line); border-left-width: 6px; border-radius: 14px; }
.line-card-header { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.line-card-header > div { display: flex; align-items: center; gap: 9px; }
.line-number { color: var(--muted); font-size: 12px; font-weight: 800; }
.line-category { width: auto; min-width: 90px; min-height: 38px; font-weight: 750; }
.line-card-tools { justify-content: flex-end; }
.source-page { color: var(--muted); font-size: 11px; }
.line-card-grid { display: grid; grid-template-columns: .8fr 1fr 1fr; gap: 12px; }
.line-card-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.line-card-grid .span-2 { grid-column: span 2; }
.line-card-grid .span-all { grid-column: 1 / -1; }
.configuration-field textarea { line-height: 1.65; color: var(--ink); background: #fbfcfb; }
.source-evidence { margin-top: 12px; color: var(--muted); font-size: 12px; }
.source-evidence summary { cursor: pointer; }
.source-evidence pre { max-height: 220px; padding: 10px; overflow: auto; border-radius: 8px; white-space: pre-wrap; background: #eef2ef; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.icon-button { width: 32px; height: 32px; border: 0; border-radius: 50%; color: #8c2d21; background: #ffe8e3; font-size: 20px; cursor: pointer; }
.line-actions { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.line-actions strong { color: var(--accent-dark); }
.line-actions .total-error { color: #9b3124; }
.pi-items-scroll { overflow-x: auto; border: 1px solid #cad5d0; border-radius: 8px; background: white; }
.pi-item-table { min-width: 780px; table-layout: fixed; }
.pi-item-table .col-kind { width: 104px; }
.pi-item-table .col-product { width: auto; }
.pi-item-table .col-qty { width: 68px; }
.pi-item-table .col-unit { width: 70px; }
.pi-item-table .col-price { width: 92px; }
.pi-item-table .col-amount { width: 102px; }
.pi-item-table .col-action { width: 42px; }
.pi-item-table th { padding: 8px 7px; font-size: 11px; }
.pi-item-table td { padding: 8px 6px; vertical-align: top; background: white; }
.pi-item-table tbody tr:last-child td { border-bottom: 0; }
.pi-line-row.state-normal > td:first-child { box-shadow: inset 4px 0 #14805f; }
.pi-line-row.state-review > td:first-child { box-shadow: inset 4px 0 #c78610; }
.pi-line-row.state-must-fix > td:first-child { box-shadow: inset 4px 0 #c24132; }
.pi-line-row.state-corrected > td:first-child { box-shadow: inset 4px 0 #2477a5; }
.pi-item-kind .line-number { display: block; margin-bottom: 5px; }
.pi-item-kind .field-status { width: 100%; min-width: 0; padding: 3px 4px; font-size: 10px; }
.pi-item-kind .line-category { width: 100%; min-width: 0; min-height: 32px; margin-top: 5px; padding: 4px 6px; border-radius: 5px; font-size: 12px; }
.pi-item-kind .line-category:disabled { color: var(--ink); opacity: 1; background: #eef3f0; }
.pi-item-name-row { display: grid; grid-template-columns: 106px minmax(170px, 1fr); gap: 6px; }
.pi-line-row[data-category="accessory"] .line-model-field,
.pi-line-row[data-category="accessory"] .pi-item-spec { display: none; }
.pi-line-row[data-category="accessory"] .pi-item-name-row { grid-template-columns: minmax(170px, 1fr); }
.pi-item-product label, .pi-table-field { display: grid; gap: 3px; color: var(--muted); font-size: 10px; font-weight: 700; }
.pi-item-product input, .pi-item-product textarea, .pi-table-field input, .pi-table-field select { min-height: 32px; padding: 5px 6px; border-radius: 5px; font-size: 12px; }
.pi-item-product input[readonly], .pi-item-product textarea[readonly], .pi-table-field input[readonly] { color: var(--ink); background: #f2f5f3; }
.pi-item-spec { margin-top: 6px; }
.pi-item-spec textarea { min-height: 58px; line-height: 1.35; }
.pi-item-source { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.pi-item-source .source-evidence { margin: 0; }
.pi-item-source .source-evidence pre { max-width: 360px; }
.pi-table-field span { display: none; }
.pi-table-field input { text-align: right; font-variant-numeric: tabular-nums; }
.pi-item-action { text-align: center; }
.pi-item-action .icon-button { width: 28px; height: 28px; font-size: 17px; }
.catalog-add-button { color: var(--accent-dark); border-color: #9bc9ba; background: #f2fbf7; font-weight: 750; }
.catalog-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 22px; overflow-y: auto; border: 0; border-radius: 14px; color: var(--ink); box-shadow: 0 24px 80px rgba(18, 34, 29, .28); }
.catalog-dialog::backdrop { background: rgba(18, 34, 29, .55); backdrop-filter: blur(2px); }
.catalog-dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.catalog-dialog-header h2 { margin: 3px 0 0; }
.catalog-help { margin: 8px 0 14px; color: var(--muted); }
.catalog-kind-switch { margin-bottom: 14px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border-radius: 9px; background: #edf2ef; }
.catalog-kind { min-height: 38px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-weight: 750; cursor: pointer; }
.catalog-kind.active { color: white; background: var(--accent); }
.catalog-picker-fields { display: grid; gap: 12px; }
.catalog-picker-fields > label { display: grid; gap: 5px; }
.catalog-picker-fields fieldset { margin: 0; padding: 11px; border: 1px solid var(--line); border-radius: 9px; }
.catalog-picker-fields legend { padding: 0 5px; font-weight: 750; }
.catalog-option-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.catalog-option-list label { padding: 8px; display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 7px; font-weight: 600; cursor: pointer; }
.catalog-option-list input { width: 16px; min-height: 16px; margin: 0; }
.catalog-option-list small { color: var(--muted); }
.catalog-empty { color: var(--muted); }
.catalog-order-values { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.catalog-order-values label { display: grid; gap: 5px; }
.catalog-selection-summary { margin-top: 12px; padding: 11px 13px; display: grid; gap: 3px; border-radius: 8px; color: #205b47; background: #e9f6f1; }
.catalog-selection-summary span { font-size: 13px; }
.catalog-dialog-actions { margin-top: 16px; display: flex; justify-content: flex-end; gap: 9px; }
.payment-total-grid { margin-bottom: 18px; }
.payment-mode-heading { margin: 20px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.payment-mode-heading > div { display: grid; gap: 2px; }
.payment-mode-heading small { color: var(--muted); }
.payment-option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.payment-option { min-height: 104px; padding: 11px; display: grid; align-content: start; gap: 5px; border: 2px solid var(--line); border-radius: 9px; background: white; cursor: pointer; }
.payment-option.selected { border-color: var(--accent); background: #eaf7f2; box-shadow: 0 0 0 3px rgba(14, 122, 95, .1); }
.payment-option input { width: 18px; min-height: 18px; margin: 0; }
.payment-option-title { font-size: 16px; font-weight: 800; }
.payment-option small { color: var(--muted); line-height: 1.45; }
.payment-preview { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.payment-preview > div { padding: 13px; display: grid; gap: 3px; border-radius: 10px; color: #175b46; background: #e8f5f0; }
.payment-preview span { font-size: 12px; }
.payment-preview strong { font-size: 17px; }
.custom-payment-editor { margin-top: 14px; padding: 15px; border: 1px solid #d7b45c; border-radius: 12px; background: #fffbec; }
.custom-payment-intro { margin-bottom: 12px; display: grid; gap: 3px; }
.custom-payment-intro span { color: var(--muted); font-size: 13px; }
#custom-milestone-rows { display: grid; gap: 9px; }
.custom-milestone-row { padding: 10px; display: grid; grid-template-columns: 1.1fr .8fr 1.2fr auto; align-items: end; gap: 9px; border: 1px solid #eadba8; border-radius: 10px; background: white; }
.custom-milestone-row label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.custom-milestone-row .milestone-start { min-height: 44px; display: flex; align-items: center; color: var(--ink); }
.milestone-start input { width: 18px; min-height: 18px; margin-right: 6px; }
.custom-payment-actions { margin-top: 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.custom-payment-actions .total-error { color: #a73729; }
.payment-account-note { margin-top: 14px; padding: 11px 13px; border: 1px solid #b8d6cb; border-radius: 8px; color: #205b47; background: #edf8f4; }
.final-confirmation { border-bottom: 0; }
.create-block-reason { margin-top: 14px; padding: 10px 12px; border-radius: 8px; color: #8c2d21; background: #fff0ed; }
.create-order-button { width: 100%; margin-top: 10px; }
.create-order-button:disabled { cursor: not-allowed; opacity: .45; }
.reject-panel { max-width: 760px; margin: 24px auto 0; padding: 16px 20px; border: 1px solid #e7b6af; border-radius: 12px; background: white; }
.reject-panel summary { color: #8c2d21; font-weight: 700; cursor: pointer; }

@media (max-width: 1120px) {
  .single-review { width: 100%; margin-left: 0; transform: none; grid-template-columns: 1fr; }
  .single-review .source-pane { position: static; height: 62vh; min-height: 480px; }
  .single-review .review-form { position: static; height: auto; min-height: 0; overflow: visible; }
  .pi-review-heading h1 { max-width: 62vw; }
}

@media (max-width: 760px) {
  .topbar { padding: 0 18px; }
  .account span { display: none; }
  .page { padding: 28px 18px 56px; }
  .auth-card { padding: 28px 22px; }
  .hero { display: block; }
  .role-badge { display: inline-block; margin-top: 10px; }
  .nav-grid { grid-template-columns: 1fr; }
  .metric-grid, .two-column, .review-layout { grid-template-columns: 1fr; }
  .profit-metric-grid { grid-template-columns: 1fr 1fr; }
  .source-pane, .single-review .source-pane { position: static; height: 60vh; min-height: 420px; }
  .section-heading { align-items: start; gap: 18px; }
  .pi-review-heading { flex-direction: column; }
  .review-progress { width: 100%; min-width: 0; }
  .single-review { width: 100%; margin-left: 0; transform: none; }
  .single-review .review-form { position: static; height: auto; overflow: visible; }
  .field-grid { grid-template-columns: 1fr; }
  .review-field.full-width { grid-column: auto; }
  .line-card-header, .line-card-header > div, .line-card-tools { align-items: flex-start; flex-wrap: wrap; }
  .line-card-grid { grid-template-columns: 1fr; }
  .line-card-grid .span-2, .line-card-grid .span-all { grid-column: auto; }
  .payment-option-grid, .payment-preview { grid-template-columns: 1fr; }
  .custom-milestone-row { grid-template-columns: 1fr; }
  .custom-payment-actions, .line-actions { align-items: flex-start; flex-direction: column; }
  .catalog-option-list, .catalog-order-values { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .profit-metric-grid { grid-template-columns: 1fr; }
  .profit-status-line { flex-direction: column; }
}

.row-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.filter-bar { margin: 0 0 14px; display: grid; grid-template-columns: minmax(240px, 1fr) 180px 180px auto; gap: 9px; }
.filter-bar input, .filter-bar select { width: 100%; min-height: 42px; }
.money-cost { color: #b84538; font-weight: 800; }
.readonly-grid { margin: 14px 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.readonly-grid > div { min-height: 74px; padding: 12px; display: grid; align-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 9px; background: #f5f7f6; }
.readonly-grid span { color: var(--muted); font-size: 12px; }
.readonly-grid strong { font-weight: 800; }
.readonly-grid .full { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .filter-bar, .readonly-grid { grid-template-columns: 1fr; }
  .readonly-grid .full { grid-column: auto; }
}

.page:has(.order-board-page) { max-width: 1480px; padding-top: 34px; }
body:has(.order-board-page) .topbar { padding-left:max(24px,calc((100vw - 1480px)/2)); padding-right:max(24px,calc((100vw - 1480px)/2)); }
.order-board-page > .section-heading { margin-bottom:16px; }
.order-board-page > .section-heading h1 { font-size:34px; letter-spacing:-.02em; }
.board-filter { grid-template-columns: 160px 160px 110px 88px; justify-content:start; align-items:center; margin-bottom:16px; padding:12px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 5px 18px rgba(18,34,29,.04); }
.board-filter-owner { grid-template-columns:160px 160px 150px 110px 88px; }
.board-filter input,.board-filter select,.board-filter button { min-height:40px; }
.board-filter button { width:88px; font-weight:800; color:#fff; border-color:var(--accent); background:var(--accent); }
.board-filter button:hover { background:var(--accent-dark); }
.board-metrics { margin-bottom: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.board-metrics > div { position:relative; min-height: 92px; padding: 15px 16px; display: grid; align-content: center; gap: 5px; overflow:hidden; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow:0 5px 18px rgba(18,34,29,.035); }
.board-metrics > div::before { content:""; position:absolute; top:0; left:0; width:100%; height:3px; background:#8e9a95; }
.board-metrics > .amount-order::before { background:#257fc3; }
.board-metrics > .amount-received::before { background:#159a58; }
.board-metrics > .amount-outstanding::before { background:#c77717; }
.board-metrics span { color: var(--muted); font-size: 12px; }
.board-metrics strong { font-size: 18px; }
.amount-order strong { color: #257fc3; }
.amount-received strong { color: #159a58; }
.amount-outstanding strong { color: #c77717; }
.order-board { display: grid; grid-template-columns: repeat(5, minmax(260px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.board-column { min-height: 520px; border: 1px solid #d5ded9; border-radius: 12px; background: #edf1ef; overflow: hidden; box-shadow:0 8px 24px rgba(18,34,29,.045); }
.board-column > header { min-height: 48px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: white; background: #17875a; }
.board-column > header strong { font-size: 14px; }
.board-column > header span { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; background: rgba(255,255,255,.2); }
.stage-inspection > header { background: #2580a9; }
.stage-paid > header { background: #8b6c25; }
.stage-shipped > header { background: #5f6c66; }
.stage-payment-pending > header { background:#bd6f17; }
.stage-payment-pending { background:#f5f0e8; }
.board-cards { padding: 9px; display: grid; gap: 9px; }
.board-empty { padding: 28px 12px; color: var(--muted); text-align: center; }
.order-card { padding: 14px; border: 1px solid #d5ded9; border-radius: 10px; background: white; transition:transform .16s ease,box-shadow .16s ease; }
.order-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order-card-top > a { color: #176fa6; font-weight: 800; text-decoration: none; }
.order-card-top > b { padding: 3px 6px; border-radius: 4px; color: #12834e; background: #e0f4e9; font-size: 11px; }
.order-card-top > b.pending-receipt-badge { color:#8b4f0d; background:#fff0d7; }
.order-customer { margin-top: 8px; display: block; }
.order-machine { margin-top: 8px; color: #405049; font-weight: 700; }
.order-config { margin-top: 4px; min-height: 34px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.order-money { margin-top: 9px; padding-top: 8px; display: grid; gap: 4px; border-top: 1px solid var(--line); font-size: 12px; }
.order-money span { display: flex; justify-content: space-between; gap: 8px; }
.order-money span:nth-child(1) b { color: #257fc3; }
.order-money span:nth-child(2) b { color: #159a58; }
.order-money span:nth-child(3) b { color: #c77717; }
.order-deadline { margin-top: 9px; padding: 8px; display: flex; justify-content: space-between; gap: 8px; border-left: 3px solid #17875a; background: #eef7f2; font-size: 12px; }
.order-deadline strong { color: #15704d; }
.pending-payment-deadline { border-left-color:#bd6f17; background:#fff7e9; }
.pending-payment-deadline strong { color:#9a580e; }
.order-owner { margin-top: 8px; display: block; color: var(--muted); }

@media (max-width: 900px) {
  .board-metrics { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .board-filter, .board-metrics { grid-template-columns: 1fr; }
  .order-board { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc(100vw - 54px); scroll-snap-type: x mandatory; scroll-padding-left: 0; }
  .board-column { scroll-snap-align: start; }
}
.main-nav { display:flex; gap:6px; align-items:center; padding:4px; border-radius:10px; background:rgba(255,255,255,.045); }
.main-nav a { padding:7px 10px; border-radius:7px; color:#e6efeb; text-decoration:none; font-size:13px; font-weight:750; transition:color .16s ease,background-color .16s ease; }
.main-nav a:hover { color:#fff; background:rgba(255,255,255,.12); }
.profit-metrics { display:grid; grid-template-columns:repeat(7,minmax(140px,1fr)); gap:12px; margin:18px 0; overflow-x:auto; }
.profit-metrics > div { min-width:140px; background:#fff; border:1px solid #dbe5e0; border-radius:14px; padding:16px; }
.profit-metrics span { display:block; color:#65736d; margin-bottom:8px; }
.profit-metrics strong { font-size:20px; }
.amount-cost strong,.money-cost { color:#7a5b16; }
.amount-profit strong,.money-profit { color:#11845f; }
.amount-full-profit strong,.money-full-profit { color:#0b62a4; }
.money-order { color:#2f5da8; font-weight:700; }
.money-received { color:#11845f; font-weight:700; }
.money-outstanding { color:#c74432; font-weight:700; }
.paid-badge { display:inline-block; padding:5px 9px; border-radius:999px; background:#def5e9; color:#08734f; font-weight:800; white-space:nowrap; }
.needs-cost { background:#fffaf0; }
.warning-button { background:#f0a72f; color:#241b0a; }
@media (max-width: 900px) { .main-nav { display:none; } .topbar { height:62px; } }
@media (max-width: 560px) { .brand { display:none; } .brand-group { gap:0; } .account > span { display:none; } }
.line-color-field { display:block; margin-top:10px; }
.line-color-field span { display:block; color:#65736d; font-size:13px; margin-bottom:4px; }
.cost-lines-card { max-width:980px; }
.exchange-rate-row { display:grid; grid-template-columns:1fr 220px; align-items:center; gap:20px; padding-bottom:16px; border-bottom:1px solid #dfe8e3; }
.cost-lines { display:grid; gap:0; }
.cost-line-row { display:grid; grid-template-columns:1fr 220px; gap:20px; align-items:center; padding:14px 0; border-bottom:1px solid #e4ebe7; }
.cost-line-row > div { display:grid; grid-template-columns:140px 1fr 110px; gap:10px; align-items:center; }
.cost-line-row small,.cost-line-row span { color:#65736d; }
.cost-line-row label,.cost-total-row > div { display:flex; gap:8px; align-items:center; }
.cost-total-row { display:grid; grid-template-columns:1fr 220px; gap:20px; align-items:center; padding:18px 0; font-size:20px; font-weight:800; }
@media (max-width:760px) { .cost-line-row,.cost-total-row,.exchange-rate-row { grid-template-columns:1fr; } .cost-line-row > div { grid-template-columns:1fr; } }
.stage-badge { padding:8px 13px; border-radius:999px; background:#e6f2ed; color:#0a7253; font-weight:800; }
.pending-receipt-alert { margin:18px 0 0; padding:16px 18px; display:flex; align-items:center; justify-content:space-between; gap:18px; border:1px solid #e2bd6f; border-left:5px solid #c47a12; border-radius:13px; color:#69470f; background:#fff7df; }
.pending-receipt-alert > div { display:flex; align-items:center; gap:14px; }
.pending-receipt-alert span { color:#765d2c; }
.pending-receipt-alert strong { font-size:18px; }
.pending-receipt-alert b,.pending-confirmation-badge { padding:6px 10px; border-radius:999px; color:#8a540e; background:#ffe6ad; font-size:13px; white-space:nowrap; }
@media (max-width:760px) { .pending-receipt-alert,.pending-receipt-alert > div { align-items:flex-start; flex-direction:column; } }
.color-inline-form { margin-top:7px; display:grid; grid-template-columns:minmax(120px,1fr) auto; gap:7px; }
.color-inline-form input { min-height:38px; }
.color-inline-form button { min-height:38px; padding:7px 12px; }
.missing-color { display:inline-block; padding:2px 7px; border-radius:6px; color:#a15d0b; background:#fff0d2; font-weight:800; }
.rejected-receipt-alert { margin:18px 0 0; padding:16px 18px; display:grid; gap:9px; border:1px solid #e5aaa0; border-left:5px solid #c64032; border-radius:13px; color:#7f2d24; background:#fff0ed; }
.rejected-receipt-alert > div { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.rejected-receipt-alert strong { font-size:18px; }
.rejected-receipt-alert small { color:#8c5b55; }
.rejection-reason { color:#b33b2f; font-style:normal; font-weight:700; }
.order-card-top > b.rejected-receipt-badge { color:#a72f23; background:#ffe4df; }
.rejected-payment-deadline { border-left-color:#c64032; color:#7f2d24; background:#fff0ed; }
.rejected-payment-deadline strong { max-width:150px; overflow:hidden; color:#a63125; text-overflow:ellipsis; white-space:nowrap; }
@media (max-width:760px) { .rejected-receipt-alert > div { align-items:flex-start; flex-direction:column; } }
.page:has(.profit-dashboard-page) { max-width:1480px; padding-top:34px; }
body:has(.profit-dashboard-page) .topbar { padding-left:max(24px,calc((100vw - 1480px)/2)); padding-right:max(24px,calc((100vw - 1480px)/2)); }
.profit-page-heading { margin-bottom:16px; }
.profit-page-heading h1 { font-size:34px; letter-spacing:-.02em; }
.profit-filter-bar { grid-template-columns:160px 160px 160px 110px 88px; justify-content:start; align-items:end; margin-bottom:12px; padding:12px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.profit-filter-bar label { display:grid; gap:5px; }
.profit-filter-bar label > span { color:var(--muted); font-size:11px; font-weight:750; }
.profit-filter-bar button { width:88px; color:#fff; border-color:var(--accent); background:var(--accent); font-weight:800; }
.active-filter-summary { margin:0 0 14px; display:flex; flex-wrap:wrap; gap:7px; }
.active-filter-summary span { padding:5px 9px; border-radius:999px; color:#3d544b; background:#eaf1ee; font-size:12px; font-weight:750; }
.profit-overview-grid { margin-bottom:16px; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.profit-overview-card { min-height:168px; padding:18px; display:grid; align-content:start; gap:10px; border:1px solid var(--line); border-top:4px solid #71817a; border-radius:14px; background:#fff; box-shadow:0 7px 22px rgba(18,34,29,.04); }
.profit-overview-card > span { color:var(--muted); font-size:13px; font-weight:800; }
.profit-overview-card > strong { font-size:24px; }
.profit-overview-card > div { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.profit-overview-card small,.profit-cell-lines small { color:var(--muted); }
.profit-overview-card b { font-size:15px; }
.overview-orders { border-top-color:#2e78b5; }
.overview-receipts { border-top-color:#159a58; }
.overview-cost { border-top-color:#9a7724; }
.overview-profit { border-top-color:#0e7a5f; }
.fee-line { color:#bd5e17; }
.total-line { padding-top:8px; border-top:1px solid var(--line); }
.profit-table-wrap { border-radius:14px; box-shadow:0 7px 24px rgba(18,34,29,.04); }
.simplified-profit-table th { padding:12px 14px; }
.simplified-profit-table td { padding:16px 14px; vertical-align:middle; }
.profit-order-cell { min-width:190px; }
.profit-order-cell > a,.profit-order-cell > span,.profit-order-cell > small { display:block; }
.profit-order-cell > a { color:#0a604a; }
.profit-order-cell > span { margin-top:3px; font-weight:700; }
.profit-order-cell > small { margin:3px 0 8px; color:var(--muted); }
.profit-order-cell em { font-style:normal; }
.receiving-badge { display:inline-block; padding:4px 8px; border-radius:999px; color:#8a5a11; background:#fff0ce; font-size:12px; font-weight:800; }
.profit-cell-lines { min-width:180px; display:grid; gap:6px; }
.profit-cell-lines > span { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.profit-cell-lines b { font-size:13px; white-space:nowrap; }
.compact-button { width:88px; min-height:34px; padding:7px 11px; justify-content:center; border-radius:8px; font-size:12px; font-weight:850; white-space:nowrap; }
.edit-cost-button { color:#fff; background:#16795c; }
.edit-cost-button:hover { background:#0f654b; }
.profit-mobile-orders { display:none; }
.profit-mobile-card { padding:16px; display:grid; gap:12px; border:1px solid var(--line); border-radius:14px; background:#fff; box-shadow:0 6px 18px rgba(18,34,29,.04); }
.profit-mobile-card > header { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.profit-mobile-card > header > div { display:grid; gap:3px; }
.profit-mobile-card > header a { color:#0a604a; font-weight:900; }
.profit-mobile-card > small { color:var(--muted); }
.mobile-profit-section { padding-top:10px; display:grid; gap:6px; border-top:1px solid var(--line); }
.mobile-profit-section > b { margin-bottom:2px; font-size:13px; }
.mobile-profit-section > span { display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--muted); font-size:13px; }
.mobile-profit-section strong { color:var(--ink); white-space:nowrap; }
@media (max-width:1000px) { .profit-overview-grid { grid-template-columns:1fr 1fr; } }
@media (max-width:760px) { .profit-filter-bar { grid-template-columns:1fr; } .profit-filter-bar button { width:100%; } .profit-overview-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } .profit-overview-card { min-height:150px; padding:13px; } .profit-overview-card > strong { font-size:20px; } .profit-overview-card > div { align-items:flex-start; flex-direction:column; gap:1px; } .profit-table-wrap { display:none; } .profit-mobile-orders { display:grid; gap:12px; } .profit-mobile-card .compact-button { width:100%; } }
.role-action-note { padding:7px 10px; border-radius:8px; color:#64716b; background:#eef2f0; font-size:12px; font-weight:750; }
.stage-reminders,.shipment-summary,.profit-summary-line { display:flex; flex-wrap:wrap; justify-content:space-between; gap:18px; align-items:center; }
.pi-snapshot-summary { display:grid; grid-template-columns:1fr 1fr 2fr; gap:12px; margin-bottom:18px; }
.pi-snapshot-summary > div { padding:14px; border-radius:12px; background:#f3f7f5; }
.pi-snapshot-summary span { display:block; color:#65736d; margin-bottom:7px; }
.profit-summary-line span,.profit-summary-line strong { padding:10px 0; }
.order-card { position:relative; }
.order-card-main-link { position:absolute; inset:0; z-index:1; border-radius:inherit; }
.order-card:hover { box-shadow:0 10px 28px rgba(14,73,54,.14); transform:translateY(-1px); }
.order-card-top,.order-card-links { position:relative; z-index:2; }
.order-card-top span { color:#1773ad; font-weight:900; }
.order-sales-owner { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:12px; padding:9px 10px; border-radius:8px; background:#f4f7f6; color:#65736d; font-size:13px; }
.order-sales-owner strong { color:#24342f; font-size:13px; }
.order-card-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:12px; }
.order-card-actions .pi-action { position:relative; z-index:2; display:flex; align-items:center; justify-content:center; gap:5px; min-height:34px; padding:7px 7px; border-radius:8px; font-size:12px; font-weight:850; line-height:1; text-decoration:none; white-space:nowrap; transition:background-color .16s ease,border-color .16s ease,color .16s ease,transform .16s ease,box-shadow .16s ease; }
.pi-action-snapshot { color:#fff; background:#117a5b; border:1px solid #117a5b; }
.pi-action-source { color:#176a8d; background:#fff; border:1px solid #8dbbd0; }
.order-card-actions .pi-action:hover { transform:translateY(-1px); box-shadow:0 5px 12px rgba(16,73,56,.12); }
.pi-action-snapshot:hover { color:#fff; background:#0c664b; border-color:#0c664b; }
.pi-action-source:hover { color:#125a79; background:#f2f8fb; border-color:#5e9db9; }
.order-card-actions .pi-action:focus-visible { outline:3px solid rgba(34,139,104,.24); outline-offset:2px; }
.snapshot-actions a { font-weight:800; color:#0b7657; }
.snapshot-actions { display:flex; gap:16px; align-items:center; }
.pi-snapshot-panel { scroll-margin-top:24px; }
@media (max-width:760px) { .pi-snapshot-summary { grid-template-columns:1fr; } }
@media (max-width:900px) {
  .board-filter,.board-filter-owner { grid-template-columns:1fr 1fr; }
  .board-filter button { width:100%; }
}
@media (max-width:620px) {
  .board-filter,.board-filter-owner { grid-template-columns:1fr; }
  .order-board-page > .section-heading h1 { font-size:28px; }
}

/* Company receiving accounts */
.page:has(.bank-account-page) { max-width:1280px; padding-top:34px; }
.bank-page-heading { margin-bottom:18px; display:flex; align-items:flex-end; justify-content:space-between; gap:20px; }
.bank-page-heading h1 { margin:7px 0 0; font-size:34px; letter-spacing:-.02em; }
.bank-add-button { gap:5px; min-width:116px; justify-content:center; }
.bank-add-button span { font-size:19px; line-height:1; }
.bank-account-summary { margin-bottom:18px; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.bank-account-summary > div { min-height:86px; padding:14px 17px; display:grid; align-content:center; gap:4px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 5px 18px rgba(18,34,29,.035); }
.bank-account-summary span { color:var(--muted); font-size:12px; }
.bank-account-summary strong { font-size:22px; }
.bank-account-summary .active { border-top:3px solid var(--accent); }
.bank-account-summary .active strong { color:var(--accent); }
.bank-account-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.bank-account-card { overflow:hidden; border:1px solid #d6e0db; border-radius:14px; background:#fff; box-shadow:0 8px 24px rgba(18,34,29,.05); }
.bank-account-card > header { padding:17px 18px 14px; display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.bank-account-card h2 { margin:4px 0 0; font-size:20px; line-height:1.35; }
.bank-channel { color:var(--muted); font-size:11px; font-weight:800; letter-spacing:.06em; }
.bank-status { flex:none; padding:5px 9px; border-radius:999px; color:#6a746f; background:#edf1ef; font-size:12px; font-weight:800; }
.bank-status.is-active { color:#087052; background:#dff3ea; }
.bank-account-number { margin:0 18px; padding:14px 15px; display:grid; gap:6px; border-left:4px solid var(--accent); border-radius:8px; background:#eff7f3; }
.bank-account-number span { color:var(--muted); font-size:11px; }
.bank-account-number strong { overflow-wrap:anywhere; font-size:17px; letter-spacing:.055em; }
.bank-account-details { margin:14px 18px 0; display:grid; grid-template-columns:1fr 1fr; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.bank-account-details > div { min-height:72px; padding:11px 13px; border-bottom:1px solid var(--line); }
.bank-account-details > div:nth-child(odd) { border-right:1px solid var(--line); }
.bank-account-details > div:nth-last-child(-n+2) { border-bottom:0; }
.bank-account-details dt { color:var(--muted); font-size:11px; }
.bank-account-details dd { margin:4px 0 0; overflow-wrap:anywhere; font-weight:700; }
.bank-account-card > footer { margin-top:14px; padding:12px 18px; display:flex; justify-content:flex-end; border-top:1px solid var(--line); background:#fafcfb; }
.bank-edit-button { padding:7px 13px; border:1px solid #a8c9bc; border-radius:8px; color:#09684e; background:#fff; font-size:13px; font-weight:800; text-decoration:none; }
.bank-edit-button:hover { border-color:var(--accent); background:#edf8f3; }
.bank-account-card.is-inactive { opacity:.7; }
.bank-account-empty { grid-column:1/-1; padding:48px; border:1px dashed #becbc5; border-radius:14px; color:var(--muted); background:#fff; text-align:center; }

.page:has(.bank-account-form-page) { max-width:980px; padding-top:34px; }
.bank-account-form-page > .back-link { display:inline-block; margin-bottom:12px; }
.bank-form-card { overflow:hidden; border:1px solid var(--line); border-radius:16px; background:#fff; box-shadow:0 12px 34px rgba(18,34,29,.06); }
.bank-form-card > header { padding:20px 24px; border-bottom:1px solid var(--line); background:#f8fbf9; }
.bank-form-card h1 { margin:0; font-size:28px; }
.bank-account-form { padding:24px; }
.bank-account-form fieldset { margin:0 0 22px; padding:0; border:0; }
.bank-account-form legend { width:100%; margin-bottom:13px; padding-bottom:8px; border-bottom:1px solid var(--line); font-size:17px; font-weight:850; }
.bank-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.bank-form-grid > div { display:grid; align-content:start; gap:6px; }
.bank-form-grid .full { grid-column:1/-1; }
.bank-form-grid label { font-size:13px; }
.bank-form-grid textarea { min-height:82px; }
.bank-form-actions { padding-top:18px; display:flex; justify-content:flex-end; gap:10px; border-top:1px solid var(--line); }
.bank-form-actions .button,.bank-form-actions button { min-width:100px; justify-content:center; }

@media (max-width:760px) {
  .bank-account-summary,.bank-account-grid,.bank-form-grid { grid-template-columns:1fr; }
  .bank-form-grid .full { grid-column:auto; }
  .bank-page-heading { align-items:stretch; flex-direction:column; }
  .bank-add-button { width:100%; }
}

/* Compact PI order creation */
.page:has(.pi-compact-review) > .message { display:none; }
.pi-review-heading { width:min(1880px,calc(100vw - 24px)); margin:0 0 10px 50%; transform:translateX(-50%); }
.pi-review-heading h1 { margin:6px 0 0; font-size:22px; }
.pi-file-name { max-width:760px; margin:3px 0 0; overflow:hidden; color:var(--muted); font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
.pi-compact-review { padding:0 !important; border:0; background:#f1f5f3; }
.pi-compact-review .stacked-form { gap:10px; }
.pi-compact-review .review-section { margin:0; padding:16px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.pi-compact-review .review-section-title { margin-bottom:12px; }
.pi-compact-review .review-section-title h2 { font-size:18px; }
.pi-compact-review .review-section-title > div > span { width:28px; height:28px; display:grid; place-items:center; border-radius:7px; color:#fff; background:var(--accent); font-size:12px; }
.pi-compact-review .review-field { padding:9px; border-left-width:1px; background:#fafcfb; }
.pi-compact-review .review-field.state-normal,.pi-compact-review .review-field.state-corrected { border-color:#dce4e0; background:#fafcfb; }
.pi-compact-review .review-field.state-review { border-color:#dda63a; background:#fffaf0; }
.pi-compact-review .review-field.state-must-fix { border:2px solid #c24132; background:#fff5f3; }
.pi-compact-review .status-normal,.pi-compact-review .status-corrected { display:none; }
.pi-compact-review .field-heading label { color:#43514b; font-size:12px; }
.pi-compact-review .field-heading:has(.status-must-fix) label { color:#a23225; }
.pi-compact-review .review-field input,.pi-compact-review .review-field select { min-height:36px; }
.pi-compact-review .review-field textarea { min-height:66px; }
.pi-compact-review .country-suggestion { margin:10px 0 0; padding:8px 10px; font-size:12px; }
.pi-compact-review .pi-items-scroll { border-radius:8px; }
.pi-compact-review .pi-item-table { min-width:760px; }
.pi-compact-review .pi-item-table .col-kind { width:86px; }
.pi-compact-review .pi-item-table .col-qty { width:112px; }
.pi-compact-review .pi-item-table .col-price,.pi-compact-review .pi-item-table .col-amount { width:94px; }
.pi-compact-review .pi-item-table th { padding:9px; color:#53615b; background:#eef3f0; }
.pi-compact-review .pi-item-table td { padding:9px; vertical-align:middle; }
.pi-compact-review .pi-item-kind .line-number { color:var(--muted); font-size:10px; }
.pi-compact-review .pi-item-kind .line-state.status-normal { display:none; }
.pi-compact-review .pi-item-kind .line-category { margin-top:3px; border:0; color:#155f49; background:#e6f4ed; font-weight:800; }
.pi-equipment-title { display:grid; grid-template-columns:110px minmax(170px,1fr); gap:7px; }
.pi-equipment-title input,.line-description-only { min-height:34px !important; font-weight:750; }
.pi-equipment-detail { margin-top:7px; display:grid; grid-template-columns:120px minmax(210px,1fr); gap:7px; }
.pi-equipment-detail label { display:grid; gap:3px; color:var(--muted); font-size:10px; }
.pi-equipment-detail input,.pi-equipment-detail textarea { min-height:34px !important; padding:6px 7px; font-size:12px; }
.pi-equipment-detail textarea { height:52px; resize:vertical; }
.pi-quantity-unit { display:grid; grid-template-columns:1fr 48px; gap:5px; }
.pi-compact-review .pi-item-table td > input,.pi-compact-review .pi-item-table td select,.pi-quantity-unit input { min-height:34px; padding:5px 6px; border-radius:6px; font-size:12px; }
.pi-compact-review .line-unit-price,.pi-compact-review .line-amount { text-align:right; font-variant-numeric:tabular-nums; }
.pi-compact-review .line-actions { margin-top:10px; }
.pi-compact-review .line-actions strong { font-size:12px; }
.pi-create-bar { position:sticky; bottom:-18px; z-index:4; padding:12px 16px !important; display:grid; grid-template-columns:1fr 180px; align-items:center; gap:12px; border-color:#c7d9d1 !important; box-shadow:0 -8px 22px rgba(18,34,29,.08); }
.pi-create-bar .create-block-reason { margin:0; padding:8px 10px; }
.pi-create-bar .create-order-button { width:180px; margin:0; }
.pi-compact-review + .reject-panel { margin-top:14px; }

@media (max-width:1120px) {
  .pi-review-heading { width:100%; margin-left:0; transform:none; }
}
@media (max-width:760px) {
  .pi-create-bar { position:static; grid-template-columns:1fr; }
  .pi-create-bar .create-order-button { width:100%; }
  .pi-equipment-detail,.pi-equipment-title { grid-template-columns:1fr; }
}

/* Site-wide visual system */
:root {
  --shadow-sm: 0 5px 18px rgba(18, 34, 29, .045);
  --shadow-md: 0 12px 34px rgba(18, 34, 29, .07);
  --radius-sm: 10px;
  --radius-md: 14px;
  --blue: #257fc3;
  --green: #159a58;
  --orange: #c77717;
  --red: #c24132;
}
html { color-scheme: light; }
body { font-variant-numeric: tabular-nums; }
h1, h2, h3 { letter-spacing: -.018em; }
button, .button, a { -webkit-tap-highlight-color: transparent; }
button, .button { transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease; }
button:hover, .button:hover { transform: translateY(-1px); }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 3px solid rgba(14, 122, 95, .2); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(14, 122, 95, .15); border-color: var(--accent); }
input[type="file"] { padding: 7px; border-style: dashed; background: #fafcfb; }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 7px 11px; border: 0; border-radius: 7px; color: #fff; background: var(--accent); font-weight: 750; cursor: pointer; }
.primary, .secondary, .danger { display: inline-flex; align-items: center; justify-content: center; }
.secondary:hover { border-color: #9dbab0; color: var(--accent-dark); background: #f4faf7; }
.danger:hover { background: #8f2f24; }
.page-title-row { align-items: flex-end; }
.page-title-row h1 { margin: 7px 0 2px; font-size: clamp(30px, 4vw, 38px); }
.page-title-row .muted { margin: 0; font-size: 13px; }
.page-detail-hero { padding: 22px 24px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-sm); }
.page-detail-hero h1 { margin-top: 0; }
.back-link { display: inline-flex; align-items: center; min-height: 32px; font-weight: 750; text-underline-offset: 3px; }
.message { border: 1px solid #b9ddcf; border-left: 5px solid var(--accent); box-shadow: var(--shadow-sm); }
.message-error { color: #842d23; border-color: #e4b0a8; border-left-color: var(--red); background: #fff1ee; }
.message-warning { color: #76500e; border-color: #e5ca90; border-left-color: var(--orange); background: #fff8e7; }
.form-error, .errorlist { margin: 0; border: 1px solid #efc3bc; }
.errorlist { list-style: none; }
.helptext { color: var(--muted); font-size: 12px; }

/* Header and home */
.topbar { position: relative; z-index: 20; box-shadow: 0 4px 18px rgba(18, 34, 29, .16); }
.home-button { color: #fff; border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.08); box-shadow: none; }
.home-button:hover { color: #fff; border-color: rgba(255,255,255,.42); background: rgba(255,255,255,.15); box-shadow: none; }
.home-page { max-width: 1080px; margin: 0 auto; }
.home-hero { padding: 28px; align-items: center; border-radius: 18px; color: #fff; background: linear-gradient(135deg, #12352b, #0e7a5f); box-shadow: var(--shadow-md); }
.home-hero h1 { max-width: 760px; }
.home-hero .eyebrow, .home-hero .muted { color: #d7eee6; }
.home-hero .role-badge { color: #0a5d47; background: #fff; }
.home-section-heading { margin: 28px 0 12px; }
.home-section-heading h2 { margin: 0; font-size: 19px; }
.nav-card { position: relative; min-height: 132px; justify-content: space-between; overflow: hidden; box-shadow: var(--shadow-sm); }
.nav-card::after { content: "→"; align-self: flex-end; color: var(--accent); font-size: 20px; font-weight: 900; }
.nav-card.accent::after { color: #fff; }

/* Forms */
.form-page { max-width: 900px; margin: 0 auto; }
.form-page > .back-link { margin-bottom: 12px; }
.standard-form-card { max-width: 680px; margin: 0; padding: 0; overflow: hidden; box-shadow: var(--shadow-md); }
.standard-form-card.wide { max-width: 900px; }
.standard-form-card > header { padding: 22px 26px 16px; border-bottom: 1px solid var(--line); background: #f8fbf9; }
.standard-form-card > header h1 { margin: 0; font-size: 28px; }
.standard-form-card > header .muted { margin: 4px 0 0; }
.standard-form-card > form, .standard-form-card > .stacked-form { margin: 0; padding: 24px 26px 26px; }
.standard-form-card > .eyebrow, .standard-form-card > h1, .standard-form-card > .metric-grid { margin-left: 26px; margin-right: 26px; }
.standard-form-card > .eyebrow { margin-top: 24px; }
.standard-form-card .stacked-form button[type="submit"] { margin-top: 6px; }
.account-form-page { max-width: 680px; }
.upload-card { text-align: left; }
.upload-card > header { text-align: center; }
.upload-icon, .auth-mark { width: 52px; height: 52px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: var(--accent); font-size: 13px; font-weight: 900; letter-spacing: .06em; }
.auth-card { text-align: center; box-shadow: var(--shadow-md); }
.auth-card .stacked-form { text-align: left; }
.auth-card .stacked-form button { margin-top: 8px; }

/* Filters and tables */
.filter-bar, .labeled-filter-bar { padding: 12px; align-items: end; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.filter-bar label, .labeled-filter-bar label { display: grid; gap: 5px; }
.filter-bar label > span, .labeled-filter-bar label > span { color: var(--muted); font-size: 11px; font-weight: 800; }
.labeled-filter-bar { grid-template-columns: minmax(260px,1fr) 170px 150px 88px; }
.labeled-filter-bar button, .board-filter button { width: 88px; color: #fff; border-color: var(--accent); background: var(--accent); font-weight: 800; }
.management-page { max-width: 1280px; margin: 0 auto; }
.management-table-wrap { box-shadow: var(--shadow-sm); }
.management-table-wrap table { min-width: 860px; }
.management-table-wrap tbody tr { transition: background-color .15s ease; }
.management-table-wrap tbody tr:hover { background: #f8fbf9; }
.management-table-wrap td { vertical-align: middle; }
.table-primary-link { color: #09684f; font-weight: 850; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.table-action-link, .row-actions a { padding: 5px 9px; border: 1px solid #bdd4cb; border-radius: 7px; color: #09684f; background: #fff; font-size: 12px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.table-action-link:hover, .row-actions a:hover { border-color: var(--accent); background: #eff8f4; }
.table-subtext { color: var(--muted); font-size: 11px; }
.status-chip, .role-chip, .count-chip { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; border-radius: 999px; color: #56645e; background: #edf2ef; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-chip.is-active { color: #087052; background: #dff3ea; }
.role-chip { color: #27634f; background: #e6f2ed; }
.empty-cell { height: 160px; color: var(--muted); text-align: center; }

/* Product cost library */
.cost-library-heading { margin-bottom: 14px; }
.cost-library-heading > .button { min-width: 132px; }
.cost-library-tabs { margin-bottom: 12px; padding: 5px; display: inline-flex; gap: 4px; border: 1px solid var(--line); border-radius: 11px; background: #edf2ef; }
.cost-library-tabs a { min-width: 112px; padding: 9px 15px; border-radius: 8px; color: #52615b; font-weight: 800; text-align: center; text-decoration: none; }
.cost-library-tabs a.is-active { color: #fff; background: var(--accent); box-shadow: 0 4px 12px rgba(14,122,95,.18); }
.cost-library-search { margin-bottom: 14px; padding: 10px; display: grid; grid-template-columns: minmax(220px, 460px) 86px; gap: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.cost-library-search input, .cost-library-search button { min-height: 40px; }
.device-cost-grid { display: grid; grid-template-columns: repeat(3, minmax(260px,1fr)); gap: 12px; }
.device-cost-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.device-cost-card header { padding: 17px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: #f6faf8; }
.device-cost-card header strong { color: #0d5845; font-size: 21px; }
.device-cost-card header span { color: #835f12; font-weight: 850; }
.device-cost-counts { padding: 16px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.device-cost-counts span { padding: 10px; display: grid; gap: 2px; border-radius: 9px; color: var(--muted); background: #f4f7f5; font-size: 12px; }
.device-cost-counts b { color: var(--ink); font-size: 18px; }
.device-cost-card footer { padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); }
.device-cost-card footer small { color: var(--muted); }
.cost-library-empty { min-height: 180px; grid-column: 1/-1; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); background: #fff; }
.cost-library-table table { min-width: 760px; }
.model-chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.model-chip-list span { padding: 3px 7px; border-radius: 999px; color: #0b684f; background: #e3f3ec; font-size: 11px; font-weight: 800; }
.model-chip-list em { color: var(--muted); font-size: 12px; font-style: normal; }
.packaging-model-field { display: grid; gap: 9px; }
.packaging-model-field > strong { font-size: 13px; }
.packaging-model-field > div { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.packaging-model-field > div > label { padding: 9px 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fafcfb; cursor: pointer; }
.packaging-model-field input { width: auto; min-height: auto; }
.device-cost-edit-page { max-width: 980px; }
.device-cost-editor { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow-md); }
.device-cost-editor > header { padding: 22px 26px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg,#f4faf7,#fff); }
.device-cost-editor > header span { color: var(--muted); font-size: 12px; font-weight: 800; }
.device-cost-editor > header h1 { margin: 4px 0 0; font-size: 32px; }
.device-cost-editor form { display: grid; gap: 0; }
.device-cost-group { padding: 22px 26px; border-bottom: 1px solid var(--line); }
.device-cost-group h2 { margin: 0 0 13px; font-size: 17px; }
.device-cost-fields { display: grid; grid-template-columns: repeat(2,minmax(220px,1fr)); gap: 10px; }
.device-cost-fields label { padding: 12px; display: grid; grid-template-columns: minmax(130px,1fr) 180px; align-items: center; gap: 12px; border: 1px solid #e1e8e4; border-radius: 10px; background: #fafcfb; }
.device-cost-fields label > span { font-weight: 750; }
.device-cost-fields input { min-width: 0; text-align: right; }
.device-cost-fields .errorlist { grid-column: 1/-1; }
.device-cost-save { padding: 18px 26px; display: flex; justify-content: flex-end; background: #f8fbf9; }
.device-cost-save button { min-width: 210px; }

/* Board refinements */
.board-filter { align-items: end; }
.board-filter label { display: grid; gap: 5px; }
.board-filter label > span { color: var(--muted); font-size: 11px; font-weight: 800; }
.order-board-page > .page-title-row { align-items: flex-end; }

/* Payment pages */
.payment-review-page { max-width: 1080px; margin: 0 auto; }
.payment-review-summary { margin: 16px 0; display: grid; grid-template-columns: .7fr 1fr 1fr 1.6fr; gap: 10px; }
.payment-review-summary > div { min-height: 92px; padding: 15px; display: grid; align-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.payment-review-summary span { color: var(--muted); font-size: 12px; }
.payment-review-summary strong { overflow-wrap: anywhere; }
.payment-review-page .two-column .form-card { margin-top: 0; box-shadow: var(--shadow-sm); }
.payment-review-page .two-column .form-card h2 { margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.payment-declare-page .metric-grid { grid-template-columns: repeat(3,1fr); }

/* Work items */
.work-items-page { max-width: 980px; margin: 0 auto; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-title-row h2 { margin: 0; }
.count-chip { min-width: 28px; color: #087052; background: #dff3ea; }
.danger-count { color: #9b3327; background: #ffe5e0; }
.work-list-panel .status-row { align-items: center; gap: 20px; }
.work-list-panel .status-row > span:last-child { color: var(--muted); font-size: 12px; text-align: right; }
.detail-footer-actions { margin-top: 16px; display: flex; justify-content: flex-end; }

/* PI draft detail */
.pi-draft-detail-page { max-width: 1180px; margin: 0 auto; }
.pi-draft-detail-page .alert-list, .pi-draft-detail-page .status-panel { box-shadow: var(--shadow-sm); }

@media (max-width: 1000px) {
  .payment-review-summary { grid-template-columns: 1fr 1fr; }
  .nav-grid { grid-template-columns: repeat(2, 1fr); }
  .device-cost-grid { grid-template-columns: repeat(2,minmax(260px,1fr)); }
  .device-cost-fields { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .topbar { height: auto; min-height: 62px; padding-top: 10px; padding-bottom: 10px; }
  .brand-group { flex: 1; }
  .main-nav { display: none; }
}
@media (max-width: 760px) {
  .page { padding-top: 22px; }
  .page-title-row { align-items: stretch; flex-direction: column; }
  .page-title-row > .button { width: 100%; justify-content: center; }
  .home-hero { padding: 23px 20px; }
  .home-hero h1 { font-size: 28px; }
  .nav-grid { grid-template-columns: 1fr; }
  .nav-card { min-height: 112px; }
  .standard-form-card { width: 100%; }
  .standard-form-card > header, .standard-form-card > form, .standard-form-card > .stacked-form { padding-left: 18px; padding-right: 18px; }
  .standard-form-card > .eyebrow, .standard-form-card > h1, .standard-form-card > .metric-grid { margin-left: 18px; margin-right: 18px; }
  .labeled-filter-bar, .board-filter, .board-filter-owner { grid-template-columns: 1fr; }
  .labeled-filter-bar button, .board-filter button { width: 100%; }
  .payment-review-summary, .payment-declare-page .metric-grid { grid-template-columns: 1fr; }
  .work-list-panel .status-row { align-items: flex-start; flex-direction: column; gap: 6px; }
  .work-list-panel .status-row > span:last-child { text-align: left; }
  .status-row { align-items: flex-start; flex-direction: column; gap: 5px; }
  .payment-review-page .two-column { gap: 12px; }
  .readonly-grid { grid-template-columns: 1fr; }
  .readonly-grid .full { grid-column: auto; }
  .cost-library-heading > .button { width: 100%; }
  .cost-library-tabs { width: 100%; display: grid; grid-template-columns: repeat(3,1fr); }
  .cost-library-tabs a { min-width: 0; padding-left: 8px; padding-right: 8px; }
  .cost-library-search, .device-cost-grid { grid-template-columns: 1fr; }
  .cost-library-search button { width: 100%; }
  .device-cost-fields label { grid-template-columns: 1fr; }
  .device-cost-save button { width: 100%; }
  .packaging-model-field > div { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 560px) {
  .topbar { justify-content: space-between; }
  .home-button { padding: 7px 10px; }
  .account { gap: 8px; }
  .auth-card { border-radius: 14px; }
  .profit-overview-card b { overflow-wrap: anywhere; }
}
