/* Reset e estilos base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #ffffff !important;
  min-height: 100vh;
  color: #333;
}

html {
  background: #ffffff !important;
}

/* Topbar - Fundo preto conforme solicitado */
.topbar {
  background: #000000 !important;
  background-color: #000000 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  height: 24px;
  width: auto;
}

.navbar {
  background: #000000 !important;
  background-color: #000000 !important;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 24px;
}

.nav-link,
.nav-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  background:rgba(255, 255, 255, 0.1);
  color:#ffffff;
  border:1px solid rgba(255, 255, 255, 0.2);
  border-radius:4px;
  padding:0 14px;
  height:36px;
  font-size:0.95rem;
  font-weight:500;
  cursor:pointer;
  text-decoration:none;
  transition:background 0.2s ease, border-color 0.2s ease;
  margin:0;
}

/* Estilos do menu de notificações */
.notification-menu {
  position: relative;
  display: flex;
  align-items: center;
  height: 36px;
  margin-right: 14px; /* Espaço entre o sino e o botão Sair */
}

.notification-button {
  position: relative;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  margin: 0;
  color: #ffffff;
}

.notification-icon {
  font-size: 0; /* Oculta o emoji nativo */
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #ff4d4f;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-dropdown {
  display: none;
  position: absolute;
  top: 45px;
  right: -100px;
  width: 320px;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  max-height: 400px;
  overflow-y: auto;
}

.notification-menu.open .notification-dropdown {
  display: block;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.notification-header h3 {
  margin: 0;
  font-size: 16px;
  color: #000;
}

.mark-all-read {
  font-size: 12px;
  color: #1890ff;
  cursor: pointer;
  text-decoration: none;
}

.notification-list {
  padding: 0;
}

.notification-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: #000;
  transition: background-color 0.3s;
}

.notification-item:hover {
  background-color: #f5f5f5;
}

.notification-item.unread {
  background-color: #e6f7ff;
}

.notification-title {
  font-weight: bold;
  margin-bottom: 4px;
}

.notification-message {
  font-size: 14px;
  color: #666;
  margin-bottom: 4px;
}

.notification-time {
  font-size: 12px;
  color: #999;
}

.no-notifications {
  padding: 16px;
  text-align: center;
  color: #999;
}

.nav-link:hover,
.nav-button:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-1px);
}

.nav-dropdown {
  position:relative;
  display:flex;
  align-items:center;
  height:36px;
}

.dropdown-menu {
  display:none;
  position:absolute;
  top:100%;
  left:0;
  min-width:180px;
  background:#fff;
  border-radius:6px;
  box-shadow:0 6px 18px rgba(0,0,0,0.16);
  padding:8px 0 8px 0;
  flex-direction:column;
  z-index:1200;
}

.dropdown-menu a {
  padding:10px 16px;
  color:#111;
  text-decoration:none;
  font-weight:500;
}

.dropdown-menu a.active {
  background:#e5e5e5;
}

.dropdown-menu a:hover {
  background:#f2f2f2;
}

.nav-dropdown.open .dropdown-menu {
  display:flex;
}

.nav-spacer {
  flex:1 1 auto;
}

.notification-area {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: 16px; /* Espaço entre o sino e o botão Sair */
}

.notification-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%; /* Deixa o ícone circular */
  color: transparent; /* Oculta o emoji colorido */
  text-decoration: none;
  transition: background 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M12 22a2 2 0 002-2h-4a2 2 0 002 2zm6-6V11a6 6 0 10-12 0v5l-2 2h16l-2-2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
}

.notification-icon:hover {
  background: rgba(255,255,255,0.2);
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: #e53935; /* Vermelho para destaque */
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: bold;
  border: 2px solid #000; /* Borda da cor da barra superior */
}

.topbar .logout-link {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:36px;
  padding:0 14px;
  border-radius:4px;
}

.content-area {
  flex-grow: 1;
  width: 100%;
  /* Ocupa toda a viewport abaixo da topbar */
  height: calc(100vh - 64px);
  margin: 0;
  padding: 0 24px 24px 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.page-title {
  margin:0 0 16px 0;
  font-size:1.75rem;
  font-weight:600;
  color:#000;
  flex-shrink: 0; /* Prevent title from shrinking */
}

.report-container {
  /* Usa altura fixa baseada na viewport para garantir previsibilidade */
  flex: 0 0 auto; /* Evita crescer/encolher pelo flex */
  height: calc(100vh - 64px - 24px); /* viewport menos topbar e padding inferior */
  min-height: 0; /* Permite ajuste dentro do flex container pai */
  width: 100%;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  overflow: hidden;
}

/* Tamanhos predefinidos para o relatório */
.report-medium {
  flex: 0 0 auto; /* Não crescer, usar altura fixa */
  height: 780px; /* Altura aproximada do exemplo fornecido */
  max-height: calc(100vh - 120px); /* Não ultrapassar a viewport útil */
}

.embed-status {
  margin-top:12px;
  font-size:0.95rem;
  color:#444;
  flex-shrink: 0;
}

.messages {
  margin-bottom:16px;
  flex-shrink: 0;
}

.message {
  padding:12px 16px;
  border-radius:6px;
  margin-bottom:8px;
  font-weight:500;
}

.message-error {
  background:#ffecec;
  color:#a30000;
  border:1px solid rgba(163,0,0,0.4);
}

.message-success {
  background:#ecfff1;
  color:#006b2e;
  border:1px solid rgba(0,107,46,0.4);
}

.empty-state {
  padding:48px;
  background:#fff;
  border-radius:8px;
  text-align:center;
  box-shadow:0 6px 20px rgba(0,0,0,0.08);
}

.container {
  max-width: 480px;
  margin: 48px auto;
  background: #ffffff;
  padding: 24px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.container h2 { text-align: center; margin-top: 0; margin-bottom: 12px }

label { display:block; margin-top:12px; font-weight:600 }
input[type="text"], input[type="password"], input[type="email"] {
  width:100%;
  padding:10px;
  margin-top:6px;
  border:1px solid #ccc;
  border-radius:4px;
  box-sizing:border-box;
}

/* Estilo genérico para campos de seleção (dropdowns) */
select {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}
button, .btn {
  display: inline-flex; /* Garante consistência no alinhamento interno */
  align-items: center;
  justify-content: center;
  background:#000;
  color:#fff;
  border: none;
  padding:10px 14px;
  border-radius:4px;
  cursor:pointer;
  margin-top:14px;
  text-decoration: none;
  font-family: inherit; /* Garante que ambos usem a mesma fonte */
  font-size: 1rem; /* Define um tamanho de fonte explícito */
  box-sizing: border-box; /* Garante que o padding não afete o tamanho final */
}

/* Garante que links com a classe .btn não tenham sublinhado */
a.btn, a.btn:hover, a.btn:visited {
  text-decoration: none;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

/* Estilo para o campo de seleção múltipla (grupos) */
select[multiple] {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

button:hover, .btn:hover { opacity:0.9 }

.error { color: #b00020; margin-top:8px }

.logout-link { color:#000; text-decoration:none; background:#fff; padding:8px 10px; border-radius:4px; border:1px solid #000 }

/* Garantir que o link de logout fique preto mesmo dentro da topbar preta */
.topbar .logout-link { color: #000 !important; }

/* Ajuste consistente do tamanho da logo na topbar */
.logo { display:inline-block; height:24px }
.logo img { height:24px; width:auto; display:block }

/* Texto da marca ao lado do logo */
.logo-text {
  margin-left: 10px;
  font-weight: 700;
  font-size: 1rem;
  color: #000000;
}

/* Na topbar preta, o texto deve ficar branco */
.topbar .logo-text { color: #ffffff; }

/* Versão centralizada para uso abaixo do logo grande (login) */
.logo-text--center {
  text-align: center;
  margin-top: 8px;
}

/* Pequeno badge de boas-vindas no canto superior esquerdo */
.welcome-top-left {
  font-size: 0.85rem;
  color: #fff;
  margin-left: 8px;
  font-weight: 500;
}

.logo-large { display:block; width:160px; max-width:90%; margin: 0 auto 20px auto }
.logo-large img { width:100%; height:auto; display:block }

/* Removido filtro: manter cores originais do arquivo PNG */

/* Estilos para o formulário de cadastro de usuário */
.form-field-container {
  margin-bottom: 1rem;
}

/* Estilo para a seção de Usuários Existentes para combinar com o layout do formulário */
.existing-users {
  margin-top: 20px;
  background: #fff;
  border-radius: 6px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.existing-users h2 {
  margin: 0 0 12px 0;
  font-size: 1.25rem;
}
.existing-users-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.existing-user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}
.existing-user-item:last-child { border-bottom: none }
.existing-user-name { font-weight: 600 }
.edit-link {
  background: #000;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
}
.edit-link:hover { opacity: 0.9 }

/* Select de usuários */
.user-select {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}
.edit-link[disabled], .edit-link:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.form-field-container label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-field-container .helptext {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
}

/* Estilos para o campo 'Grupos' (CheckboxSelectMultiple) */
#id_groups { /* O ID do UL gerado pelo Django para o campo 'groups' */
  list-style-type: none;
  padding: 0;
  margin: 6px 0 0 0; /* Garante margem superior consistente e remove margens laterais */
  border: 1px solid #ccc; /* Adiciona uma borda para parecer mais com um campo */
  border-radius: 4px;
  background-color: #fff;
  max-height: 150px; /* Limita a altura para que pareça mais compacto */
  overflow-y: auto; /* Adiciona scroll se houver muitos grupos */
}

#id_groups li {
  padding: 8px 10px; /* Preenchimento interno para cada item */
  margin: 0; /* Remove margens padrão da lista */
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-field-container input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

#id_groups li:hover {
  background-color: #f2f2f2; /* Efeito hover para os itens */
}

/* =============================
   Carrossel de Banners (Home)
   ============================= */
.banner-carousel {
  position: relative;
  margin: 16px 0 0 0;
  border: 1px solid #e5e5e5;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.banner-carousel .carousel-track {
  display: flex;
  width: 100%;
  transition: transform 0.5s ease;
  will-change: transform;
}

.banner-carousel .carousel-slide { min-width: 100%; }
.banner-carousel .carousel-slide.is-active { }

.banner {
  display: flex;
  align-items: stretch;
  gap: 24px;
  width: 100%;
  padding: 20px 24px;
}

.banner-text { flex: 1 1 auto; }
.banner-text h2 { font-size: 1.4rem; margin-bottom: 6px; color: #000; }
.banner-text p { color: #555; margin-bottom: 10px; }

.banner-actions .btn {
  display: inline-block;
  background: #111;
  color: #fff;
  border-radius: 6px;
  padding: 8px 14px;
  text-decoration: none;
  border: 1px solid #111;
}
.banner-actions .btn:hover { filter: brightness(1.1); }

.banner-visual { flex: 0 0 36%; min-height: 160px; border-radius: 8px; position: relative; }
.banner-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  /* Usa imagem PNG centralizada mantendo proporção */
  background: url("/static/img/Logo.cfef8e748ff8.png") center/140px no-repeat;
  background-size: 140px auto;
  opacity: 1;
  pointer-events: none;
}
.banner-visual--modules { background: linear-gradient(135deg, #222, #000); }
.banner-visual--updates { background: linear-gradient(135deg, #222, #000); }
.banner-visual--support { background: linear-gradient(135deg, #222, #000); }

.banner-carousel .carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.banner-carousel .carousel-nav.prev { left: 10px; }
.banner-carousel .carousel-nav.next { right: 10px; }
.banner-carousel .carousel-nav:hover { background: rgba(0,0,0,0.6); }

.banner-carousel .carousel-dots {
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.banner-carousel .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #d0d0d0;
  border: none;
  cursor: pointer;
}
.banner-carousel .dot.is-active { background: #111; }

@media (max-width: 900px) {
  .banner { flex-direction: column; }
  .banner-visual { flex: 0 0 auto; min-height: 120px; }
}

/* =============================
   Overrides: Sino branco e espaçamento
   ============================= */
/* Mais espaço entre o sino e o link Sair */
.notification-menu { margin-right: 12px !important; }
/* Oculta o emoji amarelo do sino */
.notification-icon { display: none !important; }
/* Adiciona ícone de sino branco como pseudo-elemento do botão */
.notification-button::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M12 22a2 2 0 002-2h-4a2 2 0 002 2zm6-6V11a6 6 0 10-12 0v5l-2 2h16l-2-2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
}
/* Espaço extra no link de Sair */
.topbar .logout-link { margin-left: 4px; font-weight: 700; }

/* Aumenta levemente o botão para acomodar o sino maior */
.notification-button { width: 40px !important; height: 40px !important; }
/* Título da página de login mais escuro */
.login-title {
  color: #000000 !important;
  font-weight: 700;
}

/* Centraliza campos na página de login */
.login-form {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.login-form label {
  text-align: center;
  width: 100%;
  color: #000000 !important;
  font-weight: 800;
}
.login-form input {
  width: 80%;
  max-width: 320px;
  margin: 8px auto;
  display: block;
  color: #000000;
  border: 1px solid #000000;
}
.login-form .btn {
  margin: 12px auto 0;
}