:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-color: #1e293b;
    --text-light: #64748b;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
}

.container {
    display: flex;
    min-height: 100vh;
    background-color: var(--background-color);
}

.flex-row {
    display: flex;
    flex-direction: row;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background-color: var(--card-background);
    padding: 20px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.05);
    border-radius: 24px;
    margin: 16px;
    height: calc(100vh - 32px);
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
}

.logo {
    margin-bottom: 40px;
    padding: 0 20px;
}

.logo img {
    width: 150px;
    height: auto;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 12px;
    transition: all 0.3s;
    font-size: 17px;
    position: relative;
}

.nav-item svg {
    margin-right: 16px;
    stroke-width: 1.5;
}

.nav-item.active {
    background-color: #4D9364;
    color: white;
    font-weight: 500;
    box-shadow: 0px 4px 15px rgba(77, 147, 100, 0.25);
}

.nav-item.active i {
    color: white;
}

.badge {
    position: absolute;
    right: 20px;
    background-color: #E9967A;
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 14px;
    box-shadow: 0px 2px 8px rgba(233, 150, 122, 0.3);
}

/* Main Content Styles */
.main-content {
    flex: 1;
    padding: 24px;
    margin-left: 312px;
    /* 280px (sidebar width) + 32px (margins) */
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--card-background);
    padding: 24px;
    border-radius: 24px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0px 8px 30px rgba(0, 0, 0, 0.08);
}

.stat-card .icon-wrapper {
    width: 48px;
    height: 48px;
    background-color: #4D9364;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0px 4px 15px rgba(77, 147, 100, 0.25);
}

.stat-card .icon-wrapper i {
    color: white;
    font-size: 20px;
}

.stat-card h3 {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.5px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.chart-card {
    background-color: var(--card-background);
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.05);
}

.chart-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    margin-bottom: 8px;
}

.chart-subtitle {
    font-size: 14px;
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    margin-bottom: 24px;
}

.chart-container {
    height: 300px;
    margin-top: 20px;
    font-family: 'Inter', sans-serif;
    position: relative;
}

.dashboard-header {
    margin-bottom: 24px;
}

.welcome-message {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.date-info {
    color: var(--text-light);
    font-size: 16px;
}

.alerts-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    z-index: 1000;
}

.alerts-section {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-card {
    background: #FEF3C7;
    border-left: 4px solid #F59E0B;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-card .alert-message {
    font-size: 14px;
}

.alert-card .alert-action {
    font-size: 13px;
    white-space: nowrap;
    margin-left: 12px;
}

.alert-card.warning {
    background: #FEE2E2;
    border-left-color: #EF4444;
}

.alert-card.success {
    background: #DCFCE7;
    border-left-color: #4D9364;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.alert-card.warning .alert-icon {
    background: #FEE2E2;
    color: #EF4444;
}

.alert-card .alert-icon {
    background: #FEF3C7;
    color: #F59E0B;
}

.alert-card.success .alert-icon {
    background: #DCFCE7;
    color: #4D9364;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.05);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.stat-title {
    color: var(--text-light);
    font-size: 16px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.stat-change {
    font-size: 14px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    color: #4D9364;
}

.stat-change.negative {
    color: #EF4444;
}

.logo-text {
    font-size: 22px;
    font-weight: 600;
    color: black;
    margin-left: 15px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.05);
    height: 400px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.chart-period {
    display: flex;
    gap: 8px;
}

.period-button {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.period-button.active {
    background: #4D9364;
    color: white;
}

.upcoming-payments {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.05);
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.payment-item:last-child {
    border-bottom: none;
}

.payment-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.payment-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.payment-details h4 {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 4px;
}

.payment-date {
    font-size: 14px;
    color: var(--text-light);
}

.payment-amount {
    font-weight: 600;
    color: var(--text-color);
}

.chart-container {
    position: relative;
    height: 300px;
    margin-top: 20px;
}

.budget-overview {
    background: white;
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.05);
}

.budget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.budget-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
}

.budget-total {
    font-size: 20px;
    color: #4D9364;
    font-weight: 600;
}

.budget-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.budget-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.05);
}

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: white;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
}

.category-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.budget-progress {
    margin: 15px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.good {
    background: #4D9364;
}

.progress-fill.warning {
    background: #F59E0B;
}

.progress-fill.danger {
    background: #EF4444;
}

.budget-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-light);
}

.remaining {
    font-weight: 600;
}

.remaining.positive {
    color: #4D9364;
}

.remaining.negative {
    color: #EF4444;
}

.budget-chart {
    background: white;
    border-radius: 24px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.05);
    height: 400px;
}

.chart-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 20px;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.credit-card {
    height: 250px;
    border-radius: 20px;
    padding: 25px;
    color: white;
    position: relative;
    margin: 20px 0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    margin-right: 20px;
}

.chip {
    width: 50px;
    height: 40px;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    border-radius: 8px;
    margin-bottom: 30px;
}

.card-number {
    font-size: 24px;
    letter-spacing: 2px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.card-details {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.card-holder {
    text-transform: uppercase;
}

.transactions-table {
    background: white;
    border-radius: 24px;
    padding: 24px;
    margin-top: 30px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.05);
}

.transactions-table h2 {
    color: var(--text-color);
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    color: var(--text-light);
    font-weight: 500;
}

.amount {
    font-weight: 600;
}

.amount.positive {
    color: #4D9364;
}

.amount.negative {
    color: #E9967A;
}

.transaction-date {
    color: var(--text-light);
    font-size: 14px;
}


.credit-card {
    margin-bottom: 20px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    position: relative;
    background-color: var(--card-background);
    margin: 5% auto;
    width: 90%;
    max-width: 500px;
    border-radius: 24px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text-color);
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 24px;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
}

input:focus {
    outline: none;
    border-color: #4D9364;
    box-shadow: 0 0 0 3px rgba(77, 147, 100, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #4D9364;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #3d7550;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background-color: #f3f4f6;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Styles pour le conteneur des cartes */
.credit-cards-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    flex-wrap: wrap;
}

.credit-card {
    width: 400px;
    height: 250px;
    border-radius: 20px;
    padding: 25px;
    color: white;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.add-budget {
    height: 250px;
    /* Même hauteur que les cartes de crédit */
    background: rgba(77, 147, 100, 0.1);
    border: 2px dashed #4D9364;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 20px;
}

.add-budget:hover {
    background: rgba(77, 147, 100, 0.2);
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.add-transaction {
    background: #4D9364;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-transaction:hover {
    background: #3d7550;
}

.filters {
    display: flex;
    gap: 16px;
    align-items: center;
}

.filter-select {
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: white;
    color: var(--text-color);
}

.search-input {
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: white;
    width: 200px;
}

.transactions-container {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.05);
}

.transaction-list {
    width: 100%;
    border-collapse: collapse;
}

.transaction-list th {
    text-align: left;
    padding: 16px;
    color: var(--text-light);
    font-weight: 500;
    border-bottom: 1px solid #e5e7eb;
}

.transaction-list td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

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

.transaction-date {
    color: var(--text-light);
    font-size: 14px;
}

.transaction-category {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.amount {
    font-weight: 600;
}

.amount.income {
    color: #4D9364;
}

.amount.expense {
    color: #EF4444;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

.status-badge.completed {
    background: rgba(77, 147, 100, 0.1);
    color: #4D9364;
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.transaction-actions {
    display: flex;
    gap: 8px;
    color: var(--text-light);
}

.transaction-actions i {
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.transaction-actions i:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.page-info {
    color: var(--text-light);
    font-size: 14px;
}

.page-controls {
    display: flex;
    gap: 8px;
}

.page-button {
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-button:hover {
    background: #f8fafc;
}

.page-button.active {
    background: #4D9364;
    color: white;
    border-color: #4D9364;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 10px 0;
}

.icon-option {
    position: relative;
    text-align: center;
}

.icon-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
    margin: 0;
}

.icon-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 0;
}

.icon-option label i {
    font-size: 1.5rem;
    color: #666;
}

.icon-option input[type="radio"]:checked+label {
    border-color: #4D9364;
    background-color: #e8f5e9;
}

.icon-option input[type="radio"]:checked+label i {
    color: #4D9364;
}

.icon-option:hover label {
    border-color: #4D9364;
    background-color: #f5f5f5;
}

.period-selector {
    background: white;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.period-tabs {
    display: flex;
    gap: 12px;
}

.period-tab {
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-light);
}

.period-tab.active {
    background: #4D9364;
    color: white;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-selector select {
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: white;
    color: var(--text-color);
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.05);
}

.stat-title {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

.stat-change.positive {
    color: #4D9364;
}

.stat-change.negative {
    color: #EF4444;
}

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.05);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.chart-container {
    height: 300px;
    position: relative;
}

.category-breakdown {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0px 4px 25px rgba(0, 0, 0, 0.05);
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.category-item:last-child {
    border-bottom: none;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.category-details {
    flex: 1;
}

.category-name {
    font-weight: 500;
    color: var(--text-color);
}

.category-change {
    font-size: 14px;
    color: var(--text-light);
}

.category-amount {
    text-align: right;
}

.amount-value {
    font-weight: 600;
    color: var(--text-color);
}

.amount-percentage {
    font-size: 14px;
    color: var(--text-light);
}