:root {
  --cor-marca: #0d6efd;
  --sidebar-w: 276px;
  --sidebar-w-min: 68px;
  --topbar-h: 60px;

  --bg: #f4f6fa;
  --surface: #ffffff;
  --texto: #172033;
  --texto-fraco: #667085;
  --borda: #e4e8f0;
  --sidebar-bg: #111827;
  --sidebar-txt: #aeb9c9;
  --sidebar-txt-ativo: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, .07);
  --sombra: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --raio: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--texto);
  font-size: 14px;
}

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

/* ============================ LOGIN ============================ */

.tela-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 540px at 10% -10%, rgba(38, 112, 255, .16), transparent 62%),
    #f4f7fb;
}

.login-principal {
  padding: 0;
  background: #f7f9fc;
}

.auth-layout {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(440px, 1.08fr) minmax(480px, .92fr);
}

.auth-apresentacao {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 5vw, 68px);
  display: flex;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(circle at 88% 12%, rgba(68, 132, 255, .42), transparent 28%),
    radial-gradient(circle at 8% 92%, rgba(34, 211, 238, .15), transparent 32%),
    linear-gradient(145deg, #0a1b3c 0%, #102d62 55%, #164996 100%);
}

.auth-apresentacao::before,
.auth-apresentacao::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  pointer-events: none;
}

.auth-apresentacao::before { width: 460px; height: 460px; right: -210px; top: 8%; }
.auth-apresentacao::after { width: 620px; height: 620px; left: -380px; bottom: -340px; }

.auth-marca-clara {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .08em;
}

.auth-logo,
.marca-simbolo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.auth-logo { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2); }
.marca-simbolo { background: #eaf1ff; color: #1768e5; flex: 0 0 auto; }

.auth-chamada {
  position: relative;
  z-index: 1;
  width: min(100%, 580px);
  margin: auto 0;
  padding: 56px 0;
}

.auth-etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  color: #cfe1ff;
  background: rgba(255, 255, 255, .07);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-chamada > h1 {
  max-width: 540px;
  margin: 24px 0 16px;
  font-size: clamp(36px, 4.2vw, 58px);
  line-height: 1.04;
  letter-spacing: -.045em;
  font-weight: 650;
}

.auth-chamada > p {
  max-width: 520px;
  margin: 0;
  color: #b9cbed;
  font-size: 16px;
  line-height: 1.7;
}

.auth-preview {
  width: min(100%, 520px);
  margin-top: 38px;
  padding: 18px 20px 20px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 18px;
  background: rgba(255, 255, 255, .09);
  box-shadow: 0 24px 60px rgba(0, 8, 28, .22);
  backdrop-filter: blur(12px);
}

.auth-preview-topo { display: flex; justify-content: space-between; color: #dce8ff; font-size: 12px; }
.auth-preview-topo span { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.auth-preview-grade { display: grid; grid-template-columns: 130px 1fr; gap: 24px; align-items: end; margin-top: 23px; }
.auth-preview-grade small { display: block; color: #aebfde; font-size: 11px; }
.auth-preview-grade strong { display: block; font-size: 28px; margin: 5px 0; letter-spacing: -.03em; }
.auth-preview-grade .positivo { color: #7ee2b8; font-size: 11px; }
.auth-mini-grafico { height: 76px; display: flex; align-items: end; gap: 8px; border-bottom: 1px solid rgba(255,255,255,.14); }
.auth-mini-grafico i { flex: 1; min-width: 8px; border-radius: 4px 4px 0 0; background: linear-gradient(#62a1ff, #2f75e8); }
.auth-apresentacao-rodape { position: relative; z-index: 1; margin: 0; color: #91a9d2; font-size: 12px; }
.auth-apresentacao-rodape i { margin-right: 7px; }

.auth-formulario {
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 84px);
}

.card-login {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--borda);
  border-radius: 22px;
  padding: 38px 36px 30px;
  box-shadow: 0 24px 70px rgba(20, 37, 63, .10);
}

.card-login .marca {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  margin-bottom: 30px;
}

.card-login .marca > i { font-size: 34px; color: var(--cor-marca); margin-top: 2px; }
.card-login .marca-simbolo i { font-size: 17px; }
.card-login .sobre-titulo { display: block; color: #1768e5; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 1px 0 6px; }

.card-login .marca h1 {
  font-size: 24px;
  line-height: 1.15;
  margin: 0 0 6px;
  letter-spacing: -.025em;
}

.card-login .marca p {
  margin: 0;
  color: var(--texto-fraco);
  font-size: 13.5px;
}

.campo { margin-bottom: 18px; }

.campo label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--texto-fraco);
  margin-bottom: 6px;
  letter-spacing: .01em;
}

.campo-icone { position: relative; }

.campo-icone > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa5b4;
  font-size: 14px;
  pointer-events: none;
}

.campo-icone input { padding-left: 40px; }
.campo-icone input[type=password] { padding-right: 44px; }

.alternar-senha {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #7b8798;
  cursor: pointer;
}

.alternar-senha:hover { color: var(--texto); background: #f0f3f8; }

input[type=text], input[type=password], input[type=email], input[type=tel], select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--borda);
  border-radius: 11px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--texto);
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--cor-marca);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, .15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter .15s, background .15s;
}

.btn-primario { background: linear-gradient(135deg, var(--cor-marca), #0758ce); color: #fff; box-shadow: 0 7px 18px rgba(13, 110, 253, .18); }
.btn-primario:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-neutro { background: #eef1f6; color: var(--texto); }
.btn-neutro:hover { background: #e3e8ef; }
.btn-bloco { width: 100%; }
.login-principal .btn-bloco { justify-content: space-between; margin-top: 4px; }
.auth-seguranca { margin: 15px 0 0; text-align: center; color: #98a2b3; font-size: 11.5px; }
.auth-seguranca i { margin-right: 5px; }

.alerta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  margin-bottom: 18px;
}

.alerta-erro { background: #fdecec; color: #b42318; }
.alerta-ok   { background: #e7f6ed; color: #067647; }

/* ==================== SELECAO DE AMBIENTE ==================== */

.tela-ambiente {
  min-height: 100vh;
  padding: 56px 24px;
  background:
    radial-gradient(1000px 560px at 50% -20%, rgba(45, 123, 255, .34), transparent 62%),
    linear-gradient(145deg, #0a1b3c, #102d62 64%, #164996);
  color: #fff;
}

.tela-ambiente .topo {
  text-align: center;
  margin-bottom: 42px;
}

.tela-ambiente .topo h1 {
  font-size: 26px;
  margin: 0 0 8px;
  font-weight: 600;
}

.tela-ambiente .topo p {
  margin: 0;
  color: #9fadc2;
}

.grade-ambientes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
  max-width: 980px;
  margin: 0 auto;
}

.card-ambiente {
  background: rgba(255, 255, 255, .075);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: transform .16s, border-color .16s, background .16s;
  display: block;
  width: 100%;
  font-family: inherit;
  color: inherit;
}

.card-ambiente:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .30);
}

.card-ambiente .logo {
  width: 92px;
  height: 92px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card-ambiente .logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-ambiente .logo span {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
}

.card-ambiente h2 {
  font-size: 16px;
  margin: 0 0 4px;
  font-weight: 600;
}

.card-ambiente small { color: #9fadc2; }

.rodape-ambiente {
  text-align: center;
  margin-top: 40px;
}

.rodape-ambiente a {
  color: #9fadc2;
  font-size: 13.5px;
}

.rodape-ambiente a:hover { color: #fff; }

/* ========================= SHELL / APP ========================= */

.layout { min-height: 100vh; }

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--borda);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 22px 0 14px;
  z-index: 30;
  box-shadow: 0 1px 8px rgba(16, 24, 40, .035);
}

.btn-sanduiche {
  border: 0;
  background: transparent;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 17px;
  color: var(--texto);
  flex: 0 0 auto;
}

.btn-sanduiche:hover { background: #eef1f6; }

.topbar .titulo {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.app-brand { display: inline-flex; align-items: center; gap: 9px; }

.app-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--cor-marca), color-mix(in srgb, var(--cor-marca) 72%, #001d48));
  box-shadow: 0 5px 14px color-mix(in srgb, var(--cor-marca) 25%, transparent);
  font-size: 13px;
}

.topbar .titulo strong {
  font-size: 15px;
  letter-spacing: .06em;
  white-space: nowrap;
}

.chip-ambiente {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cor-marca) 12%, #fff);
  color: var(--cor-marca);
  border: 1px solid color-mix(in srgb, var(--cor-marca) 28%, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.topbar .espaco { flex: 1 1 auto; }

/* --- menu do usuario --- */

.usuario { position: relative; flex: 0 0 auto; }

.usuario-botao {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 5px 9px;
  border-radius: 10px;
  font-family: inherit;
  color: var(--texto);
}

.usuario-botao:hover { background: #eef1f6; }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex: 0 0 auto;
}

.usuario-botao .nome {
  font-size: 13.5px;
  font-weight: 600;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usuario-botao .seta { font-size: 11px; color: var(--texto-fraco); }

.usuario-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  width: 260px;
  background: var(--surface);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 8px;
  display: none;
}

.usuario-menu.aberto { display: block; }

.usuario-menu .cabecalho {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 9px 10px 13px;
  border-bottom: 1px solid var(--borda);
  margin-bottom: 7px;
}

.usuario-menu .cabecalho .avatar { width: 42px; height: 42px; font-size: 15px; }
.usuario-menu .cabecalho b { display: block; font-size: 13.5px; }

.usuario-menu .cabecalho small {
  color: var(--texto-fraco);
  font-size: 12px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.usuario-menu a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--texto);
}

.usuario-menu a:hover { background: #f2f5f9; }
.usuario-menu a i { width: 17px; text-align: center; color: var(--texto-fraco); }
.usuario-menu a.sair { color: #b42318; }
.usuario-menu a.sair i { color: #b42318; }
.usuario-menu hr { border: 0; border-top: 1px solid var(--borda); margin: 7px 0; }

/* --------------------------- SIDEBAR --------------------------- */

.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-txt);
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 25;
  transition: width .2s ease;
  padding: 16px 10px 24px;
  border-right: 1px solid rgba(255,255,255,.035);
}

.sidebar .rotulo {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: #64748b;
  padding: 10px 12px 9px;
  white-space: nowrap;
}

.item-menu {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 12px;
  cursor: pointer;
  color: var(--sidebar-txt);
  border-left: 0;
  border-radius: 9px;
  white-space: nowrap;
  font-size: 13.5px;
  transition: background .13s;
  width: 100%;
  background: transparent;
  border-top: 0; border-right: 0; border-bottom: 0;
  font-family: inherit;
  text-align: left;
}

.item-menu:hover { background: var(--sidebar-hover); color: #fff; }

.item-menu.ativo {
  background: rgba(255, 255, 255, .09);
  color: var(--sidebar-txt-ativo);
}

.item-menu > i:first-child {
  width: 20px;
  text-align: center;
  font-size: 15px;
  flex: 0 0 20px;
}

.item-menu .texto {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-menu .chevron {
  font-size: 11px;
  transition: transform .18s;
  flex: 0 0 auto;
}

.item-menu.aberto .chevron { transform: rotate(90deg); }

.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .22s ease;
  background: rgba(0, 0, 0, .14);
  border-radius: 0 0 9px 9px;
}

.submenu.aberto { max-height: 1400px; }

.item-sub {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px 9px 42px;
  font-size: 13px;
  color: #93a1b5;
  white-space: nowrap;
  border-left: 0;
  border-radius: 7px;
}

.item-sub:hover { background: var(--sidebar-hover); color: #fff; }

.item-sub.ativo {
  color: #fff;
  background: color-mix(in srgb, var(--cor-marca) 26%, transparent);
}

.item-sub i { width: 15px; text-align: center; font-size: 12px; flex: 0 0 15px; }
.item-sub .texto { overflow: hidden; text-overflow: ellipsis; }

.sidebar .vazio {
  padding: 22px 20px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

/* --- estado recolhido (so icones) --- */

body.recolhido .sidebar { width: var(--sidebar-w-min); }
body.recolhido .sidebar .rotulo { display: none; }
body.recolhido .item-menu { justify-content: center; padding: 13px 0; gap: 0; }
body.recolhido .item-menu .texto,
body.recolhido .item-menu .chevron { display: none; }
body.recolhido .submenu { display: none; }
body.recolhido .conteudo { margin-left: var(--sidebar-w-min); }

.conteudo {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  transition: margin-left .2s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.quadro { flex: 1 1 auto; display: flex; flex-direction: column; }

.quadro iframe {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: #fff;
  min-height: calc(100vh - var(--topbar-h));
}

/* ------------------------- BOAS-VINDAS ------------------------- */

.painel { padding: 36px 40px; }

.painel h1 {
  font-size: 25px;
  margin: 0 0 8px;
  font-weight: 650;
  letter-spacing: -.025em;
}

.painel .sub {
  color: var(--texto-fraco);
  margin: 0 0 28px;
}

.grade-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 22px;
  box-shadow: var(--sombra);
  transition: transform .14s, box-shadow .14s;
}

a.card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--cor-marca) 28%, var(--borda));
  box-shadow: 0 12px 30px rgba(16, 24, 40, .09);
}

.card .icone {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 17px;
  color: #fff;
  margin-bottom: 14px;
  background: linear-gradient(145deg, var(--cor-marca), color-mix(in srgb, var(--cor-marca) 72%, #001d48));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--cor-marca) 20%, transparent);
}

.card b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.card small { color: var(--texto-fraco); }

/* ------------------------- FORMULARIOS ------------------------- */

.pagina-form { padding: 30px 34px; max-width: 700px; }

.pagina-form h1 {
  font-size: 20px;
  margin: 0 0 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bloco {
  background: var(--surface);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 24px;
  box-shadow: var(--sombra);
  margin-bottom: 20px;
}

.acoes {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.dica {
  font-size: 12.5px;
  color: var(--texto-fraco);
  margin-top: 5px;
}

/* --------------------------- MOBILE --------------------------- */

.overlay {
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  background: rgba(9, 14, 22, .5);
  z-index: 24;
  display: none;
}

.overlay.ativo { display: block; }

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; width: var(--sidebar-w); }
  body.menu-aberto .sidebar { transform: translateX(0); }
  .conteudo, body.recolhido .conteudo { margin-left: 0; }
  body.recolhido .sidebar { width: var(--sidebar-w); }
  body.recolhido .sidebar .rotulo { display: block; }
  body.recolhido .item-menu { justify-content: flex-start; padding: 11px 12px; gap: 13px; }
  body.recolhido .item-menu .texto,
  body.recolhido .item-menu .chevron { display: inline; }
  body.recolhido .submenu { display: block; }
  .usuario-botao .nome { display: none; }
  .painel, .pagina-form { padding: 20px 16px; }
  .app-brand strong { display: none; }
}

/* ======================== ADMINISTRACAO ======================== */

.pagina-admin { padding: 26px 30px 60px; }

.pagina-admin h1 {
  font-size: 20px;
  margin: 0 0 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagina-admin h1 small {
  font-size: 13px;
  font-weight: 500;
  color: var(--texto-fraco);
  padding-left: 10px;
  border-left: 1px solid var(--borda);
}

.admin-abas {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--borda);
  margin-bottom: 22px;
}

.admin-abas .aba {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--texto-fraco);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.admin-abas .aba:hover { color: var(--texto); background: #eef1f6; border-radius: 8px 8px 0 0; }

.admin-abas .aba.ativa {
  color: var(--cor-marca);
  border-bottom-color: var(--cor-marca);
  font-weight: 600;
}

.titulo-bloco {
  font-size: 15px;
  margin: 0 0 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--borda);
}

.barra-acoes {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filtro {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.filtro label { font-size: 13px; color: var(--texto-fraco); }
.filtro select, .filtro input { padding: 8px 11px; font-size: 13px; }

.linha-campos {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.linha-campos .campo { flex: 1 1 170px; }

textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--borda);
  border-radius: 10px;
  font-size: 13px;
  font-family: ui-monospace, Consolas, monospace;
  resize: vertical;
  color: var(--texto);
  background: #fff;
}

textarea:focus {
  outline: none;
  border-color: var(--cor-marca);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, .15);
}

.campo-cor { padding: 4px; height: 42px; cursor: pointer; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  font-size: 13.5px;
  cursor: pointer;
}

.check input[type=checkbox] {
  width: 17px;
  height: 17px;
  accent-color: var(--cor-marca);
  cursor: pointer;
  flex: 0 0 auto;
}

/* --------------------------- TABELA --------------------------- */

.tabela-wrap {
  background: var(--surface);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  overflow-x: auto;
}

.tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.tabela thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--texto-fraco);
  background: #f7f9fc;
  border-bottom: 1px solid var(--borda);
  white-space: nowrap;
}

.tabela tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #f0f3f8;
  vertical-align: middle;
}

.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela tbody tr:hover { background: #fafbfd; }

.icone-tabela { font-size: 16px; color: var(--cor-marca); }

.url-mini {
  font-size: 11.5px;
  color: var(--texto-fraco);
  font-family: ui-monospace, Consolas, monospace;
  margin-top: 3px;
  word-break: break-all;
}

.mini-logo {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--borda);
  display: block;
}

.mini-logo.sem {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  border: 0;
}

.bolinha-cor {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--borda);
}

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.tag-ok    { background: #e7f6ed; color: #067647; }
.tag-off   { background: #f2f4f7; color: #667085; }
.tag-admin { background: #fef0c7; color: #b54708; margin-left: 6px; }

.link-contador { color: var(--cor-marca); font-weight: 600; }
.link-contador:hover { text-decoration: underline; }

.acoes-linha {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.inline { display: inline; margin: 0; }

.btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--borda);
  background: #fff;
  color: var(--texto);
  cursor: pointer;
  white-space: nowrap;
}

.btn-mini:hover { background: #f2f5f9; }

.btn-mini.perigo { color: #b42318; border-color: #f4c9c4; }
.btn-mini.perigo:hover { background: #fdecec; }

.btn-perigo-fraco {
  background: #fdecec;
  color: #b42318;
}

.btn-perigo-fraco:hover { background: #fbdcda; }

.logo-atual {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.logo-atual img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border: 1px solid var(--borda);
  border-radius: 10px;
  background: #fff;
}

.logo-atual span { font-size: 12.5px; color: var(--texto-fraco); }

.alerta-info { background: #eaf2ff; color: #175cd3; }

/* ---------------------- SELETOR DE ICONE ---------------------- */

.icone-linha {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icone-previa {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--cor-marca);
  color: #fff;
  font-size: 17px;
  flex: 0 0 auto;
}

.icone-galeria {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.icone-opcao {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--borda);
  background: #fff;
  cursor: pointer;
  color: var(--texto-fraco);
  font-size: 14px;
}

.icone-opcao:hover {
  border-color: var(--cor-marca);
  color: var(--cor-marca);
  background: #f2f7ff;
}

/* ------------------------- PERMISSOES ------------------------- */

.bloco-permissao { transition: opacity .15s; }
.bloco-permissao.apagado { opacity: .5; }

.check-empresa { margin: 0 0 6px; }

.nome-empresa {
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.acoes-marcacao {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px 30px;
}

.grade-menus {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 4px 14px;
  margin-left: 30px;
}

.chip-menu { margin: 3px 0; }
.chip-menu span { display: inline-flex; align-items: center; gap: 8px; }
.chip-menu i { width: 16px; text-align: center; color: var(--texto-fraco); }

@media (max-width: 860px) {
  .pagina-admin { padding: 18px 14px 50px; }
  .filtro { margin-left: 0; width: 100%; }
  .acoes-linha { justify-content: flex-start; flex-wrap: wrap; }
}

/* ========================= DASHBOARD DE USO ========================= */
/* Uma serie de dados = uma cor. O azul abaixo passou nos checks de
   contraste e banda de luminosidade sobre a superficie clara. */

.pagina-admin { --serie-1: #2a78d6; --grade: #eef1f6; }

.periodo-info {
  margin-left: auto;
  font-size: 13px;
  color: var(--texto-fraco);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.grade-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 18px 20px;
  box-shadow: var(--sombra);
}

.kpi-rotulo {
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--texto-fraco);
  margin-bottom: 8px;
}

.kpi-valor {
  font-size: 27px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.grade-dupla {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

/* ---- colunas: acessos por mes ---- */

.gcoluna {
  display: flex;
  align-items: flex-end;
  gap: 2px;                     /* respiro entre marcas vizinhas */
  height: 210px;
  padding-top: 22px;
  border-bottom: 1px solid var(--borda);
  background: repeating-linear-gradient(
    to top, transparent, transparent 51px, var(--grade) 51px, var(--grade) 52px);
}

.gcoluna-item {
  flex: 1 1 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  cursor: default;
  min-width: 0;
}

.gcoluna-barra {
  width: 100%;
  max-width: 46px;
  background: var(--serie-1);
  border-radius: 4px 4px 0 0;   /* ponta arredondada, base ancorada */
  min-height: 2px;
  transition: filter .12s;
}

.gcoluna-item:hover .gcoluna-barra,
.gcoluna-item:focus-visible .gcoluna-barra { filter: brightness(1.15); }

.gcoluna-item:focus-visible { outline: 2px solid var(--serie-1); outline-offset: 2px; }

.gcoluna-topo {
  position: absolute;
  top: -20px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--texto);
  font-variant-numeric: tabular-nums;
}

.gcoluna-eixo {
  position: absolute;
  bottom: -34px;
  font-size: 10.5px;
  color: var(--texto-fraco);
  text-align: center;
  line-height: 1.3;
}

.bloco .gcoluna { margin-bottom: 42px; }

/* ---- barras horizontais: rankings ---- */

.barra-item {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 7px 0;
}

.barra-rotulo { min-width: 0; }

.barra-nome {
  display: block;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.barra-sub {
  display: block;
  font-size: 11px;
  color: var(--texto-fraco);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.barra-trilho {
  background: var(--grade);
  border-radius: 4px;
  height: 18px;
  overflow: hidden;
}

.barra-preenchida {
  height: 100%;
  background: var(--serie-1);
  border-radius: 0 4px 4px 0;
}

.barra-valor {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: right;
}

/* ---- tooltip ---- */

.dica-tooltip {
  position: fixed;
  z-index: 60;
  background: #1f2733;
  color: #fff;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}

.dica-tooltip.visivel { opacity: 1; }

@media (max-width: 860px) {
  .barra-item { grid-template-columns: minmax(90px, 130px) 1fr auto; gap: 9px; }
  .gcoluna-eixo { font-size: 9px; }
}

/* Mes sem nenhum acesso nao ganha marca: uma barra minima sugeriria
   movimento onde nao houve. */
.gcoluna-barra.vazia { min-height: 0; background: transparent; }

/* Rodape das telas de autenticacao (login, recuperacao, troca obrigatoria) */
.rodape-login {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--borda);
  text-align: center;
  font-size: 13px;
  color: var(--texto-fraco);
}

.rodape-login a { color: var(--cor-marca); font-weight: 500; }
.rodape-login a:hover { text-decoration: underline; }

/* ---------------------- AUTENTICACAO RESPONSIVA ---------------------- */

@media (max-width: 1040px) {
  .auth-layout { grid-template-columns: minmax(390px, .9fr) minmax(460px, 1.1fr); }
  .auth-chamada > h1 { font-size: 40px; }
  .auth-preview { display: none; }
}

@media (max-width: 820px) {
  .auth-layout { display: block; }
  .auth-apresentacao { display: none; }
  .auth-formulario { min-height: 100vh; padding: 32px 22px; }
  .login-principal {
    background:
      radial-gradient(600px 300px at 50% 0%, rgba(13, 110, 253, .13), transparent 70%),
      #f5f7fb;
  }
}

@media (max-width: 520px) {
  .tela-login { padding: 16px; }
  .login-principal { padding: 0; }
  .auth-formulario { align-items: center; padding: 20px 16px; }
  .card-login { padding: 28px 22px 24px; border-radius: 18px; }
  .login-principal .card-login { box-shadow: 0 16px 42px rgba(20, 37, 63, .09); }
  .card-login .marca { margin-bottom: 25px; }
  .card-login .marca h1 { font-size: 22px; }
  .topbar { padding-right: 10px; gap: 8px; }
  .topbar .titulo { gap: 8px; }
  .chip-ambiente { max-width: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cor-marca) 35%, transparent);
  outline-offset: 2px;
}
