:root {
  color-scheme: light;
  --ink: #192922;
  --muted: #58655e;
  --light-text: #acbcb3;
  --pine: #172a24;
  --pine-deep: #12231d;
  --green: #255841;
  --canvas: #f6f7f3;
  --surface: #fff;
  --line: #e4e9e1;
  --accent: #f4a36b;
  --accent-hover: #ffb781;
  --display: 'Manrope', system-ui, sans-serif;
  --font: 'DM Sans', system-ui, sans-serif;
  --radius: 15px;
  --shadow: 0 1px 2px #14261d0a;
}
* { box-sizing: border-box; }
body { margin: 0; font: 400 1rem/1.5 var(--font); color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #469676; outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
svg.icon { width: 19px; height: 19px; flex: none; display: inline-block; vertical-align: middle; }
p, h1, h2, h3 { margin: 0; }
h1, h2, h3, .number, .brand strong { font-family: var(--display); }
h1 { font-weight: 800; font-size: clamp(1.8rem, 3.2vw, 2.22rem); line-height: 1.18; letter-spacing: -.045em; }
h2 { font-size: 1.1rem; font-weight: 800; letter-spacing: -.024em; }
h3 { font-size: 1rem; font-weight: 800; }
small, .small { font-size: .84rem; }
.muted { color: var(--muted); }
.skip { position: fixed; z-index: 20; top: 10px; left: 10px; background: white; padding: 10px; transform: translateY(-150%); }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { color: #eaf0eb; background: var(--pine); height: 100vh; height: 100dvh; position: sticky; top: 0; display: flex; flex-direction: column; padding: 28px 16px 16px; overflow-y: auto; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 8px; margin-bottom: 43px; }
.brand-mark { width: 39px; height: 39px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--pine-deep); flex: none; }
.brand-mark .icon { width: 23px; height: 23px; }
.brand strong { display: block; font-size: 1.09rem; line-height: 1.25; font-weight: 800; letter-spacing: -.035em; }
.brand small { display: block; font-size: .73rem; color: var(--light-text); margin-top: 3px; }
.nav-group + .nav-group { margin-top: 24px; }
.nav-label { margin: 0 10px 8px; font-size: .69rem; text-transform: uppercase; letter-spacing: .105em; font-weight: 700; color: var(--light-text); }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 11px; min-height: 43px; font-size: .9rem; font-weight: 600; color: #d9e3dc; border-radius: 8px; margin: 3px 0; }
.nav-item:hover { background: #ffffff12; }
.nav-item[aria-current="page"] { color: #fff; background: #31483e; }
.nav-item[aria-current="page"] .icon { color: #ffb484; }
.nav-item[aria-current="page"]::before { content: ''; position: absolute; top: 10px; bottom: 10px; left: 0; width: 2px; background: var(--accent); border-radius: 4px; }
.sidebar-spacer { flex: 1; min-height: 35px; }
.workshop { border: 1px solid #ffffff16; background: #ffffff08; border-radius: 11px; display: flex; align-items: center; gap: 9px; padding: 10px; width: 100%; text-align: left; color: #f4f7f4; }
.workshop:hover { background: #ffffff14; }
.workshop > .icon { margin-left: auto; width: 15px; }
.workshop > span:nth-child(2) { flex: 1; min-width: 0; }
.workshop strong, .workshop small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workshop strong { font-size: .82rem; }
.workshop small { color: var(--light-text); font-size: .73rem; }
.workshop-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 7px; background: #e9f0e419; color: #d0e3cc; }
.topbar { min-height: 68px; background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px clamp(22px, 3vw, 44px); border-bottom: 1px solid var(--line); }
.crumb, .top-actions { display: flex; align-items: center; gap: 11px; }
.crumb { color: var(--muted); font-size: .87rem; }
.crumb strong { color: var(--ink); font-weight: 700; }
.crumb .icon { width: 13px; height: 13px; }
.top-actions { gap: 13px; }
.avatar { min-width: 34px; height: 34px; padding: 0 6px; border: none; border-radius: 50%; display: inline-grid; place-items: center; background: #dce9de; color: #264134; font-weight: 800; font-size: .78rem; }
.avatar:hover { background: #cfe2d3; }
.menu-toggle { display: none !important; }
.page { max-width: 1490px; margin: 0 auto; padding: 27px clamp(22px, 3vw, 44px) 45px; }
.page-head { display: flex; align-items: end; gap: 16px 22px; justify-content: space-between; margin-bottom: 23px; }
.page-head p { margin-top: 6px; color: var(--muted); }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); white-space: nowrap; font-weight: 700; font-size: .86rem; line-height: 1.3; }
.btn .icon { width: 17px; height: 17px; }
.btn:hover { border-color: #a8b9ac; background: #f5f8f4; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #2d2319; }
.btn.primary:hover { background: var(--accent-hover); border-color: #e98c51; }
.btn.pine { background: var(--pine); color: white; border-color: var(--pine); }
.btn.pine:hover { background: #2c4a3d; }
.btn.subtle { background: transparent; border-color: transparent; }
.btn.subtle:hover { background: #edf1eb; }
.btn.danger { color: #862b24; }
.hero { isolation: isolate; overflow: hidden; position: relative; display: flex; align-items: center; min-height: 206px; border-radius: var(--radius); padding: 24px 29px; color: white; background: #1c3529; }
.hero::before { content: ''; position: absolute; z-index: -2; inset: 0 0 0 40%; background: url('/cnc-atelier.webp') center 55% / cover no-repeat; }
.hero::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #1c3529 29%, #1c3529f5 41%, #1c35293b 72%, #142c2020); }
.hero > div { max-width: 490px; }
.hero h2 { font-size: clamp(1.54rem, 3vw, 2.12rem); line-height: 1.14; letter-spacing: -.045em; }
.hero p { margin-top: 9px; color: #e2ebe4; max-width: 41ch; font-size: .94rem; }
.hero .btn { margin-top: 15px; }
.stats { margin: 18px 0 23px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat { padding: 15px 16px; display: block; min-width: 0; }
a.stat:hover, .shortcut:hover { border-color: #a5bcb0; background: #fbfdfa; }
.stat-top { display: flex; align-items: center; gap: 9px; color: #4b5a52; font-size: .82rem; font-weight: 700; }
.stat-icon { display: inline-grid; place-items: center; width: 31px; height: 31px; flex: none; border-radius: 8px; color: #3a654f; background: #eaf3eb; }
.stat-icon.warm { background: #fff0df; color: #8d4a26; }
.stat-icon.pale { background: #edf0f4; color: #465c74; }
.stat-icon .icon { width: 16px; height: 16px; }
.stat .number { display: block; font-weight: 800; font-size: clamp(1.19rem, 2.1vw, 1.66rem); letter-spacing: -.05em; margin: 6px 0 0; line-height: 1.29; }
.stat small { display: block; margin-top: 2px; color: var(--muted); font-size: .76rem; }
.dashboard-grid, .split { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(260px, 1fr); gap: 17px; align-items: start; }
.split { gap: 20px; }
.panel { min-width: 0; }
.panel-head { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-head p { margin-top: 3px; }
.panel-body { padding: 17px 19px; }
.padded { padding: 19px; }
.text-link { padding: 0; border: 0; background: transparent; color: #2f6449; font-size: .84rem; font-weight: 800; white-space: nowrap; text-align: left; }
.text-link:hover { text-decoration: underline; }
.shortcut-list { display: grid; gap: 7px; padding: 0 13px 13px; }
.shortcut { border: 1px solid var(--line); border-radius: 9px; padding: 9px; display: flex; align-items: center; gap: 8px; }
.shortcut strong { display: block; font-size: .83rem; }
.shortcut small { color: var(--muted); display: block; font-size: .73rem; line-height: 1.3; }
.shortcut > .icon { width: 15px; height: 15px; margin-left: auto; color: var(--muted); }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .86rem; }
th { padding: 8px 14px; background: #f6f8f4; border-block: 1px solid var(--line); font-weight: 700; color: var(--muted); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
.document-cell { display: flex; align-items: center; gap: 9px; }
.document-cell .icon { color: #486355; width: 17px; height: 17px; }
.document-cell button { color: var(--ink); }
.document-cell small { display: block; white-space: nowrap; font-size: .73rem; }
.money-cell { white-space: nowrap; text-align: right; font-weight: 700; }
.pill { display: inline-flex; gap: 5px; align-items: center; vertical-align: middle; padding: 3px 7px; border-radius: 6px; font-size: .74rem; font-weight: 700; white-space: nowrap; color: #42544a; background: #eef1ed; }
.pill.green { color: #1f6547; background: #e7f2e7; }
.pill.amber { color: #7b4b19; background: #fff1d9; }
.pill.blue { color: #315d79; background: #e9f2f8; }
.pill.red { color: #852d24; background: #ffebe8; }
.demo-pill { background: #f5efe5; color: #795021; border-radius: 20px; padding: 5px 9px; }
.demo-pill::before { content: ''; width: 6px; height: 6px; background: #ac6927; border-radius: 100%; }
.form { display: grid; gap: 14px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; align-content: start; gap: 4px; color: #374b40; font-weight: 700; font-size: .89rem; min-width: 0; }
.field.wide, .wide { grid-column: 1 / -1; }
.field small { font-weight: 400; color: var(--muted); }
input:not([type='checkbox'], [type='radio']), textarea, select { width: 100%; min-width: 0; min-height: 41px; border: 1px solid #dce3da; border-radius: 8px; background: #fdfefc; color: var(--ink); padding: 8px 10px; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%234d6255' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.4' d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-position: right 10px center; background-repeat: no-repeat; }
textarea { resize: vertical; }
input[type='checkbox'] { accent-color: #316b53; }
.field-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.field-group + .field-group { border-top: 1px solid var(--line); padding-top: 12px; }
.field-group h3 { margin-bottom: 8px; }
.estimate-head { display: flex; gap: 4px; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.estimate-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.estimate-total { padding: 12px 0 4px; align-items: center; }
.estimate-total b { font: 800 1.52rem var(--display); letter-spacing: -.05em; }
.price-box { position: sticky; top: 16px; }
.price-box .actions { margin-top: 12px; }
.notice { padding: 11px 13px; border: 1px solid #e2eae1; border-radius: 8px; background: #f1f6ef; color: #355546; font-size: .88rem; }
.notice.warn { background: #fff7e9; border-color: #f4e0ba; color: #674822; }
.notice.error { background: #fdf0ed; border-color: #f2d6d0; color: #812e27; }
.notice + .notice { margin-top: 5px; }
.subscription-notice { margin-bottom: 12px; }
.empty { text-align: center; padding: 30px 15px; color: var(--muted); }
.empty .stat-icon { margin: 0 auto 6px; }
.empty h3 { color: var(--ink); }
.empty p { margin: 5px auto 9px; max-width: 43ch; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 17px; flex-wrap: wrap; }
.toolbar input { width: auto; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { border: 0; border-radius: 6px; background: transparent; font-weight: 700; font-size: .85rem; color: var(--muted); padding: 6px 9px; }
.tabs button[aria-pressed='true'], .tabs button:hover { background: #eaf2ea; color: #264937; }
.dropzone { border: 1px dashed #8fa99a; border-radius: 12px; display: grid; justify-items: center; gap: 5px; text-align: center; padding: 18px 12px; background: #f5faf4; }
.dropzone.drag, .dropzone:hover { background: #edf7ee; }
.dropzone .stat-icon { width: 39px; height: 39px; }
.dropzone p { overflow-wrap: anywhere; }
.preview { min-height: 290px; display: grid; place-items: center; margin: 12px 0; border: 1px solid var(--line); border-radius: 10px; background: #f6f9f6 radial-gradient(#a7b9ab66 1px, transparent 1px) 0 0 / 15px 15px; }
.preview img { display: block; width: 100%; height: 285px; padding: 12px; object-fit: contain; }
.layer-list { display: grid; gap: 2px; margin: 5px 0 8px; max-height: 172px; overflow: auto; }
.layer-list label { display: flex; gap: 7px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 3px; font-size: .87rem; }
.stack { display: grid; gap: 15px; }
.machine-list { display: grid; gap: 8px; }
.machine-row { border: 1px solid var(--line); border-radius: 8px; padding: 9px; display: flex; gap: 8px; align-items: center; }
.machine-row section { flex: 1; min-width: 0; }
.machine-row h3, .machine-row p { overflow-wrap: anywhere; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.plans .panel { padding: 12px; display: grid; gap: 4px; justify-items: start; }
dialog { border: 1px solid var(--line); border-radius: 15px; width: min(540px, calc(100% - 26px)); max-height: calc(100% - 30px); padding: 18px 21px 21px; color: var(--ink); box-shadow: 0 22px 80px #14261d39; }
dialog.doc-dialog { width: min(730px, calc(100% - 26px)); }
dialog::backdrop { background: #14251db0; }
.dialog-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 12px; }
.dialog-head h2 { font-size: 1.25rem; }
.dialog-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.icon-btn { display: inline-grid; place-items: center; min-width: 34px; min-height: 34px; padding: 4px; border: none; border-radius: 7px; background: transparent; color: inherit; }
.icon-btn:hover { background: #eaf1ea; }
.paper { padding: 15px; border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.paper h2 { font-size: 1.35rem; }
.paper h3 { margin-bottom: 3px; }
.paper p { white-space: pre-line; }
.paper .fields { margin: 10px 0; }
.paper-table { margin: 12px 0; }
.paper-table td, .paper-table th { padding: 7px; }
.doc-totals { margin-left: auto; max-width: 280px; }
.production { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.production summary { color: #2f6449; cursor: pointer; font-size: .9rem; font-weight: 800; }
.production form { margin-top: 10px; }
.production input { max-width: 190px; }
.toast { z-index: 10; position: fixed; bottom: 16px; right: 16px; max-width: min(440px, calc(100% - 32px)); display: none; background: #172a24; color: white; padding: 11px 15px; border-radius: 8px; box-shadow: 0 8px 25px #14261d33; }
.toast:not(:empty) { display: block; }
#print-area { display: none; }
@media (max-width: 1120px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .shortcut-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 192px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .topbar, .page { padding-inline: 16px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .price-box { position: static; }
  .page-head { align-items: start; flex-direction: column; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .shell { display: block; }
  .sidebar { display: none; position: fixed; width: min(275px, calc(100vw - 35px)); height: 100dvh; top: 0; left: 0; box-shadow: 0 0 0 100vmax #14261d75; }
  .sidebar.open, .menu-toggle { display: flex !important; }
  .sidebar .menu-toggle { margin: 0 0 10px auto; }
  .sidebar .menu-toggle:hover { color: var(--ink); }
  .sidebar .brand { margin-bottom: 19px; }
  .topbar { min-height: 57px; gap: 5px; }
  .crumb { gap: 5px; }
  .crumb > span, .crumb > .icon { display: none; }
  .top-actions { gap: 5px; }
  .page { padding-top: 17px; }
  .hero { padding: 17px 15px; min-height: 210px; }
  .hero::before { inset: 0 0 0 10%; }
  .hero::after { background: linear-gradient(90deg, #1c3529 5%, #1c3529e8 43%, #1c35298a 100%); }
  .stats { gap: 7px; margin: 10px 0 15px; }
  .stat { padding: 9px 7px; }
  .stat-top { gap: 4px; }
  .stat-icon { width: 25px; height: 25px; }
  .shortcut-list { grid-template-columns: minmax(0, 1fr); }
  .padded { padding: 13px; }
  .fields { gap: 8px; }
}
@media (max-width: 360px) { .fields, .plans { grid-template-columns: minmax(0, 1fr); } .demo-pill { display: none; } }
@media print {
  body { background: white; color: #161916; }
  .shell, dialog, .toast, .skip { display: none !important; }
  #print-area { display: block; }
  #print-area .paper { border: 0; padding: 0; }
  #print-area table { break-inside: avoid; }
  @page { size: A4; margin: 17mm; }
}
