/*
 * Administrador de Clientes Municipay · tema, peças e utilitários em CSS puro (sem build, sem Tailwind).
 * Este é o arquivo servido ao navegador. Proposta aprovada: "Proposta visual - Administrador de Clientes
 * Municipay.pdf" (DEM-148).
 *
 * CAMADAS (@layer nativo do CSS, nesta ordem): base (reset e tokens) < components (peças) < utilities.
 * Um utilitário sempre ganha de uma peça; por isso "hidden" esconde até um .modal (display: flex).
 *
 * REGRAS DE USO NAS VIEWS
 * - Use as peças abaixo. Para layout, só os utilitários que existem no fim deste arquivo (lista em
 *   "Utilitários"). Precisou de um que não existe? Acrescente-o na camada utilities, no mesmo padrão.
 * - Cor só pelas peças ou pelos utilitários de token (text-mp-*, bg-mp-*); nada de cor solta nem sombra.
 * - Nunca "hidden" junto com "flex"/"grid" no mesmo elemento que o JS mostra e esconde.
 * - Ícone: <span class="icon" aria-hidden="true">nome</span> (Material Symbols Rounded, 20px).
 *   "icon fill" = preenchido; "icon icon-sm" = 16px; "icon icon-lg" = 24px; "icon icon-xl" = 64px;
 *   "icon spinner" = girando.
 *
 * INVENTÁRIO DE CLASSES
 * Tokens (:root): mp-green #00C19F (ação, ativo) · mp-navy #00263A (texto, bordas, topo) · mp-teal #005A6F
 *   (secundário, ícones) · mp-ink #051C2C (reservada) · mp-mist #E7EFE7 (apoio) · mp-danger #D93B3B ·
 *   mp-warning #E5A100 · white. rounded-mp (0,5rem) · font-heading (Clarify) · font-sans (Roboto) ·
 *   font-mono (Roboto Mono).
 *   Por papel (use estes nas peças novas): --bg (fundo da página) · --surface (vidro de painel, modal, campo) ·
 *   --surface-soft (apoio) · --text · --text-2 (secundário) · --line (bordas de botão e campo) ·
 *   --color-divider · --color-placeholder. Vidro: --glass-lift · --glass-line · --glass-hi · --glass-blur
 *   (use a peça "glass" ou copie as quatro juntas). Tema único, escuro: não há modo claro.
 *
 * Texto
 *   page-head ........ cabeçalho da página: <div class="page-head"><div><h1 class="page-title">…</h1>
 *                      <p class="page-sub">…</p></div><div class="page-actions">botões</div></div>
 *   page-title ....... título de página em Clarify 30px (use fora do page-head também)
 *   display-title .... título grande em Clarify 48px (home)
 *   display-title-on-dark  título grande em mist até 56px sobre navy (painel do login)
 *   page-sub ......... subtítulo/descrição em teal 14px
 *   page-lead ........ texto de abertura maior em teal 17px (boas-vindas da home)
 *   section-title .... título de seção em Clarify 20px (fora de modal)
 *   text-muted ....... texto secundário em teal (13px); "text-muted-sm" 12px
 *   link ............. link sublinhado em verde
 *   code (elemento) .. <code> já sai em mono sobre mist; não precisa de classe
 *
 * Botões (sempre com rótulo, como hoje)
 *   btn .............. base, já com contorno navy (secundário: Cancelar, Sincronizar Bases)
 *   btn-outline ...... igual ao btn; use para deixar explícito
 *   btn-primary ...... verde com texto navy (Novo, Salvar, Entrar, Confirmar)
 *   btn-danger ....... vermelho com texto branco (Sim, Excluir)
 *   btn-text ......... sem borda (ação leve na tabela: Editar)
 *   btn-text-danger .. sem borda, vermelho (Excluir na tabela)
 *   btn-icon ......... só ícone 36×36 (ações de linha); exige <span class="sr-only"> ou title
 *   btn-icon-danger .. junto com btn-icon: fica vermelho (ícone e fundo rosado) no hover (Excluir na linha)
 *   btn-sm ........... altura 32px
 *   btn-block ........ largura total
 *   btn-lg ........... altura 52px, texto 15px (ação central da página, ex.: Executar na Sincronização)
 *   btn-on-dark ...... contorno claro sobre fundo navy (topo, codeblock)
 *   (disabled e :focus-visible já tratados)
 *
 * Campos
 *   field ............ wrapper de um campo (rótulo + input + ajuda), empilhado
 *   field-label ...... rótulo acima do campo; "field-label-caps" = 12px maiúsculas em teal
 *   field-input ...... input, select e textarea (40px, borda .1rem navy, foco verde, erro vermelho via
 *                      .is-error, aria-invalid ou .input-validation-error)
 *   field-input-mono . junto com field-input: Roboto Mono (identificadores, connection string)
 *   field-input-highlight  junto com field-input: borda verde 1,7px, 17px/500 (senha gerada)
 *   field-input-danger junto com field-input: borda vermelha sem sentido de erro (senha do Excluir)
 *   field-float ...... login: <div class="field-float"><input class="field-input" placeholder=" ">
 *                      <label>…</label></div> (o label vem DEPOIS do input)
 *   help ............. texto de ajuda abaixo do campo; "help-error" em vermelho
 *   validação ........ o site.js valida todo formulário ao enviar (required, pattern com a mensagem no title,
 *                      data-match="OutroCampo" para confirmar senha): põe aria-invalid no campo e cria o
 *                      "help help-error" embaixo; não é preciso escrever a mensagem no HTML
 *   checkbox ......... <input type="checkbox" class="checkbox">
 *   checkbox-row ..... <label class="checkbox-row"><input class="checkbox">Texto</label>
 *
 * Marcações e status
 *   badge ............ etiqueta mist (função "Admin"); "badge-mono" (nome de banco, código);
 *                      "badge-outline" (contorno, ambientes alvo)
 *   status-on ........ "Ativo": verde com ícone check_circle preenchido (pode ser <button>)
 *   status-off ....... "Inativo": contorno vermelho com ícone block
 *   status-neutral ... contorno navy com ícone teal
 *
 * Blocos
 *   panel ............ caixa com borda navy de 1,7px e raio (envolve a data-table)
 *   panel-soft ....... área de apoio mist, sem borda, texto 14px com entrelinha 1,6
 *   data-table ....... <table> dentro do panel; th em maiúsculas sobre mist; "data-table-compact"
 *                      células: cell-strong (nome) · cell-sub (linha de baixo, teal 12px) ·
 *                      cell-mono · cell-actions (flex dos botões, centralizado; "cell-actions-end" à direita)
 *   avatar ........... quadrado 40px teal com a inicial em Clarify mist (lista de usuários)
 *   callout .......... aviso (atenção, âmbar) com ícone: <div class="callout callout-warning">
 *                      <span class="callout-icon"><span class="icon">warning</span></span>
 *                      <div class="callout-text">…</div></div>; use o partial _Alert nas telas.
 *                      Variantes: callout-success, callout-danger, callout-warning
 *   toast ............ avisos de resultado (TempData Success/Error) flutuando embaixo, ao centro; gerados
 *                      pelo partial _Toasts no _Layout, não use nas telas. "toast-region" é o contêiner
 *   codeblock ........ bloco navy em mono (connection string); botão Copiar dentro com
 *                      "btn btn-sm btn-on-dark codeblock-action"; textarea dentro: "codeblock-input"
 *   tile ............. quadrado 52px com ícone 28px: tile-danger · tile-green · tile-soft; "tile-lg" 64px
 *   kv-v-lg .......... valor em destaque, Clarify 20px (nome do cliente nas credenciais)
 *   kv ............... par chave/valor: <div class="kv"><span class="kv-k">Cliente</span>
 *                      <span class="kv-v">Jataí</span></div>
 *   card-teal ........ card da home (link inteiro): card-teal-icon (tile verde) · card-teal-title ·
 *                      card-teal-text · card-teal-go · <img class="pix" src="~/img/pixels-card-1.svg">
 *   page-graphic ..... grafismo de pixels fixo nos cantos de baixo, atrás do conteúdo e do vidro:
 *                      "page-graphic-right" (pixels-bg-right.svg) e "page-graphic-left" (pixels-bg-left.svg)
 *                      no _Layout; "page-graphic-login" no login. z-index -1: o body não pode ter fundo próprio
 *   glass ............ superfície de vidro (fundo translúcido, borda clara, desfoque); panel, dialog, toast,
 *                      card-teal e a barra do topo já usam
 *   login-page ....... body do login (marca à esquerda, formulário à direita); login-card = cartão de vidro
 *   pix .............. grafismo de pixels animado (wwwroot/img/pixels-*.svg); posicione com
 *                      absolute/right-0/top-0/bottom-0
 *   spinner .......... "icon spinner" com progress_activity: gira (parado com reduce-motion)
 *   skeleton ......... esqueleto de carregamento entre telas; fica no _Layout (#page-skeleton) e o
 *                      site.js mostra a forma da tela de destino (table, cards, sync). Peças: skeleton
 *                      (barra mist com brilho) · skeleton-title · skeleton-display · skeleton-line(-sm) ·
 *                      skeleton-button(-lg) · skeleton-chip · skeleton-actions · skeleton-card ·
 *                      skeleton-tile · skeleton-callout · skeleton-panel · skeleton-table-head · skeleton-row
 *
 * Modal (use o partial _Modal; ele gera estas classes)
 *   modal ............ fundo navy 38% com desfoque, abre e fecha com fade (o "hidden" é animado pelo CSS); esconda com "hidden"; data-modal-overlay
 *   modal-strong ..... junto com modal: fundo navy 60% (ação em massa)
 *   modal-top ........ junto com modal: painel no alto da tela, não no centro
 *   dialog ........... painel branco 420px; "dialog-wide" 480px; "dialog-roomy" 520px (título 26px);
 *                      "dialog-center" centraliza o texto
 *   dialog-title ..... título Clarify 21px com ícone; "dialog-title-ruled" (linha embaixo);
 *                      "dialog-title-center"
 *   dialog-body ...... grid com 16px entre campos, logo abaixo do título
 *   dialog-actions ... linha de botões no fim (gap 8px, à direita); "dialog-actions-full" divide
 *                      a largura entre os botões; "dialog-actions-center" centraliza
 *
 * Telas em lista e detalhe (Clientes, Usuários) · ver o bloco no fim do arquivo
 *   split ............ grade lista (385px) + detalhe; no celular, empilha
 *   list-panel ....... painel da lista: list-tools (busca "search" + "chips"/"chip" com aria-pressed) ·
 *                      list-items > li > a.list-item (.is-selected) com dot (dot-on/dot-off) ·
 *                      list-item-text (list-item-name, list-item-sub) · list-item-icon · tag · list-empty
 *   detail ........... painel do detalhe: detail-head (detail-title, detail-meta, detail-code, pill pill-on/
 *                      pill-off) · detail-section (coluna do título 200px: detail-section-title + text-muted)
 *   kv-grid .......... <dl> rótulo/valor/ação: dt.kv-label · dd.kv-value (kv-value-muted) · dd.kv-action
 *   switch ........... <label class="switch-row"><input type="checkbox" role="switch" class="switch">Texto</label>
 *   choice-row ....... caixas lado a lado (motor de enriquecimento)
 *   drawer ........... painel lateral à direita (Novo Cliente/Usuário), abre e fecha como o modal ("hidden"):
 *                      drawer-panel · drawer-head (drawer-title) · steps/step (.is-current/.is-done) ·
 *                      drawer-body · drawer-step (fieldset de um passo) · drawer-foot · resumo
 *   Visão geral ...... kpi-strip > kpi (kpi-label, kpi-value, kpi-split) · home-grid · panel-head (panel-title,
 *                      panel-link) · panel-empty · row-list > li > a.row-link (row-icon/row-icon-muted, row-sub,
 *                      row-go)
 *
 * Layout (só _Layout e Login)
 *   wrap · topbar · topbar-nav · topbar-link (.is-active) · topbar-user · mobile-menu ·
 *   mobile-menu-link · mobile-menu-user · mobile-menu-who · mobile-menu-danger · topbar-bar · topbar-toggle · site-foot ·
 *   sig (assinatura) · sig-map (mapa-clientes-mini.svg) · sig-txt · sig-logo (logo da Municipay) · sig-name
 *
 * Utilitários (camada utilities, valores do padrão de 4px: 1 = 0,25rem)
 *   posição: relative · absolute · fixed · inset-0 · top-0 · right-0 · z-10 · z-[60]
 *   display: block · inline · flex · grid · hidden · sr-only
 *   flex/grid: flex-col · flex-wrap · flex-1 · flex-grow · items-center · items-start · justify-between ·
 *     justify-center · grid-cols-1 · gap-1 · gap-2 · gap-3 · gap-3.5 · gap-4 · gap-5 · gap-6 · gap-8
 *   margem: mx-auto · ml-auto · mt-1…mt-8 · mt-auto · mb-3 · mb-4 · mb-6 · mb-8
 *   padding: p-4 · p-6 · p-[18px] · px-3 · px-4 · px-6 · py-2 · py-3 · py-4 · py-5 · py-8 · py-10
 *   tamanho: w-full · w-1/3 · w-[150px] · w-[200px] · h-full · min-h-screen · max-w-md · max-w-xl ·
 *     max-w-4xl · max-w-[400px] · max-w-[520px] · max-w-[320px] · w-[110px] · w-[140px] · w-[160px] · min-w-0
 *   texto: text-left · text-center · text-right · whitespace-nowrap · tabular-nums · font-mono
 *   tokens: text-mp-navy · text-mp-green · text-mp-danger · bg-mp-navy · bg-mp-mist · bg-white/90 · rounded-mp
 *   overflow: overflow-hidden · overflow-x-auto
 *   responsivo (sm 640px · md 768px · lg 1024px · xl 1280px): sm:px-6 · md:hidden · md:grid-cols-2 ·
 *     md:p-10 · max-md:hidden · max-lg:hidden · max-lg:sr-only · lg:block · lg:flex · lg:grid · lg:grid-cols-2 ·
 *     lg:flex-col · lg:gap-12 · lg:px-12 · lg:px-16 · lg:py-14 · xl:grid-cols-[minmax(0,1fr)_640px]
 */

@layer base, components, utilities;

@font-face {
  font-family: "YWFT Clarify";
  src: url("../fonts/YWFT-Clarify-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "YWFT Clarify";
  src: url("../fonts/YWFT-Clarify-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@layer base {
  /* Reset (o mesmo comportamento do preflight que o Tailwind injetava) */
  *,
  ::before,
  ::after,
  ::backdrop {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0 solid;
  }
  html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    font-family: var(--font-sans);
    -webkit-tap-highlight-color: transparent;
  }
  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
  }
  a {
    color: inherit;
    text-decoration: inherit;
  }
  b, strong {
    font-weight: bolder;
  }
  code, kbd, samp, pre {
    font-family: var(--font-mono);
    font-size: 1em;
  }
  small {
    font-size: 80%;
  }
  table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
  }
  ol, ul, menu {
    list-style: none;
  }
  img, svg, video, canvas, audio, iframe, embed, object {
    display: block;
    vertical-align: middle;
  }
  img, video {
    max-width: 100%;
    height: auto;
  }
  button, input, select, optgroup, textarea {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    border-radius: 0;
    background-color: transparent;
    opacity: 1;
  }
  textarea {
    resize: vertical;
  }
  button, input:where([type="button"], [type="reset"], [type="submit"]) {
    appearance: button;
  }
  ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
    height: auto;
  }
  [hidden]:where(:not([hidden="until-found"])) {
    display: none !important;
  }

  /* Tokens da marca */
  :root {
    --color-white: #FFFFFF;
    --color-mp-green: #00C19F;
    --color-mp-navy: #00263A;
    --color-mp-teal: #005A6F;
    --color-mp-ink: #051C2C;
    --color-mp-mist: #E7EFE7;
    --color-mp-danger: #D93B3B;
    --danger-text: color-mix(in srgb, var(--color-mp-danger) 70%, var(--color-white));
    --color-mp-warning: #E5A100;
    --radius-mp: 0.5rem;
    --font-heading: "YWFT Clarify", "Roboto", sans-serif;
    --font-sans: "Roboto", sans-serif;
    --font-mono: "Roboto Mono", monospace;
    --border-w: 1.7px;
    --field-border-w: 0.1rem;
    --radius-sm: 4px;
    --control-h: 40px;
    --icon-size: 20px;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

    /* Cores por papel: tema único, escuro. As superfícies são de vidro sobre o fundo com pixels. */
    color-scheme: dark;
    --bg: color-mix(in srgb, var(--color-mp-ink) 80%, #000000);
    --surface: color-mix(in srgb, var(--color-mp-ink) 42%, transparent);
    --surface-soft: color-mix(in srgb, var(--color-mp-mist) 9%, transparent);
    --text: var(--color-mp-mist);
    --text-2: color-mix(in srgb, var(--color-mp-mist) 70%, transparent);
    --line: color-mix(in srgb, var(--color-mp-mist) 30%, var(--color-mp-navy));
    --color-divider: color-mix(in srgb, var(--color-mp-mist) 10%, transparent);
    --color-placeholder: color-mix(in srgb, var(--color-mp-mist) 45%, var(--color-mp-navy));
    --focus-color: color-mix(in srgb, var(--color-mp-green) 60%, transparent);
    --overlay: color-mix(in srgb, var(--color-mp-ink) 30%, transparent);
    --overlay-strong: color-mix(in srgb, var(--color-mp-ink) 60%, transparent);
    --shimmer: color-mix(in srgb, var(--color-mp-mist) 10%, transparent);
    --codeblock-bg: color-mix(in srgb, var(--color-mp-ink) 55%, transparent);

    /* Vidro */
    --glass-lift: color-mix(in srgb, var(--color-mp-mist) 6%, transparent);
    --glass-line: color-mix(in srgb, var(--color-mp-mist) 15%, transparent);
    --glass-hi: inset 0 1px 0 color-mix(in srgb, var(--color-white) 9%, transparent);
    --glass-blur: blur(28px) saturate(1.5);
  }

  html {
    background: var(--bg);
  }

  body {
    font-family: var(--font-sans);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
  }

  :focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 0;
  }

  code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--surface-soft);
    border-radius: var(--radius-sm);
    padding: 1px 5px;
    color: var(--text);
  }

  ::placeholder {
    color: var(--color-placeholder);
    opacity: 1;
  }
}

@layer components {
  /* ===== Ícones ===== */
  .icon {
    font-family: "Material Symbols Rounded";
    font-weight: 400;
    font-style: normal;
    font-size: var(--icon-size);
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-feature-settings: "liga";
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
    flex: none;
    user-select: none;
  }
  .icon.fill {
    font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 20;
  }
  .icon.icon-sm {
    font-size: 16px;
  }
  .icon.icon-xl {
    font-size: 64px;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 48;
  }
  .icon.icon-lg {
    font-size: 24px;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  }
  .spinner {
    animation: mp-spin 0.9s linear infinite;
  }
  @keyframes mp-spin {
    to {
      transform: rotate(360deg);
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .spinner {
      animation-duration: 2.4s;
    }
  }

  /* ===== Texto ===== */
  .page-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px 24px;
  }
  .page-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(28px, 3vw, 38px);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text);
  }
  .display-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(34px, 5vw, 48px);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--text);
  }
  .display-title-on-dark {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(40px, 5vw, 72px);
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--color-mp-mist);
  }
  .page-sub {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-2);
    margin-top: 6px;
  }
  .page-lead {
    font-size: 17px;
    line-height: 1.5;
    color: var(--text-2);
  }
  .section-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
  }
  .page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .text-muted {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-2);
  }
  .text-muted-sm {
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-2);
  }
  .link {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--color-mp-green);
  }
  .link:hover {
    text-decoration-thickness: 2px;
  }

  /* ===== Botões ===== */
  .btn {
    height: var(--control-h);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border-radius: var(--radius-mp);
    border: var(--border-w) solid var(--line);
    background: transparent;
    color: var(--text);
    font: 500 13px/1 var(--font-sans);
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  }
  .btn .icon {
    color: var(--text-2);
  }
  .btn:hover {
    background: var(--surface-soft);
  }
  .btn:disabled,
  .btn[aria-disabled="true"] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
  }
  .btn-outline {
    border-color: var(--line);
  }
  .btn-primary {
    background: var(--color-mp-green);
    border-color: var(--color-mp-green);
    color: var(--color-mp-navy);
  }
  .btn-primary .icon {
    color: var(--color-mp-navy);
  }
  .btn-primary:hover {
    background: color-mix(in srgb, var(--color-mp-green) 86%, var(--color-mp-navy));
    border-color: color-mix(in srgb, var(--color-mp-green) 86%, var(--color-mp-navy));
  }
  .btn-danger {
    background: var(--color-mp-danger);
    border-color: var(--color-mp-danger);
    color: var(--color-white);
  }
  .btn-danger .icon {
    color: var(--color-white);
  }
  .btn-danger:hover {
    background: color-mix(in srgb, var(--color-mp-danger) 86%, var(--color-mp-navy));
    border-color: color-mix(in srgb, var(--color-mp-danger) 86%, var(--color-mp-navy));
  }
  .btn-text {
    border-color: transparent;
    padding: 0 8px;
  }
  .btn-text-danger {
    border-color: transparent;
    padding: 0 8px;
    color: var(--color-mp-danger);
  }
  .btn-text-danger .icon {
    color: var(--color-mp-danger);
  }
  .btn-text-danger:hover {
    background: color-mix(in srgb, var(--color-mp-danger) 10%, var(--surface));
  }
  .btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
  }
  .btn-sm .icon {
    font-size: 18px;
  }
  .btn-text.btn-sm,
  .btn-text-danger.btn-sm {
    padding: 0 8px;
  }
  .btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-color: transparent;
  }
  .btn-icon-danger:hover .icon {
    color: var(--color-mp-danger);
  }
  .btn-icon-danger:hover {
    background: color-mix(in srgb, var(--color-mp-danger) 10%, var(--surface));
  }
  .btn-lg {
    height: 52px;
    padding: 0 28px;
    font-size: 15px;
  }
  .btn-lg .icon {
    font-size: 22px;
  }
  .btn-block {
    width: 100%;
  }
  .btn-on-dark {
    border-color: color-mix(in srgb, var(--color-mp-mist) 60%, var(--color-mp-navy));
    color: var(--color-mp-mist);
  }
  .btn-on-dark .icon {
    color: var(--color-mp-mist);
  }
  .btn-on-dark:hover {
    background: color-mix(in srgb, var(--color-mp-mist) 12%, var(--color-mp-navy));
  }
  .btn-icon.btn-on-dark {
    border-color: transparent;
  }

  /* ===== Campos ===== */
  .field {
    display: flex;
    flex-direction: column;
  }
  .field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
  }
  .field-label-caps {
    display: block;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-2);
    margin-bottom: 6px;
  }
  .field-input {
    width: 100%;
    height: var(--control-h);
    border: var(--field-border-w) solid var(--line);
    border-radius: var(--radius-mp);
    padding: 0 12px;
    font: 400 14px/1.4 var(--font-sans);
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.15s;
  }
  textarea.field-input {
    height: auto;
    min-height: 96px;
    padding: 10px 12px;
  }
  select.field-input {
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960' fill='%23005A6F'%3E%3Cpath d='M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
  }
  .field-input:focus,
  .field-input:focus-visible {
    border-color: var(--color-mp-green);
    outline: 3px solid var(--focus-color);
    outline-offset: 0;
  }
  .field-input.is-error,
  .field-input[aria-invalid="true"],
  .field-input.input-validation-error {
    border-color: var(--color-mp-danger);
  }
  .field-input[aria-invalid="true"]:focus-visible {
    outline-color: color-mix(in srgb, var(--color-mp-danger) 35%, transparent);
  }
  .field-input:disabled,
  .field-input[readonly] {
    background: color-mix(in srgb, var(--surface-soft) 55%, var(--surface));
  }
  .field-input.field-input-highlight {
    border: var(--border-w) solid var(--color-mp-green);
    font-size: 17px;
    font-weight: 500;
  }
  .field-input-danger {
    border-color: var(--color-mp-danger);
  }
  .field-input-mono {
    font-family: var(--font-mono);
    font-size: 13px;
  }
  .field-float {
    position: relative;
  }
  .field-float > .field-input {
    height: 56px;
    padding: 20px 14px 6px;
    font-size: 15px;
  }
  .field-float > label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    line-height: 1;
    color: var(--text-2);
    pointer-events: none;
    transition: top 0.15s, font-size 0.15s, color 0.15s;
  }
  .field-float > .field-input:focus + label,
  .field-float > .field-input:not(:placeholder-shown) + label,
  .field-float > .field-input:autofill + label {
    top: 17px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text);
  }
  .field-float > .field-input:focus + label {
    color: var(--color-mp-green);
  }
  .field-float > .field-input[aria-invalid="true"] + label {
    color: var(--danger-text);
  }
  @media (prefers-reduced-motion: reduce) {
    .field-float > label {
      transition: none;
    }
  }
  .help {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-2);
  }
  .help .icon {
    font-size: 16px;
    margin-top: 1px;
  }
  /** @description Mensagem de erro do campo (site.js cria): vermelho clareado para ler sobre o fundo escuro. */
  .help-error {
    color: var(--danger-text);
    animation: mp-help-in 0.18s ease-out;
  }
  /* no login a mensagem é item do grid (gap 16px); encosta no campo como nos outros formulários */
  .field-float + .help-error {
    margin-top: -10px;
  }
  @keyframes mp-help-in {
    from {
      opacity: 0;
      transform: translateY(-3px);
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .help-error {
      animation: none;
    }
  }
  .checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    flex: none;
    margin: 0;
    border: var(--field-border-w) solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface) center / 16px no-repeat;
    cursor: pointer;
  }
  .checkbox:checked {
    background-color: var(--color-mp-green);
    border-color: var(--color-mp-green);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960' fill='%2300263A'%3E%3Cpath d='m382-339 345-345q12-12 28-12t28 12q12 12 12 28.5T783-627L410-253q-12 12-28 12t-28-12L182-425q-12-12-11.5-28.5T183-482q12-12 28.5-12t28.5 12l142 143Z'/%3E%3C/svg%3E");
  }
  .checkbox:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
  .checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 30px;
    font-size: 14px;
    cursor: pointer;
  }

  /* ===== Marcações e status ===== */
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 9px;
    border-radius: var(--radius-mp);
    background: var(--surface-soft);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
  }
  .badge .icon {
    font-size: 16px;
    color: var(--text-2);
  }
  .badge-mono {
    font-family: var(--font-mono);
    font-weight: 400;
  }
  .badge-outline {
    background: transparent;
    border: 1px solid var(--line);
    font-weight: 400;
    font-size: 13px;
    height: 28px;
  }
  .status-on,
  .status-off,
  .status-neutral {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 11px;
    border-radius: var(--radius-mp);
    border: var(--border-w) solid transparent;
    font: 500 13px/1 var(--font-sans);
    white-space: nowrap;
  }
  .status-on .icon,
  .status-off .icon,
  .status-neutral .icon {
    font-size: 17px;
  }
  button.status-on,
  button.status-off,
  button.status-neutral {
    cursor: pointer;
  }
  button.status-on:hover,
  button.status-off:hover,
  button.status-neutral:hover {
    outline: 3px solid var(--focus-color);
  }
  .status-on {
    background: var(--color-mp-green);
    border-color: var(--color-mp-green);
    color: var(--color-mp-navy);
  }
  .status-on .icon {
    font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 20;
  }
  .status-off {
    background: transparent;
    border-color: var(--color-mp-danger);
    color: var(--color-mp-danger);
  }
  .status-neutral {
    background: transparent;
    border-color: var(--line);
    color: var(--text);
  }
  .status-neutral .icon {
    color: var(--text-2);
  }

  /* ===== Blocos ===== */
  .glass,
  .panel {
    border: 1px solid var(--glass-line);
    background: linear-gradient(var(--glass-lift), var(--glass-lift)), var(--surface);
    box-shadow: var(--glass-hi);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
  }
  .panel {
    position: relative;
    border-radius: var(--radius-mp);
    overflow: hidden;
  }
  .panel-soft {
    background: var(--surface-soft);
    border-radius: var(--radius-mp);
    padding: 20px 24px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
  }
  .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }
  .data-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-2);
    background: color-mix(in srgb, var(--color-mp-mist) 6%, transparent);
    height: 46px;
    padding: 0 20px;
    white-space: nowrap;
  }
  .data-table td {
    height: 66px;
    padding: 8px 20px;
    border-top: 1px solid var(--color-divider);
    vertical-align: middle;
  }
  .data-table tbody tr:first-child td {
    border-top: 0;
  }
  .data-table tbody tr:hover td {
    background: color-mix(in srgb, var(--color-mp-mist) 5%, transparent);
  }
  .data-table-compact td {
    height: 50px;
  }
  .cell-strong {
    font-weight: 500;
  }
  .cell-sub {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 3px;
  }
  .cell-mono {
    font-family: var(--font-mono);
  }
  .cell-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
  }

  .cell-actions-end {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
  }
  .avatar {
    width: 40px;
    height: 40px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: var(--radius-mp);
    background: var(--color-mp-teal);
    color: var(--color-mp-mist);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
  }

  .callout {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
    border-radius: var(--radius-mp);
    border: var(--border-w) solid var(--color-mp-warning);
    background: color-mix(in srgb, var(--color-mp-warning) 12%, var(--surface));
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
  }
  .callout-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--color-mp-warning);
    display: grid;
    place-items: center;
  }
  .callout-icon .icon {
    font-size: 18px;
    color: var(--color-mp-navy);
    font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 20;
  }
  .callout-text {
    padding-top: 4px;
  }
  .callout-text b {
    font-weight: 700;
  }
  .callout-text ul {
    list-style: disc;
    padding-left: 18px;
  }
  .callout-text .validation-summary-errors ul,
  .callout-text .validation-summary-valid ul {
    list-style: none;
    padding-left: 0;
  }
  .callout-warning {
    border-color: var(--color-mp-warning);
    background: color-mix(in srgb, var(--color-mp-warning) 12%, var(--surface));
  }
  .callout-success {
    border-color: var(--color-mp-green);
    background: color-mix(in srgb, var(--color-mp-green) 10%, var(--surface));
  }
  .callout-success .callout-icon {
    background: var(--color-mp-green);
  }
  .callout-danger {
    border-color: var(--color-mp-danger);
    background: color-mix(in srgb, var(--color-mp-danger) 8%, var(--surface));
  }
  .callout-danger .callout-icon {
    background: var(--color-mp-danger);
  }
  .callout-danger .callout-icon .icon {
    color: var(--color-white);
  }

  .toast-region {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 45;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(560px, calc(100vw - 32px));
    transform: translateX(-50%);
    pointer-events: none;
  }
  .toast {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 32px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 8px 16px 14px;
    border-radius: var(--radius-mp);
    border: 1px solid var(--glass-line);
    background: linear-gradient(var(--glass-lift), var(--glass-lift)), color-mix(in srgb, var(--color-mp-navy) 70%, transparent);
    box-shadow: var(--glass-hi);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    color: var(--color-mp-mist);
    font-size: 14px;
    line-height: 1.45;
    pointer-events: auto;
    animation: mp-toast-in 0.55s cubic-bezier(0.2, 1.35, 0.35, 1) both;
  }
  .toast-text b {
    font-weight: 700;
    color: var(--color-white);
  }
  .toast-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    animation: mp-toast-pop 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) 0.25s both;
  }
  .toast-icon .icon {
    font-size: 20px;
    font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 20;
  }
  .toast-success .toast-icon {
    background: var(--color-mp-green);
    color: var(--color-mp-navy);
  }
  .toast-danger .toast-icon {
    background: var(--color-mp-danger);
    color: var(--color-white);
  }
  .toast-danger {
    padding-bottom: 12px;
    animation: mp-toast-in 0.55s cubic-bezier(0.2, 1.35, 0.35, 1) both, mp-toast-nudge 0.4s ease-in-out 0.55s;
  }
  .toast-close {
    width: 32px;
    height: 32px;
  }
  .toast-timer {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 6px;
    display: flex;
    gap: 3px;
  }
  .toast-timer i {
    flex: 1 1 0;
    height: 4px;
    border-radius: 1px;
    background: color-mix(in srgb, var(--color-mp-green) 85%, var(--color-mp-navy));
    animation: mp-toast-pixel 0.35s ease-in forwards;
  }
  .toast:hover .toast-timer i,
  .toast:focus-within .toast-timer i {
    animation-play-state: paused;
  }
  .toast.is-leaving {
    animation: mp-toast-out 0.3s cubic-bezier(0.5, 0, 0.75, 0) forwards;
  }
  @keyframes mp-toast-in {
    from {
      transform: translateY(calc(100% + 32px));
    }
  }
  @keyframes mp-toast-out {
    to {
      transform: translateY(calc(100% + 32px));
      opacity: 0;
    }
  }
  @keyframes mp-toast-pop {
    from {
      transform: scale(0.3) rotate(-12deg);
      opacity: 0;
    }
  }
  @keyframes mp-toast-nudge {
    25% {
      transform: translateX(-5px);
    }
    75% {
      transform: translateX(5px);
    }
  }
  @keyframes mp-toast-pixel {
    to {
      transform: scale(0.2);
      opacity: 0;
    }
  }
  @media (max-width: 639px) {
    .toast-region {
      bottom: 16px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .toast,
    .toast-danger,
    .toast-icon,
    .toast-timer i,
    .toast.is-leaving {
      animation: none;
    }
  }

  .codeblock {
    position: relative;
    background: var(--codeblock-bg);
    color: var(--color-mp-mist);
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.6;
    padding: 14px 104px 14px 14px;
    border-radius: var(--radius-mp);
    word-break: break-all;
  }
  .codeblock-input {
    display: block;
    width: 100%;
    resize: none;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 0;
  }
  .codeblock-input:focus-visible {
    outline: none;
  }
  .codeblock-action {
    position: absolute;
    top: 8px;
    right: 8px;
  }

  .tile {
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: var(--radius-mp);
    display: grid;
    place-items: center;
  }
  .tile .icon {
    font-size: 28px;
    font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
  }
  .tile-lg {
    width: 64px;
    height: 64px;
  }
  .tile-lg .icon {
    font-size: 34px;
  }
  .tile-danger {
    background: var(--color-mp-danger);
  }
  .tile-danger .icon {
    color: var(--color-white);
  }
  .tile-green {
    background: var(--color-mp-green);
  }
  .tile-green .icon {
    color: var(--color-mp-navy);
  }
  .tile-soft {
    background: var(--surface-soft);
  }
  .tile-soft .icon {
    color: var(--text-2);
  }

  .kv-k {
    display: block;
    font-size: 13px;
    font-weight: 500;
  }
  .kv-v-lg {
    display: block;
    margin-top: 2px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
  }
  .kv-v {
    display: block;
    font-size: 15px;
    font-weight: 700;
    margin-top: 2px;
    overflow-wrap: anywhere;
  }

  .card-teal {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 330px;
    padding: 28px;
    border-radius: var(--radius-mp);
    border: 1px solid var(--glass-line);
    background: linear-gradient(160deg, color-mix(in srgb, var(--color-mp-teal) 62%, transparent), color-mix(in srgb, var(--color-mp-teal) 30%, transparent));
    box-shadow: var(--glass-hi);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    color: var(--color-mp-mist);
    text-decoration: none;
    transition: background-color 0.15s;
  }
  .card-teal:hover {
    background: linear-gradient(160deg, color-mix(in srgb, var(--color-mp-teal) 75%, transparent), color-mix(in srgb, var(--color-mp-teal) 40%, transparent));
  }
  .card-teal > :not(.pix) {
    position: relative;
    z-index: 1;
  }
  .card-teal > .pix {
    position: absolute;
    right: 0;
    bottom: 0;
  }
  .card-teal-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-mp);
    background: var(--color-mp-green);
    display: grid;
    place-items: center;
  }
  .card-teal-icon .icon {
    font-size: 28px;
    color: var(--color-mp-navy);
    font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
  }
  .card-teal-title {
    margin-top: 22px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(26px, 3vw, 32px);
    letter-spacing: -0.02em;
    line-height: 1.1;
  }
  .card-teal-text {
    margin-top: 12px;
    max-width: 400px;
    font-size: 15px;
    line-height: 1.55;
  }
  .card-teal-go {
    margin-top: auto;
    padding-top: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
  }
  .card-teal-go .icon {
    color: var(--color-mp-green);
    transition: transform 0.15s;
  }
  .card-teal:hover .card-teal-go .icon {
    transform: translateX(3px);
  }
  .pix {
    display: block;
    max-width: none;
    pointer-events: none;
    user-select: none;
  }

  /* ===== Skeleton de carregamento ===== */
  .skeleton-page,
  .skeleton-variant {
    display: none;
  }
  body.is-navigating main > :not(.skeleton-page) {
    display: none !important;
  }
  body.is-navigating .skeleton-page {
    display: block;
    animation: mp-skeleton-in 0.2s ease both;
  }
  .skeleton-page[data-variant="split"] [data-skeleton="split"],
  .skeleton-page[data-variant="home"] [data-skeleton="home"],
  .skeleton-page[data-variant="sync"] [data-skeleton="sync"] {
    display: block;
  }
  .skeleton {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
  }
  .skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, var(--shimmer), transparent);
    animation: mp-shimmer 1.4s ease-in-out infinite;
  }
  .skeleton-title {
    width: 280px;
    max-width: 70%;
    height: 30px;
  }
  .skeleton-display {
    width: 440px;
    max-width: 90%;
    height: 48px;
  }
  .skeleton-line {
    height: 14px;
  }
  .skeleton-line-sm {
    height: 10px;
  }
  .skeleton-button {
    width: 150px;
    height: var(--control-h);
    border-radius: var(--radius-mp);
  }
  .skeleton-button-lg {
    width: 280px;
    max-width: 100%;
    height: 52px;
    border-radius: var(--radius-mp);
  }
  .skeleton-chip {
    flex: none;
    width: 76px;
    height: 30px;
    border-radius: var(--radius-mp);
  }
  .skeleton-actions {
    flex: none;
    width: 140px;
    height: 20px;
  }
  .skeleton-card {
    height: 330px;
    border-radius: var(--radius-mp);
  }
  .skeleton-tile {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-mp);
  }
  .skeleton-callout {
    width: min(448px, 100%);
    height: 92px;
    border-radius: var(--radius-mp);
  }
  .skeleton-panel {
    border-color: var(--color-divider);
  }
  .skeleton-table-head {
    height: 46px;
    background: var(--surface-soft);
  }
  .skeleton-row {
    display: flex;
    align-items: center;
    gap: 32px;
    height: 66px;
    padding: 0 20px;
    border-top: 1px solid var(--color-divider);
  }
  .skeleton-table-head + .skeleton-row {
    border-top: 0;
  }
  @keyframes mp-shimmer {
    to {
      transform: translateX(100%);
    }
  }
  @keyframes mp-skeleton-in {
    from {
      opacity: 0;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .skeleton::after {
      display: none;
    }
    body.is-navigating .skeleton-page {
      animation: none;
    }
  }

  /* ===== Modal ===== */
  .modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
    background: var(--overlay);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 1;
    transition: opacity 0.22s ease, display 0.22s allow-discrete;
  }
  .modal.hidden {
    opacity: 0;
  }
  @starting-style {
    .modal {
      opacity: 0;
    }
  }
  .modal-strong {
    background: var(--overlay-strong);
  }
  .modal-top {
    align-items: flex-start;
    padding-top: 80px;
  }
  .modal-top > .dialog {
    margin-top: 0;
  }
  .dialog {
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    margin: auto;
    padding: 28px;
    border: 1px solid var(--glass-line);
    border-radius: var(--radius-mp);
    background: linear-gradient(var(--glass-lift), var(--glass-lift)), color-mix(in srgb, var(--color-mp-navy) 62%, transparent);
    box-shadow: var(--glass-hi);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    color: var(--text);
    transform: none;
    opacity: 1;
    transition: transform 0.28s var(--ease-out), opacity 0.2s ease;
  }
  .modal.hidden .dialog {
    transform: translateY(8px) scale(0.98);
    opacity: 0;
  }
  @starting-style {
    .modal .dialog {
      transform: translateY(12px) scale(0.97);
      opacity: 0;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .modal,
    .dialog {
      transition: none;
    }
  }
  .dialog-wide {
    max-width: 480px;
  }
  .dialog-roomy {
    max-width: 520px;
    padding: 32px;
  }
  .dialog-roomy .dialog-title {
    font-size: 26px;
  }
  .dialog-center {
    text-align: center;
  }
  .dialog-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 21px;
    line-height: 1.2;
    letter-spacing: -0.02em;
  }
  .dialog-title .icon {
    font-size: 24px;
    color: var(--text-2);
    font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
  }
  .dialog-title-ruled {
    padding-bottom: 16px;
    border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, var(--surface));
  }
  .dialog-title-center {
    justify-content: center;
  }
  .dialog-body {
    display: grid;
    gap: 16px;
    margin-top: 18px;
    text-align: left;
  }
  .dialog-center .dialog-body {
    text-align: center;
  }
  .dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
  }
  .dialog-actions-center {
    justify-content: center;
  }
  .dialog-actions-full > * {
    flex: 1 1 0;
  }

  /* ===== Layout ===== */
  .wrap {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
  }
  @media (min-width: 640px) {
    .wrap {
      padding-left: 32px;
      padding-right: 32px;
    }
  }
  /* ===== Barra do topo =====
     Barra de vidro flutuante (topbar-bar) dentro de uma faixa transparente e fixa no alto. Os links ficam
     soltos no vidro, centralizados; a página atual ganha um tom claro e o ícone verde. Os tons valem também
     no menu do celular. */
  .topbar,
  .mobile-menu {
    --topbar-raise: color-mix(in srgb, var(--color-mp-mist) 8%, transparent);
    --topbar-active: color-mix(in srgb, var(--color-mp-mist) 14%, transparent);
    --topbar-text-2: color-mix(in srgb, var(--color-mp-mist) 72%, transparent);
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    flex: none;
    padding-top: 14px;
    color: var(--color-mp-mist);
  }
  .topbar-bar {
    height: 64px;
    max-width: 1232px;
    padding: 0 8px 0 12px;
    border-radius: var(--radius-mp);
    background: linear-gradient(var(--glass-lift), var(--glass-lift)), color-mix(in srgb, var(--color-mp-ink) 52%, transparent);
  }
  @media (width < 40rem) {
    .topbar { padding: 12px 12px 0; }
    .topbar-bar { padding: 0 8px 0 10px; }
  }
  .topbar :focus-visible,
  .mobile-menu :focus-visible {
    outline-offset: 2px;
  }
  .topbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-inline: auto;
  }
  .topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px 0 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--topbar-text-2);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s;
  }
  .topbar-link .icon {
    color: inherit;
  }
  .topbar-link:hover {
    background: var(--topbar-raise);
    color: var(--color-mp-mist);
  }
  .topbar-link.is-active {
    background: var(--topbar-active);
    color: var(--color-white);
    view-transition-name: topbar-active;
  }
  .topbar-link.is-active .icon {
    color: var(--color-mp-green);
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20;
  }
  .topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-mp-mist);
  }
  /** @description Nome de quem está logado, ao lado do botão de sair; nome longo termina em reticências. */
  .topbar-name {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
  }
  .topbar .btn-on-dark {
    border-color: transparent;
  }
  .topbar-toggle[aria-expanded="true"] {
    background: var(--topbar-active);
  }
  .mobile-menu {
    position: sticky;
    top: 86px;
    z-index: 39;
    margin: 8px 12px 0;
    border: 1px solid var(--glass-line);
    border-radius: var(--radius-mp);
    background: linear-gradient(var(--glass-lift), var(--glass-lift)), color-mix(in srgb, var(--color-mp-ink) 62%, transparent);
    box-shadow: var(--glass-hi);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    color: var(--color-mp-mist);
    font-size: 14px;
  }
  .mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: var(--radius-mp);
    font-size: 15px;
    font-weight: 500;
    color: var(--topbar-text-2);
    text-decoration: none;
    background: transparent;
    cursor: pointer;
  }
  .mobile-menu-link .icon {
    color: inherit;
  }
  .mobile-menu-link:hover {
    background: var(--topbar-raise);
    color: var(--color-mp-mist);
  }
  .mobile-menu-link.is-active {
    background: var(--topbar-active);
    color: var(--color-white);
  }
  .mobile-menu-link.is-active .icon {
    color: var(--color-mp-green);
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 20;
  }
  .mobile-menu-user {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--color-divider);
  }
  .mobile-menu-who {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    color: var(--topbar-text-2);
  }
  .mobile-menu-who strong {
    color: var(--color-mp-mist);
    font-weight: 500;
  }
  .mobile-menu-danger {
    color: color-mix(in srgb, var(--color-mp-danger) 55%, var(--color-white));
  }
  .mobile-menu-danger .icon {
    color: inherit;
  }
  .page-graphic {
    position: fixed;
    bottom: 0;
    z-index: -1;
    max-width: none;
    height: auto;
    pointer-events: none;
    user-select: none;
  }
  .page-graphic-right,
  .page-graphic-login {
    right: 0;
  }
  .page-graphic-left {
    left: 0;
  }
  /** @description Grafismo de fundo das telas internas, suavizado: mais apagado e sumindo para cima, para não competir com os cards. */
  .page-graphic-right,
  .page-graphic-left {
    opacity: 0.4;
    mask-image: linear-gradient(to top, #000 35%, transparent);
  }
  @media (width < 40rem) {
    .page-graphic-right,
    .page-graphic-login {
      width: 45vw;
    }
    .page-graphic-left {
      display: none;
    }
  }

  /* ===== Login: marca à esquerda, formulário em vidro à direita ===== */
  .login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  @media (width >= 64rem) {
    .login-page {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 560px;
    }
    .login-page > main {
      padding-right: 96px;
    }
  }
  .login-card {
    width: 100%;
    max-width: 420px;
    padding: 36px 36px 32px;
    border-radius: var(--radius-mp);
    background: linear-gradient(var(--glass-lift), var(--glass-lift)), color-mix(in srgb, var(--color-mp-navy) 55%, transparent);
  }
  @media (width < 40rem) {
    .login-card {
      padding: 28px 22px 24px;
    }
  }
  .login-title {
    max-width: 600px;
  }
  .login-card .page-title {
    color: var(--color-white);
  }
  .login-card .btn-primary {
    height: 48px;
    font-size: 15px;
  }
  .site-foot {
    flex: none;
    margin-top: auto;
    border-top: 1px solid var(--color-divider);
    padding: 18px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-2);
  }

  /* ===== Assinatura do Administrador ===== */
  .sig {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex: none;
  }
  /** @description Mapa do Brasil em pixels com os clientes acesos: é o símbolo do Administrador. */
  .sig-map {
    width: 44px;
    height: 44px;
    flex: none;
    display: block;
  }
  .sig-txt {
    display: grid;
    gap: 6px;
    justify-items: start;
  }
  .sig-logo {
    height: 11px;
    width: auto;
    display: block;
  }
  .sig-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--color-mp-mist);
    white-space: nowrap;
  }
}

@layer utilities {
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border-width: 0;
  }

  .relative { position: relative; }
  .absolute { position: absolute; }
  .fixed { position: fixed; }
  .inset-0 { inset: 0; }
  .top-0 { top: 0; }
  .right-0 { right: 0; }
  .z-10 { z-index: 10; }
  .z-\[60\] { z-index: 60; }

  .block { display: block; }
  .inline { display: inline; }
  .flex { display: flex; }
  .grid { display: grid; }
  .hidden { display: none; }

  .flex-col { flex-direction: column; }
  .flex-wrap { flex-wrap: wrap; }
  .flex-1 { flex: 1; }
  .flex-grow { flex-grow: 1; }
  .items-center { align-items: center; }
  .items-start { align-items: flex-start; }
  .justify-between { justify-content: space-between; }
  .justify-center { justify-content: center; }
  .grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .gap-1 { gap: 0.25rem; }
  .gap-2 { gap: 0.5rem; }
  .gap-3 { gap: 0.75rem; }
  .gap-3\.5 { gap: 0.875rem; }
  .gap-4 { gap: 1rem; }
  .gap-5 { gap: 1.25rem; }
  .gap-6 { gap: 1.5rem; }
  .gap-8 { gap: 2rem; }

  .mx-auto { margin-inline: auto; }
  .ml-auto { margin-left: auto; }
  .mt-1 { margin-top: 0.25rem; }
  .mt-2 { margin-top: 0.5rem; }
  .mt-3 { margin-top: 0.75rem; }
  .mt-4 { margin-top: 1rem; }
  .mt-5 { margin-top: 1.25rem; }
  .mt-6 { margin-top: 1.5rem; }
  .mt-7 { margin-top: 1.75rem; }
  .mt-8 { margin-top: 2rem; }
  .mt-auto { margin-top: auto; }
  .mb-3 { margin-bottom: 0.75rem; }
  .mb-4 { margin-bottom: 1rem; }
  .mb-6 { margin-bottom: 1.5rem; }
  .mb-8 { margin-bottom: 2rem; }

  .p-4 { padding: 1rem; }
  .p-6 { padding: 1.5rem; }
  .p-\[18px\] { padding: 18px; }
  .px-3 { padding-inline: 0.75rem; }
  .px-4 { padding-inline: 1rem; }
  .px-6 { padding-inline: 1.5rem; }
  .py-2 { padding-block: 0.5rem; }
  .py-3 { padding-block: 0.75rem; }
  .py-4 { padding-block: 1rem; }
  .py-5 { padding-block: 1.25rem; }
  .py-8 { padding-block: 2rem; }
  .py-10 { padding-block: 2.5rem; }

  .w-full { width: 100%; }
  .w-1\/3 { width: calc(100% / 3); }
  .w-\[150px\] { width: 150px; }
  .w-\[200px\] { width: 200px; }
  .h-full { height: 100%; }
  .min-h-screen { min-height: 100vh; }
  .max-w-md { max-width: 28rem; }
  .max-w-xl { max-width: 36rem; }
  .max-w-4xl { max-width: 56rem; }
  .max-w-\[400px\] { max-width: 400px; }
  .max-w-\[520px\] { max-width: 520px; }

  .text-left { text-align: left; }
  .text-center { text-align: center; }
  .text-right { text-align: right; }
  .whitespace-nowrap { white-space: nowrap; }
  .tabular-nums { font-variant-numeric: tabular-nums; }

  .text-mp-navy { color: var(--text); }
  .text-mp-green { color: var(--color-mp-green); }
  .text-mp-danger { color: var(--color-mp-danger); }
  .bg-mp-navy { background-color: var(--color-mp-navy); }
  .bg-mp-mist { background-color: var(--surface-soft); }
  .bg-white\/90 { background-color: color-mix(in srgb, var(--bg) 90%, transparent); }
  .rounded-mp { border-radius: var(--radius-mp); }

  .overflow-hidden { overflow: hidden; }
  .overflow-x-auto { overflow-x: auto; }

  @media (width < 64rem) {
    .max-lg\:hidden { display: none; }
    .max-lg\:sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  }
  @media (width < 48rem) {
    .max-md\:hidden { display: none; }
  }
  @media (width >= 40rem) {
    .sm\:px-6 { padding-inline: 1.5rem; }
  }
  @media (width >= 48rem) {
    .md\:hidden { display: none; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:p-10 { padding: 2.5rem; }
  }
  @media (width >= 64rem) {
    .lg\:block { display: block; }
    .lg\:flex { display: flex; }
    .lg\:grid { display: grid; }
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:flex-col { flex-direction: column; }
    .lg\:gap-12 { gap: 3rem; }
    .lg\:px-12 { padding-inline: 3rem; }
    .lg\:px-16 { padding-inline: 4rem; }
    .lg\:py-14 { padding-block: 3.5rem; }
  }
  @media (width >= 80rem) {
    .xl\:grid-cols-\[minmax\(0\,1fr\)_640px\] { grid-template-columns: minmax(0, 1fr) 640px; }
  }
}

/* ===== Pílula do menu entre páginas =====
   Navegador com View Transitions (Chrome/Edge): a pílula da página atual desliza até a nova. A página em si
   troca sem animação. Nos outros navegadores, e com "reduzir movimento", nada muda. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}
::view-transition-group(topbar-active) {
  animation-duration: 0.32s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== Telas em lista e detalhe (Clientes, Usuários), painel lateral e Visão geral =====
   Estrutura de "Nova estrutura das telas - Administrador de Clientes.pdf" (DEM-148). */
@layer components {
  /* Lista à esquerda, detalhe à direita; no celular, um embaixo do outro. No desktop a página tem a altura
     exata da janela (sem rolagem geral): os dois cartões ocupam o que sobra entre o título e o rodapé, e cada
     um rola por dentro (a lista nos itens, o detalhe inteiro). Em janela baixa demais (menos de 260px para
     os cartões), a página volta a rolar. */
  .split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  @media (width >= 64rem) {
    .split {
      grid-template-columns: 385px minmax(0, 1fr);
      grid-template-rows: minmax(0, 1fr);
      align-items: stretch;
    }
    main > .split {
      flex: 1 1 0;
      min-height: 260px;
    }
    .split > .detail {
      min-height: 0;
      overflow-y: auto;
      overscroll-behavior: contain;
      scrollbar-width: thin;
      scrollbar-color: color-mix(in srgb, var(--color-mp-mist) 22%, transparent) transparent;
    }
  }

  /* ----- Lista ----- */
  /* contain: size impede que os itens estiquem o painel; quem rola é a list-items */
  .list-panel {
    display: flex;
    flex-direction: column;
    height: 440px;
  }
  @media (width >= 64rem) {
    .list-panel {
      height: auto;
      min-height: 0;
    }
  }
  .list-tools {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--color-divider);
  }
  .search {
    position: relative;
    display: block;
  }
  .search > .icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--text-2);
    pointer-events: none;
  }
  .search > .field-input {
    padding-left: 40px;
  }
  .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--text-2);
    font: 500 13px/1 var(--font-sans);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  }
  .chip b {
    font-weight: 700;
    color: var(--text);
  }
  .chip:hover {
    background: var(--surface-soft);
    color: var(--text);
  }
  .chip[aria-pressed="true"] {
    background: var(--color-mp-mist);
    border-color: var(--color-mp-mist);
    color: var(--color-mp-navy);
  }
  .chip[aria-pressed="true"] b {
    color: var(--color-mp-navy);
  }
  .list-items {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    contain: size;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--color-mp-mist) 22%, transparent) transparent;
  }
  .list-items > li + li {
    border-top: 1px solid var(--color-divider);
  }
  .list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 20px;
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.15s;
  }
  .list-item:hover {
    background: var(--surface-soft);
  }
  .list-item:focus-visible,
  .row-link:focus-visible {
    outline: 2px solid var(--color-mp-green);
    outline-offset: -2px;
  }
  .list-item.is-selected {
    background: color-mix(in srgb, var(--color-mp-green) 12%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-mp-green) 55%, transparent);
  }
  .list-item-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
  }
  .list-item-name,
  .list-item-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .list-item-name {
    font-size: 14px;
    font-weight: 500;
  }
  .list-item-sub {
    font: 400 12px/1.3 var(--font-mono);
    color: var(--text-2);
  }
  .list-item-icon {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--text-2);
  }
  .list-item.is-selected .list-item-icon {
    background: color-mix(in srgb, var(--color-mp-green) 16%, transparent);
    color: var(--color-mp-green);
  }
  .list-empty {
    padding: 32px 20px;
    font-size: 13px;
    text-align: center;
    color: var(--text-2);
  }
  /** @description Quadradinho de status (pixel da marca): verde ativo, apagado inativo. */
  .dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 1px;
  }
  .dot-on {
    background: var(--color-mp-green);
  }
  .dot-off {
    background: color-mix(in srgb, var(--color-mp-mist) 35%, transparent);
  }
  .tag {
    display: inline-flex;
    align-items: center;
    flex: none;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text-2);
    font-size: 12px;
    white-space: nowrap;
  }

  /* ----- Detalhe ----- */
  .detail {
    padding: 28px 32px 8px;
  }
  @media (width < 40rem) {
    .detail {
      padding: 20px 18px 4px;
    }
  }
  .detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 320px;
    padding-bottom: 28px;
    text-align: center;
  }
  .detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-divider);
  }
  .detail-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(22px, 2.4vw, 30px);
    line-height: 1.15;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
  }
  .detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-2);
  }
  .detail-code {
    padding: 0;
    background: none;
    font: 400 13px/1 var(--font-mono);
    color: var(--text-2);
  }
  .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 9px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
  }
  .pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 1px;
    background: currentColor;
  }
  .pill-on {
    background: color-mix(in srgb, var(--color-mp-green) 14%, transparent);
    color: var(--color-mp-green);
  }
  .pill-off {
    background: var(--surface-soft);
    color: var(--text-2);
  }
  .detail-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 24px 0;
    border-bottom: 1px solid var(--color-divider);
  }
  .detail-section:last-child {
    border-bottom: 0;
  }
  @media (width >= 48rem) {
    .detail-section {
      grid-template-columns: 180px minmax(0, 1fr);
      gap: 24px 28px;
    }
  }
  .detail-section-title {
    margin-bottom: 4px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    line-height: 1.3;
  }
  /** @description Pares rótulo/valor/ação do detalhe (Database, Connection string, Chave no Canal). */
  .kv-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 12px;
  }
  .kv-grid > dt {
    grid-column: 1 / -1;
  }
  @media (width >= 40rem) {
    .kv-grid {
      grid-template-columns: 128px minmax(0, 1fr) auto;
      gap: 14px 12px;
    }
    .kv-grid > dt {
      grid-column: auto;
    }
  }
  .kv-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-2);
  }
  .kv-value {
    min-width: 0;
    font: 400 13px/1.5 var(--font-mono);
    color: var(--text);
    overflow-wrap: anywhere;
  }
  .kv-value-muted {
    font-family: var(--font-sans);
    color: var(--text-2);
  }
  .kv-action {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
  }
  .choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 28px;
  }
  .checkbox[aria-invalid="true"] {
    border-color: var(--color-mp-danger);
  }

  /** @description Chave liga/desliga: <input type="checkbox" role="switch" class="switch"> dentro de label.switch-row. */
  .switch-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
  }
  .switch-row.is-busy {
    opacity: 0.6;
    pointer-events: none;
  }
  .switch {
    appearance: none;
    position: relative;
    flex: none;
    width: 40px;
    height: 22px;
    margin: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-mp-mist) 22%, transparent);
    cursor: pointer;
    transition: background-color 0.18s;
  }
  .switch::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-mp-mist);
    transition: transform 0.18s var(--ease-out), background-color 0.18s;
  }
  .switch:checked {
    background: var(--color-mp-green);
  }
  .switch:checked::before {
    transform: translateX(18px);
    background: var(--color-mp-navy);
  }
  .switch:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
  }
  @media (prefers-reduced-motion: reduce) {
    .switch,
    .switch::before {
      transition: none;
    }
  }

  /* ----- Painel lateral (Novo Cliente, Novo Usuário) ----- */
  /* com painel ou modal aberto, a página de trás não rola */
  body:has(.drawer:not(.hidden), .modal:not(.hidden)) {
    overflow: hidden;
  }
  .drawer {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    justify-content: flex-end;
    background: var(--overlay-strong);
    opacity: 1;
    transition: opacity 0.22s ease, display 0.22s allow-discrete;
  }
  .drawer.hidden {
    opacity: 0;
  }
  @starting-style {
    .drawer {
      opacity: 0;
    }
  }
  .drawer-panel {
    display: flex;
    flex-direction: column;
    width: min(500px, 100%);
    height: 100%;
    border-left: 1px solid var(--glass-line);
    background: linear-gradient(var(--glass-lift), var(--glass-lift)), color-mix(in srgb, var(--color-mp-navy) 72%, var(--bg));
    box-shadow: var(--glass-hi);
    color: var(--text);
    transform: none;
    transition: transform 0.3s var(--ease-out);
  }
  .drawer.hidden .drawer-panel {
    transform: translateX(32px);
  }
  @starting-style {
    .drawer .drawer-panel {
      transform: translateX(40px);
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .drawer,
    .drawer-panel {
      transition: none;
    }
  }
  .drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 28px 32px 0;
  }
  .drawer-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.02em;
  }
  .drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
  }
  .drawer-body,
  .drawer-step {
    display: grid;
    align-content: start;
    gap: 18px;
  }
  .drawer-step {
    min-width: 0;
  }
  .drawer-foot {
    display: flex;
    gap: 12px;
    padding: 18px 32px;
    border-top: 1px solid var(--color-divider);
  }
  .drawer-foot .btn {
    height: 44px;
  }
  .steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 22px 32px 0;
    list-style: none;
  }
  .step {
    font-size: 13px;
    color: var(--text-2);
  }
  .step::before {
    content: "";
    display: block;
    height: 3px;
    margin-bottom: 10px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--color-mp-mist) 14%, transparent);
    transition: background-color 0.2s;
  }
  .step.is-done::before,
  .step.is-current::before {
    background: var(--color-mp-green);
  }
  .step.is-current {
    font-weight: 500;
    color: var(--text);
  }
  @media (width < 40rem) {
    .drawer-head,
    .drawer-body,
    .drawer-foot,
    .steps {
      padding-inline: 20px;
    }
  }
  /** @description Resumo do último passo do Novo Cliente. */
  .resumo {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 8px 12px;
    padding: 16px;
    border-radius: var(--radius-mp);
    background: var(--surface-soft);
    font-size: 13px;
  }
  .resumo dt {
    color: var(--text-2);
  }
  .resumo dd {
    overflow-wrap: anywhere;
  }

  /* ----- Visão geral ----- */
  .kpi-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  @media (width >= 64rem) {
    .kpi-strip {
      grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.3fr);
    }
  }
  /* bordas à esquerda e em cima, puxadas 1px para fora: as da borda do painel somem no overflow */
  .kpi {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: -1px 0 0 -1px;
    padding: 20px 24px;
    border-top: 1px solid var(--color-divider);
    border-left: 1px solid var(--color-divider);
  }
  .kpi-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-2);
  }
  .kpi-value {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 32px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--text);
  }
  .kpi-split {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: auto;
    padding-bottom: 4px;
    font-size: 13px;
    color: var(--text-2);
  }
  .kpi-split b {
    margin-right: 2px;
    font-weight: 700;
    color: var(--text);
  }
  .home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  @media (width >= 64rem) {
    .home-grid {
      grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    }
  }
  .panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-divider);
  }
  .panel-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -0.02em;
  }
  .panel-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-mp-green);
    text-decoration: none;
  }
  .panel-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 24px;
    text-align: center;
  }
  .row-list {
    list-style: none;
  }
  .row-list > li + li {
    border-top: 1px solid var(--color-divider);
  }
  .row-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.15s;
  }
  .row-link:hover {
    background: var(--surface-soft);
  }
  .row-icon {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--color-mp-warning) 16%, transparent);
    color: var(--color-mp-warning);
  }
  .row-icon-muted {
    background: var(--surface-soft);
    color: var(--text-2);
  }
  .row-sub {
    font-size: 12px;
    color: var(--text-2);
  }
  .row-go {
    display: inline-flex;
    align-items: center;
    flex: none;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-mp-green);
  }
  .row-go .icon {
    transition: transform 0.15s;
  }
  .row-link:hover .row-go .icon {
    transform: translateX(2px);
  }

  /* ----- Esqueletos das telas novas ----- */
  .skeleton-input {
    height: 40px;
  }
  .skeleton-dot {
    flex: none;
    width: 8px;
    height: 8px;
  }
  .list-panel .skeleton-row {
    gap: 14px;
    height: 60px;
    border-top: 0;
    border-bottom: 1px solid var(--color-divider);
  }
  .skeleton-section {
    display: flex;
    gap: 32px;
    padding: 24px 0;
    border-top: 1px solid var(--color-divider);
  }
  .skeleton-section:first-of-type {
    margin-top: 24px;
  }
  .skeleton-strip {
    height: 96px;
    border-radius: var(--radius-mp);
  }
}

@layer utilities {
  /* tela de lista e detalhe no desktop: página do tamanho da janela (ver .split); fica nesta camada porque
     precisa ganhar do py-8 da main e do mb-6 do page-head */
  @media (width >= 64rem) {
    body:has(main > .split) { height: 100dvh; }
    main:has(> .split) { display: flex; flex-direction: column; min-height: 0; padding-block: 20px 16px; }
    main:has(> .split) > .page-head { margin-bottom: 16px; }
    main:has(> .split) ~ .site-foot { padding-block: 12px; }
  }
  .min-w-0 { min-width: 0; }
  .font-mono { font-family: var(--font-mono); }
  .w-\[110px\] { width: 110px; }
  .w-\[140px\] { width: 140px; }
  .w-\[160px\] { width: 160px; }
  .max-w-\[320px\] { max-width: 320px; }
}
