:root {
  --bg: #0c0f14;
  --surface: #141a22;
  --surface-2: #1b2430;
  --border: #2a3545;
  --text: #e9eef5;
  --muted: #8a9bb0;
  --accent: #c4705a;
  --accent-dim: #9a5a48;
  --success: #3ecf8e;
  --warn: #e8b84a;
  --danger: #f07178;
  --radius: 12px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --font: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  /* Camadas (dark) — redefinidos em tema claro */
  --tint: rgba(255, 255, 255, 0.04);
  --tint-mid: rgba(255, 255, 255, 0.05);
  --tint-strong: rgba(255, 255, 255, 0.06);
  --tint-extra: rgba(255, 255, 255, 0.07);
  --tint-highlight: rgba(255, 255, 255, 0.08);
  --tint-hover: rgba(255, 255, 255, 0.03);
  --hairline: rgba(255, 255, 255, 0.1);
  --hairline-soft: rgba(255, 255, 255, 0.08);
  --scrim: rgba(0, 0, 0, 0.55);
  --toolbar-bg: rgba(0, 0, 0, 0.2);
  --toolbar-bg-footer: rgba(0, 0, 0, 0.28);
  --footer-well: rgba(0, 0, 0, 0.2);
  --code-bg: rgba(0, 0, 0, 0.25);
  --kbd-bg: rgba(0, 0, 0, 0.3);
  --login-glow: rgba(196, 112, 90, 0.18);
  --card-well: rgba(0, 0, 0, 0.22);
  --empty-ghost: rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #edf0f6;
  --surface: #ffffff;
  --surface-2: #e8edf5;
  --border: #c5cedc;
  --text: #111820;
  --muted: #5a6678;
  --accent: #b8583d;
  --accent-dim: #8f432e;
  --shadow: 0 12px 36px rgba(15, 23, 42, 0.09);
  --tint: rgba(15, 23, 42, 0.045);
  --tint-mid: rgba(15, 23, 42, 0.055);
  --tint-strong: rgba(15, 23, 42, 0.075);
  --tint-extra: rgba(15, 23, 42, 0.09);
  --tint-highlight: rgba(15, 23, 42, 0.1);
  --tint-hover: rgba(15, 23, 42, 0.04);
  --hairline: rgba(15, 23, 42, 0.12);
  --hairline-soft: rgba(15, 23, 42, 0.1);
  --scrim: rgba(15, 23, 42, 0.4);
  --toolbar-bg: rgba(15, 23, 42, 0.05);
  --toolbar-bg-footer: rgba(15, 23, 42, 0.06);
  --footer-well: rgba(15, 23, 42, 0.04);
  --code-bg: rgba(15, 23, 42, 0.07);
  --kbd-bg: rgba(15, 23, 42, 0.06);
  --login-glow: rgba(196, 112, 90, 0.14);
  --card-well: rgba(15, 23, 42, 0.04);
  --empty-ghost: rgba(15, 23, 42, 0.035);
}

html[data-theme="dark"] {
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  z-index: 100;
}
.skip-link:focus {
  left: 0.5rem;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2rem;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 1.1rem;
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
  flex: 0 1 auto;
}

.brand--home {
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  outline-offset: 2px;
}

.brand--home:hover .brand-title {
  color: var(--accent);
}
.brand--home:hover .brand-icon {
  opacity: 0.95;
  filter: brightness(1.05);
}

.brand--home:focus-visible {
  outline: 2px solid var(--accent);
}

.nav-context {
  margin: 0.75rem 0 0;
  padding: 0 0.25rem;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
  padding: 0.25rem 0.35rem;
  margin-left: -0.35rem;
}

.nav-back:hover {
  color: var(--accent);
}

.nav-back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Ícone 1024× com alpha; "contain" mostra o desenho inteiro sem recortar; caixa um pouco maior */
.brand-icon {
  display: block;
  width: 3.85rem;
  height: 3.85rem;
  border-radius: 0.5rem;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  background: transparent;
}

.brand-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
}

.theme-switch--compact .theme-switch__btn {
  padding: 0.32rem 0.52rem;
  font-size: 0.7rem;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--tint);
  gap: 2px;
}

.theme-switch__btn {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.6rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.theme-switch__btn:hover {
  color: var(--text);
  background: var(--tint-hover);
}

.theme-switch__btn[aria-pressed="true"] {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .theme-switch__btn[aria-pressed="true"] {
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--tint);
  white-space: nowrap;
}

/* `.pill` usa display explícito e sobrescreve a UA de `[hidden]` — forçar ocultação */
.pill[hidden],
.admin-infra-status[hidden] {
  display: none !important;
}

.pill-ns {
  color: var(--text);
}

.pill-health[data-state="ok"] {
  border-color: rgba(62, 207, 142, 0.45);
  color: var(--success);
  background: rgba(62, 207, 142, 0.08);
}

.pill-health[data-state="err"] {
  border-color: rgba(240, 113, 120, 0.45);
  color: var(--danger);
  background: rgba(240, 113, 120, 0.08);
}

.admin-infra-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--toolbar-bg);
}
.infra-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.infra-chip[data-state="unknown"] {
  color: var(--muted);
  border-color: var(--border);
  background: var(--tint-hover);
}
.infra-chip[data-state="ok"] {
  color: var(--success);
  border-color: rgba(62, 207, 142, 0.35);
  background: rgba(62, 207, 142, 0.1);
}
.infra-chip[data-state="err"] {
  color: var(--danger);
  border-color: rgba(240, 113, 120, 0.4);
  background: rgba(240, 113, 120, 0.1);
}

.btn {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

#btn-refresh.is-syncing {
  animation: refresh-sync 0.45s ease;
}

@keyframes refresh-sync {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.42;
  }
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--tint-strong);
  border-color: var(--muted);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-dim);
}

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

.btn-sm {
  font-size: 0.8rem;
  padding: 0.3rem 0.65rem;
}

.btn-icon {
  padding: 0.2rem 0.55rem;
  font-size: 1.35rem;
  line-height: 1;
  background: transparent;
  border: none;
  color: var(--muted);
}

.btn-icon:hover {
  color: var(--text);
}

.banner {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
}

.banner-error {
  background: rgba(240, 113, 120, 0.12);
  border: 1px solid rgba(240, 113, 120, 0.35);
  color: #ffc9c9;
}

.hidden {
  display: none !important;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  margin-top: 1.25rem;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: fit-content;
}

.tab {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab:hover {
  color: var(--text);
  background: var(--tint);
}

.tab.is-active {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.main {
  margin-top: 1rem;
}

.panel {
  padding: 1.25rem 1.5rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel[hidden] {
  display: none;
}

.panel-head {
  margin-bottom: 1rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.hint {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.hint code {
  font-size: 0.78rem;
  background: var(--code-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.table-wrap {
  position: relative;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table tbody tr:hover {
  background: var(--tint-hover);
}

/* Tabela de tarefas: colunas estáveis, ações à direita sem "vazio" no meio */
.data-table--tasks .col-name {
  width: 38%;
  min-width: 10rem;
  vertical-align: middle;
}
.data-table--tasks .col-schedule {
  width: 30%;
  min-width: 10rem;
  vertical-align: middle;
}
.data-table--tasks .col-active {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
}
.data-table--tasks .col-actions {
  width: 1%;
  text-align: right;
  vertical-align: middle;
  padding-left: 1rem;
  white-space: nowrap;
}
/* Admin: editor de preços por modelo (alinhamento + cartão) */
.model-prices-section {
  max-width: 42rem;
}
.model-prices-hint {
  max-width: 40rem;
  line-height: 1.45;
}
.model-prices-card {
  margin-top: 0.65rem;
  padding: 0.85rem 1rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.model-prices-wrap {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--hairline-soft);
  background: var(--card-well);
}
.model-prices-table {
  table-layout: fixed;
  width: 100%;
  font-size: 0.875rem;
}
.model-prices-table th,
.model-prices-table td {
  vertical-align: middle;
}
.model-prices-table thead th {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.model-prices-table tbody td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--hairline-soft);
}
.model-prices-table tbody tr:last-child td {
  border-bottom: none;
}
.model-prices-col-model {
  width: 62%;
  min-width: 0;
}
.model-prices-col-cents {
  width: 34%;
  max-width: 11rem;
  text-align: right;
}
.model-prices-col-actions {
  width: 3.25rem;
  text-align: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}
.model-price-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 2.35rem;
  border-radius: 8px;
  font-size: 0.875rem;
}
.model-price-input--num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  max-width: 10rem;
  margin-left: auto;
  display: block;
}
.model-prices-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.15rem;
}
.model-prices-toolbar #btn-model-price-add {
  margin-right: auto;
}
.model-prices-col-actions .mp-del {
  border-radius: 8px;
  color: var(--muted);
  border: 1px solid transparent;
}
.model-prices-col-actions .mp-del:hover {
  color: #f0a8ad;
  background: rgba(240, 113, 120, 0.1);
  border-color: rgba(240, 113, 120, 0.25);
}

.data-table--tasks .code--cron {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.task-slug-sub {
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

/* Formulário de tarefa — componentes reutilizáveis de UX */

/* Segmented control (modo: Agendada / Sob demanda) */
.segmented {
  display: inline-flex;
  padding: 0.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  gap: 0.15rem;
}
.segmented__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  min-width: 0;
}
.segmented__btn:hover {
  color: var(--text);
  background: var(--tint);
}
.segmented__btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.segmented__btn:focus-visible {
  outline: 2px solid rgba(196, 112, 90, 0.5);
  outline-offset: 1px;
}
.segmented__btn-desc {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}
.segmented__btn.is-active .segmented__btn-desc {
  color: var(--muted);
}
/* Variante com três opções: cada botão empilha título + descrição e cresce
   igual para preencher a linha. Útil para seletores tipo "Do ambiente /
   Sem SSH / Personalizado". */
.segmented--tri {
  display: flex;
  width: 100%;
}
.segmented--tri .segmented__btn {
  flex: 1 1 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.55rem 0.8rem;
}
.ssh-mode-panel {
  margin-top: 0.75rem;
}
.ssh-mode-panel.hidden {
  display: none;
}

/* Preview do agendamento — "Vai rodar: …" */
.schedule-preview {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.95rem;
  background: linear-gradient(135deg, rgba(62, 207, 142, 0.09), rgba(62, 207, 142, 0.02));
  border: 1px solid rgba(62, 207, 142, 0.3);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text);
}
.schedule-preview[data-state="manual"] {
  background: linear-gradient(135deg, rgba(196, 112, 90, 0.09), rgba(196, 112, 90, 0.02));
  border-color: rgba(196, 112, 90, 0.35);
}
.schedule-preview__icon {
  font-size: 1.1rem;
  line-height: 1;
}
.schedule-preview__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.2rem;
}
.schedule-preview__value {
  font-weight: 600;
}

/* Detalhes avançados (collapsible) */
.form-advanced {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0;
  background: transparent;
}
.form-advanced > summary {
  cursor: pointer;
  padding: 0.7rem 1rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  user-select: none;
}
.form-advanced > summary::-webkit-details-marker {
  display: none;
}
.form-advanced > summary::before {
  content: "▸";
  font-size: 0.8rem;
  transition: transform 0.15s;
  display: inline-block;
}
.form-advanced[open] > summary::before {
  transform: rotate(90deg);
}
.form-advanced > summary:hover {
  color: var(--text);
}
.form-advanced[open] > summary {
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.form-advanced__body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-adv-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}
.form-adv-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.form-adv-group__title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* Linha "destaque" do card de identificação (Nome grande + toggle ativa) */
.hero-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.hero-row > .field {
  flex: 1 1 280px;
  min-width: 0;
}
.hero-row > .hero-state {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 170px;
}
.hero-row > .hero-state .field-lbl {
  margin: 0;
}
.field-lbl-big {
  font-size: 0.9rem !important;
  margin-bottom: 0.35rem !important;
}
.field input.input-big,
.field input.input-big:focus {
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
}
/* Ações inline (não empilham em vertical) */
.row-actions--inline {
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0.3rem;
}

/* Botão kebab (três pontinhos) e menu de ações flutuante. */
.btn-kebab {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-kebab:hover {
  background: var(--tint);
  color: var(--text);
  border-color: var(--border);
}
.btn-kebab[aria-expanded="true"] {
  background: var(--tint-strong);
  color: var(--text);
  border-color: var(--border);
}
.btn-kebab:focus-visible {
  outline: 2px solid rgba(196, 112, 90, 0.5);
  outline-offset: 1px;
}

.action-menu {
  position: fixed;
  z-index: 2000;
  min-width: 180px;
  padding: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  animation: action-menu-in 0.12s ease-out;
}
@keyframes action-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.action-menu__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.action-menu__item:hover,
.action-menu__item:focus-visible {
  background: var(--tint);
  outline: none;
}
.action-menu__item[disabled] {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.6;
}
.action-menu__item--danger {
  color: var(--text);
}
.action-menu__item--danger:hover,
.action-menu__item--danger:focus-visible {
  background: rgba(240, 113, 120, 0.12);
  color: var(--danger);
}
.action-menu__icon {
  width: 1rem;
  display: inline-flex;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.action-menu__item--danger .action-menu__icon {
  color: inherit;
}
.action-menu__sep {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0.1rem;
}

.phase-running {
  color: var(--success);
  font-weight: 600;
}
.phase-pending {
  color: var(--warn);
}
.phase-failed,
.phase-unknown {
  color: var(--danger);
}

.empty {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Login (email + password da consola) */
.login-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(ellipse at 50% 20%, var(--login-glow), transparent 55%), var(--bg);
}

.login-card {
  width: min(400px, 100%);
  padding: 1.75rem 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.login-form .field {
  margin-bottom: 1rem;
}

.login-error {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--danger);
}

.login-error.hidden {
  display: none !important;
}

.btn-block {
  width: 100%;
}

/* Deploy GitHub */
.deploy-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .deploy-grid {
    grid-template-columns: minmax(260px, 320px) 1fr;
    align-items: start;
  }
}

.deploy-card {
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--toolbar-bg);
}

.deploy-card-wide {
  min-width: 0;
}

.deploy-card-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.deploy-hint {
  margin-top: 0;
}

.deploy-form {
  margin: 0;
}

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

.deploy-fields .field-span {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.field-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.field-tz {
  width: 100%;
  max-width: 22rem;
}

.field input,
.field select {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(196, 112, 90, 0.45);
  outline-offset: 1px;
  border-color: var(--accent-dim);
}

.deploy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.deploy-actions-footer {
  margin-top: 1rem;
}

.deploy-token-status {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.deploy-status {
  margin-top: 1.15rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(196, 112, 90, 0.35);
  background: rgba(196, 112, 90, 0.08);
}

.deploy-status.hidden {
  display: none !important;
}

.deploy-status-title {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
}

.deploy-status-line {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.deploy-status-meta {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
}

.muted {
  color: var(--muted);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: min(min(1040px, 98vw), 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-log-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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;
}

.modal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--toolbar-bg);
}

.modal-toolbar--footer {
  border-bottom: none;
  padding: 0.55rem 1rem 0.6rem;
  background: transparent;
}

.modal-log-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--toolbar-bg-footer);
}

.modal-filter {
  flex: 1 1 180px;
  min-width: 0;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.modal-filter::placeholder {
  color: var(--muted);
}

.modal-filter:focus {
  outline: 2px solid rgba(196, 112, 90, 0.45);
  outline-offset: 1px;
  border-color: var(--accent-dim);
}

.modal-follow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.modal-follow input {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}

.modal-log-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: auto;
}

@media (max-width: 560px) {
  .modal-log-meta {
    width: 100%;
    margin-left: 0;
  }
}

.log-range-panel {
  border-top: 1px dashed var(--hairline);
}

.log-range-panel-summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1rem 0.55rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background 0.15s ease;
}

.log-range-panel-summary::-webkit-details-marker {
  display: none;
}

.log-range-panel-summary::marker {
  content: "";
}

.log-range-panel-summary:hover {
  background: var(--tint);
}

.log-range-panel-summary-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
}

.log-range-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  flex-shrink: 0;
}

.log-range-current {
  flex: 1 1 10rem;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-range-panel-chevron {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--tint-mid);
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1;
  transition:
    transform 0.2s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.log-range-panel-chevron::after {
  content: "▼";
  font-size: 0.55rem;
  opacity: 0.85;
}

.log-range-panel[open] .log-range-panel-chevron {
  transform: rotate(180deg);
}

.log-range-panel-body {
  padding: 0 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.log-range-hint {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.38;
  max-width: 56rem;
}

.log-range-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.log-range-chip {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--tint);
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    box-shadow 0.2s;
}

.log-range-chip:hover {
  color: var(--text);
  border-color: var(--muted);
  background: var(--tint-extra);
}

.log-range-chip.is-active {
  color: #fff;
  border-color: rgba(196, 112, 90, 0.65);
  background: linear-gradient(135deg, rgba(196, 112, 90, 0.35) 0%, rgba(154, 90, 72, 0.22) 100%);
  box-shadow: 0 0 0 1px rgba(196, 112, 90, 0.15), 0 4px 14px rgba(0, 0, 0, 0.25);
}

.log-range-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.log-range-custom {
  padding-top: 0.45rem;
  border-top: 1px dashed var(--hairline-soft);
}

.log-range-custom.hidden {
  display: none !important;
}

.log-range-custom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.85rem;
}

.log-range-dt {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.log-range-dt-lbl {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.log-range-dt-inp {
  font: inherit;
  font-size: 0.84rem;
  padding: 0.42rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  min-width: 11.25rem;
}

.log-range-dt-inp:focus {
  outline: 2px solid rgba(196, 112, 90, 0.45);
  outline-offset: 1px;
  border-color: var(--accent-dim);
}

.log-range-arrow {
  color: var(--muted);
  font-size: 0.95rem;
  padding-bottom: 0.35rem;
}

.log-range-now {
  margin-left: auto;
}

@media (max-width: 640px) {
  .log-range-now {
    margin-left: 0;
    width: 100%;
  }
}

.modal-body {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow: auto;
  flex: 1 1 auto;
  min-height: min(42vh, 320px);
  font-size: 0.8125rem;
  line-height: 1.55;
  background: linear-gradient(165deg, #0c1018 0%, #080a0f 48%, #0a0d12 100%);
  color: #d2dde8;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--hairline-soft);
  box-shadow: inset 0 1px 0 var(--tint);
}

.modal-body::selection {
  background: rgba(196, 112, 90, 0.35);
  color: #fff;
}

@media (max-width: 560px) {
  .modal-card {
    max-height: min(94vh, 900px);
  }

  .modal-body {
    min-height: min(36vh, 220px);
  }
}

/* Toasts */
.toast-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(400px, calc(100vw - 2rem));
  pointer-events: none;
}

.toast-root .toast {
  pointer-events: auto;
}

.toast {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: var(--shadow);
  animation: toast-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast--success {
  border-color: rgba(62, 207, 142, 0.4);
  background: linear-gradient(145deg, rgba(27, 36, 48, 0.98) 0%, rgba(20, 26, 34, 0.99) 100%);
}

html[data-theme="light"] .modal-body {
  background: linear-gradient(165deg, #f3f6fb 0%, #eef2f9 48%, #f0f4fa 100%);
  color: #1a2332;
  border-bottom-color: var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

html[data-theme="light"] .modal-body::selection {
  background: rgba(196, 112, 90, 0.28);
  color: var(--text);
}

html[data-theme="light"] .toast--success {
  border-color: rgba(62, 207, 142, 0.45);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, var(--surface-2) 100%);
}

html[data-theme="light"] .yaml-viewer {
  background: linear-gradient(165deg, #f3f6fb 0%, #eef2f9 100%);
  color: #1a2332;
}

.toast-inner {
  position: relative;
  padding: 0.85rem 2.25rem 0.85rem 1rem;
}

.toast-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--success);
  letter-spacing: -0.01em;
}

.toast-msg {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.toast-close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover {
  color: var(--text);
  background: var(--tint-strong);
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .topbar-meta {
    justify-content: flex-start;
    flex: none;
    width: 100%;
  }
  .toast-root {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}

/* ─── Login (v2) ─── */
.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.login-brand-icon {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 0.6rem;
  object-fit: contain;
  object-position: center;
  background: transparent;
}
.login-title {
  font-size: 1.2rem;
  margin: 0;
  text-align: center;
}

/* ─── Env switcher + user menu ─── */
.env-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.env-switcher-lbl {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}
.env-switcher-sel {
  font: inherit;
  font-size: 0.82rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  max-width: 14rem;
}
.env-switcher-sel:focus {
  outline: 2px solid rgba(196, 112, 90, 0.45);
  outline-offset: 1px;
  border-color: var(--accent-dim);
}

.user-menu {
  position: relative;
}
.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.6rem 0.3rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--tint);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.user-menu-btn:hover {
  background: var(--tint-highlight);
  border-color: var(--muted);
}
.user-avatar {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #e8a090 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.74rem;
}
.user-name {
  max-width: 9.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-role {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(196, 112, 90, 0.12);
  border: 1px solid rgba(196, 112, 90, 0.32);
}
.user-role:empty {
  display: none;
}
.user-chevron::after {
  content: "▾";
  font-size: 0.6rem;
  color: var(--muted);
}
.user-menu-pop {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 240px;
  padding: 0.45rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.user-menu-pop[hidden] {
  display: none !important;
}
.user-menu-item {
  text-align: left;
  font: inherit;
  font-size: 0.86rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  color: var(--text);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.user-menu-item:hover {
  background: var(--tint-strong);
}
.user-menu-item-badge {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.user-menu-item-badge--ok {
  background: rgba(73, 197, 128, 0.18);
  color: #9ee8bc;
  border: 1px solid rgba(73, 197, 128, 0.4);
}
.user-menu-item-badge--warn {
  background: rgba(240, 180, 40, 0.18);
  color: #f7d57c;
  border: 1px solid rgba(240, 180, 40, 0.45);
}
.user-menu-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem 0.6rem 0.55rem;
}
.user-menu-section-lbl {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.user-menu-section .theme-switch {
  align-self: stretch;
}
.user-menu-section .theme-switch__btn {
  flex: 1;
  text-align: center;
}
.user-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0.25rem;
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* ─── Secondary tabs (admin subtabs) ─── */
.subtabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: fit-content;
  margin-bottom: 1rem;
}
.subtab {
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.subtab:hover {
  color: var(--text);
  background: var(--tint);
}
.subtab.is-active {
  background: var(--surface-2);
  color: var(--text);
}

/* ─── Panel head with actions ─── */
.panel-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.panel-head-row .panel-head .hint {
  margin-top: 0.55rem;
}

.panel-head-row > .btn {
  align-self: center;
  flex-shrink: 0;
}

.panel-head-actions {
  display: flex;
  gap: 0.5rem;
  align-self: center;
  flex-wrap: wrap;
}

/* Coluna de ações (kebab) em qualquer data-table */
.data-table .col-actions {
  width: 1%;
  text-align: right;
  vertical-align: middle;
  padding-left: 1rem;
  white-space: nowrap;
}

/* Barra de ferramentas entre o cabeçalho e a tabela — para ações de
   manutenção que não competem visualmente com a acção primária (CTA) do topo. */
.toolbar-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.7rem 0.9rem;
  margin: 0.25rem 0 1rem;
  background: var(--tint);
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.toolbar-strip__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1 1 320px;
}

.toolbar-strip__text strong {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
}

.toolbar-strip__text .hint {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
}

.toolbar-strip > .btn {
  flex-shrink: 0;
  align-self: center;
}

/* ─── Env list (cards) ─── */
.env-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.env-card {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s, transform 0.1s;
}
.env-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-1px);
}
.env-card-title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 700;
}
.env-card-sub {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.env-card-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.2rem 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.env-card-row strong {
  color: var(--text);
  font-weight: 600;
}
.env-card-footer {
  margin-top: 0.65rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ─── Forms em cartão (task/env editor) ─── */
.form-card {
  background: var(--card-well);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}
.form-card + .form-card {
  margin-top: 1rem;
}
.form-card-title {
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.env-identity {
  display: grid;
  grid-template-columns: 1fr minmax(220px, auto);
  gap: 1.2rem 1.5rem;
  align-items: start;
}
@media (max-width: 640px) {
  .env-identity {
    grid-template-columns: 1fr;
  }
}
.env-identity__main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.env-identity__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.env-identity__name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}
.env-identity__hint {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.env-identity__tz {
  min-width: 220px;
}
.form-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
  flex-wrap: wrap;
}
.form-card-head .form-card-title {
  margin: 0;
}
.form-card-hint {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.form-card--muted {
  border-style: dashed;
  opacity: 0.95;
}

.callout {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  background: rgba(196, 112, 90, 0.08);
}
.callout--info {
  border-left: 4px solid var(--accent);
}
.callout strong {
  color: var(--text);
}
.callout-meta {
  display: block;
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}
.callout-meta .code {
  font-size: 0.76rem;
}
.switch-row--spaced {
  margin-top: 0.85rem;
}

/* Visão geral — linguagem orientada ao usuário (sem jargão de infra) */
.overview-block {
  margin-bottom: 0.15rem;
}
.overview-block-hint {
  margin: -0.15rem 0 0.7rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 52rem;
}

/* KPIs da visão geral */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0 1.1rem;
}
.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.95rem 1.05rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
}
.kpi-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.kpi-value .kpi-unit {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: none;
}
.kpi-sub {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.kpi-card--state .kpi-value {
  color: var(--success);
}
.kpi-card--state[data-state="warn"] .kpi-value {
  color: var(--warn);
}
.kpi-card--state[data-state="err"] .kpi-value {
  color: var(--danger);
}
.kpi-card--state[data-state="muted"] .kpi-value {
  color: var(--muted);
}

/* Sub-abas dentro da visão geral */
.overview-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.3rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: fit-content;
  margin-bottom: 0.9rem;
}
.overview-subtab {
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.4rem 0.85rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.overview-subtab:hover {
  color: var(--text);
  background: var(--tint);
}
.overview-subtab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.overview-subtab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  padding: 0 0.4rem;
  height: 1.1rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--tint-strong);
  color: var(--muted);
}
.overview-subtab.is-active .overview-subtab__count {
  background: var(--accent);
  color: #fff;
}
.overview-subpanel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.overview-subpanel-hint {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 52rem;
}

.form-grid {
  display: grid;
  gap: 0.75rem 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.form-grid .field-span-2 {
  grid-column: span 2;
}
.form-grid .field-span-all {
  grid-column: 1 / -1;
}
.field textarea {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  min-height: 120px;
  resize: vertical;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", monospace;
}
.field textarea:focus {
  outline: 2px solid rgba(196, 112, 90, 0.45);
  outline-offset: 1px;
  border-color: var(--accent-dim);
}
.switch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 0.35rem;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.switch input {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}

/* Agendamento da tarefa (presets + cron) */
.schedule-builder {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.schedule-daily-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: var(--tint);
  border: 1px solid var(--hairline-soft);
}
.schedule-daily-lbl {
  font-size: 0.82rem;
  color: var(--muted);
  margin-right: 0.25rem;
}
.schedule-daily-row input[type="number"] {
  width: 3.25rem;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.schedule-daily-sep {
  font-size: 0.8rem;
  color: var(--muted);
}
.mono-input {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", monospace;
  font-size: 0.82rem;
}

/* Opções opcionais (tarefa) */
.opt-task-card {
  margin-top: 0.25rem;
}
.opt-task-rows {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.opt-task-row {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--hairline-soft);
  background: var(--tint);
}
.opt-task-switch {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.opt-task-row .field {
  margin-bottom: 0;
}

/* SSH resumo no formulário de tarefa */
.task-ssh-card {
  margin-top: 0.25rem;
}
.ssh-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.ssh-mini {
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.78rem;
  line-height: 1.35;
}
.ssh-mini--ok {
  border-color: rgba(62, 207, 142, 0.35);
}
.ssh-mini--off {
  opacity: 0.88;
  border-style: dashed;
}
.ssh-mini-lbl {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}
.ssh-mini-val {
  display: block;
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Danger button */
.btn-danger {
  background: rgba(240, 113, 120, 0.14);
  color: #ffc9c9;
  border-color: rgba(240, 113, 120, 0.35);
}
.btn-danger:hover {
  background: rgba(240, 113, 120, 0.22);
  border-color: rgba(240, 113, 120, 0.55);
}

/* ─── YAML preview ─── */
.yaml-viewer {
  margin: 0;
  padding: 1rem 1.1rem;
  background: linear-gradient(165deg, #0c1018 0%, #080a0f 48%, #0a0d12 100%);
  color: #d2dde8;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  border-radius: 10px;
  border: 1px solid var(--border);
  max-height: 70vh;
  overflow: auto;
  white-space: pre;
}

/* ─── Admin: listas + assignments ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
  background: var(--tint);
  color: var(--muted);
}
.badge-admin {
  color: var(--accent);
  border-color: rgba(196, 112, 90, 0.45);
  background: rgba(196, 112, 90, 0.1);
}
.badge-on {
  color: var(--success);
  border-color: rgba(62, 207, 142, 0.45);
  background: rgba(62, 207, 142, 0.08);
}
.badge-off {
  color: var(--danger);
  border-color: rgba(240, 113, 120, 0.45);
  background: rgba(240, 113, 120, 0.08);
}
.badge--ok {
  color: var(--success);
  border-color: rgba(62, 207, 142, 0.45);
  background: rgba(62, 207, 142, 0.08);
}
.badge--neutral {
  color: var(--accent);
  border-color: rgba(196, 112, 90, 0.45);
  background: rgba(196, 112, 90, 0.1);
}
.badge--muted {
  color: var(--muted);
  border-color: var(--border);
  background: var(--tint);
}
.badge--err {
  color: var(--danger);
  border-color: rgba(240, 113, 120, 0.45);
  background: rgba(240, 113, 120, 0.08);
}
.badge--running {
  color: var(--warn);
  border-color: rgba(232, 184, 74, 0.45);
  background: rgba(232, 184, 74, 0.1);
}

/* Célula "Quando roda" em Agendamentos — leitura humana + cron discreto */
.schedule-human {
  display: block;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
.schedule-human--manual {
  color: var(--accent);
}
.schedule-sub {
  display: inline-block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--muted);
}
code.schedule-sub {
  padding: 0.08rem 0.35rem;
}
.row-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.checklist {
  display: grid;
  gap: 0.25rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  padding: 0.5rem 0;
}
.checklist label {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid transparent;
}
.checklist label:hover {
  background: var(--tint);
  border-color: var(--border);
}

/* ─── Modal Acessos (admin ambiente) ─── */
.access-dialog__intro {
  margin-bottom: 0.85rem;
}
.access-dialog__lead {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}
.access-dialog__hint,
.access-dialog__rule {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}
.access-dialog__rule {
  margin-bottom: 0;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}
.access-dialog__rule strong {
  color: var(--text);
}
.access-dialog__section-title {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.access-dialog__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: min(52vh, 440px);
  overflow-y: auto;
  padding: 0.15rem 0.15rem 0.15rem 0;
  scrollbar-gutter: stable;
}
.access-dialog__empty {
  margin: 0;
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--empty-ghost);
}
.access-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(9.5rem, 12rem);
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0;
  padding: 0.75rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.access-row:hover {
  border-color: rgba(196, 112, 90, 0.4);
  box-shadow: 0 0 0 1px rgba(196, 112, 90, 0.12);
}
.access-row:focus-within {
  border-color: rgba(196, 112, 90, 0.55);
}
.access-row__check {
  display: flex;
  align-items: flex-start;
  padding-top: 0.15rem;
}
.access-row__toggle {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 4px;
  accent-color: var(--accent);
  cursor: pointer;
}
.access-row__user {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  pointer-events: none;
}
.access-user__name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}
.access-user__email {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
  word-break: break-all;
}
.access-row__role {
  justify-self: end;
  width: 100%;
  max-width: 12rem;
}
.access-role-select {
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.65rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.access-role-select:hover {
  border-color: rgba(138, 155, 176, 0.45);
}
.access-role-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 112, 90, 0.22);
}
@media (max-width: 520px) {
  .access-row {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  .access-row__role {
    grid-column: 1 / -1;
    justify-self: stretch;
    max-width: none;
  }
}

/* ─── Dialog genérico ─── */
.dialog {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.dialog.hidden {
  display: none !important;
}
.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(4px);
}
.dialog-card {
  position: relative;
  width: min(640px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dialog-card:has(.access-dialog) {
  width: min(720px, 96vw);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.dialog-head h2 {
  margin: 0;
  font-size: 1rem;
}
.dialog-body {
  padding: 1rem;
  overflow: auto;
}
.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--footer-well);
}
.dialog-body .field {
  margin-bottom: 0.85rem;
}

/* ─── View empty/loading ─── */
.view-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.skeleton {
  min-height: 200px;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ─── Helpers ─── */
.code {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", monospace;
  font-size: 0.82rem;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  background: var(--code-bg);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.stack-h {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.kbd {
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  padding: 0.08rem 0.35rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--kbd-bg);
}

/* ─── Responsive ─── */
@media (max-width: 820px) {
  .topbar {
    align-items: stretch;
  }
  .topbar-meta {
    justify-content: space-between;
  }
  .env-switcher {
    flex: 1;
    min-width: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   2FA — Login step 2 + página Segurança + diálogos de enrollment
   ═══════════════════════════════════════════════════════════════════════ */

/* Aviso amarelo (2FA obrigatório por ativar, e afins) */
.banner-warn {
  background: rgba(240, 180, 40, 0.12);
  border: 1px solid rgba(240, 180, 40, 0.4);
  color: #f7d57c;
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Login passo 2 */
.login-2fa-intro {
  margin: 0 0 0.25rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}
.login-2fa-intro code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.08rem 0.35rem;
  border-radius: 5px;
  font-size: 0.82rem;
}
.login-2fa-trust {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
  user-select: none;
}
.login-2fa-trust input[type="checkbox"] {
  accent-color: var(--accent);
}
.login-2fa-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.25rem;
}
.login-2fa-row .btn {
  flex: 1;
}

/* Página Segurança da conta */
.sec-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 820px;
  margin: 0 auto;
}

.sec-meta {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 0.35rem 0.8rem;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.sec-meta-k {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
  font-weight: 700;
  align-self: center;
}
.sec-meta-v {
  font-weight: 600;
}

.sec-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.15rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sec-card--ok {
  border-color: rgba(73, 197, 128, 0.45);
  background: linear-gradient(180deg, rgba(73, 197, 128, 0.08), var(--surface-2));
}
.sec-card-main {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}
.sec-card-icon {
  font-size: 1.55rem;
  line-height: 1;
  flex-shrink: 0;
}
.sec-card-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
}
.sec-card-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
.sec-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.sec-devices {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.35rem 0 0;
  border-top: 1px dashed var(--border);
  margin-top: 0.35rem;
  padding-top: 0.65rem;
}
.sec-device-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.35rem 0;
  font-size: 0.85rem;
}
.sec-device-ua {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sec-device-meta {
  font-size: 0.8rem;
  white-space: nowrap;
}

/* Variante "danger ghost" para desativar 2FA sem ser um CTA primário */
.btn-danger-ghost {
  background: transparent;
  color: #ffb0b6;
  border-color: rgba(240, 113, 120, 0.35);
}
.btn-danger-ghost:hover {
  background: rgba(240, 113, 120, 0.12);
  border-color: rgba(240, 113, 120, 0.55);
}

/* Diálogos de enrollment / disable / recovery codes */
.dialog-intro {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}
.dialog-intro.success-intro {
  color: #9ee8bc;
  font-weight: 600;
}
.field-err {
  margin: 0;
  font-size: 0.82rem;
  color: #ffb0b6;
}

.enroll-qr {
  display: flex;
  justify-content: center;
  padding: 0.5rem;
  background: #fff; /* QR exige contraste alto */
  border-radius: 10px;
  margin: 0 auto 0.9rem;
  width: fit-content;
}
.enroll-qr img {
  display: block;
  width: 210px;
  height: 210px;
  image-rendering: pixelated;
}
.enroll-manual {
  margin: 0 0 0.9rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.84rem;
}
.enroll-manual > summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}
.enroll-manual-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.55rem;
}
.enroll-manual-row {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.enroll-manual-k {
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}
.enroll-manual-v {
  font-family: ui-monospace, "SF Mono", monospace;
  background: var(--kbd-bg, rgba(255, 255, 255, 0.06));
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  word-break: break-all;
  font-size: 0.82rem;
}

.recovery-codes {
  list-style: none;
  margin: 0.25rem 0;
  padding: 0.75rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem 1rem;
  background: var(--surface-1);
  border: 1px dashed var(--border);
  border-radius: 10px;
  counter-reset: recoverylist;
}
.recovery-codes li {
  counter-increment: recoverylist;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.95rem;
  padding: 0.15rem 0.35rem 0.15rem 2rem;
  position: relative;
}
.recovery-codes li::before {
  content: counter(recoverylist) ".";
  position: absolute;
  left: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  top: 0.25rem;
  width: 1.6rem;
  text-align: right;
}
.recovery-codes code {
  background: transparent;
  padding: 0;
}

/* Custos: gráficos de barras horizontais (sem dependências externas) */
.billing-chart-section {
  margin: 1.35rem 0 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.billing-chart-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 650;
  color: var(--text);
}
.billing-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.billing-bar-row {
  display: grid;
  grid-template-columns: minmax(5rem, 1.1fr) minmax(6rem, 2fr) auto;
  gap: 0.5rem 0.65rem;
  align-items: center;
}
.billing-bar-label {
  font-size: 0.82rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.billing-bar-track {
  height: 10px;
  border-radius: 6px;
  background: var(--card-well);
  overflow: hidden;
  border: 1px solid var(--hairline-soft);
}
.billing-bar-fill {
  height: 100%;
  border-radius: 6px;
  min-width: 3px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width 0.25s ease;
}
.billing-bar-meta {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.billing-bar-money {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.billing-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 900px) {
  .billing-two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .recovery-codes {
    grid-template-columns: 1fr;
  }
  .sec-meta {
    grid-template-columns: auto 1fr;
  }
  .billing-bar-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .billing-bar-track {
    order: 2;
    grid-column: 1 / -1;
  }
  .billing-bar-meta {
    text-align: left;
  }
}
