
:root{font-family:Segoe UI,Arial,sans-serif;color:#213b37;background:#f3f6f4;font-size:14px}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer;border:1px solid #ccdad4;border-radius:7px;padding:10px 16px;background:white;color:#264c42}button:hover{background:#e5eee9}button.primary{background:#176b52;color:white;border-color:#176b52}button:disabled{opacity:.5;cursor:wait}input,select,textarea{width:100%;padding:10px;border:1px solid #c8d6cf;border-radius:6px;background:white;color:#213b37}input:focus,select:focus,textarea:focus{outline:2px solid #82bba7;outline-offset:1px}textarea{min-height:90px}label{display:grid;gap:7px;font-weight:600}label.check{display:flex;align-items:center;gap:10px}input[type=checkbox]{width:18px;height:18px}.shell{display:grid;grid-template-columns:248px 1fr;min-height:100vh}aside{background:#163d34;color:#e4f0eb;padding:28px 17px;position:sticky;top:0;height:100vh;overflow:auto}.brand{font-size:28px;font-weight:750;letter-spacing:4px;margin:0 14px 6px}.tagline{font-size:11px;letter-spacing:2px;color:#acc7bc;margin:0 14px 35px}.navgroup{font-size:10px;text-transform:uppercase;letter-spacing:1.5px;color:#9cbdaf;margin:23px 12px 8px}nav button{display:block;text-align:left;width:100%;border:0;background:transparent;color:#d9e9e1;padding:10px 13px;margin:2px 0;font-size:13px}nav button:hover,nav button.active{background:#2d5b4c;color:white}main{min-width:0;padding:26px 40px}.topbar{display:flex;justify-content:space-between;align-items:center;padding-bottom:22px;border-bottom:1px solid #dce5df;margin-bottom:32px}.muted{color:#6c8075}.eyebrow{font-size:11px;text-transform:uppercase;letter-spacing:2px;color:#628477}h1{font-size:32px;font-weight:650;margin:8px 0 12px}h2{font-size:21px}.head{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:24px}.card{background:white;border:1px solid #e0e8e2;border-radius:12px;padding:25px;box-shadow:0 3px 12px #163d3404}.toolbar{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:20px}.toolbar input{max-width:340px}.tablewrap{overflow:auto}table{border-collapse:collapse;width:100%;text-align:left}th{font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:#6a8176;background:#f5f8f5}td,th{padding:15px 13px;border-bottom:1px solid #e6ece7;white-space:nowrap}td{max-width:350px;overflow:hidden;text-overflow:ellipsis}td button{padding:6px 12px}td.code{font-weight:650;color:#176b52}.empty{text-align:center;padding:65px 25px}.empty p{color:#6c8075}.pill{display:inline-block;padding:4px 9px;background:#e8f3ec;color:#296449;border-radius:20px;font-size:12px}.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}.stat{font-size:35px;margin:16px 0}.login{max-width:430px;margin:10vh auto}.login form{display:grid;gap:20px}.login .brand{margin:0;color:#176b52}.formgrid{display:grid;grid-template-columns:1fr 1fr;gap:20px}.actions{display:flex;justify-content:flex-end;gap:12px;margin-top:28px}dialog{border:1px solid #dce5df;border-radius:14px;padding:28px;width:min(730px,94vw);max-height:90vh;box-shadow:0 20px 80px #102c3433}dialog::backdrop{background:#132f285c}dialog h2{margin:0 0 25px}.error{color:#a32e32;font-size:13px;white-space:pre-wrap}.source{font-size:12px;color:#7c8e82;margin-top:20px}#notice{position:fixed;bottom:24px;right:24px;padding:14px 24px;border-radius:8px;background:#163d34;color:white;display:none;z-index:10}.banner{padding:14px 18px;border:1px solid #e4d8b8;background:#fff9e9;color:#78612c;border-radius:8px;margin-bottom:25px;line-height:1.6}.fiberrow{display:grid;grid-template-columns:1fr 100px 35px;gap:8px;margin:8px 0}.fiberrow button{padding:5px}.wide{grid-column:1/-1}@media(max-width:850px){.shell{grid-template-columns:185px 1fr}main{padding:20px}.cards{grid-template-columns:1fr}.head{align-items:flex-start}.formgrid{grid-template-columns:1fr}}@media(max-width:560px){.shell{display:block}aside{position:relative;height:auto;padding:16px}nav{display:flex;overflow:auto;gap:5px}nav button{width:auto;white-space:nowrap}.navgroup,.tagline{display:none}.brand{margin-bottom:15px}main{padding:17px}.topbar{margin-bottom:18px}h1{font-size:25px}}


.reworkrow{font-weight:700}

[hidden]{display:none!important}
.hide-context-help .context-help{display:none!important}.context-help{display:block;margin-top:6px;line-height:1.5}

nav .nav-section { margin-top: 18px; }
nav .nav-section .navgroup {
 position: sticky;
 top: 0;
 z-index: 2;
 display: block;
 margin: 0 0 7px;
 padding: 11px 12px;
 border-left: 4px solid #63c6a2;
 border-radius: 5px;
 background: #dcefe6;
 color: #123b2d;
 font-size: 13px;
 font-weight: 800;
 letter-spacing: 1px;
 line-height: 1.3;
}
nav [data-section="Administración"] .navgroup,
nav [data-section="Contabilidad"] .navgroup,
nav [data-section="Tesorería"] .navgroup { background: #dce9f6; border-color: #71b2e8; color: #153c60; }
nav [data-section="Producción"] .navgroup,
nav [data-section="Planta"] .navgroup { background: #e3efcc; border-color: #9ac558; color: #30450c; }
nav [data-section="Almacenes"] .navgroup,
nav [data-section="Compras"] .navgroup { background: #f7eacb; border-color: #dfb65c; color: #58400c; }
nav [data-section="Comercial"] .navgroup { background: #f4dedb; border-color: #df9289; color: #602b24; }
nav [data-section="Configuración"] .navgroup,
nav [data-section="Sistema"] .navgroup { background: #e7e4f4; border-color: #aba0dc; color: #3c3167; }
.page-help {
 margin: 16px 0 24px;
 padding: 16px 20px;
 background: #eef6f2;
 border: 1px solid #bfd8cb;
 border-left: 4px solid #247457;
 border-radius: 8px;
}
.page-help-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-help h2 { margin: 0; font-size: 17px; line-height: 1.4; }
.help-mode { min-width: 210px; font-size: 12px; }
.help-mode select { padding: 7px 9px; font-size: 13px; }
.page-help-body p { margin: 12px 0; }
.page-help-body summary { cursor: pointer; font-weight: 650; }
.page-help-body li { margin: 9px 0; line-height: 1.6; }
.field-help { color: #496559; font-size: 12px; font-weight: 400; }
.toolbar.list-filters { flex-wrap: wrap; justify-content: flex-start; align-items: end; }
.toolbar.list-filters > label { min-width: 150px; }
dialog.launch-batch { width: min(1180px, 96vw); }
dialog.physical-stock { width: min(1450px, 96vw); }
dialog.physical-stock th { white-space: normal; }
dialog.physical-stock [data-quantity] { width: 115px; }
dialog.physical-stock [data-whole] { display: block; margin-top: 6px; }
dialog.contract-matrix { width: min(1180px, 96vw); }
dialog.formula-cost { width: min(1180px, 96vw); }
dialog.hde-grouping { width: min(1180px, 96vw); }
dialog.hde-quality { width: min(1450px, 96vw); }
dialog.shade-classification { width: min(1450px, 96vw); }
dialog.sample-cost { width: min(1250px, 96vw); }
dialog.sample-cost th { white-space: normal; }
dialog.shade-classification th { white-space: normal; }
dialog.shade-classification [data-results] .tablewrap { max-height: 42vh; }
dialog.hde-quality th { white-space: normal; }
dialog.hde-quality [data-results] .tablewrap { max-height: 48vh; }
.contract-matrix td input { min-width: 95px; }
label.check:has(> .field-help) { display: grid; grid-template-columns: auto 1fr; align-content: start; }
label.check > .field-help { grid-column: 1 / -1; }
.page-help-body .help-purpose{line-height:1.7}
.page-help-body .help-example{padding:10px 14px;background:#fff;border-left:3px solid #699f87;line-height:1.6}
.page-help-body details{margin:12px 0}
.page-help-body dl{display:block;margin:12px 0}
.page-help-body dt{font-weight:650;margin-top:14px}
.page-help-body dd{margin:5px 0 12px;line-height:1.65}
.page-help-body .help-before{padding:12px 15px;background:#fff;border:1px solid #d5e3dc;border-radius:6px;margin-top:12px}
dialog.help-hidden .context-help { display: none !important; }
.hide-context-help dialog.help-visible .context-help { display: block !important; }
.help-settings-table { width: 100%; }
.help-settings-table td { white-space: normal; overflow: visible; }
.help-settings-table .help-mode { min-width: 200px; }
@media (max-width: 850px) {
 .page-help-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
 .help-mode { width: 100%; min-width: 0; }
}
@media (max-width: 560px) {
 nav .nav-section { flex: 0 0 210px; margin-top: 0; }
 nav .nav-section button { display: block; width: 100%; white-space: normal; }
 .page-help { padding: 14px; }
}
 dialog.cost-estimate-dialog{width:min(1150px,94vw)}
[data-template-generation]{width:min(1200px,95vw);max-width:95vw}
[data-template-generation] form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
[data-template-generation] fieldset{grid-column:1/-1;border:1px solid #cadbd3;border-radius:8px;padding:16px}
[data-template-generation] fieldset label{display:block;margin:10px 0}
[data-template-generation] [data-preview],[data-template-generation] form>.error{grid-column:1/-1;justify-self:start}
[data-master-filters]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;align-items:end}[data-master-filters][hidden]{display:none}[data-master-filters]>button{grid-column:1/-1;justify-self:end}[data-master-result] .tablewrap{overflow-x:auto}@media(max-width:1100px){[data-master-filters]{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:700px){[data-master-filters]{grid-template-columns:1fr}}
[data-master-balance] th{white-space:normal;min-width:70px}
[data-master-builder] .tablewrap,[data-master-revision] .tablewrap{overflow-x:auto}[data-master-preview] th{white-space:normal;min-width:70px}[data-master-builder] details{margin:14px 0}[data-master-builder] fieldset{margin:14px 0}

[data-master-release]{width:min(1150px,96vw)}[data-master-release] .card{margin:12px 0}[data-master-release] th{white-space:normal}

[data-master-procurement]{width:min(1150px,96vw)}[data-master-procurement] th{white-space:normal}

[data-master-deliveries]{width:min(1150px,96vw)}[data-master-deliveries] th{white-space:normal}

[data-master-backings]{width:min(1150px,96vw)}[data-master-backings] th{white-space:normal}

[data-raw-return-pieces]{width:min(1050px,96vw)}[data-raw-return-pieces] th{white-space:normal}

.prato-date-control{display:flex;align-items:center;gap:6px;width:100%;position:relative}.prato-date-control>input[data-prato-date]{min-width:0;flex:1}.prato-date-calendar{padding:9px 8px;border:1px solid #b8cfc5;border-radius:6px;color:#235847;cursor:pointer;white-space:nowrap;font-size:12px}.prato-date-calendar:focus-visible{outline:2px solid #176b52;outline-offset:2px}.prato-date-calendar[hidden]{display:none}.prato-native-date-picker{position:absolute!important;opacity:0!important;width:1px!important;height:1px!important;padding:0!important;pointer-events:none!important;left:0;bottom:0}

dialog.color-cost{width:min(1300px,calc(100vw - 40px));max-width:1300px}dialog.color-cost th{white-space:normal;min-width:90px}

dialog.task-exceptions{width:min(1300px,calc(100vw - 40px));max-width:1300px}dialog.task-exceptions [data-review-result]{border-left:4px solid #b46a12;padding:12px;background:#fff8eb}

dialog.task-exceptions [data-work-incentives]{display:none}

.combination-edition-results td{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;vertical-align:top}.combination-edition-results .edition-actions{display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-width:190px}.combination-edition-results th{white-space:normal}dialog.combination-editions-dialog{width:min(1200px,94vw)}

[data-productive-color] fieldset{display:block;border:0;padding:0;min-width:0}[data-productive-color] [data-main-pickers]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}[data-productive-color] .productive-color-picker{padding:10px;border:1px solid #d5e2dc;border-radius:8px;min-width:0}[data-productive-color] [data-aux]{margin:12px 0;padding:12px;border:1px solid #d5e2dc}[data-productive-color] [data-selected-context]{margin:12px 0}[data-productive-color] select{max-width:100%}@media(max-width:850px){[data-productive-color] [data-main-pickers]{grid-template-columns:1fr}}

[data-productive-creation] fieldset{display:block;border:0;padding:0;min-width:0}[data-productive-creation] .creation-header{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}[data-productive-creation] .creation-pickers{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}[data-productive-creation] .creation-color,[data-productive-creation] [data-aux]{margin:16px 0;padding:16px;border:1px solid #d5e2dc;border-radius:8px;min-width:0}[data-productive-creation] .productive-color-picker{padding:10px;border:1px solid #d5e2dc;border-radius:8px;min-width:0}[data-productive-creation] select{max-width:100%}@media(max-width:850px){[data-productive-creation] .creation-header,[data-productive-creation] .creation-pickers{grid-template-columns:1fr}}

/* Persistent instance identity; independent of optional contextual help. */
.demo-instance-banner{position:sticky;top:0;z-index:2000;display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.7rem 1rem;background:#fff0c2;color:#593a00;border-bottom:2px solid #c17b00;box-shadow:0 2px 6px #0001}
.demo-instance-banner strong{display:block;letter-spacing:.04em}.demo-instance-banner span{font-size:.9rem}.demo-instance-banner button{border-color:#9c6900;color:#593a00;background:#fffaf0;white-space:nowrap}
.demo-tour{width:min(920px,94vw);max-height:88vh;overflow:auto;padding:1.5rem}.demo-tour-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem}.demo-tour-heading h2{margin:0}.demo-tour-steps{padding-left:1.7rem}.demo-tour-steps>li{padding:1rem;border-bottom:1px solid #d6e0da}.demo-tour-steps h3{margin:.25rem 0}.demo-tour-actions{display:flex;align-items:center;flex-wrap:wrap;gap:1rem}.demo-tour-actions label{display:flex;align-items:center;gap:.5rem}.demo-tour-actions input{width:auto}.demo-tour-pending{margin-top:1rem}@media(max-width:650px){.demo-instance-banner{align-items:flex-start;flex-direction:column;gap:.4rem}.demo-tour-heading{align-items:flex-start;flex-direction:column}}

/* Incentive copies keep readable headings on desktop and scroll on small screens. */
dialog.incentive-review-dialog{width:min(1500px,96vw);max-width:1500px}
dialog.incentive-review-dialog th{white-space:normal;min-width:95px}

/* Keep receipt quantities readable on desktop; narrow screens retain horizontal table scrolling. */
dialog.stock-movements-dialog{width:min(1100px,94vw)}
