/* Login and administration pages (on top of style.css). */

body.page {
  overflow: auto;
  display: block;
  min-height: 100%;
}

.mono,
code,
pre {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* ---- buttons ---- */

.btn-primary,
.btn-sec,
.btn-perigo,
.btn-perigo-cheio {
  border: none;
  border-radius: 7px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand);
  color: var(--brand-text, #fff);
}

.btn-primary:hover {
  filter: brightness(1.12);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-sec {
  background: #172840;
  color: #e3e5e8;
  border: 1px solid #2a3e5a;
}

.btn-sec:hover {
  background: #213450;
}

.btn-sec:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-perigo {
  background: transparent;
  color: #ff9a9a;
  border: 1px solid #5a2a2a;
}

.btn-perigo:hover {
  background: rgba(226, 126, 126, 0.12);
}

.btn-perigo-cheio {
  background: #c0392b;
  color: #fff;
}

.btn-perigo-cheio:hover {
  background: #d64534;
}

.btn-icone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-icone span {
  font-size: 17px;
  line-height: 1;
}

/* ---- form fields ---- */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
  background: #0d1726;
  border: 1px solid #2a3e5a;
  color: #d5d8dc;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  min-width: 0;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
}

input[type="color"] {
  width: 46px;
  height: 36px;
  padding: 2px;
  background: #0d1726;
  border: 1px solid #2a3e5a;
  border-radius: 7px;
  cursor: pointer;
}

input[type="file"] {
  font-size: 12px;
  color: #d5d8dc;
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: #a3abb6;
}

.campo > span {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #959fad;
}

.campo small {
  font-size: 11px;
  color: #74839a;
}

.form-error {
  color: #ff9a9a;
  font-size: 13px;
  min-height: 18px;
}

/* ---- login ---- */

/* Honeycomb pattern plus two soft glows (one in the brand color) so the
   frosted glass card has something to blur. */
.login-page {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(520px 420px at 40% 32%, color-mix(in srgb, var(--brand) 38%, transparent), transparent 70%),
    radial-gradient(560px 460px at 62% 72%, rgba(70, 120, 200, 0.34), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97'%3E%3Cpath d='M28 0L56 16.2V48.5L28 64.7L0 48.5V16.2Z M28 64.7V97' fill='none' stroke='rgba(213,216,220,0.06)' stroke-width='1'/%3E%3Cpath d='M0 48.5V80.8L-28 97 M56 48.5V80.8L84 97' fill='none' stroke='rgba(213,216,220,0.06)' stroke-width='1'/%3E%3C/svg%3E"),
    #142339;
}

/* Pointy-top regular hexagon: height = width * 2/sqrt(3). */
.login-card {
  --hex: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  position: relative;
  width: 520px;
  aspect-ratio: 0.866 / 1;
  margin: auto;
  flex: 0 0 auto;
}

.login-hex-glass {
  position: absolute;
  inset: 0;
  clip-path: var(--hex);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02) 45%, rgba(17, 29, 47, 0.25));
  background-color: rgba(26, 46, 73, 0.38);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}

/* clip-path removes box-shadow, so the shadow is a blurred hexagon behind */
.login-hex-shadow {
  position: absolute;
  inset: 6% 4% -4%;
  filter: blur(28px);
  opacity: 0.55;
}

.login-hex-shadow span {
  display: block;
  width: 100%;
  height: 100%;
  clip-path: var(--hex);
  background: #050a12;
}

.login-hex-border {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.login-conteudo {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 110px;
}

.login-page input[type="email"],
.login-page input[type="password"] {
  background: rgba(10, 17, 29, 0.5);
  border-color: rgba(213, 216, 220, 0.14);
  padding: 9px 11px;
}

.login-page input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}

/* too narrow or short for the hexagon: a rounded glass card */
@media (max-width: 560px), (max-height: 640px) {
  .login-card {
    width: 100%;
    max-width: 380px;
    aspect-ratio: auto;
  }

  .login-hex-glass {
    clip-path: none;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
  }

  .login-hex-shadow,
  .login-hex-border {
    display: none;
  }

  .login-conteudo {
    position: relative;
    padding: 28px 24px 22px;
  }
}

/* two-step setup and recovery codes need more room than the hexagon */
.login-card.amplo {
  width: 100%;
  max-width: 440px;
  aspect-ratio: auto;
}

.login-card.amplo .login-hex-glass {
  clip-path: none;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.login-card.amplo .login-hex-shadow,
.login-card.amplo .login-hex-border {
  display: none;
}

.login-card.amplo .login-conteudo {
  position: relative;
  padding: 28px 28px 22px;
}

.login-2fa {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.login-2fa[hidden] {
  display: none;
}

.login-page input#codigo-2fa {
  background: rgba(10, 17, 29, 0.5);
  border-color: rgba(213, 216, 220, 0.14);
  padding: 9px 11px;
  font-size: 18px;
  letter-spacing: 0.2em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.login-passos {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: #c9d1db;
  line-height: 1.5;
}

.login-qr {
  align-self: center;
  border-radius: 8px;
  margin: 6px 0 2px;
  background: #fff;
}

.login-chave {
  margin: 0;
  font-size: 12px;
  color: #8a9ab0;
  text-align: center;
}

.login-chave code {
  display: block;
  margin-top: 2px;
  color: #d5d8dc;
  font-size: 12px;
  word-break: break-all;
  user-select: all;
}

.login-dica {
  margin: 4px 0 0;
  font-size: 12px;
  color: #8a9ab0;
}

.login-voltar {
  margin-top: 6px;
  font-size: 12px;
  color: #8a9ab0;
  text-align: center;
  text-decoration: none;
}

.login-voltar:hover {
  color: var(--brand);
}

.login-codigos {
  list-style: none;
  margin: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  border-radius: 10px;
  background: rgba(10, 17, 29, 0.5);
  border: 1px solid rgba(213, 216, 220, 0.14);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  text-align: center;
  color: #e8ecf1;
}

.login-codigos-acoes {
  display: flex;
  gap: 8px;
}

.login-codigos-acoes .btn-sec {
  flex: 1;
}

.login-card label.login-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 2px;
  font-size: 13px;
  color: #c9d1db;
}

.login-brand {
  margin-bottom: 22px;
}

.login-brand .brand-logo {
  height: 40px;
  max-width: 180px;
}

.login-logo {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.login-brand .brand-badge {
  width: 40px;
  height: 40px;
  font-size: 19px;
}

.login-card h1 {
  font-size: 20px;
  margin: 0 0 4px;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 18px;
}

/* the password row hides on the e-mail step at app.<domain> */
#campo-senha {
  display: contents;
}

#campo-senha[hidden] {
  display: none;
}

.login-card label {
  font-size: 12px;
  color: #a3abb6;
  margin-top: 6px;
}

.login-card .btn-primary {
  margin-top: 6px;
  padding: 10px 14px;
  font-size: 14px;
}

.login-legal {
  margin: 22px 0 0;
  text-align: center;
  font-size: 11px;
  color: #65758b;
}

.login-legal a {
  color: #8a9ab0;
  text-decoration: none;
}

.login-legal a:hover {
  color: #e5a82e;
}

/* ---- admin layout ---- */

.admin-page {
  --header-h: 58px;
  --sidebar-w: 236px;
  --esp-1: 8px;
  --esp-2: 16px;
  --esp-3: 24px;
  --esp-4: 32px;
}

/* helper text was too small and dim to read comfortably */
.admin-page .muted {
  color: #9aa6b7;
  font-size: 12.5px;
}

.admin-page header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  padding: 0 var(--esp-3) 0 var(--esp-2);
}

.header-left {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: var(--esp-1);
  min-width: 0;
  overflow: hidden;
}

.admin-page .header-actions {
  flex: 0 0 auto;
  gap: var(--esp-1);
}

.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid #213450;
  border-radius: 8px;
  background: #172840;
  color: #d5d8dc;
  cursor: pointer;
}

.nav-toggle:hover {
  background: #2a3e5a;
}

.btn-escritorio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  border-color: color-mix(in srgb, var(--brand) 45%, #213450);
  color: #fff;
}

.btn-escritorio svg {
  color: var(--brand);
}

.btn-escritorio[hidden] {
  display: none;
}

.admin-layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}

/* full-height side menu with a faint honeycomb, like the login page */
.admin-nav {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  position: sticky;
  top: var(--header-h);
  align-self: flex-start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--esp-3) 12px var(--esp-4);
  background-color: #0f1a2b;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='48.5' viewBox='0 0 28 48.5'%3E%3Cpath d='M14 0l14 8.08v16.17L14 32.33 0 24.25V8.08zM14 32.33v16.17' fill='none' stroke='%23e5a82e' stroke-opacity='.05' stroke-width='1'/%3E%3C/svg%3E");
  background-position: bottom left;
  border-right: 1px solid #1a2e49;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #c4cad2;
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.25;
  transition: background 0.12s, color 0.12s;
}

.nav-icone {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.75;
}

.admin-nav a:hover {
  background: #172840;
  color: #fff;
}

.admin-nav a.ativo {
  background: var(--brand-soft);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brand);
  font-weight: 600;
}

.admin-nav a.ativo .nav-icone {
  stroke: var(--brand);
  opacity: 1;
}

.admin-nav a:focus-visible,
.nav-toggle:focus-visible,
.btn-escritorio:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.nav-grupo {
  margin: var(--esp-3) 12px 6px;
  padding-top: var(--esp-2);
  border-top: 1px solid #1a2e49;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a97aa;
}

.nav-fundo {
  display: none;
}

.admin-main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 1160px;
  padding: var(--esp-4) var(--esp-4) 64px;
}

.secao-head {
  margin-bottom: var(--esp-3);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--esp-2);
  flex-wrap: wrap;
}

.secao-head-acao {
  flex: 0 0 auto;
}

.secao-head h1 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.01em;
}

.secao-head p {
  margin: 0;
}

.card {
  background: #111d2f;
  border: 1px solid #1a2e49;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: var(--esp-3);
}

.card.estreito {
  max-width: 420px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.card > .muted {
  margin: -4px 0 12px;
}

.linha-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.linha-form .campo {
  flex: 1 1 160px;
}

.linha-form .campo:has(input[type="color"]) {
  flex: 0 0 auto;
}

/* new client: label, field and hint rows line up, the hint never pushes
   its field up */
.form-novo-cliente {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 12px;
}

.form-novo-cliente input,
.form-novo-cliente button,
.cliente-card .linha-form input,
.cliente-card .linha-form > .btn-primary {
  box-sizing: border-box;
  height: 36px;
}

@media (max-width: 760px) {
  .form-novo-cliente {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .form-novo-cliente .campo:first-child {
    grid-column: 1 / -1;
  }
}

/* logo upload: a dashed drop area across the card */
.campo-logo {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.campo-logo > .btn-pequeno {
  align-self: flex-start;
}

.zona-upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 14px 18px;
  border: 1.5px dashed #3a5070;
  border-radius: 10px;
  background: #0d1726;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.zona-upload:hover,
.zona-upload.arrastando {
  border-color: var(--brand);
  background: #12213a;
}

.zona-upload:focus-within {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.zona-upload.enviando {
  opacity: 0.7;
  pointer-events: none;
}

.zona-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.zona-upload-icone {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #142339;
  color: #9aa6b7;
  font-size: 22px;
}

.zona-upload-previa {
  flex: none;
  height: 44px;
  max-width: 140px;
  object-fit: contain;
}

.zona-upload-texto {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-transform: none;
  letter-spacing: 0;
}

.zona-upload-texto strong {
  font-size: 13.5px;
  font-weight: 600;
  color: #d5d8dc;
}

.zona-upload-texto small {
  font-size: 12px;
  color: #74839a;
}

.btn-pequeno {
  padding: 5px 10px;
  font-size: 12px;
}

.coluna-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.coluna-form .btn-primary {
  align-self: flex-start;
}

/* ---- tables ---- */

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

.tabela th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #959fad;
  padding: 8px 10px;
  border-bottom: 1px solid #213450;
}

.tabela td {
  padding: 9px 10px;
  border-bottom: 1px solid #172840;
  vertical-align: middle;
}

.tabela td.acoes {
  text-align: right;
  white-space: nowrap;
}

.tabela td.acoes button + button {
  margin-left: 6px;
}

.tabela code {
  font-size: 12px;
  color: #e3e5e8;
}

.tabela select {
  padding: 5px 8px;
}

.tag {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #1a2e49;
  color: #a3abb6;
  font-size: 10.5px;
}

.tag-ok {
  background: rgba(46, 160, 67, 0.18);
  color: #7ee2a8;
}

/* two-step verification (Minha conta) */
.card .aviso {
  margin: 0 0 10px;
  font-size: 13px;
  color: #f2c26b;
}

.linha-botoes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.codigos-recuperacao {
  list-style: none;
  margin: 12px 0 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  border-radius: 10px;
  background: #0f1a2b;
  border: 1px solid rgba(213, 216, 220, 0.12);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  text-align: center;
}

.vazio {
  color: #74839a;
  font-style: italic;
  font-size: 13px;
}

/* ---- integration ---- */

.passos {
  margin: 8px 0;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.6;
}

.passos a {
  color: var(--brand-link, var(--brand));
}

.codigo {
  position: relative;
  margin: 6px 0 12px 20px;
}

.codigo pre {
  margin: 0;
  padding: 12px 14px;
  background: #0a111d;
  border: 1px solid #1a2e49;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.5;
  color: #e3e5e8;
}

.codigo .mini-btn {
  position: absolute;
  top: 8px;
  right: 8px;
}

.token-novo {
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(46, 204, 113, 0.08);
  border: 1px solid rgba(46, 204, 113, 0.35);
  font-size: 13px;
}

.token-valor {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.token-valor code {
  flex: 1 1 auto;
  padding: 7px 10px;
  border-radius: 6px;
  background: #0a111d;
  font-size: 12.5px;
  word-break: break-all;
}

/* ---- clients ---- */

.cliente-topo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.cliente-info {
  flex: 1 1 auto;
  min-width: 0;
}

.cliente-info h2 {
  margin: 0 0 2px;
}

.cliente-info a {
  color: var(--brand-link, var(--brand));
}

.cliente-logo {
  height: 40px;
  max-width: 120px;
  object-fit: contain;
}

.cliente-topo .brand-badge {
  width: 40px;
  height: 40px;
  font-size: 18px;
}

/* ---- toast ---- */

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 8px;
  background: #1e4d2b;
  color: #d6f5e0;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.toast.erro {
  background: #5a1f1f;
  color: #ffd9d9;
}

.toast.hidden {
  display: none;
}

/* narrow screens: the side menu becomes a drawer */
@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  .admin-nav {
    position: fixed;
    z-index: 40;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    height: auto;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.35);
  }

  .nav-aberta .admin-nav {
    transform: none;
  }

  .nav-fundo:not([hidden]) {
    display: block;
    position: fixed;
    z-index: 35;
    inset: var(--header-h) 0 0 0;
    background: rgba(6, 12, 22, 0.55);
  }

  .admin-main {
    padding: var(--esp-3) var(--esp-2) 48px;
  }
}

@media (max-width: 760px) {
  /* compact header: icons and short labels only */
  .btn-escritorio span,
  .admin-page .brand-sub,
  .cliente-ativo .muted,
  .admin-page #user-name,
  .admin-page .user-btn .caret {
    display: none;
  }

  .admin-page header {
    padding: 0 12px;
  }

  .admin-page .colmeia-logo {
    height: 22px;
  }

  .admin-page .user-btn {
    padding: 0 4px;
  }

  .card {
    padding: 16px;
  }

  .tabela {
    display: block;
    overflow-x: auto;
  }
}

/* master admin: which client is being edited */
.cliente-ativo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cliente-ativo[hidden] {
  display: none;
}

.cliente-ativo strong {
  color: #fff;
  font-weight: 600;
}

.cliente-ativo-ponto {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ---- integration docs ---- */

.doc .card h3 {
  margin: 16px 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #959fad;
}

.doc .card h2 + h3 {
  margin-top: 4px;
}

.doc-texto {
  margin: 0 0 10px;
  max-width: 72ch;
  font-size: 13.5px;
  line-height: 1.6;
}

.doc-texto a,
.doc-link {
  color: var(--brand-link, var(--brand));
}

.doc .codigo {
  margin-left: 0;
}

.doc-lista {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  font-size: 13.5px;
  line-height: 1.55;
  max-width: 78ch;
}

.doc code,
.tabela-doc code {
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #0a111d;
  color: #efca80;
}

.doc .codigo code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.tabela-rolagem {
  overflow-x: auto;
  margin-bottom: 4px;
}

.tabela-doc td {
  vertical-align: top;
  line-height: 1.5;
}

.tabela-doc td:first-child {
  white-space: nowrap;
}

.doc-robo {
  max-width: 420px;
  margin-bottom: 16px;
}

.doc-robo .campo select {
  width: 100%;
}

.doc-fluxo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px;
}

.doc-etapa {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border: 1px solid #2a3e5a;
  border-radius: 10px;
  background: #142339;
  font-size: 13px;
  font-weight: 600;
}

.doc-etapa small {
  font-weight: 400;
  color: #8691a2;
}

.doc-seta {
  color: var(--brand);
  font-size: 18px;
}

.doc-teste-acoes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.doc-link {
  font-size: 13px;
  margin-left: 4px;
}

.doc-teste-situacao {
  margin: 10px 0 0;
  min-height: 1.4em;
  font-size: 13px;
  color: #a3abb6;
}

/* ---- savings (Economia) ---- */

.periodos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.periodo-btn {
  padding: 7px 12px;
  border: 1px solid #2a3e5a;
  border-radius: 999px;
  background: #142339;
  color: #d5d8dc;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.periodo-btn:hover {
  background: #1a2e49;
}

.periodo-btn[aria-pressed="true"] {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: #fff;
}

.periodo-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.periodo-personalizado {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.periodo-personalizado .campo {
  flex: 0 1 180px;
}

.periodo-datas {
  margin: 0 0 12px;
  font-size: 12.5px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid #1a2e49;
  border-radius: 12px;
  background: #111d2f;
}

.tile.destaque {
  border-color: color-mix(in srgb, var(--brand) 45%, #1a2e49);
  background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 12%, #111d2f), #111d2f 70%);
}

.tile-rotulo {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #959fad;
}

.tile-valor {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.tile-nota {
  font-size: 12px;
  color: #8691a2;
}

.avisos-economia {
  margin-bottom: var(--esp-3, 16px);
  border: 1px solid #3d3a2c;
  border-radius: 10px;
  background: rgba(229, 168, 46, 0.05);
  font-size: 13px;
}

.avisos-economia summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  color: #e9d6aa;
}

.avisos-economia summary::-webkit-details-marker {
  display: none;
}

.avisos-icone {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e5a82e;
  color: #1a2e49;
  font-size: 12px;
  font-weight: 800;
}

.avisos-ver {
  margin-left: auto;
  font-size: 12px;
  color: var(--brand);
  white-space: nowrap;
}

.avisos-ver::after {
  content: " ▾";
}

.avisos-economia[open] .avisos-ver::after {
  content: " ▴";
}

.avisos-economia summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 10px;
}

.avisos-economia ul {
  margin: 0;
  padding: 0 16px 12px 42px;
  display: grid;
  gap: 6px;
  line-height: 1.5;
}

.avisos-economia a,
.economia .doc-texto a,
.economia .muted a,
.modo a {
  color: var(--brand-link, var(--brand));
}

.tabela-numeros td.num,
.tabela-numeros th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tabela-numeros td.forte {
  color: #fff;
  font-weight: 600;
}

.tabela-numeros tr.nao-configurado td {
  color: #8691a2;
}

.robo-nome {
  color: #e3e5e8;
  font-weight: 500;
}

.tag-pendente {
  display: inline-block;
  margin-top: 2px;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(229, 168, 46, 0.12);
  color: #efca80;
  font-size: 11px;
}

.nota-economia {
  font-size: 12.5px;
  max-width: 80ch;
}

.aviso-lgpd {
  margin: 4px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0;
  background: #142339;
  font-size: 13px;
  line-height: 1.55;
  max-width: 80ch;
}

.opcao-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  max-width: 80ch;
}

.opcao-check input {
  margin-top: 3px;
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
}

.opcao-check span {
  display: grid;
  gap: 4px;
  font-size: 13.5px;
}

.opcao-check small {
  color: #8691a2;
  line-height: 1.5;
}

.tabela tr.editando input {
  width: 100%;
}

.tabela td.acoes .btn-primary,
.tabela td.acoes .btn-sec,
.tabela td.acoes .mini-btn {
  margin-left: 6px;
}

.modos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.modo {
  padding: 12px 14px;
  border: 1px solid #1a2e49;
  border-radius: 10px;
  background: #142339;
  font-size: 13px;
}

.modo p {
  margin: 6px 0;
  line-height: 1.5;
}

.tabela-tempos td {
  vertical-align: middle;
}

.tabela-tempos select,
.tabela-tempos input {
  width: 100%;
  min-width: 120px;
}

.tabela-tempos .minutos {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tabela-tempos .minutos input {
  width: 90px;
  min-width: 70px;
}

.tabela-tempos .sufixo {
  font-size: 12px;
  white-space: nowrap;
}

/* a link styled as the primary button (skill download) */
a.btn-link {
  display: inline-block;
  text-decoration: none;
}

.card-skill {
  border-color: color-mix(in srgb, var(--brand) 35%, #1a2e49);
}

/* ---- modal dialogs ---- */

.modal {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid #2a3e5a;
  border-radius: 14px;
  background: #111d2f;
  color: #d5d8dc;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.modal::backdrop {
  background: rgba(6, 12, 22, 0.6);
  backdrop-filter: blur(2px);
}

.modal[open] {
  animation: modal-entra 0.16s ease-out;
}

@keyframes modal-entra {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0 24px;
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
}

.modal-x {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #9aa6b7;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-x:hover {
  background: #172840;
  color: #fff;
}

.modal > :not(.modal-head) {
  padding: 14px 24px 22px;
}

.modal-texto {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.5;
}

.modal .coluna-form {
  gap: 14px;
}

.modal-acoes {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.modal .coluna-form .modal-acoes .btn-primary {
  align-self: auto;
}

.campo-com-botao {
  display: flex;
  gap: 8px;
  align-items: center;
}

.campo-com-botao input {
  flex: 1 1 auto;
  min-width: 0;
}

input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---- "⋯" action menu ---- */

.menu-acoes-btn {
  width: 32px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #9aa6b7;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.menu-acoes-btn:hover,
.menu-acoes-btn[aria-expanded="true"] {
  background: #172840;
  border-color: #2a3e5a;
  color: #fff;
}

.menu-acoes {
  position: fixed;
  z-index: 60;
  min-width: 200px;
  padding: 6px;
  border: 1px solid #2a3e5a;
  border-radius: 10px;
  background: #13213a;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
}

.menu-acoes-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #d5d8dc;
  font: inherit;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-acoes-item:hover,
.menu-acoes-item:focus-visible {
  background: #1d3150;
  color: #fff;
  outline: none;
}

.menu-acoes-item.perigo {
  color: #ff9a9a;
}

.menu-acoes-item.perigo:hover,
.menu-acoes-item.perigo:focus-visible {
  background: rgba(226, 126, 126, 0.14);
}

.menu-acoes-sep {
  height: 1px;
  margin: 5px 4px;
  background: #213450;
}

/* ---- robots page ---- */

.card-topo {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.card-topo h2 {
  margin: 0;
}

.robos-resumo {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.resumo-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filtros {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.filtros input[type="search"] {
  flex: 1 1 240px;
  max-width: 360px;
  background: #0d1726;
  border: 1px solid #2a3e5a;
  color: #d5d8dc;
  border-radius: 7px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}

.filtros select {
  flex: 0 1 200px;
}

.tabela-rolagem {
  overflow-x: auto;
}

.tabela-robos td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.tabela-robos tbody tr {
  transition: background 0.12s;
}

.tabela-robos tbody tr:hover {
  background: #142339;
}

.robo-nome {
  font-weight: 600;
  color: #eef0f2;
}

/* robot sprite, first frame of its strip, pixel-sharp */
.avatar-robo {
  flex: none;
  display: inline-block;
  width: 32px;
  height: 32px;
  background: url(assets/robot.png?v=4) 0 0 / 224px 32px no-repeat;
  image-rendering: pixelated;
}

.avatar-robo.classico {
  background-image: url(assets/robot_classico.png?v=1);
}

.avatar-robo.grande {
  width: 64px;
  height: 64px;
  background-size: 448px 64px;
}

.robo-celula {
  display: flex;
  align-items: center;
  gap: 10px;
}

.seletor-aparencia {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.opcao-aparencia {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px 8px;
  border: 1px solid #2a3e5a;
  border-radius: 10px;
  background: #142339;
  color: #c9d1dc;
  font-size: 13px;
  cursor: pointer;
}

.opcao-aparencia:hover {
  border-color: #3c5578;
}

.opcao-aparencia input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.opcao-aparencia:has(input:checked) {
  border-color: #e5a82e;
  background: #1c2c44;
  color: #eef0f2;
}

.opcao-aparencia:has(input:focus-visible) {
  outline: 2px solid #e5a82e;
  outline-offset: 2px;
}

.robo-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.robo-sub code {
  font-size: 11.5px;
  color: #9aa6b7;
}

.robo-sub .mini-btn {
  opacity: 0;
  transition: opacity 0.12s;
}

.tabela-robos tr:hover .robo-sub .mini-btn,
.robo-sub .mini-btn:focus-visible {
  opacity: 1;
}

.status-selo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: #1a2e49;
  color: #c4cad2;
}

.status-ponto {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a3abb6;
}

.status-working {
  background: rgba(229, 168, 46, 0.14);
  color: #f2c766;
}

.status-working .status-ponto {
  background: #e5a82e;
  box-shadow: 0 0 0 0 rgba(229, 168, 46, 0.6);
  animation: pulso 1.6s infinite;
}

.status-success {
  background: rgba(46, 204, 113, 0.12);
  color: #7ee2a0;
}

.status-success .status-ponto {
  background: #2ecc71;
}

.status-error {
  background: rgba(231, 76, 60, 0.14);
  color: #ff9a9a;
}

.status-error .status-ponto {
  background: #e74c3c;
}

@keyframes pulso {
  70% {
    box-shadow: 0 0 0 6px rgba(229, 168, 46, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(229, 168, 46, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-working .status-ponto,
  .modal[open] {
    animation: none;
  }
}

.col-quando {
  white-space: nowrap;
}

.hoje {
  display: inline-flex;
  gap: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hoje-ok {
  color: #7ee2a0;
}

.hoje-erro {
  color: #ff9a9a;
}

.estado-vazio {
  text-align: center;
  padding: 40px 24px;
}

.estado-vazio-icone {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--brand-soft);
}

.estado-vazio-icone .nav-icone {
  width: 28px;
  height: 28px;
  stroke: var(--brand);
  opacity: 1;
}

.estado-vazio h2 {
  margin: 0 0 6px;
}

.estado-vazio p {
  margin: 0 auto 16px;
  max-width: 46ch;
}

@media (max-width: 760px) {
  .col-setor,
  .col-quando,
  .col-hoje {
    display: none;
  }

  .robo-sub .mini-btn {
    opacity: 1;
  }
}

.modal-texto + .campo {
  margin-top: 16px;
}

/* ---- results: headline, comparison, chart ---- */

.acoes-cabecalho {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tiles-3 {
  grid-template-columns: 1.35fr 1fr 1fr;
}

.tiles-2 {
  grid-template-columns: 1.35fr 1fr;
}

.tile.heroi .tile-valor {
  font-size: 36px;
  color: var(--brand);
  letter-spacing: -0.01em;
}

.variacao {
  margin-top: 6px;
  font-size: 12px;
  color: #9aa6b7;
}

.variacao-pct {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.variacao.sobe .variacao-pct {
  color: #7ee2a0;
}

.variacao.desce .variacao-pct {
  color: #ff9a9a;
}

.grafico-card .card-topo {
  margin-bottom: 18px;
}

.grafico {
  padding: 4px 0 0 44px;
}

.grafico-area {
  position: relative;
  height: 220px;
  margin-bottom: 26px;
}

.grafico-grade {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid #1a2e49;
}

.grafico-grade:first-child {
  border-top-color: #2a3e5a;
}

.grafico-y {
  position: absolute;
  right: calc(100% + 8px);
  top: -8px;
  font-size: 11px;
  color: #8691a2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.grafico-barras {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

/* the whole column is the hover target, wider than the bar */
.grafico-col {
  position: relative;
  flex: 1 1 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
}

.grafico-barra {
  width: min(70%, 36px);
  min-height: 0;
  border-radius: 4px 4px 0 0;
  background: var(--brand);
  transition: filter 0.12s;
}

.grafico-col.parcial .grafico-barra {
  background: repeating-linear-gradient(135deg, var(--brand) 0 4px, color-mix(in srgb, var(--brand) 55%, #111d2f) 4px 7px);
}

.grafico-col.ativa {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px 6px 0 0;
}

.grafico-col.ativa .grafico-barra {
  filter: brightness(1.15);
}

.grafico-x {
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #8691a2;
  white-space: nowrap;
}

.grafico-dica {
  position: absolute;
  top: 0;
  transform: translate(-50%, -100%);
  z-index: 2;
  display: grid;
  gap: 2px;
  min-width: 130px;
  padding: 8px 10px;
  border: 1px solid #2a3e5a;
  border-radius: 8px;
  background: #0d1726;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
}

.grafico-dica strong {
  color: #fff;
}

@media (max-width: 760px) {
  .tiles-2,
  .tiles-3 {
    grid-template-columns: 1fr;
  }

  .tile.heroi .tile-valor {
    font-size: 30px;
  }

  .grafico {
    padding-left: 36px;
  }

  .grafico-area {
    height: 180px;
  }

  .acoes-cabecalho {
    width: 100%;
  }
}

/* ---- print / save as PDF (Resultados) ---- */

@media print {
  body.admin-page {
    background: #fff;
    color: #111;
  }

  .admin-page header,
  .admin-nav,
  .nav-fundo,
  .periodos,
  .periodo-personalizado,
  .secao-head-acao,
  .toast {
    display: none !important;
  }

  .admin-layout {
    display: block;
    min-height: 0;
  }

  .admin-main {
    max-width: none;
    padding: 0;
  }

  .card,
  .tile,
  .avisos-economia {
    background: #fff !important;
    border-color: #ccc !important;
    color: #111;
    break-inside: avoid;
  }

  .secao-head h1,
  .card h2,
  .tile-valor,
  .robo-nome,
  .tabela-numeros td.forte,
  .grafico-dica strong {
    color: #111 !important;
  }

  .admin-page .muted,
  .tile-rotulo,
  .tile-nota,
  .variacao,
  .tabela th,
  .grafico-x,
  .grafico-y {
    color: #555 !important;
  }

  .tile.heroi .tile-valor {
    color: #9a6a00 !important;
  }

  .grafico-barra {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .grafico-grade {
    border-color: #ddd !important;
  }

  .tabela td {
    border-color: #e5e5e5;
  }
}

input[type="date"] {
  color-scheme: dark;
  font: inherit;
  font-size: 13px;
}

@media print {
  input[type="date"] {
    color-scheme: light;
  }
}

@media print {
  .avisos-economia summary,
  .tag-pendente {
    color: #6b4e00 !important;
  }

  .avisos-ver {
    display: none;
  }
}
