/* Tokens herdados de Caruaru Auxiliares/public/css/sigef-caruaru.css */
:root {
  --gradient-start: #1a5a2e;
  --gradient-mid: #1e6b35;
  --gradient-end: #238c3e;
  --color-primary: #2D9846;
  --color-primary-dark: #1a5a2e;
  --color-primary-light: #3cb055;
  --color-accent: #4ade80;

  --bg-content: #f8fafc;
  --bg-card: #ffffff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;

  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-danger-bg: #fee2e2;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text-dark);
  background: transparent;
  overflow: hidden;
}

body {
  height: 100vh;
}

body.electron:not(.colapsado) {
  background: var(--bg-content);
}

body.electron.modo-amplo .painel {
  width: 100%;
  height: 100%;
}

/* ----- Chip flutuante (estado colapsado) ----- */
.chip {
  position: fixed;
  left: 4px;
  top: 4px;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--gradient-start), var(--gradient-end));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25), 0 0 0 3px rgba(255,255,255,0.15);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform .12s ease, box-shadow .12s ease;
  -webkit-app-region: drag;
  overflow: visible;
}
.chip img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
  -webkit-app-region: no-drag;
  pointer-events: none;
}
.chip:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(255,255,255,0.22);
}
.chip:active { transform: scale(0.97); }

/* ----- Painel (estado expandido) ----- */
.painel {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-content);
}

body.colapsado .chip { display: flex; }
body.colapsado .painel { display: none; }
body:not(.colapsado) .chip { display: none; }

/* ----- Header ----- */
header.app-header {
  -webkit-app-region: drag;
  background: linear-gradient(160deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

header.app-header img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

header.app-header .titulo {
  flex: 1;
  line-height: 1.1;
  -webkit-app-region: no-drag;
  cursor: default;
  user-select: none;
}

header.app-header .titulo h1 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
}

header.app-header .titulo p {
  font-size: 11px;
  opacity: .85;
  margin-top: 2px;
}

header.app-header .header-direita {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  -webkit-app-region: no-drag;
}

header.app-header .botoes-janela {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.menu-app-host {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  -webkit-app-region: no-drag;
}

body.colapsado .menu-app-host {
  display: none;
}

#updateHeaderHost {
  display: flex;
  align-items: center;
  min-width: 0;
  flex-shrink: 1;
}

#updateHeaderHost:empty {
  display: none;
}

header.app-header .botoes-janela button {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
header.app-header .botoes-janela button:hover {
  background: rgba(255,255,255,0.28);
}

/* ----- Tabs ----- */
.tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--border-color);
}
.tabs button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 2px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 10px;
  line-height: 1.25;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s, background .2s;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}
.tabs button.ativo {
  color: var(--color-primary-dark);
  border-bottom-color: var(--color-primary);
  background: rgba(45, 152, 70, 0.06);
}
.tabs button:hover:not(.ativo) {
  background: rgba(0,0,0,.03);
}

/* ----- Conteudo rolavel ----- */
main {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

main::-webkit-scrollbar {
  width: 6px;
}
main::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}

.tab-panel { display: none; flex-direction: column; gap: 12px; }
.tab-panel.ativo { display: flex; }

/* ----- Cards ----- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.card h2 {
  font-size: 13px;
  color: var(--color-primary-dark);
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: .2px;
}

/* ----- Form ----- */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.field input[type="text"] {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input[type="text"]:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(45, 152, 70, 0.15);
}

/* ----- Input com botão limpar ----- */
.input-wrapper {
  position: relative;
}
.input-wrapper input[type="text"] {
  padding-right: 32px;
}
.btn-limpar {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: #e2e8f0;
  color: #64748b;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background .12s, color .12s;
}
.btn-limpar:hover {
  background: #fecaca;
  color: #dc2626;
}
.btn-limpar.visivel {
  display: flex;
}

.pills {
  display: flex;
  gap: 6px;
  margin: 6px 0 4px;
}
.pills button {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
}
.pills button.ativo {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary));
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: filter .15s, transform .05s;
  box-shadow: 0 2px 6px rgba(45, 152, 70, 0.3);
}
.btn:hover:not(:disabled) { filter: brightness(1.05); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.secundario {
  background: #fff;
  color: var(--color-primary-dark);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

/* ----- Autocomplete ----- */
.autocomplete {
  position: relative;
}
.autocomplete-lista {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: #fff;
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 260px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  display: none;
}
.autocomplete-lista.aberta { display: block; }
.autocomplete-item {
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.foco {
  background: rgba(45, 152, 70, 0.08);
}
.autocomplete-item .codigo {
  font-weight: 700;
  color: var(--color-primary-dark);
  font-size: 12px;
}
.autocomplete-item .nome {
  font-size: 12px;
  color: var(--text-dark);
  margin-top: 2px;
  line-height: 1.25;
}
.autocomplete-item .meta {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ----- Resultado ----- */
.resultado {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resultado .linha {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.resultado .linha:last-child { border-bottom: none; }
.resultado .linha .rotulo {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.resultado .linha .valor {
  font-size: 13px;
  color: var(--text-dark);
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.badge.verde { background: #dcfce7; color: #166534; }
.badge.amarelo { background: #fef3c7; color: #92400e; }
.badge.vermelho { background: #fee2e2; color: #991b1b; }

.aliquota-destaque {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-primary-dark);
  line-height: 1;
}

.mensagem {
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  border: 1px solid;
}
.mensagem.erro { background: var(--color-danger-bg); border-color: #fecaca; color: #991b1b; }
.mensagem.info { background: #e0f2fe; border-color: #bae6fd; color: #075985; }
.mensagem.aviso { background: #fef3c7; border-color: #fde68a; color: #92400e; }

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.rodape-mini {
  text-align: center;
  font-size: 10.5px;
  color: var(--text-muted);
  padding: 6px 10px 10px;
}

/* ----- CNAEs vinculados ----- */
.cnaes-bloco {
  width: 100%;
}
.cnaes-bloco summary {
  cursor: pointer;
  padding: 8px 10px;
  background: rgba(45, 152, 70, 0.08);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-primary-dark);
  user-select: none;
  list-style: none;
}
.cnaes-bloco summary::-webkit-details-marker { display: none; }
.cnaes-bloco summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform .15s;
}
.cnaes-bloco[open] summary::before {
  transform: rotate(90deg);
}
.cnaes-bloco summary:hover {
  background: rgba(45, 152, 70, 0.14);
}
.cnaes-lista {
  list-style: none;
  margin: 6px 0 0 0;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}
.cnaes-lista li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-color);
  font-size: 11.5px;
}
.cnaes-lista li:last-child { border-bottom: none; }
.cnaes-lista .cnae-codigo {
  font-weight: 700;
  color: var(--color-primary-dark);
  font-variant-numeric: tabular-nums;
}
.cnaes-lista .cnae-desc {
  color: var(--text-dark);
  line-height: 1.3;
}

/* ===== IR — IN RFB 1.234/2012 ===== */
.ir-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}
.ir-badge-zero      { background: #dcfce7; color: #15803d; }
.ir-badge-baixo     { background: #fef9c3; color: #854d0e; }
.ir-badge-medio     { background: #fef3c7; color: #92400e; }
.ir-badge-alto      { background: #fee2e2; color: #b91c1c; }
.ir-badge-muito-alto{ background: #fce7f3; color: #9d174d; }

/* Destaque da alíquota IR — mesmo visual do ISSQN, tamanho reduzido */
[class^="ir-destaque-"] {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.ir-destaque-zero       { color: #15803d; }
.ir-destaque-baixo      { color: #854d0e; }
.ir-destaque-medio      { color: var(--color-primary-dark); }
.ir-destaque-alto       { color: #b91c1c; }
.ir-destaque-muito-alto { color: #9d174d; }

.ir-naturezas-lista {
  margin: 4px 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ir-naturezas-lista li {
  font-size: 12.5px;
  color: var(--text-dark);
  line-height: 1.45;
}

/* ===== CNPJ inline (webview direto da Receita) ===== */
.cnpj-inline-head {
  padding: 10px 12px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cnpj-inline-head strong { font-size: 13px; }
.cnpj-inline-head span { font-size: 11.5px; opacity: 0.92; }

#cnpjWebview,
#irpfWebview {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 320px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
  display: flex;
}

body.modo-amplo #painel {
  width: 100%;
  min-height: 0;
}

body.modo-amplo main {
  flex: 1;
  min-height: 0;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

body.modo-amplo .tab-panel:not(.ativo) { display: none; }

body.modo-amplo #tab-cnpj.ativo,
body.modo-amplo #tab-irpf.ativo {
  flex: 1;
  min-height: 0;
  min-width: 0;
  gap: 0;
}

body.modo-amplo #cnpj-electron,
body.modo-amplo #irpf-electron {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

body.modo-amplo #cnpjWebview,
body.modo-amplo #irpfWebview {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  height: 100%;
  border: none;
  border-radius: 0;
}

body.electron #cnpj-electron,
body.electron #irpf-electron { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; }

/* Alças invisíveis nas bordas/cantos — redimensionar a janela */
body.electron:not(.colapsado) .janela-rz-handle {
  pointer-events: auto;
}

body.colapsado .janela-rz-handle {
  display: none !important;
  pointer-events: none;
}

/* Electron: mostra webview, oculta card mobile */
body.electron #cnpj-mobile,
body.electron #irpf-mobile { display: none; }
/* Mobile: oculta webview, mostra card mobile */
body.mobile #cnpj-electron,
body.mobile #irpf-electron { display: none; }

/* Botão "Modo painel" (janela flutuante) — só na PWA de tela larga */
.btn-modo-painel {
  display: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-modo-painel:hover { background: rgba(255, 255, 255, 0.28); }
.painel-flutuante-aberto .btn-modo-painel { background: rgba(255, 255, 255, 0.30); }
@media (min-width: 860px) {
  body.mobile .btn-modo-painel { display: inline-flex; align-items: center; }
}

/* ===== PWA em tela larga: Receita embutida em <iframe> (fallback = botão) ===== */
.receita-botao { display: contents; }   /* não altera o layout do card no celular */
.receita-embed-wrap { display: none; }  /* escondido por padrão */
.receita-embed {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: none;
  background: #fff;
  display: block;
}
.receita-embed-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  font-size: 12px;
  color: #475569;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-color);
}
.receita-embed-bar a { color: #1e40af; font-weight: 600; text-decoration: none; white-space: nowrap; }
.receita-embed-bar a:hover { text-decoration: underline; }

/* Só embute quando é PWA (body.mobile), na aba ampla, E a tela é larga (desktop). */
@media (min-width: 860px) {
  /* No navegador o layout é altura-automática (scroll). Nas abas Receita
     travamos a altura para o iframe preencher a área toda. */
  body.mobile.modo-amplo { height: 100vh; overflow: hidden; }
  body.mobile.modo-amplo #painel { height: 100vh; min-height: 0; display: flex; flex-direction: column; }
  body.mobile.modo-amplo main { flex: 1; min-height: 0; overflow: hidden; }
  /* Só o Simulador IRPF embuta (Consulta Optantes usa o botão — ver index.html). */
  body.mobile.modo-amplo #tab-irpf.ativo { display: flex; flex-direction: column; }
  body.mobile.modo-amplo #irpf-mobile {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 0;
    gap: 0;
    align-items: stretch;
    text-align: left;
  }
  body.mobile.modo-amplo #irpf-mobile .receita-embed-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }
  body.mobile.modo-amplo #irpf-mobile .receita-botao { display: none; }
}

/* Card mobile Simples Nacional */
.cnpj-mobile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 32px 24px;
}
.cnpj-mobile-desc {
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
  max-width: 320px;
  margin: 0;
}
.btn-abrir-receita {
  background: #1e40af;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  max-width: 320px;
  min-height: 52px;
  touch-action: manipulation;
  transition: background 0.15s;
}
.btn-abrir-receita:active {
  background: #1e3a8a;
}
.cnpj-mobile-hint {
  color: #94a3b8;
  font-size: 11px;
  margin: 0;
}

/* ============================================================
   MOBILE / CAPACITOR
   Ativado pela classe `mobile` adicionada pelo plataforma.js
   e por media queries para telas pequenas.
   Em Electron, nada deste bloco tem efeito.
   ============================================================ */

/* --- Oculta elementos exclusivos do desktop --- */
body.mobile .chip          { display: none !important; }
body.mobile .botoes-janela { display: none !important; }
body.mobile header.app-header { -webkit-app-region: none; }

/* --- Permite scroll natural no mobile (Electron usa overflow:hidden) --- */
body.mobile,
body.mobile html {
  overflow: auto;
  height: auto;
}
body.mobile .painel {
  height: auto;
  min-height: 100vh;
}
body.mobile main {
  overflow-y: visible;
}

/* --- O painel ocupa toda a tela no mobile (sem modo colapsado) --- */
body.mobile.colapsado .painel { display: flex; }
body.mobile.colapsado .chip   { display: none !important; }

/* --- Fontes e touch targets para telas pequenas --- */
@media (max-width: 600px) {
  html, body {
    font-size: 15px;
  }

  /* Inputs: mínimo 16px evita zoom automático no iOS */
  .field input[type="text"],
  .field input[type="number"],
  .field input[type="search"] {
    font-size: 16px;
    padding: 11px 40px 11px 12px;
  }

  /* Touch targets mínimos de 44px */
  .tabs button {
    padding: 13px 8px;
    font-size: 14px;
  }

  .btn {
    padding: 13px 14px;
    font-size: 14px;
    min-height: 44px;
  }

  .pills button {
    padding: 10px 8px;
    font-size: 13px;
    min-height: 40px;
  }

  header.app-header {
    padding: 12px 14px;
  }

  header.app-header img {
    width: 34px;
    height: 34px;
  }

  header.app-header .titulo h1 {
    font-size: 15px;
  }

  header.app-header .titulo p {
    font-size: 12px;
  }

  main {
    padding: 12px;
    gap: 12px;
  }

  .card {
    padding: 14px;
  }

  .card h2 {
    font-size: 14px;
  }

  /* Resultado: rótulos e valores maiores */
  .resultado .linha .rotulo {
    font-size: 11px;
  }

  .resultado .linha .valor {
    font-size: 14px;
  }

  .aliquota-destaque {
    font-size: 34px;
  }
  /* IR: mantém tamanho controlado no mobile */
  [class^="ir-destaque-"] {
    font-size: 22px;
  }

  /* Autocomplete: itens maiores para toque */
  .autocomplete-item {
    padding: 11px 12px;
  }

  .autocomplete-item .codigo {
    font-size: 13px;
  }

  .autocomplete-item .nome {
    font-size: 13px;
  }

  /* CNAEs lista */
  .cnaes-lista li {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* Autocomplete dropdown não sai da tela em mobile */

  /* Autocomplete dropdown não sai da tela em mobile */
  .autocomplete-lista {
    max-height: 200px;
  }
}

/* ----- Modais flutuantes (arrastar / redimensionar) ----- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 1200;
}

.modal-flutuante {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 94vw);
  height: min(560px, 88vh);
  max-height: 90vh;
  z-index: 1201;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-flutuante-cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(160deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  cursor: move;
  flex-shrink: 0;
}

.modal-flutuante-titulo {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.modal-flutuante-fechar {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-flutuante-fechar:hover {
  background: rgba(255, 255, 255, 0.28);
}

.modal-flutuante-corpo {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.modal-flutuante-corpo webview {
  flex: 1 1 auto;
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
}

.modal-flutuante-corpo .resultado {
  padding: 0;
}

.btn-expandir-modal {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #fff;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-expandir-modal:hover {
  color: var(--color-primary-dark);
  border-color: var(--color-primary);
  background: #f0fdf4;
}

.card-cabecalho {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-cabecalho h2 {
  flex: 1;
  margin: 0;
}

.tab-placeholder-web {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  min-height: 200px;
}

.tab-placeholder-web p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  max-width: 280px;
}

.btn-abrir-modal-web {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-abrir-modal-web:hover {
  filter: brightness(1.06);
}
