:root {
  --bg: #eef3f8;
  --card: #ffffff;
  --text: #122033;
  --muted: #67758a;
  --primary: #153969;
  --primary-2: #0f2b4f;
  --success: #e8fff2;
  --success-text: #12653b;
  --error: #fff1f1;
  --error-text: #9d2222;
  --border: #d9e2ec;
  --shadow: 0 12px 35px rgba(12, 24, 44, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

/* =========================
   TOPO
   ========================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px;
  background: linear-gradient(180deg, rgba(238, 243, 248, 0.98), rgba(238, 243, 248, 0.92));
  backdrop-filter: blur(8px);
}

.topbar-main {
  min-width: 0;
  flex: 1 1 320px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.1;
  color: var(--primary);
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

/* =========================
   NAVEGAÇÃO
   ========================= */

.nav-wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 18px;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bottom-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 10px 12px;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.2;
  color: var(--primary);
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(12, 24, 44, 0.04);
  transition: all 0.18s ease;
}

.bottom-nav a:hover {
  background: #f7fafc;
  border-color: #c8d5e4;
  transform: translateY(-1px);
}

.bottom-nav a:active {
  transform: translateY(0);
}

/* =========================
   CONTAINER / CARDS
   ========================= */

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(217, 226, 236, 0.7);
}

.card h2,
.card h3 {
  margin: 0 0 10px;
  color: var(--primary);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

/* =========================
   GRID
   ========================= */

.grid {
  display: grid;
  gap: 14px;
}

.grid-2 {
  grid-template-columns: 1fr;
}

.grid-3 {
  grid-template-columns: 1fr;
}

.kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kpi {
  background: linear-gradient(180deg, #fff, #f8fbff);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.kpi .label {
  color: var(--muted);
  font-size: 0.82rem;
}

.kpi .value {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 6px;
  color: var(--primary);
}

/* =========================
   TABELAS
   ========================= */

.table-wrap {
  overflow: auto;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.92rem;
  vertical-align: top;
}

th {
  background: #f7fafc;
  color: var(--primary);
  font-weight: 700;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* =========================
   FORMULÁRIOS
   ========================= */

form .grid {
  margin-top: 10px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 1rem;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #9fb7d7;
  box-shadow: 0 0 0 3px rgba(21, 57, 105, 0.08);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #98a5b7;
}

/* =========================
   BOTÕES
   ========================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-2);
}

.btn-light {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn-light:hover {
  background: #f7fafc;
}

.btn-danger {
  background: #9d2222;
  color: #fff;
}

.btn-danger:hover {
  background: #821c1c;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* =========================
   ALERTAS / TEXTOS
   ========================= */

.alert {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 12px;
  font-weight: 700;
}

.alert.success {
  background: var(--success);
  color: var(--success-text);
}

.alert.error {
  background: var(--error);
  color: var(--error-text);
}

.muted {
  color: var(--muted);
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}

.badge.alta,
.badge.critica,
.badge.atrasado {
  background: #ffe7e7;
  color: #9d2222;
}

.badge.media,
.badge.em-andamento {
  background: #fff5df;
  color: #946200;
}

.badge.baixa,
.badge.concluido {
  background: #e8fff2;
  color: #12653b;
}

/* =========================
   LOGIN
   ========================= */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: min(100%, 460px);
}

/* =========================
   RELATÓRIO FOTOGRÁFICO
   ========================= */

.report-shell,
.report-page,
.relatorio-page,
.relatorio-fotografico-page {
  width: 100%;
}

.report-card,
.relatorio-card,
.relatorio-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.report-header-grid,
.relatorio-header-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.report-meta-box,
.relatorio-meta-box,
.report-summary-box,
.relatorio-summary-box {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 16px 18px;
}

.report-meta-box h3,
.relatorio-meta-box h3,
.report-summary-box h3,
.relatorio-summary-box h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--primary);
  font-weight: 800;
}

.report-meta-list,
.relatorio-meta-list {
  display: grid;
  gap: 10px;
}

.report-meta-item,
.relatorio-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-meta-item strong,
.relatorio-meta-item strong {
  color: var(--primary);
  font-size: 0.9rem;
}

.report-meta-item span,
.relatorio-meta-item span,
.report-summary-text,
.relatorio-summary-text {
  color: var(--text);
  line-height: 1.6;
  font-size: 0.95rem;
}

.report-section-title,
.relatorio-section-title {
  margin: 0 0 16px;
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 800;
}

.report-summary,
.relatorio-summary {
  line-height: 1.7;
  color: var(--text);
  font-size: 0.96rem;
}

/* =========================
   GALERIA FOTOGRÁFICA
   Compatível com vários nomes de classe
   ========================= */

.photo-grid,
.photos-grid,
.gallery-grid,
.galeria-grid,
.relatorio-fotos-grid,
.relatorio-photo-grid,
.report-photo-grid,
.report-gallery-grid,
.galeria-fotografica-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
}

.photo-card,
.photo-item,
.gallery-card,
.galeria-card,
.relatorio-foto-card,
.report-photo-card,
.report-gallery-card,
.galeria-fotografica-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 10px 26px rgba(12, 24, 44, 0.05);
}

.photo-card:hover,
.photo-item:hover,
.gallery-card:hover,
.galeria-card:hover,
.relatorio-foto-card:hover,
.report-photo-card:hover,
.report-gallery-card:hover,
.galeria-fotografica-card:hover {
  transform: translateY(-1px);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 14px 30px rgba(12, 24, 44, 0.08);
}

.photo-thumb,
.photo-image,
.gallery-image,
.galeria-imagem,
.relatorio-foto-imagem,
.report-photo-image,
.report-gallery-image,
.galeria-fotografica-imagem {
  position: relative;
  width: 100%;
  height: 340px;
  overflow: hidden;
  background: #e8edf3;
  border-bottom: 1px solid var(--border);
}

.photo-thumb img,
.photo-image img,
.gallery-image img,
.galeria-imagem img,
.relatorio-foto-imagem img,
.report-photo-image img,
.report-gallery-image img,
.galeria-fotografica-imagem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.photo-body,
.photo-content,
.gallery-body,
.galeria-conteudo,
.relatorio-foto-body,
.report-photo-body,
.report-gallery-body,
.galeria-fotografica-body {
  padding: 18px 18px 20px;
}

.photo-label,
.photo-tag,
.gallery-label,
.galeria-label,
.relatorio-foto-label,
.report-photo-label,
.report-gallery-label,
.galeria-fotografica-label {
  display: inline-block;
  margin: 0 0 12px;
  color: #728bab;
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.photo-description,
.photo-text,
.gallery-description,
.galeria-descricao,
.relatorio-foto-descricao,
.report-photo-description,
.report-gallery-description,
.galeria-fotografica-descricao {
  margin: 0;
  color: #223047;
  font-size: 1rem;
  line-height: 1.65;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* fallback para quando a descrição estiver em p/div sem classe */
.photo-card p,
.photo-item p,
.gallery-card p,
.galeria-card p,
.relatorio-foto-card p,
.report-photo-card p,
.report-gallery-card p,
.galeria-fotografica-card p {
  margin: 0;
  color: #223047;
  font-size: 1rem;
  line-height: 1.65;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* =========================
   SE O HTML DA GALERIA FOR EM UL/LI
   ========================= */

.photo-grid ul,
.photos-grid ul,
.gallery-grid ul,
.galeria-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.photo-grid li,
.photos-grid li,
.gallery-grid li,
.galeria-grid li {
  list-style: none;
}

/* =========================
   BLOCO INTERNO DA SEÇÃO DA GALERIA
   ========================= */

.gallery-section,
.galeria-section,
.report-gallery-section,
.relatorio-gallery-section,
.galeria-fotografica-section {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.gallery-section h2,
.gallery-section h3,
.galeria-section h2,
.galeria-section h3,
.report-gallery-section h2,
.report-gallery-section h3,
.relatorio-gallery-section h2,
.relatorio-gallery-section h3,
.galeria-fotografica-section h2,
.galeria-fotografica-section h3 {
  margin: 0 0 16px;
  color: var(--primary);
}

/* =========================
   RESPONSIVO
   ========================= */

@media (min-width: 640px) {
  .bottom-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .report-header-grid,
  .relatorio-header-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-grid,
  .photos-grid,
  .gallery-grid,
  .galeria-grid,
  .relatorio-fotos-grid,
  .relatorio-photo-grid,
  .report-photo-grid,
  .report-gallery-grid,
  .galeria-fotografica-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .bottom-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .topbar {
    padding: 14px 16px;
    gap: 14px;
  }

  .topbar-main,
  .topbar-actions {
    width: 100%;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .topbar h1 {
    font-size: 1.9rem;
  }

  .chip,
  .topbar-actions .btn {
    min-height: 44px;
  }

  .card {
    padding: 14px;
    border-radius: 16px;
  }

  .row-actions {
    width: 100%;
  }

  .row-actions .btn,
  .row-actions a.btn,
  .row-actions button.btn {
    flex: 1 1 auto;
  }

  .gallery-section,
  .galeria-section,
  .report-gallery-section,
  .relatorio-gallery-section,
  .galeria-fotografica-section {
    padding: 14px;
    border-radius: 18px;
  }

  .photo-thumb,
  .photo-image,
  .gallery-image,
  .galeria-imagem,
  .relatorio-foto-imagem,
  .report-photo-image,
  .report-gallery-image,
  .galeria-fotografica-imagem {
    height: 280px;
  }

  .photo-body,
  .photo-content,
  .gallery-body,
  .galeria-conteudo,
  .relatorio-foto-body,
  .report-photo-body,
  .report-gallery-body,
  .galeria-fotografica-body {
    padding: 16px;
  }

  .photo-description,
  .photo-text,
  .gallery-description,
  .galeria-descricao,
  .relatorio-foto-descricao,
  .report-photo-description,
  .report-gallery-description,
  .galeria-fotografica-descricao {
    font-size: 0.96rem;
  }
}

@media (max-width: 480px) {
  .nav-wrap,
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .bottom-nav {
    gap: 8px;
  }

  .bottom-nav a {
    min-height: 50px;
    padding: 10px;
    font-size: 0.85rem;
    border-radius: 12px;
  }

  .topbar h1 {
    font-size: 1.7rem;
  }

  .topbar-actions {
    flex-direction: row;
    gap: 8px;
  }

  .chip {
    font-size: 0.82rem;
    padding: 0 12px;
  }

  .btn {
    padding: 11px 14px;
    border-radius: 12px;
  }

  input,
  select,
  textarea {
    padding: 11px 12px;
    border-radius: 12px;
  }

  .kpis {
    grid-template-columns: 1fr;
  }

  .photo-thumb,
  .photo-image,
  .gallery-image,
  .galeria-imagem,
  .relatorio-foto-imagem,
  .report-photo-image,
  .report-gallery-image,
  .galeria-fotografica-imagem {
    height: 220px;
  }
}

@media (max-width: 380px) {
  .bottom-nav {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .chip,
  .topbar-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .topbar h1 {
    font-size: 1.5rem;
  }
}