/* Parte web: login, estado da sincronização, Definições, Utilizadores e telemóvel */
header.top{flex-wrap:wrap;row-gap:8px}
header.top .nav{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
header.top a.inicio{color:#fff;text-decoration:none;border:1px solid rgba(255,255,255,.45);border-radius:6px;padding:7px 13px;white-space:nowrap}
header.top a.inicio:hover{background:rgba(255,255,255,.12)}
header.top a.inicio[hidden]{display:none}
#quem{display:flex;gap:8px;align-items:center;font-size:13px;margin-left:6px}
.sync{font-size:12px;padding:3px 9px;border-radius:12px;background:rgba(255,255,255,.1);white-space:nowrap;max-width:420px;overflow:hidden;text-overflow:ellipsis}
.sync.ok{color:#a5e3a9}.sync.warn{color:#ffd27a}.sync.err{color:#ff9d9d;background:rgba(198,40,40,.25)}
.autor{font-size:11px;font-weight:400}
.procbar .id small.autor{display:block;opacity:.8}
button.perigo{color:var(--red);border-color:#e6a1a1}
button.perigo:hover{background:#fdecec}
.login{position:fixed;inset:0;background:var(--navy);z-index:500;display:flex;align-items:center;justify-content:center;padding:16px}
.login[hidden]{display:none}
.lgcaixa{background:#fff;border-radius:12px;padding:0 24px 22px;width:min(380px,100%);box-shadow:0 10px 40px rgba(0,0,0,.35);display:flex;flex-direction:column;gap:12px;overflow:hidden}
.lgtopo{background:var(--navy);margin:0 -24px 6px;padding:18px 24px;color:#fff;display:flex;align-items:center;gap:14px;font-size:17px;font-weight:600;border-bottom:3px solid var(--sky)}
.lgtopo img{height:34px}
.lgcaixa label.f{display:flex;flex-direction:column;gap:4px}
.lgcaixa input{font-size:16px;padding:9px 10px}
.lgcaixa button{font-size:15px;padding:10px}
.lgmsg{min-height:18px;color:var(--red);font-size:13px}
.defs{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:14px}
.defs .caixa{border:1px solid var(--line);border-radius:8px;padding:12px 14px;background:#fff}
.defs h3{margin:0 0 8px;color:var(--navy)}
.defs label.f{display:flex;flex-direction:column;gap:3px;margin-bottom:8px}
#tUsers tr.inativo td{opacity:.55}
#tUsers td.acoes{white-space:nowrap}
@media print{.login,header.top{display:none!important}}
/* telemóvel */
@media (max-width:760px){
  header.top{padding:8px 10px;gap:8px}
  header.top img{height:28px}
  header.top .ttl{font-size:15px;padding-left:10px}
  header.top .sp{display:none}
  header.top .nav{width:100%;overflow-x:auto;flex-wrap:nowrap}
  header.top .nav button,header.top a.inicio{padding:6px 9px;font-size:13px;white-space:nowrap}
  #guardado{display:none}
  .sync{max-width:100%;order:3}
  main#app{padding:8px!important}
  .card{padding:10px!important}
  .procbar{flex-wrap:wrap}
  .stepper{overflow-x:auto;flex-wrap:nowrap}
  .stepper button{white-space:nowrap}
  .tw{max-width:100%}
  .row{flex-wrap:wrap}
  input,select,textarea{font-size:16px}
  .defs{grid-template-columns:1fr}
  .cols{grid-template-columns:1fr 1fr}
  .kpis{grid-template-columns:1fr 1fr}
  .grid2{grid-template-columns:1fr}
  .cab{grid-template-columns:1fr 1fr!important}
  #app table{display:block;overflow-x:auto;max-width:100%}
  #app table#tHist{display:table;width:100%;max-width:none;min-width:860px;overflow:visible}

  #app table.tConf{display:table;table-layout:fixed;width:100%;max-width:100%;min-width:0}
  #app .tw-conf{display:block;width:100%;max-width:100%}
  #app .conf-centros{width:100%;max-width:100%;overflow-x:auto}
  #app .conf-centros .card.obra{min-width:980px;max-width:none}
  #app input,#app select{max-width:100%;min-width:0}
}
body.fora main,body.fora header.top,body.fora #printArea{display:none!important}
/* ===== Assistência Técnica ===== */
.badge.b-at{background:#e3f3e4;color:#1b5e20;margin-left:8px;vertical-align:middle}
#tLinhas th.c-at,#tLinhas td.c-at{text-align:center;width:3.6em}
.atbox{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:2px}
.atbox input{width:18px;height:18px;cursor:pointer;accent-color:#1b5e20}
.atorig{font-size:10px;color:var(--muted,#5d6b7a);white-space:nowrap;line-height:1.1}
#tAT th.pat{background:#123e6b}
#tAT td.pat{font-weight:700;color:var(--navy);background:#eef5fc;white-space:nowrap;font-variant-numeric:tabular-nums}
#tAT tr.prov td.pat{background:#fff6e5;color:#8a4b00}
#tAT td.c-np{font-weight:700;color:var(--navy);white-space:nowrap}
#tAT td.c-des{min-width:220px}
#tAT tr[data-abrir]:hover td{background:#f7fafd}
#tAT{border-collapse:separate;border-spacing:0}
#tAT td.c-centro,#tAT td.c-cli,#tAT th.c-centro,#tAT th.c-cli{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#tAT td.c-est,#tAT th.c-est,#tAT td.c-marc,#tAT th.c-marc{white-space:nowrap;background:#fff}
#tAT td.c-est .badge,#tAT td.c-est .tc-pill{white-space:nowrap}
#tAT td.c-marc,#tAT th.c-marc{position:sticky;right:0;z-index:2;max-width:72px;width:72px;overflow:hidden;text-overflow:ellipsis}
#tAT td.c-est,#tAT th.c-est{position:sticky;right:0;z-index:2;box-shadow:-2px 0 0 var(--l,#dfe5ea)}
#tAT:has(.c-marc) td.c-est,#tAT:has(.c-marc) th.c-est{right:72px}
#tAT th.c-est,#tAT th.c-marc{background:var(--navy);z-index:3}
#tAT tr[data-abrir]:hover td.c-est,#tAT tr[data-abrir]:hover td.c-marc{background:#f7fafd}
@media (max-width:1280px){
  #tAT td.c-des{min-width:140px}
  #tAT td.c-centro,#tAT td.c-cli,#tAT th.c-centro,#tAT th.c-cli{max-width:90px}
}
@media (max-width:1024px){
  #tAT td.c-des{min-width:110px}
  #tAT td.c-centro,#tAT td.c-cli,#tAT th.c-centro,#tAT th.c-cli{max-width:72px}
}

body[data-nivel="at"] #bVoltarTopo,body[data-nivel="at"] #bFretes,body[data-nivel="at"] #bDefs{display:none!important}
@media (max-width:720px){
  #tAT th.c-np,#tAT td.c-np{position:sticky;left:0;z-index:1;background:#fff;box-shadow:2px 0 0 var(--l,#dfe5ea)}
  #tAT th.c-np{z-index:3;background:var(--navy)}
  #tAT td.c-des{min-width:160px}
}
/* login único: links com aspeto de botão */
a.btn-link{display:inline-block;text-decoration:none;border-radius:6px;padding:7px 13px;background:var(--blue);color:#fff;font-weight:600;border:1px solid var(--blue)}
a.btn-link:hover{background:#0f5592}
/* ===== Base de preços (APP-24) ===== */
.pr-filtros{flex-wrap:wrap;gap:10px;align-items:flex-end}
.pr-filtros .f{flex-direction:column;gap:2px;font-size:12px}
#tPrecos th.pr-ord{cursor:pointer;user-select:none;white-space:nowrap}
#tPrecos tbody tr[data-prart]{cursor:pointer}
#tPrecos tbody tr[data-prart]:hover{background:#eef4fb}
#tPrecos tr.pr-ab{background:#e3eefa}
#tPrecos td.pr-ref{white-space:nowrap;font-family:Consolas,monospace;font-size:12.5px}
#tPrecos td.pr-des{min-width:220px}
#tPrecos td.c{text-align:center}
.pr-p{white-space:nowrap}.pr-p b{display:block}.pr-p small{color:#5b6b7b;font-size:11px}
.pr-sobe{color:#b3261e;font-weight:600}.pr-desce{color:#1b7a3a;font-weight:600}
tr.pr-hist>td{background:#f7fafd;padding:8px 10px}
.pr-h .tw{margin-top:6px;max-height:none}
.pr-h table{font-size:12.5px}
@media (max-width:760px){
  .pr-filtros .f{flex:1 1 45%}
  .pr-filtros #prQ{flex:1 1 100%}
  #tPrecos td.pr-des{min-width:160px}
}

/* lote 1 (30/11/2026, IMP-01): em Consulta os campos aparecem como texto (sem amarelo «preenches tu», sem borda, sem cursor de edição) e não há «Guardado automaticamente» */
body[data-nivel="consulta"] #app input:disabled,body[data-nivel="consulta"] #app select:disabled,body[data-nivel="consulta"] #app textarea:disabled{background:#f3f6f9!important;border-color:transparent!important;color:#1f2d3d!important;-webkit-text-fill-color:#1f2d3d;opacity:1;cursor:default;box-shadow:none!important}
body[data-nivel="consulta"] #app select:disabled{appearance:none;-webkit-appearance:none;background-image:none!important}
body[data-nivel="consulta"] #guardado{display:none!important}
/* IMP-04: campos de data em texto dd/mm/aaaa */
input[data-data-pt]{font-variant-numeric:tabular-nums}
body[data-nivel="consulta"] #app span.man{display:none!important}

/* 1.6.0: cabeçalhos de preço c/ despesas em branco (contraste no azul); calendário visível; pegas das colunas */
#tAT th.pat{background:var(--navy,#123e6b);color:#fff!important}
input[type="date"]{min-width:11em;color-scheme:light}
input[type="date"]::-webkit-calendar-picker-indicator{opacity:1;cursor:pointer;display:block}
.tc-colh{position:absolute;top:0;right:0;width:8px;height:100%;cursor:col-resize;z-index:4}
.tc-colh:hover,.tc-colh:active{background:rgba(255,255,255,.35)}
#tAT thead th,#tFretes thead th{position:relative}

/* 1.6.0: AT e Fretes cabem a 1024/1280 por defeito (table-layout fixed); o utilizador pode alargar e aparecer scroll no contentor */
#tAT,#tFretes{width:100%;max-width:100%;table-layout:fixed;box-sizing:border-box}
.tw:has(#tAT),.tw:has(#tFretes),#tAT,#tFretes{max-width:100%}
.tw:has(#tAT),.tw:has(#tFretes){overflow-x:auto}
#tAT td.c-des,#tAT th,#tAT td,#tFretes th,#tFretes td{min-width:0;overflow:hidden;text-overflow:ellipsis}
@media (max-width:1280px){
  #tAT td.c-des{min-width:0}
}
@media (max-width:1024px){
  #tAT td.c-des{min-width:0}
}
