/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --azul:    #0D1B2A;
  --azul2:   #1a2e45;
  --dourado: #C9A227;
  --dourado2:#e8bc3a;
  --branco:  #FFFFFF;
  --cinza:   #E5E5E5;
  --cinza2:  #f7f7f7;
  --texto:   #2c2c2c;
  --sombra:  0 4px 24px rgba(13,27,42,.15);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--cinza2);
  color: var(--texto);
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Playfair Display', serif; }

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

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

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--azul);
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
  min-height: 64px;
}

.navbar-logo {
  display: flex; align-items: center; gap: .7rem;
  text-decoration: none;
}

.navbar-logo .logo-mark {
  width: 42px; height: 42px;
  background: var(--dourado);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; font-weight: 700;
  color: var(--azul);
  letter-spacing: -1px;
}

.navbar-logo span {
  color: var(--branco);
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
}

.navbar-logo span em {
  color: var(--dourado);
  font-style: normal;
}

.nav-links {
  display: flex; gap: 1.8rem; list-style: none;
}

.nav-links a {
  color: var(--cinza);
  font-size: .88rem;
  letter-spacing: .5px;
  transition: color .2s;
}

.nav-links a:hover, .nav-links a.active { color: var(--dourado); }

.nav-btn {
  background: var(--dourado);
  color: var(--azul) !important;
  padding: .45rem 1.2rem;
  border-radius: 20px;
  font-weight: 600;
  transition: background .2s !important;
}

.nav-btn:hover { background: var(--dourado2) !important; }

.hamburger {
  display: none;
  flex-direction: column; gap: 5px; cursor: pointer;
}

.hamburger span {
  width: 24px; height: 2px;
  background: var(--branco);
  border-radius: 2px;
  transition: .3s;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul2) 60%, #0a2540 100%);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 3rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url('/portal-familia/public/assets/images/hero-bg.jpg') center/cover no-repeat;
  opacity: .12;
}

.hero-content { position: relative; z-index: 1; max-width: 700px; }

.hero-badge {
  display: inline-block;
  border: 1px solid var(--dourado);
  color: var(--dourado);
  font-size: .78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: .35rem 1rem;
  border-radius: 20px;
  margin-bottom: 1.2rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--branco);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero h1 span { color: var(--dourado); }

.hero p {
  color: rgba(255,255,255,.75);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

/* ===== CONTADOR ===== */
.countdown {
  display: flex; gap: 1rem; justify-content: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.countdown-item {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(201,162,39,.3);
  border-radius: 12px;
  padding: 1rem 1.4rem;
  min-width: 80px;
  text-align: center;
}

.countdown-item .num {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  color: var(--dourado);
  line-height: 1;
}

.countdown-item .label {
  font-size: .7rem;
  color: rgba(255,255,255,.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: .3rem;
}

.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 2rem;
  border-radius: 30px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .25s;
}

.btn-primary {
  background: var(--dourado);
  color: var(--azul);
}

.btn-primary:hover { background: var(--dourado2); transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  border: 2px solid rgba(255,255,255,.4);
  color: var(--branco);
}

.btn-outline:hover { border-color: var(--dourado); color: var(--dourado); }

/* ===== SECTIONS ===== */
.section { padding: 5rem 1.5rem; }

.section-header { text-align: center; margin-bottom: 3rem; }

.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--azul);
  margin-bottom: .5rem;
}

.section-header p { color: #666; font-size: .95rem; }

.section-divider {
  width: 60px; height: 3px;
  background: var(--dourado);
  margin: .8rem auto 0;
  border-radius: 2px;
}

/* ===== DEPOIMENTOS ===== */
.depoimentos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1100px; margin: 0 auto;
}

.card-depoimento {
  background: var(--branco);
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: var(--sombra);
  border-top: 3px solid var(--dourado);
  transition: transform .2s;
}

.card-depoimento:hover { transform: translateY(-4px); }

.card-depoimento .quote {
  font-size: 2rem; color: var(--dourado); line-height: 1;
  margin-bottom: .5rem;
}

.card-depoimento p { color: #555; font-size: .92rem; line-height: 1.7; margin-bottom: 1.2rem; }

.card-depoimento .autor {
  display: flex; align-items: center; gap: .8rem;
}

.card-depoimento .autor img {
  width: 40px; height: 40px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--dourado);
}

.card-depoimento .autor .avatar-placeholder {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--azul);
  display: flex; align-items: center; justify-content: center;
  color: var(--dourado);
  font-weight: 700; font-size: .9rem;
}

.card-depoimento .autor-info strong { display: block; font-size: .88rem; color: var(--azul); }
.card-depoimento .autor-info span { font-size: .78rem; color: #999; }

/* ===== GALERIA ===== */
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 1100px; margin: 0 auto;
}

.galeria-item {
  position: relative; border-radius: 12px; overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
}

.galeria-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s;
}

.galeria-item:hover img { transform: scale(1.08); }

.galeria-item .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,27,42,.85) 0%, transparent 60%);
  opacity: 0; transition: opacity .3s;
  display: flex; align-items: flex-end; padding: 1rem;
}

.galeria-item:hover .overlay { opacity: 1; }

.galeria-item .overlay span { color: var(--branco); font-size: .85rem; }

/* ===== EVENTOS ===== */
.eventos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1100px; margin: 0 auto;
}

.card-evento {
  background: var(--branco);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--sombra);
  transition: transform .2s;
}

.card-evento:hover { transform: translateY(-4px); }

.card-evento-img {
  height: 180px; background: var(--azul2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.card-evento-img img { width: 100%; height: 100%; object-fit: cover; }

.card-evento-img .icon-placeholder {
  font-size: 3rem; color: var(--dourado);
}

.card-evento-body { padding: 1.4rem; }

.card-evento-body h3 { color: var(--azul); margin-bottom: .4rem; font-size: 1.1rem; }

.card-evento-body .meta {
  display: flex; gap: 1rem; flex-wrap: wrap;
  font-size: .82rem; color: #777; margin-bottom: 1rem;
}

.card-evento-body .meta span { display: flex; align-items: center; gap: .3rem; }

.btn-sm {
  padding: .45rem 1.2rem;
  font-size: .85rem;
  border-radius: 20px;
}

/* ===== ÁRVORE GENEALÓGICA ===== */
.arvore-container {
  max-width: 1100px; margin: 0 auto;
  overflow-x: auto;
}

.tree { display: flex; flex-direction: column; align-items: center; }

.tree ul {
  display: flex; flex-wrap: wrap; justify-content: center;
  padding-top: 20px; position: relative; gap: 1rem;
  list-style: none;
}

.tree ul::before {
  content: '';
  position: absolute; top: 0; left: 50%;
  border-left: 2px solid var(--dourado);
  height: 20px;
}

.tree li {
  display: flex; flex-direction: column; align-items: center;
  position: relative; padding: 20px 10px 0;
}

.tree li::before, .tree li::after {
  content: '';
  position: absolute; top: 0;
  border-top: 2px solid var(--dourado);
  width: 50%; height: 20px;
}

.tree li::before { right: 50%; border-right: 2px solid var(--dourado); }
.tree li::after  { left: 50%;  border-left:  2px solid var(--dourado); }
.tree li:only-child::before, .tree li:only-child::after { display: none; }
.tree li:only-child { padding-top: 0; }
.tree li:first-child::before, .tree li:last-child::after { border: none; }

.tree-node {
  background: var(--branco);
  border: 2px solid var(--dourado);
  border-radius: 12px;
  padding: .8rem 1.2rem;
  text-align: center;
  min-width: 120px;
  box-shadow: var(--sombra);
  cursor: pointer;
  transition: background .2s;
}

.tree-node:hover { background: var(--azul); color: var(--branco); }
.tree-node:hover .node-name { color: var(--dourado); }

.tree-node .node-name { font-weight: 600; font-size: .88rem; color: var(--azul); }
.tree-node .node-year { font-size: .75rem; color: #999; }

/* ===== EMPRESAS ===== */
.empresas-carousel {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  justify-content: center; max-width: 1100px; margin: 0 auto;
}

.empresa-card {
  background: var(--branco);
  border-radius: 12px;
  padding: .9rem 1.4rem;
  box-shadow: var(--sombra);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s;
  min-width: 120px;
  max-width: 160px;
  height: 70px;
  position: relative;
}

.empresa-card img {
  max-height: 44px;
  max-width: 120px;
  object-fit: contain;
  filter: grayscale(20%);
  transition: filter .2s, transform .2s;
}

.empresa-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(13,27,42,.15); }
.empresa-card:hover img { filter: grayscale(0%); transform: scale(1.05); }

/* Tooltip nativo via title — reforço visual */
.empresa-card::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%; transform: translateX(-50%);
  background: var(--azul);
  color: var(--dourado);
  font-size: .72rem;
  font-weight: 600;
  padding: .3rem .7rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 10;
}

.empresa-card::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%; transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--azul);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 10;
}

.empresa-card:hover::after,
.empresa-card:hover::before { opacity: 1; }

/* ===== FOOTER ===== */
footer {
  background: var(--azul);
  color: rgba(255,255,255,.6);
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: .85rem;
}

footer .footer-logo {
  font-family: 'Playfair Display', serif;
  color: var(--dourado);
  font-size: 1.3rem;
  margin-bottom: .5rem;
}

/* ===== FORMS ===== */
.form-card {
  background: var(--branco);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: var(--sombra);
  max-width: 480px; margin: 0 auto;
}

.form-card h2 { color: var(--azul); margin-bottom: 1.5rem; text-align: center; }

.form-group { margin-bottom: 1.2rem; }

.form-group label {
  display: block; font-size: .85rem;
  color: #555; margin-bottom: .4rem; font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: .9rem;
  transition: border-color .2s;
  background: var(--cinza2);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--dourado);
  background: var(--branco);
}

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

.alert {
  padding: .8rem 1rem;
  border-radius: 8px;
  font-size: .88rem;
  margin-bottom: 1rem;
}

.alert-danger  { background: #fde8e8; color: #c0392b; border: 1px solid #f5c6c6; }
.alert-success { background: #e8f8f0; color: #1e8449; border: 1px solid #a9dfbf; }

/* ===== DASHBOARD ===== */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 64px);
  margin-top: 64px;
  align-items: start;
}

.sidebar {
  background: var(--azul);
  padding: 1.5rem 1rem;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  z-index: 100;
  order: 1;
}

.dashboard-main {
  padding: 2rem 2.5rem;
  background: var(--cinza2);
  min-width: 0;
  order: 2;
  min-height: calc(100vh - 64px);
}

.sidebar-profile {
  text-align: center; margin-bottom: 1.8rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-profile img,
.sidebar-profile .avatar {
  width: 72px; height: 72px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid var(--dourado);
  margin: 0 auto .7rem;
  display: block;
}

.sidebar-profile .avatar {
  background: var(--azul2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: var(--dourado);
}

.sidebar-profile strong { color: var(--branco); display: block; font-size: .95rem; }
.sidebar-profile span  { color: rgba(255,255,255,.45); font-size: .78rem; }

.sidebar-nav { list-style: none; }

.sidebar-nav li a {
  display: flex; align-items: center; gap: .75rem;
  color: rgba(255,255,255,.65);
  padding: .72rem 1rem;
  border-radius: 10px;
  font-size: .875rem;
  transition: all .2s;
  text-decoration: none;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  background: rgba(201,162,39,.18);
  color: var(--dourado);
}

.sidebar-nav li a i { width: 18px; text-align: center; }

.sidebar-section {
  padding: .8rem 1rem .3rem;
  font-size: .68rem;
  color: rgba(255,255,255,.28);
  text-transform: uppercase;
  letter-spacing: 1.8px;
}

.dashboard-main {
  padding: 2rem 2.5rem;
  background: var(--cinza2);
  overflow-y: auto;
  min-width: 0;
}

.dashboard-main h1 {
  font-size: 1.6rem; color: var(--azul); margin-bottom: .3rem;
}

.page-subtitle {
  color: #888; font-size: .88rem; margin-bottom: 1.8rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}

.stat-card {
  background: var(--branco);
  border-radius: 14px;
  padding: 1.3rem;
  box-shadow: var(--sombra);
  text-align: center;
  border-bottom: 3px solid var(--dourado);
}

.stat-card .stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 2rem; color: var(--dourado);
}

.stat-card .stat-label { font-size: .78rem; color: #777; margin-top: .3rem; }

/* ===== ADMIN TABLE ===== */
.admin-table {
  width: 100%; border-collapse: collapse;
  background: var(--branco);
  border-radius: 14px; overflow: hidden;
  box-shadow: var(--sombra);
}

.admin-table th {
  background: var(--azul);
  color: var(--dourado);
  padding: .9rem 1rem;
  text-align: left; font-size: .82rem;
  font-weight: 600; letter-spacing: .3px;
}

.admin-table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--cinza);
  font-size: .875rem;
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafafa; }

.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .73rem; font-weight: 600;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger  { background: #f8d7da; color: #721c24; }
.badge-info    { background: #d1ecf1; color: #0c5460; }

/* Painel box */
.admin-box {
  background: var(--branco);
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: var(--sombra);
  margin-bottom: 1.8rem;
}

.admin-box h3 {
  color: var(--azul);
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: .6rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--cinza);
}

.admin-box h3 i { color: var(--dourado); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .dashboard-main { padding: 1.5rem; }
}

@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--azul); padding: 1rem 2rem; gap: 1rem; }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .countdown { gap: .6rem; }
  .countdown-item { min-width: 65px; padding: .7rem .9rem; }
  .countdown-item .num { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.8rem; }
  .form-card { padding: 1.5rem; }
}

/* ===== ANIVERSARIANTES ===== */
.aniversariantes-section {
  background: linear-gradient(135deg, #fff8e7 0%, #fffdf5 100%);
  border-top: 3px solid var(--dourado);
}

.aniversariantes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 1100px; margin: 0 auto;
}

.card-aniversariante {
  background: var(--branco);
  border-radius: 20px;
  box-shadow: var(--sombra);
  overflow: hidden;
  transition: transform .25s;
  border: 1px solid rgba(201,162,39,.2);
}

.card-aniversariante:hover { transform: translateY(-5px); }

.card-aniv-header {
  background: linear-gradient(135deg, var(--azul) 0%, var(--azul2) 100%);
  padding: 1.8rem 1.5rem 1rem;
  text-align: center;
  position: relative;
}

.card-aniv-header::after {
  content: '🎂';
  position: absolute; top: .8rem; right: 1rem;
  font-size: 1.4rem;
}

.card-aniv-foto {
  width: 90px; height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--dourado);
  margin: 0 auto .8rem;
  display: block;
}

.card-aniv-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: rgba(201,162,39,.2);
  border: 4px solid var(--dourado);
  margin: 0 auto .8rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; color: var(--dourado);
}

.card-aniv-header h3 {
  color: var(--branco);
  font-size: 1.05rem;
  margin-bottom: .3rem;
}

.card-aniv-data {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(201,162,39,.2);
  color: var(--dourado);
  font-size: .8rem;
  padding: .25rem .8rem;
  border-radius: 20px;
  font-weight: 600;
}

.card-aniv-body { padding: 1.2rem; }

/* Mensagens de felicitações */
.felicitacoes-lista {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 1rem;
  display: flex; flex-direction: column; gap: .6rem;
}

.felicitacoes-lista::-webkit-scrollbar { width: 4px; }
.felicitacoes-lista::-webkit-scrollbar-thumb { background: var(--dourado); border-radius: 4px; }

.msg-feliz {
  background: var(--cinza2);
  border-radius: 10px;
  padding: .6rem .9rem;
  font-size: .83rem;
}

.msg-feliz .msg-autor {
  font-weight: 600; color: var(--azul);
  font-size: .78rem; margin-bottom: .2rem;
  display: flex; align-items: center; gap: .4rem;
}

.msg-feliz .msg-autor img {
  width: 22px; height: 22px;
  border-radius: 50%; object-fit: cover;
}

.msg-feliz .msg-autor .av-mini {
  width: 22px; height: 22px;
  border-radius: 50%; background: var(--azul);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--dourado); font-size: .65rem; font-weight: 700;
}

.msg-feliz p { color: #444; line-height: 1.5; }

/* Form felicitação */
.form-feliz {
  display: flex; flex-direction: column; gap: .6rem;
}

.form-feliz textarea {
  width: 100%;
  padding: .6rem .8rem;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: .85rem;
  resize: none;
  min-height: 70px;
  transition: border-color .2s;
}

.form-feliz textarea:focus { outline: none; border-color: var(--dourado); }

/* Emojis picker */
.emoji-bar {
  display: flex; flex-wrap: wrap; gap: .3rem;
  margin-bottom: .3rem;
}

.emoji-btn {
  background: none; border: 1px solid #eee;
  border-radius: 8px; padding: .2rem .4rem;
  font-size: 1.1rem; cursor: pointer;
  transition: background .15s, transform .15s;
  line-height: 1;
}

.emoji-btn:hover { background: #fff3cd; transform: scale(1.2); }

.form-feliz .btn-enviar-feliz {
  align-self: flex-end;
  background: var(--dourado);
  color: var(--azul);
  border: none; border-radius: 20px;
  padding: .45rem 1.2rem;
  font-size: .83rem; font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}

.form-feliz .btn-enviar-feliz:hover { background: var(--dourado2); }

.sem-aniversariantes {
  text-align: center; color: #aaa;
  padding: 3rem; font-size: .95rem;
  grid-column: 1/-1;
}

.badge-mes {
  display: inline-block;
  background: var(--dourado);
  color: var(--azul);
  font-size: .75rem; font-weight: 700;
  padding: .2rem .7rem;
  border-radius: 20px;
  margin-left: .5rem;
  vertical-align: middle;
}

/* Alerta flutuante de sucesso */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 9999;
  background: var(--azul);
  color: var(--branco);
  padding: .9rem 1.5rem;
  border-radius: 12px;
  border-left: 4px solid var(--dourado);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  font-size: .9rem;
  animation: slideIn .3s ease, fadeOut .4s ease 3s forwards;
}

@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(120%); } }

/* ===== ÁRVORE COM FOTO ===== */
.tree-node { min-width: 110px; }

.tree-node-foto {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--dourado);
  display: block;
  margin: 0 auto .4rem;
}

.tree-node-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--cinza2);
  border: 2px solid var(--dourado);
  display: flex; align-items: center; justify-content: center;
  color: var(--dourado); font-size: 1.2rem;
  margin: 0 auto .4rem;
}

.tree-node:hover .tree-node-avatar { background: var(--azul2); }

/* ===== MENSAGENS ===== */
.mensagens-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  background: var(--branco);
  border-radius: 16px;
  box-shadow: var(--sombra);
  overflow: hidden;
  min-height: 520px;
}

.msg-sidebar {
  border-right: 1px solid var(--cinza);
  overflow-y: auto;
}

.msg-sidebar-header {
  padding: 1rem 1.2rem;
  background: var(--azul);
  color: var(--dourado);
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
}

.contato-item {
  display: flex; align-items: center; gap: .8rem;
  padding: .9rem 1.2rem;
  cursor: pointer;
  border-bottom: 1px solid var(--cinza);
  transition: background .15s;
}

.contato-item:hover, .contato-item.active { background: #fff8e7; }

.contato-avatar {
  width: 42px; height: 42px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--dourado);
  flex-shrink: 0;
}

.contato-avatar-placeholder {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--azul);
  display: flex; align-items: center; justify-content: center;
  color: var(--dourado); font-weight: 700; font-size: .9rem;
  flex-shrink: 0;
}

.contato-info { flex: 1; min-width: 0; }
.contato-info strong { display: block; font-size: .88rem; color: var(--azul); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contato-info span { font-size: .75rem; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

.badge-nao-lida {
  background: var(--dourado);
  color: var(--azul);
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700;
  flex-shrink: 0;
}

.msg-chat {
  display: flex; flex-direction: column;
}

.msg-chat-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--cinza);
  display: flex; align-items: center; gap: .8rem;
  background: var(--cinza2);
}

.msg-chat-header strong { color: var(--azul); font-size: .95rem; }

.msg-chat-body {
  flex: 1;
  padding: 1.2rem;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: .8rem;
  max-height: 380px;
}

.msg-balao {
  max-width: 70%;
  padding: .65rem 1rem;
  border-radius: 16px;
  font-size: .88rem;
  line-height: 1.5;
  position: relative;
}

.msg-balao.enviada {
  background: var(--azul);
  color: var(--branco);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.msg-balao.recebida {
  background: var(--cinza2);
  color: var(--texto);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg-balao .msg-hora {
  font-size: .68rem;
  opacity: .6;
  display: block;
  margin-top: .3rem;
  text-align: right;
}

.msg-chat-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--cinza);
  display: flex; gap: .7rem; align-items: flex-end;
}

.msg-chat-footer textarea {
  flex: 1;
  padding: .65rem .9rem;
  border: 1.5px solid #ddd;
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: .88rem;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  transition: border-color .2s;
}

.msg-chat-footer textarea:focus { outline: none; border-color: var(--dourado); }

.msg-chat-footer button {
  background: var(--dourado);
  color: var(--azul);
  border: none;
  border-radius: 12px;
  padding: .65rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background .2s;
  flex-shrink: 0;
}

.msg-chat-footer button:hover { background: var(--dourado2); }

.msg-vazia {
  flex: 1; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: .5rem; color: #bbb;
}

.msg-vazia i { font-size: 2.5rem; }

.badge-msg-nav {
  background: var(--dourado);
  color: var(--azul);
  border-radius: 10px;
  padding: .1rem .45rem;
  font-size: .7rem;
  font-weight: 700;
  margin-left: .4rem;
}

@media (max-width: 600px) {
  .mensagens-layout { grid-template-columns: 1fr; }
  .msg-sidebar { max-height: 200px; }
}

/* ===== ADMIN QUICK CARDS ===== */
.admin-quick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .3rem;
  background: var(--branco);
  border-radius: 14px;
  padding: 1.3rem 1.4rem;
  box-shadow: var(--sombra);
  text-decoration: none;
  color: var(--texto);
  border-left: 4px solid var(--dourado);
  transition: transform .2s, box-shadow .2s;
}

.admin-quick-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(13,27,42,.18);
}

.admin-quick-card i {
  font-size: 1.5rem;
  color: var(--dourado);
  margin-bottom: .2rem;
}

.admin-quick-card span {
  font-weight: 600;
  color: var(--azul);
  font-size: .92rem;
}

.admin-quick-card small {
  font-size: .75rem;
  color: #999;
}

.admin-quick-alert {
  border-left-color: #e67e22;
  background: #fffaf5;
}

.admin-quick-alert i { color: #e67e22; }

/* Stat card clicável */
.stat-card[onclick] { cursor: pointer; transition: transform .2s; }
.stat-card[onclick]:hover { transform: translateY(-3px); }

/* Sidebar label de seção */
.sidebar-section-label {
  padding: .4rem 1rem;
  font-size: .7rem;
  color: rgba(255,255,255,.3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 1.2rem;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.92);
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: 8px; box-shadow: 0 0 40px rgba(0,0,0,.5); }
.lightbox-close { position: absolute; top: 1.5rem; right: 1.5rem; color: var(--branco); font-size: 2rem; cursor: pointer; background: none; border: none; }

/* ===== SELETOR DE MESES ===== */
.meses-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  max-width: 900px;
  margin: 0 auto 2.5rem;
}

.mes-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  padding: .55rem .9rem;
  border-radius: 12px;
  background: var(--branco);
  border: 1.5px solid var(--cinza);
  color: #888;
  font-size: .78rem;
  font-weight: 500;
  text-decoration: none;
  transition: all .2s;
  min-width: 52px;
  cursor: pointer;
}

.mes-btn:hover {
  border-color: var(--dourado);
  color: var(--dourado);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201,162,39,.15);
}

.mes-btn--atual {
  border-color: rgba(201,162,39,.4);
  color: var(--dourado);
  background: #fffdf5;
}

.mes-btn--ativo {
  background: var(--azul);
  border-color: var(--azul);
  color: var(--dourado) !important;
  box-shadow: 0 4px 16px rgba(13,27,42,.2);
}

.mes-btn--ativo .mes-nome { color: var(--dourado); }

.mes-nome {
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .3px;
}

.mes-count {
  background: var(--dourado);
  color: var(--azul);
  border-radius: 10px;
  font-size: .65rem;
  font-weight: 700;
  padding: .05rem .4rem;
  line-height: 1.4;
}

.mes-btn--ativo .mes-count {
  background: var(--dourado);
  color: var(--azul);
}

@media (max-width: 600px) {
  .mes-btn { min-width: 44px; padding: .45rem .6rem; font-size: .72rem; }
  .mes-nome { font-size: .72rem; }
}
