/* Revvoada — Ações rápidas em botão flutuante */
.rv-fab-wrap {
  position: fixed;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 9000;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}

.rv-fab-wrap > * { pointer-events: auto; }

.rv-fab {
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 31px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  color: #fff;
  background: var(--rv-primary, #415437);
  box-shadow: 0 10px 28px rgba(38, 45, 35, .24), 0 3px 8px rgba(38, 45, 35, .16);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, bottom .18s ease;
  -webkit-tap-highlight-color: transparent;
}

.rv-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(38, 45, 35, .28), 0 4px 10px rgba(38, 45, 35, .18);
}

.rv-fab:active { transform: translateY(0) scale(.97); }

.rv-fab:focus-visible {
  outline: 3px solid #8b9a78;
  outline-offset: 4px;
}

.rv-fab-menu {
  min-width: 246px;
  max-height: min(78vh, 720px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(65, 84, 55, .14);
  border-radius: 18px;
  background: rgba(255, 253, 248, .98);
  box-shadow: 0 18px 42px rgba(39, 45, 35, .18), 0 4px 12px rgba(39, 45, 35, .08);
  transform-origin: bottom right;
  animation: rvFabMenuIn .16s ease both;
}


.rv-fab-menu-title {
  padding: 8px 10px 5px;
  color: #66705f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rv-fab-menu-title + .rv-fab-menu-title { margin-top: 6px; }

.rv-fab-menu-separator { margin-top: 4px; }

.rv-fab-menu button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: transparent;
  color: #2f382c;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.rv-fab-menu button:hover { background: rgba(65, 84, 55, .08); }

.rv-fab-menu button:focus-visible {
  outline: 2px solid #8b9a78;
  outline-offset: -2px;
}

.rv-fab-menu-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(65, 84, 55, .09);
  color: #415437;
  font-size: 16px;
  font-weight: 800;
}

.rv-fab-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8999;
  background: transparent;
}

.rv-fab-hidden-add { display: none !important; }

@keyframes rvFabMenuIn {
  from { opacity: 0; transform: translateY(7px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 700px) {
  .rv-fab-wrap {
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px)); /* JS elevates above the real bottom navigation */
  }

  .rv-fab {
    width: 58px;
    height: 58px;
    font-size: 29px;
  }

  .rv-fab-menu {
    min-width: min(292px, calc(100vw - 36px));
    max-width: calc(100vw - 36px);
  }
}

/* Revvoada — filtro visual de status das apresentações */
.rv-status-filter {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
}

.rv-status-filter button {
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid rgba(65, 84, 55, .18);
  border-radius: 999px;
  background: rgba(255, 253, 248, .88);
  color: #415437;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.rv-status-filter button:hover {
  border-color: rgba(65, 84, 55, .36);
  transform: translateY(-1px);
}

.rv-status-filter button.is-active {
  color: #fff;
  background: #415437;
  border-color: #415437;
}

.rv-status-filter button:focus-visible {
  outline: 3px solid #8b9a78;
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .rv-status-filter {
    gap: 6px;
    margin-bottom: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .rv-status-filter::-webkit-scrollbar { display: none; }
  .rv-status-filter button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 13px;
    font-size: 12px;
  }
}

/* Revvoada 2.6 — fluxo direto de adicionar foto */
.rv-foto-direto-fundo { z-index: 12000; }
.rv-foto-direto-modal {
  width: min(720px, calc(100vw - 28px));
  max-height: min(88vh, 820px);
  overflow-y: auto;
}
.rv-foto-direto-etapas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 0 18px;
}
.rv-foto-direto-etapa {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid rgba(65,84,55,.14);
  border-radius: 14px;
  background: rgba(65,84,55,.035);
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
}
.rv-foto-direto-etapa > span {
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(65,84,55,.09);
  color: #415437;
  font-weight: 800;
}
.rv-foto-direto-etapa strong { font-size: 13px; color: #2f382c; }
.rv-foto-direto-etapa small { color: #6b7466; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-foto-direto-etapa-ativa { border-color: rgba(65,84,55,.34); background: rgba(65,84,55,.08); }
.rv-foto-direto-etapa-ok { background: rgba(65,84,55,.06); }
.rv-foto-direto-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 14px;
  border-radius: 16px;
  overflow: hidden;
  background: #eeeae2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rv-foto-direto-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rv-foto-direto-bloco { margin-top: 0; }
.rv-foto-direto-bloco select { width: 100%; min-height: 48px; }
.rv-foto-direto-progresso { margin-top: 12px; }
.rv-foto-direto-acoes { margin-top: 8px; }
@media (max-width: 700px) {
  .rv-foto-direto-modal { width: calc(100vw - 20px); border-radius: 20px; }
  .rv-foto-direto-etapas { grid-template-columns: 1fr; }
  .rv-foto-direto-etapa { min-height: 54px; }
  .rv-foto-direto-preview { aspect-ratio: 4 / 3; }
}

/* Revvoada 2.6 — modal Foto > Coleção compacto, sem rolagem */
.rv-foto-direto-modal {
  max-height: min(88dvh, 760px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.rv-foto-direto-modal .modal-header {
  flex: 0 0 auto;
  margin-bottom: 10px;
}
.rv-foto-direto-modal .modal-header p {
  margin-bottom: 0;
}
.rv-foto-direto-etapas {
  flex: 0 0 auto;
  margin: 2px 0 10px;
}
.rv-foto-direto-etapa {
  min-height: 54px;
  padding: 8px 10px;
}
.rv-foto-direto-etapa > span {
  width: 24px;
  height: 24px;
}
.rv-foto-direto-preview {
  flex: 0 0 auto;
  height: clamp(150px, 24dvh, 255px);
  aspect-ratio: auto;
  margin-bottom: 10px;
}
.rv-foto-direto-bloco {
  flex: 0 0 auto;
  padding: 12px 14px;
}
.rv-foto-direto-bloco .ficha-secao-header {
  margin-bottom: 8px;
}
.rv-foto-direto-bloco select {
  min-height: 46px;
}
.rv-foto-direto-progresso {
  flex: 0 0 auto;
}
.rv-foto-direto-acoes {
  flex: 0 0 auto;
  margin-top: 10px;
}

@media (max-width: 700px) {
  .rv-foto-direto-modal {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100dvh - 18px);
    padding: 16px 14px;
  }
  .rv-foto-direto-modal .modal-header h2 {
    font-size: 20px;
  }
  .rv-foto-direto-modal .modal-header p {
    font-size: 13px;
    line-height: 1.3;
  }
  .rv-foto-direto-etapas {
    gap: 6px;
  }
  .rv-foto-direto-etapa {
    min-height: 50px;
    padding: 7px 8px;
    grid-template-columns: 24px minmax(0, 1fr);
  }
  .rv-foto-direto-etapa > span {
    width: 24px;
    height: 24px;
  }
  .rv-foto-direto-etapa strong { font-size: 12px; }
  .rv-foto-direto-etapa small { font-size: 10px; }
  .rv-foto-direto-preview {
    height: clamp(135px, 20dvh, 220px);
    margin-bottom: 8px;
  }
  .rv-foto-direto-bloco {
    padding: 10px 12px;
  }
  .rv-foto-direto-bloco .ficha-secao-header h3 {
    font-size: 15px;
    margin-bottom: 2px;
  }
  .rv-foto-direto-bloco .ficha-secao-subtitulo {
    font-size: 11px;
  }
  .rv-foto-direto-bloco select {
    min-height: 44px;
  }
  .rv-foto-direto-acoes {
    margin-top: 8px;
  }
  .rv-foto-direto-acoes .botao-secundario,
  .rv-foto-direto-acoes .botao-principal {
    min-height: 46px;
  }
}

/* Revvoada 2.6 — modal Foto > Coleção: encaixe integral no celular, sem rolagem */
@media (max-width: 700px) {
  .rv-foto-direto-fundo {
    align-items: center !important;
    justify-content: center !important;
    padding: 10px !important;
    overflow: hidden !important;
  }
  .rv-foto-direto-modal {
    width: min(100%, 520px) !important;
    max-width: 520px !important;
    height: auto !important;
    max-height: calc(100dvh - 20px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 12px !important;
    border-radius: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }
  .rv-foto-direto-modal .modal-header {
    margin-bottom: 7px !important;
    gap: 6px !important;
  }
  .rv-foto-direto-modal .modal-header h2 {
    font-size: 21px !important;
    line-height: 1.08 !important;
    margin: 0 0 2px !important;
  }
  .rv-foto-direto-modal .modal-header p {
    font-size: 13px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
  }
  .rv-foto-direto-modal .botao-fechar {
    width: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    height: 40px !important;
    padding: 0 !important;
  }
  .rv-foto-direto-etapas {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
    margin: 0 0 7px !important;
  }
  .rv-foto-direto-etapa {
    min-height: 48px !important;
    padding: 6px 7px !important;
    border-radius: 12px !important;
    grid-template-columns: 22px minmax(0, 1fr) !important;
    column-gap: 5px !important;
  }
  .rv-foto-direto-etapa > span {
    width: 22px !important;
    height: 22px !important;
    font-size: 12px !important;
  }
  .rv-foto-direto-etapa strong {
    font-size: 11px !important;
    line-height: 1.05 !important;
  }
  .rv-foto-direto-etapa small {
    font-size: 8.5px !important;
    line-height: 1.05 !important;
  }
  .rv-foto-direto-preview {
    height: clamp(110px, 17dvh, 170px) !important;
    aspect-ratio: auto !important;
    margin-bottom: 7px !important;
    border-radius: 13px !important;
  }
  .rv-foto-direto-bloco {
    padding: 8px 10px !important;
    border-radius: 13px !important;
  }
  .rv-foto-direto-bloco .ficha-secao-header {
    margin-bottom: 5px !important;
  }
  .rv-foto-direto-bloco .ficha-secao-header h3 {
    font-size: 14px !important;
    margin: 0 0 2px !important;
  }
  .rv-foto-direto-bloco .ficha-secao-subtitulo {
    font-size: 10px !important;
    line-height: 1.15 !important;
    margin: 0 !important;
  }
  .rv-foto-direto-bloco select {
    min-height: 44px !important;
    height: 44px !important;
    padding: 8px 11px !important;
    font-size: 15px !important;
  }
  .rv-foto-direto-progresso {
    margin-top: 6px !important;
  }
  .rv-foto-direto-acoes {
    margin-top: 7px !important;
    gap: 7px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }
  .rv-foto-direto-acoes .botao-secundario,
  .rv-foto-direto-acoes .botao-principal {
    width: 100% !important;
    min-height: 44px !important;
    height: 44px !important;
    padding: 8px 10px !important;
    font-size: 15px !important;
  }
  .rv-foto-direto-modal > .erro {
    margin-top: 6px !important;
    padding: 7px 9px !important;
    font-size: 11px !important;
  }
}
