/**
 * CSS centralisé pour le système de tables A+B+C
 * Modifiez uniquement ce fichier pour changer le style de toutes les tables
 */

/* =============================================================================
   BLOCS DE STATISTIQUES ÉLÉGANTS
   ============================================================================= */

.stats-card {
    border: 1px solid #e3e6f0 !important;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15) !important;
    transition: all 0.3s;
}

.stats-card:hover {
    box-shadow: 0 0.25rem 2rem 0 rgba(58, 59, 69, 0.2) !important;
    transform: translateY(-2px);
}

.stats-card.success {
    border-left: 4px solid #1cc88a !important;
}

.stats-card.warning {
    border-left: 4px solid #f6c23e !important;
}

.stats-card .card-body {
    padding: 1.25rem;
}

.stats-card .card-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #5a5c69;
}

.stats-card .card-subtitle {
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

/* =============================================================================
   OPTIMISATION DU TABLEAU ULTRA-COMPACT
   ============================================================================= */

.modern-table {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.modern-table th {
    padding: 0.4rem 0.25rem;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.2;
}

.modern-table td {
    padding: 0.4rem 0.25rem;
    vertical-align: middle;
    line-height: 1.3;
}

/* =============================================================================
   LIGNE DE FILTRES ULTRA-COMPACTE
   ============================================================================= */

.filter-row th {
    padding: 0.25rem;
    background-color: #f1f3f4;
    border-bottom: 1px solid #dee2e6;
    border-top: none;
}

.filter-row input,
.filter-row select {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    min-width: 60px;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

/* Contrôles rapides compacts et élégants */
.quick-controls {
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quick-controls .form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.quick-controls .form-control,
.quick-controls .form-select {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.quick-controls .form-control:focus,
.quick-controls .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.quick-controls .btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

/* =============================================================================
   BADGES ÉLÉGANTS ET SUBTILS - STYLE DE RÉFÉRENCE
   ============================================================================= */

/* Badges avec style exact de la référence */
.badge-elegant {
    font-size: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: none;
    transition: all 0.2s ease;
}

/* Style "Envoyé à Pennylane" - vert très pâle avec texte plus foncé */
.badge-sent {
    background-color: #f0fdf4;
    color: #166534;
}

/* Style "Sync" - vert identique avec texte plus foncé */
.badge-sync {
    background-color: #f0fdf4;
    color: #166534;
}

/* Style "En attente" - gris très doux */
.badge-pending {
    background-color: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

/* Style "Erreur" - rouge très doux */
.badge-error {
    background-color: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* Style "Brouillon" - gris bleuté doux */
.badge-draft {
    background-color: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

/* =============================================================================
   BADGES POUR AUTRES MODULES - FORME HARMONISÉE
   ============================================================================= */

/* Badges produits */
.badge-info {
    background-color: #e0f2fe;
    color: #0277bd;
}

.badge-secondary {
    background-color: #f5f5f5;
    color: #616161;
}

.badge-muted {
    background-color: #f8f9fa;
    color: #6c757d;
}

/* Badges clients */
.badge-primary {
    background-color: #e3f2fd;
    color: #1976d2;
}

.badge-code {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.badge-empty {
    background-color: #fafafa;
    color: #9e9e9e;
}

/* Badges workflows */
.badge-workflow-pending {
    background-color: #fff8e1;
    color: #ff8f00;
}

.badge-workflow-running {
    background-color: #e3f2fd;
    color: #1976d2;
}

.badge-workflow-completed {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.badge-workflow-failed {
    background-color: #ffebee;
    color: #c62828;
}

.badge-workflow-cancelled {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

/* Badges logs d'erreur */
.badge-error-api {
    background-color: #fff3e0;
    color: #ef6c00;
}

.badge-error-data {
    background-color: #fce4ec;
    color: #ad1457;
}

.badge-error-validation {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.badge-error-system {
    background-color: #ffebee;
    color: #c62828;
}

.badge-error-auth {
    background-color: #e8eaf6;
    color: #3f51b5;
}

.badge-resolved-true {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.badge-resolved-false {
    background-color: #fff8e1;
    color: #f57c00;
}

/* =============================================================================
   ONGLETS MODERNES POUR LA NAVIGATION
   ============================================================================= */

/* Onglets modernes */
.nav-tabs-modern {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 1rem;
}

.nav-tabs-modern .nav-link {
    border: none;
    background: none;
    color: #6c757d;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-tabs-modern .nav-link:hover {
    background-color: #f8f9fa;
    border-bottom-color: #adb5bd;
}

.nav-tabs-modern .nav-link.active {
    color: #0d6efd;
    background-color: transparent;
    border-bottom-color: #0d6efd;
    font-weight: 600;
}

.nav-tabs-modern .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

/* =============================================================================
   SUPPRESSION DES OUTLINES SUR FOCUS
   ============================================================================= */

*:focus,
*:active,
button:focus,
button:active,
.btn:focus,
.btn:active,
a.btn:focus,
a.btn:active,
input:focus,
select:focus,
.form-control:focus,
.form-select:focus,
a.btn-outline-warning:focus,
a.btn-outline-warning:active,
a.btn-outline-success:focus,
a.btn-outline-success:active,
a.btn-outline-info:focus,
a.btn-outline-info:active,
a.btn-outline-danger:focus,
a.btn-outline-danger:active,
a.btn-primary:focus,
a.btn-primary:active,
a.btn-secondary:focus,
a.btn-secondary:active {
    box-shadow: none !important;
    outline: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
    text-decoration: none !important;
}

/* Règle globale pour tous les états de focus */
*:focus-visible {
    box-shadow: none !important;
    outline: none !important;
}

/* Spécifique pour les liens habillés en boutons */
a[class*="btn"]:focus,
a[class*="btn"]:active,
a[class*="btn"]:hover:focus {
    box-shadow: none !important;
    outline: none !important;
}

/* =============================================================================
   STYLES POUR LES FILTRES AJAX
   ============================================================================= */

.ajax-filter {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ajax-filter:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 1200px) {
    .modern-table {
        font-size: 0.8rem;
    }
    .modern-table th, .modern-table td {
        padding: 0.4rem 0.2rem;
    }
    .quick-controls {
        padding: 0.3rem 0;
        margin-bottom: 0.8rem;
    }
}

@media (max-width: 768px) {
    .modern-table {
        font-size: 0.75rem;
    }
    .modern-table th, .modern-table td {
        padding: 0.3rem 0.15rem;
    }
    .filter-row input,
    .filter-row select {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
        min-width: 50px;
    }
}

/* =============================================================================
   ESPACEMENT POUR PAGES SANS FILTRES GLOBAUX
   ============================================================================= */

.table-container-no-filters {
    margin-top: 1.5rem;
}

/* =============================================================================
   BOUTONS D'ACTIONS - STYLE BOOTSTRAP ÉLÉGANT
   ============================================================================= */

/* Amélioration légère des btn-group pour un look plus net */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

/* =============================================================================
   BOUTONS MODERNES POUR LE HEADER
   ============================================================================= */

.btn-modern {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.btn-modern:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-modern.primary {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    color: white;
}

.btn-modern.primary:hover {
    background: linear-gradient(135deg, #0b5ed7, #0a58ca);
    color: white;
}

.btn-modern.success {
    background: linear-gradient(135deg, #198754, #157347);
    color: white;
}

.btn-modern.success:hover {
    background: linear-gradient(135deg, #157347, #146c43);
    color: white;
}

.btn-modern.secondary {
    background: linear-gradient(135deg, #6c757d, #5c636a);
    color: white;
}

.btn-modern.secondary:hover {
    background: linear-gradient(135deg, #5c636a, #565e64);
    color: white;
}

/* =============================================================================
   PAGINATION HARMONISÉE
   ============================================================================= */

.modern-pagination {
    font-size: 0.875rem;
}

.modern-page-input {
    width: 60px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    text-align: center;
}