/*
 * Insights — styles dédiés.
 * Spec : SPECIFICATIONS.md §9.5.
 */

.insights {
    padding: var(--space-4);
    max-width: 720px;
    margin: 0 auto;
}

.insights__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}
.insights__title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text);
}
.insights__subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}
.insights__actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* ============================================================
   Sections
   ============================================================ */
.insights__section {
    margin-bottom: var(--space-5);
}
.insights__section-title {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-3);
}

/* ============================================================
   Card d'insight
   ============================================================ */
.insight {
    background: var(--surface);
    border: var(--border-width) solid var(--border);
    border-left-width: 3px;
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    box-shadow: var(--shadow);
    transition: background var(--transition-fast);
}
.insight--new {
    background: var(--accent-soft);
    border-left-color: var(--accent);
}
.insight--info     { border-left-color: var(--accent); }
.insight--suggestion { border-left-color: var(--accent-hover); }
.insight--warning  { border-left-color: var(--warning); }

.insight__head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    flex-wrap: wrap;
}
.insight__icon {
    width: 28px;
    height: 28px;
    background: var(--surface-alt);
    color: var(--accent-text);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.insight--new .insight__icon {
    background: var(--surface);
    color: var(--accent);
}
.insight__title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
    flex: 1;
    min-width: 0;
}
.insight__ai-badge,
.insight__new-badge {
    font-size: 0.6rem;
}
.insight__body {
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: var(--space-3);
}
.insight__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.insight__meta {
    font-size: 0.72rem;
}
.insight__actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* ============================================================
   Empty state
   ============================================================ */
.insights__empty {
    background: var(--surface);
    border: var(--border-width) dashed var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-5);
    text-align: center;
    color: var(--text-muted);
}
.insights__empty-icon {
    color: var(--accent);
    margin-bottom: var(--space-3);
}
.insights__empty-text {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: var(--space-2);
}

/* ============================================================
   Badge compteur sur la nav (sidebar pill + bottom-nav dot)
   ============================================================ */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    min-width: 18px;
    height: 18px;
    line-height: 1;
}
.nav-badge--hidden { display: none; }

.nav-badge--dot {
    /* Variante mobile : juste un point de couleur */
    width: 8px;
    height: 8px;
    min-width: 0;
    padding: 0;
    font-size: 0;
    border-radius: var(--radius-pill);
}

/* Conteneur pour positionner le dot par dessus l'icône en bottom-nav */
.bottom-nav__icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bottom-nav__icon-wrap .nav-badge--dot {
    position: absolute;
    top: -2px;
    right: -4px;
    border: 2px solid var(--surface);
    box-sizing: content-box;
}

/* Sur sidebar : badge en bout de ligne */
.sidebar__item {
    position: relative;
}
.sidebar__item .nav-badge {
    margin-left: auto;
}
