/* Painel administrativo.
   O markup era quase todo estilo inline, e as abas eram pintadas pelo JS —
   o que impedia qualquer folha de estilo de agir. Aqui o JS volta a cuidar só
   do estado (classe e aria-selected) e a aparência vem daqui. */

#app-shell .admin-head { margin-bottom: 18px; }
#app-shell .admin-head h2 { margin: 0 0 4px; }
#app-shell .admin-head p { max-width: 62ch; margin: 0; color: var(--fg-secondary); font-size: 14px; line-height: 1.55; }

/* Controle segmentado no lugar das abas sublinhadas. */
#app-shell .admin-tabs {
  width: fit-content;
  margin-bottom: 20px;
  padding: 3px;
  display: flex;
  gap: 3px;
  background: var(--surface-alt);
  border: 0;
  border-radius: 999px;
}
#app-shell .admin-tabs .tab-button {
  min-height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: var(--fg-secondary);
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease;
}
#app-shell .admin-tabs .tab-button:hover { color: var(--fg); }
#app-shell .admin-tabs .tab-button[aria-selected="true"] {
  color: var(--fg);
  background: var(--surface);
  font-weight: 620;
  box-shadow: 0 1px 3px rgba(29, 29, 31, .1);
}

/* Cartões. */
#app-shell .admin-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
#app-shell .admin-card__title { margin: 0 0 4px; font-size: 15px; font-weight: 620; letter-spacing: -.016em; }
#app-shell .admin-card__hint { max-width: 64ch; margin: 0 0 16px; color: var(--fg-secondary); font-size: 12.5px; line-height: 1.55; }
#app-shell .admin-card--scroll { overflow-x: auto; }
#app-shell .admin-card--narrow { max-width: 620px; }

#app-shell .admin-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
#app-shell .admin-form { display: flex; flex-direction: column; gap: 13px; }
#app-shell .admin-form .button { width: 100%; }
#app-shell .admin-feedback { min-height: 16px; margin: 0; font-size: 12px; }

/* Tabela de clientes. */
#app-shell .admin-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
#app-shell .admin-table th {
  padding: 0 10px 10px;
  color: var(--fg-tertiary);
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
#app-shell .admin-table td { padding: 11px 10px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
#app-shell .admin-table tr:last-child td { border-bottom: 0; }
#app-shell .admin-table tbody tr:hover { background: var(--surface-alt); }
#app-shell .admin-table__num { font-variant-numeric: tabular-nums; white-space: nowrap; }
#app-shell .admin-table__actions { text-align: right; white-space: nowrap; }

/* Selo de status: usado pelo app.js e, até aqui, sem estilo nenhum — os
   status apareciam como texto solto no meio da tabela. */
#app-shell .admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 620;
  white-space: nowrap;
}
#app-shell .admin-badge--active { color: var(--green); background: var(--green-soft); }
#app-shell .admin-badge--inactive { color: var(--red); background: var(--red-soft); }

/* Chaves de integração: rótulo e estado numa linha, campo e teste embaixo. */
#app-shell .admin-key { display: flex; flex-direction: column; gap: 7px; }
#app-shell .admin-key__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#app-shell .admin-key__label { color: var(--fg); font-size: 13px; font-weight: 550; }
#app-shell .admin-key__label code { color: var(--fg-tertiary); font-size: 11.5px; font-weight: 450; }
#app-shell .admin-key__status { color: var(--fg-tertiary); font-size: 11px; font-weight: 600; white-space: nowrap; }
#app-shell .admin-key__status[data-state="ok"] { color: var(--green); }
#app-shell .admin-key__status[data-state="error"] { color: var(--red); }
#app-shell .admin-key__row { display: flex; gap: 8px; }
#app-shell .admin-key__row input { flex: 1; min-width: 0; min-height: 38px; }
#app-shell .admin-key__row .button { min-height: 38px; padding-inline: 15px; white-space: nowrap; }

@media (max-width: 1180px) {
  #app-shell .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  #app-shell .admin-key__row { flex-direction: column; }
  #app-shell .admin-key__row .button { width: 100%; }
}
