/* ========= THEME BASE ========= */
/* Dark profundo + roxo Zap2B nos destaques */
[data-md-color-scheme="slate"] {
    --md-default-bg-color: #0b0f14;
    --md-default-fg-color: #e6e9ef;
    --md-default-fg-color--light: #c7cbd3;
    --md-code-bg-color: #0f172a;
    --md-primary-fg-color: #6C4FF6;   /* roxo Zap2B */
    --md-accent-fg-color:  #6C4FF6;
  }
  
  /* Cabeçalho preto e busca à direita */
  .md-header { background: #000 !important; }
  .md-search { margin-left: auto; max-width: 420px; }
  
  /* Esconde o texto do título (mantém no <title>) */
  .md-header__title { display: none !important; }
  /* Esconde o nome do site no topo da sidebar */
  .md-nav__title { display: none !important; }
  
  /* Logo responsiva - corrigida para mobile */
  .md-header__button.md-logo {
    display: flex !important;
    align-items: center;
  }
  
  .md-header__button.md-logo img { 
    height: 26px;
    width: auto;
    max-width: none;
  }
  
  @media (min-width: 960px) {
    .md-header__button.md-logo img { height: 30px; }
  }
  
  /* Garante que a logo apareça no mobile */
  @media (max-width: 959px) {
    .md-header__button.md-logo {
      display: flex !important;
      margin-right: 0.5rem;
    }
  }
  
  /* Botão Login no header */
  .z2b-btn-login {
    margin-left: .75rem;
    padding: .45rem .9rem;
    border-radius: 8px;
    background: #6C4FF6;
    color: #fff !important;
    font-weight: 600;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border: 1px solid rgba(255,255,255,.08);
  }
  .z2b-btn-login:hover { filter: brightness(1.06); }
  
  /* ========= CONTENT ========= */
  .md-typeset .admonition,
  .md-typeset details { border-radius: 12px; }
  
  /* ========= SIDEBAR / NAV ========= */
  .md-sidebar { background: #0b0f14 !important; }
  .md-nav { font-size: 14.5px; }
  .md-nav__list { gap: 2px; }
  
  .md-nav__link {
    border-radius: 8px;
    padding: .45rem .6rem;
  }
  .md-nav__link:hover {
    background: rgba(255,255,255,.05);
  }
  
  /* Título de seção (grupo) mais forte, mas sem visual de "selecionado" */
  .md-nav__item--section > .md-nav__link {
    letter-spacing: .2px;
    font-weight: 700;
    color: #c7cbd3;
    opacity: .95;
    background: transparent !important;
    box-shadow: none !important;
  }
  
  /* ===== ACTIVE STATE (corrigido) ===== */
  /* Destaque APENAS no link ativo (folha) */
  .md-nav__link--active {
    position: relative;
    background: rgba(108,79,246,.18) !important;
    box-shadow: inset 2px 0 0 #6C4FF6 !important;
  }
  
  /* Garante que os pais NÃO pareçam selecionados */
  .md-nav__item--active > .md-nav__link:not(.md-nav__link--active) {
    background: transparent !important;
    box-shadow: none !important;
  }
  
  /* Barrinha vertical só no item ativo (não nos pais) */
  .md-nav__link--active::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: #6C4FF6;
    border-radius: 2px;
  }
  
  /* Espaçamento entre grupos */
  .md-nav__item--section { margin-top: .35rem; }
  
  /* ========= PERMALINK ICON ========= */
  /* Personaliza o ícone de permalink para ser mais elegante */
  .md-typeset .headerlink {
    color: rgba(108, 79, 246, 0.4) !important;
    font-size: 0.8em;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
  }
  
  .md-typeset .headerlink:hover {
    color: #6C4FF6 !important;
    text-decoration: none;
  }
  
  /* Opcional: esconder completamente o ícone */
  /* .md-typeset .headerlink { display: none !important; } */
  
  /* ========= TEXT WRAPPING ========= */
  /* Evita quebra inadequada de palavras */
  .md-typeset blockquote {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  
  /* Força quebra em pontos específicos para evitar palavras quebradas */
  .md-typeset blockquote strong {
    white-space: nowrap;
  }
  
  /* Melhora a quebra de linha em geral */
  .md-typeset p, .md-typeset blockquote {
    line-height: 1.6;
    text-align: justify;
    text-justify: inter-word;
  }
  
  /* ========= NAVIGATION STYLING ========= */
  /* Estilização profissional da navegação */
  .md-nav__link {
    font-weight: 500;
    transition: all 0.2s ease;
  }
  
  /* Hover effect suave */
  .md-nav__link:hover {
    color: #e6e9ef;
    transform: translateX(2px);
  }
  
  /* Links ativos com destaque roxo */
  .md-nav__link--active {
    color: #6C4FF6 !important;
    font-weight: 600;
  }
  
  /* Seções principais */
  .md-nav__item--section > .md-nav__link {
    font-weight: 700;
    color: #c7cbd3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
  }
  
  /* ========= PROFESSIONAL CARDS ========= */
  /* Cards grid com design moderno e profissional */
  .md-typeset .grid.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
  }
  
  .md-typeset .grid.cards > * {
    background: linear-gradient(135deg, #1a1f2e 0%, #0f1419 100%);
    border: 1px solid rgba(108, 79, 246, 0.15);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
  
  /* Hover effect elegante */
  .md-typeset .grid.cards > *:hover {
    transform: translateY(-4px);
    border-color: rgba(108, 79, 246, 0.4);
    box-shadow: 0 12px 40px rgba(108, 79, 246, 0.15);
  }
  
  /* Efeito de brilho sutil */
  .md-typeset .grid.cards > *::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(108, 79, 246, 0.6), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .md-typeset .grid.cards > *:hover::before {
    opacity: 1;
  }
  
  /* Ícones dos cards */
  .md-typeset .grid.cards .twemoji {
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 8px rgba(108, 79, 246, 0.3));
  }
  
  /* Títulos dos cards */
  .md-typeset .grid.cards h3,
  .md-typeset .grid.cards h4 {
    color: #e6e9ef;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
  }
  
  /* Texto descritivo */
  .md-typeset .grid.cards p {
    color: #9ca3af;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
  }
  
  /* Botões dos cards */
  .md-typeset .grid.cards a[href] {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(108, 79, 246, 0.1);
    border: 1px solid rgba(108, 79, 246, 0.3);
    border-radius: 8px;
    color: #6C4FF6 !important;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none !important;
    transition: all 0.2s ease;
  }
  
  .md-typeset .grid.cards a[href]:hover {
    background: rgba(108, 79, 246, 0.15);
    border-color: rgba(108, 79, 246, 0.5);
    transform: translateX(2px);
  }
  
  /* Ícone do botão */
  .md-typeset .grid.cards a[href] .twemoji {
    width: 1rem;
    height: 1rem;
    margin: 0;
    filter: none;
  }
  
  /* Responsividade */
  @media (max-width: 768px) {
    .md-typeset .grid.cards {
      grid-template-columns: 1fr;
      gap: 1rem;
    }
    
    .md-typeset .grid.cards > * {
      padding: 1.5rem;
    }
  }
  
  /* ========= MOBILE NAVIGATION IMPROVEMENTS ========= */
  /* Breadcrumbs melhorados para mobile */
  @media (max-width: 959px) {
    .md-path {
      font-size: 0.8rem;
      margin-bottom: 1rem;
      padding: 0.5rem;
      background: rgba(108, 79, 246, 0.05);
      border-radius: 6px;
      border-left: 3px solid #6C4FF6;
    }
    
    .md-path__link {
      color: #6C4FF6;
      text-decoration: none;
    }
    
    .md-path__link:hover {
      text-decoration: underline;
    }
  }
  
  /* Footer navigation melhorado para mobile */
  @media (max-width: 959px) {
    .md-footer-nav {
      padding: 1rem;
      margin-top: 2rem;
      border-top: 1px solid rgba(108, 79, 246, 0.1);
    }
    
    .md-footer-nav__inner {
      display: flex;
      justify-content: space-between;
      gap: 1rem;
    }
    
    .md-footer-nav__link {
      flex: 1;
      padding: 0.75rem;
      background: rgba(108, 79, 246, 0.08);
      border-radius: 8px;
      text-align: center;
      font-size: 0.9rem;
      transition: all 0.2s ease;
    }
    
    .md-footer-nav__link:hover {
      background: rgba(108, 79, 246, 0.15);
      transform: translateY(-1px);
    }
  }
  
  /* Botão "voltar ao topo" mais visível no mobile */
  @media (max-width: 959px) {
    .md-top {
      position: fixed !important;
      bottom: 1rem !important;
      right: 1rem !important;
      background: #6C4FF6 !important;
      border-radius: 50% !important;
      box-shadow: 0 4px 12px rgba(108, 79, 246, 0.3);
      width: 48px !important;
      height: 48px !important;
      z-index: 100 !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      padding: 0 !important;
    }
    
    /* Remove o texto no mobile, mantém apenas o ícone */
    .md-top .md-top__inner {
      display: none !important;
    }
    
    /* Garante que o ícone SVG fique centralizado */
    .md-top svg {
      width: 24px !important;
      height: 24px !important;
      margin: 0 !important;
    }
    
    .md-top:hover {
      background: rgba(108, 79, 246, 0.9) !important;
      transform: scale(1.1);
    }
  }
  
  /* Menu mobile mais acessível */
  @media (max-width: 959px) {
    .md-nav--primary .md-nav__title {
      background: #6C4FF6;
      color: white;
      font-weight: 600;
      padding: 1rem;
    }
    
    .md-nav--primary .md-nav__title::before {
      display: none; /* Remove o ícone padrão */
    }
    
    /* Melhora a navegação hierárquica no mobile - abordagem conservadora */
    .md-nav__item--section > .md-nav__link {
      background: rgba(108, 79, 246, 0.1);
      border-left: 3px solid #6C4FF6;
      margin: 0.25rem 0;
      padding: 0.75rem;
      border-radius: 6px;
      font-weight: 600;
    }
    
    /* Links de índice das seções mais visíveis */
    .md-nav__link--index {
      background: rgba(108, 79, 246, 0.15) !important;
      color: #6C4FF6 !important;
      font-weight: 600;
      border-radius: 6px;
      margin-bottom: 0.5rem;
    }
    
    /* Submenus com indentação clara */
    .md-nav__item .md-nav__list {
      border-left: 2px solid rgba(108, 79, 246, 0.2);
      margin-left: 0.5rem;
      padding-left: 1rem;
    }
    
    /* Breadcrumbs mais proeminentes no mobile */
    .md-path {
      position: sticky;
      top: 0;
      z-index: 10;
      background: rgba(11, 15, 20, 0.95);
      backdrop-filter: blur(10px);
      border-bottom: 1px solid rgba(108, 79, 246, 0.2);
    }
  }
  
  /* Rodapé elegante com cards profissionais */
  .md-footer {
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 4rem;
  }
  
  /* Cards de navegação anterior/próximo */
  .md-footer-nav {
    padding: 2rem 0 1.5rem;
  }
  
  .md-footer-nav__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 100%;
  }
  
  .md-footer-nav__link {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(108, 79, 246, 0.08) 0%, rgba(108, 79, 246, 0.03) 100%);
    border: 1px solid rgba(108, 79, 246, 0.15);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    min-height: 80px;
  }
  
  .md-footer-nav__link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6C4FF6, #9333EA, #EC4899);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .md-footer-nav__link:hover {
    background: linear-gradient(135deg, rgba(108, 79, 246, 0.15) 0%, rgba(108, 79, 246, 0.08) 100%);
    border-color: rgba(108, 79, 246, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(108, 79, 246, 0.15);
  }
  
  .md-footer-nav__link:hover::before {
    opacity: 1;
  }
  
  /* Estilo dos títulos "Anterior/Próximo" */
  .md-footer-nav__title {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(108, 79, 246, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  
  /* Título da página */
  .md-footer-nav__link .md-ellipsis {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.4;
    margin: 0;
  }
  
  /* Alinhamento para link anterior (esquerda) */
  .md-footer-nav__link--prev {
    text-align: left;
  }
  
  /* Alinhamento para link próximo (direita) */
  .md-footer-nav__link--next {
    text-align: right;
  }
  
  /* Ícones SVG dos cards */
  .md-footer-nav__link svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
  }
  
  .md-footer-nav__link:hover svg {
    opacity: 1;
  }
  
  /* Data de atualização elegante */
  .md-source-file {
    text-align: center;
    padding: 1.5rem 0 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 1.5rem;
  }
  
  .md-source-file__fact {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(108, 79, 246, 0.08);
    padding: 0.6rem 1.2rem;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(108, 79, 246, 0.15);
    transition: all 0.3s ease;
  }
  
  .md-source-file__fact:hover {
    background: rgba(108, 79, 246, 0.12);
    border-color: rgba(108, 79, 246, 0.25);
  }
  
  /* Responsivo para mobile */
  @media (max-width: 959px) {
    .md-footer-nav__inner {
      grid-template-columns: 1fr;
      gap: 1rem;
    }
    
    .md-footer-nav__link {
      padding: 1.25rem;
      min-height: 70px;
      text-align: left !important;
    }
    
    .md-footer-nav {
      padding: 1.5rem 0 1rem;
    }
    
    .md-footer {
      margin-top: 3rem;
    }
  }
  
  /* Cards específicos do Dashboard */
  .dashboard-overview.md-typeset .grid.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
  }
  
  .dashboard-overview .md-typeset .grid.cards > li {
    background: linear-gradient(135deg, rgba(108, 79, 246, 0.08) 0%, rgba(147, 51, 234, 0.05) 100%);
    border: 1px solid rgba(108, 79, 246, 0.15);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
  }
  
  .dashboard-overview .md-typeset .grid.cards > li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6C4FF6, #9333EA, #EC4899);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .dashboard-overview .md-typeset .grid.cards > li:hover {
    background: linear-gradient(135deg, rgba(108, 79, 246, 0.12) 0%, rgba(147, 51, 234, 0.08) 100%);
    border-color: rgba(108, 79, 246, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(108, 79, 246, 0.15);
  }
  
  .dashboard-overview .md-typeset .grid.cards > li:hover::before {
    opacity: 1;
  }
  
  /* Ícones dos cards do Dashboard */
  .dashboard-icon {
    font-size: 2.5rem !important;
    margin-bottom: 1rem !important;
    display: block !important;
    text-align: center !important;
  }
  
  /* Cores dos ícones - Dashboard */
  .kpi-icon {
    color: #6C4FF6 !important;
  }
  
  .origins-icon {
    color: #10B981 !important;
  }
  
  .stats-icon {
    color: #F59E0B !important;
  }
  
  .classification-icon {
    color: #EF4444 !important;
  }
  
  /* Cores dos ícones - Atendimentos */
  .sidebar-icon {
    color: #8B5CF6 !important;
  }
  
  .conversation-icon {
    color: #06B6D4 !important;
  }
  
  .composer-icon {
    color: #10B981 !important;
  }
  
  /* Títulos dos cards - Dashboard e Atendimentos */
  .dashboard-overview .md-typeset .grid.cards > li > p:first-of-type,
  .atendimentos-overview .md-typeset .grid.cards > li > p:first-of-type {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: rgba(255, 255, 255, 0.95) !important;
    margin-bottom: 1rem !important;
    text-align: center !important;
  }
  
  /* Conteúdo dos cards - Dashboard e Atendimentos */
  .dashboard-overview .md-typeset .grid.cards > li > p:last-of-type,
  .atendimentos-overview .md-typeset .grid.cards > li > p:last-of-type {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    color: rgba(255, 255, 255, 0.8) !important;
    text-align: center !important;
    margin: 0 !important;
  }
  
  /* Linha separadora - Dashboard e Atendimentos */
  .dashboard-overview .md-typeset .grid.cards > li > hr,
  .atendimentos-overview .md-typeset .grid.cards > li > hr {
    border: none !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent, rgba(108, 79, 246, 0.3), transparent) !important;
    margin: 1.5rem 0 !important;
  }
  
  /* Cards específicos dos Atendimentos */
  .atendimentos-overview.md-typeset .grid.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
  }
  
  .atendimentos-overview .md-typeset .grid.cards > li {
    background: linear-gradient(135deg, rgba(108, 79, 246, 0.08) 0%, rgba(147, 51, 234, 0.05) 100%);
    border: 1px solid rgba(108, 79, 246, 0.15);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
  }
  
  .atendimentos-overview .md-typeset .grid.cards > li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8B5CF6, #06B6D4, #10B981);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .atendimentos-overview .md-typeset .grid.cards > li:hover {
    background: linear-gradient(135deg, rgba(108, 79, 246, 0.12) 0%, rgba(147, 51, 234, 0.08) 100%);
    border-color: rgba(108, 79, 246, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(108, 79, 246, 0.15);
  }
  
  .atendimentos-overview .md-typeset .grid.cards > li:hover::before {
    opacity: 1;
  }
  
  /* Responsivo para cards do Dashboard e Atendimentos */
  @media (max-width: 959px) {
    .dashboard-overview.md-typeset .grid.cards,
    .atendimentos-overview.md-typeset .grid.cards {
      grid-template-columns: 1fr;
      gap: 1rem;
    }
    
    .dashboard-overview .md-typeset .grid.cards > li,
    .atendimentos-overview .md-typeset .grid.cards > li {
      padding: 1.5rem;
    }
    
    .dashboard-icon {
      font-size: 2rem !important;
    }
  }
  