
:root{
  --bg:#f3f1eb;
  --surface:#ffffff;
  --surface-soft:#faf9f6;
  --surface-2:#f0eee7;
  --ink:#20242a;
  --muted:#6d737c;
  --line:#ddd8cd;
  --accent:#315f52;
  --accent-dark:#264b41;
  --accent-soft:#e7efeb;
  --warn:#805b0b;
  --warn-soft:#fff6df;
  --danger:#9c3030;
  --sidebar:#1f302b;
  --sidebar-soft:#293d37;
  --shadow:0 10px 30px rgba(32,36,42,.07);
  --radius:18px;
  --radius-sm:12px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;line-height:1.45}
button,input,select{font:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.5}
.app-shell{min-height:100vh;display:flex}
.sidebar{
  width:250px;background:var(--sidebar);color:#eef5f1;position:fixed;inset:0 auto 0 0;
  display:flex;flex-direction:column;padding:18px 14px;z-index:50;
}
.brand{display:flex;align-items:center;gap:12px;padding:4px 6px 22px}
.brand-mark{width:42px;height:42px;border-radius:13px;background:#dbe9e2;color:var(--accent-dark);display:grid;place-items:center;font-weight:900}
.brand strong,.brand span{display:block}
.brand span{font-size:.78rem;color:#9fb4ab;margin-top:2px}
.nav{display:flex;flex-direction:column;gap:4px}
.nav-item{
  display:flex;align-items:center;gap:11px;width:100%;border:0;background:transparent;color:#c7d5cf;
  padding:10px 11px;border-radius:11px;text-align:left;font-weight:700;
}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}
.nav-item.active{background:#dfeae5;color:#254b40}
.nav-icon{width:22px;text-align:center;font-weight:900}
.nav-label{font-size:.68rem;text-transform:uppercase;letter-spacing:.11em;color:#789087;padding:16px 11px 6px;font-weight:850}
.sidebar-footer{margin-top:auto;border-top:1px solid rgba(255,255,255,.1);padding:16px 7px 4px;display:flex;align-items:center;gap:9px}
.sidebar-footer strong,.sidebar-footer span{display:block}
.sidebar-footer strong{font-size:.82rem}
.sidebar-footer span{font-size:.7rem;color:#90a69d}
.status-dot{width:9px;height:9px;border-radius:99px;background:#91c5ad;box-shadow:0 0 0 4px rgba(145,197,173,.12)}
.main{width:calc(100% - 250px);margin-left:250px;min-width:0}
.topbar{min-height:82px;background:rgba(243,241,235,.92);backdrop-filter:blur(10px);position:sticky;top:0;z-index:30;border-bottom:1px solid var(--line);display:flex;align-items:center;padding:14px 26px;gap:14px}
.topbar h1{font-size:1.25rem;margin:0}
.topbar p{font-size:.78rem;color:var(--muted);margin:2px 0 0}
.topbar-badge{margin-left:auto;border:1px solid var(--line);background:var(--surface);padding:7px 10px;border-radius:999px;color:var(--muted);font-size:.72rem;font-weight:750}
.menu-btn{display:none;border:0;background:var(--surface);border:1px solid var(--line);border-radius:10px;width:40px;height:40px}
.content{padding:26px;max-width:1500px;margin:0 auto}
.view{display:none}
.view.active{display:block}
.hero{
  border-radius:24px;background:linear-gradient(135deg,#2a5247,#3b6a5d);color:white;padding:30px;
  display:flex;justify-content:space-between;gap:24px;align-items:center;box-shadow:var(--shadow)
}
.hero h2{font-size:clamp(1.8rem,3vw,2.5rem);margin:4px 0 10px}
.hero p{max-width:720px;color:#d8e5df;margin:0}
.eyebrow{font-size:.68rem;letter-spacing:.11em;text-transform:uppercase;font-weight:900;color:#6b877c}
.hero .eyebrow{color:#b9d1c6}
.primary,.secondary,.ghost{
  border:0;border-radius:11px;padding:10px 14px;font-weight:850;
}
.primary{background:var(--accent);color:white}
.primary:hover{background:var(--accent-dark)}
.hero .primary{background:white;color:var(--accent-dark)}
.secondary{background:#ece9e1;color:var(--ink)}
.ghost{background:transparent;border:1px solid var(--line)}
.large{padding:12px 17px;white-space:nowrap}
.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-top:18px}
.stat-card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:16px;box-shadow:var(--shadow)}
.stat-card span,.stat-card small{display:block;color:var(--muted)}
.stat-card span{font-weight:750;font-size:.82rem}
.stat-card strong{display:block;font-size:1.75rem;margin:7px 0 3px}
.stat-card small{font-size:.72rem}
.section-heading{display:flex;justify-content:space-between;align-items:end;margin:27px 0 12px}
.section-heading h3,.section-heading p{margin:0}
.section-heading p{color:var(--muted);font-size:.8rem;margin-top:3px}
.quick-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.quick-card{
  border:1px solid var(--line);background:var(--surface);border-radius:15px;padding:14px;
  display:flex;align-items:center;gap:10px;text-align:left;box-shadow:var(--shadow)
}
.quick-card:hover{transform:translateY(-1px)}
.quick-card strong,.quick-card small{display:block}
.quick-card small{font-size:.72rem;color:var(--muted);margin-top:2px}
.quick-icon{width:36px;height:36px;border-radius:11px;background:var(--surface-2);display:grid;place-items:center;font-weight:900}
.pill{font-size:.67rem;font-weight:850;padding:4px 7px;border-radius:999px;background:var(--accent-soft);color:var(--accent);white-space:nowrap}
.pill.muted{background:var(--surface-2);color:var(--muted)}
.quick-card .pill{margin-left:auto}
.roadmap-card{margin-top:18px;background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:20px;display:flex;justify-content:space-between;gap:20px;align-items:center}
.roadmap-card h3,.roadmap-card p{margin:3px 0}
.roadmap-card p{color:var(--muted);font-size:.84rem;max-width:700px}
.roadmap-steps{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.roadmap-steps span{padding:6px 9px;border:1px solid var(--line);border-radius:999px;font-size:.7rem;font-weight:800;color:var(--muted)}
.roadmap-steps .done{background:var(--accent-soft);border-color:#c7d9d0;color:var(--accent)}
.module-head{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:18px}
.module-head h2{font-size:1.8rem;margin:3px 0}
.module-head p{margin:0;color:var(--muted)}
.coming{background:var(--surface);border:1px solid var(--line);border-radius:20px;min-height:360px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:30px}
.coming-icon{width:62px;height:62px;border-radius:20px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-size:1.6rem;font-weight:900}
.coming h3{margin:15px 0 6px}
.coming p{max-width:620px;color:var(--muted);margin:0}
.subnav{display:flex;gap:8px;margin-bottom:14px}
.subnav-item{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:8px 12px;font-weight:800;color:var(--muted)}
.subnav-item.active{background:var(--accent);border-color:var(--accent);color:white}
.calculator-layout{display:grid;grid-template-columns:minmax(330px,420px) 1fr;gap:18px;align-items:start}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);padding:18px}
.calc-inputs{position:sticky;top:104px}
.panel-title{display:flex;justify-content:space-between;align-items:start;gap:12px;margin-bottom:16px}
.panel-title h3{margin:3px 0 0}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.field{margin-bottom:13px}
.field label{display:block;font-size:.8rem;font-weight:800;margin-bottom:6px}
.field input,.field select{
  width:100%;border:1px solid #cdc7bb;border-radius:10px;padding:10px;background:white;color:var(--ink);outline:none
}
.field input:focus,.field select:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(49,95,82,.1)}
.field>span{display:block;color:var(--muted);font-size:.7rem;margin-top:4px}
.check-row{display:flex;gap:9px;align-items:flex-start;border:1px solid var(--line);background:var(--surface-soft);border-radius:11px;padding:10px;margin-bottom:12px}
.check-row input{margin-top:3px}
.check-row strong,.check-row small{display:block}
.check-row strong{font-size:.82rem}
.check-row small{font-size:.7rem;color:var(--muted);margin-top:2px}
.divider{height:1px;background:var(--line);margin:16px 0}
.calc-inputs h4{font-size:.88rem;margin:0 0 12px}
.tech-details{border-top:1px solid var(--line);margin-top:14px;padding-top:13px}
.tech-details summary{cursor:pointer;color:var(--accent);font-weight:850;font-size:.82rem}
.top-gap{margin-top:12px}
.form-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}
.form-error{display:none;color:var(--danger);font-weight:800;font-size:.8rem;margin-top:9px}
.empty-state{min-height:520px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
.empty-icon{width:64px;height:64px;border-radius:20px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-size:1.5rem;font-weight:900}
.empty-state h3{margin:14px 0 5px}
.empty-state p{max-width:460px;color:var(--muted);margin:0}
.result-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-bottom:12px}
.result-summary.four{grid-template-columns:repeat(4,1fr)}
.metric{border:1px solid var(--line);border-radius:12px;padding:11px;background:var(--surface-soft)}
.metric.kpi{background:var(--accent-soft);border-color:#cbd9d2}
.metric small,.metric span{display:block}
.metric small{color:var(--muted);font-size:.69rem;font-weight:780}
.metric strong{display:block;font-size:1.08rem;margin-top:3px}
.metric span{color:var(--muted);font-size:.66rem;margin-top:2px}
.result-note{font-size:.74rem;color:var(--muted);margin:10px 0 16px}
.result-section-title{font-size:.9rem;margin:18px 0 8px}
.table-wrap{overflow:auto}
.result-table{width:100%;border-collapse:collapse;font-size:.78rem}
.result-table th,.result-table td{padding:8px 7px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.result-table th{font-size:.66rem;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.result-table .num{text-align:right}
.piece-title{font-weight:800}
.small-note{display:block;color:var(--muted);font-size:.66rem;margin-top:2px}
.cut-sheet{margin-top:14px;border:1px solid var(--line);border-radius:14px;padding:12px;background:var(--surface-soft)}
.cut-sheet-head{display:flex;justify-content:space-between;gap:10px;align-items:baseline;margin-bottom:8px}
.cut-sheet-head strong{font-size:.82rem}
.cut-sheet-head span{font-size:.67rem;color:var(--muted)}
.cut-sheet svg{display:block;width:100%;height:auto;background:white;border:1px solid #bab5aa}
.cut-sequence{margin:8px 0 0;padding-left:19px;font-size:.72rem}
.cut-sequence li{margin:4px 0}
.result-warning{border:1px solid #ead7a5;background:var(--warn-soft);color:#664600;border-radius:11px;padding:10px;font-size:.72rem;margin-top:12px}
.result-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.sidebar-overlay{display:none}
@media(max-width:1100px){
  .stat-grid,.quick-grid{grid-template-columns:repeat(2,1fr)}
  .calculator-layout{grid-template-columns:1fr}
  .calc-inputs{position:static}
}
@media(max-width:820px){
  .sidebar{transform:translateX(-105%);transition:.2s ease}
  .sidebar.open{transform:translateX(0)}
  .sidebar-overlay{position:fixed;inset:0;background:rgba(10,20,16,.35);z-index:40}
  .sidebar-overlay.show{display:block}
  .main{width:100%;margin-left:0}
  .menu-btn{display:block}
  .topbar{padding:12px 16px}
  .topbar-badge{display:none}
  .content{padding:18px 14px}
  .hero{align-items:flex-start;flex-direction:column}
  .roadmap-card{align-items:flex-start;flex-direction:column}
  .roadmap-steps{justify-content:flex-start}
}
@media(max-width:560px){
  .stat-grid,.quick-grid,.form-row,.result-summary,.result-summary.four{grid-template-columns:1fr}
  .module-head{align-items:flex-start;flex-direction:column}
}
@media print{
  .sidebar,.topbar,.calc-inputs,.subnav,.module-head,.result-actions{display:none!important}
  .main{margin:0;width:100%}.content{padding:0}.view{display:none!important}
  #view-despieces{display:block!important}.calculator-layout{display:block}.panel{box-shadow:none;border:0;padding:0}
  .cut-sheet{break-inside:avoid}
}
