/* 
=====================================================
  SYSTÈME DE COTATIONS IFAPME - CSS PRINCIPAL
=====================================================
*/

:root {
    /* Couleurs principales */
    --primary: #6366F1;
    --secondary: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --success: #10B981;
    --info: #3B82F6;
    
    /* Backgrounds */
    --bg-body: #F9FAFB;
    --bg-surface: #FFFFFF;
    
    /* Texte */
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-inverse: #FFFFFF;
    
    /* Bordures */
    --border-color: #E5E7EB;
    --border-radius: 12px;
    
    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    
    /* Espacements */
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
}

/* Reset de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md) var(--space-lg);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
}

.btn-danger:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text-inverse);
}

.btn-secondary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* Cards */
.card {
    background: var(--bg-surface);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-lg);
}

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

/* Inputs */
.input, .select, textarea {
    width: 100%;
    padding: var(--space-md);
    font-size: 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-surface);
    transition: all 0.2s;
}

.input:focus, .select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Labels */
.label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table thead {
    background: var(--bg-body);
}

.table th {
    padding: var(--space-md);
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.table td {
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: var(--bg-body);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 50px;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

/* Alerts */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border-left: 4px solid var(--info);
}

/* Navigation */
nav {
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    padding: var(--space-md) 0;
}

/* Utilitaires */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt { margin-top: var(--space-lg); }
.mb { margin-bottom: var(--space-lg); }
.p { padding: var(--space-lg); }

.flex {
    display: flex;
    gap: var(--space-md);
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Responsive */
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .flex {
        flex-direction: column;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Messages flash */
.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.flash-message {
    padding: var(--space-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--space-sm);
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.3s ease-in;
}
