/*
 * style.css — Bootstrap 5.3.3
 * Regras exclusivamente estéticas — zero override de navbar,
 * zero z-index manual, zero position tricks.
 * Bootstrap gerencia collapse, dropdowns e sticky-top nativamente.
 */

:root {
  --app-dark:   #1a3a5c;
  --app-mid:    #274e7a;
  --app-lt:     #3a6ea8;
  --app-bg:     #eef3fa;
  --app-border: #d0d9e6;
}

/* ── Base ── */
body { background: #f0f4f8; font-size: 15px; }

/* ── Navbar: apenas cor e sombra ── */
.bg-app {
  background: linear-gradient(135deg, var(--app-dark) 0%, var(--app-lt) 100%) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.nav-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  font-weight: 800; font-size: 13px; color: #fff;
  flex-shrink: 0;
}

/* ── Cards ── */
.card { border-color: var(--app-border); border-radius: 10px; }
.card-header {
  background: #fff; border-bottom: 2px solid var(--app-bg);
  padding: .65rem 1.1rem;
}
.card-header h5, .card-header h6 { margin: 0; font-weight: 700; color: var(--app-dark); }

/* ── Tabelas ── */
.table { font-size: 13.5px; }
.table thead th {
  background: var(--app-mid); color: #fff; border: none;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .3px; white-space: nowrap;
}
.table > :not(caption) > * > * { padding: .5rem .75rem; }
.table-hover > tbody > tr:hover > * { background-color: var(--app-bg); }

/* ── Formulários — font-size 16px evita zoom automático iOS ── */
.form-label { font-weight: 600; font-size: 13px; color: #4a5568; margin-bottom: 3px; }
.form-control, .form-select { font-size: 16px; border-color: var(--app-border); }
.form-control:focus, .form-select:focus {
  border-color: var(--app-lt);
  box-shadow: 0 0 0 .2rem rgba(58,110,168,.18);
}
.form-text { font-size: 11.5px; }

/* ── Paginação ── */
.pagination .page-link { color: var(--app-lt); }
.pagination .page-item.active .page-link { background: var(--app-mid); border-color: var(--app-mid); }

/* ── Flash ── */
#flash-msg { animation: fadein .3s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ── Seções ── */
.section-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--app-mid);
  border-bottom: 2px solid var(--app-bg);
  padding-bottom: 3px; margin: 1.1rem 0 .6rem;
}
.section-label:first-child { margin-top: 0; }

/* ── Info list (ficha) ── */
.info-list dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: #888; }
.info-list dd { font-size: 14px; margin-bottom: .65rem; }

/* ── Stat cards ── */
.stat-card { transition: transform .15s, box-shadow .15s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.1) !important; }
.stat-icon  { font-size: 2rem; }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--app-lt); }
.stat-label { font-size: 12px; color: #6c757d; }

/* ── Avatar mini (lista) ── */
.member-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--app-border);
  flex-shrink: 0; display: block;
}
.member-avatar-ph {
  width: 36px; height: 36px; border-radius: 50%;
  background: #dde5f0; display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0; line-height: 1;
}

/* ── Foto grande (ficha) ── */
.member-photo {
  width: 96px; height: 96px; border-radius: 10px;
  object-fit: cover; border: 3px solid var(--app-border);
  flex-shrink: 0; display: block;
}
.member-photo-ph {
  width: 96px; height: 96px; border-radius: 10px;
  background: #dde5f0; border: 3px solid var(--app-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.8rem; flex-shrink: 0;
}
@media (max-width: 575.98px) {
  .member-photo, .member-photo-ph { width: 68px; height: 68px; font-size: 2rem; }
}

/* ── Upload de foto ── */
.foto-box {
  width: 130px; height: 130px;
  border-radius: 10px; border: 2px dashed var(--app-border);
  background: #f8f9fa; overflow: hidden; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: border-color .2s;
}
.foto-box:hover { border-color: var(--app-lt); }
.foto-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-ph {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; color: #adb5bd; text-align: center; padding: 10px;
}
.foto-ph .bi { font-size: 2rem; }
.foto-ph span { font-size: 11px; line-height: 1.4; }
@media (max-width: 575.98px) { .foto-box { width: 96px; height: 96px; } }

/* ──────────────────────────────────────────────────────────────
   GRID DE FOTOS (membros)
   Usa CSS Grid nativo com aspect-ratio no img-wrap.
   aspect-ratio é suportado em todos os browsers modernos desde 2021.
   NÃO usa padding-top hack nem position:absolute.
   NÃO tem duplo overflow:hidden (o photo-card não usa classe .card).
   ────────────────────────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
@media (min-width: 480px)  { .photo-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); } }
@media (min-width: 768px)  { .photo-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); } }
@media (min-width: 1024px) { .photo-grid { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); } }

.photo-card {
  background: #fff; border: 1px solid var(--app-border);
  border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column;
  cursor: pointer; transition: box-shadow .15s;
}
.photo-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.13); }

/* Quadro 1:1 sem position tricks */
.photo-img-wrap {
  aspect-ratio: 1 / 1;
  overflow: hidden; background: #dde5f0;
  display: flex; align-items: center; justify-content: center;
}
.photo-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-img-ph { font-size: 3rem; line-height: 1; }

.photo-card-body { padding: 7px 9px; flex: 1; }
.photo-card-name {
  font-size: 12px; font-weight: 700; color: var(--app-dark); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.photo-card-sub { font-size: 10.5px; color: #6c757d; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.photo-card-actions { display: flex; border-top: 1px solid #eff0f1; flex-shrink: 0; }
.photo-card-actions a {
  flex: 1; text-align: center; padding: 7px 3px;
  color: #6c757d; font-size: 14px; text-decoration: none;
  transition: background .1s, color .1s;
}
.photo-card-actions a:hover { background: var(--app-bg); color: var(--app-dark); }

/* ── Toggle lista/fotos ── */
.view-btn { padding: 4px 10px; }

/* ── Login ── */
.login-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--app-dark) 0%, var(--app-lt) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem 1rem;
}

/* ── Thumb de arquivo (atas + membros) ── */
.file-thumb {
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: 6px; overflow: hidden;
  border: 1px solid var(--app-border);
  display: flex; align-items: center; justify-content: center;
  background: #f8f9fa;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-thumb-pdf { background: #fff0f0; border-color: #ffc9c9; }
.file-thumb-pdf .bi { font-size: 22px; color: #dc3545; }

/* ── Badge restrito ── */
.badge-lock { background: #f3e5f5; color: #7b1fa2; font-size: 10px; }

/* ── Misc ── */
.min-w-0 { min-width: 0; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
