
.fh-pcp{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#222;max-width:1200px;margin:20px auto}
.fh-head{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:28px;border-radius:16px;background:#222;color:#fff;margin-bottom:18px}
.fh-head h2{margin:4px 0 6px;font-size:30px}.fh-head p{margin:0;opacity:.8}.fh-kicker{font-size:12px;letter-spacing:2px;opacity:.75}
.fh-card{background:#fff;border:1px solid #ddd;border-radius:14px;padding:20px;margin:18px 0;box-shadow:0 3px 15px rgba(0,0,0,.05)}
.fh-card h3{margin:0 0 16px}.fh-grid{display:grid;gap:14px}.fh-grid-4{grid-template-columns:repeat(4,1fr)}
.fh-grid label,.fh-table label{font-size:13px;font-weight:600}.fh-grid input{display:block;width:100%;box-sizing:border-box;margin-top:6px;padding:10px;border:1px solid #ccc;border-radius:8px}
.fh-options{display:flex;gap:22px;margin-top:15px;font-size:14px}.fh-section-title{display:flex;justify-content:space-between;align-items:center;gap:15px}
.fh-table-wrap{overflow:auto}.fh-table{width:100%;border-collapse:collapse;min-width:850px}.fh-table th,.fh-table td{border-bottom:1px solid #eee;padding:9px;text-align:left;font-size:13px}.fh-table th{background:#f6f6f6}
.fh-table input,.fh-table select{width:100%;box-sizing:border-box;padding:8px;border:1px solid #ccc;border-radius:7px}
.fh-btn{border:0;border-radius:9px;padding:10px 15px;background:#333;color:#fff;cursor:pointer;font-weight:700}.fh-btn:hover{opacity:.9}.fh-btn-primary{background:#198754;padding:13px 20px}.fh-btn-light{background:#f1f1f1;color:#222}
.fh-actions{display:flex;gap:10px;justify-content:flex-end;margin:18px 0}.fh-help{font-size:12px;color:#666;margin-top:10px}
.fh-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.fh-stat{background:#f7f7f7;border:1px solid #ddd;border-radius:12px;padding:15px}.fh-stat b{display:block;font-size:22px;margin-top:4px}
.fh-sheet-card{background:#fff;border:1px solid #ddd;border-radius:14px;padding:18px;margin:18px 0}.fh-sheet-title{display:flex;justify-content:space-between;align-items:center}.fh-sheet-title h3{margin:0}
.fh-canvas-wrap{overflow:auto;border:1px solid #ddd;background:#fafafa;padding:12px;border-radius:10px}.fh-canvas{position:relative;background:#fff;border:2px solid #222;margin:auto}
.fh-piece{position:absolute;box-sizing:border-box;border:1px solid #333;background:#e9f5ec;display:flex;align-items:center;justify-content:center;text-align:center;overflow:hidden;font-size:11px;padding:2px}
.fh-piece small{display:block;font-size:9px}.fh-error{padding:12px;border-radius:10px;background:#fff3cd;border:1px solid #ffe69c;margin-top:12px}
@media(max-width:800px){.fh-grid-4,.fh-stats{grid-template-columns:1fr 1fr}.fh-head{align-items:flex-start;flex-direction:column}}
@media(max-width:520px){.fh-grid-4,.fh-stats{grid-template-columns:1fr}.fh-head h2{font-size:24px}}
@media print{.fh-head .fh-btn,.fh-actions,.fh-card:first-of-type,.fh-card:nth-of-type(2),#fh-csv{display:none!important}.fh-pcp{max-width:none}.fh-sheet-card{break-inside:avoid}}

.fh-dnd-help{padding:10px 12px;background:#f0f7ff;border:1px solid #cfe3ff;border-radius:9px;margin:12px 0;font-size:13px}.fh-piece{cursor:grab}.fh-piece:active{cursor:grabbing}.fh-options select{margin-left:6px;padding:7px;border:1px solid #ccc;border-radius:7px}
.fh-fill-tools{display:flex;flex-wrap:wrap;align-items:end;gap:10px;margin-top:14px;padding:12px;background:#f7f7f7;border:1px solid #ddd;border-radius:10px}.fh-fill-tools label{font-size:12px;font-weight:700;display:flex;flex-direction:column;gap:5px}.fh-fill-tools select{min-width:240px;padding:9px;border:1px solid #ccc;border-radius:8px;background:#fff}
.fh-standard-sheet{display:flex;align-items:center;gap:8px;padding:12px 14px;margin:10px 0 14px;background:#f7f7f7;border:1px solid #ddd;border-radius:9px;font-size:14px}
.fh-standard-sheet strong{font-weight:700}

.p-color{min-width:130px}
.fh-piece-colored{border-color:rgba(0,0,0,.25)!important}
.fh-piece small{display:block;font-size:10px;line-height:1.2;margin-top:2px}

.fh-grain-picker{display:flex;gap:4px;align-items:stretch;min-width:150px}
.fh-grain-btn{appearance:none;border:1px solid #cfcfcf;background:#fff;border-radius:7px;padding:3px 5px;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:45px;transition:.15s}
.fh-grain-btn:hover{border-color:#888}
.fh-grain-btn.active{border-color:#198754;box-shadow:0 0 0 2px rgba(25,135,84,.14);background:#f3fbf6}
.fh-grain-btn b{font-size:9px;font-weight:700;white-space:nowrap}
.fh-grain-preview{position:relative;width:34px;height:28px;border:1px solid rgba(0,0,0,.2);border-radius:4px;overflow:hidden;background:#d8b27a}
.fh-grain-preview:before,.fh-grain-preview:after{content:"";position:absolute;inset:-12px;opacity:.48;background:repeating-linear-gradient(92deg,transparent 0 5px,rgba(92,54,24,.55) 6px 7px,transparent 8px 12px)}
.fh-grain-v:before{transform:rotate(90deg)}
.fh-grain-h:before{transform:none}
.fh-grain-free{background:linear-gradient(135deg,#eee,#fff)}
.fh-grain-free:before,.fh-grain-free:after{display:none}
.fh-piece{background-image:repeating-linear-gradient(92deg,rgba(120,80,30,.08) 0 1px,transparent 1px 9px)}
.fh-piece[style*="background:#ffffff"],.fh-piece[style*="background: #ffffff"]{background-image:none}

.fh-edge-picker{display:flex;justify-content:center}.fh-edge-diagram{position:relative;width:78px;height:58px;border:1px solid #bbb;background:#f7f7f7;border-radius:5px}.fh-edge{position:absolute;border:0;background:#ddd;color:#555;font-size:9px;font-weight:700;padding:2px;cursor:pointer;z-index:2}.fh-edge:hover{background:#bbb}.fh-edge.active{background:#198754;color:#fff}.fh-edge.e-top{left:24px;top:0;width:30px;height:15px}.fh-edge.e-bottom{left:24px;bottom:0;width:30px;height:15px}.fh-edge.e-left{left:0;top:15px;width:16px;height:28px}.fh-edge.e-right{right:0;top:15px;width:16px;height:28px}.fh-edge-center{position:absolute;left:19px;top:18px;width:40px;height:20px;display:flex;align-items:center;justify-content:center;font-size:8px;color:#777}.fh-edge-line{position:absolute;display:none;background:#198754;z-index:4}.fh-edge-line.on{display:block}.fh-edge-line.top,.fh-edge-line.bottom{left:0;right:0;height:3px}.fh-edge-line.top{top:0}.fh-edge-line.bottom{bottom:0}.fh-edge-line.left,.fh-edge-line.right{top:0;bottom:0;width:3px}.fh-edge-line.left{left:0}.fh-edge-line.right{right:0}.fh-grain-lines{position:absolute;inset:4px;opacity:.28;pointer-events:none}.fh-grain-lines.vertical{background:repeating-linear-gradient(90deg,rgba(80,45,15,.75) 0 1px,transparent 1px 8px)}.fh-grain-lines.horizontal{background:repeating-linear-gradient(0deg,rgba(80,45,15,.75) 0 1px,transparent 1px 8px)}.fh-grain-lines.free{display:none}.fh-cut-sketch{position:relative;display:inline-block;width:54px;height:34px;border:1px solid #aaa;border-radius:4px;background:#fff;vertical-align:middle;margin-right:7px;overflow:hidden}.fh-cut-sketch .top,.fh-cut-sketch .bottom{position:absolute;left:0;right:0;height:3px;background:#198754;display:none}.fh-cut-sketch .top{top:0}.fh-cut-sketch .bottom{bottom:0}.fh-cut-sketch .left,.fh-cut-sketch .right{position:absolute;top:0;bottom:0;width:3px;background:#198754;display:none}.fh-cut-sketch .left{left:0}.fh-cut-sketch .right{right:0}.fh-cut-sketch .on{display:block}.fh-cut-sketch .grain{position:absolute;inset:4px;opacity:.3}.fh-cut-sketch .grain.v{background:repeating-linear-gradient(90deg,#6b4f2a 0 1px,transparent 1px 7px)}.fh-cut-sketch .grain.h{background:repeating-linear-gradient(0deg,#6b4f2a 0 1px,transparent 1px 7px)}.fh-edge-label{font-size:11px;color:#555}.fh-piece-colored .fh-grain-lines{opacity:.35}

.fh-piece-row-active{outline:2px solid #198754!important;outline-offset:-2px;background:#f3fbf6!important}

.fh-piece-colored{background-image:repeating-linear-gradient(92deg,rgba(90,55,20,.10) 0 1px,transparent 1px 10px)!important;border:1px solid rgba(0,0,0,.28)!important;overflow:hidden}
.fh-piece-colored span{display:flex;flex-direction:column;gap:2px;padding:2px;line-height:1.05}
.fh-piece-colored strong{font-size:11px}
.fh-piece-colored small{font-size:9px}
.fh-sheet-legend{display:flex;flex-wrap:wrap;gap:7px;margin-top:8px;padding:8px;background:#f7f7f7;border:1px solid #ddd;border-radius:7px}
.fh-legend-item{display:inline-flex;align-items:center;gap:4px;font-size:11px}
.fh-legend-item i,.fh-cut-color{display:inline-block;width:13px;height:13px;border:1px solid rgba(0,0,0,.25);border-radius:3px;vertical-align:middle;margin-right:5px}

/* Plano visual: cores suaves por tipo de peça, no estilo de mapas de corte profissionais */
.fh-piece-colored{border:1px solid rgba(40,40,40,.38)!important;box-shadow:inset 0 0 0 1px rgba(255,255,255,.18)}
.fh-piece-colored strong{font-size:12px;font-weight:700}
.fh-piece-colored small{font-size:9px}
.fh-sheet-legend{font-size:11px}

/* ===== FIX HOME BR 2.0 — WORKBENCH ===== */
#fh-pcp.fh-theme-workbench{--fh-ink:#17212b;--fh-bg:#f4f7f8;max-width:1500px!important;margin:24px auto!important;background:var(--fh-bg)!important;border:1px solid #dce2e6;border-radius:18px;overflow:hidden;box-shadow:0 12px 40px rgba(25,40,55,.10);display:grid!important;grid-template-columns:270px minmax(0,1fr);gap:0!important;padding:0!important;color:var(--fh-ink)}
#fh-pcp.fh-theme-workbench .fh-sidebar{background:#18232d;color:#eef4f7;padding:24px 18px;display:flex;flex-direction:column;min-height:100%}
#fh-pcp.fh-theme-workbench .fh-brand{padding:2px 8px 22px;border-bottom:1px solid rgba(255,255,255,.12)}
#fh-pcp.fh-theme-workbench .fh-brand h2{font-size:22px;line-height:1.12;margin:7px 0;color:#fff}
#fh-pcp.fh-theme-workbench .fh-brand h2 em{font-style:normal;color:#69c28d}
#fh-pcp.fh-theme-workbench .fh-brand p{font-size:12px;line-height:1.5;color:#aebbc4;margin:0}
#fh-pcp.fh-theme-workbench .fh-kicker{font-size:10px;font-weight:800;letter-spacing:.14em;color:#69c28d;text-transform:uppercase}
#fh-pcp.fh-theme-workbench .fh-side-section{padding:20px 8px;border-bottom:1px solid rgba(255,255,255,.10)}
#fh-pcp.fh-theme-workbench .fh-side-label{font-size:10px;font-weight:800;letter-spacing:.12em;color:#94a5b0;margin-bottom:10px}
#fh-pcp.fh-theme-workbench .fh-sheet-badge{display:flex;flex-direction:column;background:#22313c;border:1px solid #31434f;border-radius:10px;padding:10px;margin-bottom:12px}
#fh-pcp.fh-theme-workbench .fh-sheet-badge strong{font-size:15px;color:#fff}
#fh-pcp.fh-theme-workbench .fh-sheet-badge span{font-size:10px;color:#9eafb9;margin-top:2px}
#fh-pcp.fh-theme-workbench .fh-sidebar label{font-size:11px;color:#c6d1d8;display:block}
#fh-pcp.fh-theme-workbench .fh-sidebar input[type=number],#fh-pcp.fh-theme-workbench .fh-sidebar select{width:100%;box-sizing:border-box;background:#24333e;border:1px solid #3a4c58;color:#fff;border-radius:7px;padding:8px;margin-top:5px}
#fh-pcp.fh-theme-workbench .fh-grid-2{display:grid!important;grid-template-columns:1fr 1fr;gap:8px}
#fh-pcp.fh-theme-workbench .fh-check{display:flex!important;gap:7px;align-items:center;margin:10px 0;color:#dce5ea!important}
#fh-pcp.fh-theme-workbench .fh-check input{accent-color:#69c28d}
#fh-pcp.fh-theme-workbench .fh-side-actions{display:flex;flex-direction:column;gap:8px;padding:20px 8px}
#fh-pcp.fh-theme-workbench .fh-btn-wide{width:100%;justify-content:center}
#fh-pcp.fh-theme-workbench .fh-btn-primary{background:#198754;border-color:#198754;color:#fff}
#fh-pcp.fh-theme-workbench .fh-btn-accent{background:#2d8dbb;border-color:#2d8dbb;color:#fff}
#fh-pcp.fh-theme-workbench .fh-btn-dark{background:#18232d;color:#fff;border-color:#18232d}
#fh-pcp.fh-theme-workbench .fh-btn-ghost{background:transparent!important;color:#c8d3da;border-color:#40515d}
#fh-pcp.fh-theme-workbench .fh-side-tip{margin:auto 8px 0;padding:11px;background:#202f39;border:1px solid #31434f;border-radius:10px;color:#9eafb9;font-size:10px;line-height:1.4;display:flex;gap:8px}
#fh-pcp.fh-theme-workbench .fh-side-tip strong{color:#dce7ec}
#fh-pcp.fh-theme-workbench .fh-workspace{min-width:0;padding:26px 28px 34px;background:#f7f9fa}
#fh-pcp.fh-theme-workbench .fh-topbar,.fh-results-head{display:flex;align-items:center;justify-content:space-between;gap:18px}
#fh-pcp.fh-theme-workbench .fh-topbar{margin-bottom:18px}
#fh-pcp.fh-theme-workbench .fh-topbar h1,#fh-pcp.fh-theme-workbench .fh-results-head h2{font-size:24px;line-height:1.1;margin:5px 0 0;color:#18232d}
#fh-pcp.fh-theme-workbench .fh-card{background:#fff;border:1px solid #e0e5e8;border-radius:13px;box-shadow:0 4px 15px rgba(30,45,60,.045)}
#fh-pcp.fh-theme-workbench .fh-pieces-card{padding:18px;margin-bottom:22px}
#fh-pcp.fh-theme-workbench .fh-section-title h3{margin:0 0 4px;font-size:16px}
#fh-pcp.fh-theme-workbench .fh-muted{margin:0;color:#77838d;font-size:11px}
#fh-pcp.fh-theme-workbench .fh-table{min-width:980px}
#fh-pcp.fh-theme-workbench .fh-table thead th{background:#f3f6f8;color:#64727d;font-size:10px;text-transform:uppercase;letter-spacing:.04em}
#fh-pcp.fh-theme-workbench .fh-fill-tools{background:#f4f7f8;border:1px dashed #d5dde2;border-radius:9px;padding:10px;margin-top:12px}
#fh-pcp.fh-theme-workbench .fh-results{padding-top:2px}
#fh-pcp.fh-theme-workbench .fh-results-head{margin:4px 0 14px}
#fh-pcp.fh-theme-workbench .fh-results-head .fh-dnd-help{background:#eaf4ef;border:1px solid #d3e8dc;color:#43725a;border-radius:8px;padding:8px 10px;font-size:10px}
#fh-pcp.fh-theme-workbench .fh-cut-card{padding:18px;margin-top:22px}
@media(max-width:900px){#fh-pcp.fh-theme-workbench{grid-template-columns:1fr!important;margin:12px 0!important;border-radius:10px}#fh-pcp.fh-theme-workbench .fh-sidebar{min-height:auto}#fh-pcp.fh-theme-workbench .fh-workspace{padding:18px 12px 28px}#fh-pcp.fh-theme-workbench .fh-topbar,#fh-pcp.fh-theme-workbench .fh-results-head{align-items:flex-start;flex-direction:column}}

.fh-material-cell{display:inline-flex;align-items:center;gap:6px;font-weight:600}
.fh-material-cell i{display:inline-block;width:18px;height:18px;border:1px solid rgba(0,0,0,.28);border-radius:4px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.35)}

#fh-download-pdf{font-weight:700}
@media print{
 .fh-pdf-hide,#fh-download-pdf,#fh-download-csv,.fh-actions{display:none!important}
 .fh-sheet-card{break-inside:avoid;page-break-inside:avoid}
}

#fh-download-list-pdf{display:inline-flex;align-items:center;justify-content:center;margin:0 0 12px;padding:11px 18px;font-weight:700;border-radius:8px}
@media print{#fh-download-list-pdf{display:none!important}}
