/* Laura – charte graphique Les Techniciens (V1.2)
   Bleu foncé #1C4374 (confiance, fiabilité) · Framboise #D0004F (engagement, organisation)
   Titres : capitales condensées très espacées (logotype) · Signature : écriture manuscrite */

:root,
[data-bs-theme="light"] {
    --lt-blue: #1C4374;
    --lt-blue-hover: #163660;
    --lt-blue-deep: #142a4c;        /* « fond bleu foncé » des motifs et supports */
    --lt-raspberry: #D0004F;
    --lt-raspberry-hover: #b00043;
    --lt-blue-soft: #e9eef5;
    --lt-raspberry-soft: #fbe6ee;
    --app-surface: #ffffff;
    --app-bg: #f5f6f8;
    --app-border: #e2e6ec;
    --app-ink: #1d2433;

    --bs-body-font-family: "Lato", "Gill Sans", "Gill Sans MT", "Segoe UI", system-ui, sans-serif;
    --bs-body-color: var(--app-ink);
    --bs-body-bg: var(--app-bg);
    --bs-primary: var(--lt-blue);
    --bs-primary-rgb: 28, 67, 116;
    --bs-link-color: var(--lt-blue);
    --bs-link-color-rgb: 28, 67, 116;
    --bs-link-hover-color: var(--lt-raspberry);
    --bs-link-hover-color-rgb: 208, 0, 79;
    --bs-border-radius: .6rem;
    --bs-focus-ring-color: rgba(28, 67, 116, .25);
}
[data-bs-theme="dark"] {
    --lt-blue: #7fa6d9;             /* bleu éclairci pour rester lisible sur fond sombre */
    --lt-blue-hover: #a3c0e6;
    --lt-blue-deep: #0d1a2e;
    --lt-raspberry: #ff3d7f;
    --lt-raspberry-hover: #ff6b9b;
    --lt-blue-soft: #18263b;
    --lt-raspberry-soft: #3a1626;
    --app-surface: #142033;
    --app-bg: #0d1726;
    --app-border: #24344c;
    --app-ink: #e7ecf3;

    --bs-body-color: var(--app-ink);
    --bs-body-bg: var(--app-bg);
    --bs-primary: var(--lt-blue);
    --bs-primary-rgb: 127, 166, 217;
    --bs-link-color: var(--lt-blue);
    --bs-link-color-rgb: 127, 166, 217;
    --bs-link-hover-color: var(--lt-raspberry);
}

body { background: var(--app-bg); -webkit-font-smoothing: antialiased; }

/* Typographie de marque */
.lt-wordmark {
    font-family: "Saira Extra Condensed", "Arial Narrow", sans-serif;
    font-weight: 500; text-transform: uppercase; letter-spacing: .32em;
}
.lt-signature { font-family: "Caveat", "Bradley Hand", cursive; color: var(--lt-raspberry); font-size: 1.35rem; line-height: 1; }
h1, .h1, h2, .h2, h3, .h3, h4, .h4 { color: var(--lt-blue); font-weight: 700; }
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] .h4, [data-bs-theme="dark"] h4 { color: var(--app-ink); }

/* Boutons */
.btn-primary {
    --bs-btn-bg: var(--lt-blue); --bs-btn-border-color: var(--lt-blue); --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--lt-blue-hover); --bs-btn-hover-border-color: var(--lt-blue-hover); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--lt-blue-hover); --bs-btn-active-border-color: var(--lt-blue-hover);
    --bs-btn-disabled-bg: var(--lt-blue); --bs-btn-disabled-border-color: var(--lt-blue);
}
.btn-accent {
    --bs-btn-bg: var(--lt-raspberry); --bs-btn-border-color: var(--lt-raspberry); --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--lt-raspberry-hover); --bs-btn-hover-border-color: var(--lt-raspberry-hover); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--lt-raspberry-hover); --bs-btn-active-border-color: var(--lt-raspberry-hover); --bs-btn-active-color: #fff;
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0d1726; --bs-btn-hover-color: #0d1726; }
.btn-outline-primary {
    --bs-btn-color: var(--lt-blue); --bs-btn-border-color: var(--lt-blue);
    --bs-btn-hover-bg: var(--lt-blue); --bs-btn-hover-border-color: var(--lt-blue); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--lt-blue); --bs-btn-active-border-color: var(--lt-blue); --bs-btn-active-color: #fff;
}
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-hover-color: #0d1726; --bs-btn-active-color: #0d1726; }
.btn-check:checked + .btn-outline-primary { background: var(--lt-blue); border-color: var(--lt-blue); color: #fff; }
[data-bs-theme="dark"] .btn-check:checked + .btn-outline-primary { color: #0d1726; }
.form-control:focus, .form-select:focus { border-color: var(--lt-blue); }
.form-check-input:checked { background-color: var(--lt-blue); border-color: var(--lt-blue); }
.page-link { color: var(--lt-blue); }
.active > .page-link, .page-link.active { background: var(--lt-blue); border-color: var(--lt-blue); }
.badge.text-bg-primary { background: var(--lt-raspberry) !important; color: #fff !important; }

.nav-pills { --bs-nav-pills-link-active-bg: var(--lt-blue); --bs-nav-link-color: var(--lt-blue); --bs-nav-link-hover-color: var(--lt-raspberry); }
[data-bs-theme="dark"] .nav-pills { --bs-nav-pills-link-active-color: #0d1726; }
/* Onglets de l'administration : tout visible, sans défilement (V1.3.1) */
.admin-tabs { flex-wrap: wrap; gap: .25rem; }
.admin-tabs .nav-link { display: flex; align-items: center; gap: .35rem; padding: .4rem .65rem; font-size: .92rem; white-space: nowrap; }
@media (max-width: 767.98px) {
    .admin-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .admin-tabs .nav-link { flex-direction: column; justify-content: center; gap: .15rem; height: 100%; padding: .45rem .2rem; font-size: .74rem; line-height: 1.15; text-align: center; white-space: normal; }
    .admin-tabs .nav-link i { font-size: 1.15rem; }
}
.dropdown-menu { --bs-dropdown-link-active-bg: var(--lt-blue); }
.min-w-0 { min-width: 0; }
.btn { background-image: none; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
[hidden] { display: none !important; }

/* En-tête : blanc, filet framboise terminé par un cercle (comme les supports de la charte) */
.app-nav { background: var(--app-surface); position: sticky; top: 0; z-index: 1020; }
.app-nav::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--lt-raspberry);
}
.app-nav .navbar-brand { display: flex; align-items: center; gap: .55rem; color: var(--lt-blue); padding: .35rem 0; }
.app-nav .navbar-brand .lt-wordmark { font-size: 1.25rem; line-height: 1; }
.app-nav .brand-sub { display: block; font-size: .62rem; letter-spacing: .28em; color: var(--bs-secondary-color); text-transform: uppercase; margin-top: 2px; }
.app-nav .nav-link { color: var(--app-ink); font-weight: 600; font-size: .95rem; border-radius: .5rem; }
.app-nav .nav-link:hover { color: var(--lt-raspberry); }
.app-nav .nav-link.active { color: var(--lt-raspberry); }
.app-nav .app-user { color: var(--app-ink); border: 1px solid var(--app-border); border-radius: 2rem; padding: .3rem .8rem; }
.app-nav .app-user:hover { border-color: var(--lt-blue); color: var(--lt-blue); }

/* Titres de section avec filet framboise (repris de la charte) */
.app-section-title { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.app-section-title h1 { margin: 0; }
.app-eyebrow { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--lt-raspberry); font-weight: 700; }

/* Cartes */
.app-card { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: .85rem; overflow: hidden; }
.app-card .card-header, .app-card .card-footer { background: transparent; border-color: var(--app-border); }
.app-card .card-header { color: var(--lt-blue); }
[data-bs-theme="dark"] .app-card .card-header { color: var(--app-ink); }
.app-card .list-group-item { background: transparent; border-color: var(--app-border); color: inherit; }
.app-card .list-group-item-action:hover { background: var(--lt-blue-soft); }
.app-card-muted { background: transparent; border-style: dashed; }
.app-inline-form { background: var(--lt-blue-soft); border-top: 1px solid var(--app-border); margin: 0; }

/* Indicateurs */
.app-stat { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: .85rem; padding: .9rem .6rem; text-align: center; position: relative; overflow: hidden; }
.app-stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--lt-raspberry); }
.app-stat i { color: var(--lt-blue); font-size: 1.2rem; }
.app-stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1.2; color: var(--lt-blue); }
[data-bs-theme="dark"] .app-stat-value { color: var(--app-ink); }
.app-stat-label { font-size: .78rem; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: .08em; }

/* Listes de définitions */
.app-dl { display: grid; grid-template-columns: minmax(7rem, 35%) 1fr; gap: .45rem 1rem; }
.app-dl dt { font-weight: 600; color: var(--bs-secondary-color); font-size: .85rem; }
.app-dl dd { margin: 0; word-break: break-word; }
.app-pre { white-space: pre-line; }

/* Pages invitées (connexion, double authentification) : fond bleu foncé, formes de la charte */
.app-guest {
    min-height: 100vh; display: grid; place-items: center; padding: 1.25rem;
    background-color: var(--lt-blue-deep); position: relative; overflow-x: hidden;
}
.app-guest::before, .app-guest::after { content: ""; position: fixed; pointer-events: none; z-index: 0; }
.app-guest::before { /* forme framboise, en bas à gauche */
    width: 340px; height: 340px; left: -120px; bottom: -150px; background: #D0004F;
    border-radius: 0 38% 0 0; transform: rotate(-24deg);
}
.app-guest::after { /* forme bleue, en haut à droite */
    width: 420px; height: 420px; right: -170px; top: -170px; background: #1C4374;
    border-radius: 0 0 0 42%; transform: rotate(-24deg);
}
.app-guest-card {
    position: relative; z-index: 1; width: 100%; max-width: 410px; background: var(--app-surface);
    border-radius: 1.1rem; padding: 2rem 1.6rem 1.6rem; box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.app-guest-brand { text-align: center; margin-bottom: 1.5rem; }
.app-guest-brand .lt-wordmark { display: block; font-size: 1.9rem; color: var(--lt-blue); margin-top: .4rem; padding-left: .32em; }
.app-guest-brand .lt-signature { display: block; margin-top: .2rem; }
.app-guest-brand .brand-by { display: block; font-size: .68rem; letter-spacing: .3em; text-transform: uppercase; color: var(--bs-secondary-color); margin-top: .6rem; }
.app-code { font-size: 1.6rem; letter-spacing: .4em; font-variant-numeric: tabular-nums; }
.app-qr { background: #fff; padding: 10px; border-radius: 8px; line-height: 0; }
.app-secret { font-size: .95rem; letter-spacing: .05em; }

/* À propos */
.app-about { max-width: 640px; margin: 0 auto; }
.app-about .lt-wordmark { font-size: 2.4rem; color: var(--lt-blue); padding-left: .32em; }

/* Pied de page : filet framboise terminé par un cercle */
.app-footer { margin-top: 3rem; display: flex; align-items: center; gap: .75rem; font-size: .78rem; color: var(--bs-secondary-color); }
.app-footer::before { content: ""; flex: 1; height: 2px; background: var(--lt-raspberry); border-radius: 2px; }
.app-footer .dot { width: 12px; height: 12px; border: 2px solid var(--lt-raspberry); border-radius: 50%; flex: none; }
.app-footer a { color: inherit; text-decoration: none; letter-spacing: .12em; text-transform: uppercase; }
.app-footer a:hover { color: var(--lt-raspberry); }

/* Parc : pastilles de catégorie et arbre réseau */
.asset-ico { width: 2.3rem; height: 2.3rem; border-radius: .6rem; display: grid; place-items: center; flex: none; background: var(--lt-blue-soft); color: var(--lt-blue); font-size: 1.1rem; }
.asset-ico.net { background: var(--lt-raspberry-soft); color: var(--lt-raspberry); }
.status-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .3rem; vertical-align: middle; }
.net-tree, .net-tree ul { list-style: none; margin: 0; padding-left: 1.2rem; }
.net-tree { padding-left: 0; }
.net-tree li { position: relative; padding: .25rem 0 .25rem 1rem; }
.net-tree ul li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--app-border); }
.net-tree ul li::after { content: ""; position: absolute; left: 0; top: 1.15rem; width: .8rem; border-top: 2px solid var(--app-border); }
.net-tree ul li:last-child::before { bottom: auto; height: 1.15rem; }
.net-node { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .6rem; border: 1px solid var(--app-border); border-radius: .6rem; background: var(--app-surface); text-decoration: none; color: inherit; }
.net-node:hover { border-color: var(--lt-blue); }

/* Étiquettes QR à imprimer */
.labels-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(62mm, 1fr)); gap: 4mm; }
.qr-label { border: 1px dashed #b9c1cc; border-radius: 3mm; padding: 3mm; display: flex; gap: 3mm; align-items: center; background: #fff; color: #1d2433; break-inside: avoid; }
.qr-label .qr { width: 24mm; height: 24mm; flex: none; }
.qr-label .qr img, .qr-label .qr canvas { width: 100% !important; height: 100% !important; }
.qr-label .l-name { font-weight: 700; font-size: 10pt; line-height: 1.15; }
.qr-label .l-meta { font-size: 7.5pt; color: #4a5568; line-height: 1.25; }
.qr-label .l-brand { display: flex; align-items: center; gap: 1.5mm; margin-top: 1.5mm; font-size: 6.5pt; letter-spacing: .2em; color: #1C4374; text-transform: uppercase; }
@media print {
    .app-nav, .app-tabbar, .app-footer, .no-print, .alert { display: none !important; }
    body { background: #fff !important; }
    .app-main { padding: 0 !important; max-width: none !important; }
    .qr-label { border-color: #ccc; }
}

/* Mobile : barre d'onglets en bas, grandes zones tactiles */
@media (max-width: 767.98px) {
    .app-main { padding-bottom: 6rem !important; }
    .app-tabbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
        display: grid; grid-template-columns: repeat(5, 1fr);
        background: var(--app-surface); border-top: 3px solid var(--lt-raspberry);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .app-tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .45rem; font-size: .7rem; color: var(--bs-secondary-color); text-decoration: none; }
    .app-tabbar a i { font-size: 1.3rem; }
    .app-tabbar a.active { color: var(--lt-blue); font-weight: 700; }
    .app-tabbar .app-tabbar-main i { background: var(--lt-raspberry); color: #fff; width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; margin-top: -.9rem; box-shadow: 0 4px 12px rgba(208, 0, 79, .35); }
    .app-sticky-actions { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); background: var(--app-surface) !important; }
    .btn { min-height: 44px; }
    .btn-sm { min-height: 36px; }
    .form-control, .form-select { font-size: 16px; } /* évite le zoom automatique sur iPhone */
    .page-actions { width: 100%; }
    .page-actions > *, .page-actions > .dropdown > .btn { flex: 1 1 auto; }
    .page-actions > .dropdown { display: flex; }
}

/* Note matériel */
.score-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 2.4rem; padding: .1rem .45rem; border-radius: 2rem; font-weight: 700; font-size: .8rem; color: #fff; }
.score-good { background: #1f9d55; }
.score-mid  { background: #e08a00; }
.score-bad  { background: var(--lt-raspberry); }
.score-none { background: transparent; color: var(--bs-secondary-color); border: 1px dashed var(--app-border); font-weight: 400; }
.score-ring { --p: 0; --c: #1f9d55; width: 7.5rem; height: 7.5rem; border-radius: 50%; margin: 0 auto; display: grid; place-items: center;
    background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--app-border) 0); }
.score-ring > div { width: 6rem; height: 6rem; border-radius: 50%; background: var(--app-surface); display: grid; place-items: center; text-align: center; }
.score-ring strong { font-size: 2rem; line-height: 1; color: var(--app-ink); }
.score-ring small { display: block; color: var(--bs-secondary-color); font-size: .7rem; }
.crit-dot { width: .65rem; height: .65rem; border-radius: 50%; display: inline-block; flex: none; }
.crit-rec { background: #1f9d55; } .crit-min { background: #e08a00; } .crit-obs { background: var(--lt-raspberry); } .crit-unk { background: transparent; border: 2px solid var(--app-border); }

/* Accueil administration */
.admin-tile { transition: border-color .15s, transform .15s; }
.admin-tile:hover { border-color: var(--lt-blue); transform: translateY(-2px); }

/* Éditeur du référentiel */
.crit-off { opacity: .6; }
.crit-off:focus-within { opacity: 1; }
.crit-share { min-width: 4.8rem; }
.influence-bar { display: flex; height: 1.6rem; border-radius: .5rem; overflow: hidden; background: var(--app-border); }
.influence-bar span { display: flex; align-items: center; justify-content: center; color: #fff; font-size: .7rem; font-weight: 700; overflow: hidden; white-space: nowrap; transition: width .2s; }
.influence-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.sim-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; }
.sim-grid > div { border: 1px solid var(--app-border); border-radius: .6rem; padding: .6rem .75rem; }
.sim-grid strong { display: block; font-size: 1.3rem; color: var(--lt-blue); }

/* ---- Audits (V0.0.7) ---- */
.audit-head { background: var(--app-bg, var(--bs-body-bg)); }
@media (max-width: 767.98px) {
  .audit-head { position: sticky; top: var(--nav-h, 72px); z-index: 1010; padding: .5rem 0; margin-top: -.5rem; background: var(--app-bg); border-bottom: 1px solid var(--app-border); }
}
.q-num { flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
  background: var(--bs-secondary-bg); color: var(--app-ink); }
.question-card { border-left: 4px solid transparent; transition: border-color .2s; }
.question-card.is-answered { border-left-color: var(--lt-blue); }
.question-card.is-answered .q-num { background: var(--lt-blue); color: #fff; }
.save-state { white-space: nowrap; text-align: right; flex: none; }
@media (max-width: 575.98px) { .save-state { position: absolute; top: .35rem; right: .75rem; font-size: .75rem; } .question-card { position: relative; } }
.save-state.ok { color: #1f9d55 !important; }
.save-state.err { color: var(--lt-raspberry) !important; font-weight: 700; }

.crit-badge { font-weight: 600; }
.crit-badge.crit-1 { background: var(--bs-secondary-bg); color: var(--bs-secondary-color); }
.crit-badge.crit-2 { background: #fff1d6; color: #8a5300; }
.crit-badge.crit-3 { background: var(--lt-raspberry); color: #fff; }
[data-bs-theme="dark"] .crit-badge.crit-2 { background: #4a3500; color: #ffd27a; }

.answer-group { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; }
.answer-btn { border: 1px solid var(--app-border); background: var(--app-surface); color: var(--app-ink); font-size: .85rem; padding: .55rem .3rem; line-height: 1.15; }
.answer-btn:hover { border-color: var(--lt-blue); }
.btn-check:checked + .answer-btn { color: #fff; font-weight: 700; }
.btn-check:checked + .ans-conforme { background: #1f9d55; border-color: #1f9d55; }
.btn-check:checked + .ans-partiel { background: #e08a00; border-color: #e08a00; }
.btn-check:checked + .ans-non_conforme { background: var(--lt-raspberry); border-color: var(--lt-raspberry); }
.btn-check:checked + .ans-na, .btn-check:checked + .ans-non_verifie { background: #6c757d; border-color: #6c757d; }
@media (max-width: 575.98px) {
  .answer-group { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .answer-btn { padding: .7rem .25rem; } /* cible tactile confortable */
  .answer-group .ans-na, .answer-group .ans-non_verifie { font-size: .78rem; }
}

.domain-bar { display: block; height: .4rem; border-radius: 1rem; background: var(--bs-secondary-bg); overflow: hidden; }
.domain-bar > span { display: block; height: 100%; border-radius: 1rem; }
.lvl-good { background: #1f9d55; }
.lvl-mid { background: #e08a00; }
.lvl-bad { background: var(--lt-raspberry); }
.lvl-none { background: transparent; }

/* ---- Plan d'amélioration (V0.0.9) ---- */
.flex-none { flex: none; }
.gain { display: inline-block; white-space: nowrap; font-weight: 700; font-size: .78rem; color: #1f9d55; background: rgba(31, 157, 85, .1); border-radius: 2rem; padding: .05rem .5rem; }
.gain.neg { color: var(--lt-raspberry); background: rgba(208, 0, 79, .08); }
.gain.zero { color: var(--bs-secondary-color); background: var(--bs-secondary-bg); font-weight: 400; }
.stairs { display: flex; align-items: stretch; gap: .75rem; overflow-x: auto; padding-bottom: .25rem; }
.stair { flex: 1 0 5.5rem; max-width: 10rem; display: flex; flex-direction: column; gap: .4rem; }
.stair-col { height: 9rem; display: flex; align-items: flex-end; background: repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), var(--app-border) calc(25% - 1px) 25%); border-radius: .4rem; }
.stair-bar { display: flex; align-items: flex-start; justify-content: center; width: 100%; border-radius: .4rem .4rem 0 0; min-height: 1.6rem; transition: height .3s; }
.stair-bar b { color: #fff; font-size: 1.05rem; padding-top: .2rem; }
.stair-bar.lvl-none { background: var(--bs-secondary-bg); } .stair-bar.lvl-none b { color: var(--bs-secondary-color); }
.stair-bar.is-done { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .55); }
.stair-label { font-size: .78rem; line-height: 1.2; font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.stair-label small { display: block; font-weight: 400; color: var(--bs-secondary-color); }
.stair-empty { align-self: center; color: var(--bs-secondary-color); font-size: .9rem; }
.step-num { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--lt-blue); color: #fff; font-weight: 700; flex: none; }
.plan-step.is-done .step-num { background: #1f9d55; }
.plan-ico { width: 1.9rem; height: 1.9rem; border-radius: .5rem; display: grid; place-items: center; background: var(--bs-secondary-bg); color: var(--lt-blue); flex: none; }
.plan-move select { max-width: 12rem; }
.plan-candidates { max-height: 26rem; overflow-y: auto; }
.plan-computer:not(:has(input[value="upgrade"]:checked)) .upgrade-fields { display: none; }
/* Ligne d'action du plan : le texte prend la place disponible, les commandes restent sur la ligne (V1.2.1) */
.plan-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; grid-template-areas: "ico text gain move del"; align-items: center; column-gap: .6rem; }
.plan-item > .plan-ico { grid-area: ico; align-self: start; }
.plan-item > .plan-text { grid-area: text; overflow-wrap: anywhere; }
.plan-item > .plan-gain { grid-area: gain; white-space: nowrap; }
.plan-item > .plan-move { grid-area: move; }
.plan-item > .plan-del { grid-area: del; align-self: start; }
@media (max-width: 767.98px) {
  .plan-item { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ico text del" ". gain gain" ". move move"; row-gap: .4rem; }
  .plan-item > .plan-gain { justify-self: start; }
  .plan-move select { max-width: none; width: 100%; }
}
.plan-flag { background: rgba(28, 67, 116, .12); color: var(--lt-blue); font-weight: 600; }
[data-bs-theme="dark"] .plan-flag { background: rgba(120, 160, 220, .2); color: #a9c4ea; }

/* ---- Photos (V0.0.10) ---- */
.photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .6rem; }
.photo-list:not(:empty) { margin-bottom: .6rem; }
.photo-item { margin: 0; display: flex; flex-direction: column; gap: .3rem; }
.photo-thumb { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: .5rem; overflow: hidden; background: var(--bs-secondary-bg); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb.is-off img { opacity: .45; }
.photo-off { position: absolute; top: .25rem; right: .25rem; background: rgba(0, 0, 0, .55); color: #fff; border-radius: 1rem; padding: 0 .35rem; font-size: .75rem; }
.photo-item .form-control { font-size: .78rem; padding: .2rem .4rem; }
.photo-add { cursor: pointer; }
.photo-add:focus-within { outline: 2px solid var(--lt-blue); outline-offset: 2px; }
@media (max-width: 575.98px) { .photo-list { grid-template-columns: repeat(2, 1fr); } .photo-add { padding: .5rem .9rem; } }

/* ---- Étoile (V0.0.11) ---- */
.radar-wrap { max-width: 30rem; margin: 0 auto; color: var(--app-ink); }
.radar { width: 100%; height: auto; display: block; overflow: visible; }
[data-bs-theme="dark"] .radar polygon[fill="#1C4374"] { fill: #7fa6dd; stroke: #a9c4ea; }
#audit-new:not(:has(#kind-bilan:checked)) .bilan-only { display: none; }
#audit-new:has(#kind-bilan:checked) .not-bilan { display: none; }

/* ---- Audit particulier (V0.0.13) ---- */
.score-ring.sm { width: 3.6rem; height: 3.6rem; margin: 0; flex: none; }
.score-ring.sm > div { width: 2.8rem; height: 2.8rem; }
.score-ring.sm strong { font-size: 1.15rem; }
.badge.verdict-keep, .verdict-box.verdict-keep { background: rgba(31, 157, 85, .12); color: #157a41; }
.badge.verdict-upgrade, .verdict-box.verdict-upgrade { background: rgba(224, 138, 0, .14); color: #8a5300; }
.badge.verdict-replace, .verdict-box.verdict-replace { background: rgba(208, 0, 79, .1); color: var(--lt-raspberry); }
[data-bs-theme="dark"] .badge.verdict-keep, [data-bs-theme="dark"] .verdict-box.verdict-keep { color: #6fd39b; }
[data-bs-theme="dark"] .badge.verdict-upgrade, [data-bs-theme="dark"] .verdict-box.verdict-upgrade { color: #ffc560; }
.verdict-box { border-radius: .6rem; padding: .6rem .8rem; margin-top: .5rem; }
.verdict-box strong { font-size: 1.05rem; }
.projection-line { display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; }
.projection-line strong { font-size: 1rem; }
.sim-bars { display: flex; gap: .75rem; }
.sim-bar { flex: 1; display: flex; flex-direction: column; gap: .35rem; }
.sim-col { height: 8rem; display: flex; align-items: flex-end; justify-content: center; background: var(--bs-secondary-bg); border-radius: .4rem; }
.sim-col > span { display: flex; justify-content: center; width: 100%; border-radius: .4rem .4rem 0 0; min-height: 1.6rem; }
.sim-col b { color: #fff; padding-top: .2rem; }
.sim-col em { font-size: .72rem; color: var(--bs-secondary-color); align-self: center; text-align: center; padding: .3rem; }
.sim-label { font-size: .78rem; font-weight: 700; text-align: center; }

/* Réseau d'un particulier (box + appareils) */
.net-ico { flex: 0 0 2.4rem; width: 2.4rem; height: 2.4rem; display: inline-flex; align-items: center; justify-content: center; border-radius: .6rem; background: var(--lt-blue-soft); color: var(--lt-blue); font-size: 1.15rem; }
.net-box .net-ico { background: var(--lt-blue); color: #fff; }
.net-link { background: var(--lt-blue-soft); color: var(--lt-blue); font-weight: 600; white-space: nowrap; }

/* ---- Ventes (V0.0.23) ---- */
.product-thumb { width: 4.5rem; height: 4.5rem; object-fit: contain; border-radius: .6rem; background: #fff; border: 1px solid var(--app-border); flex: none; }
.product-thumb-empty { display: grid; place-items: center; font-size: 1.8rem; color: var(--bs-secondary-color); background: var(--bs-tertiary-bg); }
.product-thumb-lg { width: 7rem; height: 7rem; }
.product-card:hover { border-color: var(--lt-blue); }
.usage-bar { display: grid; grid-template-columns: 6.5rem 1fr 2rem; align-items: center; gap: .5rem; font-size: .85rem; margin: .25rem 0; }
.usage-bar strong { text-align: right; }
.usage-track { height: .55rem; border-radius: .3rem; background: var(--bs-tertiary-bg); overflow: hidden; }
.usage-track > span { display: block; height: 100%; border-radius: .3rem; background: var(--bs-secondary-color); }
.usage-track > span.lvl-good { background: #1f9d55; } .usage-track > span.lvl-mid { background: #e08a00; } .usage-track > span.lvl-bad { background: var(--lt-raspberry); }
.feature-table input[name$="[order]"] { width: 3.6rem; }
.sale-logo-preview { display: inline-grid; place-items: center; padding: .6rem 1.2rem; border-radius: .5rem; }
.sale-logo-preview img { max-height: 3rem; max-width: 16rem; }

/* ---- Consultation seule (V0.0.24) : formulaires d'enregistrement et boutons de modification masqués ---- */
.app-readonly form[method="post"]:not([data-keep]), .app-readonly [data-write] { display: none !important; }
.app-readonly [data-keep] button:not([type="button"]) { display: none !important; }
.rights-table td, .rights-table th { padding-left: .35rem; padding-right: .35rem; }
.tool-history li { margin-bottom: .35rem; }
/* Tablette (768 à 1199 px) : la barre de menu tient sur la largeur (V1.2.1) */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .app-nav .nav-link.px-3 { padding-left: .45rem !important; padding-right: .45rem !important; font-size: .88rem; }
  .app-nav .d-md-flex.ms-4 { margin-left: .75rem !important; gap: 0 !important; }
  .app-nav .app-user .d-sm-inline { display: none !important; }
  .app-nav .brand-sub { display: none; }
}

/* Chantiers du plan d'amélioration (V1.4.0) */
.ref-tag { display: inline-block; font-weight: 700; font-size: .78rem; letter-spacing: .02em; padding: .15rem .45rem; border-radius: .4rem; background: var(--lt-blue); color: #fff; white-space: nowrap; }
.chantier { border-top: 1px solid var(--bs-border-color); }
.chantier:first-of-type { border-top: 0; }
.chantier-head { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: .6rem; padding: .7rem 1rem; background: var(--bs-tertiary-bg); }
.chantier-title { overflow-wrap: anywhere; }
.chantier-status select { min-width: 8.5rem; }
.chantier.status-realise .chantier-head { background: rgba(31, 157, 85, .08); }
.chantier.status-abandonne { opacity: .65; }
.nature-head { background: transparent; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--bs-secondary-color); padding-top: .55rem; padding-bottom: .25rem; }
.chantier-add summary { cursor: pointer; color: var(--lt-blue); }
@media (max-width: 575.98px) {
    .chantier-head { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ref title edit" "status status status"; }
    .chantier-head > .ref-tag { grid-area: ref; }
    .chantier-head > .plan-ico { display: none; }
    .chantier-head > .chantier-title { grid-area: title; }
    .chantier-head > .chantier-status { grid-area: status; }
    .chantier-head > button { grid-area: edit; }
}

/* Interventions (V1.5.0) */
.iv-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .8rem; }
.iv-date { width: 3.2rem; text-align: center; line-height: 1.1; border-radius: .5rem; background: var(--bs-tertiary-bg); padding: .3rem 0; }
.iv-date strong { display: block; color: var(--lt-blue); }
.iv-date small { color: var(--bs-secondary-color); font-size: .72rem; }
.iv-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .35rem .8rem; max-height: 18rem; overflow-y: auto; border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .6rem; }
.iv-asset { display: flex; align-items: center; overflow-wrap: anywhere; }

/* Supervision des NAS (V1.6.0) */
.nas-card.status-crit, .nas-card.status-silent { border-left: .3rem solid var(--bs-danger); }
.nas-card.status-warn { border-left: .3rem solid var(--bs-warning); }
.nas-card.status-ok { border-left: .3rem solid var(--bs-success); }
.nas-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .8rem; }
.nas-kpis span { display: block; color: var(--bs-secondary-color); font-size: .75rem; }
.nas-chart { width: 100%; height: auto; color: var(--bs-body-color); }
.nas-token, .nas-cmd { white-space: pre-wrap; word-break: break-all; background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .6rem .8rem; font-size: .85rem; user-select: all; }
.nas-token { font-size: 1rem; font-weight: 700; letter-spacing: .03em; }
.nas-steps li { margin-bottom: .6rem; }
.nas-msg { min-width: 16rem; overflow-wrap: anywhere; }
.nas-list { max-height: 14rem; overflow-y: auto; }
.nas-discovery { max-height: 30rem; overflow: auto; font-size: .75rem; background: var(--bs-tertiary-bg); padding: .6rem; border-radius: .5rem; }
details.card > summary { cursor: pointer; list-style: revert; }

/* Barre du haut : plus de place pour les onglets Interventions et Supervision (tablette et petit écran d'ordinateur) */
@media (min-width: 992px) and (max-width: 1399.98px) {
  .app-nav .nav-link { font-size: .875rem; padding-left: .5rem !important; padding-right: .5rem !important; white-space: nowrap; }
  .app-nav .brand-sub { display: none; }
}
@media (min-width: 992px) and (max-width: 1099.98px) {
  .app-nav .nav-link { font-size: .8rem; padding-left: .35rem !important; padding-right: .35rem !important; }
}

/* Aide intégrée (V1.11.0) */
.aide-body { max-width: 62rem; overflow-wrap: anywhere; }
.aide-body h2 { font-size: 1.25rem; margin: 2rem 0 .6rem; padding-top: .4rem; border-top: 3px solid var(--lt-blue); color: var(--lt-blue); scroll-margin-top: 4.5rem; }
.aide-body h3 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; scroll-margin-top: 4.5rem; }
.aide-body h4 { font-size: .95rem; margin: 1rem 0 .3rem; }
.aide-body .aide-note { border-left: .3rem solid var(--bs-warning); background: var(--bs-tertiary-bg); padding: .6rem .9rem; border-radius: 0 .5rem .5rem 0; margin: 1rem 0; }
.aide-body .aide-table th { background: var(--bs-tertiary-bg); white-space: nowrap; }
.aide-body .aide-check { list-style: none; margin-left: -1.4rem; }
.aide-body .aide-box { font-size: 1.1em; margin-right: .3rem; }
.aide-body pre.aide-code { background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .7rem .9rem; font-size: .85rem; overflow-x: auto; }
@media (min-width: 992px) { .aide-toc { position: sticky; top: 4.5rem; max-height: calc(100vh - 6rem); overflow-y: auto; } }
