/**
 * Mes Lecteurs — CRM Auteur
 * Cards, segments, KPIs, responsive
 */

/* ── KPI Cards ── */
.kpi-card {
    background: var(--bs-white, #fff);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    transition: transform .15s ease, box-shadow .15s ease;
}
.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}
.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: .5rem;
}
.kpi-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--bs-dark, #212529);
}
.kpi-label {
    font-size: .8rem;
    color: var(--bs-secondary, #6c757d);
    margin-top: 2px;
}

/* ── Segment Tabs ── */
.segment-tabs {
    gap: .35rem;
    flex-wrap: wrap;
}
.segment-tabs .nav-link {
    font-size: .85rem;
    padding: .4rem .85rem;
    border-radius: 20px;
    color: var(--bs-body-color, #333);
    background: var(--bs-gray-100, #f8f9fa);
    border: 1px solid transparent;
    transition: all .15s ease;
}
.segment-tabs .nav-link:hover {
    background: var(--bs-gray-200, #e9ecef);
}
.segment-tabs .nav-link.active {
    background: var(--bs-primary, #0d6efd);
    color: #fff;
}
.segment-tabs .nav-link .badge {
    font-size: .7rem;
    font-weight: 600;
    vertical-align: middle;
}

/* ── Search Bar ── */
.search-bar {
    min-width: 240px;
    max-width: 320px;
}
.search-bar .input-group-text {
    background: transparent;
    border-right: 0;
}
.search-bar .form-control {
    border-left: 0;
    font-size: .875rem;
}
.search-bar .form-control:focus {
    box-shadow: none;
    border-color: var(--bs-primary, #0d6efd);
}
.search-bar .input-group-text + .form-control:focus ~ .input-group-text,
.search-bar .form-control:focus + .input-group-text {
    border-color: var(--bs-primary, #0d6efd);
}

/* ── Reader Cards ── */
.reader-grid .reader-card {
    background: var(--bs-white, #fff);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
    height: 100%;
}
.reader-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .1);
}
.reader-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}
.reader-card-link:hover {
    color: inherit;
}

/* Avatar */
.reader-avatar {
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 1.25rem;
}
.reader-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bs-gray-200, #e9ecef);
}
.reader-initials {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

/* Segment Badge */
.segment-badge {
    position: absolute;
    top: .6rem;
    right: .75rem;
    font-size: .65rem;
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.segment-fan {
    background: #fff3cd;
    color: #856404;
}
.segment-nouveau {
    background: #d1e7dd;
    color: #0f5132;
}
.segment-silencieux {
    background: #e2e3e5;
    color: #41464b;
}

/* Info */
.reader-info {
    text-align: center;
    padding: .75rem 1rem .5rem;
    flex: 1;
}
.reader-name {
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: .35rem;
    color: var(--bs-dark, #212529);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.role-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    padding: .15rem .5rem;
    border-radius: 8px;
    margin-bottom: .35rem;
}
.reader-location {
    font-size: .75rem;
    color: var(--bs-secondary, #6c757d);
    margin-top: .2rem;
}
.reader-location i {
    margin-right: 3px;
    font-size: .65rem;
}

/* Stats row */
.reader-stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: .5rem 1rem;
    border-top: 1px solid var(--bs-gray-100, #f1f1f1);
}
.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .8rem;
    color: var(--bs-body-color, #333);
}
.stat-item i {
    font-size: .75rem;
}

/* Footer */
.reader-footer {
    display: flex;
    justify-content: space-between;
    padding: .5rem 1rem .75rem;
    font-size: .7rem;
    color: var(--bs-secondary, #6c757d);
    border-top: 1px solid var(--bs-gray-100, #f1f1f1);
}
.reader-footer i {
    margin-right: 3px;
}

/* ── Responsive ── */
@media (max-width: 575.98px) {
    .kpi-card {
        padding: .85rem .5rem;
    }
    .kpi-value {
        font-size: 1.3rem;
    }
    .kpi-label {
        font-size: .7rem;
    }
    .segment-tabs .nav-link {
        font-size: .78rem;
        padding: .3rem .65rem;
    }
    .search-bar {
        min-width: 100%;
        max-width: 100%;
    }
    .reader-photo,
    .reader-initials {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .reader-grid .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}
