.data-table-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 300px;
  overflow: auto;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  
  .loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    
    p {
      margin: 0;
      color: #666;
      font-size: 14px;
    }
  }
}

.data-grid {
  width: 100%;
  height: 100%;
  
  // Personnalisation AG-Grid
  ::ng-deep {
    .ag-header {
      background-color: #f8f9fa;
      border-bottom: 2px solid #e9ecef;
      
      .ag-header-cell {
        border-right: 1px solid #e9ecef;
        
        .ag-header-cell-label {
          font-weight: 600;
          color: #495057;
        }
      }
    }
    
    .ag-row {
      &:hover {
        background-color: #f8f9fa;
      }
      
      &.ag-row-selected {
        background-color: #e3f2fd !important;
      }
    }
    
    .ag-cell {
      border-right: 1px solid #f1f3f4;
      display: flex;
      align-items: center;
      
      &:focus {
        outline: none;
      }
    }
    
    // Styles pour les badges picklist
    .picklist-badge {
      display: inline-block;
      white-space: nowrap;
      border: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    // Styles pour les références
    .reference-value {
      color: #1976d2;
      text-decoration: none;
      cursor: pointer;
      
      &:hover {
        text-decoration: underline;
      }
    }
    
    // Pagination personnalisée
    .ag-paging-panel {
      background-color: #f8f9fa;
      border-top: 1px solid #e9ecef;
      padding: 8px 16px;
      
      .ag-paging-page-summary-panel {
        color: #6c757d;
        font-size: 13px;
      }
      
      .ag-paging-button {
        border: 1px solid #dee2e6;
        background-color: white;
        color: #495057;
        
        &:hover:not(.ag-disabled) {
          background-color: #e9ecef;
        }
        
        &.ag-disabled {
          opacity: 0.5;
          cursor: not-allowed;
        }
      }
    }
    
    // Filtres flottants
    .ag-floating-filter-input {
      border: 1px solid #ced4da;
      border-radius: 4px;
      padding: 4px 8px;
      font-size: 13px;
      
      &:focus {
        border-color: #80bdff;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
        outline: none;
      }
    }
  }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6c757d;
  text-align: center;
  padding: 40px 20px;
  
  .empty-icon {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
  }
  
  h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 500;
  }
  
  p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
  }
}

// Responsive design
@media (max-width: 768px) {
  .data-table-container {
    .data-grid ::ng-deep {
      .ag-header-cell {
        min-width: 120px;
      }
      
      .ag-cell {
        padding: 8px 4px;
        font-size: 13px;
      }
      
      .ag-paging-panel {
        padding: 4px 8px;
        
        .ag-paging-page-summary-panel {
          font-size: 12px;
        }
      }
    }
  }
}

// Mode sombre (optionnel)
@media (prefers-color-scheme: dark) {
  .data-grid.ag-theme-alpine {
    --ag-background-color: #1e1e1e;
    --ag-header-background-color: #2d2d2d;
    --ag-odd-row-background-color: #242424;
    --ag-row-hover-color: #333333;
    --ag-selected-row-background-color: #0d47a1;
    --ag-border-color: #404040;
    --ag-secondary-border-color: #404040;
    --ag-foreground-color: #ffffff;
    --ag-secondary-foreground-color: #cccccc;
  }
}

