:root{font-family:Inter,Arial,sans-serif;color:#19304b;background:#f4f7fb}*{box-sizing:border-box}body{margin:0;display:flex;min-height:100vh}aside{width:246px;background:#102945;color:#d9e8f5;padding:26px 16px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand{display:flex;align-items:center;gap:12px;font-size:12px;letter-spacing:.05em;padding:4px 8px 35px}.brand b{display:block;font-size:20px;letter-spacing:.12em}.brand small{display:block;color:#8cb1ce;margin-top:3px;letter-spacing:0}.mark{height:42px;width:42px;background:#168cc6;display:grid;place-items:center;border-radius:11px;color:white;font-size:28px;font-weight:bold}nav{display:grid;gap:6px}button{font:inherit;cursor:pointer}nav button{border:0;background:transparent;color:#b6cadc;text-align:left;padding:14px;border-radius:10px;font-size:14px}nav button:hover,nav .active{background:#205077;color:white}.aside-bottom{margin-top:auto;padding:15px 10px;font-size:12px;color:#9ebbd2;line-height:1.8}main{flex:1;min-width:0;padding:34px clamp(22px,4vw,64px)}header,.toolbar{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:30px}header small,.eyebrow{font-size:11px;font-weight:700;letter-spacing:.12em;color:#6383a0}header h1{margin:8px 0 0;font-size:29px;letter-spacing:-.03em}h2{letter-spacing:-.025em}p{color:#667c91;line-height:1.6}.primary{background:#087db7;color:white;border:0;border-radius:9px;padding:13px 19px;font-weight:700}.light{border:0;border-radius:9px;padding:13px 18px;background:white;color:#10436d;font-weight:700}.hero{background:linear-gradient(115deg,#153d66,#0d77a9);color:white;min-height:260px;border-radius:16px;padding:37px 43px;display:flex;justify-content:space-between;gap:25px;overflow:hidden}.hero h2{font-size:28px;max-width:520px;margin:16px 0 8px}.hero p{color:#cde2f1;max-width:560px;margin-bottom:20px}.pill{font-size:10px;letter-spacing:.12em;background:#ffffff2c;padding:8px 11px;border-radius:20px}.hero-art{border-left:1px solid #ffffff55;align-self:stretch;padding:25px 0 0 35px;font-size:35px;font-weight:800;color:#ffffffb0;min-width:190px}.hero-art span{font-size:11px;display:block;color:white;letter-spacing:.15em;margin-bottom:21px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin:21px 0}.stats article,.panel,.comp-card{background:white;border:1px solid #e4ebf2;border-radius:13px;padding:23px;box-shadow:0 5px 18px #19304b08}.stats label,.stats small{display:block;color:#7b91a3;font-size:12px}.stats strong{display:block;font-size:27px;color:#134169;margin:10px 0}.panel{margin-bottom:20px}.panel h3{margin:0 0 10px}.panel p{margin-bottom:0}.hidden{display:none!important}.drop{border:2px dashed #a7cbe1;background:#f5faff;border-radius:12px;padding:45px 22px;display:flex;flex-direction:column;align-items:center;gap:10px;margin-top:25px;text-align:center}.drop strong{font-size:18px}.drop span{font-size:13px;color:#667c91}.drop input{max-width:250px}.status{margin-top:20px;padding:13px;background:#eef5fa;border-radius:8px;color:#28597b}.columns{display:grid;grid-template-columns:1fr 1fr;gap:22px}.toolbar h2{margin:0 0 5px}.toolbar p{margin:0}.controls{display:flex;gap:10px}input:not([type=file]){border:1px solid #d7e3ed;border-radius:8px;padding:11px;min-width:230px;background:white}button:not(.primary):not(.light):not(nav button){border:1px solid #d7e3ed;border-radius:8px;background:white;padding:10px 13px;color:#235273}.tablewrap{padding:0;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:12px}th{text-align:left;font-size:10px;letter-spacing:.07em;color:#70899e;background:#f8fafc;padding:14px 12px;white-space:nowrap}td{padding:12px;border-top:1px solid #edf1f5;vertical-align:top}td:nth-child(n+5){white-space:nowrap}td b{display:block;color:#175d91}td small{display:block;color:#567087;max-width:460px;line-height:1.4}.group td{background:#eef4fa;font-weight:700;color:#235273}.pagination{display:flex;justify-content:center;align-items:center;gap:15px;padding:18px;color:#607d93;font-size:13px}.comp-list{display:grid;gap:10px}.comp-card{display:flex;justify-content:space-between;align-items:center;gap:15px;padding:16px 20px}.comp-card b{color:#096d9f}.comp-card small{display:block;color:#6e8292;margin-top:5px}.comp-card p{margin:5px 0 0;font-size:13px}dialog{border:0;border-radius:16px;width:min(900px,94vw);max-height:88vh;box-shadow:0 25px 80px #0e243e55;padding:25px;overflow:auto}dialog::backdrop{background:#10294599}.dialog-head{display:flex;justify-content:space-between;gap:20px}.dialog-head h2{font-size:20px;margin:7px 0 17px}.dialog-head small{color:#087db7;font-weight:700}#detailContent .tablewrap{overflow:auto}.meta{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:20px}.meta span{background:#edf6fa;padding:8px;border-radius:7px;font-size:12px}#notice:not(:empty){padding:12px 16px;background:#e7f5ed;color:#1f7245;border-radius:8px;margin-bottom:18px}@media(max-width:850px){aside{width:100%;height:auto;position:static;padding:14px}body{display:block}nav{display:flex;overflow:auto}.brand{padding:4px 8px 12px}.aside-bottom{display:none}main{padding:23px 15px}.hero-art{display:none}.hero{padding:25px}.stats{grid-template-columns:1fr}.toolbar,header{align-items:flex-start;flex-direction:column}.controls{flex-wrap:wrap}.columns{grid-template-columns:1fr}}
.inputs-table{min-width:820px}.inputs-table .input-description{min-width:230px;max-width:370px;white-space:normal;line-height:1.45;color:#48657d}.inputs-table td:nth-child(2){white-space:nowrap}

.price-fields{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr));gap:15px}.price-fields label{display:grid;gap:8px;font-size:12px;font-weight:bold;color:#56738c}.price-fields input,.price-fields select{width:100%;min-width:0;border:1px solid #d7e3ed;border-radius:8px;padding:11px;background:white;color:#19304b}.price-fields select{font:inherit}.inputs-table .changed{background:#eaf6ef;color:#207144;font-weight:bold}.inputs-table .missing{color:#a36122}@media(max-width:850px){.price-fields{grid-template-columns:repeat(2,1fr)}}
/* Janela de composição: todas as colunas cabem em telas de escritório. */
#detail{width:min(1320px,98vw);padding:clamp(12px,2vw,25px)}
#detail .dialog-head{align-items:flex-start}
#detail .dialog-head>button{flex:0 0 auto;width:42px;height:42px;padding:0}
#detail .tablewrap{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
#detail .inputs-table{width:100%;min-width:920px;table-layout:fixed}
#detail .inputs-table th,#detail .inputs-table td{padding:10px 7px;overflow-wrap:anywhere}
#detail .inputs-table th:nth-child(1){width:14%}
#detail .inputs-table th:nth-child(2){width:9%}
#detail .inputs-table th:nth-child(3){width:27%}
#detail .inputs-table th:nth-child(4){width:7%}
#detail .inputs-table th:nth-child(5){width:5%}
#detail .inputs-table th:nth-child(6){width:7%}
#detail .inputs-table th:nth-child(7){width:10%}
#detail .inputs-table th:nth-child(8){width:10%}
#detail .inputs-table th:nth-child(9){width:11%}
#detail .inputs-table .input-description{min-width:0;max-width:none}
#detail .inputs-table td:nth-child(n+6){white-space:normal}
@media(max-width:700px){#detail{width:98vw;max-height:94vh}#detail .inputs-table{min-width:920px}}

.budget-table{min-width:1110px}.budget-table td:nth-child(2){white-space:nowrap;color:#125782}.budget-table .service-description{min-width:280px;max-width:520px;white-space:normal;line-height:1.45;color:#48657d}.budget-table th:nth-child(3){min-width:280px}.budget-table .group td:nth-child(3){white-space:normal}.budget-table td:nth-child(n+6){white-space:nowrap}

.budget-table{width:100%;min-width:1320px;table-layout:fixed}.budget-table th:nth-child(1){width:5%}.budget-table th:nth-child(2){width:8%}.budget-table th:nth-child(3){width:29%}.budget-table th:nth-child(4){width:8%}.budget-table th:nth-child(5){width:5%}.budget-table th:nth-child(6){width:7%}.budget-table th:nth-child(7){width:9%}.budget-table th:nth-child(8){width:10%}.budget-table th:nth-child(9){width:9%}.budget-table th:nth-child(10){width:7%}.budget-table th:nth-child(11){width:3%}.budget-table .service-description{min-width:0;max-width:none}.budget-table .group td:nth-child(3){text-align:left}.budget-table .reference{white-space:normal;overflow-wrap:anywhere}.source-chip{display:inline-block;padding:10px 14px;margin:8px 8px 0 0;border:1px solid #d0e5f0;background:#f1f8fc;border-radius:9px;font-size:13px}.source-chip small{display:block;color:#59758d;margin-top:4px}

.budget-references{margin:5px 0;color:#52748e;font-size:12px;line-height:1.5}.budget-table{min-width:1120px}.budget-table th:nth-child(1){width:5%}.budget-table th:nth-child(2){width:8%}.budget-table th:nth-child(3){width:30%}.budget-table th:nth-child(4){width:8%}.budget-table th:nth-child(5){width:5%}.budget-table th:nth-child(6){width:8%}.budget-table th:nth-child(7){width:11%}.budget-table th:nth-child(8){width:11%}.budget-table th:nth-child(9){width:10%}.budget-table th:nth-child(10){width:4%}.budget-table th:nth-child(n+6):nth-child(-n+9),.budget-table tr:not(.group) td:nth-child(n+6):nth-child(-n+9){text-align:right;font-variant-numeric:tabular-nums}.budget-table .group td:nth-child(4){text-align:right;font-variant-numeric:tabular-nums}.budget-table.hide-cetro .cetro-column{display:none}.budget-table.hide-cetro{min-width:1020px}.inputs-table th:nth-child(n+6),.inputs-table td:nth-child(n+6){text-align:right;font-variant-numeric:tabular-nums}.catalog-table th:nth-child(n+5),.catalog-table td:nth-child(n+5){text-align:right;font-variant-numeric:tabular-nums}.tablewrap:has(#priceBody) td:nth-child(4),.tablewrap:has(#priceBody) th:nth-child(4){text-align:right;font-variant-numeric:tabular-nums}

/* Colunas ajustadas ao conteúdo: descrição usa o espaço restante. */
.budget-table,.budget-table.hide-cetro{table-layout:auto;width:100%;min-width:0}
.budget-table th:nth-child(1),.budget-table th:nth-child(2),.budget-table th:nth-child(4),.budget-table th:nth-child(5),.budget-table th:nth-child(6),.budget-table th:nth-child(7),.budget-table th:nth-child(8),.budget-table th:nth-child(9),.budget-table th:nth-child(10){width:1%;white-space:nowrap}
.budget-table th:nth-child(3){width:auto;min-width:260px}
.budget-table td:not(.service-description){white-space:nowrap}
.budget-table .service-description{min-width:260px;max-width:none;white-space:normal;overflow-wrap:break-word}
.budget-table .group td:nth-child(3){white-space:normal}
.budget-table.hide-cetro .cetro-column{display:none}
.budget-table th,.budget-table td{padding-left:9px;padding-right:9px}
@media(max-width:900px){.budget-table,.budget-table.hide-cetro{min-width:850px}}

.db-actions{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}.db-actions button{border:1px solid #c9ddeb;background:#fff;color:#164d73;padding:10px 14px;border-radius:8px}.catalog-entry{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:13px;border-top:1px solid #e6eef5;font-size:13px}.catalog-entry small{display:block;color:#69849a;margin-top:4px}#dbStatus{font-size:13px;color:#28648b;margin:10px 0}.login-gate{position:fixed;inset:0;z-index:9999;background:#102945e8;display:grid;place-items:center;padding:15px}.login-gate.hidden{display:none}.login-card{background:#fff;border-radius:16px;padding:32px;width:min(420px,100%);box-shadow:0 20px 60px #0004}.login-card h2{margin-top:0}.login-card label{display:grid;gap:6px;margin:14px 0;font-size:13px}.login-card input{width:100%;min-width:0}.login-card .primary{width:100%}#loginError{color:#a52d32;font-size:13px}.db-actions button:disabled{opacity:.5;cursor:wait}
