/* ==========================================================================
   🎨 FIDDLE BRO'S - DESIGN SYSTEM & STYLES PREMIUM (AGENCE & SAAS)
   ========================================================================== */

/* --- 1. VARIABLES GLOBALES (Le cœur de ton image de marque) --- */
:root {
    /* Palette de Couleurs */
    --bg-main: #FAFAFA;
    --bg-gray: #F3F4F6;
    --surface: #FFFFFF;
    --border: #E5E7EB;
    
    --text-main: #111827;
    --text-muted: #4B5563;
    --text-light: #9CA3AF;
    
    --primary: #0F766E;        /* Vert Fiddle */
    --primary-hover: #0D655E;
    --primary-light: rgba(15, 118, 110, 0.1);
    
    --accent: #D97706;         /* Orange Doré */
    --accent-light: rgba(217, 119, 6, 0.1);
    
    --danger: #EF4444;
    --danger-light: #FEF2F2;

    /* Ombres (Effet 3D SaaS) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 2. RESET & BASE --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background-color: var(--bg-main); color: var(--text-main); line-height: 1.6; overflow-x: hidden; }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3, h4 { font-weight: 800; line-height: 1.2; color: var(--text-main); }
.text-gradient { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.mt-4 { margin-top: 1.5rem; }

/* --- 3. BOUTONS GLOBAUX --- */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border-radius: 12px; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; transition: var(--transition); border: none; gap: 8px; font-family: inherit; }
.btn-large { padding: 16px 32px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 8px; }
.btn-full { width: 100%; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 14px var(--primary-light); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(15, 118, 110, 0.3); }
.btn-outline { background: transparent; color: var(--text-main); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Loader Bouton */
.btn-loader .btn-spinner { display: none; width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.3); border-top: 3px solid white; border-radius: 50%; animation: spin 1s linear infinite; }
.btn.loading .btn-spinner { display: inline-block; }
.btn.loading .btn-text { display: none; }

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

/* ==========================================================================
   🌐 PARTIE 1 : LE SITE VITRINE (Page d'accueil)
   ========================================================================== */

#main-header { position: fixed; top: 0; width: 100%; z-index: 100; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 15px 0; }
.nav-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 22px; font-weight: 800; color: var(--primary); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.logo img { width: 36px; height: 36px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a.link-text { color: var(--text-muted); text-decoration: none; font-weight: 600; transition: var(--transition); }
.nav-links a.link-text:hover { color: var(--primary); }

.hero { padding: 180px 0 100px; text-align: center; position: relative; }
.badge-hero { display: inline-block; padding: 6px 16px; background: var(--primary-light); color: var(--primary); border-radius: 100px; font-size: 13px; font-weight: 700; margin-bottom: 24px; }
.hero h1 { font-size: 3.5rem; margin-bottom: 24px; letter-spacing: -0.03em; }
.hero p { font-size: 1.125rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 40px; }

.section { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: 2.25rem; margin-bottom: 16px; }
.section-header p { color: var(--text-muted); font-size: 1.125rem; max-width: 600px; margin: 0 auto; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 40px 30px; transition: var(--transition); box-shadow: var(--shadow-sm); position: relative; }
.card:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: var(--shadow-xl); }
.card-icon { width: 60px; height: 60px; background: var(--primary-light); color: var(--primary); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 24px; }
.card h3 { font-size: 1.25rem; margin-bottom: 12px; }
.card p { color: var(--text-muted); font-size: 0.95rem; }

.step-card { overflow: hidden; }
.step-number { position: absolute; top: -15px; right: -15px; font-size: 100px; font-weight: 900; color: var(--bg-gray); opacity: 0.5; line-height: 1; z-index: 0; pointer-events: none; }
.step-card > * { position: relative; z-index: 1; }

.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; max-width: 900px; margin: 0 auto; }
.pricing-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 40px; position: relative; box-shadow: var(--shadow-sm); }
.pricing-card.highlight { background: var(--primary); color: white; border-color: var(--primary); transform: scale(1.02); box-shadow: var(--shadow-xl); }
.badge-popular { position: absolute; top: -15px; right: 30px; background: var(--accent); color: white; padding: 6px 16px; border-radius: 100px; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.price-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 15px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.highlight .price-title { color: rgba(255,255,255,0.8); }
.price-amount { font-size: 3.5rem; font-weight: 800; margin-bottom: 10px; line-height: 1; }
.price-amount span { font-size: 1.1rem; font-weight: 500; }
.price-desc { color: var(--text-muted); margin-bottom: 30px; }
.highlight .price-desc { color: rgba(255,255,255,0.9); }
.pricing-list { list-style: none; }
.pricing-list li { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 0.95rem; color: var(--text-muted); }
.highlight .pricing-list li { color: white; }
.pricing-list li::before { content: "✓"; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; background: var(--accent-light); color: var(--accent); border-radius: 50%; font-weight: bold; font-size: 12px; }
.highlight .pricing-list li::before { background: rgba(255,255,255,0.2); color: white; }
.highlight .btn-primary { background: white; color: var(--primary); }
.highlight .btn-primary:hover { background: var(--bg-gray); }

/* FOOTER VITRINE */
.site-footer { background-color: #111827; color: var(--text-light); padding-top: 80px; margin-top: 50px; }
.footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-bottom: 60px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-logo { display: flex; align-items: center; gap: 15px; font-size: 24px; font-weight: 800; color: white; margin-bottom: 20px; }
.footer-logo img { width: 40px; height: 40px; border-radius: 8px; }
.footer-bio { max-width: 400px; font-size: 0.95rem; line-height: 1.7; }
.footer-links h4, .footer-contact h4 { color: white; font-size: 1.1rem; margin-bottom: 25px; }
.footer-links ul, .footer-contact ul { list-style: none; }
.footer-links li, .footer-contact li { margin-bottom: 15px; }
.footer-links a, .footer-contact a { color: var(--text-light); text-decoration: none; transition: var(--transition); }
.footer-links a:hover, .footer-contact a:hover { color: white; }
.footer-bottom { padding: 25px 0; text-align: center; font-size: 0.85rem; }

/* MODALE DE CONNEXION */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(17, 24, 39, 0.7); backdrop-filter: blur(8px); z-index: 1000; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; }
.modal-overlay.active { display: flex; opacity: 1; }
.modal-content { background: var(--surface); padding: 40px; border-radius: 24px; width: 90%; max-width: 420px; position: relative; transform: translateY(20px); transition: transform 0.3s ease; box-shadow: var(--shadow-xl); }
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-close { position: absolute; top: 20px; right: 20px; background: none; border: none; font-size: 28px; color: var(--text-muted); cursor: pointer; }
.modal-header { text-align: center; margin-bottom: 30px; }
.modal-icon { font-size: 40px; margin-bottom: 10px; }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.form-group input { width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 12px; font-size: 1rem; outline: none; transition: var(--transition); font-family: inherit; }
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.alert-error { display: none; background: var(--danger-light); color: var(--danger); padding: 12px; border-radius: 8px; font-size: 0.875rem; font-weight: 600; text-align: center; margin-bottom: 15px; }
.modal-footer { text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-top: 24px; }
.modal-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }

/* ==========================================================================
   💻 PARTIE 2 : LOGICIEL SAAS (Le Dashboard Pro)
   ========================================================================== */

.dashboard-body { margin: 0; background-color: var(--bg-gray); height: 100vh; overflow: hidden; }

/* LAYOUT PRINCIPAL */
.dashboard-layout { display: flex; height: 100vh; width: 100vw; }

/* 1. SIDEBAR (Panneau Latéral) */
.sidebar { width: 260px; background-color: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.sidebar-logo-img { width: 32px; height: 32px; border-radius: 8px; }
.sidebar-logo-text { font-weight: 800; font-size: 1.1rem; color: var(--text-main); }

.sidebar-nav { flex: 1; padding: 24px 16px; overflow-y: auto; }
.sidebar-title { font-size: 0.75rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; padding-left: 12px; }

.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px; text-decoration: none; color: var(--text-muted); font-weight: 600; border-radius: 12px; transition: var(--transition); margin-bottom: 4px; font-size: 0.95rem; }
.nav-item:hover:not(.disabled) { background-color: var(--bg-gray); color: var(--text-main); }
.nav-item.active { background-color: var(--primary-light); color: var(--primary); }
.nav-item.disabled { opacity: 0.5; cursor: not-allowed; justify-content: space-between; }
.nav-icon { font-size: 1.2rem; }
.badge-soon { background: var(--bg-gray); color: var(--text-muted); font-size: 0.65rem; padding: 3px 8px; border-radius: 100px; font-weight: 700; text-transform: uppercase; }

.sidebar-footer { padding: 20px; border-top: 1px solid var(--border); }
.user-profile { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.avatar { width: 40px; height: 40px; background: var(--primary-light); color: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.user-info { overflow: hidden; }
.user-role { font-size: 0.8rem; font-weight: 700; color: var(--text-main); }
.user-email-text { font-size: 0.75rem; color: var(--text-muted); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }

.btn-logout-sidebar { width: 100%; display: flex; align-items: center; justify-content: center; padding: 10px; background: transparent; border: 1px solid var(--border); color: var(--danger); font-weight: 600; font-size: 0.9rem; border-radius: 10px; cursor: pointer; transition: var(--transition); }
.btn-logout-sidebar:hover { background: var(--danger-light); border-color: #FCA5A5; }

/* 2. MAIN CONTENT (Zone Centrale) */
.dashboard-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Topbar */
.topbar { height: 72px; background-color: var(--surface); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; padding: 0 32px; flex-shrink: 0; }
.topbar-search { position: relative; width: 350px; }
.topbar-search .search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-light); }
.search-input-top { width: 100%; padding: 10px 16px 10px 45px; background: var(--bg-gray); border: 1px solid transparent; border-radius: 10px; font-family: inherit; font-size: 0.9rem; transition: var(--transition); }
.search-input-top:focus { background: white; border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-light); }

/* Contenu Scrolable */
.dashboard-content { padding: 32px; overflow-y: auto; flex: 1; }
.page-title-group { margin-bottom: 32px; }
.page-title-group h1 { font-size: 1.8rem; margin-bottom: 4px; }
.page-title-group p { color: var(--text-muted); font-size: 0.95rem; }

/* 3. KPI CARDS (Les stats en haut) */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 32px; }
.kpi-card { background: var(--surface); padding: 24px; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform 0.2s; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.kpi-header h3 { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.kpi-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.kpi-icon.blue { background: rgba(59, 130, 246, 0.1); color: #3B82F6; }
.kpi-icon.orange { background: var(--accent-light); color: var(--accent); }
.kpi-icon.green { background: var(--primary-light); color: var(--primary); }
.kpi-value { font-size: 2.2rem; font-weight: 800; color: var(--text-main); margin-bottom: 8px; line-height: 1; }
.kpi-trend { font-size: 0.8rem; color: var(--text-muted); }
.kpi-trend.positive { color: #10B981; font-weight: 600; }

/* 4. TABLEAU CLIENTS PRO */
.table-container { background: var(--surface); border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; }
.table-header-row { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 15px; background: white; }
.table-header-row h2 { font-size: 1.1rem; margin: 0; }
.badge-live { background: rgba(16, 185, 129, 0.1); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.2); font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 100px; display: inline-flex; align-items: center; gap: 6px; }

.table-responsive { overflow-x: auto; }
.pro-table { width: 100%; border-collapse: collapse; text-align: left; }
.pro-table th { background: #F9FAFB; padding: 14px 24px; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
.pro-table td { padding: 16px 24px; font-size: 0.9rem; color: var(--text-main); border-bottom: 1px solid var(--bg-gray); vertical-align: middle; }
.pro-table tr:last-child td { border-bottom: none; }
.pro-table tr:hover { background: #F8FAFC; }

.badge-points { background: var(--primary-light); color: var(--primary); padding: 4px 12px; border-radius: 100px; font-weight: 800; font-size: 0.85rem; display: inline-block; border: 1px solid rgba(15, 118, 110, 0.2); }
.empty-state { text-align: center; padding: 60px !important; color: var(--text-muted) !important; font-size: 0.95rem; }

/* 5. LOADER SÉCURITÉ */
.loader-overlay { position: fixed; inset: 0; background: rgba(255, 255, 255, 0.95); z-index: 9999; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.3s ease; }
.loader-text { font-weight: 700; color: var(--text-muted); font-size: 0.9rem; margin-top: 15px; }

/* ==========================================================================
   📱 NAVIGATION STYLE APP + DASHBOARD RESPONSIVE (MERGED & PRO)
   ========================================================================== */

@media (max-width: 768px) {
    /* --- 1. VITRINE : NAVIGATION STYLE APP --- */
    #main-header { padding: 10px 0; }
    .nav-inner { position: relative; }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%; /* Menu caché */
        height: 100vh;
        width: 85%;
        max-width: 320px;
        background: var(--surface);
        flex-direction: column;
        justify-content: flex-start;
        padding: 100px 30px;
        gap: 25px !important;
        box-shadow: -15px 0 40px rgba(0,0,0,0.15);
        transition: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 999;
    }

    .nav-links.active { right: 0; }

    .nav-links a.link-text {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--text-main);
        width: 100%;
        padding-bottom: 15px;
        border-bottom: 1px solid var(--border);
    }

    .btn-nav {
        width: 100%;
        margin-top: 30px;
        padding: 20px !important;
        background: var(--primary) !important;
        color: white !important;
        font-size: 16px !important;
        border-radius: 18px !important;
        box-shadow: 0 10px 20px rgba(15, 118, 110, 0.2) !important;
        justify-content: center;
    }

    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        background: var(--bg-gray);
        border: none;
        cursor: pointer;
        padding: 10px;
        border-radius: 12px;
        z-index: 1001;
    }

    .bar { width: 22px; height: 2px; background-color: var(--primary); transition: 0.3s; border-radius: 2px; }
    .menu-toggle.active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.active .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .menu-toggle.active .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* --- 2. VITRINE : CONTENU --- */
    .hero { padding: 130px 0 60px; }
    .hero h1 { font-size: 2.3rem; }
    .grid-3, .pricing-grid, .footer-content { grid-template-columns: 1fr !important; gap: 30px; }
    .pricing-card.highlight { transform: none; margin-top: 20px; }
    .footer-content { text-align: center; }

    /* --- 3. DASHBOARD PRO : RESPONSIVE SÉCURISÉ --- */
    .dashboard-layout { flex-direction: column; }
    
    .sidebar { 
        width: 100%; 
        height: auto; 
        border-right: none; 
        border-bottom: 1px solid var(--border); 
        flex-direction: row; 
        align-items: center; 
        justify-content: space-between; 
        padding: 12px 20px; 
    }
    
    .sidebar-header { border-bottom: none; padding: 0; }
    .sidebar-nav, .sidebar-footer { display: none; } /* On simplifie sur mobile */
    
    .topbar { 
        flex-direction: column; 
        height: auto; 
        padding: 15px; 
        gap: 15px; 
    }
    
    .topbar-search { width: 100%; }
    .kpi-grid { grid-template-columns: 1fr !important; }
    .dashboard-content { padding: 15px; }
    
    .table-header-row { flex-direction: column; align-items: flex-start; gap: 10px; }
}
