@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Prevenir flash branco - aplicar tema antes de tudo */
html.dark,
html.dark body {
  background: #0a0a0a !important;
  color: #ededed
}

/* Forçar modo escuro em todos os containers críticos */
html.dark .content,
html.dark .chat-list,
html.dark .chat-panel,
html.dark .chat-messages,
html.dark [class*="bg-white"]:not([class*="text-white"]):not(.btn-primary),
html.dark .tabs,
html.dark #chat-panel {
  background-color: #171717 !important
}

html.dark .chat-item {
  background-color: transparent
}

html.dark .chat-item:hover {
  background-color: rgba(255, 255, 255, 0.05)
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial, sans-serif;
  background: #fff;
  color: #111
}

.theme {
  --bg: #ffffff;
  --text: #111111;
  --muted: #f5f5f5;
  --border: #eaeaea;
  --brand: #22c55e;
  --sidebar: #0b1220;
  --sidebar-text: #e8eefc
}

.dark.theme {
  --bg: #0a0a0a;
  --text: #ededed;
  --muted: #171717;
  --border: #262626;
  --brand: #22c55e;
  --sidebar: #0a0a0a;
  --sidebar-text: #ededed
}

/* Garantir variáveis dark quando o tema vem do html.dark */
html.dark .theme {
  --bg: #0a0a0a;
  --text: #ededed;
  --muted: #171717;
  --border: #262626;
  --brand: #22c55e;
  --sidebar: #0a0a0a;
  --sidebar-text: #ededed;
  --text-muted: #a1a1aa
}

.theme {
  background: var(--bg);
  color: var(--text)
}

.theme {
  --text-muted: #6b7280
}

.dark.theme {
  --text-muted: #a1a1aa
}

.theme {
  --fs-hero: 25.2px;
  --fs-h2: 19.8px;
  --fs-h3: 16.2px;
  --fs-body: 12.6px;
  --fs-small: 10.8px;
  --lh: 1.5;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --space-4: 3.6px;
  --space-8: 7.2px;
  --space-12: 10.8px;
  --space-16: 14.4px;
  --space-24: 21.6px;
  --space-32: 28.8px;
  --space-48: 43.2px
}

.content h1 {
  font-size: var(--fs-hero);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  margin: 0 0 var(--space-12)
}

.content h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-semibold);
  line-height: 1.3;
  margin: 0 0 var(--space-12)
}

.content h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  line-height: 1.3;
  margin: var(--space-12) 0
}

.content p,
.content li,
.content label {
  font-size: var(--fs-body);
  line-height: var(--lh)
}

.text-muted {
  color: var(--text-muted)
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10.8px 14.4px;
  border-bottom: 1px solid #eee
}

.topbar.hidden {
  display: none
}

.nav a {
  margin-right: 10.8px;
  text-decoration: none;
  color: #111
}

.nav a:last-child {
  margin-right: 0
}

.content {
  padding: var(--space-16);
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column
}

/* Quando o superadmin está impersonando, o banner ocupa o topo: descontar a altura dele
   para que o topo do conteúdo (ex.: abas do painel de afiliado) não fique escondido. */
body:has(.impersonation-banner) .app,
body:has(.impersonation-banner) .content {
  height: calc(100vh - 40px) !important;
  min-height: calc(100vh - 40px) !important;
  max-height: calc(100vh - 40px) !important;
}

/* Página Usuários: área de conteúdo só ocupa o necessário, sem espaço em branco abaixo */
body.page-settings-users .content {
  height: auto;
  min-height: 0;
}

/* Página Produtos/Serviços: conteúdo ocupa 100vh e o card da tabela preenche até embaixo, tabela rola dentro */
body.page-settings-products .content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.page-settings-products .content > div:last-of-type {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Página Etiquetas: barra de rolagem e menos espaço em branco */
body.page-settings-tags .content {
  height: auto;
  min-height: 0;
}

/* Página Origens de Lead: card preenche até embaixo, tabela rola dentro (igual Produtos) */
body.page-settings-lead-sources .content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.page-settings-lead-sources .content > div:last-of-type {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Página Motivos de Perda: card preenche até embaixo, tabela rola dentro (igual Produtos) */
body.page-settings-loss-reasons .content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.page-settings-loss-reasons .content > div:last-of-type {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Página Respostas Rápidas: card preenche até embaixo, tabela rola dentro */
body.page-settings-quick-replies .content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.page-settings-quick-replies .content > div:last-of-type {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Página Mensagens Agendadas: card da lista preenche até embaixo, tabela rola dentro */
body.page-scheduled-messages .content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.page-scheduled-messages .content > div:last-of-type {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Página Auditoria: garantir rolagem quando a lista ultrapassar a altura da tela */
body.page-settings-audit .audit-scroll-container {
  max-height: 70vh;
  overflow-y: auto;
}

.app {
  display: flex;
  height: 100vh;
  overflow: hidden
}

html,
body {
  height: 100%;
  overflow: hidden;
  margin: 0
}

/* Sidebar - Collapsible */
.sidebar {
  width: 64.8px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 14.4px 10.8px;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
  z-index: 40;
}

.sidebar.expanded {
  width: 216px;
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 21.6px;
  padding: 0 3.6px;
  min-height: 32.4px;
}

/* Elementos exclusivos do drawer mobile - ocultos no desktop */
#mobile-sidebar-close,
#mobile-sidebar-backdrop {
  display: none;
}

/* Sidebar hover expand - automatically expands on hover */
.sidebar {
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar:hover {
  width: 216px;
}

.sidebar:hover .sidebar-text,
.sidebar:hover .sidebar-brand-text {
  opacity: 1;
  transform: translateX(0);
}

.sidebar:hover .sidebar-version {
  text-align: left;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10.8px;
  overflow: hidden;
}

.sidebar-brand img {
  flex-shrink: 0;
  width: 50.4px;
  height: 28.8px;
  object-fit: contain;
}

.sidebar-brand-text {
  font-weight: 700;
  font-size: 14.4px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-9px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sidebar.expanded .sidebar-brand-text {
  opacity: 1;
  transform: translateX(0);
}

/* Sidebar Toggle Button - Hidden, using hover instead */
.sidebar-toggle {
  display: none;
}

.sidebar-toggle svg {
  width: 16.2px;
  height: 16.2px;
  transition: transform 0.3s ease;
}

.sidebar-toggle-collapse {
  display: none;
}

.sidebar-toggle-expand {
  display: block;
}

.sidebar.expanded .sidebar-toggle-collapse {
  display: block;
}

.sidebar.expanded .sidebar-toggle-expand {
  display: none;
}


/* Sidebar Navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3.6px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 3.6px;
  margin-right: -3.6px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 3.6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1.8px;
}

/* Sidebar Link */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10.8px;
  padding: 9px 10.8px;
  border-radius: 9px;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-size: 12.6px;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
  background: rgba(255, 255, 255, 0.1);
}

/* Sidebar Icon */
.sidebar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 21.6px;
  height: 21.6px;
  flex-shrink: 0;
}

.sidebar-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--sidebar-text);
}

.sidebar-avatar {
  width: 21.6px;
  height: 21.6px;
  border-radius: 50%;
  object-fit: cover;
}

/* Sidebar Text */
.sidebar-text {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.2s ease 0.05s, transform 0.2s ease 0.05s;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.expanded .sidebar-text {
  opacity: 1;
  transform: translateX(0);
}

/* Sidebar Footer */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 3.6px;
  margin-top: auto;
  padding-top: 10.8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-version {
  text-align: center;
  font-size: 9.9px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 7.2px;
  padding: 0 10.8px;
}

.sidebar.expanded .sidebar-version {
  text-align: left;
}

/* Sidebar Profile Button */
.sidebar-profile {
  font-family: inherit;
}

/* Sidebar link active indicator */
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2.7px;
  height: 18px;
  background: var(--secondary-color, var(--brand));
  border-radius: 0 2.7px 2.7px 0;
}

/* Sidebar hover expand effect (optional - uncomment if needed) */
/*
.sidebar:hover {
  width: 240px;
}
.sidebar:hover .sidebar-text,
.sidebar:hover .sidebar-brand-text {
  opacity: 1;
  transform: translateX(0);
}
*/

/* Adjust content when sidebar is expanded */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.user {
  color: var(--sidebar-text)
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-12);
  margin-top: var(--space-12)
}

.card {
  border: 1px solid var(--border);
  border-radius: 10.8px;
  padding: 14.4px;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06)
}

.card:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08)
}

.card-title {
  font-size: 10.8px;
  color: var(--text-muted);
  letter-spacing: .02em
}

.card-value {
  font-size: 23.4px;
  font-weight: 600
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.card-meta {
  font-size: 10.8px;
  color: var(--text-muted)
}

.card-metric {
  display: flex;
  flex-direction: column;
  gap: 5.4px
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10.8px
}

.table th,
.table td {
  border: 1px solid var(--border);
  padding: 10.8px;
  text-align: left
}

.table thead th {
  background: var(--muted);
  font-weight: 600
}

.table tbody tr:nth-child(odd) {
  background: rgba(0, 0, 0, 0.02)
}

.table tr:hover {
  background: var(--muted)
}

.filters {
  display: flex;
  gap: 7.2px;
  margin-top: 7.2px
}

.filters input,
.filters select,
.filters button {
  padding: 5.4px
}

.pagination {
  display: flex;
  gap: 7.2px;
  margin-top: 10.8px;
  align-items: center
}

.kanban {
  display: flex;
  gap: var(--space-16);
  overflow-x: auto;
  overflow-y: hidden;
  height: 100%;
  min-height: 0;
  padding-bottom: 16px
}

.kanban-col {
  width: 306px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 10.8px;
  background: var(--muted);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0
}

.kanban-col-head {
  padding: 12.6px 14.4px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  border-radius: 10.8px 10.8px 0 0;
  flex-shrink: 0
}

.kanban-col-body {
  padding: 10.8px;
  display: flex;
  flex-direction: column;
  gap: 10.8px;
  flex: 1;
  overflow-y: auto;
  min-height: 0
}

.kanban-col-body.drag-over {
  background: rgba(34, 197, 94, 0.1);
  border: 2px dashed var(--brand)
}

.deal {
  border: 1px solid var(--border);
  border-radius: 10.8px;
  padding: 0;
  background: var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease
}

.deal:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px)
}

.deal:active {
  cursor: grabbing
}

.deal.dragging {
  opacity: 0.4;
  transform: scale(1.02) rotate(1deg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 100
}

.deal-title {
  font-weight: 600;
  margin-bottom: 4px
}

.deal-meta {
  font-size: 10.8px;
  color: var(--text-muted)
}

.empty {
  padding: 28.8px;
  color: var(--text-muted);
  text-align: center;
  font-size: 12.6px
}

/* Line clamp utilities */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden
}

.btn-sm {
  padding: 5.4px 10.8px;
  font-size: 11.7px
}

.inline-form {
  display: flex;
  gap: 5.4px;
  align-items: center;
  margin-top: 5.4px
}

.chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 108px);
  overflow: hidden
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10.8px;
  padding: 10.8px;
  border-bottom: 1px solid var(--border);
  background: var(--muted)
}

.chat-header .avatar {
  width: 32.4px;
  height: 32.4px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600
}

.chat-header .info .title {
  font-weight: 600
}

.chat-header .info .subtitle {
  font-size: 10.8px;
  color: var(--text-muted)
}

.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 14.4px;
  display: flex;
  flex-direction: column;
  gap: 7.2px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), transparent)
}

.bubble {
  max-width: 70%;
  display: flex;
  flex-direction: column;
  gap: 3.6px
}

.bubble.me {
  align-self: flex-end
}

.bubble.them {
  align-self: flex-start
}

.bubble .text {
  border: 1px solid var(--border);
  border-radius: 10.8px;
  padding: 9px;
  background: var(--bg);
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word
}

.bubble .text a {
  word-break: break-all;
  overflow-wrap: anywhere;
  hyphens: auto
}

.bubble.me .text {
  background: #dcfce7;
  border-color: #bbf7d0
}

.bubble.them .text {
  background: #fff;
  border-color: var(--border)
}

.bubble .meta {
  font-size: 10.8px;
  color: var(--text-muted);
  padding: 0 5.4px
}

/* Player de áudio: tamanho padrao compacto (evitar desproporção gigante) */
#chat-messages .audio-player,
#chat-panel .audio-player,
.chat-messages .audio-player,
.audio-player {
  max-width: 260px !important;
  min-width: 200px !important;
  width: fit-content !important;
  padding: 6px 8px !important;
  gap: 6px !important;
}
#chat-messages .audio-player .audio-play-btn,
#chat-panel .audio-player .audio-play-btn,
.chat-messages .audio-player .audio-play-btn,
.audio-player .audio-play-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
}
#chat-messages .audio-player .audio-play-btn svg,
#chat-messages .audio-player .audio-play-btn [data-lucide],
.audio-player .audio-play-btn svg,
.audio-player .audio-play-btn [data-lucide] {
  width: 14px !important;
  height: 14px !important;
}
#chat-messages .audio-player .audio-progress-container,
#chat-panel .audio-player .audio-progress-container,
.audio-player .audio-progress-container {
  height: 24px !important;
  min-width: 80px !important;
}
#chat-messages .audio-player .audio-wave-bar,
.audio-player .audio-wave-bar {
  min-width: 2px !important;
}
/* Evitar que o player estique para preencher a bolha */
#chat-messages .audio-player,
#chat-panel .audio-player,
.chat-messages .audio-player {
  flex-shrink: 0 !important;
  align-self: flex-start !important;
}
#chat-messages .audio-player .audio-speed-toggle-btn,
#chat-panel .audio-player .audio-speed-toggle-btn,
.audio-player .audio-speed-toggle-btn {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  font-size: 10px !important;
}

.composer {
  display: flex;
  gap: 7.2px;
  align-items: center;
  padding: 10.8px;
  border-top: 1px solid var(--border);
  background: var(--muted)
}

.composer textarea {
  flex: 1;
  min-height: 39.6px;
  max-height: 108px;
  resize: vertical
}

.form input,
.form select,
.form textarea {
  border: 1px solid var(--border);
  padding: 9px;
  border-radius: 7.2px;
  background: var(--bg);
  color: var(--text)
}

.form button {
  padding: 9px 10.8px;
  border-radius: 7.2px;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--text)
}

.form button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff
}

.form label {
  font-size: 10.8px;
  color: #666;
  margin-bottom: 3.6px
}

.form {
  display: flex;
  flex-direction: column;
  gap: 7.2px;
  max-width: 360px;
  width: 100%;
  margin-top: 7.2px
}

.form input,
.form select,
.form button {
  padding: 7.2px
}

/* Formulário NPS: garantir bordas visíveis em todos os campos */
#survey-form input:not([type="hidden"]):not(:focus),
#survey-form select:not(:focus),
#survey-form textarea:not(:focus) {
  border: 1px solid #94a3b8;
}
html.dark #survey-form input:not([type="hidden"]):not(:focus),
html.dark #survey-form select:not(:focus),
html.dark #survey-form textarea:not(:focus) {
  border-color: #64748b;
}

.auth.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden
}

.auth-left {
  background: #0b1220;
  color: #e8eefc;
  padding: 43.2px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start
}

.auth-left .brand {
  font-weight: 700;
  margin-bottom: 21.6px;
  font-size: 18px
}

.auth-left h1 {
  font-size: var(--fs-hero);
  font-weight: var(--fw-bold);
  margin: 0 0 var(--space-8)
}

.auth-left p {
  color: var(--text-muted);
  margin: 0 0 var(--space-16)
}

.features {
  list-style: none;
  padding: 0;
  margin: var(--space-24) 0 0
}

.features li {
  margin: var(--space-8) 0;
  padding-left: 21.6px;
  position: relative
}

.features li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--brand)
}

.auth-right {
  padding: var(--space-48);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--bg);
  overflow-y: auto
}

.auth-right>div {
  width: 100%;
  max-width: 360px
}

.auth-right h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-semibold);
  margin: 0 0 var(--space-16);
  text-align: left
}

.auth-right p {
  margin-top: 14.4px;
  text-align: center;
  color: var(--text-muted)
}

.auth-right p a {
  color: var(--brand);
  text-decoration: none
}

.auth-right p a:hover {
  text-decoration: underline
}

.row {
  display: flex;
  justify-content: flex-end;
  margin: var(--space-8) 0
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8)
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10.8px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease
}

.btn:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06)
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff
}

.btn-outline {
  background: transparent;
  border-color: var(--border)
}

.btn-ghost {
  background: transparent;
  border-color: transparent
}

/* Mobile Navigation - WhatsApp Style */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow:
    0 -2px 8px rgba(0, 0, 0, 0.06),
    0 -1px 0 rgba(0, 0, 0, 0.05);
  padding: 7.2px 0;
  padding-bottom: calc(7.2px + env(safe-area-inset-bottom, 0px));
  gap: 0;
  border-radius: 0;
  z-index: 50;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
}

/* Barra inferior: cinza/preto neutro (sem canal azul), alinhado a html.dark body (#0a0a0a) e áreas de conteúdo (#171717) */
.dark .mobile-nav,
html.dark .mobile-nav {
  background: rgba(23, 23, 23, 0.98);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 -4px 14px rgba(0, 0, 0, 0.4),
    0 -1px 0 rgba(255, 255, 255, 0.04);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3.6px;
  padding: 7.2px 10.8px;
  border-radius: 0;
  color: #64748b;
  text-decoration: none;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  position: relative;
  max-width: 90px;
}

.dark .mobile-nav-item {
  color: #a1a1aa;
}

.mobile-nav-item:active {
  transform: scale(0.95);
  opacity: 0.7;
}

.mobile-nav-item:hover:not(.active) {
  color: #334155;
  background: transparent;
}

.dark .mobile-nav-item:hover:not(.active) {
  color: #e2e8f0;
  background: transparent;
}

.mobile-nav-item.active {
  background: transparent;
  color: var(--primary-color, #22c55e);
  box-shadow: none;
  transform: none;
}

.dark .mobile-nav-item.active {
  color: var(--primary-color, #22c55e);
  box-shadow: none;
}

.mobile-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.7px;
  background: var(--primary-color, #22c55e);
  border-radius: 0;
}

.mobile-nav-item svg {
  width: 21.6px;
  height: 21.6px;
  stroke-width: 2;
  transition: all 0.2s ease;
}

.mobile-nav-item.active svg {
  transform: none;
  color: var(--primary-color, #22c55e);
}

.mobile-nav-item span {
  transition: opacity 0.2s ease;
}

.mobile-nav-item .mobile-nav-avatar {
  width: 21.6px;
  height: 21.6px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.8px solid transparent;
  transition: all 0.2s ease;
}

.mobile-nav-item:hover .mobile-nav-avatar {
  border-color: rgba(100, 116, 139, 0.3);
}

.mobile-nav-item.active .mobile-nav-avatar {
  border-color: var(--primary-color, #22c55e);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.1);
}

/* Indicator dot for notifications */
.mobile-nav-item[data-badge]::after {
  content: attr(data-badge);
  position: absolute;
  top: 3.6px;
  right: 7.2px;
  min-width: 16.2px;
  height: 16.2px;
  background: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8.1px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4.5px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@media (max-width: 1024px) {
  .grid.lg\:grid-cols-\[380px_1fr_320px\] {
    grid-template-columns: 380px 1fr;
  }

  #contact-info-panel {
    display: none !important;
  }

  /* Sidebar vira drawer off-canvas no mobile (em vez de sumir) */
  .sidebar {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: 264px !important;
    max-width: 85vw;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 70;
    overflow-y: auto;
    box-shadow: none;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
  }

  /* No drawer, textos/labels sempre visíveis (ignora colapso de hover do desktop) */
  .sidebar .sidebar-text,
  .sidebar .sidebar-brand-text,
  .sidebar .sidebar-version {
    opacity: 1 !important;
    transform: none !important;
    text-align: left;
  }

  /* Botão fechar (X) do drawer aparece só no mobile */
  #mobile-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--sidebar-text);
    border: none;
    cursor: pointer;
    flex-shrink: 0;
  }

  #mobile-sidebar-close svg {
    width: 18px;
    height: 18px;
  }

  /* Backdrop do drawer */
  #mobile-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 60;
  }

  #mobile-sidebar-backdrop.open {
    display: block;
  }

  .content {
    padding: 12px;
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    height: 100vh;
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .mobile-nav {
    display: flex;
  }

  .app {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  html,
  body {
    overflow: auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  /* Garantir que badges não sejam cortados no mobile */
  .chat-item {
    overflow: visible !important;
    padding-bottom: 22px !important;
    min-height: auto !important;
    position: relative;
    margin-bottom: 0 !important;
  }

  .chat-item-body {
    overflow: visible !important;
  }

  .chat-list {
    overflow-x: visible !important;
    overflow-y: auto !important;
    padding-bottom: 16px !important;
  }

  /* Aumentar espaço para badges quando quebram linha */
  .chat-item-body>div:last-child {
    margin-bottom: 0 !important;
  }

  /* Forçar padding extra para cards com badges */
  .chat-item:has(> .chat-item-body > div:last-child .flex-wrap) {
    padding-bottom: 24px !important;
  }
}

/* Desktop: Show sidebar toggle on hover or when expanded */
@media (min-width: 1025px) {
  .sidebar {
    display: flex !important;
  }
}

/* Compact mobile nav for very small screens */
@media (max-width: 380px) {
  .mobile-nav {
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-nav-item {
    padding: 6px 8px;
    gap: 3px;
  }

  .mobile-nav-item svg {
    width: 20px;
    height: 20px;
  }

  .mobile-nav-item span {
    font-size: 9px;
  }
}

@media (max-width: 800px) {
  .grid.lg\:grid-cols-\[380px_1fr_320px\] {
    grid-template-columns: 1fr
  }

  .auth.split {
    grid-template-columns: 1fr;
    min-height: 100vh
  }

  .auth-left {
    display: none
  }

  .auth-right {
    padding: 32px 24px;
    justify-content: flex-start;
    padding-top: 48px
  }
}

/* Mobile optimizations for titles and content */
@media (max-width: 768px) {

  /* Reduce page titles on mobile */
  .content h1,
  .content h1.text-2xl,
  .content .text-2xl.font-bold {
    font-size: 18px !important;
    line-height: 1.3;
  }

  /* Hide subtitles on mobile to save space */
  .content h1+p.text-sm,
  .content h1+p.text-slate-600,
  .content .text-2xl+p.text-sm {
    display: none;
  }

  /* Reduce padding on mobile */
  .content {
    padding: 12px;
  }

  /* Compact header area */
  .content>div:first-child {
    margin-bottom: 8px !important;
  }

  /* Make tabs more compact */
  .tabs {
    gap: 4px;
  }

  .tabs .tab,
  .tab {
    padding: 6px 8px;
    font-size: 11px;
  }

  .tabs .badge,
  .tab .badge {
    padding: 1px 4px;
    font-size: 9px;
  }

  /* Fix grid height on mobile */
  .h-\[calc\(100vh-140px\)\] {
    height: calc(100vh - 100px) !important;
  }

  /* Reduce chat list padding and optimize space */
  .chat-list {
    max-height: calc(100vh - 200px);
  }

  /* Compact search area */
  .p-4.border-b {
    padding: 10px !important;
  }

  /* Compact tabs area */
  .tabs.grid-cols-3 {
    margin-bottom: 8px !important;
  }

  /* Compact conversation items */
  .chat-item {
    padding: 10px;
    min-height: 70px;
  }

  .chat-item .avatar {
    width: 36px;
    height: 36px;
  }

  .chat-item-head .name {
    font-size: 13px;
  }

  .chat-item-meta .preview {
    font-size: 11px;
    -webkit-line-clamp: 1;
  }

  /* Smaller tags */
  .chat-item .text-\[10px\] {
    font-size: 9px !important;
    padding: 2px 4px;
  }

  /* Smaller icons in tags */
  .chat-item .w-2\.5 {
    width: 8px !important;
    height: 8px !important;
  }

  /* Chat panel optimizations */
  .chat-header {
    padding: 10px 12px;
  }

  .chat-header .avatar {
    width: 36px;
    height: 36px;
  }

  /* Composer optimizations */
  .composer {
    padding: 8px 10px;
  }

  /* Back button more prominent on mobile */
  .chat-header a.lg\\:hidden {
    padding: 8px;
  }

  /* Always show close button on mobile (no hover) */
  .btn-close-conv {
    opacity: 1 !important;
  }

  /* Hide mobile nav when conversation is open */
  body.conversation-open .mobile-nav {
    display: none !important;
  }

  /* Adjust content padding when conversation is open (no nav) */
  body.conversation-open .content {
    padding-bottom: 12px;
  }

  /* ==============================================
     CORREÇÃO MÍDIAS EM BALÕES DE MENSAGEM - MOBILE
     Problema: Imagens e vídeos extrapolam os limites
     dos balões de mensagem no mobile.
     
     Solução: Limitar tamanho máximo e garantir
     que mídias fiquem contidas nos balões.
     ============================================== */

  /* Limitar tamanho das mídias dentro das mensagens */
  .chat-messages img,
  .chat-messages video,
  #chat-messages-container img,
  #chat-messages-container video {
    max-width: 100% !important;
    max-height: 200px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 8px;
  }

  /* Balões de mensagem - limitar largura */
  /* CORRIGIDO: Seletor mais específico para evitar afetar divisores de data e outros elementos */
  .bubble.message-bubble {
    max-width: 85% !important;
    overflow: visible;
    /* Permitir que reações e outros elementos sejam visíveis */
  }

  /* Garantir que o conteúdo interno do balão não estoure */
  .bubble .text {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    /* overflow: hidden removido - causava mensagens cortadas */
  }

  /* Permitir scroll horizontal apenas para conteúdo muito largo como código */
  .bubble .text pre,
  .bubble .text code {
    overflow-x: auto;
    max-width: 100%;
  }

  /* Container de mídia dentro do balão */
  .bubble img,
  .bubble video {
    max-width: 100% !important;
    max-height: 180px !important;
    object-fit: contain;
  }

  /* Preview modal de imagens */
  [class*="rounded-lg"] img:not(.avatar),
  [class*="rounded-xl"] img:not(.avatar) {
    max-width: 100%;
  }

  /* Stickers e imagens pequenas */
  .chat-messages img[alt="sticker"],
  .chat-messages img.sticker {
    max-width: 120px !important;
    max-height: 120px !important;
  }

  /* ==============================================
     CORREÇÃO LAYOUT MENSAGENS MOBILE
     Problema: Mensagens "amontoadas" ou não aparecendo
     
     Solução: Garantir flexbox correto e scroll adequado
     ============================================== */

  /* Container de mensagens - garantir scroll e flexbox */
  .chat-messages,
  #chat-messages {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    /* Crítico para flexbox funcionar */
    flex: 1 1 0% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    gap: 8px !important;
    /* Espaçamento entre mensagens */
    padding: 12px !important;
  }

  /* Garantir que os balões de mensagem tenham espaçamento adequado */
  .chat-messages .bubble,
  #chat-messages .bubble {
    margin-bottom: 4px;
    flex-shrink: 0;
    /* Não comprimir as mensagens */
  }

  /* Divisores de data - não devem ter max-width limitado */
  .chat-messages>div:not(.bubble):not(.message-bubble),
  #chat-messages>div:not(.bubble):not(.message-bubble) {
    max-width: 100% !important;
    overflow: visible !important;
  }

  /* Container pai das mensagens - deve ocupar espaço disponível */
  .chat,
  .chat.flex.flex-col {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* Garantir largura total no mobile */
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app,
  .content {
    width: 100%;
    max-width: 100%;
  }

  /* Remover margens e padding do grid de inbox no mobile */
  #inbox-grid {
    gap: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Remover border e rounded do container de conversas no mobile */
  #inbox-grid>div {
    border-radius: 0 !important;
    border: none !important;
  }

  /* Cards de conversa ocupam toda largura no mobile */
  .chat-item {
    padding-left: 12px !important;
    padding-right: 12px !important;
    margin: 0 !important;
  }

  /* Chat list sem margens no mobile */
  .chat-list {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Chat panel sem border e rounded no mobile */
  #chat-panel {
    border-radius: 0 !important;
    border: none !important;
  }

  /* Garantir que o conteúdo ocupe toda largura na inbox */
  /* O padding do content será removido apenas para a inbox */
  body:has(#inbox-grid) .content {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Reduzir tamanho do inbox e elementos para 90% */
  @media (min-width: 1024px) {
    body:has(#inbox-grid) .content {
      width: 90% !important;
      max-width: 90% !important;
      margin-left: auto !important;
      margin-right: auto !important;
    }

    #inbox-grid {
      width: 100% !important;
    }

    /* Reduzir tamanho dos elementos internos proporcionalmente */
    #inbox-grid .chat-item {
      padding: 9px !important;
      font-size: 0.9em;
    }

    #inbox-grid .chat-header {
      padding: 9px 9.9px !important;
      font-size: 0.9em;
    }

    #inbox-grid .composer {
      padding: 9.72px 9px !important;
      font-size: 0.9em;
    }

    #inbox-grid .message-bubble {
      font-size: 0.9em;
      padding: 4.5px 9px !important;
    }

    #inbox-grid input,
    #inbox-grid textarea,
    #inbox-grid button {
      font-size: 0.9em;
    }

    #inbox-grid .avatar {
      width: 28.8px !important;
      height: 28.8px !important;
    }

    #inbox-grid .chat-header .avatar {
      width: 28.8px !important;
      height: 28.8px !important;
    }

    /* Reduzir gaps e espaçamentos */
    #inbox-grid {
      gap: 2.7px !important;
    }

    #inbox-grid .gap-2 {
      gap: 0.45rem !important;
    }

    #inbox-grid .gap-3 {
      gap: 0.675rem !important;
    }

    #inbox-grid .p-3 {
      padding: 0.675rem !important;
    }

    #inbox-grid .mb-3 {
      margin-bottom: 0.675rem !important;
    }
  }

  /* Ajustar padding do header da lista de conversas */
  #inbox-grid>div:first-child>div:first-child {
    padding-left: 10.8px;
    padding-right: 10.8px;
  }

  /* Remover borda arredondada da coluna do chat (lista de conversas) */
  #inbox-grid>div:first-child {
    border-radius: 0 !important;
  }

  /* Mobile composer optimizations */
  .composer {
    gap: 8px;
    padding: 8px 10px !important;
  }

  .composer textarea {
    min-height: 40px !important;
    font-size: 16px !important;
    /* Prevent iOS zoom on focus */
  }

  /* Mobile composer menu animation */
  #mobile-composer-menu {
    animation: slideUp 0.15s ease-out;
  }

  @keyframes slideUp {
    from {
      opacity: 0;
      transform: translateY(8px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

.flow-editor {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  margin-top: 16px
}

.flow-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px
}

.flow-nodes-list,
.flow-edges-list {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.flow-node-item,
.flow-edge-item {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.flow-node-item summary {
  cursor: pointer;
  font-weight: 600
}

.flow-node-edit {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px
}

.flow-node-edit .form textarea {
  min-height: 80px
}

.flow-canvas {
  position: relative;
  min-height: 480px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--bg)
}

.flow-node {
  position: absolute;
  width: 160px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04)
}

.flow-node-head {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  font-weight: 600
}

.flow-node-body {
  padding: 8px
}

.chat-list-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px
}

.tabs {
  display: flex;
  gap: 8px;
  margin-top: 8px
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  background: var(--bg)
}

.tab .badge {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px
}

.tab.active {
  border-color: var(--brand)
}

.tab svg {
  width: 18px;
  height: 18px
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px
}

.chat-item {
  display: flex;
  gap: 10.8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 10.8px;
  background: var(--bg);
  text-decoration: none;
  color: inherit
}

.chat-item:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06)
}

.chat-item .avatar {
  width: 32.4px;
  height: 32.4px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600
}

.chat-item-body {
  display: flex;
  flex-direction: column;
  gap: 3.6px;
  flex: 1
}

.chat-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.chat-item-head .name {
  font-weight: 600
}

.chat-item-head .time {
  font-size: 10.8px;
  color: var(--text-muted)
}

.chat-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.chat-item-meta .preview {
  color: var(--text-muted)
}

.chat-item-meta .status {
  font-size: 10.8px;
  color: var(--text-muted)
}

.chat-item.selected {
  background: rgba(34, 197, 94, 0.05);
  border-left: 3.6px solid var(--brand)
}

.bubble.me .text {
  background: var(--primary-color);
  color: #fff;
  border: none
}

.bubble.them .text {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05)
}

.composer textarea:focus {
  outline: none;
  ring: 2px;
  ring-color: var(--brand)
}

.tab.active {
  background: var(--muted);
  font-weight: 600
}

/* Toast Animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.animate-slide-in-right {
  animation: slideInRight 0.3s ease-out;
}

/* Profile Sidebar */
#profile-sidebar-content {
  max-height: 100vh;
  overflow-y: auto;
}

#profile-sidebar-content::-webkit-scrollbar {
  width: 5.4px;
}

#profile-sidebar-content::-webkit-scrollbar-track {
  background: #f1f5f9;
}

#profile-sidebar-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2.7px;
}

#profile-sidebar-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Composer buttons */
.composer .btn {
  flex-shrink: 0;
  min-width: 39.6px;
  min-height: 39.6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.composer .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.composer .btn svg {
  pointer-events: none;
}

/* Emoji Picker */
#emoji-picker {
  max-height: 270px;
  overflow-y: auto;
  z-index: 1000;
}

#emoji-picker .emoji-item {
  cursor: pointer;
  transition: background-color 0.15s ease;
  user-select: none;
}

#emoji-picker .emoji-item:active {
  transform: scale(0.95);
}

/* File preview */
#file-preview {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.15s ease-out;
}

/* Chat item improvements */
.chat-list {
  gap: 0;
  margin-top: 0;
  -webkit-overflow-scrolling: touch;
  /* Smooth scrolling on iOS */
}

.chat-item {
  padding: 10.8px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  transition: all 0.15s ease;
  /* Mobile touch optimization - removes 300ms tap delay */
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  /* Ensure pointer events work correctly */
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

/* Make all child elements pass clicks through to the link */
.chat-item * {
  pointer-events: none;
}

/* Re-enable pointer events only for interactive elements */
.chat-item .btn-close-conv,
.chat-item .btn-preview-conv {
  pointer-events: auto;
}

/* Active state for better mobile feedback */
.chat-item:active {
  background-color: rgba(0, 0, 0, 0.05);
}

.dark .chat-item:active {
  background-color: rgba(255, 255, 255, 0.05);
}

.chat-item:hover {
  box-shadow: none;
}

.chat-item:hover .btn-close-conv {
  opacity: 1;
}

.btn-close-conv {
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* Note: .btn-close-conv opacity:1 moved to main mobile media query above */

.chat-item .avatar {
  width: 36px;
  height: 36px;
  font-size: 12.6px;
}

.chat-item-head .name {
  font-size: 12.6px;
}

.chat-item-meta .preview {
  font-size: 10.8px;
  line-height: 1.4;
}

/* Loading states */
.loading-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Better scrollbar for chat list */
.chat-list::-webkit-scrollbar {
  width: 5.4px;
}

.chat-list::-webkit-scrollbar-track {
  background: transparent;
}

.chat-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2.7px;
}

.chat-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

.dark .chat-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

.dark .chat-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Error state */
.error-state {
  animation: fadeIn 0.3s ease;
}

/* Chat panel loading */
#chat-panel .animate-spin {
  animation: spin 1s linear infinite;
}

/* Drag & Drop Overlay */
#drop-overlay {
  animation: fadeIn 0.15s ease;
  cursor: copy;
}

#drop-overlay>div {
  animation: bounceIn 0.25s ease;
  transform-origin: center;
}

@keyframes bounceIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* File toast animation */
#file-toast {
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  0% {
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
  }

  100% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* Message Actions (Edit/Delete) */
.bubble.me {
  position: relative;
}

.bubble.me .message-actions {
  position: absolute;
  right: calc(100% + 7.2px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 3.6px;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
}

/* Mostrar botões quando hover no bubble */
.bubble.me:hover .message-actions {
  opacity: 1;
  pointer-events: auto;
}

/* Manter visível quando hover nos botões (via JavaScript) */
.bubble.me .message-actions.show-actions {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.message-actions button {
  width: 25.2px;
  height: 25.2px;
  border-radius: 50%;
  background: white;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark .message-actions button {
  background: #334155;
  border-color: #475569;
}

.message-actions button:hover {
  transform: scale(1.1);
}

.msg-edit-btn:hover {
  background: #f0fdf4;
  border-color: #86efac;
}

.dark .msg-edit-btn:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
}

.msg-delete-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.msg-delete-btn:hover i {
  color: #ef4444 !important;
}

.dark .msg-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
}

/* Deleted message style */
.bubble .deleted-message {
  font-style: italic;
  opacity: 0.6;
}

/* Toast for message actions */
#msg-action-toast {
  animation: slideUp 0.3s ease;
}

/* Esconder sidebar de perfil durante carregamento para evitar flash */
#profile-sidebar.translate-x-full {
  visibility: hidden;
}

#profile-sidebar:not(.translate-x-full) {
  visibility: visible;
}

/* Kanban - modo escuro */
html.dark .kanban-col,
.dark .kanban-col,
.dark.theme .kanban-col {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}

html.dark .kanban-col-head,
.dark .kanban-col-head,
.dark.theme .kanban-col-head {
  background-color: #0b1220 !important;
  border-color: #1e293b !important;
}

html.dark .kanban-col-body,
.dark .kanban-col-body,
.dark.theme .kanban-col-body {
  background-color: #0f172a !important;
}

html.dark .deal,
.dark .deal,
.dark.theme .deal {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

@keyframes wave {

  0%,
  100% {
    transform: scaleY(0.5);
  }

  50% {
    transform: scaleY(1.2);
  }
}

/* Notificações */
.notifications-btn {
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
}

.notifications-btn {
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
}

.notifications-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: #ffffff;
  border-radius: 10px;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  padding: 0 5px;
  border: 2px solid var(--sidebar);
  z-index: 10;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Modal de Notificações */
.notifications-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.notifications-modal.hidden {
  display: none;
}

.notifications-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

.notifications-modal-content {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  background: var(--bg);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.dark .notifications-modal-content {
  background: #0f172a;
  border: 1px solid #1e293b;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.notifications-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.notifications-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notifications-title-icon {
  width: 24px;
  height: 24px;
  color: var(--brand);
  flex-shrink: 0;
}

.notifications-modal-title h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.notifications-count-text {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}

.notifications-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.notifications-modal-close:hover {
  background: var(--muted);
  color: var(--text);
}

.notifications-modal-close:active {
  transform: scale(0.95);
}

.notifications-modal-close i {
  width: 20px;
  height: 20px;
}

.notifications-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(85vh - 180px);
  padding: 8px;
}

.notifications-list::-webkit-scrollbar {
  width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
  background: transparent;
}

.notifications-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.notifications-list::-webkit-scrollbar {
  width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
  background: transparent;
}

.notifications-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.dark .notifications-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

/* Cards de Notificações */
.notification-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 8px;
  display: flex;
  gap: 14px;
  transition: all 0.2s ease;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notification-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.dark .notification-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.notification-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.notification-card:hover .notification-card-icon {
  transform: scale(1.05);
}

.notification-card-icon i {
  width: 22px;
  height: 22px;
}

.notification-card-body {
  flex: 1;
  min-width: 0;
}

.notification-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.notification-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
}

.notification-card-dismiss {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-top: -2px;
  position: relative;
  z-index: 10;
}

.notification-card:hover .notification-card-dismiss {
  opacity: 1;
}

.notification-card-dismiss:hover {
  background: var(--muted);
  color: var(--text);
}

.notification-card-dismiss i {
  width: 14px;
  height: 14px;
}

.notification-card-message {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.notification-card-type {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.notification-card-time {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.notification-card-link {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  text-decoration: none;
}

.notification-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
}

.notification-icon i {
  width: 18px;
  height: 18px;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.notification-message {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notification-time {
  font-size: 11px;
  color: var(--text-muted);
}

.notifications-loading {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.notifications-loading i {
  width: 32px;
  height: 32px;
  color: var(--brand);
}

.notifications-empty {
  padding: 60px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.notifications-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.notifications-empty-icon i {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  opacity: 0.6;
}

.notifications-empty h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.notifications-empty p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  max-width: 280px;
}

.notifications-error {
  padding: 48px 24px;
  text-align: center;
  color: #ef4444;
  font-size: 14px;
}

.notifications-modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  gap: 12px;
  flex-direction: column;
}

.notifications-dismiss-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ef4444;
  background: transparent;
  border: 1px solid #ef4444;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  padding: 10px 16px;
  border-radius: 10px;
  width: 100%;
  cursor: pointer;
}

.notifications-dismiss-all:hover {
  background: #ef4444;
  color: white;
}

.notifications-dismiss-all:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.notifications-view-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--brand);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  padding: 10px 16px;
  border-radius: 10px;
  width: 100%;
}

.notifications-view-all:hover {
  background: var(--muted);
  color: var(--brand);
  gap: 12px;
}

.notifications-view-all i {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.notifications-view-all:hover i {
  transform: translateX(2px);
}

/* ==============================================
   CORREÇÃO VIEWPORT MOBILE - INPUT CORTADO
   Problema: No navegador mobile, a barra de endereços/navegação
   ocupa espaço e 100vh não reflete a altura visível real,
   fazendo o input de mensagem ficar cortado.
   
   Solução: Usar dvh (dynamic viewport height) que considera
   a altura real disponível. Esta correção NÃO afeta o PWA
   pois ele roda em modo standalone (tela cheia).
   ============================================== */

/* Suporte para navegadores que suportam dvh */
@supports (height: 100dvh) {
  /* Aplicar apenas em mobile (não desktop) */
  @media (max-width: 1023px) {
    /* Não aplicar em PWA (standalone mode) */
    @media not all and (display-mode: standalone) {

      /* Container principal do inbox */
      #inbox-grid {
        height: calc(100dvh - 60px) !important;
        max-height: calc(100dvh - 60px) !important;
      }

      /* Container do chat + sidebar */
      #chat-sidebar-container {
        height: 100% !important;
        max-height: calc(100dvh - 60px) !important;
      }

      /* Painel do chat */
      #chat-panel {
        height: 100% !important;
        max-height: calc(100dvh - 60px) !important;
      }

      /* Área de mensagens - ajustar para deixar espaço para input */
      .chat-messages,
      #chat-messages {
        max-height: calc(100dvh - 180px) !important;
        min-height: 0 !important;
        /* Importante para flexbox shrink funcionar */
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        /* Scroll suave no iOS */
      }

      /* App principal */
      .app {
        height: 100dvh !important;
        max-height: 100dvh !important;
      }

      /* Content area */
      .content {
        height: 100dvh !important;
        max-height: 100dvh !important;
      }
    }
  }
}

/* Fallback para navegadores que não suportam dvh */
/* Usar -webkit-fill-available como alternativa */
@supports not (height: 100dvh) {
  @media (max-width: 1023px) {
    #inbox-grid {
      height: calc(-webkit-fill-available - 60px);
      height: calc(100vh - 60px - env(safe-area-inset-bottom, 0px));
    }

    /* Área de mensagens - fallback */
    .chat-messages,
    #chat-messages {
      max-height: calc(100vh - 180px - env(safe-area-inset-bottom, 0px)) !important;
      min-height: 0 !important;
      overflow-y: auto !important;
      -webkit-overflow-scrolling: touch;
    }
  }
}

/* Mobile: ajustar modal */
@media (max-width: 768px) {
  .notifications-modal {
    padding: 0;
  }

  .notifications-modal-content {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
  }

  .notifications-modal-header {
    padding: 20px;
  }

  .notifications-modal-title h2 {
    font-size: 20px;
  }

  .notification-card {
    padding: 14px;
  }
}

/* ===== GRAVAÇÃO DE ÁUDIO - Interface Moderna (WhatsApp Style) ===== */
@keyframes waveform-1 {

  0%,
  100% {
    height: 8px;
  }

  50% {
    height: 24px;
  }
}

@keyframes waveform-2 {

  0%,
  100% {
    height: 16px;
  }

  50% {
    height: 8px;
  }
}

@keyframes waveform-3 {

  0%,
  100% {
    height: 12px;
  }

  50% {
    height: 28px;
  }
}

.animate-waveform-1 {
  animation: waveform-1 0.8s ease-in-out infinite;
}

.animate-waveform-2 {
  animation: waveform-2 0.6s ease-in-out infinite;
}

.animate-waveform-3 {
  animation: waveform-3 0.7s ease-in-out infinite;
}

.waveform-bar {
  min-height: 4px;
  transition: height 0.1s ease;
}

/* Parar animação quando pausado */
#recorder-state-paused .waveform-bar,
.waveform-paused .waveform-bar {
  animation: none !important;
  height: 12px !important;
}

/* Estilos para o gravador moderno */
#audio-recorder-modern {
  transition: all 0.2s ease;
}

#recorder-state-recording,
#recorder-state-paused {
  transition: opacity 0.2s ease;
}

/* Preview progress bar hover effect */
#preview-progress-container:hover {
  height: 6px;
}

#preview-progress-container:hover #preview-progress-bar {
  height: 100%;
}

/* ===== Logo dupla da sidebar (app_logo_sidebar): icone no rail recolhido, logo cheia quando expandida ===== */
.sidebar-brand .brand-full-img {
  display: none;
  width: auto;
  max-width: 150px;
  height: 30px;
  object-fit: contain;
}
.sidebar:hover .brand-full-img { display: block; }
.sidebar:hover .brand-ico-img { display: none; }
@media (max-width: 1024px) {
  .sidebar-brand .brand-full-img { display: block; }
  .sidebar-brand .brand-ico-img { display: none; }
}

/* ============================================================
   RE-SKIN CHATZY — FASE 1: fonte global + sidebar
   .sidebar-chatzy só é aplicada quando NÃO é revendedor white-label
   ============================================================ */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/DMSans.woff2') format('woff2');
}
body {
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

.sidebar-chatzy {
  background: linear-gradient(180deg, #1e2637, #141821) !important;
  border-right: 1px solid rgba(255, 255, 255, .07);
}
.sidebar-chatzy .sidebar-link {
  color: rgba(255, 255, 255, .82);
  font-weight: 500;
  font-size: 13.5px;
  border-radius: 10px;
}
.sidebar-chatzy .sidebar-link:hover {
  background: rgba(255, 255, 255, .13) !important;
  color: #ffffff !important;
}
.sidebar-chatzy .sidebar-link.active {
  background: rgba(0, 221, 91, .16) !important;
  color: #3bef83 !important;
  font-weight: 600;
}
.sidebar-chatzy .sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -10.8px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #22ec74;
}
.sidebar-chatzy .sidebar-link.active .sidebar-icon svg {
  filter: drop-shadow(0 0 5px rgba(0, 221, 91, .45));
  animation: czNavPulse 2.6s ease-in-out infinite;
}
@keyframes czNavPulse {
  0%, 55%, 100% { transform: scale(1); }
  72% { transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar-chatzy .sidebar-link.active .sidebar-icon svg { animation: none !important; }
}

/* ============================================================
   RE-SKIN CHATZY — FASE 2: componentes globais
   ============================================================ */
.btn.btn-primary,
button.btn-primary {
  background: linear-gradient(150deg, #12e468, #04b04c) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 6px 14px -6px rgba(0, 221, 91, .5);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn.btn-primary:hover,
button.btn-primary:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 9px 18px -6px rgba(0, 221, 91, .55);
}
.btn { border-radius: 10px !important; }

/* ============================================================
   RE-SKIN CHATZY — FASE 3.1: Dashboard
   Escopado em #page-dashboard; overrides de cor só no tema claro
   ============================================================ */
#page-dashboard h1 {
  font-weight: 700;
  letter-spacing: -.4px;
}
#page-dashboard section { border-radius: 16px; }

html:not(.dark) #page-dashboard .czy-hero {
  background:
    radial-gradient(120% 160% at 96% 0%, #ccf8dd 0%, rgba(204, 248, 221, 0) 48%),
    linear-gradient(180deg, #ffffff, #f7fcf9) !important;
  border-color: #eceff2 !important;
}

/* cards de KPI (relatorio do dia) */
#page-dashboard article,
#page-dashboard .grid > a.group {
  border-radius: 14px;
  transition: transform .15s ease, box-shadow .15s ease;
}
#page-dashboard article:hover,
#page-dashboard .grid > a.group:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -12px rgba(16, 24, 40, .18);
}
html:not(.dark) #page-dashboard article,
html:not(.dark) #page-dashboard .grid > a.group {
  background: #ffffff !important;
  border-color: #eceff2 !important;
}
#page-dashboard article p.text-2xl,
#page-dashboard a p.text-2xl {
  font-weight: 700;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   RE-SKIN CHATZY — card "Indique e Ganhe" no rodapé da sidebar
   Escondido no rail recolhido; aparece na expansão (hover) e no mobile
   ============================================================ */
.czy-promo {
  display: none;
  flex-direction: column;
  gap: 3px;
  margin: 8px 6px 10px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px;
  text-decoration: none;
  transition: background .15s ease;
}
.czy-promo:hover { background: rgba(255, 255, 255, .1); }
.sidebar:hover .czy-promo { display: flex; }
.czy-promo-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .1);
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}
.czy-promo-title { font-weight: 700; font-size: 13px; color: #ffffff; white-space: nowrap; }
.czy-promo-text { font-size: 11.5px; color: rgba(255, 255, 255, .6); line-height: 1.4; }
.czy-promo-btn { font-size: 12.5px; font-weight: 600; color: #3bef83; margin-top: 7px; white-space: nowrap; }
@media (max-width: 1024px) {
  .sidebar .czy-promo { display: flex; }
}

/* fix: card promo com largura fixa (nao espreme durante a animacao de expandir) + fade suave */
.czy-promo {
  width: 188px;
  min-width: 188px;
  box-sizing: border-box;
}
.sidebar:hover .czy-promo {
  display: flex;
  animation: czyPromoIn .18s ease .1s both;
}
@keyframes czyPromoIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar:hover .czy-promo { animation: none !important; }
}

/* ============================================================
   RE-SKIN CHATZY — FASE 3.2: Dashboard (miolo no padrão mockup)
   ============================================================ */
/* labels dos KPIs: caixa alta discreta */
#page-dashboard article .flex p.text-sm,
#page-dashboard a.group p.text-sm {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #98a2b3;
}
html.dark #page-dashboard article .flex p.text-sm,
html.dark #page-dashboard a.group p.text-sm { color: #7c8798; }

/* números dos KPIs: grandes e protagonistas (mantém a cor semântica) */
#page-dashboard article p.text-2xl,
#page-dashboard a.group p.text-2xl {
  font-size: 27px;
  line-height: 1.1;
  margin-top: 8px;
}

/* tiles de ícone dos KPIs: um pouco maiores e mais arredondados */
#page-dashboard article span.inline-flex.h-9,
#page-dashboard a.group span.inline-flex.h-10 {
  height: 40px;
  width: 40px;
  border-radius: 12px;
}

/* títulos de seção (Avisos / Seu relatório do dia) */
#page-dashboard section .border-b .inline-flex.items-center.gap-2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.2px;
}

/* atalhos da coluna direita (Tutoriais/Documentação) com hover do mockup */
#page-dashboard aside a.group {
  border-radius: 16px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
#page-dashboard aside a.group:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -14px rgba(16, 24, 40, .22);
}

/* respiro entre os blocos */
#page-dashboard.space-y-6 > * + * { margin-top: 18px; }

/* ============================================================
   RE-SKIN CHATZY — fidelidade ao mockup: sidebar FIXA aberta (244px)
   com botão Recolher (classe .czy-collapsed persistida), texto do
   ativo verde, logo cheia no aberto. Só com .sidebar-chatzy (plataforma).
   ============================================================ */
/* aberta por padrão */
.sidebar-chatzy { width: 244px !important; }
.sidebar-chatzy .sidebar-text { opacity: 1 !important; transform: none !important; }
.sidebar-chatzy .sidebar-brand-text { opacity: 1 !important; transform: none !important; }
.sidebar-chatzy .brand-full-img { display: block; }
.sidebar-chatzy .brand-ico-img { display: none; }
.sidebar-chatzy .czy-promo { display: flex; animation: none; }
.sidebar-chatzy .sidebar-version { text-align: left; }

/* recolhida (botão) */
.sidebar-chatzy.czy-collapsed { width: 64.8px !important; }
.sidebar-chatzy.czy-collapsed .sidebar-text,
.sidebar-chatzy.czy-collapsed .sidebar-brand-text { opacity: 0 !important; }
.sidebar-chatzy.czy-collapsed .brand-full-img { display: none; }
.sidebar-chatzy.czy-collapsed .brand-ico-img { display: block; }
.sidebar-chatzy.czy-collapsed .czy-promo { display: none; }

/* item ativo: texto e ícone VERDES como no mockup */
.sidebar-chatzy .sidebar-link.active,
.sidebar-chatzy .sidebar-link.active .sidebar-text,
.sidebar-chatzy .sidebar-link.active .sidebar-icon,
.sidebar-chatzy .sidebar-link.active .sidebar-icon svg {
  color: #3bef83 !important;
}
.sidebar-chatzy .sidebar-link { font-size: 14px; padding: 9px 11px; gap: 11px; }
.sidebar-chatzy .sidebar-link .sidebar-text { font-weight: 500; }
.sidebar-chatzy .sidebar-link.active .sidebar-text { font-weight: 600; }

/* botão Recolher menu */
.czy-collapse { color: rgba(255,255,255,.55) !important; margin-top: auto; }
.czy-collapse:hover { color: #ffffff !important; background: rgba(255,255,255,.1) !important; }
.sidebar-chatzy.czy-collapsed .czy-collapse .sidebar-icon svg { transform: scaleX(-1); }
/* nav deixa de empurrar o rodapé (o botão assume o espaçador) */
.sidebar-chatzy .sidebar-nav { flex: 0 0 auto; }

/* ============================================================
   RE-SKIN CHATZY — fidelidade final da sidebar
   ============================================================ */
/* fix: card promo não re-anima no hover da sidebar (era o "pisca") */
.sidebar-chatzy:hover .czy-promo { animation: none !important; }
.sidebar-chatzy.czy-collapsed:hover .czy-promo { display: none; }

/* cor exata do mockup, à prova de overrides */
.sidebar-chatzy {
  background-color: transparent !important;
  background-image: linear-gradient(180deg, #1e2637, #141821) !important;
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif !important;
}

/* animações temáticas do item ATIVO (as mesmas dos mockups) */
.sidebar-chatzy .sidebar-link.active .sidebar-icon svg {
  transform-box: fill-box;
  transform-origin: center;
  filter: drop-shadow(0 0 5px rgba(0, 221, 91, .45));
}
.sidebar-chatzy .sidebar-link[href="/"].active .sidebar-icon svg { animation: czNavBob 2.6s ease-in-out infinite; }
.sidebar-chatzy .sidebar-link[href="/atendimento"].active .sidebar-icon svg { animation: czNavWiggle 2.8s ease-in-out infinite; }
.sidebar-chatzy .sidebar-link[href="/chat-interno"].active .sidebar-icon svg { animation: czNavPop 2.6s ease-in-out infinite; }
.sidebar-chatzy .sidebar-link[href="/kanban"].active .sidebar-icon svg { animation: czNavSlide 2.8s ease-in-out infinite; }
.sidebar-chatzy .sidebar-link[href="/contatos"].active .sidebar-icon svg { animation: czNavPop 2.6s ease-in-out infinite; }
.sidebar-chatzy .sidebar-link[href="/disparos"].active .sidebar-icon svg { animation: czNavFly 2.7s ease-in-out infinite; }
.sidebar-chatzy .sidebar-link[href="/relatorios"].active .sidebar-icon svg { animation: czNavBars 2.8s ease-in-out infinite; transform-origin: bottom center; }
.sidebar-chatzy .sidebar-link[href="/apps"].active .sidebar-icon svg { animation: czNavTilt 3s ease-in-out infinite; }
.sidebar-chatzy .sidebar-link[href="/automacoes"].active .sidebar-icon svg { animation: czNavNod 3s ease-in-out infinite; }
.sidebar-chatzy .sidebar-link[href="/configuracoes/integracoes"].active .sidebar-icon svg { animation: czNavPlug 2.9s ease-in-out infinite; }
.sidebar-chatzy .sidebar-link[href="/configuracoes"].active .sidebar-icon svg { animation: czNavSpin 3.2s ease-in-out infinite; }
@keyframes czNavBob { 0%, 50%, 100% { transform: translateY(0); } 65% { transform: translateY(-2.5px); } 80% { transform: translateY(1px); } }
@keyframes czNavWiggle { 0%, 55%, 100% { transform: rotate(0); } 68% { transform: rotate(-8deg); } 82% { transform: rotate(6deg); } }
@keyframes czNavPop { 0%, 55%, 100% { transform: scale(1); } 72% { transform: scale(1.14); } }
@keyframes czNavSlide { 0%, 55%, 100% { transform: translateX(0); } 70% { transform: translateX(2px); } 85% { transform: translateX(-1px); } }
@keyframes czNavFly { 0%, 52%, 100% { transform: translate(0, 0) rotate(0); } 72% { transform: translate(3px, -3px) rotate(10deg); } }
@keyframes czNavBars { 0%, 55%, 100% { transform: scaleY(1); } 72% { transform: scaleY(1.15); } }
@keyframes czNavTilt { 0%, 55%, 100% { transform: rotate(0); } 70% { transform: rotate(-6deg); } 85% { transform: rotate(4deg); } }
@keyframes czNavNod { 0%, 55%, 100% { transform: rotate(0); } 70% { transform: rotate(7deg); } 85% { transform: rotate(-4deg); } }
@keyframes czNavPlug { 0%, 55%, 100% { transform: translateY(0); } 70% { transform: translateY(2px); } 85% { transform: translateY(-1px); } }
@keyframes czNavSpin { 0%, 55%, 100% { transform: rotate(0); } 75% { transform: rotate(100deg); } }
@media (prefers-reduced-motion: reduce) {
  .sidebar-chatzy .sidebar-link.active .sidebar-icon svg { animation: none !important; }
}

/* ============ RE-SKIN CHATZY: DASHBOARD IDENTICO AO MOCKUP ============ */
  #page-dashboard .content { padding: 22px 26px 40px; display: flex; gap: 20px; align-items: flex-start; }
  #page-dashboard .col-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
  #page-dashboard .col-rail { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }

  /* ---------- Hero ---------- */
  #page-dashboard .hero {
    position: relative; overflow: hidden;
    background:
      radial-gradient(120% 140% at 85% 10%, #d9f5e6 0%, rgba(217,245,230,0) 55%),
      linear-gradient(180deg, #ffffff, #f7fcf9);
    border: 1px solid #eceff2; border-radius: 16px;
    padding: 26px 28px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.05);
  }
  #page-dashboard .hero-illus { position: absolute; right: 0; top: 0; height: 100%; width: 46%; opacity: .9; pointer-events: none; }
  #page-dashboard .date-pill {
    display: inline-flex; align-items: center; gap: 7px;
    background: #ffffff; border: 1px solid #eceff2; color: #5b6472;
    font-size: 12.5px; font-weight: 500; padding: 5px 11px; border-radius: 20px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.05);
  }
  #page-dashboard .hero h1 { font-size: 30px; font-weight: 700; letter-spacing:-.2px; margin: 14px 0 6px; text-wrap: balance; }
  #page-dashboard .hero p { margin: 0; color: #5b6472; font-size: 14.5px; max-width: 460px; }
  #page-dashboard .hero-underline { width: 44px; height: 4px; border-radius: 3px; background: #00dd5b; margin-top: 16px; }

  /* ---- Hero em modo NOITE (fundo escuro / céu noturno) ---- */
  #page-dashboard .hero.night {
    background:
      radial-gradient(85% 120% at 84% 12%, rgba(150,175,235,.30) 0%, rgba(150,175,235,0) 55%),
      linear-gradient(165deg, #0e1e3e 0%, #16274c 60%, #1a2b52 100%);
    border-color: rgba(255,255,255,.08);
  }
  #page-dashboard .hero.night h1 { color: #ffffff; }
  #page-dashboard .hero.night p { color: #b6c2da; }
  #page-dashboard .hero.night .hero-underline { background: #2ee08f; }
  #page-dashboard .hero.night .date-pill {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.22);
    color: #e6ecf7; box-shadow: none;
  }

  /* ---------- 2FA alert ---------- */
  #page-dashboard .alert {
    display: flex; align-items: center; gap: 16px;
    background: var(--amber-soft); border: 1px solid #f7e2bd; border-radius: 16px;
    padding: 18px 20px;
  }
  #page-dashboard .alert-ico { width: 44px; height: 44px; border-radius: 12px; background: #fbe5c2; color: #b45309; display: grid; place-items: center; flex-shrink: 0; }
  #page-dashboard .alert-body { flex: 1; min-width: 0; }
  #page-dashboard .alert-title { font-weight: 700; font-size: 15px; color: #7a4a06; }
  #page-dashboard .alert-text { font-size: 13px; color: #9a7433; margin-top: 2px; }
  #page-dashboard .btn-amber {
    display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
    background: #f79009; color: #fff; font-weight: 600; font-size: 13.5px;
    padding: 10px 16px; border-radius: 10px; box-shadow: 0 4px 10px rgba(247,144,9,.25);
  }

  /* ---------- Report section ---------- */
  #page-dashboard .section-head { display: flex; align-items: center; gap: 10px; margin: 4px 2px 0; }
  #page-dashboard .section-head .sh-ico { width: 26px; height: 26px; border-radius: 8px; background: #e2fbec; color: #04b04c; display: grid; place-items: center; }
  #page-dashboard .section-head h2 { font-size: 16px; font-weight: 700; margin: 0; letter-spacing:-.2px; }
  #page-dashboard .section-head .sh-spacer { flex: 1; }
  #page-dashboard .datepick { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #eceff2; background: #fff; border-radius: 10px; padding: 7px 11px; font-size: 12.5px; color: #5b6472; font-weight: 500; }

  #page-dashboard .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

  #page-dashboard .stat {
    background: #ffffff; border: 1px solid #eceff2; border-radius: 16px;
    padding: 16px 16px 10px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.05); position: relative; overflow: hidden;
    transition: box-shadow .18s, transform .18s;
  }
  #page-dashboard .stat:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
  #page-dashboard .stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
  #page-dashboard .stat-label { font-size: 13px; color: #5b6472; font-weight: 500; }
  #page-dashboard .stat-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
  #page-dashboard .stat-num { font-size: 29px; font-weight: 700; letter-spacing:-.2px; margin: 8px 0 2px; }
  #page-dashboard .stat-delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
  #page-dashboard .delta-up { color: #04b04c; }
  #page-dashboard .delta-flat { color: #98a2b3; }
  #page-dashboard .spark { display: block; width: 100%; height: 34px; margin-top: 6px; }

  /* ---------- Performance strip ---------- */
  #page-dashboard .perf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  #page-dashboard .perf-card { background: #fafbfc; border: 1px solid #f2f4f6; border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
  #page-dashboard .perf-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
  #page-dashboard .perf-label { font-size: 12px; color: #5b6472; }
  #page-dashboard .perf-val { font-size: 15px; font-weight: 700; }
  #page-dashboard .perf-sub { font-size: 11px; color: #98a2b3; }
  #page-dashboard .perf-spacer { flex: 1; }

  /* ---------- Rail ---------- */
  #page-dashboard .rail-card { background: #ffffff; border: 1px solid #eceff2; border-radius: 16px; padding: 18px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.05); }
  #page-dashboard .rail-row { display: flex; align-items: flex-start; gap: 13px; }
  #page-dashboard .rail-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
  #page-dashboard .rail-title { font-weight: 700; font-size: 15.5px; }
  #page-dashboard .rail-text { font-size: 12.5px; color: #5b6472; margin: 3px 0 12px; }
  #page-dashboard .rail-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }

  #page-dashboard .act-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
  #page-dashboard .act-head .ah-l { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; }
  #page-dashboard .act-head .ah-l .sh-ico { width: 24px; height: 24px; border-radius: 7px; background: #e2fbec; color: #04b04c; display: grid; place-items: center; }
  #page-dashboard .pill { font-size: 11.5px; font-weight: 600; color: #04b04c; background: #e2fbec; padding: 4px 10px; border-radius: 20px; }
  #page-dashboard .act { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #f2f4f6; }
  #page-dashboard .act:first-of-type { border-top: none; }
  #page-dashboard .act-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
  #page-dashboard .act-main { flex: 1; min-width: 0; }
  #page-dashboard .act-t { font-size: 13px; font-weight: 600; }
  #page-dashboard .act-s { font-size: 11.5px; color: #98a2b3; }
  #page-dashboard .act-time { font-size: 11.5px; color: #98a2b3; white-space: nowrap; }
  #page-dashboard .act-more { display: block; text-align: center; margin-top: 12px; color: #04b04c; font-weight: 600; font-size: 13px; }


#page-dashboard .czd-content { padding: 22px 26px 40px; display: flex; gap: 20px; align-items: flex-start; }
@media (max-width: 1180px) { #page-dashboard .czd-content { flex-direction: column; } #page-dashboard .col-rail { width: 100%; } }
@media (max-width: 860px) { #page-dashboard .grid { grid-template-columns: 1fr 1fr; } #page-dashboard .perf { grid-template-columns: 1fr; } }
@media (max-width: 560px) { #page-dashboard .grid { grid-template-columns: 1fr; } }
#page-dashboard .datepick { position: relative; overflow: hidden; }
#page-dashboard .czd-refresh { width: 34px; height: 34px; border-radius: 10px; border: 1px solid #eceff2; background: #fff; display: grid; place-items: center; color: #5b6472; cursor: pointer; }
#page-dashboard .czd-refresh:hover { color: #04b04c; border-color: #bff2d5; }

/* ============ RE-SKIN CHATZY: ajustes p/ monitores grandes ============ */
/* conteudo do dashboard com largura maxima centralizada (proporcao do mockup em qualquer tela) */
#page-dashboard .czd-content { max-width: 1560px; margin: 0 auto; }
/* ilustracao do hero: nao estica alem do desenhado */
#page-dashboard .hero-illus { width: 46%; max-width: 620px; min-width: 320px; }
#page-dashboard .hero { min-height: 172px; }
@media (min-width: 1900px) {
  #page-dashboard .grid { grid-template-columns: repeat(3, 1fr); }
}

/* Recolher menu abaixo do Indique e Ganhe, sempre colado acima do rodapé */
.sidebar-chatzy .czy-promo { margin-top: auto; }
.sidebar-chatzy .czy-collapse { margin-top: 4px; }
.sidebar-chatzy.czy-collapsed .czy-collapse { margin-top: auto; }

/* recolhido: botao desce e cola acima do rodape (mesma posicao do aberto) */
.sidebar-chatzy.czy-collapsed .czy-collapse { margin-top: auto !important; }
.sidebar-chatzy .czy-collapse { margin-top: 4px !important; }
.sidebar-chatzy.czy-collapsed .czy-collapse { margin-top: auto !important; }

/* footer sem auto-push quando skin Chatzy (o promo/botao assumem a ancoragem) */
.sidebar-chatzy .sidebar-footer { margin-top: 0 !important; }

/* ============ RE-SKIN CHATZY: CONEXOES (hero + faixa segmentada + tabela) ============ */
.czc-head { border-radius: 16px !important; }
html:not(.dark) .czc-head {
  background:
    radial-gradient(120% 160% at 96% 0%, #ccf8dd 0%, rgba(204, 248, 221, 0) 48%),
    linear-gradient(180deg, #ffffff, #f7fcf9) !important;
  border-color: #eceff2 !important;
}
.czc-head h1 { font-size: 23px !important; font-weight: 700 !important; letter-spacing: -.4px; }

/* faixa segmentada (Opcao A) */
.czc-strip { gap: 0 !important; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.05); }
html:not(.dark) .czc-strip { background: #ffffff; border: 1px solid #eceff2; }
html.dark .czc-strip { background: #0f172a; border: 1px solid #1e293b; }
.czc-strip > .connections-kpi-card {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 18px 22px !important;
  position: relative;
}
.czc-strip > .connections-kpi-card + .connections-kpi-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: #eceff2;
}
html.dark .czc-strip > .connections-kpi-card + .connections-kpi-card::before { background: #1e293b; }
@media (max-width: 1279px) { .czc-strip > .connections-kpi-card + .connections-kpi-card::before { display: none; } }
.czc-strip .connections-kpi-icon { width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; }
.czc-strip p.text-3xl { font-size: 24px !important; font-weight: 700 !important; margin-top: 8px !important; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }

/* tabela */
html:not(.dark) .connections-table thead tr { background: #fafbfc !important; }
.connections-table thead th { font-size: 11.5px !important; letter-spacing: .04em !important; }
html:not(.dark) .connections-table tbody tr:hover { background: #fafcfb; }

/* ============ RE-SKIN CHATZY: CONEXOES — fidelidade total ao mockup ============ */
/* hero (wash exato do mockup) */
html:not(.dark) .czc-head {
  background:
    radial-gradient(120% 160% at 96% 0%, #d9f5e6 0%, rgba(217, 245, 230, 0) 48%),
    linear-gradient(180deg, #ffffff, #f7fcf9) !important;
}
.czcx-hico {
  width: 52px; height: 52px; border-radius: 15px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #2af07e, #04b04c); color: #fff;
  box-shadow: 0 8px 20px rgba(0, 221, 91, .32);
  animation: czcxHeroPulse 4.5s ease-in-out infinite;
}
@keyframes czcxHeroPulse { 0%, 100% { box-shadow: 0 8px 20px rgba(0,221,91,.3); } 50% { box-shadow: 0 12px 28px rgba(0,221,91,.5); } }
.lk-a, .lk-b { transform-box: fill-box; transform-origin: center; }
.lk-a { animation: czcxLka 1.9s ease-in-out infinite; }
.lk-b { animation: czcxLkb 1.9s ease-in-out infinite; }
@keyframes czcxLka { 0%, 100% { transform: translate(0, 0); } 42%, 58% { transform: translate(1.7px, -1.7px); } }
@keyframes czcxLkb { 0%, 100% { transform: translate(0, 0); } 42%, 58% { transform: translate(-1.7px, 1.7px); } }
.czc-head .flex.flex-col.gap-5 { align-items: flex-start; }
@media (prefers-reduced-motion: reduce) { .czcx-hico, .lk-a, .lk-b { animation: none !important; } }

/* faixa segmentada (markup e medidas do mockup) */
.czcx-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #ffffff; border: 1px solid #eceff2; border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.05);
  overflow: hidden;
}
html.dark .czcx-stats { background: #0f172a; border-color: #1e293b; }
.czcx-stat { display: flex; align-items: center; gap: 13px; padding: 19px 22px; position: relative; }
.czcx-stat + .czcx-stat::before { content: ""; position: absolute; left: 0; top: 20%; bottom: 20%; width: 1px; background: #eceff2; }
html.dark .czcx-stat + .czcx-stat::before { background: #1e293b; }
.czcx-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: var(--czcx-soft); color: var(--czcx-c); }
.czcx-val { font-size: 23px; font-weight: 700; letter-spacing: -.2px; line-height: 1.05; color: #101828; font-variant-numeric: tabular-nums; }
html.dark .czcx-val { color: #f1f5f9; }
.czcx-lab { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #98a2b3; margin-top: 2px; }
.czcx-total { --czcx-c: #5b6472; --czcx-soft: #f2f4f6; }
.czcx-on { --czcx-c: #04b04c; --czcx-soft: #e2fbec; }
.czcx-cnt { --czcx-c: #dd9500; --czcx-soft: #fef6e0; }
.czcx-off { --czcx-c: #e5484d; --czcx-soft: #fdecea; }
@media (max-width: 1100px) { .czcx-stats { grid-template-columns: 1fr 1fr; } .czcx-stat + .czcx-stat::before { display: none; } }
@media (max-width: 560px) { .czcx-stats { grid-template-columns: 1fr; } }

/* botoes do header no padrao do mockup */
.connections-toolbar-btn { border-radius: 10px !important; font-weight: 600 !important; }
#connection-type-dropdown-button {
  background: linear-gradient(150deg, #12e468, #04b04c) !important;
  border-color: transparent !important;
  color: #fff !important;
  font-weight: 700 !important;
  border-radius: 11px !important;
  box-shadow: 0 6px 14px -6px rgba(0, 221, 91, .5);
}

/* CONEXOES: texto do hero cola no icone (flex:1), sem icone duplicado no titulo */
.czc-head { padding: 18px 24px !important; }
.czc-head .flex.flex-col.gap-5 > .space-y-2 { flex: 1 1 auto; min-width: 0; }
.czc-head h1 i, .czc-head h1 svg { display: none !important; }
.czc-head h1 { margin-top: 0 !important; }
.czc-head .space-y-2 > * + * { margin-top: 3px !important; }

/* CONEXOES: botoes identicos ao mockup */
.connections-toolbar-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: #ffffff !important;
  color: #101828 !important;
  border: 1px solid #eceff2 !important;
  border-radius: 11px !important;
  padding: 10px 15px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
html:not(.dark) .connections-toolbar-btn:hover { border-color: #bff2d5 !important; color: #04b04c !important; background: #ffffff !important; }
#connection-type-dropdown-button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: #00dd5b !important;
  color: #fff !important;
  border: none !important;
  border-radius: 11px !important;
  padding: 10px 15px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  box-shadow: 0 6px 16px -6px #00dd5b !important;
}
#connection-type-dropdown-button:hover { filter: brightness(1.04); }
/* separador antes do caret (split-button do mockup) */
#connection-type-dropdown-button > svg:last-child,
#connection-type-dropdown-button > i:last-child {
  opacity: .85;
  margin-left: 2px;
  padding-left: 9px;
  border-left: 1px solid rgba(255, 255, 255, .3);
  width: 22px;
  height: 13px;
}
