:root {
  --navy:#142453; --navy-2:#0d1a3c; --blue:#28418c; --accent:#e9b858;
  --text:#1a2843; --muted:#738096; --bg:#f3f6fb; --surface:#fff;
  --border:#e2e8f2; --shadow:0 6px 26px rgba(25,49,97,.06);
  --green:#167e5c; --red:#b7434b;
  font-family:Inter,"Segoe UI",Roboto,Arial,sans-serif;
}
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:var(--bg);color:var(--text);font-size:14px;line-height:1.48}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
button:disabled{opacity:.65;cursor:wait}
:focus-visible{outline:3px solid rgba(80,109,214,.4);outline-offset:2px}
h1,h2,h3,p{margin:0}
h1{font-size:29px;letter-spacing:-.04em;line-height:1.22}
h2{font-size:21px;letter-spacing:-.025em;line-height:1.25}
h3{font-size:16px;letter-spacing:-.016em}
.muted{color:var(--muted)} .small{font-size:12px}
.eyebrow{font-size:10px;font-weight:800;letter-spacing:.14em;color:#5d76ac}
.auth-screen{display:grid;min-height:100vh;place-items:center;padding:24px;background:radial-gradient(circle at 20% 0%,#334f8f 0%,#182b61 34%,#101c40 100%)}
.auth-card{width:min(100%,450px);padding:38px 36px;background:#fff;border-radius:20px;box-shadow:0 20px 65px rgba(0,0,0,.22)}
.auth-card .brand-logo{width:54px;height:54px;font-size:19px;margin-bottom:22px}
.auth-card h1{margin:6px 0 12px}.auth-card form{display:flex;flex-direction:column;gap:10px;margin:27px 0 20px}.auth-card .small{margin-top:14px}
.brand-logo{display:grid;place-items:center;flex:0 0 auto;width:46px;height:46px;border:1px solid rgba(255,255,255,.16);border-radius:13px;background:linear-gradient(140deg,#d8aa51,#f0cf84);color:#233451;font-weight:900;letter-spacing:-.04em;box-shadow:0 4px 14px rgba(0,0,0,.09)}
label{display:block;font-size:12px;font-weight:750;color:#485777}
input,select,textarea{width:100%;min-height:44px;padding:10px 13px;border:1px solid #d8e0ec;border-radius:10px;background:#fff;color:#263650;transition:border .16s,box-shadow .16s}
input::placeholder,textarea::placeholder{color:#a1abbd}
input:focus,select:focus,textarea:focus{border-color:#788bc6;outline:0;box-shadow:0 0 0 3px rgba(41,77,156,.12)}
input[readonly]{background:#f5f7fc}
textarea{min-height:92px;resize:vertical}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;white-space:nowrap;min-height:42px;border-radius:10px;padding:9px 17px;border:1px solid transparent;font-size:13px;font-weight:750;line-height:1.1;text-decoration:none;transition:background .15s,border .15s,transform .15s}
.btn:hover:not(:disabled){transform:translateY(-1px)}
.btn.primary{color:#fff;background:var(--navy);border-color:var(--navy);box-shadow:0 3px 12px rgba(20,36,83,.15)}
.btn.primary:hover:not(:disabled){background:#20356e}
.btn.outline{background:#fff;border-color:#d7e0ed;color:#334468}
.btn.outline:hover:not(:disabled){background:#f5f7fb;border-color:#a8b8d2}
.btn.logout{min-height:31px;padding:6px 13px;font-size:11px;background:transparent;color:#d9e4ff;border:1px solid #536385}
.btn.full{width:100%}
.app-shell{display:flex;min-height:100vh}
.sidebar{display:flex;flex-direction:column;gap:0;flex:0 0 256px;width:256px;min-height:100vh;background:var(--navy-2);color:#fff;padding:29px 16px 21px;position:sticky;top:0;height:100vh;overflow-y:auto}
.sidebar-brand{display:flex;align-items:center;gap:12px;padding:2px 10px 20px;border-bottom:1px solid #26365a;margin-bottom:24px}
.sidebar-brand strong{display:block;font-size:13px;letter-spacing:.055em}
.sidebar-brand small{display:block;margin-top:2px;color:#a3b3d7;font-size:11px}
.nav-title{margin:16px 12px 8px;color:#7185ae;font-size:10px;font-weight:850;letter-spacing:.12em}
#navigation{display:flex;flex-direction:column}
.nav-item{display:flex;align-items:center;gap:12px;width:100%;min-height:41px;padding:10px 12px;border:0;border-radius:9px;color:#b9c6e1;background:transparent;text-align:left;font-size:12px;font-weight:680;transition:background .15s,color .15s}
.nav-item>span{width:21px;font-size:17px;text-align:center;color:#92a5d0}
.nav-item:hover{background:#1d2d57;color:#fff}
.nav-item.active{background:#2a3d72;color:#fff;box-shadow:inset 3px 0 #f0c66e}
.nav-item.active>span{color:#f0c66e}
.sidebar-foot{display:flex;align-items:center;gap:9px;flex-wrap:wrap;color:#aebce0;font-size:11px;padding:19px 10px 4px;margin-top:auto;border-top:1px solid #26365a}
.sidebar-foot .logout{margin-left:auto}
.online-dot{width:7px;height:7px;border-radius:50%;background:#55d9a7}
.workspace{min-width:0;flex:1;display:flex;flex-direction:column}
.topbar{min-height:134px;display:flex;justify-content:space-between;align-items:center;gap:24px;padding:25px 39px;background:#fff;border-bottom:1px solid var(--border)}
.topbar-breadcrumb{display:block;font-size:12px;margin-bottom:9px;color:#8490a7}
.topbar h1{margin-bottom:6px}
.topbar p{font-size:12px}
.top-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.environment{font-size:9px;color:#6a7a94;background:#f0f3fa;border:1px solid #e1e7f2;border-radius:7px;padding:8px 10px;font-weight:850;letter-spacing:.09em}
.main-content{width:100%;max-width:1700px;padding:30px 39px 70px;flex:1;margin:0 auto}
.section-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin:0 0 19px}
.section-heading h2{margin-top:6px}
.section-heading p.muted{font-size:12px;margin-top:7px}
.period-controls{display:flex;align-items:center;gap:10px}
.period-controls input{width:162px;min-height:39px;font-size:12px}
.kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;margin-bottom:20px}
.kpi{position:relative;min-width:0;padding:23px 20px 20px;background:#fff;border:1px solid var(--border);border-radius:15px;box-shadow:var(--shadow)}
.kpi-caption{display:flex;align-items:center;justify-content:space-between;gap:7px;color:#75839b;font-size:10px;font-weight:850;letter-spacing:.065em}
.kpi-caption>span{display:grid;place-items:center;flex:0 0 auto;width:27px;height:27px;background:#f1f5fc;border-radius:8px;color:#4b6daa;font-size:15px}
.kpi strong{display:block;margin:12px 0 5px;font-size:28px;line-height:1.1;letter-spacing:-.055em;color:#192b50;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kpi small{color:#8a95a8;font-size:11px}
.dashboard-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(330px,.85fr);gap:18px}
.surface{min-width:0;padding:22px;background:#fff;border:1px solid var(--border);border-radius:15px;box-shadow:var(--shadow)}
.surface-heading{display:flex;align-items:center;justify-content:space-between;padding-bottom:18px;margin-bottom:18px;border-bottom:1px solid #edf0f6}
.surface-heading .muted{margin-top:5px}
.bar-chart{min-height:250px;display:flex;flex-direction:column;gap:17px}
.bar-row{display:grid;grid-template-columns:148px 1fr 77px;gap:14px;align-items:center;font-size:12px}
.bar-label{color:#51607b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bar-track{height:13px;overflow:hidden;background:#edf1f8;border-radius:8px}
.bar-fill{height:100%;border-radius:8px;background:linear-gradient(90deg,#2e4b9d,#79a1e6);min-width:2px}
.bar-value{text-align:right;font-weight:800;color:#2a3c67}
.empty{display:grid;place-items:center;min-height:185px;text-align:center;color:#8490a2;font-size:12px}
.recent-list{display:flex;flex-direction:column;max-height:323px;overflow-y:auto}
.recent-item{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 3px;border-bottom:1px solid #eff2f6}
.recent-item:last-child{border:0}
.recent-main{min-width:0}
.recent-main strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px}
.recent-main small{display:block;margin-top:3px;color:#8994a9;font-size:11px}
.recent-aside{font-size:11px;font-weight:750;color:#44598d;white-space:nowrap}
.info-note{margin-top:19px;border:1px solid #dee6f3;border-radius:12px;padding:15px 18px;background:#ecf2fc;color:#3c4e70;font-size:12px}
.info-note strong{display:block;margin-bottom:4px}
.listing{padding:0;overflow:hidden}
.filters{display:grid;grid-template-columns:minmax(220px,1.8fr) minmax(135px,1fr) minmax(135px,1fr) auto;align-items:end;gap:12px;padding:19px 20px 18px;border-bottom:1px solid var(--border)}
.field{display:flex;flex-direction:column;gap:7px;min-width:0}
.field input{min-height:40px}
.table-status{padding:12px 19px;font-size:11px;font-weight:700;color:#8492a7}
.table-scroll{overflow-x:auto;max-width:100%}
.data-table{width:100%;border-collapse:collapse;white-space:nowrap}
.data-table th,.data-table td{padding:14px 16px;text-align:left;border-top:1px solid #edf0f5}
.data-table th{background:#f8fafc;color:#78859a;font-size:10px;letter-spacing:.055em;font-weight:850;text-transform:uppercase}
.data-table td{font-size:12px;color:#3d4b67}
.data-table tbody tr:hover{background:#fafcff}
.data-table td:first-child{font-weight:750;color:#203458}
.row-actions{display:flex;align-items:center;gap:7px}
.btn-mini{border:1px solid #dde4ee;border-radius:7px;background:#fff;color:#3d5185;padding:7px 10px;font-size:11px;font-weight:750}
.btn-mini:hover{background:#eef3fc}
.btn-mini.danger{color:#ae424a;border-color:#f1d4d6;background:#fffafa}
.table-empty{padding:45px!important;text-align:center;color:#8694aa!important}
.badge{display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:99px;background:#edf2fd;color:#33548a;font-size:10px;font-weight:750}
.warning{border:1px solid #e3d1a7;background:#fff7e7;color:#826019;padding:14px;border-radius:12px;margin-bottom:20px}
.footer{padding:20px 39px;border-top:1px solid #e2e8f2;color:#919bac;font-size:10px}
.editor-dialog{border:0;border-radius:18px;max-width:760px;width:calc(100% - 28px);max-height:calc(100vh - 38px);overflow:auto;padding:0;box-shadow:0 20px 100px rgba(5,17,47,.35)}
.editor-dialog::backdrop{background:rgba(6,18,46,.62);backdrop-filter:blur(3px)}
.editor-dialog form{padding:27px 30px}
.dialog-head{display:flex;justify-content:space-between;gap:15px;border-bottom:1px solid #e7ecf4;padding-bottom:20px;margin-bottom:21px}
.dialog-head h2{margin:5px 0 5px;font-size:24px}
.close-button{width:35px;height:35px;flex:0 0 auto;display:grid;place-items:center;background:#f3f6fa;color:#68758e;border:0;border-radius:10px;font-size:26px;line-height:1}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.form-grid .span2{grid-column:span 2}
.field .hint{font-size:10px;color:#929eaf}
.dialog-actions{display:flex;justify-content:flex-end;gap:10px;border-top:1px solid #e8edf4;margin-top:22px;padding-top:20px}
.calculated-preview{padding:13px 16px;border-radius:10px;margin-top:17px;background:#f2f6fc;border:1px solid #dce7f8;color:#2c426b;font-size:12px;font-weight:750}
.error-text{color:#ac343b;font-size:12px;font-weight:650;min-height:14px}
.toast{position:fixed;right:24px;bottom:24px;background:#142453;color:#fff;padding:13px 19px;border-radius:11px;box-shadow:0 8px 28px rgba(20,36,83,.2);font-size:12px;z-index:20}
@media(max-width:1200px){.sidebar{flex-basis:220px;width:220px}.topbar{padding:24px}.main-content{padding:25px}.dashboard-grid{grid-template-columns:1fr}.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:840px){.app-shell{display:block}.sidebar{position:relative;width:100%;height:auto;min-height:0;display:block;padding:15px}.sidebar-brand{padding:0 0 13px;margin:0;border:0}.sidebar-brand .brand-logo{width:35px;height:35px;font-size:12px}.sidebar-brand small{display:none}.sidebar nav{display:flex;overflow-x:auto;gap:6px;padding:5px 0 8px}.sidebar .nav-title{display:none}.nav-item{width:auto;min-width:max-content;border:1px solid #314268;border-radius:8px;min-height:34px;padding:7px 10px;font-size:11px}.nav-item>span{width:13px;font-size:12px}.sidebar-foot{display:none}.topbar{min-height:110px}.filters{grid-template-columns:1fr 1fr}.filters .search-field{grid-column:span 2}.footer{padding:20px}}
@media(max-width:620px){.topbar{flex-direction:column;align-items:stretch;gap:15px;padding:19px 15px}.topbar h1{font-size:24px}.top-actions{display:grid;grid-template-columns:1fr 1fr}.top-actions .environment{display:none}.main-content{padding:17px 12px 40px}.section-heading{align-items:stretch;flex-direction:column}.period-controls{justify-content:space-between}.kpis{gap:9px}.kpi{padding:15px 11px}.kpi-caption{font-size:9px}.kpi strong{font-size:22px}.kpi small{font-size:10px}.surface{padding:16px}.bar-row{grid-template-columns:95px 1fr 63px;gap:7px}.filters{grid-template-columns:1fr 1fr;padding:12px;gap:10px}.filters .search-field{grid-column:span 2}.filters button{grid-column:span 2}.editor-dialog form{padding:20px 17px}.form-grid{grid-template-columns:1fr}.form-grid .span2{grid-column:span 1}.dialog-actions{display:grid;grid-template-columns:1fr 1fr}.footer{text-align:center}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important}}


/* Planilha técnica: traços originais e fórmulas */
.tracos-actions{display:flex;flex-wrap:wrap;gap:9px}
.tracos-surface{padding:0;overflow:hidden}
.tracos-utilities{padding:19px 20px;display:flex;justify-content:space-between;align-items:flex-end;gap:18px;flex-wrap:wrap;border-bottom:1px solid var(--border)}
.tracos-densities{display:flex;gap:12px;flex-wrap:wrap}
.tracos-density{display:flex;min-width:190px;flex-direction:column;gap:6px;padding:10px 13px;border-radius:10px;background:#f2f6fc;border:1px solid #dfe8f7}
.tracos-density span{color:#5b6d90;font-size:11px;font-weight:700}
.tracos-density strong{color:#223969;font-size:18px;font-weight:800}
.tracos-density input{min-height:33px;padding:6px 8px;max-width:170px;font-size:13px}
.tracos-search-field{min-width:250px;max-width:330px;flex:1}
.tracos-search-field input{min-height:38px}
.tracos-meta{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 19px;color:#7888a0;font-size:11px}
.tracos-meta .invalid{color:#ba3745;font-weight:800}
.tracos-scroll{width:100%;max-height:65vh;overflow:auto;border-top:1px solid var(--border)}
.tracos-table{width:100%;min-width:1410px;border-collapse:separate;border-spacing:0;white-space:nowrap;font-variant-numeric:tabular-nums}
.tracos-table th,.tracos-table td{height:36px;min-width:102px;padding:7px 10px;border-bottom:1px solid #e5ebf4;border-right:1px solid #e9edf4;text-align:right;font-size:12px}
.tracos-table thead th{position:sticky;top:0;z-index:3;background:#243e79;color:#fff;font-size:11px;text-align:center;font-weight:800}
.tracos-table .traco-index{position:sticky;left:0;z-index:2;min-width:46px;width:46px;max-width:46px;text-align:center;background:#f1f4fb;color:#79879c;font-weight:600}
.tracos-table thead .traco-index{z-index:5;background:#20345f;color:#fff}
.tracos-table .traco-name{position:sticky;left:46px;z-index:2;min-width:240px;width:240px;max-width:240px;text-align:left;background:#fff;color:#23395b;font-weight:700}
.tracos-table thead .traco-name{z-index:4;background:#243e79;color:#fff}
.tracos-table tbody tr:hover td{background:#f6f9ff}
.tracos-table tbody tr:hover .traco-index{background:#eaf0fb}
.tracos-table tbody tr:hover .traco-name{background:#f6f9ff}
.tracos-table .formula-value{color:#205a90;font-weight:800;background:#eef6ff}
.tracos-table input{min-height:29px;height:29px;border-radius:5px;padding:4px 6px;font-size:12px;text-align:right}
.tracos-table td.traco-name input{text-align:left}
.tracos-table .formula-input{background:#edf6ff;color:#1f5d94;font-weight:700}
.tracos-help{padding:12px 20px 17px;font-size:11px;color:#7888a0}
@media(max-width:840px){.tracos-utilities{align-items:stretch}.tracos-search-field{max-width:100%}.tracos-density{min-width:140px}.tracos-scroll{max-height:58vh}}

/* Correspondência visual com a folha Traços do Excel de origem */
.tracos-table{min-width:1560px;table-layout:fixed;color:#434343;border-spacing:0}
.tracos-table th,.tracos-table td{height:26px;min-width:0;white-space:nowrap;padding:3px 7px;font-size:12px;vertical-align:middle;border:1px solid #d9e1eb;border-width:0 1px 1px 0}
.tracos-table .traco-name{width:188px;min-width:188px;max-width:188px;font-weight:400;background:white;color:#434343}
.tracos-table .traco-index{width:42px;min-width:42px;max-width:42px;border-right:1px solid #cad2dd;text-align:center}
.tracos-table thead th{position:sticky;top:0;background:white;color:#434343;font-size:11px;text-transform:none;letter-spacing:normal}
.tracos-table thead .traco-index{background:#e9edf4;color:#5d6c82}
.tracos-table thead .traco-name{background:#ffd966;color:#1155cc;font-weight:700}
.tracos-table tbody .traco-name{font-weight:400}
.tracos-table .tracos-excel-title{background:#fff;color:#1155cc;text-align:center;font-weight:500;font-size:15px}
.tracos-table .tracos-parameter-label{background:#fff;color:#434343;text-align:center;font-weight:400;max-width:155px;overflow:hidden;text-overflow:ellipsis}
.tracos-table .tracos-parameter-value{background:#fff;color:#434343;text-align:center;font-weight:400}
.tracos-table .traco-group-row .tracos-original-heading,.tracos-table .traco-ingredients-row .tracos-original-heading{background:#ffd966;color:#1155cc;text-align:center;font-size:12px;font-weight:700}
.tracos-table .traco-ingredients-row .tracos-original-heading{width:106px;min-width:106px;max-width:106px}
.tracos-table .tracos-original-row td{text-align:center}
.tracos-table .tracos-original-row .traco-name{text-align:left}
.tracos-table tbody .formula-value{background:#fff;color:#434343;font-weight:400}
.tracos-table input{padding:2px 5px;min-height:23px;height:23px}
.tracos-table thead input{min-height:23px;height:23px;text-align:center}
.tracos-table thead .traco-blank-header th{background:#fff;color:#434343}
.tracos-table .traco-index{z-index:4}
.tracos-table thead .traco-group-row th{top:52px;z-index:8}
.tracos-table thead .traco-ingredients-row th{top:78px;z-index:7}
.tracos-table thead .traco-banner-row th{top:0;z-index:10}
.tracos-table thead .traco-blank-header th{top:26px;z-index:9}
