/* ==========================================================================
   CE CRM — Feuille de style principale
   Complète Bootstrap 5.3, RGAA accessible, responsive
   ========================================================================== */

/* ── Variables ─────────────────────────────────────────── */
:root {
    --crm-sidebar-width: 0px; /* Pas de sidebar fixe, navbar top */
    --crm-navbar-height: 56px;
    --crm-primary: #0d6efd;
    --crm-bg: #f8f9fc;
    --crm-border: #dee2e6;
    --crm-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ── Layout global ─────────────────────────────────────── */
body.crm-body {
    background-color: var(--crm-bg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: .9rem;
    color: #212529;
}

.crm-navbar {
    background: #fff;
    border-bottom: 1px solid var(--crm-border);
    box-shadow: var(--crm-shadow);
    min-height: var(--crm-navbar-height);
}

.crm-main {
    min-height: calc(100vh - var(--crm-navbar-height) - 40px);
}

.crm-footer {
    background: #fff;
    border-top: 1px solid var(--crm-border);
}

/* ── RGAA — Lien d'évitement ───────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--crm-primary);
    color: #fff;
    padding: .5rem 1rem;
    z-index: 9999;
    text-decoration: none;
    border-radius: 0 0 .25rem 0;
}
.skip-link:focus {
    top: 0;
}

/* ── Avatars ───────────────────────────────────────────── */
.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--crm-primary), #6610f2);
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    flex-shrink: 0;
    user-select: none;
}
.avatar-circle.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: .7rem;
}
.avatar-circle.avatar-xl {
    width: 72px;
    height: 72px;
    font-size: 1.5rem;
}

/* ── KPI Cards ─────────────────────────────────────────── */
.kpi-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Canaux de contact (icônes dans les tableaux) ──────── */
.channel-icon {
    font-size: 1rem;
    line-height: 1;
    transition: transform .15s;
}
.channel-icon:hover {
    transform: scale(1.2);
}

/* ── Timeline (fiche contact) ──────────────────────────── */
.timeline {
    position: relative;
}
.timeline-item {
    position: relative;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 28px;
    bottom: 0;
    width: 2px;
    background: var(--crm-border);
}
.timeline-item:last-child::before {
    display: none;
}
.timeline-icon {
    flex-shrink: 0;
    z-index: 1;
}

/* ── Kanban ────────────────────────────────────────────── */
.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--crm-border); border-radius: 3px; }

.kanban-card {
    cursor: grab;
    transition: box-shadow .15s, transform .1s;
    border-radius: .5rem !important;
}
.kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.12) !important;
}
.kanban-card-ghost {
    opacity: .4;
    background: #e9ecef;
}
.kanban-card.sortable-chosen {
    cursor: grabbing;
    transform: rotate(1deg);
    box-shadow: 0 8px 20px rgba(0,0,0,.15) !important;
}

.kanban-col-header {
    font-size: .85rem;
}

/* ── Taille de texte utilitaire ────────────────────────── */
.xsmall { font-size: .75rem; }

/* ── Bouton extra-small ─────────────────────────────────── */
.btn-xs {
    padding: .15rem .4rem;
    font-size: .75rem;
    line-height: 1.4;
    border-radius: .2rem;
}

/* ── Boutons de suppression (modal confirm) ─────────────── */
.btn-delete, .btn-tag-delete { cursor: pointer; }

/* ── Auth page ─────────────────────────────────────────── */
body.auth-body {
    background: linear-gradient(135deg, #0d6efd22, #6610f222), var(--crm-bg);
}

/* ── Breadcrumb compact ─────────────────────────────────── */
.breadcrumb-sm {
    font-size: .8rem;
    margin-bottom: 0;
    background: none;
    padding: 0;
}

/* ── Focus visible (RGAA) ──────────────────────────────── */
:focus-visible {
    outline: 3px solid #fd7e14;
    outline-offset: 2px;
}
.btn:focus-visible,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 3px rgba(253,126,20,.35);
}

/* ── Responsive tables ─────────────────────────────────── */
@media (max-width: 576px) {
    .table-responsive table td,
    .table-responsive table th {
        padding-left: .5rem;
        padding-right: .5rem;
    }
}

/* ── Couleur des badges de statut (assure contraste RGAA) ─ */
.bg-warning { color: #000 !important; }
.bg-info    { color: #000 !important; }
