/*
 * ERPENY Design System v1.0
 * Système de design moderne basé sur les rapports
 * Cohérence visuelle pour toute l'application
 */

/* ========================================
   VARIABLES CSS & COULEURS
   ======================================== */

:root {
    /* Gradients principaux */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-orange: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    --gradient-cyan: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    --gradient-purple: linear-gradient(135deg, #6f42c1 0%, #563d7c 100%);
    --gradient-success: linear-gradient(135deg, #28a745, #20c997);
    --gradient-warning: linear-gradient(135deg, #ffc107, #fd7e14);
    --gradient-danger: linear-gradient(135deg, #dc3545, #e83e8c);
    
    /* Couleurs système */
    --color-white: #ffffff;
    --color-light: #f8f9fa;
    --color-muted: #6c757d;
    --color-border: #e3e6f0;
    
    /* Espacements */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Bordures */
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 1rem;
    
    /* Ombres */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* ========================================
   CARTES MÉTRIQUES MODERNES
   ======================================== */

.metric-card {
    background: var(--gradient-primary);
    color: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: none;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    position: relative;
    z-index: 1;
}

.metric-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 1;
}

.metric-subtitle {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: var(--spacing-xs);
    position: relative;
    z-index: 1;
}

/* Variantes de couleurs pour les cartes */
.metric-card.orange { background: var(--gradient-orange); }
.metric-card.cyan { background: var(--gradient-cyan); }
.metric-card.purple { background: var(--gradient-purple); }
.metric-card.success { background: var(--gradient-success); }
.metric-card.warning { background: var(--gradient-warning); }
.metric-card.danger { background: var(--gradient-danger); }

/* ========================================
   CERCLES DE PROGRESSION
   ======================================== */

.progress-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-white);
    margin: 0 auto;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease;
}

.progress-circle:hover {
    transform: scale(1.05);
}

.progress-circle.high { background: var(--gradient-success); }
.progress-circle.medium { background: var(--gradient-warning); }
.progress-circle.low { background: var(--gradient-danger); }

/* Cercles plus petits pour les dashboards */
.progress-circle.sm {
    width: 80px;
    height: 80px;
    font-size: 1.25rem;
}

/* ========================================
   BADGES DE STATUT MODERNES
   ======================================== */

.status-badge {
    font-size: 0.875rem;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-md);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    transition: all 0.2s ease;
}

.status-badge:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.status-completed { 
    background-color: #d4edda; 
    color: #155724; 
    border: 1px solid #c3e6cb; 
}

.status-generating { 
    background-color: #fff3cd; 
    color: #856404; 
    border: 1px solid #ffeaa7; 
}

.status-failed { 
    background-color: #f8d7da; 
    color: #721c24; 
    border: 1px solid #f5c6cb; 
}

.status-pending { 
    background-color: #d1ecf1; 
    color: #0c5460; 
    border: 1px solid #bee5eb; 
}

/* ========================================
   TABLES MODERNES
   ======================================== */

.modern-table {
    background: var(--color-white);
    border: none !important;
    border-collapse: collapse;
}

.modern-table,
.modern-table thead,
.modern-table tbody,
.modern-table tfoot,
.modern-table tr,
.modern-table th,
.modern-table td {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
}

.modern-table th {
    background: var(--color-light);
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: var(--spacing-md) var(--spacing-lg);
    border: none !important;
    position: relative;
}

.modern-table th:hover {
    background: #e9ecef;
    cursor: pointer;
}

.modern-table td {
    padding: var(--spacing-md) var(--spacing-lg);
    border: none !important;
    vertical-align: middle;
}

.modern-table tbody tr:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}



/* ========================================
   BOUTONS MODERNES
   ======================================== */

.btn-modern {
    border-radius: var(--border-radius-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-modern:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-modern.primary {
    background: var(--gradient-primary);
    color: var(--color-white);
}

.btn-modern.success {
    background: var(--gradient-success);
    color: var(--color-white);
}

.btn-modern.warning {
    background: var(--gradient-warning);
    color: var(--color-white);
}

.btn-modern.danger {
    background: var(--gradient-danger);
    color: var(--color-white);
}

/* ========================================
   CARTES DE CONTENU
   ======================================== */

.content-card {
    background: var(--color-white);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.content-card:hover {
    box-shadow: var(--shadow-md);
}

.content-card .card-header {
    background: var(--color-light);
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-lg);
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.content-card .card-body {
    padding: var(--spacing-lg);
}

/* ========================================
   ÉLÉMENTS D'ÉCART (DISCREPANCIES)
   ======================================== */

.discrepancy-item {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    transition: all 0.2s ease;
}

.discrepancy-item:hover {
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

.missing-item {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    transition: all 0.2s ease;
}

.missing-item:hover {
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

.info-item {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    transition: all 0.2s ease;
}

.info-item:hover {
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

/* ========================================
   CONTRÔLES RAPIDES / FILTRES
   ======================================== */

.quick-controls {
    padding: var(--spacing-lg) 0;
    margin-bottom: var(--spacing-lg);
}

.quick-controls .form-control,
.quick-controls .form-select {
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--color-border);
    padding: var(--spacing-sm) var(--spacing-md);
    transition: all 0.2s ease;
}

.quick-controls .form-control:focus,
.quick-controls .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* ========================================
   ANIMATIONS & TRANSITIONS
   ======================================== */

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   RESPONSIVENESS
   ======================================== */

@media (max-width: 768px) {
    .metric-card {
        margin-bottom: var(--spacing-md);
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .progress-circle {
        width: 80px;
        height: 80px;
        font-size: 1.25rem;
    }
    
    .modern-table th,
    .modern-table td {
        padding: var(--spacing-sm) var(--spacing-md);
    }
}

/* ========================================
   UTILITAIRES
   ======================================== */

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box, var(--gradient-primary) border-box;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========================================
   METRIC CARDS - Composants centralisés
   ======================================== */
.metric-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.metric-card.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.metric-card.warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.metric-card.danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

.metric-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: white;
}

.metric-label {
    font-size: 0.875rem;
    opacity: 0.8;
    color: white;
}

/* ========================================
   TABS MODERNES - Composants centralisés
   ======================================== */
.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;
}