:root {
    --fd-primary:        #0b4f6c;
    --fd-primary-dark:   #08384d;
    --fd-primary-light:  #1d93c6;
    --fd-primary-mid:    #006894;
    --fd-body-bg:        #eef4f7;
    --fd-text:           #10212b;
    --fd-text-muted:     #5a7080;
    --fd-link-color:     #0b5ea8;
    --fd-card-bg:        #fafafa;
    --fd-card-shadow:    rgba(11, 79, 108, 0.10);
    --fd-border:         #b8d4e3;
    --fd-border-light:   #d9e4ea;
    --fd-summary-bg: linear-gradient(45deg, #c2bdbd, #958e8e);
    --fd-summary-text:          #111111;
    --fd-tree-addr:             rgba(0,0,0,.55);
    --fd-summary-com-bg: linear-gradient(45deg, #1aa0db, #04b2fb);
    --fd-summary-com-text:      #111111;
    --fd-link-card-bg:          linear-gradient(45deg, #e4e4e4, #adadad);
    --fd-link-card-text:        #111111;
    --fd-accordion-com-bg: linear-gradient(45deg, #fafaff, #ffffff);
    --fd-accordion-com-text:    #111111;
    --fd-link-card-h4:          #111111;
    --fd-link-card-p:           rgba(0,0,0,.55);
    --fd-accordion-bg:          linear-gradient(45deg, #bfd3db, #98abb9);
    --fd-accordion-text:        #3f3b3b;
    --fd-btn-bg:         #d7e9f0;
    --fd-btn-text:       #06384d;
    --fd-btn-hover:      #aee8fe;
    --fd-btn-active:     #79c3ec;
    --fd-header-bg:      #0b4f6c;
    --fd-sidebar-bg:     #08384d;
    --fd-table-text:     #070707;
    --fd-table-th:       #0b4f6c;
}

[data-theme="dark"] {
    --fd-primary:        #4ab0d8;
    --fd-primary-dark:   #0e2a38;
    --fd-primary-light:  #3b9cc4;
    --fd-primary-mid:    #1a6a90;
    --fd-body-bg:        #0f1e27;
    --fd-text:           #d8eaf2;
    --fd-text-muted:     #7a9fb0;
    --fd-link-color:     #5bbfee;
    --fd-card-bg:        #16283a;
    --fd-card-shadow:    rgba(0, 0, 0, 0.35);
    --fd-border:         #1e3f54;
    --fd-border-light:   #1e3f54;
    --fd-summary-bg:            linear-gradient(45deg, #000000, #010101);
    --fd-summary-text:          #d8eaf2;
    --fd-tree-addr:             rgba(255,255,255,.6);
    --fd-summary-com-bg: linear-gradient(45deg, #162950, #0f1e27);
    --fd-summary-com-text:      #d8eaf2;
    --fd-link-card-bg:          linear-gradient(45deg, #000000, #010101);
    --fd-link-card-text:        #d8eaf2;
    --fd-accordion-com-bg:      linear-gradient(45deg, #142635, #20303f);
    --fd-accordion-com-text:    #d8eaf2;
    --fd-link-card-h4:          #d8eaf2;
    --fd-link-card-p:           rgba(255,255,255,.6);
    --fd-accordion-bg:          linear-gradient(45deg, #142635, #20303f);
    --fd-accordion-text:        #d8eaf2;
    --fd-btn-bg:         #1a3348;
    --fd-btn-text:       #90c4d8;
    --fd-btn-hover:      #1e4460;
    --fd-btn-active:     #2a6488;
    --fd-header-bg:      #071520;
    --fd-sidebar-bg:     #071520;
    --fd-table-text:     #c8dde8;
    --fd-table-th:       #6ab8d8;
}

[data-theme="dark"] .fd-tree-site,
[data-theme="dark"] .fd-measure-card {
    background: #16283a;
    border-color: #1e3f54;
}
[data-theme="dark"] .fd-top-table th {
    background: #16283a;
}
[data-theme="dark"] .fd-card input,
[data-theme="dark"] .fd-card select,
[data-theme="dark"] .fd-card textarea {
    background: #0f1e27;
    color: #d8eaf2;
    border: 1px solid #1e3f54;
}
[data-theme="dark"] .fd-stat-card {
    background: #16283a;
    color: #d8eaf2;
}
[data-theme="dark"] .fd-stat-value {
    color: #4ab0d8;
}
[data-theme="dark"] .fd-tree-fiche,
[data-theme="dark"] .fd-tree-action { color: #4ab0d8; }
[data-theme="dark"] .fd-tree-fiche:hover,
[data-theme="dark"] .fd-tree-action:hover { background: rgba(74,176,216,.12); color: #7acde8; }
[data-theme="dark"] .fd-tree-equipment { background: linear-gradient(45deg, #0f5a80, #063d58); color: #c8e8f5; }
[data-theme="dark"] .fd-tree-equipment:hover { background: linear-gradient(45deg, #126a95, #074a6a); }
[data-theme="dark"] .fd-equip-summary { background: linear-gradient(45deg, #0f5a80, #063d58); }
[data-theme="dark"] .fd-equip-summary:hover { background: linear-gradient(45deg, #126a95, #074a6a); }
[data-theme="dark"] .fd-reading-list a { background: #1a2f42; color: #c8dde8; }
[data-theme="dark"] .fd-reading-list a:hover { background: #1e3a50; }
[data-theme="dark"] .fd-reading-list strong { color: #4ab0d8; }
[data-theme="dark"] .fd-analyse-card { background: #16283a; border-left-color: #1e3f54; color: #c8dde8; }
[data-theme="dark"] .fd-dormants-toolbar { background: #0e1c28; border-color: #1e3f54; }

html {
    height: 100%;
}

body.fd-body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--fd-body-bg);
    color: var(--fd-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body {
    min-height: 100vh;
}

a[href^="mailto"] {
    color: var(--fd-link-color);
}

h1 {
    font-size: 24px;
    text-align: center;
    margin: 60px 5px;
}

h2 {
    font-size: 16px;
    text-align: center;
    color: var(--fd-primary);
}

p {
    padding: 0 10px;
}

.fd-container,
.fd-login {
    max-width: 1200px;
    width: 100%;
    margin: 40px auto 0px auto;
    padding: 15px 8px 0px 8px;
    flex: 1;
    box-sizing: border-box;
}

.fd-login {
    max-width: 420px;
}

.fd-card {
    margin-top: 10px;
    background: var(--fd-card-bg);
    border-radius: 2px;
    padding: 10px 16px;
    color: var(--fd-text);
    box-shadow: 0 2px 8px var(--fd-card-shadow);
}

.fd-card-2 {
    background: none;
    padding: 15px 0;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
@media (max-width: 600px) {
    .fd-card-2 {
        flex-direction: column;
        align-items: flex-start;
    }
    .fd-card-2 > * {
        width: 54%;
        box-sizing: border-box;
        text-align: center;
    }
}

.fd-card-3 {
    margin: 20px 10px 40px 10px;
    background: var(--fd-card-bg);
    border-radius: 2px;
    padding: 10px 16px;
    color: var(--fd-text);
    box-shadow: 0 2px 8px var(--fd-card-shadow);
}

.fd-card label {
    padding: 3px;
    display: block;
    margin: 10px 0px;
    font-weight: 700;
}

.fd-card input {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    box-sizing: border-box;
}

.fd-card input[readonly] {
    cursor: default;
}
.fd-card input[readonly]:placeholder-shown {
    background: #eef2f5;
    color: #aab8c2;
    border-color: #dde4ea;
    cursor: not-allowed;
}
[data-theme="dark"] .fd-card input[readonly]:placeholder-shown {
    background: #1e2a32;
    color: #3d5060;
    border-color: #2a3a45;
}

@media (max-width: 700px) {
    .fd-card {
        margin-left: 8px;
        margin-right: 8px;
    }

    .fd-card input {
    text-align: center;
    width: 100%;
    padding: 10px 3px;
    margin-top: 0px;
    box-sizing: border-box;
}
}

.fd-card button:not(.fd-main-button-2):not(.fd-main-button-inline):not(.fd-stepper):not(.fd-chart-toggle):not(.fd-page-btn):not(.fd-btn-feed):not(.fd-fluide-fav-btn) {
    display: inline-block;
    padding: 5px 14px;
    margin: 6px auto;
    text-align: center;
    background: var(--fd-btn-bg);
    border: 0;
    border-radius: 2px;
    color: var(--fd-btn-text);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}

.fd-card button:not(.fd-main-button-2):not(.fd-main-button-inline):not(.fd-stepper):not(.fd-chart-toggle):not(.fd-page-btn):not(.fd-btn-feed):not(.fd-fluide-fav-btn):hover {
    background: var(--fd-btn-hover);
    color: var(--fd-text);
}

.fd-card button:not(.fd-main-button-2):not(.fd-main-button-inline):not(.fd-stepper):not(.fd-chart-toggle):not(.fd-page-btn):not(.fd-btn-feed):not(.fd-fluide-fav-btn):active {
    background: var(--fd-btn-active);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.18);
}
.fd-card button:not(.fd-main-button-2):not(.fd-main-button-inline):not(.fd-stepper):not(.fd-chart-toggle):not(.fd-page-btn):not(.fd-btn-feed):not(.fd-fluide-fav-btn):focus {
    background: var(--fd-btn-active);
}

.fd-field-warning {
    display: block;
    color: #b94a00;
    font-size: .82rem;
    margin-top: 3px;
    min-height: 1em;
}

.fd-alert {
    background: #ffe3e3;
    color: #8a1111;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.fd-alert-inline {
    background: #fff8e1;
    color: #7a5800;
    border: 1px solid #ffe082;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: .85rem;
    margin: 10px 0 6px;
}
.fd-alert-inline a {
    color: #0b4f6c;
    font-weight: 600;
    text-decoration: underline;
}
.fd-alert-inline.fd-alert-inline-info {
    background: #e8f4fb;
    color: #0b4f6c;
    border-color: #b3d9ee;
}

.fd-alert-success {
    display: inline-flex;
    /* Ramassée à gauche : sans cela, le conteneur en colonne flex de la page
       l'étire sur toute la largeur et la petite pastille devient une grosse
       barre pleine largeur. */
    align-self: flex-start;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    gap: 8px;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #a5d6a7;
    margin-bottom: 14px;
    font-weight: 600;
    font-size: .9rem;
}
.fd-alert-success::before {
    content: '\2713';
    font-weight: 700;
}
[data-theme="dark"] .fd-alert-success {
    background: #0d2e14;
    color: #66bb6a;
    border-color: #2e5e32;
}

.fd-grid {
    font-size: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 5px;
    margin-bottom: 42px;
}

@media (max-width: 700px) {
    .fd-grid {
        font-size: 15px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px;
        margin-bottom: 42px;
    }
}
.fd-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 42px;
    font-size: 14px;
}

@media (max-width: 700px) {
    .fd-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.fd-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    font-size: 14px;
    padding: 10px;
    gap: 8px;
    margin-bottom: 42px;
}
@media (max-width: 700px) {
    .fd-grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
        width: 100%;
        box-sizing: border-box;
    }
}

.fd-link-card {
    display: block;
    cursor: pointer;
    padding: 6px 16px;
    font-weight: 800;
    background: var(--fd-accordion-com-bg);
    color: var(--fd-accordion-com-text);
    border-radius: 2px;
    text-decoration: none;
    transition: filter .15s, transform .15s;
}
.fd-link-card:hover {
    filter: brightness(1.12);
    transform: translateY(-2px);
    color: #ffffff;
}
.fd-link-card h4 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--fd-link-card-h4);
    text-align: center;
}
.fd-link-card p {
    padding: 0;
    margin: 0;
    font-size: .78rem;
    text-align: center;
    color: var(--fd-link-card-p);
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
}

.fd-button {
    display: inline-block;
    margin: 0 10px;
    padding: 10px 14px;
    background: var(--fd-btn-bg);
    border-radius: 2px;
    border: none;
    text-decoration: none;
    color: var(--fd-btn-text);
    font-weight: 500;
}

.fd-button:hover {
    background: var(--fd-btn-hover);
    color: var(--fd-text);
}

@media (max-width: 768px) {
    .fd-button, a.fd-main-button-2{
        font-size: 13px;
        margin: 4px;
        border: none;
        padding: 10px 7px;
        text-align: center;
    }
}

.fd-card textarea {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    border-radius: 6px;
    box-sizing: border-box;
    resize: vertical;
}

.fd-card select {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    box-sizing: border-box;
}

.fd-measure-grid {
    padding: 0px;
    margin: 3px;
    align-items: stretch;
    width: auto;
    min-width: 0;
}
.fd-measure-card label {
    font-size: 20px;
        padding: 0;
    text-align: center;
}

@media (max-width: 700px) {
.fd-measure-card label {
    font-size: 12px;
}
}
.fd-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.fd-input-row input {
    flex: 1;
}

.fd-input-row span {
    font-weight: 700;
    color: #0b4f6c;
}

.fd-main-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    margin: 22px 0;
    padding: 8px 14px;

    border: 0;
    border-radius: 6px;
    background: var(--fd-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}
.fd-main-button:hover {
    background: var(--fd-primary-mid);
    color: #fff;
}
.fd-main-button span {
    color: inherit;
    font-size: 16px;
    padding: 0;
    margin: 0;
    background: transparent;
}

/* Bouton "Enregistrer" autonome : impose son style meme dans une .fd-card
   (sans passer par la liste d'exclusion de .fd-card button:not(...)). */
.fd-btn-save {
    display: inline-block;
    margin: 22px 0 !important;
    padding: 11px 22px !important;
    border: 0 !important;
    border-radius: 4px !important;
    background: #76f0b3 !important;
    color: #063246 !important;
    font-size: 14px;
    font-weight: 600 !important;
    cursor: pointer;
}
.fd-btn-save:hover {
    background: #5fe0a0 !important;
    color: #063246 !important;
}

.fd-main-button-inline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    margin: 0;
    padding: 8px 14px;
    text-decoration: none;
}
@media (max-width: 600px) {
    .fd-card-actions {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    .fd-main-button-inline {
        width: 54%;
        margin: 4px;
        box-sizing: border-box;
    }
}

.fd-main-button-auto {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
    margin: 0;
    padding: 8px 14px;
    text-decoration: none;
}

.fd-main-button-2 {
    display: inline-flex;
    align-items: center;
    margin: 0 10px;
    padding: 5px 12px;
    background: linear-gradient(344deg, #ff0202, #e8949a);
    border-radius: 2px;
    border: none;
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    font-size: .93rem;
    cursor: pointer;
    line-height: 1.4;
}
.fd-main-button-2:hover {
    background: linear-gradient(344deg, #d40000, #e07070);
    color: #fff;
}
.fd-card-actions-form {
    display: contents;
}

.fd-main-button-3 {
    display: block;
    width: 80px;
    padding: 4px 8px !important;
    margin: 0px auto !important;
    text-align: center;
    border-radius: 8px;
    background:#d7e9f0;
    color: #010101;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.fd-table-wrap {
    overflow-x: auto;
    margin: 10px;
}

.fd-table {
    margin-top: 10px;
    width: 100%;
    border-collapse: collapse;
}

.fd-table th,
.fd-table td {
    padding: 10px;
    color: var(--fd-table-text);
    border-bottom: 1px solid var(--fd-border-light);
    text-align: left;
}

.fd-table th {
    color: var(--fd-table-th);
}

.fd-analysis {
    border-left: 6px solid #0b4f6c;
}

.fd-analysis-ok {
    border-left-color: #1f8f4d;
}

.fd-analysis-warning {
    border-left-color: #f0a500;
}

.fd-analysis-danger,
.fd-analysis-critical {
    border-left-color: #c0392b;
}

.fd-badge-global {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    background: #0b4f6c;
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
}

.fd-badge-line {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    background: #e6edf2;
    color: #0b4f6c;
    font-size: .85rem;
    font-weight: 700;
}

.fd-top-separator td {
    background: #dceaf2;
    font-weight: 800;
    color: #0b4f6c;
    border-top: 2px solid #0b4f6c;
}

.fd-top-block {
    margin-bottom: 0px;
}

.fd-top-block h3 {
    font-size: 15px;
    margin: 10px 3px 3px;
    color: #0b4f6c;
}

.fd-top-table th,
.fd-top-table td {
    text-align: center;
    white-space: nowrap;
}

.fd-top-block {
    overflow: hidden;
}
.fd-top-block .fd-table-wrap {
    max-width: 100%;
}

.fd-top-table th {
    padding: 3px 2px;
    font-size: 13px;
    background: #eef5f8;
}
.fd-measure-card {
    padding: 10px 12px 16px 12px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #d9e4ea;
    position: relative;
    min-width: 0;
    overflow: hidden;
}

@media (max-width: 700px) {
    .fd-measure-card {
        padding: 8px 8px 12px 8px;
        border-radius: 8px;
    }
}
.fd-measure-muted {
    opacity: .45;
    background: #eef2f4;
}

.fd-measure-muted input {
    cursor: not-allowed;
}

.fd-success {
    background: #f1f8f2;
    border-left: 4px solid #2e7d32;
}

.fd-mode-card {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 10px 16px;
}
.fd-mode-card strong {
    flex-shrink: 0;
    color: var(--fd-primary);
    font-size: .95rem;
}
.fd-mode-card label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .95rem;
    cursor: pointer;
    margin: 0;
    font-weight: 400;
}
.fd-mode-card input[type=radio] {
    width: 16px;
    height: 16px;
    accent-color: var(--fd-primary);
    cursor: pointer;
    margin: 0;
}
.fd-mode-locked {
    font-weight: 700;
    color: var(--fd-primary);
    font-size: .95rem;
}
@media (max-width: 600px) {
    .fd-mode-card {
        gap: 12px;
    }
}

.fd-chart-buttons {
    padding: 10px 5px 15px 5px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.fd-chart-wrap {
    position: relative;
    height: clamp(320px, 46vh, 480px);
    margin: 6px 4px 14px;
}
@media (max-width: 600px) {
    .fd-chart-wrap {
        height: clamp(280px, 52vh, 380px);
        margin: 4px 0 10px;
    }
}

.fd-chart-toggle {
    padding: 6px 12px;
    border: 1px solid #e7e9eb;
    border-radius: 20px;
    background: #fff;
    color: #0b4f6c;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
}

.fd-chart-toggle:hover {
    background: #2cf19b5e;
}

button.fd-chart-toggle.active {
    background: #4fffb3;
    color: #000000;
    border-color: #d8d6d6;

    box-shadow: inset 0 2px 2px rgb(0 0 0 / 21%);
}

.fd-chart-toggle.active::before {
     content: "";
}
@media (max-width: 600px) {
    .fd-chart-toggle {
        font-size: 12px;
        padding: 5px 9px;
    }
}

.fd-chart-disabled {
    opacity: .4;
    cursor: not-allowed;
}

.fd-header {
    height: 64px;
    background: var(--fd-header-bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

@media (max-width: 900px) {
    .fd-header {
     padding: 0 15px 0 6px;
    }
}

.fd-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}
.fd-logo img {
    height: 100px;
    width: auto;
    display: block;
}
@media (max-width: 600px) {
    .fd-logo img {height: 80px;}
}

.fd-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fd-header-user {
    font-size: .95rem;
    opacity: .9;
}

/* Ã‰cran d'upgrade (plans) */
.fd-upgrade-card { max-width: 560px; }
.fd-upgrade-lead { font-size: 1.05rem; color: var(--fd-text); margin-bottom: 10px; }
.fd-upgrade-sub { color: var(--fd-text-muted); font-size: .92rem; line-height: 1.6; margin-bottom: 20px; }
.fd-upgrade-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Export XLSX */
.fd-export-form { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fd-export-date { width: auto; padding: 6px 8px; }

/* RÃ©attribution de site (module Groupe) */
.fd-site-reassign { margin-top: 12px; }
.fd-site-reassign-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fd-site-reassign-row .fd-input { width: auto; min-width: 180px; }

/* SÃ©lecteur d'agence (module Groupe) */
.fd-agency-switch { margin: 0; display: flex; align-items: center; }
.fd-agency-select {
    max-width: 180px;
    padding: 5px 9px;
    border-radius: 6px;
    border: 1px solid var(--fd-border);
    background: var(--fd-card-bg);
    color: var(--fd-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.fd-header-login {
    color: #fff;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    padding: 7px 14px;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 8px;
}
.fd-header-login:hover {
    background: rgba(255,255,255,.14);
}

.fd-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0px;
    border: none;
    border-radius: 999px;
    background: rgb(255 255 255 / 5%);
    cursor: pointer;
    font-family: inherit;
}
.fd-tt-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: background .2s;
    color: rgba(255,255,255,.5);
}
.fd-tt-pill svg {
    width: 16px;
    height: 16px;
    display: block;
}
.fd-tt-pill[data-theme-pill="light"] { color: rgba(249,199,79,.6); }
.fd-tt-pill[data-theme-pill="dark"]  { color: rgba(200,221,232,.5); }
.fd-tt-pill.active {
    background: rgba(255,255,255,.22);
}
.fd-tt-pill[data-theme-pill="light"].active { color: #f9c74f; }
.fd-tt-pill[data-theme-pill="dark"].active  {color: #ffffffb5;}

.fd-layout {
    display: flex;
    flex: 1;
}

.fd-sidebar {
    /* Largeur fluide : 240px au-dessus de ~1200px, retrecit jusqu'a 168px (-30%)
       a 900px, puis bascule en barre horizontale (media query a 900px). */
    width: clamp(168px, calc(24vw - 48px), 240px);
    flex: 0 0 auto;
    background: var(--fd-sidebar-bg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fd-sidebar a {
    color: #fff;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 2px;
    white-space: nowrap;
}

.fd-sidebar a:hover {
    background: rgba(255,255,255,.12);
}

.fd-sidebar-active {
    background: rgba(255,255,255,.18) !important;
    font-weight: 700;

    padding-left: 9px !important;
}

/* Groupes de navigation repliables */
.fd-nav-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fd-nav-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: rgba(255,255,255,.55);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-align: left;
    cursor: pointer;
}
.fd-nav-group-title:hover { color: rgba(255,255,255,.85); }
.fd-nav-open > .fd-nav-group-title {color: #e57373;}
.fd-nav-group-title:focus-visible {
    outline: 1px solid #aee8fe;
    outline-offset: 2px;
    border-radius: 3px;
}
.fd-nav-caret {
    font-size: .7rem;
    transition: transform .15s;
    transform: rotate(-90deg);
}
.fd-nav-open .fd-nav-caret { transform: none; }
.fd-nav-group-links {
    display: none;
    flex-direction: column;
    gap: 4px;
}
.fd-nav-open .fd-nav-group-links { display: flex; }
.fd-nav-group-links a { padding-left: 22px; }
.fd-nav-group-links a.fd-sidebar-active { padding-left: 19px !important; }
/* Déconnexion : formulaire POST (jeton anti-CSRF) déguisé en lien de nav.
   L'espacement va sur le formulaire, désormais l'élément flex de la barre ;
   le bouton reprend trait pour trait l'allure d'un lien .fd-sidebar a. */
.fd-nav-logout-form {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.14);
    padding-top: 14px;
}
.fd-nav-logout {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
    color: #fff;
    padding: 10px 12px;
    border-radius: 2px;
    white-space: nowrap;
}
.fd-nav-logout:hover {
    background: rgba(255,255,255,.12);
}

.fd-content {
    flex: 1;
    min-width: 0;
    padding: 28px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.fd-content > .fd-footer {
    margin-top: 80px;
}

.fd-footer {
    text-align: center;
    padding: 14px 14px 6px 14px;
    color: #667;
    font-size: .9rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}
.fd-footer a {
    text-decoration: none;
}
.fd-bug-link {
    background: none;
    border: none;
    color: #a0b0bb;
    font-size: .82rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}
.fd-bug-link:hover { color: #0b4f6c; }
/* Mobile : footer sur une seule ligne, petit espace entre les elements */
@media (max-width: 600px) {
    .fd-footer {
        gap: 12px;
        padding: 12px 10px 4px;
        font-size: .82rem;
    }
}

@media (max-width: 900px) {
    .fd-layout {
        flex-direction: column;
        min-height: unset;
    }

    /* Menu tiroir : la sidebar glisse depuis la gauche, ouverte par le burger */
    .fd-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 264px;
        max-width: 82vw;
        z-index: 1300;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, .35);
    }
    body.fd-nav-mobile-open .fd-sidebar {
        transform: none;
    }
    body.fd-nav-mobile-open {
        overflow: hidden;
    }
    .fd-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(4, 20, 30, .5);
        z-index: 1250;
    }
    body.fd-nav-mobile-open .fd-sidebar-overlay {
        display: block;
    }

    .fd-content {
        padding: 18px 4px;
    }
}

/* Bouton burger (entete) : visible uniquement en mobile */
.fd-burger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    margin-right: 2px;
}
.fd-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    border-radius: 2px;
}
@media (max-width: 900px) {
    .fd-burger { display: block; }
}

.fd-tree {
    padding: 0 10px 25px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin: 20px 10px;
    gap: 8px;
}
.fd-tree-group {
    flex: 0 0 calc(50% - 4px);
}
@media (max-width: 767px) {
    .fd-tree-group {
        flex: 0 0 100%;
    }
}

.fd-tree-site {
    background: #fff;
    margin: 0;
    border-radius: 2px;
    box-shadow: 0px 1px 2px rgb(0 0 0 / 59%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.fd-tree-site summary::-webkit-details-marker {
    display: none;
}

.fd-tree-site-summary-com {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 9px 6px 15px;
    font-weight: 800;
    background: var(--fd-summary-com-bg);
    color: var(--fd-summary-com-text);
}
.fd-tree-site-summary-com::-webkit-details-marker {
    display: none;
}
.fd-tree-site-summary-ue {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 6px 9px 6px 15px;
    font-weight: 800;
    background: var(--fd-summary-com-bg);
    color: var(--fd-summary-com-text);
}
.fd-tree-site-summary-ue::-webkit-details-marker {
    display: none;
}
.fd-tree-site-summary-ue .fd-dash-summary-toggle {
    flex-shrink: 0;
    margin-left: 8px;
}
.fd-summary-name {
    flex-shrink: 0;
    margin-right: auto;
}
.fd-summary-email {
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
    font-size: .85rem;
    opacity: .8;
    margin-left: auto;
    margin-right: 8px;
}

.fd-tree-site summary:not(.fd-tree-site-summary-ue):not(.fd-accordion-summary-com):not(.fd-equip-summary) > span:first-of-type {
    font-size: 17px;
    text-align: right;
    font-weight: 600;
    color: rgb(255 255 255);
    margin-left: auto;
    margin-right: 8px;
}
.fd-tree-site summary:not(.fd-tree-site-summary-ue):not(.fd-accordion-summary-com):not(.fd-equip-summary) > span:first-of-type + .fd-dash-summary-toggle {
    margin-left: 0;
}

@media (max-width: 700px) {
    .fd-tree-site summary:not(.fd-tree-site-summary-ue):not(.fd-accordion-summary-com):not(.fd-equip-summary) > span:first-of-type {
        font-size: .9rem;
        text-align: right;
        font-weight: 400;
        color: var(--fd-tree-addr);
        margin-left: auto;
        margin-right: 8px;
        flex-shrink: 0;
    }
}
.fd-tree-content {
    display: none;
}

.fd-tree-site[open] .fd-tree-content {
    background: transparent;
    display: block;
    margin-bottom: 12px;
}

.fd-tree-fiche,
.fd-tree-action {
    display: block;
    padding: 9px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #0b4f6c;
    font-weight: 700;
}
/* Même classe portée par un <button> (création de relevé passée en POST) :
   on efface le fond, la bordure et la police par défaut du bouton pour qu'il
   soit indiscernable du lien voisin. */
button.fd-tree-action {
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.fd-tree-fiche:hover,
.fd-tree-action:hover {
    background: rgba(11,79,108,.08);
}

.fd-tree-equipment {
    display: block;
    margin: 0 10px;
    padding: 3px 10px;
    border-radius: 2px;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(45deg, #1d93c6, #006894);
    margin-top: 8px;
}

.fd-tree-equipment small {
    display: block;
    margin-left: 24px;
    color: rgba(255,255,255,.75);
    font-size: .85rem;
}

.fd-tree-equipment:hover {
    background: linear-gradient(45deg, #1a85b5, #005a7a);
}

.fd-equip-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: linear-gradient(45deg, #1d93c6, #006894);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: filter .15s;
    text-decoration: none;
}
.fd-equip-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin-bottom: 12px; }
.fd-equip-summary:hover { filter: brightness(1.1); }
.fd-equip-summary::-webkit-details-marker { display: none; }
.fd-equip-summary-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
}
.fd-equip-summary .fd-dash-summary-toggle {
    flex-shrink: 0;
    margin-left: 4px;
}
.fd-equip-summary-sub {
    width: 100%;
    order: 2;
    font-size: .82rem;
    font-weight: 400;
    opacity: .85;
}

.fd-tree-empty {
    color: var(--fd-text-muted);
    font-size: 15px;
    margin: 6px 0px 4px 8px;
}

.fd-tree-group {
    margin: 0;
    border-radius: 4px;
    color: #ffffff;
    overflow: hidden;
    box-shadow: 0 1px 4px rgb(0 0 0 / 41%);
}

.fd-tree-group > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 5px 7px 22px;
    font-weight: 600;
    font-size: 17px;
    cursor: pointer;
    list-style: none;
    user-select: none;

    background: var(--grp, #78909c);
    color: #fff;
}

.fd-tree-group > summary::-webkit-details-marker { display: none; }

.fd-tree-group > summary .fd-accordion-counts {
    margin-left: auto;
    margin-right: 4px;
    font-size: .8rem;
    font-weight: 600;
    color: rgba(255,255,255,.8);
}
[data-theme="dark"] .fd-tree-group > summary .fd-accordion-counts {
    color: rgb(255 255 255);
}

.fd-tree-group > summary .fd-dash-summary-toggle {
    color: rgba(255,255,255,.7);
    background: rgba(255,255,255,.15);
    border-radius: 4px;
    padding: 9px 9px;
    font-size: .8rem;
    margin: 0 7px 0 5px;
    box-shadow: 0px 0px 1px black;
}
[data-theme="dark"] .fd-tree-group > summary .fd-dash-summary-toggle {
    color: rgba(180,210,230,.6);
    background: rgba(180,210,230,.1);
}

.fd-tree-group-content {
    padding: 8px 10px 12px;
    background: #f4f8fb;
    columns: 2;
    column-gap: 6px;
}
[data-theme="dark"] .fd-tree-group-content {
    background: #0e1c28;
}
.fd-tree-group-content > .fd-tree-site {
    break-inside: avoid;
    margin-bottom: 6px;
}
@media (max-width: 767px) {
    .fd-tree-group-content {
        columns: 1;
    }
}

.fd-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
}

.fd-badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.fd-badge-warning {
    border-radius: 12px;
    background: #dddddd8c;
    color: #f20e0e;
    margin: 10px;
    font-weight: 500;
}

.fd-reading-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fd-reading-list li {
    margin-bottom: 10px;
}

.fd-reading-list a {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f7fafc;
    color: #1f2933;
    text-decoration: none;
}
.fd-reading-list a:hover {
    background: #eef6fa;
}
.fd-reading-list strong {
    color: #0b4f6c;
}
@media (max-width: 700px) {
    .fd-reading-list a {
        padding: 14px;
        font-size: .95rem;
    }
    .fd-reading-list li {
        margin-bottom: 12px;
    }
}

.fd-grid-2 {
    text-align: center;
    max-width: 300px;
    margin: 18px auto 0;
    background: 198748;
    color: red;
}
.fd-grid-2 .fd-link-card {
    transition: transform .15s ease, box-shadow .15s ease;
}
.fd-grid-2 .fd-link-card:hover {
    background: #198748;;
    color: black;
    transform: translateY(-2px);
}
.fd-grid-2:hover {
    transform: translateY(-2px);
}
.fd-grid-2 .fd-link-card h2 {
    margin: 0 0 10px;
}
.fd-grid-2 .fd-link-card p {
    margin: 0;
    color: #000000;
}
@media (max-width: 768px) {
    .fd-grid-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.fd-status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.fd-status-actions a,
.fd-status-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 700;
    transition: .2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.fd-status-actions a:hover,
.fd-status-actions button:hover {
    transform: translateY(-1px);
}

.fd-status-draft {
    background: #fff3e0;
    color: #ef6c00;
}

.fd-status-completed {
    background: #e3f2fd;
    color: #1565c0;
}

.fd-status-validated {
    background: #e8f5e9;
    color: #2e7d32;
}

.fd-status-archived {
    background: #eceff1;
    color: #455a64;
}

.fd-status-deleted {
    background: #ffcfcf;
    color: #b15656;
}

@media (max-width: 768px) {
    .fd-status-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-start;
    }

    .fd-status-actions a,
    .fd-status-actions button {
        width: auto;
        padding: 8px 12px;
        margin: 0;
    }
}

.fd-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: .78rem;
    text-align: center;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.3;
}

.fd-status-badge-draft {
    background: #ededed;
    color: #75716e;
}

.fd-status-badge-completed {
    background: #e3f2fd;
    color: #1565c0;
}

.fd-status-badge-validated {
    background: #e8f5e9;
    color: #2e7d32;
}

.fd-status-badge-archived {
    background: #eceff1;
    color: #455a64;
}

.fd-user-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
}
.fd-user-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.fd-user-status-active {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}
.fd-user-status-active::before {
    background: #43a047;
}
.fd-user-status-inactive {
    background: #eceff1;
    color: #546e7a;
    border: 1px solid #cfd8dc;
}
.fd-user-status-inactive::before {
    background: #90a4ae;
}
[data-theme="dark"] .fd-user-status-active {
    background: #0d2e14;
    color: #66bb6a;
    border-color: #2e5e32;
}
[data-theme="dark"] .fd-user-status-active::before { background: #66bb6a; }
[data-theme="dark"] .fd-user-status-inactive {
    background: #1e2a32;
    color: #90a4ae;
    border-color: #2e3d48;
}
[data-theme="dark"] .fd-user-status-inactive::before { background: #546e7a; }

.fd-status-badge-en-cours {
    background: #fff3e0;
    color: #e67e22;
}
.fd-status-badge-termine {
    background: #e3f2fd;
    color: #2980b9;
}
.fd-status-badge-valide {
    background: #e8f5e9;
    color: #27ae60;
}
.fd-status-badge-archive {
    background: #eceff1;
    color: #7f8c8d;
}

.fd-status-badge-default {
    background: #f5f5f5;
    color: #666;
}
.fd-status-badge-signe {
    background: #e8f5e9;
    color: #27ae60;
}

[data-theme="dark"] .fd-status-badge-draft     { background: #2a2a2a; color: #a0a0a0; }
[data-theme="dark"] .fd-status-badge-completed { background: #0d2035; color: #5aabdf; }
[data-theme="dark"] .fd-status-badge-validated { background: #0d2a18; color: #4fc87a; }
[data-theme="dark"] .fd-status-badge-archived  { background: #1e2a30; color: #8aabb8; }
[data-theme="dark"] .fd-status-badge-en-cours  { background: #3a200a; color: #f0a05a; }
[data-theme="dark"] .fd-status-badge-valide    { background: #0d2a18; color: #4fc87a; }
[data-theme="dark"] .fd-status-badge-archive   { background: #1e2a30; color: #8aabb8; }
[data-theme="dark"] .fd-status-badge-signe     { background: #0d2a18; color: #4fc87a; }
[data-theme="dark"] .fd-status-badge-default   { background: #1e2a30; color: #8aabb8; }

.fd-page-id {
    font-size: .85em;
    font-weight: 700;
    color: #1d93c6;
    margin-left: .15em;
}
[data-theme="dark"] .fd-page-id { color: #5aabdf; }

.fd-page-subtitle {
    font-size: .65em;
    color: #5a7080;
    font-weight: 400;
}

.fd-card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.fd-card-title {
    margin: 0;
    font-weight: 700;
}
.fd-card-meta {
    margin: 4px 0 0;
    font-size: .82rem;
    color: #5a7080;
}

.fd-inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
}
.fd-select-status {
    border: 1px solid #c8dde8;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: .85rem;
    cursor: pointer;
    background: var(--fd-card-bg, #fff);
    color: var(--fd-text, #111);
}

.fd-section-title {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--fd-muted);
    margin: 28px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--fd-border);
}
.fd-section-title:first-of-type {
    margin-top: 0;
}

.fd-section-title-note {
    font-size: .8em;
    font-weight: 400;
    color: #5a7080;
}
.fd-accordion-note {
    font-size: .82rem;
    font-weight: 400;
    color: #8a9aaa;
}
.fd-link-muted {
    color: #8a9aaa;
    text-decoration: none;
    float: right;
}
.fd-link-muted:hover { color: var(--fd-accent); }

.fd-equip-info-block {
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--fd-bg-alt, #f4f8fb);
    border: 1px solid var(--fd-border);
    border-radius: 6px;
}
.fd-equip-info-name {
    font-size: .95rem;
    font-weight: 700;
    color: var(--fd-text);
    margin: 0 0 8px;
}
.fd-equip-info-rows { display: flex; flex-direction: column; gap: 4px; }
.fd-equip-info-row  { display: flex; align-items: baseline; gap: 8px; font-size: .82rem; }
.fd-equip-info-label { flex-shrink: 0; width: 52px; color: var(--fd-text-muted); font-weight: 600; }
.fd-equip-info-val   { color: var(--fd-text); }
[data-theme="dark"] .fd-equip-info-block { background: #1a2f40; }

.fd-addr-name {
    margin: 0;
    font-weight: 700;
}
.fd-addr-line {
    margin: 2px 0 0;
}
.fd-addr-meta {
    margin: 4px 0 0;
    font-size: .85rem;
    color: #5a7080;
}

.fd-detail-line {
    margin: 2px 0 0;
    font-size: .85rem;
}

.fd-sig-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.fd-sig-block {
    border: 1px solid #e2edf3;
    border-radius: 10px;
    padding: 16px;
}
.fd-sig-label {
    margin: 0 0 4px;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #5a7080;
    font-weight: 700;
}
.fd-sig-signer {
    margin: 0 0 12px;
    font-weight: 600;
}
.fd-sig-img-wrap {
    border: 1px solid #c8dde8;
    border-radius: 8px;
    padding: 6px;
    background: #f8fbfd;
    display: inline-block;
    margin-bottom: 8px;
}
.fd-sig-img {
    max-width: 100%;
    height: 80px;
    display: block;
}
.fd-sig-ok {
    margin: 0 0 8px;
    font-size: .82rem;
    color: #27ae60;
}
.fd-sig-none {
    margin: 0;
    color: #5a7080;
    font-size: .85rem;
}
.fd-sig-prompt {
    margin: 0 0 8px;
    font-size: .85rem;
    color: #5a7080;
}
.fd-sig-canvas-wrap {
    position: relative;
    border: 2px dashed #c8dde8;
    border-radius: 8px;
    background: #fafcfe;
    touch-action: none;
    max-width: 480px;
}
.fd-sig-canvas {
    display: block;
    width: 100%;
    height: 160px;
    border-radius: 6px;
    cursor: crosshair;
    touch-action: none;
}
.fd-sig-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #b0c4cc;
    font-size: .9rem;
    pointer-events: none;
    user-select: none;
}
.fd-sig-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.fd-accordion-body-card {
    border-top: none;
    border-radius: 0 0 var(--fd-radius, 2px) var(--fd-radius, 2px);
}
.fd-cf-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.fd-cf-row .fd-drag-handle {
    flex-shrink: 0;
    padding-top: 4px;
    cursor: grab;
}
.fd-cf-body {
    flex: 1;
    min-width: 0;
}
.fd-cf-body label,
.fd-cf-body .fd-label {
    display: block;
    margin-top: 0 !important;
    margin-bottom: 4px;
    font-weight: 600;
}
.fd-cf-body input.fd-input,
.fd-cf-body select.fd-input {
    width: 100%;
    box-sizing: border-box;
    margin-top: 0;
}
.fd-label-mt {
    margin-top: 14px !important;
}
.fd-hidden {
    display: none;
}
.fd-radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.fd-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .93rem;
    cursor: pointer;
}
.fd-checkbox-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .93rem;
    cursor: pointer;
    margin-top: 6px;
}

.fd-dashboard {
    padding: 8px 4px 40px;
}

.fd-dash-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 26px;
    padding: 0 15px;
}
.fd-dash-welcome h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #0b4f6c;
}
[data-theme="dark"] .fd-dash-welcome h1 {
    color: var(--fd-text);
}
.fd-dash-date {
    margin: 4px 0 0;
    font-size: .9rem;
    color: #888;
    padding: 0;
    text-transform: capitalize;
}

.fd-dash-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #444;
    margin: 24px 0 8px 4px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
[data-theme="dark"] .fd-dash-section-title {
    color: var(--fd-text-muted);
}

summary.fd-dash-section-title {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    font-size: 15px;
    font-weight: 800;
    margin: -12px -16px;
    padding: 10px 16px;
    border-radius: 2px;
    background: var(--fd-summary-bg);
    color: var(--fd-summary-text);
    overflow: hidden;
}
summary.fd-dash-section-title > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
summary.fd-dash-section-title .fd-dash-summary-count {
    margin-left: auto;
    margin-right: 10px;
    flex-shrink: 0;
}
summary.fd-dash-section-title .fd-dash-summary-count + .fd-dash-summary-toggle {
    margin-left: 0;
}
@media (max-width: 600px) {
    summary.fd-dash-section-title { font-size: 13px; padding: 9px 12px; }
    summary.fd-dash-section-title .fd-dash-summary-count { display: none; }
}
summary.fd-dash-section-title::-webkit-details-marker { display: none; }

details.fd-card[open] > summary.fd-dash-section-title {
    margin-bottom: 12px;
    border-radius: 2px 2px 0 0;
}

.fd-dash-summary-count {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,.8);
}
[data-theme="dark"] .fd-dash-summary-count {
    color: rgba(180,210,230,.8);
}

.fd-dash-summary-toggle {
    margin-left: auto;
    font-size: 20px;
    color: rgb(217 205 205 / 47%);
    background: rgb(215 214 214 / 15%);
    border-radius: 2px;
    padding: 7px 9px;
    flex-shrink: 0;
    display: inline-block;
    transition: transform .2s ease;
    transform: rotate(-90deg);
}
[data-theme="dark"] .fd-dash-summary-toggle {
    color: rgb(180 210 230 / 55%);
    background: rgba(180,210,230,.12);
}
details[open] > summary .fd-dash-summary-toggle {
    transform: rotate(0deg);
}

.fd-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin: 40px 0 40px;
}

.fd-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 14px;
    padding: 18px 12px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    text-decoration: none;
    color: inherit;
    transition: transform .15s, box-shadow .15s;
}
.fd-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.fd-stat-card.fd-dragging {
    opacity: .45;
}
.fd-stat-card.fd-drag-over {
    outline: 2px dashed #1d93c6;
    outline-offset: 2px;
}
[data-theme="dark"] .fd-stat-card.fd-drag-over {
    outline-color: #5aabdf;
}

.fd-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--ico-bg);
    color: var(--ico-c);
}
[data-theme="dark"] .fd-stat-icon {
    opacity: .75;
}

.fd-stat-icon-sites     { --ico-bg: #e3f2fd; --ico-c: #0b4f6c; }
.fd-stat-icon-equip     { --ico-bg: #e0f7fa; --ico-c: #00838f; }
.fd-stat-icon-readings  { --ico-bg: #f3e5f5; --ico-c: #6a1b9a; }
.fd-stat-icon-reports   { --ico-bg: #fff3e0; --ico-c: #e65100; }
.fd-stat-icon-users     { --ico-bg: #e8f5e9; --ico-c: #2e7d32; }
.fd-stat-icon-companies { --ico-bg: #fce4ec; --ico-c: #880e4f; }
.fd-stat-icon-tool-pt   {--ico-bg: #fde3e3;--ico-c: #0b4f6c;}

.fd-stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--fd-primary);
    line-height: 1;
}

.fd-dash-details { margin-top: 16px; }
.fd-time-muted   { color: var(--fd-text-muted); font-size: .82rem; }
.fd-quick-badge  { color: #e67e22; font-weight: 600; }
[data-theme="dark"] .fd-quick-badge { color: #f0a040; }

.fd-stat-label {
    font-size: .78rem;
    color: #666;
    text-align: center;
    font-weight: 500;
}
[data-theme="dark"] .fd-stat-label {
    color: var(--fd-text-muted);
}

@media (max-width: 700px) {
    .fd-stat-grid {
        margin: 12px 0 16px;
        grid-template-columns: repeat(2, 1fr);
    }
    .fd-dash-welcome h1 {
        font-size: 1.2rem;
    }
}

.fd-chart-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.fd-chart-tab {
    padding: 3px 11px;
    font-size: .76rem;
    font-weight: 600;
    font-family: inherit;
    border: 1.5px solid var(--fd-border);
    border-radius: 20px;
    background: transparent;
    color: var(--fd-text-muted);
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
    line-height: 1.5;
}
.fd-chart-tab:hover { border-color: #1d93c6; color: #1d93c6; }
.fd-chart-tab.active { background: #1d93c6; border-color: #1d93c6; color: #fff; }
[data-theme="dark"] .fd-chart-tab { border-color: #2a4a5e; color: #8aafc4; }
[data-theme="dark"] .fd-chart-tab:hover { border-color: #5aabdf; color: #5aabdf; }
[data-theme="dark"] .fd-chart-tab.active { background: #1d93c6; border-color: #1d93c6; color: #fff; }

.fd-dash-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.fd-dash-chart-card { padding: 16px 20px; }
.fd-dash-chart-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 8px;
}
.fd-dash-chart-title {
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--fd-text-muted);
}
.fd-dash-chart-total {
    font-size: .78rem;
    color: var(--fd-text-muted);
}
.fd-chart-header-right {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.fd-dash-chart-card .fd-chart-wrap {
    position: relative;
    height: 200px;
    overflow: hidden;
    max-width: 100%;
}
.fd-dash-chart-card .fd-chart-wrap canvas {
    max-width: 100% !important;
}

.fd-chart-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 10px;
    margin-top: 10px;
}
.fd-chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.fd-chart-legend-swatch {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    flex-shrink: 0;
}
.fd-chart-legend-label {
    font-size: .74rem;
    color: var(--fd-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 700px) {
    .fd-dash-charts { grid-template-columns: 1fr; }
    .fd-dash-chart-card .fd-chart-wrap { height: 200px; }
}

#fd-dash-blocks {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.fd-dash-block {
    margin: 10px 0;
    position: relative;
}
.fd-dash-drag-handle {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: #b0bec5;
    opacity: 0;
    transition: opacity .15s, color .15s, background .15s;
    z-index: 20;
    border-radius: 5px;
    user-select: none;
}
.fd-dash-block:hover .fd-dash-drag-handle { opacity: 1; }
.fd-dash-drag-handle:hover { color: #0b4f6c; background: rgba(11,79,108,.08); }
.fd-dash-block.fd-dragging { opacity: .45; cursor: grabbing; }
.fd-dash-block.fd-drag-over { outline: 2px dashed #1d93c6; outline-offset: 4px; border-radius: 6px; }
[data-theme="dark"] .fd-dash-drag-handle:hover { color: #5aabdf; background: rgba(29,147,198,.12); }
[data-theme="dark"] .fd-dash-block.fd-drag-over { outline-color: #5aabdf; }
.fd-dash-pinned-wrap {
    flex: 0 0 33%;
    max-width: 33%;
    max-height: 72px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fd-dash-pinned-notice {
    background: #fff8e1;
    border-left: 3px solid #f9a825;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: .88rem;
    color: #5d4037;
    flex-shrink: 0;
}
[data-theme="dark"] .fd-dash-pinned-notice {
    background: #2a2000;
    border-left-color: #f9a825;
    color: #f5d87a;
}

.fd-dash-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0 8px 2px;
}
.fd-dash-see-all {
    font-size: .82rem;
    color: var(--fd-primary);
    text-decoration: none;
    font-weight: 500;
}
.fd-dash-see-all:hover { text-decoration: underline; }

.fd-dash-readings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
@media (max-width: 900px) {
    .fd-dash-readings-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .fd-dash-readings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .fd-dash-pinned-wrap {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.fd-dash-reading-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: var(--fd-card-bg);
    border: 1px solid var(--fd-border);
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s, transform .15s;
}
.fd-dash-reading-card:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,.10);
    transform: translateY(-2px);
}
.fd-dash-reading-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.fd-dash-reading-name {
    font-weight: 600;
    font-size: .9rem;
    color: var(--fd-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fd-dash-quick-tag {
    font-size: .7rem;
    flex-shrink: 0;
}
.fd-dash-reading-site {
    font-size: .78rem;
    color: var(--fd-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fd-dash-reading-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}
.fd-dash-reading-fluid {
    font-size: .78rem;
    font-weight: 600;
    color: var(--fd-primary);
    background: rgba(29,147,198,.10);
    border-radius: 4px;
    padding: 1px 6px;
}
.fd-dash-reading-date {
    font-size: .75rem;
    color: var(--fd-text-muted);
}
.fd-dash-reading-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 6px;
}
.fd-dash-reading-co {
    font-size: .72rem;
    color: var(--fd-text-muted);
}

.fd-dash-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.fd-dash-inactive-list,
.fd-dash-activity-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}

.fd-isel-wrap {
    position: relative;
    display: inline-block;
    vertical-align: baseline;
}
.fd-isel-trigger {
    background: none;
    border: none;
    border-bottom: 1px dashed var(--fd-primary, #1d93c6);
    color: var(--fd-primary, #1d93c6);
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0 1px;
    outline: none;
    line-height: inherit;
}
.fd-isel-trigger:hover { border-bottom-style: solid; }
.fd-isel-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--fd-card-bg, #fff);
    border: 1px solid var(--fd-border, #dde3ea);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    padding: 4px 0;
    z-index: 300;
    white-space: nowrap;
    min-width: 80px;
    overflow: hidden;
}
.fd-isel-opt {
    display: block;
    width: 100%;
    padding: 7px 18px;
    font-size: .82rem;
    cursor: pointer;
    color: var(--fd-text);
    text-align: center;
    border-radius: 0;
    transition: background .12s;
}
.fd-isel-opt:hover { background: var(--fd-hover-bg, #f0f6fb); }
.fd-isel-opt input[type="radio"] { display: none; }
.fd-isel-opt.fd-isel-checked {
    color: var(--fd-primary, #1d93c6);
    font-weight: 700;
    background: rgba(29,147,198,.07);
}

.fd-dash-inactive-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--fd-border);
}
.fd-dash-inactive-list li:last-child { border-bottom: none; }
.fd-dash-inactive-name {
    font-size: .88rem;
    font-weight: 600;
    color: var(--fd-primary);
    text-decoration: none;
    grid-column: 1;
}
.fd-dash-inactive-name:hover { text-decoration: underline; }
.fd-dash-inactive-co {
    font-size: .75rem;
    color: var(--fd-text-muted);
    grid-column: 1;
}
.fd-dash-inactive-date {
    font-size: .75rem;
    color: var(--fd-text-muted);
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    white-space: nowrap;
}

.fd-dash-activity-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--fd-border);
}
.fd-dash-activity-list li:last-child { border-bottom: none; }
.fd-dash-act-ico {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 800;
    flex-shrink: 0;
    background: #88888820; color: #888;
}

.fd-dash-act-ico-reading    { background: #1d93c620; color: #1d93c6; }
.fd-dash-act-ico-bon        { background: #e67e2220; color: #e67e22; }
.fd-dash-act-ico-cerfa      { background: #7b68ee20; color: #7b68ee; }
.fd-dash-act-ico-assemblage { background: #2ecc7120; color: #2ecc71; }
.fd-dash-act-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.fd-dash-act-label {
    font-size: .85rem;
    font-weight: 500;
    color: var(--fd-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fd-dash-act-type {
    font-size: .72rem;
    font-weight: 700;
    color: var(--fd-text-muted);
    margin-right: 5px;
}
.fd-dash-act-sub {
    font-size: .75rem;
    color: var(--fd-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fd-dash-act-time {
    font-size: .72rem;
    color: var(--fd-text-muted);
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
}
.fd-dash-act-time:hover { color: var(--fd-primary); }

.fd-dash-widget {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
}
.fd-dash-widget-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--fd-border);
}
.fd-wpn-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.fd-wpn-info {
    font-size: .75rem;
    color: var(--fd-text-muted);
    min-width: 56px;
    text-align: center;
}
.fd-wpn-perpage,
.fd-card .fd-wpn-perpage {
    font-size: .78rem !important;
    font-weight: 400;
    padding: 0 4px 0 6px !important;
    border: 1.5px solid #c8dde8 !important;
    border-radius: 2px;
    background: #fff !important;
    color: #0b4f6c !important;
    cursor: pointer;
    width: 62px !important;
    height: 30px !important;
    margin: 0 !important;
    line-height: 30px;
    transition: background .12s, border-color .12s;
    appearance: auto;
}
.fd-wpn-perpage:hover,
.fd-card .fd-wpn-perpage:hover { background: #e4f0f7 !important; }
[data-theme="dark"] .fd-wpn-perpage,
[data-theme="dark"] .fd-card .fd-wpn-perpage {
    background: #1a2f40 !important;
    border-color: #2a4a5e !important;
    color: #c8dde8 !important;
}
[data-theme="dark"] .fd-wpn-perpage:hover,
[data-theme="dark"] .fd-card .fd-wpn-perpage:hover {
    background: #223d52 !important;
    border-color: #4a7a9b !important;
}

.fd-report-number {
    font-family: monospace;
    font-size: .82rem;
    background: #eef4f7;
    color: #0b4f6c;
    padding: 2px 7px;
    border-radius: 6px;
    white-space: nowrap;
}

.fd-report-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.fd-btn-sm {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    border: none;
}

.fd-btn-view   { background: #e3f2fd; color: #0b4f6c; }
.fd-btn-dl     { background: #e8f5e9; color: #2e7d32; }
.fd-btn-regen  { background: #fff3e0; color: #e65100; }

.fd-btn-view:hover  { background: #bbdefb; }
.fd-btn-dl:hover    { background: #c8e6c9; }
.fd-btn-regen:hover { background: #ffe0b2; }

.fd-inline-alert {
    display: inline-block;
    margin: 0 0 15px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #fff3cd;
    color: #856404;
    font-size: .9rem;
    font-weight: 700;
}

.fd-pdf-card {
    margin-top: 18px;
    text-align: center;
    background: none;
    box-shadow: none;
}

.fd-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 45px 20px 25px;
    padding-top: 15px;
    /* border-top: 1px solid #e5e7eb; */
}
.fd-card-actions-row {
    flex-direction: row !important;
    justify-content: flex-start;
}
.fd-card-actions form {
    display: contents;
}

.fd-button-sm {
    font-size: .82rem;
    padding: 6px 12px;
}

.fd-accordion-empty {
    padding: 16px;
    color: #7f8c8d;
    text-align: center;
}

.fd-analyse-month {
    margin: 16px 0 8px;
}
.fd-analyse-month-past .fd-analyse-month-title {
    color: #a0b0bb;
}
.fd-analyse-month-title {
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #0b4f6c;
    padding: 6px 0 4px;
    border-bottom: 1px solid #d0e4ee;
    margin: 0 0 10px;
}
.fd-analyse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}
.fd-analyse-card {
    display: block;
    background: #fafafa;
    border-radius: 6px;
    border-left: 4px solid #b0c8d8;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 4px rgba(11,79,108,.08);
    transition: box-shadow .15s;
}
.fd-analyse-card:hover {
    box-shadow: 0 3px 10px rgba(11,79,108,.14);
}
.fd-analyse-card-overdue  { border-left-color: #e53935; background: #fff5f5; }
.fd-analyse-card-urgent   { border-left-color: #f57c00; background: #fff8f0; }
.fd-analyse-card-ok       { border-left-color: #43a047; background: #f4fbf4; }
.fd-analyse-card-site {
    font-size: .75rem;
    font-weight: 600;
    color: #5a7080;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 2px;
}
.fd-analyse-card-name {
    font-size: .95rem;
    font-weight: 700;
    color: #0b4f6c;
    margin-bottom: 4px;
}
.fd-analyse-card-meta {
    font-size: .78rem;
    color: #7a8f9a;
    margin-bottom: 8px;
}
.fd-analyse-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.fd-analyse-interval {
    font-size: .72rem;
    font-weight: 600;
    background: #e3f2fd;
    color: #0b4f6c;
    border-radius: 4px;
    padding: 2px 7px;
}
.fd-analyse-days {
    font-size: .8rem;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 8px;
}
.fd-analyse-card-overdue-badge { background: #fde8e8; color: #c62828; }
.fd-analyse-card-urgent-badge  { background: #fef0e0; color: #e65100; }
.fd-analyse-card-ok-badge      { background: #e8f5e9; color: #2e7d32; }
.fd-analyse-card-lastdate {
    font-size: .72rem;
    color: #9aabb5;
    margin-top: 6px;
}
.fd-analyse-loss { color: #c62828; font-weight: 600; }

.fd-dormants-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: #f5f7fa;
    border-bottom: 1px solid #dde3ea;
    flex-wrap: wrap;
}
.fd-dormants-toolbar-label {
    font-size: .82rem;
    font-weight: 700;
    color: #5a7080;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.fd-dormants-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .9rem;
    cursor: pointer;
    font-weight: 400;
}
.fd-dormants-radio input[type="radio"] {
    accent-color: #0b4f6c;
    cursor: pointer;
}
.fd-analyse-gain { color: #2e7d32; font-weight: 600; }
.fd-toolbar-label {
    font-size: .82rem;
    font-weight: 600;
    color: #5a7080;
}
.fd-toolbar-scope {
    font-size: .75rem;
    color: var(--fd-text-muted);
    font-style: italic;
    white-space: nowrap;
}
@media (max-width: 600px) {
    .fd-toolbar-scope { display: none; }
}
@media (max-width: 600px) {
    .fd-analyse-grid {
        grid-template-columns: 1fr;
    }
}

.fd-th-sort {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.fd-th-sort:hover {
    color: #1d93c6;
}
/* FlÃ¨ches en Ã©chappements Unicode : indÃ©pendantes de l'encodage du fichier
   (les caractÃ¨res littÃ©raux avaient Ã©tÃ© doublement encodÃ©s). */
.fd-th-sort::after {
    content: ' \2195';   /* haut-bas */
    opacity: .35;
    font-size: .8em;
}
.fd-th-sort[data-sort-dir="asc"]::after {
    content: ' \2191';   /* haut */
    opacity: 1;
    color: #0b4f6c;
}
.fd-th-sort[data-sort-dir="desc"]::after {
    content: ' \2193';   /* bas */
    opacity: 1;
    color: #0b4f6c;
}

.fd-td-id {
    font-weight: 600;
    color: var(--fd-primary);
    white-space: nowrap;
}
.fd-td-date {
    white-space: nowrap;
    font-size: .88rem;
}
.fd-td-sm {
    font-size: .85rem;
}

.fd-td-muted {
    font-size: .82rem;
    color: var(--fd-text-muted);
}

.fd-meta-info {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    font-size: .85rem;
    color: #6b7280;
}

.fd-card-danger {
    border-left: 4px solid #dc2626;
}
.fd-card-danger h2 {
    color: #dc2626;
    margin-bottom: 14px;
}
.fd-card-danger .fd-danger-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.fd-card-danger .fd-danger-actions form {
    margin: 0;
}
.fd-card-danger .fd-danger-actions button,
.fd-card-danger .fd-danger-actions .fd-button {
    margin: 0;
}

.fd-company-title {
    margin-top: 28px;
    margin-bottom: 12px;
}

.fd-user-card {
    margin-bottom: 12px;
}
.fd-admin-stat-line {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 18px;
    background: #eef4f8;
    border-radius: 6px;
    margin-bottom: 16px;
}
.fd-admin-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0b4f6c;
}
.fd-admin-stat-label {
    font-size: .9rem;
    color: #5a7080;
}

/* Dossiers : aide sous le titre de la section techniciens */
.fd-folder-hint {
    font-size: .82rem;
    color: #5a7080;
    margin: 2px 0 8px;
    line-height: 1.5;
}
[data-theme="dark"] .fd-folder-hint {
    color: #8fb3c7;
}

/* Signature : bouton d'apposition explicite de la signature de profil */
.fd-sig-apply {
    margin-bottom: 8px;
}
.fd-sig-or {
    font-size: .82rem;
    color: #5a7080;
    margin: 4px 0 8px;
}
[data-theme="dark"] .fd-sig-or {
    color: #8fb3c7;
}

/* Corbeille des photos : vignette grisée + actions de restauration */
.fd-photo-trashed {
    opacity: .85;
}
.fd-photo-trashed .fd-photo-img {
    filter: grayscale(35%);
}
.fd-photo-trash-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.fd-photo-trash-actions form {
    display: inline;
    margin: 0;
}

/* Corbeille du catalogue de facturation : liste simple avec restauration */
.fd-trash-cat-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}
.fd-trash-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 0;
    border-bottom: 1px solid #e0e7ef;
}
[data-theme="dark"] .fd-trash-cat-item {
    border-bottom-color: #1e3f54;
}
.fd-trash-cat-item:last-child {
    border-bottom: none;
}
.fd-trash-cat-name {
    flex: 1;
    min-width: 160px;
    font-weight: 600;
}
.fd-trash-cat-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.fd-trash-cat-actions form {
    display: inline;
}

/* Marque un Ã©lÃ©ment supprimÃ©. PartagÃ©e avec la liste des utilisateurs. */
.fd-trash-item {
    border-left: 3px solid #e74c3c;
    opacity: .88;
}

/* â”€â”€â”€ Corbeille : accordÃ©ons autonomes â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   Volontairement indÃ©pendants de .fd-tree-* et .fd-device-company-group, qui
   servent les pages Sites et Postes et portent des rÃ¨gles propres Ã  ces
   contextes (rendu multi-colonnes, flex-basis en pleine largeur, couleur de
   texte claire hÃ©ritÃ©e du bandeau). RÃ©utilisÃ©es ici, elles produisaient des
   fiches impossibles Ã  replier et du texte blanc sur fond blanc.
   RÃ¨gle Ã  tenir : un <details> reste en display:block, sinon le navigateur
   cesse de masquer son contenu Ã  l'Ã©tat repliÃ©.                             */
.fd-tr-node {
    display: block;
    margin-bottom: 10px;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgb(0 0 0 / 22%);
}
.fd-tr-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
}
.fd-tr-head::-webkit-details-marker {
    display: none;
}
.fd-tr-head::after {
    content: '\25B8';
    margin-left: auto;
    font-size: 1rem;
    line-height: 1;
    transition: transform .15s ease;
}
.fd-tr-node[open] > .fd-tr-head::after {
    transform: rotate(90deg);
}
.fd-tr-count {
    font-size: .8rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgb(255 255 255 / 18%);
}
.fd-tr-body {
    padding: 10px 12px;
    background: #f4f8fb;
}
[data-theme="dark"] .fd-tr-body {
    background: #0e1c28;
}

/* Niveau 1 : sociÃ©tÃ© (super administration uniquement) */
.fd-tr-company > .fd-tr-head {
    background: linear-gradient(45deg, #2c3e50, #1a252f);
    color: #fff;
}

/* Niveau 2 : catÃ©gorie, une teinte par nature d'Ã©lÃ©ment */
.fd-tr-cat > .fd-tr-head           { color: #fff; }
.fd-tr-cat-users > .fd-tr-head     { background: linear-gradient(45deg, #5d4e8a, #3d3060); }
.fd-tr-cat-sites > .fd-tr-head     { background: linear-gradient(45deg, #1d6fa4, #0d4f7a); }
.fd-tr-cat-equips > .fd-tr-head    { background: linear-gradient(45deg, #1a7a6e, #0f5248); }
.fd-tr-cat-readings > .fd-tr-head  { background: linear-gradient(45deg, #6b7280, #4b5563); }

/* Niveau 3 : fiche d'un Ã©lÃ©ment supprimÃ© */
.fd-tr-item {
    margin-bottom: 6px;
    box-shadow: 0 1px 2px rgb(0 0 0 / 16%);
}
.fd-tr-item > .fd-tr-head {
    background: #fff;
    color: #1a3a4a;
    font-weight: 600;
    padding: 9px 14px;
}
.fd-tr-date {
    font-size: .85rem;
    font-weight: 400;
    color: #5a7080;
    margin-left: auto;
}
.fd-tr-item > .fd-tr-head::after {
    margin-left: 12px;
    color: #5a7080;
}
.fd-tr-item-body {
    padding: 2px 14px 12px;
    background: #fff;
}
[data-theme="dark"] .fd-tr-item > .fd-tr-head,
[data-theme="dark"] .fd-tr-item-body {
    background: #16283a;
}
[data-theme="dark"] .fd-tr-item > .fd-tr-head {
    color: #c8dde8;
}
[data-theme="dark"] .fd-tr-date,
[data-theme="dark"] .fd-tr-item > .fd-tr-head::after {
    color: #8fb3c7;
}

@media (max-width: 600px) {
    .fd-tr-head {
        flex-wrap: wrap;
    }
    .fd-tr-date {
        width: 100%;
        margin-left: 0;
    }
}
.fd-trash-meta {
    font-size: .85rem;
    color: #5a7080;
    margin: 3px 0px 16px 0px;
}
.fd-trash-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.fd-trash-actions form {
    display: flex;
}
@media (max-width: 600px) {
    .fd-trash-actions { flex-direction: column; }
    .fd-trash-actions form { width: 100%; }
    .fd-trash-actions form button { width: 100%; }
}

.fd-archivage-title {
    margin-top: 32px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e7ef;
    color: #1a3a4a;
    font-size: 1.25rem;
}

.fd-role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
    margin-right: 6px;
}

.fd-role-super-admin {
    background: #fde2e2;
    color: #b91c1c;
}

.fd-role-admin {
    background: #e3f2fd;
    color: #1565c0;
}

.fd-role-user {
    background: #e8f5e9;
    color: #2e7d32;
}

.fd-role-default {
    background: #f3f4f6;
    color: #4b5563;
}

.fd-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 10px 14px;
    background: #f5f7f9;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
}

.fd-breadcrumb a {
    color: #0b4f6c;
    text-decoration: none;
    font-weight: 500;
}

.fd-breadcrumb a:hover {
    text-decoration: underline;
}

.fd-breadcrumb span {
    color: #94a3b8;
    font-weight: 600;
}

.fd-breadcrumb strong {
    color: #111827;
    font-weight: 700;
}

@media (max-width: 700px) {
    .fd-breadcrumb {
        gap: 6px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

.fd-back-stack {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    margin: 10px;
}
.fd-back-stack .fd-back-button {
    margin: 0;
}
.fd-actions-top {
    min-height: 44px;
    display: flex;
    align-items: center;
}
/* Titre de page centre en mobile (bureau inchange), marge reglable ici */
@media (max-width: 600px) {
    h1 {
        text-align: center;
        margin: 4px 0 14px;
    }
}
.fd-back-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px 5px 6px;
    margin: 10px;
    background: var(--fd-btn-bg);
    border-radius: 2px;
    text-decoration: none;
    color: var(--fd-btn-text);
    font-weight: 500;
}
.fd-back-secondary {
    background: var(--fd-body-bg);
    color: #4a7a8a;
    font-weight: 400;
    font-size: 0.9rem;
}
.fd-back-secondary .fd-back-icon {
    background: var(--fd-border);
    color: var(--fd-body-bg);
}
.fd-back-icon {
    display: inline-block;
    font-size: 1rem;

    background: var(--fd-border);
    padding: 5px 6px 3px 5px;
    transform: rotate(90deg);
    color: var(--fd-btn-bg);
}

.fd-offline-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    font-size: .85rem;
    font-weight: 600;
}

.fd-offline-banner--offline {
    background: #fff3cd;
    color: #856404;
}

.fd-offline-banner--pending {
    background: #e3f2fd;
    color: #1565c0;
}

.fd-offline-banner--offline #fd-offline-label::before {
    content: '\26A0  Mode hors ligne';
}

.fd-offline-banner--pending #fd-offline-label::before {
    content: '\2191 Synchronisation en cours';
}

.fd-stepper {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #c5d5de;
    border-radius: 6px;
    background: #f0f6fa;
    color: #0b4f6c;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 32px;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: none;
}

.fd-stepper:active {
    background: #d7e9f0;
    transform: scale(0.95);
}

.fd-stepper:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.fd-measure-range {
    display: block;
    font-size: 11px;
    color: #8fa8b5;
    margin-top: 2px;
    margin-bottom: 4px;
    font-weight: 400;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

.fd-measure-card--ok {
    border-color: #2e7d32;
    border-width: 1px 1px 1px 4px;
}

.fd-measure-card--warn {
    border-color: #f0a500;
    border-width: 1px 1px 1px 4px;
    background: #fffdf0;
}

@media (max-width: 700px) {
    .fd-stepper {
        width: 30px;
        height: 36px;
        line-height: 36px;
        font-size: 1.2rem;
    }
    .fd-input-row {
        gap: 4px;
    }
    .fd-input-row span {
        font-size: .78rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 28px;
    }
}

.fd-accordion {
    border: 1px solid var(--fd-border);
    border-radius: 2px;
    margin: 10px 20px;
    background: var(--fd-card-bg);
    box-shadow: 0 1px 4px rgba(11,79,108,.07);
}
.fd-summary {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px 11px 8px 15px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: var(--fd-text);
    background: var(--fd-card-bg);
    border-radius: 2px;
    border-bottom: 1px solid var(--fd-border-light);
    list-style: none;
    user-select: none;
    overflow: hidden;
    transition: background .15s;
}
.fd-summary:hover {
    background: var(--fd-btn-bg);
}
.fd-summary > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fd-summary::-webkit-details-marker { display: none; }
details[open] > .fd-summary {
    border-radius: 4px 4px 0 0;
}

.fd-accordion-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 11px 8px 22px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: var(--fd-accordion-com-text);
    background: var(--fd-accordion-com-bg);
    border-radius: 2px;
    list-style: none;
    user-select: none;
    border-left: none;
    transition: filter .15s;
    overflow: hidden;
}
.fd-accordion-group {
    display: flex;
    flex-direction: column;
    gap: 0px;
    margin-top: 3px;
}
.fd-accordion-summary > span:first-child {
    min-width: 0;
    flex: 1 1 auto;
    white-space: normal;
    overflow-wrap: anywhere;
}
.fd-accordion-right {
    flex-shrink: 1;
    min-width: 0;
}
@media (max-width: 600px) {
    .fd-accordion-summary {
        font-size: .9rem;
        padding: 8px 8px 8px 22px;
    }
    .fd-accordion-summary .fd-accordion-counts {
        display: none;
    }
}
.fd-accordion-summary:hover {
    filter: brightness(1.08);
}
.fd-accordion-toggle {
    margin-left: auto;
    font-size: 20px;
    color: #1d93c6e3;
    background: rgba(255, 255, 255, .15);
    box-shadow: 0px 0px 1px #282828;
    border-radius: 4px;
    padding: 10px 9px 7px 10px;
    flex-shrink: 0;
    display: inline-block;
    transition: transform .2s ease;
    transform: rotate(-90deg);
}
details[open] > summary .fd-accordion-toggle {
    transform: rotate(0deg);
}

.fd-accordion-summary.fd-accordion-summary-dark {
    background: linear-gradient(45deg, #0b3d5c, #071f30);
}
[data-theme="dark"] .fd-accordion-summary.fd-accordion-summary-dark {
    background: linear-gradient(45deg, #0a2a3d, #061520);
}
.fd-accordion-summary::-webkit-details-marker { display: none; }
details[open] > .fd-accordion-summary {
    border-radius: 4px 4px 0 0;
}

.fd-accordion-summary-com {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 11px 8px 22px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: var(--fd-accordion-com-text);
    background: var(--fd-accordion-com-bg);
    border-radius: 2px;
    list-style: none;
    user-select: none;
    border-left: none;
    transition: filter .15s;
    flex-wrap: wrap;
}
.fd-accordion-summary-com .fd-sum-name {
    flex: 1;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: 0;
    margin-right: 0;
    font-size: 1rem;
    color: inherit;
    text-align: left;
}
.fd-accordion-summary-com .fd-sum-addr {
    width: 100%;
    order: 2;
    font-weight: 400;
    font-size: .85rem;
    opacity: .75;
}
.fd-accordion-summary-com .fd-sum-cpcity {
    width: 100%;
    order: 3;
    font-weight: 400;
    font-size: .85rem;
    opacity: .75;
}
.fd-accordion-summary-com .fd-dash-summary-toggle {
    order: 1;
    margin-left: auto;
    flex-shrink: 0;
    align-self: flex-start;
}
.fd-accordion-summary-com:hover {
    filter: brightness(1.08);
}
.fd-accordion-summary-com::-webkit-details-marker { display: none; }
details[open] > .fd-accordion-summary-com {
    border-radius: 4px 4px 0 0;
}
@media (max-width: 600px) {
    .fd-accordion-summary-com {
        font-size: .9rem;
        padding: 8px 8px 8px 22px;
    }
    .fd-accordion-summary-com .fd-accordion-counts {
        display: none;
    }
}

.fd-accordion-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.fd-accordion-right .fd-accordion-toggle {
    margin-left: 0;
}

.fd-accordion-counts {
    font-size: .82rem;
    font-weight: 500;
    color: #0e1c28;
    font-size: 16px;
    margin-right: 12px;
    margin-left: 12px;
    min-width: 0;
    overflow-wrap: anywhere;
}
[data-theme="dark"] .fd-accordion-counts {
    color: #b4d2e6;
}

.fd-quota-badge {
    display: inline-block;
    font-size: 15px;
    font-weight: 700;
    padding: 7px 13px;
    border-radius: 20px;
    background: #e0f7fa;
    color: #00838f;
    border: 1px solid #b2ebf2;
    vertical-align: middle;
    margin-left: 8px;
}
.fd-quota-badge.fd-quota-full {
    background: #fde8e8;
    color: #c0392b;
    border-color: #f5c6c6;
}

.fd-nav-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 40px 20px;
    padding: 6px 14px 6px 5px;
    background: #0874a2;
    border-radius: 2px;
    text-decoration: none;
    color: #ffffff;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s;
}
.fd-nav-card:hover {
    filter: brightness(1.06);
    color: #063246;
}
.fd-nav-card span {
    color: #8ebed2;
    font-size: 24px;
    padding: 4px 10px;
    margin: 0px 5px 0px 4px;
    background: #188cbe;
}

.fd-accordion-sub {
    margin: 6px 12px;
    border-color: #d0e6f0;
    box-shadow: none;
}
.fd-accordion-summary-sub .fd-accordion-counts {
    color: #5a8fa8;
    font-weight: 400;
}

.fd-accordion-summary-sub {
    font-size: .9rem;
    color: #08384d;
    font-weight: 600;
    padding: 10px 14px;
    background: linear-gradient(90deg, #f0f7fb 0%, #f8fbfd 100%);
    border-left-color: #5ab0d8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.fd-accordion-summary-sub:hover {
    background: linear-gradient(90deg, #e0f0f8 0%, #f0f7fb 100%);
}
details[open] > .fd-accordion-summary-sub {
    background: linear-gradient(90deg, #e0f0f8 0%, #f0f7fb 100%);
}

[data-theme="dark"] .fd-accordion-summary-sub {
    color: var(--fd-text);
    background: linear-gradient(90deg, #122030 0%, #1a2e40 100%);
    border-left-color: #2a7a9e;
}
[data-theme="dark"] .fd-accordion-summary-sub .fd-accordion-counts {
    color: var(--fd-text-muted);
}
[data-theme="dark"] .fd-accordion-summary-sub:hover,
[data-theme="dark"] details[open] > .fd-accordion-summary-sub {
    background: linear-gradient(90deg, #1a2e40 0%, #1e3a50 100%);
}

.fd-accordion-sub:not([data-doc-type]) > .fd-accordion-summary-sub {
    background: linear-gradient(45deg, #1d93c6, #006894);
    color: #fff;
    border-left-color: #005a7a;
}
.fd-accordion-sub:not([data-doc-type]) > .fd-accordion-summary-sub .fd-accordion-counts {
    color: rgba(255,255,255,.75);
}
.fd-accordion-sub:not([data-doc-type]) > .fd-accordion-summary-sub:hover,
.fd-accordion-sub:not([data-doc-type])[open] > .fd-accordion-summary-sub {
    background: linear-gradient(45deg, #1a85b5, #005a7a);
}
[data-theme="dark"] .fd-accordion-sub:not([data-doc-type]) > .fd-accordion-summary-sub {
    background: linear-gradient(45deg, #0f5a80, #063d58);
    color: #c8e8f5;
    border-left-color: #0a4060;
}
[data-theme="dark"] .fd-accordion-sub:not([data-doc-type]) > .fd-accordion-summary-sub:hover,
[data-theme="dark"] .fd-accordion-sub:not([data-doc-type])[open] > .fd-accordion-summary-sub {
    background: linear-gradient(45deg, #126a95, #074a6a);
}

/* Rapports : sous-accordeons colores par type de document (memes couleurs que
   "Activite recente" du dashboard). La couleur cascade aux equipements imbriques.
   Scope #fd-report-sites : n'affecte pas cerfas/create. */
#fd-report-sites [data-doc-type="releves"] { --doc-c: #1d93c6; --doc-bg: #1d93c620; --doc-bg2: #1d93c636; }
#fd-report-sites [data-doc-type="cerfas"]  { --doc-c: #7b68ee; --doc-bg: #7b68ee20; --doc-bg2: #7b68ee36; }
#fd-report-sites [data-doc-type="bons"]    { --doc-c: #e67e22; --doc-bg: #e67e2220; --doc-bg2: #e67e2236; }

/* En-tete de section (Releves / CERFA / Bons) : couleur du type de document.
   '>' = uniquement l'en-tete direct, pas les equipements imbriques. */
#fd-report-sites [data-doc-type] > .fd-accordion-summary-sub {
    background: var(--doc-bg);
    color: var(--doc-c);
    border-left-color: var(--doc-c);
}
#fd-report-sites [data-doc-type] > .fd-accordion-summary-sub .fd-accordion-counts {
    color: var(--doc-c);
    opacity: .75;
}
#fd-report-sites [data-doc-type] > .fd-accordion-summary-sub:hover,
#fd-report-sites [data-doc-type][open] > .fd-accordion-summary-sub {
    background: var(--doc-bg2);
}

/* Sous-accordeons equipement : degrade bleu plein + texte blanc, comme
   les equipements sur sites/index (variantes clair et sombre). */
#fd-report-sites .fd-report-equip > .fd-accordion-summary-sub {
    background: linear-gradient(45deg, #1d93c6, #006894);
    color: #fff;
    border-left-color: #005a7a;
}
#fd-report-sites .fd-report-equip > .fd-accordion-summary-sub .fd-accordion-counts {
    color: rgba(255,255,255,.75);
}
#fd-report-sites .fd-report-equip > .fd-accordion-summary-sub:hover,
#fd-report-sites .fd-report-equip[open] > .fd-accordion-summary-sub {
    background: linear-gradient(45deg, #1a85b5, #005a7a);
}
[data-theme="dark"] #fd-report-sites .fd-report-equip > .fd-accordion-summary-sub {
    background: linear-gradient(45deg, #0f5a80, #063d58);
    color: #c8e8f5;
    border-left-color: #0a4060;
}
[data-theme="dark"] #fd-report-sites .fd-report-equip > .fd-accordion-summary-sub:hover,
[data-theme="dark"] #fd-report-sites .fd-report-equip[open] > .fd-accordion-summary-sub {
    background: linear-gradient(45deg, #126a95, #074a6a);
}

.fd-pagination {
    display: flex;
    gap: 4px;
    padding: 8px 0 4px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.fd-period-pill {
    padding: 6px 14px;
    border-radius: 4px;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    background: #f0f4f8;
    color: #5a7080;
    transition: background .15s, color .15s;
}
.fd-period-pill.active,
.fd-period-pill:hover {
    background: #93cde6;
    color: #fff;
}
.fd-period-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
}
.fd-period-nav a {
    text-decoration: none;
    color: #0b4f6c;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 2px 6px;
}
.fd-period-nav strong {
    font-size: .95rem;
    min-width: 120px;
    text-align: center;
    display: inline-block;
}
.fd-period-nav strong.fd-period-nav--year {
    min-width: 60px;
}

.fd-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    color: #0b4f6c;
    background: #e3f2fd;
    border-radius: 6px;
    padding: 3px 6px;
    margin-bottom: 5px;
    text-decoration: none;
    vertical-align: middle;
    line-height: 1;
}
.fd-nav-link:hover {
    background: #bbdefb;
}
.fd-nav-link svg {
    display: block;
}

.fd-logo-preview-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f5f7fa;
    border: 1px solid #dde3ea;
    border-radius: 6px;
    padding: 10px 16px;
    margin: 6px 0 16px;
}
.fd-logo-preview {
    display: block;
    max-width: 140px;
    max-height: 56px;
    object-fit: contain;
}

.fd-form-row {
    display: flex;
    gap: 12px;
}
.fd-form-row > div {
    flex: 1;
}
.fd-form-row label {
    display: block;
}

.fd-card-toggle-active[data-active="1"] {
    border-left: 4px solid #27ae60;
    margin-top: 14px;
}
.fd-card-toggle-active[data-active="0"] {
    border-left: 4px solid #7f0909;
    margin-top: 14px;
}
.fd-toggle-status {
    margin: 0 0 8px;
    font-weight: 600;
}

.fd-badge-suspended {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: #b71c1c;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 8px;
}

.fd-info-table {
    border-collapse: collapse;
    margin: 10px 0;
}
.fd-info-table th,
.fd-info-table td {
    padding: 4px 0;
    border: none;
    vertical-align: top;
    font-weight: 400;
    color: var(--fd-text);
    text-align: left;
}
.fd-info-table th {
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
    padding-right: 16px;
    color: var(--fd-primary);
}

.fd-equip-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.fd-equip-archived-badge {
    background: #f0f0f0;
    color: #7f8c8d;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: .82rem;
    font-weight: 600;
}
[data-theme="dark"] .fd-equip-archived-badge {
    background: #1e2e3a;
    color: #8a9aaa;
    border-color: #2a3f54;
}
.fd-photo-block {
    display: block;
    text-decoration: none;
    color: inherit;
}
.fd-photo-block-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}
.fd-photo-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--fd-primary);
}
.fd-photo-count {
    font-size: .82rem;
    color: var(--fd-text-muted);
    margin-left: 2px;
}
.fd-photo-arrow {
    margin-left: auto;
    color: var(--fd-border);
    font-size: 1.2rem;
}
.fd-photo-thumbs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.fd-photo-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--fd-border-light);
}
.fd-cerfa-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.fd-cerfa-title {
    font-weight: 700;
    color: var(--fd-primary);
    margin: 0;
}
.fd-cerfa-id-badge {
    font-size: .8rem;
    font-weight: 600;
    background: #e3f2fd;
    color: #0b4f6c;
    border-radius: 4px;
    padding: 2px 7px;
    margin-right: 6px;
}
[data-theme="dark"] .fd-cerfa-id-badge {
    background: #1a3348;
    color: #6ab8d8;
}
.fd-cerfa-time {
    font-weight: 400;
    font-size: .85rem;
    color: var(--fd-text-muted);
}
.fd-cerfa-meta {
    margin: 4px 0 0;
    color: var(--fd-text-muted);
    font-size: .9rem;
}
.fd-cerfa-tech {
    margin: 4px 0 0;
    color: var(--fd-text-muted);
    font-size: .82rem;
}
.fd-cerfa-none {
    margin: 0;
    color: var(--fd-text-muted);
}

.fd-input-cp {
    flex: 0 0 120px;
}
.fd-input-city {
    flex: 1;
}
.fd-label-tight {
    display: block;
    margin-top: 0;
    font-weight: 700;
}

.fd-period-btn {
    padding: 7px 16px;
    border: 1.5px solid #d0dde6;
    border-radius: 999px;
    background: #fff;
    color: #5a7080;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.fd-period-btn.active {
    background: #0b4f6c;
    color: #fff;
    border-color: #0b4f6c;
}

.fd-device-company-group > summary {
    background: linear-gradient(45deg, #2c3e50, #1a252f);
    color: #fff;
}
.fd-device-company-alert > summary {
    background: linear-gradient(45deg, #c0392b, #922b21);
}
.fd-device-badge-count {
    font-size: .75rem;
    font-weight: 600;
    background: #e67e22;
    color: #fff;
    border-radius: 10px;
    padding: 2px 10px;
    vertical-align: middle;
    margin-left: 8px;
}
/* Page Postes : pas de rendu multi-colonnes (hÃ©ritÃ© de la page Sites),
   les lignes de postes ont besoin de toute la largeur.
   La largeur est imposÃ©e par width et non par flex-basis : dans un parent
   flex en colonne, flex-basis dÃ©signerait la hauteur et Ã©tirerait le bloc
   repliÃ© sur toute la hauteur disponible. */
.fd-device-company-group {
    flex: 0 0 auto;
    width: 100%;
}
.fd-device-company-group .fd-tree-group-content {
    columns: 1;
}
/* Summary utilisateur : une seule ligne, infos tronquables, toggle Ã  droite */
.fd-device-company-group .fd-tree-site > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
}
.fd-device-company-group .fd-tree-site > summary > span:first-of-type {
    margin-left: auto !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right !important;
    font-size: .88rem !important;
    font-weight: 400 !important;
    color: var(--fd-text) !important;
    opacity: .85;
}
.fd-device-company-group .fd-tree-site > summary > .fd-dash-summary-toggle {
    flex-shrink: 0;
    margin-left: 0;
}

.fd-device-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #eef4f8;
    background: #fff;
}
.fd-device-row:last-child {
    border-bottom: none;
}
[data-theme="dark"] .fd-device-row {
    background: var(--fd-card-bg);
    border-bottom-color: var(--fd-border-light);
    color: var(--fd-text);
}
.fd-device-row-pending {
    border-left: 3px solid #e67e22;
}
.fd-device-row-revoked {
    border-left: 3px solid #c0392b;
    opacity: .78;
}
.fd-device-row-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}
.fd-device-row-name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.fd-device-row-name strong {
    font-size: .95rem;
    color: #0b4f6c;
}
.fd-device-status-badge {
    font-size: .7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.fd-device-status-pending  { background: #fef0e6; color: #c0671a; }
.fd-device-status-approved { background: #e6f4ea; color: #1a7a40; }
.fd-company-status-active   { background: #e6f4ea; color: #1a7a40; }
.fd-company-status-inactive { background: #fdecea; color: #b0261c; }
.fd-company-status-archived { background: #eef4f8; color: #5a7080; }
.fd-co-archived { opacity: .75; }
.fd-co-inactive { border-left: 3px solid #c0392b; }
.fd-user-dot { flex-shrink: 0; display: inline; vertical-align: middle; border-radius: 50%; box-shadow: 0 0 4px rgb(0 0 0 / 30%); }
.fd-co-summary-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 8px;
}
.fd-co-counts {
    font-size: .8rem;
    font-weight: 400;
    color: rgba(255,255,255,.8);
}
.fd-co-content {
    padding: 10px 14px 12px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fd-co-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.fd-co-actions form { display: flex; }
.fd-co-protected {
    color: #aaa;
    font-style: italic;
}
@media (max-width: 600px) {
    .fd-co-summary-meta { flex-direction: column; align-items: flex-end; gap: 3px; }
    .fd-co-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
}
.fd-device-status-revoked  { background: #fdecea; color: #b0261c; }
.fd-device-meta {
    font-size: .8rem;
    color: #5a7080;
}
.fd-device-code-small code {
    background: #f0f6fa;
    border: 1px solid #c8dde8;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: .82rem;
    letter-spacing: .1em;
    color: #0b4f6c;
}
.fd-device-row-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}
.fd-device-row-actions form {
    display: flex;
}
.fd-button-warning {
    background: #e67e22;
    color: #fff;
    border-color: #c0671a;
}
.fd-button-warning:hover {
    background: #cf6d17;
}
.fd-button-danger {
    background: #c0392b;
    color: #fff;
    border-color: #a93226;
}
.fd-button-danger:hover {
    background: #a93226;
}
@media (max-width: 600px) {
    .fd-device-row {
        flex-direction: column;
    }
    .fd-device-row-actions {
        width: 100%;
    }
    .fd-device-row-actions form {
        flex: 1;
    }
    .fd-device-row-actions form button {
        width: 100%;
    }
}

.fd-site-toolbar-right {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: auto;
}

.fd-report-sites {
    padding: 0px 10px 25px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    margin: 20px 10px 50px 10px;
}
/* Blocs societe (super_admin) et sites hors dossier : pleine largeur,
   seuls les dossiers (.fd-tree-group) se mettent en 2 colonnes. */
.fd-report-sites > .fd-tree-group.fd-device-company-group,
.fd-report-sites > .fd-accordion {
    flex: 0 0 100%;
}
/* Quand un tableau est ouvert quelque part, la grille de colonnes repasse en
   pleine largeur (1 colonne) pour afficher le tableau confortablement. Elle
   revient a 2 colonnes des que le tableau est referme. */
.fd-report-cols:has(details[open] > .fd-report-table-wrap) {
    display: block;
}
.fd-report-table-wrap {
    margin: 8px 12px 12px;
    overflow-x: auto;
}
.fd-report-group-content {
    padding: 8px 0 0;
    background: #f4f8fb;
}

/* Dossiers en 2 colonnes indÃ©pendantes : ouvrir un dossier ne pousse
   que les dossiers de sa propre colonne. */
.fd-report-cols {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    flex: 1 1 100%;
}
.fd-report-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fd-report-col > .fd-tree-group {
    flex: 0 0 auto;
    width: 100%;
}
@media (max-width: 767px) {
    .fd-report-cols {
        flex-direction: column;
        align-items: stretch;
    }
    .fd-report-col {
        flex: 0 0 auto;
        width: 100%;
    }
}
[data-theme="dark"] .fd-report-group-content {
    background: #0e1c28;
}
.fd-report-equip-nodoc {
    padding: 8px 12px 12px;
}
.fd-report-equip-actions {
    padding: 8px 12px 12px;
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}
@media (max-width: 600px) {
    .fd-report-equip-actions { flex-wrap: wrap; }
    .fd-report-equip-actions .fd-button-sm { flex: 1 1 auto; text-align: center; }
}
.fd-button-sm {
    font-size: .82rem;
    padding: 6px 12px;
    white-space: nowrap;
    text-align: center;
    margin: 2px 0;
}
.fd-cerfa-date-cell {
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}
.fd-cerfa-date-time {
    color: #8a9aaa;
    font-size: .78rem;
}
.fd-report-type-cell {
    font-size: .82rem;
}

.fd-page-btn {
    padding: 4px 12px;
    border: 1.5px solid #c8dde8;
    border-radius: 2px;
    background: #fff;
    color: #0b4f6c;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    height: 30px;
    line-height: 1;
    transition: background .12s, color .12s, border-color .12s;
}
.fd-page-btn:hover:not([disabled]) {
    background: #e4f0f7;
}
.fd-page-btn.active {
    background: #0b4f6c;
    color: #fff;
    border-color: #0b4f6c;
}
.fd-page-btn[disabled] {
    opacity: .35;
    cursor: default;
}
[data-theme="dark"] .fd-page-btn {
    background: #1a2f40;
    border-color: #2a4a5e;
    color: #c8dde8;
}
[data-theme="dark"] .fd-page-btn:hover:not([disabled]) {
    background: #223d52;
    border-color: #4a7a9b;
}
[data-theme="dark"] .fd-page-btn.active {
    background: #1d93c6;
    border-color: #1d93c6;
    color: #fff;
}
.fd-fluide-toolbar {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-wrap: wrap;
    margin: 10px 8px 22px 18px;
}
.fd-fluide-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.fd-fluide-toolbar:has(.fd-site-toolbar-right) .fd-site-toolbar-right .fd-fluide-search-input {
    width: 240px;
}
.fd-report-search-wrap {
    margin-left: auto;
}
.fd-report-search-wrap .fd-fluide-search-input {
    width: 240px;
}
@media (max-width: 600px) {
    .fd-report-search-wrap .fd-fluide-search-input {
        width: 100%;
        box-sizing: border-box;
    }
    .fd-fluide-toolbar:has(.fd-report-search-wrap) {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }
    .fd-fluide-toolbar:has(.fd-report-search-wrap) .fd-fluide-toolbar-left {
        flex-shrink: 0;
        width: auto;
    }
    .fd-fluide-toolbar:has(.fd-report-search-wrap) .fd-report-search-wrap {
        flex: 1;
        min-width: 0;
    }
}
@media (max-width: 600px) {
    .fd-fluide-toolbar {
        flex-direction: column;
        align-items: flex-start;
        margin: 25px 8px 16px;
    }
    .fd-fluide-toolbar .fd-fluide-toolbar-left {
        justify-content: flex-start;
        width: 54%;
    }
    .fd-fluide-toolbar:has(.fd-fluide-date-input):not(:has(.fd-report-search-wrap)) .fd-fluide-toolbar-left {
        width: 100%;
    }
    .fd-fluide-toolbar .fd-fluide-toolbar-left .fd-main-button-inline,
    .fd-fluide-toolbar .fd-fluide-toolbar-left .fd-fluide-search-input {
        width: 100%;
        box-sizing: border-box;
    }
    .fd-fluide-toolbar:has(.fd-site-toolbar-right) {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }
    .fd-fluide-toolbar:has(.fd-site-toolbar-right) .fd-fluide-toolbar-left {
        flex-shrink: 0;
    }
    .fd-fluide-toolbar:has(.fd-site-toolbar-right) .fd-site-toolbar-right {
        flex: 1;
        min-width: 0;
    }
    .fd-fluide-toolbar:has(.fd-site-toolbar-right) .fd-site-toolbar-right .fd-fluide-search-input {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    .fd-fluide-toolbar-left {
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
    }
    .fd-fluide-toolbar-left .fd-toolbar-label {
        display: none;
    }
    .fd-fluide-date-input {
        flex: 1;
        min-width: 100px;
        width: 100%;
        box-sizing: border-box;
        font-size: .82rem;
        padding: 7px 5px;
    }
    .fd-fluide-toolbar-left .fd-button {
        white-space: nowrap;
        padding: 7px 10px;
        margin: 0;
        font-size: .82rem;
    }
}
.fd-fluide-sort-btn {
    margin: 0;
    cursor: pointer;
}
.fd-fluide-search-input {
    padding: 8px 10px;
    margin: 4px;
    border: 1px solid #c8dde8;
    border-radius: 4px;
    font-size: .9rem;
    min-width: 180px;
    outline: none;
}
[data-theme="dark"] .fd-fluide-search-input {
    background: var(--fd-card-bg);
    color: var(--fd-text);
    border-color: var(--fd-border);
}
[data-theme="dark"] .fd-fluide-search-input::placeholder {
    color: var(--fd-text-muted);
}
.fd-fluide-date-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.fd-fluide-date-label {
    font-size: .85rem;
    color: #5a7080;
    font-weight: 600;
}
.fd-fluide-date-input {
    padding: 7px 10px;
    border: 1px solid #c8dde8;
    border-radius: 2px;
    font-size: .85rem;
    color: #0b4f6c;
    outline: none;
    background: #fff;
}
[data-theme="dark"] .fd-fluide-date-input {
    background: var(--fd-card-bg);
    color: var(--fd-text);
    border-color: var(--fd-border);
}
[data-theme="dark"] .fd-fluide-date-input::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.5);
}
.fd-fluide-company-select {
    padding: 7px 10px;
    border: 1px solid #1d93c6;
    border-radius: 2px;
    font-size: .85rem;
    font-weight: 600;
    color: #0b4f6c;
    background: #eef6fb;
    outline: none;
    cursor: pointer;
}
[data-theme="dark"] .fd-fluide-company-select {
    color: var(--fd-text);
    background: var(--fd-card-bg);
    border-color: var(--fd-primary);
}
.fd-fluide-date-btn {
    margin: 0;
}
.fd-fluide-date-reset {
    margin: 0;
    background: #f0f4f7;
    color: #5a7080;
    border-color: #c8dde8;
}
.fd-fluide-count {
    margin-left: auto;
    padding: 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--fd-text);
}
.fd-report-type-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
    padding: 6px 14px 10px;
}
.fd-report-type-filter-label {
    font-size: .85rem;
    font-weight: 600;
    color: #5a7080;
    white-space: nowrap;
}
.fd-report-type-select {
    padding: 6px 10px;
    border: 1px solid #c8d4db;
    border-radius: 6px;
    font-size: .88rem;
    color: #0b4f6c;
    background: #fff;
    cursor: pointer;
}

.fd-fluide-filter-active {
    margin: 0 14px 10px;
    font-size: .85rem;
    color: #0b4f6c;
    background: #e3f2fd;
    border: 1px solid #b3d4e8;
    border-radius: 4px;
    padding: 6px 12px;
    display: inline-block;
}

.fd-fluide-equip-summary-inner {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.fd-fluide-equip-refrigerant {
    font-weight: 400;
    color: var(--fd-text-muted);
    font-size: .8rem;
}
.fd-fluide-equip-stats {
    font-size: .78rem;
    color: var(--fd-text-muted);
    font-weight: 400;
}
.fd-fluide-sub-wrap {
    margin: 8px 12px 12px;
}
.fd-th-right {
    text-align: right;
}
.fd-fluide-td-ajout {
    text-align: right;
    color: #27ae60;
    font-weight: 600;
}
.fd-fluide-td-retrait {
    text-align: right;
    color: #e74c3c;
    font-weight: 600;
}
.fd-fluide-td-recyclage {
    text-align: right;
    color: #8e44ad;
    font-weight: 600;
}
.fd-fluide-td-zero {
    text-align: right;
    color: #aaa;
}
.fd-fluide-detail-row {
    background: #f8fbfd;
}
[data-theme="dark"] .fd-fluide-detail-row {
    background: #0e1c28;
}
.fd-fluide-detail-td {
    padding: 3px 10px 8px;
    border-top: none;
}
.fd-fluide-detail-meta {
    font-size: .78rem;
    color: var(--fd-text-muted);
    display: inline-flex;
    flex-wrap: wrap;
    gap: 12px;
}
.fd-fluide-teq {
    color: #7b4f00;
}
[data-theme="dark"] .fd-fluide-teq {
    color: #e8a440;
}
.fd-cerfa-badge {
    border-radius: 4px;
    padding: 2px 8px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}
.fd-cerfa-badge-en_cours  { background: #fef0e6; color: #e67e22; border-color: #f5c6a0; }
.fd-cerfa-badge-termine   { background: #eaf4fb; color: #2980b9; border-color: #a9d4ef; }
.fd-cerfa-badge-valide    { background: #e9f7ef; color: #27ae60; border-color: #a3d9b7; }
.fd-cerfa-badge-archive   { background: #f0f0f0; color: #7f8c8d; border-color: #c8c8c8; }
[data-theme="dark"] .fd-cerfa-badge-en_cours  { background: #3a200a; color: #f0a05a; border-color: #7a3d10; }
[data-theme="dark"] .fd-cerfa-badge-termine   { background: #0d2235; color: #5aabdf; border-color: #1a4d70; }
[data-theme="dark"] .fd-cerfa-badge-valide    { background: #0d2a18; color: #4fc87a; border-color: #1a5e30; }
[data-theme="dark"] .fd-cerfa-badge-archive   { background: #1e2a30; color: #8aabb8; border-color: #2e4050; }

.fd-cerfa-view-h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: #5a7080; font-weight: 700; margin-bottom: 8px; }
.fd-cerfa-view-kv { margin-top: 4px; }
.fd-cerfa-view-muted { color: #5a7080; }
.fd-cerfa-view-label { font-weight: 600; color: #5a7080; font-size: .9rem; }
.fd-cerfa-view-success { color: #27ae60; font-weight: 600; }
.fd-cerfa-view-danger { color: #c0392b; font-weight: 600; }
.fd-cerfa-view-danger-note { color: #c0392b; font-size: .82rem; }
.fd-cerfa-view-warn { color: #e09000; font-weight: 600; }
.fd-cerfa-view-co2 { display: inline-block; background: #fff8e1; border-left: 3px solid #f9a825; padding: 4px 8px; border-radius: 0 4px 4px 0; color: #7b4f00; font-size: .85rem; margin-top: 4px; }
.fd-cerfa-view-co2-detail { color: #9a7500; font-size: .78rem; }
.fd-cerfa-view-sig-divider { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #e2edf3; }
.fd-cerfa-view-sig-label { font-size: .8rem; color: #5a7080; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.fd-cerfa-view-sig-img { border: 1px solid #c8dde8; border-radius: 8px; padding: 8px; display: inline-block; background: #f8fbfd; margin-bottom: 10px; }
.fd-cerfa-view-sig-img img { max-width: 100%; height: 120px; display: block; }
.fd-cerfa-view-canvas-wrap { position: relative; border: 2px dashed #c8dde8; border-radius: 8px; background: #fafcfe; max-width: 480px; touch-action: none; }
.fd-cerfa-view-canvas-wrap canvas { display: block; width: 100%; height: 160px; border-radius: 6px; cursor: crosshair; touch-action: none; }
.fd-cerfa-view-canvas-hint { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #b0c4cc; font-size: .9rem; pointer-events: none; user-select: none; }
.fd-cerfa-view-sig-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.fd-hidden { display: none; }
[data-theme="dark"] .fd-cerfa-view-h2 { color: var(--fd-text-muted); }
[data-theme="dark"] .fd-cerfa-view-muted { color: var(--fd-text-muted); }
[data-theme="dark"] .fd-cerfa-view-sig-divider { border-color: var(--fd-border); }
[data-theme="dark"] .fd-cerfa-view-sig-img { border-color: var(--fd-border); background: var(--fd-card-bg); }
[data-theme="dark"] .fd-cerfa-view-canvas-wrap { border-color: var(--fd-border); background: var(--fd-card-bg); }
[data-theme="dark"] .fd-cerfa-view-co2 { background: #2a1e00; border-color: #a07800; color: #e0b040; }
[data-theme="dark"] .fd-cerfa-view-co2-detail { color: #b08020; }

.fd-fluide-tfoot-row {
    font-weight: 700;
    background: #f0f7fb;
}
[data-theme="dark"] .fd-fluide-tfoot-row {
    background: #0e1c28;
}
.fd-fluide-tfoot-label {
    text-align: right;
    color: var(--fd-text-muted);
}
.fd-fluide-site-total {
    margin: 0 12px 16px;
    padding: 10px 14px;
    background: #e8f4fb;
    border-radius: 4px;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    font-size: .88rem;
    color: var(--fd-text);
}
[data-theme="dark"] .fd-fluide-site-total {
    background: #0e1c28;
}
.fd-fluide-site-total-label {
    font-weight: 700;
    color: var(--fd-primary);
}
.fd-fluide-group-content {
    display: block;
    margin: 0 20px;
    padding: 8px 0 0;
    background: #f4f8fb;
}
[data-theme="dark"] .fd-fluide-group-content {
    background: #0e1c28;
}
/* Un dossier ouvert passe pleine largeur (comme sites/index et reports). */
#fd-fluide-sites > .fd-tree-group[open] {
    flex: 0 0 100%;
}
.fd-fluide-pages {
    margin-bottom: 24px;
}
.fd-fluide-bilan-card-wrap {
    margin: 30px 0 50px;
}
.fd-fluide-hist-card {
    margin-top: 24px;
}
.fd-fluide-section-title {
    text-align: left;
    margin: 0 0 18px;
    font-size: 1rem;
    color: var(--fd-primary);
}
.fd-period-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.fd-fluide-bilan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.fd-fluide-bilan-tile {
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}
.fd-fluide-bilan-ajout    { background: #e8f5e9; }
.fd-fluide-bilan-retrait  { background: #fdecea; }
.fd-fluide-bilan-recyclage{ background: #f3e5f5; }
.fd-fluide-bilan-nb       { background: #e3f2fd; }
[data-theme="dark"] .fd-fluide-bilan-ajout    { background: #0d2a18; }
[data-theme="dark"] .fd-fluide-bilan-retrait  { background: #2a0d0d; }
[data-theme="dark"] .fd-fluide-bilan-recyclage{ background: #1e0d2a; }
[data-theme="dark"] .fd-fluide-bilan-nb       { background: #0d1e2a; }
.fd-fluide-bilan-value {
    font-size: 1.5rem;
    font-weight: 800;
}
.fd-fluide-bilan-ajout     .fd-fluide-bilan-value { color: #2e7d32; }
.fd-fluide-bilan-retrait   .fd-fluide-bilan-value { color: #c62828; }
.fd-fluide-bilan-recyclage .fd-fluide-bilan-value { color: #6a1b9a; }
.fd-fluide-bilan-nb        .fd-fluide-bilan-value { color: #0b4f6c; }
[data-theme="dark"] .fd-fluide-bilan-ajout     .fd-fluide-bilan-value { color: #4fc87a; }
[data-theme="dark"] .fd-fluide-bilan-retrait   .fd-fluide-bilan-value { color: #e57373; }
[data-theme="dark"] .fd-fluide-bilan-recyclage .fd-fluide-bilan-value { color: #ce93d8; }
[data-theme="dark"] .fd-fluide-bilan-nb        .fd-fluide-bilan-value { color: #4ab0d8; }
.fd-fluide-bilan-unit {
    font-size: .9rem;
}
.fd-fluide-bilan-label {
    font-size: .78rem;
    font-weight: 600;
    margin-top: 4px;
    color: var(--fd-text-muted);
}
.fd-fluide-chart-section {
    margin-top: 4px;
    padding: 15px;
    background: #ffffff;
}
.fd-fluide-chart-title {
    font-size: .8rem;
    font-weight: 600;
    color: var(--fd-text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.fd-fluide-chart-wrap {
    position: relative;
    height: 220px;
}
.fd-fluide-empty {
    color: var(--fd-text-muted);
    text-align: center;
    padding: 24px 0;
}
.fd-table-wrap-groups {
    padding: 0;
    margin-bottom: 20px;
}
.fd-table-wrap-flush {
    padding: 0;
}

.fd-flat-accordion {
    margin-top: 14px;
}

/* equipements/index.php : grille propre des groupes par type.
   Scope par l'id => n'affecte pas les autres pages en .fd-tree. */
#fd-eq-tree {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    align-items: start;
    gap: 12px;
}
#fd-eq-tree > .fd-accordion {
    margin: 0;
}
/* Un groupe de type ouvert s'etale sur toute la largeur (comme sites/index),
   adapte a la grille : span de toutes les colonnes. Ferme => 1 colonne. */
#fd-eq-tree > .fd-accordion[open] {
    grid-column: 1 / -1;
}

/* admin/users.php : grille propre des utilisateurs (scope id).
   Les blocs societe (super_admin) s'etalent sur toute la largeur. */
#fd-user-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    align-items: start;
    gap: 12px;
}
#fd-user-list > .fd-device-company-group {
    grid-column: 1 / -1;
}

/* sites/index.php : un dossier ouvert passe pleine largeur pour afficher ses
   sites plus large (sinon coince dans sa colonne 50%). Ferme => retour 50%. */
#fd-site-tree > .fd-tree-group[open] {
    flex: 0 0 100%;
}

.fd-td-site-name {
    font-weight: 600;
    color: var(--fd-table-th);
}
.fd-td-muted {
    font-size: .88rem;
    color: var(--fd-muted, #5a7080);
}
[data-theme="dark"] .fd-td-muted {
    color: #7a9bb0;
}
.fd-td-sm {
    font-size: .82rem;
}
.fd-td-none {
    color: #aaa;
}
[data-theme="dark"] .fd-td-none {
    color: #4a6070;
}
.fd-group-badge {
    color: #fff;
    background: var(--grp, #78909c);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: .78rem;
    font-weight: 600;
    display: inline-block;
}
.fd-td-nowrap {
    white-space: nowrap;
}

.fd-folder-actions-bottom {
    margin-top: 50px;
}
.fd-folder-create-body {
    padding: 16px 0 4px;
    margin-bottom: 35px;
}
.fd-folders-create-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
}
.fd-folders-create-form .fd-input {
    flex: 1;
    min-width: 180px;
    padding: 9px 12px;
    border: 1px solid var(--fd-border);
    border-radius: 8px;
    font-size: .95rem;
    background: var(--fd-card-bg);
    color: var(--fd-text);
    box-sizing: border-box;
}
.fd-folder-item {
    margin-bottom: 10px;
}
/* Poignee de glisser-deposer (reordonnancement des dossiers) */
.fd-folder-drag {
    display: inline-flex;
    align-items: center;
    cursor: grab;
    opacity: .5;
    flex-shrink: 0;
    margin-right: 2px;
    transition: opacity .15s;
    touch-action: none;
}
.fd-folder-drag:hover { opacity: 1; }
.fd-folder-drag:active { cursor: grabbing; }
/* garde poignee + nom colles a gauche, le compteur/chevron a droite */
.fd-folder-name { margin-right: auto; }
.fd-folder-item.fd-dragging {
    opacity: .45;
}
.fd-folder-item.fd-drag-over {
    outline: 2px dashed #1d93c6;
    outline-offset: 2px;
    border-radius: 4px;
}
[data-theme="dark"] .fd-folder-item.fd-drag-over {
    outline-color: #5aabdf;
}
.fd-folder-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.fd-folder-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fd-folder-rename-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.fd-folder-rename-form .fd-input {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid var(--fd-border);
    border-radius: 6px;
    font-size: .9rem;
    background: var(--fd-card-bg);
    color: var(--fd-text);
    box-sizing: border-box;
}
.fd-folder-rename-form .fd-button-sm,
.fd-folder-actions > form:last-child .fd-button-sm {
    width: 90px;
    flex-shrink: 0;
}
.fd-folder-sites-title {
    font-weight: 700;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--fd-primary);
    margin-bottom: 8px;
}
.fd-folder-sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px 16px;
    margin-bottom: 12px;
}
.fd-folder-site-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .9rem;
    cursor: pointer;
    color: var(--fd-text);
}
.fd-folder-site-label input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: var(--fd-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.fd-user-folders-fieldset {
    border: 1px solid var(--fd-border-light);
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 20px;
}
.fd-user-folders-fieldset > legend {
    font-weight: 700;
    padding: 0 8px;
    color: var(--fd-primary);
    font-size: 1rem;
}
.fd-user-folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px 20px;
    margin-top: 10px;
}
.fd-user-folders-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    cursor: pointer;
    color: var(--fd-text);
}
.fd-user-folders-label input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: var(--fd-primary);
    cursor: pointer;
    flex-shrink: 0;
}
.fd-user-folders-hint {
    font-size: .8rem;
    color: var(--fd-text-muted);
    margin-top: 8px;
}

.ue-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
    gap: 10px 16px;
    margin-top: 8px;
}
.ue-grid label {
    margin: 0;
    font-weight: 600;
    font-size: .9rem;
    color: var(--fd-text);
}
.ue-grid input:not([type=checkbox]),
.ue-grid select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--fd-border-light);
    border-radius: 8px;
    font-size: .95rem;
    box-sizing: border-box;
    background: var(--fd-card-bg);
    color: var(--fd-text);
}
.ue-grid input:not([type=checkbox]):focus,
.ue-grid select:focus {
    outline: none;
    border-color: var(--fd-primary);
    box-shadow: 0 0 0 3px rgba(11, 79, 108, .1);
}
[data-theme="dark"] .ue-grid input:not([type=checkbox]):focus,
[data-theme="dark"] .ue-grid select:focus {
    box-shadow: 0 0 0 3px rgba(74, 176, 216, .15);
}
.ue-separator {
    grid-column: 1 / -1;
    border: none;
    border-top: 1px solid var(--fd-border-light);
    margin: 4px 0;
}
.ue-checkbox-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ue-checkbox-row input[type=checkbox] {
    width: 18px;
    height: 18px;
    accent-color: var(--fd-primary);
    cursor: pointer;
}

.perm-fieldset {
    border: 1px solid var(--fd-border-light);
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 20px;
}
.perm-fieldset > legend {
    font-weight: 700;
    padding: 0 8px;
    color: var(--fd-primary);
    font-size: 1rem;
}
.perm-groups {
    display: flex;
    flex-direction: column;
    margin-top: 8px;
}
.perm-group {
    padding: 14px 0;
    border-bottom: 1px solid var(--fd-border-light);
}
.perm-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.perm-group-title {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--fd-primary);
    margin-bottom: 10px;
}
.perm-group-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
}
.perm-group-items label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    font-size: .9rem;
    cursor: pointer;
    color: var(--fd-text);
}
.fd-input-upper {
    text-transform: uppercase;
}
.fd-input-upper::placeholder {
    text-transform: none;
}
.fd-row-2 {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.fd-row-2 > div {
    flex: 1;
    min-width: 0;
}
.fd-row-2 > div input,
.fd-row-2 > div select {
    width: 100%;
    box-sizing: border-box;
}

.fd-row-cp-ville {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.fd-row-cp-ville .fd-cp {
    flex: 0 0 110px;
}
.fd-row-cp-ville .fd-ville {
    flex: 1;
    min-width: 0;
}
.fd-row-cp-ville input {
    width: 100%;
    box-sizing: border-box;
}

.perm-group-items input[type=checkbox] {
    width: 17px;
    height: 17px;
    accent-color: var(--fd-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.fd-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.fd-modal-box {
    background: var(--fd-card-bg);
    border-radius: 8px;
    padding: 28px;
    min-width: 320px;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.fd-modal-title {
    margin: 0 0 18px;
    font-size: 1rem;
    color: var(--fd-primary);
}

.fd-label-sm {
    font-size: .85rem;
    font-weight: 600;
    color: #5a7080;
    display: block;
    margin-bottom: 4px;
}
[data-theme="dark"] .fd-label-sm {
    color: var(--fd-text-muted);
}
.fd-color-input {
    width: 48px;
    height: 38px;
    border: 1px solid #c8dde8;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}
.fd-color-swatch {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    vertical-align: middle;
    background: var(--grp);
}
.fd-color-swatch-text {
    font-size: .8rem;
    color: #7f8c8d;
    margin-left: 6px;
}
[data-theme="dark"] .fd-color-swatch-text {
    color: var(--fd-text-muted);
}
.fd-form-inline {
    display: inline;
}
.fd-form-contents {
    display: contents;
}
.fd-sort-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #5a7080;
    font-size: 1rem;
    padding: 2px 4px;
}
.fd-td-sort {
    white-space: nowrap;
    padding: 4px 6px;
}
.fd-checkbox-inline {
    width: auto;
    margin: 0;
}
.fd-label-flex {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.fd-input-full {
    width: 100%;
    box-sizing: border-box;
}
.fd-flex-row-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.fd-flex-end {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.fd-alert-banner {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
}
.fd-alert-banner-success {
    background: #e8f5e9;
    border-left: 4px solid #27ae60;
    color: #1b5e20;
}
[data-theme="dark"] .fd-alert-banner-success {
    background: #0d2e14;
    color: #66bb6a;
    border-left-color: #2e7d32;
}

.fd-teq-result {
    margin-top: 6px;
    font-size: .85rem;
    color: #7b4f00;
    background: #fff8e1;
    border-left: 3px solid #f9a825;
    padding: 6px 10px;
    border-radius: 0 4px 4px 0;
}
[data-theme="dark"] .fd-teq-result {
    background: #2a1f00;
    color: #f9a825;
}

.fd-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}
.fd-photo-card {
    padding: 0;
    overflow: hidden;
    position: relative;
}
.fd-photo-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}
.fd-photo-meta {
    padding: 6px 10px 8px;
}
.fd-photo-caption {
    margin: 0 0 2px;
    font-size: .82rem;
}
.fd-photo-caption-placeholder {
    color: #a0b8c8;
    font-style: italic;
}
.fd-photo-date {
    margin: 2px 0 0;
    font-size: .75rem;
    color: #8a9aaa;
}
.fd-photo-delete-wrap {
    position: absolute;
    top: 6px;
    right: 6px;
}
.fd-photo-delete-btn {
    background: rgba(0,0,0,.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}
.fd-photo-add-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.fd-photo-add-btn {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}
.fd-photo-preview-img {
    max-width: 100%;
    max-height: 140px;
    border-radius: 8px;
    border: 1px solid #d0e4ee;
    object-fit: cover;
}
.fd-photo-caption-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #c8dce8;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: .9rem;
    box-sizing: border-box;
}
.fd-photo-caption-saved {
    margin: 0 0 2px;
    font-size: .82rem;
    color: #3a5060;
}
.fd-photo-preview-wrap {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.fd-photo-add-card {
    margin-bottom: 16px;
}
.fd-photo-add-title {
    margin: 0 0 12px;
}

.fd-view-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.fd-h1-flush {
    margin: 0;
}
.fd-h2-flush {
    margin: 0;
}
.fd-archived-badge {
    background: #f0f0f0;
    color: #7f8c8d;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: .82rem;
    font-weight: 600;
}
[data-theme="dark"] .fd-archived-badge {
    background: #2a2a2a;
    color: #9aa0a6;
    border-color: #444;
}

.fd-cerfa-fieldset {
    border: 1px solid #e2edf3;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}
[data-theme="dark"] .fd-cerfa-fieldset {
    border-color: var(--fd-border);
}
.fd-cerfa-legend {
    font-weight: 700;
    color: var(--fd-primary);
    padding: 0 6px;
}
.fd-cerfa-req {
    color: #e74c3c;
}
.fd-cerfa-opt {
    font-weight: 400;
    color: #5a7080;
    font-size: .85rem;
}
.fd-cerfa-note {
    margin: 4px 0 0;
    font-size: .9rem;
    color: #5a7080;
}
.fd-cerfa-note-sm {
    margin: 2px 0 0;
    font-size: .85rem;
    color: #5a7080;
}
.fd-cerfa-note-xs {
    margin: 2px 0 8px;
    font-size: .8rem;
    color: #5a7080;
}
.fd-cerfa-note-warn {
    margin: 2px 0 8px;
    font-size: .8rem;
    color: #e74c3c;
}
.fd-cerfa-note-orange {
    margin: 6px 0 0;
    font-size: .85rem;
    color: #e09000;
}
.fd-cerfa-inner {
    padding: 12px 14px;
}
.fd-cerfa-info-box {
    margin: 0;
    border-top: none;
    border-radius: 0 0 4px 4px;
}
.fd-cerfa-subcard {
    margin: 0;
    background: #f8fbfd;
}
[data-theme="dark"] .fd-cerfa-subcard {
    background: rgba(255,255,255,.03);
}

.fd-bug-modal {
    border: none;
    border-radius: 16px;
    padding: 0;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.fd-bug-modal-inner {
    padding: 28px 28px 24px;
}
.fd-bug-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.fd-bug-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--fd-primary);
    margin: 0;
}
.fd-bug-modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
}
.fd-bug-modal-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: #5a7080;
    margin-bottom: 6px;
}
.fd-bug-modal-select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #d0dde6;
    border-radius: 10px;
    font-size: .95rem;
    margin-bottom: 14px;
    background: #f8fbfd;
}
[data-theme="dark"] .fd-bug-modal-select {
    background: var(--fd-input-bg);
    border-color: var(--fd-border);
    color: var(--fd-text);
}
.fd-bug-modal-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #d0dde6;
    border-radius: 10px;
    font-size: .95rem;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
    background: #f8fbfd;
    margin-bottom: 18px;
}
[data-theme="dark"] .fd-bug-modal-textarea {
    background: var(--fd-input-bg);
    border-color: var(--fd-border);
    color: var(--fd-text);
}
.fd-bug-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.fd-bug-modal-cancel {
    padding: 9px 18px;
    border: 1.5px solid #d0dde6;
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    font-size: .9rem;
    color: #5a7080;
}
[data-theme="dark"] .fd-bug-modal-cancel {
    background: var(--fd-card-bg);
    border-color: var(--fd-border);
    color: var(--fd-text);
}
.fd-bug-modal-submit {
    padding: 9px 20px;
    background: var(--fd-primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
}
.fd-bug-modal-sent {
    color: #1a7c4a;
    font-weight: 600;
    text-align: center;
    padding: 12px 0;
}

.fd-card-mb {
    margin-bottom: 16px;
}
.fd-card-mb20 {
    margin-bottom: 20px;
}
.fd-card-mt {
    margin-top: 16px;
}
.fd-card-mt20 {
    margin-top: 20px;
}

.fd-releve-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.fd-releve-meta {
    margin: 0 0 4px;
    font-size: .85rem;
    color: #7f8c8d;
}
.fd-status-open-link {
    font-size: .82rem;
    padding: 6px 12px;
    display: inline-block;
    margin-top: 10px;
}

.fd-td-bold-primary {
    font-weight: 600;
    color: var(--fd-primary);
    white-space: nowrap;
}
.fd-td-tech {
    font-size: .82rem;
    color: #5a7080;
}
.fd-td-center {
    text-align: center;
}

.fd-td-sub {
    font-size: .8rem;
}
.fd-td-ua {
    font-size: .8rem;
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.fd-rapides-empty {
    padding: 16px;
    color: #7f8c8d;
    text-align: center;
}

.fd-404-btn {
    width: auto;
    margin: 0;
    padding: 11px 22px;
    text-decoration: none;
}

.fd-report-title {
    text-align: left;
    margin-bottom: 10px;
}
.fd-report-notes-text {
    white-space: pre-wrap;
    margin: 0;
}
.fd-report-note-wrap {
    margin-top: 8px;
}
.fd-report-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #d0dde3;
    border-radius: 8px;
    font-size: .93rem;
    resize: vertical;
}
[data-theme="dark"] .fd-report-textarea {
    background: var(--fd-input-bg);
    border-color: var(--fd-border);
    color: var(--fd-text);
}

.fd-cerfa-list-link {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 10px;
}
.fd-cerfa-list-title {
    margin: 0;
    font-weight: 700;
    color: var(--fd-primary);
}
.fd-cerfa-list-time {
    font-weight: 400;
    font-size: .85rem;
    color: #7f8c8d;
}
.fd-cerfa-list-motif {
    margin: 6px 0 0;
    color: #5a7080;
    font-size: .9rem;
    padding-top: 6px;
    border-top: 1px solid #eaf0f4;
}
.fd-cerfa-list-actions {
    margin: 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.fd-cerfa-list-meta {
    color: #8a9aaa;
    font-size: .82rem;
}
.fd-cerfa-status-badge {
    border-radius: 4px;
    padding: 2px 10px;
    font-size: .78rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.fd-cerfa-status-badge-en_cours { background: #e67e221a; color: #e67e22; border-color: #e67e2244; }
.fd-cerfa-status-badge-termine  { background: #2980b91a; color: #2980b9; border-color: #2980b944; }
.fd-cerfa-status-badge-valide   { background: #27ae601a; color: #27ae60; border-color: #27ae6044; }
.fd-cerfa-status-badge-archive  { background: #7f8c8d1a; color: #7f8c8d; border-color: #7f8c8d44; }

.fd-super-admin-input {
    background: #f5f5f5;
    color: #888;
    cursor: not-allowed;
}
[data-theme="dark"] .fd-super-admin-input {
    background: #2a2a2a;
    color: #666;
}
.fd-perm-admin-note {
    font-size: .8rem;
    color: #888;
    margin-top: 8px;
}

.fd-sig-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}
.fd-sig-tab {
    padding: 5px 14px;
    border: 1px solid var(--fd-border);
    border-radius: 6px;
    background: var(--fd-bg-card);
    color: var(--fd-text);
    cursor: pointer;
    font-size: 0.85rem;
}
.fd-sig-tab-active {
    background: var(--fd-primary);
    color: #fff;
    border-color: var(--fd-primary);
}
.fd-sig-panel-hidden { display: none; }
.fd-sig-canvas {
    display: block;
    width: 100%;
    max-width: 480px;
    height: 180px;
    border: 1px solid var(--fd-border);
    border-radius: 8px;
    background: #fff;
    touch-action: none;
    cursor: crosshair;
}
.fd-sig-canvas-actions {
    margin-top: 6px;
}
.fd-sig-current-label {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--fd-text-muted);
}

.fd-profile-img {
    background: #ffffff;
    max-width: 220px;
    border-radius: 8px;
    margin-top: 6px;
}
.fd-profile-logo {
    max-width: 160px;
}
.fd-label-opt {
    font-weight: 400;
    color: #7f8c8d;
}
.fd-label-flex-lg {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    cursor: pointer;
    margin-top: 16px;
}
.fd-checkbox-lg {
    width: 18px;
    height: 18px;
    accent-color: var(--fd-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.fd-site-photos-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.fd-site-photos-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.fd-site-photos-title {
    font-size: 1rem;
    color: var(--fd-primary);
}
.fd-site-photos-count {
    font-size: .82rem;
    color: #5a7080;
    margin-left: 2px;
}
.fd-site-photos-arrow {
    margin-left: auto;
    color: #a0b8c8;
    font-size: 1.2rem;
}
.fd-site-photos-thumbs {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox : masque la scrollbar */
}
.fd-site-photos-thumbs::-webkit-scrollbar { display: none; } /* Chrome/Safari/Edge */
.fd-site-photos-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #d0e4ee;
    flex-shrink: 0;
}

.fd-site-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.fd-site-title-row h1 {
    margin: 0;
}
.fd-site-photos-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.fd-site-photos-head-flat {
    margin-bottom: 0;
}
.fd-site-photos-label {
    font-size: 1rem;
    color: #0b4f6c;
}
.fd-site-photos-count {
    font-size: .82rem;
    color: #5a7080;
    margin-left: 2px;
}
.fd-site-photos-chevron {
    margin-left: auto;
    color: #a0b8c8;
    font-size: 1.2rem;
}
.fd-equip-list-header {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.fd-sg-new-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-top: 14px;
}
.fd-sg-new-name {
    flex: 1;
    min-width: 180px;
}
.fd-sg-td-actions {
    white-space: nowrap;
}
.fd-sg-td-name {
    font-weight: 600;
}
.fd-sg-empty {
    color: #7f8c8d;
    text-align: center;
    padding: 24px 0;
}
.fd-err-phone {
    margin: 2px 0 0;
    font-size: .8rem;
    color: #e74c3c;
}
.fd-cerfa-header {
    background: linear-gradient(90deg, #0b4f6c, #1d93c6);
    color: #fff;
}
.fd-cerfa-header h2 {
    margin: 0;
    color: #fff;
    text-align: left;
}
.fd-cerfa-header p {
    margin: 4px 0 0;
    font-size: .85rem;
    opacity: .85;
}
.fd-label-flex-mt {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-top: 12px;
}
.fd-cerfa-note-sm-mb {
    margin: 0 0 10px;
    font-size: .85rem;
    color: #5a7080;
}
.fd-mt-xs {
    margin-top: 4px;
}
.fd-mt-md {
    margin-top: 14px;
}
.fd-label-mt {
    margin-top: 10px;
}
.fd-card-m0 {
    margin: 0;
}
.fd-p0 {
    margin: 0;
}
.fd-p-sm {
    margin: 2px 0 0;
    font-size: .9rem;
}
.fd-p-cap {
    margin: 6px 0 0;
    font-size: .9rem;
}
.fd-operator-warn {
    color: #e09000;
    font-size: .8rem;
    font-weight: 400;
}
.fd-text-body {
    font-size: .9rem;
}
.fd-text-danger {
    color: #c0392b;
}
.fd-label-clickable {
    cursor: pointer;
}
.fd-mb-md {
    margin-bottom: 14px;
}
.fd-mb-lg {
    margin-bottom: 18px;
}
.fd-button-light {
    background: #eef4f7;
    color: #0b4f6c;
    border-color: #c8dde8;
}
.fd-drag-handle {
    display: block;
    cursor: grab;
    color: #b0c4ce;
    font-size: 1.2rem;
    line-height: 1;
    margin-bottom: 8px;
    user-select: none;
}
.fd-drag-handle:active {
    cursor: grabbing;
}
.fd-section-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid #eef2f4;
}
.fd-section-row:last-child {
    border-bottom: none;
}
.fd-section-row .fd-drag-handle {
    display: inline-block;
    margin-bottom: 0;
    flex-shrink: 0;
}
.fd-section-row input[type="checkbox"] {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    margin: 0 !important;
    margin-top: 0 !important;
    cursor: pointer;
    accent-color: var(--fd-primary);
}
.fd-section-row label {
    margin: 0 !important;
    font-weight: 500;
    font-size: .93rem;
    cursor: pointer;
    color: var(--fd-text);
    line-height: 1;
}
.fd-section-row span {
    font-size: .93rem;
    cursor: pointer;
    padding: 0 10px;
}
.fd-section-row label {
    font-size: .93rem;
    font-weight: 500;
    color: var(--fd-text);
    cursor: pointer;
    margin: 0;
    line-height: 1;
}
.fd-opt-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.fd-opt-row .fd-input {
    flex: 1;
    margin: 0;
}
.fd-opt-remove {
    flex-shrink: 0;
    background: none;
    border: 1px solid #c8dde8;
    border-radius: 4px;
    color: #c0392b;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 4px 8px;
}

.fd-feed-card {
    display: flex;
    margin: 60px 20px 35px;
    flex-direction: column;
    gap: 12px;
    padding: 25px 16px;
    background: none;
    box-shadow: none;
}
.fd-feed-pinned-group { display: flex; flex-direction: column; gap: 6px; }
.fd-feed-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
    padding: 4px 0;
}
.fd-feed-msg {
    background: var(--fd-card-bg, #f4f8fb);
    border: 1px solid var(--fd-border-light, #d9e4ea);
    border-radius: 6px;
    padding: 8px 10px;
}
.fd-feed-msg-mine {
    background: #e8f4fb;
    border-color: #b0d8ee;
}
.fd-feed-msg-pinned {
    background: #fff8e1;
    border-color: #c6c6c6;
}
[data-theme="dark"] .fd-feed-msg         {background: #030404;border-color: #1e3a50;}
[data-theme="dark"] .fd-feed-msg-mine    {background: #0b263b;border-color: #1d6a95;}
[data-theme="dark"] .fd-feed-msg-pinned  {background: #2d2700;border-color: #554b1d;}
.fd-feed-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.fd-feed-author { font-weight: 700; font-size: .85rem; }
.fd-feed-date   { font-size: .78rem; opacity: .6; }
.fd-feed-pin-icon { font-size: .85rem; }
.fd-feed-actions { display: flex; gap: 6px; margin-left: auto; }
.fd-feed-form-inline { display: inline; }
.fd-btn-feed {
    background: transparent;
    border: 1px solid var(--fd-border-light, #c8dde8);
    border-radius: 4px;
    cursor: pointer;
    font-size: .75rem;
    padding: 2px 7px;
    margin: 0;
    color: var(--fd-text, #222);
    transition: background .15s;
}
.fd-btn-feed:hover { background: var(--fd-border-light, #e8f0f5); }
.fd-feed-btn-del {color: #c0392b;border-color: #b7797933;}
.fd-feed-text {
    font-size: .9rem;
    font-family: inherit;
    line-height: 1.5;
    padding: 4px 0;
    white-space: pre-wrap;
    word-break: break-word;
}
.fd-feed-empty { font-size: .9rem; opacity: .6; text-align: center; padding: 12px 0; }
.fd-feed-compose { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--fd-border-light, #d9e4ea); padding-top: 10px; }
.fd-feed-textarea { resize: vertical; min-height: 52px; }
.fd-feed-compose-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fd-feed-edit-form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.fd-feed-reactions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.fd-btn-react {
    border-radius: 12px;
    padding: 2px 9px;
    font-size: .8rem;
    border-color: var(--fd-border-light, #c8dde8);
}
.fd-btn-react:hover { background: var(--fd-border-light, #e8f0f5); }
.fd-btn-react-active {
    background: #d4edff;
    border-color: #1d93c6;
    color: #006894;
    font-weight: 600;
}
[data-theme="dark"] .fd-btn-react-active { background: #0f3a55; border-color: #1d93c6; color: #7acde8; }
.fd-feed-purge-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid var(--fd-border-light, #d9e4ea);
    padding-top: 8px;
}

.fd-fluide-kpi {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: .4rem;
}
.fd-fluide-kpi > .fd-dash-block {
    flex: 1;
    min-width: 280px;
}

.fd-fluide-separator {
    border: none;
    border-top: 2px solid var(--fd-border, #dde3ea);
    margin: 50px 0 20px;
    opacity: .6;
}

.fd-fluide-filter-section {
    margin-bottom: .6rem;
}

.fd-fluide-bottom-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 10px;
    background: var(--fd-card-bg);
    border-radius: 2px;
    box-shadow: 0 2px 8px var(--fd-card-shadow);
    color: var(--fd-text);
    padding: 10px 16px;
    animation: fd-bottom-in .4s ease both;
    transition: opacity .35s ease;
}

.fd-fluide-bottom-card {
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    color: inherit;
}

.fd-fluide-bottom-section > .fd-dash-block + .fd-dash-block {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--fd-border-light);
}
.fd-fluide-bottom-section.fd-leaving {
    opacity: 0;
}
@keyframes fd-bottom-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fd-fluide-ref-select {
    min-width: 160px;
    max-width: 200px;
    cursor: pointer;
}

.fd-csel-wrap {
    position: relative;
    display: inline-flex;
}
.fd-csel-trigger {
    min-width: 160px;
    max-width: 220px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
}
.fd-csel-trigger span:first-child {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fd-csel-arrow {
    font-size: .65rem;
    opacity: .55;
    flex-shrink: 0;
}
.fd-csel-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    max-height: 260px;
    overflow-y: auto;
    background: var(--fd-card-bg, #fff);
    border: 1px solid var(--fd-border, #dde3ea);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.22);
    z-index: 200;
    padding: 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--fd-border) transparent;
}
.fd-csel-panel::-webkit-scrollbar {
    width: 9px;
}
.fd-csel-panel::-webkit-scrollbar-track {
    background: transparent;
}
.fd-csel-panel::-webkit-scrollbar-thumb {
    background: var(--fd-border);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.fd-csel-panel::-webkit-scrollbar-thumb:hover {
    background: var(--fd-text-muted);
    background-clip: padding-box;
}
.fd-csel-opt {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    cursor: pointer;
    font-size: .88rem;
    border-radius: 6px;
    transition: background .12s ease;
}
.fd-csel-opt:hover { background: rgba(29,147,198,.14); }
.fd-csel-opt.fd-csel-selected {
    background: rgba(29,147,198,.16);
    font-weight: 600;
    color: var(--fd-primary, #1d93c6);
}
.fd-csel-opt-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fd-csel-star {
    flex-shrink: 0;
    padding: 0 2px;
}
.fd-csel-group-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--fd-text-muted);
    padding: 6px 10px 2px;
}
.fd-csel-sep {
    border-top: 1px solid var(--fd-border, #dde3ea);
    margin: 4px 0;
}

.fd-accordion-sub:not([data-doc-type]) > .fd-accordion-summary-sub .fd-fluide-equip-refrigerant,
.fd-accordion-sub:not([data-doc-type]) > .fd-accordion-summary-sub .fd-fluide-equip-stats {
    color: rgba(255, 255, 255, .72);
}

.fd-fluide-inv-tile-kg  { background: #e0f2f1; }
.fd-fluide-inv-tile-co2 { background: #fce4ec; }
[data-theme="dark"] .fd-fluide-inv-tile-kg  { background: #0a2220; }
[data-theme="dark"] .fd-fluide-inv-tile-co2 { background: #2a0d15; }
.fd-fluide-inv-tile-kg  .fd-fluide-bilan-value { color: #00695c; }
.fd-fluide-inv-tile-co2 .fd-fluide-bilan-value { color: #ad1457; }
[data-theme="dark"] .fd-fluide-inv-tile-kg  .fd-fluide-bilan-value { color: #4db6ac; }
[data-theme="dark"] .fd-fluide-inv-tile-co2 .fd-fluide-bilan-value { color: #f48fb1; }

.fd-fgas-wrap {
    margin: 4px 0 22px;
}
.fd-fgas-title {
    font-size: .78rem;
    font-weight: 600;
    color: var(--fd-text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.fd-fgas-bar {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    height: 44px;
    gap: 2px;
}
.fd-fgas-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 2px;
    opacity: .45;
    transition: opacity .2s;
    cursor: default;
}
.fd-fgas-zone-active {
    opacity: 1;
    outline: 2px solid rgba(0,0,0,.2);
    outline-offset: -2px;
}
.fd-fgas-zone-1 { background: #c8e6c9; }
.fd-fgas-zone-2 { background: #fff9c4; }
.fd-fgas-zone-3 { background: #ffe0b2; }
.fd-fgas-zone-4 { background: #ffcdd2; }
[data-theme="dark"] .fd-fgas-zone-1 { background: #1b4332; }
[data-theme="dark"] .fd-fgas-zone-2 { background: #3d3300; }
[data-theme="dark"] .fd-fgas-zone-3 { background: #3d2000; }
[data-theme="dark"] .fd-fgas-zone-4 { background: #3d0a0a; }
.fd-fgas-zone-val {
    font-size: .72rem;
    font-weight: 700;
    color: var(--fd-primary);
    white-space: nowrap;
}
.fd-fgas-zone-desc {
    font-size: .65rem;
    color: var(--fd-text-muted);
    white-space: nowrap;
}
.fd-fgas-zone-active .fd-fgas-zone-val  { color: #0b4f6c; }
.fd-fgas-zone-active .fd-fgas-zone-desc { color: #1a5276; }
[data-theme="dark"] .fd-fgas-zone-active .fd-fgas-zone-val  { color: #7acde8; }
[data-theme="dark"] .fd-fgas-zone-active .fd-fgas-zone-desc { color: #5aabdf; }
.fd-fgas-current {
    margin-top: 7px;
    font-size: .8rem;
    color: var(--fd-text-muted);
}
.fd-fgas-current strong { color: var(--fd-primary); }

.fd-fluide-inv-list {
    border-top: 1px solid var(--fd-border-light, #d9e4ea);
    margin-bottom: 22px;
}
.fd-fluide-inv-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--fd-border-light, #d9e4ea);
    font-size: .85rem;
}
.fd-fluide-inv-name {
    flex: 1;
    font-weight: 600;
    color: var(--fd-primary);
}
.fd-fluide-inv-kg {
    font-weight: 700;
    color: #00695c;
    white-space: nowrap;
}
.fd-fluide-inv-co2 {
    color: #ad1457;
    white-space: nowrap;
    font-size: .8rem;
}
.fd-fluide-inv-equip {
    color: var(--fd-text-muted);
    white-space: nowrap;
    font-size: .78rem;
}
[data-theme="dark"] .fd-fluide-inv-kg  { color: #4db6ac; }
[data-theme="dark"] .fd-fluide-inv-co2 { color: #f48fb1; }

.fd-fluide-fav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: .95rem;
    color: #b0bec5;
    padding: 0 0 0 .35rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color .15s;
}
.fd-fluide-fav-btn:hover,
.fd-fluide-fav-btn.fd-fluide-fav-on {
    color: #f9a825;
}
.fd-fluide-inv-sep {
    border: none;
    border-top: 1px solid var(--fd-border, #dde3ea);
    margin: .35rem 0;
}

.fd-fluide-status-badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.fd-fluide-status-phaseout { background: #fff8e1; color: #f57f17; }
.fd-fluide-status-illegal  { background: #fce4ec; color: #c62828; }
[data-theme="dark"] .fd-fluide-status-phaseout { background: #3d2e00; color: #ffd54f; }
[data-theme="dark"] .fd-fluide-status-illegal  { background: #3d0a0a; color: #ef9a9a; }

.fd-fluide-topsites {
    border-top: 1px solid var(--fd-border-light, #d9e4ea);
    padding-top: 14px;
}
.fd-fluide-topsites-title {
    font-size: .78rem;
    font-weight: 600;
    color: var(--fd-text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.fd-fluide-topsites-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    font-size: .82rem;
}
.fd-fluide-topsites-name {
    width: 130px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fd-fluide-topsites-name a {
    color: var(--fd-accent);
    text-decoration: none;
}
.fd-fluide-topsites-name a:hover { text-decoration: underline; }
.fd-fluide-topsites-bar-wrap {
    flex: 1;
    background: var(--fd-border-light, #d9e4ea);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}
.fd-fluide-topsites-bar {
    height: 100%;
    background: var(--fd-accent, #1d93c6);
    border-radius: 4px;
    transition: width .3s;
}
.fd-fluide-topsites-val {
    width: 60px;
    text-align: right;
    font-weight: 600;
    color: var(--fd-primary);
    white-space: nowrap;
    font-size: .8rem;
}

.fd-fluide-kpi > .fd-dash-block[data-widget="mouvements"] {
    display: flex;
    flex-direction: column;
}
.fd-fluide-card-stack {
    margin-top: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.fd-leak-pager {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: auto;
    padding-top: 12px;
}
.fd-card-section-sub {
    font-size: .8rem;
    font-weight: 500;
    color: var(--fd-text-muted);
    margin-left: 6px;
}
.fd-fluide-leaks {
    margin-top: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fd-fluide-leaks-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fd-fluide-leaks-title {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--fd-text-muted);
    margin-bottom: 4px;
}
.fd-fluide-leak-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--fd-body-bg);
    text-decoration: none;
    color: inherit;
    border-left: 3px solid #c62828;
}
.fd-fluide-leak-row:hover {
    background: rgba(198, 40, 40, .10);
}
.fd-fluide-leak-site {
    font-weight: 600;
    font-size: .85rem;
    color: var(--fd-primary);
}
.fd-fluide-leak-equip {
    font-weight: 400;
    color: var(--fd-text-muted);
    margin-left: 4px;
}
.fd-fluide-leak-loc {
    flex: 1;
    min-width: 0;
    font-size: .8rem;
    color: var(--fd-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fd-fluide-leak-date {
    margin-left: auto;
    font-size: .78rem;
    color: var(--fd-text-muted);
    white-space: nowrap;
}
.fd-fluide-leaks-empty {
    margin-top: 1rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border-radius: 8px;
    background: rgba(46, 125, 50, .12);
    color: #43a047;
    font-weight: 500;
    font-size: .85rem;
    text-align: center;
}

.fd-fluide-chart-dual {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.fd-fluide-chart-col {
    flex: 1;
    min-width: 220px;
}
.fd-fluide-chart-col .fd-fluide-chart-title {
    font-size: .78rem;
    font-weight: 600;
    color: var(--fd-text-muted);
    margin-bottom: 10px;
}
.fd-fluide-chart-col .fd-fluide-chart-wrap {
    height: 220px;
    position: relative;
}
.fd-fluide-chart-wrap-donut {
    height: 240px !important;
}

.fd-fluide-search-wrap {
    margin-bottom: 14px;
}

@media (max-width: 640px) {
    .fd-fluide-ref-select { max-width: 100%; }
    .fd-fluide-chart-dual { flex-direction: column; }
    .fd-fluide-topsites-name { width: 90px; }
    .fd-fgas-zone-val  { font-size: .62rem; }
    .fd-fgas-zone-desc { display: none; }
}

/* Page 404 */
.fd-header-slim { height: 60px; }
.fd-header-slim .fd-logo img { height: 40px; }
.fd-404-wrap {
    min-height: 74vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}
.fd-404-code {
    font-size: 8rem;
    font-weight: 800;
    color: var(--fd-primary);
    opacity: .14;
    line-height: 1;
    margin: 0;
    letter-spacing: -.04em;
}
.fd-404-icon {
    color: var(--fd-primary);
    margin: -34px 0 14px;
}
.fd-404-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fd-text);
    margin: 0 0 8px;
}
.fd-404-sub {
    color: var(--fd-text-muted);
    font-size: .95rem;
    line-height: 1.6;
    margin: 0 0 28px;
    max-width: 380px;
}
.fd-404-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}
@media (max-width: 600px) {
    .fd-404-code { font-size: 5.5rem; }
    .fd-404-icon { margin: -22px 0 12px; }
    .fd-404-title { font-size: 1.25rem; }
}

/* ============================================================
   Module Devis / Facturation
   ============================================================ */

/* Onglets Devis / Factures */
.fd-bil-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--fd-border);
}
.fd-bil-tab {
    padding: 8px 18px;
    text-decoration: none;
    color: var(--fd-text-muted);
    font-weight: 600;
    border-radius: 8px 8px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -2px;
}
.fd-bil-tab-active {
    color: var(--fd-primary);
    background: var(--fd-card-bg);
    border-color: var(--fd-border);
    border-bottom: 2px solid var(--fd-card-bg);
}

/* Tuiles de synthese */
.fd-bil-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.fd-bil-tile {
    background: var(--fd-card-bg);
    border: 1px solid var(--fd-border-light);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 1px 4px var(--fd-card-shadow);
}
.fd-bil-tile-label {
    font-size: .8rem;
    color: var(--fd-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.fd-bil-tile-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fd-primary);
}
.fd-bil-tile-sub {
    font-size: .85rem;
    color: var(--fd-text-muted);
}

.fd-bil-filter-select {
    width: auto;
    max-width: 200px;
}

/* Badges de statut */
.fd-status-badge-bil-brouillon { background: #ececec; color: #666; }
.fd-status-badge-bil-envoye    { background: #e3f0fb; color: #1565c0; }
.fd-status-badge-bil-accepte   { background: #e6f6ea; color: #1e7c3d; }
.fd-status-badge-bil-refuse    { background: #fdecea; color: #c62828; }
.fd-status-badge-bil-expire    { background: #fff3e0; color: #b45f06; }
.fd-status-badge-bil-emise     { background: #e3f0fb; color: #1565c0; }
.fd-status-badge-bil-partielle { background: #fff3e0; color: #b45f06; }
.fd-status-badge-bil-payee     { background: #e6f6ea; color: #1e7c3d; }
[data-theme="dark"] .fd-status-badge-bil-brouillon { background: #2a2a2a; color: #a0a0a0; }
[data-theme="dark"] .fd-status-badge-bil-envoye    { background: #0d2035; color: #5aabdf; }
[data-theme="dark"] .fd-status-badge-bil-accepte   { background: #0d2a18; color: #4fc87a; }
[data-theme="dark"] .fd-status-badge-bil-refuse    { background: #350d0d; color: #e57373; }
[data-theme="dark"] .fd-status-badge-bil-expire    { background: #3a200a; color: #f0a05a; }
[data-theme="dark"] .fd-status-badge-bil-emise     { background: #0d2035; color: #5aabdf; }
[data-theme="dark"] .fd-status-badge-bil-partielle { background: #3a200a; color: #f0a05a; }
[data-theme="dark"] .fd-status-badge-bil-payee     { background: #0d2a18; color: #4fc87a; }

/* Editeur de lignes */
.fd-bil-lines-table {
    min-width: 760px;
}
.fd-bil-lines-table td {
    vertical-align: top;
}
.fd-bil-input {
    padding: 6px 8px;
    font-size: .9rem;
}
.fd-bil-col-move   { width: 34px; white-space: nowrap; }
.fd-bil-col-qty    { width: 70px; }
.fd-bil-col-unite  { width: 80px; }
.fd-bil-col-prix   { width: 100px; }
.fd-bil-col-tva    { width: 90px; }
.fd-bil-col-remise { width: 76px; }
.fd-bil-col-total  { width: 110px; text-align: right; white-space: nowrap; }
.fd-bil-col-del    { width: 34px; }
.fd-bil-description {
    margin-top: 4px;
    font-size: .82rem;
    resize: vertical;
}
.fd-bil-titre-input {
    font-weight: 700;
}
.fd-bil-line-total {
    display: block;
    padding-top: 10px;
    font-weight: 600;
    text-align: right;
}
.fd-bil-move-btn,
.fd-bil-del-btn {
    display: block;
    background: none;
    border: 1px solid var(--fd-border-light);
    border-radius: 4px;
    color: var(--fd-text-muted);
    cursor: pointer;
    font-size: .7rem;
    line-height: 1;
    padding: 3px 5px;
    margin: 0 0 3px;
}
.fd-bil-del-btn {
    font-size: 1rem;
    color: #c62828;
    margin-top: 6px;
}
.fd-bil-move-btn:hover,
.fd-bil-del-btn:hover {
    background: var(--fd-border-light);
}
.fd-bil-add-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0 4px;
}

/* Totaux */
.fd-bil-totals {
    margin-top: 14px;
    margin-left: auto;
    max-width: 340px;
}
.fd-bil-totals-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 4px 10px;
    font-size: .95rem;
}
.fd-bil-totals-muted {
    color: var(--fd-text-muted);
    font-size: .87rem;
}
.fd-bil-totals-ttc {
    background: var(--fd-primary);
    color: #fff;
    font-weight: 700;
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 4px;
}

/* Autocomplete catalogue */
.fd-bil-autocomplete {
    position: absolute;
    z-index: 300;
    background: var(--fd-card-bg);
    border: 1px solid var(--fd-border);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
    max-height: 260px;
    overflow-y: auto;
    max-width: 420px;
}
.fd-bil-autocomplete-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: .9rem;
}
.fd-bil-autocomplete-item:hover {
    background: var(--fd-border-light);
}
.fd-bil-autocomplete-label {
    color: var(--fd-text);
}
.fd-bil-autocomplete-price {
    color: var(--fd-text-muted);
    white-space: nowrap;
    font-size: .82rem;
}

/* Fiche document */
.fd-bil-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 760px) {
    .fd-bil-two-cols { grid-template-columns: 1fr; }
}
.fd-bil-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}
.fd-bil-timeline li {
    position: relative;
    padding: 3px 0 3px 18px;
    font-size: .92rem;
}
.fd-bil-timeline li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 10px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fd-primary-light);
}
.fd-bil-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.fd-bil-action-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin: 0;
}
.fd-bil-signataire-input {
    width: 220px;
    padding: 6px 10px;
}
.fd-bil-btn-danger {
    color: #c62828 !important;
}
.fd-bil-view-titre td {
    background: var(--fd-border-light);
    font-weight: 700;
}
.fd-bil-view-comment td {
    color: var(--fd-text-muted);
    font-style: italic;
    font-size: .88rem;
}
.fd-bil-view-desc {
    font-size: .84rem;
    margin-top: 2px;
    white-space: pre-line;
}

/* Descriptions mises en forme : classes fermées appliquées au rendu et à
   l'éditeur. Tailles en em pour s'adapter au contexte (écran, PDF, page client). */
.fd-rt-lg   { font-size: 1.25em; }
.fd-rt-sm   { font-size: .82em; }
.fd-rt-gray { color: #888; }
[data-theme="dark"] .fd-rt-gray { color: #9aa7b0; }

/* Éditeur de description léger (barre + zone éditable) */
.fd-rt-wrap {
    border: 1px solid #c8dce8;
    border-radius: 8px;
    overflow: hidden;
}
[data-theme="dark"] .fd-rt-wrap { border-color: #1e3f54; }
.fd-rt-bar {
    display: flex;
    gap: 1px;
    padding: 2px 3px;
    background: #eef4f8;
    border-bottom: 1px solid #c8dce8;
}
[data-theme="dark"] .fd-rt-bar {
    background: #12222e;
    border-bottom-color: #1e3f54;
}
/* !important : la règle générique « .fd-card button:not(…) » impose padding 14px
   et margin:auto (qui étale les boutons sur toute la largeur dans une barre
   flex). On la neutralise sans toucher à sa chaîne d'exclusion. */
.fd-rt-btn {
    flex: 0 0 auto;
    min-width: 22px !important;
    width: auto !important;
    height: 22px !important;
    margin: 0 !important;
    padding: 0 6px !important;
    border: 1px solid transparent !important;
    border-radius: 4px !important;
    background: transparent !important;
    color: #1a3a4a;
    font-size: .78rem !important;
    font-weight: 500 !important;
    cursor: pointer;
    line-height: 1 !important;
}
[data-theme="dark"] .fd-rt-btn { color: #c8dde8; }
.fd-rt-btn:hover  { background: rgba(11,79,108,.12) !important; box-shadow: none !important; }
.fd-rt-btn:active { background: rgba(11,79,108,.22) !important; box-shadow: none !important; }
[data-theme="dark"] .fd-rt-btn { color: #c8dde8; }
[data-theme="dark"] .fd-rt-btn:hover { background: rgba(180,210,230,.12); }
.fd-rt-editor {
    min-height: 3.2em;
    padding: 8px 10px;
    outline: none;
    line-height: 1.5;
    white-space: pre-wrap;
}
.fd-rt-editor:empty::before {
    content: attr(data-placeholder);
    color: #97a9b4;
}
.fd-rt-hidden-src { display: none !important; }

/* Notes préenregistrées */
.fd-note-picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 6px;
}
.fd-input-sm {
    max-width: 320px;
    padding: 4px 8px;
    font-size: .85rem;
}
.fd-note-picker-manage {
    font-size: .82rem;
    color: #0b4f6c;
    text-decoration: none;
    white-space: nowrap;
}
.fd-note-picker-manage:hover { text-decoration: underline; }
[data-theme="dark"] .fd-note-picker-manage { color: #7fc4e0; }

.fd-note-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fd-note-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #dbe4ea;
    border-radius: 8px;
    background: #fafcfd;
}
[data-theme="dark"] .fd-note-item {
    border-color: #1e3f54;
    background: #0f1e28;
}
.fd-note-body { min-width: 0; flex: 1 1 auto; }
.fd-note-title {
    margin: 0 0 3px;
    font-weight: 600;
}
.fd-note-preview {
    margin: 0;
    font-size: .88rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.fd-note-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}
.fd-note-actions form { margin: 0; }

/* Catalogue */
.fd-bil-item-inactif {
    opacity: .55;
}
.fd-bil-item-actions {
    white-space: nowrap;
}
.fd-bil-item-actions .fd-bil-action-form {
    margin-left: 4px;
}

/* â”€â”€ Facturation : phase 2 (factures, avoirs, reglements) â”€â”€ */

.fd-status-badge-bil-en_retard { background: #fdecea; color: #c62828; }
[data-theme="dark"] .fd-status-badge-bil-en_retard { background: #350d0d; color: #e57373; }

.fd-bil-tile-alert .fd-bil-tile-value { color: #c62828; }
[data-theme="dark"] .fd-bil-tile-alert .fd-bil-tile-value { color: #e57373; }

a.fd-bil-tile {
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s ease, transform .15s ease;
}
a.fd-bil-tile:hover {
    box-shadow: 0 3px 10px var(--fd-card-shadow);
    transform: translateY(-1px);
}

.fd-bil-type-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 4px;
    background: var(--fd-border-light);
    color: var(--fd-text-muted);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.fd-bil-solde {
    border: 1px solid var(--fd-primary);
    border-radius: 6px;
    padding: 7px 10px;
    margin-top: 4px;
    font-weight: 700;
}
.fd-bil-solde-ok {
    border-color: #1e7c3d;
    color: #1e7c3d;
}
.fd-bil-solde-retard {
    border-color: #c62828;
    color: #c62828;
}
[data-theme="dark"] .fd-bil-solde-ok     { border-color: #4fc87a; color: #4fc87a; }
[data-theme="dark"] .fd-bil-solde-retard { border-color: #e57373; color: #e57373; }

.fd-bil-payment-form {
    margin-top: 14px;
    border-top: 1px solid var(--fd-border-light);
    padding-top: 12px;
}
.fd-bil-payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
@media (max-width: 600px) {
    .fd-bil-payment-grid { grid-template-columns: 1fr; }
}

.fd-dash-billing .fd-bil-tiles {
    margin-bottom: 0;
}

/* â”€â”€ Facturation : phase 3 (regimes TVA, acomptes, page publique) â”€â”€ */

.fd-bil-tva-off {
    opacity: .45;
    pointer-events: none;
}
.fd-bil-autoliq-notice {
    display: none;
    margin-bottom: 10px;
}
.fd-bil-acompte-input {
    width: 72px;
    padding: 6px 8px;
    text-align: right;
}
.fd-bil-sig-img {
    max-width: 320px;
    max-height: 130px;
    border: 1px solid var(--fd-border-light);
    border-radius: 6px;
    background: #fff;
    padding: 6px;
}
.fd-bil-export {
    position: relative;
}
.fd-bil-export > summary {
    display: inline-block;
    cursor: pointer;
    list-style: none;
}
.fd-bil-export > summary::-webkit-details-marker {
    display: none;
}
.fd-bil-export-form {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    min-width: 230px;
    background: var(--fd-card-bg);
    border: 1px solid var(--fd-border);
    border-radius: 10px;
    box-shadow: 0 6px 20px var(--fd-card-shadow);
    padding: 14px;
}
.fd-bil-export-form .fd-main-button {
    margin-top: 12px;
}

/* Page publique (consultation client, sans compte) */
.fd-pub-body {
    background: var(--fd-body-bg);
    color: var(--fd-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
}
.fd-pub-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}
.fd-pub-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    background: var(--fd-card-bg);
    border: 1px solid var(--fd-border-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.fd-pub-header-left {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.fd-pub-logo {
    max-height: 56px;
    max-width: 120px;
    object-fit: contain;
}
.fd-pub-company {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--fd-primary);
}
.fd-pub-company-info {
    font-size: .82rem;
    color: var(--fd-text-muted);
    line-height: 1.6;
    margin-top: 4px;
}
.fd-pub-header-right {
    text-align: right;
}
.fd-pub-doctype {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--fd-primary);
    letter-spacing: .04em;
}
.fd-pub-num {
    font-weight: 700;
    margin-top: 2px;
}
.fd-pub-date {
    font-size: .85rem;
    color: var(--fd-text-muted);
    margin-top: 2px;
}
.fd-pub-card {
    background: var(--fd-card-bg);
    border: 1px solid var(--fd-border-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.fd-pub-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--fd-primary);
    margin: 0 0 10px;
}
.fd-pub-client-name {
    font-weight: 700;
    font-size: 1.05rem;
}
.fd-pub-client {
    line-height: 1.6;
}
.fd-pub-objet {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--fd-border-light);
}
.fd-pub-num-col {
    text-align: right;
    white-space: nowrap;
}
.fd-pub-notes {
    font-size: .92rem;
    line-height: 1.6;
    color: var(--fd-text);
}
.fd-pub-mention {
    font-size: .85rem;
    line-height: 1.6;
    color: var(--fd-text-muted);
    border-left: 3px solid var(--fd-primary-light);
    padding: 8px 12px;
    margin-top: 10px;
    background: rgba(29, 147, 198, .06);
    border-radius: 0 6px 6px 0;
}
.fd-pub-banner {
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: .95rem;
    background: #fff8e1;
    color: #7a5800;
    border: 1px solid #f0d68a;
}
.fd-pub-banner-ok {
    background: #e6f6ea;
    color: #1e7c3d;
    border-color: #a9d9ba;
}
.fd-pub-banner-error {
    background: #fdecea;
    color: #c62828;
    border-color: #f0aaa6;
}
[data-theme="dark"] .fd-pub-banner       { background: #3a200a; color: #f0a05a; border-color: #6a4520; }
[data-theme="dark"] .fd-pub-banner-ok    { background: #0d2a18; color: #4fc87a; border-color: #245b38; }
[data-theme="dark"] .fd-pub-banner-error { background: #350d0d; color: #e57373; border-color: #6b2626; }

.fd-pub-accept {
    border-color: var(--fd-primary-light);
    border-width: 2px;
}
.fd-pub-sig-wrap {
    position: relative;
    margin-top: 6px;
}
.fd-pub-canvas {
    width: 100%;
    height: 200px;
    background: #fff;
    border: 2px dashed var(--fd-border);
    border-radius: 10px;
    touch-action: none;
    cursor: crosshair;
    display: block;
}
.fd-pub-sig-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #9bb0bd;
    font-size: 1rem;
    pointer-events: none;
}
.fd-pub-sig-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}
.fd-pub-submit {
    margin-top: 18px;
}
.fd-pub-sig-img {
    max-width: 320px;
    max-height: 140px;
    background: #fff;
    border: 1px solid var(--fd-border-light);
    border-radius: 8px;
    padding: 6px;
}
.fd-pub-footer-mentions {
    font-size: .78rem;
    color: var(--fd-text-muted);
    line-height: 1.6;
    padding: 0 4px;
    margin-bottom: 12px;
}
.fd-pub-footer {
    text-align: center;
    font-size: .82rem;
    color: var(--fd-text-muted);
    margin-top: 24px;
}
@media (max-width: 600px) {
    .fd-pub-header { flex-direction: column; }
    .fd-pub-header-right { text-align: left; }
    .fd-pub-canvas { height: 170px; }
}

/* â”€â”€ Catalogue : arborescence des categories â”€â”€ */

.fd-cat-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
@media (max-width: 900px) {
    .fd-cat-layout { grid-template-columns: 1fr; }
}
.fd-cat-main {
    min-width: 0;
}
/* Le collage est portÃ© par .fd-cat-side : les cartes restent dans le flux,
   sinon chacune crÃ©erait un plan d'empilement et masquerait le menu de la
   carte prÃ©cÃ©dente. */
.fd-cat-card {
    position: relative;
}

.fd-cat-tree,
.fd-cat-children {
    list-style: none;
    margin: 0;
    padding: 0;
}
.fd-cat-children {
    margin-left: 14px;
    border-left: 1px solid var(--fd-border-light);
    padding-left: 4px;
}
.fd-cat-node {
    margin: 1px 0;
}
.fd-cat-row {
    display: flex;
    align-items: center;
    gap: 2px;
    border-radius: 8px;
}
.fd-cat-row:hover {
    background: var(--fd-border-light);
}
.fd-cat-row-active {
    background: var(--fd-primary);
}
.fd-cat-row-active .fd-cat-name,
.fd-cat-row-active .fd-cat-count,
.fd-cat-row-active .fd-cat-menu-btn {
    color: #fff;
}
.fd-cat-row-active .fd-cat-count {
    background: rgba(255, 255, 255, .22);
}
.fd-cat-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    text-decoration: none;
    color: var(--fd-text);
    font-size: .92rem;
    min-width: 0;
}
.fd-cat-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fd-cat-count {
    flex-shrink: 0;
    background: var(--fd-border-light);
    color: var(--fd-text-muted);
    border-radius: 10px;
    padding: 1px 8px;
    font-size: .75rem;
    font-weight: 600;
}

/* Menu d'actions par categorie */
.fd-cat-menu {
    position: relative;
    flex-shrink: 0;
}
.fd-cat-menu > summary {
    list-style: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--fd-text-muted);
    font-size: 1rem;
    line-height: 1;
}
.fd-cat-menu > summary::-webkit-details-marker {
    display: none;
}
.fd-cat-menu > summary:hover {
    background: rgba(0, 0, 0, .08);
}
.fd-cat-menu-panel {
    position: absolute;
    z-index: 60;
    right: 0;
    top: calc(100% + 4px);
    width: 240px;
    background: var(--fd-card-bg);
    border: 1px solid var(--fd-border);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
    padding: 10px;
}
.fd-cat-menu-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 0;
}
.fd-cat-menu-form + .fd-cat-menu-form {
    border-top: 1px solid var(--fd-border-light);
}
.fd-cat-menu-form .fd-input {
    font-size: .85rem;
    padding: 6px 8px;
}

/* Ajout de categorie */
.fd-cat-add {
    margin-top: 12px;
    border-top: 1px solid var(--fd-border-light);
    padding-top: 12px;
}
.fd-cat-add > summary {
    list-style: none;
    cursor: pointer;
    display: block;
    text-align: center;
}
.fd-cat-add > summary::-webkit-details-marker {
    display: none;
}
.fd-cat-add-form {
    margin-top: 12px;
}
.fd-cat-search {
    margin-bottom: 12px;
    width: 100%;
}

.fd-bil-autocomplete-label {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.fd-bil-autocomplete-cat {
    font-size: .74rem;
    color: var(--fd-text-muted);
}

/* â”€â”€ Catalogue : reference, marge, import â”€â”€ */

.fd-row-ref-des {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 12px;
}
@media (max-width: 600px) {
    .fd-row-ref-des { grid-template-columns: 1fr; }
}
.fd-item-ref {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .84rem;
    white-space: nowrap;
}
.fd-item-margin {
    white-space: nowrap;
    font-weight: 600;
}
.fd-item-margin-live {
    margin-top: 6px;
    font-size: .88rem;
    font-weight: 600;
    color: #1e7c3d;
    min-height: 1.2em;
}
.fd-item-margin-live.fd-item-margin-negative {
    color: #c62828;
}
[data-theme="dark"] .fd-item-margin-live { color: #4fc87a; }
[data-theme="dark"] .fd-item-margin-live.fd-item-margin-negative { color: #e57373; }

/* Reference sur les lignes de document */
.fd-bil-line-ref {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .78rem;
    color: var(--fd-text-muted);
    margin-left: 6px;
    white-space: nowrap;
}
.fd-bil-reference {
    max-width: 130px;
    margin-bottom: 3px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .8rem;
}

/* Marge interne du document */
.fd-bil-marge {
    border: 1px dashed var(--fd-border);
    border-radius: 6px;
    margin-top: 4px;
    color: #1e7c3d;
    font-weight: 600;
}
[data-theme="dark"] .fd-bil-marge { color: #4fc87a; }

/* Import CSV */
.fd-import-table th {
    vertical-align: top;
    min-width: 150px;
}
.fd-import-head {
    font-size: .82rem;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fd-import-select {
    font-size: .84rem;
    padding: 5px 6px;
}
.fd-import-coef {
    max-width: 140px;
}
.fd-import-sample {
    background: var(--fd-body-bg);
    border: 1px solid var(--fd-border-light);
    border-radius: 8px;
    padding: 12px;
    font-size: .78rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre;
    margin: 0;
}
.fd-import-tpl-formats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin: 4px 0 2px;
}

/* â”€â”€ Repli de la barre laterale (grand ecran) â”€â”€ */

/* Bouton alignÃ© en haut de la barre, juste sous l'en-tÃªte (64 px de haut).
   En position fixe pour rester atteignable une fois la barre repliÃ©e. */
.fd-sidebar-toggle {
    position: fixed;
    top: 74px;
    /* Bord droit de la barre : sa largeur de contenu plus ses 2 x 20 px de marge intÃ©rieure */
    left: calc(clamp(168px, calc(24vw - 48px), 240px) + 40px);
    z-index: 45;
    width: 22px;
    height: 30px;
    margin-left: -11px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: var(--fd-sidebar-bg);
    color: rgba(255, 255, 255, .75);
    cursor: pointer;
    font-size: .6rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 0 6px rgba(0, 0, 0, .18);
    /* Pas de transition sur left : le navigateur n'interpole pas entre un
       calc(clamp(...)) et 0, et la position resterait figÃ©e au repli. */
    transition: background .18s ease;
}
.fd-sidebar-toggle:hover {
    background: var(--fd-primary-light);
    color: #fff;
}

body.fd-sidebar-collapsed .fd-sidebar {
    display: none;
}
body.fd-sidebar-collapsed .fd-sidebar-toggle {
    left: 0;
    margin-left: 0;
}

@media (max-width: 900px) {
    /* Sur mobile la barre est deja un tiroir : le bouton de repli n'a pas lieu d'etre */
    .fd-sidebar-toggle { display: none; }
    body.fd-sidebar-collapsed .fd-sidebar { display: flex; }
}

/* â”€â”€ Catalogue : panneaux repliables, marques, fournisseurs, colonnes â”€â”€ */

.fd-cat-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 16px;
}
@media (max-width: 900px) {
    .fd-cat-side { position: static; }
}
.fd-cat-card {
    margin-bottom: 0;
}
.fd-cat-new-item {
    width: 100%;
    justify-content: center;
}

.fd-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.fd-panel-head .fd-card-section-title {
    margin-bottom: 0;
}
.fd-panel-toggle {
    background: none;
    border: 1px solid var(--fd-border-light);
    border-radius: 6px;
    color: var(--fd-text-muted);
    cursor: pointer;
    font-size: .65rem;
    line-height: 1;
    padding: 5px 7px;
    flex-shrink: 0;
}
.fd-panel-toggle:hover {
    background: var(--fd-border-light);
    color: var(--fd-text);
}
.fd-panel-body {
    margin-top: 10px;
}
.fd-panel-collapsed .fd-panel-body {
    display: none;
}

.fd-supplier-contact {
    font-size: .76rem;
    color: var(--fd-text-muted);
    padding: 0 10px 4px 10px;
    margin-top: -2px;
}

.fd-row-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 760px) {
    .fd-row-3 { grid-template-columns: 1fr; }
}

/* Poignees de largeur de colonne */
.fd-resizable th {
    position: relative;
}
.fd-col-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
}
.fd-col-resizer::after {
    content: "";
    position: absolute;
    top: 20%;
    right: 3px;
    width: 2px;
    height: 60%;
    background: var(--fd-border);
    border-radius: 1px;
    opacity: 0;
    transition: opacity .15s ease;
}
.fd-resizable th:hover .fd-col-resizer::after,
body.fd-col-resizing .fd-col-resizer::after {
    opacity: 1;
}
body.fd-col-resizing {
    cursor: col-resize;
    user-select: none;
}
.fd-resizable td {
    overflow: hidden;
    text-overflow: ellipsis;
}
.fd-resize-hint {
    margin-top: 8px;
}

/* Glisser-déposer des colonnes : en-tête saisissable, colonne en cours de
   déplacement, et repère de dépose (liseré à gauche de la colonne cible). */
.fd-col-movable {
    cursor: move;
}
.fd-col-dragging {
    opacity: .45;
}
.fd-col-drop-target {
    box-shadow: inset 3px 0 0 0 #0b4f6c;
}
[data-theme="dark"] .fd-col-drop-target {
    box-shadow: inset 3px 0 0 0 #6ab8d8;
}

/* Colonne Reference dans l'editeur de lignes */
.fd-bil-col-ref {
    width: 140px;
}
.fd-bil-col-ref .fd-bil-reference {
    max-width: 100%;
    margin-bottom: 0;
}
.fd-bil-lines-table {
    min-width: 880px;
}

/* ============================================================
   Facturation : corrections d'affichage
   Les regles globales .fd-card input (padding 12px) et
   .fd-card button:not(...) l'emportent en specificite sur les
   classes du module : on les neutralise par des classes dediees.
   ============================================================ */

/* â”€â”€ Editeur de lignes : champs compacts â”€â”€ */
.fd-bil-lines-table .fd-bil-input,
.fd-bil-lines-table input.fd-bil-input,
.fd-bil-lines-table select.fd-bil-input,
.fd-bil-lines-table textarea.fd-bil-input {
    padding: 5px 7px !important;
    margin-top: 0 !important;
    font-size: .86rem !important;
    line-height: 1.3 !important;
    text-align: left !important;
    height: auto !important;
    min-height: 0 !important;
}
.fd-bil-lines-table td {
    padding: 6px 5px !important;
    vertical-align: top;
}
.fd-bil-lines-table th {
    padding: 8px 5px !important;
    font-size: .8rem;
    line-height: 1.25;
    vertical-align: bottom;
}
.fd-bil-lines-table .fd-accordion-note {
    display: block;
    font-size: .72rem;
    font-weight: 400;
}
.fd-bil-lines-table .fd-bil-description {
    margin-top: 4px !important;
    min-height: 30px !important;
    resize: vertical;
    font-family: inherit !important;
    font-size: .78rem !important;
    overflow: hidden;
}
.fd-bil-lines-table .fd-bil-num {
    text-align: right !important;
}
.fd-bil-lines-table .fd-bil-titre-input {
    font-weight: 700 !important;
    font-size: .95rem !important;
}
.fd-bil-lines-table .fd-bil-comment-input {
    font-style: italic;
    min-height: 34px !important;
}

/* Boutons de deplacement et de suppression : discrets, hors style de carte */
.fd-card .fd-bil-move-btn,
.fd-card .fd-bil-del-btn {
    display: block !important;
    width: 22px !important;
    padding: 2px 0 !important;
    margin: 0 0 2px !important;
    background: transparent !important;
    border: 1px solid var(--fd-border-light) !important;
    border-radius: 4px !important;
    color: var(--fd-text-muted) !important;
    font-size: .62rem !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    text-align: center !important;
    box-shadow: none !important;
}
.fd-card .fd-bil-del-btn {
    font-size: .9rem !important;
    color: #c62828 !important;
    margin-top: 4px !important;
}
.fd-card .fd-bil-move-btn:hover,
.fd-card .fd-bil-del-btn:hover {
    background: var(--fd-border-light) !important;
}
.fd-bil-col-move {
    width: 30px !important;
    padding-right: 0 !important;
}

/* Largeurs de colonnes de l'editeur */
.fd-bil-col-ref    { width: 120px; }
.fd-bil-col-des    { min-width: 210px; }
.fd-bil-col-qty    { width: 62px; }
.fd-bil-col-unite  { width: 72px; }
.fd-bil-col-prix   { width: 88px; }
.fd-bil-col-tva    { width: 84px; }
.fd-bil-col-remise { width: 66px; }
.fd-bil-col-total  { width: 96px; }
.fd-bil-col-del    { width: 30px; }

/* â”€â”€ Panneaux du catalogue : bouton de repli discret â”€â”€ */
.fd-card .fd-panel-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 26px !important;
    height: 26px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 1px solid var(--fd-border-light) !important;
    border-radius: 6px !important;
    color: var(--fd-text-muted) !important;
    font-size: .6rem !important;
    font-weight: 400 !important;
    box-shadow: none !important;
    flex-shrink: 0;
}
.fd-card .fd-panel-toggle:hover {
    background: var(--fd-border-light) !important;
    color: var(--fd-text) !important;
}
.fd-panel-head {
    margin-bottom: 0;
}
.fd-panel-collapsed {
    padding-bottom: 12px;
}

/* Menu d'actions par ligne de classement */
.fd-cat-menu-panel .fd-button {
    display: block;
    text-align: center;
    margin: 0;
}

/* Bouton d'ajout : sobre, pleine largeur mais discret */
.fd-cat-add {
    margin-top: 10px;
    padding-top: 10px;
}
.fd-cat-add-btn {
    display: block;
    padding: 7px 12px;
    font-size: .88rem;
    font-weight: 500;
    text-align: center;
    background: transparent;
    border: 1px dashed var(--fd-border);
    color: var(--fd-text-muted);
    border-radius: 8px;
}
.fd-cat-add-btn:hover {
    background: var(--fd-border-light);
    color: var(--fd-text);
    border-style: solid;
}
.fd-cat-add[open] > .fd-cat-add-btn {
    background: var(--fd-border-light);
    color: var(--fd-text);
    border-style: solid;
}

/* Alignement du bandeau de panneau et largeur du bouton Nouvel article */
.fd-panel-head .fd-card-section-title {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3;
}
.fd-cat-new-item {
    width: 100%;
    box-sizing: border-box;
    margin: 0 !important;
}

/* â”€â”€ Menu d'actions d'une categorie : au-dessus des cartes suivantes â”€â”€ */

/* La carte dont un menu est ouvert passe au premier plan */
.fd-cat-card.fd-panel-raised {
    z-index: 80;
}

.fd-cat-menu-panel {
    max-height: min(70vh, 420px);
    overflow-y: auto;
    padding: 8px 10px;
}
.fd-cat-menu-form {
    gap: 4px;
    padding: 5px 0;
}
/* Champs et boutons compacts : neutralise .fd-card input / .fd-card button */
.fd-cat-menu-panel .fd-input,
.fd-cat-menu-panel input.fd-input,
.fd-cat-menu-panel select.fd-input {
    padding: 6px 8px !important;
    margin-top: 0 !important;
    font-size: .84rem !important;
    text-align: left !important;
}
.fd-card .fd-cat-menu-panel button {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 5px 10px !important;
    font-size: .82rem !important;
}
.fd-cat-menu-panel .fd-button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 5px 10px;
    font-size: .82rem;
    text-align: center;
}

/* â”€â”€ Repli des categories parentes â”€â”€ */

.fd-card .fd-cat-caret {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 18px !important;
    height: 22px !important;
    padding: 0 !important;
    margin: 0 0 0 2px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 4px !important;
    color: var(--fd-text-muted) !important;
    font-size: .62rem !important;
    line-height: 1 !important;
    box-shadow: none !important;
    flex-shrink: 0;
    transition: transform .15s ease;
}
.fd-card .fd-cat-caret:hover {
    background: rgba(0, 0, 0, .08) !important;
    color: var(--fd-text) !important;
}
.fd-cat-row-active .fd-cat-caret {
    color: rgba(255, 255, 255, .85) !important;
}
.fd-cat-row-active .fd-cat-caret:hover {
    background: rgba(255, 255, 255, .18) !important;
    color: #fff !important;
}
.fd-cat-node-collapsed > .fd-cat-row .fd-cat-caret {
    transform: rotate(-90deg);
}
.fd-cat-node-collapsed > .fd-cat-children {
    display: none;
}
.fd-cat-caret-spacer {
    display: inline-block;
    width: 18px;
    margin-left: 2px;
    flex-shrink: 0;
}
.fd-cat-link {
    padding-left: 6px;
}

/* â”€â”€ Selection par coches dans les panneaux de classement â”€â”€ */

.fd-card input[type="checkbox"].fd-sel-check {
    width: 15px !important;
    height: 15px !important;
    margin: 0 0 0 8px !important;
    padding: 0 !important;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--fd-primary);
}
.fd-cat-row-active input[type="checkbox"].fd-sel-check {
    accent-color: #fff;
}

.fd-sel-bar {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--fd-primary-light);
    border-radius: 8px;
    background: rgba(29, 147, 198, .07);
}
.fd-sel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.fd-sel-count {
    font-size: .82rem;
    font-weight: 700;
    color: var(--fd-primary);
}
.fd-card button.fd-sel-clear {
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    color: var(--fd-text-muted) !important;
    font-size: .76rem !important;
    font-weight: 400 !important;
    text-decoration: underline;
    box-shadow: none !important;
    cursor: pointer;
}
.fd-sel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.fd-card .fd-sel-actions button,
.fd-sel-actions .fd-button {
    margin: 0 !important;
    padding: 5px 10px !important;
    font-size: .8rem !important;
}
.fd-card .fd-sel-actions button:disabled {
    opacity: .4;
    cursor: not-allowed;
}
.fd-sel-actions .fd-sel-disabled {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}
.fd-card .fd-sel-actions button.fd-sel-open-active {
    background: var(--fd-primary) !important;
    color: #fff !important;
}
.fd-sel-panel {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--fd-border-light);
}
.fd-sel-panel .fd-input {
    padding: 6px 8px !important;
    margin-top: 4px !important;
    font-size: .86rem !important;
    text-align: left !important;
}
.fd-sel-panel .fd-main-button {
    margin-top: 8px;
    width: 100%;
    justify-content: center;
}

/* â”€â”€ Colonne de selection du tableau des articles â”€â”€ */

.fd-col-check {
    width: 34px;
    text-align: center;
    padding-left: 6px !important;
    padding-right: 0 !important;
}
.fd-card .fd-col-check input[type="checkbox"] {
    width: 15px !important;
    height: 15px !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer;
    accent-color: var(--fd-primary);
}
.fd-sel-bar-wide {
    margin-bottom: 12px;
}
.fd-sel-bar-wide .fd-sel-head {
    margin-bottom: 6px;
}
/* Ligne cochee mise en evidence */
.fd-item-row:has(.fd-sel-check:checked) {
    background: rgba(29, 147, 198, .09);
}

.fd-sel-warn {
    margin: 8px 0 0;
    font-size: .8rem;
    line-height: 1.5;
    color: #a3400f;
}
[data-theme="dark"] .fd-sel-warn {
    color: #f0a05a;
}

/* Facture Ã©lectronique : informations manquantes avant export */
.fd-facturx-manques {
    margin: 10px 0 16px;
    padding-left: 22px;
}
.fd-facturx-manques li {
    margin-bottom: 7px;
    line-height: 1.55;
}
