:root{
  --blue:#1f3f94;
  --blue2:#2448aa;
  --bg:#f5f6f8;
  --border:#d7dce5;
  --text:#061536;
  --muted:#667085;
  --red:#ef1b23;
  --yellow:#ffe600;
  --green:#12d91f;
  --sidebar:245px;
  --topbar:64px;
}

*{box-sizing:border-box;}

html,body{
  margin:0;
  min-height:100%;
  background:var(--bg);
  color:var(--text);
  font-family:Arial, Helvetica, sans-serif;
  font-size:14px;
}

a{color:inherit;text-decoration:none;}

button{
  border:0;
  border-radius:5px;
  background:var(--blue2);
  color:white;
  padding:11px 15px;
  font-weight:bold;
  cursor:pointer;
}

button:hover{filter:brightness(.96);}
button:disabled{opacity:.55;cursor:not-allowed;}

button.secondary{
  background:white;
  color:var(--blue);
  border:1px solid #cfd6e2;
}

button.danger{background:#dc2626;}
button.smallbtn{padding:7px 9px;font-size:12px;}

.app{
  min-height:100vh;
  display:grid;
  grid-template-columns:var(--sidebar) 1fr;
}

.topbar{
  position:fixed;
  top:0;
  left:0;
  right:0;
  height:var(--topbar);
  background:var(--blue);
  color:white;
  z-index:50;
  display:grid;
  grid-template-columns:var(--sidebar) 1fr;
  align-items:center;
  box-shadow:0 1px 3px rgba(0,0,0,.18);
}

.brand{
  height:var(--topbar);
  display:flex;
  align-items:center;
  gap:10px;
  padding-left:18px;
  line-height:1.1;
}

.brand .icon{font-size:26px;}
.brand strong{display:block;font-size:18px;}
.brand span{font-size:12px;}

.top-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  padding-right:24px;
}

.top-actions a,.top-actions button{
  width:auto;
  background:transparent;
  color:white;
  padding:8px 12px;
  border-radius:4px;
}

.top-actions a.active,.top-actions button.active{
  background:white;
  color:var(--blue);
}

.sidebar{
  position:fixed;
  top:var(--topbar);
  left:0;
  bottom:0;
  width:var(--sidebar);
  background:#f3f4f6;
  border-right:1px solid #d4d8df;
  overflow-y:auto;
  z-index:40;
}

.sidebar .nav{padding:14px;}

.sidebar a,.sidebar .item{
  display:flex;
  gap:9px;
  align-items:center;
  padding:11px 12px;
  border-radius:7px;
  margin-bottom:7px;
  color:#1f2937;
  font-weight:600;
  cursor:pointer;
}

.sidebar a.active,.sidebar a:hover,.sidebar .item.active,.sidebar .item:hover{
  background:var(--blue);
  color:#fff;
}

.content{
  grid-column:2;
  padding:calc(var(--topbar) + 18px) 24px 28px;
  min-width:0;
}

.container-narrow{
  max-width:1500px;
  margin:0 auto;
}

.card{
  background:white;
  border:1px solid var(--border);
  border-radius:6px;
  padding:18px;
  margin-bottom:18px;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}

h2,h3,h4{margin:0 0 14px;color:#09358d;}
.sub{color:var(--muted);margin-top:-4px;margin-bottom:12px;}
.hr{height:1px;background:var(--border);margin:14px 0 16px;}

.grid{display:grid;gap:12px;}
.grid-2{grid-template-columns:repeat(2,1fr);}
.grid-3{grid-template-columns:repeat(3,1fr);}
.grid-4{grid-template-columns:repeat(4,1fr);}
.grid-5{grid-template-columns:repeat(5,1fr);}

label{
  display:block;
  color:#344054;
  font-size:12px;
  font-weight:bold;
  text-transform:uppercase;
  margin-bottom:5px;
}

input,select,textarea{
  width:100%;
  border:1px solid #cfd6e2;
  border-radius:5px;
  padding:10px 12px;
  background:white;
  color:#061536;
  font-size:14px;
}

textarea{min-height:86px;resize:vertical;}
input[type="checkbox"]{width:auto;accent-color:#2448aa;}

.alert{color:#d00000;margin-top:10px;font-weight:bold;}
.ok{color:#027a48;margin-top:10px;font-weight:bold;}

.login-bg{
  min-height:100vh;
  background:linear-gradient(135deg,#193685,#061536);
  display:grid;
  place-items:center;
}

.login{
  width:420px;
  background:white;
  border-radius:8px;
  padding:24px;
  box-shadow:0 18px 50px rgba(0,0,0,.25);
}

.chips{display:flex;gap:7px;flex-wrap:wrap;}

.chip{
  background:#1644b8;
  color:white;
  border-radius:18px;
  padding:7px 13px;
  font-size:12px;
  cursor:pointer;
}

.empty{
  min-height:150px;
  display:grid;
  place-items:center;
  text-align:center;
  color:#98a2b3;
}

.briefing-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.summary-cards{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin:16px 0;
}

.summary-card{
  width:112px;
  min-width:112px;
  border:2px solid #e5e7eb;
  border-radius:5px;
  padding:12px;
  text-align:center;
  background:#f9fafb;
  cursor:pointer;
}

.summary-card .dot{
  width:30px;
  height:30px;
  border:2px solid #111;
  border-radius:50%;
  margin:0 auto 5px;
}

.summary-card strong{display:block;font-size:30px;line-height:1;}
.summary-card span{display:block;margin-top:5px;font-weight:bold;text-transform:uppercase;}
.summary-card.red{border-color:#ff9b9b;color:#d00000;background:#fff1f1;}
.summary-card.yellow{border-color:#ffc928;color:#92400e;background:#fffdeb;}
.summary-card.green{border-color:#58df8e;color:#027a48;background:#effff4;}
.summary-card.gray{color:#64748b;}

.dot.red{background:var(--red);}
.dot.yellow{background:var(--yellow);}
.dot.green{background:var(--green);}
.dot.gray{background:white;}

.tribunais{display:flex;gap:8px;flex-wrap:wrap;}
.trib{background:#e8f0ff;color:#0036ad;padding:6px 10px;border-radius:6px;cursor:pointer;}

.metric-row{
  display:grid;
  grid-template-columns:170px 1fr 70px;
  gap:12px;
  align-items:center;
  margin:9px 0;
}

.bar{
  height:14px;
  border-radius:7px;
  background:#eef0f4;
  overflow:hidden;
}

.bar>div{height:100%;border-radius:7px;background:#3b82f6;}

.filters{display:flex;gap:7px;align-items:center;flex-wrap:wrap;}
.filter-btn{width:auto;background:white;color:#061536;border:1px solid #cfd6e2;padding:8px 12px;}
.filter-btn.active{background:var(--blue);color:white;}
.filter-search{
  max-width:520px;
  border:2px solid #1d4ed8 !important;
  background:#fff !important;
  color:#061536 !important;
  box-shadow:0 0 0 1px rgba(29,78,216,.08);
}
.filter-search:focus{
  outline:none !important;
  border-color:#0036ad !important;
  box-shadow:0 0 0 3px rgba(29,78,216,.16);
}

.table-wrap{
  overflow-x:auto;
  border:1px solid var(--border);
  border-radius:4px;
  background:white;
}

table{width:100%;border-collapse:collapse;background:white;}

th{
  background:var(--blue);
  color:white;
  padding:11px 12px;
  text-align:left;
  font-size:12px;
  text-transform:uppercase;
  white-space:nowrap;
}

td{
  padding:12px;
  border-bottom:1px solid #edf0f5;
  vertical-align:top;
}

tbody tr{cursor:pointer;}
tbody tr:hover{background:#eef4ff!important;}
tr.row-urgent{background:#fff1f1;}
tr.row-atencao{background:#fffdf1;}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  border-radius:4px;
  padding:5px 9px;
  font-size:12px;
  border:1px solid #d9e0ea;
  background:#f8fafc;
  white-space:nowrap;
}

.badge.red{color:#d00000;border-color:#ff9b9b;background:#fff1f1;}
.badge.yellow{color:#92400e;border-color:#ffc928;background:#fffdeb;}
.badge.green{color:#027a48;border-color:#58df8e;background:#effff4;}
.badge.purple{color:#6d28d9;background:#f3e8ff;border:0;}
.badge.blue{color:#0040b8;background:#e8f0ff;border:0;}

.small{color:#64748b;font-size:12px;margin-top:4px;}
.linkish{color:#1d4ed8;text-decoration:underline;cursor:pointer;}

.modal{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  z-index:100;
  align-items:center;
  justify-content:center;
  padding:18px;
}

.modal.open{display:flex;}

.modal-content{
  width:980px;
  max-width:100%;
  max-height:92vh;
  overflow:auto;
  background:white;
  border-radius:7px;
  padding:18px;
  box-shadow:0 20px 60px rgba(0,0,0,.35);
}

.modal-top{display:flex;justify-content:space-between;gap:10px;}
.modal-close{background:transparent;color:#98a2b3;width:auto;font-size:22px;padding:0;}

.info-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  margin:14px 0;
}

.info-box{
  background:#f8fafc;
  border:1px solid #edf0f5;
  border-radius:5px;
  padding:10px;
}

.info-box span{display:block;color:#64748b;font-size:12px;margin-bottom:6px;}

.teor{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:5px;
  padding:12px;
  max-height:260px;
  overflow:auto;
  white-space:pre-wrap;
  font-family:Consolas,monospace;
  font-size:12px;
}

.teor-formatado{
  white-space:pre-wrap;
  line-height:1.45;
  font-family:"Times New Roman", Times, serif;
  font-size:14px;
}

.partes-box{
  max-height:170px;
  overflow:auto;
  white-space:normal;
  word-break:break-word;
  line-height:1.45;
  background:#fff;
  border:1px solid #edf0f5;
  border-radius:5px;
  padding:8px;
}

.status-buttons{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0;}
.status-buttons button{width:auto;}

.global-loading{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:200;
  display:flex;
  gap:12px;
  align-items:center;
  background:white;
  border:1px solid #cfd6e2;
  border-left:5px solid var(--blue2);
  border-radius:8px;
  padding:12px 14px;
  box-shadow:0 10px 30px rgba(0,0,0,.18);
  min-width:280px;
}

.spinner{
  width:28px;
  height:28px;
  border-radius:50%;
  border:4px solid #dbe3f0;
  border-top-color:var(--blue2);
  animation:spin 1s linear infinite;
}

@keyframes spin{to{transform:rotate(360deg);}}

.gl-title{font-weight:bold;color:var(--blue);}
.gl-sub{font-size:12px;color:#475467;}
.gl-time{font-size:11px;color:#98a2b3;}

#globalBuscaStatus{display:none;}
.action-row{display:flex;gap:8px;flex-wrap:wrap;}

@media(max-width:900px){
  .app{grid-template-columns:1fr;}
  .sidebar{display:none;}
  .topbar{grid-template-columns:1fr;}
  .brand{padding-left:16px;}
  .top-actions{display:none;}
  .content{grid-column:1;padding:calc(var(--topbar) + 18px) 12px 18px;}
  .grid-2,.grid-3,.grid-4,.grid-5,.info-grid{grid-template-columns:1fr;}
}


/* Ajustes DJEN - navegação, popup, datas e status */
.sidebar-toggle{
  width:calc(100% - 28px);
  margin:12px 14px 2px;
  padding:8px 10px;
  background:#ffffff;
  color:var(--blue);
  border:1px solid #cfd6e2;
}


.modal.open{overscroll-behavior:contain;}
.modal-content{overscroll-behavior:contain;}
body.modal-open{overflow:hidden;}

.btn-copy-processo{
  width:auto;
  min-width:28px;
  height:26px;
  padding:4px 7px;
  margin-left:6px;
  background:#ffffff;
  color:var(--blue);
  border:1px solid #cfd6e2;
  border-radius:6px;
  vertical-align:middle;
}
.btn-copy-processo:hover{background:#eef4ff;}
.status-buttons .status-active,
.badge.status-pendente{color:#344054;background:#f8fafc;border:1px solid #d9e0ea;}
.status-buttons .status-visto,
.badge.status-visto{color:#075985;background:#e0f2fe;border:1px solid #7dd3fc;}
.status-buttons .status-delegado,
.badge.status-delegado{color:#6d28d9;background:#f3e8ff;border:1px solid #c4b5fd;}
.status-buttons .status-cumprido,
.badge.status-cumprido{color:#027a48;background:#effff4;border:1px solid #58df8e;}
.vencimento-edit-row{display:flex;gap:8px;align-items:flex-end;margin:10px 0 4px;}
.vencimento-edit-row input{max-width:190px;}

.btn-gerenciar-bilhetes{
  width:auto;
  min-width:58px;
  height:28px;
  padding:4px 9px;
  background:#ffffff;
  color:var(--blue);
  border:1px solid #f59e0b;
  border-radius:7px;
}
.btn-gerenciar-bilhetes:hover{background:#fff7ed;}

/* Ajuste solicitado: botões de controle ficam brancos; somente o selecionado fica azul */
.status-buttons button{
  background:#ffffff !important;
  color:var(--blue) !important;
  border:1px solid #cfd6e2 !important;
}
.status-buttons button.status-active{
  background:var(--blue2) !important;
  color:#ffffff !important;
  border-color:var(--blue2) !important;
}

.link-btn{
  border:0;
  background:transparent;
  color:#143f96;
  padding:0;
  margin:0;
  cursor:pointer;
  text-align:left;
  font:inherit;
}
.link-btn:hover{text-decoration:underline;}

/* Ajustes Clientes/Publicações - 2026-05-29 */
.loading-box{
  padding:18px;
  border:1px solid #dbe4f0;
  border-radius:8px;
  background:#f8fbff;
  color:#183b70;
  font-weight:600;
}
.cliente-opcao-vinculo{
  width:100%;
  text-align:left;
  border:1px solid #d4deef;
  border-radius:8px;
  background:#fff;
  padding:10px 12px;
  margin-bottom:8px;
  cursor:pointer;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.cliente-opcao-vinculo:hover{ background:#eef5ff; border-color:#8bb6f0; }
.cliente-opcao-vinculo span{ color:#52627a; font-size:12px; }
.col-cliente{ min-width:150px; max-width:190px; }
.cliente-nome-cell{
  font-weight:700;
  line-height:1.2;
  max-width:180px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  word-break:normal;
  overflow-wrap:normal;
}
.cliente-modal-titulo{
  display:inline-block;
  max-width:360px;
  margin-left:12px;
  padding:4px 8px;
  border-radius:999px;
  background:#eef5ff;
  color:#173f8f;
  font-size:12px;
  font-weight:700;
  vertical-align:middle;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.cliente-modal-titulo.sem-cliente{background:#f8fafc;color:#64748b;}
.cliente-id-cell{ font-size:11px; color:#718096; margin-top:3px; }

/* Ajustes finais Clientes - 2026-05-29 */
.th-sort{
  background:transparent!important;
  border:0!important;
  color:white!important;
  padding:0!important;
  margin:0!important;
  font:inherit!important;
  font-weight:700!important;
  text-transform:uppercase;
  cursor:pointer;
  width:auto!important;
  box-shadow:none!important;
}
.cliente-opcao-vinculo{
  color:#0f172a!important;
  min-height:44px;
  justify-content:flex-start;
}
.cliente-opcao-vinculo .cliente-opcao-nome{
  display:block;
  min-width:260px;
  max-width:100%;
  color:#0f172a!important;
  font-weight:800!important;
  font-size:14px!important;
  white-space:normal;
}
.smallbtn.danger{
  border-color:#fecaca!important;
  background:#fff1f1!important;
  color:#b42318!important;
}
.processo-card-cliente:hover{ background:#eef5ff; }


/* Ajustes Clientes - largura e busca 2026-05-29 */
.clientes-wrap table th:first-child, .clientes-wrap table td:first-child{min-width:360px;max-width:520px;}
#trocaVinculoResultados{max-height:420px;overflow:auto;padding-right:4px;}
#trocaVinculoResultados .cliente-opcao-vinculo{margin-bottom:6px;}

/* Ajustes finais - organização do histórico do cliente e vínculo */
.grupo-processo-cliente{
  border:1px solid #d9e2f2;
  border-radius:10px;
  margin:10px 0 14px 0;
  overflow:hidden;
  background:#ffffff;
}
.grupo-processo-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  background:#f8fbff;
  border-bottom:1px solid #d9e2f2;
  cursor:pointer;
}
.grupo-processo-head:hover{background:#eef5ff;}
.grupo-processo-cliente .table-wrap{border:0;margin:0;}
.grupo-processo-cliente table{margin:0;}
.criar-cliente-vinculo{
  border-color:#86efac!important;
  background:#f0fdf4!important;
}
.criar-cliente-vinculo:hover{
  background:#dcfce7!important;
}
#lista table thead th{
  background:#1f3f95!important;
  color:#fff!important;
}
#lista table thead th *{color:#fff!important;}
#lista .cliente-nome-cell{color:#0f172a!important;}
#lista .cliente-nome-cell.sem-cliente{color:#667085!important;}

/* Contratos/Réus */
a.button{display:inline-block;background:var(--blue);color:white;border:0;border-radius:5px;padding:10px 14px;font-weight:bold;text-decoration:none;text-align:center;}
a.button.secondary{background:#f8fafc;color:#0b3b91;border:1px solid #cfd6e2;}
.clip2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-width:520px;line-height:1.25}
.table-wrap table th,.table-wrap table td{vertical-align:top}

.import-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;align-items:center;min-width:260px}
.import-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;flex-wrap:wrap}
.import-upload{margin-top:10px;display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center}
.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:14px;flex-wrap:wrap}
.djen-popup-content p{font-size:14px;line-height:1.45}
button:disabled{opacity:.65;cursor:not-allowed}
thead th{white-space:nowrap;vertical-align:middle}
.table-wrap table th,.table-wrap table td{overflow:hidden;text-overflow:ellipsis}

.placeholder-box{margin-top:12px;padding:12px;border:1px solid #cbd6ee;border-radius:8px;background:#f8fbff}.placeholder-box h4{margin:0 0 8px}.import-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}.import-actions{display:flex;gap:8px;justify-content:flex-end;min-width:320px}.import-actions .smallbtn,.import-actions a.smallbtn{display:inline-block;padding:9px 14px;border:1px solid #b8c7e6;border-radius:6px;background:#f7faff;text-decoration:none;font-weight:700}.import-upload{margin-top:10px;display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center}.import-upload input[type=file]{width:100%}


/* Preview das geradoras: fechado por padrão, abre em grade para não alongar a tela */
.preview-mini{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:9px 10px;
  border:1px solid #cfd8ea;
  background:#f8fbff;
  border-radius:8px;
  cursor:pointer;
}
.preview-mini span{font-size:12px;color:#48607e;font-weight:400}
.preview-conteudo{margin-top:8px}
.preview-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(260px,1fr));
  gap:6px 10px;
  max-height:360px;
  overflow:auto;
}
.preview-item{
  display:grid;
  grid-template-columns:minmax(160px,230px) 1fr;
  gap:8px;
  align-items:start;
  padding:7px 8px;
  border:1px solid #e5ebf5;
  background:#fff;
  border-radius:6px;
}
.preview-item b{font-size:12px;color:#001f5f;word-break:break-word}
.preview-item span{font-size:12px;word-break:break-word}
@media(max-width:900px){.preview-grid{grid-template-columns:1fr}.preview-mini{align-items:flex-start;flex-direction:column}.preview-item{grid-template-columns:1fr}}


/* Sidebar minimizada com ícones legíveis */
.sidebar .menu-icon{display:inline-flex;width:22px;min-width:22px;justify-content:center;font-size:18px;line-height:1}
.sidebar .menu-label{display:inline-block;white-space:nowrap}
body.sidebar-collapsed{--sidebar:74px;}
body.sidebar-collapsed .brand span,
body.sidebar-collapsed .brand strong{display:none;}
body.sidebar-collapsed .brand{justify-content:center;padding-left:0;}
body.sidebar-collapsed .topbar{grid-template-columns:var(--sidebar) 1fr;}
body.sidebar-collapsed .sidebar .nav{padding:12px 8px;}
body.sidebar-collapsed .sidebar a{justify-content:center;padding:12px 6px;gap:0;}
body.sidebar-collapsed .sidebar .menu-label{display:none;}
body.sidebar-collapsed .sidebar .menu-icon{font-size:20px;width:28px;min-width:28px;}
body.sidebar-collapsed .sidebar-toggle{width:calc(100% - 16px);margin:10px 8px;}


/* PATCH V23 - cumpridos compacto e menu minimizado preservando ícones */
.compact-table table.cumpridos-table td{padding:8px 10px;vertical-align:top;line-height:1.25;}
.compact-table table.cumpridos-table th{white-space:nowrap;}
.compact-table .resumo-curto{max-width:360px;max-height:34px;overflow:hidden;}
.linha-clicavel{cursor:pointer;}
.linha-clicavel:hover{background:#f3f7ff;}
body.sidebar-collapsed .sidebar .nav a{display:flex !important;align-items:center !important;justify-content:center !important;}
body.sidebar-collapsed .sidebar .menu-icon{display:inline-flex !important;opacity:1 !important;visibility:visible !important;}
body.sidebar-collapsed .sidebar .menu-label{display:none !important;}
.site-modal{position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:9500;display:flex;align-items:center;justify-content:center;padding:24px;}
.site-modal-card{background:#fff;border-radius:12px;border:1px solid #dbe3ef;box-shadow:0 20px 60px rgba(0,0,0,.25);padding:18px;width:min(920px,96vw);}
.input-button{display:flex;gap:6px;align-items:center}.input-button input{flex:1}.input-button button{white-space:nowrap}.stat-card{border:1px solid var(--border);border-radius:8px;background:#fff;padding:12px}.stat-card b{display:block;font-size:22px}.stat-card span{color:var(--muted);font-size:12px}.table-wrap{overflow:auto;max-width:100%}.empty{padding:12px;border:1px dashed var(--border);border-radius:8px;color:var(--muted);background:#fff}


/* =========================================================
   GUSTAVO GIOVANELLA - TEMA FINAL CLARO/ESCURO
   Apenas visual; não altera dados do banco.
   ========================================================= */
:root{
  --gg-blue:#1f3f94;
  --gg-blue2:#2448aa;
  --gg-bg:#f5f6f8;
  --gg-card:#ffffff;
  --gg-text:#061536;
  --gg-muted:#667085;
  --gg-border:#d7dce5;
  --gg-gold:#d5aa3f;
  --gg-gold2:#e8c463;
  --gg-dark-bg:#242932;
  --gg-dark-card:#2f3640;
  --gg-dark-card2:#29313b;
  --gg-dark-top:#111821;
  --gg-dark-text:#f4f7fb;
  --gg-dark-muted:#c8d1df;
  --gg-dark-border:#526071;
}
html[data-theme="claro"], body.theme-light{
  --blue:var(--gg-blue);
  --blue2:var(--gg-blue2);
  --bg:var(--gg-bg);
  --border:var(--gg-border);
  --text:var(--gg-text);
  --muted:var(--gg-muted);
}
body.theme-light{background:var(--gg-bg)!important;color:var(--gg-text)!important;}
body.theme-light .topbar{background:var(--gg-blue)!important;border-bottom:0!important;box-shadow:0 1px 3px rgba(0,0,0,.18)!important;}
body.theme-light .sidebar{background:#f3f4f6!important;border-right:1px solid #d4d8df!important;}
body.theme-light .sidebar a, body.theme-light .sidebar .item{color:#1f2937!important;background:transparent!important;border:0!important;}
body.theme-light .sidebar a.active, body.theme-light .sidebar a:hover{background:var(--gg-blue)!important;color:#fff!important;box-shadow:none!important;}
body.theme-light button, body.theme-light a.button, body.theme-light .smallbtn{background:var(--gg-blue2)!important;color:#fff!important;border:1px solid var(--gg-blue2)!important;}
body.theme-light button.secondary, body.theme-light a.button.secondary, body.theme-light .filter-btn{background:#fff!important;color:var(--gg-blue)!important;border:1px solid #cfd6e2!important;}
body.theme-light .filter-btn.active{background:var(--gg-blue)!important;color:#fff!important;}
body.theme-light .card, body.theme-light .modal-content, body.theme-light .site-modal-card{background:#fff!important;color:var(--gg-text)!important;border:1px solid var(--gg-border)!important;}
body.theme-light th, body.theme-light thead th, body.theme-light #lista table thead th, body.theme-light .table-wrap table th{background:var(--gg-blue)!important;color:#fff!important;border-bottom:0!important;}
body.theme-light .th-sort, body.theme-light th .th-sort{color:#fff!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;border-radius:0!important;}
body.theme-light td, body.theme-light tbody td{color:#061536!important;border-bottom:1px solid #edf0f5!important;}
body.theme-light table, body.theme-light .table-wrap{background:#fff!important;}
body.theme-light .badge.blue, body.theme-light .trib{background:#e8f0ff!important;color:#0036ad!important;border:0!important;}
body.theme-light .bar>div{background:#3b82f6!important;}
body.theme-light .brand-logo{background:#0b1220!important;border-radius:8px!important;padding:3px!important;}

/* ESCURO: grafite confortável, dourado moderado */
html[data-theme="escuro"], body.theme-dark{
  --blue:#0f1722;
  --blue2:var(--gg-gold);
  --bg:var(--gg-dark-bg);
  --border:var(--gg-dark-border);
  --text:var(--gg-dark-text);
  --muted:var(--gg-dark-muted);
}
body.theme-dark{background:var(--gg-dark-bg)!important;color:var(--gg-dark-text)!important;}
body.theme-dark .topbar{background:var(--gg-dark-top)!important;border-bottom:1px solid rgba(213,170,63,.55)!important;box-shadow:0 2px 18px rgba(0,0,0,.25)!important;}
body.theme-dark .sidebar{background:#252b34!important;border-right:1px solid #424c5a!important;}
body.theme-dark .content{background:var(--gg-dark-bg)!important;}
body.theme-dark .card, body.theme-dark .modal-content, body.theme-dark .site-modal-card,
body.theme-dark .grupo-processo-cliente, body.theme-dark .grupo-processo-head,
body.theme-dark .djen-popup-content, body.theme-dark .placeholder-box{
  background:var(--gg-dark-card)!important;color:var(--gg-dark-text)!important;border:1px solid var(--gg-dark-border)!important;box-shadow:0 10px 35px rgba(0,0,0,.20)!important;
}
body.theme-dark .grupo-processo-head{background:var(--gg-dark-card2)!important;}
body.theme-dark h1, body.theme-dark h2, body.theme-dark h3, body.theme-dark h4, body.theme-dark label,
body.theme-dark .sub, body.theme-dark .small, body.theme-dark p, body.theme-dark b, body.theme-dark strong,
body.theme-dark .cliente-nome-cell, body.theme-dark .cliente-id-cell, body.theme-dark .linkish{
  color:var(--gg-dark-text)!important;
}
body.theme-dark .sub, body.theme-dark .small{color:var(--gg-dark-muted)!important;}
body.theme-dark input, body.theme-dark select, body.theme-dark textarea{
  background:#242b35!important;color:#fff!important;border:1px solid #647286!important;box-shadow:none!important;
}
body.theme-dark input::placeholder, body.theme-dark textarea::placeholder{color:#aeb8c7!important;}
body.theme-dark button, body.theme-dark a.button, body.theme-dark .smallbtn,
body.theme-dark .top-actions button, body.theme-dark .import-actions .smallbtn{
  background:linear-gradient(180deg,var(--gg-gold2),var(--gg-gold))!important;color:#090d14!important;border:1px solid #c0932f!important;box-shadow:0 2px 8px rgba(0,0,0,.18)!important;
}
body.theme-dark button.secondary, body.theme-dark a.button.secondary, body.theme-dark .filter-btn:not(.active){
  background:#28313d!important;color:#f7f9fc!important;border:1px solid #687789!important;box-shadow:none!important;
}
body.theme-dark .filter-btn.active{background:linear-gradient(180deg,var(--gg-gold2),var(--gg-gold))!important;color:#090d14!important;border-color:#c0932f!important;}
body.theme-dark .top-actions a, body.theme-dark .top-actions button{color:#fff!important;background:transparent!important;border:0!important;box-shadow:none!important;}
body.theme-dark .top-actions a.active{color:var(--gg-gold2)!important;background:transparent!important;}
body.theme-dark #btnTemaTopo, body.theme-dark .top-actions button#btnTemaTopo, body.theme-dark .top-actions button:last-child{background:linear-gradient(180deg,var(--gg-gold2),var(--gg-gold))!important;color:#090d14!important;border:1px solid #c0932f!important;border-radius:7px!important;}
body.theme-dark .sidebar a, body.theme-dark .sidebar .item{color:#f7f9fc!important;background:transparent!important;border:1px solid transparent!important;}
body.theme-dark .sidebar a.active, body.theme-dark .sidebar a:hover{background:#303944!important;color:#fff!important;border-color:rgba(213,170,63,.55)!important;box-shadow:none!important;}
body.theme-dark .sidebar-toggle{background:linear-gradient(180deg,var(--gg-gold2),var(--gg-gold))!important;color:#090d14!important;border-color:#c0932f!important;}
body.theme-dark .brand, body.theme-dark .brand strong, body.theme-dark .brand span{color:#fff!important;}
body.theme-dark .brand-logo{background:#0b0f16!important;border-radius:8px!important;padding:3px!important;}
body.theme-dark .summary-card{background:#28313d!important;color:#f7f9fc!important;border-color:#5d697a!important;}
body.theme-dark .summary-card.red{background:#3b2c31!important;border-color:#ef4444!important;color:#ffb4b4!important;}
body.theme-dark .summary-card.yellow{background:#3a3526!important;border-color:#d5aa3f!important;color:#f6d98b!important;}
body.theme-dark .summary-card.green{background:#25382f!important;border-color:#22c55e!important;color:#b9f6ce!important;}
body.theme-dark .metric-row, body.theme-dark .bar{color:#fff!important;}
body.theme-dark .bar{background:#434d5c!important;}
body.theme-dark .bar>div{background:linear-gradient(90deg,#d5aa3f,#e8c463)!important;}
body.theme-dark .trib, body.theme-dark .badge.blue{background:#313a46!important;color:#f6d98b!important;border:1px solid rgba(213,170,63,.55)!important;}
body.theme-dark .badge, body.theme-dark .badge.status-pendente{background:#2a333f!important;color:#fff!important;border:1px solid #687789!important;}
body.theme-dark .badge.red{background:#4a272a!important;color:#ffb4b4!important;border-color:#ef4444!important;}
body.theme-dark .badge.yellow{background:#443822!important;color:#ffe49b!important;border-color:#d5aa3f!important;}
body.theme-dark .badge.green{background:#1f3a2a!important;color:#bcf7d0!important;border-color:#22c55e!important;}
body.theme-dark .badge.purple{background:#392f4f!important;color:#e9d5ff!important;border:1px solid #8b5cf6!important;}
body.theme-dark .info-box, body.theme-dark .teor, body.theme-dark .partes-box, body.theme-dark .empty,
body.theme-dark .loading-box, body.theme-dark .stat-card, body.theme-dark .preview-mini, body.theme-dark .preview-item{
  background:#252d38!important;color:#f7f9fc!important;border:1px solid #536173!important;
}
body.theme-dark .teor, body.theme-dark .teor *{color:#f7f9fc!important;}
body.theme-dark .table-wrap{background:var(--gg-dark-card)!important;border:1px solid var(--gg-dark-border)!important;}
body.theme-dark table{background:var(--gg-dark-card)!important;color:#fff!important;}
body.theme-dark th, body.theme-dark thead th, body.theme-dark #lista table thead th, body.theme-dark .table-wrap table th{
  background:#111821!important;color:#f6d98b!important;border-bottom:3px solid var(--gg-gold)!important;padding:11px 12px!important;box-shadow:none!important;border-radius:0!important;
}
body.theme-dark .th-sort, body.theme-dark th .th-sort{
  color:#f6d98b!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;border-radius:0!important;display:inline!important;
}
body.theme-dark td, body.theme-dark tbody td{color:#f7f9fc!important;border-bottom:1px solid #424c5a!important;}
body.theme-dark tbody tr:hover{background:#35404d!important;}
body.theme-dark tr.row-urgent{background:#463033!important;}
body.theme-dark tr.row-atencao{background:#3d3828!important;}
body.theme-dark .cliente-nome-cell, body.theme-dark #lista .cliente-nome-cell, body.theme-dark .col-cliente b,
body.theme-dark tbody td a, body.theme-dark .link-btn{color:#fff!important;}
body.theme-dark .linkish{color:#f6d98b!important;}
body.theme-dark .filter-search{background:#242b35!important;color:#fff!important;border:2px solid var(--gg-gold)!important;}
body.theme-dark #selecionadosInfo, body.theme-dark .selected-bar, body.theme-dark .selection-bar,
body.theme-dark [id*="selecionado"], body.theme-dark [class*="selecionado"]{
  background:#252d38!important;color:#f7f9fc!important;border-color:#536173!important;
}
body.theme-dark .cliente-contrato-card{background:#2f3640!important;border:1px solid #536173!important;color:#f7f9fc!important;}
body.theme-dark .cliente-contrato-card *{color:#f7f9fc!important;}
body.theme-dark .contratos-clientes-lista .badge{color:#f6d98b!important;background:#3a3320!important;}
body.theme-dark .ok{color:#21d07a!important}.theme-dark .alert{color:#ff9a9a!important;}
body.theme-dark .modal-close{background:transparent!important;color:#d5dde8!important;border:0!important;box-shadow:none!important;}

/* Cabeçalhos clicáveis sempre normais, sem chip quebrado */
thead th, .table-wrap thead th{border-radius:0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
th button, th .th-sort{max-width:100%!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}

/* Contratos: cards legíveis no tema escuro e claro */
.contratos-clientes-lista .cliente-contrato-card{border-radius:10px!important;}
body.theme-light .cliente-contrato-card{background:#fff!important;border:1px solid #dbe5f3!important;color:#061536!important;}
body.theme-light .cliente-contrato-card *{color:#061536!important;}
body.theme-light .cliente-contrato-card .small{color:#64748b!important;}

/* Login: mantido fixo com degradê aprovado, sem depender do tema */
body.login-bg{
  min-height:100vh!important;
  background:
    radial-gradient(circle at 16% 18%, rgba(213,170,63,.18) 0, rgba(213,170,63,.08) 13%, transparent 34%),
    radial-gradient(circle at 83% 78%, rgba(213,170,63,.20) 0, rgba(213,170,63,.10) 18%, transparent 39%),
    linear-gradient(135deg,#181818 0%,#071120 52%,#24231f 100%)!important;
  display:grid!important;place-items:center!important;position:relative!important;overflow:hidden!important;
}
body.login-bg:before, body.login-bg:after{content:"";position:fixed;background:url('/djen/assets/gustavo-g.png?v=gg-theme-final-3') center/contain no-repeat;opacity:.88;pointer-events:none;z-index:0;}
body.login-bg:before{width:170px;height:170px;left:70px;top:85px;}
body.login-bg:after{width:330px;height:330px;right:85px;bottom:75px;}
body.login-bg .login{position:relative;z-index:1;width:420px;background:#fff!important;color:#061536!important;border:1px solid #e1c16d!important;border-radius:12px!important;box-shadow:0 24px 80px rgba(0,0,0,.45)!important;padding:24px!important;}
body.login-bg .login h3, body.login-bg .login label, body.login-bg .login p, body.login-bg .login .sub{color:#061536!important;}
body.login-bg .login input{background:#fff!important;color:#061536!important;border:1px solid #cfd6e2!important;}
body.login-bg .login button{background:linear-gradient(180deg,#e8c463,#d5aa3f)!important;color:#090d14!important;border:1px solid #c0932f!important;}
.login-logo-mini{width:22px!important;height:22px!important;object-fit:contain!important;vertical-align:middle!important;margin-right:8px!important;background:#0b0f16!important;border-radius:5px!important;padding:3px!important;}
body.login-bg .login h3 img.login-logo-mini + img.login-logo-mini{display:none!important;}

/* Favicon/brand sizing */
.brand-logo{width:32px!important;height:32px!important;object-fit:contain!important;flex:0 0 32px!important;}
.brand{overflow:hidden!important;}
.brand strong{font-size:17px!important;line-height:1!important;}
.brand span{font-size:11px!important;line-height:1!important;}

/* Logs centralizado igual as demais telas */
body .content > .card, body .content > .table-wrap, body .content > #logsLista, body .content > .logs-wrap{max-width:1500px;margin-left:auto;margin-right:auto;}
#logsTabela, #logsTable, .logs-table{max-width:1500px;margin-left:auto;margin-right:auto;}

/* Estados/cidades: caixas de status no escuro não podem ficar brancas demais */
body.theme-dark #statusLocalidades .stat-card, body.theme-dark .stat-card b, body.theme-dark .stat-card span{color:#f7f9fc!important;background:#252d38!important;}

/* Tema claro deve ser azul, não dourado */
body.theme-light .top-actions button#btnTemaTopo{background:transparent!important;color:#fff!important;border:0!important;}
body.theme-light .top-actions button:last-child{background:#fff!important;color:var(--gg-blue)!important;border:1px solid #fff!important;}
body.theme-light .filter-btn.active, body.theme-light .sidebar-toggle{background:var(--gg-blue)!important;color:#fff!important;border-color:var(--gg-blue)!important;}
body.theme-light .summary-card .bar>div{background:#3b82f6!important;}


/* =========================================================
   GUSTAVO GIOVANELLA - TEMA FINAL CLARO/ESCURO SEM DB
   ========================================================= */
:root{
  --gg-blue:#1f3f94; --gg-blue2:#2448aa; --gg-blue3:#16347d;
  --gg-gold:#d5aa3f; --gg-gold2:#e8c463; --gg-gold3:#f7e3a3;
  --gg-dark-bg:#252b34; --gg-dark-card:#303741; --gg-dark-card2:#2a313b; --gg-dark-top:#111821; --gg-dark-border:#5b6573; --gg-dark-text:#f6f8fb; --gg-dark-muted:#c8d0dc;
}
body.theme-light{background:#f5f6f8!important;color:#061536!important;}
body.theme-light .topbar{background:var(--gg-blue)!important;color:#fff!important;border-bottom:0!important;}
body.theme-light .sidebar{background:#f3f4f6!important;border-right:1px solid #d4d8df!important;}
body.theme-light .sidebar a{color:#1f2937!important;background:transparent!important;border:0!important;}
body.theme-light .sidebar a.active, body.theme-light .sidebar a:hover{background:var(--gg-blue)!important;color:#fff!important;}
body.theme-light .card, body.theme-light .modal-content, body.theme-light .site-modal-card{background:#fff!important;color:#061536!important;border:1px solid #d7dce5!important;}
body.theme-light h1,body.theme-light h2,body.theme-light h3,body.theme-light h4{color:#09358d!important;}
body.theme-light label{color:#344054!important;}
body.theme-light .sub, body.theme-light .small{color:#667085!important;}
body.theme-light input, body.theme-light select, body.theme-light textarea{background:#fff!important;color:#061536!important;border:1px solid #cfd6e2!important;}
body.theme-light button, body.theme-light a.button, body.theme-light .smallbtn{background:var(--gg-blue2)!important;color:#fff!important;border:1px solid var(--gg-blue2)!important;box-shadow:none!important;}
body.theme-light button.secondary, body.theme-light a.button.secondary, body.theme-light .filter-btn:not(.active){background:#fff!important;color:var(--gg-blue)!important;border:1px solid #cfd6e2!important;}
body.theme-light .filter-btn.active{background:var(--gg-blue)!important;color:#fff!important;border-color:var(--gg-blue)!important;}
body.theme-light .top-actions a, body.theme-light .top-actions button{background:transparent!important;color:#fff!important;border:0!important;}
body.theme-light .top-actions a.active{background:#fff!important;color:var(--gg-blue)!important;}
body.theme-light #btnTemaTopo{background:#fff!important;color:var(--gg-blue)!important;border:1px solid #fff!important;border-radius:7px!important;}
body.theme-light .top-actions button:last-child{background:#fff!important;color:var(--gg-blue)!important;border:1px solid #fff!important;border-radius:7px!important;}
body.theme-light table, body.theme-light .table-wrap{background:#fff!important;color:#061536!important;}
body.theme-light th, body.theme-light thead th, body.theme-light .table-wrap thead th{background:var(--gg-blue)!important;color:#fff!important;border-bottom:0!important;border-radius:0!important;box-shadow:none!important;}
body.theme-light td, body.theme-light tbody td{color:#061536!important;border-bottom:1px solid #edf0f5!important;}
body.theme-light tbody tr:hover{background:#eef4ff!important;}
body.theme-light .trib, body.theme-light .badge.blue{background:#e8f0ff!important;color:#0036ad!important;border:0!important;}
body.theme-light .bar{background:#eef0f4!important}.theme-light .bar>div{background:#3b82f6!important;}
body.theme-light .cliente-contrato-card, body.theme-light .grupo-processo-cliente{background:#fff!important;color:#061536!important;border:1px solid #dbe5f3!important;}
body.theme-light .cliente-contrato-card *{color:#061536!important;}

body.theme-dark{background:var(--gg-dark-bg)!important;color:var(--gg-dark-text)!important;}
body.theme-dark .content{background:var(--gg-dark-bg)!important;}
body.theme-dark .topbar{background:var(--gg-dark-top)!important;color:#fff!important;border-bottom:1px solid rgba(213,170,63,.55)!important;box-shadow:0 2px 18px rgba(0,0,0,.25)!important;}
body.theme-dark .sidebar{background:#2a3038!important;border-right:1px solid #465160!important;}
body.theme-dark .sidebar a{color:#f7f9fc!important;background:transparent!important;border:1px solid transparent!important;}
body.theme-dark .sidebar a.active, body.theme-dark .sidebar a:hover{background:#333b46!important;color:#fff!important;border-color:rgba(213,170,63,.65)!important;}
body.theme-dark .sidebar-toggle{background:linear-gradient(180deg,var(--gg-gold2),var(--gg-gold))!important;color:#080c12!important;border:1px solid #b98924!important;}
body.theme-dark .card, body.theme-dark .modal-content, body.theme-dark .site-modal-card, body.theme-dark .grupo-processo-cliente, body.theme-dark .grupo-processo-head, body.theme-dark .djen-popup-content, body.theme-dark .placeholder-box{background:var(--gg-dark-card)!important;color:var(--gg-dark-text)!important;border:1px solid var(--gg-dark-border)!important;box-shadow:0 10px 35px rgba(0,0,0,.20)!important;}
body.theme-dark h1,body.theme-dark h2,body.theme-dark h3,body.theme-dark h4,body.theme-dark label,body.theme-dark p,body.theme-dark b,body.theme-dark strong,body.theme-dark span,body.theme-dark div{color:inherit;}
body.theme-dark h1,body.theme-dark h2,body.theme-dark h3,body.theme-dark h4,body.theme-dark label{color:#fff!important;}
body.theme-dark .sub, body.theme-dark .small{color:var(--gg-dark-muted)!important;}
body.theme-dark input, body.theme-dark select, body.theme-dark textarea{background:#252c36!important;color:#fff!important;border:1px solid #6b7788!important;box-shadow:none!important;}
body.theme-dark input::placeholder, body.theme-dark textarea::placeholder{color:#b7c0ce!important;opacity:1!important;}
body.theme-dark button, body.theme-dark a.button, body.theme-dark .smallbtn{background:linear-gradient(180deg,var(--gg-gold2),var(--gg-gold))!important;color:#090d14!important;border:1px solid #c0932f!important;box-shadow:0 2px 8px rgba(0,0,0,.18)!important;}
body.theme-dark button.secondary, body.theme-dark a.button.secondary, body.theme-dark .filter-btn:not(.active){background:#2a333f!important;color:#f7f9fc!important;border:1px solid #687789!important;box-shadow:none!important;}
body.theme-dark .filter-btn.active{background:linear-gradient(180deg,var(--gg-gold2),var(--gg-gold))!important;color:#090d14!important;border-color:#c0932f!important;}
body.theme-dark .top-actions a, body.theme-dark .top-actions button{background:transparent!important;color:#fff!important;border:0!important;box-shadow:none!important;}
body.theme-dark .top-actions a.active{color:var(--gg-gold2)!important;background:transparent!important;}
body.theme-dark #btnTemaTopo, body.theme-dark .top-actions button:last-child{background:linear-gradient(180deg,var(--gg-gold2),var(--gg-gold))!important;color:#090d14!important;border:1px solid #c0932f!important;border-radius:7px!important;}
body.theme-dark .summary-card{background:#28313d!important;color:#f7f9fc!important;border-color:#5d697a!important;}
body.theme-dark .summary-card.red{background:#3b2c31!important;border-color:#ef4444!important;color:#ffb4b4!important;}
body.theme-dark .summary-card.yellow{background:#3a3526!important;border-color:#d5aa3f!important;color:#f6d98b!important;}
body.theme-dark .summary-card.green{background:#25382f!important;border-color:#22c55e!important;color:#b9f6ce!important;}
body.theme-dark .metric-row, body.theme-dark .bar{color:#fff!important;}
body.theme-dark .bar{background:#434d5c!important;}.theme-dark .bar>div{background:linear-gradient(90deg,#d5aa3f,#e8c463)!important;}
body.theme-dark .trib, body.theme-dark .badge.blue{background:#313a46!important;color:#f6d98b!important;border:1px solid rgba(213,170,63,.55)!important;}
body.theme-dark .badge, body.theme-dark .badge.status-pendente{background:#2a333f!important;color:#fff!important;border:1px solid #687789!important;}
body.theme-dark .badge.red{background:#4a272a!important;color:#ffb4b4!important;border-color:#ef4444!important;}
body.theme-dark .badge.yellow{background:#443822!important;color:#ffe49b!important;border-color:#d5aa3f!important;}
body.theme-dark .badge.green{background:#1f3a2a!important;color:#bcf7d0!important;border-color:#22c55e!important;}
body.theme-dark .badge.purple{background:#392f4f!important;color:#e9d5ff!important;border:1px solid #8b5cf6!important;}
body.theme-dark .info-box, body.theme-dark .teor, body.theme-dark .partes-box, body.theme-dark .empty, body.theme-dark .loading-box, body.theme-dark .stat-card, body.theme-dark .preview-mini, body.theme-dark .preview-item{background:#252d38!important;color:#f7f9fc!important;border:1px solid #536173!important;}
body.theme-dark .info-box span, body.theme-dark .teor, body.theme-dark .teor *, body.theme-dark .partes-box *{color:#f7f9fc!important;}
body.theme-dark .table-wrap{background:var(--gg-dark-card)!important;border:1px solid var(--gg-dark-border)!important;}
body.theme-dark table{background:var(--gg-dark-card)!important;color:#fff!important;}
body.theme-dark th, body.theme-dark thead th, body.theme-dark .table-wrap table th{background:#111821!important;color:#f6d98b!important;border-bottom:3px solid var(--gg-gold)!important;padding:11px 12px!important;box-shadow:none!important;border-radius:0!important;}
body.theme-dark th *, body.theme-dark thead th *{color:#f6d98b!important;}
body.theme-dark .th-sort, body.theme-dark th.th-sort{background:#111821!important;color:#f6d98b!important;border-radius:0!important;display:table-cell!important;}
body.theme-dark .th-sort span, body.theme-dark th .sort-ind{color:#f6d98b!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;border-radius:0!important;}
body.theme-dark td, body.theme-dark tbody td{color:#f7f9fc!important;border-bottom:1px solid #424c5a!important;}
body.theme-dark tbody tr:hover{background:#35404d!important;}
body.theme-dark tr.row-urgent{background:#463033!important;} body.theme-dark tr.row-atencao{background:#3d3828!important;}
body.theme-dark .cliente-nome-cell, body.theme-dark #lista .cliente-nome-cell, body.theme-dark .col-cliente b, body.theme-dark tbody td a, body.theme-dark .link-btn{color:#fff!important;}
body.theme-dark .linkish{color:#f6d98b!important;}
body.theme-dark .filter-search{background:#252c36!important;color:#fff!important;border:2px solid var(--gg-gold)!important;}
body.theme-dark #selecionadosInfo, body.theme-dark .selected-bar, body.theme-dark .selection-bar, body.theme-dark [id*="selecionado"], body.theme-dark [class*="selecionado"]{background:#252d38!important;color:#f7f9fc!important;border-color:#536173!important;}
body.theme-dark .cliente-contrato-card{background:#2f3640!important;border:1px solid #536173!important;color:#f7f9fc!important;}
body.theme-dark .cliente-contrato-card *{color:#f7f9fc!important;}
body.theme-dark .contratos-clientes-lista .badge{color:#f6d98b!important;background:#3a3320!important;}
body.theme-dark .ok{color:#21d07a!important}.theme-dark .alert{color:#ff9a9a!important;}
body.theme-dark .modal-close{background:transparent!important;color:#d5dde8!important;border:0!important;box-shadow:none!important;}
body.theme-dark .form-card, body.theme-dark .panel, body.theme-dark .linha-card, body.theme-dark .cliente-card, body.theme-dark .reus-card{background:#303741!important;color:#fff!important;border-color:#5b6573!important;}

/* Marca, topo e favicon visual */
.brand-logo{width:32px!important;height:32px!important;object-fit:contain!important;flex:0 0 32px!important;background:transparent!important;border-radius:0!important;padding:0!important;}
.brand strong{font-size:17px!important;line-height:1!important;color:#fff!important;}.brand span{font-size:11px!important;line-height:1!important;color:#dbe5ff!important;}
body.theme-dark .brand span{color:#f6d98b!important;}
.menu-icon{min-width:20px!important;text-align:center!important;}

/* Cabeçalhos clicáveis sempre normais, sem chip quebrado */
thead th, .table-wrap thead th{border-radius:0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
th button, th .th-sort{max-width:100%!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}

/* Contratos: cabeçalho/filtro visual e cards legíveis */
.contratos-clientes-lista .cliente-contrato-card, .cliente-contrato-card{border-radius:10px!important;}
body.theme-light .cliente-contrato-card{background:#fff!important;border:1px solid #dbe5f3!important;color:#061536!important;}
body.theme-light .cliente-contrato-card *{color:#061536!important;}
body.theme-light .cliente-contrato-card .small{color:#64748b!important;}

/* Login aprovado: degradê fixo + dois Gs + botão tema */
body.login-bg{min-height:100vh!important;background:radial-gradient(circle at 16% 18%, rgba(213,170,63,.18) 0, rgba(213,170,63,.08) 13%, transparent 34%),radial-gradient(circle at 83% 78%, rgba(213,170,63,.20) 0, rgba(213,170,63,.10) 18%, transparent 39%),linear-gradient(135deg,#181818 0%,#071120 52%,#24231f 100%)!important;display:grid!important;place-items:center!important;position:relative!important;overflow:hidden!important;}
body.login-bg:before, body.login-bg:after{content:"";position:fixed;background:url('/djen/assets/gustavo-g.png?v=gg-ui-20260617-final') center/contain no-repeat;opacity:.88;pointer-events:none;z-index:0;}
body.login-bg:before{width:170px;height:170px;left:70px;top:85px;} body.login-bg:after{width:330px;height:330px;right:85px;bottom:75px;}
body.login-bg .login{position:relative;z-index:1;width:420px;background:#fff!important;color:#061536!important;border:1px solid #e1c16d!important;border-radius:12px!important;box-shadow:0 24px 80px rgba(0,0,0,.45)!important;padding:24px!important;}
body.login-bg .login h3, body.login-bg .login label, body.login-bg .login p, body.login-bg .login .sub{color:#061536!important;}
body.login-bg .login input{background:#fff!important;color:#061536!important;border:1px solid #cfd6e2!important;}
body.login-bg .login button{background:linear-gradient(180deg,#e8c463,#d5aa3f)!important;color:#090d14!important;border:1px solid #c0932f!important;}
.login-logo-mini{width:22px!important;height:22px!important;object-fit:contain!important;vertical-align:middle!important;margin-right:8px!important;background:transparent!important;border-radius:0!important;padding:0!important;}
body.login-bg .login h3 img.login-logo-mini + img.login-logo-mini{display:none!important;}
.theme-toggle-login{position:fixed!important;right:22px!important;top:18px!important;z-index:2!important;width:auto!important;}

/* Logs centralizado igual as demais telas */
body .content > .card, body .content > .table-wrap, body .content > #logsLista, body .content > .logs-wrap{max-width:1500px;margin-left:auto;margin-right:auto;}
#logsTabela, #logsTable, .logs-table{max-width:1500px;margin-left:auto;margin-right:auto;}

/* Estados/cidades no escuro sem blocos brancos */
body.theme-dark #statusLocalidades .stat-card, body.theme-dark #statusLocalidades .stat-card *, body.theme-dark .stat-card b, body.theme-dark .stat-card span{color:#f7f9fc!important;background:#252d38!important;}
body.theme-dark .empty{background:#252d38!important;color:#c8d0dc!important;}


/* ===== GG FINAL CLEAN THEME OVERRIDES ===== */
:root{
  --gg-blue:#24479b;
  --gg-blue2:#2d55bd;
  --gg-blue-dark:#19377f;
  --gg-gold:#d6aa3e;
  --gg-gold2:#e8c766;
  --gg-page:#f3f5f8;
  --gg-card:#ffffff;
  --gg-text:#061536;
  --gg-border:#d6deea;
  --gg-dark-page:#242b35;
  --gg-dark-card:#303842;
  --gg-dark-card2:#27303a;
  --gg-dark-top:#111820;
  --gg-dark-field:#222a34;
  --gg-dark-border:#5a6676;
  --gg-dark-text:#f4f7fb;
  --gg-dark-muted:#c5cfdd;
}

/* Evita qualquer marca d'água/ícone gigante nas telas internas. Login é exceção. */
body:not(.login-bg)::before,
body:not(.login-bg)::after{display:none!important;content:none!important;background:none!important;}

.brand-logo,.login-logo-mini{
  object-fit:contain!important;background:transparent!important;border:0!important;border-radius:0!important;padding:0!important;box-shadow:none!important;
}
.brand-logo{width:32px!important;height:32px!important;flex:0 0 32px!important;}
.login-logo-mini{width:20px!important;height:20px!important;margin-right:8px!important;vertical-align:middle!important;}
.brand span,#paginaAtualTopo{display:none!important;}
.brand strong{font-size:17px!important;line-height:1.05!important;color:#fff!important;}
.brand{gap:9px!important;}
.menu-icon{min-width:22px!important;text-align:center!important;}

/* Login: modo claro azul em degradê, modo escuro grafite/dourado. */
body.login-bg{min-height:100vh!important;display:grid!important;place-items:center!important;position:relative!important;overflow:hidden!important;}
body.login-bg.theme-light,
html[data-theme="claro"] body.login-bg{
  background:radial-gradient(circle at 15% 18%,rgba(255,255,255,.18) 0,rgba(255,255,255,.08) 16%,transparent 36%),radial-gradient(circle at 83% 76%,rgba(213,170,63,.24) 0,rgba(213,170,63,.11) 17%,transparent 38%),linear-gradient(135deg,#173781 0%,#0f2b69 48%,#092054 100%)!important;
}
body.login-bg.theme-dark,
html[data-theme="escuro"] body.login-bg{
  background:radial-gradient(circle at 16% 18%,rgba(213,170,63,.18) 0,rgba(213,170,63,.08) 13%,transparent 34%),radial-gradient(circle at 83% 78%,rgba(213,170,63,.20) 0,rgba(213,170,63,.10) 18%,transparent 39%),linear-gradient(135deg,#181818 0%,#071120 52%,#24231f 100%)!important;
}
body.login-bg:before,body.login-bg:after{content:""!important;display:block!important;position:fixed!important;background:url('/djen/assets/gustavo-g.png?v=gg-ui-20260617-fix2') center/contain no-repeat!important;pointer-events:none!important;z-index:0!important;opacity:.78!important;}
body.login-bg:before{width:170px!important;height:170px!important;left:70px!important;top:85px!important;}
body.login-bg:after{width:330px!important;height:330px!important;right:85px!important;bottom:75px!important;}
body.login-bg .login{position:relative!important;z-index:1!important;width:420px!important;background:#fff!important;color:#061536!important;border:1px solid #e1c16d!important;border-radius:12px!important;box-shadow:0 24px 80px rgba(0,0,0,.45)!important;padding:24px!important;}
body.login-bg .login h3,body.login-bg .login label,body.login-bg .login p,body.login-bg .login .sub{color:#061536!important;}
body.login-bg .login input{background:#fff!important;color:#061536!important;border:1px solid #cfd6e2!important;}
body.login-bg .login button:not(.theme-toggle-login){background:linear-gradient(180deg,#e8c766,#d6aa3e)!important;color:#090d14!important;border:1px solid #bd8c28!important;}
.theme-toggle-login{position:fixed!important;right:22px!important;top:18px!important;z-index:2!important;width:auto!important;background:linear-gradient(180deg,#e8c766,#d6aa3e)!important;color:#090d14!important;border:1px solid #bd8c28!important;border-radius:7px!important;padding:9px 14px!important;font-weight:700!important;}
body.login-bg .login h3 img.login-logo-mini + img.login-logo-mini{display:none!important;}

/* TEMA CLARO = azul clássico */
html[data-theme="claro"],body.theme-light{--bg:var(--gg-page);--border:var(--gg-border);--text:var(--gg-text);--muted:#667085;}
body.theme-light:not(.login-bg){background:var(--gg-page)!important;color:var(--gg-text)!important;}
body.theme-light .topbar{background:var(--gg-blue)!important;color:#fff!important;border-bottom:0!important;box-shadow:0 1px 3px rgba(0,0,0,.18)!important;}
body.theme-light .sidebar{background:#f3f4f6!important;border-right:1px solid #d4d8df!important;}
body.theme-light .content{background:var(--gg-page)!important;}
body.theme-light .card,body.theme-light .modal-content,body.theme-light .site-modal-card{background:#fff!important;color:#061536!important;border:1px solid var(--gg-border)!important;box-shadow:0 1px 2px rgba(16,24,40,.04)!important;}
body.theme-light h1,body.theme-light h2,body.theme-light h3,body.theme-light h4{color:#09358d!important;}
body.theme-light label{color:#344054!important;}
body.theme-light .sub,body.theme-light .small{color:#667085!important;}
body.theme-light input,body.theme-light select,body.theme-light textarea{background:#fff!important;color:#061536!important;border:1px solid #cfd6e2!important;}
body.theme-light button,body.theme-light a.button,body.theme-light .smallbtn{background:var(--gg-blue2)!important;color:#fff!important;border:1px solid var(--gg-blue2)!important;box-shadow:none!important;}
body.theme-light button.secondary,body.theme-light a.button.secondary,body.theme-light .filter-btn:not(.active),body.theme-light .sidebar-toggle{background:#fff!important;color:var(--gg-blue)!important;border:1px solid #cfd6e2!important;}
body.theme-light .filter-btn.active,body.theme-light .sidebar a.active,body.theme-light .sidebar a:hover{background:var(--gg-blue)!important;color:#fff!important;}
body.theme-light .sidebar a,body.theme-light .sidebar .item{color:#1f2937!important;background:transparent!important;border:0!important;}
body.theme-light .top-actions a,body.theme-light .top-actions button{background:transparent!important;color:#fff!important;border:0!important;}
body.theme-light #btnTemaTopo,body.theme-light .top-actions button:last-child{background:#fff!important;color:var(--gg-blue)!important;border:1px solid #cfd6e2!important;border-radius:7px!important;}
body.theme-light th,body.theme-light thead th,body.theme-light .table-wrap table th{background:var(--gg-blue)!important;color:#fff!important;border-bottom:0!important;box-shadow:none!important;border-radius:0!important;}
body.theme-light th *,body.theme-light thead th *{color:#fff!important;background:transparent!important;border:0!important;box-shadow:none!important;}
body.theme-light table,body.theme-light .table-wrap{background:#fff!important;color:#061536!important;}
body.theme-light td,body.theme-light tbody td{color:#061536!important;border-bottom:1px solid #edf0f5!important;}
body.theme-light tbody tr:hover{background:#eef4ff!important;}
body.theme-light .badge.blue,body.theme-light .trib{background:#e8f0ff!important;color:#0036ad!important;border:0!important;}
body.theme-light .bar>div{background:#3b82f6!important;}
body.theme-light .cliente-contrato-card{background:#fff!important;border:1px solid #dbe5f3!important;color:#061536!important;}
body.theme-light .cliente-contrato-card *{color:#061536!important;}

/* TEMA ESCURO = grafite/dourado, sem blocos brancos */
html[data-theme="escuro"],body.theme-dark{--bg:var(--gg-dark-page);--border:var(--gg-dark-border);--text:var(--gg-dark-text);--muted:var(--gg-dark-muted);}
body.theme-dark:not(.login-bg){background:var(--gg-dark-page)!important;color:var(--gg-dark-text)!important;}
body.theme-dark .topbar{background:var(--gg-dark-top)!important;border-bottom:1px solid rgba(214,170,62,.55)!important;box-shadow:0 2px 18px rgba(0,0,0,.25)!important;color:#fff!important;}
body.theme-dark .sidebar{background:#262d36!important;border-right:1px solid #465263!important;}
body.theme-dark .content{background:var(--gg-dark-page)!important;}
body.theme-dark .card,body.theme-dark .modal-content,body.theme-dark .site-modal-card,body.theme-dark .djen-popup-content,body.theme-dark .placeholder-box,body.theme-dark .grupo-processo-cliente,body.theme-dark .grupo-processo-head{background:var(--gg-dark-card)!important;color:var(--gg-dark-text)!important;border:1px solid var(--gg-dark-border)!important;box-shadow:0 10px 35px rgba(0,0,0,.18)!important;}
body.theme-dark .grupo-processo-head{background:var(--gg-dark-card2)!important;}
body.theme-dark h1,body.theme-dark h2,body.theme-dark h3,body.theme-dark h4,body.theme-dark label{color:#fff!important;}
body.theme-dark .sub,body.theme-dark .small{color:var(--gg-dark-muted)!important;}
body.theme-dark p,body.theme-dark b,body.theme-dark strong,body.theme-dark span,body.theme-dark div{color:inherit;}
body.theme-dark input,body.theme-dark select,body.theme-dark textarea{background:var(--gg-dark-field)!important;color:#fff!important;border:1px solid #6b7788!important;box-shadow:none!important;}
body.theme-dark input::placeholder,body.theme-dark textarea::placeholder{color:#b7c0ce!important;opacity:1!important;}
body.theme-dark button,body.theme-dark a.button,body.theme-dark .smallbtn{background:linear-gradient(180deg,var(--gg-gold2),var(--gg-gold))!important;color:#090d14!important;border:1px solid #bd8c28!important;box-shadow:0 2px 8px rgba(0,0,0,.18)!important;}
body.theme-dark button.secondary,body.theme-dark a.button.secondary,body.theme-dark .filter-btn:not(.active){background:#2a333f!important;color:#f7f9fc!important;border:1px solid #687789!important;box-shadow:none!important;}
body.theme-dark .filter-btn.active{background:linear-gradient(180deg,var(--gg-gold2),var(--gg-gold))!important;color:#090d14!important;border-color:#bd8c28!important;}
body.theme-dark .top-actions a,body.theme-dark .top-actions button{background:transparent!important;color:#fff!important;border:0!important;box-shadow:none!important;}
body.theme-dark .top-actions a.active{color:var(--gg-gold2)!important;background:transparent!important;}
body.theme-dark #btnTemaTopo,body.theme-dark .top-actions button:last-child{background:linear-gradient(180deg,var(--gg-gold2),var(--gg-gold))!important;color:#090d14!important;border:1px solid #bd8c28!important;border-radius:7px!important;}
body.theme-dark .sidebar-toggle{background:linear-gradient(180deg,var(--gg-gold2),var(--gg-gold))!important;color:#090d14!important;border-color:#bd8c28!important;}
body.theme-dark .sidebar a,body.theme-dark .sidebar .item{color:#f7f9fc!important;background:transparent!important;border:1px solid transparent!important;}
body.theme-dark .sidebar a.active,body.theme-dark .sidebar a:hover{background:#303944!important;color:#fff!important;border-color:rgba(214,170,62,.60)!important;box-shadow:none!important;}
body.theme-dark .brand,body.theme-dark .brand strong{color:#fff!important;}
body.theme-dark .summary-card{background:#28313d!important;color:#f7f9fc!important;border-color:#5d697a!important;}
body.theme-dark .summary-card.red{background:#3b2c31!important;border-color:#ef4444!important;color:#ffb4b4!important;}
body.theme-dark .summary-card.yellow{background:#3a3526!important;border-color:#d6aa3e!important;color:#f6d98b!important;}
body.theme-dark .summary-card.green{background:#25382f!important;border-color:#22c55e!important;color:#b9f6ce!important;}
body.theme-dark .metric-row,body.theme-dark .bar{color:#fff!important;}
body.theme-dark .bar{background:#434d5c!important;} body.theme-dark .bar>div{background:linear-gradient(90deg,#d6aa3e,#e8c766)!important;}
body.theme-dark .trib,body.theme-dark .badge.blue{background:#313a46!important;color:#f6d98b!important;border:1px solid rgba(214,170,62,.55)!important;}
body.theme-dark .badge,body.theme-dark .badge.status-pendente{background:#2a333f!important;color:#fff!important;border:1px solid #687789!important;}
body.theme-dark .badge.red{background:#4a272a!important;color:#ffb4b4!important;border-color:#ef4444!important;}
body.theme-dark .badge.yellow{background:#443822!important;color:#ffe49b!important;border-color:#d6aa3e!important;}
body.theme-dark .badge.green{background:#1f3a2a!important;color:#bcf7d0!important;border-color:#22c55e!important;}
body.theme-dark .badge.purple{background:#392f4f!important;color:#e9d5ff!important;border:1px solid #8b5cf6!important;}
body.theme-dark .info-box,body.theme-dark .teor,body.theme-dark .partes-box,body.theme-dark .empty,body.theme-dark .loading-box,body.theme-dark .stat-card,body.theme-dark .preview-mini,body.theme-dark .preview-item,body.theme-dark .ec-stat,body.theme-dark .ec-table-wrap{background:#252d38!important;color:#f7f9fc!important;border:1px solid #536173!important;}
body.theme-dark .info-box span,body.theme-dark .teor,body.theme-dark .teor *,body.theme-dark .partes-box *,body.theme-dark .stat-card *,body.theme-dark .ec-stat *,body.theme-dark .empty *{color:#f7f9fc!important;}
body.theme-dark .table-wrap{background:var(--gg-dark-card)!important;border:1px solid var(--gg-dark-border)!important;}
body.theme-dark table{background:var(--gg-dark-card)!important;color:#fff!important;}
body.theme-dark th,body.theme-dark thead th,body.theme-dark .table-wrap table th{background:#111821!important;color:#f6d98b!important;border-bottom:3px solid var(--gg-gold)!important;padding:11px 12px!important;box-shadow:none!important;border-radius:0!important;}
body.theme-dark th *,body.theme-dark thead th *{color:#f6d98b!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;border-radius:0!important;}
body.theme-dark .th-sort,body.theme-dark th.th-sort{background:#111821!important;color:#f6d98b!important;border-radius:0!important;display:table-cell!important;}
body.theme-dark td,body.theme-dark tbody td{color:#f7f9fc!important;border-bottom:1px solid #424c5a!important;}
body.theme-dark tbody tr:hover{background:#35404d!important;}
body.theme-dark tr.row-urgent{background:#463033!important;} body.theme-dark tr.row-atencao{background:#3d3828!important;}
body.theme-dark .cliente-nome-cell,body.theme-dark #lista .cliente-nome-cell,body.theme-dark .col-cliente b,body.theme-dark tbody td a,body.theme-dark .link-btn{color:#fff!important;}
body.theme-dark .linkish{color:#f6d98b!important;}
body.theme-dark .filter-search{background:#252c36!important;color:#fff!important;border:2px solid var(--gg-gold)!important;}
body.theme-dark #selecionadosInfo,body.theme-dark .selected-bar,body.theme-dark .selection-bar,body.theme-dark [id*="selecionado"],body.theme-dark [class*="selecionado"]{background:#252d38!important;color:#f7f9fc!important;border-color:#536173!important;}
body.theme-dark #selecionadosInfo *,body.theme-dark .selected-bar *,body.theme-dark .selection-bar *{color:#f7f9fc!important;}
body.theme-dark .cliente-contrato-card,body.theme-dark .contrato-card,body.theme-dark .contrato-row{background:#2f3640!important;border:1px solid #536173!important;color:#f7f9fc!important;}
body.theme-dark .cliente-contrato-card *,body.theme-dark .contrato-card *,body.theme-dark .contrato-row *{color:#f7f9fc!important;}
body.theme-dark .contratos-clientes-lista .badge{color:#f6d98b!important;background:#3a3320!important;}
body.theme-dark .modal-close{background:transparent!important;color:#d5dde8!important;border:0!important;box-shadow:none!important;}
body.theme-dark .ok{color:#21d07a!important;} body.theme-dark .alert{color:#ff9a9a!important;}

/* Corrige badges/contadores de Clientes: bolinha maior e texto legível */
#listaClientes .badge,.clientes-table .badge,.badge-count{min-width:28px!important;min-height:24px!important;padding:5px 9px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;font-weight:700!important;line-height:1.1!important;}
body.theme-dark #listaClientes .badge,body.theme-dark .clientes-table .badge{color:#fff!important;}
body.theme-light #listaClientes .badge,body.theme-light .clientes-table .badge{color:#061536!important;}

/* Publicações: urgência/status legíveis no escuro */
body.theme-dark .badge.red,body.theme-dark .row-urgent .badge.red{background:#ffe4e6!important;color:#b91c1c!important;border-color:#fb7185!important;}
body.theme-dark .badge.status-pendente,body.theme-dark .status-pendente{background:#f8fafc!important;color:#1f2937!important;border:1px solid #cbd5e1!important;}
body.theme-dark .badge.status-delegado,body.theme-dark .status-delegado{background:#ede9fe!important;color:#5b21b6!important;border:1px solid #c4b5fd!important;}
body.theme-dark .badge.status-cumprido,body.theme-dark .status-cumprido{background:#dcfce7!important;color:#166534!important;border:1px solid #86efac!important;}

/* Contratos: no tema escuro, cards não podem ficar brancos com texto invisível */
body.theme-dark .contratos-clientes-lista > div,body.theme-dark #listaContratos > div,body.theme-dark .contrato-cliente-row{background:#303842!important;color:#f7f9fc!important;border:1px solid #536173!important;border-radius:10px!important;}
body.theme-dark .contratos-clientes-lista > div *,body.theme-dark #listaContratos > div *,body.theme-dark .contrato-cliente-row *{color:#f7f9fc!important;}
body.theme-dark .contratos-clientes-lista button,body.theme-dark #listaContratos button{color:#090d14!important;}

/* Logs centralizados e com conteúdo visível */
main.content .logs-page,.logs-page{max-width:1500px!important;margin:0 auto!important;width:100%!important;min-width:0!important;padding:0!important;}
.logs-page .card{max-width:1500px!important;margin-left:auto!important;margin-right:auto!important;}
.logs-table-wrap{width:100%!important;overflow-x:auto!important;}
body.theme-dark .logs-table-wrap{background:var(--gg-dark-card)!important;}

/* Estados/Cidades inline antigo */
body.theme-dark .ec-stat,body.theme-dark .ec-table-wrap,body.theme-dark #listaMunicipios .empty,body.theme-dark #listaForuns .empty,body.theme-dark #resultadoCep,body.theme-dark #resultadoCepRua{background:#252d38!important;color:#f7f9fc!important;border-color:#536173!important;}
body.theme-dark .ec-stat b,body.theme-dark .ec-stat span,body.theme-dark .ec-muted{color:#f7f9fc!important;}
body.theme-dark .ec-table th{background:#111821!important;color:#f6d98b!important;border-bottom:3px solid var(--gg-gold)!important;}
body.theme-dark .ec-table tr:nth-child(even){background:#2c3540!important;}
body.theme-dark .ec-table td{color:#f7f9fc!important;border-bottom:1px solid #424c5a!important;}
body.theme-light .ec-stat{background:#f8fbff!important;color:#061536!important;border-color:#cdd8ef!important;}
body.theme-light .ec-stat b{color:#003b8f!important;}

/* Remove chips quebrados dentro de TH */
thead th, .table-wrap thead th{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
th button,th .th-sort{max-width:100%!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;}

/* Ajustes 20260617 v3 */
.brand-logo,.login-logo-mini{background:transparent!important;border-radius:0!important;padding:0!important;mix-blend-mode:normal!important;}
body.theme-light .brand-logo,body.theme-dark .brand-logo{background:transparent!important;border-radius:0!important;padding:0!important;}
.barra-lote-publicacoes{background:#252d38!important;color:#f7f9fc!important;border-color:#536173!important;}
.barra-lote-publicacoes *{color:#f7f9fc!important;}
.barra-lote-publicacoes button:disabled{cursor:default!important;}


/* ===== Correções finais DJEN 2026-06-17 v4 ===== */
body.theme-dark .barra-lote-publicacoes,
body.theme-dark .barra-lote-publicacoes[style],
body.theme-dark div.barra-lote-publicacoes{
  background:#252d38!important;
  color:#f7f9fc!important;
  border:1px solid #536173!important;
  box-shadow:none!important;
}
body.theme-dark .barra-lote-publicacoes *,
body.theme-dark #qtdSelecionadosPublicacoes{
  color:#f7f9fc!important;
}
body.theme-dark #btnCumprirSelecionadosPublicacoes:disabled{
  cursor:default!important;
  pointer-events:none!important;
  opacity:.70!important;
}
body.theme-dark .cliente-modal-titulo,
body.theme-dark .cliente-modal-titulo.sem-cliente{
  background:#252c36!important;
  color:#f7f9fc!important;
  border:1px solid #667386!important;
}
body.theme-dark .cliente-controle-card,
body.theme-dark #modalPublicacaoClienteDetalhe .cliente-controle-card,
body.theme-dark .bilhetes-processo-box,
body.theme-dark .bilhete-processo-card,
body.theme-dark .bilhete-processo-texto,
body.theme-dark .bilhete-card,
body.theme-dark .bilhete-texto,
body.theme-dark .bilhete-editor-inline,
body.theme-dark .modal-bilhetes-box,
body.theme-dark .partes-box,
body.theme-dark #contratosClienteBox{
  background:#252c36!important;
  color:#f7f9fc!important;
  border-color:#536173!important;
}
body.theme-dark .modal-bilhetes-body{background:#252c36!important;color:#f7f9fc!important;}
body.theme-dark .modal-bilhetes-head{background:#111821!important;color:#f7f9fc!important;border-bottom:1px solid #536173!important;}
body.theme-dark .modal-bilhetes-head button{background:#2f3845!important;color:#f7f9fc!important;border:1px solid #536173!important;}
body.theme-dark .info-box,
body.theme-dark .teor,
body.theme-dark .resumo-box,
body.theme-dark .modal-content .small-card{
  background:#252c36!important;
  color:#f7f9fc!important;
  border-color:#536173!important;
}
body.theme-dark .brand img,
body.theme-dark .brand .brand-logo,
body.theme-dark .brand .logo,
body.theme-dark img[src*="gustavo-g"]{
  background:transparent!important;
  box-shadow:none!important;
  border:0!important;
}
#extrasGeradora .sub{display:block!important;margin-top:10px!important;line-height:1.35!important;clear:both!important;}


/* ===== Correções DJEN v5 ===== */
.barra-lote-publicacoes,
body.theme-dark .barra-lote-publicacoes,
html[data-theme="escuro"] .barra-lote-publicacoes,
.barra-lote-publicacoes[style]{
  background:#252d38!important;
  color:#f7f9fc!important;
  border:1px solid #536173!important;
  box-shadow:none!important;
}
.barra-lote-publicacoes *, .barra-lote-publicacoes span, #qtdSelecionadosPublicacoes{color:#f7f9fc!important;}
#btnCumprirSelecionadosPublicacoes:disabled{cursor:default!important;pointer-events:none!important;opacity:.70!important;}
.brand-logo,.login-logo-mini,.brand img,img[src*="gustavo-g"]{background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;padding:0!important;}
body.theme-dark table th, html[data-theme="escuro"] table th{color:#f7f9fc!important;}
body.theme-dark table th.col-cliente, html[data-theme="escuro"] table th.col-cliente{color:#f7f9fc!important;}
body.theme-dark .cliente-controle-card,
html[data-theme="escuro"] .cliente-controle-card,
body.theme-dark #boxDelegacoesControle,
html[data-theme="escuro"] #boxDelegacoesControle,
body.theme-dark .bilhetes-processo-box,
html[data-theme="escuro"] .bilhetes-processo-box,
body.theme-dark .bilhete-processo-card,
html[data-theme="escuro"] .bilhete-processo-card,
body.theme-dark .bilhete-processo-texto,
html[data-theme="escuro"] .bilhete-processo-texto,
body.theme-dark .bilhete-card,
html[data-theme="escuro"] .bilhete-card,
body.theme-dark .bilhete-texto,
html[data-theme="escuro"] .bilhete-texto,
body.theme-dark .bilhete-editor-inline,
html[data-theme="escuro"] .bilhete-editor-inline,
body.theme-dark .partes-box,
html[data-theme="escuro"] .partes-box,
body.theme-dark .modal-content .small-card,
html[data-theme="escuro"] .modal-content .small-card,
body.theme-dark .resumo-box,
html[data-theme="escuro"] .resumo-box,
body.theme-dark .teor,
html[data-theme="escuro"] .teor{
  background:#252c36!important;
  color:#f7f9fc!important;
  border-color:#536173!important;
}
body.theme-dark #boxDelegacoesControle *, html[data-theme="escuro"] #boxDelegacoesControle *{color:#f7f9fc!important;}
#extrasGeradora .sub{display:block!important;margin-top:14px!important;line-height:1.45!important;clear:both!important;position:relative!important;z-index:1!important;}
.extraGeradora[data-campo="valor_cobrado_seguro"], .extraGeradora[data-campo="valor_cobrado_tarifa"]{display:none!important;}
label:has(+ .extraGeradora[data-campo="valor_cobrado_seguro"]), label:has(+ .extraGeradora[data-campo="valor_cobrado_tarifa"]){display:none!important;}

/* Correções MySQL v26: bilhete no tema escuro legível */
body.theme-dark .proc-com-bilhete a,
html[data-theme="escuro"] .proc-com-bilhete a,
body.theme-dark .col-proc.proc-com-bilhete a,
html[data-theme="escuro"] .col-proc.proc-com-bilhete a{
  color:#ffffff!important;
  background:transparent!important;
  text-shadow:none!important;
}
body.theme-dark .proc-com-bilhete,
html[data-theme="escuro"] .proc-com-bilhete,
body.theme-dark .col-proc.proc-com-bilhete,
html[data-theme="escuro"] .col-proc.proc-com-bilhete{
  background:#4b2f2f!important;
  color:#ffffff!important;
}
body.theme-dark .btn-bilhete-mini,
html[data-theme="escuro"] .btn-bilhete-mini{
  color:#111827!important;
  background:#e4b84b!important;
  border-color:#f0c85d!important;
}

/* Correções MySQL v26: bilhete no tema escuro legível */
body.theme-dark .proc-com-bilhete a,
html[data-theme="escuro"] .proc-com-bilhete a,
body.theme-dark .col-proc.proc-com-bilhete a,
html[data-theme="escuro"] .col-proc.proc-com-bilhete a{
  color:#ffffff!important;
  background:transparent!important;
  text-shadow:none!important;
}
body.theme-dark .proc-com-bilhete,
html[data-theme="escuro"] .proc-com-bilhete,
body.theme-dark .col-proc.proc-com-bilhete,
html[data-theme="escuro"] .col-proc.proc-com-bilhete{
  background:#4b2f2f!important;
  color:#ffffff!important;
}
body.theme-dark .btn-bilhete-mini,
html[data-theme="escuro"] .btn-bilhete-mini{
  color:#111827!important;
  background:#e4b84b!important;
  border-color:#f0c85d!important;
}


/* Correção modo claro */
body:not(.dark-mode) .acoes-lote,
body:not(.dark-mode) .selecao-bar,
body:not(.dark-mode) .bulk-actions{
 background:#fff !important;
 color:#222 !important;
 border:1px solid #ddd !important;
}


/* Correção definitiva - modo claro ações em lote Publicações */
body.theme-light .barra-lote-publicacoes,
html[data-theme="claro"] .barra-lote-publicacoes,
body:not(.theme-dark) .barra-lote-publicacoes{
  background:#ffffff !important;
  color:#111827 !important;
  border:1px solid #d7dde7 !important;
  box-shadow:0 1px 2px rgba(15,23,42,.06) !important;
}
body.theme-light .barra-lote-publicacoes *,
html[data-theme="claro"] .barra-lote-publicacoes *,
body:not(.theme-dark) .barra-lote-publicacoes *{
  color:#111827 !important;
}
body.theme-light .barra-lote-publicacoes button,
html[data-theme="claro"] .barra-lote-publicacoes button,
body:not(.theme-dark) .barra-lote-publicacoes button{
  background:#ffffff !important;
  color:#0f2f6b !important;
  border:1px solid #cfd6e2 !important;
}
body.theme-light #qtdSelecionadosPublicacoes,
html[data-theme="claro"] #qtdSelecionadosPublicacoes,
body:not(.theme-dark) #qtdSelecionadosPublicacoes{
  color:#111827 !important;
}
body.theme-dark .barra-lote-publicacoes,
html[data-theme="escuro"] .barra-lote-publicacoes{
  background:#252d38 !important;
  color:#f7f9fc !important;
  border-color:#536173 !important;
}
body.theme-dark .barra-lote-publicacoes *,
html[data-theme="escuro"] .barra-lote-publicacoes *{
  color:#f7f9fc !important;
}


/* V33 - modo claro: barra de ações em lote das Publicações sempre branca */
body:not(.theme-dark) .barra-lote-publicacoes,
body.theme-light .barra-lote-publicacoes,
html[data-theme="claro"] .barra-lote-publicacoes{
  background:#ffffff!important;
  color:#111827!important;
  border:1px solid #d7dde7!important;
  box-shadow:0 1px 2px rgba(15,23,42,.06)!important;
}
body:not(.theme-dark) .barra-lote-publicacoes *,
body.theme-light .barra-lote-publicacoes *,
html[data-theme="claro"] .barra-lote-publicacoes *{
  color:#111827!important;
}
body:not(.theme-dark) .barra-lote-publicacoes button,
body.theme-light .barra-lote-publicacoes button,
html[data-theme="claro"] .barra-lote-publicacoes button{
  background:#ffffff!important;
  color:#0f2f6b!important;
  border:1px solid #cfd6e2!important;
}

/* Correção modo claro - barra de cumprir publicações */
body.theme-light .barra-lote-publicacoes, html[data-theme="claro"] .barra-lote-publicacoes{
  background:#ffffff !important;
  color:#111827 !important;
  border:1px solid #d0d7de !important;
}
body.theme-light .barra-lote-publicacoes *, html[data-theme="claro"] .barra-lote-publicacoes *{color:#111827 !important;}
body.theme-light .barra-lote-publicacoes button.secondary, html[data-theme="claro"] .barra-lote-publicacoes button.secondary{
  background:#ffffff !important;
  color:#0f172a !important;
  border-color:#cbd5e1 !important;
}


/* Filtro de tribunais da aba Publicações: legível no claro e no escuro */
body.theme-light{
  --gg-filter-bg:#ffffff;
  --gg-filter-text:#061536;
  --gg-filter-border:#cfd6e2;
}
body.theme-dark{
  --gg-filter-bg:#252d38;
  --gg-filter-text:#f4f7fb;
  --gg-filter-border:#526071;
}
body.theme-dark #boxFiltroTribunais,
html[data-theme="escuro"] #boxFiltroTribunais{
  background:#252d38!important;
  color:#f4f7fb!important;
  border-color:#526071!important;
  box-shadow:0 10px 24px rgba(0,0,0,.45)!important;
}
body.theme-dark #boxFiltroTribunais label,
html[data-theme="escuro"] #boxFiltroTribunais label{
  color:#f4f7fb!important;
}
body.theme-light #boxFiltroTribunais,
html[data-theme="claro"] #boxFiltroTribunais{
  background:#ffffff!important;
  color:#061536!important;
  border-color:#cfd6e2!important;
}


/* V42 - filtro de tribunais legível no modo escuro */
body.theme-dark #boxFiltroTribunais button,
html[data-theme="escuro"] #boxFiltroTribunais button{
  background:#313a46!important;
  color:#f7f9fc!important;
  border:1px solid #687789!important;
}
body.theme-dark #boxFiltroTribunais input[type="checkbox"],
html[data-theme="escuro"] #boxFiltroTribunais input[type="checkbox"]{
  accent-color:#d5aa3f!important;
}
body.theme-light #boxFiltroTribunais button,
html[data-theme="claro"] #boxFiltroTribunais button{
  background:#ffffff!important;
  color:#0f172a!important;
  border:1px solid #cbd5e1!important;
}

/* Destaque para opção importante da Geradora */
.geradora-word-cliente-box{display:flex;align-items:center;gap:10px;margin:14px 0;padding:12px 14px;border:2px solid #d4a92f;border-radius:10px;background:rgba(212,169,47,.12);font-weight:800;box-shadow:0 6px 18px rgba(0,0,0,.08)}
.geradora-word-cliente-box input{width:18px;height:18px;accent-color:#d4a92f}.geradora-word-cliente-box span{letter-spacing:.2px}
body.theme-dark .geradora-word-cliente-box{background:rgba(231,184,61,.16);border-color:#e7b83d;color:#f7e6af}


/* Contratos - cabeçalho e paginação reorganizados */
.contratos-hero-card{
  padding:18px!important;
  overflow:hidden;
}
.contratos-hero{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  padding:6px 2px 16px 2px;
  border-bottom:1px solid rgba(148,163,184,.30);
}
.contratos-hero-title{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}
.contratos-hero-icon{
  width:46px;
  height:46px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg,#f4cf6b,#d5aa3f);
  color:#14110a;
  box-shadow:0 10px 24px rgba(213,170,63,.20);
  font-size:23px;
  flex:0 0 auto;
}
.contratos-hero h3{
  margin:0;
  font-size:22px;
  line-height:1.15;
}
.contratos-hero p{
  margin:4px 0 0 0;
  color:var(--muted);
  font-size:13px;
}
.contratos-hero-actions{
  display:flex;
  justify-content:flex-end;
  flex:0 0 auto;
}
.contratos-primary-btn{
  min-width:230px;
  height:42px;
  border-radius:10px!important;
  font-weight:800!important;
}
.contratos-toolbar{
  display:grid;
  grid-template-columns:minmax(320px,1fr) minmax(260px,.45fr);
  gap:14px;
  align-items:end;
  padding-top:14px;
}
.contratos-search-wrap label{
  display:block;
  margin-bottom:6px;
}
.contratos-search-box{
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--border);
  border-radius:10px;
  padding:0 12px;
  background:#fff;
  min-height:42px;
}
.contratos-search-box input{
  border:0!important;
  box-shadow:none!important;
  outline:0!important;
  width:100%;
  padding-left:0!important;
  background:transparent!important;
}
.contratos-info-panel{
  min-height:42px;
  border:1px solid rgba(148,163,184,.32);
  border-radius:10px;
  padding:9px 12px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;
  background:rgba(148,163,184,.08);
  font-size:12px;
}
.contratos-status{
  margin:0!important;
  font-weight:800;
}
.contratos-list-card{
  padding:14px!important;
}
.contratos-list-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
  padding:12px;
  margin-bottom:12px;
  border:1px solid rgba(148,163,184,.34);
  border-radius:12px;
  background:linear-gradient(180deg,rgba(255,255,255,.72),rgba(248,250,252,.94));
}
.contratos-list-summary{
  display:flex;
  align-items:baseline;
  gap:6px;
  flex-wrap:wrap;
  min-width:250px;
}
.contratos-list-summary .contratos-list-kicker{
  width:100%;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--muted);
  font-weight:800;
}
.contratos-list-summary strong{
  font-size:22px;
  line-height:1;
}
.contratos-list-summary em{
  font-style:normal;
  color:var(--muted);
  font-size:12px;
}
.contratos-page-controls{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
.contratos-page-indicator{
  display:inline-flex;
  align-items:center;
  gap:4px;
  min-height:34px;
  padding:0 10px;
  border-radius:9px;
  border:1px solid rgba(148,163,184,.35);
  background:#fff;
  font-size:12px;
  white-space:nowrap;
}
.contratos-per-page{
  display:flex!important;
  align-items:center;
  gap:6px;
  margin:0!important;
  font-size:12px;
  white-space:nowrap;
}
.contratos-per-page select{
  min-width:82px;
  height:34px;
  padding:5px 8px!important;
}
body.theme-dark .contratos-hero p{color:var(--gg-dark-muted)!important;}
body.theme-dark .contratos-search-box{
  background:#252d38!important;
  border-color:#6b7788!important;
}
body.theme-dark .contratos-info-panel{
  background:#252d38!important;
  border-color:#536173!important;
  color:#dce5f1!important;
}
body.theme-dark .contratos-list-head{
  background:linear-gradient(180deg,#252d38,#202832)!important;
  border-color:#536173!important;
  color:#f7f9fc!important;
}
body.theme-dark .contratos-list-summary .contratos-list-kicker,
body.theme-dark .contratos-list-summary em{color:#b8c4d4!important;}
body.theme-dark .contratos-page-indicator{
  background:#2a333f!important;
  border-color:#687789!important;
  color:#f7f9fc!important;
}

.drive-search-line{
  display:grid;
  grid-template-columns:minmax(0,1fr) 190px;
  gap:8px;
  align-items:center;
}
.drive-index-status{
  border:1px solid var(--border);
  border-radius:8px;
  padding:10px 12px;
  line-height:1.4;
  overflow-wrap:anywhere;
}
.drive-index-status.ready{
  background:#ecfdf3;
  border-color:#86efac;
  color:#166534;
}
.drive-index-status.running{
  background:#eff6ff;
  border-color:#93c5fd;
  color:#1e3a8a;
}
.drive-index-status.warning{
  background:#fffbeb;
  border-color:#fcd34d;
  color:#854d0e;
}
/* Pastas: no tema escuro o cartão é dourado e precisa de texto escuro. */
body.theme-dark button.drive-folder-main,
html[data-theme="escuro"] button.drive-folder-main{
  color:#111827!important;
}
body.theme-dark button.drive-folder-main b,
html[data-theme="escuro"] button.drive-folder-main b{
  color:#111827!important;
}
body.theme-dark button.drive-folder-main .small,
html[data-theme="escuro"] button.drive-folder-main .small{
  color:#374151!important;
}
/* No tema claro o cartão é azul e fica mais legível com letras claras. */
body.theme-light button.drive-folder-main,
html[data-theme="claro"] button.drive-folder-main{
  color:#ffffff!important;
}
body.theme-light button.drive-folder-main b,
html[data-theme="claro"] button.drive-folder-main b{
  color:#ffffff!important;
}
body.theme-light button.drive-folder-main .small,
html[data-theme="claro"] button.drive-folder-main .small{
  color:#dbeafe!important;
}
body.theme-dark .drive-index-status.ready,
html[data-theme="escuro"] .drive-index-status.ready{
  background:#173728!important;
  border-color:#3f7d5b!important;
  color:#d1fae5!important;
}
body.theme-dark .drive-index-status.running,
html[data-theme="escuro"] .drive-index-status.running{
  background:#1e304d!important;
  border-color:#486d9b!important;
  color:#dbeafe!important;
}
body.theme-dark .drive-index-status.warning,
html[data-theme="escuro"] .drive-index-status.warning{
  background:#443716!important;
  border-color:#8f742d!important;
  color:#fde68a!important;
}

@media (max-width:900px){
  .contratos-hero{align-items:flex-start;flex-direction:column;}
  .contratos-hero-actions,.contratos-primary-btn{width:100%;}
  .contratos-toolbar{grid-template-columns:1fr;}
  .contratos-page-controls{justify-content:flex-start;}
}

/* Ajustes DJEN 2026-06-24 v65: Contratos mais limpo */
.contratos-hero-card-v65{padding:16px!important;border-radius:14px!important;}
.contratos-hero-v65{padding:0 0 14px 0!important;}
.contratos-hero-v65 .contratos-hero-actions{gap:10px;align-items:center;flex-wrap:wrap;}
.contratos-status-pill{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:7px 11px;border-radius:999px;border:1px solid rgba(148,163,184,.35);background:rgba(148,163,184,.10);font-size:12px;font-weight:800;white-space:nowrap;}
.contratos-status-pill.ok{border-color:rgba(34,197,94,.35);background:rgba(34,197,94,.10);color:#047857;}
.contratos-status-pill.alert{border-color:rgba(239,68,68,.45);background:rgba(239,68,68,.10);color:#b91c1c;}
.contratos-status-pill.carregando{color:var(--muted);}
.contratos-filter-panel{display:grid;grid-template-columns:minmax(150px,190px) minmax(320px,1fr) minmax(150px,190px);gap:12px;align-items:end;padding-top:14px;}
.contratos-filter-field label{display:block;margin:0 0 6px 0;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.035em;color:var(--muted);}
.contratos-filter-field select,.contratos-filter-field input{height:42px;border-radius:10px!important;}
.contratos-filter-search .contratos-search-box{height:42px;min-height:42px;}
.contratos-list-head-v65{padding:10px 12px!important;margin-bottom:10px!important;background:rgba(148,163,184,.08)!important;}
.contratos-count-chip{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:240px;}
.contratos-count-chip b{font-size:20px;line-height:1;}
.contratos-count-chip span{font-weight:800;}
.contratos-count-chip em{font-style:normal;color:var(--muted);font-size:12px;}
.contrato-row-card{border:1px solid #dbe5f3;border-radius:11px;background:#fff;margin:8px 0;padding:11px 12px;cursor:pointer;transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease;}
.contrato-row-card:hover{transform:translateY(-1px);box-shadow:0 8px 22px rgba(15,23,42,.08);border-color:#d5aa3f;}
.contrato-row-main{display:grid;grid-template-columns:minmax(260px,1fr) minmax(260px,.9fr) auto;gap:12px;align-items:center;}
.contrato-row-cliente b{display:block;line-height:1.2;}
.contrato-row-badges{display:flex;justify-content:center;gap:6px;flex-wrap:wrap;}
.contrato-row-badges .badge{margin-left:0!important;}
.contrato-row-open{white-space:nowrap;justify-self:end;}
body.theme-dark .contratos-status-pill{background:#252d38!important;border-color:#536173!important;color:#dce5f1!important;}
body.theme-dark .contratos-status-pill.ok{border-color:rgba(34,197,94,.45)!important;background:rgba(34,197,94,.14)!important;color:#b9f6ce!important;}
body.theme-dark .contratos-status-pill.alert{border-color:rgba(239,68,68,.55)!important;background:rgba(239,68,68,.14)!important;color:#ffc0c0!important;}
body.theme-dark .contratos-filter-field label{color:#c8d0dc!important;}
body.theme-dark .contrato-row-card{background:#2f3640!important;border-color:#536173!important;color:#f7f9fc!important;}
body.theme-dark .contrato-row-card:hover{border-color:#e7b83d!important;box-shadow:0 8px 22px rgba(0,0,0,.22)!important;}
body.theme-dark .contratos-list-head-v65{background:#252d38!important;border-color:#536173!important;}
@media (max-width:980px){.contratos-filter-panel{grid-template-columns:1fr}.contrato-row-main{grid-template-columns:1fr}.contrato-row-badges{justify-content:flex-start}.contrato-row-open{justify-self:start;width:100%;}}

/* Ajustes DJEN 2026-06-24 v66: Contratos cabeçalho/lista e busca sem campo duplicado */
.contratos-filter-panel{
  grid-template-columns:minmax(145px,180px) minmax(360px,1fr) minmax(145px,180px)!important;
  gap:10px!important;
  align-items:end!important;
}
.contratos-search-input{
  width:100%!important;
  height:42px!important;
  min-height:42px!important;
  border-radius:10px!important;
  padding:0 14px 0 38px!important;
  box-shadow:none!important;
  background-image:linear-gradient(transparent,transparent)!important;
}
.contratos-filter-search{position:relative;}
.contratos-filter-search::after{
  content:'🔎';
  position:absolute;
  left:13px;
  bottom:11px;
  font-size:14px;
  pointer-events:none;
  opacity:.82;
}
.contratos-filter-search .contratos-search-box{display:none!important;}
.contratos-list-head-v66{
  display:grid!important;
  grid-template-columns:minmax(260px,1fr) minmax(260px,.9fr) auto!important;
  gap:12px!important;
  align-items:center!important;
  padding:10px 12px!important;
  margin-bottom:9px!important;
  border:1px solid rgba(148,163,184,.34)!important;
  border-radius:12px!important;
  background:rgba(148,163,184,.08)!important;
}
.contratos-col-title{
  min-height:34px;
  display:flex;
  align-items:center;
  padding:0 8px;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.045em;
  color:var(--muted);
}
.contratos-col-contratos{justify-content:center;}
.contratos-list-head-v66 .contratos-page-controls{justify-content:flex-end;}
.contratos-clientes-lista-v66 .contrato-row-card:first-child{margin-top:0;}
body.theme-dark .contratos-search-input{background:#252d38!important;color:#fff!important;border-color:#6b7788!important;}
body.theme-dark .contratos-col-title{color:#c8d0dc!important;}
body.theme-dark .contratos-list-head-v66{background:#252d38!important;border-color:#536173!important;}
@media (max-width:980px){
  .contratos-filter-panel{grid-template-columns:1fr!important;}
  .contratos-list-head-v66{grid-template-columns:1fr!important;}
  .contratos-col-contratos{justify-content:flex-start;}
  .contratos-list-head-v66 .contratos-page-controls{justify-content:flex-start;}
}

/* Ajustes DJEN 2026-06-24 v66: Geradoras comarca/fórum */
.extraGeradora[data-campo="forum"]:disabled{
  opacity:.78;
  cursor:not-allowed;
}

/* Ajustes DJEN 2026-06-24 v67: Contratos ordenação no cabeçalho e alinhamento */
.contratos-hero-icon{
  width:36px!important;
  height:36px!important;
  border-radius:10px!important;
  font-size:18px!important;
}
.contratos-hero h3{font-size:20px!important;}
.contratos-filter-panel{
  grid-template-columns:minmax(145px,180px) minmax(360px,1fr)!important;
}
.contratos-list-head-v67{
  display:block!important;
  padding:10px 12px!important;
  margin-bottom:9px!important;
  border:1px solid rgba(148,163,184,.34)!important;
  border-radius:12px!important;
  background:rgba(148,163,184,.08)!important;
}
.contratos-list-actions-v67{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:9px;
}
.contratos-status-inline{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:0 10px;
  border-radius:999px;
  border:1px solid rgba(34,197,94,.35);
  background:rgba(34,197,94,.10);
  color:#047857;
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}
.contratos-columns-row-v67,
.contrato-row-main{
  display:grid!important;
  grid-template-columns:minmax(300px,1.08fr) minmax(300px,.92fr) minmax(112px,112px)!important;
  gap:12px!important;
  align-items:center!important;
}
.contratos-sort-title{
  width:100%;
  min-height:34px;
  display:flex!important;
  align-items:center;
  gap:6px;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--muted)!important;
  cursor:pointer;
  text-align:left;
  justify-content:flex-start;
  padding:0 8px!important;
}
.contratos-sort-title:hover,
.contratos-sort-title.active{
  color:#d5aa3f!important;
}
.contratos-col-contratos.contratos-sort-title{
  justify-content:center!important;
  text-align:center;
}
.contrato-row-badges{
  justify-content:center!important;
  justify-self:stretch!important;
}
.contrato-row-open{
  width:112px;
  justify-self:end!important;
}
body.theme-dark .contratos-list-head-v67{
  background:#252d38!important;
  border-color:#536173!important;
}
body.theme-dark .contratos-status-inline{
  border-color:rgba(34,197,94,.45)!important;
  background:rgba(34,197,94,.14)!important;
  color:#b9f6ce!important;
}
body.theme-dark .contratos-sort-title{color:#c8d0dc!important;}
body.theme-dark .contratos-sort-title:hover,
body.theme-dark .contratos-sort-title.active{color:#f4cf6b!important;}
@media (max-width:980px){
  .contratos-filter-panel{grid-template-columns:1fr!important;}
  .contratos-columns-row-v67,.contrato-row-main{grid-template-columns:1fr!important;}
  .contratos-col-contratos.contratos-sort-title{justify-content:flex-start!important;text-align:left;}
  .contrato-row-badges{justify-content:flex-start!important;}
  .contrato-row-open{width:100%;justify-self:start!important;}
}

/* Ajustes DJEN 2026-06-24 v68: correção manual somente TI em contratos */
.contratos-ti-btn{
  min-height:36px;
  padding:8px 12px!important;
  border-radius:10px!important;
  font-size:12px!important;
  font-weight:900!important;
  white-space:nowrap;
}
body.theme-dark .contratos-ti-btn{
  background:#202832!important;
  border-color:#6b7788!important;
  color:#f7f9fc!important;
}

/* Ajustes DJEN 2026-06-25 v74: Contratos com cabeçalho no padrão das tabelas */
.contratos-list-head-v74{
  display:block!important;
  padding:0!important;
  margin-bottom:8px!important;
  border:1px solid rgba(148,163,184,.34)!important;
  border-radius:8px!important;
  background:transparent!important;
  overflow:hidden!important;
}
.contratos-list-actions-v74{
  display:flex!important;
  justify-content:space-between!important;
  align-items:center!important;
  gap:12px!important;
  padding:8px 10px!important;
  margin:0!important;
  background:rgba(148,163,184,.06)!important;
}
.contratos-columns-row-v74{
  background:#111821!important;
  border-bottom:3px solid var(--gg-gold,#d5aa3f)!important;
  gap:0!important;
}
.contratos-columns-row-v74 .contratos-col-title,
.contratos-columns-row-v74 .contratos-sort-title,
.contratos-columns-row-v74 .contratos-col-acoes{
  min-height:38px!important;
  padding:11px 14px!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  background:#111821!important;
  box-shadow:none!important;
  color:#f6d98b!important;
  font-size:12px!important;
  font-weight:900!important;
  text-transform:uppercase!important;
  letter-spacing:.04em!important;
  display:flex!important;
  align-items:center!important;
}
.contratos-columns-row-v74 .contratos-sort-title{cursor:pointer!important;}
.contratos-columns-row-v74 .contratos-sort-title:hover,
.contratos-columns-row-v74 .contratos-sort-title.active{color:#fff0b6!important;}
.contratos-columns-row-v74 .contratos-col-contratos{justify-content:center!important;text-align:center!important;}
.contratos-columns-row-v74 .contratos-col-acoes{justify-content:center!important;}
body.theme-light .contratos-columns-row-v74,
body.theme-light .contratos-columns-row-v74 .contratos-col-title,
body.theme-light .contratos-columns-row-v74 .contratos-sort-title,
body.theme-light .contratos-columns-row-v74 .contratos-col-acoes{
  background:var(--gg-blue,#1f3f94)!important;
  color:#fff!important;
  border-bottom-color:var(--gg-blue,#1f3f94)!important;
}
body.theme-dark .contratos-list-head-v74{background:transparent!important;border-color:#536173!important;}
body.theme-dark .contratos-list-actions-v74{background:#252d38!important;}

/* Autocomplete reutilizado por Contratos/Financeiro */
.cliente-autocomplete-wrap{position:relative}
.cliente-sugestoes{position:absolute;left:0;right:0;top:100%;z-index:9100;background:#1d2630;border:1px solid #6b7789;border-radius:8px;max-height:240px;overflow:auto;box-shadow:0 12px 28px rgba(0,0,0,.35);display:none}
.cliente-sugestoes.open{display:block}
.cliente-sugestao{padding:8px 10px;cursor:pointer;border-bottom:1px solid rgba(255,255,255,.08);color:#f7f9fc}
.cliente-sugestao:hover{background:rgba(214,167,45,.16)}


/* Ajustes DJEN v86: tema claro sem blocos grafite nos modais de Clientes/Publicações */
body.theme-light #modalPublicacaoClienteDetalhe .cliente-controle-card,
html[data-theme="claro"] #modalPublicacaoClienteDetalhe .cliente-controle-card,
body.theme-light #modalPublicacaoClienteDetalhe .partes-box,
html[data-theme="claro"] #modalPublicacaoClienteDetalhe .partes-box,
body.theme-light #contratosClienteBox,
html[data-theme="claro"] #contratosClienteBox,
body.theme-light #boxDelegacoesControle,
html[data-theme="claro"] #boxDelegacoesControle,
body.theme-light .cliente-controle-card,
html[data-theme="claro"] .cliente-controle-card,
body.theme-light .bilhetes-processo-box,
html[data-theme="claro"] .bilhetes-processo-box,
body.theme-light .bilhete-processo-card,
html[data-theme="claro"] .bilhete-processo-card,
body.theme-light .bilhete-card,
html[data-theme="claro"] .bilhete-card,
body.theme-light .bilhete-texto,
html[data-theme="claro"] .bilhete-texto,
body.theme-light .bilhete-editor-inline,
html[data-theme="claro"] .bilhete-editor-inline{
  background:#ffffff!important;
  color:#061536!important;
  border-color:#d9e2f2!important;
}
body.theme-light #modalPublicacaoClienteDetalhe .cliente-controle-card *,
html[data-theme="claro"] #modalPublicacaoClienteDetalhe .cliente-controle-card *,
body.theme-light #modalPublicacaoClienteDetalhe .partes-box *,
html[data-theme="claro"] #modalPublicacaoClienteDetalhe .partes-box *,
body.theme-light #contratosClienteBox *,
html[data-theme="claro"] #contratosClienteBox *,
body.theme-light #boxDelegacoesControle *,
html[data-theme="claro"] #boxDelegacoesControle *{
  color:#061536!important;
}
body.theme-light .cliente-controle-card .small,
html[data-theme="claro"] .cliente-controle-card .small,
body.theme-light #contratosClienteBox .small,
html[data-theme="claro"] #contratosClienteBox .small{
  color:#667085!important;
}
body.theme-light .info-box,
html[data-theme="claro"] .info-box,
body.theme-light .teor,
html[data-theme="claro"] .teor,
body.theme-light .resumo-box,
html[data-theme="claro"] .resumo-box,
body.theme-light .modal-content .small-card,
html[data-theme="claro"] .modal-content .small-card{
  background:#f8fafc!important;
  color:#061536!important;
  border-color:#e5e7eb!important;
}
body.theme-light .reproc-progress-track,
html[data-theme="claro"] .reproc-progress-track{
  background:#eef0f4!important;
  border:1px solid #d7dce5!important;
}
body.theme-dark .reproc-progress-track,
html[data-theme="escuro"] .reproc-progress-track{
  background:#111923!important;
  border:1px solid #536173!important;
}
body.theme-dark #boxDelegacoesControle,
html[data-theme="escuro"] #boxDelegacoesControle{
  background:#252c36!important;
  color:#f7f9fc!important;
  border:1px solid #536173!important;
}
body.theme-dark #boxDelegacoesControle *,
html[data-theme="escuro"] #boxDelegacoesControle *{
  color:#f7f9fc!important;
}

/* Ajustes DJEN v86: botão de fechar não vira botão azul no tema claro */
body.theme-light .modal-close,
html[data-theme="claro"] .modal-close{
  background:transparent!important;
  color:#475467!important;
  border:0!important;
  box-shadow:none!important;
  width:auto!important;
  min-width:0!important;
  padding:0!important;
}
body.theme-light .modal-close:hover,
html[data-theme="claro"] .modal-close:hover{
  color:#1f3f94!important;
  filter:none!important;
}


/* Ajustes DJEN v87: remover últimos blocos grafite/cinza no tema claro dos popups de publicação */
body.theme-light #boxDelegacoesControle,
html[data-theme="claro"] #boxDelegacoesControle,
body:not(.theme-dark) #boxDelegacoesControle,
body.theme-light .controle-delegacao-box,
html[data-theme="claro"] .controle-delegacao-box,
body:not(.theme-dark) .controle-delegacao-box{
  background:#ffffff!important;
  color:#061536!important;
  border:1px solid #d9e2f2!important;
  box-shadow:none!important;
}
body.theme-light #boxDelegacoesControle *,
html[data-theme="claro"] #boxDelegacoesControle *,
body:not(.theme-dark) #boxDelegacoesControle *,
body.theme-light .controle-delegacao-box *,
html[data-theme="claro"] .controle-delegacao-box *,
body:not(.theme-dark) .controle-delegacao-box *{
  color:#061536!important;
  border-color:#d9e2f2!important;
}
body.theme-light #boxDelegacoesControle > div,
html[data-theme="claro"] #boxDelegacoesControle > div,
body:not(.theme-dark) #boxDelegacoesControle > div,
body.theme-light .controle-delegacao-box > div,
html[data-theme="claro"] .controle-delegacao-box > div,
body:not(.theme-dark) .controle-delegacao-box > div{
  background:transparent!important;
}
body.theme-light .controle-delegacao-titulo,
html[data-theme="claro"] .controle-delegacao-titulo,
body:not(.theme-dark) .controle-delegacao-titulo{
  color:#09358d!important;
  background:transparent!important;
}
body.theme-light .modal-content [class*="controle"],
html[data-theme="claro"] .modal-content [class*="controle"],
body:not(.theme-dark) .modal-content [class*="controle"]{
  border-color:#d9e2f2!important;
}

/* Acessibilidade: labels automáticos invisíveis para eliminar avisos de formulário no DevTools sem alterar layout */
.djen-sr-only{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}

/* Drive/Arquivos v111 - lixeira protegida e confirmação reforçada */
.drive-trash-info{
  margin-top:10px;
  padding:10px 12px;
  border:1px solid #f3c7c7;
  border-left:4px solid #c62828;
  border-radius:7px;
  background:#fff7f7;
  color:#7f1d1d;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.drive-row{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  padding:8px 0;
  border-bottom:1px solid rgba(127,127,127,.18);
}
.drive-item-main{
  flex:1;
  min-width:0;
  text-align:left;
}
.drive-item-main .small{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.drive-actions{
  display:flex;
  gap:7px;
  align-items:center;
  justify-content:flex-end;
  flex:0 0 auto;
  flex-wrap:nowrap;
}
button.drive-trash-btn,
body.theme-light button.drive-trash-btn,
html[data-theme="claro"] button.drive-trash-btn,
body.theme-dark button.drive-trash-btn,
html[data-theme="escuro"] button.drive-trash-btn{
  background:#b42318!important;
  color:#fff!important;
  border:1px solid #912018!important;
  box-shadow:none!important;
  white-space:nowrap!important;
}
button.drive-trash-btn:hover,
body.theme-light button.drive-trash-btn:hover,
html[data-theme="claro"] button.drive-trash-btn:hover,
body.theme-dark button.drive-trash-btn:hover,
html[data-theme="escuro"] button.drive-trash-btn:hover{
  background:#8f1d14!important;
  filter:none!important;
}
button.drive-trash-btn:disabled,
body.theme-light button.drive-trash-btn:disabled,
html[data-theme="claro"] button.drive-trash-btn:disabled,
body.theme-dark button.drive-trash-btn:disabled,
html[data-theme="escuro"] button.drive-trash-btn:disabled{
  background:#8f9aa8!important;
  border-color:#7a8592!important;
  color:#fff!important;
  opacity:.72!important;
  cursor:not-allowed!important;
}
.drive-trash-state{
  display:inline-flex;
  align-items:center;
  min-height:35px;
  padding:7px 9px;
  border:1px solid #a8b3c2;
  border-radius:6px;
  background:#edf1f6;
  color:#344054;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}
.drive-protected-badge{
  display:inline-block;
  margin-left:8px;
  padding:2px 6px;
  border-radius:999px;
  background:#fee4e2;
  color:#b42318;
  font-size:10px;
  font-weight:800;
  vertical-align:middle;
}
.drive-trash-banner{
  margin:0 0 14px;
  padding:11px 12px;
  border:1px solid #f0b4b4;
  border-radius:7px;
  background:#fff3f2;
  color:#912018;
  line-height:1.45;
}
.drive-delete-modal{
  width:min(760px,96vw)!important;
  max-height:92vh;
}
.drive-delete-kicker{
  display:inline-block;
  margin-bottom:5px;
  color:#b42318;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
}
.drive-delete-warning{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin:14px 0;
  padding:12px;
  border:1px solid #f2b8b5;
  border-radius:7px;
  background:#fff3f2;
  color:#912018;
  line-height:1.45;
}
.drive-delete-details{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin:12px 0 14px;
}
.drive-delete-details>div{
  min-width:0;
  padding:10px;
  border:1px solid #d7dce5;
  border-radius:7px;
  background:#f8fafc;
}
.drive-delete-details>div.full{grid-column:1/-1;}
.drive-delete-details span{
  display:block;
  margin-bottom:5px;
  color:#667085;
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.drive-delete-details b,
.drive-delete-details code{
  display:block;
  color:#101828;
  overflow-wrap:anywhere;
  white-space:normal;
}
.drive-delete-check{
  display:flex;
  gap:9px;
  align-items:flex-start;
  margin:14px 0;
  padding:11px 12px;
  border:1px solid #d0d5dd;
  border-radius:7px;
  background:#fff;
  cursor:pointer;
}
.drive-delete-check input{
  width:18px;
  height:18px;
  margin:1px 0 0;
  flex:0 0 auto;
}
body.theme-dark .drive-trash-info,
html[data-theme="escuro"] .drive-trash-info{
  background:#3a2525!important;
  color:#ffd7d2!important;
  border-color:#8f4b46!important;
  border-left-color:#ff6b61!important;
}
body.theme-dark .drive-trash-banner,
html[data-theme="escuro"] .drive-trash-banner,
body.theme-dark .drive-delete-warning,
html[data-theme="escuro"] .drive-delete-warning{
  background:#3a2525!important;
  color:#ffd7d2!important;
  border-color:#8f4b46!important;
}
body.theme-dark .drive-delete-details>div,
html[data-theme="escuro"] .drive-delete-details>div,
body.theme-dark .drive-delete-check,
html[data-theme="escuro"] .drive-delete-check{
  background:#252c36!important;
  color:#f7f9fc!important;
  border-color:#536173!important;
}
body.theme-dark .drive-delete-details b,
body.theme-dark .drive-delete-details code,
html[data-theme="escuro"] .drive-delete-details b,
html[data-theme="escuro"] .drive-delete-details code{
  color:#f7f9fc!important;
}
body.theme-dark .drive-delete-details span,
html[data-theme="escuro"] .drive-delete-details span{
  color:#c5ced9!important;
}
body.theme-dark .drive-trash-state,
html[data-theme="escuro"] .drive-trash-state{
  background:#2a333f!important;
  color:#f7f9fc!important;
  border-color:#687789!important;
}
@media (max-width:900px){
  .drive-row{align-items:flex-start;flex-direction:column;}
  .drive-actions{width:100%;justify-content:flex-start;flex-wrap:wrap;}
  .drive-item-main .small{white-space:normal;overflow-wrap:anywhere;}
}
@media (max-width:620px){
  .drive-search-line{grid-template-columns:1fr;}
  .drive-delete-details{grid-template-columns:1fr;}
  .drive-delete-details>div.full{grid-column:auto;}
}


/* Prévia fiel das Geradoras Iniciais: Word temporário destacado e exibido em PDF. */
.geradora-preview-modal{
  width:min(1500px,97vw);
  max-width:97vw;
  height:95vh;
  max-height:95vh;
  padding:14px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.geradora-preview-top{align-items:flex-start;flex:0 0 auto}
.geradora-preview-top h3{margin:0 0 4px}
.geradora-preview-legenda{
  display:flex;
  gap:18px;
  align-items:center;
  flex-wrap:wrap;
  padding:8px 10px;
  margin:8px 0;
  border:1px solid #d7dfed;
  border-radius:7px;
  background:#f8fafc;
  font-size:12px;
  flex:0 0 auto;
}
.geradora-preview-legenda span{display:inline-flex;align-items:center;gap:6px}
.geradora-preview-legenda i{width:18px;height:12px;border:1px solid rgba(0,0,0,.25);display:inline-block;border-radius:2px}
.geradora-preview-amarelo{background:#fff200}
.geradora-preview-vermelho{background:#c00000;box-shadow:none}
.geradora-preview-frame-wrap{
  flex:1 1 auto;
  min-height:0;
  border:1px solid #cbd5e1;
  border-radius:7px;
  overflow:hidden;
  background:#d8dde6;
}
#framePreviewDocumentoGeradora,#framePreviewRecurso{width:100%;height:100%;min-height:500px;border:0;background:#d8dde6;display:block}
.geradora-preview-actions{margin-top:8px;flex:0 0 auto}
body.theme-dark .geradora-preview-legenda,
html[data-theme="escuro"] .geradora-preview-legenda{background:#252d38!important;color:#f7f9fc!important;border-color:#536173!important}
body.theme-dark .geradora-preview-frame-wrap,
html[data-theme="escuro"] .geradora-preview-frame-wrap{border-color:#536173;background:#141a22}
@media(max-width:760px){
  .geradora-preview-modal{width:100vw;max-width:100vw;height:100vh;max-height:100vh;border-radius:0;padding:10px}
  #framePreviewDocumentoGeradora,#framePreviewRecurso{min-height:420px}
}


/* ===== Menu lateral com seções expansíveis ===== */
.sidebar-menu-group{margin-bottom:7px}
.sidebar-section-toggle{
  width:100%;
  appearance:none;
  -webkit-appearance:none;
  border:1px solid transparent;
  background:transparent;
  font:inherit;
  text-align:left;
  color:inherit;
  display:flex;
  gap:9px;
  align-items:center;
  padding:11px 12px;
  border-radius:7px;
  cursor:pointer;
}
.sidebar-section-toggle .menu-chevron{margin-left:auto;font-size:20px;line-height:1;transition:transform .18s ease,opacity .18s ease;opacity:.78}
.sidebar-menu-group.open .sidebar-section-toggle .menu-chevron{transform:rotate(90deg)}
.sidebar-submenu{display:none;padding:2px 0 2px 31px;margin-top:-2px}
.sidebar-menu-group.open .sidebar-submenu{display:block}
.sidebar-submenu a.sidebar-subitem{
  position:relative;
  min-height:34px;
  padding:8px 10px;
  margin:0 0 4px 0;
  border-radius:7px;
  gap:8px;
  font-size:13px;
  font-weight:650;
  opacity:.92;
}
.sidebar-submenu .submenu-dot{width:6px;height:6px;border-radius:50%;flex:0 0 6px;background:currentColor;opacity:.52}
.sidebar-submenu a.sidebar-subitem.active{opacity:1}
body.theme-light .sidebar-section-toggle{color:#1f2937!important}
body.theme-light .sidebar-section-toggle:hover,
body.theme-light .sidebar-section-toggle.active{background:var(--gg-blue)!important;color:#fff!important;border-color:var(--gg-blue)!important}
body.theme-light .sidebar-submenu a.sidebar-subitem{color:#334155!important;background:#e9edf5!important;border:1px solid transparent!important}
body.theme-light .sidebar-submenu a.sidebar-subitem:hover,
body.theme-light .sidebar-submenu a.sidebar-subitem.active{background:#dbe6ff!important;color:var(--gg-blue)!important;border-color:#aebfe9!important;box-shadow:inset 3px 0 0 var(--gg-blue)!important}
body.theme-dark .sidebar-section-toggle{color:#f7f9fc!important}
body.theme-dark .sidebar-section-toggle:hover,
body.theme-dark .sidebar-section-toggle.active{background:#303944!important;color:#fff!important;border-color:rgba(214,170,62,.60)!important}
body.theme-dark .sidebar-submenu a.sidebar-subitem{color:#e8edf5!important;background:#20262e!important;border:1px solid #3d4755!important}
body.theme-dark .sidebar-submenu a.sidebar-subitem:hover,
body.theme-dark .sidebar-submenu a.sidebar-subitem.active{background:#343d49!important;color:#f4c95d!important;border-color:#a97d27!important;box-shadow:inset 3px 0 0 #d6aa3e!important}
body.sidebar-collapsed .sidebar-section-toggle{justify-content:center;padding:12px 6px;gap:0}
body.sidebar-collapsed .sidebar-section-toggle .menu-label,
body.sidebar-collapsed .sidebar-section-toggle .menu-chevron,
body.sidebar-collapsed .sidebar-submenu{display:none!important}
body.sidebar-collapsed .sidebar-menu-group{margin-bottom:7px}

/* =========================================================
   Geradoras de recursos — Apelação, PAP, Agravo, Lote e Petições
   ========================================================= */
.recursos-geradoras-page{max-width:1180px}
.recursos-head{display:flex;align-items:center;justify-content:space-between;gap:16px}
.recursos-head h3{margin-bottom:5px}
.recurso-output-box{margin-top:16px;padding-top:14px;border-top:1px solid var(--border,rgba(120,130,145,.35))}
.recurso-output-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:end}
.recurso-incluir{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin:14px 0;padding:10px 12px;border:1px solid var(--border,rgba(120,130,145,.35));border-radius:8px}
.recurso-incluir label,.recurso-check{display:flex;align-items:center;gap:6px}
.recurso-section-title{font-weight:800;margin:14px 0 8px}
.recurso-tipos{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(280px,.75fr);gap:14px;margin-top:12px}
.recurso-tipos-list,.recurso-selecionados{border:1px solid var(--border,rgba(120,130,145,.35));border-radius:8px;padding:8px;max-height:430px;overflow:auto;background:rgba(127,127,127,.035)}
.recurso-tipo-grupo{border-bottom:1px solid rgba(127,127,127,.18);padding:5px 0}
.recurso-tipo-grupo:last-child{border-bottom:0}
.recurso-tipo-grupo summary{font-weight:800;cursor:pointer;padding:5px 7px;display:flex;justify-content:space-between}
.recurso-tipo-grupo summary span{opacity:.65;font-weight:600}
.recurso-tipo-item{display:flex;align-items:flex-start;gap:8px;padding:6px 9px;border-radius:6px;cursor:pointer}
.recurso-tipo-item:hover{background:rgba(127,127,127,.12)}
.recurso-tipo-item input{margin-top:3px}
.recurso-selecionado{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px;border-bottom:1px solid rgba(127,127,127,.18)}
.recurso-selecionado:last-child{border-bottom:0}
.recurso-selecionado span{min-width:0;overflow-wrap:anywhere;font-weight:700}
.recurso-selecionado small{display:block;font-weight:500;opacity:.65;margin-bottom:2px}
.recurso-selecionado>div{display:flex;gap:4px;flex:0 0 auto}
.recurso-selecionado button{padding:4px 8px;min-width:30px}
.danger-text{color:#d22!important}
.recurso-autocomplete{position:relative}
.recurso-sugestoes{position:absolute;z-index:35;left:0;right:0;top:100%;max-height:280px;overflow:auto;background:var(--card-bg,#fff);border:1px solid var(--border,#aaa);border-radius:0 0 8px 8px;box-shadow:0 12px 24px rgba(0,0,0,.22)}
.recurso-sugestoes:empty{display:none}
.recurso-sugestoes button{display:flex;width:100%;flex-direction:column;align-items:flex-start;text-align:left;border:0;border-bottom:1px solid rgba(127,127,127,.15);border-radius:0;background:transparent;color:inherit;padding:8px 10px}
.recurso-sugestoes button:hover{background:rgba(127,127,127,.13)}
.recurso-sugestoes span{font-size:.78rem;opacity:.7}
.recurso-radio-list{display:grid;gap:7px}
.recurso-radio-list label{display:flex;align-items:flex-start;gap:8px;padding:9px 10px;border:1px solid var(--border,rgba(120,130,145,.35));border-radius:7px;cursor:pointer}
.recurso-radio-list label:hover{background:rgba(127,127,127,.08)}
.recurso-pedido{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;margin-bottom:7px}
.recurso-downloads{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
.button-link{display:inline-flex;align-items:center;justify-content:center;gap:5px;text-decoration:none;padding:8px 12px;border-radius:7px;background:var(--accent,#e9b949);color:#111;font-weight:800}
.recurso-metricas{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0}
.recurso-metricas span{border:1px solid var(--border,rgba(120,130,145,.35));border-radius:8px;padding:8px 13px}
.recurso-metricas b{font-size:1.15rem;margin-right:4px}
.recurso-folder-result{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px;border-bottom:1px solid rgba(127,127,127,.18)}
.recurso-folder-result span{min-width:0}
.recurso-folder-result small{display:block;opacity:.68;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:720px}
.status-warning{background:#c78d13!important;color:#111!important}
@media(max-width:850px){.recurso-tipos{grid-template-columns:1fr}.recurso-output-row{grid-template-columns:1fr}.recursos-head{align-items:flex-start;flex-direction:column}.grid.grid-4.recurso-campos{grid-template-columns:1fr 1fr}}


/* ===== Geradoras de recursos v2: formulários web, configuração e prévia ===== */
.recurso-acoes-geracao{align-items:center;gap:8px;flex-wrap:wrap}
.recurso-acoes-geracao .sub{margin-right:auto;max-width:680px;line-height:1.35}
.recurso-catalogo-aviso{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.recurso-catalogo-aviso b{margin-right:2px}
.recurso-cadastrar-sugestao{border-top:1px solid rgba(127,127,127,.25)!important;background:rgba(232,181,52,.10)!important}
.recurso-cadastrar-sugestao b{color:var(--accent,#b88713)}
.recurso-cadastro-modal{width:min(760px,94vw);max-height:90vh;overflow:auto}
.recurso-config-lote{margin-top:16px;border:1px solid var(--border,rgba(120,130,145,.35));border-radius:9px;background:rgba(127,127,127,.035)}
.recurso-config-lote>summary{cursor:pointer;padding:12px 14px;font-weight:800;display:flex;align-items:center;gap:8px}
.recurso-config-lote[open]>summary{border-bottom:1px solid var(--border,rgba(120,130,145,.35))}
.recurso-config-lote-corpo{padding:14px}
.recurso-validacoes{display:grid;gap:10px;margin:10px 0}
.recurso-validacao-row{display:grid;grid-template-columns:minmax(105px,.65fr) minmax(92px,.45fr) minmax(92px,.45fr) minmax(260px,2fr) auto;gap:8px;align-items:end;padding:10px;border:1px solid rgba(127,127,127,.22);border-radius:8px}
.recurso-validacao-row label{margin:0}
.recurso-validacao-row textarea{min-height:96px;resize:vertical}
.cfg-opcoes-wrap{min-width:0}
.recurso-config-status{margin:8px 0;min-height:20px}
.recurso-downloads .button-link{max-width:100%;overflow-wrap:anywhere}
.grid .full{grid-column:1/-1}
body.theme-dark .recurso-config-lote,html[data-theme="escuro"] .recurso-config-lote{background:#252d38;border-color:#536173}
body.theme-dark .recurso-cadastrar-sugestao,html[data-theme="escuro"] .recurso-cadastrar-sugestao{background:rgba(214,170,62,.13)!important}
body.theme-light .recurso-config-lote,html[data-theme="claro"] .recurso-config-lote{background:#f6f8fc}
@media(max-width:950px){.recurso-validacao-row{grid-template-columns:1fr 1fr}.recurso-validacao-row .cfg-opcoes-wrap{grid-column:1/-1}.recurso-validacao-row>button{justify-self:end}}
@media(max-width:640px){.recurso-validacao-row{grid-template-columns:1fr}.recurso-validacao-row .cfg-opcoes-wrap{grid-column:auto}.recurso-acoes-geracao .sub{flex-basis:100%}}

/* Ajustes de alinhamento dos controles das geradoras (input global usa width:100%). */
.recurso-parte-bloco{display:grid;gap:10px;min-width:0}
.recurso-radio-list label,.recurso-tipo-item,.recurso-incluir label,.recurso-check{text-transform:none}
.recurso-radio-list input[type="radio"],.recurso-tipo-item input[type="checkbox"],.recurso-incluir input[type="checkbox"],.recurso-check input[type="checkbox"]{width:auto!important;min-width:16px;flex:0 0 auto;margin:2px 0 0}
.recurso-radio-list label{justify-content:flex-start;align-items:flex-start;font-size:13px;line-height:1.35}
.recurso-radio-list label span{flex:1;min-width:0}
.recurso-config-body{padding:14px}

/* Geradoras de recursos v3: arquivos Word gerenciados e prévia em tamanho real. */
.recurso-modelos-word{
  margin:0 0 16px;
  border:1px solid var(--border,rgba(120,130,145,.35));
  border-radius:9px;
  background:rgba(127,127,127,.035);
}
.recurso-modelos-word>summary{
  cursor:pointer;
  padding:11px 13px;
  font-weight:800;
}
.recurso-modelos-word[open]>summary{border-bottom:1px solid var(--border,rgba(120,130,145,.35))}
.recurso-modelos-word-corpo{padding:11px 13px;display:grid;gap:9px}
.recurso-modelo-item{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  padding:10px;
  border:1px solid rgba(127,127,127,.22);
  border-radius:8px;
}
.recurso-modelo-item code{
  display:block;
  margin-top:5px;
  white-space:normal;
  overflow-wrap:anywhere;
  font-size:12px;
  opacity:.82;
}
.recurso-modelo-acoes{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.geradora-preview-frame-wrap{position:relative}
#framePreviewRecurso{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
}
body.theme-dark .recurso-modelos-word,html[data-theme="escuro"] .recurso-modelos-word{background:#252d38;border-color:#536173}
body.theme-light .recurso-modelos-word,html[data-theme="claro"] .recurso-modelos-word{background:#f6f8fc}
@media(max-width:760px){
  .recurso-modelo-item{grid-template-columns:1fr}
  .recurso-modelo-acoes{justify-content:flex-start}
}
.recurso-modelos-rodape{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.recurso-modelos-rodape .small{flex:1;min-width:260px}

/* =========================================================
   Geradoras de recursos v4 — abas internas e formulários organizados
   ========================================================= */
.recurso-tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:-4px 0 18px;
  padding-bottom:12px;
  border-bottom:1px solid var(--border,rgba(120,130,145,.35));
}
.recurso-tab{
  background:transparent!important;
  color:inherit!important;
  border:1px solid var(--border,rgba(120,130,145,.45))!important;
  box-shadow:none!important;
  min-height:38px;
  padding:8px 14px!important;
}
.recurso-tab.active{
  background:var(--accent,#e3b63f)!important;
  color:#111!important;
  border-color:var(--accent,#e3b63f)!important;
  font-weight:900;
}
.recurso-tab-panel[hidden]{display:none!important}
.recurso-tab-panel{min-width:0}
.recurso-form-section,.recurso-configuracoes{display:grid;gap:16px;min-width:0}
.recurso-form-section>h3,.recurso-config-intro h3{margin:0}
.recurso-config-intro{padding-bottom:2px}
.recurso-config-intro .sub{margin:4px 0 0}
.recurso-grid-form{align-items:start;gap:16px}
.recurso-campo{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
  margin:0;
}
.recurso-campo>label,
.recurso-parte-bloco .recurso-campo>label{
  margin:0!important;
  line-height:1.2;
  position:static!important;
  transform:none!important;
}
.recurso-campo>input,
.recurso-campo>select,
.recurso-campo>textarea{
  margin:0!important;
  position:static!important;
  min-width:0;
}
.recurso-campo>.sub{margin:0;line-height:1.35}
.recurso-parte-bloco{display:grid;gap:14px;min-width:0}
.recurso-parte-bloco textarea{min-height:105px}
.recurso-config-modelo-select{
  max-width:760px;
  padding:13px;
  border:1px solid var(--border,rgba(120,130,145,.35));
  border-radius:9px;
  background:rgba(127,127,127,.035);
}
.recurso-modelos-config{margin:0}
.recurso-modelos-word-titulo,
.recurso-config-lote-titulo{
  padding:11px 13px;
  font-weight:900;
  border-bottom:1px solid var(--border,rgba(120,130,145,.35));
}
.recurso-modelo-info{min-width:0}
.recurso-modelo-nota{
  display:block;
  margin-top:4px;
  font-size:12px;
  line-height:1.35;
  opacity:.78;
}
.recurso-config-lote-aberto{margin:0}
.recurso-config-lote-aberto .recurso-config-lote-corpo{display:block}
.recurso-config-lote-titulo span{
  display:inline-flex;
  margin-left:6px;
  padding:2px 7px;
  border-radius:999px;
  background:rgba(227,182,63,.18);
  font-size:11px;
}
.recurso-validacao-row{align-items:start}
.recurso-validacao-row>.cfg-remover{align-self:end;margin-bottom:2px}
.recurso-radio-list{margin-top:2px}
.recurso-radio-list label{margin:0!important}
.recurso-incluir{margin:0}
.recurso-acoes-geracao{margin-top:2px}
body.theme-dark .recurso-config-modelo-select,
html[data-theme="escuro"] .recurso-config-modelo-select{background:#252d38;border-color:#536173}
body.theme-light .recurso-config-modelo-select,
html[data-theme="claro"] .recurso-config-modelo-select{background:#f6f8fc}
@media(max-width:850px){
  .recurso-grid-form{grid-template-columns:1fr!important}
  .recurso-tabs{flex-direction:column}
  .recurso-tab{width:100%;text-align:left}
}


/* =========================================================
   Geradoras de recursos v7 — preview lateral e tipos destacados
   ========================================================= */
.recursos-geradoras-page{max-width:1720px}
.recurso-workspace{
  display:grid;
  grid-template-columns:minmax(620px,1.02fr) minmax(500px,.98fr);
  gap:18px;
  align-items:start;
}
.recurso-editor-pane{min-width:0}
.recurso-preview-side{
  position:sticky;
  top:12px;
  min-width:0;
  border:1px solid var(--border,rgba(120,130,145,.42));
  border-radius:10px;
  overflow:hidden;
  background:var(--card-bg,#fff);
  box-shadow:0 8px 24px rgba(0,0,0,.10);
}
.recurso-preview-side-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:11px 12px;
  border-bottom:1px solid var(--border,rgba(120,130,145,.35));
}
.recurso-preview-side-head>div:first-child{display:grid;gap:3px;min-width:0}
.recurso-preview-side-head span{font-size:12px;opacity:.72;overflow-wrap:anywhere}
.recurso-preview-side-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}
.recurso-preview-side-actions label{display:inline-flex;align-items:center;gap:5px;font-size:12px;white-space:nowrap}
.recurso-preview-side-actions input{width:auto!important;margin:0}
.recurso-preview-side-actions button{padding:6px 9px!important;min-height:32px}
.recurso-preview-side-legenda{margin:8px 10px 0}
.recurso-preview-side-frame{
  position:relative;
  height:calc(100vh - 235px);
  min-height:620px;
  max-height:980px;
  margin:8px 10px 10px;
  overflow:hidden;
  border:1px solid var(--border,rgba(120,130,145,.42));
  border-radius:7px;
  background:#151b23;
}
#framePreviewLateralRecurso{position:absolute;inset:0;width:100%;height:100%;border:0;background:#151b23}
.recurso-preview-side-placeholder{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;color:#d9e0e9;background:#151b23;z-index:2}
.recurso-preview-side-placeholder[hidden]{display:none!important}
.recurso-tipo-item{border:1px solid transparent;transition:background .15s,border-color .15s,box-shadow .15s}
.recurso-tipo-item.selected{
  background:rgba(229,181,55,.24)!important;
  border-color:var(--accent,#e3b63f)!important;
  box-shadow:inset 4px 0 0 var(--accent,#e3b63f);
  font-weight:800;
}
.recurso-radio-list label:has(input:checked){
  background:rgba(229,181,55,.24)!important;
  border-color:var(--accent,#e3b63f)!important;
  box-shadow:inset 4px 0 0 var(--accent,#e3b63f);
  font-weight:800;
}
body.theme-dark .recurso-preview-side,html[data-theme="escuro"] .recurso-preview-side{background:#2e3844;border-color:#566578}
body.theme-light .recurso-preview-side,html[data-theme="claro"] .recurso-preview-side{background:#fff}
@media(max-width:1280px){
  .recurso-workspace{grid-template-columns:1fr}
  .recurso-preview-side{position:relative;top:auto}
  .recurso-preview-side-frame{height:760px;min-height:560px;max-height:none}
}
@media(max-width:700px){
  .recurso-preview-side-head{flex-direction:column}
  .recurso-preview-side-actions{justify-content:flex-start}
  .recurso-preview-side-frame{height:620px;min-height:500px}
}


/* Geradoras v8 — seleção inequívoca e prévia realmente contínua */
.recurso-tipo-item.selected,
.recurso-tipo-item:has(input[type="checkbox"]:checked){
  background:#e5b537!important;
  border-color:#f4cf63!important;
  box-shadow:inset 5px 0 0 #8c6500,0 0 0 1px rgba(0,0,0,.18)!important;
  color:#111!important;
  font-weight:900!important;
}
.recurso-tipo-item.selected span,
.recurso-tipo-item:has(input[type="checkbox"]:checked) span{color:#111!important}
.recurso-tipo-item input[type="checkbox"]{accent-color:#8c6500}
.recurso-selecionado{border-left:4px solid #e5b537!important;background:rgba(229,181,55,.13)!important}
.recurso-preview-side-loading{
  position:absolute;right:12px;top:12px;z-index:4;
  display:flex;align-items:center;gap:7px;padding:7px 10px;
  border-radius:999px;background:rgba(15,20,27,.88);color:#fff;
  font-size:12px;font-weight:800;box-shadow:0 4px 14px rgba(0,0,0,.25);
  pointer-events:none;
}
.recurso-preview-side-loading[hidden]{display:none!important}
.recurso-preview-side-loading span{width:13px;height:13px;border:2px solid rgba(255,255,255,.35);border-top-color:#e5b537;border-radius:50%;animation:djenPreviewSpin .65s linear infinite}
@keyframes djenPreviewSpin{to{transform:rotate(360deg)}}

/* =========================================================
   Geradoras v11 — cabeçalho compacto, prévia limpa e instalador amigável
   ========================================================= */
.recursos-geradoras-page{padding-top:10px}
.recurso-toolbar{
  display:grid;
  grid-template-columns:auto minmax(220px,1fr) auto;
  align-items:center;
  gap:14px;
  margin:-4px 0 18px;
  padding-bottom:12px;
  border-bottom:1px solid var(--border,rgba(120,130,145,.35));
}
.recurso-toolbar .recurso-tabs{
  margin:0;
  padding:0;
  border:0;
  flex-wrap:nowrap;
}
.recurso-toolbar-context{min-width:0;display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.recurso-toolbar-context b{font-size:14px;white-space:nowrap}
.recurso-toolbar-context span{font-size:12px;line-height:1.3;opacity:.74;min-width:180px}
.recurso-toolbar>.pill{justify-self:end;white-space:nowrap}

.recurso-preview-clean-tools{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:7px 10px 0;
}
.recurso-preview-clean-tools button{min-width:34px!important;min-height:30px!important;padding:4px 8px!important}
.recurso-preview-clean-tools strong{min-width:48px;text-align:center;font-size:12px}
.recurso-preview-clean-wrap{background:#20262e!important;overflow:auto!important}
.recurso-preview-pages{
  min-height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:18px;
  padding:18px;
  overflow:visible;
  background:#20262e;
}
.recurso-preview-page-wrap{
  width:100%;
  margin:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}
.recurso-preview-page{
  display:block;
  max-width:none;
  height:auto;
  margin:0 auto;
  background:#fff;
  box-shadow:0 5px 18px rgba(0,0,0,.35);
  transition:width .12s ease;
}
.recurso-preview-page-wrap figcaption{
  color:#d5dbe3;
  font-size:11px;
  opacity:.75;
}
.recurso-preview-pages[hidden]{display:none!important}
.geradora-preview-frame-wrap.recurso-preview-clean-wrap .recurso-preview-pages{position:absolute;inset:0;overflow:auto}
.geradora-preview-frame-wrap.recurso-preview-clean-wrap iframe[hidden],
.recurso-preview-side-frame iframe[hidden]{display:none!important}

.recurso-installer-modal{
  position:relative;
  width:min(560px,92vw);
  padding:28px 30px 24px;
  text-align:center;
  overflow:hidden;
  border:1px solid rgba(229,181,55,.45);
  box-shadow:0 24px 70px rgba(0,0,0,.42);
}
.recurso-installer-modal:before{
  content:"";
  position:absolute;
  inset:0 0 auto;
  height:5px;
  background:linear-gradient(90deg,#8c6500,#e5b537,#f4cf63);
}
.recurso-installer-close{position:absolute;right:12px;top:12px}
.recurso-installer-icon{
  width:68px;height:68px;margin:2px auto 14px;
  display:grid;place-items:center;border-radius:20px;
  background:rgba(229,181,55,.16);
  border:1px solid rgba(229,181,55,.38);
  font-size:34px;
}
.recurso-installer-modal h3{margin:0 0 9px;font-size:20px}
.recurso-installer-modal>p{margin:0 0 14px;line-height:1.45;opacity:.85}
.recurso-installer-file{
  margin:0 auto 16px;
  padding:10px 12px;
  border-radius:8px;
  background:#151b23;
  color:#f5cf62;
  font-family:Consolas,monospace;
  font-size:13px;
  overflow-wrap:anywhere;
}
.recurso-installer-modal ol{
  margin:0 auto 16px;
  padding:0;
  max-width:430px;
  list-style:none;
  counter-reset:passo;
  display:grid;
  gap:9px;
  text-align:left;
}
.recurso-installer-modal li{counter-increment:passo;display:grid;grid-template-columns:28px 1fr;gap:9px;align-items:start;line-height:1.4}
.recurso-installer-modal li:before{
  content:counter(passo);
  width:26px;height:26px;display:grid;place-items:center;
  border-radius:50%;background:#e5b537;color:#111;font-weight:900;
}
.recurso-installer-note{
  padding:10px 12px;border-radius:8px;
  background:rgba(86,166,255,.10);border:1px solid rgba(86,166,255,.25);
  font-size:12px;line-height:1.4;text-align:left;
}
.recurso-installer-modal .modal-actions{justify-content:center;margin-top:18px}

@media(max-width:980px){
  .recurso-toolbar{grid-template-columns:1fr auto}
  .recurso-toolbar-context{grid-column:1/-1;grid-row:2}
}
@media(max-width:700px){
  .recurso-toolbar{grid-template-columns:1fr}
  .recurso-toolbar .recurso-tabs{flex-direction:column}
  .recurso-toolbar>.pill{justify-self:start}
  .recurso-preview-pages{padding:10px;gap:12px}
}


/* =========================================================
   Geradoras v12 — modal local legível e PAP com modelo único
   ========================================================= */
.recurso-installer-modal{
  width:min(620px,92vw);
  padding:30px 34px 26px;
}
.recurso-installer-modal ol{
  width:100%;
  max-width:500px;
  gap:11px;
}
.recurso-installer-modal li{
  grid-template-columns:30px minmax(0,1fr);
  gap:11px;
  align-items:center;
  width:100%;
  min-width:0;
}
.recurso-installer-modal li>span{
  display:block;
  min-width:0;
  white-space:normal;
  word-break:normal;
  overflow-wrap:break-word;
}
.recurso-installer-modal li strong{
  display:inline;
  white-space:normal;
  word-break:normal;
}
@media(max-width:560px){
  .recurso-installer-modal{padding:27px 20px 22px}
  .recurso-installer-modal h3{font-size:18px}
}


/* =========================================================
   Geradoras v13 — PAP longa, qualificação e abridor local
   ========================================================= */
.recurso-installer-browser-note{
  margin:4px 0 0;
  padding:11px 13px;
  border-radius:8px;
  background:rgba(229,181,55,.10);
  border:1px solid rgba(229,181,55,.28);
  font-size:12px;
  line-height:1.45;
  text-align:left;
}
.recurso-preview-page-wrap{min-height:120px}
.recurso-preview-page{display:block;margin:0 auto;height:auto}


/* Geradoras v15 — legenda correta e PAP incremental */
.geradora-preview-legenda .geradora-preview-vermelho{background:#c00000!important;box-shadow:none!important;border-color:#7a0000!important}


/* V18 - Menu reorganizado, abas das Geradoras Iniciais e alertas individuais */
.geradora-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px;border-top:1px solid var(--border);padding-top:14px}
.geradora-tab{background:transparent;color:var(--text);border:1px solid var(--border);box-shadow:none;padding:9px 13px}
.geradora-tab:hover{border-color:var(--accent);transform:none}
.geradora-tab.active{background:linear-gradient(180deg,#f6cf62,#dba929);color:#17130a;border-color:#dba929;box-shadow:0 6px 14px rgba(0,0,0,.18)}
.geradora-modelo-head{align-items:flex-end}
.geradora-modelo-compacto{min-width:min(360px,100%)}
.geradora-destino-box{margin-top:12px;border:1px solid var(--border);border-radius:10px;padding:12px;background:rgba(10,18,29,.16)}
.geradora-destino-main{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:end}
.geradora-destino-actions{display:flex;gap:8px;flex-wrap:wrap}
.geradora-destino-input input[readonly]{cursor:default;background:rgba(10,18,29,.22)}
.djen-task-alert-overlay{position:fixed;inset:0;z-index:100000;background:rgba(2,8,18,.72);display:flex;align-items:center;justify-content:center;padding:18px;backdrop-filter:blur(3px)}
.djen-task-alert-card{width:min(560px,96vw);display:flex;gap:16px;align-items:flex-start;background:var(--card);border:1px solid var(--border);border-top:4px solid #d8ad38;border-radius:14px;padding:22px;box-shadow:0 24px 80px rgba(0,0,0,.48)}
.djen-task-alert-card.urgent{border-top-color:#ef4444}
.djen-task-alert-icon{width:58px;height:58px;flex:0 0 58px;display:flex;align-items:center;justify-content:center;border-radius:50%;font-size:29px;background:rgba(216,173,56,.15);border:1px solid rgba(216,173,56,.55)}
.djen-task-alert-card.urgent .djen-task-alert-icon{background:rgba(239,68,68,.14);border-color:rgba(239,68,68,.55)}
.djen-task-alert-content{min-width:0;flex:1}.djen-task-alert-content h3{margin:2px 0 8px}.djen-task-alert-content p{margin:0;line-height:1.55;color:var(--muted)}
.djen-task-alert-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:18px}
@media(max-width:800px){.geradora-destino-main{grid-template-columns:1fr}.geradora-destino-actions button{flex:1}.djen-task-alert-card{display:block}.djen-task-alert-icon{margin-bottom:12px}}

/* V20 - destino por item, fila persistente e histórico das Geradoras */
.geradora-destino-grid{display:grid;grid-template-columns:minmax(230px,.8fr) minmax(320px,1.7fr) auto;gap:12px;align-items:end}
.geradora-destino-grid select,.geradora-destino-grid input{width:100%}
.geradora-fila-pasta{max-width:290px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.geradora-historico-card{border:1px solid var(--border);border-radius:10px;margin-bottom:10px;background:rgba(10,18,29,.12)}
.geradora-historico-card>summary{cursor:pointer;display:flex;justify-content:space-between;gap:12px;align-items:center;padding:13px 15px;font-weight:700}
.geradora-historico-card>summary span:last-child{font-size:12px;color:var(--muted);font-weight:600;text-align:right}
.geradora-historico-body{padding:0 15px 15px}
.geradora-historico-arquivo{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;align-items:center;padding:7px 0;border-bottom:1px solid rgba(127,127,127,.16)}
.geradora-historico-arquivo small{color:var(--muted)}
@media(max-width:980px){.geradora-destino-grid{grid-template-columns:1fr}.geradora-historico-card>summary{display:block}.geradora-historico-card>summary span{display:block}.geradora-historico-card>summary span:last-child{text-align:left;margin-top:5px}}
.geradora-historico-dados{max-height:320px;overflow:auto;white-space:pre-wrap;min-width:360px;font-size:11px}


/* Menu do próprio usuário no topo */
.top-user-wrap{position:relative;display:inline-flex;align-items:center;z-index:1200}
.top-actions .top-user-button,.top-actions .top-password-button{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;min-height:34px!important;padding:6px 9px!important;border-radius:7px!important;background:transparent!important;color:inherit!important;border:1px solid transparent!important;box-shadow:none!important;cursor:pointer!important}
.top-actions .top-user-button:hover,.top-actions .top-password-button:hover{background:rgba(255,255,255,.12)!important;border-color:rgba(255,255,255,.18)!important}
.top-user-avatar{font-size:14px}.top-user-chevron{font-size:11px;opacity:.8}.top-password-button{min-width:34px!important;padding:6px!important}
.top-user-dropdown{display:none;position:absolute;right:0;top:calc(100% + 8px);width:245px;padding:7px;border-radius:10px;border:1px solid var(--border,#536173);background:var(--panel,#263241);box-shadow:0 16px 40px rgba(0,0,0,.34);z-index:3000}
.top-user-dropdown.open{display:flex;flex-direction:column}
.top-user-summary{padding:9px 10px 11px;border-bottom:1px solid var(--border,#536173);margin-bottom:5px;display:flex;flex-direction:column;gap:2px;overflow:hidden}
.top-user-summary b,.top-user-summary span,.top-user-summary small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.top-user-summary span{font-size:12px;opacity:.86}.top-user-summary small{font-size:11px;opacity:.68}
.top-actions .top-user-dropdown button{width:100%!important;justify-content:flex-start!important;text-align:left!important;padding:9px 10px!important;border-radius:7px!important;background:transparent!important;color:inherit!important;border:0!important;box-shadow:none!important;font-weight:600!important}
.top-actions .top-user-dropdown button:hover{background:rgba(214,167,45,.16)!important}
body.theme-light .top-user-dropdown{background:#fff!important;color:#1f2937!important;border-color:#d7dde7!important}
body.theme-dark .top-user-dropdown{background:#232e3c!important;color:#fff!important;border-color:#536173!important}
@media(max-width:900px){.top-user-dropdown{right:auto;left:0}.top-password-button{display:none!important}}
/* Chat corporativo: botão global e contador de não lidas. */
.chat-global-badge{display:none;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#d99d00;color:#111;font-size:10px;font-weight:900;align-items:center;justify-content:center;margin-left:auto}.chat-global-badge.show{display:inline-flex}.top-chat-link{display:none;align-items:center;gap:6px;text-decoration:none}.top-chat-link.show{display:inline-flex}.sidebar-chat-link{display:none!important}.sidebar-chat-link.show{display:flex!important}.sidebar-collapsed .sidebar-chat-link .chat-global-badge{position:absolute;right:2px;top:2px}
