/* =============================================================================
   IT Org — Styles complémentaires à Bootstrap 5
   ========================================================================== */

body { background: #f4f6f9; }

/* --- Avatars (initiales sur fond coloré, teinte via --hue) ----------------- */
.avatar {
    --hue: 210;
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 2.5rem; height: 2.5rem; border-radius: 50%;
    background: hsl(var(--hue) 55% 88%); color: hsl(var(--hue) 55% 28%);
    font-weight: 600; font-size: .95rem; letter-spacing: .02em; user-select: none;
}
.avatar-xs { width: 1.6rem; height: 1.6rem; font-size: .65rem; }
.avatar-sm { width: 2rem;   height: 2rem;   font-size: .75rem; }
.avatar-lg { width: 3.25rem; height: 3.25rem; font-size: 1.15rem; }
.avatar-xl { width: 5rem;   height: 5rem;   font-size: 1.7rem; }

/* --- Cartes / vignettes ----------------------------------------------------- */
.card { border-color: rgba(0,0,0,.07); }
.tile, .stat-card { transition: transform .12s ease, box-shadow .12s ease; }
.tile:hover, .stat-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.08); }

.stat-icon {
    width: 3rem; height: 3rem; border-radius: .75rem;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem;
}

.member-card .card-body { padding: 1rem; }
.member-card .member-name { color: var(--bs-body-color); font-weight: 600; }
.member-card .member-meta { font-size: .8rem; color: var(--bs-secondary-color); }
.member-card.inactive { opacity: .6; }
.member-card .dropdown { position: absolute; top: .4rem; right: .4rem; }
.member-card .stretched-link::after { z-index: 0; }
.member-card .dropdown, .member-card .dropdown-menu { z-index: 2; }

.holder-badge { font-weight: 500; }

/* --- Reporting UP : chaîne de managers ------------------------------------- */
.chain { position: relative; }
.chain li { position: relative; padding-left: 1.5rem; }
.chain li::before {            /* trait vertical */
    content: ""; position: absolute; left: .5rem; top: 0; bottom: 0;
    border-left: 2px solid var(--bs-border-color);
}
.chain li:first-child::before { top: 50%; }
.chain li:last-child::before  { bottom: 50%; }
.chain li::after {             /* point */
    content: ""; position: absolute; left: calc(.5rem - 4px); top: calc(50% - 5px);
    width: 10px; height: 10px; border-radius: 50%; background: var(--bs-primary);
}
.chain-item {
    display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; margin: .2rem 0;
    border-radius: .5rem; color: inherit; text-decoration: none;
}
a.chain-item:hover { background: var(--bs-tertiary-bg); }
.chain-item.current { background: var(--bs-primary-bg-subtle); }

/* --- Reporting DOWN / organigramme : arbre ---------------------------------- */
.org-tree { list-style: none; margin: 0; padding-left: 1.25rem; }
.org-tree.org-root { padding-left: 0; }
.org-tree li { position: relative; margin: .15rem 0; }
.org-tree .org-tree li::before {   /* trait horizontal vers le nœud */
    content: ""; position: absolute; left: -1rem; top: 1rem; width: .8rem;
    border-top: 1px solid var(--bs-border-color);
}
.org-tree .org-tree { border-left: 1px solid var(--bs-border-color); margin-left: .6rem; }
.org-tree summary { list-style: none; display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.org-tree summary::-webkit-details-marker { display: none; }
.org-tree summary::before {
    content: "\25B8"; color: var(--bs-secondary-color); width: .8rem; transition: transform .15s;
}
.org-tree details[open] > summary::before { transform: rotate(90deg); }
.org-leaf { padding-left: 1.2rem; }
.org-node {
    display: inline-flex; align-items: center; gap: .45rem; flex-wrap: wrap;
    padding: .25rem .5rem; border-radius: .4rem; color: inherit; text-decoration: none;
}
.org-node:hover { background: var(--bs-tertiary-bg); }
.org-node.inactive { opacity: .5; }

/* --- Divers ------------------------------------------------------------------ */
.filter-bar { background: var(--bs-body-bg); }
.notes { white-space: normal; }
.resp-row { background: var(--bs-tertiary-bg); border-radius: .5rem; padding: .35rem .5rem; }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--bs-secondary-color); }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .5rem; }

/* --- Pages d'authentification --------------------------------------------- */
.auth-page { background: linear-gradient(135deg, #e9eef6 0%, #f7f9fc 100%); min-height: 100vh; }
.auth-logo {
    display: inline-flex; width: 3.5rem; height: 3.5rem; border-radius: 1rem;
    align-items: center; justify-content: center; font-size: 1.75rem;
    background: var(--bs-primary); color: #fff;
}
.otp-input { letter-spacing: .6em; font-variant-numeric: tabular-nums; }
