:root {
  --ink: #172631;
  --muted: #6d7c85;
  --line: #dbe4e7;
  --panel: #fff;
  --bg: #eef3f4;
  --navy: #132d3b;
  --teal: #0d8b84;
  --teal-dark: #08726d;
  --teal-soft: #e8f7f5;
  --orange: #f47b3a;
  --danger: #bd453a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--bg); }
button, input, select { font: inherit; }
button { color: inherit; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { position: relative; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 10px; background: var(--navy); overflow: hidden; }
.brand-mark::before { content: ''; position: absolute; width: 28px; height: 12px; border: 3px solid #fff; border-radius: 8px; opacity: .95; }
.brand-mark i { position: relative; z-index: 1; width: 3px; height: 18px; background: var(--orange); border-radius: 2px; }
.brand-name { display: flex; align-items: baseline; gap: 0; line-height: 1; white-space: nowrap; }
.brand strong, .brand b { display: block; margin: 0; font-size: 22px; letter-spacing: -.7px; }
.brand strong { font-weight: 800; }.brand b { color: var(--teal); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.top-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.top-status b { font-weight: 600; }
.top-status span { width: 8px; height: 8px; border-radius: 50%; background: #28a875; box-shadow: 0 0 0 4px #e3f6ee; }
.language-picker { position: relative; z-index: 40; color: var(--muted); }
.language-trigger { width: 166px; height: 38px; display: grid; grid-template-columns: 26px minmax(0,1fr) 10px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #cbd7db; border-radius: 9px; background: #fff; color: var(--ink); font-size: 11px; font-weight: 750; text-align: left; cursor: pointer; }
.language-trigger:hover, .language-trigger[aria-expanded="true"] { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(13,139,132,.1); }
.language-trigger img, .language-menu img { width: 24px; height: 16px; display: block; border: 1px solid rgba(23,38,49,.14); border-radius: 2px; object-fit: cover; }
.language-trigger i { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.language-menu { position: absolute; top: calc(100% + 5px); right: 0; width: 192px; max-height: min(430px,calc(100vh - 86px)); overflow-y: auto; padding: 5px; border: 1px solid #bdcbd0; border-radius: 9px; background: #fff; box-shadow: 0 14px 35px rgba(17,41,53,.2); }
.language-menu[hidden] { display: none; }
.language-menu button { width: 100%; min-height: 34px; display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font-size: 11px; text-align: left; cursor: pointer; }
.language-menu button:hover, .language-menu button:focus { outline: none; background: #edf7f6; }
.language-menu button[aria-selected="true"] { background: var(--teal); color: #fff; font-weight: 800; }
.language-native-select { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app-shell { min-height: calc(100vh - 100px); display: grid; grid-template-columns: 400px minmax(0,1fr); }
.sidebar { padding: 18px; overflow-y: auto; border-right: 1px solid var(--line); background: #f7f9fa; }
.panel { margin-bottom: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: 0 2px 10px rgba(21,45,58,.035); }
.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.section-heading > span { flex: 0 0 26px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 800; }
.section-heading h2 { margin: 0; font-size: 14px; }.section-heading p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.field-grid { display: grid; gap: 9px; }.field-grid.two { grid-template-columns: 1fr 1fr; }.field-grid.three { grid-template-columns: repeat(3,1fr); }
.field { min-width: 0; display: block; color: #53636c; font-size: 10px; font-weight: 700; }.field.full { margin-bottom: 9px; }
.field input, .field select { width: 100%; height: 36px; margin-top: 5px; padding: 7px 9px; border: 1px solid #cbd7db; border-radius: 7px; outline: none; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus, .cut-input:focus { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(13,139,132,.11); }
.dimensions { margin-top: 9px; }.dimensions:empty { display: none; }.dimensions .field > span { min-height: 24px; display: flex; align-items: flex-end; line-height: 1.2; }
.profile-switcher { margin-bottom: 9px; padding: 9px; border: 1px solid #dce5e7; border-radius: 8px; background: #f7fafb; }
.profile-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; color: #53636c; font-size: 10px; font-weight: 750; }
.profile-list-heading button { min-height: 28px; padding: 0 9px; border: 1px solid #cbd7db; border-radius: 6px; background: #fff; color: var(--teal-dark); font-size: 9px; font-weight: 800; cursor: pointer; }.profile-list-heading button b { margin-right: 4px; color: var(--teal); font-size: 14px; }.profile-list-heading button:hover { border-color: var(--teal); background: var(--teal-soft); }
.profile-list { max-height: 158px; display: grid; gap: 5px; overflow-y: auto; }
.profile-list-item { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 27px; align-items: stretch; border: 1px solid #d4dfe2; border-radius: 7px; background: #fff; overflow: hidden; }
.profile-list-item.active { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(13,139,132,.1); }
.profile-list-select { min-width: 0; padding: 7px 9px; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }.profile-list-select strong, .profile-list-select small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.profile-list-select strong { font-size: 10px; }.profile-list-select small { margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 600; }
.profile-list-remove { width: 27px; border: 0; border-left: 1px solid #edf1f2; background: transparent; color: #a5b0b5; font-size: 15px; cursor: pointer; }.profile-list-remove:hover:not(:disabled) { color: var(--danger); background: #fff0ee; }.profile-list-remove:disabled { opacity: .25; cursor: default; }
.profile-name-field { margin-top: 0; }
.field-help { margin: 10px 0 0; padding: 8px 9px; border-radius: 7px; background: #f5f8f9; color: var(--muted); font-size: 9px; line-height: 1.45; }.field-help strong { color: #52626b; }
.stock-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; color: #465862; font-size: 10px; }.stock-heading small { color: var(--muted); font-size: 8px; font-weight: 600; }
.stock-columns, .stock-row { display: grid; grid-template-columns: minmax(0,1fr) 79px 42px 48px 22px; gap: 5px; }
.stock-columns { padding: 0 3px 3px; color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .03em; }
.stock-list { display: grid; gap: 6px; }.stock-row { align-items: center; }.stock-row input, .stock-row select { width: 100%; height: 32px; padding: 5px 6px; border: 1px solid #d0dade; border-radius: 6px; background: #fff; color: var(--ink); font-size: 9px; outline: none; }.stock-row input:focus, .stock-row select:focus { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(13,139,132,.1); }.stock-length, .stock-quantity { text-align: right; }
.stock-priority-label { height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid #d0dade; border-radius: 6px; background: #fff; cursor: pointer; }.stock-priority-label:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }.stock-priority-label input { width: 14px; height: 14px; margin: 0; padding: 0; accent-color: var(--teal); cursor: pointer; }
.remove-stock { width: 27px; height: 31px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #99a6ac; font-size: 17px; cursor: pointer; }.remove-stock:hover:not(:disabled) { color: var(--danger); background: #fff0ee; }.remove-stock:disabled { opacity: .25; cursor: default; }
.stock-add-button { margin-top: 8px; }.tool-field { width: calc(50% - 5px); margin-top: 11px; }
.import-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.save-project-button { grid-column: 1 / -1; background: var(--teal-soft); border-color: #b9deda; color: var(--teal-dark); }
.project-file-panel { padding: 12px; border-color: #b9deda; background: linear-gradient(135deg,#f8fdfc,#f1f8f8); }.project-file-heading h2 { margin: 0; font-size: 13px; }.project-file-heading p { margin: 2px 0 9px; color: var(--muted); font-size: 9px; }.project-file-panel .import-actions { margin-bottom: 0; }
.ghost-button, .add-row-button { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #cbd7db; border-radius: 7px; background: #fff; color: #42545e; font-size: 10px; font-weight: 750; cursor: pointer; }
.ghost-button:hover, .add-row-button:hover { border-color: var(--teal); color: var(--teal-dark); background: var(--teal-soft); }
.ghost-button span { color: var(--teal); font-size: 15px; }.ghost-button b, .add-row-button b { font: inherit; }.import-button { position: relative; }
.cut-columns, .cut-row { display: grid; grid-template-columns: minmax(0,1fr) 82px 76px 45px 27px; gap: 5px; }
.cut-columns { padding: 0 3px 3px; color: var(--muted); font-size: 7px; font-weight: 750; text-transform: uppercase; letter-spacing: .025em; }
.cuts-list { display: grid; gap: 6px; }
.cut-row { align-items: center; }
.cut-input { width: 100%; height: 31px; padding: 5px 6px; border: 1px solid #d3dde0; border-radius: 6px; outline: none; background: #fff; color: var(--ink); font-size: 9px; }
.cut-length, .cut-quantity { text-align: right; }
.remove-cut { width: 27px; height: 30px; border: 0; border-radius: 5px; background: transparent; color: #99a6ac; font-size: 17px; cursor: pointer; }.remove-cut:hover:not(:disabled) { color: var(--danger); background: #fff0ee; }.remove-cut:disabled { opacity: .25; cursor: default; }
.add-row-button { width: 100%; margin-top: 8px; border-style: dashed; }.add-row-button span { color: var(--teal); font-size: 16px; }
table { width: 100%; border-collapse: collapse; }
.primary-button { width: 100%; height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border: 0; border-radius: 10px; background: var(--teal); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 6px 15px rgba(13,139,132,.2); }.primary-button:hover { background: var(--teal-dark); }.primary-button:disabled { opacity: .55; cursor: wait; }
.message { min-height: 19px; margin: 8px 4px 0; color: var(--muted); font-size: 10px; line-height: 1.4; }.message.error { color: var(--danger); }.message.success { color: #167458; }
.workspace { min-width: 0; padding: 0 26px 28px; background: var(--bg); }
.workspace-toolbar { min-height: 76px; display: flex; align-items: center; gap: 16px; }
.workspace-toolbar h1 { margin: 0; font-size: 18px; }.workspace-toolbar p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.toolbar-actions { margin-left: auto; display: flex; gap: 8px; }.toolbar-actions button { height: 36px; padding: 0 14px; border-radius: 7px; font-size: 10px; font-weight: 750; cursor: pointer; }
.secondary-button { border: 1px solid #cbd7db; background: #fff; }.export-button { border: 1px solid var(--navy); background: var(--navy); color: #fff; }.toolbar-actions button:disabled { opacity: .4; cursor: default; }
.result-area { min-height: 0; }
.metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 13px; }
.metrics article { min-width: 0; min-height: 69px; display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.metric-icon { flex: 0 0 37px; width: 37px; height: 37px; display: grid; place-items: center; border-radius: 8px; font-weight: 850; }.metric-icon.bars { color: var(--teal); background: var(--teal-soft); }.metric-icon.usage { color: var(--orange); background: #fff0e8; }.metric-icon.pieces { color: #5574a0; background: #edf3fb; }.metric-icon.waste { color: #916b32; background: #f8f2e7; }
.metrics small { display: block; overflow: hidden; color: var(--muted); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }.metrics strong { display: block; margin-top: 2px; font-size: 17px; }
.result-card { margin-bottom: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 2px 10px rgba(21,45,58,.03); }
.card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }.card-heading h2 { margin: 0; font-size: 14px; }.card-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.profile-badge { margin-left: auto; padding: 6px 9px; border-radius: 6px; background: #f1f5f6; color: #53646d; font-size: 9px; font-weight: 750; }
.bars-visual { display: grid; gap: 13px; max-height: 410px; overflow-y: auto; padding-right: 5px; }
.profile-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 5px 0 -3px; padding: 8px 10px; border-left: 3px solid var(--teal); border-radius: 4px; background: #f2f7f7; color: #344952; font-size: 10px; font-weight: 800; }.profile-result-heading span { color: var(--muted); font-size: 8px; font-weight: 650; }
.bar-row { display: grid; grid-template-columns: 78px minmax(180px,1fr) 88px; align-items: center; gap: 10px; }
.bar-label { font-size: 9px; font-weight: 800; color: #52636c; }.bar-label small { display: block; margin-top: 2px; color: var(--muted); font-size: 7px; font-weight: 650; }.bar-track { position: relative; height: 35px; display: flex; overflow: hidden; border: 1px solid #9cafb5; border-radius: 6px; background: repeating-linear-gradient(135deg,#f2f5f6,#f2f5f6 5px,#e8edef 5px,#e8edef 10px); }
.bar-piece { position: relative; min-width: 2px; display: grid; place-items: center; border-right: 1px solid rgba(255,255,255,.9); color: #fff; font-size: 8px; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.25); white-space: nowrap; overflow: hidden; }
.bar-kerf { flex: 0 0 auto; min-width: 1px; background: #243a45; opacity: .88; }
.bar-waste-label { color: var(--muted); font-size: 9px; text-align: right; }.bar-waste-label strong { color: #57676f; }
.result-table-wrap { overflow-x: auto; }.result-table { min-width: 790px; }.result-table th { padding: 8px 9px; border-bottom: 1px solid var(--line); background: #f7f9fa; color: #63727a; font-size: 8px; text-align: left; text-transform: uppercase; letter-spacing: .035em; }.result-table td { padding: 10px 9px; border-bottom: 1px solid #edf1f2; color: #40515a; font-size: 10px; vertical-align: top; }.result-table tr:last-child td { border-bottom: 0; }.pattern-code { color: var(--teal-dark); font-weight: 850; }.cut-sequence { line-height: 1.55; }.cut-chip { display: inline-block; margin: 0 4px 3px 0; padding: 3px 6px; border-radius: 4px; background: #eff4f5; white-space: nowrap; }
footer { height: 32px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-top: 1px solid var(--line); background: #fff; color: #87949a; font-size: 9px; } footer a { color: inherit; }
@media (max-width: 1050px) { .app-shell { grid-template-columns: 350px minmax(0,1fr); }.sidebar { padding: 13px; }.workspace { padding: 0 15px 20px; }.metrics { grid-template-columns: 1fr 1fr; }.top-status { display: none; } }
@media (max-width: 760px) { .topbar { height: 62px; padding: 0 15px; }.language-trigger { width: 144px; }.language-menu { width: 184px; }.app-shell { display: block; }.sidebar { overflow: visible; border-right: 0; }.workspace { padding-top: 4px; }.bar-row { grid-template-columns: 45px minmax(150px,1fr); }.bar-waste-label { grid-column: 2; }.metrics { grid-template-columns: 1fr 1fr; } footer { padding: 0 15px; } }
@media (max-width: 470px) { .brand-mark { width: 36px; height: 36px; }.brand strong, .brand b { font-size: 19px; }.language-trigger { width: 50px; grid-template-columns: 26px 8px; }.language-trigger span { display: none; }.language-menu { right: 0; } }
[dir="rtl"] .language-menu { right: auto; left: 0; }
[dir="rtl"] .language-trigger, [dir="rtl"] .language-menu button, [dir="rtl"] .result-table th { text-align: right; }
[dir="rtl"] .toolbar-actions, [dir="rtl"] .profile-badge { margin-left: 0; margin-right: auto; }
[dir="rtl"] .profile-result-heading { border-left: 0; border-right: 3px solid var(--teal); }
@media print { .topbar, .sidebar, .toolbar-actions, footer { display: none !important; }.app-shell { display: block; }.workspace { padding: 0; }.result-card, .metrics article { break-inside: avoid; box-shadow: none; }.bars-visual { max-height: none; overflow: visible; } }
