body.painel {
  background: #e4ebe4;
  color: #142733;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-feature-settings: "kern" 1;
  font-synthesis: none;
}

body.painel .demo { display: none; }

body.painel h1,
body.painel h2,
body.painel h3 {
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
  font-weight: 600;
}

body.painel .workspace {
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

body.painel .sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #02060a;
  border-right: 0;
  color: #dce8df;
  padding: 18px 12px 14px;
  font-family: "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
}

body.painel .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f3efe2;
  font-size: 16px;
  padding: 0 6px;
}
body.painel .brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
body.painel .brand small { color: #9fb3a6; font-size: 11px; font-weight: 500; }
body.painel .brand-pata { height: 26px; width: auto; }

body.painel .nav-ico {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

body.painel .sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 18px;
}

body.painel .nav-grupo {
  margin: 16px 10px 6px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a8496;
}

body.painel .nav-grupo:first-child { margin-top: 8px; }

body.painel .sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: #b7c6bb;
  border-radius: 4px;
  padding: 0 10px;
  white-space: nowrap;
  border-left: 0;
}

body.painel .sidebar nav a:hover { background: #0c1418; color: #f3efe2; }

body.painel .sidebar nav a[aria-current] {
  background: #0c1418;
  color: #f3efe2;
  box-shadow: inset 2px 0 0 #3ee07a;
}

body.painel .sidebar-foot {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 12px 6px 0;
  border-top: 1px solid #1a2a32;
  color: #8aa394;
  font-size: 12px;
}

body.painel .sidebar-foot p { display: none; }

body.painel .sidebar-eu {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

body.painel .sidebar-inicial {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: #14301f;
  color: #3ee07a;
  font-size: 13px;
  font-weight: 650;
}

body.painel .sidebar-eu strong {
  display: block;
  color: #dce8df;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.painel .sidebar-foot .badge {
  margin: 3px 0 0;
  width: fit-content;
}

body.painel .sidebar-acoes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

body.painel .sidebar-acoes a,
body.painel .sidebar-acoes .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  margin: 0;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid #2a3d46;
  background: transparent;
  color: #dce8df;
  font-size: 13px;
  width: 100%;
}

body.painel .sidebar-acoes a:hover,
body.painel .sidebar-acoes .secondary:hover {
  border-color: #3ee07a;
  color: #f3efe2;
}

body.painel .content {
  padding: 24px 32px 40px;
  max-width: 1080px;
}

body.painel:has(#remoto-caixa) .content {
  max-width: none;
}

body.painel .heading {
  align-items: center;
  margin-bottom: 18px;
  gap: 16px;
}

body.painel .heading h1 {
  font-size: 26px;
  letter-spacing: -0.025em;
  margin-bottom: 2px;
}

body.painel .heading .intro {
  color: #226347;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

body.painel .heading p { font-size: 13px; }

body.painel button,
body.painel .button {
  border-radius: 2px;
  min-height: 38px;
  padding: 8px 16px;
}

body.painel .resumo {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: none;
}

body.painel .resumo-item {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid #c5d0c6;
  border-radius: 2px;
  background: #f4f8f4;
  color: #142733;
  font-weight: 400;
  cursor: pointer;
}

body.painel .resumo-item:hover,
body.painel .resumo-fixo:hover {
  border-color: #226347;
  filter: none;
  color: #226347;
}

body.painel .resumo-fixo { cursor: default; }
body.painel .resumo-fixo:hover { border-color: #c5d0c6; color: #142733; }

body.painel .resumo-item strong {
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 600;
}

body.painel .resumo-item span {
  font-size: 13px;
  color: #536b7e;
}

body.painel .carga {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  background: none;
  border: 0;
  border-top: 1px solid #d5ddd6;
  border-bottom: 1px solid #d5ddd6;
  border-radius: 0;
  padding: 8px 0;
  margin-bottom: 16px;
}

body.painel .carga h2 {
  font-size: 0.8rem;
  margin: 0 8px 0 0;
  color: #536b7e;
  font-weight: 600;
}

body.painel .carga-linha {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border: 0;
  padding: 0;
  font-size: 13px;
}

body.painel .carga-linha b { font-size: 14px; }

body.painel .toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px 168px;
  align-items: end;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  background: #eef3ee;
  border-bottom: 1px solid #d5ddd6;
}

body.painel .toolbar label {
  color: #536b7e;
  margin: 0;
  font-size: 12px;
}

body.painel .toolbar select { min-width: 0; }

body.painel input,
body.painel select,
body.painel textarea {
  border-color: #c5d0c6;
  border-radius: 2px;
  background: #f7faf7;
  min-height: 38px;
  padding: 8px 10px;
}

body.painel .panel {
  background: #f7faf7;
  border: 1px solid #c5d0c6;
  border-radius: 2px;
  overflow: hidden;
}

body.painel .panel-title {
  padding: 10px 14px;
  border-bottom: 1px solid #d5ddd6;
  background: #eef3ee;
}

body.painel .ticket {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 132px 16px;
  gap: 12px 16px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #d5ddd6;
}

body.painel .ticket:last-child { border-bottom: 0; }
body.painel .ticket:hover { background: #e4eee4; }

body.painel .ticket-id {
  min-width: 0;
  letter-spacing: -0.02em;
}

body.painel .ticket small { margin-top: 2px; }

body.painel .ticket-main h3 {
  font-size: 15px;
  margin-bottom: 2px;
}

body.painel .ticket-state {
  display: grid;
  justify-items: end;
  gap: 4px;
}

body.painel .chevron { font-size: 18px; }

body.painel .badge {
  border-radius: 2px;
  background: #efe6c8;
  color: #775d21;
}

/* Selo de estado (Clientes e Instalações): pílula com ponto, nunca uma caixa do tamanho de um botão.
   Estado = forma + palavra, não só cor. Chip de código e papel do usuário seguem como eram. */
body.painel .inst-info .badge, body.painel .pg-inst-topo .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 2px 10px 2px 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
body.painel .inst-info .badge::before, body.painel .pg-inst-topo .badge::before { content: ""; width: 8px; height: 8px; flex: none; box-sizing: border-box; border-radius: 50%; background: currentColor; }
body.painel .inst-info .badge:not(.active):not(.alerta):not(.pendente)::before,
body.painel .pg-inst-topo .badge:not(.active):not(.alerta):not(.pendente)::before { background: transparent; border: 2px solid currentColor; }
body.painel .inst-info .badge.alerta::before, body.painel .pg-inst-topo .badge.alerta::before { border-radius: 1px; transform: rotate(45deg); }
body.painel .badge.pendente { background: #f4e6b8; color: #6d5410; }
body.painel .inst-info .badge.pendente::before { background: transparent; border: 2px solid currentColor; }

/* Clientes: informação em cima, ações embaixo, sem quebrar botão em três linhas. */
body.painel .installations > .inst { display: grid; gap: 10px; padding: 16px 0 0; margin-top: 12px; border-top: 1px solid #dce6ed; }
body.painel .inst-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 13px; }
body.painel .inst-info span:not(.badge) { color: #536b7e; }
body.painel .inst-acoes { display: flex; flex-wrap: wrap; gap: 8px; }
body.painel .inst-acoes button { white-space: nowrap; min-height: 36px; }
body.painel button[role="switch"][aria-checked="true"] { border-color: #226347; color: #226347; }

body.painel button.codigo-copiar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 6px 10px;
  border: 0;
  background: #efe6c8;
  color: #775d21;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

body.painel button.codigo-copiar svg {
  width: 14px;
  height: 14px;
}

body.painel button.copiar-icone {
  display: inline-flex;
  align-items: center;
  vertical-align: -8px;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  margin-left: 2px;
  padding: 6px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: #6b8193;
  cursor: pointer;
}

body.painel button.copiar-icone:hover {
  background: #e6edf2;
  color: #20364a;
}

body.painel button.copiar-icone svg {
  width: 14px;
  height: 14px;
}

body.painel .badge.active {
  background: #d7eee0;
  color: #226347;
}

body.painel .client,
body.painel .detail,
body.painel .context,
body.painel .membro {
  background: none;
  border-radius: 0;
}

body.painel .client {
  border-bottom: 1px solid #d5ddd6;
  padding: 16px 14px;
}

body.painel .membro {
  grid-template-columns: minmax(0, 1fr) auto 72px auto;
  gap: 12px;
  border-bottom: 1px solid #d5ddd6;
  padding: 12px 14px;
}

body.painel .papeis {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
  padding: 0;
  border: 0;
}

body.painel .papeis h3 { margin-bottom: 6px; }
body.painel .papeis p { color: #536b7e; font-size: 13px; }

body.painel .note {
  padding: 12px 0 8px 16px;
  border-left: 2px solid #d9b85c;
}

body.painel .licencas-emitir { margin-bottom: 20px; }
body.painel .licencas-emitir form { padding-top: 12px; }
body.painel .licencas-totais { margin: 8px 0 16px; }
body.painel .licencas-tabela { overflow-x: auto; }
body.painel .licencas-tabela table { width: 100%; border-collapse: collapse; }
body.painel .licencas-tabela th,
body.painel .licencas-tabela td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #d5ddd6;
  vertical-align: top;
  font-size: 14px;
}
body.painel .licencas-tabela th { color: #536b7e; font-weight: 600; }
body.painel .licencas-tabela small { display: block; color: #536b7e; font-size: 12px; margin-top: 2px; }
body.painel .licencas-acoes { display: grid; gap: 6px; justify-items: start; }
body.painel .licencas-login { max-width: 420px; }
body.painel button.link { color: #226347; }
body.painel .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

body.painel .detail,
body.painel .context { padding: 18px 16px; }

@media (max-width: 720px) {
  body.painel .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 1050px) {
  body.painel .workspace { grid-template-columns: 220px 1fr; }
  body.painel .content { padding: 20px 18px 36px; }
  body.painel .toolbar { grid-template-columns: 1fr 1fr; }
  body.painel .toolbar .search { grid-column: 1 / -1; }
  body.painel .ticket { grid-template-columns: 76px minmax(0, 1fr) 16px; }
  body.painel .ticket-state { grid-column: 2; justify-items: start; }
}

body.painel .menu-toggle { display: none; }

@media (max-width: 720px) {
  body.painel .workspace { display: block; }
  /* Barra do topo com a marca e o botão Menu; a navegação só aparece aberta (aria-expanded). */
  body.painel .sidebar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    border-bottom: 1px solid #1a2a32;
    padding: 10px 16px;
  }
  body.painel .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 0 16px;
    background: transparent;
    border: 1px solid #3a4e58;
    color: #dce8df;
  }
  body.painel .menu-toggle[aria-expanded="true"] { background: #0c1418; border-color: #8fb8a3; }
  body.painel .workspace:not(.menu-aberto) .sidebar nav,
  body.painel .workspace:not(.menu-aberto) .sidebar-foot { display: none; }
  body.painel .sidebar nav, body.painel .sidebar-foot { grid-column: 1 / -1; }
  body.painel .sidebar nav {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    gap: 2px;
  }
  body.painel .resumo { display: flex; }
  body.painel .toolbar { grid-template-columns: 1fr; }
  body.painel .toolbar .search { grid-column: auto; }
  body.painel .papeis { grid-template-columns: 1fr; }
  body.painel .sidebar { min-height: 0; }
  body.painel .sidebar-foot {
    margin-top: 12px;
    padding-top: 10px;
  }
  body.painel .sidebar nav a { min-height: 44px; padding: 0 12px; }
  body.painel .ticket { grid-template-columns: 1fr auto; }
  body.painel .ticket-id { grid-column: 1; }
  body.painel .ticket-main { grid-column: 1; }
  body.painel .ticket-state { grid-column: 1; }
  body.painel .chevron { grid-column: 2; grid-row: 1 / span 3; }
}

/* Painel de Gestão: instalações e sinal de vida */
body.painel .badge.alerta { background: #f6dcd6; color: #9b2c1c; }
body.painel .pg-inst { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid #e0e8ee; }
body.painel .pg-inst:first-child { border-top: 0; }
body.painel .pg-inst-topo, body.painel .pg-inst-dados { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 14px; }
body.painel .pg-inst-dados { color: #536b7e; font-size: 13px; }
body.painel .pg-alerta { border-left: 3px solid #c0392b; padding-left: 12px; }
body.painel .pg-lista-alertas { margin: 0; padding-left: 18px; color: #9b2c1c; font-size: 13px; }
body.painel .pg-alertas p { margin: 6px 0; font-size: 14px; }
body.painel .pg-aguardando { display: flex; gap: 12px; align-items: center; padding: 8px 0; }

/* Equipe: áreas de cada membro */
body.painel .membro-acessos { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13px; }
body.painel .membro-acessos .acesso { display: inline-flex; gap: 8px; align-items: center; min-height: 28px; cursor: pointer; }
body.painel .membro-acessos .acesso-off { opacity: .5; cursor: not-allowed; }
body.painel .membro-acessos button { padding: 6px 10px; font-size: 13px; min-height: 32px; }
body.painel .membro-acessos .acesso { white-space: nowrap; }
body.painel .membro-acessos input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; flex: none; margin: 0; padding: 0; }

/* Cliente que já existe em outro produto: botão para usar o mesmo cadastro */
#form-error [data-usar-produto] { display: block; margin-top: 10px; }

/* Aprovação de demandas da Boavista */
body.painel .aprov-lista { display: grid; gap: 10px; margin-top: 12px; }
body.painel .aprov-linha { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--line, #d9dfe8); border-radius: 10px; background: #fff; color: inherit; text-decoration: none; }
body.painel .aprov-linha:hover { border-color: #0b5cab; }
body.painel .aprov-linha strong { display: block; }
body.painel .aprov-linha span { color: #4f5b6d; font-size: 14px; }
body.painel .aprov-lado { display: grid; gap: 4px; justify-items: end; }
body.painel .aprov-lado small { color: #4f5b6d; }
body.painel .aprov-pilula { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #eef1f6; color: #3b4658; }
body.painel .aprov-aprovada { background: #e3f4ea; color: #146c3b; }
body.painel .aprov-ajustes { background: #fdf0dc; color: #8a4b00; }
body.painel .aprov-rejeitada { background: #fde8e6; color: #b42318; }
body.painel .aprov-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
body.painel .aprov-quadro { width: 100%; height: 70vh; min-height: 420px; border: 1px solid #d9dfe8; border-radius: 10px; background: #fff; margin: 12px 0; }
body.painel .aprov-decisao { display: grid; gap: 10px; padding: 16px; border: 2px solid #0b5cab; border-radius: 12px; background: #fff; }
body.painel .aprov-decisao textarea { width: 100%; min-height: 80px; }
body.painel .aprov-botoes { display: flex; flex-wrap: wrap; gap: 8px; }
body.painel .aprov-historico { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
body.painel .aprov-historico p { margin: 4px 0 0; color: #4f5b6d; }

/* Confirmação e aviso: no lugar de confirm() e alert() do navegador. */
body.painel dialog.dialogo-confirma, dialog.dialogo-confirma {
  width: min(440px, 92vw);
  padding: 24px;
  border: 1px solid #c6d3de;
  border-radius: 12px;
  background: #fff;
  color: #20364a;
  box-shadow: 0 12px 40px rgba(20, 39, 51, 0.25);
}
dialog.dialogo-confirma::backdrop { background: rgba(20, 39, 51, 0.45); }
dialog.dialogo-confirma h2 { margin: 0 0 8px; font-size: 18px; }
dialog.dialogo-confirma p { margin: 0 0 20px; font-size: 14px; line-height: 1.5; color: #4a6173; }
dialog.dialogo-confirma .dialogo-acoes { display: flex; justify-content: flex-end; gap: 8px; }
#notice.erro { background: #8a2a2a; display: flex; align-items: center; gap: 14px; }
#notice .notice-fechar { min-height: 28px; padding: 4px 10px; background: transparent; color: #fff; border: 1px solid #fff; border-radius: 6px; font-size: 13px; cursor: pointer; }

/* P9, P11, P13 */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body.painel button.perigo-texto { color: #9b2c1c; border-color: #d9a79e; }
body.painel button.perigo-texto:hover:not(:disabled) { background: #f6dcd6; }
body.painel .membro-acessos button[type="submit"]:disabled { opacity: .6; cursor: not-allowed; }
body.painel .licenca-passos { padding: 16px 18px; border-top: 1px solid #dce6ed; }
body.painel .licenca-passos h2 { margin: 0 0 8px; font-size: 16px; }
body.painel .licenca-passos ol { margin: 0 0 10px; padding-left: 22px; font-size: 14px; line-height: 1.6; color: #20364a; }

/* Instalações do Painel de Gestão: mesma grade em todos os cartões (alinhamento, leitura e ação no mesmo lugar) */
body.painel .pg-inst { display: grid; gap: 14px; padding: 18px 0; border-top: 1px solid #e0e8ee; }
body.painel .pg-inst-topo { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px 16px; font-size: 14px; }
body.painel .pg-inst-topo .fine { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
body.painel .pg-inst-dados { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 20px; margin: 0; padding: 12px 14px; border-radius: 8px; background: #f4f8fb; }
body.painel .pg-inst-dados > div { display: grid; align-content: start; gap: 4px; min-width: 0; }
body.painel .pg-inst-dados dt { margin: 0; font-size: 12px; font-weight: 600; color: #536b7e; }
body.painel .pg-inst-dados dd { margin: 0; font-size: 14px; color: #20364a; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
body.painel .pg-inst > .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; width: 100%; margin: 0; }
body.painel .pg-inst > .actions > * { min-height: 36px; white-space: nowrap; }
body.painel .client-title { align-items: flex-start; margin-bottom: 4px; }
body.painel .installations > .pg-inst { margin-top: 8px; padding: 16px 0 0; }
body.painel .client-title h2 { margin-bottom: 4px; }
@media (max-width: 720px) {
  body.painel .pg-inst-topo { grid-template-columns: 1fr auto; }
  body.painel .pg-inst > .actions { justify-content: flex-start; }
}
