/* ================================================================
   Axeane UI — Suivi envoi documents (vue Table + vue Dossiers)
   Préfixe .sed-  |  directive ax-suivi-documents
   ================================================================ */

.sed-ecran { height: 99%; }
.sed.ax-container {
    display: flex; flex-direction: column; gap: 12px;
    height: 100%; padding: 16px 24px 12px; box-sizing: border-box;
    background: var(--ax-body); color: var(--ax-text); font-size: 13px;
}

/* ═══ En-tête (bandeau bleu) ═══ */
.sed-entete {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 14px 18px; border-radius: 12px;
    background: linear-gradient(135deg, var(--ax-primary) 0%, var(--ax-primary-dark) 100%);
    box-shadow: 0 2px 8px rgba(var(--ax-primary-rgb), .25);
}
.sed-titre { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sed-titre h2 { margin: 0; font-size: 18px; font-weight: 600; color: #fff; letter-spacing: -.01em; }
.sed-titre p { margin: 2px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, .8); }
.sed-titre-icone {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 40px; height: 40px; border-radius: 10px;
    background: rgba(255, 255, 255, .16); color: #fff; font-size: 18px;
}
.sed-entete-actions { display: flex; align-items: center; gap: 10px; }

/* Choix d'affichage (segmented control) */
.sed-seg {
    display: inline-flex; padding: 3px; gap: 2px;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); border-radius: 10px;
}
.sed-seg button {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 14px; border: 0; border-radius: 7px;
    background: transparent; color: rgba(255, 255, 255, .85); font-size: 13px; font-weight: 500; cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.sed-seg button:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.sed-seg button.actif { background: #fff; color: var(--ax-primary); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }

.sed-btn {
    display: inline-flex; align-items: center; gap: 7px;
    height: 36px; padding: 0 14px; border-radius: 9px;
    background: #fff; border: 1px solid var(--ax-border-strong); color: var(--ax-text-strong);
    font-size: 13px; font-weight: 500; cursor: pointer; box-shadow: var(--ax-shadow-xs);
    transition: border-color .15s ease, background-color .15s ease;
}
.sed-btn:hover { border-color: var(--ax-primary); color: var(--ax-primary); }
.sed-entete .sed-btn { border-color: transparent; color: var(--ax-primary); }
.sed-entete .sed-btn:hover { background: var(--ax-primary-50); }
.sed-entete button:focus-visible { outline-color: #fff; }

.sed-lien {
    display: inline-flex; align-items: center; gap: 5px; align-self: flex-end;
    height: 36px; padding: 0 6px; border: 0; background: none;
    color: var(--ax-primary); font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.sed-lien:hover { text-decoration: underline; }

/* ═══ Cartes ═══ */
.sed-carte {
    background: var(--ax-card); border: 1px solid var(--ax-border); border-radius: 12px; box-shadow: var(--ax-shadow-sm);
}

/* ═══ Critères ═══ */
.sed-criteres { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px 14px; padding: 14px 16px; }
.sed-champ { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.sed-champ label { margin: 0; font-size: 12px; font-weight: 600; color: var(--ax-text-sec); }
.sed-champ-periode { width: 170px; }
.sed-champ-date { width: 150px; }
.sed-champ-type { width: 200px; }
.sed-champ-recherche { flex: 1 1 220px; max-width: 360px; }

.sed-champ ol.nya-bs-select { width: 100% !important; margin: 0; }
.sed-champ ol.nya-bs-select button.dropdown-toggle {
    height: 36px; border-radius: 9px; border-color: var(--ax-border-input); font-size: 13px; background: #fff;
}

.sed-input {
    width: 100%; height: 36px; padding: 6px 11px; box-sizing: border-box !important;
    border: 1px solid var(--ax-border-input); border-radius: 9px; background: #fff;
    font-size: 13px; color: var(--ax-text); outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.sed-input::placeholder { color: var(--ax-text-light); }
.sed-input:hover { border-color: var(--ax-text-light); }
.sed-input:focus { border-color: var(--ax-border-focus); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }

.sed-recherche { position: relative; }
.sed-recherche > .fa { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ax-text-light); pointer-events: none; }
.sed-recherche .sed-input { padding-left: 34px; }

.sed-date { position: relative; display: flex; }
.sed-date .sed-input { padding-right: 34px; }
.sed-date-btn {
    position: absolute; right: 3px; top: 50%; transform: translateY(-50%);
    width: 30px; height: 28px; border: 0; border-radius: 6px; background: transparent;
    color: var(--ax-text-sec); cursor: pointer;
}
.sed-date-btn:hover { background: var(--ax-border-light); color: var(--ax-primary); }

/* Puces de statut */
.sed-puces { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; align-self: center; }
.sed-puce {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 11px; border-radius: 999px;
    border: 1px solid var(--ax-border); background: #fff; color: var(--ax-text);
    font-size: 12.5px; cursor: pointer; transition: border-color .15s ease, background-color .15s ease;
}
.sed-puce b { font-weight: 600; color: var(--ax-text-strong); font-variant-numeric: tabular-nums; }
.sed-puce:hover { border-color: var(--ax-border-strong); background: var(--ax-border-light); }
.sed-puce.actif { border-color: var(--ax-primary); background: var(--ax-primary-50); }
.sed-point { width: 8px; height: 8px; border-radius: 50%; background: var(--ax-text-light); }
.sed-puce-info .sed-point { background: #3b82f6; }
.sed-puce-ok .sed-point { background: #16a34a; }
.sed-puce-attente .sed-point { background: #f59e0b; }
.sed-puce-ko .sed-point { background: #dc2626; }

/* ═══ Corps ═══ */
.sed-corps { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ── Table ── */
.sed-table-defil { flex: 1 1 auto; min-height: 0; overflow: auto; }
.sed-table { width: 100%; min-width: 1040px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.sed-table th, .sed-table td { padding: 0 10px; text-align: left; vertical-align: middle; }
.sed-table thead th {
    position: sticky; top: 0; z-index: 2; background: #f8fafc;
    font-size: 12px; font-weight: 600; color: var(--ax-text-sec); height: 40px; white-space: nowrap;
    border-bottom: 1px solid var(--ax-border);
}
.sed-table thead tr.sed-filtres th { top: 40px; height: 48px; background: #fff; font-weight: 400; }
.sed-table thead tr.sed-filtres .sed-input { height: 32px; font-size: 12.5px; border-radius: 8px; }
.sed-table thead tr.sed-filtres .sed-date-btn { height: 26px; }

.sed-table .col-piece { width: 130px; }
.sed-table .col-date { width: 136px; }
.sed-table .col-statut { width: 124px; }
.sed-table .col-type { width: 150px; }
.sed-table .col-rejet { width: 20%; }
.sed-table .col-desc { width: 24%; }
.sed-table .col-fichier { width: 30%; }
.sed-table .col-actions { width: 204px; text-align: right; }

.sed-tri {
    display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none;
    font: inherit; color: inherit; cursor: pointer;
}
.sed-tri:hover { color: var(--ax-text-strong); }
.sed-tri .fa { font-size: 11px; color: var(--ax-text-light); }
.sed-tri .fa-sort-asc, .sed-tri .fa-sort-desc { color: var(--ax-primary); }

.sed-table tbody td { height: 46px; border-bottom: 1px solid var(--ax-border-light); font-size: 13px; }
.sed-table tbody tr { transition: background-color .12s ease; }
.sed-table tbody tr:hover { background: #f8f9ff; }
.sed-table tbody tr.rejete td:first-child { box-shadow: inset 3px 0 0 #dc2626; }

.sed-fort { font-weight: 600; color: var(--ax-text-strong); }
.sed-num { font-variant-numeric: tabular-nums; }
.sed-doux { color: var(--ax-text-sec); }
.sed-coupe { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sed-rejet { color: #b91c1c; font-size: 12.5px; }

.sed-fichier-lien {
    display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
    padding: 0; border: 0; background: none; color: var(--ax-text); cursor: pointer; font-size: 13px;
}
.sed-fichier-lien .fa { color: #dc2626; flex: none; }
.sed-fichier-lien span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sed-fichier-lien:hover span { color: var(--ax-primary); text-decoration: underline; }

/* Badges */
.sed-badge {
    display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.sed-badge-info { background: #eff6ff; color: #1d4ed8; }
.sed-badge-ok { background: #ecfdf5; color: #047857; }
.sed-badge-attente { background: #fffbeb; color: #b45309; }
.sed-badge-ko { background: #fef2f2; color: #b91c1c; }
.sed-badge-neutre { background: #f1f5f9; color: #475569; }
.sed-badge-texte { gap: 5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 22px; vertical-align: middle; }
.sed-badge-texte .fa { margin-right: 4px; }

.sed-type {
    display: inline-block; max-width: 100%; height: 24px; line-height: 24px; padding: 0 9px; border-radius: 6px;
    font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.sed-type-mini { height: 20px; line-height: 20px; padding: 0 7px; font-size: 11px; }

/* Teintes des types / dossiers */
.sed-teinte-indigo { background: #eef2ff; color: #4338ca; }
.sed-teinte-vert { background: #ecfdf5; color: #047857; }
.sed-teinte-orange { background: #fff7ed; color: #c2410c; }
.sed-teinte-bleu { background: #eff6ff; color: #1d4ed8; }
.sed-teinte-rose { background: #fdf2f8; color: #be185d; }
.sed-teinte-violet { background: #f5f3ff; color: #6d28d9; }
.sed-teinte-cyan { background: #ecfeff; color: #0e7490; }
.sed-teinte-ambre { background: #fffbeb; color: #b45309; }
.sed-teinte-neutre { background: #f1f5f9; color: #475569; }

/* Boutons icône + menu */
.sed-actions { display: inline-flex; align-items: center; gap: 2px; }
.sed-icone-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent;
    color: var(--ax-text-sec); cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.sed-icone-btn:hover { background: var(--ax-primary-50); color: var(--ax-primary); }
.sed-menu { min-width: 160px; padding: 6px; border: 1px solid var(--ax-border); border-radius: 10px; box-shadow: var(--ax-shadow-lg); }
.sed-menu > li > a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--ax-text); cursor: pointer; }
.sed-menu > li > a:hover { background: var(--ax-border-light); }
.sed-menu > li > a.danger { color: #b91c1c; }
.sed-menu > li > a.danger:hover { background: #fef2f2; }

/* Documents rejetés : bandeau, bouton Remplacer, actions sur les cartes */
.sed-bandeau-rejet {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 14px; border: 1px solid #fecaca; border-radius: 12px; background: #fef2f2; color: #7f1d1d; font-size: 13px;
}
.sed-bandeau-icone { color: #dc2626; font-size: 18px; }
.sed-bandeau-texte { flex: 1 1 280px; min-width: 0; }
.sed-btn.sed-btn-rejet { height: 32px; border-color: #fca5a5; color: #b91c1c; }
.sed-btn.sed-btn-rejet:hover { background: #fff; border-color: #dc2626; color: #991b1b; }
.sed-btn-remplacer {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 8px;
    border: 1px solid #f97316; background: #fff7ed; color: #c2410c; font-size: 12.5px; font-weight: 600; cursor: pointer;
    white-space: nowrap; transition: background-color .15s ease, color .15s ease;
}
.sed-btn-remplacer:hover { background: #f97316; color: #fff; }
.sed-icone-btn.sed-icone-danger:hover { background: #fef2f2; color: #b91c1c; }
.sed-lien.sed-lien-danger { color: #b91c1c; height: 30px; align-self: center; }
.sed-fichier-rejet { display: flex; align-items: center; gap: 10px; padding: 8px 14px 12px; border-top: 1px dashed #fecaca; }

/* Pied (pagination) */
.sed-pied {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 52px; padding: 0 14px; border-top: 1px solid var(--ax-border);
}
/* la bulle du chat support est fixée en bas à droite : la pagination s'arrête avant */
.sed-pied .sed-pagination { margin-right: 64px !important; }
.sed-pied .sed-pagination { margin: 0; }
.sed-pagination > li > a { min-width: 32px; height: 32px; line-height: 20px; text-align: center; border-color: var(--ax-border); color: var(--ax-text); }
.sed-pagination > li:first-child > a { border-radius: 8px 0 0 8px; }
.sed-pagination > li:last-child > a { border-radius: 0 8px 8px 0; }
.sed-pagination > .active > a, .sed-pagination > .active > a:hover, .sed-pagination > .active > a:focus {
    background: var(--ax-primary); border-color: var(--ax-primary); color: #fff;
}

/* État vide */
.sed-vide { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 16px; text-align: center; color: var(--ax-text-sec); }
.sed-vide strong { color: var(--ax-text-strong); font-size: 14px; font-weight: 600; }
.sed-vide .sed-lien { align-self: center; height: auto; }
.sed-vide-icone {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; border-radius: 14px; background: var(--ax-border-light); font-size: 22px; color: var(--ax-text-light);
}

/* ── Dossiers ── */
.sed-fil {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
    min-height: 52px; padding: 8px 12px; border-bottom: 1px solid var(--ax-border);
}
.sed-fil-chemin { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; }
.sed-fil-etape { display: inline-flex; align-items: center; gap: 4px; }
.sed-fil-etape > .fa { color: var(--ax-text-light); }
.sed-fil-chemin button {
    display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 9px;
    border: 0; border-radius: 8px; background: none; color: var(--ax-text-sec); font-size: 14px; cursor: pointer;
}
.sed-fil-chemin button:hover { background: var(--ax-border-light); color: var(--ax-text-strong); }
.sed-fil-chemin button.courant { color: var(--ax-text-strong); font-weight: 600; }
.sed-fil-info { margin-left: auto; font-size: 12.5px; }
.sed-fil > .sed-seg { margin-left: auto; }
.sed-fil-info + .sed-seg { margin-left: 8px; }

/* Choix d'affichage sur fond clair (Arbre / Grille) */
.sed-seg-clair { background: var(--ax-border-light); border-color: var(--ax-border); }
.sed-seg-clair button { height: 28px; padding: 0 11px; font-size: 12.5px; color: var(--ax-text-sec); }
.sed-seg-clair button:hover { color: var(--ax-text-strong); background: #fff; }
.sed-seg-clair button.actif { background: #fff; color: var(--ax-primary); box-shadow: var(--ax-shadow-sm); }

/* Arbre à gauche + contenu à droite */
.sed-dossiers { flex: 1 1 auto; min-height: 0; display: flex; }
.sed-arbre {
    flex: 0 0 280px; min-width: 0; overflow: auto; padding: 10px 8px;
    border-right: 1px solid var(--ax-border); background: #fafbfd;
}
.sed-arbre ul { list-style: none; margin: 0; padding: 0; }
.sed-arbre-ligne { display: flex; align-items: center; gap: 2px; border-radius: 8px; padding-right: 4px; }
.sed-arbre-ligne:hover { background: var(--ax-border-light); }
.sed-arbre-ligne.actif { background: var(--ax-primary-50); }
.sed-arbre-chevron {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 22px; height: 30px; padding: 0; border: 0; background: none; color: var(--ax-text-light); cursor: pointer;
}
button.sed-arbre-chevron:hover { color: var(--ax-text-strong); }
.sed-arbre-nom {
    display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; height: 32px; padding: 0 6px;
    border: 0; border-radius: 6px; background: none; color: var(--ax-text); font-size: 13px; text-align: left; cursor: pointer;
}
.sed-arbre-ligne.actif .sed-arbre-nom { color: var(--ax-primary); font-weight: 600; }
.sed-arbre-libelle { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sed-arbre-nb { flex: none; font-size: 11.5px; color: var(--ax-text-light); font-variant-numeric: tabular-nums; }
.sed-arbre-alerte { flex: none; color: #dc2626; font-size: 12px; }
.sed-arbre-nom > .fa { flex: none; font-size: 14px; }

/* Couleur des icônes de dossier dans l'arbre */
.sed-icone-indigo { color: #4f46e5; }
.sed-icone-vert { color: #059669; }
.sed-icone-orange { color: #ea580c; }
.sed-icone-bleu { color: #2563eb; }
.sed-icone-rose { color: #db2777; }
.sed-icone-violet { color: #7c3aed; }
.sed-icone-cyan { color: #0891b2; }
.sed-icone-ambre { color: #d97706; }
.sed-icone-neutre { color: #64748b; }

.sed-drive { flex: 1 1 auto; min-width: 0; min-height: 0; overflow: auto; padding: 16px; }
.sed-section-titre { margin: 4px 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ax-text-sec); }
.sed-grille + .sed-section-titre { margin-top: 22px; }
.sed-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.sed-grille-fichiers { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.sed-dossier {
    position: relative; display: flex; align-items: flex-start; gap: 12px;
    padding: 14px; border: 1px solid var(--ax-border); border-radius: 12px; background: #fff;
    text-align: left; cursor: pointer; color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.sed-dossier:hover { border-color: rgba(var(--ax-primary-rgb), .45); box-shadow: var(--ax-shadow-md); transform: translateY(-1px); }
.sed-dossier-icone {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 42px; height: 42px; border-radius: 10px; font-size: 20px;
}
.sed-dossier-texte { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sed-dossier-nom { font-size: 14px; font-weight: 600; color: var(--ax-text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sed-dossier-meta { font-size: 12.5px; color: var(--ax-text-sec); }
.sed-dossier-types { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.sed-alerte {
    align-self: flex-start; margin-top: 2px;
    display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px;
    background: #fef2f2; color: #b91c1c; font-size: 11.5px; font-weight: 600;
}

.sed-fichier {
    display: flex; flex-direction: column; border: 1px solid var(--ax-border); border-radius: 12px; background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.sed-fichier:hover { border-color: rgba(var(--ax-primary-rgb), .45); box-shadow: var(--ax-shadow-md); }
.sed-fichier.rejete { border-color: #fecaca; }
.sed-fichier-ouvrir {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 14px 14px 10px; border: 0; background: none; text-align: left; cursor: pointer; color: inherit;
}
.sed-pdf {
    position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
    width: 42px; height: 50px; border-radius: 8px; background: #fef2f2; color: #dc2626; font-size: 20px;
}
.sed-pdf span { font-size: 9px; font-weight: 700; letter-spacing: .04em; margin-top: 1px; }
.sed-fichier-texte { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sed-fichier-nom { font-size: 13px; font-weight: 600; color: var(--ax-text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sed-fichier-ouvrir:hover .sed-fichier-nom { color: var(--ax-primary); }
.sed-fichier-meta { font-size: 12px; color: var(--ax-text-sec); font-variant-numeric: tabular-nums; }
.sed-fichier-pied { display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 8px 8px 14px; }
.sed-fichier-pied .sed-badge-texte { flex: 0 1 auto; min-width: 0; }
.sed-fichier-pied .sed-actions { margin-left: auto; }

/* Focus clavier */
.sed button:focus-visible, .sed a:focus-visible, .sed .sed-input:focus-visible {
    outline: 2px solid var(--ax-border-focus); outline-offset: 2px;
}

@media (max-width: 1100px) {
    .sed-arbre { flex-basis: 220px; }
}
@media (max-width: 900px) {
    .sed.ax-container { padding: 12px; }
    .sed-dossiers.avec-arbre { flex-direction: column; }
    .sed-arbre { flex: 0 0 auto; max-height: 220px; border-right: 0; border-bottom: 1px solid var(--ax-border); }
    .sed-puces { margin-left: 0; }
    .sed-champ-recherche { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    .sed *, .sed *::before, .sed *::after { transition: none !important; }
    .sed-dossier:hover { transform: none; }
}
