:root {
    --primary: #0A58A8;
    --primary-dark: #073E77;
    --cyan: #06B6D4;
    --cyan-light: #38BDF8;
    --dark: #0F172A;
    --dark-navy: #091322;
    --light-bg: #F8FAFC;
    --card-bg: #FFFFFF;
    --border: #E2E8F0;
    --text: #334155;
    --success: #16A34A;
    --warning: #F59E0B;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background-color: var(--light-bg); color: var(--text); line-height: 1.5; }

.container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 32px !important;
    box-sizing: border-box !important;
}

/* Header Sombre & Mascotte Transparente */
.navbar { background: var(--dark-navy); color: white; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); position: sticky; top: 0; z-index: 100; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); }
.nav-container { display: flex; justify-content: space-between; align-items: center; }

.brand { display: flex; align-items: center; gap: 14px; }
.nav-mascot-img { height: 44px; width: auto; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(6, 182, 212, 0.4)); }
.brand-text-nav { display: flex; flex-direction: column; }
.brand-title-nav { font-family: 'Outfit', sans-serif; font-size: 1.35rem; font-weight: 800; color: #FFFFFF; line-height: 1.1; letter-spacing: -0.3px; }
.brand-title-nav span { background: linear-gradient(135deg, var(--cyan-light), var(--cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.brand-tagline-nav { font-size: 0.68rem; color: #94A3B8; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; margin-top: 1px; }

.portal-badge { background: rgba(56, 189, 248, 0.12); color: #38BDF8; font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 0.82rem; letter-spacing: 1.5px; border: 1px solid rgba(56, 189, 248, 0.35); border-radius: 6px; padding: 3px 10px; margin-left: 6px; }

.nav-right { display: flex; align-items: center; gap: 10px; }
.user-chip { background: rgba(255, 255, 255, 0.1); color: white; padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 8px; }
.user-chip-admin { background: #F59E0B; color: #78350F; font-weight: 700; }
.btn-outline-ninja { background: rgba(255, 255, 255, 0.1); color: #38BDF8; border: 1px solid rgba(56, 189, 248, 0.4); }
.btn-outline-ninja:hover { background: #38BDF8; color: #0F172A; }
.btn-logout { background: rgba(239, 68, 68, 0.15); color: #FCA5A5; border: 1px solid rgba(239, 68, 68, 0.3); }
.btn-logout:hover { background: #EF4444; color: white; }

/* Login Overlay - Sombre Haut de Gamme */
.login-overlay { position: fixed; inset: 0; background: radial-gradient(circle at center, #0F1C34 0%, #060B16 100%); backdrop-filter: blur(12px); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { background: #0F172A; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 18px; width: 100%; max-width: 420px; padding: 40px 32px; box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 45px rgba(6, 182, 212, 0.18); color: #F1F5F9; }

.login-brand { text-align: center; margin-bottom: 28px; }
.brand-header-flex { display: flex; align-items: center; justify-content: center; gap: 14px; }
.brand-mascot-img-login { height: 60px; width: auto; object-fit: contain; filter: drop-shadow(0 4px 14px rgba(6, 182, 212, 0.45)); }
.brand-text-login { text-align: left; }
.brand-title-login { font-family: 'Outfit', sans-serif; font-size: 1.6rem; font-weight: 800; color: #FFFFFF; line-height: 1.1; }
.brand-title-login span { background: linear-gradient(135deg, var(--cyan-light), var(--cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.brand-tagline-login { font-size: 0.72rem; color: #94A3B8; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }

.portal-badge-login { background: rgba(56, 189, 248, 0.12); color: #38BDF8; font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 0.92rem; letter-spacing: 2px; text-transform: uppercase; border: 1px solid rgba(56, 189, 248, 0.35); border-radius: 8px; padding: 5px 20px; margin-top: 16px; display: inline-block; }

.login-box .form-label { color: #CBD5E1; font-weight: 600; margin-bottom: 8px; font-size: 0.88rem; display: block; }
.login-box .form-control { background: #182746; border: 1px solid #2A3C61; color: #FFFFFF; padding: 12px 14px; border-radius: 8px; width: 100%; font-size: 0.95rem; }
.login-box .form-control:focus { outline: none; border-color: #38BDF8; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25); }
.login-error { background: rgba(239, 68, 68, 0.2); color: #FCA5A5; border: 1px solid rgba(239, 68, 68, 0.4); padding: 10px 14px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; margin-bottom: 14px; text-align: center; }

/* Tabs */
.tabs { display: flex; gap: 12px; margin: 26px 0 20px; }
.tab-btn { background: #E2E8F0; border: none; padding: 12px 22px; border-radius: 8px; font-weight: 700; cursor: pointer; color: var(--text); font-family: 'Outfit', sans-serif; font-size: 0.95rem; transition: 0.2s; display: flex; align-items: center; gap: 8px; }
.tab-btn:hover { background: #CBD5E1; }
.tab-btn.active { background: var(--primary); color: white; }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Cards & Layout */
.card { background: var(--card-bg); border-radius: 12px; border: 1px solid var(--border); padding: 30px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); margin-bottom: 30px; }
.card-header { margin-bottom: 24px; }
.card-header h2 { font-family: 'Outfit', sans-serif; font-size: 1.35rem; color: var(--dark); display: flex; align-items: center; gap: 10px; }
.text-muted { color: #64748B; font-size: 0.9rem; margin-top: 4px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 2fr 1fr 1fr; }
@media(max-width: 768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.9rem; color: var(--dark); }
.form-control { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem; font-family: inherit; transition: 0.2s; background: white; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10, 88, 168, 0.15); }

/* Checkbox Cards */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 6px; }
.checkbox-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 2px solid var(--border); border-radius: 8px; cursor: pointer; transition: 0.2s; background: #FAFAFA; }
.checkbox-card:hover { border-color: #CBD5E1; background: white; }
.checkbox-card.checked { border-color: var(--primary); background: #EFF6FF; }
.checkbox-card input { width: 18px; height: 18px; accent-color: var(--primary); }
.cb-icon { font-size: 1.4rem; color: var(--primary); width: 32px; text-align: center; }
.checkbox-card strong { display: block; font-size: 0.95rem; color: var(--dark); }
.checkbox-card p { font-size: 0.78rem; color: #64748B; margin-top: 2px; }

/* Trades Configurator Accordions & Badges */
.trades-configurator { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.trade-accordion-card { border: 1.5px solid var(--border); border-radius: 10px; background: #FFFFFF; overflow: hidden; transition: 0.2s border-color, 0.2s box-shadow; }
.trade-accordion-card.active-lot { border-color: #38BDF8; box-shadow: 0 2px 10px rgba(56, 189, 248, 0.12); }
.trade-accordion-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: #F8FAFC; cursor: pointer; user-select: none; transition: 0.2s background; }
.trade-accordion-header:hover { background: #F1F5F9; }
.trade-checkbox-label { display: flex; align-items: center; gap: 14px; cursor: pointer; flex: 1; }
.lot-master-checkbox { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.trade-header-icon { font-size: 1.3rem; width: 28px; text-align: center; }
.trade-header-text strong { display: block; font-size: 0.98rem; color: var(--dark); font-family: 'Outfit', sans-serif; }
.trade-header-text span { font-size: 0.78rem; color: #64748B; display: block; }
.accordion-arrow { color: #94A3B8; font-size: 0.9rem; transition: transform 0.25s ease; padding: 4px; }
.trade-accordion-card.open .accordion-arrow { transform: rotate(180deg); }

.trade-subpanel { display: none; padding: 18px 20px 22px; background: #FFFFFF; border-top: 1px solid var(--border); }
.trade-accordion-card.open .trade-subpanel { display: block; animation: fadeInSub 0.2s ease; }
@keyframes fadeInSub { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.config-section { margin-bottom: 16px; }
.config-section:last-child { margin-bottom: 0; }
.config-label { display: block; font-size: 0.84rem; font-weight: 700; color: #475569; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.chips-group { display: flex; flex-wrap: wrap; gap: 8px; }
.trade-chip { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 20px; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: 0.15s all; background: #F1F5F9; color: #475569; border: 1px solid #CBD5E1; user-select: none; }
.trade-chip:hover { background: #E2E8F0; color: var(--dark); }
.trade-chip.active { background: #0A58A8; color: #FFFFFF; border-color: #0A58A8; box-shadow: 0 2px 6px rgba(10, 88, 168, 0.25); }
.trade-chip.active::before { content: "✓ "; margin-right: 4px; font-weight: bold; }
.trade-custom-notes { font-size: 0.88rem; resize: vertical; min-height: 54px; }


/* Dropzone */
.dropzone { border: 2px dashed #94A3B8; border-radius: 10px; padding: 30px 20px; text-align: center; background: #F8FAFC; cursor: pointer; transition: 0.2s; }
.dropzone:hover { border-color: var(--primary); background: #F0F7FF; }
.drop-icon { font-size: 2.2rem; color: #64748B; margin-bottom: 8px; }
.file-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.file-tag { background: #E0F2FE; color: var(--primary); padding: 4px 10px; border-radius: 4px; font-size: 0.8rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }

/* Buttons */
.btn { padding: 11px 22px; border-radius: 8px; font-weight: 700; cursor: pointer; border: none; font-family: 'Outfit', sans-serif; font-size: 0.95rem; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }

/* Admin Validation Buttons */
.btn-validate { background: #16A34A; color: white; padding: 6px 12px; font-size: 0.82rem; border-radius: 6px; }
.btn-validate:hover { background: #15803D; }
.btn-edit-ninja { background: #0284C7; color: white; padding: 6px 12px; font-size: 0.82rem; border-radius: 6px; }
.btn-edit-ninja:hover { background: #0369A1; }
.btn-danger { background: #EF4444; color: white; padding: 6px 12px; font-size: 0.82rem; border-radius: 6px; border: none; cursor: pointer; transition: 0.2s; }
.btn-danger:hover { background: #DC2626; }


/* Table */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { background: #F1F5F9; padding: 12px 14px; text-align: left; font-weight: 700; color: #475569; border-bottom: 2px solid var(--border); }
.table td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 700; }
.badge-pending { background: #FEF3C7; color: #B45309; }
.badge-success { background: #DCFCE7; color: #15803D; }

/* Modal */
.modal { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(4px); z-index: 999; align-items: center; justify-content: center; }
.modal-content { background: white; border-radius: 12px; width: 90%; max-width: 800px; max-height: 85vh; overflow-y: auto; padding: 26px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 16px; }
.close { font-size: 1.8rem; cursor: pointer; color: #64748B; }
pre { background: #F1F5F9; padding: 14px; border-radius: 8px; font-size: 0.85rem; overflow-x: auto; white-space: pre-wrap; font-family: monospace; }

.btn-plan-view { background: #0284C7; color: white !important; font-weight: 700; border-radius: 6px; padding: 6px 12px; font-size: 0.82rem; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn-plan-view:hover { background: #0369A1; }


/* =======================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS (TABLETS & SMARTPHONES)
   ======================================================= */
@media (max-width: 860px) {
    .container { padding: 0 14px; }
    .navbar { padding: 10px 0; }
    .nav-container { flex-direction: column; gap: 10px; align-items: stretch; }
    .brand { justify-content: space-between; width: 100%; }
    .nav-right { justify-content: flex-end; width: 100%; gap: 6px; flex-wrap: wrap; }
    .brand-title-nav { font-size: 1.15rem; }
    .nav-mascot-img { height: 36px; }
    .btn-outline-ninja, .btn-logout { font-size: 0.75rem; padding: 5px 10px; }
    .user-chip { font-size: 0.75rem; padding: 4px 10px; }

    .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 14px; }
    .tab-btn { justify-content: center; padding: 10px 8px; font-size: 0.85rem; }

    .card { padding: 18px 14px; margin-bottom: 20px; border-radius: 10px; }
    .card-header h2 { font-size: 1.15rem; }
    
    .grid-2, .grid-3 { grid-template-columns: 1fr !important; gap: 12px; }
    .checkbox-grid { grid-template-columns: 1fr !important; }
    .dropzone { padding: 20px 10px; }

    /* Modal Mobile */
    .modal-content { width: 95%; max-height: 90vh; padding: 18px 14px; border-radius: 10px; }
    .login-box { padding: 26px 18px; max-width: 95%; }
    .brand-mascot-img-login { height: 48px; }
    .brand-title-login { font-size: 1.35rem; }

    /* Conversion Tableau -> Cartes Mobiles */
    .table-responsive { overflow-x: visible; }
    .table-responsive table, 
    .table-responsive thead, 
    .table-responsive tbody, 
    .table-responsive th, 
    .table-responsive td, 
    .table-responsive tr { 
        display: block; 
    }
    .table-responsive thead tr { 
        position: absolute; 
        top: -9999px; 
        left: -9999px; 
    }
    .table-responsive tr { 
        border: 1px solid #E2E8F0; 
        border-radius: 12px; 
        margin-bottom: 14px; 
        padding: 14px; 
        background: #FFFFFF; 
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); 
    }
    .table-responsive td { 
        border: none; 
        padding: 6px 0; 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        font-size: 0.88rem; 
        text-align: right; 
    }
    .table-responsive td:before { 
        content: attr(data-label); 
        font-weight: 700; 
        color: #64748B; 
        font-size: 0.8rem; 
        text-transform: uppercase; 
        margin-right: 12px; 
        text-align: left; 
    }
    .table-responsive td:last-child { 
        margin-top: 10px; 
        padding-top: 10px; 
        border-top: 1px dashed #E2E8F0; 
        justify-content: flex-end; 
    }
    .table-responsive td:last-child:before { 
        display: none; 
    }
    .table-responsive td:last-child > div { 
        width: 100%; 
        display: grid !important; 
        grid-template-columns: 1fr 1fr; 
        gap: 6px; 
    }
    .table-responsive td:last-child .btn { 
        justify-content: center; 
        padding: 8px 10px; 
        font-size: 0.8rem; 
    }
}

/* =======================================================
   PRINT & EXPORT PDF STYLESHEET (FICHE DE SYNTHÈSE)
   ======================================================= */
@media print {
    body * {
        visibility: hidden;
    }
    #study-modal, #study-modal .modal-content, #study-modal .modal-content * {
        visibility: visible;
    }
    #study-modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: transparent !important;
        backdrop-filter: none !important;
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    #study-modal .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .modal-header button, .modal-header .close {
        display: none !important;
    }
    pre {
        white-space: pre-wrap !important;
        border: 1px solid #CBD5E1 !important;
        background: #F8FAFC !important;
        font-size: 0.8rem !important;
    }
    @page {
        size: A4 portrait;
        margin: 15mm 15mm 15mm 15mm;
    }
}



/* =======================================================
   HABITAT 65 - TOLTECK DASHBOARD & RS815 EXPLORER
   ======================================================= */
.brand-logo-badge {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1E3A8A, #0284C7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin: 20px 0 24px;
}
.kpi-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: 0.2s transform, 0.2s box-shadow;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.icon-blue { background: #EFF6FF; color: #2563EB; }
.icon-amber { background: #FFFBEB; color: #D97706; }
.icon-green { background: #F0FDF4; color: #16A34A; }
.icon-indigo { background: #EEF2FF; color: #4F46E5; }

.kpi-info { display: flex; flex-direction: column; }
.kpi-label { font-size: 0.78rem; color: #64748B; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; }
.kpi-value { font-size: 1.45rem; font-weight: 800; color: #0F172A; line-height: 1.2; margin-top: 3px; font-family: 'Outfit', sans-serif; }
.text-amber { color: #D97706 !important; }
.text-green { color: #16A34A !important; }
.text-indigo { color: #4F46E5 !important; }

/* Toolbar & Filters */
.dossiers-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-pill {
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    color: #475569;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.filter-pill:hover { background: #E2E8F0; }
.filter-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.search-box {
    position: relative;
    min-width: 280px;
    flex: 1;
    max-width: 420px;
}
.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
}
.search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
    transition: 0.2s;
}
.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 88, 168, 0.15);
}

/* Modal Explorer RS815 */
.modal-lg { max-width: 960px !important; }
.explorer-section {
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 18px;
}
.explorer-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0F172A;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.explorer-count-badge {
    background: #E2E8F0;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}
.file-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 12px;
}
.file-item-card {
    background: white;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: 0.2s;
}
.file-item-card:hover {
    border-color: #0284C7;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.1);
}
.file-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}
.file-icon {
    font-size: 1.4rem;
}
.icon-pdf { color: #DC2626; }
.icon-zip { color: #D97706; }
.icon-dwg { color: #2563EB; }
.icon-file { color: #64748B; }

.file-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 175px;
}
.file-size {
    font-size: 0.75rem;
    color: #64748B;
    margin-top: 1px;
}
.btn-dl-file {
    background: #EFF6FF;
    color: #0284C7;
    border: 1px solid #BAE6FD;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-dl-file:hover {
    background: #0284C7;
    color: white;
}
.status-pill {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.status-pill-fait { background: #DCFCE7; color: #15803D; border: 1px solid #86EFAC; }
.status-pill-faire { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }


/* ========================================================================== */
/* EXPANDED PIPELINE & DASHBOARD STYLES (HABITAT 65)                          */
/* ========================================================================== */

.modal-xl {
    max-width: 1200px !important;
    width: 95% !important;
}

/* Step Navigation Bar in Project Workspace Modal */
.step-nav-bar {
    display: flex !important;
    gap: 8px !important;
    background: #0F172A !important;
    padding: 12px 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    overflow-x: auto !important;
}

.step-nav-btn {
    flex: 1 1 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: #94A3B8 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 12px 12px !important;
    border-radius: 8px !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.step-nav-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #F8FAFC;
    border-color: rgba(255, 255, 255, 0.25);
}

.step-nav-btn.active {
    background: #0284C7;
    color: #FFFFFF;
    border-color: #38BDF8;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.step-num {
    background: rgba(0, 0, 0, 0.35);
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.step-badge {
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.step-nav-btn.active .step-badge {
    background: rgba(255, 255, 255, 0.35);
    color: #FFF;
}

/* Clients Grid & Cards */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.client-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.client-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: #CBD5E1;
}

.client-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.client-card-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0F172A;
}

.client-meta-row {
    font-size: 0.85rem;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.client-projects-box {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #E2E8F0;
}

.client-project-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #F1F5F9;
    color: #0F172A;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    margin: 3px;
    cursor: pointer;
    border: 1px solid #CBD5E1;
}

.client-project-pill:hover {
    background: #0284C7;
    color: #FFF;
    border-color: #0284C7;
}

/* Step Upload Box */
.step-upload-box {
    background: #FFFFFF;
    border: 2px dashed #CBD5E1;
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.step-upload-box:hover {
    border-color: #0284C7;
    background: #F0F9FF;
}

/* Ratio Comparison Table */
.ratio-comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.ratio-comparison-table th {
    background: #0F172A;
    color: #F8FAFC;
    padding: 12px 16px;
    font-size: 0.82rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.ratio-comparison-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #E2E8F0;
    font-size: 0.9rem;
}

.ratio-badge-exact {
    background: #DCFCE7;
    color: #15803D;
    border: 1px solid #86EFAC;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
}

.ratio-badge-over {
    background: #FEE2E2;
    color: #B91C1C;
    border: 1px solid #FCA5A5;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
}

.ratio-badge-under {
    background: #E0E7FF;
    color: #4338CA;
    border: 1px solid #C7D2FE;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
}

/* Lot Badges */
.lot-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}
.lot-maconnerie { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.lot-electricite { background: #E0F2FE; color: #0369A1; border: 1px solid #BAE6FD; }
.lot-placo { background: #F3E8FF; color: #6B21A8; border: 1px solid #E9D5FF; }
.lot-plomberie { background: #CCFBF1; color: #0F766E; border: 1px solid #99F6E4; }
.lot-cvc { background: #FFE4E6; color: #BE123C; border: 1px solid #FECDD3; }
.lot-menuiseries { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.lot-sols { background: #FFFBEB; color: #78350F; border: 1px solid #FDE68A; }
.lot-peinture { background: #F1F5F9; color: #334155; border: 1px solid #CBD5E1; }
.lot-charpente { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }


/* ========================================================================== */
/* PLEINE LARGEUR ÉCRAN (FULL WIDTH RESPONSIVE)                               */
/* ========================================================================== */
main.main-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 24px 0 !important;
    box-sizing: border-box !important;
}

.card {
    width: 100% !important;
    box-sizing: border-box !important;
}

.file-list-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
}

.table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
}

#project-page-step-nav {
    width: 100% !important;
    box-sizing: border-box !important;
}


/* ==========================================================================
   WIDGETS CORPS DE MÉTIER (ÉTAPE 04 : DEVIS ARTISANS & RATIOS)
   ========================================================================== */
.trade-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.trade-widget-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.trade-widget-card:hover {
    border-color: #CBD5E1;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.trade-widget-header {
    padding: 14px 16px;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.trade-widget-title {
    font-weight: 700;
    font-size: 0.98rem;
    color: #0F172A;
    line-height: 1.3;
}

.trade-widget-desc {
    font-size: 0.76rem;
    color: #64748B;
    margin-top: 3px;
    line-height: 1.3;
}

.trade-widget-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.badge-has-artisan {
    background: #DCFCE7;
    color: #15803D;
    border: 1px solid #86EFAC;
}

.badge-pending-artisan {
    background: #FEF3C7;
    color: #B45309;
    border: 1px solid #FDE68A;
}

.trade-widget-ref-bar {
    padding: 8px 16px;
    background: #F1F5F9;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.trade-widget-body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.artisan-quote-card {
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 10px 12px;
    background: #FFFFFF;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.artisan-quote-card.selected {
    border: 2px solid #16A34A;
    background: #F0FDF4;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.12);
}

.artisan-quote-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.artisan-quote-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: #0F172A;
}

.artisan-quote-amount {
    font-weight: 800;
    font-size: 0.95rem;
    color: #0F172A;
}

.artisan-quote-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

.artisan-quote-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #CBD5E1;
}

.btn-select-artisan {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    color: #475569;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-select-artisan:hover {
    background: #E2E8F0;
    color: #0F172A;
}

.btn-select-artisan.active {
    background: #16A34A;
    border-color: #16A34A;
    color: #FFFFFF;
    font-weight: 700;
}

.trade-widget-footer {
    padding: 10px 16px;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-view-pdf {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1D4ED8;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-view-pdf:hover {
    background: #DBEAFE;
    color: #1E40AF;
}
