:root{
  --brand: #0b66c3;
  --brand-dark: #094f97;
  --brand-deep: #06274d;
  --ciano: #19c3e6;
  --verde: #12b886;
  --bg: #f2f6fb;
  --card: #ffffff;
  --text: #16202a;
  --muted: #667085;
  --stroke: rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 8px 24px rgba(11, 102, 195, 0.08);
  --shadow-md: 0 22px 50px rgba(11, 102, 195, 0.18);
  --radius: 22px;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

svg{
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* fundo: grade leve + bolhas desfocadas */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(11,102,195,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,102,195,0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: -1;
}

.fundo{ position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.bolha{ position: absolute; border-radius: 50%; filter: blur(70px); opacity: .35; animation: flutuar 18s ease-in-out infinite; }
.b1{ width: 380px; height: 380px; background: var(--ciano); right: -120px; top: 260px; }
.b2{ width: 320px; height: 320px; background: var(--brand); left: -140px; bottom: -80px; animation-delay: -6s; }
.b3{ width: 220px; height: 220px; background: var(--verde); left: 45%; bottom: 10%; opacity: .18; animation-delay: -12s; }

@keyframes flutuar{
  0%, 100%{ transform: translate(0, 0); }
  50%{ transform: translate(-30px, 24px); }
}

/* topo */
.topo{
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 60%, #1689e0 100%);
  padding: 22px 18px 96px;
  position: relative;
  overflow: hidden;
}

.topo::after{
  content: "";
  position: absolute;
  right: -70px;
  bottom: -110px;
  width: 260px;
  height: 260px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
}

.topo__conteudo{
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.btn-voltar{
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #fff;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
  transition: background .2s, transform .2s;
}
.btn-voltar:hover{ background: rgba(255,255,255,.24); transform: translateX(-2px); }

.topo__titulo{ color: #fff; flex: 1; min-width: 0; }
.topo__subtitulo{ margin: 0 0 4px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.topo__titulo h1{ margin: 0; font-size: clamp(24px, 4vw, 32px); }

.usuario{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
}
.usuario__avatar{
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  background: linear-gradient(135deg, var(--ciano), var(--verde));
}
.usuario__nome{ font-size: 14px; font-weight: 600; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usuario__sair{ margin: 0; }
.usuario__sair button{
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-dark);
  background: #fff;
  transition: transform .2s, box-shadow .2s;
}
.usuario__sair button:hover{ transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.usuario__sair svg{ width: 16px; height: 16px; }

/* conteúdo */
.pagina{
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: -64px auto 0;
  padding: 0 18px 40px;
  position: relative;
  z-index: 1;
}

.usuario__tempo{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,.16);
  transition: background .3s;
}
.usuario__tempo svg{ width: 15px; height: 15px; }
.usuario__tempo.acabando{ background: #f04438; animation: pulsar 1s ease-in-out infinite; }
@keyframes pulsar{ 50%{ opacity: .65; } }

.aviso{
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  color: #175cd3;
  background: #eff8ff;
  border: 1px solid #b2ddff;
}

/* login */
.login{
  max-width: 420px;
  margin: 0 auto;
  padding: 34px 30px 28px;
  border-radius: 26px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-md);
  animation: subir .45s ease both;
}

.login__marca{ text-align: center; margin-bottom: 22px; }
.login__escudo{
  width: 66px;
  height: 66px;
  margin: 0 auto 14px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--ciano));
  box-shadow: 0 12px 28px rgba(11,102,195,.35);
}
.login__escudo svg{ width: 34px; height: 34px; }
.login__marca h2{ margin: 0 0 6px; font-size: 22px; }
.login__marca p{ margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.alerta{
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fecdca;
}

.login__form{ display: grid; gap: 14px; }
.campo{ display: grid; gap: 6px; }
.campo > span:first-child{ font-size: 13px; font-weight: 600; color: #344054; }
.campo input{
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid #d0d5dd;
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.campo input:focus{ border-color: var(--brand); box-shadow: 0 0 0 4px rgba(11,102,195,.14); }

.campo__senha{ position: relative; display: block; }
.campo__senha input{ padding-right: 50px; }
.ver-senha{
  position: absolute;
  right: 6px;
  top: 6px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
}
.ver-senha:hover, .ver-senha.ativo{ color: var(--brand); background: rgba(11,102,195,.08); }
.ver-senha svg{ width: 20px; height: 20px; }

.btn-entrar{
  height: 50px;
  margin-top: 4px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #1689e0);
  box-shadow: 0 10px 24px rgba(11,102,195,.3);
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.btn-entrar:hover{ transform: translateY(-2px); box-shadow: 0 14px 30px rgba(11,102,195,.38); }
.btn-entrar:disabled{ opacity: .7; cursor: wait; transform: none; }

.login__ajuda{ margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--muted); line-height: 1.5; }
.login__ajuda a{ color: var(--brand); font-weight: 600; }
.login__ajuda a:hover{ text-decoration: underline; }

/* opções técnicas */
.boas-vindas{
  padding: 26px 28px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-sm);
  animation: subir .4s ease both;
}
.boas-vindas__mini{ margin: 0 0 4px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.boas-vindas h2{ margin: 0; font-size: clamp(22px, 3.4vw, 28px); }

.ferramentas{
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.card{
  --cor: var(--brand);
  --cor2: #1689e0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 250px;
  padding: 28px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s;
  animation: subir .45s ease both;
}
.card:nth-child(2){ animation-delay: .08s; }
.card--remoto{ --cor: #0e9f8a; --cor2: var(--ciano); }

.card::before{
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cor), var(--cor2));
  opacity: .08;
  transition: transform .4s, opacity .3s;
}
.card:hover{ transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--cor) 35%, transparent); }
.card:hover::before{ transform: scale(1.35); opacity: .14; }
.card:focus-visible{ outline: 3px solid var(--cor); outline-offset: 3px; }

.card__icone{
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--cor), var(--cor2));
  box-shadow: 0 12px 26px color-mix(in srgb, var(--cor) 35%, transparent);
  transition: transform .3s;
}
.card__icone svg{ width: 32px; height: 32px; }
.card:hover .card__icone{ transform: rotate(-6deg) scale(1.06); }

.card__texto{ display: grid; gap: 8px; flex: 1; position: relative; }
.card__titulo{ font-size: 20px; font-weight: 700; }
.card__desc{ font-size: 14px; line-height: 1.55; color: var(--muted); }

.card__ir{
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--cor);
  background: color-mix(in srgb, var(--cor) 10%, transparent);
  transition: background .25s, color .25s, gap .25s;
}
.card__ir svg{ width: 18px; height: 18px; }
.card:hover .card__ir{ background: var(--cor); color: #fff; gap: 12px; }

@keyframes subir{
  from{ opacity: 0; transform: translateY(14px); }
  to{ opacity: 1; transform: none; }
}

.rodape{ padding: 22px 18px; text-align: center; font-size: 13px; color: var(--muted); }

@media (max-width: 640px){
  .topo{ padding-bottom: 88px; }
  .topo__conteudo{ flex-wrap: wrap; }
  .usuario{ order: 3; width: 100%; justify-content: space-between; }
  .usuario__nome{ flex: 1; max-width: none; }
  .login{ padding: 28px 20px 22px; }
  .card{ min-height: 0; padding: 22px; }
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- cards novos */
.card--senha{ --cor: #7a5af8; --cor2: #9e77ed; }
.card--config{ --cor: #475467; --cor2: #667085; }

/* ---------------------------------------------------------------- telas internas (acesso com senha / configurar) */
.aviso--topo, .alerta--topo{ max-width: 760px; margin: 0 auto 16px; box-shadow: var(--shadow-sm); }
.painel{
  max-width: 760px;
  margin: 0 auto 18px;
  padding: 26px 28px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.95);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-sm);
  animation: subir .4s ease both;
}
.painel h2{ margin: 6px 0 8px; font-size: 24px; }
.painel h3{ margin: 26px 0 12px; font-size: 17px; }
.painel--abertas h3{ margin-top: 0; }
.painel__voltar{ font-size: 14px; font-weight: 600; color: var(--brand); }
.painel__voltar:hover{ text-decoration: underline; }
.painel__desc{ margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.painel__desc small{ color: #b54708; font-weight: 600; }
.form-senha, .form-config{ display: grid; gap: 14px; }
.vazio{ margin: 0; color: var(--muted); font-size: 14px; }

.lista-pc{
  display: grid;
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
  padding: 2px;
}
.pc{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #d0d5dd;
  background: #fff;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.pc:hover{ border-color: var(--brand); }
.pc:has(input:checked){ border-color: var(--brand); box-shadow: 0 0 0 4px rgba(11,102,195,.14); }
.pc input{ accent-color: var(--brand); width: 18px; height: 18px; margin: 0; }
.pc__ponto{ width: 9px; height: 9px; border-radius: 50%; background: var(--verde); flex: 0 0 9px; }
.pc__nome{ flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc__estado{ font-size: 12px; color: var(--muted); }
.pc__tag{ font-size: 11px; font-weight: 700; color: #6941c6; background: #f4f3ff; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.pc--off{ cursor: not-allowed; opacity: .55; }
.pc--off .pc__ponto{ background: #98a2b3; }

.grade-2{ display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.campo--curto{ max-width: 260px; }

.tabela-rolar{ overflow-x: auto; }
.tabela{ width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th{ text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid #eaecf0; white-space: nowrap; }
.tabela td{ padding: 10px; border-bottom: 1px solid #f2f4f7; white-space: nowrap; }
.tabela .ativo{ color: #6941c6; }

.aberta{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid #f2f4f7;
  font-size: 14px;
}
.aberta:last-child{ border-bottom: 0; }
.aberta button{
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #b42318;
  background: #fef3f2;
  cursor: pointer;
}
.aberta button:hover{ background: #fee4e2; }

@media (max-width: 640px){
  .painel{ padding: 20px 18px; }
}

/* aba: o conteúdo logado só aparece depois do script conferir que é a mesma aba do login (sessionStorage) */
body.logado .pagina, body.logado .usuario{ visibility: hidden; }
.aba-ok body.logado .pagina, .aba-ok body.logado .usuario{ visibility: visible; }

/* chave liga/desliga (configuração) */
.chave{ position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid #d0d5dd; background: #fff; cursor: pointer; }
.chave input{ position: absolute; opacity: 0; pointer-events: none; }
.chave__trilho{ position: relative; flex: 0 0 44px; height: 24px; margin-top: 2px; border-radius: 999px; background: #d0d5dd; transition: background .2s; }
.chave__trilho::after{ content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.chave input:checked + .chave__trilho{ background: var(--brand); }
.chave input:checked + .chave__trilho::after{ transform: translateX(20px); }
.chave input:focus-visible + .chave__trilho{ box-shadow: 0 0 0 4px rgba(11,102,195,.2); }
.chave__texto{ display: grid; gap: 4px; font-size: 14px; }
.chave__texto small{ color: var(--muted); line-height: 1.5; }
