:root {
    /* Palette inspirée d'Equalia - tons aquatiques et dynamiques */
    --primary-color: #0089d0;
    --primary-dark: #006ba6;
    --primary-light: #4db3e6;
    --accent-color: #00c1ff;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #f5f8fa;
    --card-background: #ffffff;
    --text-primary: #1a2332;
    --text-secondary: #6b7a8f;
    --border-color: #e1e8ed;
    --shadow: 0 2px 8px 0 rgba(0, 137, 208, 0.08);
    --shadow-lg: 0 10px 30px -5px rgba(0, 137, 208, 0.15);
    --gradient-primary: linear-gradient(135deg, #0089d0 0%, #00c1ff 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-weight: 400;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    margin-bottom: 3rem;
    padding: 2rem 0;
    background: linear-gradient(135deg, rgba(0, 137, 208, 0.03) 0%, rgba(0, 193, 255, 0.03) 100%);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 0 2rem;
}

.header-left h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 12px;
    border: 2px solid var(--primary-light);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.user-info:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.user-name {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-name::before {
    content: "👤";
    font-size: 1.1rem;
}

.user-department {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.btn-logout {
    background: var(--danger-color);
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-logout:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.card h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.75rem;
}

.card h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* Formulaire */
.form-section {
    background: var(--gradient-primary);
    color: white;
    position: relative;
    overflow: hidden;
}

.form-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 0;
}

.form-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    z-index: 0;
}

.form-section h2 {
    color: white;
    position: relative;
    z-index: 1;
}

.form-section h2::after {
    background: rgba(255, 255, 255, 0.4);
}

.form-section form {
    position: relative;
    z-index: 1;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
    font-weight: 500;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: white;
    background: white;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Boutons */
.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
    width: 100%;
    font-weight: 600;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 137, 208, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 137, 208, 0.3);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Statistiques */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

/* Filtres */
.filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.filters input,
.filters select {
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 137, 208, 0.1);
    transform: translateY(-2px);
}

/* Liste des dépenses */
.expenses-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem;
    font-style: italic;
}

.expense-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    transition: all 0.3s ease;
    background: white;
    position: relative;
}

.expense-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
    border-radius: 14px 0 0 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.expense-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateX(4px);
}

.expense-item:hover::before {
    opacity: 1;
}

.expense-date {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 100px;
}

.expense-details {
    flex: 1;
}

.expense-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.category-transport { background: #dbeafe; color: #1e40af; }
.category-restauration { background: #fef3c7; color: #92400e; }
.category-hébergement { background: #fce7f3; color: #9f1239; }
.category-fournitures { background: #d1fae5; color: #065f46; }
.category-communication { background: #e0e7ff; color: #3730a3; }
.category-autre { background: #f3f4f6; color: #374151; }

.expense-description {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.expense-employee {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.expense-amount {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 120px;
    text-align: right;
}

/* Notifications */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: var(--success-color);
    color: white;
}

.notification.error {
    background: var(--danger-color);
    color: white;
}

/* Upload de fichier */
.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.file-upload-label:hover {
    background: white;
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.file-upload-icon {
    font-size: 1.5rem;
}

.file-upload-text {
    color: var(--primary-color);
}

.image-preview {
    margin-top: 1rem;
    display: none;
    position: relative;
}

.image-preview.active {
    display: block;
}

.image-preview img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.image-preview-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.image-preview-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Justificatif dans la liste */
.expense-receipt {
    margin-top: 0.5rem;
}

.receipt-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.receipt-thumbnail:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

.no-receipt {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Modale d'image */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 3rem;
    color: white;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
}

.modal-close:hover {
    color: var(--primary-light);
    transform: scale(1.1);
}

.modal-content {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 137, 208, 0.3);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-caption {
    color: white;
    padding: 1rem 2rem;
    text-align: center;
    font-size: 1.1rem;
    margin-top: 1rem;
    background: rgba(0, 137, 208, 0.8);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

/* Footer */
.footer {
    margin-top: 4rem;
    padding: 2rem 0;
    text-align: center;
    border-top: 2px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-brand {
    font-weight: 500;
}

.footer-brand strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-left h1 {
        font-size: 1.75rem;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .user-info {
        flex: 1;
        align-items: flex-start;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .expense-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .expense-amount {
        text-align: left;
    }

    .expense-date {
        min-width: auto;
    }

    .footer {
        margin-top: 3rem;
        padding: 1.5rem 0;
    }

    .footer-content p {
        font-size: 0.8rem;
    }
}

