/*
 * Listes Refactia (documents, clients, prestations, paiements…).
 *
 * Référence : liste des factures (list/list-global_v2.css, orderdocs-list-*).
 * Structure : .app-list > .app-list__head (légende) + .app-list__row (ligne).
 * Les colonnes restent propres à chaque module (classes *-col-*) ; ce fichier
 * fixe la surface, les états et le rythme commun.
 * Valeurs : foundation/tokens.css. Registre : doc/design-system/README.md
 */

.app-list {
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-10);
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: var(--ds-font);
}

.app-list__head,
.app-list__row {
    display: flex;
    align-items: center;
    gap: var(--ds-space-12);
    box-sizing: border-box;
    margin: 0;
    padding: var(--ds-space-12) var(--ds-space-16);
    border-radius: var(--ds-radius-md);
}

.app-list__head {
    min-height: var(--ds-control-touch);
    background: var(--ds-brand);
    color: var(--ds-on-brand);
    box-shadow: var(--ds-shadow-raised);
    font-size: var(--ds-text-base);
    font-weight: var(--ds-weight-bold);
}

.app-list__row {
    border: 1px solid var(--ds-line);
    background: var(--ds-surface);
    color: var(--ds-ink);
    font-size: var(--ds-text-base);
    text-decoration: none;
    transition:
        background-color var(--ds-duration) var(--ds-ease),
        border-color var(--ds-duration) var(--ds-ease),
        box-shadow var(--ds-duration) var(--ds-ease),
        transform var(--ds-duration) var(--ds-ease);
}

.app-list__row--interactive {
    cursor: pointer;
}

.app-list__row--interactive:hover {
    border-color: var(--ds-line-hover);
    background: var(--ds-tint-1);
    box-shadow: var(--ds-shadow-raised);
    transform: translateY(-1px);
}

.app-list__row--interactive:focus-visible {
    outline: 2px solid var(--ds-focus-color);
    outline-offset: 2px;
}

.app-list__row:is(.is-selected, [aria-current="true"], [aria-selected="true"]) {
    border-color: var(--ds-brand);
    background: var(--ds-tint-2);
}

.app-list__row--late {
    border-color: var(--ds-danger-line);
    background: var(--ds-danger-tint);
}

.app-list__row--late.app-list__row--interactive:hover {
    border-color: var(--ds-danger-line);
    background: var(--ds-danger-bg);
}

.app-list__cell {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-list__cell--strong {
    font-weight: var(--ds-weight-semibold);
}

.app-list__cell--muted {
    color: var(--ds-ink-muted);
}

.app-list__cell--end {
    text-align: right;
}

@media (prefers-reduced-motion: reduce) {
    .app-list__row {
        transition: none;
    }

    .app-list__row--interactive:hover {
        transform: none;
    }
}
