/* =====================================================================
   EDIT - Feuille de style (mobile d'abord)
   Couleurs de la marque : marine #0E1F3D, orange #F2A93B
   ===================================================================== */
:root {
    --navy: #0E1F3D;
    --navy-2: #16305c;
    --navy-3: #1f3f78;
    --orange: #F2A93B;
    --orange-d: #d98d1c;
    --ink: #13213b;
    --muted: #5d6b82;
    --line: #e3e8f0;
    --soft: #f4f6fa;
    --radius: 16px;
    --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-primary: #1f3f78;
    --bs-primary-rgb: 31, 63, 120;
    --bs-link-color: #1f3f78;
    --bs-link-color-rgb: 31, 63, 120;
}

body { color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .fw-800 { font-weight: 800; letter-spacing: -0.02em; }
a { color: var(--navy-3); }
.bg-soft { background: var(--soft) !important; }
.text-orange { color: var(--orange-d) !important; }
.text-navy { color: var(--navy) !important; }
.bg-orange { background: var(--orange) !important; color: var(--navy) !important; }
.bg-purple { background: #6f42c1 !important; }
.small-caps { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); }

/* Boutons */
.btn { border-radius: 12px; font-weight: 600; }
.btn-brand { background: var(--orange); color: var(--navy); border: 0; }
.btn-brand:hover, .btn-brand:focus { background: var(--orange-d); color: var(--navy); }
.btn-navy { background: var(--navy); color: #fff; border: 0; }
.btn-navy:hover, .btn-navy:focus { background: var(--navy-2); color: #fff; }
.btn-outline-brand { border: 1.5px solid var(--navy); color: var(--navy); background: transparent; }
.btn-outline-brand:hover { background: var(--navy); color: #fff; }
.btn-wa { background: #25D366; color: #fff; border: 0; }
.btn-wa:hover { background: #1ebe5a; color: #fff; }
.btn-lg { padding: .8rem 1.25rem; }

/* Formulaires */
.form-control, .form-select { border-radius: 12px; padding: .7rem .9rem; border-color: #d4dbe6; font-size: 1rem; }
.form-control:focus, .form-select:focus { border-color: var(--navy-3); box-shadow: 0 0 0 .2rem rgba(31, 63, 120, .15); }
.form-label { font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.choice-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn-choice { border: 1.5px solid #d4dbe6; background: #fff; color: var(--ink); font-weight: 500; padding: .55rem .85rem; border-radius: 999px; }
.btn-check:checked + .btn-choice { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-check:focus-visible + .btn-choice { box-shadow: 0 0 0 .2rem rgba(242, 169, 59, .5); }
.more-fields summary { cursor: pointer; color: var(--navy-3); font-weight: 600; }
.account-box { background: #fff8ec; border: 1px dashed var(--orange); border-radius: 14px; padding: .9rem 1rem; }

/* Navigation */
.site-nav { background: #fff; border-bottom: 1px solid var(--line); }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-sub { font-size: .72rem; color: var(--muted); max-width: 190px; line-height: 1.2; border-left: 1px solid var(--line); padding-left: .6rem; }
.site-nav .nav-link { font-weight: 600; color: var(--ink); border-radius: 10px; padding: .55rem .8rem !important; }
.site-nav .nav-link.active, .site-nav .nav-link:hover { color: var(--navy-3); background: var(--soft); }
@media (min-width: 992px) {
    .site-nav .offcanvas { visibility: visible; position: static; transform: none; border: 0; background: transparent; flex-grow: 1; }
    .site-nav .offcanvas-header { display: none; }
    .site-nav .offcanvas-body { display: flex; padding: 0; }
}

/* Héros */
.hero {
    position: relative; overflow: hidden; color: #fff;
    background: radial-gradient(1200px 500px at 110% -10%, rgba(242, 169, 59, .28), transparent 60%),
                linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 70%, var(--navy-3) 100%);
    padding: 2.5rem 0 5.5rem;
}
.hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .14;
    background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 0); background-size: 22px 22px;
    mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(1.75rem, 6vw, 3rem); line-height: 1.1; }
.hero .lead { color: rgba(255, 255, 255, .82); font-size: 1.05rem; }
.hero-chip { display: inline-flex; align-items: center; gap: .4rem; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); color: #fff; border-radius: 999px; padding: .3rem .8rem; font-size: .8rem; font-weight: 600; }
.hero-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(242, 169, 59, .25); }

/* Rubriques (tuiles cliquables) */
.rubriques-wrap { margin-top: -4rem; position: relative; z-index: 2; }
.rubrique-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 768px) { .rubrique-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; } }
@media (min-width: 1200px) { .rubrique-grid { grid-template-columns: repeat(5, 1fr); } }
.rubrique-tile {
    display: flex; flex-direction: column; gap: .5rem; height: 100%;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1rem; text-decoration: none; color: var(--ink);
    box-shadow: 0 6px 24px rgba(14, 31, 61, .08); transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.rubrique-tile:hover, .rubrique-tile:focus { transform: translateY(-3px); border-color: var(--orange); box-shadow: 0 10px 30px rgba(14, 31, 61, .14); color: var(--ink); }
.rubrique-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--navy-3); font-size: 1.35rem; }
.rubrique-tile:hover .rubrique-icon { background: var(--orange); color: var(--navy); }
.rubrique-tile h3 { font-size: .98rem; margin: 0; line-height: 1.25; }
.rubrique-tile p { font-size: .8rem; color: var(--muted); margin: 0; line-height: 1.35; }
.rubrique-tile .go { margin-top: auto; font-size: .8rem; font-weight: 700; color: var(--navy-3); }

/* Sections */
.section { padding: 3.5rem 0; }
.section-title { font-size: clamp(1.4rem, 4vw, 2rem); }
.card-soft { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 18px rgba(14, 31, 61, .05); }
.step-num { width: 38px; height: 38px; border-radius: 50%; background: var(--orange); color: var(--navy); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.stat-big { font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1; }

/* Cartes logiciels / réalisations */
.cover { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; background: var(--soft); }
.cover-placeholder { aspect-ratio: 16 / 10; border-radius: var(--radius) var(--radius) 0 0; display: grid; place-items: center; font-size: 2.6rem; color: rgba(255, 255, 255, .9);
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 100%); }
.item-card { overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.item-card .body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .4rem; flex-grow: 1; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding-left: 1.5rem; margin-bottom: .35rem; font-size: .92rem; }
.check-list li::before { content: "\F26E"; font-family: "bootstrap-icons"; position: absolute; left: 0; top: 0; color: var(--orange-d); }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
@media (min-width: 768px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery img, .gallery video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: #000; }
.ratio iframe { border-radius: 12px; }

/* Page formulaire de rubrique */
.form-hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 1.75rem 0 4.5rem; }
.form-hero .rubrique-icon { background: rgba(255, 255, 255, .12); color: var(--orange); }
.form-card { margin-top: -3.5rem; position: relative; z-index: 2; }
.form-section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--muted); margin: 0 0 .75rem; }

/* Pied de page */
.site-footer { background: var(--navy); color: #fff; padding-bottom: 4rem; }
.footer-logo { height: 34px; width: auto; }
.footer-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--orange); }
.footer-links a { color: rgba(255, 255, 255, .8); text-decoration: none; display: inline-block; padding: .2rem 0; }
.footer-links a:hover { color: #fff; }
.wa-float { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; background: #25D366; color: #fff; display: grid; place-items: center; font-size: 1.6rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); z-index: 1030; text-decoration: none; }
.wa-float:hover { color: #fff; transform: scale(1.05); }

/* Fil de suivi (messages) */
.thread { display: flex; flex-direction: column; gap: .6rem; }
.msg { max-width: 88%; padding: .6rem .85rem; border-radius: 14px; font-size: .93rem; }
.msg .meta { font-size: .72rem; opacity: .75; margin-top: .25rem; }
.msg.client { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.msg.staff { align-self: flex-start; background: var(--soft); border-bottom-left-radius: 4px; }
.msg.internal { align-self: flex-start; background: #fff8ec; border: 1px dashed var(--orange); }
.msg.system { align-self: center; background: transparent; color: var(--muted); font-size: .8rem; text-align: center; padding: .2rem; }

/* =====================================================================
   Espace collaborateurs
   ===================================================================== */
.staff-body { background: var(--soft); padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (min-width: 992px) { .staff-body { padding-bottom: 0; } }
.staff-top { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 1020; }
.staff-top .brand-logo { height: 26px; }
.staff-top a { color: #fff; }
.staff-side { background: #fff; border-right: 1px solid var(--line); min-height: calc(100vh - 56px); position: sticky; top: 56px; }
.staff-side .nav-link { color: var(--ink); font-weight: 600; border-radius: 10px; padding: .55rem .75rem; display: flex; align-items: center; gap: .6rem; }
.staff-side .nav-link:hover { background: var(--soft); }
.staff-side .nav-link.active { background: var(--navy); color: #fff; }
.staff-side .nav-link .badge { margin-left: auto; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 1030; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { flex: 1; text-align: center; padding: .5rem 0 .45rem; color: var(--muted); text-decoration: none; font-size: .68rem; font-weight: 600; position: relative; }
.bottom-nav a i { display: block; font-size: 1.3rem; line-height: 1.2; }
.bottom-nav a.active { color: var(--navy); }
.bottom-nav a.active i { color: var(--orange-d); }
.bottom-nav .dot-count { position: absolute; top: 4px; left: 54%; background: #dc3545; color: #fff; border-radius: 999px; font-size: .62rem; padding: 0 .35rem; line-height: 1.3; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; height: 100%; display: block; text-decoration: none; color: var(--ink); }
.kpi .n { font-size: 1.6rem; font-weight: 800; line-height: 1.1; color: var(--navy); }
.kpi .l { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kpi.alert-kpi { border-color: var(--orange); background: #fff8ec; }
.list-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.list-row { display: block; padding: .85rem 1rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: #fafbfd; color: var(--ink); }
.list-row .t { font-weight: 700; }
.list-row .s { font-size: .82rem; color: var(--muted); }
.filters { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .btn { white-space: nowrap; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy-3); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.share-link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; background: var(--soft); border-radius: 8px; padding: .4rem .6rem; word-break: break-all; }
.table-clean { font-size: .9rem; }
.table-clean th { font-size: .75rem; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: .35rem .75rem; font-size: .92rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; word-break: break-word; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.empty i { font-size: 2.2rem; display: block; margin-bottom: .5rem; color: #b9c3d3; }

/* Tuiles plus compactes sur petit écran */
@media (max-width: 575.98px) {
    .rubrique-tile { padding: .8rem; gap: .35rem; }
    .rubrique-tile h3 { font-size: .92rem; }
    .rubrique-tile p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .76rem; }
    .rubrique-tile .go { display: none; }
    .rubrique-icon { width: 38px; height: 38px; font-size: 1.15rem; }
    .rubriques-wrap .card-soft { padding: .75rem !important; }
}
.site-nav .nav-link, .site-nav .btn { white-space: nowrap; }
@media (min-width: 992px) and (max-width: 1199.98px) { .site-nav .nav-link { padding: .5rem .5rem !important; font-size: .92rem; } }
.h5, .h6, h5, h6 { font-weight: 700; }

/* Mot du Directeur Général */
.dg-card { border-left: 4px solid var(--orange); }
.dg-photo { width: 180px; height: 180px; object-fit: cover; object-position: center 20%; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 8px 24px rgba(14, 31, 61, .18); }
.dg-quote { font-size: 1.02rem; line-height: 1.6; color: var(--ink); position: relative; padding-left: 1.6rem; }
.dg-quote::before { content: "\201C"; position: absolute; left: 0; top: -.6rem; font-size: 3rem; line-height: 1; color: var(--orange); font-weight: 800; }

/* Œil des mots de passe */
.pwd-wrap { position: relative; }
.pwd-wrap .form-control { padding-right: 2.8rem; }
.pwd-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); width: 2.4rem; height: 2.4rem; border-radius: 10px; font-size: 1.1rem; }
.pwd-eye:hover, .pwd-eye:focus-visible { color: var(--navy); background: var(--soft); }
.install-tip { font-size: .85rem; background: #fff8ec; border: 1px dashed var(--orange); border-radius: 12px; padding: .75rem; }

/* Discussions */
.chat-wrap { max-width: 860px; margin: 0 auto; }
.chat-head { position: sticky; top: 56px; z-index: 5; background: var(--soft); padding: .4rem 0 .6rem; border-bottom: 1px solid var(--line); }
.chat-thread { padding: 1rem 0 1rem; min-height: 50vh; }
.chat-input { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); display: flex; gap: .5rem; align-items: flex-end; background: var(--soft); padding: .6rem 0; }
@media (min-width: 992px) { .chat-input { bottom: 0; } }
.chat-input textarea { resize: none; border-radius: 22px; padding: .6rem 1rem; max-height: 140px; }
.chat-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; padding: 0; flex-shrink: 0; font-size: 1.1rem; }
.msg-photo { display: block; max-width: 240px; max-height: 260px; border-radius: 10px; margin-bottom: .3rem; object-fit: cover; }
