/* style.css - Design moderne et professionnel */

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-bg: #1f2937;
    --light-bg: #f9fafb;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1f2937;
    line-height: 1.6;
}

/* Container principal */
.main-container {
    background: white;
    min-height: 100vh;
    margin: 0 auto;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
}

/* Header/Navigation */
.app-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-header .version {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 400;
}

/* Navigation tabs */
.nav-tabs {
    border: none;
    background: white;
    padding: 1rem 2rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 80px;
    z-index: 99;
}

.nav-tabs .nav-link {
    border: none;
    color: #6b7280;
    font-weight: 500;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: var(--transition);
    margin-right: 0.5rem;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    background: var(--light-bg);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: linear-gradient(to bottom, var(--light-bg), white);
    font-weight: 600;
    border-bottom: 3px solid var(--primary-color);
}

/* Month selector */
.month-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-radius: 1rem;
    margin: 2rem;
    box-shadow: var(--card-shadow);
}

.month-selector h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-bg);
    margin: 0;
}

.month-nav-btn {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.month-nav-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 0 2rem 2rem;
  }
  
  .stat-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid #e5e7eb;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.stat-card.income::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.stat-card.expense::before {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.stat-card.tva::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.stat-card.pending::before {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
  }
  
  .stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-color);
}

.stat-card .card-title {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.stat-card h3 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--dark-bg);
    margin: 0;
}

.stat-card .stat-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    opacity: 0.1;
}

/* Tables */
.data-table-container {
    padding: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-bg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table-wrapper {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.table {
    margin: 0;
    width: 100%;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.table thead th {
    padding: 1rem 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border: none;
}

.table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid #e5e7eb;
}

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

.table tbody tr:hover {
    background: #f9fafb;
    transform: scale(1.01);
}

.table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
}

.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: 0.375rem;
}

.btn-icon.edit:hover {
    background: #dbeafe;
    color: var(--info-color);
    transform: scale(1.2);
}

.btn-icon.delete:hover {
    background: #fee2e2;
    color: var(--danger-color);
    transform: scale(1.2);
}

/* Switch iOS style */
  .switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
  }
  
  .switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .slider-ios {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.4s;
    border-radius: 34px;
  }
  
  .slider-ios:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }
  
  input:checked + .slider-ios {
    background: linear-gradient(135deg, #10b981, #34d399);
  }
  
  input:focus + .slider-ios {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
  }
  
  input:checked + .slider-ios:before {
    transform: translateX(24px);
}

/* Floating buttons */
.floating-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1000;
}

.fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
}

.fab::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 70px;
    background: var(--dark-bg);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.fab:hover::before {
    opacity: 1;
}

.fab.primary {
    background: linear-gradient(135deg, var(--success-color), #34d399);
}

.fab.secondary {
    background: linear-gradient(135deg, var(--info-color), #60a5fa);
}

.fab:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--card-shadow-hover);
}

.fab:active {
    transform: scale(0.95);
}

/* Modal improvements */
.modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 1rem 1rem 0 0;
    padding: 1.5rem 2rem;
    border-bottom: none;
}

.modal-header .modal-title {
    font-weight: 700;
    font-size: 1.25rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem 2rem;
}

/* Forms */
.form-floating {
    margin-bottom: 1.5rem;
}

.form-floating > .form-control {
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem 0.75rem;
    transition: var(--transition);
}

.form-floating > .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-floating > label {
    padding: 1rem 0.75rem;
    color: #6b7280;
}

.form-check {
    padding-left: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

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

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #34d399);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #f87171);
}

/* Charts */
.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    margin: 1.5rem 2rem;
}

.chart-container h4 {
    font-weight: 700;
    color: var(--dark-bg);
    margin-bottom: 1.5rem;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
}

.toast {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

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

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.info {
    border-left: 4px solid var(--info-color);
}

/* Filters section */
.filters-section {
    background: white;
    padding: 1.5rem 2rem;
    margin: 1.5rem 2rem;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .month-selector {
        flex-direction: column;
        gap: 1rem;
    }
    
    .data-table-container {
        overflow-x: auto;
    }
    
    .floating-actions {
        bottom: 1rem;
        right: 1rem;
    }
    
    .fab {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}

/* Print styles */
@media print {
    .floating-actions,
    .fab,
    .month-nav-btn,
    .action-buttons {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .stat-card {
        break-inside: avoid;
    }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.empty-state svg {
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-bg);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 2rem;
  }
  