/* iManage — tile-view
 * Styles spécifiques aux tuiles.
 * Réutilise .lv-root, .lv-header, .lv-footer, .lv-btn-*, .lv-filters de list-view.css.
 */

/* ── Grille de tuiles ─────────────────────────────────────── */
.tv-root {
    /* Identique à .lv-root — hérite de la définition dans list-view.css */
}

.tv-grid {
    display: grid;
    padding: 16px;
    gap: 14px;
    align-items: start;
}

.tv-cols-2 { grid-template-columns: repeat(2, 1fr); }
.tv-cols-3 { grid-template-columns: repeat(3, 1fr); }
.tv-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 575px) {
    .tv-cols-2,
    .tv-cols-3,
    .tv-cols-4 { grid-template-columns: 1fr; }
}
@media (min-width: 576px) and (max-width: 899px) {
    .tv-cols-3,
    .tv-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tuile générique ──────────────────────────────────────── */
.tv-tile-wrap { display: contents; }

.tv-card {
    background: var(--lv-surf, #fff);
    border: 1px solid var(--lv-line, #e2e8f0);
    border-radius: 12px;
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow .15s ease-out, border-color .15s ease-out, transform .15s ease-out;
    position: relative;
    overflow: hidden;
}
.tv-card:hover {
    box-shadow: 0 4px 20px rgba(15, 23, 42, .08);
    border-color: var(--accent, #1fb4c5);
    transform: translateY(-1px);
}
.tv-card--archived {
    opacity: .55;
    background: var(--lv-soft, #f8fafc);
    pointer-events: none;
}

/* ── En-tête : avatar + nom (+ sous-titre âge/sexe) ─────── */
.tv-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tv-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent, #1fb4c5) 12%, transparent);
    color: var(--accent, #1fb4c5);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .02em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    user-select: none;
}
/* Teintes par sexe (subtiles, n'écrasent pas l'identité visuelle) */
.tv-card-avatar--m { background: rgba(59, 130, 246, .12); color: #2563eb; }
.tv-card-avatar--f { background: rgba(236, 72, 153, .12); color: #db2777; }

.tv-card-name-wrap { flex: 1; min-width: 0; }
.tv-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--lv-ink, #0f172a);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tv-card-sub {
    font-size: 11.5px;
    color: var(--lv-mute, #64748b);
    margin-top: 2px;
    letter-spacing: .02em;
}

/* ── Corps : lignes d'info ──────────────────────────────── */
.tv-card-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.tv-card-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    color: var(--lv-ink, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.4;
    min-width: 0;
}
.tv-card-row > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}
.tv-card-row .fa-solid,
.tv-card-row .fa-regular {
    font-size: 11px;
    color: var(--lv-mute, #94a3b8);
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}
.tv-card-row a {
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.tv-card-row a:hover {
    color: var(--accent, #1fb4c5);
    text-decoration: underline;
}
.tv-archive {
    font-size: 11px;
    color: var(--lv-mute, #64748b);
}

/* ── Footer : référence + actions ───────────────────────── */
.tv-card-ref {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--lv-mute, #64748b);
    font-variant-numeric: tabular-nums;
    letter-spacing: .03em;
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px solid var(--lv-line, #f1f5f9);
}
.tv-card-ref-label {
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .05em;
}
.tv-card-ref-value {
    font-weight: 600;
    color: var(--lv-ink, #0f172a);
}

.tv-card-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;        /* poussées à droite du footer */
}
.tv-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--lv-mute, #94a3b8);
    cursor: pointer;
    font-size: 13px;
    transition: color .12s ease, background-color .12s ease;
}
.tv-icon-btn:hover {
    color: var(--accent, #1fb4c5);
    background: color-mix(in srgb, var(--accent, #1fb4c5) 10%, transparent);
}
.tv-icon-btn.cancel_data:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, .08);
}

/* ── Bouton toggle liste / tuiles ─────────────────────────── */
.tv-mode-group {
    display: inline-flex;
    border: 1px solid var(--lv-line, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.tv-mode-group .lv-btn-ghost {
    border: none;
    border-radius: 0;
    padding: 6px 12px;
    font-size: 13px;
}
.tv-mode-group .lv-btn-ghost + .lv-btn-ghost {
    border-left: 1px solid var(--lv-line, #e2e8f0);
}
.tv-mode-group .tv-mode-btn.active {
    background: var(--lv-softer, #f1f5f9);
    color: var(--lv-ink, #0f172a);
}

/* ── Champs cachés (pour iManage.row_editor.show()) ─────────
   Le row_editor lit les data-field_* / data-dropdown_* sur les éléments
   .field / .dropdown / .textarea — ces métadonnées doivent rester dans
   le DOM mais ne pas s'afficher visuellement. */
.lv-hidden-fields {
    display: none !important;
}
