/* ===================================================
   RESPONSIVO GERAL (SMARTPHONES E TABLETS MENORES)
   =================================================== */
@media (max-width: 768px) {
  /* Botão do menu mobile estilo Claude (minimalista) */
  .mobile-menu-btn { 
    display: flex !important; 
    background: transparent !important;
    border: none !important;
    padding: 4px !important;
    color: var(--text-secondary);
    margin-right: -4px;
  }
  .mobile-menu-btn:hover {
    color: var(--text-primary);
  }
  .sidebar-toggle { display: none !important; }
  
  /* Ajustar o grid de métricas do dashboard e outros grids */
  .grid-2, .grid-3, .grid-4 { 
    grid-template-columns: 1fr !important; 
  }
  
  /* Dashboard cards em 2 colunas */
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  /* Header responsivo no mobile */
  .top-header {
    padding: 12px 16px;
  }
  
  .header-left {
    gap: 8px;
  }

  /* Form rows */
  .form-row {
    flex-direction: column;
    gap: 16px;
  }
  
  .modal-form .form-row > .form-group {
    flex: 1 1 100% !important;
  }

  /* Sidebar off-canvas e Overlay */
  .sidebar {
    width: 280px;
    left: -280px;
    z-index: 1001;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.open {
    left: 0;
  }
  
  .overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 1000;
  }
  .overlay.active {
    display: block;
  }

  /* Main wrapper ocupa 100% */
  .main-wrapper {
    margin-left: 0 !important;
    width: 100vw;
  }

  /* Kanban Scroll Horizontal (Trello-style) */
  .kanban-board {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding-bottom: 16px;
    height: auto;
  }
  .kanban-col {
    width: 280px; /* Reduzido para sobrar espaço e habilitar scroll automático */
    min-width: 280px;
    scroll-snap-align: center;
    min-height: 400px;
  }

  /* Botão Novo visível em tamanho compacto */
  .header-right .btn-action {
    display: flex !important;
    padding: 8px 14px;
    font-size: 13px;
  }

  /* Listas Responsivas (Quebra de linha) */
  .list-item {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .list-item-avatar {
    margin-bottom: auto;
  }
  .list-item-info {
    flex: 1 1 calc(100% - 60px);
  }
  .list-item-meta, .list-item-metrics {
    width: 100%;
    margin-right: 0 !important;
    justify-content: space-between !important;
    gap: 8px !important;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
  }
  .list-item-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 8px;
  }

  /* Responsive Stats Card & Pipeline Styles */
  .stat-card-small {
    padding: 12px 16px;
    gap: 12px;
  }
  
  .stat-content {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 2px;
  }
  
  .stat-value {
    font-size: 15px;
  }
  
  .stat-label {
    font-size: 9px;
  }

  .pipeline-stage-card {
    flex: 1 1 calc(33.333% - 12px) !important;
    min-width: 90px;
  }
}

/* Extra small devices (smartphones in portrait) */
@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .stat-card-small {
    padding: 10px 12px;
    gap: 8px;
  }
  
  .stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }
  
  .stat-icon i, .stat-icon svg {
    width: 16px !important;
    height: 16px !important;
  }

  .pipeline-stage-card {
    flex: 1 1 calc(50% - 8px) !important;
    min-width: 80px;
  }
}
