:root {
  --amarelo-raspa: #ffb81c;
  --azul-raspa: #009cde;
  --magenta-raspa: #e4007b;
  --azul-escuro: #003087;
  --verde-jsc: var(--azul-raspa);
  --vermelho-jsc: var(--magenta-raspa);
  --fundo: #f5f8fc;
  --texto: #1a1a2e;
  --branco: #ffffff;
  --sombra: 0 8px 24px rgba(0, 48, 135, 0.1);
  --raio: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Fundo aleatório no login (assets/fundos) */
body.login-com-fundo {
  position: relative;
  isolation: isolate;
}

body.login-com-fundo::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: var(--login-fundo);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.2;
  pointer-events: none;
}

a {
  color: var(--verde-jsc);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.topbar {
  background: var(--branco);
  border-bottom: 4px solid var(--amarelo-raspa);
  box-shadow: var(--sombra);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1rem;
}
.brand span:first-child {
  color: var(--amarelo-raspa);
}
.brand span:last-child {
  color: var(--magenta-raspa);
  font-size: 0.78rem;
}

.clover {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--amarelo-raspa) 55%, var(--azul-raspa) 55%);
}

/* —— Menu principal (dropdown + mobile) —— */
.topbar-inicio {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.topbar-inicio .brand {
  text-decoration: none;
  color: inherit;
}
.topbar-inicio .brand:hover {
  text-decoration: none;
  opacity: 0.92;
}
.brand-logo-wrap {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e5e8ee;
}
.brand-logo-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.brand-accent {
  color: var(--vermelho-jsc);
}
.brand-sub {
  font-size: 0.65rem;
  font-weight: 600;
  color: #666;
  letter-spacing: 0.12em;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem 1rem;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-item {
  position: relative;
}

.nav-link,
.nav-dropdown-btn,
.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--texto);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover,
.nav-dropdown-btn:hover,
.nav-user-btn:hover {
  color: var(--verde-jsc);
  background: rgba(0, 90, 135, 0.06);
  text-decoration: none;
}

.nav-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.55;
  margin-top: 2px;
  transition: transform 0.2s;
}
.nav-item-dropdown.is-open .nav-chevron,
.nav-utilizador.is-open .nav-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-panel,
.nav-user-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 220px;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: var(--branco);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 200;
}
.nav-item-dropdown.is-open .nav-dropdown-panel,
.nav-utilizador.is-open .nav-user-panel {
  display: block;
}
.nav-dropdown-panel a,
.nav-user-panel a,
.nav-user-logout {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 1rem;
  margin: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--texto);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.nav-dropdown-panel a:hover,
.nav-user-panel a:hover,
.nav-user-logout:hover {
  background: rgba(255, 184, 28, 0.15);
  color: var(--verde-jsc);
  text-decoration: none;
}
.nav-user-logout-form {
  margin: 0;
}

.nav-utilizador {
  position: relative;
  flex-shrink: 0;
}
.nav-user-btn {
  max-width: 200px;
}
.nav-user-nome {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amarelo-raspa), var(--azul-raspa));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-user-info {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: #666;
  border-bottom: 1px solid #eee;
  pointer-events: none;
  line-height: 1.35;
}
.nav-user-login-id {
  display: block;
  font-size: 0.75rem;
  color: #999;
  font-weight: 500;
  margin-top: 0.15rem;
}

.config-fundos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 0.5rem;
}
.config-fundo-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  cursor: pointer;
  border: 2px solid #e5e8ee;
  border-radius: 12px;
  padding: 0.45rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.config-fundo-card:hover {
  border-color: rgba(0, 156, 222, 0.45);
}
.config-fundo-card.is-activo,
.config-fundo-card:has(input:checked) {
  border-color: var(--azul-raspa, #009cde);
  box-shadow: 0 0 0 3px rgba(0, 156, 222, 0.15);
}
.config-fundo-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.config-fundo-preview {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background-color: #eef1f5;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.config-fundo-aleatorio {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--azul-escuro, #003087);
  background: linear-gradient(135deg, rgba(0, 156, 222, 0.15), rgba(255, 184, 28, 0.25));
}
.config-fundo-nome {
  font-size: 0.78rem;
  font-weight: 600;
  color: #555;
  word-break: break-all;
  line-height: 1.3;
}
.config-sep {
  border: 0;
  border-top: 1px solid #e8eaee;
  margin: 1.25rem 0;
}

.config-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  margin-top: 1rem;
  align-items: start;
}
.config-sec-cab {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.config-sec-cab h2 {
  margin: 0;
  font-size: 1.05rem;
}
.config-form-grid {
  display: grid;
  gap: 0.85rem 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}
.config-form .form-row {
  margin: 0;
}
.config-form .form-actions {
  margin-top: 1.1rem;
}
@media (max-width: 900px) {
  .config-layout {
    grid-template-columns: 1fr;
  }
  .config-form-grid {
    grid-template-columns: 1fr;
  }
}

.perfil-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  margin-top: 1rem;
}
.perfil-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}
.perfil-form .hint {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: #666;
  font-weight: 500;
}
.perfil-form input[readonly],
.perfil-form input:disabled {
  background: #f5f5f5;
  color: #555;
  cursor: not-allowed;
}
.form-actions {
  margin-top: 0.5rem;
}
.muted {
  color: #666;
  font-size: 0.92rem;
}

/* Prémios — admin */
.premios-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.premios-page-header h1 {
  margin: 0 0 0.35rem;
}
.premios-page-lead {
  margin: 0;
  max-width: 42rem;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.45;
}
.premios-page-header-acoes {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.premios-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}
.premios-kpi {
  background: var(--branco);
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  box-shadow: var(--sombra);
  border-top: 3px solid var(--amarelo-raspa);
}
.premios-kpi-pago {
  border-top-color: var(--azul-raspa);
}
.premios-kpi-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.premios-kpi-valor {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--texto);
}
.premios-kpi-valor-sm {
  font-size: 1.2rem;
}
.premios-kpi-sub {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #777;
}
.premios-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
}
.premios-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.premios-side-card {
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.premios-side-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.98rem;
  background: linear-gradient(180deg, #fafbfc, #f3f5f7);
  border-bottom: 1px solid #eceff2;
  user-select: none;
}
.premios-side-summary::-webkit-details-marker {
  display: none;
}
.premios-side-hint {
  font-size: 0.75rem;
  font-weight: 700;
  color: #5a6b7a;
  background: #e8eef3;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}
.premios-side-body {
  padding: 0.9rem 1rem 1rem;
}
.premios-side-title {
  margin: 0;
  padding: 0.85rem 1rem 0;
  font-size: 0.98rem;
}
.premios-dist-card {
  padding-bottom: 0.35rem;
}
.premios-dist-body {
  padding: 0.35rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.premios-dist-bloco {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.premios-dist-cab {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.88rem;
  font-weight: 700;
}
.premios-barra {
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #eceff2;
}
.premios-barra-pendente {
  background: rgba(255, 184, 28, 0.95);
  min-width: 0;
}
.premios-barra-pago {
  background: rgba(0, 156, 222, 0.95);
  min-width: 0;
}
.premios-dist-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.86rem;
  color: #444;
}
.premios-dist-lista li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.premios-dist-lista strong {
  margin-left: auto;
  font-weight: 700;
  color: var(--texto);
}
.premios-dist-lista em {
  font-style: normal;
  color: #888;
  font-size: 0.8rem;
  min-width: 2.6rem;
  text-align: right;
}
.premios-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.premios-dot-pendente {
  background: rgba(255, 184, 28, 0.95);
}
.premios-dot-pago {
  background: rgba(0, 156, 222, 0.95);
}
.premios-lista-panel {
  margin: 0;
  min-width: 0;
}
.premios-lista-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}
.premios-lista-toolbar h2 {
  margin: 0;
  font-size: 1.1rem;
}
.premios-filtro-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
  align-items: flex-end;
  margin: 0 0 1rem;
  padding: 0.85rem 0.95rem;
  background: #f7f8fa;
  border: 1px solid #e8eaee;
  border-radius: 10px;
}
.premios-filtro-campo {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 7.5rem;
}
.premios-filtro-campo label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #555;
  margin: 0;
}
.premios-filtro-form input[type="text"],
.premios-filtro-form select {
  margin: 0;
  min-width: 0;
  width: 100%;
  max-width: none;
}
.premios-filtro-codigo {
  flex: 1 1 10rem;
  min-width: 10rem;
}
.premios-filtro-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding-bottom: 0.05rem;
}
.premios-lista-vazia {
  text-align: center;
  padding: 2rem 1rem;
  color: #555;
}
.premios-table-wrap {
  margin: 0 -0.15rem;
}
.premios-table {
  font-size: 0.92rem;
}
.premios-table th,
.premios-table td {
  vertical-align: middle;
}
.premios-codigo {
  font-size: 0.9rem;
}
.premios-col-valor {
  font-weight: 700;
  white-space: nowrap;
}
.premios-lote-tag,
.premios-origem-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  margin-right: 0.2rem;
}
.premios-lote-tag {
  background: rgba(13, 107, 74, 0.12);
  color: #0d6b4a;
}
.premios-origem-tag {
  background: rgba(0, 48, 135, 0.1);
  color: #003087;
}
.premios-meta {
  display: block;
  font-size: 0.78rem;
  color: #777;
  margin-top: 0.15rem;
  line-height: 1.3;
}
.premios-col-registo {
  white-space: nowrap;
  color: #555;
  font-size: 0.9rem;
  vertical-align: middle;
}
.premios-col-acoes {
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}
.premios-paginacao {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid #eceff2;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 960px) {
  .premios-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .premios-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .premios-kpi-grid {
    grid-template-columns: 1fr;
  }
}
.badge-pendente {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 184, 28, 0.35);
  color: #8a6200;
}
.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.82rem;
}

/* Prémios — painel agente */
.card-verificar-premio {
  border-radius: 14px;
  box-shadow: var(--sombra);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border: 2px dashed var(--amarelo-raspa);
  background: linear-gradient(145deg, rgba(255, 184, 28, 0.12), rgba(0, 156, 222, 0.08));
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.card-verificar-premio .logo {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
}
.card-verificar-premio .body {
  padding: 0.85rem 1rem 1rem;
}
.card-verificar-premio h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--texto);
}
.card-verificar-premio:hover {
  border-color: var(--verde-jsc);
  box-shadow: 0 6px 20px rgba(0, 90, 135, 0.15);
}
.card-premio-ico {
  font-size: 2.8rem;
  line-height: 1;
}
.card-premio-sub {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
}
.input-premio-codigo {
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  padding: 0.65rem 0.75rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
}
.premio-resultado-box {
  text-align: center;
  padding: 1.25rem 0.5rem;
  border-radius: 12px;
}
.premio-resultado-texto {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.25;
}
.premio-resultado-sem {
  background: rgba(228, 0, 123, 0.14);
  border: 2px solid rgba(228, 0, 123, 0.45);
}
.premio-resultado-sem .premio-resultado-texto {
  color: #9e0056;
}
.premio-resultado-ok {
  background: rgba(0, 156, 222, 0.15);
  border: 2px solid rgba(0, 156, 222, 0.45);
}
.premio-resultado-ok .premio-resultado-texto {
  color: #005a87;
}
.premio-resultado-ja-pago {
  background: rgba(228, 0, 123, 0.12);
  border: 2px solid rgba(228, 0, 123, 0.5);
}
.premio-resultado-ja-pago .premio-resultado-texto {
  color: #9e0056;
}
.badge-premio-pago {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(0, 156, 222, 0.2);
  color: #005a87;
}
.badge-premio-pendente {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 184, 28, 0.35);
  color: #8a6200;
}

.codigo-mascarado {
  letter-spacing: 0.12em;
  color: #888;
}

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: var(--branco);
  cursor: pointer;
}
.nav-burger span {
  display: block;
  height: 2px;
  background: var(--texto);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
.topbar.is-nav-open .nav-burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.topbar.is-nav-open .nav-burger span:nth-child(2) {
  opacity: 0;
}
.topbar.is-nav-open .nav-burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 901px) {
  .nav-item-dropdown:hover .nav-dropdown-panel {
    display: block;
  }
}

@media (max-width: 900px) {
  .topbar {
    flex-wrap: nowrap;
    align-items: flex-start;
  }
  .nav-burger {
    display: flex;
  }
  .topbar-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    background: var(--branco);
    border-bottom: 4px solid var(--amarelo-raspa);
    box-shadow: var(--sombra);
    padding: 0.75rem 1rem 1rem;
    z-index: 150;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
  .topbar-nav.is-mobile-open {
    display: flex;
  }
  .topbar {
    position: relative;
  }
  .nav-menu {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .nav-item-dropdown .nav-dropdown-panel {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--amarelo-raspa);
    margin: 0.25rem 0 0.5rem 0.75rem;
    padding: 0;
    min-width: 0;
    display: none;
  }
  .nav-item-dropdown.is-open .nav-dropdown-panel {
    display: block;
  }
  .nav-utilizador {
    width: 100%;
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
  }
  .nav-user-btn {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
  }
  .nav-user-panel {
    position: static;
    box-shadow: none;
    border: none;
    margin-top: 0.25rem;
  }
  .nav-utilizador.is-open .nav-user-panel {
    display: block;
  }
}

.wrap {
  max-width: none;
  margin: 0;
  padding: 1.5rem 1.5rem 3rem;
  flex: 1 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.app-footer {
  margin-top: auto;
  background: #fff;
  border-top: 1px solid #e5e8ee;
  color: #5a6270;
  font-size: 0.82rem;
}
.app-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1.5rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  box-sizing: border-box;
}
.app-footer-esq,
.app-footer-dir {
  margin: 0;
  line-height: 1.4;
}
.app-footer-dir a {
  color: var(--azul-escuro);
  font-weight: 600;
  text-decoration: none;
}
.app-footer-dir a:hover {
  color: var(--azul-raspa);
  text-decoration: underline;
}
@media (max-width: 720px) {
  .app-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.85rem 1rem;
  }
}

/* Página de login centrada (horizontal e vertical) */
.wrap.wrap-login-centro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1 0 auto;
  min-height: 0;
  max-width: none;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
}

.wrap.wrap-login-centro h1 {
  text-align: center;
  align-self: center;
  width: min(22rem, calc(100vw - 2rem));
  max-width: 100%;
  box-sizing: border-box;
}

.wrap.wrap-login-centro .flash {
  align-self: center;
  width: min(22rem, calc(100vw - 2rem));
  max-width: 100%;
  box-sizing: border-box;
}

.wrap.wrap-login-centro .panel-login {
  align-self: center;
  width: min(22rem, calc(100vw - 2rem));
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 0;
}

.wrap.wrap-login-centro .login-ajuda {
  align-self: center;
  width: min(22rem, calc(100vw - 2rem));
  max-width: 100%;
  box-sizing: border-box;
  margin: -0.35rem 0 1rem;
  text-align: center;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.45;
}

.wrap.wrap-login-centro .login-esqueci {
  margin: 0 0 0.85rem;
  text-align: right;
  font-size: 0.9rem;
}

.wrap.wrap-login-centro .login-esqueci a,
.wrap.wrap-login-centro .login-voltar a {
  color: var(--verde-jsc);
  text-decoration: none;
  font-weight: 600;
}

.wrap.wrap-login-centro .login-esqueci a:hover,
.wrap.wrap-login-centro .login-voltar a:hover {
  text-decoration: underline;
}

.wrap.wrap-login-centro .login-voltar {
  align-self: center;
  width: min(22rem, calc(100vw - 2rem));
  max-width: 100%;
  box-sizing: border-box;
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.92rem;
}

.wrap.wrap-login-centro .panel-login input[type="text"],
.wrap.wrap-login-centro .panel-login input[type="email"],
.wrap.wrap-login-centro .panel-login input[type="password"] {
  max-width: none;
  width: 100%;
}

.wrap.wrap-login-centro .panel-login select {
  max-width: none;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--branco);
  cursor: pointer;
}

.wrap.wrap-login-centro .login-marca {
  align-self: center;
  text-align: center;
  margin-bottom: 0.35rem;
  max-width: min(26rem, calc(100vw - 2rem));
}

.wrap.wrap-login-centro .login-logo-img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  max-height: 5.5rem;
  width: auto;
  object-fit: contain;
}

.wrap.wrap-login-centro .login-credito {
  text-align: center;
  align-self: center;
  width: min(22rem, calc(100vw - 2rem));
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 1.5rem;
  margin-bottom: 0;
  font-size: 0.88rem;
  color: #777;
}

.wrap.wrap-login-centro .login-credito-sep {
  opacity: 0.55;
}

.wrap.wrap-login-centro .login-credito .versao-app {
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #666;
}

.wrap.wrap-login-centro .login-credito.login-licenciado {
  margin-top: 0.45rem;
  font-size: 0.75rem;
  color: #888;
}

h1 {
  font-size: 1.35rem;
  margin: 0 0 1rem;
  font-weight: 700;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
}

/* Painel de jogos: exactamente 5 cartões por linha (5 colunas) */
#lista-jogos.grid-cards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card-jogo {
  background: var(--branco);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.12s;
  text-align: center;
}
.card-jogo:hover {
  border-color: var(--verde-jsc);
  transform: translateY(-2px);
}

.card-jogo .logo {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fafafa, #eee);
  padding: 0.5rem;
}
.card-jogo .logo img {
  max-width: 100%;
  max-height: 100px;
  object-fit: contain;
}

.card-jogo .body {
  padding: 0.85rem 0.75rem 1rem;
}
.card-jogo h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--texto);
}
.badge-stock {
  display: inline-block;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(0, 156, 222, 0.18);
  color: #005a87;
  font-weight: 600;
}

.badge-stock-esgotado {
  background: rgba(228, 0, 123, 0.14);
  color: #9e0056;
  font-weight: 800;
}

.card-jogo-sem-stock {
  opacity: 0.92;
}

.card-jogo-sem-stock:hover {
  border-color: rgba(228, 0, 123, 0.45);
}

.modal.modal-operadores {
  max-width: min(100vw - 1.5rem, 38rem);
}

.grid-operadores-pin {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.card-operador-pin {
  background: var(--branco);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.12s;
  text-align: center;
}
.card-operador-pin:hover {
  border-color: var(--verde-jsc);
  transform: translateY(-2px);
}
.card-operador-pin .body {
  padding: 1rem 0.65rem;
}
.card-operador-pin-ico {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.35rem;
}
.card-operador-pin h2 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--texto);
  line-height: 1.25;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
}
.btn-verde {
  background: var(--verde-jsc);
  color: #fff;
}
.btn-verde:hover {
  filter: brightness(1.05);
}
.btn-vermelho {
  background: var(--vermelho-jsc);
  color: #fff;
}
.btn-vermelho:hover {
  filter: brightness(1.05);
}
.btn-ghost {
  background: #e8e8e8;
  color: var(--texto);
}

.panel {
  background: var(--branco);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  max-width: 420px;
  padding: 0.55rem 0.65rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.form-row {
  margin-bottom: 1rem;
}

.flash {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 600;
}
.flash-ok {
  background: rgba(0, 156, 222, 0.2);
  color: #005a87;
}
.flash-erro {
  background: rgba(228, 0, 123, 0.12);
  color: #9e0056;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.data th,
table.data td {
  text-align: left;
  padding: 0.5rem 0.45rem;
  border-bottom: 1px solid #e5e5e5;
}
table.data th {
  background: #fafafa;
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-backdrop.aberto {
  display: flex;
}

.toast-transacao-ok {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.2);
}

.toast-transacao-ok.aberto {
  display: flex;
}

.toast-transacao-ok-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.35rem;
  border-radius: var(--raio);
  background: #e6f6fc;
  border: 2px solid var(--azul-raspa);
  box-shadow: 0 12px 40px rgba(0, 48, 135, 0.18);
  font-size: 1.1rem;
  font-weight: 700;
  color: #005a87;
}

.toast-transacao-ok-check {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--azul-raspa);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
}

.modal {
  background: var(--branco);
  border-radius: var(--raio);
  max-width: min(100vw - 1.5rem, 26rem);
  width: 100%;
  padding: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 48, 135, 0.2);
  border-top: 5px solid var(--amarelo-raspa);
}

.modal h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.modal.modal-rede {
  max-width: min(100vw - 1.5rem, 42rem);
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 720px);
  overflow: hidden;
}

.modal-rede-cab {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem 0.85rem;
  border-bottom: 1px solid #ececec;
  background: linear-gradient(180deg, #fafcff 0%, #fff 100%);
}

.modal-rede-cab h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
}

.modal-rede-etiqueta {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--azul-raspa);
}

.modal-rede-sub {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: #666;
  line-height: 1.4;
}

.modal-rede-fechar {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: #eef1f6;
  color: #444;
  font-size: 1.35rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.modal-rede-fechar:hover {
  background: #dfe6f0;
  color: #111;
}

.modal-rede-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.modal-rede-corpo {
  padding: 1rem 1.25rem;
  overflow: auto;
  flex: 1;
}

.modal-rede-sec + .modal-rede-sec {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid #f0f0f0;
}

.modal-rede-sec h4 {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #555;
}

.modal-rede-grid {
  display: grid;
  gap: 0.75rem 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-rede-grid .form-row {
  margin: 0;
}

.modal-rede-grid .form-row input,
.modal-rede-grid .form-row select,
.modal-rede-grid .form-row textarea {
  max-width: none;
}

.modal-rede-grid .form-row--full {
  grid-column: 1 / -1;
}

.modal-rede-sec .hint,
.modal-rede-sec small {
  display: block;
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: #666;
  font-weight: 500;
  line-height: 1.4;
}

.modal-rede-estado {
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px solid #e6ebf2;
}

.modal-rede-estado label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-rede-login {
  margin-top: 1rem;
  padding: 0.85rem;
  border-radius: 10px;
  background: #fffaf0;
  border: 1px solid #f0e2b8;
}

.modal-rede-login-toggle label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-rede-login-campos {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed #e8d9a8;
}

.modal-rede-rodape {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem 1.1rem;
  border-top: 1px solid #ececec;
  background: #fafafa;
}

@media (max-width: 640px) {
  .modal-rede-grid {
    grid-template-columns: 1fr;
  }
}

.pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.pay-btn {
  min-height: 88px;
  font-size: 1rem;
  flex-direction: column;
  border-radius: var(--raio);
}
.pay-btn svg {
  width: 36px;
  height: 36px;
}

.admin-bar {
  flex-shrink: 0;
  background: linear-gradient(90deg, var(--azul-escuro), var(--magenta-raspa));
  color: #fff;
  padding: 0.45rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 520px) {
  .pay-grid {
    grid-template-columns: 1fr;
  }
}

.valor-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.valor-chip {
  min-height: 48px;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 10px;
  border: 2px solid var(--azul-raspa);
  background: rgba(0, 156, 222, 0.12);
  color: #005a87;
  cursor: pointer;
  font-family: inherit;
}
.valor-chip:hover {
  background: rgba(0, 156, 222, 0.28);
}
.valor-chip-outro {
  grid-column: 1 / -1;
  border-color: #888;
  background: #eee;
  color: var(--texto);
}
.valor-chip-outro:hover {
  background: #e0e0e0;
}

.valor-display {
  width: 100%;
  box-sizing: border-box;
  min-height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.65rem 0.85rem;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 3px solid var(--azul-raspa);
  border-radius: 12px;
  background: linear-gradient(180deg, #fafcfe, #eef6fc);
  color: var(--texto);
  font-variant-numeric: tabular-nums;
}

.teclado-web {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-top: 0.75rem;
  touch-action: manipulation;
  user-select: none;
}

.teclado-web .tecla {
  min-height: 3.25rem;
  font-size: 1.35rem;
  font-weight: 800;
  font-family: inherit;
  border: 2px solid #c8c8c8;
  border-radius: 10px;
  background: var(--branco);
  color: var(--texto);
  cursor: pointer;
  box-shadow: 0 2px 0 #ddd;
}

.teclado-web .tecla:active {
  transform: translateY(1px);
  box-shadow: none;
}

.teclado-web .tecla-virgula {
  font-size: 1.5rem;
  font-weight: 900;
  border-color: var(--azul-raspa);
  color: #005a87;
}

.teclado-web .tecla-apagar {
  font-size: 1.2rem;
  border-color: #999;
}

.teclado-web .tecla-larga {
  grid-column: 1 / -1;
  min-height: 2.85rem;
  font-size: 1rem;
  font-weight: 700;
  border-color: var(--magenta-raspa);
  color: var(--magenta-raspa);
  background: rgba(228, 0, 123, 0.06);
}

/* Carrinho (painel de vendas) */
body.carrinho-aberto .wrap {
  padding-bottom: max(10rem, 28vh);
}

.carrinho-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  background: var(--branco);
  border-top: 4px solid var(--amarelo-raspa);
  box-shadow: 0 -8px 28px rgba(0, 48, 135, 0.12);
  padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom, 0));
}

.carrinho-bar-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.carrinho-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.carrinho-titulo {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.carrinho-contagem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--verde-jsc);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.carrinho-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(28vh, 12rem);
  overflow-y: auto;
  font-size: 0.88rem;
  line-height: 1.35;
}

.carrinho-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #eee;
}

.carrinho-linha:last-child {
  border-bottom: none;
}

.carrinho-linha-txt {
  flex: 1;
  min-width: 0;
}

.btn-carrinho-remover {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: rgba(228, 0, 123, 0.12);
  color: var(--magenta-raspa);
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.btn-carrinho-remover:hover {
  background: rgba(228, 0, 123, 0.22);
}

.carrinho-total-linha {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 2px solid #e8e8e8;
  font-size: 1rem;
  font-weight: 600;
}

.carrinho-acoes {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.carrinho-acoes .btn {
  flex: 1;
}

.pay-btn-carrinho {
  min-height: 88px;
  font-size: 1rem;
  flex-direction: column;
  border-radius: var(--raio);
}

.pay-btn-carrinho svg {
  width: 36px;
  height: 36px;
}

.relatorio-anual {
  font-size: 0.88rem;
  white-space: nowrap;
}

.relatorio-anual th,
.relatorio-anual td {
  padding: 0.35rem 0.45rem;
}

.badge-estado {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-ok {
  background: rgba(0, 156, 222, 0.18);
  color: #005a87;
}
.badge-inactivo {
  background: #eee;
  color: #666;
}
.badge-pendente {
  background: rgba(255, 184, 28, 0.25);
  color: #8a6200;
}
.badge-concluido {
  background: rgba(13, 107, 74, 0.2);
  color: #0d6b4a;
}
.badge-rejeitado,
.badge-cancelado {
  background: rgba(228, 0, 123, 0.12);
  color: #9e0056;
}
.badge-exp-planeada,
.badge-op-pendente {
  background: rgba(255, 184, 28, 0.25);
  color: #8a6200;
}
.badge-exp-preparada,
.badge-op-em_curso {
  background: rgba(0, 156, 222, 0.2);
  color: #005a87;
}
.badge-exp-em_transito {
  background: rgba(0, 48, 135, 0.12);
  color: #003087;
}
.badge-exp-entregue,
.badge-op-concluida,
.badge-venda-confirmada {
  background: rgba(0, 156, 222, 0.22);
  color: #005a87;
}
.badge-exp-cancelada,
.badge-op-cancelada,
.badge-venda-anulada,
.badge-lote-bloqueado,
.badge-lote-recolhido {
  background: rgba(228, 0, 123, 0.14);
  color: #9e0056;
}
.badge-lote-activo {
  background: rgba(0, 156, 222, 0.18);
  color: #005a87;
}
.badge-lote-esgotado {
  background: #eee;
  color: #666;
}
.badge-venda-registada {
  background: rgba(255, 184, 28, 0.22);
  color: #8a6200;
}

/* Documentação API */
.doc-api-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.doc-api-header h1 {
  margin: 0 0 0.35rem;
}
.doc-api-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}
.doc-api-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 156, 222, 0.15);
  color: var(--azul-escuro);
  font-weight: 700;
  font-size: 0.85rem;
}
.doc-api-ambiente {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.doc-api-url {
  font-size: 0.95rem;
  padding: 0.15rem 0.45rem;
  background: #eef4fb;
  border-radius: 6px;
}
.doc-api-toolbar {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
}
.doc-api-search-wrap {
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.doc-api-search-icon {
  font-size: 1.15rem;
  color: #64748b;
  line-height: 1;
}
.doc-api-search-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  background: var(--branco);
}
.doc-api-search-input:focus {
  outline: 2px solid rgba(0, 156, 222, 0.35);
  border-color: var(--azul-raspa);
}
.doc-api-toolbar-acoes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.doc-api-pesquisa-contagem {
  font-size: 0.88rem;
  white-space: nowrap;
}
.doc-api-sem-resultados {
  margin-bottom: 1rem;
}
.doc-api-seccoes {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 960px;
}
.doc-api-secao,
.doc-api-subsecao {
  background: var(--branco);
  border: 1px solid #dbe3ee;
  border-radius: var(--raio);
  box-shadow: 0 2px 8px rgba(0, 48, 135, 0.04);
}
.doc-api-secao-titulo,
.doc-api-subsecao-titulo {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  padding: 0.85rem 1rem 0.85rem 2.35rem;
  position: relative;
  user-select: none;
  color: var(--azul-escuro);
}
.doc-api-subsecao-titulo {
  font-weight: 600;
  font-size: 0.96rem;
  padding: 0.7rem 1rem 0.7rem 2.1rem;
}
.doc-api-secao-titulo::-webkit-details-marker,
.doc-api-subsecao-titulo::-webkit-details-marker {
  display: none;
}
.doc-api-secao-titulo::before,
.doc-api-subsecao-titulo::before {
  content: "▸";
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--azul-raspa);
  font-size: 0.95rem;
  transition: transform 0.15s ease;
}
.doc-api-secao[open] > .doc-api-secao-titulo::before,
.doc-api-subsecao[open] > .doc-api-subsecao-titulo::before {
  transform: translateY(-50%) rotate(90deg);
}
.doc-api-secao-corpo,
.doc-api-subsecao-corpo {
  padding: 0 1.15rem 1.15rem;
  border-top: 1px solid #eef2f7;
}
.doc-api-subseccoes {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.75rem;
}
.doc-api-intro {
  margin-bottom: 1rem;
  max-width: 960px;
  padding: 1.15rem 1.35rem;
}
.doc-api {
  line-height: 1.6;
}
.doc-api h2 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.2rem;
  color: var(--azul-escuro);
}
.doc-api h2:first-child {
  margin-top: 0;
}
.doc-api h3 {
  margin: 1.15rem 0 0.45rem;
  font-size: 1.05rem;
}
.doc-api p,
.doc-api li {
  margin: 0.5rem 0;
}
.doc-api ul,
.doc-api ol {
  padding-left: 1.35rem;
}
.doc-api hr {
  border: none;
  border-top: 1px dashed #cbd5e1;
  margin: 1.5rem 0;
}
.doc-api table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1rem;
  font-size: 0.92rem;
}
.doc-api th,
.doc-api td {
  border: 1px solid #dbe3ee;
  padding: 0.45rem 0.65rem;
  text-align: left;
  vertical-align: top;
}
.doc-api th {
  background: #f0f5fb;
  font-weight: 600;
}
.doc-api code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88em;
  background: #eef4fb;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.doc-api pre {
  background: #1a1a2e;
  color: #e8eef7;
  padding: 1rem 1.1rem;
  border-radius: var(--raio);
  overflow-x: auto;
  margin: 0.75rem 0 1rem;
  font-size: 0.85rem;
  line-height: 1.45;
}
.doc-api pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.doc-api blockquote {
  margin: 0.75rem 0;
  padding: 0.5rem 0.85rem;
  border-left: 4px solid var(--azul-raspa);
  background: #f7fbff;
  color: #334155;
}
.doc-api a {
  word-break: break-word;
}

/* Tokens API (admin) */
.api-tokens-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
  max-width: 960px;
}
.api-tokens-kpi-item {
  background: var(--branco);
  border: 1px solid #dbe3ee;
  border-radius: var(--raio);
  padding: 0.85rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 48, 135, 0.04);
}
.api-tokens-kpi-valor {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--azul-escuro);
  line-height: 1.1;
}
.api-tokens-kpi-label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #64748b;
}
.api-tokens-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}
.api-token-id {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}
.api-tokens-revogar-lista {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.api-tokens-revogar-lista li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #eef2f7;
}
.api-tokens-revogar-lista li:last-child {
  border-bottom: none;
}

