/* ========== LAYOUT PRINCIPAL - ESTILO CHATGPT ========== */
.app-container {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: 225px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  flex-shrink: 0;
  transition:
    width 0.3s ease,
    background-color 0.3s ease;
}

.sidebar.collapsed {
  width: 68px;
}

.sidebar-header {
  padding: 5px 5px;
  border-bottom: 1px solid var(--border-color);
  transition: border-color 0.3s ease;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  overflow: hidden;
}

.sidebar.collapsed .logo-container {
  justify-content: center;
  padding: 8px 4px;
}

/* Sidebar Toggle - Inside Sidebar */
.sidebar-toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-sidebar);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (min-width: 769px) {
  .sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
  }
}

.sidebar-toggle:hover {
  background: var(--sidebar-item-hover);
}

.sidebar-toggle svg {
  flex-shrink: 0;
  color: currentColor;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-logo {
  display: none;
}

.app-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.3s ease;
}

.sidebar.collapsed .app-info {
  display: none;
}

.app-title {
  color: var(--text-sidebar);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.app-title-image {
  height: 20px;
  width: auto;
  object-fit: contain;
}

.app-version {
  color: var(--text-sidebar-muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
}

.new-chat-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  color: var(--text-sidebar);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .new-chat-btn {
  width: 44px;
  padding: 10px;
  margin: 0 auto;
  font-size: 0;
  gap: 0;
}

.new-chat-btn:hover {
  background: var(--sidebar-item-hover);
}

.new-chat-btn svg {
  flex-shrink: 0;
  color: currentColor;
}

.nav-menu {
  overflow-y: auto;
  padding: 12px 8px;
  flex-shrink: 0;
}

.nav-item {
  padding: 4px 16px;
  margin-bottom: 4px;
  border-radius: 8px;
  color: var(--text-sidebar);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.sidebar.collapsed .nav-item {
  padding: 10px;
  margin: 0 auto 4px auto;
  width: 44px;
  justify-content: center;
  font-size: 0;
  gap: 0;
}

.nav-item:hover.sup {
  background: var(--background-sup);
}

.nav-item.active {
  background: var(--background-sup);
  font-weight: 500;
}

.nav-item.active.dash {
  background: var(--background-dash);
  font-weight: 500;
}
.nav-item:hover.dash {
  background: var(--background-dash);
}

.nav-item.active.fin {
  background: var(--background-fin);
  font-weight: 500;
}
.nav-item:hover.fin {
  background: var(--background-fin);
}

.nav-item.active.mov {
  background: #6b7280;
  font-weight: 500;
}
.nav-item:hover.mov {
  background: #4b5563;
}

.nav-item.active.comp {
  background: var(--background-comp);
  font-weight: 500;
}

.nav-item:hover.comp {
  background: var(--background-comp);
}

.submenu-item.sup.active {
  background: var(--background-sup);
  font-weight: 500;
}

.submenu-item:hover.sup {
  background: var(--background-sup);
  font-weight: 500;
}

.submenu-item.fin.active {
  background: var(--background-fin);
  font-weight: 500;
}

.submenu-item:hover.fin {
  background: var(--background-fin);
  font-weight: 500;
}

.submenu-item.audt.active {
  background: var(--background-comp);
  font-weight: 500;
}

.submenu-item:hover.audt {
  background: var(--background-comp);
  font-weight: 500;
}

.submenu-item.catweb.active {
  background: var(--background-comp);
  font-weight: 500;
}

.submenu-item:hover.catweb {
  background: var(--background-comp);
  font-weight: 500;
}

.submenu-item.dash.active {
  background: var(--background-comp);
  font-weight: 500;
}

.submenu-item:hover.dash {
  background: var(--background-comp);
  font-weight: 500;
}

.submenu-item.alerta.active {
  background: var(--background-comp);
  font-weight: 500;
}

.submenu-item:hover.alerta {
  background: var(--background-comp);
  font-weight: 500;
}

.submenu-item.gestc.active {
  background: var(--background-comp);
  font-weight: 500;
}

.submenu-item:hover.gestc {
  background: var(--background-comp);
  font-weight: 500;
}

.nav-item:hover.auto {
  background: var(--background-auto);
}

.nav-item.active.auto {
  background: var(--background-auto);
  font-weight: 500;
}

.nav-item.active.agentes {
  background: var(--background-sup);
  font-weight: 500;
}

.nav-item:hover.agentes {
  background: var(--background-sup);
}

.submenu-item.active.vendas {
  background: var(--background-auto);
  font-weight: 500;
}
.submenu-item:hover.vendas {
  background: var(--background-auto);
  font-weight: 500;
}

.submenu-item.active.compras {
  background: var(--background-auto);
  font-weight: 500;
}

.submenu-item:hover.compras {
  background: var(--background-auto);
  font-weight: 500;
}

.submenu-item.active.cobranca {
  background: var(--background-auto);
  font-weight: 500;
}

.submenu-item:hover.cobranca {
  background: var(--background-auto);
  font-weight: 500;
}

.submenu-item.active.mkt {
  background: var(--background-sup);
  font-weight: 500;
}

.submenu-item:hover.mkt {
  background: var(--background-sup);
  font-weight: 500;
}

.nav-item svg {
  flex-shrink: 0;
  color: currentColor;
}

.nav-arrow {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.nav-item.active .nav-arrow {
  transform: rotate(180deg);
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* ========== HISTÓRICO DE CONVERSAS ========== */
.chat-history {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-top: 1px solid var(--border-color);
  padding: 8px;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.sidebar.collapsed .chat-history {
  display: none;
}

.chat-history-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-sidebar-muted);
  padding: 6px 8px 8px;
  flex-shrink: 0;
}

.chat-history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-history-list::-webkit-scrollbar {
  width: 4px;
}
.chat-history-list::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 2px;
}

.chat-history-item {
  display: flex;
  flex-direction: column;
  padding: 3px 11px;
  border-radius: 22px;
  cursor: pointer;
  height: 29px;
  transition: background 0.15s ease;
  position: relative;
  min-width: 0;
  gap: 0;
}

.chat-history-item:hover {
  background: var(--sidebar-item-hover);
}

.chat-history-item.active {
  background: var(--sidebar-item-active);
  border-left: 3px solid var(--accent-primary);
  padding-left: 8px;
}

.chat-history-item.pinned {
  border-left: none;
}

.chat-history-top-row {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  min-height: 24px;
}

.chat-history-title {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sidebar);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  padding-bottom: 0;
  padding-right: 28px;
  cursor: pointer;
  position: relative;
}

.chat-history-kebab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-sidebar-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);

  /* Por padrão o menu kebab fica oculto e aparece apenas ao passar o mouse */
  opacity: 0;
  pointer-events: none;
}

.chat-history-item:hover .chat-history-kebab-btn,
.chat-history-item:focus-within .chat-history-kebab-btn {
  opacity: 1;
  pointer-events: auto;
}

.chat-history-kebab-btn svg {
  width: 12px;
  height: 12px;
}

.chat-history-pinned-indicator {
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--text-sidebar-muted);
  opacity: 0.95;
  flex-shrink: 0;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.chat-history-pinned-indicator svg {
  width: 18px;
  height: 18px;
}

.chat-history-item.pinned .chat-history-pinned-indicator {
  display: inline-flex;
}

.chat-history-item.pinned .chat-history-kebab-btn {
  opacity: 0;
  pointer-events: none;
}

.chat-history-item.pinned:hover .chat-history-kebab-btn,
.chat-history-item.pinned:focus-within .chat-history-kebab-btn {
  opacity: 1;
  pointer-events: auto;
}

.chat-history-item.pinned:hover .chat-history-pinned-indicator,
.chat-history-item.pinned:focus-within .chat-history-pinned-indicator {
  /* Mantém o ícone de fixado visível mesmo ao passar o mouse */
  display: inline-flex;
}

.chat-history-kebab-btn:hover {
  background: var(--input-bg);
  border-color: var(--border-color);
  color: var(--text-sidebar);
}

.chat-history-item.active .chat-history-title,
.chat-history-item.active .chat-history-pinned-indicator,
.chat-history-item.active .chat-history-kebab-btn {
  color: #fff;
}

.history-mini-menu {
  position: absolute;
  right: 0;
  top: 24px;
  min-width: 170px;
  background: var(--dropdown-panel-bg);
  border: 1px solid var(--dropdown-panel-border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 20;
}

.history-mini-menu.open {
  display: flex;
}

.history-mini-menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 7px 10px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--dropdown-item-color);
  font-size: 12px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.history-mini-menu-item:hover {
  background: var(--bg-tertiary);
}

.history-mini-menu-item.delete {
  color: var(--error-color);
}

.history-mini-menu-item.delete:hover {
  background: var(--error-bg);
}

.chat-history-title[title]:hover::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 12px;
  padding: 10px 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400;
  z-index: 10002;
  pointer-events: none;
  white-space: nowrap;
  max-width: none;
  width: max-content;
  animation: tooltipSlideIn 0.2s ease-out;
}

@keyframes tooltipSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

.sidebar.collapsed .chat-history-title[title]:hover::after {
  left: 60px;
}

/* Hover menu */
.chat-history-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--border-color);
  margin-top: 4px;
  animation: fadeInMenu 0.12s ease;
}

@keyframes fadeInMenu {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-history-item:hover .chat-history-menu {
  display: flex;
}

.chat-history-date {
  display: none;
}

.chat-history-date svg {
  flex-shrink: 0;
  color: var(--text-sidebar-muted);
}

.chat-history-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.chat-history-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 3px 7px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  color: var(--text-sidebar);
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.chat-history-action-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.chat-history-action-btn.admin-action:hover {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
  color: #fff;
}

.chat-history-action-btn.pin-action:hover {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
}

.chat-history-action-btn.delete-action:hover {
  background: var(--error-bg);
  border-color: var(--error-color);
  color: var(--error-color);
}

.chat-history-empty {
  font-size: 12px;
  color: var(--text-sidebar-muted);
  text-align: center;
  padding: 16px 8px;
  line-height: 1.5;
}

.submenu {
  padding-left: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 0 0 14px;
}

.submenu.expanded {
  max-height: 500px;
  padding: 0 0 0 14px;
}

.submenu.level-2 {
  padding-left: 48px;
}

.submenu-item {
  padding: 4px 16px;
  margin-bottom: 4px;
  border-radius: 8px;
  color: var(--text-sidebar);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
}

.submenu-item:hover {
  background: var(--sidebar-item-hover);
}

.submenu-item.active {
  background: var(--sidebar-item-active);
  font-weight: 500;
}

.sidebar.collapsed .submenu-item {
  padding: 10px;
  margin: 0 auto 4px auto;
  width: 44px;
  justify-content: center;
  font-size: 0;
  gap: 0;
}

.submenu-item svg {
  flex-shrink: 0;
  color: currentColor;
}

.submenu-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.dev-badge {
  margin-left: auto;
  font-size: 8px;
  padding: 2px 4px;
  border-radius: 3px;
  background: var(--destaque-badge);
  color: var(--destaque-text);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.sidebar.collapsed .dev-badge {
  display: none;
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding: 5px 5px;
  padding-bottom: calc(5px + env(safe-area-inset-bottom));
  transition: border-color 0.3s ease;
  position: relative;
  margin-top: auto;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-footer {
  overflow: visible;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-sidebar);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.sidebar.collapsed .user-info {
  justify-content: center;
  padding: 8px;
  overflow: visible;
}

.sidebar.collapsed .user-details,
.sidebar.collapsed .settings-icon {
  display: none !important;
}

.user-info:hover {
  background: var(--sidebar-item-hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  color: var(--text-sidebar);
}

.user-email {
  font-size: 11px;
  color: var(--text-sidebar-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.user-menu-arrow {
  flex-shrink: 0;
  color: var(--text-sidebar-muted);
  transition: transform 0.2s ease;
}

.user-info.active .user-menu-arrow {
  transform: rotate(180deg);
}

.sidebar.collapsed .user-menu-arrow {
  display: none !important;
}

/* User Dropdown Menu */
.user-dropdown {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 10px;
  right: 10px;
  background: transparent;
  border-radius: 20px;
  padding: 0;
  box-shadow: none;
  border: none;
  z-index: 1000;
  animation: dropdownSlideUp 0.24s ease-out;
}

@keyframes dropdownSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  width: 100%;
  padding: 11px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--dropdown-item-color);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-family: inherit;
}

.dropdown-item:hover {
  background: var(--bg-secondary);
}

.dropdown-item svg {
  flex-shrink: 0;
  color: var(--dropdown-item-icon);
  opacity: 0.85;
  width: 18px;
  height: 18px;
}

.dropdown-item-static {
  cursor: default;
}

.dropdown-item-static:hover {
  background: transparent;
}

.dropdown-divider {
  height: 1px;
  background: var(--dropdown-panel-divider);
  margin: 4px 0;
}

.sidebar.collapsed .user-dropdown {
  bottom: calc(100% + 10px);
  min-width: 240px;
  right: auto;
}

.dropdown-menu-panel {
  background: var(--dropdown-panel-bg);
  border: 1px solid var(--dropdown-panel-border);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.dropdown-item-admin,
.dropdown-item-logout {
  cursor: pointer;
}

.dropdown-item-registro {
  justify-content: flex-start;
  font-size: 13px;
  padding-top: 10px;
  padding-bottom: 10px;
  opacity: 0.7;
}

.dropdown-item-registro .menu-text {
  width: 100%;
  color: var(--dropdown-item-color);
  font-weight: 400;
  text-align: left;
}

.dropdown-item .menu-text {
  font-weight: 400;
}

.dropdown-item-logout {
  color: var(--dropdown-item-color);
}

.dropdown-item-logout:hover,
.dropdown-item-admin:hover,
.dropdown-item-agents:hover {
  background: var(--bg-secondary);
}

/* Header de informações do usuário quando sidebar colapsado */
.user-dropdown-header {
  display: none;
}

.sidebar.collapsed .user-dropdown-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--dropdown-panel-divider);
  margin-bottom: 2px;
  background: var(--dropdown-collapsed-header-bg);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.sidebar.collapsed .user-dropdown-name {
  font-size: 13px;
  font-weight: 400;
  color: var(--dropdown-collapsed-name-color);
}

.sidebar.collapsed .user-dropdown-email {
  font-size: 11px;
  color: var(--dropdown-collapsed-email-color);
  word-break: break-all;
}

.settings-icon {
  background: transparent;
  border: none;
  color: var(--text-sidebar-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.settings-icon:hover {
  background: var(--sidebar-item-active);
  color: var(--text-sidebar);
}

.btn-logout {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  color: var(--text-sidebar);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .btn-logout {
  width: 44px;
  padding: 10px;
  margin: 8px auto 0 auto;
  font-size: 0;
  gap: 0;
}

.btn-logout:hover {
  background: var(--sidebar-item-hover);
  color: var(--error-color);
  border-color: var(--error-color);
}

.btn-logout svg {
  flex-shrink: 0;
  color: currentColor;
}

/* ========== MOBILE HEADER ========== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--sidebar-bg);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  z-index: 1001;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mobile-menu-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-sidebar);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.mobile-menu-btn:hover {
  background: var(--sidebar-item-hover);
}

.mobile-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-sidebar);
  font-weight: 600;
  font-size: 16px;
}

.mobile-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-theme-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-sidebar);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.mobile-theme-toggle:hover {
  background: var(--sidebar-item-hover);
}

.mobile-theme-toggle svg {
  flex-shrink: 0;
}

/* Theme Toggle - Top Right Corner */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

.theme-toggle svg {
  flex-shrink: 0;
  color: currentColor;
}

/* ========== ÁREA PRINCIPAL DE CONTEÚDO ========== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
  transition: background-color 0.3s ease;
}

.chat-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  background: var(--bg-primary);
  padding: 24px 0;
}

.chat-container {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.messages-container {
  flex: 1;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding-bottom: 370px;
  width: 100%;
  min-height: 60vh;
}

.welcome-icon {
  margin-bottom: 24px;
  color: var(--accent-primary);
}

.welcome-screen h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

.welcome-screen p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  transition: color 0.3s ease;
}

.audit-welcome {
  justify-content: center;
  padding-bottom: 370px;
}
