:root{--nav:#071e39;--nav2:#0b2b52;--blue:#0d5ca6;--light:#f4f7fb;--card:#fff;--txt:#182231;--muted:#657083;--line:#dce5ef;--good:#138a46;--bad:#c43e3e;--warn:#b7791f;--shadow:0 16px 36px rgba(12,32,55,.10)}
*{box-sizing:border-box}body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:var(--light);color:var(--txt)}.app{display:flex;min-height:100vh}.side{width:264px;background:linear-gradient(180deg,var(--nav),var(--nav2));color:#fff;padding:22px 16px;position:fixed;inset:0 auto 0 0}.brand{display:flex;align-items:center;gap:12px;margin-bottom:28px}.logo{width:44px;height:44px;border-radius:12px;background:#fff;color:var(--blue);display:grid;place-items:center;font-weight:950}.brand b{font-size:16px}.brand small{display:block;color:#bdd8ef;font-size:12px}.navbtn{display:flex;gap:10px;align-items:center;width:100%;padding:13px 14px;border:0;border-radius:12px;color:#dceaf8;background:transparent;text-align:left;font-weight:850;cursor:pointer;margin:5px 0}.navbtn.active,.navbtn:hover{background:rgba(255,255,255,.13);color:#fff}.main{margin-left:264px;width:calc(100% - 264px)}.top{min-height:78px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:14px 28px;position:sticky;top:0;z-index:3}.title h1{margin:0;font-size:22px}.title p{margin:4px 0 0;color:var(--muted);font-size:13px}.filters{display:flex;gap:10px;align-items:center;flex-wrap:wrap}select,.btn{height:38px;border:1px solid var(--line);background:#fff;border-radius:10px;padding:0 12px;font-weight:850;color:#26364a;cursor:pointer}.btn.primary{background:var(--blue);color:#fff;border-color:var(--blue)}.btn.danger{background:#fff5f5;color:#b42318;border-color:#fed7d7}.content{padding:24px 28px 42px}.view{display:none}.view.active{display:block}.selector{display:flex;gap:9px;flex-wrap:wrap;align-items:center;margin:0 0 16px;padding:10px 0 2px}.chip{height:40px;border:1px solid #d3dde8;background:#fff;border-radius:999px;padding:0 15px;font-weight:950;cursor:pointer;color:#18304e;letter-spacing:.01em;box-shadow:0 1px 2px rgba(12,32,55,.03);white-space:nowrap;display:inline-flex;align-items:center;justify-content:center}.chip.active{background:#0d5ca6;color:#fff;border-color:#0d5ca6;box-shadow:0 4px 10px rgba(13,92,166,.18)}.chip:hover{border-color:#b8cee5;background:#f6faff}.chip.active:hover{background:#0d5ca6;color:#fff}.grid-kpi{display:grid;grid-template-columns:repeat(auto-fit,minmax(158px,1fr));gap:14px}.card,.kpi,.chart,.tablecard,.segcard{background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}.kpi{padding:17px;cursor:pointer;min-height:124px}.kpi:hover,.segcard:hover,.insight-bar:hover{outline:2px solid #b9dcff}.lab{font-size:12px;color:var(--muted);text-transform:uppercase;font-weight:900;letter-spacing:.03em}.val{font-size:22px;font-weight:950;margin-top:9px;white-space:nowrap}.sub{font-size:12px;color:var(--muted);margin-top:8px;line-height:1.35}.good{color:var(--good)}.bad{color:var(--bad)}.warn{color:var(--warn)}.charts{display:grid;grid-template-columns:1.35fr 1fr;gap:16px;margin-top:16px}.chartCol{display:grid;grid-template-rows:auto auto;gap:16px}.chart,.tablecard,.card{padding:18px;overflow:auto}.chart h2,.tablecard h2,.card h2{margin:0 0 5px;font-size:18px}.chart p,.tablecard p,.card p{margin:0 0 12px;color:var(--muted);font-size:13px}.legend{display:flex;gap:14px;flex-wrap:wrap;margin-top:8px;color:#506176;font-size:12px;font-weight:800}.dot{display:inline-block;width:10px;height:10px;border-radius:99px;margin-right:5px}.b{background:#0d5ca6}.r{background:#c43e3e}.g{background:#138a46}.p{background:#6f2dbd}.o{background:#b7791f}.axis{stroke:#cfdceb;stroke-width:1.15}.lineA,.lineB,.lineC,.lineD{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.lineA{stroke:#0d5ca6}.lineB{stroke:#c43e3e}.lineC{stroke:#138a46}.lineD{stroke:#6f2dbd}.svgtext{font:11px Segoe UI,Arial;fill:#667588}.chart-point-label{font:700 10.5px Segoe UI,Arial;paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round}.chart-axis-label,.chart-month-label{font-size:11.5px;font-weight:600}.projects{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:16px}.segcard{padding:17px;cursor:pointer}.segcard h3{margin:0 0 12px}.fatgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.fat{border:1px solid var(--line);border-radius:14px;padding:12px;background:#f9fbfe;cursor:pointer;min-width:0}.fat b{display:block;margin-bottom:6px}.fat span{font-weight:900;font-size:17px}.fat small{display:block;color:var(--muted);margin-top:4px}.fat .info{display:grid;gap:4px;margin-top:7px}.fat .line{display:flex;justify-content:space-between;gap:8px;align-items:center;border-top:1px solid #e7eef6;padding-top:4px;font-size:12px}.fat .line em{font-style:normal;color:var(--muted)}.splitline{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:7px}.mini{border-top:1px solid #e7eef6;padding-top:5px;font-size:12px}.mini em{display:block;font-style:normal;color:var(--muted);font-size:11px}table{border-collapse:collapse;width:100%;font-size:13px}th,td{border-bottom:1px solid var(--line);padding:10px;text-align:right}th:first-child,td:first-child,th:nth-child(2),td:nth-child(2){text-align:left}th{color:#4b5d72;background:#f6f9fc;font-size:12px;text-transform:uppercase}.status{display:inline-block;border-radius:999px;padding:5px 9px;font-size:11px;font-weight:900;background:#eaf3ff;color:#0d5ca6}.barTable{margin-top:12px;font-size:12px}.barTable th,.barTable td{padding:7px 8px}.barTable th:first-child,.barTable td:first-child{text-align:left}.modal{position:fixed;inset:0;background:rgba(6,20,36,.58);display:none;align-items:center;justify-content:center;z-index:10;padding:22px}.modal.show{display:flex}.modalbox{background:#fff;border-radius:22px;box-shadow:0 28px 60px rgba(0,0,0,.25);width:min(1080px,96vw);max-height:88vh;overflow:auto}.modalhead{display:flex;justify-content:space-between;align-items:flex-start;padding:22px 24px;border-bottom:1px solid var(--line)}.modalhead h2{margin:0}.x{border:0;background:#f0f4f8;border-radius:10px;width:36px;height:36px;font-size:20px;cursor:pointer}.modalbody{padding:20px 24px}.modalbox.dre-full{width:98vw;height:94vh;max-height:94vh;display:flex;flex-direction:column}.modalbox.dre-full .modalbody{flex:1;overflow:auto;display:flex;flex-direction:column}.modalbox.dre-full .native-dre-wrap{flex:1;max-height:none;overflow:auto}.modalbox.dre-full .native-dre-actions{position:sticky;bottom:0;background:#fff;border-top:1px solid var(--line);padding:12px 0 0;margin-top:12px;display:flex;gap:8px;flex-wrap:wrap}.modalbox.dre-full th{position:sticky;top:0;z-index:1}.modal-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin-bottom:16px}.mcell{border:1px solid var(--line);border-radius:14px;background:#f9fbfe;padding:12px}.mcell b{display:block;font-size:12px;color:var(--muted);text-transform:uppercase}.mcell strong{display:block;margin-top:6px;font-size:18px}.insight-list{display:grid;gap:10px}.insight-bar{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;padding:14px;border:1px solid var(--line);border-radius:14px;background:#f9fbfe;cursor:pointer}.insight-bar b{display:block;font-size:13px}.insight-bar small{display:block;color:var(--muted);margin-top:3px;line-height:1.25}.insight-value{font-weight:950;white-space:nowrap}.trendbox{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:14px}.trenditem{border:1px solid var(--line);border-radius:14px;padding:13px;background:#f9fbfe;cursor:pointer}.trenditem b{display:block;font-size:12px;color:#657083;text-transform:uppercase}.trenditem strong{display:block;margin-top:6px;font-size:20px}.two{display:grid;grid-template-columns:1fr 1fr;gap:14px}.config-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.config-full{grid-column:1/-1}.config-stack{display:grid;gap:16px}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:8px 0}.input{height:38px;border:1px solid var(--line);border-radius:10px;padding:0 12px;width:100%}.muted{color:var(--muted)}.preview-wrap{max-height:360px;overflow:auto;border:1px solid var(--line);border-radius:14px}.editable{width:120px;height:28px;border:1px solid #d7e2ed;border-radius:8px;text-align:right;padding:0 8px}.notice{background:#eef6ff;border:1px solid #cfe7ff;border-radius:14px;padding:12px;margin:10px 0;color:#0a4a85;font-weight:750}
.structure-table{width:100%;border:1px solid var(--line);border-radius:14px;overflow:hidden}.structure-table table{width:100%;border-collapse:collapse}.structure-table th,.structure-table td{text-align:left;padding:10px;border-bottom:1px solid var(--line)}.structure-table tbody tr:last-child td{border-bottom:0}.confirm-box{display:grid;gap:12px}.confirm-alert{background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;border-radius:14px;padding:12px;font-weight:800}.confirm-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}

.imported-months-table td,.imported-months-table th{text-align:left}.imported-months-table td:nth-child(n+3),.imported-months-table th:nth-child(n+3){text-align:right}.import-mirror-wrap{max-height:68vh;overflow:auto;border:1px solid var(--line);border-radius:14px}.import-mirror{min-width:1320px}.import-mirror th,.import-mirror td{vertical-align:middle}.import-mirror .col-line{min-width:64px;width:64px;text-align:left}.import-mirror .col-group{min-width:180px;width:180px;text-align:left}.import-mirror .col-account{min-width:520px;width:520px;text-align:left}.import-mirror .col-value{min-width:140px;width:140px}.import-mirror .col-total{min-width:150px;width:150px}.import-mirror .import-account{min-width:500px;text-align:left}.import-mirror .import-group{min-width:150px;text-align:left}.import-mirror .editable{width:128px}.import-mirror thead th{position:sticky;top:0;z-index:2}

.import-edit-table{table-layout:auto;min-width:1450px}
.import-edit-table th,.import-edit-table td{white-space:nowrap}
.import-edit-table th.import-account-col,.import-edit-table td.import-account-col{min-width:340px;width:340px;white-space:normal;text-align:left}
.import-edit-table th.import-group-col,.import-edit-table td.import-group-col{min-width:180px;width:180px;text-align:left}
.import-edit-table th.import-line-col,.import-edit-table td.import-line-col{width:70px;min-width:70px;text-align:center}
.import-edit-table th.import-actions-col,.import-edit-table td.import-actions-col{width:96px;min-width:96px;text-align:center}
.import-edit-table .import-account-input{min-width:320px;width:100%;height:34px}
.import-edit-table .import-group-input{min-width:160px;width:100%;height:34px}
.import-edit-table .editable{width:122px}
.import-edit-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:0 0 10px}
.hide{display:none!important}@media(max-width:1250px){.grid-kpi{grid-template-columns:repeat(3,1fr)}.charts,.projects,.two,.config-grid{grid-template-columns:1fr}}@media(max-width:850px){.side{width:78px}.brand small,.brand b,.navbtn span{display:none}.main{margin-left:78px;width:calc(100% - 78px)}.grid-kpi,.trendbox{grid-template-columns:1fr}.top{align-items:flex-start;flex-direction:column;gap:10px}}

.structure-order{display:inline-flex;gap:4px;align-items:center;justify-content:center;white-space:nowrap}.structure-order .btn{height:30px;padding:0 8px}.structure-table .order-col{width:74px;text-align:center}.structure-table .kind-col{width:130px}.structure-table .active-col{width:88px;text-align:center}.structure-table .sheet-header-col{min-width:220px}.structure-table .sheet-header-input{min-width:210px}.structure-table .dash-col{width:118px;text-align:center}.import-edit-table .import-account-col{min-width:520px;width:520px}.import-edit-table .import-account-input{min-width:500px}.import-edit-table .import-group-col{min-width:190px;width:190px}.import-edit-table .import-value-col{min-width:145px;width:145px}.import-edit-table th,.import-edit-table td{white-space:nowrap}.import-edit-table .import-account-col,.import-edit-table .import-group-col{white-space:normal}.structure-note{font-size:12px;color:var(--muted);line-height:1.35;margin-top:8px}
.structure-savebar{display:flex;gap:8px;justify-content:flex-end;align-items:center;flex-wrap:wrap;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}


.config-grid .config-full{grid-column:1/-1}
.structure-table{max-height:540px;overflow:auto;display:block;border:1px solid var(--line);border-radius:14px;background:#fff}
.structure-table table{min-width:1280px;width:100%;table-layout:fixed}
.structure-table th{position:sticky;top:0;z-index:2;background:#f6f9fc}
.structure-table th:nth-child(2),.structure-table td:nth-child(2){width:170px}
.structure-table th:nth-child(3),.structure-table td:nth-child(3){width:190px}
.structure-table th.sheet-header-col,.structure-table td.sheet-header-col{width:420px;min-width:420px}
.structure-table .sheet-header-input{min-width:390px;width:100%}
.structure-table th.kind-col,.structure-table td.kind-col{width:115px}
.structure-table th.active-col,.structure-table td.active-col{width:85px;text-align:center}
.structure-table th.dash-col,.structure-table td.dash-col{width:150px;text-align:center}
.structure-table th:last-child,.structure-table td:last-child{width:120px}
.structure-table input,.structure-table select{font-size:13px}
@media(max-width:1250px){.config-grid{grid-template-columns:1fr}.structure-table table{min-width:1180px}}

#structureList .structure-table{
  width:100%;
  max-height:492px !important; /* cabeçalho + aproximadamente 8 lançamentos */
  overflow-y:auto !important;
  overflow-x:auto !important;
  display:block !important;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
}
#structureList .structure-table table{min-width:1280px;width:100%;table-layout:fixed}
#structureList .structure-table th{position:sticky;top:0;z-index:3;background:#f6f9fc}
#importedMonthsList .structure-table{
  max-height:260px !important;
  overflow:auto !important;
  display:block !important;
}
#importedMonthsList .structure-table table{
  min-width:760px !important;
  table-layout:auto !important;
  font-size:12px;
}
#importedMonthsList .structure-table th,
#importedMonthsList .structure-table td{padding:6px 7px !important;white-space:nowrap;}
#importedMonthsList .structure-table th:nth-child(2),
#importedMonthsList .structure-table td:nth-child(2){max-width:210px;overflow:hidden;text-overflow:ellipsis;}
#importedMonthsList .structure-actions{gap:4px;flex-wrap:nowrap;justify-content:flex-start}
#importedMonthsList .structure-actions .btn{height:30px;padding:0 8px;font-size:12px}


#importedMonthsList .structure-table{
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  -webkit-overflow-scrolling:touch;
}
#importedMonthsList .structure-table table{
  width:100% !important;
  min-width:640px !important;
  table-layout:auto !important;
}
#importedMonthsList .structure-table th,
#importedMonthsList .structure-table td{padding:6px 7px !important;white-space:nowrap;}
#importedMonthsList .structure-table th:nth-child(1),
#importedMonthsList .structure-table td:nth-child(1){width:32%;min-width:150px;}
#importedMonthsList .structure-table th:nth-child(2),
#importedMonthsList .structure-table td:nth-child(2){width:56px;min-width:48px;text-align:center;}
#importedMonthsList .structure-table th:nth-child(3),
#importedMonthsList .structure-table td:nth-child(3),
#importedMonthsList .structure-table th:nth-child(4),
#importedMonthsList .structure-table td:nth-child(4){width:120px;min-width:105px;text-align:right;}
#importedMonthsList .structure-table th:nth-child(5),
#importedMonthsList .structure-table td:nth-child(5){width:160px;min-width:150px;}
#importedMonthsList .structure-actions{gap:4px;flex-wrap:nowrap;justify-content:flex-start;}
#importedMonthsList .structure-actions .btn{height:30px;padding:0 8px;font-size:12px;}
#structureList .structure-table{max-height:480px !important;overflow-y:auto !important;overflow-x:auto !important;display:block !important;}

body.auth-lock .app{display:none}
body.auth-lock #loginScreen{display:flex}
#loginScreen{position:fixed;inset:0;background:linear-gradient(135deg,#071e39,#0d5ca6);align-items:center;justify-content:center;z-index:9999;padding:24px;display:none}
.login-box{width:min(430px,94vw);background:#fff;border-radius:24px;box-shadow:0 28px 70px rgba(0,0,0,.28);padding:28px;border:1px solid rgba(255,255,255,.25)}
.login-brand{display:flex;align-items:center;gap:12px;margin-bottom:18px}.login-brand .logo{box-shadow:0 8px 18px rgba(13,92,166,.16)}
.login-box h1{font-size:22px;margin:0}.login-box p{color:var(--muted);font-size:13px;margin:6px 0 16px}.login-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:14px}.login-error{display:none;background:#fff5f5;border:1px solid #fecaca;color:#b42318;border-radius:12px;padding:10px;margin-top:10px;font-weight:800;font-size:13px}.login-error.show{display:block}
.userbar{display:flex;align-items:center;gap:10px;font-size:12px;color:#516174;font-weight:800}.userbar b{color:#10253f}.btn.small{height:30px;padding:0 9px;font-size:12px;border-radius:8px}.user-grid{display:grid;grid-template-columns:1.25fr 1fr;gap:16px}.user-card-full{grid-column:1/-1}.perm-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:8px;margin-top:8px}.perm-item{border:1px solid var(--line);border-radius:12px;padding:9px;background:#f9fbfe;font-size:12px;font-weight:850;color:#334155;display:flex;gap:8px;align-items:center}.actions-inline{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.users-table-wrap{max-height:420px;overflow:auto;border:1px solid var(--line);border-radius:14px}.users-table-wrap th{position:sticky;top:0;z-index:1}.users-table td,.users-table th{text-align:left;white-space:nowrap}.users-table td:last-child,.users-table th:last-child{text-align:right}.profile-form{display:grid;gap:8px}.muted-pill{display:inline-block;border-radius:999px;background:#eef6ff;color:#0d5ca6;padding:4px 8px;font-size:11px;font-weight:900}.inactive-pill{background:#fff5f5;color:#b42318}.copy-box{display:flex;gap:8px;align-items:center}.copy-box input{font-weight:950;letter-spacing:.08em}
@media(max-width:1100px){.user-grid{grid-template-columns:1fr}}


#config .config-grid > .config-full{grid-column:1/-1}
#backlogCard{min-width:0}
#importedMonthsList{max-width:100%;overflow-x:auto}
#importedMonthsList table{width:100%;min-width:0}

.executive-panel .modal-summary{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:10px}.executive-panel .mcell{padding:9px 10px;border-radius:12px}.executive-panel .mcell b{font-size:10.5px;line-height:1.15}.executive-panel .mcell strong{font-size:16px;margin-top:4px;white-space:nowrap}.executive-panel h3{font-size:15px}.stte-dre-filterbar{display:none!important}@media(max-width:900px){.executive-panel .modal-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}


/* v2.26 - ajuste pontual Dashboard/Painel Executivo e rolagem geral */
html,body{min-height:100%;overflow-y:auto;}
.main{height:100vh;overflow-y:auto;overflow-x:hidden;}
.content{min-height:calc(100vh - 78px);}
.trendbox{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px!important;margin-top:10px!important;}
.trenditem{padding:9px 10px!important;min-height:76px!important;}
.trenditem b{font-size:10.5px!important;line-height:1.15!important;}
.trenditem strong{font-size:16px!important;margin-top:5px!important;white-space:nowrap!important;}
.trenditem .sub{font-size:10.5px!important;margin-top:5px!important;}
@media(max-width:1200px){.trendbox{grid-template-columns:repeat(2,minmax(0,1fr))!important;}}
@media(max-width:700px){.trendbox{grid-template-columns:1fr!important;}}


/* v2.26 - rolagem própria somente na aba DRE Completo */
#dre.view.active{
  display:flex !important;
  flex-direction:column;
  height:calc(100vh - 126px);
  min-height:0;
  overflow:hidden;
}
#dre .tablecard{
  flex:1 1 auto;
  min-height:0;
  max-height:100%;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
#dre #dreTable{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  padding-bottom:8px;
}
#dre .stte-dre-wrap,
#dre .stte-dre-full-wrap{
  max-height:none !important;
  overflow:visible !important;
}
#dre .stte-dre-actions{
  position:sticky;
  top:0;
  z-index:4;
  background:#fff;
  padding-bottom:10px;
  border-bottom:1px solid var(--line);
  margin-bottom:10px;
}
#dre .stte-dre-table thead th{
  position:sticky;
  top:0;
  z-index:3;
}
