:root{
  --navy:#002060;
  --navy-dark:#001238;
  --red:#d62828;
  --gray-bg:#f4f6f9;
  --border:#c9d2de;
  --ok:#1e7a3c;
}
*{box-sizing:border-box;}
body{
  margin:0; font-family:'Segoe UI',Arial,Helvetica,sans-serif;
  background:var(--gray-bg); color:#1c2733;
}
a{color:var(--navy);}
.app{max-width:900px;margin:0 auto;padding-bottom:60px;}
header.top{
  background:var(--navy); color:#fff; padding:16px 18px 14px;
  position:sticky; top:0; z-index:50; box-shadow:0 2px 6px rgba(0,0,0,.15);
}
header.top h1{margin:0 0 2px; font-size:17px; font-weight:700;}
header.top p{margin:0; font-size:12.5px; opacity:.85;}
header.top a{color:#fff; text-decoration:none;}
main{padding:16px;}
.card{
  background:#fff; border:1px solid var(--border); border-radius:8px;
  padding:14px 16px; margin-bottom:14px;
}
.card h2{font-size:15px; margin:0 0 10px; color:var(--navy);}
.proc-card{
  display:block; border:1px solid var(--border); border-radius:8px; padding:12px 14px; margin-bottom:10px;
  text-decoration:none; color:inherit; background:#fff;
}
.proc-card:hover{border-color:var(--navy); box-shadow:0 2px 8px rgba(0,32,96,.12);}
.proc-card .num{font-weight:700; color:var(--navy); font-size:13.5px;}
.proc-card .sub{font-size:12px; color:#5a6b80; margin-top:2px;}
.tags-row{display:flex; flex-wrap:wrap; gap:6px; margin-top:6px;}
.tag{
  display:inline-block; font-size:10.5px; background:var(--navy); color:#fff;
  padding:2px 8px; border-radius:10px;
}
.tag.status-em_andamento{background:#1e5aa8;}
.tag.status-concluido{background:var(--ok);}
.tag.status-homologado{background:#6b21a8;}
.tag.status-cancelado{background:#7c8a9c;}
.tag.warn{background:#fff3cd; color:#7a5c00;}
.tag.muted-tag{background:#eef1f6; color:#33465e;}
button, .btn{
  background:var(--navy); color:#fff; border:none; padding:10px 16px; border-radius:6px;
  font-size:13.5px; font-weight:600; cursor:pointer; text-decoration:none; display:inline-block;
}
button:hover, .btn:hover{background:var(--navy-dark);}
.btn.secondary{background:#fff; color:var(--navy); border:1px solid var(--navy);}
.btn.danger{background:#fff; color:var(--red); border:1px solid var(--red); padding:6px 10px; font-size:12px;}
.field{margin-bottom:12px;}
.field label{display:block; font-size:12px; font-weight:600; color:#33465e; margin-bottom:3px;}
.field input[type=text], .field input[type=date], .field input[type=file], .field textarea{
  width:100%; padding:7px 9px; border:1px solid var(--border); border-radius:5px; font-size:13px; font-family:inherit;
}
.field textarea{min-height:56px; resize:vertical;}
.alert{padding:10px 12px; border-radius:6px; font-size:13px; margin-bottom:12px;}
.alert.error{background:#fde8e8; color:#9b1c1c; border:1px solid #f5b5b5;}
.alert.ok{background:#e6f4ea; color:var(--ok); border:1px solid #b7ddc3;}
.empty-msg{color:#7c8a9c; font-size:13px; text-align:center; padding:30px 10px;}

/* Visualizador de fotos */
.repo-wrap{display:flex; gap:14px; flex-wrap:wrap;}
.thumbs{display:flex; gap:8px; flex:0 0 auto; flex-direction:row; flex-wrap:wrap; max-width:100%;}
.thumb{
  width:64px; height:64px; border-radius:6px; overflow:hidden; border:2px solid transparent;
  position:relative; flex-shrink:0;
}
.thumb img{width:100%; height:100%; object-fit:cover; display:block;}
.thumb.active{border-color:var(--red);}
.thumb .n{position:absolute; bottom:0; left:0; right:0; background:rgba(0,32,96,.85); color:#fff; font-size:9px; text-align:center; padding:1px 0;}
.viewer{flex:1; min-width:240px;}
.viewer img{width:100%; border-radius:6px; border:1px solid var(--border); display:block;}
.caption{font-style:italic; font-size:12.5px; text-align:center; color:#334; margin-top:6px;}
.nav-row{display:flex; justify-content:space-between; margin-top:8px; gap:8px;}

/* Dados do processo */
.dados-tabela{width:100%; border-collapse:collapse; font-size:13px;}
.dados-tabela td, .dados-tabela th{padding:7px 8px; border-bottom:1px solid var(--border); text-align:left; vertical-align:top;}
.dados-tabela .lbl{font-weight:600; color:var(--navy); width:160px; white-space:nowrap;}
.eventos-tabela{font-size:12.5px;}
.eventos-tabela th{background:#eef1f6; color:var(--navy);}
.parte-bloco h3{margin:0 0 4px; font-size:13.5px; color:var(--navy);}
.parte-bloco .muted{margin:2px 0; font-size:12.5px; color:#5a6b80;}
.sep{border:none; border-top:1px solid var(--border); margin:14px 0;}
.lista-simples{margin:0; padding-left:18px; font-size:13px;}
.filtros-form{display:flex; flex-wrap:wrap; gap:10px 14px; align-items:flex-end;}
.filtros-form .field{margin-bottom:0; min-width:160px; flex:1;}
.filtros-form select{
  width:100%; padding:7px 9px; border:1px solid var(--border); border-radius:5px; font-size:13px; font-family:inherit;
}

/* Diligência comparativa — captura e anotação (Fase 2) */
.par-item{
  display:flex; gap:12px; align-items:flex-start; border:1px solid var(--border); border-radius:8px;
  padding:10px; margin-bottom:10px; flex-wrap:wrap;
}
.par-item img{width:96px; height:96px; object-fit:cover; border-radius:6px; flex-shrink:0;}
.par-info{flex:1; min-width:160px;}
.par-legenda{font-weight:600; font-size:13px; color:#1c2733;}
.par-desc{font-size:12.5px; color:#5a6b80; margin-top:4px; white-space:pre-line;}
.par-data{font-size:12px; color:#7c8a9c; margin-top:4px;}
.par-item .btn.danger{align-self:center;}

.capture-box{text-align:center; border:2px dashed var(--border); border-radius:8px; padding:22px 10px; margin-bottom:12px;}
.capture-box .step-hint{font-size:12.5px; color:#5a6b80; margin:8px 0 0;}

.toolbar{display:flex; gap:6px; flex-wrap:wrap; margin:10px 0;}
.tool-btn{
  background:#fff; color:#1c2733; border:1px solid var(--border); border-radius:6px; padding:9px 12px;
  font-size:13px; font-weight:600; cursor:pointer; min-height:40px;
}
.tool-btn.active{background:var(--red); color:#fff; border-color:var(--red);}
.tool-btn#undoBtn, .tool-btn#clearBtn{background:#eef1f6;}

.canvas-wrap{position:relative; display:inline-block; max-width:100%; touch-action:none;}
#photoCanvas{max-width:100%; border-radius:6px; border:1px solid var(--border); touch-action:none; display:block;}

.float-input{
  position:absolute; z-index:20; border:1px solid var(--red); border-radius:4px;
  padding:4px 7px; font-size:14px; font-weight:700; color:var(--red); background:#fff;
  min-width:80px;
}

.toast{
  position:fixed; bottom:18px; left:50%; transform:translateX(-50%); background:var(--navy);
  color:#fff; padding:10px 18px; border-radius:20px; font-size:13px; opacity:0; transition:.25s;
  pointer-events:none; z-index:200; max-width:90%; text-align:center;
}
.toast.show{opacity:1;}

/* Revisão de dados extraídos por IA (processo_editar.php) */
.field-row{display:flex; gap:10px; flex-wrap:wrap;}
.field-row .field{flex:1; min-width:140px;}
.field-row .field-sm{flex:0 0 100px; min-width:100px;}
.field-row.subrow{background:#f8f9fb; border-radius:6px; padding:10px 10px 0; margin-bottom:10px;}
.card h4{font-size:12.5px; color:var(--navy); margin:16px 0 8px; text-transform:uppercase; letter-spacing:.03em;}
.field input[type=checkbox]{width:auto; margin-right:6px;}
