:root {
  /* Global Styles Overrides */
  --primary-blue: #001f3f;
  --primary-green: #029e5d;
  --secondary-green: #00a651;
  --light-gray: #f5f5f5;
  --border-color: #e0e0e0;
  --text-color: #333;
}

/* --- Estilização Avançada de Dropdowns --- */
.dropdown-menu {
  min-width: 220px !important;
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
  padding: 8px 0 !important;
  margin-top: 10px !important;
}

.dropdown-item {
  padding: 10px 20px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #444 !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
}

.dropdown-item:hover {
  background-color: #f8f9fa !important;
  color: var(--primary-green) !important;
  padding-left: 25px !important;
}

.dropdown-item i {
  width: 20px;
  margin-right: 10px;
  color: #888;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f8f9fa;
  color: var(--text-color);
  overflow-x: hidden;
  /* Prevent horizontal scroll from rows */
}

/* --- Navbar Brand Logo --- */
.navbar-brand-wrapper {
  width: 180px;
  height: 40px;
  display: flex;
  align-items: center;
}

.navbar-carbografite {
  background-color: var(--primary-blue) !important;
  border-bottom: 4px solid var(--primary-green);
  height: 60px;
  padding: 0;
}

.navbar-carbografite .container-fluid {
  justify-content: flex-start !important;
  /* Força alinhamento à esquerda */
}

.navbar-carbografite .d-none.d-md-flex {
  margin-left: auto !important;
  /* Empurra menu para a direita */
}

.navbar-brand img {
  height: 35px !important;
  width: auto;
  object-fit: contain;
  padding: 2px 0;
}

/* --- Carbografite Green Standardization --- */
.btn-primary {
  background-color: var(--primary-green) !important;
  border-color: var(--primary-green) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--secondary-green) !important;
  border-color: var(--secondary-green) !important;
}

.text-primary {
  color: var(--primary-green) !important;
}

.bg-primary {
  background-color: var(--primary-green) !important;
}

/* --- Layout Structure --- */
.sidebar-fixed {
  position: fixed;
  top: 60px;
  bottom: 0;
  left: 0;
  padding-top: 20px;
  z-index: 100;
}

.sidebar-right {
  position: fixed;
  right: 0;
  top: 60px;
  bottom: 0;
  padding-top: 20px;
  border-left: 1px solid #dee2e6;
  overflow-y: auto;
}

.main-offset {
  margin-top: 0;
  min-height: calc(100vh - 60px - 80px);
  display: flex;
  flex-direction: column;
}

.main-content-padding {
  padding-top: 20px;
  padding-bottom: 100px;
  /* Padding extra para não esconder conteúdo atrás do rodapé/botões */
  margin-right: 2rem;
  /* Respiro entre conteúdo e sidebar direita */
  min-height: calc(100vh - 120px);
  /* Sticky Footer Logic: 100vh - Navbar(60) - Footer(60) */
}

#carboBannerCarousel {
  width: 100%;
  margin: 0;
  padding: 0;
  display: block;
}

.full-width-banner-wrapper {
  width: 100%;
  overflow: hidden;
  margin-bottom: 0;
}

/* Banner full width strict reset */
.banner-wrapper,
#banner-section,
.full-width-banner,
.full-width-banner-wrapper {
  width: 100%;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden;
  display: block;
}

/* Banner wrapper: ocupa 100% da largura sem padding */
.banner-wrapper,
.full-width-banner-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden;
  display: block;
}

/* Carousel e carousel-inner: apenas largura, sem forçar altura */
.banner-wrapper .carousel,
.banner-wrapper .carousel-inner,
.full-width-banner-wrapper .carousel,
.full-width-banner-wrapper .carousel-inner {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0;
  padding: 0;
}

.banner-wrapper img,
.full-width-banner-wrapper img {
  width: 100% !important;
  height: auto;
  display: block;
  margin: 0;
  padding: 0;
}

#carboBannerCarousel .carousel-item img {
  width: 100% !important;
  height: auto;
  min-height: 200px;
  max-height: 520px;
  object-fit: contain;
  /* Garante que a imagem apareça inteira sem cortes */
  background-color: #1a1a1a;
  /* Fundo escuro para preencher espaços se necessário */
  object-position: center;
  display: block;
  margin: 0;
  padding: 0;
}

@media (min-width: 1600px) {
  #carboBannerCarousel .carousel-item img {
    max-height: 600px;
  }
}

@media (max-width: 1200px) {
  #carboBannerCarousel .carousel-item img {
    max-height: 400px;
  }
}

@media (max-width: 992px) {
  #carboBannerCarousel .carousel-item img {
    max-height: 320px;
  }
}

@media (max-width: 768px) {
  #carboBannerCarousel .carousel-item img {
    max-height: 240px;
    min-height: 150px;
  }
}

#chatbot-toggler {
  display: none !important;
}

/* Área de posts/comunicados */
.content-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
}

.page-wrapper {
  width: 100%;
}

.main-content {
  width: 100%;
  overflow-x: hidden;
  padding: 1rem;
}

/* Top Bar 1 (Utilitária) */
.topbar-utility {
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: var(--primary-blue);
  border-bottom: 2px solid var(--primary-green);
  z-index: 1030;
  display: flex;
  align-items: center;
}

.topbar-utility .utility-link {
  font-size: 12.5px;
  color: #ffffff;
  text-decoration: none;
}

.topbar-utility .utility-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.topbar-utility .utility-text {
  font-size: 12.5px;
  color: #ffffff;
}

/* Garante visibilidade da data/hora no desktop */
.topbar1 .item-datahora {
  display: inline !important;
  font-size: 12.5px;
  color: #ffffff;
}

/* Mobile behavior for Top Bar 1 */
@media (max-width: 991.98px) {
  .topbar-utility {
    display: none !important;
  }

  .topbar1 .item-configuracoes,
  .topbar1 .item-usuario,
  .topbar1 .item-meuperfil,
  .topbar1 .item-sair {
    display: none !important;
  }

  .topbar1 .item-datahora {
    display: none !important;
  }

  .topbar-primary {
    top: 0 !important;
  }

  .main-offset {
    padding-top: 0 !important;
  }
}

/* Top Bar 2 (Navegação Principal) */
.topbar-primary {
  position: sticky;
  top: 36px;
  z-index: 1020;
  background: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 8px 12px;
}

.topbar2 {
  display: flex;
  align-items: center;
}

.topbar2 .navbar-brand img {
  height: 48px;
  width: auto;
  vertical-align: middle;
}

.topbar-primary .main-menu .nav-link {
  font-size: 14px;
  font-weight: 500;
  color: #333333;
  padding: 8px 12px;
}

.topbar-primary .main-menu .nav-link:hover {
  color: #2e7d32;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.topbar-primary .dropdown-menu {
  border: 1px solid #e5e5e5;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.topbar-primary .dropdown-item:hover {
  background: #f5f5f5;
}

/* Navbar compacta para Desktop (evita quebra de linha em notebooks) */
@media (min-width: 992px) {
  .navbar-nav .nav-link {
    font-size: 0.85rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .navbar-nav {
    gap: 0.35rem !important;
    /* Reduz o espaçamento entre os itens da lista */
  }
}


/* Hamburger menu for mobile */
.nav-menu-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hamburger-btn {
  display: none;
}

.main-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

@media (max-width: 1399.98px) {
  .hamburger-btn {
    display: block;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    padding: 4px 8px;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    z-index: 1050;
    padding: 8px 0;
  }

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

  .main-nav a,
  .main-nav .nav-item {
    padding: 10px 20px;
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
    font-size: 14px;
  }

  .topbar-primary .dropdown-menu,
  .main-nav .dropdown-menu {
    position: static !important;
    float: none !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    background-color: transparent !important;
    padding-left: 16px;
  }

  .topbar2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
  }

  .topbar2 .navbar-brand img {
    height: 38px;
    width: auto;
  }
}

/* Main offset compensando as duas barras */
.main-offset {
  padding-top: 36px;
  /* utilitária fixa */
}

@media (max-width: 767.98px) {
  .sidebar-fixed {
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    width: 85vw;
    max-width: 320px;
    padding-top: 12px;
    transform: translateX(-105%);
    transition: transform 0.2s ease-in-out;
    z-index: 1045;
  }

  .sidebar-fixed.show,
  .sidebar-fixed.collapsing {
    transform: translateX(0);
  }

  .sidebar-sticky {
    height: calc(100vh - 60px);
    overflow-y: auto;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1040;
  }

  .main-content-padding {
    margin-right: 0;
    padding-top: 10px;
    /* Reduzido de 20px */
    padding-bottom: 80px;
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* --- Sidebar Styling --- */
.sidebar {
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.03);
  background-color: #001f3f !important;
  /* Navy Blue */
  color: #fff !important;
  border-right: 1px solid #001f3f;
}

.sidebar-sticky {
  height: calc(100vh - 60px);
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar .nav-link {
  font-weight: 500;
  color: #ffffff !important;
  /* Pure White */
  padding: 6px 12px;
  /* Compact Padding */
  border-radius: 6px;
  transition: all 0.2s ease-in-out;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem !important;
  /* Normalized Size */
}

.sidebar .nav-link:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.sidebar .nav-link.active {
  color: #ffffff !important;
  background-color: #029e5d;
  /* Green Active */
  font-weight: 600;
  border-right: none;
}

.sidebar .nav-link i {
  width: 20px;
  text-align: center;
}

/* --- Sidebar Collapse Buttons --- */
.sidebar .btn-toggle {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  width: 100%;
  font-weight: 600;
  color: #ffffff !important;
  /* Pure White */
  background-color: transparent;
  border: 0;
  text-transform: uppercase;
  font-size: 0.9rem !important;
  margin-top: 1rem;
}

.sidebar .btn-toggle:hover,
.sidebar .btn-toggle[aria-expanded="true"],
.sidebar .btn-toggle-active {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .btn-toggle .fa-chevron-right {
  transition: transform .35s ease;
}

.sidebar .btn-toggle[aria-expanded="true"] .fa-chevron-right {
  transform: rotate(90deg);
}

.sidebar .collapse-inner {
  padding-left: 10px;
}

/* --- Login Screen --- */
.login-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background-color: #f8f9fa;
  padding: 0 20px 20px !important;
}

.login-box-wrapper {
  width: 92%;
  max-width: 400px;
  margin: 0 auto;
}

/* Ajuste mobile para evitar que a logo seja cortada no topo */
@media (max-width: 768px) {
  html body .login-container.login-box {
    padding-top: 60px !important; /* Respiro solicitado de 60px */
    justify-content: flex-start !important;
  }
  
  /* ESPECIFICIDADE MÁXIMA PARA MATAR O AZUL */
  html body .login-box .card-header {
    background: #000000 !important;
    background-color: #000000 !important;
  }

  /* ESPECIFICIDADE MÁXIMA PARA A LOGO */
  html body .login-box .card-header img {
    width: 140px !important;     /* Tamanho solicitado */
    max-width: 140px !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
  }
}

.login-card {
  width: 100%;
  max-width: 400px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  background-color: #fff;
  padding: 0;
  overflow: hidden;
}

.login-card .card-header {
  background-color: #000000 !important;
  /* PRETO TOTAL ABSOLUTO */
  color: #fff;
  padding: 24px 32px;
  text-align: center;
  border-bottom: 4px solid #029e5d;
  border-radius: 8px 8px 0 0;
}

.login-card .card-header img {
  max-height: 64px;
  max-width: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-bottom: 16px;
}

.login-card .card-header h1 {
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  margin: 0 0 4px;
}

.login-card .card-header p {
  color: #cccccc;
  font-size: 13px;
  margin: 0;
}

/* Garante o respiro interno do formulário em todas as telas */
.login-card .card-body {
  padding: 30px 40px !important;
  /* Aumentei um pouco as laterais (40px) para ficar mais elegante */
}

/* Ajuste específico para telas muito pequenas, para não espremer demais */
@media (max-width: 576px) {
  .login-card .card-body {
    padding: 25px 20px !important;
    /* Um respiro menor, mas ainda presente, garantindo que não cole nas bordas */
  }
}

.login-card .form-control {
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 15px;
}

/* Fix Eye Button Height */
.login-card .input-group .btn {
  padding: 0 12px;
  height: calc(2.2em + .75rem + 2px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.login-card .btn-primary {
  width: 100%;
  padding: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Flash Messages in Login */
.login-container .flash-messages {
  width: 100%;
  max-width: 400px;
  /* Force alignment */
  margin-bottom: 1rem;
}

/* --- Login Desktop Fix --- */
@media (min-width: 992px) {
  .login-container {
    justify-content: center !important;
    padding-top: 30px !important;
    /* Respiro no desktop para não colar no teto */
    transform: none !important;
  }

  /* Aplica o leve recuo para cima apenas no desktop para impacto visual */
  .login-box-wrapper {
    transform: translateY(-40px);
  }
}

/* --- Micro Cards (Aside) - Clean --- */
.micro-card {
  background-color: #fff !important;
  margin-bottom: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  border: none !important;
  /* Clean, no green border */
}

.micro-card .card-header {
  margin-left: 1rem;
  /* Respiro no título */
}

.micro-card .card-body {
  padding: 1rem !important;
  /* Respiro interno ajustado */
}

.calendar-mini,
.ratio {
  padding: 0 0.5rem;
  /* Padding lateral extra para conteúdo */
}

/* --- Chatbot Widget --- */
#chatbot-toggler {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #029e5d;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  z-index: 2000;
  /* Acima do rodapé e sidebar */
}

#chatbot-toggler:hover {
  transform: scale(1.1);
  background: #00a651;
}

#chatbot-toggler span {
  position: absolute;
}

.chatbot-popup {
  position: fixed;
  bottom: 160px;
  right: 30px;
  width: 420px;
  max-width: 90%;
  /* Responsivo mobile */
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
  transform-origin: bottom right;
  box-shadow: 0 0 128px 0 rgba(0, 0, 0, 0.1),
    0 32px 64px -48px rgba(0, 0, 0, 0.5);
  transition: all 0.1s ease;
  z-index: 2001;
  /* Acima do toggler */
}

body.show-chatbot .chatbot-popup {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.chat-header {
  padding: 15px 22px;
  background: #029e5d;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header .header-info {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-info .chatbot-logo {
  height: 35px;
  width: 35px;
  padding: 4px;
  /* Space inside circle */
  background: #fff;
  border-radius: 50%;
  fill: #029e5d;
  flex-shrink: 0;
}

.header-info .logo-text {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
}

.chat-header #close-chatbot {
  border: none;
  color: #fff;
  height: 40px;
  width: 40px;
  font-size: 1.9rem;
  margin-right: -10px;
  padding-top: 2px;
  cursor: pointer;
  background: none;
  transition: 0.2s ease;
}

.chat-header #close-chatbot:hover {
  color: #dcdcdc;
}

.chat-body {
  padding: 25px 22px;
  height: 460px;
  overflow-y: auto;
  margin-bottom: 82px;
  scrollbar-width: thin;
  scrollbar-color: #ccccf2 transparent;
}

.chat-body .message {
  display: flex;
  gap: 11px;
  align-items: center;
}

.chat-body .bot-message .bot-avatar {
  height: 35px;
  width: 35px;
  padding: 4px;
  background: #fff;
  border-radius: 50%;
  fill: #029e5d;
  border: 1px solid #029e5d;
  align-self: flex-end;
  margin-bottom: 2px;
  flex-shrink: 0;
}

.chat-body .user-message {
  flex-direction: column;
  align-items: flex-end;
}

.chat-body .message .message-text {
  padding: 12px 16px;
  max-width: 75%;
  font-size: 0.95rem;
}

.chat-body .bot-message.thinking .message-text {
  padding: 2px 16px;
}

.chat-body .bot-message .message-text {
  background: #f2f2f2;
  border-radius: 13px 13px 13px 3px;
}

.chat-body .user-message .message-text {
  color: #fff;
  background: #029e5d;
  border-radius: 13px 13px 3px 13px;
}

.chat-body .bot-message .thinking-indicator {
  display: flex;
  gap: 4px;
  padding-block: 15px;
}

.chat-body .bot-message .thinking-indicator .dot {
  height: 7px;
  width: 7px;
  opacity: 0.7;
  border-radius: 50%;
  background: #029e5d;
  animation: dotPulse 1.8s ease-in-out infinite;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(1) {
  animation-delay: 0.2s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(2) {
  animation-delay: 0.3s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {

  0%,
  44% {
    transform: translateY(0);
  }

  28% {
    opacity: 0.4;
    transform: translateY(-4px);
  }

  44% {
    opacity: 0.2;
  }
}

.chat-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: #fff;
  padding: 15px 22px 20px;
}

.chat-footer .chat-form {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 32px;
  outline: 1px solid #cccce5;
}

.chat-footer .chat-form:focus-within {
  outline: 2px solid #029e5d;
}

.chat-form .message-input {
  border: none;
  outline: none;
  background: none;
  width: 100%;
  height: 47px;
  padding: 0 17px;
  font-size: 0.95rem;
}

.chat-form #send-message {
  height: 35px;
  width: 35px;
  border: none;
  background: #029e5d;
  color: #fff;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
}

.chat-form #send-message:hover {
  background: #00a651;
}

.chat-form #send-message[style*="none"] {
  /* Ensure it stays hidden if JS sets display:none */
}

/* File Attachment Styles */
.file-upload-wrapper {
  position: relative;
  height: 35px;
  width: 35px;
  margin-right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.file-upload-wrapper button {
  border: none;
  background: none;
  color: #029e5d;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.file-upload-wrapper button:hover {
  transform: scale(1.1);
  color: #00a651;
}

/* Attachment Preview Area (inside Chat Form) */
.attachment-preview {
  position: absolute;
  bottom: 55px;
  /* Above input */
  left: 20px;
  background: #e9ecef;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.attachment-preview .remove-file {
  cursor: pointer;
  color: #dc3545;
  font-weight: bold;
}

/* Chat Message Rendering (Markdown Support) */
.chat-msg {
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
}

.chat-msg ul {
  margin: 5px 0 5px 20px;
  padding: 0;
}

.chat-msg li {
  margin-bottom: 3px;
}

.chat-msg strong {
  font-weight: 600;
}

.chat-msg a {
  color: #0056b3;
  text-decoration: underline;
}

.chat-msg code {
  background-color: #e9ecef;
  color: #333;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
}

.chat-msg pre {
  background-color: #e9ecef;
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
  margin-top: 5px;
}

.chat-msg table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 5px;
  font-size: 0.9rem;
}

.chat-msg th,
.chat-msg td {
  border: 1px solid #ddd;
  padding: 6px;
  text-align: left;
}

.chat-msg th {
  background-color: #e9ecef;
  color: #333;
  border-bottom-left-radius: 2px;
}

.chat-msg.error {
  background-color: #f8d7da;
  color: #721c24;
}

/* --- Thinking Indicator Animation (Pulso Neural) --- */
.chat-body .bot-message .thinking-indicator {
  display: flex;
  gap: 4px;
  padding-block: 15px;
  cursor: wait;
  /* Indicate loading */
}

.chat-body .bot-message .thinking-indicator .dot {
  height: 8px;
  /* Slightly larger */
  width: 8px;
  opacity: 0.7;
  border-radius: 50%;
  background: #029e5d;
  animation: dotPulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 rgba(2, 158, 93, 0);
  /* Init shadow */
}

/* Staggered delays */
.chat-body .bot-message .thinking-indicator .dot:nth-child(1) {
  animation-delay: 0s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-body .bot-message .thinking-indicator .dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Interactivity: Speed up on hover */
.chat-body .bot-message .thinking-indicator:hover .dot {
  animation-duration: 0.7s;
  /* 2x speed */
}

@keyframes dotPulse {
  0% {
    transform: translateY(0);
    opacity: 0.7;
    box-shadow: 0 0 0 rgba(2, 158, 93, 0);
  }

  50% {
    transform: translateY(-8px);
    /* Jump */
    opacity: 1;
    box-shadow: 0 4px 8px rgba(2, 158, 93, 0.4);
    /* Soft shadow pulse */
  }

  100% {
    transform: translateY(0);
    opacity: 0.7;
    box-shadow: 0 0 0 rgba(2, 158, 93, 0);
  }
}

.footer-carbografite {
  background-color: #000000 !important;
  /* Black */
  color: #ffffff;
  padding: 20px 0;
  margin-top: auto;
  /* Push to bottom */
  font-size: 0.85rem;
  border-top: 4px solid #029e5d;
  width: 100%;
  position: relative;
  z-index: 500;
  /* Acima da sidebar (100) mas abaixo de Modais (1050) */
}

.footer-carbografite a {
  color: #fff;
  text-decoration: none;
}

.footer-carbografite a:hover {
  text-decoration: underline;
  color: #029e5d;
}

/* --- Session Timer Fixed --- */
.session-timer-fixed {
  bottom: 20px;
  right: 20px;
  left: auto;
  z-index: 2050;
  border-left: 5px solid #029e5d;
  border-right: none;
  position: fixed !important;
  z-index: 999999 !important;
  bottom: 100px !important;
}

/* --- Action Buttons (Clean Style) --- */
.btn-icon-action {
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.btn-icon-action:hover {
  transform: scale(1.2);
}

.btn-icon-action .fa-edit {
  color: #0056b3;
}

/* Blue */
.btn-icon-action .fa-trash-alt,
.btn-icon-action .fa-trash {
  color: #dc3545;
}

/* Red */
.btn-icon-action .fa-eye {
  color: #17a2b8;
}

/* Teal/Info */
.btn-icon-action .fa-check {
  color: #28a745;
}

/* Green */
.btn-icon-action .fa-times {
  color: #dc3545;
}

/* Red */

/* --- Card Styling --- */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  background-color: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 24px;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid #f0f0f0;
  padding: 15px 20px;
  border-radius: 12px 12px 0 0 !important;
}

.card-title {
  margin: 0;
  font-weight: 600;
  color: var(--primary-blue);
  font-size: 1.1rem;
}

.card-body {
  padding: 20px;
}

/* --- Card Post (Clean) --- */
.card-post {
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  transition: transform 0.2s;
  overflow: hidden;
  background-color: #fff;
}

.card-post:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.card-post .card-body {
  padding: 1.25rem;
  /* Clean padding */
}

.card-post .card-title {
  font-size: 1.1rem !important;
  /* Reduced title size */
}

.card-post img,
.card-post .post-image {
  max-height: 450px;
  /* Limit image scale */
  width: 100%;
  object-fit: contain;
  object-position: top;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* --- Typography & Titles (Refined) --- */
.card-header h3,
.form-title,
h2,
.h2-responsive {
  font-size: 1.25rem !important;
  /* Tamanho sóbrio */
  font-weight: 600;
  color: #001f3f;
  /* Azul Marinho para contraste técnico */
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Central Layout (Clean) --- */
.card-central {
  max-width: 900px;
  /* Impede o card de 'dobrar de tamanho' em telas grandes */
  margin: 20px auto;
  padding: 25px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* --- Badges & Highlights --- */
.badge {
  background-color: var(--primary-green) !important;
  color: #fff !important;
  font-weight: 500;
}

/* --- Calendar Mini --- */
.calendar-mini .hover-bg-light:hover {
  background-color: #e9ecef;
}

.cursor-pointer {
  cursor: pointer;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

/* --- Purified Base Styles --- */
.img-thumbnail-post {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  font-size: 0.8rem;
}

.social-media-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.social-media-buttons {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* Calendar JS Classes */
.calendar-day-event {
  font-weight: bold;
  color: #029e5d;
}

.calendar-dot {
  width: 4px;
  height: 4px;
  background: #029e5d;
  border-radius: 50%;
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
}

/* ERRO CONSERTADO AQUI (Essa chave não existia!) */

/* --- Catálogos: imagem de capa sem corte --- */
.catalog-card .catalog-cover,
.catalog-card img,
.card-catalogo img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  object-position: center;
  background-color: #f0f0f0;
  display: block;
  border-radius: 6px 6px 0 0;
}

/* --- Form Template de Ouro (Carbografite Standard) --- */
.card-header-carbografite {
  background-color: #029e5d;
  color: #ffffff;
  padding: 15px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 8px 8px 0 0;
}

label {
  font-weight: 600;
  color: #001f3f;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.form-control,
.form-select {
  border: 1px solid #ced4da;
  border-radius: 6px;
}

.form-control:focus,
.form-select:focus {
  border-color: #029e5d !important;
  box-shadow: 0 0 0 0.2rem rgba(2, 158, 93, 0.25) !important;
}

/* Ensure buttons align correctly in forms */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* --- Executive Design System (Refinements) --- */

/* Buttons: Clean & Compact */
.btn {
  padding-top: 0.375rem !important;
  /* ~6px */
  padding-bottom: 0.375rem !important;
  /* ~6px */
  font-size: 0.875rem !important;
  /* 14px */
  font-weight: 500 !important;
  /* Medium */
  border-radius: 6px !important;
  /* Slightly tighter radius */
  letter-spacing: 0.01em;
  transition: all 0.2s ease-in-out;
}

/* Extra small buttons for tables */
.btn-xs,
.table .btn {
  padding: 0.125rem 0.5rem !important;
  /* ~2px 8px */
  font-size: 0.75rem !important;
  /* 12px */
  line-height: 1.5;
}

/* Adjustments for specific button sizes if needed */
.btn-lg {
  padding: 0.5rem 1rem !important;
  font-size: 1rem !important;
}

.btn-sm {
  padding: 0.25rem 0.5rem !important;
  font-size: 0.75rem !important;
}

/* Sidebar Refinements */
.sidebar .nav-link {
  text-transform: none !important;
  /* Ensure no uppercase */
  font-weight: 400;
  /* Lighter weight */
  letter-spacing: 0.2px;
}

.sidebar .nav-link.active {
  font-weight: 500;
}

.sidebar .btn-toggle {
  text-transform: none !important;
  font-weight: 500 !important;
}

/* Right Sidebar Headers */
.micro-card .card-header {
  text-transform: none !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  color: #555 !important;
}

/* --- Home Nav Grid (Botões Interativos) --- */
.home-nav-grid {
  padding: 24px 16px;
}

.home-nav-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.home-nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 12px;
  padding: 28px 16px 20px;
  text-decoration: none;
  color: #001f3f;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  border: 2px solid transparent;
  min-height: 140px;
  text-align: center;
  gap: 12px;
}

.home-nav-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(2, 158, 93, 0.15);
  border-color: #029e5d;
  color: #029e5d;
  text-decoration: none;
}

.home-nav-icon {
  font-size: 2rem;
  color: #029e5d;
  line-height: 1;
}

.home-nav-card:hover .home-nav-icon {
  color: #029e5d;
}

.home-nav-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: inherit;
}

@media (max-width: 576px) {
  .home-nav-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .home-nav-card {
    padding: 20px 10px 16px;
    min-height: 120px;
  }

  .home-nav-icon {
    font-size: 1.6rem;
  }
}

/* --- PWA Install Button --- */
.pwa-install-btn-style {
  font-size: 11px;
  font-weight: 600;
  color: #029e5d;
  background: #fff;
  border: 1px solid #029e5d;
  border-radius: 6px;
  padding: 2px 10px;
  height: 26px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.pwa-install-btn-style:hover {
  background: #029e5d;
  color: #fff;
}

@media (max-width: 768px) {
  .pwa-install-btn-style {
    padding: 2px 8px;
  }
}

/* Catálogos: imagens sem corte */
.catalog-card-img {
  width: 100%;
  height: 280px;
  object-fit: contain;
  object-position: center;
  background: #f0f0f0;
  border-radius: 6px 6px 0 0;
  display: block;
}

/* Correção de dropdown admin na página de perfil */
.navbar .dropdown-menu {
  position: absolute !important;
  width: auto !important;
  min-width: 200px;
  max-width: 300px;
}

.navbar-collapse.show,
.navbar-collapse.collapsing {
  position: relative;
  z-index: 1000;
}

#admin-sidebar,
.admin-menu,
.admin-nav {
  position: fixed !important;
  width: 260px !important;
}

.brinde-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.brinde-card .brinde-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.brinde-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.brinde-card:hover .brinde-image img {
  transform: scale(1.05);
}

.tour-video-container {
  text-align: center;
  padding: 4px 0;
}

.tour-video-container video {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* --- Correção de Sobreposição Mobile (Z-Index) --- */
/* Garante que o Navbar e o menu sanduíche fiquem no topo absoluto */
.topbar-primary,
.navbar,
.navbar-collapse,
.main-nav.menu-open {
  z-index: 9999 !important;
  background-color: #ffffff !important;
}

/* Rebaixa a camada do cabeçalho fixo da tabela para não furar o menu */
.table-responsive thead th,
.table {
  z-index: 10 !important;
}

/* --- Correção Z-Index Modais --- */
.modal-backdrop {
  z-index: 9999998 !important;
}

.modal {
  z-index: 9999999 !important;
}

/* CORREÇÃO DEFINITIVA DO SUBMENU NO MOBILE (Efeito Sanfona Anti-Popper) */

@media (max-width: 991px) {
  .navbar-nav .dropdown-menu {
    position: static !important;
    float: none !important;
    width: auto !important;
    margin-top: 0 !important;
    background-color: #f8f9fa !important;
    /* Fundo cinza claro para destacar */
    border: 1px solid #dee2e6 !important;
    /* Borda bem suave */
    border-radius: 8px !important;
    box-shadow: none !important;
    transform: none !important;
    /* MATA A SOBREPOSIÇÃO DO POPPER.JS */
    padding: 10px !important;
    margin-bottom: 15px !important;
  }

  .navbar-nav .dropdown-menu.show {
    display: block !important;
  }
}

/* --- Normalização de Espaçamento Superior (Android Fix) --- */
@media (max-width: 991px) {
  .main-offset {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  .content-container {
    margin-top: 5px !important;
  }
}

/* --- Correção de Sobreposição no Menu Dropdown (Android Fix) --- */
@media (max-width: 991px) {
  .navbar-nav .dropdown-menu {
    position: static !important;
    float: none !important;
    display: none;
    height: auto !important;
    overflow: visible !important;
    background-color: #fcfcfc !important;
    border: 1px solid #e0e0e0 !important;
    margin: 5px 15px 15px 15px !important;
  }

  .navbar-nav .dropdown-menu.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .navbar-nav .nav-item {
    height: auto !important;
    position: relative !important;
  }
}

/* --- Visibilidade Condicional Offline (Caixa de Saída e Memória) --- */
#outbox-menu-item,
#storage-menu-item,
#outbox-separator,
#storage-separator,
#card-caixa-saida,
#card-memoria {
  display: none !important;
}

body.is-offline #outbox-menu-item,
body.is-offline #storage-menu-item {
  display: inline-block !important;
}

body.is-offline #outbox-separator,
body.is-offline #storage-separator {
  display: inline-block !important;
}

@media (max-width: 991.98px) {

  body.is-offline #outbox-menu-item,
  body.is-offline #storage-menu-item {
    display: block !important;
    padding: 10px 15px !important;
    background: #fff3cd !important;
    border-radius: 8px;
    margin: 5px 0;
  }
}

/* --- Shepherd Tour Custom Styles --- */
.shepherd-element {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: none !important;
  font-family: inherit;
}

.shepherd-header {
  background-color: #029e5d !important;
  /* Verde Carbografite */
  padding: 12px 16px !important;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.shepherd-title {
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
}

.shepherd-cancel-icon {
  color: #ffffff !important;
  font-size: 24px !important;
  font-weight: 400 !important;
}

.shepherd-cancel-icon:hover {
  color: #e0e0e0 !important;
}

/* A "setinha" (carrot) do pop-up */
.shepherd-arrow::before {
  background-color: #029e5d !important;
}

.shepherd-text {
  padding: 16px !important;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

.shepherd-footer {
  padding: 0 16px 16px 16px !important;
}

.shepherd-button {
  border-radius: 6px !important;
  font-weight: 600 !important;
  padding: 6px 15px !important;
}

@media (min-width: 992px) {
    header .navbar .dropdown-menu {
        background-color: #ffffff !important;
        background: #ffffff !important;
        border: 1px solid #cccccc !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    header .navbar .dropdown-item {
        color: #000000 !important;
    }
}