/* Gestion de factures - Style principal */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    /* Bannière (index) et menu gauche (dashboard) — modifier ici pour changer tout le design */
    --banner-bg: #e2e8f0;
    --banner-text: #475569;
    --banner-text-muted: #64748b;
    --banner-accent: #0ea5e9;
    --banner-accent-hover: #0284c7;
    --banner-border: rgba(0,0,0,0.08);
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

/* Auth pages */
body:not(.app-body) {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.auth-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-card-wide {
    max-width: 480px;
}

.auth-card h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
}

.auth-subtitle {
    color: var(--text-muted);
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
}

/* Message éphémère (flash) */
.flash-message {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    background: var(--success);
    color: white;
    border-radius: var(--radius);
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: flash-in 0.3s ease;
}
@keyframes flash-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.flash-message-alert {
    background: var(--warning);
}

/* Message de félicitations — vert pastel, chaleureux */
.flash-message-felicitation {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Message persistant (non éphémère) — pas de fixed/centrage, reste dans le flux */
.flash-message-persistent {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin-bottom: 1rem;
    z-index: auto;
    animation: none;
}

.flash-link {
    color: #047857;
    font-weight: 600;
    text-decoration: underline;
}
.flash-link:hover {
    color: #065f46;
}

/* Page de présentation (landing) - Esprit Tolteck */
.landing-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    width: 100%;
    min-width: 0;
}

.landing-page main {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

/* Header */
.landing-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-width: 0;
    z-index: 100;
    padding: 1rem 1.25rem;
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
    padding-top: max(1rem, env(safe-area-inset-top));
    background: var(--banner-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow-x: hidden;
    box-sizing: border-box;
}

.landing-nav {
    max-width: 100%;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow: hidden;
    box-sizing: border-box;
}

.landing-logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--banner-accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
    margin-left: 0.5rem;
}

.logo-img {
    height: 40px;
    width: auto;
}

.landing-menu {
    display: flex;
    gap: 2rem;
}

.landing-menu a {
    color: var(--banner-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
}

.landing-menu a:hover {
    color: var(--banner-accent);
}

.landing-menu a.active {
    color: var(--banner-accent);
    font-weight: 600;
}

.landing-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 1;
    min-width: 0;
}

.landing-actions a {
    color: var(--banner-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    white-space: nowrap;
}

.landing-actions a:hover {
    color: var(--banner-accent);
}

.landing-actions .btn-primary {
    padding: 0.5rem 1.25rem;
    font-size: 1.05rem;
    border-radius: 6px;
    color: #fff;
    background: var(--banner-accent);
}

.landing-actions .btn-primary:hover {
    background: var(--banner-accent-hover);
}

.landing-user {
    color: var(--banner-text);
    font-weight: 500;
    font-size: 1rem;
}

.banner-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    font-size: 1.2rem;
    text-decoration: none;
    color: var(--banner-text);
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.banner-icon:hover {
    background: rgba(0,0,0,.06);
    color: var(--banner-accent);
}

.banner-icon-text {
    width: auto;
    padding: 0 0.75rem;
    gap: 0.35rem;
    display: inline-flex;
}
.banner-icon-text i {
    font-size: 1rem;
}

.banner-logout {
    color: var(--danger) !important;
}
.banner-logout:hover {
    color: #b91c1c !important;
}

/* Hero */
.landing-hero {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 5.5rem 2rem 6rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('https://images.unsplash.com/photo-1497215842964-222b430dc094?w=1920') center center / cover no-repeat;
    filter: grayscale(80%);
    z-index: 0;
}

.landing-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.75) 0%, rgba(248,250,252,0.82) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.hero-badge {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    margin-bottom: 1.25rem;
    background: #dcfce7;
    color: #166534;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 20px;
}

.landing-hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1.25rem;
    color: #0f172a;
}

.hero-tagline-block {
    margin: 0 0 2rem;
}

.hero-tagline {
    font-size: 1.25rem;
    color: #475569;
    margin: 0 auto 1.5rem;
    line-height: 1.7;
    max-width: 700px;
}

.hero-arguments {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 2rem;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 0 0 1.25rem;
    text-align: left;
    font-size: 1.05rem;
    color: #475569;
    line-height: 1.6;
}

.hero-arguments li {
    margin-bottom: 0.25rem;
}

@media (max-width: 640px) {
    .hero-arguments {
        grid-template-columns: 1fr;
    }
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-hero-primary {
    display: inline-block;
    padding: 0.95rem 2rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    background: #0ea5e9;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-hero-primary:hover {
    background: #0284c7;
}

.btn-hero-secondary {
    display: inline-block;
    padding: 0.95rem 2rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: #0ea5e9;
    background: #fff;
    border: 2px solid #0ea5e9;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-hero-secondary:hover {
    background: #f0f9ff;
}

/* Sélection image hero (temporaire) */
.hero-image-picker {
    padding: 2rem 1rem;
    background: #f1f5f9;
    text-align: center;
}

.image-picker-title {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: #64748b;
}

.image-picker-subtitle {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

.image-picker-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.image-picker-btn {
    width: 120px;
    height: 80px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    transition: border-color 0.2s, transform 0.2s;
}

.image-picker-btn:hover {
    border-color: #0ea5e9;
    transform: scale(1.05);
}

.image-picker-hint {
    margin: 0;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Benefits - style Tolteck "Gagnez du temps" */
.landing-benefits {
    padding: 4rem 1rem;
    background: #fff;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.benefits-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.benefit-card {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    background: #f8fafc;
    transition: box-shadow 0.2s;
}

.benefit-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.benefit-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.benefit-card h3 {
    font-size: 1.25rem;
    margin: 0 0 0.75rem;
    color: #0f172a;
}

.benefit-card p {
    margin: 0;
    color: #64748b;
    line-height: 1.6;
    font-size: 0.95rem;
}

.benefit-card-free {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #22c55e;
    cursor: pointer;
}

.benefit-card-free:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

/* Modal popup */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal.modal-open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    background: #fff;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    color: #64748b;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.modal-content h3 {
    margin: 0 0 1rem;
    font-size: 1.35rem;
    color: #0f172a;
}

.modal-content p {
    margin: 0 0 1rem;
    color: #64748b;
    line-height: 1.6;
}

.modal-tarifs {
    margin: 1rem 0;
    padding-left: 1.5rem;
    color: #0f172a;
}

.modal-tarifs li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.modal-content .btn {
    display: inline-block;
    margin-top: 1rem;
}

/* Modal démo - même taille que les autres popups */
.modal-content-demo {
    max-width: 600px;
    width: 92%;
    max-height: 90vh;
    padding: 2.5rem 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content-demo .modal-close {
    z-index: 10;
}

.modal-iframe {
    width: 100%;
    height: 520px;
    border: none;
    display: block;
}

.features-free-note {
    margin: 0 0 1rem;
    color: #64748b;
    font-size: 0.95rem;
}

.usp-item p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
}

.usp-highlight h4 {
    color: #166534;
}

.final-cta-sub {
    margin: 0 0 1rem;
    color: #64748b;
    font-size: 1rem;
}

/* Features */
.landing-features {
    padding: 4rem 1rem;
    background: #f8fafc;
}

.landing-features h2 {
    text-align: center;
    margin: 0 0 3rem;
    font-size: 1.75rem;
    color: #0f172a;
}

.features-grid {
    max-width: 1400px;
    margin: 0 auto 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s, transform 0.2s;
}

.feature-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 2.25rem;
    display: block;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    color: #0f172a;
}

.feature-card p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
}

.features-cta {
    text-align: center;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* USP - Pourquoi utiliser */
.landing-usp {
    padding: 4rem 1rem;
    background: #fff;
}

.landing-usp h2 {
    text-align: center;
    margin: 0 0 2.5rem;
    font-size: 1.75rem;
    color: #0f172a;
}

.usp-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.usp-item {
    text-align: center;
    padding: 1.5rem;
}

.usp-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.usp-item h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #0f172a;
}

/* Final CTA */
.landing-final-cta {
    padding: 4rem 1rem;
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
}

.final-cta-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.landing-final-cta h2 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    color: #0f172a;
}

/* Footer — charte graphique (banner), pleine largeur comme la bannière */
.landing-footer {
    width: 100%;
    flex-shrink: 0;
    padding: 2rem 1rem;
    background: var(--banner-bg);
    border-top: 1px solid var(--banner-border);
    color: var(--banner-text);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-copy {
    margin: 0;
    font-size: 0.9rem;
    color: var(--banner-text-muted);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--banner-text);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--banner-accent);
}

/* Hamburger mobile */
.landing-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    color: var(--banner-text);
}
.landing-menu-toggle:hover {
    background: rgba(0,0,0,.06);
}
.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}
body.mobile-menu-open .landing-menu-toggle .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
body.mobile-menu-open .landing-menu-toggle .hamburger-line:nth-child(2) {
    opacity: 0;
}
body.mobile-menu-open .landing-menu-toggle .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}
body.mobile-menu-open {
    overflow: hidden;
}

/* Responsive landing - mobile-first breakpoints */
@media (max-width: 900px) {
    .landing-hero {
        padding: 5rem 1.25rem 4rem;
        min-height: auto;
    }
    .landing-hero h1 {
        font-size: 2rem;
    }
    .hero-tagline {
        font-size: 1.1rem;
    }
    .hero-arguments {
        grid-template-columns: 1fr;
        padding-left: 1rem;
    }
}

@media (max-width: 768px) {
    .landing-header {
        padding: 0.6rem 0.75rem;
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }
    .landing-nav {
        gap: 0.5rem;
    }
    .landing-menu-toggle {
        display: flex;
    }
    .landing-menu {
        position: fixed;
        top: 57px;
        left: 0;
        right: 0;
        background: var(--banner-bg);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        box-shadow: 0 4px 12px rgba(0,0,0,.1);
        z-index: 99;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.25s, opacity 0.25s, visibility 0.25s;
    }
    body.mobile-menu-open .landing-menu {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    .landing-menu a {
        display: block;
        padding: 0.9rem 0;
        border-bottom: 1px solid var(--banner-border);
        font-size: 1rem;
    }
    .landing-menu a:last-child {
        border-bottom: none;
    }
    .landing-actions {
        gap: 0.35rem;
    }
    .landing-actions a {
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
    }
    .landing-actions .btn-primary {
        padding: 0.45rem 0.7rem;
        font-size: 0.85rem;
    }
    .logo-img {
        height: 34px;
    }
    .landing-hero {
        padding: 4.5rem 1rem 3.5rem;
    }
    .landing-hero h1 {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }
    .hero-badge {
        font-size: 0.9rem;
        padding: 0.35rem 0.75rem;
    }
    .hero-tagline {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    .hero-arguments {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
    .hero-tagline-block {
        margin-bottom: 1.5rem;
    }
    .hero-cta {
        flex-direction: column;
        gap: 0.75rem;
    }
    .hero-cta .btn-hero-primary,
    .hero-cta .btn-hero-secondary {
        width: 100%;
        max-width: 320px;
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
        text-align: center;
    }
    .benefits-container {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        min-width: 0;
    }
    .landing-benefits {
        padding: 3rem 1rem;
    }
    .benefit-card {
        padding: 1.5rem;
    }
    .landing-features {
        padding: 3rem 1rem;
    }
    .landing-features h2 {
        font-size: 1.4rem;
        margin-bottom: 2rem;
    }
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    .feature-card {
        padding: 1.5rem;
    }
    .features-cta .btn-lg {
        width: 100%;
        max-width: 320px;
    }
    .landing-usp {
        padding: 3rem 1rem;
    }
    .landing-usp h2 {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }
    .usp-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .usp-item {
        padding: 1rem;
    }
    .usp-item h4 {
        font-size: 0.9rem;
    }
    .landing-final-cta {
        padding: 3rem 1rem;
    }
    .landing-final-cta h2 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }
    .final-cta-content .btn-hero-primary {
        width: 100%;
        max-width: 320px;
    }
    .landing-footer {
        padding: 1.5rem 1rem;
    }
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    .footer-links {
        justify-content: center;
    }
    .modal-content {
        width: 95%;
        max-height: 85vh;
        padding: 1.5rem;
        margin: 1rem;
    }
    .modal-content-demo {
        width: 95%;
        padding: 3rem 0.5rem 0.5rem;
    }
    .modal-iframe {
        height: 400px;
        min-height: 60vh;
    }
    .modal-close {
        width: 36px;
        height: 36px;
        top: 0.75rem;
        right: 0.75rem;
    }
}

@media (max-width: 480px) {
    .landing-hero h1 {
        font-size: 1.35rem;
    }
    .hero-arguments {
        font-size: 0.9rem;
        padding-left: 0.75rem;
    }
    .usp-grid {
        grid-template-columns: 1fr;
    }
    .landing-actions {
        gap: 0.35rem;
    }
    .landing-actions a {
        font-size: 0.85rem;
        padding: 0.35rem 0.5rem;
    }
    .landing-actions .btn-primary {
        padding: 0.45rem 0.75rem;
        font-size: 0.9rem;
    }
    .logo-img {
        height: 32px;
    }
}

/* App layout */
.app-body {
    display: flex;
    min-height: 100vh;
}

/* Avec bannière (landing-header) en haut */
/* Header au-dessus du sidebar pour que le bouton hamburger soit cliquable */
.app-with-banner .landing-header {
    z-index: 1000;
}
.app-with-banner .sidebar {
    top: 56px;
    height: calc(100vh - 56px);
}
.app-with-banner .sidebar-overlay {
    top: 56px;
}
.app-with-banner .main-content {
    margin-top: 56px;
    min-height: calc(100vh - 56px);
}

.sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    color: var(--banner-text);
    margin-right: 0.5rem;
}
.sidebar-toggle:hover {
    background: rgba(0,0,0,.06);
}
.sidebar-toggle .hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}
body.sidebar-open .sidebar-toggle .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
body.sidebar-open .sidebar-toggle .hamburger-line:nth-child(2) {
    opacity: 0;
}
body.sidebar-open .sidebar-toggle .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Afficher le hamburger sur mobile (pages app) */
@media (max-width: 768px) {
    .app-with-banner .sidebar-toggle {
        display: flex;
    }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.app-with-banner .sidebar-overlay {
    top: 56px;
}
body.sidebar-open .sidebar-overlay {
    display: block;
    opacity: 1;
    visibility: visible;
}

.sidebar {
    width: 260px;
    max-width: 85vw;
    background: var(--banner-bg);
    color: var(--banner-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 999;
    transition: transform 0.25s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--banner-border);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--banner-accent);
    letter-spacing: -0.02em;
}

.user-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
    padding: 0.25rem 0;
    color: var(--banner-text);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.user-block:hover {
    color: var(--banner-accent);
    background: rgba(0,0,0,.04);
}

.user-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 1.25rem 0;
    flex: 1;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #334155;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.nav-menu a:hover {
    background: rgba(0,0,0,.06);
    color: var(--banner-accent);
}

.nav-menu a.active {
    background: var(--banner-accent);
    color: white;
}

.sidebar-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--banner-border);
}

.btn-logout {
    color: #475569;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.btn-logout:hover {
    color: var(--banner-accent);
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    transition: margin-left 0.25s ease;
}

/* Fond pastel par page — Clients, Produits, Factures */
.app-body.page-clients .main-content {
    background: #eff6ff;
}

.app-body.page-produits .main-content {
    background: #ecfdf5;
}

.app-body.page-factures .main-content {
    background: #f5f3ff;
}

/* Page header */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.page-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
}

.page-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 0.5rem;
    color: var(--primary);
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-secondary:hover {
    background: #475569;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-trash {
    background: transparent !important;
    color: var(--danger);
    border: none;
}

.btn-trash:hover {
    background: transparent !important;
    color: #b91c1c;
}

/* Colonne Supprimer factures : poubelles même taille, grises, centrées */
.data-table .col-supprimer {
    display: flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}
.data-table .col-supprimer > a,
.data-table .col-supprimer > .icon-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0;
    vertical-align: middle;
}
.data-table .col-supprimer > a.btn-trash {
    padding: 0;
}
.data-table .col-supprimer .fa-trash {
    font-size: 1rem !important;
}
.data-table .col-supprimer .icon-disabled .fa-trash {
    color: var(--text-muted, #64748b);
}
.data-table .col-supprimer a.btn-trash .fa-trash {
    color: var(--danger);
}
.data-table .col-supprimer a.btn-trash:hover .fa-trash {
    color: #b91c1c;
}

.btn-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

/* Forms */
.form-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.form-card h3 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

/* Formulaire de recherche factures */
.search-form {
    margin-bottom: 1.5rem;
}

.search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    align-items: end;
}

.search-filters .form-group-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
}

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

/* Listes déroulantes Client et Produits (add devis) : plus visibles */
.select-prominent {
    font-size: 1.05rem !important;
    font-weight: 500;
    padding: 0.6rem 0.85rem !important;
    border: 2px solid var(--primary) !important;
    border-radius: 8px !important;
    background: #f0f7ff !important;
    color: var(--text);
    min-height: 2.75rem;
}
.select-prominent:focus {
    border-color: var(--primary-dark) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.25) !important;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem;
    font-size: 0.9rem;
    color: #64748b;
    cursor: pointer;
}

.form-checkbox input {
    width: auto;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.form-row .flex-1 {
    min-width: 0;
}

.flex-2 { flex: 2; min-width: 120px; }

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.form-actions-sticky {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-body, #fff);
    padding: 1rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.form-help {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: -0.5rem 0 1rem;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
}

.stat-card-line {
    white-space: nowrap;
}

.stat-card-line .stat-icon,
.stat-card-line .stat-value,
.stat-card-line .stat-label {
    display: inline;
}
.stat-card-line .stat-icon {
    margin-right: 0.25rem;
}
.stat-card-line .stat-value {
    margin-right: 0.25rem;
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-label {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-sublabel {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

.stat-card-line .stat-sublabel {
    display: block;
    white-space: normal;
    margin-top: 0.25rem;
}

.stat-link {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.stat-link:hover {
    color: var(--primary);
    opacity: 0.85;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 0.85rem;
}

.data-table tr:hover td {
    background: #fafafa;
}

.data-table .actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    white-space: nowrap;
    vertical-align: middle;
}

.data-table .actions .btn:not(.btn-trash) {
    margin-right: 0;
}

/* Poubelle rouge et grise : même taille, centrées verticalement */
.data-table .actions > a.btn-trash,
.data-table .actions > .icon-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0;
    vertical-align: middle;
}
.data-table .actions > a.btn-trash {
    padding: 0;
}
.data-table .actions .fa-trash {
    font-size: 1rem !important;
}
.data-table .actions .icon-disabled .fa-trash {
    color: var(--text-muted, #64748b);
}
.data-table .actions a.btn-trash .fa-trash {
    color: var(--danger);
}
.data-table .actions a.btn-trash:hover .fa-trash {
    color: #b91c1c;
}

.txt-right { text-align: right; }

.icon-disabled {
    display: inline-block;
    cursor: help;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.icon-disabled:hover {
    opacity: 1;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

.badge-devis { background: #fef3c7; color: #92400e; }
.badge-devis-envoye { background: #fff; color: #1eaf51; }
.col-envoi-mail--envoye { background: #fff !important; }
.col-envoi-mail--envoye .badge-devis-envoye { color: #166534; }
.badge-facture { background: #dbeafe; color: #1e40af; }
.badge-facture-non-reglee { background: #fee2e2 !important; color: #991b1b !important; }
.badge-facture-reglee { background: #dcfce7 !important; color: #166534 !important; }
.data-table .badge-facture-non-reglee,
.data-table .badge-facture-reglee { display: inline-block; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.85em; }
.badge-en_attente { background: #e2e8f0; color: #475569; }
.badge-a_regler { background: #e2e8f0; color: #475569; }
.badge-envoyee { background: #dbeafe; color: #1e40af; }
.badge-payee { background: #d1fae5; color: #065f46; }
.badge-annulee { background: #fee2e2; color: #991b1b; }
.inline-form { display: inline; }
.inline-form .btn-link { background: none; border: none; padding: 0; cursor: pointer; font: inherit; }
.badge-clickable { text-decoration: none; cursor: pointer; transition: opacity 0.15s; }
.badge-clickable:hover { opacity: 0.85; text-decoration: underline; }
.badge-lien-transform { background: none !important; color: var(--color-primary, #2563eb); }
.badge-lien-transform:hover { color: var(--color-primary-dark, #1d4ed8); }

.statut-cell .statut-select {
    cursor: pointer;
    border: none;
    font-size: inherit;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    min-width: 120px;
}
.statut-cell .statut-select:focus {
    outline: none;
}

.btn-disabled, .btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #94a3b8 !important;
    color: #fff !important;
    border: none;
}

/* Empty state */
.empty-state,
.empty-state-card {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-state p,
.empty-state-card p {
    margin: 0 0 1rem;
    color: var(--text-muted);
}

.content-section h2 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
}

.dashboard-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}
.dashboard-link-list li {
    margin: 0;
}
.dashboard-link-list a {
    display: block;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s;
}
.dashboard-link-list a:hover {
    background: var(--bg-hover, #f1f5f9);
    border-color: var(--banner-bg, #0f172a);
}

.dashboard-explain { margin-bottom: 1.5rem; }
.dashboard-explain h3 { margin: 0 0 0.75rem; font-size: 1.1rem; }
.dashboard-explain > p { margin: 0 0 1rem; line-height: 1.5; }
.dashboard-tips { list-style: none; margin: 0; padding: 0; }
.dashboard-tips li {
    margin: 0 0 1.25rem;
    padding-left: 1.75rem;
    position: relative;
    line-height: 1.45;
}
.dashboard-tips li:last-child { margin-bottom: 0; }
.dashboard-tips li i {
    position: absolute;
    left: 0;
    top: 0.15rem;
    color: var(--primary);
    width: 1.25rem;
    text-align: center;
}

.mt-1 { margin-top: 1rem; }

.pagination-more {
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.pagination-more .btn { flex-shrink: 0; }
.pagination-info {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Logo section dashboard */
.logo-section {
    margin-bottom: 1.5rem;
}

.logo-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.logo-thumb {
    max-width: 120px;
    max-height: 80px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.logo-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.logo-form input[type="file"] {
    font-size: 0.9rem;
}

/* Facture lines */
.ligne-facture {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 6px;
}

.ligne-row {
    display: grid;
    grid-template-columns: 220px 90px 1fr 80px 100px 70px 90px 40px;
    gap: 0.75rem;
    align-items: end;
}

@media (max-width: 900px) {
    .ligne-row {
        grid-template-columns: 1fr 80px 100px;
    }
    .ligne-produit { grid-column: 1 / -1; }
    .ligne-ref { grid-column: 1 / -1; }
    .ligne-desc { grid-column: 1 / -1; }
}

.ligne-total-ht {
    font-weight: 600;
}

.ligne-save-as-product {
    margin-top: 0.5rem;
}

/* Facture totals */
.facture-totaux {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    max-width: 280px;
    margin-left: auto;
}

.facture-totaux-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    max-width: none;
    align-items: baseline;
    width: fit-content;
    margin-left: auto;
    margin-right: 0;
}

.facture-totaux-inline .total-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.facture-totaux-inline .total-label {
    color: var(--text-muted, #64748b);
    font-size: 0.95rem;
}

.facture-totaux-inline .total-item-ttc {
    font-size: 1.15rem;
    font-weight: 700;
}

.facture-totaux-inline .total-item-ttc .total-label {
    color: var(--text);
    font-size: 1rem;
}

.facture-totaux-view {
    margin-left: 0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
}

.total-row.total-ttc {
    font-size: 1.15rem;
    font-weight: 700;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--border);
}

/* Facture view */
.facture-view {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: left;
}

/* Bannière émetteur (logo + infos user) en haut à gauche */
.facture-banner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border);
}

.facture-banner-logo {
    flex-shrink: 0;
}

.facture-banner-logo .logo-facture,
.facture-logo .logo-facture {
    max-width: 140px;
    max-height: 70px;
    object-fit: contain;
}

.facture-banner-info {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Bloc client : centré sur les 50 % à droite, texte justifié à gauche */
.facture-client-block {
    width: 50%;
    margin-left: 50%;
    margin-bottom: 1.5rem;
    padding: 0.75rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: left;
}

.facture-client-block strong {
    display: block;
    margin-bottom: 0.25rem;
}

.facture-infos {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.info-row span:first-child {
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.facture-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.facture-table th,
.facture-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.facture-table th {
    background: linear-gradient(180deg, #e8f4fc 0%, #dbeafe 100%);
    color: #1e40af;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-bottom: 2px solid #93c5fd;
}

.facture-table tbody tr:nth-child(even) {
    background: #f1f5f9;
}

.facture-table tbody tr:nth-child(odd) {
    background: #fff;
}

.facture-table tbody tr:hover {
    background: #e2e8f0;
}

.facture-note {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.facture-legal {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.facture-legal p {
    margin: 0.35rem 0;
}

.facture-legal p:first-child {
    margin-bottom: 0.5rem;
}

/* Impression facture */
@media print {
    @page {
        margin: 10mm;
    }
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
        display: block !important;
    }
    body {
        padding-top: 0 !important;
    }
    .sidebar,
    .page-header,
    .header-actions,
    .btn,
    .back-link {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .facture-view {
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0 !important;
        position: relative !important;
        top: 0 !important;
    }
    .facture-infos {
        margin-top: 4rem !important;
    }
    .facture-table th,
    .facture-table tbody tr:nth-child(even) {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .facture-view {
        padding-bottom: 100px;
    }
    .facture-legal {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        padding: 0.75rem 10mm;
        border-top: 1px solid #ccc;
        background: #fff;
        color: #374151;
        font-size: 0.65rem;
        line-height: 1.4;
    }
    .facture-legal p {
        margin: 0.2rem 0;
    }
}
/* ===========================
   PATCH MOBILE / RESPONSIVE
   À ajouter en FIN de fichier
   =========================== */

/* 1) Base mobile friendliness */
html {
    -webkit-text-size-adjust: 100%;
  }
  
  body {
    overflow-x: hidden;
  }
  
  img, svg, video, canvas {
    max-width: 100%;
    height: auto;
  }
  
  /* Evite le zoom iOS sur inputs (<16px) */
  input, select, textarea, button {
    font-size: 16px;
  }
  
  /* Safe areas (iPhone notch) */
  .landing-header,
  .landing-final-cta,
  .landing-footer,
  .landing-hero,
  .landing-benefits,
  .landing-features,
  .landing-usp {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  
  /* 2) Header fixed + offsets robustes
     On définit une hauteur de header via variable,
     et on l'utilise pour le menu et le hero.
  */
  :root {
    --landing-header-h: 72px;
  }
  
  /* Ajuste la hauteur réelle du header (desktop) */
  .landing-header {
    min-height: var(--landing-header-h);
  }
  
  /* Le hero ne doit pas passer sous le header fixed */
  .landing-hero {
    padding-top: calc(var(--landing-header-h) + 2.5rem);
  }
  
  /* Menu mobile : ne pas utiliser "57px" fixe */
  @media (max-width: 768px) {
    :root { --landing-header-h: 56px; }
  
    .landing-header {
      min-height: var(--landing-header-h);
    }
  
    .landing-menu {
      top: var(--landing-header-h);
    }
  }
  
  /* 3) Hero : éviter les pièges de 100vh sur iOS */
  .landing-hero {
    min-height: 100svh; /* stable viewport height (iOS récent) */
  }
  @supports not (height: 100svh) {
    .landing-hero { min-height: 100vh; }
  }
  
  /* 4) Navigation : éviter les débordements */
  .landing-nav {
    overflow: visible;
  }
  
  .landing-actions a,
  .landing-menu a {
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Sur très petits écrans, le header peut être trop serré */
  @media (max-width: 420px) {
    .landing-actions {
      gap: 0.25rem;
    }
    .landing-actions a {
      font-size: 0.82rem;
      padding: 0.3rem 0.45rem;
    }
    .landing-actions .btn-primary {
      padding: 0.4rem 0.6rem;
    }
  }
  
  /* 5) Listes du hero : éviter débordements et améliorer lisibilité */
  .hero-arguments {
    padding-left: 1.25rem;
    word-break: break-word;
  }
  .hero-tagline {
    word-break: break-word;
  }
  
  /* 6) Grilles : sécuriser les min-width (cause fréquente d’overflow) */
  .features-grid,
  .benefits-container,
  .usp-grid {
    min-width: 0;
  }
  .feature-card,
  .benefit-card,
  .usp-item {
    min-width: 0;
  }
  
  /* 7) Modales : mobile UX + scroll + safe area */
  body.modal-open {
    overflow: hidden;
  }
  
  /* (Tu ouvres/fermes via class sur la modal, pas sur body,
     mais on gère le cas si tu l'ajoutes plus tard) */
  
  .modal {
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
             max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  }
  
  /* La modale ne doit jamais dépasser l'écran */
  .modal-content {
    width: min(520px, 100%);
    max-height: min(90svh, 90vh);
  }
  
  /* iFrame démo : hauteur responsive, pas figée */
  .modal-iframe {
    height: min(70svh, 520px);
  }
  @media (max-width: 768px) {
    .modal-iframe {
      height: 70svh;
      min-height: 420px;
    }
  }
  @media (max-width: 420px) {
    .modal-iframe {
      height: 72svh;
      min-height: 360px;
    }
  }
  
  /* 8) Boutons : confort tactile */
  .btn,
  .btn-hero-primary,
  .btn-hero-secondary,
  .landing-actions a,
  .landing-menu a {
    touch-action: manipulation;
  }
  
  /* 9) Fix overflow rares (iphone/safari) */
  .landing-page,
  .landing-page main,
  .hero-content {
    max-width: 100%;
  }
  
  /* 10) Amélioration perf: background hero (évite repaint lourd sur mobile) */
  @media (max-width: 768px) {
    .landing-hero::before {
      filter: grayscale(70%);
    }
  }
  /* ==============================
   TABLE FACTURES -> MOBILE CARDS
   ============================== */

.table-responsive {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Desktop: tableau normal (rien à faire) */
  
  @media (max-width: 768px) {
    /* Sidebar mobile */
    .sidebar-toggle {
      display: flex;
    }
    .sidebar {
      transform: translateX(-100%);
      top: 56px;
      height: calc(100vh - 56px);
    }
    body.sidebar-open .sidebar {
      transform: translateX(0);
    }
    .main-content {
      margin-left: 0;
      padding: 1rem;
    }
    body.sidebar-open {
      overflow: hidden;
    }
  
    /* Le tableau devient une liste de cartes */
    .data-table,
    .data-table thead,
    .data-table tbody,
    .data-table th,
    .data-table tr,
    .data-table td {
      display: block;
      width: 100%;
    }
  
    /* On cache l'en-tête (les data-label le remplacent) */
    .data-table thead {
      display: none;
    }
  
    /* Chaque ligne = une carte */
    .data-table tr {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 12px;
      box-shadow: var(--shadow);
      padding: 0.75rem 0.75rem;
      margin-bottom: 0.75rem;
    }
  
    /* Chaque cellule = ligne "label : valeur" */
    .data-table td {
      border: none;
      padding: 0.45rem 0;
      display: grid;
      grid-template-columns: 140px 1fr;
      gap: 0.75rem;
      align-items: center;
      text-align: left;
      min-width: 0;
      word-break: break-word;
    }
  
    .data-table td::before {
      content: attr(data-label);
      font-weight: 600;
      color: var(--text-muted);
      font-size: 0.85rem;
    }
  
    /* Colonnes d'actions: alignées à droite */
    .data-table td.txt-right {
      text-align: left; /* on repasse à gauche pour la lisibilité */
    }
  
    /* Boutons plus “touch friendly” */
    .data-table .btn.btn-sm {
      padding: 0.5rem 0.75rem;
      font-size: 0.9rem;
    }
  
    /* Badges : éviter qu'ils débordent */
    .badge {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      max-width: 100%;
      white-space: normal;
    }
  
    /* Ligne Statut: autoriser le wrap */
    .statut-cell {
      overflow: hidden;
    }
  
    /* Option : rendre les 2-3 infos clés plus visibles */
    .data-table td[data-label="N°"] strong {
      font-size: 1.05rem;
    }
  
    /* Envoyé par mail : boutons plein largeur si besoin */
    .col-envoi-mail .btn {
      width: 100%;
      text-align: center;
    }
  }
  
  @media (max-width: 420px) {
    .data-table td {
      grid-template-columns: 120px 1fr;
    }
  }
  