/* ============================================================
   FIDURIAN - STYLES OPTIMISÉS
   Version optimisée avec réduction des redondances
   ============================================================ */

/* ============================================================
   IMPORTS & RESET
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600&family=Playfair+Display:ital,wght@0,300;0,400;0,500;1,300;1,400&family=JetBrains+Mono:wght@300;400;500&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================================
   VARIABLES CSS - THÈMES
   ============================================================ */
:root {
    --bg-primary: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    --bg-secondary: rgba(255, 255, 255, 0.7);
    --bg-card: rgba(255, 255, 255, 0.8);
	--bg-full: rgba(255, 255, 255);
    --bg-accent: rgba(255, 255, 255, 0.5);
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-accent: #888888;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.12);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --accent-color: #1a1a1a;
    --professional-color: #2563eb;
    --personal-color: #059669;
}

[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%, #0a0a0a 100%);
    --bg-secondary: rgba(255, 255, 255, 0.05);
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-full: #3D3B3B;
    --bg-accent: rgba(255, 255, 255, 0.03);
    --text-primary: #e8e8e8;
    --text-secondary: #9ca3af;
    --text-accent: #6b7280;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --accent-color: #ffffff;
    --professional-color: #3b82f6;
    --personal-color: #10b981;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ============================================================
   ANIMATIONS GLOBALES
   ============================================================ */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ============================================================
   INTRO OVERLAY
   ============================================================ */
.intro-overlay {
    position: fixed;
    inset: 0;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    animation: forceHide 0.5s ease 5s forwards;
}

.intro-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    animation: none;
}

@keyframes forceHide {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}

.intro-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 60px;
    position: relative;
}

.logo-frame {
    position: absolute;
    border: 2px solid #2d3748;
    opacity: 0;
    animation: frame-construct 0.6s ease forwards;
}

.logo-frame-1 { inset: 0; animation-delay: 0.3s; }
.logo-frame-2 { inset: 15px; animation-delay: 0.6s; }
.logo-frame-3 { inset: 30px; animation-delay: 0.9s; }

@keyframes frame-construct {
    from { opacity: 0; transform: scale(0.8) rotate(45deg); }
    to { opacity: 1; transform: scale(1) rotate(0deg); }
}

.construction-line {
    position: absolute;
    background: #2d3748;
    opacity: 0;
    animation: line-construct 0.4s ease forwards;
}

.line-h1, .line-h2 { left: 0; width: 100%; height: 1px; }
.line-h1 { top: 20px; animation-delay: 1.2s; }
.line-h2 { bottom: 20px; animation-delay: 1.4s; }

.line-v1, .line-v2 { top: 0; width: 1px; height: 100%; transform-origin: top; animation-name: line-construct-v; }
.line-v1 { left: 20px; animation-delay: 1.6s; }
.line-v2 { right: 20px; animation-delay: 1.8s; }

@keyframes line-construct {
    from { opacity: 0; transform: scaleX(0); }
    to { opacity: 1; transform: scaleX(1); }
}

@keyframes line-construct-v {
    from { opacity: 0; transform: scaleY(0); }
    to { opacity: 1; transform: scaleY(1); }
}

.intro-title, .intro-subtitle {
    opacity: 0;
    animation: text-appear 0.8s ease forwards;
}

.intro-title {
    font-size: 28px;
    font-weight: 100;
    letter-spacing: 8px;
    color: #2d3748;
    margin-bottom: 10px;
    animation-delay: 2s;
}

.intro-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 3px;
    color: #718096;
    animation-delay: 2.2s;
}

@keyframes text-appear {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   QUICK LOADER
   ============================================================ */
.quick-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.quick-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.quick-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100vw;
    padding: 0 20px;
    box-sizing: border-box;
    text-align: center;
}

.quick-loader-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

.quick-loader-text i {
    color: var(--professional-color);
}

.quick-loader-bar {
    width: 400px;
    max-width: 90%;
    height: 3px;
    background: var(--bg-accent);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 20px auto;
}

.quick-loader-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--professional-color), var(--personal-color), var(--professional-color));
    background-size: 200% 100%;
    border-radius: 10px;
    animation: quick-loader-progress 1.5s ease-in-out forwards, quick-loader-shimmer 1.5s ease-in-out infinite;
}

@keyframes quick-loader-progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

@keyframes quick-loader-shimmer {
    from { background-position: -200% 0; }
    to { background-position: 200% 0; }
}

/* ============================================================
   MAIN CONTENT & EFFETS DE FOND
   ============================================================ */
.main-content {
    opacity: 0;
    transition: opacity 0.8s ease;
    animation: forceVisible 0.5s ease 5s forwards;
}

.main-content.visible {
    opacity: 1;
    animation: none;
}

.page-title {
  margin-left: 10px; /* espace en dessous */
}

.page-subtitle {
  margin-left: 30px; /* espace en dessous */
  margin-top: 30px;   /* espace au-dessus */
  margin-bottom: 30px; /* espace en dessous */
}

@keyframes forceVisible {
    to { opacity: 1; }
}

.particles-canvas, .floating-shapes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

[data-theme="dark"] .particles-canvas { opacity: 1; }
[data-theme="light"] .floating-shapes { opacity: 1; }

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(0,0,0,0.02), rgba(0,0,0,0.01));
}

.shape-1 { width: 300px; height: 300px; top: 10%; right: 15%; animation: float-1 20s ease-in-out infinite; }
.shape-2 { width: 200px; height: 200px; bottom: 20%; left: 10%; animation: float-2 25s ease-in-out infinite; }
.shape-3 { width: 150px; height: 150px; top: 60%; right: 30%; animation: float-3 30s ease-in-out infinite; }

@keyframes float-1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

@keyframes float-2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-40px, -20px) rotate(180deg); }
}

@keyframes float-3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -40px) rotate(90deg); }
    75% { transform: translate(-30px, 10px) rotate(270deg); }
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.6s ease;
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-mark {
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    position: relative;
    animation: logo-breathe 4s ease-in-out infinite;
}

@keyframes logo-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.logo-mark::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 1px solid var(--text-accent);
    border-radius: 50%;
    animation: logo-ring 6s ease-in-out infinite;
}

@keyframes logo-ring {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.3; }
    50% { transform: scale(1.3) rotate(180deg); opacity: 0.1; }
}

.brand-text h1 {
    font-size: 24px;
    font-weight: 200;
    letter-spacing: 8px;
    color: var(--text-primary);
    text-transform: uppercase;
    transition: all 0.6s ease;
}

[data-theme="dark"] .brand-text h1 {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    letter-spacing: 3px;
    font-weight: 400;
}

.brand-text p {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle, .config-toggle {
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.theme-toggle {
    padding: 8px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    gap: 8px;
}

.config-toggle {
    padding: 12px;
    width: 45px;
    height: 45px;
    justify-content: center;
}

.theme-toggle:hover, .config-toggle:hover {
    border-color: var(--border-hover);
    background: var(--bg-card);
}

.config-toggle:hover {
    transform: rotate(45deg);
}

.config-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-full);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: 0 20px 60px var(--shadow-color);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.config-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.config-item {
    padding: 15px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.config-item:last-child {
    border-bottom: none;
}

.config-item:hover {
    background: var(--bg-accent);
    color: var(--text-primary);
}

/* ============================================================
   CONTAINER & GRID
   ============================================================ */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px;
    position: relative;
    z-index: 2;
}

.dashboard-grid, .dashboard-dynamic-grid, .builder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    grid-auto-rows: auto;
    grid-auto-flow: dense;
    align-items: start;
}

@media (min-width: 1024px) {
    .dashboard-grid, .dashboard-dynamic-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================
   MODULES - BASE
   ============================================================ */
.module, .dashboard-bloc, .grid-item {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px var(--shadow-color);
    opacity: 0;
    transform: translateY(20px);
    min-height: 180px;
    height: auto;
    display: flex;
    flex-direction: column;
}

.module.loaded, .dashboard-bloc, .grid-item {
    opacity: 1;
    transform: translateY(0);
}

.module:hover, .dashboard-bloc:hover, .grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px var(--shadow-color);
    border-color: var(--border-hover);
}

.module-title, .bloc-title {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 30px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="light"] .module-title {
    font-size: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-card {
    text-align: center;
    padding: 35px 25px;
}

.kpi-icon, .availability-icon {
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    margin: 0 auto 20px;
    position: relative;
}

[data-theme="dark"] .kpi-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, var(--professional-color), #1d4ed8);
    clip-path: polygon(30% 0%, 70% 0%, 100% 50%, 70% 100%, 30% 100%, 0% 50%);
    animation: kpi-pulse 2s ease-in-out infinite;
}

[data-theme="dark"] .availability-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #10b981, #059669);
    clip-path: polygon(30% 0%, 70% 0%, 100% 50%, 70% 100%, 30% 100%, 0% 50%);
    animation: kpi-pulse 2s ease-in-out infinite;
}

@keyframes kpi-pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.5); opacity: 0.1; }
}

.kpi-icon::after, .availability-icon::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    animation: kpi-pulse 3s ease-in-out infinite;
}

[data-theme="dark"] .kpi-icon::after, [data-theme="dark"] .availability-icon::after {
    display: none;
}

.kpi-title, .availability-title {
    font-size: 11px;
    font-weight: 400;
    color: var(--professional-color);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.availability-title {
    color: #10b981;
}

.kpi-value, .availability-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 8px;
}

[data-theme="dark"] .kpi-value, [data-theme="dark"] .availability-value {
    font-size: 32px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.kpi-change, .availability-change {
    font-size: 12px;
    font-weight: 300;
    color: var(--text-accent);
}

/* ============================================================
   CHARTS
   ============================================================ */
.chart-module {
    padding: 35px 30px;
}

.chart-header {
    margin-bottom: 30px;
    text-align: center;
}

.chart-title {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.chart-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 400;
    color: var(--text-primary);
}

.chart-canvas {
    height: 180px;
    position: relative;
}

/* ============================================================
   ASSETS & STATS
   ============================================================ */
.assets-grid, .stats-grid, .indicators-grid {
    display: grid;
    gap: 20px;
}

.assets-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 25px;
}

.indicators-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.asset-item, .stat-item, .stat-card, .indicator-item {
    padding: 25px 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    background: var(--bg-accent);
    transition: all 0.4s ease;
}

.asset-item:hover, .stat-card:hover, .indicator-item:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    background: var(--bg-card);
}

.asset-name, .stat-label, .indicator-label {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.asset-value, .stat-percentage, .stat-value, .indicator-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.asset-value { font-size: 18px; }
.stat-percentage { font-size: 32px; font-weight: 300; line-height: 1; margin-bottom: 10px; }
.stat-value { font-size: 20px; font-weight: 600; }
.indicator-value { font-size: 18px; }

/* ============================================================
   PORTFOLIO OVERVIEW
   ============================================================ */
.portfolio-overview {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.3);
}

.portfolio-overview .module-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.overview-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 25px;
}

.overview-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.overview-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.overview-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.overview-card:hover::before {
    opacity: 1;
}

.main-card {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.main-card .card-icon {
    background: rgba(255, 255, 255, 0.3);
    width: 70px;
    height: 70px;
    font-size: 28px;
}

.card-content {
    flex: 1;
}

.card-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.main-card .card-value {
    font-size: 32px;
}

.card-label {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 5px;
}

.card-change {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================================
   FINANCIAL ACCOUNTS
   ============================================================ */
.financial-accounts-grid, .comptes-list-full {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.financial-account-card, .financial-account-card-full {
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.financial-account-card::before, .financial-account-card-full::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #8b5cf6, #7c3aed);
    transition: width 0.3s ease;
}

.financial-account-card:hover, .financial-account-card-full:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px var(--shadow-color);
    border-color: var(--border-hover);
}

.financial-account-card:hover::before, .financial-account-card-full:hover::before {
    width: 8px;
}

.type-cto::before { background: linear-gradient(180deg, #8b5cf6, #7c3aed); }
.type-pea::before { background: linear-gradient(180deg, #10b981, #059669); }
.type-assurance_vie::before { background: linear-gradient(180deg, #f59e0b, #d97706); }
.type-livret::before { background: linear-gradient(180deg, #3b82f6, #2563eb); }

.financial-account-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.financial-account-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.financial-account-type {
    display: inline-block;
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 8px;
}

.type-cto .financial-account-type {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.type-pea .financial-account-type {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.type-assurance_vie .financial-account-type {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.type-livret .financial-account-type {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.financial-account-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.financial-account-card:hover .financial-account-actions {
    opacity: 1;
}

.financial-account-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.financial-metric {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.financial-metric-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.financial-metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.financial-metric-value.highlight {
    color: #8b5cf6;
    font-size: 18px;
}

/* ============================================================
   INVESTISSEMENTS
   ============================================================ */
.investissements-liste {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.investissements-header {
    font-weight: 600;
    margin-bottom: 15px;
    color: #667eea;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.investissement-item, .investissement-item-grouped {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.investissement-item:hover, .investissement-item-grouped:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.investissement-item-grouped.expanded {
    border-left: 3px solid #667eea;
}

.toggle-sublots {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px 8px;
    margin-right: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.toggle-sublots:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.inv-lots-count {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.inv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.inv-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.inv-name strong {
    color: var(--text-primary);
    font-size: 15px;
}

.inv-symbole {
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.inv-details, .sublot-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.inv-detail, .sublot-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 8px 10px;
    background: var(--bg-accent);
    border-radius: 6px;
}

.inv-detail .label, .sublot-detail .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.inv-detail .value, .sublot-detail .value {
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.inv-detail .value.highlight, .sublot-detail .value.highlight { color: #667eea; }
.inv-detail .value.text-success, .sublot-detail .value.text-success { color: #10b981; }
.inv-detail .value.text-danger, .sublot-detail .value.text-danger { color: #ef4444; }

/* ============================================================
   SUBLOTS
   ============================================================ */
.sublots-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    animation: slideDown 0.3s ease-out;
}

.sublots-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.sublot-item {
    background: rgba(102, 126, 234, 0.02);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease-out;
}

.sublot-item:hover {
    background: rgba(102, 126, 234, 0.05);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateX(3px);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-section {
    margin-bottom: 45px;
}

.section-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
}

.section-icon {
    width: 45px;
    height: 45px;
    background: var(--bg-accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--professional-color);
    flex-shrink: 0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.form-group input, .form-group select, .form-group textarea {
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    background: var(--bg-accent);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--personal-color);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
}

.form-hint, .form-help {
    font-size: 12px;
    color: var(--text-accent);
    margin-top: 8px;
    font-style: italic;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary, .btn-secondary, .btn-cancel, .btn-icon, .btn-connector {
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--professional-color);
    color: white;
    padding: 15px 30px;
    font-size: 16px;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    padding: 14px 28px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: var(--personal-color);
    border-color: var(--personal-color);
    color: white;
    transform: translateY(-2px);
}

.btn-icon {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    color: #667eea;
    transform: scale(1.1);
}

.btn-icon.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.btn-edit, .btn-delete {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.btn-edit:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--personal-color);
    color: var(--personal-color);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.btn-edit-small, .btn-delete-small, .btn-edit-mini, .btn-delete-mini {
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    font-size: 12px;
}

.btn-edit-small:hover, .btn-edit-mini:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

.btn-delete-small:hover, .btn-delete-mini:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--personal-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background: var(--bg-accent);
    border-bottom: 1px solid var(--border-color);
    padding: 10px;
    gap: 10px;
}

.tab-btn {
    flex: 1;
    padding: 16px 24px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tab-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.tab-content {
    display: none;
    padding: 30px;
    animation: slideDown 0.4s ease;
}

.tab-content.active {
    display: block;
}

/* ============================================================
   BADGES
   ============================================================ */
.frequency-badge, .status-badge, .notification-badge {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.frequency-mensuel, .status-connected {
    background: rgba(16, 185, 129, 0.2);
    color: var(--personal-color);
}

.frequency-trimestriel {
    background: rgba(59, 130, 246, 0.2);
    color: var(--professional-color);
}

.frequency-semestriel {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.frequency-annuel {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.frequency-ponctuel, .status-disconnected {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-accent);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .dashboard-grid, .overview-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .header-content {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .brand-text h1 {
        font-size: 18px;
        letter-spacing: 4px;
    }

    .form-row, .financial-account-metrics, .inv-details, .sublot-details {
        grid-template-columns: 1fr;
    }

    .module-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .tabs-header {
        flex-direction: column;
    }

    .financial-account-header, .epargne-header {
        flex-direction: column;
        gap: 15px;
    }

    .financial-account-actions, .epargne-actions {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .portfolio-overview .overview-card {
        flex-direction: column;
        text-align: center;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.grid-full {
    grid-column: 1 / -1;
}

.text-success { color: #10b981 !important; }
.text-danger { color: #ef4444 !important; }
.text-muted { color: var(--text-accent); }

.positive { color: var(--personal-color); }
.negative { color: #ef4444; }

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .header, .config-menu, .btn-primary, .btn-secondary {
        display: none;
    }
    
    .module, .dashboard-bloc {
        break-inside: avoid;
        box-shadow: none;
    }
}

/* ============================================================
   STYLES ADDITIONNELS POUR LA PAGE REVENUS
   À ajouter à la fin de votre fichier style.css
   ============================================================ */

/* Page Header - Ajustements */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 32px;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: 2px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.page-title i {
    color: var(--professional-color);
}

.page-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Form Actions - Amélioration */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: flex-start;
    align-items: center;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    margin: 0;
}

/* Stats Grid - Ajustement pour 3 colonnes */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Stat Card - Centrage et espacement */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--shadow-color);
    border-color: var(--border-hover);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--professional-color), var(--personal-color));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 12px;
    color: var(--text-accent);
    font-weight: 400;
}

/* Financial Account Card - Amélioration pour les listes */
.financial-account-card {
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.financial-account-card:hover {
    transform: translateX(5px);
    box-shadow: 0 10px 30px var(--shadow-color);
    border-color: var(--border-hover);
}

.financial-account-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.financial-account-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.financial-account-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.financial-account-card:hover .financial-account-actions {
    opacity: 1;
}

.financial-account-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.financial-metric {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.financial-metric-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.financial-metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.financial-metric-value.highlight {
    font-size: 20px;
    font-weight: 700;
}

/* Notification Badge - Pour les compteurs */
.notification-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
}

/* Module Title - Ajustement pour les badges */
.module-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .page-title {
        font-size: 24px;
        flex-direction: column;
        gap: 10px;
    }
    
    .page-subtitle {
        font-size: 13px;
    }
    
    .financial-account-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .financial-account-actions {
        opacity: 1;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
    }
}

/* Animation pour les onglets */
.tab-content {
    animation: fadeInTab 0.4s ease-out;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sublot-actions {
  text-align: right;
}

/* ============================================
   HEADER - BOUTON UPGRADE ET BADGES
   ============================================ */

/* Bouton Upgrade Premium */
.btn-header-upgrade {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    transition: all 0.3s ease;
}

.btn-header-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.btn-header-upgrade i {
    font-size: 16px;
    animation: gemPulse 2s ease-in-out infinite;
}

@keyframes gemPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.upgrade-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%) scale(0);
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Badge MAX */
.badge-max {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
    position: relative;
    overflow: hidden;
}

.badge-max::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.badge-max i {
    font-size: 16px;
    animation: crownFloat 3s ease-in-out infinite;
}

@keyframes crownFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

.badge-max span {
    position: relative;
    z-index: 1;
}

/* Badge Admin */
.badge-admin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.badge-admin::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shine 3s ease-in-out infinite;
}

.badge-admin i {
    font-size: 16px;
    animation: shieldPulse 2s ease-in-out infinite;
}

@keyframes shieldPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.badge-admin span {
    position: relative;
    z-index: 1;
}

/* Responsive pour les badges */
@media (max-width: 768px) {
    .btn-header-upgrade,
    .badge-max,
    .badge-admin {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .btn-header-upgrade i,
    .badge-max i,
    .badge-admin i {
        font-size: 14px;
    }
    
    .upgrade-text {
        display: none;
    }
    
    .btn-header-upgrade {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}

/* Ajustements pour le thème sombre */
[data-theme="dark"] .btn-header-upgrade {
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .btn-header-upgrade:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

[data-theme="dark"] .badge-max {
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

[data-theme="dark"] .badge-admin {
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* ============================================================
   FORMS - CORRECTION RESPONSIVE
   ============================================================ */

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* S'assurer que les labels avec icônes ne cassent pas */
.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Pour les checkbox avec labels longs */
.form-group label[for="assujetti_ifi"] {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.form-group label[for="assujetti_ifi"] input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.form-group label[for="assujetti_ifi"] span {
    flex: 1;
    word-break: break-word;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-group {
        width: 100%;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Évite le zoom automatique sur iOS */
        width: 100%;
    }
    
    /* S'assurer que les icônes dans les labels ne prennent pas trop de place */
    .form-group label i {
        flex-shrink: 0;
    }
}

/* ==============================================
   RESPONSIVE MOBILE - PAGE REVENUS
   À ajouter à la fin de style.css
   ============================================== */

/* Base - Force box-sizing */
*, .form-group input, .form-group select, .form-group textarea { box-sizing: border-box; }
.form-group input, .form-group select, .form-group textarea { width: 100%; max-width: 100%; }
body, .container, .tabs-container, .module { overflow-x: hidden; max-width: 100%; }

/* Tablette < 1024px */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* Mobile < 768px */
@media (max-width: 768px) {
    .container { padding: 15px; }
    .page-title { font-size: 22px; letter-spacing: 1px; flex-direction: column; gap: 10px; }
    .page-subtitle { font-size: 13px; margin: 15px 0 !important; text-align: center; }
    
    /* Tabs */
    .tabs-header { flex-direction: column; gap: 8px; padding: 8px; }
    .tab-btn { width: 100%; padding: 14px 16px; font-size: 14px; }
    .tab-content { padding: 20px 15px; }
    
    /* Stats */
    .stats-grid { grid-template-columns: 1fr; gap: 15px; }
    .stat-card { padding: 20px 15px; }
    .stat-icon { width: 40px; height: 40px; margin-bottom: 15px; }
    .stat-value { font-size: 24px; }
    .stat-label { font-size: 12px; }
    
    /* Dashboard */
    .dashboard-grid { grid-template-columns: 1fr; gap: 15px; }
    .module { padding: 20px 15px; min-height: auto; }
    .module-title { font-size: 14px; }
    
    /* Cards */
    .financial-account-card { padding: 15px; }
    .financial-account-header { flex-direction: column; gap: 12px; }
    .financial-account-actions { opacity: 1 !important; width: 100%; justify-content: flex-end; }
    .financial-account-metrics { grid-template-columns: 1fr 1fr; gap: 12px; }
    .financial-metric-label { font-size: 10px; }
    .financial-metric-value { font-size: 14px; }
    .financial-metric-value.highlight { font-size: 16px; }
    
    /* Forms */
    .form-row { grid-template-columns: 1fr; gap: 15px; }
    .form-group label { font-size: 13px; gap: 6px; }
    .form-group input, .form-group select, .form-group textarea { 
        padding: 14px 16px; 
        font-size: 16px !important; 
        border-radius: 12px; 
    }
    .form-hint, .form-help { font-size: 11px; }
    .form-actions { flex-direction: column; gap: 10px; }
    .form-actions .btn-primary, .form-actions .btn-secondary { 
        width: 100%; 
        padding: 14px 20px; 
        font-size: 15px; 
    }
    
    /* Badges */
    .frequency-badge, .notification-badge { font-size: 10px; padding: 3px 10px; }
    
    /* Blocs spéciaux */
    .module[style*="linear-gradient(135deg, #3b82f6"] { padding: 20px 15px !important; }
    .module[style*="linear-gradient(135deg, #3b82f6"] [style*="font-size: 48px"] { font-size: 36px !important; }
    .module[style*="linear-gradient(135deg, #8b5cf6"] { padding: 20px 15px !important; }
    .module[style*="linear-gradient(135deg, #8b5cf6"] > div { flex-direction: column; text-align: center; gap: 15px; }
    
    /* Alertes */
    .alert { padding: 12px 15px; font-size: 14px; }
    .empty-state { padding: 40px 15px; }
    
    /* UX Mobile */
    .btn-icon, .btn-edit, .btn-delete { min-width: 40px; min-height: 40px; }
}

/* Petit mobile < 480px */
@media (max-width: 480px) {
    .container { padding: 10px; }
    .page-title { font-size: 20px; }
    .stat-value { font-size: 22px; }
    .module { padding: 15px 10px; }
    .financial-account-metrics { grid-template-columns: 1fr; }
    .form-group input, .form-group select, .form-group textarea { padding: 12px 14px; }
    .btn-primary, .btn-secondary { padding: 12px 16px; font-size: 14px; }
}

/* ==============================================
   RESPONSIVE MOBILE - DASHBOARD
   À ajouter à la fin de style.css
   ============================================== */

/* Base */
.dashboard-container,.dashboard-header,.dashboard-grid,.grid-item,.bloc-content{max-width:100%;overflow-x:hidden;box-sizing:border-box}

/* Tablette < 1024px */
@media (max-width:1024px){
    .dashboard-container{padding:15px}
    .dashboard-header{padding:18px}
    .dashboard-title h1{font-size:24px}
    .dashboard-grid{gap:18px}
    .size-small,.size-medium{grid-column:span 6}
    .size-large,.size-xlarge{grid-column:span 12}
}

/* Mobile < 768px */
@media (max-width:768px){
    body{overflow-x:hidden}
    .dashboard-container{padding:15px;width:100%}
    
    /* Header */
    .dashboard-header{flex-direction:column;gap:20px;padding:20px 15px;border-radius:12px;margin-bottom:15px}
    .dashboard-title{width:100%;gap:12px}
    .dashboard-title i{font-size:28px}
    .dashboard-title h1{font-size:22px;line-height:1.2}
    .dashboard-title p{font-size:13px!important}
    
    /* Actions */
    .dashboard-actions{width:100%;flex-direction:column;gap:10px}
    .btn-dashboard{width:100%;padding:14px 20px;font-size:15px;justify-content:center;border-radius:10px}
    
    /* Grille */
    .dashboard-grid{grid-template-columns:1fr!important;gap:15px}
    .grid-item{grid-column:1/-1!important;padding:15px;border-radius:12px}
    
    /* Blocs */
    .bloc-header{flex-direction:row;justify-content:space-between;margin-bottom:15px;padding-bottom:12px;gap:10px}
    .bloc-title{flex:1;gap:10px;font-size:15px}
    .bloc-title span{font-size:14px;font-weight:600}
    .bloc-icon{width:36px;height:36px;font-size:16px;flex-shrink:0}
    .bloc-actions{gap:8px;flex-shrink:0}
    .bloc-action-btn{min-width:36px;min-height:36px;padding:8px;font-size:14px}
    .bloc-content{padding:0;min-height:150px}
    
    /* States */
    .bloc-loading,.bloc-error{padding:30px 15px;gap:8px;font-size:14px}
    .bloc-loading i,.bloc-error i{font-size:28px}
    .dashboard-empty{padding:50px 20px;border-radius:12px}
    .dashboard-empty i{font-size:52px;margin-bottom:15px}
    .dashboard-empty p{font-size:15px;margin:8px 0}
    
    /* Contenu blocs */
    .grid-item .kpi-card,.grid-item .stat-card{padding:18px 15px;min-height:120px}
    .grid-item .kpi-icon,.grid-item .stat-icon{width:36px;height:36px;margin-bottom:12px}
    .grid-item .kpi-value,.grid-item .stat-value{font-size:22px;margin-bottom:6px}
    .grid-item .kpi-title,.grid-item .stat-label{font-size:11px;margin-bottom:10px}
    .grid-item .chart-canvas{height:200px;margin-top:10px}
    .grid-item .assets-grid,.grid-item .stats-grid{grid-template-columns:1fr 1fr;gap:12px}
    .grid-item .asset-item,.grid-item .stat-item{padding:15px 12px}
    .grid-item .asset-name{font-size:11px}
    .grid-item .asset-value{font-size:16px}
    
    /* Financial cards */
    .grid-item .financial-account-card{padding:12px;margin-bottom:12px}
    .grid-item .financial-account-header{flex-direction:column;gap:10px;align-items:flex-start}
    .grid-item .financial-account-name{font-size:14px}
    .grid-item .financial-account-metrics{grid-template-columns:1fr 1fr;gap:10px}
    .grid-item .financial-metric-label{font-size:10px}
    .grid-item .financial-metric-value{font-size:13px}
    
    /* Portfolio */
    .grid-item .portfolio-overview{padding:20px 15px}
    .grid-item .overview-grid{grid-template-columns:1fr;gap:12px}
    .grid-item .overview-card{padding:18px 15px;flex-direction:column;text-align:center;gap:12px}
    .grid-item .card-icon{width:50px;height:50px;font-size:22px}
    .grid-item .card-value{font-size:22px}
    
    /* Tables & Lists */
    .grid-item table{font-size:13px;min-width:300px}
    .grid-item th,.grid-item td{padding:10px 8px}
    .grid-item ul li{font-size:13px;padding:10px 12px;margin-bottom:8px}
    .grid-item img,.grid-item iframe{max-width:100%;height:auto}
    
    /* UX */
    .btn-dashboard:active,.bloc-action-btn:active{transform:scale(.95)}
    .btn-dashboard:focus,.bloc-action-btn:focus{outline:2px solid var(--professional-color);outline-offset:2px}
}

/* Petit mobile < 480px */
@media (max-width:480px){
    .dashboard-container{padding:10px}
    .dashboard-header{padding:15px 10px;gap:15px}
    .dashboard-title h1{font-size:20px}
    .dashboard-title p{font-size:12px!important}
    .dashboard-grid{gap:12px}
    .grid-item{padding:12px}
    .bloc-title{font-size:14px}
    .bloc-title span{font-size:13px}
    .bloc-icon{width:32px;height:32px;font-size:14px}
    .bloc-action-btn{min-width:32px;min-height:32px}
    .grid-item .kpi-value,.grid-item .stat-value{font-size:20px}
    .grid-item .chart-canvas{height:180px}
    .grid-item .assets-grid,.grid-item .stats-grid,.grid-item .financial-account-metrics{grid-template-columns:1fr}
    .btn-dashboard{padding:12px 18px;font-size:14px}
    .dashboard-empty{padding:40px 15px}
    .dashboard-empty i{font-size:48px}
}

/* Landscape */
@media (max-width:768px) and (orientation:landscape){
    .dashboard-header{flex-direction:row;align-items:center}
    .dashboard-actions{flex-direction:row;width:auto}
    .btn-dashboard{width:auto;padding:10px 16px;font-size:13px}
    .dashboard-grid{grid-template-columns:repeat(2,1fr)!important}
    .grid-item{grid-column:span 1!important}
    .grid-item.size-xlarge,.grid-item.force-full-width{grid-column:1/-1!important}
}

/* Print */
@media print{
    .dashboard-header,.dashboard-actions,.bloc-actions{display:none!important}
    .dashboard-grid{display:block}
    .grid-item{break-inside:avoid;page-break-inside:avoid;margin-bottom:20px}
}