* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========== VARIÁVEIS DE TEMA - IDENTIDADE VISUAL SOPHIA ========== */
:root {
  /* Light Theme (padrão) */
  --bg-primary: #ffffff;
  --bg-secondary: #12528a3d;
  --bg-tertiary: #f9fafb;
  --dropdown-panel-bg: #ffffff;
  --dropdown-panel-border: #d1d5db;
  --dropdown-panel-divider: #e5e5e5;
  --dropdown-item-color: #2d2d2d;
  --dropdown-item-icon: #12528a;
  --dropdown-collapsed-header-bg: #f9fafb;
  --dropdown-collapsed-name-color: #1a1a1a;
  --dropdown-collapsed-email-color: #12528a;
  --sidebar-bg: #12528a;
  --sidebar-item-hover: #0d3a5f;
  --sidebar-item-active: #0a2d4a;
  --text-primary: #2d2d2d;
  --text-secondary: #6e6e80;
  --background-dash: #026025;
  --background-sup: #0a2d4a;
  --background-fin: #c8a956;
  --background-comp: #743637;
  --background-auto: #2a1a35;
  --text-sidebar: #ffffff;
  --destaque-text: #ffffff;
  --text-sidebar-muted: #d0e1f0;
  --border-color: #e5e5e5;
  --border-input: #c4c4c4;
  --input-bg: #12528a3d;
  --card-border: #d1d5db;
  --accent-primary: #12528a;
  --accent-secondary: #ca993b;
  --accent-hover: #0d3a5f;
  --message-user-bg: #12528a;
  --message-bot-bg: #f7f7f8;
  --destaque-badge: #ff6200c7;
  --error-color: #ef4444;
  --error-bg: #ffe5e5;
  --cancel-btn: #95a5a6;
  --cancel-btn-hover: #7f8c8d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
  --scrollbar-thumb: #c4c4c4;
  --scrollbar-thumb-hover: #a0a0a0;
  --scrollbar-sidebar: #0a2d4a;
  --scrollbar-sidebar-hover: #0d3a5f;
  --input-border: #12528a3d;
}

body.dark-theme {
  /* Dark Theme */
  --bg-primary: #000000;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2d2d2d;
  --dropdown-panel-bg: #070809;
  --dropdown-panel-border: #2d3235;
  --dropdown-panel-divider: #2f3538;
  --dropdown-item-color: #e6f8ff;
  --dropdown-item-icon: #e6f8ff;
  --dropdown-collapsed-header-bg: #070809;
  --dropdown-collapsed-name-color: #e6f8ff;
  --dropdown-collapsed-email-color: #9cddeb;
  --sidebar-bg: #000000;
  --sidebar-item-hover: #1a1a1a;
  --sidebar-item-active: #2d2d2d;
  --text-primary: #ffffff;
  --text-secondary: #b4b4b4;
  --text-sidebar: #ffffff;
  --text-sidebar-muted: #8e8e93;
  --border-color: #2d2d2d;
  --border-input: #404040;
  --background-dash: #026025;
  --background-sup: #0a2d4a;
  --background-fin: #9f7f29;
  --background-comp: #743637;
  --background-auto: #2a1a35;
  --input-bg: #1a1a1a;
  --card-border: #404040;
  --accent-primary: #12528a;
  --accent-secondary: #ca993b;
  --accent-hover: #0d3a5f;
  --message-user-bg: #12528a;
  --message-bot-bg: #1a1a1a;
  --error-color: #ef4444;
  --destaque-badge: #ff6200c7;
  --destaque-text: #ffffff;
  --error-bg: #3d1a1a;
  --cancel-btn: #6c7a89;
  --cancel-btn-hover: #57606f;
  --shadow-sm: 0 1px 2px rgba(255, 255, 255, 0.05);
  --shadow-md: 0 4px 16px rgba(255, 255, 255, 0.1);
  --shadow-lg: 0 6px 24px rgba(255, 255, 255, 0.15);
  --scrollbar-thumb: #404040;
  --scrollbar-thumb-hover: #555;
  --scrollbar-sidebar: #1a1a1a;
  --scrollbar-sidebar-hover: #2d2d2d;
  --input-border: #347cbc;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.history-action-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  pointer-events: none;
  z-index: 12000;
  background: var(--dropdown-panel-bg);
  color: var(--dropdown-item-color);
  border: 1px solid var(--dropdown-panel-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.history-action-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== TELA DE LOGIN ========== */
.login-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--accent-primary) 0%,
    var(--accent-hover) 100%
  );
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.login-box {
  background: var(--bg-primary);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 420px;
  animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo {
  height: 80px;
  width: auto;
  border-radius: 8px;
  margin-bottom: 15px;
}

.login-header h1 {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.password-input-group {
  position: relative;
}

.password-input-group input {
  padding-right: 48px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  outline: none;
}

.toggle-password:hover {
  color: var(--accent-primary);
}

.toggle-password:focus {
  color: var(--accent-primary);
}

.toggle-password svg {
  width: 20px;
  height: 20px;
}

.input-group input {
  padding: 12px 16px;
  border: 1px solid var(--accent-primary);
  border-radius: 6px;
  font-size: 15px;
  transition: all 0.2s ease;
  outline: none;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.input-group input:focus {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 3px rgba(18, 82, 138, 0.1);
}

.error-message {
  color: var(--error-color);
  font-size: 14px;
  text-align: center;
  min-height: 20px;
  font-weight: 500;
}

.btn-primary {
  padding: 14px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 10px;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* ========== 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.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;
}

.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;
}

.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: center;
  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;
}

/* ========== DASHBOARD VIEW ========== */
.chat-wrapper.dashboard-mode {
  align-items: stretch;
  justify-content: flex-start;
  padding: 20px 20px 32px;
  margin-top: 0;
}

.dashboard-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.dashboard-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1024px) {
  .dashboard-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }
}

.dashboard-card {
  background: var(--bg-primary);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-card-header .icon {
  font-size: 20px;
}

.dashboard-card-header .title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dashboard-card-header .value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.dashboard-card-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}

.dashboard-card-legend .legend {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-secondary);
}

.donut-chart {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  margin: 0 auto;
  position: relative;
  background: conic-gradient(var(--accent-primary) 0 0);
}

.donut-chart::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: var(--bg-primary);
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-align: center;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 10px;
  line-height: 1.2;
}

.receitas-chart {
  background: conic-gradient(
    rgba(34, 197, 94, 0.85) 0% 42%,
    rgba(37, 99, 235, 0.85) 42% 68%,
    rgba(234, 179, 8, 0.85) 68% 100%
  );
}

.despesas-chart {
  background: conic-gradient(
    rgba(240, 68, 36, 0.85) 0% 45%,
    rgba(245, 158, 11, 0.85) 45% 70%,
    rgba(168, 85, 247, 0.85) 70% 100%
  );
}

.dashboard-info {
  display: grid;
  gap: 10px;
}

.dashboard-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-secondary);
}

.dashboard-info-row.necessidade {
  background: rgba(255, 98, 0, 0.12);
}

.info-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.info-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.pagar-receber-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pagar-receber-card {
  padding: 14px 12px;
  border-radius: 16px;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pagar-receber-card.receber {
  background: rgba(14, 165, 233, 0.12);
}

.pagar-receber-card.pagar {
  background: rgba(239, 68, 68, 0.12);
}

.pagar-receber-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pagar-receber-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.pagar-receber-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ========== MOVIMENTO FINANCEIRO ========== */
.movement-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 26px;
}

/* ========== ALERTAS DE COMPLIANCE ========== */
.alert-container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 0;
}

.alert-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.alert-icon {
  color: var(--error-color);
}

.alert-welcome h1 {
  font-size: 26px;
  color: var(--text-primary);
}

.alert-welcome p {
  font-size: 14px;
  color: var(--text-secondary);
}

.alert-list {
  display: grid;
  gap: 12px;
}

.alert-item {
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alert-item.warning {
  border-left: 4px solid #f59e0b;
}

.alert-item.info {
  border-left: 4px solid #3b82f6;
}

.alert-item.danger {
  border-left: 4px solid var(--error-color);
}

.alert-title {
  font-weight: 700;
  color: var(--text-primary);
}

.alert-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.movement-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 880px) {
  .movement-summary {
    grid-template-columns: repeat(1, 1fr);
  }
}

.movement-card {
  background: var(--bg-primary);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.movement-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.movement-card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.movement-card-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.movement-card.entrada {
  border-left: 4px solid rgba(34, 197, 94, 0.85);
}

.movement-card.saida {
  border-left: 4px solid rgba(239, 68, 68, 0.85);
}

.movement-card.saldo {
  border-left: 4px solid rgba(59, 130, 246, 0.85);
}

.movement-table-wrapper {
  background: var(--bg-primary);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow: hidden;
}

.movement-table-body {
  overflow-y: auto;
  max-height: 280px;
}

.movement-table-body::-webkit-scrollbar {
  width: 8px;
}

.movement-table-body::-webkit-scrollbar-thumb {
  background: var(--border-input);
  border-radius: 999px;
}

.movement-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.movement-table-header span {
  font-weight: 600;
  color: var(--text-primary);
}

.btn-small {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-input);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-small:hover {
  background: var(--bg-tertiary);
}

.movement-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.movement-table th,
.movement-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}

.movement-table th {
  font-weight: 600;
  color: var(--text-secondary);
}

.movement-table tbody tr:hover {
  background: var(--bg-tertiary);
}

.movement-table .type {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.movement-table .type.entrada {
  color: rgba(34, 197, 94, 0.95);
}

.movement-table .type.saida {
  color: rgba(239, 68, 68, 0.95);
}

.movement-table .value {
  font-weight: 700;
  color: var(--text-primary);
}

/* Suggestion Cards */
.suggestion-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 768px;
  margin-top: 190px;
  padding: 0 20px;
}

.suggestion-card {
  background: var(--bg-primary);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  min-height: 52px;
}

.suggestion-card:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  box-shadow: 0 2px 6px rgba(16, 163, 127, 0.12);
  transform: translateY(-1px);
}

.suggestion-card:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.suggestion-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.suggestion-text {
  flex: 1;
  line-height: 1.4;
  font-weight: 400;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ========== MENSAGENS ========== */
.message-wrapper {
  margin-bottom: 24px;
}

.message-wrapper.user {
  display: flex;
  justify-content: flex-end;
}

.message-wrapper.bot {
  display: flex;
  justify-content: flex-start;
}

.messages-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-inner {
  max-width: 85%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-header {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0 4px;
  transition: color 0.3s ease;
}

.message {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
  word-wrap: break-word;
  transition: all 0.3s ease;
}

.message.user {
  background: var(--message-user-bg);
  color: white;
  border-bottom-right-radius: 4px;
}

.message.bot {
  background: var(--message-bot-bg);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

/* Formatação Markdown nas mensagens */
.message.bot p {
  margin: 0 0 10px 0;
}

.message.bot p:last-child {
  margin-bottom: 0;
}

.message.bot ul,
.message.bot ol {
  margin: 8px 0;
  padding-left: 20px;
}

.message.bot li {
  margin: 4px 0;
}

.message.bot a {
  color: var(--accent-primary);
  text-decoration: underline;
  font-weight: 500;
}

.message.bot a:hover {
  color: var(--accent-hover);
}

.message.bot code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 14px;
}

.message.bot pre {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 10px 0;
  border: 1px solid var(--border-color);
}

.message.bot pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* SQL Query Block */
.sql-query-block {
  margin-top: 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}

.sql-query-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  transition:
    background 0.15s,
    color 0.15s;
}

.sql-query-toggle:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.sql-query-toggle span {
  flex: 1;
}

.sql-chevron {
  transition: transform 0.2s;
}

.sql-query-block.open .sql-chevron {
  transform: rotate(180deg);
}

.sql-query-block.open .sql-query-toggle {
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.sql-query-content {
  display: none;
  position: relative;
  background: var(--bg-secondary);
}

.sql-query-block.open .sql-query-content {
  display: block;
}

.sql-query-content pre {
  margin: 0;
  padding: 12px 14px;
  padding-top: 36px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow-x: auto;
}

.sql-query-content pre code {
  background: transparent;
  padding: 0;
  color: var(--text-primary);
  font-family: "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.6;
}

.sql-copy-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 3px 10px;
  font-size: 11px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.sql-copy-btn:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.typing-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

.typing-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.25s ease-in-out infinite;
}

/* 🌞 LIGHT MODE */
body:not(.dark-theme) .typing-dot {
  background: #555;
}

/* 🌙 DARK MODE */
body.dark-theme .typing-dot {
  background: #ccc;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.6);
    opacity: 1;
  }
}

.message.bot {
  padding: 10px 14px;
  border-radius: 12px;
  display: inline-block;
  max-width: 95%;
  width: 100%;
  font-size: 12px;
}

/* 🌞 LIGHT  */
body:not(.dark-theme) .message.bot {
  background: #f1f1f1;
  color: #000;
}

/* 🌙 DARK */
body.dark-theme .message.bot {
  background: #2a2a2a;
  color: #fff;
}
/* ========== INPUT CONTAINER ========== */
.input-container {
  display: flex;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  padding: 24px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 10;
  transition: all 0.3s ease;
}

.input-action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  gap: 10px;
}

.input-text-box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.btn-new-chat {
  background: var(--accent-primary);
  color: white;
  border: none;
  justify-content: center;
  text-align: center;
  align-items: center;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 110px;
  height: 46px;
  flex-shrink: 0;
}

.btn-new-chat:hover {
  background: var(--accent-hover);
}

.input-wrapper {
  max-width: calc(100% - 126px);
  width: 100%;
  min-width: 300px;
}

.input-wrapper textarea {
  width: 100%;
}

.input-container.centered {
  position: absolute;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  border-top: none;
}

.input-container.fixed-bottom {
  position: sticky;
  bottom: 0;
  top: auto;
  transform: none;
}

.input-wrapper {
  max-width: 680px;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: 12px;
  padding: 12px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
}

.input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 6px 24px rgba(18, 82, 138, 0.35);
}

#messageInput {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  min-height: 24px;
  max-height: 200px;
  line-height: 1.6;
  color: var(--text-primary);
  background: transparent;
}

#messageInput::placeholder {
  color: var(--text-secondary);
}

.new-chat-wrapper {
  /* display: flex; */
  justify-content: center;
  margin-bottom: 8px;
  /* width: 100%; */
}

.btn-new-message {
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  font-weight: 600;
}

.btn-new-message:hover {
  background: var(--accent-hover);
}

.btn-new-message:hover {
  background: var(--bg-tertiary);
}

.message-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  min-height: 24px;
  max-height: 200px;
  line-height: 1.6;
  color: var(--text-primary);
  background: transparent;
}

.message-input::placeholder {
  color: var(--text-secondary);
}

.btn-send {
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}

.btn-send .send-icon {
  display: block;
  transition: opacity 0.2s ease;
}

.btn-send .lock-icon {
  display: none;
  transition: opacity 0.2s ease;
}

.btn-send:disabled .send-icon {
  display: none;
}

.btn-send:disabled .lock-icon {
  display: block;
  stroke: #ff6b6b;
  animation: lockPulse 1.5s ease-in-out infinite;
}

@keyframes lockPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.btn-send:hover {
  background: var(--accent-hover);
}

.btn-send:disabled {
  background: var(--bg-tertiary);
  cursor: not-allowed;
  opacity: 0.9;
}

.btn-send:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-send.generating {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  opacity: 1;
}

.btn-send.generating .send-icon {
  display: none;
}

.btn-send.generating .lock-icon {
  display: none;
}

.btn-send.generating .stop-gen-icon {
  display: block !important;
  color: var(--text-primary);
}

.btn-send.generating:hover {
  background: var(--bg-secondary);
}

/* ========== COPY BUTTON ========== */
.msg-actions {
  display: flex;
  gap: 4px;
  position: absolute;
  top: 4px;
  right: -44px;
  opacity: 1;
}

.message.bot {
  position: relative;
  width: 100%;
  max-width: 920px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.5;
  word-wrap: break-word;
  margin-bottom: 8px;
}

.message.user {
  width: 100%;
  max-width: 920px;
  padding: 14px 18px;
  background: var(--message-user-bg);
  color: #fff;
  border-radius: 16px;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.btn-copy {
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.btn-copy svg {
  display: block;
  flex-shrink: 0;
}

.btn-copy:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

.btn-copy:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.btn-copy:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.btn-copy.copied {
  background: var(--bg-secondary);
  border-color: #22c55e;
  color: #22c55e;
}

/* ========== AUDIO RECORD BUTTON ========== */
/* ========== AUDIO RECORDING UI (estilo WhatsApp) ========== */

/* Barra de gravação – flex item dentro do input-wrapper */
.audio-rec-bar {
  display: none;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

/* Mostrar barra + esconder textarea e btn-send durante gravação */
.input-wrapper.is-recording .audio-rec-bar {
  display: flex;
}
.input-wrapper.is-recording #messageInput {
  display: none;
}
.input-wrapper.is-recording .btn-send {
  display: none;
}

/* Cancelar (lixeira): visível só no mode bloqueado */
.audio-rec-cancel {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--error-color, #ef4444);
  padding: 6px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.audio-rec-cancel:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Dica de deslizar: visível ANTES de bloquear */
.audio-rec-slide {
  display: none;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 13px;
  flex: 1;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  transition:
    opacity 0.2s ease,
    transform 0.15s ease;
}

/* Dot + timer */
.audio-rec-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.audio-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: recDotBlink 1s ease-in-out infinite;
}
@keyframes recDotBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.15;
  }
}
.audio-rec-time {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
}

/* Não-bloqueado: cancelar escondido, slide visível */
.input-wrapper.is-recording:not(.is-locked) .audio-rec-cancel {
  display: none;
}
.input-wrapper.is-recording:not(.is-locked) .audio-rec-slide {
  display: flex;
}

/* Bloqueado: slide escondido, cancelar visível */
.input-wrapper.is-locked .audio-rec-slide {
  display: none;
}
.input-wrapper.is-locked .audio-rec-cancel {
  display: flex;
}

/* Cadeado flutuante acima do botão mic */
.audio-lock-hint {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 55px; /* posição aproximada acima do btn-audio */
  width: 34px;
  height: 34px;
  background: var(--accent-primary);
  color: white;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  z-index: 20;
  transition:
    transform 0.15s ease,
    background 0.2s ease;
  user-select: none;
}
.audio-lock-hint:hover {
  transform: scale(1.1);
}
.audio-lock-hint.is-locked-state {
  background: #25d366;
}
.input-wrapper.is-recording:not(.is-locked) .audio-lock-hint {
  display: flex;
}

/* Botão enviar áudio (modo bloqueado) */
.audio-rec-send-btn {
  display: none;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 40px;
  min-height: 40px;
  transition:
    background 0.2s ease,
    transform 0.1s ease;
}
.audio-rec-send-btn:hover {
  background: var(--accent-hover);
}
.audio-rec-send-btn:active {
  transform: scale(0.95);
}

/* No modo bloqueado: esconder mic, mostrar send */
.input-wrapper.is-locked #btnGravar {
  display: none;
}
.input-wrapper.is-locked .audio-rec-send-btn {
  display: flex;
}

.btn-audio {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}

.btn-audio:hover {
  color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.btn-audio.recording {
  color: #ff4444;
  animation: micPulse 1.2s ease-in-out infinite;
}

@keyframes micPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.btn-audio:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Input Disclaimer */
.input-disclaimer {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 16px 0 130px;
  line-height: 1.4;
  max-width: 768px;
  margin: 8px auto 0 auto;
  width: 100%;
  order: 2;
}

.send-btn {
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.send-btn:hover {
  background: var(--accent-hover);
}

.send-btn:disabled {
  background: var(--bg-tertiary);
  cursor: not-allowed;
}

.send-btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* ========== MODAL DE ADMIN ========== */
.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.admin-create-card {
  width: 92%;
  max-width: 640px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  margin: auto;
  overflow: hidden;
  animation: scaleIn 0.25s ease;
}

.admin-create-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.admin-create-header h3 {
  margin: 0;
  font-size: 15px;
  color: var(--text-primary);
}

.admin-create-body {
  padding: 16px 20px 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px 14px;
}

.admin-form-row-2cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.admin-form-group-full {
  grid-column: auto;
}

.admin-create-body .admin-form-group {
  margin: 0;
}

.admin-create-card .admin-form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #c7d4df;
}

.admin-create-card .admin-input,
.admin-create-card input[type="text"],
.admin-create-card input[type="email"],
.admin-create-card input[type="tel"],
.admin-create-card input[type="password"] {
  width: 100%;
  height: 34px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 12px;
  padding: 0 10px;
}

.admin-create-card .admin-input::placeholder,
.admin-create-card input::placeholder {
  color: var(--text-secondary);
}

.admin-create-card .admin-input:focus,
.admin-create-card input:focus {
  outline: none;
  border-color: #1b76b2;
  box-shadow: 0 0 0 2px rgba(27, 118, 178, 0.2);
}

.admin-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid #1f2a35;
  grid-column: 1 / -1;
}

.admin-create-card .admin-cancel-btn {
  background: var(--cancel-btn);
  color: white;
  border: none;
}

.admin-create-card .admin-save-btn {
  background: #0b5f96;
  color: #ffffff;
  border: none;
}

.admin-create-card .admin-save-btn:hover {
  background: #0f74b5;
}

@media (max-width: 680px) {
  .admin-create-body {
    grid-template-columns: 1fr;
  }

  .admin-create-body .admin-form-group:nth-of-type(1),
  .admin-create-body .admin-form-group:nth-of-type(2) {
    grid-column: auto;
  }
}

.admin-users-card {
  width: 92%;
  max-width: 560px;
  background: var(--bg-primary);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  margin: auto;
  overflow: hidden;
  animation: scaleIn 0.25s ease;
}

.admin-main-card {
  width: 92%;
  max-width: 420px;
  background: var(--bg-primary);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  margin: auto;
  overflow: hidden;
  animation: scaleIn 0.25s ease;
}

.admin-main-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-main-option {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-main-option:hover {
  background: var(--input-bg);
  border-color: var(--accent-primary);
}

.admin-users-body {
  padding: 18px 20px;
}

.admin-users-list {
  min-height: 300px;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-tertiary);
  padding: 8px;
}

body:not(.dark-theme) .admin-users-list {
  background: var(--bg-tertiary);
}

.admin-users-placeholder {
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  padding: 14px;
}

.admin-user-item {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  margin-bottom: 8px;
}

.admin-user-item:last-child {
  margin-bottom: 0;
}

.admin-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.admin-user-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.admin-users-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.admin-conexao-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

/* Painel Lateral do Modal */
.admin-sidebar {
  width: 300px;
  background: var(--bg-primary);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
  animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.admin-sidebar-header {
  padding: 25px;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(
    135deg,
    var(--accent-primary) 0%,
    var(--accent-hover) 100%
  );
}

.admin-sidebar-header h2 {
  color: white;
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.close-modal-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  border-radius: 4px;
}

.close-modal-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

/* ========== FILTROS DO SIDEBAR ========== */
.sidebar-filters {
  padding: 20px 15px;
  background: transparent;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  margin: 15px;
  margin-bottom: 20px;
}

.filters-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 15px;
  margin-top: 0;
}

.filter-group {
  position: relative;
}

.filter-dropdown-container {
  position: relative;
  width: 100%;
}

.filter-dropdown-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 2px solid var(--accent-primary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.filter-dropdown-btn:hover {
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
}

.filter-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-input);
  border-radius: 0 0 6px 6px;
  margin-top: -1px;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  max-height: 250px;
  flex-direction: column;
}

.filter-dropdown-content.show {
  display: flex;
}

.dropdown-search {
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
}

.dropdown-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 13px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.dropdown-options {
  overflow-y: auto;
  flex: 1;
}

.dropdown-option {
  padding: 10px 15px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
}

.dropdown-option:hover {
  background: var(--bg-secondary);
}

.dropdown-option.selected {
  background: var(--accent-primary);
  color: white;
}

.agents-list {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  position: relative;
}

.agent-item {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 20px;
  border-radius: 8px;
  background: var(--bg-secondary);
  margin-bottom: 12px;
  cursor: pointer;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    opacity 0.2s ease;
  border: 2px solid transparent;
  position: relative;
}

/* Cores de fundo para cada tipo de agente */
.agent-item.agent-suporte {
  background: var(--background-sup);
}

.agent-item.agent-financeiro {
  background: var(--background-fin);
}

.agent-item.agent-auditoria {
  background: var(--background-comp);
}

/* Ajustar cor do texto para contrastar com o fundo escuro */
.agent-item.agent-suporte .agent-name,
.agent-item.agent-suporte .agent-role {
  color: #ffffff;
}

.agent-item.agent-financeiro .agent-name {
  color: #2d2d2d;
}

.agent-item.agent-financeiro .agent-role {
  color: #4a4a4a;
}

.agent-item.agent-auditoria .agent-name,
.agent-item.agent-auditoria .agent-role {
  color: #ffffff;
}

/* Agentes indentados (filhos) */
.agent-item.agent-child {
  margin-left: 40px;
  margin-top: 8px;
  margin-bottom: 8px;
}

/* Linha vertical do pai descendo para os filhos */
.agent-item.agent-parent::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 100%;
  width: 2px;
  height: var(--line-height, 40px);
  background: var(--border-color);
  z-index: 0;
}

/* Linha horizontal conectando o filho à linha vertical */
.agent-item.agent-child::before {
  content: "";
  position: absolute;
  left: -30px;
  top: calc(50% - 1px);
  width: 30px;
  height: 2px;
  background: var(--border-color);
}

/* Linha vertical conectando múltiplos filhos - filhos do meio */
.agent-item.agent-child:not(.last-child):not(.first-child)::after {
  content: "";
  position: absolute;
  left: -30px;
  top: -8px;
  width: 2px;
  height: calc(100% + 16px);
  background: var(--border-color);
}

/* Primeiro filho - linha vertical desce */
.agent-item.agent-child.first-child:not(.last-child)::after {
  content: "";
  position: absolute;
  left: -30px;
  top: 50%;
  width: 2px;
  height: calc(50% + 8px);
  background: var(--border-color);
}

/* Último filho - linha vertical sobe */
.agent-item.agent-child.last-child:not(.first-child)::after {
  content: "";
  position: absolute;
  left: -30px;
  top: -8px;
  width: 2px;
  height: calc(50% + 8px);
  background: var(--border-color);
}

.agent-item:hover {
  opacity: 0.9;
}

.agent-item.agent-child:hover {
  opacity: 0.9;
}

.agent-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.agent-item.active {
  border-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Estilos de ícone removidos - sem círculos */

.agent-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-name:empty::after,
.agent-role:empty::after {
  content: "Sem informação";
  opacity: 0.5;
}

.agent-role {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Esconder elementos com texto undefined */
.agent-item *:not(.agent-info):not(.agent-name):not(.agent-role) {
  display: none;
}

/* Modal de Edição do Agente */
.agent-edit-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.agent-edit-content {
  background: var(--bg-primary);
  border-radius: 12px;
  width: 90vw;
  max-width: 1100px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
}

.agent-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 25px;
  border-bottom: 2px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.agent-edit-header h3 {
  color: var(--accent-primary);
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

#importModelBtn {
  padding: 8px 16px;
  font-size: 12px;
  background: linear-gradient(135deg, #12528a 0%, #0d3a5f 100%);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

#importModelBtn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(18, 82, 138, 0.3);
}

#importModelBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ========== ESTILO DE BOX PARA EMPRESA NO MODAL DE AGENTES ========== */
.empresa-filter-box {
  padding: 15px;
  border: 2px solid var(--accent-primary);
  border-radius: 8px;
  background: transparent;
}

.empresa-filter-box label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  margin-top: 0;
}

.empresa-filter-box label.modelo-ia-label {
  margin-top: 20px;
  margin-bottom: 12px;
}

.empresa-filter-box select.admin-select {
  width: 100% !important;
  padding: 12px 16px !important;
  background: var(--bg-primary) !important;
  border: 2px solid var(--accent-primary) !important;
  border-radius: 6px !important;
  color: var(--text-primary) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  margin-bottom: 0;
}

.empresa-filter-box select.admin-select:hover {
  background: var(--bg-secondary) !important;
}

.empresa-filter-box select.admin-select:focus {
  outline: none !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(18, 82, 138, 0.1) !important;
}

.close-edit-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  border-radius: 4px;
}

.close-edit-btn:hover {
  color: var(--error-color);
  background: var(--error-bg);
}

.agent-edit-body {
  padding: 25px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Layout de duas colunas para edição do agente */
.agent-form-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.95fr;
  gap: 15px;
  height: 100%;
}

.form-right-column {
  padding: 12px;
  gap: 10px;
  min-width: 260px;
}

.admin-form-group {
  margin-bottom: 10px;
}

.admin-form-group label {
  font-size: 11px;
  margin-bottom: 4px;
}

.admin-select,
.admin-input {
  font-size: 11px;
  padding: 8px 10px;
}

.form-left-column {
  display: flex;
  flex-direction: column;
}

.form-left-column .admin-form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-left-column .admin-textarea {
  flex: 1;
  min-height: 300px;
}

.form-right-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-bottom: 0;
  overflow-y: auto;
  min-width: 320px !important;
  /* background: rgba(255, 255, 255, 0.035); visual debug */
}

.form-right-column .admin-form-group {
  /* background: rgba(255, 255, 255, 0.04); */
  padding: 8px;
  border-radius: 6px;
  display: block !important;
}

.form-right-column .admin-form-group label {
  font-size: 11px;
  margin-bottom: 4px;
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

.admin-form-row-2cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.agent-edit-footer {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  padding: 5px 25px;
  border-top: 2px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

/* Formulários Admin */
.admin-form-group {
  margin-bottom: 15px;
}

.admin-form-group:last-child {
  margin-bottom: 0;
}

.admin-form-group label {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 12px;
}

.admin-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--input-border);
  border-radius: 6px;
  font-size: 12px;
  transition: all 0.3s ease;
  outline: none;
  font-family: inherit;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.admin-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

/* === ESTILOS PARA CAMPO DE NOME BLOQUEADO === */
.locked-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.admin-input-locked {
  cursor: not-allowed !important;
  background: linear-gradient(
    135deg,
    var(--bg-primary) 0%,
    var(--input-bg) 100%
  ) !important;
  opacity: 0.75;
  color: var(--text-secondary) !important;
}

.admin-input-locked:hover {
  cursor: not-allowed !important;
  border-color: var(--input-border);
}

.admin-input-locked:focus {
  border-color: var(--input-border);
  box-shadow: none;
  outline: none;
}

.lock-overlay {
  position: absolute;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
  pointer-events: none;
}

.lock-overlay svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-secondary);
  opacity: 0.7;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.admin-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--input-border);
  border-radius: 6px;
  font-size: 12px;
  transition: all 0.3s ease;
  outline: none;
  font-family: inherit;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
}

.admin-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.combo-box {
  position: relative;
}

.combo-box-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.combo-box-toggle {
  width: 36px;
  height: 36px;
  border: 2px solid var(--input-border);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.combo-box-toggle svg {
  width: 16px;
  height: 16px;
}

.combo-box-toggle:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.combo-box-toggle:hover {
  border-color: var(--accent-primary);
}

.combo-box-panel {
  position: absolute;
  z-index: 20;
  width: 100%;
  max-height: 260px;
  overflow-y: auto;
  background: var(--bg-primary);
  border: 2px solid var(--input-border);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
  margin-top: 8px;
}

.combo-box-option {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: none;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.combo-box-option:hover,
.combo-box-option:focus {
  background: rgba(255, 255, 255, 0.05);
}

.combo-box-option-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.combo-box-option-details {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-secondary);
}

.combo-box-meta {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.combo-box-empty,
.combo-box-loading {
  padding: 14px 16px;
  color: var(--text-secondary);
}

.admin-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--input-border);
  border-radius: 6px;
  font-size: 12px;
  transition: all 0.3s ease;
  outline: none;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.admin-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.temperature-control {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 5px;
}

.admin-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  background: linear-gradient(to right, var(--accent-primary) 0%, #ef4444 100%);
}

.admin-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--accent-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 5px rgba(16, 163, 127, 0.2);
}

.admin-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--accent-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 5px rgba(16, 163, 127, 0.2);
}

.temperature-value {
  font-weight: 600;
  color: var(--accent-primary);
  min-width: 35px;
  text-align: center;
  font-size: 16px;
}

.help-text {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 5px;
  line-height: 1.4;
}

.admin-cancel-btn {
  padding: 12px 24px;
  background: var(--cancel-btn);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-cancel-btn:hover {
  background: var(--cancel-btn-hover);
  transform: translateY(-1px);
}

.admin-save-btn {
  padding: 12px 24px;
  background: linear-gradient(
    135deg,
    var(--accent-primary) 0%,
    var(--accent-hover) 100%
  );
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 163, 127, 0.4);
}

.admin-save-btn:active {
  transform: translateY(0);
}

.admin-save-btn-full {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: auto;
  min-width: 180px;
  padding: 14px 32px;
  background: linear-gradient(
    135deg,
    var(--accent-primary) 0%,
    var(--accent-hover) 100%
  );
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.admin-save-btn-full:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 163, 127, 0.4);
}

.admin-save-btn-full:active {
  transform: translateY(0);
}

/* ========== MODAL DE CONFIRMAÇÃO ========== */
.confirmation-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 20001 !important;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.confirmation-content {
  background: var(--bg-primary);
  border-radius: 12px;
  border: solid 2px var(--accent-primary);
  padding: 40px 35px 30px;
  max-width: 550px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: scaleIn 0.3s ease;
  position: relative;
}

.confirmation-icon {
  margin: 0 auto 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.confirmation-icon svg {
  animation: checkMark 0.5s ease 0.2s both;
}

@keyframes checkMark {
  0% {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.1) rotate(0deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.confirmation-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 15px 0;
}

.confirmation-message {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0 0 25px 0;
  line-height: 1.5;
}

.confirmation-btn {
  padding: 12px 40px;
  background: linear-gradient(
    135deg,
    var(--accent-primary) 0%,
    var(--accent-hover) 100%
  );
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.confirmation-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 163, 127, 0.4);
}

.confirmation-btn:active {
  transform: translateY(0);
}

/* ========== BOTÃO COPIAR TEMPLATE ========== */
.admin-copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(
    135deg,
    var(--accent-primary, #10a37f) 0%,
    var(--accent-hover, #0f9370) 100%
  );
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.admin-copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 163, 127, 0.35);
}

.admin-copy-btn:active {
  transform: translateY(0);
}

.admin-copy-btn svg {
  width: 14px;
  height: 14px;
}

/* ========== RESPONSIVIDADE ========== */
/* ===== NOTEBOOK: 1920x1080 — coberto pelos estilos base ===== */

/* ===== DESKTOP: fixa sidebar do modal em 300px ===== */
@media (min-width: 769px) {
  .admin-sidebar {
    width: 300px !important;
    min-width: 300px;
    max-width: 300px;
    flex-shrink: 0;
  }
}

/* ===== TABLET: 1280x800 ===== */
@media (max-width: 1280px) {
  /* Admin: ajusta proporção do grid */
  .admin-form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .agent-form-grid {
    grid-template-columns: 2.5fr 1fr;
    gap: 20px;
  }

  /* Admin modal */
  .admin-sidebar {
    width: 300px;
  }

  .agent-edit-content {
    max-width: 960px;
  }

  /* Chat container levemente mais estreito */
  .chat-container,
  .messages-container {
    max-width: 720px;
  }

  .input-wrapper {
    max-width: 720px;
  }

  .input-disclaimer {
    max-width: 720px;
  }

  /* Welcome screen ajustado para viewport 800px */
  .welcome-screen {
    padding-bottom: 320px;
  }

  .audit-welcome {
    padding-bottom: 320px;
  }

  /* Suggestion cards */
  .suggestion-cards {
    max-width: 720px;
    margin-top: 160px;
  }

  /* Login */
  .login-box {
    max-width: 400px;
  }
}

/* ===== MOBILE: 768px e abaixo ===== */
@media (max-width: 768px) {
  /* Mostrar header mobile */
  .mobile-header {
    display: flex;
  }

  /* Esconder botão de tema desktop */
  .theme-toggle {
    display: none !important;
  }

  /* Sidebar vira overlay em mobile */
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    height: 100vh;
    height: -webkit-fill-available;
    height: 100dvh;
    z-index: 1002;
    transition: left 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
  }

  .sidebar.mobile-open {
    left: 0;
  }

  /* Main content ocupa toda largura e tem padding-top para header */
  .main-content {
    margin-left: 0 !important;
    width: 100%;
    padding-top: 56px;
    height: 100svh;
    height: -webkit-fill-available;
  }

  .chat-wrapper {
    padding-bottom: 80px;
  }

  /* Esconder botão de toggle dentro da sidebar */
  .sidebar-toggle {
    display: none !important;
  }

  /* Overlay escuro quando sidebar aberta */
  body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  body.sidebar-open::after {
    opacity: 1;
    pointer-events: auto;
  }

  /* Modais admin */
  .admin-sidebar {
    width: 100%;
  }

  .agent-edit-content {
    width: 85vw;
    max-width: 700px;
    max-height: 80vh;
  }

  /* Chat */
  .message-inner {
    max-width: 95%;
  }

  .messages-container,
  .chat-container {
    padding: 12px;
    padding-bottom: calc(110px + env(safe-area-inset-bottom));
  }

  .input-container {
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: transform 0.1s ease;
  }

  .input-container.centered {
    position: fixed;
    top: auto;
    bottom: 0;
    transform: none;
    border-top: 1px solid var(--border-color);
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .input-wrapper {
    gap: 10px;
    padding: 10px 14px;
    border-radius: 24px;
    max-width: 100%;
  }

  .input-disclaimer {
    display: block;
    font-size: 11px;
    padding: 4px 8px 0;
    text-align: center;
    line-height: 1.3;
  }

  #messageInput {
    font-size: 16px;
  }

  .send-btn {
    width: 36px;
    height: 36px;
  }

  /* Tela de boas-vindas */
  .welcome-screen {
    padding-bottom: 300px;
  }

  .audit-welcome {
    padding-bottom: 300px;
  }

  .welcome-screen h1 {
    font-size: 26px;
  }

  .welcome-screen p {
    font-size: 15px;
  }

  /* Suggestion cards em 2 colunas */
  .suggestion-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 150px;
  }

  /* Login */
  .login-box {
    padding: 32px;
    width: 90%;
    max-width: 400px;
  }

  /* Aba lateral de sugestões menor em mobile */
  .audit-side-tab {
    top: 25%;
    bottom: auto;
    padding: 14px 8px;
    gap: 8px;
    border-radius: 8px 0 0 8px;
  }

  .audit-side-tab-text {
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .audit-side-tab svg {
    width: 15px;
    height: 15px;
  }

  .user-dropdown {
    left: 12px;
    right: 12px;
  }

  .dropdown-item {
    padding: 12px 14px;
    font-size: 13px;
  }

  .dropdown-item-registro {
    font-size: 13px;
  }
}

/* ===== iPhone 17 Pro Max / iPhone 16 Pro Max / iPhone 15 Pro Max ===== */
@media (max-width: 440px) and (max-height: 956px),
  (max-width: 430px) and (max-height: 932px) {
  .mobile-header {
    display: flex;
  }

  .theme-toggle {
    display: none !important;
  }

  .sidebar {
    position: fixed;
    left: -85vw;
    top: 0;
    bottom: 0;
    width: 85vw;
    max-width: 320px;
    height: 100vh;
    height: -webkit-fill-available;
    height: 100dvh;
    z-index: 1002;
    transition: left 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100%;
    padding-top: 56px;
    height: 100svh;
    height: -webkit-fill-available;
  }

  .chat-wrapper {
    padding-bottom: 80px;
  }

  .sidebar-toggle {
    display: none !important;
  }

  body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  body.sidebar-open::after {
    opacity: 1;
    pointer-events: auto;
  }

  .message-inner {
    max-width: 95%;
  }

  .messages-container,
  .chat-container {
    padding: 12px;
    padding-bottom: calc(110px + env(safe-area-inset-bottom));
  }

  .input-container {
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: transform 0.1s ease;
  }

  .input-container.centered {
    position: fixed;
    top: auto;
    bottom: 0;
    transform: none;
    border-top: 1px solid var(--border-color);
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .input-wrapper {
    gap: 10px;
    padding: 10px 14px;
    border-radius: 24px;
    max-width: 100%;
  }

  .input-disclaimer {
    display: block;
    font-size: 11px;
    padding: 4px 8px 0;
    text-align: center;
    line-height: 1.3;
  }

  #messageInput {
    font-size: 16px;
  }

  .send-btn {
    width: 36px;
    height: 36px;
  }

  .welcome-screen {
    padding-bottom: 300px;
  }

  .audit-welcome {
    padding-bottom: 300px;
  }

  .welcome-screen h1 {
    font-size: 26px;
  }

  .welcome-screen p {
    font-size: 15px;
  }

  .suggestion-cards {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 140px;
  }

  .login-box {
    padding: 32px;
    width: 90%;
    max-width: 400px;
  }

  .audit-side-tab {
    top: 25%;
    bottom: auto;
    padding: 14px 8px;
    gap: 8px;
    border-radius: 8px 0 0 8px;
  }

  .audit-side-tab-text {
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .audit-side-tab svg {
    width: 15px;
    height: 15px;
  }

  .user-dropdown {
    left: 12px;
    right: 12px;
  }

  .dropdown-item {
    padding: 12px 14px;
    font-size: 13px;
  }

  .dropdown-item-registro {
    font-size: 13px;
  }
}

/* ===== CELULAR: 384x932 ===== */
@media (max-width: 384px) {
  /* Sidebar ocupa parte da tela em mobile */
  .sidebar {
    width: 85vw;
    max-width: 300px;
    left: -85vw;
    top: 0;
    bottom: 0;
    height: 100vh;
    height: -webkit-fill-available;
    height: 100dvh;
    overflow: hidden;
  }

  .sidebar.mobile-open {
    left: 0;
  }

  /* Welcome screen ajustado para telas de 932px de altura */
  .welcome-screen {
    padding-bottom: 260px;
    padding-left: 12px;
    padding-right: 12px;
    min-height: 50vh;
  }

  .audit-welcome {
    padding-bottom: 260px;
  }

  .welcome-screen h1 {
    font-size: 20px;
  }

  .welcome-screen p {
    font-size: 14px;
  }

  /* Suggestion cards em coluna única */
  .suggestion-cards {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0 12px;
    margin-top: 130px;
  }

  .suggestion-card {
    padding: 14px;
    font-size: 13px;
    min-height: 52px;
  }

  .suggestion-icon {
    font-size: 18px;
  }

  /* Mensagens */
  .message {
    font-size: 14px;
    padding: 10px 12px;
  }

  .dropdown-item.has-icon {
    justify-content: center;
  }

  .dropdown-item.has-icon .menu-text {
    display: none;
  }

  .dropdown-item-registro .menu-text {
    display: block;
    text-align: center;
    font-size: 16px;
  }

  .dropdown-menu-panel {
    border-radius: 16px;
  }

  .message-inner {
    max-width: 100%;
  }

  .input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    z-index: 100;
    transition: transform 0.1s ease;
  }

  .input-container.centered {
    position: fixed;
    top: auto;
    bottom: 0;
    transform: none;
    border-top: 1px solid var(--border-color);
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .input-wrapper {
    padding: 10px 12px;
    gap: 8px;
    border-radius: 26px;
  }

  .input-disclaimer {
    display: block;
    font-size: 11px;
    padding: 4px 8px 0;
    text-align: center;
    line-height: 1.3;
  }

  .input-disclaimer {
    font-size: 11px;
    padding: 6px 8px 0;
    text-align: center;
    line-height: 1.3;
  }

  .send-btn {
    width: 36px;
    height: 36px;
    padding: 8px;
  }

  #messageInput {
    font-size: 15px;
  }

  /* Modais */
  .admin-modal-footer,
  .agent-edit-footer,
  .admin-create-actions {
    flex-direction: column;
    gap: 10px;
  }

  .admin-cancel-btn,
  .admin-save-btn,
  .admin-save-btn-full {
    width: 100%;
  }

  /* Botão fixo vira relativo em mobile */
  .admin-save-btn-full {
    position: relative;
    bottom: auto;
    right: auto;
    width: 100%;
    min-width: auto;
  }

  .form-right-column {
    padding-bottom: 0;
  }

  /* Layout de duas colunas vira uma coluna */
  .agent-form-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .form-left-column .admin-textarea {
    min-height: 200px;
  }

  .admin-modal {
    padding: 0;
  }

  .admin-sidebar {
    width: 100%;
  }

  .agent-edit-content {
    width: 95vw;
    max-height: 85vh;
  }

  /* Login */
  .login-box {
    padding: 24px 20px;
    width: 95%;
    border-radius: 12px;
  }

  .login-header h1 {
    font-size: 20px;
  }

  .login-logo {
    height: 50px;
    margin-bottom: 12px;
  }

  .login-header p {
    font-size: 13px;
  }

  .input-group input {
    padding: 12px;
    font-size: 15px;
  }

  .btn-primary {
    padding: 12px;
    font-size: 15px;
  }

  /* Nav items da sidebar */
  .nav-item {
    font-size: 14px;
    padding: 10px 12px;
  }

  .nav-icon {
    width: 20px;
    height: 20px;
  }
}

/* ===== Samsung S23 Ultra Override ===== */
@media (max-width: 384px) and (max-height: 824px) {
  .chat-wrapper {
    justify-content: flex-start;
    padding: 24px 0 140px !important;
  }

  .messages-container,
  .chat-container {
    padding-bottom: calc(140px + env(safe-area-inset-bottom)) !important;
  }

  .input-container,
  .input-container.centered {
    padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
  }

  .message {
    padding: 10px 12px !important;
  }

  .message-inner {
    max-width: 100% !important;
  }
}

/* ========== SCROLLBAR CUSTOMIZADA ==========

/* ===== iPHONE 15 PRO: 393×852pt + Dynamic Island ===== */
@media (max-width: 393px) {
  /* Safe area para Dynamic Island e barra home */
  .mobile-header {
    padding-top: env(safe-area-inset-top);
    height: calc(56px + env(safe-area-inset-top));
  }

  .main-content {
    padding-top: calc(56px + env(safe-area-inset-top));
    height: 100svh;
    height: -webkit-fill-available;
  }

  .chat-wrapper {
    padding-bottom: 80px;
  }

  .input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    z-index: 100;
    transition: transform 0.1s ease;
  }

  .input-container.centered {
    position: fixed;
    top: auto;
    bottom: 0;
    transform: none;
    border-top: 1px solid var(--border-color);
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .input-disclaimer {
    display: block;
    font-size: 11px;
    padding: 4px 8px 0;
    text-align: center;
    line-height: 1.3;
  }

  /* Sidebar cobre toda a área incluindo Dynamic Island */
  .sidebar {
    width: 85vw;
    max-width: 300px;
    left: -85vw;
    top: 0;
    bottom: 0;
    height: auto;
    padding-top: env(safe-area-inset-top);
  }

  /* Barra inferior de navegação do iOS */
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Mensagens */
  .message {
    font-size: 14px;
    padding: 10px 12px;
  }

  .message-inner {
    max-width: 100%;
  }

  /* Input */
  .input-wrapper {
    padding: 10px 12px;
    gap: 8px;
    border-radius: 26px;
  }

  #messageInput {
    font-size: 16px; /* evita zoom automático no iOS */
  }

  /* Welcome screen */
  .welcome-screen {
    padding-bottom: calc(260px + env(safe-area-inset-bottom));
    padding-left: 12px;
    padding-right: 12px;
  }

  .audit-welcome {
    padding-bottom: calc(260px + env(safe-area-inset-bottom));
  }

  .welcome-screen h1 {
    font-size: 20px;
  }

  .welcome-screen p {
    font-size: 14px;
  }

  /* Suggestion cards em coluna única */
  .suggestion-cards {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0 12px;
    margin-top: 130px;
  }

  /* Login */
  .login-box {
    padding: 24px 20px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    width: 95%;
    border-radius: 12px;
  }

  /* Nav items da sidebar */
  .nav-item {
    font-size: 14px;
    padding: 10px 12px;
  }

  /* Modais */
  .audit-suggestions-modal {
    max-width: 100%;
    border-left: none;
    border-radius: 0;
  }

  .audit-suggestions-overlay {
    align-items: flex-end;
    justify-content: stretch;
  }

  .agente1-modal {
    max-height: 90vh;
    border-radius: 12px;
  }

  .agente1-modal-overlay {
    padding: 12px;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  /* Aba lateral de sugestões — recuar da barra home */
  .audit-side-tab {
    top: 25%;
    bottom: auto;
    padding: 14px 8px;
    gap: 8px;
    border-radius: 8px 0 0 8px;
  }

  .audit-side-tab-text {
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .audit-side-tab svg {
    width: 15px;
    height: 15px;
  }
}

/* ===== Samsung S23 Ultra: 384x824 ===== */
@media (max-width: 384px) and (max-height: 824px) {
  .main-content {
    padding-top: calc(56px + env(safe-area-inset-top));
    height: 100svh;
    min-height: 100svh;
    height: -webkit-fill-available;
  }

  .chat-wrapper {
    padding: 12px 0 180px;
    min-height: 0;
  }

  .messages-container,
  .chat-container {
    padding: 12px;
    padding-bottom: calc(180px + env(safe-area-inset-bottom));
    min-height: 0;
  }

  .message-inner {
    max-width: 100%;
  }

  .message {
    padding: 10px 12px;
  }

  .sidebar {
    width: 85vw;
    max-width: 300px;
    left: -85vw;
    top: 0;
    bottom: 0;
    height: 100vh;
    height: -webkit-fill-available;
    height: 100dvh;
    overflow: hidden;
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .welcome-screen {
    padding-bottom: 180px;
    padding-left: 12px;
    padding-right: 12px;
    min-height: 50vh;
  }

  .audit-welcome {
    padding-bottom: 180px;
  }

  .welcome-screen h1 {
    font-size: 20px;
  }

  .welcome-screen p {
    font-size: 14px;
  }

  .suggestion-cards {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0 12px;
    margin-top: 100px;
  }

  .login-box {
    padding: 22px 18px;
    width: 95%;
    border-radius: 12px;
  }

  .input-container {
    padding: 8px 10px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }

  .input-container.centered {
    position: fixed;
    top: auto;
    bottom: 0;
    transform: none;
    border-top: 1px solid var(--border-color);
    padding: 8px 10px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .input-wrapper {
    padding: 10px 12px;
    gap: 8px;
    border-radius: 24px;
    width: 100%;
  }

  .send-btn {
    width: 36px;
    height: 36px;
    padding: 8px;
  }
}

/* ===== iOS Safari — iPhone 15 Pro — Correções específicas ===== */
/* @supports (-webkit-touch-callout: none) identifica iOS WebKit (Safari, Chrome iOS, etc.) */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 393px) {
    /* Altura correta: Safari browser tem toolbar que varia,
       height: 100% + min-height fill-available é mais estável */
    html {
      height: -webkit-fill-available;
    }

    .main-content {
      height: 100%;
      min-height: -webkit-fill-available;
    }

    /* Reduz padding-bottom excessivo da welcome screen:
       260px empurrava o conteúdo muito para cima no Safari */
    .welcome-screen {
      padding-bottom: calc(110px + env(safe-area-inset-bottom));
      min-height: auto;
    }

    .audit-welcome {
      padding-bottom: calc(110px + env(safe-area-inset-bottom));
    }

    /* Reduz margin-top dos cards de sugestão para se encaixar na tela menor */
    .suggestion-cards {
      margin-top: 20px;
    }

    /* Chat wrapper com espaço para o input fixo + barra nativa do Safari */
    .chat-wrapper {
      padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    /* Mensagens com padding adequado para não ficar atrás do input fixo */
    .messages-container,
    .chat-container {
      padding-bottom: calc(95px + env(safe-area-inset-bottom));
    }
  }
}

/* ========== SCROLLBAR CUSTOMIZADA ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.sidebar ::-webkit-scrollbar-thumb {
  background: var(--scrollbar-sidebar);
}

.sidebar ::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-sidebar-hover);
}

/* ========== ABA LATERAL DE SUGESTÕES - AUDITORIA ========== */
.audit-side-tab {
  position: fixed;
  right: 0;
  top: 30%;
  transform: translateY(-50%);
  background: var(--accent-primary);
  color: #fff;
  border: none;
  border-radius: 10px 0 0 10px;
  padding: 18px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 900;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.18);
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease;
  font-family: inherit;
}

/* Cores específicas por seção */
.audit-side-tab.section-suporte {
  background: var(--background-sup);
}

.audit-side-tab.section-suporte:hover {
  background: #0d3a5f;
  box-shadow: -6px 0 20px rgba(0, 0, 0, 0.26);
}

.audit-side-tab.section-financeiro {
  background: var(--background-fin);
}

.audit-side-tab.section-financeiro:hover {
  background: #d4b363;
  box-shadow: -6px 0 20px rgba(0, 0, 0, 0.26);
}

.audit-side-tab.section-auditoria {
  background: var(--background-comp);
}

.audit-side-tab.section-auditoria:hover {
  background: #8a4445;
  box-shadow: -6px 0 20px rgba(0, 0, 0, 0.26);
}

.audit-side-tab:hover {
  background: var(--accent-hover);
  box-shadow: -6px 0 20px rgba(0, 0, 0, 0.26);
}

.audit-side-tab-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ========== MODAL DE SUGESTÕES DE AUDITORIA ========== */
.audit-suggestions-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  z-index: 3000;
  animation: fadeInOverlay 0.22s ease;
}

@keyframes fadeInOverlay {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.audit-suggestions-modal {
  background: var(--bg-primary);
  border-left: 1px solid var(--border-color);
  border-radius: 0;
  width: 100%;
  max-width: 480px;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.2);
  animation: slideInFromRight 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
}

@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
    opacity: 0.6;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.audit-suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.audit-suggestions-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.audit-suggestions-title svg {
  color: var(--accent-primary);
}

/* Cores do header do modal por seção */
.audit-suggestions-modal.section-suporte .audit-suggestions-title svg {
  color: var(--background-sup);
}

.audit-suggestions-modal.section-financeiro .audit-suggestions-title svg {
  color: var(--background-fin);
}

.audit-suggestions-modal.section-auditoria .audit-suggestions-title svg {
  color: var(--background-comp);
}

.audit-suggestions-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.audit-suggestions-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.audit-suggestions-subtitle {
  padding: 10px 24px 0;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.audit-suggestions-body {
  overflow-y: auto;
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.audit-suggestions-body::-webkit-scrollbar {
  width: 6px;
}
.audit-suggestions-body::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

/* Categorias */
.audit-category {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.audit-category-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-primary);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}

.audit-questions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.audit-question-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  line-height: 1.4;
}

.audit-question-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(16, 163, 127, 0.12);
}

.audit-question-btn:active {
  transform: translateY(0);
}

@media (max-width: 384px) {
  .audit-questions-grid {
    grid-template-columns: 1fr;
  }

  .audit-suggestions-modal {
    max-width: 100%;
    border-left: none;
    border-top: 1px solid var(--border-color);
    border-radius: 0;
  }

  .audit-suggestions-overlay {
    align-items: flex-end;
    justify-content: stretch;
  }

  .audit-suggestions-header {
    padding: 16px 16px 12px;
  }

  .audit-suggestions-body {
    padding: 12px 16px 20px;
  }

  .audit-side-tab {
    top: 25%;
    bottom: auto;
    padding: 14px 8px;
    gap: 8px;
    border-radius: 8px 0 0 8px;
  }

  .audit-side-tab-text {
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .audit-side-tab svg {
    width: 15px;
    height: 15px;
  }
}

/* ========== MODAL AGENTE 1 ========== */
.agente1-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  padding: 20px;
  animation: fadeInOverlay 0.2s ease;
}

.agente1-modal {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  width: 100%;
  max-width: 680px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: agente1SlideUp 0.25s ease;
  overflow: hidden;
}

@keyframes agente1SlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.agente1-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.agente1-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.agente1-modal-title svg {
  color: var(--accent-primary);
}

.agente1-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.agente1-modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.agente1-modal-meta {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.agente1-modal-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-primary);
  white-space: nowrap;
  margin-top: 1px;
}

.agente1-modal-question {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.agente1-modal-body {
  overflow-y: auto;
  padding: 20px;
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.7;
}

.agente1-modal-body::-webkit-scrollbar {
  width: 5px;
}
.agente1-modal-body::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

.agente1-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 10px 0;
}

@media (max-width: 384px) {
  .agente1-modal {
    max-height: 90vh;
    border-radius: 12px;
  }
  .agente1-modal-overlay {
    padding: 12px;
  }
}

.msg-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  opacity: 0;
  transition: 0.2s;
}

.message:hover .msg-actions {
  opacity: 1;
}

.message {
  position: relative;
}

.confirmation-modal.error .confirmation-content {
  border-color: #ef4444;
}

.alert-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.alert-btn {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.alert-btn:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.admin-user-item.active {
  border: 1px solid var(--accent-primary);
  border: 3px solid var(--input-border);
}

.admin-user-item {
  position: relative;
}

.user-select {
  position: absolute;
  top: 50px;
  right: 15px;
  transform: scale(1.2);
  cursor: pointer;
}

.confirmation-modal {
  animation: fadeInScale 0.2s ease;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#deleteConfirmModal {
  z-index: 20000 !important;
}

#deleteConfirmModal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 20000 !important;
}

#confirmationModal {
  z-index: 20001 !important;
}

.confirmation-modal {
  backdrop-filter: blur(4px);
}

.confirmation-modal {
  backdrop-filter: blur(4px);
}

/* Modal de confirmação (deve ficar na frente) */
#deleteModal {
  z-index: 2000 !important;
}

/* Modal de listagem */
#userListModal {
  z-index: 1050;
}

/* Backdrop do modal de confirmação */
#deleteModal + .modal-backdrop {
  z-index: 1999 !important;
}

/* ========== CHECKBOX STYLES ========== */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-primary);
  margin: 0;
}

.admin-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-primary);
}

.admin-checkbox:hover {
  opacity: 0.8;
}

.checkbox-label span {
  user-select: none;
}

/* Checkboxes side-by-side container */
.checkboxes-container {
  display: flex;
  gap: 24px;
  align-items: center;
  /* margin-bottom: 20px; */
}
