/* Variables globales */
:root {
    --primary-gradient: linear-gradient(135deg, #5fbf9a 0%, #5aa5d8 100%);
    --page-gradient: linear-gradient(135deg, #f4faf7 0%, #edf6f7 52%, #f3f8fc 100%);
    --sidebar-bg: #275e63;
    --sidebar-width: 250px;
    --primary-color: #4f9eb2;
    --success-color: #22C55E;
    --danger-color: #EF4444;
    --card-bg: #FFFFFF;
    --text-dark: #1F2937;
    --text-light: #6B7280;
    --border-color: #E5E7EB;
}

/* Reset et body global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--page-gradient) !important;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
    isolation: isolate;
}

body::before,
body::after {
    content: "";
    position: fixed;
    width: 60vmax;
    height: 60vmax;
    border-radius: 42% 58% 55% 45% / 50% 40% 60% 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: -1;
    pointer-events: none;
    animation: page-background-rotate 48s linear infinite;
}

body::before {
    top: -28vmax;
    left: -24vmax;
    background: radial-gradient(circle at 30% 30%, #b8e8d0, #d4f1e4 60%, transparent 70%);
}

body::after {
    right: -24vmax;
    bottom: -28vmax;
    background: radial-gradient(circle at 60% 60%, #b9d9f5, #dcecfa 60%, transparent 70%);
    animation-direction: reverse;
    animation-duration: 58s;
}

@keyframes page-background-rotate {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after {
        animation: none;
    }
}

.btn-primary {
    --bs-btn-bg: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-hover-bg: #428a9d;
    --bs-btn-hover-border-color: #428a9d;
    --bs-btn-active-bg: #397b8d;
    --bs-btn-active-border-color: #397b8d;
}

.btn-outline-primary {
    --bs-btn-color: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-hover-bg: var(--primary-color);
    --bs-btn-hover-border-color: var(--primary-color);
    --bs-btn-active-bg: var(--primary-color);
    --bs-btn-active-border-color: var(--primary-color);
}

/* Sidebar personnalisée */
.sidebar {
    background-color: var(--sidebar-bg) !important;
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    border-radius: 8px;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    transform: translateX(5px);
}

/* Zone principale avec marge pour la sidebar */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Header utilisateur */
.user-header {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Cards avec effet glassmorphism */
.glass-card {
    background: rgba(255, 255, 255, 0.95) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 15px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden; /* Assure que les enfants respectent les coins arrondis */
}

/* Assure que les éléments des glass-card respectent les coins arrondis */
.glass-card .card-header {
    border-top-left-radius: 15px !important;
    border-top-right-radius: 15px !important;
    border-bottom: none !important;
}

.glass-card .card-body:last-child {
    border-bottom-left-radius: 15px !important;
    border-bottom-right-radius: 15px !important;
}

.glass-card .card-footer {
    border-bottom-left-radius: 15px !important;
    border-bottom-right-radius: 15px !important;
}

/* Progress bars personnalisées */
.progress-custom {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-custom .progress-bar {
    border-radius: 10px;
}

/* Badges des mois */
.month-badge {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: white;
}

.month-badge.completed {
    background-color: #22c55e !important;
}

.month-badge.total {
    background-color: #6b7280 !important;
}

/* Variations de compte et styles financiers */
.variation-positive {
    color: #22c55e !important;
    font-weight: 600;
}

.variation-negative {
    color: #ef4444 !important;
    font-weight: 600;
}

/* Progress bars améliorées */
.progress-custom {
    height: 20px !important;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-custom .progress-bar {
    height: 100% !important;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Correction spécifique pour les progress bars du dashboard */
.progress[style*="height: 20px"] {
    height: 20px !important;
    min-height: 20px !important;
}

.progress[style*="height: 20px"] .progress-bar {
    height: 20px !important;
    min-height: 20px !important;
    line-height: 20px !important;
}

.progress-bar span {
    line-height: 1;
    font-size: 0.7rem !important;
    font-weight: bold;
    color: white !important;
    display: inline-block;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Surcharge Bootstrap pour forcer la hauteur */
.card-body .progress {
    height: 20px !important;
}

.card-body .progress .progress-bar {
    height: 100% !important;
    min-height: 20px !important;
}

/* Style spécifique pour les progress bars du dashboard */
.dashboard-progress {
    height: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    background-color: #e9ecef !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

.dashboard-progress .progress-bar {
    height: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.dashboard-progress .progress-bar span {
    font-size: 0.7rem !important;
    font-weight: bold !important;
    color: white !important;
    line-height: 1 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ==============================================
   STYLES POUR LA PAGE PRÉVISIONS
   ============================================== */

/* Page container */
.previsions-page {
    padding: 24px;
    background: transparent; /* Utilise le gradient global */
    min-height: calc(100vh - 80px);
}

.previsions-page .container {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    background: transparent !important; /* Force transparent, pas de fond blanc */
    padding: 0; /* Supprime le padding Bootstrap par défaut */
}

/* Colonnes */
.left-col {
    flex: 2;
}

.right-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Panels avec glassmorphism - même style que dashboard */
.panel {
    background: rgba(255, 255, 255, 0.95) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
}

.main-panel {
    padding: 24px;
}

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

.panel-header h2, 
.panel-header h3 {
    margin: 0;
    color: var(--text-dark);
    font-weight: 600;
}

.panel-header h2 {
    font-size: 24px;
}

.panel-header h3 {
    font-size: 18px;
}

.btn-add {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-add:hover {
    background: #2563eb;
    transform: scale(1.1);
}

/* Category cards dans les glass-card */
.glass-card .category-card {
    background: rgba(238, 242, 251, 0.6);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: all 0.2s ease;
}

.glass-card .category-card:hover {
    background: rgba(238, 242, 251, 0.9);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.category-title strong {
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 600;
}

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

.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
}

.status-dot[data-color="yellow"] { background: #f59e0b; }
.status-dot[data-color="blue"] { background: #3b82f6; }
.status-dot[data-color="cyan"] { background: #06b6d4; }
.status-dot[data-color="teal"] { background: #14b8a6; }
.status-dot[data-color="green"] { background: #10b981; }
.status-dot[data-color="purple"] { background: #8b5cf6; }

.btn-mini, .btn-more {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-light);
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-mini:hover, .btn-more:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

/* Sub items */
.category-items {
    margin-top: 12px;
    padding-left: 8px;
}

.sub-item {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--text-dark);
    padding: 4px 0;
    font-size: 14px;
}

.connector {
    color: var(--text-light);
    font-family: monospace;
    transform: translateY(-1px);
}

.sub-label {
    color: var(--text-light);
}

/* Styles pour les éléments dans les glass-card */
.glass-card .bg-light {
    background-color: rgba(248, 249, 250, 0.6) !important;
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: all 0.2s ease;
}

.glass-card .bg-light:hover {
    background-color: rgba(248, 249, 250, 0.9) !important;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Boutons spécifiques prévisions */
.btn-mini, .btn-more, .btn-calendar {
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    transition: all 0.2s ease;
}

.btn-mini:hover, .btn-more:hover, .btn-calendar:hover {
    background-color: rgba(59, 130, 246, 0.1) !important;
    border-color: var(--primary-color) !important;
    transform: scale(1.1);
}

/* Sub items dans les catégories */
.category-items {
    margin-top: 8px;
}

.sub-item .connector {
    font-family: monospace;
    color: var(--text-light);
    font-size: 12px;
}

.sub-item .sub-label {
    color: var(--text-light);
    font-size: 13px;
}

/* Status dots - même style que dashboard */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot[data-color="yellow"] { background-color: #f59e0b; }
.status-dot[data-color="blue"] { background-color: #3b82f6; }
.status-dot[data-color="cyan"] { background-color: #06b6d4; }
.status-dot[data-color="teal"] { background-color: #14b8a6; }
.status-dot[data-color="green"] { background-color: #10b981; }
.status-dot[data-color="purple"] { background-color: #8b5cf6; }

.btn-calendar {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-calendar:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Responsive pour prévisions */
@media (max-width: 768px) {
    .previsions-page {
        padding: 16px;
    }
    
    .previsions-page .container {
        flex-direction: column;
        gap: 20px;
    }
    
    .left-col,
    .right-col {
        flex: none;
        width: 100%;
    }
    
    .main-panel {
        padding: 16px;
    }
    
    .panel {
        padding: 16px;
    }
}

/* Badges et indicateurs */
.badge {
    font-weight: 500;
    padding: 0.35em 0.75em;
}

/* Dashboard avec pourcentages définis */
.dashboard-container {
    height: calc(100vh - 160px);
    overflow: hidden;
    padding-bottom: 20px;
}

.dashboard-left-column,
.dashboard-right-column {
    height: 100%;
}

.dashboard-column-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1rem;
}

/* Colonne gauche - Répartition : 25% comptes / 75% dépenses */
.dashboard-accounts-card {
    height: 25%;
    min-height: 180px;
    display: flex;
    flex-direction: column;
}

.dashboard-expenses-card {
    height: 75%;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

/* Colonne droite - Répartition : 60% prévisions / 40% éphémères */
.dashboard-forecast-card {
    height: 60%;
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.dashboard-ephemeral-card {
    height: 40%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

/* Assure que les headers ne prennent pas trop de place */
.dashboard-accounts-card .card-header,
.dashboard-expenses-card .card-header,
.dashboard-forecast-card .card-header,
.dashboard-ephemeral-card .card-header {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
}

/* Assure que les body utilisent tout l'espace restant */
.dashboard-accounts-card .card-body,
.dashboard-expenses-card .card-body,
.dashboard-ephemeral-card .card-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.dashboard-forecast-card .card-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.dashboard-forecast-card .chart-container {
    flex: 1;
    min-height: 0;
    position: relative;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    /* Dashboard responsive - Adaptation pour mobile */
    .dashboard-container {
        height: auto !important;
        overflow: visible;
        padding-bottom: 20px;
    }
    
    .dashboard-left-column,
    .dashboard-right-column {
        height: auto !important;
        margin-bottom: 1rem;
    }
    
    .dashboard-column-content {
        height: auto !important;
        gap: 1rem;
    }
    
    /* Redéfinition des hauteurs pour mobile */
    .dashboard-accounts-card {
        height: auto !important;
        min-height: 200px !important;
    }
    
    .dashboard-expenses-card {
        height: auto !important;
        min-height: 250px !important;
    }
    
    .dashboard-forecast-card {
        height: auto !important;
        min-height: 300px !important;
    }
    
    .dashboard-ephemeral-card {
        height: auto !important;
        min-height: 180px !important;
    }
    
    /* Ajustement du graphique sur mobile */
    .dashboard-forecast-card .chart-container {
        height: 250px;
        min-height: 250px;
    }
}

/* Responsive pour très petits écrans */
@media (max-width: 576px) {
    .dashboard-forecast-card {
        min-height: 280px !important;
    }
    
    .dashboard-forecast-card .chart-container {
        height: 220px;
        min-height: 220px;
    }
    
    .dashboard-accounts-card {
        min-height: 180px !important;
    }
    
    .dashboard-expenses-card {
        min-height: 220px !important;
    }
    
    .dashboard-ephemeral-card {
        min-height: 160px !important;
    }
    
    /* Texte plus petit sur très petits écrans */
    .small {
        font-size: 0.8rem !important;
    }
    
    .fw-semibold.small {
        font-size: 0.75rem !important;
    }
}

/* ====== STYLES POUR L'ÉCRAN PRÉVISIONS ====== */

/* Prévisions avec pourcentages définis - même logique que dashboard */
.previsions-container {
    height: calc(100vh - 160px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px;
    /* Masquer la scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.previsions-container::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none; /* Chrome, Safari, Edge */
}

.previsions-left-column,
.previsions-right-column {
    height: 100%;
}

.previsions-column-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1rem;
}

/* Colonne gauche - Prévisions principales (utilise tout l'espace disponible) */
.previsions-main-card {
    min-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

/* Colonne droite - Répartition 50/50 */
.previsions-ephemeral-card {
    min-height: calc((100vh - 220px) / 2);
    display: flex;
    flex-direction: column;
}

.previsions-annual-card {
    min-height: calc((100vh - 220px) / 2);
    display: flex;
    flex-direction: column;
}

/* Assure que les headers ne prennent pas trop de place */
.previsions-main-card .card-header,
.previsions-ephemeral-card .card-header,
.previsions-annual-card .card-header {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
}

/* Assure que les body utilisent tout l'espace restant */
.previsions-main-card .card-body,
.previsions-ephemeral-card .card-body,
.previsions-annual-card .card-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Responsive pour écran prévisions */
@media (max-width: 768px) {
    /* Prévisions responsive - Adaptation pour mobile */
    .previsions-container {
        height: auto !important;
        overflow: visible;
        padding-bottom: 20px;
    }
    
    .previsions-left-column,
    .previsions-right-column {
        height: auto !important;
        margin-bottom: 1rem;
    }
    
    .previsions-column-content {
        height: auto !important;
        gap: 1rem;
    }
    
    /* Redéfinition des hauteurs pour mobile */
    .previsions-main-card {
        height: auto !important;
        min-height: 350px !important;
    }
    
    .previsions-ephemeral-card {
        height: auto !important;
        min-height: 200px !important;
    }
    
    .previsions-annual-card {
        height: auto !important;
        min-height: 200px !important;
    }
}

/* Responsive pour très petits écrans - Prévisions */
@media (max-width: 576px) {
    .previsions-main-card {
        min-height: 300px !important;
    }
    
    .previsions-ephemeral-card {
        min-height: 180px !important;
    }
    
    .previsions-annual-card {
        min-height: 180px !important;
    }
    
    /* Ajustement des éléments de catégorie sur mobile */
    .category-card {
        margin-bottom: 1rem !important;
    }
    
    .category-items {
        margin-left: 1rem !important;
    }
    
    /* Boutons plus petits sur mobile */
    .btn-mini, .btn-more, .btn-calendar {
        width: 20px !important;
        height: 20px !important;
        font-size: 10px !important;
    }
}

/* Scrollbars personnalisées */
.custom-scroll::-webkit-scrollbar {
    width: 4px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Graphique canvas */
.chart-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 200px;
}

.chart-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    pointer-events: none;
    z-index: 10;
} 

.account-header {
    transition: all 0.3s ease;
}

.account-header:hover {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

.collapse-toggle i {
    transition: transform 0.3s ease;
}

.collapse-toggle.collapsed i {
    transform: rotate(0deg);
}

.collapse-toggle:not(.collapsed) i {
    transform: rotate(180deg);
}

.transaction-date-header {
    padding-left: 1rem;
    border-left: 3px solid #3B82F6;
}

.transaction-item {
    border: 1px solid transparent;
    transition: all 0.2s ease;
    background-color: white;
}

.transaction-item:hover {
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.bg-danger-subtle {
    background-color: rgba(239, 68, 68, 0.1);
}

.bg-success-subtle {
    background-color: rgba(34, 197, 94, 0.1);
}

.variation-positive {
    color: #22C55E;
    font-weight: 600;
}

.variation-negative {
    color: #EF4444;
    font-weight: 600;
}

/* Badge personnalisé pour les catégories */
.badge {
    font-weight: 500;
    padding: 0.35em 0.75em;
}

/* Animation pour les dropdowns */
.dropdown-menu {
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style pour le modal */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .transaction-item {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .transaction-item .text-end {
        width: 100%;
        text-align: left !important;
        margin-top: 0.5rem;
    }
}

/* Ajustements pour optimiser l'espace */

.card-header h5.small,
.card-title.small {
    font-size: 0.95rem;
}

.month-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: white;
}

.month-badge.completed {
    background-color: #22C55E !important;
}

/* Améliorer le scroll personnalisé */
.overflow-auto::-webkit-scrollbar {
    width: 6px;
}

.overflow-auto::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.overflow-auto::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 10px;
}

.overflow-auto::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

/* Réduire les paddings des cards */
.glass-card .card-body.py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.glass-card .card-header.py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Styles de base pour la page prévisions */
.previsions-page {
    padding: 24px;
    background: #eef1fb;
    min-height: calc(100vh - 80px);
}

.container {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
}

/* Colonne gauche */
.left-col {
    flex: 2;
}

.right-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Panels */
.panel {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 0 rgba(0,0,0,0.03);
}

.main-panel {
    padding: 20px;
}

/* Header */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.panel-header h2, .panel-header h3 {
    margin: 0;
}

.btn-add {
    background: transparent;
    border: 0;
    font-size: 20px;
    cursor: pointer;
}

/* Category card */
.category-card {
    background: #eef2fb;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    display: block;
}

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

.category-title strong {
    font-size: 18px;
}

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

.status-dot {
    display:inline-block;
    width:12px;
    height:12px;
    border-radius:50%;
    background: #7cc3ff;
}

.status-dot[data-color="yellow"] { background:#f6d365; }
.status-dot[data-color="blue"] { background:#6ea8ff; }
.status-dot[data-color="cyan"] { background:#7dd3fc; }
.status-dot[data-color="teal"] { background:#66e0b8; }
.status-dot[data-color="green"] { background:#b4f0a1; }
.status-dot[data-color="purple"] { background:#caa6ff; }

.btn-mini, .btn-more {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
}

/* Sub items */
.category-items {
    margin-top: 8px;
    padding-left: 8px;
}

.sub-item {
    display:flex;
    gap:8px;
    align-items:center;
    color:#333;
    padding: 4px 0;
}

.connector {
    color:#111;
    opacity:0.7;
    transform: translateY(2px);
}

/* Right list */
.small-panel .list {
    margin-top: 10px;
}

.list-item {
    background:#f3f6ff;
    border-radius:8px;
    padding:10px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:8px;
}

.list-item .date { color:#333; font-size:14px; }
.btn-calendar { border:0; background:transparent; cursor:pointer; margin-left:6px; }



.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: white;
    padding: 20px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-header h1 {
    font-size: 20px;
    margin-bottom: 30px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item .icon {
    font-size: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
}

.top-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 8px 15px;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

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

.logout-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    margin-left: 10px;
}

/* Cards globales */
.card {
    background: var(--card-bg);
    border-radius: 15px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* Assure que les enfants respectent les coins arrondis */
}

/* Assure que tous les éléments de card respectent les coins arrondis */
.card .card-header:first-child {
    border-top-left-radius: 15px !important;
    border-top-right-radius: 15px !important;
}

.card .card-body:last-child,
.card .card-footer:last-child {
    border-bottom-left-radius: 15px !important;
    border-bottom-right-radius: 15px !important;
}

.card h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.card h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

/* Accounts Card */
.account-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.account-item:last-of-type {
    border-bottom: none;
}

.bank-icon {
    width: 40px;
    height: 40px;
}

.account-name {
    font-weight: 600;
    color: var(--text-dark);
}

.account-balance {
    font-size: 18px;
    font-weight: 700;
    color: var(--success-color);
    margin-left: auto;
}

.account-variation {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 5px;
}

.account-variation.positive {
    color: var(--success-color);
    background: rgba(34, 197, 94, 0.1);
}

.account-variation.negative {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.see-all-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Expenses Card */
.expense-item {
    margin-bottom: 20px;
}

.expense-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.expense-category {
    font-weight: 600;
    color: var(--text-dark);
}

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

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

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

.expense-percentage {
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
}

/* Forecast Card */
.card-header-with-edit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.edit-icon {
    font-size: 20px;
    text-decoration: none;
    cursor: pointer;
}

/* Styles pour les graphiques en anneau */
.donut-chart-container {
    position: relative;
    width: 100%;
    height: 220px;
    margin: 10px auto;
}

.chart-legend {
    margin-top: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

.legend-label {
    flex: 1;
    font-size: 14px;
    color: var(--text-dark);
}

.legend-percentage {
    font-weight: 600;
    color: var(--text-light);
}

/* Ephemeral Charges */
.ephemeral-item {
    margin-bottom: 20px;
}

.ephemeral-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.month-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.month-badge {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    background: var(--primary-color);
    color: white;
}

.month-badge.completed {
    background: var(--success-color);
}

.month-badge.total {
    background: var(--text-light);
}

.ephemeral-amount {
    display: block;
    font-size: 13px;
    color: var(--text-light);
}

/* Layout Dashboard - Cartes avec hauteur dynamique */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Dashboard Layout pour Twig */
.row.g-3 {
    margin: 0;
    height: calc(100vh - 160px); /* Laisse 20px en plus pour les coins du bas */
    padding-bottom: 20px; /* Espace pour voir les coins arrondis du bas */
}

.col-lg-6.h-100 {
    padding: 0 0.75rem;
    height: 100%;
}

.d-flex.flex-column.h-100.gap-3 {
    height: 100%;
    gap: 1rem !important;
}

/* Cards spécifiques du dashboard */
.card.glass-card {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    border-radius: 15px;
}

/* Hauteurs fixes pour les cards */
.card.glass-card[style*="height: 160px"] {
    min-height: 160px !important;
    max-height: 160px !important;
}

.card.glass-card[style*="height: 280px"] {
    min-height: 280px !important;
    max-height: 280px !important;
}

/* Card flex */
.card.glass-card[style*="flex: 1"] {
    flex: 1 !important;
    min-height: 0 !important;
}

/* Scrollbars invisibles */
.overflow-auto {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.overflow-auto::-webkit-scrollbar {
    display: none; /* WebKit (Chrome, Safari, Edge) */
}

/* Alternative pour garder une scrollbar très fine si nécessaire */
.overflow-auto.thin-scroll::-webkit-scrollbar {
    width: 2px;
    display: block;
}

.overflow-auto.thin-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.overflow-auto.thin-scroll::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 1px;
}

.overflow-auto.thin-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* ====== STYLES POUR LES FORMULAIRES ====== */

/* Messages d'erreur de formulaire */
.form-error-icon {
    color: var(--danger-color);
}

.form-error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Style pour les champs en erreur */
.form-control.is-invalid {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.25);
}

.form-control.is-invalid:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.25);
}

/* Amélioration des groupes d'input */
.input-group-text {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: var(--border-color);
    color: var(--primary-color);
}

.form-control:focus + .input-group-text,
.input-group > .form-control:focus ~ .input-group-text {
    border-color: var(--primary-color);
}