/* ============================================================
   IMMORIAN - STYLES FIDURIAN DESIGN SYSTEM
   Design identique a Fidurian : glassmorphisme, themes, particules
   ============================================================ */

/* ============================================================
   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;
}

/* ============================================================
   VARIABLES CSS - THEMES (identique Fidurian)
   ============================================================ */
:root {
    /* Fidurian theme variables */
    --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;

    /* Backward-compatible aliases for legacy inline styles */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: rgba(0, 0, 0, 0.08);
    --primary-400: #60a5fa;
    --primary-500: #2563eb;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-900: #1e3a5f;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: rgba(0, 0, 0, 0.08);
    --gray-300: rgba(0, 0, 0, 0.12);
    --gray-400: #888888;
    --gray-500: #888888;
    --gray-600: #666666;
    --gray-700: #444444;
    --gray-800: #1a1a1a;
    --gray-900: #1a1a1a;
    --success-50: rgba(16, 185, 129, 0.08);
    --success-100: rgba(16, 185, 129, 0.15);
    --success-200: rgba(16, 185, 129, 0.3);
    --success-500: #10b981;
    --success-600: #059669;
    --success-700: #047857;
    --success-800: #065f46;
    --danger-50: rgba(239, 68, 68, 0.08);
    --danger-100: rgba(239, 68, 68, 0.15);
    --danger-200: rgba(239, 68, 68, 0.3);
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --danger-700: #b91c1c;
    --danger-800: #991b1b;
    --warning-50: rgba(245, 158, 11, 0.08);
    --warning-100: rgba(245, 158, 11, 0.15);
    --warning-200: rgba(245, 158, 11, 0.3);
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --warning-700: #b45309;
    --warning-800: #92400e;
    --info-50: rgba(59, 130, 246, 0.08);
    --info-100: rgba(59, 130, 246, 0.15);
    --info-200: rgba(59, 130, 246, 0.3);
    --info-500: #3b82f6;
    --info-600: #2563eb;
    --info-700: #1d4ed8;
    --info-800: #1e40af;
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-10: 2.5rem;
    --spacing-12: 3rem;
    --spacing-16: 4rem;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    --radius-2xl: 25px;
    --radius-full: 9999px;
    --shadow-sm: 0 4px 20px var(--shadow-color);
    --shadow-md: 0 4px 20px var(--shadow-color);
    --shadow-lg: 0 10px 40px var(--shadow-color);
    --shadow-xl: 0 10px 40px var(--shadow-color);
    --transition-fast: 0.3s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[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;

    /* Dark mode backward-compatible aliases */
    --primary-50: rgba(59, 130, 246, 0.08);
    --primary-100: rgba(59, 130, 246, 0.12);
    --primary-200: rgba(255, 255, 255, 0.1);
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #3b82f6;
    --primary-700: #2563eb;
    --primary-900: #1e3a8a;
    --gray-50: rgba(255, 255, 255, 0.03);
    --gray-100: rgba(255, 255, 255, 0.05);
    --gray-200: rgba(255, 255, 255, 0.1);
    --gray-300: rgba(255, 255, 255, 0.15);
    --gray-400: #6b7280;
    --gray-500: #6b7280;
    --gray-600: #9ca3af;
    --gray-700: #d1d5db;
    --gray-800: #e8e8e8;
    --gray-900: #e8e8e8;
    --success-50: rgba(16, 185, 129, 0.1);
    --success-100: rgba(16, 185, 129, 0.15);
    --success-200: rgba(16, 185, 129, 0.3);
    --success-500: #10b981;
    --success-600: #10b981;
    --success-700: #10b981;
    --success-800: #34d399;
    --danger-50: rgba(239, 68, 68, 0.1);
    --danger-100: rgba(239, 68, 68, 0.15);
    --danger-200: rgba(239, 68, 68, 0.3);
    --danger-500: #ef4444;
    --danger-600: #ef4444;
    --danger-700: #f87171;
    --danger-800: #fca5a5;
    --warning-50: rgba(245, 158, 11, 0.1);
    --warning-100: rgba(245, 158, 11, 0.15);
    --warning-200: rgba(245, 158, 11, 0.3);
    --warning-500: #f59e0b;
    --warning-600: #f59e0b;
    --warning-700: #fbbf24;
    --warning-800: #fcd34d;
    --info-50: rgba(59, 130, 246, 0.1);
    --info-100: rgba(59, 130, 246, 0.15);
    --info-200: rgba(59, 130, 246, 0.3);
    --info-500: #3b82f6;
    --info-600: #3b82f6;
    --info-700: #60a5fa;
    --info-800: #93c5fd;
    --shadow-sm: 0 4px 20px var(--shadow-color);
    --shadow-md: 0 4px 20px var(--shadow-color);
    --shadow-lg: 0 10px 40px var(--shadow-color);
    --shadow-xl: 0 10px 40px var(--shadow-color);
}

/* ============================================================
   BASE
   ============================================================ */
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
}

/* ============================================================
   ANIMATIONS GLOBALES (identique Fidurian)
   ============================================================ */
@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 fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes logo-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes logo-ring {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.3; }
    50% { transform: scale(1.3) rotate(180deg); opacity: 0.1; }
}

@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); }
}

@keyframes slideInFromRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

.slide-in-right {
    animation: slideInRight 0.3s ease forwards;
}

/* ============================================================
   PARTICLES CANVAS & FLOATING SHAPES (identique Fidurian)
   ============================================================ */
.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; }

@media (max-width: 768px) {
    .shape-1, .shape-2, .shape-3 { display: none; }
    .btn-customize-dashboard { display: none !important; }
}

/* ============================================================
   HEADER / NAVBAR (style Fidurian)
   ============================================================ */
.navbar {
    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;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    gap: 15px;
}

.navbar-brand {
    flex-shrink: 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    text-decoration: none;
    cursor: pointer;
}

.logo-mark {
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    position: relative;
    animation: logo-breathe 4s ease-in-out infinite;
}

.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;
}

.brand-text h1 {
    font-size: 20px;
    font-weight: 200;
    letter-spacing: 6px;
    color: var(--text-primary);
    text-transform: uppercase;
    transition: all 0.6s ease;
    margin: 0;
}

[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;
}

/* Product Switcher */
.product-switcher {
    position: static;
}

.logo-section {
    position: relative;
}

.product-switcher-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    font-size: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.product-switcher-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.product-switcher-toggle.active {
    color: var(--text-primary);
}

.product-switcher-toggle.active i {
    transform: rotate(180deg);
}

.product-switcher-toggle i {
    transition: transform 0.2s;
}

.product-switcher-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 200;
    white-space: nowrap;
}

[data-theme="dark"] .product-switcher-dropdown {
    background: #1a1a2e;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.product-switcher-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.product-switcher-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.product-switcher-item:hover {
    background: var(--bg-secondary);
}

.product-switcher-item .brand-text h1 {
    font-size: 16px;
    letter-spacing: 4px;
}

.product-switcher-item .brand-text p {
    font-size: 10px;
    letter-spacing: 1.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-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;
    padding: 8px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    gap: 8px;
}

.theme-toggle:hover {
    border-color: var(--border-hover);
    background: var(--bg-card);
}

/* ============================================================
   USER MENU DROPDOWN
   ============================================================ */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 25px;
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: inherit;
}

.user-menu-toggle:hover {
    border-color: var(--border-hover);
    background: var(--bg-card);
}

.user-menu-toggle.active {
    border-color: var(--professional-color);
    background: var(--bg-card);
}

.user-menu-toggle .fa-user-circle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.user-menu-arrow {
    font-size: 0.65rem;
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.user-menu-toggle.active .user-menu-arrow {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-full, #fff);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 16px 48px var(--shadow-color);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s ease;
    z-index: 1002;
    overflow: hidden;
}

.user-menu-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    background: var(--bg-accent);
}

.user-menu-avatar {
    font-size: 1.8rem;
    color: var(--professional-color);
    line-height: 1;
}

.user-menu-fullname {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.user-menu-email {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.user-menu-item:hover {
    background: var(--bg-accent);
    color: var(--text-primary);
}

.user-menu-item.active {
    color: var(--professional-color);
    font-weight: 500;
}

.user-menu-item i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
}

.user-menu-item-logout {
    color: #ef4444;
}

.user-menu-item-logout:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

/* Config menu (hamburger icon) - hidden on desktop */
.config-menu {
    display: none;
    position: relative;
}

.config-toggle {
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 18px;
    padding: 0;
}

.config-toggle:hover {
    border-color: var(--border-hover);
    background: var(--bg-card);
    transform: rotate(45deg);
}

.config-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-full, #fff);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: 0 20px 60px var(--shadow-color);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    overflow: hidden;
}

.config-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.config-item {
    padding: 14px 18px;
    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);
}

.config-item.active {
    color: var(--professional-color);
    font-weight: 500;
    background: var(--bg-accent);
}

.config-item-logout {
    color: #ef4444;
}

.config-item-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Navigation links */
.nav-menu {
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
    flex: 1;
    justify-content: center;
    align-items: center;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 400;
    font-size: 12px;
    white-space: nowrap;
    position: relative;
    letter-spacing: 0.3px;
}

.nav-menu a:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-menu a.active {
    color: var(--professional-color);
    background: var(--bg-card);
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.nav-menu .logout-btn {
    color: #ef4444;
}

.nav-menu .logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.main-content {
    flex: 1;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px;
    position: relative;
    z-index: 2;
}

/* ============================================================
   HEADERS ET TITRES
   ============================================================ */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-transform: uppercase;
    margin: 0;
    transition: all 0.6s ease;
}

[data-theme="dark"] .page-title {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    letter-spacing: 2px;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 400;
    letter-spacing: 1px;
    transition: color 0.6s ease;
}

h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

.section-title {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: inline-block;
}

/* ============================================================
   BOUTONS (style Fidurian)
   ============================================================ */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 2px;
    background: var(--bg-card);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--shadow-color);
    border-color: var(--border-hover);
}

.btn:active {
    transform: translateY(0);
}

/* Disabled buttons */
.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled:hover,
.btn.disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: var(--professional-color);
    color: white;
    border-color: var(--professional-color);
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    padding: 14px 28px;
    font-size: 14px;
}

.btn-secondary:hover {
    background: var(--personal-color);
    border-color: var(--personal-color);
    color: white;
}

.btn-success {
    background: var(--personal-color);
    color: white;
    border-color: var(--personal-color);
}

.btn-success:hover {
    background: #047857;
    border-color: #047857;
    box-shadow: 0 10px 30px rgba(5, 150, 105, 0.3);
}

.btn-danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.3);
}

.btn-info {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.btn-info:hover {
    background: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

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

.btn-outline:hover {
    background: var(--bg-card);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-sm, .btn-small {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 10px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: 15px;
}

/* ============================================================
   CARTES & MODULES (glassmorphisme Fidurian)
   ============================================================ */
.card, .glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    color: var(--text-primary);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px var(--shadow-color);
}

.card:hover, .glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px var(--shadow-color);
    border-color: var(--border-hover);
}

.form-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 35px;
    color: var(--text-primary);
    margin-bottom: 24px;
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   GRILLES
   ============================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.biens-grid, .locataires-grid, .locations-grid, .credits-grid, .maintenances-grid, .assurances-grid, .factures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* ============================================================
   CARTES STATISTIQUES (style Fidurian KPI)
   ============================================================ */
.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    color: var(--text-primary);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--professional-color);
    border-radius: 0 0 3px 3px;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px var(--shadow-color);
    border-color: var(--border-hover);
}

.stat-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1;
}

[data-theme="dark"] .stat-number {
    font-size: 32px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.stat-label {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.stat-success::before { background: var(--personal-color); }
.stat-danger::before { background: #ef4444; }
.stat-warning::before { background: #f59e0b; }
.stat-info::before { background: var(--professional-color); }

/* ============================================================
   FORMULAIRES (style Fidurian)
   ============================================================ */
.form-section {
    margin-bottom: 45px;
    padding: 25px;
    background: var(--bg-accent);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

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

.form-grid, .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
    letter-spacing: 0.5px;
}

.required {
    color: #ef4444;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    background: var(--bg-accent);
    color: var(--text-primary);
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    appearance: none;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--personal-color);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
    transform: translateY(-2px);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-accent);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.help-text {
    font-size: 12px;
    color: var(--text-accent);
    margin-top: 6px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    flex-wrap: wrap;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* ============================================================
   ALERTES (style Fidurian)
   ============================================================ */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 400;
    font-size: 14px;
    border: 1px solid;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--personal-color);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #d97706;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--professional-color);
}

/* ============================================================
   CARTES SPECIALISEES (glassmorphisme Fidurian)
   ============================================================ */
.bien-card, .locataire-card, .location-card, .credit-card, .maintenance-card, .assurance-card, .facture-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    color: var(--text-primary);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 20px var(--shadow-color);
    overflow: hidden;
}

.bien-card:hover, .locataire-card:hover, .location-card:hover, .credit-card:hover, .maintenance-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px var(--shadow-color);
    border-color: var(--border-hover);
}

.bien-header, .locataire-header, .location-header, .credit-header, .maintenance-header, .assurance-header, .facture-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.bien-header h3, .locataire-header h3, .location-header h3, .credit-header h3, .maintenance-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 1px;
}

.bien-info, .locataire-info, .location-info, .credit-info, .maintenance-info, .assurance-info, .facture-info {
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.info-label {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 13px;
    min-width: 120px;
    letter-spacing: 0.5px;
}

.info-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    color: var(--text-primary);
    text-align: right;
    font-size: 14px;
}

.info-value a {
    color: var(--professional-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.info-value a:hover {
    color: #1d4ed8;
}

/* Actions des cartes */
.bien-actions, .locataire-actions, .location-actions, .credit-actions, .maintenance-actions, .assurance-actions, .facture-actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.bien-actions .btn,
.locataire-actions .btn,
.location-actions .btn,
.credit-actions .btn,
.maintenance-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 10px 8px;
    font-size: 12px;
}

.bien-actions form,
.locataire-actions form,
.location-actions form,
.credit-actions form,
.maintenance-actions form {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
}

.bien-actions form .btn,
.locataire-actions form .btn,
.location-actions form .btn,
.credit-actions form .btn,
.maintenance-actions form .btn {
    width: 100%;
}

/* ============================================================
   BADGES ET STATUTS
   ============================================================ */
.status-badge, .tva-badge, .echeance-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'JetBrains Mono', monospace;
}

.status-libre {
    background: rgba(16, 185, 129, 0.15);
    color: var(--personal-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-occupe {
    background: rgba(59, 130, 246, 0.15);
    color: var(--professional-color);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-travaux {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-actif {
    background: rgba(16, 185, 129, 0.15);
    color: var(--personal-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-inactif {
    background: var(--bg-accent);
    color: var(--text-accent);
    border: 1px solid var(--border-color);
}

.status-parti {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-planifiee {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-en_cours {
    background: rgba(59, 130, 246, 0.15);
    color: var(--professional-color);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-terminee {
    background: rgba(16, 185, 129, 0.15);
    color: var(--personal-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.tva-assujetti {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.tva-non-assujetti {
    background: var(--bg-accent);
    color: var(--text-accent);
    border: 1px solid var(--border-color);
}

/* ============================================================
   BADGES BIEN (type, location, credit)
   ============================================================ */
.bien-badges {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 16px;
}

.badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.badge-type {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-credit-active {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-credit-inactive {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.badge-type-locataire-particulier {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-type-locataire-entreprise {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-impaye {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-statut-location-active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-statut-location-terminee {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-statut-location-resiliee {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-statut-actif {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    margin-left: auto;
}

.badge-statut-inactif {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
    margin-left: auto;
}

.badge-statut-parti {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin-left: auto;
}

.badge-echeance-soon {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-assurance-type {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-facture-statut-brouillon {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.badge-facture-statut-envoyee {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-facture-statut-payee {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-facture-statut-impayee {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-facture-statut-annulee {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* TVA inline sous le loyer */
.tva-inline {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Badges statut maintenance */
.badge-statut-maintenance-planifiee {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.3);
    margin-left: auto;
}

.badge-statut-maintenance-en_cours {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
    margin-left: auto;
}

.badge-statut-maintenance-terminee {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    margin-left: auto;
}

.badge-statut-maintenance-annulee {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin-left: auto;
}

/* Badges statut charge/impôt */
.badge-statut-charge-a_payer {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
    margin-left: auto;
}

.badge-statut-charge-payee {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    margin-left: auto;
}

.badge-statut-charge-en_attente {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
    margin-left: auto;
}

.badge-statut-charge-contestee {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    margin-left: auto;
}

/* ============================================================
   TABS NAVIGATION
   ============================================================ */
.tabs-navigation {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.tab-link {
    flex: 1;
    text-align: center;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    background: none;
    font-size: 14px;
}

.tab-link:hover {
    background: var(--bg-accent);
    color: var(--text-primary);
}

.tab-link.active {
    background: var(--bg-card);
    color: var(--professional-color);
    border-bottom-color: var(--professional-color);
    font-weight: 600;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: block;
}

.modal-content {
    background: var(--bg-full);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-accent);
    color: var(--text-primary);
}

.modal-form {
    padding: 20px;
}

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

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

.modal-form .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.modal-form .required {
    color: #ef4444;
}

.modal-form .form-group input,
.modal-form .form-group select,
.modal-form .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-form .form-group input:focus,
.modal-form .form-group select:focus,
.modal-form .form-group textarea:focus {
    outline: none;
    border-color: var(--professional-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.modal-form .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ============================================================
   TABLEAUX (style Fidurian)
   ============================================================ */
.table-section {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px var(--shadow-color);
}

.table-responsive {
    overflow-x: auto;
    border-radius: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
}

th {
    background: var(--bg-accent);
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:hover {
    background: var(--bg-accent);
}

.actions-cell {
    min-width: 150px;
}

.action-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* ============================================================
   ACTIONS RAPIDES
   ============================================================ */
.quick-actions {
    margin-bottom: 30px;
}

.quick-actions h3 {
    margin-bottom: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.action-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px var(--shadow-color);
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px var(--shadow-color);
    border-color: var(--border-hover);
    color: var(--professional-color);
    text-decoration: none;
}

.action-icon {
    font-size: 36px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.action-title {
    font-weight: 400;
    font-size: 16px;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.action-card:hover .action-title {
    color: var(--professional-color);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 10px 0;
    text-align: center;
    color: var(--text-accent);
    font-size: 13px;
    margin-top: 60px;
    letter-spacing: 1px;
}

/* ============================================================
   SCROLL TO TOP
   ============================================================ */
.scroll-top {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 20px var(--shadow-color);
}

.scroll-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--shadow-color);
    border-color: var(--border-hover);
}

/* ============================================================
   ETATS SPECIAUX
   ============================================================ */
.credit-expired {
    border-left: 3px solid #ef4444;
    background: linear-gradient(to right, rgba(239, 68, 68, 0.05), transparent);
}

.credit-soon {
    border-left: 3px solid #f59e0b;
    background: linear-gradient(to right, rgba(245, 158, 11, 0.05), transparent);
}

.maintenance-urgente {
    border-left: 3px solid #ef4444;
    background: linear-gradient(to right, rgba(239, 68, 68, 0.05), transparent);
}

.facture-impayee {
    border-left: 3px solid #ef4444;
}

.facture-payee {
    border-left: 3px solid var(--personal-color);
}

/* ============================================================
   FORMULAIRES - Styles spécifiques aux pages add/edit
   ============================================================ */

/* Info items dans les résumés (edit pages) */
.form-container .info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.form-container .info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Location / Facture - champs financiers calculés */
.info-details {
    margin-top: 8px;
    padding: 12px;
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.total-display {
    padding: 16px;
    background: rgba(5, 150, 105, 0.05);
    border: 2px solid rgba(5, 150, 105, 0.2);
    border-radius: 10px;
    text-align: center;
}

.total-display label {
    font-size: 13px;
    color: var(--personal-color);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.total-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--personal-color);
}

.input-group {
    position: relative;
}

.input-suffix {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-accent);
    font-weight: 500;
    pointer-events: none;
}

/* Location edit - info actuelle */
.current-info {
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 24px;
}

.current-info h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 16px;
}

.current-info p {
    margin: 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Crédit - section résultat calculé */
.calcul-section {
    background: rgba(14, 165, 233, 0.05);
    border-color: rgba(14, 165, 233, 0.2);
}

.calcul-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.calcul-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.calcul-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--professional-color);
}

.calcul-detail {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
}

.form-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.alert-link {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.alert-link:hover {
    text-decoration: none;
}

@media (max-width: 768px) {
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .form-section {
        padding: 16px;
    }

    .current-info p {
        flex-direction: column;
        align-items: flex-start;
    }

    .calcul-detail {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
}

/* ============================================================
   REPORTING - Styles spécifiques à la page reporting
   ============================================================ */

.reporting-filters {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.reporting-filters .filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
}

.reporting-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reporting-filters .filter-group label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.reporting-period-info {
    text-align: center;
    padding: 16px;
    background: var(--bg-accent);
    border-radius: 12px;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.reporting-period-info strong {
    color: var(--text-primary);
}

.reporting-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.reporting-kpi {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px var(--shadow-color);
}

.reporting-kpi::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--professional-color);
    border-radius: 0 0 3px 3px;
}

.reporting-kpi:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px var(--shadow-color);
    border-color: var(--border-hover);
}

.reporting-kpi.kpi-success::before { background: var(--personal-color); }
.reporting-kpi.kpi-danger::before { background: #ef4444; }
.reporting-kpi.kpi-warning::before { background: #f59e0b; }
.reporting-kpi.kpi-info::before { background: var(--professional-color); }

.reporting-kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.reporting-kpi-title {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.reporting-kpi-icon {
    font-size: 1.5rem;
    opacity: 0.7;
}

.reporting-kpi-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1;
}

.reporting-kpi-sub {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.reporting-kpi-sub .positive { color: var(--personal-color); font-weight: 600; }
.reporting-kpi-sub .negative { color: #ef4444; font-weight: 600; }

.reporting-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(500px, 100%), 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.reporting-chart-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reporting-chart-card:hover {
    box-shadow: 0 10px 40px var(--shadow-color);
    border-color: var(--border-hover);
}

.reporting-chart-card h3 {
    margin-bottom: 20px;
    font-size: 14px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

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

.reporting-performance {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.reporting-bien-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px var(--shadow-color);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reporting-bien-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px var(--shadow-color);
    border-color: var(--border-hover);
}

.reporting-bien-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.reporting-bien-name {
    font-weight: 500;
    font-size: 16px;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.reporting-bien-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.reporting-metric {
    text-align: center;
    padding: 12px;
    background: var(--bg-accent);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.reporting-metric-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.reporting-metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .reporting-kpis {
        grid-template-columns: 1fr;
    }

    .reporting-charts {
        grid-template-columns: 1fr;
    }

    .reporting-performance {
        grid-template-columns: 1fr;
    }

    .reporting-filters .filters-grid {
        grid-template-columns: 1fr;
    }

    .reporting-kpi-value {
        font-size: 22px;
    }

    .reporting-chart-card {
        padding: 16px;
    }

    .reporting-chart-container {
        height: 250px;
    }
}

/* ============================================================
   PROFIL SWITCH (Configuration page)
   ============================================================ */
.profil-switch {
    display: inline-flex;
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.profil-switch-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 400;
    white-space: nowrap;
}

.profil-switch-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.profil-switch-btn.active {
    background: var(--professional-color, #2563eb);
    color: #fff;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.profil-switch-btn i {
    font-size: 0.85rem;
}

@media (max-width: 480px) {
    .profil-switch {
        width: 100%;
    }
    .profil-switch-btn {
        flex: 1;
        justify-content: center;
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
    }
}

/* ============================================================
   ZONE DE DANGER
   ============================================================ */
.danger-zone {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 15px;
    padding: 24px;
    margin: 30px 0;
}

.danger-zone h3 {
    color: #ef4444;
    margin-bottom: 16px;
}

.danger-zone p {
    color: #dc2626;
    margin-bottom: 16px;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 20px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .navbar {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1000;
        background: var(--bg-secondary);
        backdrop-filter: blur(20px);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        gap: 10px;
    }

    .logo-section {
        gap: 10px;
    }

    .logo-mark {
        width: 10px !important;
        height: 10px !important;
    }

    .logo-mark::after {
        inset: -3px;
    }

    .brand-text h1 {
        font-size: 14px !important;
        letter-spacing: 2px !important;
    }

    .brand-text p {
        display: none;
    }

    .header-actions {
        gap: 8px !important;
    }

    .theme-toggle {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    .theme-toggle #theme-text {
        display: none;
    }

    /* Hide desktop nav-menu + hamburger, show config hamburger */
    .nav-menu {
        display: none !important;
    }

    .menu-toggle {
        display: none !important;
    }

    .menu-overlay {
        display: none !important;
    }

    .config-menu {
        display: block;
    }

    .config-toggle {
        width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
    }

    /* User menu mobile */
    .user-menu-name {
        display: none;
    }

    .user-menu-arrow {
        display: none;
    }

    .user-menu-toggle {
        padding: 0.35rem 0.6rem;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        justify-content: center;
    }

    .user-menu-toggle .fa-user-circle {
        font-size: 1rem;
    }

    .user-menu-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        min-width: 100%;
        max-height: 70vh;
        overflow-y: auto;
        transform: translateY(100%);
    }

    .user-menu-dropdown.active {
        transform: translateY(0);
    }

    .tabs-navigation {
        flex-direction: column;
    }

    .tab-link {
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
    }

    .tab-link.active {
        border-bottom-color: var(--professional-color);
    }

    .modal-content {
        width: 95%;
        margin: 2% auto;
    }

    .modal-form .form-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding-top: 60px;
    }

    .container {
        padding: 0 16px;
    }

    .header-section {
        flex-direction: column;
        text-align: left;
        gap: 16px;
        margin: 16px 0;
    }

    .page-title {
        font-size: 22px;
        letter-spacing: 1px;
    }

    .dashboard-grid,
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .biens-grid,
    .locataires-grid,
    .locations-grid,
    .credits-grid,
    .maintenances-grid,
    .assurances-grid,
    .factures-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-container {
        padding: 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    /* Boutons pleine largeur SAUF dans les actions de cartes */
    .btn {
        width: 100%;
        justify-content: center;
    }

    .bien-actions .btn,
    .locataire-actions .btn,
    .location-actions .btn,
    .credit-actions .btn,
    .maintenance-actions .btn,
    .assurance-actions .btn,
    .facture-actions .btn {
        width: auto;
        padding: 8px 4px;
        font-size: 11px;
    }

    .action-buttons {
        justify-content: center;
    }

    .card, .bien-card, .locataire-card, .location-card, .credit-card, .maintenance-card, .assurance-card, .facture-card {
        padding: 16px;
        border-radius: 15px;
    }

    /* Badges responsive - toujours sur 1 ligne */
    .bien-badges {
        gap: 4px;
    }

    .bien-badges .badge {
        font-size: 9px;
        padding: 3px 5px;
        letter-spacing: 0;
    }

    /* Header de carte plus compact */
    .bien-header {
        flex-direction: column;
        gap: 8px;
    }

    .bien-header h3 {
        font-size: 14px;
    }

    .status-select {
        font-size: 12px;
        padding: 4px 8px;
        align-self: flex-start;
    }

    /* Info items plus compacts */
    .bien-info .info-item {
        padding: 5px 0;
        margin-bottom: 4px;
    }

    .bien-info .info-label {
        font-size: 11px;
        min-width: 90px;
    }

    .bien-info .info-value {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 8px 10px !important;
    }

    .logo-mark {
        width: 8px !important;
        height: 8px !important;
    }

    .logo-mark::after {
        inset: -2px;
    }

    .brand-text h1 {
        font-size: 12px !important;
    }

    .theme-toggle {
        padding: 5px 8px !important;
    }

    .config-toggle {
        width: 32px !important;
        height: 32px !important;
    }

    .user-menu-toggle {
        width: 32px !important;
        height: 32px !important;
    }

    .main-content {
        padding-top: 55px;
    }

    .page-title {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .card, .form-container {
        padding: 12px;
    }

    .scroll-top {
        bottom: 86px;
        right: 20px;
        width: 40px;
        height: 40px;
    }

    .bien-card, .locataire-card, .location-card, .credit-card, .maintenance-card, .assurance-card, .facture-card {
        padding: 12px;
    }

    .bien-actions .btn,
    .locataire-actions .btn,
    .location-actions .btn,
    .credit-actions .btn,
    .maintenance-actions .btn,
    .assurance-actions .btn,
    .facture-actions .btn {
        padding: 6px 3px;
        font-size: 10px;
    }

    .bien-badges .badge {
        font-size: 8px;
        padding: 2px 4px;
    }

    .bien-header h3 {
        font-size: 13px;
        letter-spacing: 0.5px;
    }

    .bien-info .info-label {
        min-width: 80px;
        font-size: 10px;
    }

    .bien-info .info-value {
        font-size: 11px;
    }

    .page-title {
        font-size: 18px;
    }
}

/* ============================================================
   UTILITAIRES
   ============================================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.font-bold { font-weight: 600; }
.font-semibold { font-weight: 500; }
.font-medium { font-weight: 400; }

.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-base { font-size: 16px; }
.text-lg { font-size: 18px; }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }

.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* ============================================================
   FOCUS ET ACCESSIBILITE
   ============================================================ */
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--professional-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .navbar,
    .btn,
    .scroll-top,
    .particles-canvas,
    .floating-shapes {
        display: none !important;
    }

    .card,
    .form-container {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        backdrop-filter: none !important;
    }
}

/* ============================================================
   STYLES SPECIFIQUES ASSURANCES (glassmorphisme)
   ============================================================ */
.filters-toggle {
    background: var(--professional-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.filters-toggle:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
}

.filters-toggle .arrow {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.filters-toggle.active .arrow {
    transform: rotate(180deg);
}

.filters-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-bottom: 24px;
}

.filters-section.show {
    max-height: 500px;
}

/* Selecteur de statut */
.status-select {
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.status-select:focus {
    outline: none;
    border-color: var(--personal-color);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
}

.status-select.status-active {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--personal-color);
}

.status-select.status-actif {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--personal-color);
}

.status-select.status-suspendue,
.status-select.status-suspendu {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #d97706;
}

.status-select.status-expiree,
.status-select.status-solde {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.status-select.status-annulee {
    background: var(--bg-accent);
    border-color: var(--border-color);
    color: var(--text-accent);
}

.status-select.status-brouillon {
    background: rgba(107, 114, 128, 0.1);
    border-color: rgba(107, 114, 128, 0.3);
    color: #6b7280;
}

.status-select.status-envoyee {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.status-select.status-payee {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.status-select.status-impayee {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.status-select.status-a_payer {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #d97706;
}

.status-select.status-partielle {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #b45309;
}

.status-badge.status-partielle,
.factures-row-partielle {
    background: rgba(245, 158, 11, 0.08);
}

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

/* ============================================================
   FACTURES - LISTE RESPONSIVE
   ============================================================ */
.factures-list-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-color);
}

/* --- Desktop : grille 6 colonnes --- */
.factures-list-header {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr auto;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-accent);
    border-bottom: 1px solid var(--border-color);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.factures-list-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr auto;
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    font-size: 13px;
    color: var(--text-primary);
    transition: background 0.2s ease;
}

.factures-list-row:last-of-type {
    border-bottom: none;
}

.factures-list-row:hover {
    background: var(--bg-accent);
}

.factures-row-payee {
    opacity: 0.7;
}

.factures-row-annulee {
    opacity: 0.5;
}

.fl-col {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fl-montant strong {
    font-family: 'JetBrains Mono', monospace;
}

.echeance-depassee {
    color: #ef4444 !important;
    font-weight: 600;
}

.factures-list-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem;
}

/* --- Boutons d'action icônes compacts --- */
.fl-actions-btns {
    display: flex;
    gap: 3px;
    flex-wrap: nowrap;
    align-items: center;
}

.fl-actions-btns form {
    display: inline-flex;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid var(--border-color);
    background: var(--bg-accent);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    padding: 0;
    line-height: 1;
}

.btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--shadow-color);
    border-color: var(--border-hover);
}

.btn-icon-duplicate {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.btn-icon-duplicate:hover {
    background: rgba(16, 185, 129, 0.2);
}

.btn-icon-edit {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.btn-icon-edit:hover {
    background: rgba(59, 130, 246, 0.2);
}

.btn-icon-view {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.btn-icon-view:hover {
    background: rgba(139, 92, 246, 0.2);
}

.btn-icon-print {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.btn-icon-print:hover {
    background: rgba(245, 158, 11, 0.2);
}

.btn-icon-delete {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-icon-delete:hover {
    background: rgba(239, 68, 68, 0.2);
}

.fl-statut .status-select {
    padding: 5px 8px;
    font-size: 11px;
    width: 100%;
    max-width: 140px;
}

/* --- Mobile : chaque ligne devient une fiche --- */
@media (max-width: 900px) {
    .factures-list-header {
        display: none;
    }

    .factures-list-row {
        display: block;
        padding: 16px;
        border-bottom: 1px solid var(--border-color);
    }

    /* Cacher les colonnes desktop-only */
    .factures-list-row .fl-dates {
        display: none;
    }

    .fl-dates-echeance {
        display: flex;
    }

    .fl-col {
        white-space: normal;
        overflow: visible;
    }

    /* Numéro facture = titre de la fiche */
    .fl-col.fl-numero {
        display: block;
        font-size: 15px;
        font-weight: 600;
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border-color);
    }

    .fl-col.fl-numero::before { display: none; }

    /* Infos en grille 2 colonnes */
    .fl-col.fl-locataire,
    .fl-col.fl-bien,
    .fl-col.fl-dates-echeance,
    .fl-col.fl-montant {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 0;
        font-size: 13px;
    }

    .fl-col.fl-locataire::before,
    .fl-col.fl-bien::before,
    .fl-col.fl-dates-echeance::before,
    .fl-col.fl-montant::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 600;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 0.3px;
        flex-shrink: 0;
        min-width: 90px;
    }

    /* Statut + actions en bas */
    .fl-col.fl-statut {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--border-color);
    }

    .fl-col.fl-statut::before {
        content: none;
    }

    .fl-statut .status-select {
        max-width: none;
        flex: 1;
    }

    .fl-col.fl-actions {
        display: flex;
        justify-content: flex-end;
        margin-top: 10px;
    }

    .fl-col.fl-actions::before {
        display: none;
    }

    .fl-actions-btns {
        gap: 6px;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .factures-list-row {
        padding: 12px;
    }

    .fl-col.fl-locataire,
    .fl-col.fl-bien,
    .fl-col.fl-dates-echeance,
    .fl-col.fl-montant {
        font-size: 12px;
    }

    .fl-col.fl-locataire::before,
    .fl-col.fl-bien::before,
    .fl-col.fl-dates-echeance::before,
    .fl-col.fl-montant::before {
        font-size: 10px;
        min-width: 75px;
    }

    .btn-icon {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
}

/* Classes utilitaires pour les dates */
.date-proche {
    color: #d97706 !important;
    font-weight: 500;
}

.expired-text {
    color: #ef4444 !important;
    font-weight: 500;
}

/* ============================================================
   FAB - FLOATING ACTION BUTTON (identique Fidurian)
   ============================================================ */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
}

.fab-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
}

.fab-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
    color: white;
}

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

.fab-button.purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.fab-button.blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.fab-button.green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.fab-label {
    position: absolute;
    right: 70px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.fab-container:hover .fab-label {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 768px) {
    .fab-container {
        bottom: 20px;
        right: 20px;
    }

    .fab-button {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .fab-label {
        display: none;
    }
}

/* ============================================================
   MENU HAMBURGER MOBILE
   ============================================================ */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================================
   ANIMATIONS MENU
   ============================================================ */
.nav-menu.active a {
    animation: slideInFromRight 0.3s ease forwards;
}

.nav-menu.active a:nth-child(1) { animation-delay: 0.05s; }
.nav-menu.active a:nth-child(2) { animation-delay: 0.1s; }
.nav-menu.active a:nth-child(3) { animation-delay: 0.15s; }
.nav-menu.active a:nth-child(4) { animation-delay: 0.2s; }
.nav-menu.active a:nth-child(5) { animation-delay: 0.25s; }
.nav-menu.active a:nth-child(6) { animation-delay: 0.3s; }
.nav-menu.active a:nth-child(7) { animation-delay: 0.35s; }
.nav-menu.active a:nth-child(8) { animation-delay: 0.4s; }
.nav-menu.active a:nth-child(9) { animation-delay: 0.45s; }
.nav-menu.active a:nth-child(10) { animation-delay: 0.5s; }

/* ============================================================
   ZONE TACTILE AMELIOREE
   ============================================================ */
@media (max-width: 768px) {
    .nav-menu a {
        min-height: 48px;
        touch-action: manipulation;
    }

    .menu-toggle {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }

    .btn {
        min-height: 44px;
        touch-action: manipulation;
    }
}

/* ============================================================
   DRAG & DROP UPLOAD ZONE
   ============================================================ */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--bg-card);
    margin-bottom: 1rem;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.03);
}

.drop-zone-active,
.drop-zone.drop-zone-active {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.08);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.drop-zone-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.6;
}

.drop-zone-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.drop-zone-browse {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

.drop-zone-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* File list */
.file-list {
    margin-bottom: 1rem;
}

.file-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-surface, #f8fafc);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.file-list-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list-name small {
    color: var(--text-secondary);
}

.file-list-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.3rem;
    line-height: 1;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.file-list-remove:hover {
    color: #dc2626;
}

/* Upload progress */
.upload-progress-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.upload-progress-name {
    flex: 0 0 40%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-progress-bar-outer {
    flex: 1;
    height: 8px;
    background: var(--gray-200, #e5e7eb);
    border-radius: 4px;
    overflow: hidden;
}

.upload-progress-bar-inner {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    width: 0%;
    transition: width 0.15s ease;
}

.upload-progress-pct {
    flex: 0 0 50px;
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ============================================================
   DASHBOARD CUSTOMIZABLE WIDGETS
   ============================================================ */
.widget-edit-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 2px solid var(--primary, #2563eb);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.dashboard-widget {
    position: relative;
    transition: opacity 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-widget.widget-edit-mode {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    cursor: grab;
}

.dashboard-widget.widget-dragging {
    opacity: 0.4;
}

.dashboard-widget.widget-drag-over {
    border-color: var(--primary, #2563eb);
    background: rgba(37, 99, 235, 0.04);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.dashboard-widget.widget-hidden {
    opacity: 0.4;
}

.widget-drag-handle {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--bg-surface, #f8fafc);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.widget-drag-icon {
    font-size: 1.2rem;
    cursor: grab;
    color: var(--text-secondary);
    user-select: none;
}

.widget-drag-label {
    font-weight: 600;
    color: var(--text-primary);
}

.widget-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.8rem;
}

.widget-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary, #2563eb);
}

.widget-toggle-label {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================================
   ETATS DES LIEUX - Badges, grilles, cartes
   ============================================================ */

/* Badges d'etat (bon/correct/mauvais/non_applicable) */
.etat-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.etat-bon {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.etat-correct {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.etat-mauvais {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.etat-non_applicable {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

/* Badge type entree/sortie */
.edl-badge-entree {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.edl-badge-sortie {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Grille des pieces (view page) */
.edl-pieces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--spacing-4);
}

/* Carte par piece */
.edl-piece-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl, 12px);
    padding: var(--spacing-4);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.1));
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.edl-piece-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.edl-piece-card h4 {
    margin-bottom: var(--spacing-3);
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-2);
}

/* Sous-grille pour les 6 elements */
.edl-element-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-3);
}

.edl-element-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.edl-element-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edl-element-notes {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.15rem;
}

/* Tableau des pieces (edit page) */
.edl-pieces-table {
    width: 100%;
    overflow-x: auto;
    display: block;
}

.edl-pieces-table table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
}

.edl-pieces-table th,
.edl-pieces-table td {
    padding: 0.5rem 0.6rem;
    text-align: center;
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--border-color);
}

.edl-pieces-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edl-pieces-table td:first-child {
    text-align: left;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .edl-pieces-grid {
        grid-template-columns: 1fr;
    }

    .edl-element-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .edl-pieces-table table {
        min-width: auto;
        font-size: 11px;
    }

    .edl-pieces-table th,
    .edl-pieces-table td {
        padding: 0.3rem 0.4rem;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .edl-pieces-table th,
    .edl-pieces-table td {
        padding: 0.25rem 0.3rem;
        font-size: 10px;
    }

    .container {
        padding: 0 12px;
    }

    .config-dropdown {
        min-width: 180px;
    }
}
