/* Variables CSS pour la palette de couleurs entreprise bleu */
/* :root {
    --primary-color: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-dark: #1e40af;
    --secondary-color: #0f766e;
    --secondary-light: #14b8a6;
    --accent-color: #f59e0b;
    --dark-color: #1f2937;
    --dark-light: #374151;
    --light-color: #f8fafc;
    --light-gray: #e5e7eb;
    --white: #ffffff;
    --danger-color: #dc2626;
    --success-color: #059669;
    --warning-color: #d97706;
    --info-color: #0284c7;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #d1d5db;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
} */


:root {
    --primary-color: #171718;
    --primary-light: #060f1d;
    --primary-dark: #01030a;
    --secondary-color: #0f766e;
    --secondary-light: #14b8a6;
    --accent-color: #f59e0b;
    --dark-color: #1f2937;
    --dark-light: #374151;
    --light-color: #f8fafc;
    --light-gray: #e5e7eb;
    --white: #ffffff;
    --danger-color: #dc2626;
    --success-color: #059669;
    --warning-color: #d97706;
    --info-color: #0284c7;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #d1d5db;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}
/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--light-color);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
}

/* Page de connexion */
.login-body {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.login-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 48px;
    box-shadow: var(--shadow-xl);
    text-align: center;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.login-card h1 {
    color: var(--primary-color);
    font-size: 2.75rem;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.login-card h2 {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 400;
    font-size: 1.125rem;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background-color: var(--white);
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    letter-spacing: 0.025em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
   
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #0d6b63, var(--secondary-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #ef4444);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c, var(--danger-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #10b981);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    background: linear-gradient(135deg, #047857, var(--success-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), #06b6d4);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-info:hover {
    background: linear-gradient(135deg, #0369a1, var(--info-color));
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--white), #f8fafc);
    box-shadow: var(--shadow-md);
    padding: 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 
Pour ajouter une image avant le texte dans .navbar-brand, on utilise le pseudo-élément ::before avec la propriété content et url().
Assurez-vous que le chemin de l'image est correct. Exemple ci-dessous :
*/
.navbar-brand::before {
    content: url(../img/icon.png);
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    /* Vous pouvez ajuster la taille de l'image avec width/height si besoin : */
    width: 32px;
    height: 32px;
    /* Pour forcer la taille, utilisez object-fit */
    object-fit: contain;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 4px;
    margin: 0;
    padding: 0;
}

.navbar-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
    position: relative;
}

.navbar-nav a:hover {
    background-color: var(--light-gray);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.navbar-nav a.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

/* Contenu principal */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px 24px;
}

.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
    padding: 48px 32px;
    margin-bottom: 32px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.3;
}

.page-header h1 {
    font-size: 2.75rem;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.025em;
    position: relative;
    z-index: 1;
}

.page-header p {
    font-size: 1.125rem;
    opacity: 0.9;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* Cartes */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

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

.card-header {
    background: linear-gradient(135deg, var(--light-color), #f1f5f9);
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    color: var(--text-primary);
    margin: 0;
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: -0.025em;
}

.card-body {
    padding: 24px;
}

/* Tableaux */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th,
.table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: linear-gradient(135deg, var(--light-color), #f1f5f9);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.table tr:hover {
    background-color: #f8fafc;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Formulaires */
.form-container {
    background: var(--white);
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.form-container h3 {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.form-row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.form-row .form-group {
    flex: 1;
}

.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background-color: var(--white);
    color: var(--text-primary);
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Messages */
.error-message {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #991b1b;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid #fecaca;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message::before {
    content: '⚠️';
    font-size: 1.125rem;
}

.success-message {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #166534;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid #bbf7d0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.success-message::before {
    content: '✅';
    font-size: 1.125rem;
}

/* Boutons d'action */
.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-danger {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.badge-info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.badge-success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Grille */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .navbar-nav {
        flex-direction: column;
        width: 100%;
        text-align: center;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Styles spécifiques pour les comptes */
.account-item {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.account-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.account-item:hover::before {
    transform: scaleY(1);
}

.account-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.account-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1rem;
    letter-spacing: -0.025em;
}

.account-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: block;
    margin-top: 4px;
    word-break: break-all;
}

.account-link:hover {
    text-decoration: underline;
}

/* Styles pour les graphiques */
.chart-container {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.chart-title {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

/* Styles pour les statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.2s ease;
}

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Modal de prévisualisation */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--white);
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--white);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 0;
    flex: 1;
    overflow: hidden;
}

#previewContainer {
    width: 100%;
    height: 100%;
    position: relative;
}

#previewFrame {
    border: none;
    width: 100%;
    height: 500px;
    border-radius: 0;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: var(--light-color);
    border-radius: 0 0 12px 12px;
}

/* Responsive pour le modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    #previewFrame {
        height: 400px;
    }
}
