/* ====== RESET BÁSICO ====== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f9f9f9;
  color: #111827;
}

/* ====== HEADER ====== */
.header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
}

.brand {
  font-weight: 600;
  font-size: 1.6rem;
  display: flex;
  gap: 6px;
  align-items: center;
}

.brand small {
  color: #6b7280;
  font-weight: 400;
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-btn,
.nav a {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  padding: 5px 12px;
  font-size: 0.88rem;
  text-decoration: none;
  color: #111827;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-btn:hover,
.nav a:hover {
  background: #e5e7eb;
}

/* dropdown */
.dropdown {
  position: relative;
}

/* seta discreta ao lado dos itens do header com menu */
.dropdown-btn .arrow {
  font-size: 0.75rem;     /* seta pequena */
  margin-left: 4px;
  opacity: 0.7;
  transition: transform .15s ease, opacity .15s ease;
}

/* a seta gira suavemente no hover */
.dropdown:hover .dropdown-btn .arrow {
  transform: rotate(180deg);
  opacity: 1;
}

/* comportamento padrão (desktop) */
.menu {
  position: absolute;
  top: 110%;
  left: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 6px;
  display: none;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  z-index: 99;

  min-width: 170px;
  width: max-content;
  max-width: 90vw;         /* impede de ultrapassar a tela */
  white-space: nowrap;     /* mantém o texto em linha única */
  overflow-x: auto;        /* ✅ adiciona rolagem horizontal se o texto for maior */
}

/* ajuste para celulares em modo retrato */
@media (max-width: 600px) {
  .menu {
    right: 0;
    left: auto;
    max-width: 90vw;       /* garante limite lateral */
    overflow-x: auto;      /* ✅ ativa rolagem horizontal suave */
    -webkit-overflow-scrolling: touch; /* rolagem fluida no iPhone */
  }
}

.menu-right {
  right: 0;
  left: auto;
}

.dropdown:hover .menu {
  display: block;
}

.menu-item {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  color: #111827;
  text-decoration: none;
  font-size: 0.85rem;
}

.menu-item:hover {
  background: #e5e7eb;
}

/* ====== TOOLBAR / BUSCA ====== */
/* ====== PAINEL DE FILTROS DE BUSCA (MENU SUSPENSO) ====== */

.search-filters {
  position: fixed;                 /* flutuando na tela */
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
  padding: 10px 12px 12px;
  font-size: 0.85rem;

  /* começa escondido, o JS liga/desliga */
  display: none;
}

.search-filters-header {
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}

.search-filters-fields {
  display: flex;
  flex-direction: column;   /* um embaixo do outro */
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 8px;
}

.search-filters-fields label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.search-filters-fields input[type="checkbox"] {
  transform: scale(0.9);    /* caixinha ligeiramente menor */
}

/* botões "Aplicar" e "Padrão" alinhados à esquerda */
.search-filters-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* no mobile o painel continua pequeno, só garante que não grude na borda */
@media (max-width: 600px) {
  .search-filters {
    max-width: 260px;
  }
}

.toolbar {
  display: flex;
  gap: 6px;
  margin-top: 45px;  /* distância entre header e busca */
  padding: 0 14px;
}

.input {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 10px;
  font-size: 0.9rem;
  background: #fff;
}

.input:focus {
  outline: 2px solid #bfdbfe;
  outline-offset: 1px;
}

.grow {
  flex: 1;
}

.btn {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn:hover {
  background: #e5e7eb;
}

.btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.btn.is-loading {
  opacity: 0.7;
  cursor: wait;
  position: relative;
}

.btn.is-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: rgba(255,255,255,1);
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  animation: spinBtn 0.6s linear infinite;
}

@keyframes spinBtn {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

/* ====== LIMITE DE LARGURA DO CAMPO DE PESQUISA ====== */
.toolbar .input.grow {
  max-width: 480px;   /* largura máxima padrão (monitores médios) */
  flex-grow: 1;       /* continua expansível em telas pequenas */
}

/* telas grandes (a partir de 1200px de largura) */
@media (min-width: 1200px) {
  .toolbar .input.grow {
    max-width: 520px;  /* aumenta levemente o limite */
  }
}

/* ====== GRID DE OBRAS — simples e responsivo ====== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  column-gap: 32px;           /* espaço horizontal entre colunas */
  row-gap: 20px;              /* espaço vertical entre linhas */
  padding: 12px 185px 20px;   /* top | laterais | bottom */
  margin: 0;
}

/* Header/toolbar/list-info alinhados às mesmas margens laterais */
.header,
.toolbar,
.list-info {
  padding-left: 185px;
  padding-right: 185px;
}

/* bolinha de seleção no canto do card */
.art-select-icon {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #9ca3af;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  cursor: pointer;

  opacity: 0;                 /* 👈 escondido por padrão */
  transition: opacity .2s ease, background .2s ease, border-color .2s ease;
}

.selection-menu-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
}

.selection-menu {
  position: fixed;
  display: none;

  /* 👇 força coluna */
  display: flex;
  flex-direction: column;

  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 0;
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
  z-index: 999;
}

.selection-menu button {
  background: none;
  border: none;
  text-align: left;
  padding: 8px 12px;
  width: 190px;          /* largura fixa */
  font-size: 0.85rem;
  cursor: pointer;
  color: #374151;
  display: block;        /* 👈 garante linha inteira */
}

.selection-menu button:hover {
  background: #f3f4f6;
}

/* aparece quando passa o mouse no card (desktop) */
@media (hover: hover) and (pointer: fine) {
  .art-card:hover .art-select-icon {
    opacity: 1;
  }
}

/* quando está selecionado, fica visível sempre */
.art-select-icon.selected {
  opacity: 1;
  background: #2563eb;
  border-color: #2563eb;
}

/* ====== MARGENS MAIORES EM TELAS GRANDES ====== */
@media (min-width: 1600px) {
  .grid,
  .header,
  .toolbar,
  .list-info {
    padding-left: 240px;
    padding-right: 240px;
  }
}

@media (min-width: 1920px) {
  .grid,
  .header,
  .toolbar,
  .list-info {
    padding-left: 260px;
    padding-right: 260px;
  }
}

/* ====== CARD DE OBRA (LISTAGEM) ====== */
.art-card {
  background: #f9f9f9;
  border: 1px solid #f9f9f9;
  border-radius: 0px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 250px;

  /* 👇 limita o tamanho do card, mesmo quando só tem 1 coluna */
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
}

/* bloco que contém a imagem */
.art-thumb-box {
  background: #ededed;          /* fundo cinza em toda a largura */
  padding: 0.625rem;            /* mesmo respiro de antes */
  display: flex;
  justify-content: center;
  align-items: center;
}

/* imagem da obra */
.art-card img.art-thumb {
  width: 100%;
  height: 11.9rem;
  object-fit: contain;
  object-position: center;
  background: transparent;      /* remove o fundo da imagem */
  display: block;
}

/* área do texto */
.art-info {
  background: #f9f9f9;          /* fundo branco do texto */
  padding: 0.75rem;
  text-align: left;

  /* ▼ ADICIONE ISSO AQUI ▼ */
  display: flex;
  flex-direction: column;
  gap: 0px;
}

/* primeira linha: Artista + bandeira */
.art-info .first-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.art-info h3 {
  margin: 0 0 0.15rem;            /* 4px ≈ 0.25rem */
  font-size: 0.9rem;
}

.art-info p {
  margin: 0;
  font-size: 0.9rem;
}

.art-info .meta {
  color: #6b7280;
  font-size: 0.75rem;
  margin-top: 0.8rem;             /* 8px ≈ 0.5rem */
}

/* Somente reduzir o espaço entre técnica e dimensões */
.art-info .meta + p {
  margin-top: 4px;     /* ajuste fino */
}

/* ====== PÁGINAS (cadastro, localizações, listas) ====== */
.form-wrap,
.page-wrap {
  max-width: 720px;
  margin: 30px auto;
  background: transparent;
  padding: 0 14px 80px;
}

.form-wrap h2,
.page-wrap h2 {
  margin-bottom: 12px;
}

/* ====== FORM EM LINHA (localizações e listas) ====== */
.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;   /* distância do formulário para a lista = igual ao modelo que você gostou */
  max-width: 420px;
}

.inline-form .input {
  flex: 1;
  border-radius: 10px;
}

/* ====== LISTA (LOCALIZAÇÕES / LISTAS) ====== */
#locList,
#listsBox {
  /* vamos deixar ambos com o mesmo comportamento */
  display: block;
}

.loc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;    /* distância entre um item e outro — igual ao que você gostou */
  background: #fff;
  transition: background 0.2s ease;
}

.loc-row:hover {
  background: #f9fafb;
}

/* botão pequeno (excluir) */
.btn.small {
  font-size: 0.8rem;
  padding: 4px 8px;
}

/* Botão "Excluir" em cinza médio (vale para Localizações e Listas) */
.btn.danger {
  background: #9ca3af;
  color: #fff;
  border: none;
  transition: background 0.2s ease;
}

.btn.danger:hover {
  background: #6b7280;
}

/* ====== LISTAS ARQUIVADAS (pasta) ====== */
.archived-section {
  margin-top: 20px;
}

.archived-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: none;
  font-size: 0.9rem;
  color: #374151;
  cursor: pointer;
}

.archived-toggle .icon-folder {
  font-size: 1rem;
}

.archived-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 0.7rem;
  color: #4b5563;
}

#archivedBox {
  margin-top: 10px;
}

/* 🔵 Badge de contagem de obras nas listas */
.list-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-right: 6px;      /* afasta da esquerda do nome */
  border-radius: 999px;
  background: #ffdd8c;    /* cinza claro igual ao das arquivadas */
  font-size: 0.75rem;
  color: #4b5563;
  font-weight: 500;
}

/* ====== LOCALIZAÇÕES – MODO EDIÇÃO ====== */

/* A linha em edição substitui .loc-row, mas preserva o mesmo estilo base */
.loc-row-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 6px;
  background: #f3f4f6; /* cinza muito suave para destacar que está em edição */
}

/* Input de renomear */
.loc-row-edit input.input {
  flex: 1;
  padding: 6px 8px;
  font-size: 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

/* Botões no modo edição */
.loc-row-edit .btn.small {
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Salvar = “azul discreto”, coerente com o visual neutro do site */
.btn.primary {
  background: #3b82f6;
  color: #fff;
  border: none;
  transition: background 0.2s;
}

.btn.primary:hover {
  background: #2563eb;
}

/* Excluir já usa o seu padrão (cinza médio → hover cinza escuro) */
/* Cancelar */
.btn.cancel {
  background: #e5e7eb;
  color: #374151;
  border: none;
}

.btn.cancel:hover {
  background: #d1d5db;
}

/* Mobile */
@media (max-width: 520px) {
  .loc-row-edit {
    flex-wrap: wrap;
  }

  .loc-row-edit input.input {
    flex: 1 0 100%;
  }

  .loc-row-edit .btn.small {
    flex: 1;
    text-align: center;
  }
}

/* ====== IMG PICKER ====== */
.img-picker {
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  text-align: center;
}

.img-picker small {
  display: block;
  color: #6b7280;
  font-size: 0.7rem;
  margin-top: 6px;
}

.img-picker img {
  max-height: 200px;
  width: auto;
  margin: 0 auto 8px;
  display: block;
  object-fit: contain;
}

/* ====== FICHA DA OBRA ====== */
.obra-wrap {
  max-width: 1080px;
  margin: 20px auto;

  /* padding lateral permanece igual */
  padding: 0 14px;

  /* 🔥 adiciona espaço seguro inferior para iPhones sem botão */
  padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
}

.obra-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 16px 0 16px;  /* SEM padding-bottom */
}

.obra-body {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* ====== FICHA DA OBRA — CABEÇALHO ====== */

/* container geral do topo da ficha */
.obra-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

/* linha de ações (botões) */
.obra-actions {
  display: flex;
  flex-wrap: wrap;          /* permite quebrar linha se faltar espaço */
  gap: 8px;
  justify-content: flex-end;/* alinhar à direita */
  align-items: center;
  margin-top: 40px;     /* AQUI – espaçamento acima dos botões */
  margin-bottom: 24px;  /* AQUI – espaçamento abaixo dos botões */
}

/* ====== FICHA DA OBRA — AÇÕES NO MOBILE ====== */
@media (max-width: 600px) {
  /* vira um grid 2x2 no celular */
  .obra-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    justify-items: stretch;
    justify-content: stretch;
  }

  /* botões ocupam toda a coluna e texto centralizado */
  .obra-actions .btn,
  .obra-actions .btn-icon,
  .obra-actions .btn.danger {
    width: 100%;
    justify-content: center;
  }
}

/* bloco de artista + título logo abaixo */
.obra-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

/* nome do artista */
.obra-artist {
  margin: 0;
  font-weight: 600;
  font-size: 1.25rem;
}

/* título da obra */
.obra-title {
  margin: 0;
  font-weight: 400;
  color: #4b5563;
  font-size: 1rem;
}

/* opcional: um pouquinho mais de respiro em telas maiores */
@media (min-width: 900px) {
  .obra-header {
    gap: 16px;
  }
}

.obra-img img {
  max-width: 380px;
  width: 100%;
  object-fit: contain;
  display: block;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.obra-data p {
  margin-bottom: 6px;
}

.edition-label {
  font-size: 1rem;
  font-weight: 400;
}

/* Switch */
.toggle-switch {
  appearance: none;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  transition: background .2s ease;
  border: none;
}

.toggle-switch::after {
  content: "";
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform .2s ease;
}

.toggle-switch.active {
  background: #2563eb;
}

.toggle-switch.active::after {
  transform: translateX(20px);
}

/* ====== RESPONSIVO (MOBILE) ====== */
@media (max-width: 600px) {

  /* HEADER: logo em cima, menu embaixo */
  .header {
    flex-direction: column;      /* linha 1: logo / linha 2: nav */
    align-items: flex-start;
    gap: 4px;
  }

  /* NAV: pode quebrar em 2 linhas, sem barra rolante */
  .nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;             /* 👈 volta a permitir quebra de linha */
    row-gap: 4px;
    column-gap: 6px;
    justify-content: flex-start;
  }

  .nav a,
  .nav .btn {
    white-space: nowrap;
    font-size: 0.8rem;           /* levemente menor pra caber mais coisa */
    padding: 4px 8px;
  }

  /* esconde o "v8.x" pra ganhar espaço */
  .brand small {
    display: none;
  }

  /* HEADER / TOOLBAR / LIST-INFO: padding menor no mobile */
  .header,
  .toolbar,
  .list-info {
    padding-left: 16px !important;
    padding-right: 16px !important;
    margin: 0;
    max-width: none;
  }

  /* Busca com respiro adequado */
  .toolbar {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
  }

  .toolbar .input.grow {
    flex: 1 1 100%;
  }

  /* GRID com respiro nas laterais */
  .grid {
    padding-left: 32px !important;
    padding-right: 32px !important;
    margin: 0;
    max-width: none;
    grid-template-columns: 1fr !important;
    gap: 16px 16px;
  }
}

/* ===== TIPOGRAFIA DAS PÁGINAS AUXILIARES — MOBILE ===== */
@media (max-width: 600px) {

  /* Títulos das páginas (Listas, Categorias, Status, Localizações) */
  .page-wrap h2 {
    font-size: 1.2rem;   /* padrão mobile — se ainda parecer grande, teste 1.15rem */
  }

  /* Texto explicativo logo abaixo do título */
  .page-wrap p {
    font-size: 0.95rem;  /* levemente menor que o padrão (16px) */
  }

  /* Linhas de lista (Ex.: Escultura, Fotografia, Papel, etc.) */
  .loc-row {
    font-size: 0.9rem;   /* controla o texto principal da linha no celular */
  }

  /* Links dentro da linha (caso use <a> para o nome da lista/categoria) */
  .loc-row a {
    font-size: 0.9rem;   /* mantido igual ao pai só para garantir consistência */
  }
}

/* ====== RESPONSIVO (TABLET 601–1024px) ====== */
@media (min-width: 601px) and (max-width: 1024px) {
  /* gutters moderados no tablet */
  .header, .toolbar, .list-info, .grid {
    padding-left: 40px;
    padding-right: 40px;
  }

  /* 2 colunas seguras no tablet */
  .grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 20px 28px;
  }

  /* imagem mantém proporção */
  .art-card img.art-thumb {
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain;
  }
}

/* ====== TABLET GRANDE (landscape ~ 1025–1366px) ====== */
@media (min-width: 1025px) and (max-width: 1366px) {
  .header, .toolbar, .list-info, .grid {
    padding-left: 60px;
    padding-right: 60px;
  }
  .grid {
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 22px 30px;
  }
  .art-card img.art-thumb {
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain;
  }
}

/* ====== DROPDOWN com ponte + fade ====== */
.dropdown {
  position: relative;
}

/* ponte invisível pra não sumir no caminho */
.dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 10px;
  background: transparent;
}

/* estado inicial do menu: escondido mas animável */
.dropdown .menu {
  position: absolute;
  top: 110%;
  left: 0;
  background: #ffffffea; /* levemente translúcido */
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  min-width: 170px;
  padding: 6px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  z-index: 50;

  /* animação */
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .15s ease-out, transform .15s ease-out, visibility 0s linear .15s;
}

.dropdown .menu a {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  color: #111827;
  text-decoration: none;
  font-size: 0.85rem;
  white-space: nowrap;
}

.dropdown .menu a:hover {
  background: #e5e7eb;
}

/* quando estiver sobre o botão OU sobre o menu: mostra e anima */
.dropdown:hover .menu,
.dropdown:has(.menu:hover) .menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .15s ease-out, transform .15s ease-out, visibility 0s;
}

/* se o menu for alinhado à direita */
.menu-right {
  right: 0;
  left: auto;
}
/* ====== HEADER (versão sem bordas, só texto) ====== */
.nav a,
.nav .btn,
.header .dropdown > .btn {
  background: transparent;
  border: none;
  border-radius: 9999px;
  padding: 6px 10px;
  color: #111827;
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav a:hover,
.nav .btn:hover,
.header .dropdown > .btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* menus do topo com leve transparência */
.header .menu {
  background: rgba(255, 255, 255, 0.85);
  border: none;
  backdrop-filter: blur(6px);
}

/* itens do menu sem borda */
.header .menu a {
  border: none;
  text-decoration: none;
  background: transparent;
}

.header .menu a:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* ponte pra não sumir quando desce o mouse */
.header .dropdown {
  position: relative;
}

.header .dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 10px;
}

.header .dropdown .menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .15s ease-out, transform .15s ease-out, visibility 0s linear .15s;
}

.header .dropdown:hover .menu,
.header .dropdown:has(.menu:hover) .menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .15s ease-out, transform .15s ease-out, visibility 0s;
}
/* garantir que os menus da direita (Listas e Engrenagem) abram para dentro do site */
.header .dropdown:last-child .menu,
.header .dropdown:nth-last-child(2) .menu {
  left: auto;
  right: 0;             /* mantém alinhado ao botão */
  transform-origin: top right;
  min-width: 180px;     /* garante espaço para os textos */
  translate: -10px 0;   /* puxa um pouco para dentro do site */
}

/* ===== SUBMENUS DENTRO DE "OBRAS" ===== */

/* container "Categorias ▸ / Status ▸ / Localizações ▸" */
.dropdown .submenu {
  position: relative;
  padding: 0;              /* tira o recuo extra que empurrava pra esquerda */
}

/* rótulo com o MESMO estilo dos outros itens do menu */
.submenu-label {
  display: block;
  font-weight: 400;        /* sem negrito */
  font-size: 0.85rem;      /* igual aos demais links do menu */
  padding: 6px 10px;       /* mesmo padding dos .header .menu a */
  cursor: default;
}

/* caixinha que abre ao lado */
.header .menu .submenu > .submenu-menu {
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 4px;    /* pequena distância lateral */
  min-width: 180px;

  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  padding: 6px 0;

  display: none;
  z-index: 999;
}

/* links dentro do submenu */
.header .menu .submenu > .submenu-menu a {
  display: block;
  padding: 6px 12px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.header .menu .submenu > .submenu-menu a:hover {
  background: #f3f4f6;
}

/* hover: destaca o rótulo e abre o submenu */
.header .menu .submenu:hover > .submenu-label {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
}

/* abre o submenu ao passar o mouse ou quando o mouse está em cima do submenu */
.dropdown .submenu:hover .submenu-menu,
.dropdown .submenu:has(.submenu-menu:hover) .submenu-menu {
  display: block;
}

/* 🔧 IMPORTANTE: deixar o menu do topo sem corte,
   para os submenus abrirem para o lado */
.header .menu {
  overflow: visible !important;
}

/* forçar o cadastro a ficar em coluna */
.form-wrap form {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* cada label vira uma coluna */
.form-wrap form > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* linha só para Título + Ano */
.form-wrap form .row-inline {
  display: flex;
  gap: 12px;
}
.form-wrap form .row-inline > label {
  flex: 1;
}
.form-wrap form .row-inline .col-year {
  max-width: 140px;
  flex: 0 0 140px;
}

@media (max-width: 600px) {
  .form-wrap form .row-inline {
    flex-direction: column;
  }
  .form-wrap form .row-inline .col-year {
    max-width: 100%;
    flex: 1 1 auto;
  }
}
/* deixar o formulário mais próximo do estilo de listas/localizações */
.form-wrap form .input,
.form-wrap form textarea,
.form-wrap form select {
  border-radius: 8px;      /* em vez daquele super arredondado */
  border: 1px solid #d1d5db;
}

/* Título + Ano na mesma linha e bem alinhados */
.form-wrap form .row-inline {
  display: flex;
  gap: 14px;
  align-items: flex-end;     /* faz o input do ano “descer” e ficar alinhado com o do título */
}

.form-wrap form .row-inline .col-title {
  flex: 2 1 auto;
}

.form-wrap form .row-inline .col-year {
  width: 100px;              /* ano menor */
  flex: 0 0 100px;
}

/* no mobile volta um embaixo do outro */
@media (max-width: 600px) {
  .form-wrap form .row-inline {
    flex-direction: column;
    align-items: stretch;
  }
  .form-wrap form .row-inline .col-year {
    width: 100%;
    flex: 0 0 100px;
  }
}

/* ====== ANO (60%) + CÓDIGO (40%) ====== */
.form-wrap form .title-year {
  display: flex;
  gap: 14px;
  align-items: flex-end;
}

/* Ano = 60% da largura (mas pode encolher um pouco se precisar) */
.form-wrap form .title-year .col-year {
  flex: 1 1 60%;
}

/* Código = 40% da largura (também pode encolher) */
.form-wrap form .title-year .col-title {
  flex: 1 1 40%;
}

/* inputs sempre ocupam toda a coluna */
.form-wrap form .title-year input {
  width: 100%;
}

/* inputs sempre ocupam toda a coluna */
.form-wrap form .title-year input {
  width: 100%;
}

/* ====== MOBILE: mantém 60% / 40%, só ajusta o gap se quiser ====== */
@media (max-width: 600px) {
  .form-wrap form .title-year {
    gap: 12px;
  }
}

/* barra que fica entre a busca e o grid — sem max-width para seguir os paddings globais */
.list-info {
  margin: 60px auto 4px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.list-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 10px;
}


.list-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* botão com ícone de PDF */
.btn-icon {
  display: inline-flex;
  align-items: center;
  padding: 3px 3px;
  gap: 6px;
  padding-inline: 10px;
}

.btn-icon img {
  width: 18px;
  height: 18px;
  display: block;
}


/* pílulas (texto + botões) */
.list-pill {
  background: #e5e7eb;
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 0.8rem;
  color: #111827;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  white-space: nowrap;
}

.list-pill.action {
  cursor: pointer;
  background: #d1d5db;
}

.list-pill.action:hover {
  background: #cbd5f5;
}

/* --------------------------------------- */
/*  Botão "Remover selecionadas" — refinado */
/* --------------------------------------- */

/* --------------------------------------- */
/*  Botão "Remover selecionadas" – igual à pílula */
/* --------------------------------------- */

/* estado padrão (sem seleção) — fica idêntico à .list-pill normal */
.list-pill.danger[disabled] {
  background: #e5e7eb;      /* mesmo cinza da pílula da lista */
  color: #111827;
  cursor: default;
  opacity: 0.85;            /* levemente apagado pra sugerir “inativo” */
}

/* estado ativo (há obras selecionadas) */
.list-pill.danger:not([disabled]) {
  background: #fee2e2;      /* vermelho bem clarinho */
  color: #7f1d1d;           /* vinho suave no texto */
  cursor: pointer;
}

/* hover do ativo – só um toquezinho a mais */
.list-pill.danger:not([disabled]):hover {
  background: #fecaca;      /* ainda claro, só um pouco mais forte */
}

/* Ícone de seleção das obras no modo edição */
.art-card {
  position: relative;
}

.art-select-icon {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.art-select-icon:hover {
  border-color: #4a90e2;
}

.art-select-icon.selected {
  background: #4a90e2;
  border-color: #4a90e2;
}

.art-select-icon.selected::after {
  content: "✓";
  color: #fff;
  font-size: 15px;
  position: absolute;
  top: 0;
  left: 6px;
}
.page-wrap a {
  color: #111827;           /* mesmo tom usado em textos e botões */
  text-decoration: underline; /* mantém o sublinhado */
}

.page-wrap a:hover {
  color: #6b7280;           /* tom cinza médio do hover, já usado em botões */
}

/* Menu "Organizar" igual ao da engrenagem / Adicionar à lista */
.list-info .dropdown .menu {
  background: rgba(255, 255, 255, 0.85);
  border: none;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.list-info .dropdown .menu button {
  background: transparent;
  border: none;
  text-align: left;
  width: 100%;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #111827;
  cursor: pointer;
}

.list-info .dropdown .menu button:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* item atualmente selecionado no menu "Ordenar" */
.list-info .dropdown .menu .menu-item.active {
  background: #e5e7eb;
  font-weight: 500;
}

/* ====== ALINHAR TEXTO NO MOBILE (sem recuo exagerado) ====== */
@media (max-width: 600px) {
  .art-info {
    text-align: left;
    padding: 0.75rem;     /* usa o mesmo padding padrão do card */
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .art-info h3,
  .art-info p {
    text-align: left;
    margin: 2px 0;
  }
}

button.letter-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 1.2rem !important; /* bem grande só pra testar */
  font-weight: 400;
  cursor: pointer;
  padding: 0 10px;
}

.letter-pill.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.letter-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9999px;
  background: #dc2626;      /* vermelho tipo badge */
  color: #fff;
  font-size: 0.7rem;
  line-height: 16px;
  text-align: center;
  font-weight: 600;
}

/* Centralização específica da página de artistas */
.artists-page .page-wrap {
  margin-top: 30px;
}

 /* você pode depois jogar isso dentro do styles.css se quiser */
    .letters-grid {
      display:flex;
      flex-wrap:wrap;
      gap:8px;
      margin-bottom:16px;
      margin-top: 40px;
    }
    .letter-pill {
      min-width:32px;
      padding:6px 10px;
      border-radius:9999px;
      border:1px solid #d1d5db;
      background:#fff;
      font-size:0.9rem;
      cursor:pointer;
      text-align:center;
    }
    .letter-pill.active {
      background:#111827;
      color:#fff;
      border-color:#111827;
    }

    .artists-grid {
      display:grid;
      grid-template-columns:repeat(auto-fill, minmax(180px, 1fr));
      gap:16px;
    }
    .artist-card {
      border:1px solid #e5e7eb;
      border-radius:8px;
      background:#fff;
      padding:10px;
      display:flex;
      flex-direction:column;
      gap:8px;
      cursor:pointer;
      transition:box-shadow 0.15s ease, transform 0.15s ease;
    }
    .artist-card:hover {
      box-shadow:0 4px 12px rgba(0,0,0,0.06);
      transform:translateY(-1px);
    }
    .artist-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #f9fafb;
    }
    .artist-name {
      font-size:0.95rem;
      font-weight:500;
      color:#111827;
    }
    .artist-sub {
      font-size:0.75rem;
      color:#6b7280;
    }
    
/* ====== ALERTA DE OBRA (BANDEIRA + NOTA) ====== */

/* container da bandeira dentro do bloco de info */
.flag-container {
  position: relative;          /* 👈 referencia pro popup */
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;           /* empurra para a direita da linha */
}

/* botão da bandeira (apagada, escondida por padrão) */
.alert-flag {
  border: none;
  background: transparent;
  color: #9ca3af;              /* cinza quando apagada */
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
  opacity: 0;                  /* começa invisível por padrão */
}

/* DESKTOP: aparece só no hover do card */
@media (hover: hover) and (pointer: fine) {
  .art-card:hover .alert-flag {
    opacity: 1;
  }
}

/* FAVORITO (estrela) */
.favorite-btn {
  border: none;
  background: transparent;
  color: #9ca3af;         /* cinza apagado */
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0;             /* some por padrão no desktop */
  transition: color 0.2s ease, opacity 0.2s ease;
}

/* quando marcado como favorito */
.favorite-btn.active {
  color: #fbbf24;         /* amarelo tipo estrela */
  opacity: 1;             /* sempre visível se ativo */
}

/* DESKTOP: aparece no hover do card (igual à bandeira) */
@media (hover: hover) and (pointer: fine) {
  .art-card:hover .favorite-btn {
    opacity: 1;
  }
}

/* MOBILE: sempre visível */

.submenu.open .submenu-menu {
  display: block;   /* usado no celular ao tocar no rótulo */
}

@media (hover: none) and (pointer: coarse) {
  .favorite-btn {
    opacity: 1;
  }
}

/* MOBILE: bandeira sempre visível */
@media (hover: none) and (pointer: coarse) {
  .alert-flag {
    opacity: 1;
  }
}

/* bandeira ativa (vermelha) — sempre visível */
.alert-flag.active {
  color: #dc2626;              /* vermelho do alerta */
  opacity: 1;                  /* nunca some */
}

/* campo de anotação (ao clicar na bandeira) */
.issue-note {
  width: 90%;
  min-height: 60px;
  font-size: 0.75rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  padding: 4px 6px;
  resize: vertical;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-top: 6px;
  transition: all 0.2s ease;
}

/* popup de leitura do alerta – fica logo abaixo da bandeira */
.issue-popup {
  position: absolute;
  top: 100%;              /* abaixo da bandeira */
  bottom: auto;
  right: 0;
  margin-top: 4px;
  max-width: 260px;
  min-width: 140px;
  font-size: 0.75rem;
  line-height: 1.4;
  background: #ee999c;
  color: #111827;
  padding: 6px 8px;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  z-index: 20;
  white-space: normal;
}

/* ===== Ajuste do menu "Adicionar à lista" — DESKTOP ===== */

.obra-card .list-drop {
  position: relative; /* referência para posicionar o menu */
}

.obra-card .list-drop .menu {
  /* posição padrão do menu no desktop */
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 220px;
  z-index: 20;

  /* impede que o menu transborde se o nome for gigante */
  white-space: normal;

  /* NOVO: limita tamanho no desktop também */
  max-height: 220px;     /* pode ajustar + alto do que o mobile */
  overflow-y: auto;
}

/* linha superior da ficha: ícones + botão Voltar */
.obra-top-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* grupo dos ícones no lado esquerdo */
.obra-top-left {
  display: flex;
  align-items: center;
}

/* evita que os ícones grudem */
.obra-top-left .flag-container {
  display: flex;
  align-items: center;
  gap: 0px;
}

/* ===== FICHA DA OBRA: ícones SEMPRE visíveis ===== */

/* na página da obra, os ícones não ficam invisíveis */
.obra-top-left .favorite-btn,
.obra-top-left .alert-flag {
  opacity: 1;        /* apagados, mas visíveis */
  display: inline-flex; /* garante que apareçam mesmo com regras do grid */
}

/* favorito ativo na ficha */
.obra-top-left .favorite-btn.active {
  color: #fbbf24;
  opacity: 1;
}

/* alerta ativo na ficha */
.obra-top-left .alert-flag.active {
  color: #dc2626;
  opacity: 1;
}

/* ===== Ajuste do menu "Adicionar à lista" na ficha (mobile) ===== */
@media (max-width: 600px) {

  .obra-card .list-drop {
    position: relative;
  }

  .obra-card .list-drop .menu {
    left: 0;
    right: 0;
    min-width: 0;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    max-height: 220px;
    overflow-y: auto;
  }

  .obra-card .list-drop .menu .menu-item {
    white-space: normal;
  }
}

.pager {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 12px 0 110px;   /* CIMA | LADOS | BAIXO (evita ser coberta no mobile) */
}

/* setas já existindo — ajuste fino se quiser */
.pager-arrow {
  font-size: 1.6rem;           /* tamanho dos sinais « ‹ › » */
  cursor: pointer;
  user-select: none;
  padding: 0 4px;
  line-height: 1;
  color: #333;
}

.pager-arrow.disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.pager-info {
  font-size: 0.9rem;
  color: #6b7280;
}

/* wrapper que agrupa a barra de botões + contador */
.list-tools-wrap {
  display: flex;
  flex-direction: column;
  gap: 0px;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* contador */
.sel-counter-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-height: 20px;
  margin-top: 6px;
}

.sel-counter {
  font-size: 0.8rem;
  color: #6b7280;
}

.sel-counter.hidden {
  visibility: hidden;
}

/* container geral (botões + contador + paginação + grid) */
#listInfo {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0px;
}

/* ===== AJUSTE DOS BOTÕES / PÍLULAS NO CELULAR ===== */
@media (max-width: 600px) {

  /* barra de botões pode quebrar de linha */
  .list-tools {
    flex-wrap: wrap;
  }

  /* pílulas e botões nunca passam da largura da tela */
  .list-pill {
    white-space: normal;  /* permite quebrar o texto em 2 linhas */
    max-width: 100%;
  }

  /* garante que o container não crie scroll horizontal */
  #listInfo {
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
}

/* ===== MODAL DE ESCOLHA DE ESCOPO (selecionadas vs visíveis) ===== */

.scope-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px); /* 👈 adiciona isso */
}

.scope-modal {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px 20px 16px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3);
  font-size: 0.9rem;
}

.scope-modal h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #111827;
}

.scope-modal p {
  margin: 0 0 12px;
  color: #4b5563;
  line-height: 1.4;
}

.scope-modal .scope-counts {
  font-size: 0.8rem;
  color: #4b5563;
  margin-bottom: 14px;
  background: #f3f4f6;   /* 👈 novo */
  border-radius: 8px;    /* 👈 novo */
  padding: 6px 8px;      /* 👈 novo */
}

.scope-modal .scope-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* botões dentro do modal reaproveitam sua classe .btn,
   só afinamos um pouco o visual aqui */
.scope-modal .btn {
  font-size: 0.85rem;
  border-radius: 9999px;
  padding: 6px 12px;
}

.scope-modal .btn.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.scope-modal .btn.secondary {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #111827;
}

.scope-modal .btn.text {
  background: transparent;
  border: none;
  color: #6b7280;
  padding-inline: 4px;
}

.scope-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f3f4f6;
  margin-bottom: 8px;
  cursor: pointer;
}

.scope-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.scope-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.scope-choice {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #2563eb; /* cor do quadradinho quando marcado */
}

.scope-option-text strong {
  display: block;
}

.scope-option-text span {
  display: block;
  font-size: 0.8rem;
  color: #6b7280;
}

.modal-add-list .scope-modal{
  max-width: 520px;
  padding: 14px 16px 12px;
  font-size: 0.85rem;
}

.modal-add-list .scope-modal h3{
  font-size: 1.05rem;
}

.modal-add-list .scope-modal > p{
  font-size: 0.9rem;   /* ajuste aqui */
  line-height: 1.4;
}

/* NÃO mexa aqui se não quiser achatar o bloco */
.modal-add-list .scope-option{
  padding: 8px 10px;
  margin-bottom: 0; /* garante que não há espaço extra */
}

/* AQUI diminui o espaço ENTRE as listas */
.modal-add-list .scope-options{
  max-height: 320px;
  overflow-y: auto;
  gap: 8px; /* 👈 ESTE é o número que você quer mexer */
}

.page-layer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  pointer-events: none;        /* só ativa quando "visível" */
}

.page-layer.hidden {
  display: none;
}

.page-layer-backdrop {
  flex: 1;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.page-layer-panel {
  position: relative;
  width: min(900px, 100%);
  max-width: 100%;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 16px rgba(0,0,0,0.25);
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  display: flex;
  flex-direction: column;

  /* 👇 espaçamentos novos */
  padding: 28px 0px 0px; /* topo / laterais / baixo */
  box-sizing: border-box;
}

.page-layer .page-layer-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.page-layer-close {
  position: absolute;
  left: 14px;
  top: 12px;
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  z-index: 1;
}

/* estado aberto */
.page-layer.is-visible {
  display: flex;
  pointer-events: auto;
}

.page-layer.is-visible .page-layer-backdrop {
  opacity: 1;
}

.page-layer.is-visible .page-layer-panel {
  transform: translateX(0);
  opacity: 1;
}

.page-layer-body .obra-card {
  padding-top: 24px; /* espaço entre o botão X e o conteúdo */
}

.btn-primary {
  background: #2563eb;   /* azul Tailwind-like */
  color: white;
  border: 1px solid #1e4fd1;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #1d4ed8;
}

/* ----- MODAL DO ZOOM (NOVO) ----- */
.imgzoom-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12000;              /* MAIOR que o .page-layer (9999) */
}

.imgzoom-modal.hidden {
  display: none;
}

/* fundo escuro */
.imgzoom-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
}

/* caixinha da imagem */
.imgzoom-panel {
  position: relative;
  background: #000;
  padding: 0px;
  border-radius: 8px;
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

/* imagem ampliada */
#imgZoomPicture {
  max-width: 100%;
  max-height: 80vh;
  display: block;
}

/* botão X */
.imgzoom-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

/* botão da lupa no layer */
.zoom-btn {
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  cursor: pointer;
  font-size: 0.9rem;
}
.zoom-btn:hover {
  background: #f3f4f6;
}

.zoom-link {
  margin-top: 14px;            /* distância da imagem */
  cursor: pointer;
  font-size: 0.92rem;
  color: #374151;              /* cinza elegante – deixa de ser azul */
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;     /* centraliza com a imagem */
  text-decoration: none;
}

.zoom-link:hover {
  color: #1f2937;              /* levemente mais escuro ao hover */
}

/* === Drawer de ações (Ordenar / Adicionar / PDF) === */

.tools-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25); /* levemente transparente */
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  z-index: 999; /* acima do grid */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

/* usamos a classe .hidden que você já possui */
.tools-drawer-overlay.hidden {
  display: none;
}

.tools-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.tools-drawer {
  width: 280px;
  max-width: 90vw;
  background: #ffffff;
  box-shadow: -8px 0 24px rgba(0,0,0,0.18);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateX(100%);
  transition: transform 0.25s ease-out;
}

/* quando o overlay estiver aberto, o painel entra */
.tools-drawer-overlay.open .tools-drawer {
  transform: translateX(0);
}

.tools-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.tools-drawer-title {
  font-size: 14px;
  font-weight: 600;
}

.tools-drawer-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.tools-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

/* Botão da seta em círculo translúcido */
.toolbar-toggle-btn {
  position: fixed;
  top: 120px;                 /* você já ajustou isso, pode manter o valor que gostou */
  right: 10px;                /* aumenta/diminui pra jogar mais pra dentro ou pra fora */
  transform: translateY(-50%);
  z-index: 1000;

  width: 42px;
  height: 42px;
  padding: 0;
  border: none;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.15);  /* círculo escuro translúcido */
  backdrop-filter: blur(4px);       /* opcional: efeito "glass" */
  border-radius: 50%;               /* deixa redondo */
  cursor: pointer;
  transition: background 0.2s ease, right 0.3s ease;
}

.toolbar-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* 🎯 Seta com as cores antigas */
.toolbar-toggle-btn .chevron {
  font-size: 28px;
  color: #555;                        /* mesma cor de antes */
  transition: color 0.15s ease;
}

.toolbar-toggle-btn:hover .chevron {
  color: #000;                        /* mesma cor de hover de antes */
}

/* Quando o menu abre, só empurra o botão pra esquerda.
   NÃO gira, não muda a seta. */
.toolbar-toggle-btn.open {
  right: 300px;                       /* ajuste se o drawer tiver outra largura */
}

/* Nada de rotate aqui! Mantemos a seta como está */
.toolbar-toggle-btn.open .chevron {
  transform: none;
}

/* Correção do menu "Ordenar" dentro do drawer lateral */
.tools-drawer-body .menu {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

/* Reset total nos itens do dropdown */
.tools-drawer-body .menu .menu-item {
  all: unset;               /* limpa estilos herdados */
  display: block;
  width: 100%;
  padding: 8px 14px;
  font-size: 14px;
  line-height: 1.3;
  cursor: pointer;
  color: #333;
  box-sizing: border-box;
}

/* Hover bonito */
.tools-drawer-body .menu .menu-item:hover {
  background: #f3f3f3;
}

/* Item ativo (o selecionado) */
.tools-drawer-body .menu .menu-item.active {
  background: #e6e6e6;
  font-weight: 600;
}

/* ===== ARTWORK FORM — LAYOUT FINAL (tabs + imagem fixa) ===== */

/* largura maior só para o cadastro */
.form-wrap-wide {
  max-width: 1280px;
}

/* ===== Cabeçalho ===== */
.artform-head {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 24px;
}

.artform-head-center {
  text-align: center;
}

.artform-title {
  margin: 0;
}

.artform-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
  margin-top: 4px;
}

.artform-head-right {
  position: absolute;
  right: 0;
  top: 0;
}

/* ===== Layout 2 colunas ===== */
.artform-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 40px;
  align-items: start;
}

/* ===== Coluna esquerda (formulário) ===== */
.artform-left form label {
  display: block;
  margin-bottom: 18px; /* 👈 MAIS ESPAÇO ENTRE CAMPOS */
}

.artform-left .input,
.artform-left textarea.input,
.artform-left select.input {
  width: 100%;
}

/* ===== Tabs ===== */
.artform-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  margin-bottom: 28px;
}

.artform-tab {
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
}

.artform-tab:hover {
  background: #e5e7eb;
}

.artform-tab.is-active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

/* controle real das abas */
.artform-pane[hidden] {
  display: none !important;
}

/* ===== Títulos internos ===== */
.artform-section-title {
  margin: 24px 0 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ===== Botões ===== */
.artform-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

/* ===== Coluna direita (imagem) ===== */
.artform-right {
  padding-top: 54px; /* 👈 alinha com o campo Artista */
}

.artform-preview {
  background: transparent;
  border: none;
}

.artform-preview-box {
  border: none;
  background: transparent;
  padding: 0;
}

.artform-preview-box img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  display: block;
}

/* botão simples */
.artform-preview-actions {
  margin-top: 10px;
  text-align: center;
}

/* ===== Mobile ===== */
@media (max-width: 900px) {
  .artform-layout {
    grid-template-columns: 1fr;
  }

  .artform-right {
    order: -1;
    padding-top: 0;
    margin-bottom: 24px;
  }

  .artform-preview-box img {
    max-height: 320px;
  }
}

/* ===== Layout base: nome | campo ===== */
#tab-principais .field-row{
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
  margin: 0 0 14px;
  min-height: 44px;
}

#tab-principais .field-name,
#tab-principais label {
  font-weight: 400;
  font-size: 0.95rem;
}

#tab-principais .field-row .input{
  width: 100%;
  margin: 0;
  min-width: 0;
}

/* se você ainda usa algum "2 campos na mesma linha" */
#tab-principais .field-row-2{
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 12px;
}

/* ===== Assinatura/Edição: dentro do campo (toggle | input) ===== */
/* (isso só funciona com o HTML que tem .field-controls) */
#tab-principais .field-controls{
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
  min-height: 44px;
}

#tab-principais .signature-input,
#tab-principais .edition-input{
  width: 100%;
  margin: 0;
  min-width: 0;
}

/* fechado: input some */
#tab-principais .signature-row:not(.has-signature) .signature-input{ display: none; }
#tab-principais .edition-row:not(.has-edition) .edition-input{ display: none; }

/* ===== Anexos (se você quiser manter igual) ===== */
#tab-imagens .attach-row input[type="file"]{
  width: 100%;
  min-width: 0;
}

#tab-imagens .field-controls{
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
  min-height: 44px;
}

/* ===== Layout base (vale para tab-principais, tab-imagens, tab-outras) ===== */
.artform-pane .field-row{
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
  margin: 0 0 14px;
  min-height: 44px;
}

.artform-pane .field-name{
  font-weight: 400;   /* sem negrito */
  font-size: 0.9rem;  /* mesmo tamanho do resto */
}

/* inputs/textarea/select sempre ocupam a coluna da direita */
.artform-pane .field-row .input{
  width: 100%;
  margin: 0;
  min-width: 0;
}

/* Toggle + campo na coluna da direita (Assinatura/Edição/Anexos) */
.artform-pane .field-controls{
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
  min-height: 44px;
}