/* Acessibilidade */
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Reset e base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root{
  /* Paleta inspirada no tema escuro do Copilot */
  --bg: #071023;         /* fundo principal - azul muito escuro */
  --panel: #0b1726;      /* painéis e áreas internas */
  --muted: #0f2538;      /* elementos secundários / listas */
  --muted-2: #102636;    /* cabeçalhos e barras */
  --border: #203647;     /* bordas sutis */
  --accent: #00b7ff;     /* ciano brilhante principal (Copilot) */
  --accent-2: #7c3aed;   /* roxo secundário */
  --text: #e6f3fb;       /* texto claro */
  --muted-text: #9fb8cc; /* texto secundário */
  --toast-left: #072033; /* fundo dos toasts */
  --danger: #ff6b6b;     /* ações de exclusão */
}

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Main layout */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Sidebar moderno */
#sidebar {
  width: 280px;
  background: linear-gradient(180deg, #071023, #081428);
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  transition: all 0.3s ease;
  min-width: 200px;
}

#sidebar.open {
  left: 0;
}

#sidebar button {
  background-color: #00316f;
  color: var(--text);
  border: none;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
}

#sidebar button:active { transform: translateY(1px); }

/* Dropdowns */
.dropdown-header {
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.5rem;
  background-color: var(--muted-2);
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  transition: background 0.12s ease;
}

.dropdown-header:focus {
  outline: 2px solid rgba(0,183,255,0.18);
  outline-offset: 2px;
}

.dropdown-header:hover {
  background-color: #0e3246;
}

.dropdown-list {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
}

.dropdown-list li {
  background-color: var(--muted);
  padding: 0.5rem 0.75rem;
  margin-bottom: 6px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.12s ease;
  color: var(--text);
}

.dropdown-list li:hover {
  background-color: #12384a;
}

.dropdown-list li button {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
}

/* Responsivo */
@media (max-width: 1024px) {
  #sidebar {
    width: 240px;
  }
}

@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100%;
    z-index: 1000;
  }

  #sidebar.open {
    left: 0;
  }

  main {
    margin-left: 0;
  }
}

/* Barra de ferramentas moderna */
#toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background-color: var(--muted-2);
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.toolbar-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  border-right: 1px solid rgba(35,58,80,0.25);
  padding-right: 1rem;
}

.toolbar-group:last-child {
  border-right: none;
}

/* Botões e selects */
#toolbar button,
#toolbar select {
  background-color: var(--panel);
  color: var(--text);
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.06s ease;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
}

#toolbar button:hover,
#toolbar select:hover {
  background-color: #0f2b3c;
}

#toolbar button:active {
  transform: translateY(1px);
}

#toolbar button.active {
  background: linear-gradient(90deg, rgba(0,183,255,0.12), rgba(124,58,237,0.08));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
  color: var(--text);
  border-radius: 8px;
}

#toolbar i {
  font-size: 1.1rem;
  color: var(--muted-text);
}

/* Editor de texto */
#editorArea {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.5rem;
  overflow: auto;
  min-height: 0;
}

#editor {
  flex: 1;
  background-color: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  outline: none;
  overflow-y: auto;
  max-height: calc(100vh - 160px);
  min-height: 200px;
  caret-color: var(--accent);
}

/* focus visible for editor and interactive elements */
#editor:focus, .sheet-cell:focus, button:focus, select:focus, input:focus, .dropdown-header:focus {
  outline: 2px solid rgba(0,183,255,0.18);
  outline-offset: 2px;
}

/* Área da planilha */
#sheetArea {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.5rem;
  overflow: auto;
  min-height: 0;
}

#spreadsheet {
  overflow: auto;
  max-height: calc(100vh - 160px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--panel);
  padding: 0.5rem;
}

/* Tabela da planilha */
.sheet-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 600px;
  background-color: transparent;
}

.sheet-table th,
.sheet-table td {
  border: 1px solid rgba(32,54,71,0.45);
  padding: 0;
  text-align: center;
  background-color: #071726;
  color: var(--text);
  font-size: 0.9rem;
}

.sheet-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(180deg, rgba(0,183,255,0.05), rgba(124,58,237,0.03));
  font-weight: 600;
  color: var(--text);
  padding: 0.5rem;
}

.sheet-table td:first-child,
.sheet-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background-color: rgba(10,23,34,0.9);
  color: var(--text);
}

/* Cells */
.sheet-cell {
  padding: 0.5rem;
  min-width: 80px;
  outline: none;
  background-color: transparent;
  transition: background 0.12s ease, box-shadow 0.12s ease;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.sheet-cell:focus {
  background-color: rgba(0,183,255,0.03);
  border: 1px solid rgba(0,183,255,0.18);
  box-shadow: 0 0 8px rgba(0,183,255,0.06);
}

/* Redimensionamento de colunas */
.col-resizer {
  position: absolute;
  right: 0;
  top: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 10;
}

.sheet-table th {
  position: relative;
}

/* Controles de cor da planilha */
#colorControls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

#colorControls label {
  color: var(--muted-text);
  font-size: 0.95rem;
}

#colorControls input,
#colorControls select,
#colorControls button {
  background-color: var(--panel);
  color: var(--text);
  border: none;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

#colorControls button:hover {
  background-color: #0f2b3c;
}

/* Modais modernos */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(7,16,35,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.overlay[style*="display: none"] { pointer-events: none; }

.modal {
  background-color: #071826;
  padding: 2rem;
  border-radius: 10px;
  width: 90%;
  max-width: 520px;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(2,8,22,0.6);
  animation: fadeIn 0.2s ease;
  max-height: 80vh;
  overflow: auto;
  border: 1px solid rgba(124,58,237,0.06);
}

.modal h2 {
  margin-top: 0;
  color: var(--text);
  font-size: 1.25rem;
}

.modal input,
.modal select,
.modal textarea {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  border: none;
  border-radius: 6px;
  background-color: var(--muted);
  color: var(--text);
  font-size: 0.95rem;
  border: 1px solid rgba(255,255,255,0.02);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1rem;
}

.modal-actions button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background: linear-gradient(90deg, #2196F3, #2196F3);
  color: #021025;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(12,34,56,0.18);
}

.modal-actions button:hover {
  filter: brightness(1.05);
}

/* Toasts animados */
.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background-color: var(--toast-left);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(2,8,22,0.6);
  z-index: 2000;
  animation: fadeInOut 3s ease-in-out;
  max-width: 90%;
  font-size: 0.9rem;
  border-left: 6px solid var(--accent);
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(20px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateY(20px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Small screen tweaks */
@media (max-width: 480px) {
  .toast {
    right: auto;
    left: 1rem;
    bottom: 1rem;
  }

  .modal-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .modal-actions button {
    width: 100%;
  }

  .sheet-table {
    min-width: 480px;
  }
}

/* Utility */
.hidden { display: none !important; }
.center { display:flex; align-items:center; justify-content:center; }

/* Botões da área de planilha com visual idêntico à toolbar */
#sheetControls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0;
}

#sheetControls button,
#sheetControls .toolbar-btn {
  background-color: var(--panel);
  color: var(--text);
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.06s ease;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
  min-height: 38px;
  min-width: 84px;
}

/* Hover / active / focus idênticos à toolbar */
#sheetControls button:hover,
#sheetControls .toolbar-btn:hover {
  background-color: #0f2b3c;
}

#sheetControls button:active,
#sheetControls .toolbar-btn:active {
  transform: translateY(1px);
}

#sheetControls button:focus,
#sheetControls .toolbar-btn:focus {
  outline: 2px solid rgba(0,183,255,0.18);
  outline-offset: 2px;
}

/* Versão pequena (apenas ícone) */
#sheetControls .icon-only {
  padding: 0.45rem;
  min-width: 40px;
  border-radius: 8px;
}

/* Ícones Font Awesome dentro dos botões */
#sheetControls i {
  font-size: 1.05rem;
  color: var(--muted-text);
  width: 1.1em;
  text-align: center;
}

/* Ajuste responsivo */
@media (max-width: 480px) {
  #sheetControls {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  #sheetControls button { min-width: 72px; font-size: 0.9rem; }
}
/* Logo da sidebar (sem fundo) */
.sidebar-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.sidebar-logo i {
  font-size: 1.25rem;
  color: var(--accent);
  width: 1.4em;
  text-align: center;
}

.sidebar-logo .logo-text {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mantém contraste no foco/hover sem aplicar fundo permanente */
.sidebar-logo:focus,
.sidebar-logo:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,183,255,0.06);
  outline: 2px solid rgba(0,183,255,0.12);
  background: rgba(255,255,255,0.01);
}

/* Versão compacta para telas pequenas */
@media (max-width: 480px) {
  .sidebar-logo .logo-text { display: none; }
  .sidebar-logo { justify-content: center; padding: 0.6rem; }
}

/* Forçar logo sem fundo e sem borda */
#kivokitLogo,
.sidebar-logo {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text) !important;
}

/* Mantém foco acessível sem fundo permanente */
#kivokitLogo:focus,
.sidebar-logo:focus {
  outline: 2px solid rgba(0,183,255,0.12);
  outline-offset: 2px;
  box-shadow: 0 6px 18px rgba(0,183,255,0.04);
  background: transparent !important;
}

/* Separador da sidebar entre logo e ações */
.sidebar-separator {
  width: 100%;
  height: 1px;
  margin: 0.5rem 0;
  background: linear-gradient(90deg, rgb(255 255 255 / 25%), rgb(255 255 255 / 25%));
  border-radius: 1px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.01);
}

/* Opcional: aumenta o espaço quando o botão é sem fundo para melhorar o contraste */
#kivokitLogo {
  padding-bottom: 0.35rem;
}

/* Rodapé da sidebar */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Botão Sair */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  background: transparent;
  color: var(--text);
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.08s ease;
}

.sidebar-link:hover {
  background-color: rgba(255, 107, 107, 0.1);
  color: var(--danger);
  transform: translateY(-1px);
}

.sidebar-link:focus {
  outline: 2px solid rgba(255, 107, 107, 0.3);
  outline-offset: 2px;
}

.sidebar-link i {
  font-size: 1.1rem;
  width: 1.25em;
  text-align: center;
}

.exit-btn i {
  color: var(--danger);
}

/* Versão compacta para telas pequenas */
@media (max-width: 480px) {
  .sidebar-link span {
    display: none;
  }
  .sidebar-link {
    justify-content: center;
    padding: 0.75rem;
  }
}

/* --- Mobile enhancements (adicionar no final do arquivo) --- */

/* Allow denser layout on small screens */
@media (max-width: 768px) {
  /* Make main take full width when sidebar closed */
  body { overflow: hidden; }

  /* Sidebar as off-canvas already positioned left:-280px on <=768px
     add width optimizations and an overlay when open */
  #sidebar { width: 260px; transition: transform 0.28s cubic-bezier(.2,.8,.2,1); transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); box-shadow: 0 10px 30px rgba(2,8,22,0.6); }

  /* Overlay behind sidebar */
  .mobile-sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.45);
    z-index: 900; display: none;
  }
  .mobile-sidebar-backdrop.show { display: block; }

  /* Toolbar fixed at bottom with icon-only compact groups */
  #toolbar {
    position: fixed; left: 0; right: 0; bottom: 0;
    padding: 0.5rem 0.75rem; gap: 0.5rem;
    border-top: 1px solid var(--border);
    z-index: 920;
    background: linear-gradient(180deg, rgba(10,20,30,0.9), rgba(10,20,30,0.98));
  }
  .toolbar-group { padding-right: 0.5rem; border-right: none; }

  /* Show icons only (hide labels that are not present anyway) */
  #toolbar button, #toolbar select {
    padding: 0.6rem;
    min-width: 44px; min-height: 44px;
  }
  #toolbar select { display: none; } /* hide selects on small screens to save space; can be accessible via modal */

  /* Ensure editor/sheet area doesn't go below the toolbar */
  #editorArea, #sheetArea { padding-bottom: calc(70px + 1rem); } /* space for toolbar */

  /* FAB: new document floating action button */
  .fab-newdoc {
    position: fixed; right: 1rem; bottom: 76px;
    width: 56px; height: 56px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: #021025; z-index: 930;
    box-shadow: 0 10px 30px rgba(2,8,22,0.4); cursor: pointer;
    transition: transform .12s ease;
  }
  .fab-newdoc:active { transform: translateY(2px); }

  /* Make modal actions full width */
  .modal { width: 94%; max-width: 520px; padding: 1rem; }
  .modal-actions { gap: 0.5rem; flex-direction: column-reverse; }

  /* Larger touch targets for sheet controls */
  #sheetControls button { min-width: 52px; min-height: 48px; padding: 0.6rem; }

  /* Toast position moved up to not overlap toolbar */
  .toast { bottom: 84px; right: 1rem; left: auto; }

  /* Minor typography adjustments for tight screens */
  #editor { font-size: 15px; padding: 0.75rem; min-height: calc(100vh - 160px); }
  #spreadsheet { padding: 0.25rem; }

  /* Make sidebar-logo compact */
  .sidebar-logo { justify-content: center; gap: 0.4rem; }
  .sidebar-logo .logo-text { display: none; }

  /* Ensure sticky headers don't collide with fixed toolbar when printing / long pages */
  .sheet-table th { z-index: 4; }

  /* Provide accessible focus for the hamburger */
  .hamburger-btn { position: fixed; left: 1rem; top: 1rem; z-index: 940; background: transparent; border: none; color: var(--text); padding: 0.5rem; border-radius: 8px; }
  .hamburger-btn:focus { outline: 2px solid rgba(0,183,255,0.18); }
}

/* --- Corrige faixas brancas no Desktop --- */
@media (min-width: 769px) {
  /* Garantir preenchimento completo */
  html, body {
    height: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    background: var(--bg) !important;
    color: var(--text) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Forçar fundo consistente em containers principais */
  main, #sidebar, #toolbar, #editorArea, #sheetArea, .modal, .overlay {
    background: transparent;
    background-color: transparent;
  }

  /* Aplicar fundo principal explicitamente aos elementos que cobrem a viewport */
  body > main, #sidebar {
    background-color: var(--bg);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  /* Prevenir que bordas arredondadas exponham o fundo do navegador */
  * { background-clip: padding-box; }

  /* Evitar gaps por margens colapsadas */
  :root, html, body, main { box-sizing: border-box; }

  /* Scrollbar escuro (WebKit/Blink) para que track não mostre faixas claras */
  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-track { background: var(--bg); }
  ::-webkit-scrollbar-thumb { background: rgba(0,183,255,0.10); border-radius: 8px; border: 2px solid var(--bg); }

  /* Se existir algum elemento com fundo branco por engano, forçar tema escuro */
  [style*="background: #fff"], [style*="background: white"], [style*="background-color: #fff"], [style*="background-color: white"] {
    background-color: transparent !important;
  }

  /* Evitar sombras ou outlines brilhantes que pareçam como faixas brancas */
  * { box-shadow: none !important; }

  /* Garante que overlays/modais cubram inteiramente sem bordas brancas visíveis */
  .overlay { background-color: rgba(7,16,35,0.95) !important; }
  .modal { background-color: #071826 !important; }

  /* Se ainda houver elementos ponte (wrappers) brancos: forçar cor do texto e fundo */
  .wrapper, .container, .page {
    background-color: var(--bg) !important;
    color: var(--text) !important;
  }
}

/* --- Forçar fundo escuro e remover faixas brancas apenas em desktop --- */
@media (min-width: 769px) {
  /* Garantir cobertura total da viewport */
  html, body {
    height: 100%;
    min-height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    background: var(--bg) !important;
    color: var(--text) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Elementos de topo devem herdar/forçar o fundo escuro */
  body > * {
    background-color: var(--bg) !important;
  }
  main, #sidebar, #toolbar, #editorArea, #sheetArea, .overlay, .modal {
    background-color: transparent !important;
  }
  /* Se existir wrapper branco, forçar tema escuro */
  .wrapper, .container, .page, .app, .root {
    background-color: var(--bg) !important;
    color: var(--text) !important;
  }

  /* Evitar que bordas arredondadas exponham o fundo do navegador */
  * { background-clip: padding-box; }

  /* Scrollbar escuro (WebKit/Blink) para que o track não mostre faixas claras */
  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-track { background: var(--bg) !important; }
  ::-webkit-scrollbar-thumb { background: rgba(0,183,255,0.10) !important; border-radius: 8px; border: 2px solid var(--bg) !important; }

  /* Forçar remoção de fundos brancos inline/incidentes */
  [style*="background: #fff"], [style*="background: white"], [style*="background-color: #fff"], [style*="background-color: white"] {
    background-color: transparent !important;
    color: var(--text) !important;
  }

  /* Evitar sombras claras que pareçam faixas brancas */
  * { box-shadow: none !important; }

  /* Garante que overlays e modais cubram totalmente sem mostrar bordas brancas */
  .overlay { background-color: rgba(7,16,35,0.95) !important; }
  .modal  { background-color: #071826 !important; }
}

/* --- Visibilidade do hamburger e FAB por breakpoints --- */

/* Ocultar hamburger no desktop (>=769px) */
@media (min-width: 769px) {
  .hamburger-btn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* Mostrar hamburger apenas em mobile (<=768px) */
@media (max-width: 768px) {
  .hamburger-btn {
    display: inline-flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: var(--text);
    z-index: 940;
  }
}

/* Ocultar FAB no desktop (>=769px) */
@media (min-width: 769px) {
  .fab-newdoc {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* Mostrar FAB apenas em mobile (<=768px) */
@media (max-width: 768px) {
  .fab-newdoc {
    display: inline-flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #021025;
    z-index: 930;
    box-shadow: 0 10px 30px rgba(2,8,22,0.4);
    transition: transform .12s ease;
  }

  .fab-newdoc:active { transform: translateY(2px); }
}
