/* =============================================================================
   roehn.css — identidade visual ROEHN na interface do RoehnID (PLANO_STYLE.md)

   Um único arquivo, CSS puro, carregado em TODOS os layouts depois do bootstrap.min.css:
     1. Fontes (Termina self-hosted; corpo em Inter/sistema até existir o kit da Motiva Sans)
     2. Tokens (cores do manual de marca + derivados) — toda cor da interface nasce aqui
     3. Base (fundo, texto, títulos, links, foco)
     4. Re-tema do Bootstrap 5.3 por variáveis --bs-* (Áreas Admin e Revenda não mudam de markup)
     5. Barra superior padronizada (.roehn-topbar) para as três áreas
     6. Componentes roehn-* do portal, da autenticação e dos cards KPI

   Regra: view nunca recebe #hex inline — cor nova entra como token na seção 2.

   Tema escuro (PLANO_STYLE_DARK.md): <html data-theme="dark" data-bs-theme="dark"> liga o bloco
   ":root[data-theme=dark]" no fim da seção 2, que só troca os VALORES dos mesmos tokens — por isso nenhuma
   cor pode ficar escrita à mão fora da seção 2. O atributo é posto pelo script inline dos layouts
   (localStorage "roehnTheme" → senão prefers-color-scheme) antes do primeiro paint.
   ========================================================================== */

/* ---------- 1. Fontes ----------------------------------------------------- */
/* Todas self-hosted em wwwroot/fonts. font-display: block = o navegador espera a fonte certa (alguns ms,
   os arquivos são pequenos e locais) em vez de pintar com a fonte do sistema e trocar depois — isso
   evita o "pulo" do texto. Os layouts fazem <link rel="preload"> dos três arquivos para o download
   começar antes de o CSS ser lido. */

/* Termina (títulos) — woff2 gerados dos TTF de BRAND GUIDELINES/TIPOGRAFIA/Termina, subset latino. */
@font-face {
  font-family: 'Termina';
  font-weight: 300;
  font-style: normal;
  font-display: block;
  src: url('../fonts/Termina-Light.woff2') format('woff2');
}

@font-face {
  font-family: 'Termina';
  font-weight: 400;
  font-style: normal;
  font-display: block;
  src: url('../fonts/Termina-Regular.woff2') format('woff2');
}

/* Inter (corpo) — fonte variável (um arquivo cobre todos os pesos), subset latino, licença OFL
   (wwwroot/fonts/Inter-LICENSE.txt). Antes vinha do CDN rsms.me. */
@font-face {
  font-family: 'Inter';
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
  src: url('../fonts/InterVariable-latin.woff2') format('woff2');
}

/* ---------- 2. Tokens ----------------------------------------------------- */
:root {
  /* Cores do manual (BRAND GUIDELINES, página "Cores") */
  --roehn-offwhite: #FBFAF9;   /* Off White — base institucional: fundo de página (ajuste de 01/10/2026: 251,250,249; o manual traz #FBF6EF) */
  --roehn-surface:  #FFFFFF;   /* superfícies: cards, tabelas, inputs, barra superior */
  --roehn-stone:    #968975;   /* Warm Stone — apoio: bordas marcadas, ícones, rótulos grandes (3,2:1 — não usar em texto corrido) */
  --roehn-taupe:    #746554;   /* Taupe — cor assinatura: PRIMÁRIA (botão, link, ativo, foco) */
  --roehn-gray:     #515151;   /* Dark Gray — texto corrido */
  --roehn-black:    #000000;   /* Black — títulos, logo, contraste máximo */

  /* Derivados (não estão no manual; derivados dos tons acima) */
  --roehn-taupe-2:  #5E5143;   /* hover/pressed do primário */
  --roehn-accent:   #746554;   /* cor de DESTAQUE em texto: links, item ativo, foco, rótulos de seção, filete dos KPIs
                                  (no claro é o próprio Taupe; no escuro vira "Sand", porque o Taupe não lê em fundo escuro) */
  --roehn-accent-2: #5E5143;   /* hover do destaque */
  --roehn-on-primary: #FFFFFF; /* texto sobre o botão primário */
  --roehn-muted:    #7A6E5F;   /* texto secundário — 4,6:1 sobre Off White (AA) */
  --roehn-tint:     #F3EDE4;   /* zebra de tabela, hover de linha, fundo de chip */
  --roehn-tint-2:   #EAE2D6;   /* hover do .btn-secondary */
  --roehn-stripe:   #FCFAF6;   /* linha zebrada da tabela */
  --roehn-line:     rgba(150, 137, 117, 0.28);  /* filete padrão */
  --roehn-line-strong: rgba(150, 137, 117, 0.55);
  --roehn-focus:    rgba(116, 101, 84, 0.18);   /* anel de foco */

  /* Semânticas (dessaturadas para conviver com a paleta) */
  --roehn-success:    #4E7A5A;
  --roehn-success-bg: #E8F0E9;
  --roehn-warning:    #8F6A1F;
  --roehn-warning-bg: #F6EEDC;
  --roehn-danger:     #A94B3C;
  --roehn-danger-bg:  #F5E4E0;
  --roehn-danger-2:   #8E3F32;  /* hover do .btn-danger */
  /* Texto dos alertas (um tom mais escuro que a cor semântica, para ler bem sobre o fundo tingido) */
  --roehn-success-text: #2F5A3A;
  --roehn-warning-text: #6B4E12;
  --roehn-danger-text:  #7E3327;
  /* Bordas de badges e alertas */
  --roehn-success-border: #CBDCCF;
  --roehn-warning-border: #E5D4A8;
  --roehn-danger-border:  #E8C6BF;
  /* Badge "de destaque" (Admin, grupo, features) */
  --roehn-badge-accent-bg:     #EEE8E0;
  --roehn-badge-accent-border: #D9CDBE;
  --roehn-badge-accent-text:   #746554;
  /* Coisas que NÃO mudam no escuro */
  --roehn-qr-bg: #FFFFFF;      /* o QR do 2FA precisa de fundo branco para os leitores */
  /* Pattern Oficial de fundo (telas públicas) e ícone do botão de menu (mobile) */
  --roehn-pattern: url('../img/brand/pattern.webp');
  --roehn-toggler-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(81, 81, 81, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");

  --roehn-font-display: 'Termina', 'Helvetica Neue', Arial, sans-serif;
  --roehn-font-body: 'Motiva Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --roehn-radius: 6px;
  --roehn-shadow: 0 1px 2px rgba(81, 81, 81, 0.06), 0 8px 24px -12px rgba(116, 101, 84, 0.25);
  --roehn-shadow-lg: 0 24px 60px -24px rgba(81, 81, 81, 0.35), 0 1px 2px rgba(81, 81, 81, 0.05);
  --roehn-topbar-height: 60px;
}

/* ---- Tema escuro: mesmos tokens, valores escuros (PLANO_STYLE_DARK.md §2) ----
   Fundo preto QUENTE (nunca cinza-azulado), Off White vira texto, Taupe continua no botão primário,
   "Sand" assume links/destaques. Contrastes conferidos no plano (texto 14:1, muted 6,5:1, Sand 9,6:1). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --roehn-offwhite: #121110;
  --roehn-surface:  #1C1A17;
  --roehn-tint:     #262320;
  --roehn-tint-2:   #302C27;
  --roehn-stripe:   #201E1A;
  --roehn-gray:     #ECE6DC;
  --roehn-black:    #FBFAF9;
  --roehn-muted:    #A99D8D;
  --roehn-taupe-2:  #8A7865;
  --roehn-accent:   #CDBFA9;
  --roehn-accent-2: #E2D6C2;
  --roehn-on-primary: #FBFAF9;
  --roehn-line:     rgba(150, 137, 117, 0.22);
  --roehn-line-strong: rgba(150, 137, 117, 0.45);
  --roehn-focus:    rgba(205, 191, 169, 0.28);
  --roehn-success:    #8FBF9A;  --roehn-success-bg: #1D3324;  --roehn-success-text: #B6DCBB;  --roehn-success-border: rgba(143, 191, 154, 0.35);
  --roehn-warning:    #D9B35A;  --roehn-warning-bg: #3A3014;  --roehn-warning-text: #EBD39A;  --roehn-warning-border: rgba(217, 179, 90, 0.35);
  --roehn-danger:     #E39081;  --roehn-danger-bg:  #3A1F1A;  --roehn-danger-text:  #F1B5A8;  --roehn-danger-border:  rgba(227, 144, 129, 0.35);
  --roehn-danger-2:   #C9705F;
  --roehn-badge-accent-bg: #3A3328;  --roehn-badge-accent-border: rgba(205, 191, 169, 0.3);  --roehn-badge-accent-text: #E2D6C2;
  --roehn-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --roehn-shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.4);
  --roehn-pattern: url('../img/brand/pattern-dark.webp');
  --roehn-toggler-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(236, 230, 220, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  /* Variantes RGB do Bootstrap que o bloco claro escreve como literal */
  --bs-body-color-rgb: 236, 230, 220;
  --bs-secondary-color-rgb: 169, 157, 141;
  --bs-link-color-rgb: 205, 191, 169;
  --bs-link-hover-color-rgb: 226, 214, 194;
  --bs-success-rgb: 143, 191, 154;
  --bs-warning-rgb: 217, 179, 90;
  --bs-danger-rgb: 227, 144, 129;
  --bs-dark: #FBFAF9;
  --bs-dark-rgb: 251, 250, 249;
}

/* ---------- 3. Base ------------------------------------------------------- */
/* As telas sem Bootstrap (portal e autenticação) dependem destes resets; com Bootstrap são redundantes. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--roehn-offwhite);
  color: var(--roehn-gray);
  font-family: var(--roehn-font-body);
  line-height: 1.55;
}

h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
  font-family: var(--roehn-font-display);
  font-weight: 300;
  color: var(--roehn-black);
  letter-spacing: 0.01em;
}

h5, h6, .h5, .h6 {
  font-family: var(--roehn-font-body);
  font-weight: 600;
  color: var(--roehn-black);
}

a {
  color: var(--roehn-accent);
}

a:hover {
  color: var(--roehn-accent-2);
}

code {
  color: var(--roehn-accent-2);
  background: var(--roehn-tint);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Rótulo de seção em Termina caixa alta (cabeçalho de card, nome de área, legenda de grupo). */
.roehn-caps {
  font-family: var(--roehn-font-display);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--roehn-accent);
}

/* ---------- 4. Re-tema do Bootstrap 5.3 ----------------------------------- */
:root,
[data-bs-theme=light] {
  --bs-body-bg: var(--roehn-offwhite);
  --bs-body-color: var(--roehn-gray);
  --bs-body-color-rgb: 81, 81, 81;
  --bs-body-font-family: var(--roehn-font-body);
  --bs-heading-color: var(--roehn-black);
  --bs-emphasis-color: var(--roehn-black);
  --bs-secondary-color: var(--roehn-muted);
  --bs-secondary-color-rgb: 122, 110, 95;
  --bs-tertiary-bg: var(--roehn-tint);
  --bs-border-color: var(--roehn-line);
  --bs-border-color-translucent: var(--roehn-line);
  --bs-border-radius: var(--roehn-radius);
  --bs-border-radius-sm: 4px;
  --bs-link-color: var(--roehn-accent);
  --bs-link-color-rgb: 116, 101, 84;
  --bs-link-hover-color: var(--roehn-accent-2);
  --bs-link-hover-color-rgb: 94, 81, 67;
  --bs-primary: var(--roehn-taupe);
  --bs-primary-rgb: 116, 101, 84;
  --bs-secondary: var(--roehn-stone);
  --bs-secondary-rgb: 150, 137, 117;
  --bs-success: var(--roehn-success);
  --bs-success-rgb: 78, 122, 90;
  --bs-warning: var(--roehn-warning);
  --bs-warning-rgb: 143, 106, 31;
  --bs-danger: var(--roehn-danger);
  --bs-danger-rgb: 169, 75, 60;
  --bs-dark: var(--roehn-black);
  --bs-dark-rgb: 0, 0, 0;
  --bs-focus-ring-color: var(--roehn-focus);
  --bs-code-color: var(--roehn-accent-2);
}

.text-muted {
  color: var(--roehn-muted) !important;
}

/* Botões */
.btn {
  --bs-btn-border-radius: var(--roehn-radius);
  --bs-btn-font-weight: 500;
}

.btn-primary {
  --bs-btn-color: var(--roehn-on-primary);
  --bs-btn-bg: var(--roehn-taupe);
  --bs-btn-border-color: var(--roehn-taupe);
  --bs-btn-hover-color: var(--roehn-on-primary);
  --bs-btn-hover-bg: var(--roehn-taupe-2);
  --bs-btn-hover-border-color: var(--roehn-taupe-2);
  --bs-btn-active-color: var(--roehn-on-primary);
  --bs-btn-active-bg: var(--roehn-taupe-2);
  --bs-btn-active-border-color: var(--roehn-taupe-2);
  --bs-btn-disabled-color: var(--roehn-on-primary);
  --bs-btn-disabled-bg: var(--roehn-stone);
  --bs-btn-disabled-border-color: var(--roehn-stone);
  --bs-btn-focus-shadow-rgb: 116, 101, 84;
}

.btn-outline-primary {
  --bs-btn-color: var(--roehn-accent);
  --bs-btn-border-color: var(--roehn-stone);
  --bs-btn-hover-color: var(--roehn-accent-2);
  --bs-btn-hover-bg: var(--roehn-tint);
  --bs-btn-hover-border-color: var(--roehn-accent);
  --bs-btn-active-color: var(--roehn-on-primary);
  --bs-btn-active-bg: var(--roehn-taupe);
  --bs-btn-active-border-color: var(--roehn-taupe);
  --bs-btn-disabled-color: var(--roehn-stone);
  --bs-btn-disabled-border-color: var(--roehn-line);
  --bs-btn-focus-shadow-rgb: 116, 101, 84;
}

.btn-secondary {
  --bs-btn-color: var(--roehn-black);
  --bs-btn-bg: var(--roehn-tint);
  --bs-btn-border-color: var(--roehn-line-strong);
  --bs-btn-hover-color: var(--roehn-black);
  --bs-btn-hover-bg: var(--roehn-tint-2);
  --bs-btn-hover-border-color: var(--roehn-stone);
  --bs-btn-active-color: var(--roehn-black);
  --bs-btn-active-bg: var(--roehn-tint-2);
  --bs-btn-active-border-color: var(--roehn-stone);
  --bs-btn-focus-shadow-rgb: 150, 137, 117;
}

.btn-outline-secondary,
.btn-outline-light,
.btn-outline-dark {
  --bs-btn-color: var(--roehn-gray);
  --bs-btn-border-color: var(--roehn-line-strong);
  --bs-btn-hover-color: var(--roehn-black);
  --bs-btn-hover-bg: var(--roehn-tint);
  --bs-btn-hover-border-color: var(--roehn-stone);
  --bs-btn-active-color: var(--roehn-black);
  --bs-btn-active-bg: var(--roehn-tint);
  --bs-btn-active-border-color: var(--roehn-stone);
  --bs-btn-disabled-color: var(--roehn-stone);
  --bs-btn-disabled-border-color: var(--roehn-line);
  --bs-btn-focus-shadow-rgb: 150, 137, 117;
}

.btn-danger {
  --bs-btn-color: var(--roehn-on-primary);
  --bs-btn-bg: var(--roehn-danger);
  --bs-btn-border-color: var(--roehn-danger);
  --bs-btn-hover-color: var(--roehn-on-primary);
  --bs-btn-hover-bg: var(--roehn-danger-2);
  --bs-btn-hover-border-color: var(--roehn-danger-2);
  --bs-btn-active-color: var(--roehn-on-primary);
  --bs-btn-active-bg: var(--roehn-danger-2);
  --bs-btn-active-border-color: var(--roehn-danger-2);
  --bs-btn-focus-shadow-rgb: 169, 75, 60;
}

.btn-outline-danger {
  --bs-btn-color: var(--roehn-danger);
  --bs-btn-border-color: var(--roehn-danger);
  --bs-btn-hover-color: var(--roehn-offwhite);
  --bs-btn-hover-bg: var(--roehn-danger);
  --bs-btn-hover-border-color: var(--roehn-danger);
  --bs-btn-active-color: var(--roehn-offwhite);
  --bs-btn-active-bg: var(--roehn-danger);
  --bs-btn-active-border-color: var(--roehn-danger);
  --bs-btn-focus-shadow-rgb: 169, 75, 60;
}

/* Formulários */
.form-control,
.form-select {
  background-color: var(--roehn-surface);
  border-color: var(--roehn-line-strong);
  color: var(--roehn-black);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--roehn-accent);
  box-shadow: 0 0 0 0.2rem var(--roehn-focus);
}

.form-control::placeholder {
  color: var(--roehn-stone);
}

/* A lista aberta do <select> é desenhada pelo navegador/sistema, não pelo CSS da página. O color-scheme diz
   a ele em que modo pintá-la (o bloco escuro define color-scheme: dark no :root e o campo herda) e as cores
   das <option> são respeitadas por Chrome/Edge/Firefox — assim a lista acompanha o tema, claro ou escuro. */
.form-select,
.roehn-input {
  color-scheme: inherit;
}

select option {
  background-color: var(--roehn-surface);
  color: var(--roehn-gray);
}

.form-check-input:checked {
  background-color: var(--roehn-taupe);
  border-color: var(--roehn-taupe);
}

.form-check-input:focus {
  border-color: var(--roehn-accent);
  box-shadow: 0 0 0 0.2rem var(--roehn-focus);
}

.form-label {
  color: var(--roehn-gray);
  font-weight: 500;
}

.form-text {
  color: var(--roehn-muted);
}

/* Cards */
.card {
  --bs-card-bg: var(--roehn-surface);
  --bs-card-border-color: var(--roehn-line);
  --bs-card-border-radius: var(--roehn-radius);
  --bs-card-inner-border-radius: calc(var(--roehn-radius) - 1px);
  --bs-card-cap-bg: var(--roehn-surface);
  --bs-card-cap-color: var(--roehn-accent);
  box-shadow: var(--roehn-shadow);
}

.card.shadow-sm {
  box-shadow: var(--roehn-shadow) !important;
}

.card-header {
  font-family: var(--roehn-font-display);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--roehn-accent);
  border-bottom-color: var(--roehn-line);
}

.card-header.bg-white {
  background-color: var(--roehn-surface) !important;
}

/* Tabelas */
.table {
  --bs-table-bg: var(--roehn-surface);
  --bs-table-color: var(--roehn-gray);
  --bs-table-border-color: var(--roehn-line);
  --bs-table-striped-bg: var(--roehn-stripe);
  --bs-table-striped-color: var(--roehn-gray);
  --bs-table-hover-bg: var(--roehn-tint);
  --bs-table-hover-color: var(--roehn-black);
}

.table > :not(caption) > * > * {
  border-bottom-color: var(--roehn-line);
}

.table > thead th {
  font-family: var(--roehn-font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--roehn-muted);
  background-color: var(--roehn-offwhite);
  border-bottom: 1px solid var(--roehn-line);
}

.table.bg-white {
  background-color: var(--roehn-surface) !important;
}

.table-responsive {
  border-radius: var(--roehn-radius);
}

/* Badges: pílula com fundo claro e texto na cor semântica. */
.badge {
  --bs-badge-font-weight: 600;
  --bs-badge-font-size: 0.68em;
  --bs-badge-padding-x: 0.65em;
  --bs-badge-padding-y: 0.35em;
  --bs-badge-border-radius: 999px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.badge.text-bg-success {
  color: var(--roehn-success-text) !important;
  background-color: var(--roehn-success-bg) !important;
  border-color: var(--roehn-success-border);
}

.badge.text-bg-primary,
.badge.text-bg-dark,
.badge.text-bg-info {
  color: var(--roehn-badge-accent-text) !important;
  background-color: var(--roehn-badge-accent-bg) !important;
  border-color: var(--roehn-badge-accent-border);
}

.badge.text-bg-secondary,
.badge.text-bg-light {
  color: var(--roehn-muted) !important;
  background-color: var(--roehn-tint) !important;
  border-color: var(--roehn-line);
}

.badge.text-bg-warning {
  color: var(--roehn-warning-text) !important;
  background-color: var(--roehn-warning-bg) !important;
  border-color: var(--roehn-warning-border);
}

.badge.text-bg-danger {
  color: var(--roehn-danger-text) !important;
  background-color: var(--roehn-danger-bg) !important;
  border-color: var(--roehn-danger-border);
}

/* Alertas: fundo tingido + texto na cor semântica + borda esquerda de 4 px. O neutro (secondary/info)
   fica em branco; sucesso, atenção e erro precisam saltar aos olhos. */
.alert {
  --bs-alert-bg: var(--roehn-surface);
  --bs-alert-color: var(--roehn-gray);
  --bs-alert-border-color: var(--roehn-line);
  --bs-alert-border-radius: var(--roehn-radius);
  --bs-alert-link-color: inherit;
  border-left: 4px solid var(--roehn-stone);
  font-weight: 500;
}

.alert-success {
  --bs-alert-bg: var(--roehn-success-bg);
  --bs-alert-color: var(--roehn-success-text);
  --bs-alert-border-color: var(--roehn-success-border);
  border-left-color: var(--roehn-success);
}

.alert-warning {
  --bs-alert-bg: var(--roehn-warning-bg);
  --bs-alert-color: var(--roehn-warning-text);
  --bs-alert-border-color: var(--roehn-warning-border);
  border-left-color: var(--roehn-warning);
}

.alert-danger {
  --bs-alert-bg: var(--roehn-danger-bg);
  --bs-alert-color: var(--roehn-danger-text);
  --bs-alert-border-color: var(--roehn-danger-border);
  border-left-color: var(--roehn-danger);
}

.alert-info,
.alert-primary {
  border-left-color: var(--roehn-accent);
}

/* Dropdowns */
.dropdown-menu {
  --bs-dropdown-bg: var(--roehn-surface);
  --bs-dropdown-color: var(--roehn-gray);
  --bs-dropdown-border-color: var(--roehn-line);
  --bs-dropdown-border-radius: var(--roehn-radius);
  --bs-dropdown-link-color: var(--roehn-gray);
  --bs-dropdown-link-hover-color: var(--roehn-black);
  --bs-dropdown-link-hover-bg: var(--roehn-tint);
  --bs-dropdown-link-active-color: var(--roehn-black);
  --bs-dropdown-link-active-bg: var(--roehn-tint);
  --bs-dropdown-header-color: var(--roehn-muted);
  --bs-dropdown-divider-bg: var(--roehn-line);
  box-shadow: var(--roehn-shadow);
}

.dropdown-item.active,
.dropdown-item:active {
  box-shadow: inset 2px 0 0 var(--roehn-accent);
}

/* Paginação */
.pagination {
  --bs-pagination-bg: var(--roehn-surface);
  --bs-pagination-color: var(--roehn-gray);
  --bs-pagination-border-color: var(--roehn-line);
  --bs-pagination-border-radius: var(--roehn-radius);
  --bs-pagination-hover-color: var(--roehn-black);
  --bs-pagination-hover-bg: var(--roehn-tint);
  --bs-pagination-hover-border-color: var(--roehn-line);
  --bs-pagination-focus-color: var(--roehn-black);
  --bs-pagination-focus-bg: var(--roehn-tint);
  --bs-pagination-focus-box-shadow: 0 0 0 0.2rem var(--roehn-focus);
  --bs-pagination-active-color: var(--roehn-on-primary);
  --bs-pagination-active-bg: var(--roehn-taupe);
  --bs-pagination-active-border-color: var(--roehn-taupe);
  --bs-pagination-disabled-color: var(--roehn-stone);
  --bs-pagination-disabled-bg: var(--roehn-surface);
  --bs-pagination-disabled-border-color: var(--roehn-line);
}

/* Números de destaque em Termina Light (os dashboards usam .roehn-kpi; fica para qualquer .display-6 avulso). */
.display-6 {
  font-family: var(--roehn-font-display);
  font-weight: 300;
  color: var(--roehn-black);
}

hr {
  border-top-color: var(--roehn-line-strong);
  opacity: 1;
}

dt {
  color: var(--roehn-black);
  font-weight: 500;
}

/* ---------- 5. Barra superior padronizada --------------------------------- */
/* Usada com o markup .navbar do Bootstrap (collapse/dropdown continuam do bundle):
   <nav class="navbar navbar-expand-md roehn-topbar"> … </nav> */
.roehn-topbar {
  --bs-navbar-padding-y: 0;
  --bs-navbar-color: var(--roehn-muted);
  --bs-navbar-hover-color: var(--roehn-black);
  --bs-navbar-active-color: var(--roehn-black);
  --bs-navbar-brand-color: var(--roehn-black);
  --bs-navbar-brand-hover-color: var(--roehn-black);
  --bs-navbar-toggler-border-color: var(--roehn-line-strong);
  --bs-navbar-toggler-icon-bg: var(--roehn-toggler-icon);
  --bs-navbar-toggler-focus-width: 0.2rem;
  min-height: var(--roehn-topbar-height);
  background-color: var(--roehn-surface);
  border-bottom: 1px solid var(--roehn-line);
  margin-bottom: 1.5rem;
}

/* Marca: logo + nome da área, separados por um filete. */
.roehn-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  min-height: var(--roehn-topbar-height);
  padding: 0;
  color: var(--roehn-black);
  text-decoration: none;
}

.roehn-topbar__logo {
  display: block;
  height: 15px;
  width: auto;
  color: var(--roehn-black);
}

.roehn-topbar__area {
  font-family: var(--roehn-font-display);
  font-weight: 400;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--roehn-stone);
  border-left: 1px solid var(--roehn-line-strong);
  padding-left: 0.9rem;
  line-height: 1;
  padding-top: 2px;
  white-space: nowrap;
}

.roehn-topbar .navbar-nav .nav-link {
  font-size: 0.9rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

/* Com a barra expandida: item ativo sublinhado em Taupe. Colapsada (mobile): só a cor. */
@media (min-width: 768px) {
  .roehn-topbar .navbar-nav > .nav-item > .nav-link {
    padding-top: 0;
    padding-bottom: 0;
    min-height: var(--roehn-topbar-height);
    display: inline-flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
  }

  .roehn-topbar .navbar-nav > .nav-item > .nav-link.active {
    border-bottom-color: var(--roehn-accent);
  }

  .roehn-topbar .navbar-nav > .nav-item + .nav-item {
    margin-left: 0.5rem;
  }
}

.roehn-topbar .navbar-nav .nav-link.active {
  color: var(--roehn-black);
}

/* Bloco do usuário à direita (revenda · nome). */
.roehn-topbar__meta {
  font-size: 0.85rem;
  color: var(--roehn-muted);
  white-space: nowrap;
}

.roehn-topbar__meta strong {
  color: var(--roehn-black);
  font-weight: 500;
}

@media (min-width: 768px) {
  .roehn-topbar__meta {
    border-left: 1px solid var(--roehn-line-strong);
    padding-left: 1rem;
    margin-left: 0.25rem;
  }
}

/* Avatar de iniciais (menu do usuário). */
.roehn-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--roehn-tint);
  border: 1px solid var(--roehn-line-strong);
  display: inline-grid;
  place-items: center;
  font-family: var(--roehn-font-display);
  font-size: 0.6rem;
  color: var(--roehn-accent);
  line-height: 1;
  flex: none;
}

/* Botão de tema claro/escuro (_ThemeSwitcher.cshtml): mostra a lua no claro (vai para o escuro) e o sol no escuro. */
.roehn-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--roehn-radius);
  color: var(--roehn-muted);
  cursor: pointer;
}

.roehn-theme:hover {
  color: var(--roehn-black);
  background: var(--roehn-tint);
  border-color: var(--roehn-line-strong);
}

.roehn-theme:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.2rem var(--roehn-focus);
}

.roehn-theme svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}

.roehn-theme .roehn-theme__sun {
  display: none;
}

:root[data-theme="dark"] .roehn-theme .roehn-theme__sun {
  display: block;
}

:root[data-theme="dark"] .roehn-theme .roehn-theme__moon {
  display: none;
}

/* Nas telas de autenticação o botão fica solto no canto (o layout não tem barra). */
.roehn-auth__theme {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
}

/* Variante escura (logo branco sobre preto) — pronta, não usada por padrão (PLANO_STYLE D2). */
.roehn-topbar--dark {
  --bs-navbar-color: rgba(255, 255, 255, 0.65);
  --bs-navbar-hover-color: #fff;
  --bs-navbar-active-color: #fff;
  --bs-navbar-brand-color: #fff;
  --bs-navbar-brand-hover-color: #fff;
  --bs-navbar-toggler-border-color: rgba(255, 255, 255, 0.3);
  --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  background-color: var(--roehn-black);
  border-bottom-color: var(--roehn-black);
  color: #fff;
}

.roehn-topbar--dark .roehn-topbar__brand,
.roehn-topbar--dark .roehn-topbar__logo,
.roehn-topbar--dark .navbar-nav .nav-link.active,
.roehn-topbar--dark .roehn-topbar__meta strong {
  color: #fff;
}

.roehn-topbar--dark .roehn-topbar__area {
  color: rgba(255, 255, 255, 0.6);
  border-left-color: rgba(255, 255, 255, 0.25);
}

.roehn-topbar--dark .roehn-topbar__meta {
  color: rgba(255, 255, 255, 0.7);
  border-left-color: rgba(255, 255, 255, 0.25);
}

/* ---------- 6. Componentes roehn-* ---------------------------------------- */

/* Cards KPI dos dashboards (usar junto com .card: <div class="card roehn-kpi">): barra de cor à ESQUERDA
   (como no desenho original do Dashboard da Admin) — Taupe nos principais, Warm Stone nos secundários. */
.card.roehn-kpi,
.roehn-kpi {
  background: var(--roehn-surface);
  border: 1px solid var(--roehn-line);
  border-left: 0.3rem solid var(--roehn-accent);
  border-radius: var(--roehn-radius);
  box-shadow: var(--roehn-shadow) !important;
}

.card.roehn-kpi--secondary,
.roehn-kpi--secondary {
  border-left-color: var(--roehn-stone);
}

.roehn-kpi__label {
  font-family: var(--roehn-font-display);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--roehn-muted);
}

.roehn-kpi__value {
  font-family: var(--roehn-font-display);
  font-weight: 300;
  font-size: 2.1rem;
  line-height: 1.15;
  color: var(--roehn-black);
}

/* Portal (_RoehnLayout) — mesmas classes que as views de Segurança/Error já usam. */
.roehn-portal {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Barra do portal (sem Bootstrap): mesmo desenho da .roehn-topbar das áreas Admin/Revenda. */
.roehn-nav {
  background: var(--roehn-surface);
  border-bottom: 1px solid var(--roehn-line);
}

/* Largura total, com o mesmo gutter do .container-fluid do Bootstrap (Admin/Revenda). */
.roehn-nav__inner {
  min-height: var(--roehn-topbar-height);
  padding: 0 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.roehn-nav__brand {
  display: inline-flex;
  align-items: center;
  color: var(--roehn-black);
  text-decoration: none;
}

.roehn-nav__auth {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  font-size: 0.875rem;
}

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

.roehn-nav__login,
.roehn-nav__logout {
  color: var(--roehn-gray);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.roehn-nav__login:hover,
.roehn-nav__logout:hover {
  color: var(--roehn-black);
}

.roehn-nav__logout-form {
  margin: 0;
  display: inline;
}

/* Hero da home: logo grande sobre o Pattern Oficial. */
.roehn-main--hero {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background-color: var(--roehn-offwhite);
  background-image: var(--roehn-pattern);
  background-size: cover;
  background-position: center;
}

/* Conteúdo centralizado (a barra acima continua em largura total): nas telas do portal os cards são
   poucos e esticar até a borda deixa tudo deformado. Mesmo gutter do .container-fluid. */
.roehn-main--content {
  flex: 1 1 auto;
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.5rem 0.75rem 3rem;
}

.roehn-wordmark {
  display: block;
  width: min(60vw, 420px);
  height: auto;
  color: var(--roehn-black);
}

.roehn-h1 {
  font-family: var(--roehn-font-display);
  font-weight: 300;
  font-size: 1.7rem;
  color: var(--roehn-black);
  margin: 0 0 1.5rem;
}

.roehn-h2 {
  font-family: var(--roehn-font-display);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--roehn-accent);
  margin: 0 0 0.35rem;
}

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

.roehn-card {
  background: var(--roehn-surface);
  border: 1px solid var(--roehn-line);
  border-radius: var(--roehn-radius);
  box-shadow: var(--roehn-shadow);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.roehn-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.roehn-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.roehn-badge--on {
  color: var(--roehn-success-text);
  background: var(--roehn-success-bg);
  border-color: var(--roehn-success-border);
}

.roehn-badge--off {
  color: var(--roehn-muted);
  background: var(--roehn-tint);
  border-color: var(--roehn-line);
}

/* Mesmo desenho dos .alert do Bootstrap: fundo tingido, texto na cor semântica, borda esquerda de 4 px. */
.roehn-alert {
  background: var(--roehn-surface);
  border: 1px solid var(--roehn-line);
  border-left: 4px solid var(--roehn-stone);
  border-radius: var(--roehn-radius);
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--roehn-gray);
}

.roehn-alert--info {
  border-left-color: var(--roehn-accent);
}

.roehn-alert--warn {
  background: var(--roehn-warning-bg);
  border-color: var(--roehn-warning-border);
  border-left-color: var(--roehn-warning);
  color: var(--roehn-warning-text);
}

.roehn-alert--danger {
  background: var(--roehn-danger-bg);
  border-color: var(--roehn-danger-border);
  border-left-color: var(--roehn-danger);
  color: var(--roehn-danger-text);
}

.roehn-alert--success {
  background: var(--roehn-success-bg);
  border-color: var(--roehn-success-border);
  border-left-color: var(--roehn-success);
  color: var(--roehn-success-text);
}

.roehn-alert a {
  color: inherit;
  text-decoration: underline;
}

.roehn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.roehn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--roehn-taupe);
  color: var(--roehn-on-primary);
  border: 1px solid var(--roehn-taupe);
  border-radius: var(--roehn-radius);
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.2;
  text-decoration: none;
}

.roehn-btn:hover {
  background: var(--roehn-taupe-2);
  border-color: var(--roehn-taupe-2);
  color: var(--roehn-on-primary);
}

.roehn-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.2rem var(--roehn-focus);
}

.roehn-btn--outline {
  background: transparent;
  color: var(--roehn-accent);
  border-color: var(--roehn-stone);
}

.roehn-btn--outline:hover {
  background: var(--roehn-tint);
  border-color: var(--roehn-accent);
  color: var(--roehn-accent-2);
}

.roehn-btn--danger {
  background: transparent;
  color: var(--roehn-danger);
  border-color: var(--roehn-danger);
}

.roehn-btn--danger:hover {
  background: var(--roehn-danger);
  border-color: var(--roehn-danger);
  color: var(--roehn-offwhite);
}

.roehn-btn--block {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 1rem;
}

.roehn-link {
  color: var(--roehn-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  padding: 0.55rem 0.75rem;
}

.roehn-link:hover {
  color: var(--roehn-accent-2);
}

.roehn-inline-form {
  display: inline;
  margin: 0;
}

.roehn-steps {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}

.roehn-steps li {
  margin-bottom: 1rem;
}

.roehn-field {
  margin-bottom: 1rem;
  max-width: 18rem;
}

.roehn-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--roehn-gray);
  margin-bottom: 0.3rem;
}

.roehn-input {
  display: block;
  width: 100%;
  background: var(--roehn-surface);
  border: 1px solid var(--roehn-line-strong);
  color: var(--roehn-black);
  border-radius: var(--roehn-radius);
  padding: 0.55rem 0.75rem;
  font: inherit;
}

.roehn-input--code {
  letter-spacing: 0.2em;
  text-align: center;
  font-size: 1.2rem;
}

.roehn-input::placeholder {
  color: var(--roehn-stone);
}

.roehn-input:focus {
  outline: none;
  border-color: var(--roehn-accent);
  box-shadow: 0 0 0 0.2rem var(--roehn-focus);
}

.roehn-error {
  color: var(--roehn-danger);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

.roehn-error:empty {
  display: none;
}

.roehn-error-summary {
  color: var(--roehn-danger);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.roehn-error-summary:empty {
  display: none;
}

.roehn-error-summary ul {
  margin: 0;
  padding-left: 1rem;
}

.roehn-qr {
  width: 200px;
  height: 200px;
  border: 8px solid var(--roehn-qr-bg);
  border-radius: var(--roehn-radius);
  box-shadow: var(--roehn-shadow);
  display: block;
  background: var(--roehn-qr-bg);
}

.roehn-kbd {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--roehn-tint);
  border: 1px solid var(--roehn-line);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.95rem;
  color: var(--roehn-black);
}

.roehn-codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.5rem;
}

/* Autenticação (_AuthLayout): fundo Off White com o Pattern Oficial e card centralizado. */
.roehn-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-color: var(--roehn-offwhite);
  background-image: var(--roehn-pattern);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.roehn-auth__card {
  width: 100%;
  max-width: 25rem;
  background: var(--roehn-surface);
  border: 1px solid var(--roehn-line);
  border-radius: 10px;
  padding: 2.25rem 2.1rem 1.75rem;
  box-shadow: var(--roehn-shadow-lg);
}

.roehn-auth__card--wide {
  max-width: 30rem;
}

.roehn-auth__logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0.6rem;
}

.roehn-auth__logo a {
  display: inline-flex;
  color: var(--roehn-black);
}

.roehn-auth__logo-svg,
.roehn-auth__logo img {
  display: block;
  height: 22px;
  width: auto;
  color: var(--roehn-black);
}

.roehn-auth__tag {
  text-align: center;
  font-family: var(--roehn-font-display);
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--roehn-stone);
  margin: 0 0 1.75rem;
}

.roehn-auth__title {
  text-align: center;
  font-family: var(--roehn-font-display);
  font-weight: 300;
  font-size: 1.25rem;
  color: var(--roehn-black);
  margin: 1rem 0 0.35rem;
}

.roehn-auth__subtitle {
  text-align: center;
  font-size: 0.875rem;
  color: var(--roehn-muted);
  margin: 0.75rem 0 1.5rem;
}

.roehn-auth__title + .roehn-auth__subtitle {
  margin-top: 0;
}

/* Acesso negado: só texto e um botão, centralizados. */
.roehn-auth__denied {
  text-align: center;
  padding-top: 0.5rem;
}

.roehn-auth__denied .roehn-auth__subtitle {
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.roehn-auth .roehn-field {
  max-width: none;
}

.roehn-auth__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.roehn-auth__check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--roehn-muted);
  margin-bottom: 1rem;
}

.roehn-auth__check input {
  accent-color: var(--roehn-accent);
}

.roehn-auth__password {
  position: relative;
}

.roehn-auth__password .roehn-input {
  padding-right: 2.5rem;
}

.roehn-auth__eye {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--roehn-stone);
}

.roehn-auth__eye:hover {
  color: var(--roehn-accent);
}

.roehn-auth__eye svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
}

.roehn-auth__footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--roehn-line);
  text-align: center;
  font-size: 0.78rem;
  color: var(--roehn-muted);
}

.roehn-auth__footer p {
  margin: 0 0 0.75rem;
}

.roehn-auth__footer a {
  color: var(--roehn-accent);
}
