/**
 * Estrela Brilhante - Área Administrativa
 */

:root {
  --admin-sidebar-w: 260px;
  --admin-header-h: 56px;
}

.admin-body {
  display: flex;
  min-height: 100vh;
  background: var(--fundo);
}

.admin-sidebar {
  width: var(--admin-sidebar-w);
  background: var(--texto);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  --logo-size: 65px;
}
.admin-sidebar .logo { color: #fff; padding: 1rem; }
.admin-sidebar .logo img {
  height: var(--logo-size);
  width: auto;
  object-fit: contain;
}
.admin-sidebar .logo:hover { color: var(--dourado); }
.admin-sidebar .logo-text span { color: rgba(255,255,255,0.7); }
.admin-sidebar-header { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-nav {
  flex: 1;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.admin-nav a {
  padding: 0.75rem 1.25rem;
  color: rgba(255,255,255,0.9);
  font-weight: 500;
  transition: background var(--transicao), color var(--transicao);
}
.admin-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.admin-sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.admin-user { font-size: 0.875rem; opacity: 0.9; }
.admin-sidebar-footer .btn { border-color: rgba(255,255,255,0.5); color: #fff; }
.admin-sidebar-footer .btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

.admin-main {
  flex: 1;
  margin-left: var(--admin-sidebar-w);
  min-height: 100vh;
}
.admin-content {
  padding: 1.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.admin-content h1 { margin-bottom: 1rem; font-size: 1.5rem; }
.admin-content h2 { margin: 1.5rem 0 0.75rem; font-size: 1.25rem; }

/* Tabelas e listagens */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--fundo-card);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  overflow: hidden;
}
.admin-table th,
.admin-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--borda); }
.admin-table th { background: var(--fundo); font-weight: 600; font-size: 0.875rem; color: var(--texto-suave); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(46, 125, 50, 0.04); }
.admin-table .actions { white-space: nowrap; }
.admin-table .actions a { margin-right: 0.5rem; font-size: 0.875rem; }

/* Cards de estatísticas */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.admin-stat {
  background: var(--fundo-card);
  padding: 1.25rem;
  border-radius: var(--raio);
  box-shadow: var(--sombra);
}
.admin-stat .num { font-size: 2rem; font-weight: 700; color: var(--verde-principal); line-height: 1.2; }
.admin-stat .label { font-size: 0.875rem; color: var(--texto-suave); margin-top: 0.25rem; }

/* Formulários admin */
.admin-form .form-group { margin-bottom: 1.25rem; }
.admin-form label { display: block; font-weight: 500; margin-bottom: 0.35rem; }
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="date"],
.admin-form input[type="number"],
.admin-form textarea {
  width: 100%;
  max-width: 600px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  background: var(--fundo-card);
}
.admin-form textarea { min-height: 200px; resize: vertical; }
.admin-form input:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--verde-principal);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}
.admin-form .checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.admin-form .checkbox-label input { width: auto; max-width: none; }
.admin-form .preview-img { max-width: 200px; margin-top: 0.5rem; border-radius: var(--raio); }
.admin-form .btn { margin-right: 0.5rem; margin-top: 0.5rem; }

/* Toolbar */
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.admin-toolbar h1 { margin: 0; }

/* Galeria admin */
.admin-fotos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.admin-foto-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--raio);
  overflow: hidden;
  background: var(--borda);
}
.admin-foto-item img { width: 100%; height: 100%; object-fit: cover; }
.admin-foto-item .remove {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 28px;
  height: 28px;
  background: rgba(211, 47, 47, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-foto-item .remove:hover { background: #c62828; }

/* Mensagens contato */
.msg-item { background: var(--fundo-card); padding: 1rem; border-radius: var(--raio); margin-bottom: 1rem; box-shadow: var(--sombra); }
.msg-item.nao-lido { border-left: 4px solid var(--verde-principal); }
.msg-item .meta { font-size: 0.875rem; color: var(--texto-suave); margin-bottom: 0.5rem; }
.msg-item .assunto { font-weight: 600; margin-bottom: 0.5rem; }
.msg-item .mensagem { font-size: 0.9375rem; white-space: pre-wrap; }

@media (max-width: 768px) {
  .admin-body { flex-direction: column; }

  .admin-sidebar {
    width: 100%;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    height: auto;
    flex-direction: column;
    --logo-size: 48px;
  }

  .admin-sidebar-header { padding: 0.75rem 1rem; }

  .admin-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.75rem 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .admin-nav a {
    flex: 0 0 auto;
    padding: 0.65rem 0.9rem;
    white-space: nowrap;
    border-radius: 999px;
  }

  .admin-sidebar-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }
  .admin-user { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .admin-main { margin-left: 0; }
  .admin-content { padding: 1rem; }

  .admin-stats { grid-template-columns: 1fr; }

  .admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }
  .admin-actions .btn {
    flex: 1 1 calc(50% - 0.5rem);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .admin-actions .btn { flex-basis: 100%; }
}
