/*
 * TRIVIUM : design system (référence : fichier Figma « Trivium », page 00 Composants).
 * Coquille blanche sur fond pierre, panneau teinté, cartes blanches sans ombre.
 * Typographie : Plus Jakarta Sans, servie en local. Aucun letter-spacing, aucune capitale espacée.
 * Espacements : uniquement 4, 8, 12, 16, 24, 32 px (échelle --sp-*).
 */

@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../vendor/fonts/plus-jakarta-sans-latin-wght.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../vendor/fonts/plus-jakarta-sans-latin-ext-wght.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ==========================================================================
   1. Jetons (variables Figma, collection « TRIVIUM »)
   ========================================================================== */
:root {
    --tv-outer: #ECEAE5; --tv-shell: #FFFFFF; --tv-panel: #F6F5F2; --tv-card: #FFFFFF;
    --tv-line: #EEEDE9; --tv-line-2: #E4E2DD; --tv-gray-50: #F3F2EF;
    --tv-ink: #1F1A17; --tv-body: #45403B; --tv-muted: #78726C; --tv-faint: #A3A09A; --tv-ink-soft: #BDB8B2;
    --tv-accent: #E63E20; --tv-accent-600: #C9341A; --tv-accent-50: #FDEEEA; --tv-accent-100: #FAD9D1; --tv-accent-300: #F4A899;
    --tv-green: #1E8E5A; --tv-green-50: #E7F5EE;
    --tv-amber: #B7791F; --tv-amber-50: #FCF3E3;
    --tv-blue: #2F6FB3; --tv-blue-50: #E9F1FA;
    --tv-red: #C2362B; --tv-red-50: #FCEBEA;
    /* alias conservés pour les écrans existants */
    --tv-ink-900: var(--tv-ink); --tv-bg: var(--tv-panel); --tv-surface: var(--tv-card); --tv-subtle: var(--tv-panel);

    --sp-4: 4px; --sp-8: 8px; --sp-12: 12px; --sp-16: 16px; --sp-24: 24px; --sp-32: 32px;
    --r-4: 4px; --r-8: 8px; --r-12: 12px; --r-16: 16px; --r-20: 20px; --r-24: 24px; --r-full: 999px;

    --tv-sidebar-w: 208px;
    --tv-shadow-pop: 0 8px 24px rgba(31, 26, 23, .12), 0 1px 4px rgba(31, 26, 23, .06);
    --tv-shadow-seg: 0 1px 4px rgba(31, 26, 23, .1);

    /* Bootstrap */
    --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --bs-body-font-size: 13px;
    --bs-body-line-height: 1.5385; /* 20 px */
    --bs-body-color: var(--tv-body);
    --bs-body-bg: var(--tv-outer);
    --bs-emphasis-color: var(--tv-ink);
    --bs-heading-color: var(--tv-ink);
    --bs-secondary-color: var(--tv-muted);
    --bs-tertiary-color: var(--tv-faint);
    --bs-border-color: var(--tv-line);
    --bs-border-radius: 8px;
    --bs-border-radius-sm: 8px;
    --bs-border-radius-lg: 12px;
    --bs-primary: #1F1A17;
    --bs-primary-rgb: 31, 26, 23;
    --bs-link-color: var(--tv-accent-600);
    --bs-link-color-rgb: 201, 52, 26;
    --bs-link-hover-color: var(--tv-ink);
    --bs-link-hover-color-rgb: 31, 26, 23;
    --bs-focus-ring-color: rgba(230, 62, 32, .25);
}

/* ==========================================================================
   2. Base et typographie
   ========================================================================== */
* { letter-spacing: 0; }
body { background: var(--tv-outer); color: var(--tv-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 600; color: var(--tv-ink); }
h1, .h1 { font-size: 20px; line-height: 28px; }
h2, .h2 { font-size: 16px; line-height: 24px; }
h3, .h3, h4, .h4 { font-size: 14px; line-height: 20px; }
h5, .h5, h6, .h6 { font-size: 13px; line-height: 20px; }
strong, b, .fw-bold, .fw-semibold { font-weight: 600 !important; }
.fw-bolder { font-weight: 700 !important; }
small, .small { font-size: 12px; line-height: 16px; }
.lead { font-size: 14px; }
.fs-4, .fs-5 { font-size: 16px !important; }
.fs-3, .display-6 { font-size: 20px !important; font-weight: 600; }
.text-uppercase { text-transform: none !important; }
.text-secondary, .text-muted, .text-body-secondary { color: var(--tv-muted) !important; }
.text-body-tertiary { color: var(--tv-faint) !important; }
.text-accent { color: var(--tv-accent-600) !important; }
.text-danger { color: var(--tv-red) !important; }
.text-success { color: var(--tv-green) !important; }
.text-warning { color: var(--tv-amber) !important; }
.text-dark, .text-body-emphasis { color: var(--tv-ink) !important; }
a { color: var(--tv-accent-600); text-decoration: none; }
a:hover { color: var(--tv-ink); text-decoration: none; }
hr { border-color: var(--tv-line); opacity: 1; }
:focus-visible { outline: 2px solid var(--tv-accent); outline-offset: 2px; }

/* Nombres : jamais coupés, chiffres tabulaires */
.num, .table td.num, .table th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.num, .table th.num { text-align: right; }
.text-nowrap, .tv-nowrap { white-space: nowrap; }

/* Débordement du texte (audit 4.8) */
.tv-truncate { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.min-w-0 { min-width: 0; }

/* ==========================================================================
   3. Coquille : fond pierre, coquille blanche, sidebar, barre du haut, panneau
   ========================================================================== */
.tv-shell { display: flex; gap: 16px; min-height: 100vh; background: var(--tv-shell); padding: 12px; }
@media (min-width: 992px) {
    body { padding: 16px; }
    .tv-shell { min-height: calc(100vh - 32px); border-radius: 24px; }
}
.tv-zone { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.tv-panel { flex: 1; background: var(--tv-panel); border-radius: 20px; padding: 16px; min-width: 0; }
@media (min-width: 768px) { .tv-panel { padding: 24px; } }

/* Sidebar */
.tv-sidebar { width: var(--tv-sidebar-w); background: var(--tv-shell) !important; color: var(--tv-ink); border-right: 0 !important; }
@media (min-width: 992px) {
    .tv-sidebar.offcanvas-lg {
        flex: 0 0 var(--tv-sidebar-w); position: sticky; top: 28px; align-self: flex-start;
        height: calc(100vh - 56px); overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 8px 0;
        scrollbar-width: none;
    }
}
@media (max-width: 991.98px) {
    .tv-sidebar.offcanvas-lg { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
}
.tv-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px 16px; }
.tv-logo { display: inline-flex; align-items: center; gap: 8px; color: var(--tv-ink); }
.tv-logo:hover { color: var(--tv-ink); }
.tv-logo-mark { display: inline-flex; align-items: flex-end; gap: 4px; width: 20px; height: 20px; }
.tv-logo-mark i { display: block; width: 4px; border-radius: 1px; background: var(--tv-ink); }
.tv-logo-mark i:nth-child(1) { height: 8px; }
.tv-logo-mark i:nth-child(2) { height: 12px; }
.tv-logo-mark i:nth-child(3) { height: 20px; background: var(--tv-accent); }
.tv-logo-word { font-size: 18px; line-height: 24px; font-weight: 800; color: var(--tv-ink); }
.tv-logo-word b { color: var(--tv-accent); font-weight: 800 !important; }

.tv-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tv-nav .nav-section { display: flex; align-items: center; gap: 8px; padding: 16px 8px 4px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-faint); }
.tv-nav .nav-link, .tv-side-foot .nav-link {
    display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px; border-radius: 8px;
    font-size: 13px; line-height: 20px; font-weight: 500; color: var(--tv-muted);
}
.tv-nav .nav-link .bi, .tv-side-foot .nav-link .bi { flex: 0 0 20px; width: 20px; font-size: 17px; line-height: 20px; text-align: center; color: var(--tv-muted); }
.tv-nav .nav-link > span, .tv-side-foot .nav-link > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-nav .nav-link:hover, .tv-side-foot .nav-link:hover { color: var(--tv-ink); background: var(--tv-panel); }
.tv-nav .nav-link.active, .tv-side-foot .nav-link.active { color: var(--tv-ink); font-weight: 600; background: var(--tv-panel); }
.tv-nav .nav-link.active .bi, .tv-side-foot .nav-link.active .bi { color: var(--tv-accent); }
.tv-nav .nav-link .tv-nav-count { flex: none; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-faint); }
.tv-side-foot { display: flex; flex-direction: column; gap: 4px; margin-top: auto; padding-top: 16px; }
.tv-activity-switch { display: flex; align-items: center; gap: 8px; height: 32px; padding: 8px; border-radius: 8px; background: var(--tv-accent-50); color: var(--tv-accent-600); font-size: 12px; line-height: 16px; font-weight: 600; border: 0; width: 100%; text-align: left; }
.tv-activity-switch .bi { font-size: 14px; }
.tv-activity-switch span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Barre du haut */
.tv-topbar { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.tv-search-trigger {
    display: flex; align-items: center; gap: 8px; flex: 0 1 320px; min-width: 0; height: 32px; padding: 0 12px;
    background: var(--tv-panel); border: 0; border-radius: 8px; color: var(--tv-faint); font-size: 13px; line-height: 16px; text-align: left; cursor: pointer;
}
.tv-search-trigger .bi { font-size: 14px; color: var(--tv-muted); }
.tv-search-trigger > span:not(.tv-kbd) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-search-trigger:hover { background: var(--tv-gray-50); }
.tv-kbd { flex: none; padding: 0 8px; border: 1px solid var(--tv-line-2); border-radius: 4px; background: #fff; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-muted); }
.tv-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.tv-bell { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px; border-radius: 8px; background: var(--tv-panel); color: var(--tv-ink); font-size: 12px; font-weight: 600; border: 0; }
.tv-bell .tv-bell-count { color: var(--tv-accent-600); }
.tv-usermenu { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border: 0; border-radius: 12px; background: transparent; color: var(--tv-ink); text-align: left; }
.tv-usermenu:hover { background: var(--tv-panel); }
.tv-usermenu .tv-user-name { display: block; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--tv-ink); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-usermenu .tv-user-org { display: block; font-size: 12px; line-height: 16px; color: var(--tv-muted); }
.tv-usermenu .bi-chevron-down { font-size: 12px; color: var(--tv-muted); }
.tv-avatar {
    width: 32px; height: 32px; border-radius: 999px; background: var(--tv-ink); color: #fff; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; line-height: 16px;
}
.tv-avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.tv-avatar.sm { width: 32px; height: 32px; }
.tv-content { min-width: 0; }
.tv-footer { color: var(--tv-faint); font-size: 12px; }

/* ==========================================================================
   4. En-tête de page et onglets de module
   ========================================================================== */
.tv-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; margin-bottom: 24px; }
.tv-page-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.tv-page-title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; color: var(--tv-ink); overflow-wrap: anywhere; }
.tv-page-sub { margin-top: 4px; font-size: 13px; line-height: 20px; color: var(--tv-muted); }
.tv-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-muted); }
.tv-back:hover { color: var(--tv-ink); }
.tv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }

/* Onglets de module : barre blanche, onglet actif en encre */
.tv-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--tv-card); border-radius: 12px; max-width: 100%; overflow-x: auto; scrollbar-width: none; margin-bottom: 24px; }
.tv-tabs::-webkit-scrollbar { display: none; }
.tv-tab { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 12px; border-radius: 8px; white-space: nowrap; font-size: 13px; line-height: 16px; font-weight: 500; color: var(--tv-muted); }
.tv-tab:hover { color: var(--tv-ink); background: var(--tv-panel); }
.tv-tab .tv-tab-count { font-size: 12px; font-weight: 600; color: var(--tv-faint); }
.tv-tab.active, .tv-tab[aria-current] { background: var(--tv-ink); color: #fff; }
.tv-tab.active .tv-tab-count, .tv-tab[aria-current] .tv-tab-count { color: var(--tv-ink-soft); }

/* Filtres de statut (puces) : remplacent les nav-pills */
.nav-pills, .tv-status-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.nav-pills .nav-link, .tv-chip {
    display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border-radius: 8px;
    border: 1px solid var(--tv-line-2); background: var(--tv-card); color: var(--tv-ink); white-space: nowrap;
    font-size: 12px; line-height: 16px; font-weight: 600;
}
.nav-pills .nav-link:hover, .tv-chip:hover { background: var(--tv-panel); color: var(--tv-ink); }
.nav-pills .nav-link.active, .tv-chip.active { background: var(--tv-accent-50); border-color: var(--tv-accent-50); color: var(--tv-accent-600); }
.nav-pills .nav-link .tv-count, .tv-chip .tv-count { color: var(--tv-faint); font-weight: 600; }
.nav-pills .nav-link.active .tv-count, .tv-chip.active .tv-count { color: var(--tv-accent-600); }

/* Segment (choix exclusifs) */
.tv-segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--tv-gray-50); border-radius: 8px; }
.tv-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.tv-segmented label, .tv-segmented a, .tv-segmented button { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 0; border-radius: 8px; background: transparent; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--tv-muted); cursor: pointer; }
.tv-segmented input:checked + label, .tv-segmented .active { background: var(--tv-card); color: var(--tv-ink); font-weight: 600; box-shadow: var(--tv-shadow-seg); }
.tv-segmented input:focus-visible + label { outline: 2px solid var(--tv-accent); }

/* ==========================================================================
   5. Boutons : Principal, Doux, Clair, Sombre, Discret ; tailles M (32) et S (24)
   ========================================================================== */
.btn {
    --bs-btn-padding-y: 0; --bs-btn-padding-x: 12px; --bs-btn-font-size: 13px; --bs-btn-font-weight: 500; --bs-btn-line-height: 16px;
    --bs-btn-border-radius: 8px; --bs-btn-border-width: 1px; --bs-btn-box-shadow: none; --bs-btn-focus-box-shadow: 0 0 0 3px rgba(230, 62, 32, .25);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 32px; white-space: nowrap;
}
.btn .bi { font-size: 14px; line-height: 1; }
.btn-sm, .btn-group-sm > .btn { --bs-btn-padding-x: 8px; --bs-btn-font-size: 12px; --bs-btn-font-weight: 600; min-height: 24px; gap: 4px; }
.btn-sm .bi { font-size: 12px; }
.btn-lg, .btn-group-lg > .btn { --bs-btn-padding-x: 12px; --bs-btn-font-size: 13px; --bs-btn-border-radius: 8px; min-height: 32px; }
/* Principal */
.btn-accent {
    --bs-btn-color: #fff; --bs-btn-bg: var(--tv-accent); --bs-btn-border-color: var(--tv-accent);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--tv-accent-600); --bs-btn-hover-border-color: var(--tv-accent-600);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--tv-accent-600); --bs-btn-active-border-color: var(--tv-accent-600);
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--tv-accent); --bs-btn-disabled-border-color: var(--tv-accent);
}
/* Sombre */
.btn-primary, .btn-dark {
    --bs-btn-color: #fff; --bs-btn-bg: var(--tv-ink); --bs-btn-border-color: var(--tv-ink);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #000; --bs-btn-hover-border-color: #000;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #000; --bs-btn-active-border-color: #000;
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--tv-ink); --bs-btn-disabled-border-color: var(--tv-ink);
}
/* Doux */
.btn-soft {
    --bs-btn-color: var(--tv-accent-600); --bs-btn-bg: var(--tv-accent-50); --bs-btn-border-color: var(--tv-accent-50);
    --bs-btn-hover-color: var(--tv-accent-600); --bs-btn-hover-bg: var(--tv-accent-100); --bs-btn-hover-border-color: var(--tv-accent-100);
    --bs-btn-active-color: var(--tv-accent-600); --bs-btn-active-bg: var(--tv-accent-100); --bs-btn-active-border-color: var(--tv-accent-100);
}
/* Clair */
.btn-light, .btn-outline-secondary, .btn-outline-dark, .btn-outline-primary, .btn-secondary {
    --bs-btn-color: var(--tv-ink); --bs-btn-bg: #fff; --bs-btn-border-color: var(--tv-line-2);
    --bs-btn-hover-color: var(--tv-ink); --bs-btn-hover-bg: var(--tv-panel); --bs-btn-hover-border-color: var(--tv-line-2);
    --bs-btn-active-color: var(--tv-ink); --bs-btn-active-bg: var(--tv-gray-50); --bs-btn-active-border-color: var(--tv-line-2);
    --bs-btn-disabled-color: var(--tv-faint); --bs-btn-disabled-bg: #fff; --bs-btn-disabled-border-color: var(--tv-line-2);
}
/* Danger (confirmation destructive) */
.btn-danger, .btn-outline-danger {
    --bs-btn-color: #fff; --bs-btn-bg: var(--tv-red); --bs-btn-border-color: var(--tv-red);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #A52C23; --bs-btn-hover-border-color: #A52C23;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #A52C23; --bs-btn-active-border-color: #A52C23;
}
.btn-outline-danger { --bs-btn-color: var(--tv-red); --bs-btn-bg: #fff; --bs-btn-border-color: var(--tv-line-2); }
.btn-success { --bs-btn-bg: var(--tv-green); --bs-btn-border-color: var(--tv-green); --bs-btn-hover-bg: #187349; --bs-btn-hover-border-color: #187349; }
/* Discret */
.btn-link, .btn-ghost {
    --bs-btn-color: var(--tv-ink); --bs-btn-bg: transparent; --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--tv-ink); --bs-btn-hover-bg: var(--tv-panel); --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: var(--tv-ink); --bs-btn-active-bg: var(--tv-gray-50);
    text-decoration: none;
}
.btn-icon { width: 32px; height: 32px; min-height: 32px; padding: 0; }
.btn-icon.btn-sm { width: 24px; height: 24px; min-height: 24px; }
.btn-group > .btn { border-radius: 8px; }
.btn-group > .btn:not(:last-child):not(.dropdown-toggle) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-group > .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.btn-accent + .dropdown-toggle-split { border-left-color: rgba(255, 255, 255, .35); }
.dropdown-toggle::after { border: 0; width: 12px; height: 12px; margin-left: 0; vertical-align: 0; content: "\F282"; font-family: "bootstrap-icons"; font-size: 10px; line-height: 12px; }

/* Lien d'action (« Ouvrir », « Tout voir ») */
.tv-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-accent-600); }
.tv-link .bi { font-size: 12px; }

/* ==========================================================================
   6. Champs : une seule taille (32 px), libellé 12 px au-dessus
   ========================================================================== */
.form-label { display: block; margin-bottom: 4px; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--tv-body); }
.required > .form-label::after, .form-label.required::after { content: " *"; color: var(--tv-red); }
.form-control, .form-select {
    height: 32px; padding: 0 12px; border: 1px solid var(--tv-line-2); border-radius: 8px; background-color: #fff;
    font-size: 13px; line-height: 16px; color: var(--tv-body); box-shadow: none;
}
.form-select { padding-right: 32px; background-position: right 12px center; background-size: 12px 12px; }
textarea.form-control { height: auto; min-height: 64px; padding: 8px 12px; line-height: 20px; }
select[multiple].form-select, .form-select[size]:not([size="1"]) { height: auto; padding: 8px 12px; }
input[type="file"].form-control { padding: 0; line-height: 30px; }
input[type="file"].form-control::file-selector-button { height: 30px; padding: 0 12px; margin: 0 12px 0 0; border: 0; border-right: 1px solid var(--tv-line-2); background: var(--tv-panel); color: var(--tv-ink); }
.form-control-sm, .form-select-sm, .form-control-lg, .form-select-lg { height: 32px; padding-top: 0; padding-bottom: 0; font-size: 13px; border-radius: 8px; }
.form-control-sm, .form-control-lg { padding-left: 12px; padding-right: 12px; }
.form-select-sm, .form-select-lg { padding-left: 12px; padding-right: 32px; }
.form-control::placeholder { color: var(--tv-faint); opacity: 1; }
.form-control:focus, .form-select:focus { border-color: var(--tv-accent); box-shadow: 0 0 0 1px var(--tv-accent); outline: 0; }
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background-color: var(--tv-panel); color: var(--tv-muted); opacity: 1; }
.form-control.is-invalid, .form-select.is-invalid, .was-validated .form-control:invalid { border-color: var(--tv-red); background-image: none; padding-right: 12px; }
.form-select.is-invalid { padding-right: 32px; background-image: var(--bs-form-select-bg-img); }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { border-color: var(--tv-red); box-shadow: 0 0 0 1px var(--tv-red); }
.invalid-feedback { margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--tv-red); }
.form-text { margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--tv-muted); }
.input-group > .form-control, .input-group > .form-select { height: 32px; }
.input-group-text { height: 32px; padding: 0 12px; border: 1px solid var(--tv-line-2); border-radius: 8px; background: #fff; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-muted); }
.input-group > .form-control:not(:last-child) { border-right: 0; }
.input-group > .form-control:not(:first-child) { border-left: 0; }
.input-group > .input-group-text:last-child { border-left: 0; padding-left: 0; }
.input-group > .input-group-text:first-child { border-right: 0; padding-right: 0; }
.input-group:focus-within > .input-group-text { border-color: var(--tv-accent); }
.input-group > .form-control:focus { box-shadow: none; }
.input-group:focus-within { border-radius: 8px; box-shadow: 0 0 0 1px var(--tv-accent); }
.form-check { display: flex; align-items: center; gap: 8px; min-height: 20px; padding-left: 0; }
.form-check .form-check-input { float: none; flex: none; margin: 0; }
.form-check-inline { display: inline-flex; margin-right: 16px; }
.form-check-input { width: 16px; height: 16px; border: 1px solid var(--tv-line-2); border-radius: 4px; }
.form-check-input[type="radio"] { border-radius: 999px; }
.form-check-input:checked { background-color: var(--tv-accent); border-color: var(--tv-accent); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(230, 62, 32, .2); border-color: var(--tv-accent); }
.form-check-label { font-size: 13px; line-height: 20px; color: var(--tv-body); }
.form-switch .form-check-input { width: 28px; border-radius: 999px; }
/* Recherche avec loupe dans le champ */
.tv-search { position: relative; }
.tv-search > .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--tv-muted); pointer-events: none; }
.tv-search > .form-control { padding-left: 32px; }
/* Filtre (liste ou période) compact */
.tv-filter { width: auto; min-width: 120px; font-weight: 500; }
.mb-3 { margin-bottom: 16px !important; }

/* ==========================================================================
   7. Cartes, KPI, listes
   ========================================================================== */
.card {
    --bs-card-border-width: 0; --bs-card-border-radius: 16px; --bs-card-inner-border-radius: 16px; --bs-card-bg: var(--tv-card);
    --bs-card-cap-bg: transparent; --bs-card-spacer-x: 16px; --bs-card-spacer-y: 16px; --bs-card-cap-padding-x: 16px; --bs-card-cap-padding-y: 16px;
    box-shadow: none; color: var(--tv-body);
}
.card-header {
    display: flex; align-items: center; gap: 8px; min-height: 24px; padding: 16px 16px 0; border-bottom: 0;
    font-size: 14px; line-height: 20px; font-weight: 600; color: var(--tv-ink);
}
.card-header > .bi:first-child { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 8px; background: var(--tv-gray-50); color: var(--tv-ink); font-size: 12px; }
.card-header .tv-link, .card-header .ms-auto { margin-left: auto; }
.card-header-plain { padding-bottom: 0; }
.card-header + .card-body, .card-header + .list-group, .card-header + .card-filters { padding-top: 12px; }
.card-title { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--tv-ink); }
.card-footer { padding: 12px 16px 16px; border-top: 0; background: transparent; font-size: 12px; line-height: 16px; color: var(--tv-muted); }
.card-filters { padding: 16px 16px 0; border-bottom: 0; }
.card-filters .mb-3 { margin-bottom: 0 !important; }
.card-filters + .table-responsive, .card-filters + .table, .card-filters + .tv-empty, .card-header + .table-responsive, .card-header + .table { padding-top: 12px; }
.card.border, .card.border-0 { border: 0 !important; }
.card .card { background: var(--tv-panel); }
.bg-light, .bg-body-tertiary, .bg-body-secondary { background-color: var(--tv-panel) !important; }

/* KPI : libellé et pastille en haut, chiffre, ligne de détail réservée */
.tv-kpi { height: 100%; border-radius: 16px; }
.tv-kpi:hover { color: inherit; }
.tv-kpi .card-body {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label icon" "value value" "meta meta" "extra extra";
    align-content: start; column-gap: 8px; row-gap: 8px; padding: 16px;
}
.tv-kpi-label { grid-area: label; align-self: center; min-width: 0; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--tv-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-kpi-icon { grid-area: icon; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: 0; border-radius: 8px; font-size: 12px; background: var(--tv-gray-50) !important; color: var(--tv-ink) !important; }
.tv-kpi-value { grid-area: value; font-size: 20px; line-height: 28px; font-weight: 600; color: var(--tv-ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-kpi-meta { grid-area: meta; display: flex; align-items: center; gap: 8px; min-height: 20px; font-size: 12px; line-height: 16px; color: var(--tv-muted); }
.tv-kpi .card-body > :not(.tv-kpi-label):not(.tv-kpi-icon):not(.tv-kpi-value):not(.tv-kpi-meta) { grid-column: 1 / -1; }
.tv-kpi.dark { background: var(--tv-ink); color: #fff; }
.tv-kpi.dark .tv-kpi-value, .tv-kpi.dark a { color: #fff; }
.tv-kpi.dark .tv-kpi-label, .tv-kpi.dark .tv-kpi-meta { color: var(--tv-ink-soft); }
.tv-kpi.dark .tv-kpi-icon { background: rgba(255, 255, 255, .14) !important; color: #fff !important; }
a.tv-kpi:hover { color: inherit; }
a.tv-kpi:not(.dark):hover { box-shadow: inset 0 0 0 1px var(--tv-line-2); }

/* Pastilles d'icône (neutres par défaut, couleur réservée aux états) */
.tv-chip-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--tv-gray-50); color: var(--tv-ink); font-size: 14px; }
.tv-chip-icon.sm { width: 24px; height: 24px; font-size: 12px; }
.tint-ink, .tint-neutral { background: var(--tv-gray-50); color: var(--tv-ink); }
.tint-accent { background: var(--tv-accent-50); color: var(--tv-accent); }
.tint-green { background: var(--tv-green-50); color: var(--tv-green); }
.tint-amber { background: var(--tv-amber-50); color: var(--tv-amber); }
.tint-blue { background: var(--tv-blue-50); color: var(--tv-blue); }
.tint-red { background: var(--tv-red-50); color: var(--tv-red); }

/* Tendance */
.tv-trend { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 8px; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; background: var(--tv-gray-50); color: var(--tv-muted); }
.tv-trend.up { background: var(--tv-green-50); color: var(--tv-green); }
.tv-trend.down { background: var(--tv-red-50); color: var(--tv-red); }
.tv-trend .bi { font-size: 12px; }

/* Statistique (libellé, chiffre, détail) */
.tv-stat-label { display: block; font-size: 12px; line-height: 16px; color: var(--tv-muted); }
.tv-stat-value { display: block; margin-top: 4px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--tv-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tv-stat-detail { display: block; margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--tv-faint); }

/* Listes */
.list-group { --bs-list-group-border-color: var(--tv-line); --bs-list-group-bg: transparent; --bs-list-group-color: var(--tv-body); --bs-list-group-action-hover-bg: var(--tv-panel); --bs-list-group-action-hover-color: var(--tv-ink); }
.list-group-flush > .list-group-item { padding: 8px 16px; }
.card > .list-group-flush:last-child { padding-bottom: 8px; }
.tv-todo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tv-todo .tv-todo-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }
.tv-todo > span:not(.tv-todo-icon):not(.tv-todo-count), .tv-todo > div { flex: 1; min-width: 0; }
.tv-todo .tv-todo-count { margin-left: auto; flex: none; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--tv-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tv-list-item { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 8px 0; color: inherit; }
.tv-list-item + .tv-list-item { border-top: 1px solid var(--tv-line); }
.tv-list-title { display: block; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--tv-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-list-detail { display: block; font-size: 12px; line-height: 16px; color: var(--tv-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-list-value { margin-left: auto; flex: none; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--tv-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tv-chevron { flex: none; font-size: 14px; color: var(--tv-faint); }

/* Raccourcis */
.tv-shortcut { display: flex; align-items: center; gap: 12px; height: 100%; padding: 16px; border-radius: 16px; background: var(--tv-card); color: var(--tv-ink); font-weight: 600; }
.tv-shortcut:hover { color: var(--tv-ink); box-shadow: inset 0 0 0 1px var(--tv-line-2); }
.tv-shortcut .tv-kpi-icon { flex: none; }
.tv-shortcut small { display: block; font-weight: 400; color: var(--tv-muted); }

/* ==========================================================================
   8. Tableaux
   ========================================================================== */
.table { --bs-table-bg: transparent; --bs-table-color: var(--tv-body); --bs-table-hover-bg: var(--tv-panel); --bs-table-hover-color: var(--tv-body); --bs-table-striped-bg: var(--tv-panel); margin-bottom: 0; font-size: 13px; line-height: 20px; }
.card > .table-responsive, .card > .table, .card > .card-body > .table-responsive.tv-flush { padding-left: 16px; padding-right: 16px; }
.card > .table-responsive:first-child, .card > .table:first-child { padding-top: 16px; }
.card > .table-responsive:last-child, .card > .table:last-child { padding-bottom: 8px; }
.table > :not(caption) > * > * { padding: 12px; border-bottom: 1px solid var(--tv-line); vertical-align: middle; box-shadow: none; }
.table > thead > tr > * {
    padding: 8px 12px; border-bottom: 0; background: var(--tv-panel); white-space: nowrap;
    font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-muted); text-transform: none;
}
.table > thead > tr > *:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.table > thead > tr > *:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.table > tbody > tr:last-child > * { border-bottom: 0; }
.table td.num { font-weight: 600; color: var(--tv-ink); }
.table tfoot > tr > * { background: transparent; border-top: 1px solid var(--tv-line-2); border-bottom: 0; font-weight: 600; color: var(--tv-ink); }
.table-sm > :not(caption) > * > * { padding: 8px 12px; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--tv-panel); }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover > * { background: var(--tv-panel); }
tr[data-href]:focus-within > * { background: var(--tv-panel); }
.tv-cell-title { font-weight: 600; color: var(--tv-ink); white-space: nowrap; }
.tv-cell-sub { display: block; font-size: 12px; line-height: 16px; color: var(--tv-muted); }
.tv-cell-name { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1199.98px) { .tv-col-secondary { display: none; } }

/* Pagination et pied de liste */
.tv-list-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px 16px; font-size: 12px; line-height: 16px; color: var(--tv-muted); }
.pagination { --bs-pagination-padding-x: 8px; --bs-pagination-padding-y: 4px; --bs-pagination-font-size: 12px; --bs-pagination-color: var(--tv-ink); --bs-pagination-bg: #fff; --bs-pagination-border-color: var(--tv-line-2); --bs-pagination-hover-bg: var(--tv-panel); --bs-pagination-hover-color: var(--tv-ink); --bs-pagination-active-bg: var(--tv-ink); --bs-pagination-active-border-color: var(--tv-ink); --bs-pagination-disabled-color: var(--tv-faint); gap: 4px; margin: 0; }
.pagination .page-link { min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px !important; font-weight: 600; line-height: 16px; }

/* ==========================================================================
   9. Badges (sans pastille ronde)
   ========================================================================== */
.badge {
    display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 8px;
    font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; vertical-align: middle;
    background: var(--tv-gray-50); color: var(--tv-muted);
}
.badge .bi { font-size: 12px; }
.badge-soft-secondary, .badge-soft-light, .text-bg-light, .text-bg-secondary, .bg-secondary { background: var(--tv-gray-50) !important; color: var(--tv-muted) !important; }
.badge-soft-info, .badge-soft-primary, .text-bg-info, .text-bg-primary, .bg-info, .bg-primary.badge { background: var(--tv-blue-50) !important; color: var(--tv-blue) !important; }
.badge-soft-warning, .text-bg-warning, .bg-warning { background: var(--tv-amber-50) !important; color: var(--tv-amber) !important; }
.badge-soft-danger, .text-bg-danger, .bg-danger.badge { background: var(--tv-red-50) !important; color: var(--tv-red) !important; }
.badge-soft-success, .text-bg-success, .bg-success.badge { background: var(--tv-green-50) !important; color: var(--tv-green) !important; }
.badge-soft-accent { background: var(--tv-accent-50) !important; color: var(--tv-accent-600) !important; }
.badge-soft-dark, .text-bg-dark { background: var(--tv-ink) !important; color: #fff !important; }
.rounded-pill.badge { border-radius: 8px !important; }

/* ==========================================================================
   10. Bannières (alertes), toasts, états vides, chargement
   ========================================================================== */
.alert {
    display: flex; align-items: flex-start; gap: 12px; padding: 12px; margin-bottom: 16px; border: 0; border-radius: 12px; box-shadow: none;
    font-size: 13px; line-height: 20px; font-weight: 400; color: var(--tv-muted); background: var(--tv-blue-50);
}
.alert > .bi:first-child { flex: none; font-size: 16px; line-height: 20px; }
.alert strong, .alert .alert-heading, .alert-title { color: var(--tv-ink); font-weight: 600; }
.alert-heading { font-size: 13px; line-height: 20px; margin-bottom: 4px; }
.alert .alert-link { font-size: 12px; font-weight: 600; }
.alert-dismissible { padding-right: 32px; }
.alert-dismissible .btn-close { padding: 12px; background-size: 10px; }
.alert-info { background: var(--tv-blue-50); color: var(--tv-muted); }
.alert-info > .bi:first-child, .alert-info .alert-link { color: var(--tv-blue); }
.alert-success { background: var(--tv-green-50); color: var(--tv-muted); }
.alert-success > .bi:first-child, .alert-success .alert-link { color: var(--tv-green); }
.alert-warning { background: var(--tv-amber-50); color: var(--tv-muted); }
.alert-warning > .bi:first-child, .alert-warning .alert-link { color: var(--tv-amber); }
.alert-danger { background: var(--tv-red-50); color: var(--tv-muted); }
.alert-danger > .bi:first-child, .alert-danger .alert-link { color: var(--tv-red); }
.alert-secondary, .alert-dark, .alert-light { background: var(--tv-gray-50); color: var(--tv-muted); }
.alert > div { min-width: 0; color: var(--tv-body); }
.tv-banner-title { display: block; font-weight: 600; color: var(--tv-ink); }
.tv-banner-action { margin-left: auto; flex: none; align-self: center; font-size: 12px; line-height: 16px; font-weight: 600; color: inherit; }

/* Toasts : bas à gauche, encre, 3 au maximum */
.tv-toasts { position: fixed; left: 16px; bottom: 16px; z-index: 1090; display: flex; flex-direction: column-reverse; gap: 8px; max-width: calc(100% - 32px); pointer-events: none; }
.tv-toast {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--tv-ink); color: #fff;
    box-shadow: 0 16px 48px rgba(31, 26, 23, .24); font-size: 13px; line-height: 20px; font-weight: 600; pointer-events: auto; max-width: 480px;
    animation: tv-toast-in .2s ease-out;
}
.tv-toast > .bi:first-child { flex: none; font-size: 16px; color: #fff; }
.tv-toast.is-error > .bi:first-child { color: var(--tv-accent-300); }
.tv-toast-msg { flex: 1; min-width: 0; }
.tv-toast-action { flex: none; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-accent-300); background: none; border: 0; padding: 0; }
.tv-toast-action:hover { color: #fff; }
.tv-toast-close { flex: none; padding: 0; border: 0; background: none; color: var(--tv-ink-soft); font-size: 12px; line-height: 1; }
.tv-toast-close:hover { color: #fff; }
@keyframes tv-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* État vide */
.tv-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 24px; text-align: center; color: var(--tv-muted); }
.tv-empty .tv-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin: 0; border-radius: 8px; font-size: 14px; background: var(--tv-gray-50) !important; color: var(--tv-ink) !important; }
.tv-empty h3 { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--tv-ink); }
.tv-empty p { max-width: 320px; margin: 0 !important; font-size: 13px; line-height: 20px; color: var(--tv-muted); }

/* Squelettes de chargement */
.tv-skeleton { display: block; height: 12px; border-radius: 4px; background: var(--tv-gray-50); animation: tv-pulse 1.2s ease-in-out infinite; }
.tv-skeleton.lg { height: 16px; }
@keyframes tv-pulse { 50% { opacity: .55; } }

/* Infobulle */
.tooltip { --bs-tooltip-bg: var(--tv-ink); --bs-tooltip-color: #fff; --bs-tooltip-padding-x: 8px; --bs-tooltip-padding-y: 4px; --bs-tooltip-font-size: 12px; --bs-tooltip-border-radius: 8px; --bs-tooltip-max-width: 320px; --bs-tooltip-opacity: 1; }

/* ==========================================================================
   11. Jauges, graphiques, étapes, récapitulatifs
   ========================================================================== */
.progress, .tv-gauge { --bs-progress-height: 6px; --bs-progress-border-radius: 4px; --bs-progress-bg: var(--tv-gray-50); --bs-progress-bar-bg: var(--tv-accent); }
.progress-bar { border-radius: 4px; }
.progress-bar.bg-danger, .tv-gauge.is-low .progress-bar { background-color: var(--tv-red) !important; }
.progress.is-low, .tv-gauge.is-low { --bs-progress-bg: var(--tv-red-50); }
.progress-bar.bg-success { background-color: var(--tv-green) !important; }
.progress-bar.bg-warning { background-color: var(--tv-amber) !important; }
.progress-bar.bg-dark, .progress-bar.bg-primary { background-color: var(--tv-accent) !important; }

.tv-bars-chart { display: flex; align-items: flex-end; gap: 16px; height: 180px; padding-top: 8px; }
.tv-bars-chart .tv-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.tv-bars-chart .tv-bar-pair { display: flex; align-items: flex-end; gap: 4px; height: 100%; width: 100%; justify-content: center; }
.tv-bars-chart .tv-bar { width: 38%; max-width: 24px; border-radius: 4px 4px 0 0; min-height: 4px; }
.tv-bars-chart .tv-bar.a { background: var(--tv-accent); }
.tv-bars-chart .tv-bar.b { background: var(--tv-ink-soft); }
.tv-bars-chart .tv-bar-label { font-size: 12px; color: var(--tv-faint); }
.tv-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; line-height: 16px; color: var(--tv-muted); }
.tv-legend i { display: inline-block; width: 12px; height: 4px; border-radius: 4px; margin-right: 4px; vertical-align: middle; }

/* Étapes : Fait, En cours, À venir */
.tv-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.tv-step { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--tv-muted); }
.tv-step .tv-step-dot { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 0; border-radius: 999px; background: var(--tv-gray-50); color: var(--tv-muted); font-size: 12px; line-height: 16px; font-weight: 600; }
.tv-step.done { color: var(--tv-body); }
.tv-step.done .tv-step-dot { background: var(--tv-ink); color: #fff; }
.tv-step.current { color: var(--tv-ink); font-weight: 600; }
.tv-step.current .tv-step-dot { background: var(--tv-accent); color: #fff; }
.tv-step + .tv-step::before { content: ""; width: 16px; height: 1px; background: var(--tv-line-2); margin-right: 4px; }

/* Récapitulatif chiffré */
.tv-summary { list-style: none; padding: 0; margin: 0; }
.tv-summary li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--tv-muted); }
.tv-summary li strong, .tv-summary li span:last-child { color: var(--tv-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tv-summary li.total { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--tv-line); font-size: 16px; line-height: 24px; font-weight: 600; color: var(--tv-ink); }
.tv-summary li.accent span:last-child { color: var(--tv-accent-600); font-weight: 600; }

/* Fiche (définitions) */
.tv-dl { display: grid; grid-template-columns: minmax(112px, 40%) 1fr; gap: 8px 16px; margin: 0; }
.tv-dl dt { font-weight: 400; color: var(--tv-muted); }
.tv-dl dd { margin: 0; font-weight: 500; color: var(--tv-ink); overflow-wrap: anywhere; }

/* Lignes de document dynamiques */
.tv-lines td { vertical-align: top; }
.tv-lines .form-control, .tv-lines .form-select { min-width: 64px; }

/* Formulaire + récapitulatif collant à droite (8/4) */
@media (min-width: 1200px) {
    .tv-split-main { flex: 0 0 auto; width: 66.6667%; }
    .tv-split-aside { flex: 0 0 auto; width: 33.3333%; }
    .tv-split-aside .position-sticky, .tv-sticky { position: sticky !important; top: 24px; }
}
@media (max-width: 1199.98px) { .tv-split-aside .position-sticky { position: static !important; } }

/* ==========================================================================
   12. Palette Ctrl K, menus, modales
   ========================================================================== */
.tv-palette .modal-dialog { max-width: 640px; }
.tv-palette .modal-content { border: 0; border-radius: 16px; box-shadow: var(--tv-shadow-pop); overflow: hidden; }
.tv-palette .tv-palette-input { height: 48px; padding: 0 16px 0 32px; border: 0; border-bottom: 1px solid var(--tv-line); border-radius: 0; font-size: 14px; }
.tv-palette .tv-palette-input:focus { box-shadow: none; border-color: var(--tv-line); }
.tv-palette .tv-palette-icon { position: absolute; left: 12px; top: 16px; font-size: 14px; color: var(--tv-muted); }
.tv-palette .tv-results { max-height: 60vh; overflow-y: auto; padding: 8px; }
.tv-palette .tv-result { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 8px; border-radius: 8px; color: var(--tv-body); }
.tv-palette .tv-result:hover, .tv-palette .tv-result.active { background: var(--tv-panel); color: var(--tv-ink); }
.tv-palette .tv-result-group { padding: 8px 8px 4px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-faint); text-transform: none; }

.dropdown-menu {
    --bs-dropdown-min-width: 240px; --bs-dropdown-padding-x: 8px; --bs-dropdown-padding-y: 8px; --bs-dropdown-font-size: 13px;
    --bs-dropdown-link-color: var(--tv-body); --bs-dropdown-link-hover-bg: var(--tv-panel); --bs-dropdown-link-hover-color: var(--tv-ink);
    --bs-dropdown-link-active-bg: var(--tv-panel); --bs-dropdown-link-active-color: var(--tv-ink); --bs-dropdown-divider-bg: var(--tv-line);
    --bs-dropdown-header-color: var(--tv-faint); --bs-dropdown-header-padding-x: 8px; --bs-dropdown-header-padding-y: 8px;
    --bs-dropdown-bg: #fff; background-color: #fff; border: 0; border-radius: 12px; box-shadow: var(--tv-shadow-pop);
}
.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; font-size: 13px; line-height: 20px; font-weight: 500; }
.dropdown-item .bi { flex: none; font-size: 14px; color: var(--tv-muted); }
.dropdown-item .tv-shortcut-key { margin-left: auto; font-size: 12px; color: var(--tv-faint); }
.dropdown-header { font-size: 12px; line-height: 16px; font-weight: 600; text-transform: none; }
.dropdown-divider { margin: 4px 0; }

.modal { --bs-modal-bg: #fff; --bs-modal-width: 480px; --bs-modal-border-radius: 16px; --bs-modal-border-width: 0; --bs-modal-padding: 24px; --bs-modal-header-padding: 24px 24px 16px; --bs-modal-footer-gap: 8px; --bs-backdrop-bg: #1F1A17; --bs-backdrop-opacity: .4; }
.modal-lg { --bs-modal-width: 640px; }
.modal-content { border: 0; border-radius: 16px; overflow: hidden; }
.modal-dialog-scrollable .modal-content { max-height: 80vh; }
.modal-header { align-items: flex-start; gap: 12px; border-bottom: 0; }
.modal-title { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--tv-ink); }
.modal-sub { margin-top: 4px; font-size: 13px; line-height: 20px; color: var(--tv-muted); }
.modal-header .btn-close { margin: 0 0 0 auto; padding: 4px; background-size: 12px; }
.modal-body { padding: 0 24px 24px; }
.modal-footer { padding: 16px 24px; border-top: 0; background: var(--tv-panel); }
.modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.modal-footer > * { margin: 0; }
@media (max-width: 575.98px) {
    .modal-dialog:not(.tv-palette .modal-dialog) { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; max-width: none; }
    .modal-dialog:not(.tv-palette .modal-dialog) .modal-content { border-radius: 20px 20px 0 0; }
}

/* ==========================================================================
   13. Connexion
   ========================================================================== */
.tv-login { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--tv-shell); }
@media (min-width: 992px) { .tv-login { grid-template-columns: 1.05fr 1fr; } }
.tv-login-aside { display: none; position: relative; overflow: hidden; padding: 32px; background: var(--tv-ink); color: #fff; }
@media (min-width: 992px) { .tv-login-aside { display: flex; flex-direction: column; justify-content: space-between; } }
.tv-login-aside h2 { max-width: 26ch; font-size: 20px; line-height: 28px; font-weight: 600; color: #fff; }
.tv-login-aside p { max-width: 44ch; color: var(--tv-ink-soft); }
.tv-login-main { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.tv-login-card { width: 100%; max-width: 400px; }

@media print {
    body { padding: 0; background: #fff; }
    .tv-shell { padding: 0; }
    .tv-sidebar, .tv-topbar, .btn, .no-print, .tv-footer, .tv-toasts { display: none !important; }
    .tv-panel { padding: 0; background: #fff; }
}

/* ==========================================================================
   14. Mobile
   ========================================================================== */
@media (max-width: 767.98px) {
    /* Mêmes tailles que sur ordinateur (retour terrain 23/11/2026) : pas d'agrandissement du texte ni des champs. */
    .tv-page-head { margin-bottom: 16px; }
    .tv-actions { margin-left: 0; }
    .tv-kpi .card-body { padding: 12px; }
    .tv-kpi-value { font-size: 16px; line-height: 24px; }
    .tv-shortcut { padding: 12px; gap: 8px; }
    .tv-shortcut small { display: none; }
    .tv-topbar { gap: 8px; }
    .tv-search-trigger { flex: 1 1 auto; }
}

/* ==========================================================================
   15. Écrans terrain (livreur, commercial, pompiste) : cibles au pouce
   ========================================================================== */
.tv-stepper { display: inline-flex; align-items: stretch; overflow: hidden; border: 1px solid var(--tv-line-2); border-radius: 12px; background: #fff; }
.tv-stepper button { width: 40px; min-height: 40px; border: 0; background: var(--tv-panel); font-size: 20px; font-weight: 600; color: var(--tv-ink); }
.tv-stepper button:active { background: var(--tv-gray-50); }
.tv-stepper input { width: 64px; border: 0; text-align: center; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; background: transparent; color: var(--tv-ink); }
.tv-stepper input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--tv-accent); }
.tv-stepper.is-diff { border-color: var(--tv-accent); }

.tv-count-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--tv-line); }
.tv-count-row:first-child { border-top: 0; }
.tv-count-row .tv-count-label { flex: 1; min-width: 0; }
.tv-count-row .tv-count-label strong { display: block; color: var(--tv-ink); }
.tv-count-row .tv-count-label small { color: var(--tv-muted); }
.tv-count-row .tv-count-result { min-width: 88px; text-align: right; font-weight: 600; color: var(--tv-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 575.98px) {
    .tv-count-row { flex-wrap: wrap; }
    .tv-count-row .tv-count-label { flex-basis: 100%; }
}

.tv-sigpad { position: relative; border: 2px dashed var(--tv-line-2); border-radius: 16px; background: #fff; touch-action: none; }
.tv-sigpad canvas { display: block; width: 100%; height: 200px; border-radius: 12px; cursor: crosshair; }
.tv-sigpad.is-signed { border-style: solid; border-color: var(--tv-green); }
.tv-sigpad-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--tv-faint); font-weight: 600; pointer-events: none; }
.tv-sigpad.is-signed .tv-sigpad-hint { display: none; }

.tv-photo { display: flex; align-items: center; gap: 16px; }
.tv-photo img { width: 88px; height: 88px; object-fit: cover; border-radius: 12px; border: 1px solid var(--tv-line); }
.tv-proof { max-width: 100%; max-height: 220px; border-radius: 12px; border: 1px solid var(--tv-line); background: #fff; }

/* Ligne de tâche : toute la ligne est cliquable, chevron gris */
.tv-task { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--tv-line); color: inherit; text-decoration: none; }
.tv-task:first-child { border-top: 0; }
a.tv-task:hover { background: var(--tv-panel); color: inherit; }
.tv-task-body { flex: 1; min-width: 0; }
.tv-task-title { display: block; font-weight: 600; color: var(--tv-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-task-meta { display: block; font-size: 12px; line-height: 16px; color: var(--tv-muted); }
.tv-task-go { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: 8px; background: transparent; color: var(--tv-faint); font-size: 14px; }
.tv-task.is-done .tv-task-go { color: var(--tv-green); }

.tv-action-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tv-action-tile { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 16px; border: 1px solid var(--tv-line-2); border-radius: 16px; background: #fff; color: inherit; text-decoration: none; font-weight: 600; }
.tv-action-tile:hover { border-color: var(--tv-ink); color: inherit; }
.tv-action-tile small { display: block; font-weight: 400; color: var(--tv-muted); }
.tv-action-tile.is-primary { background: var(--tv-ink); border-color: var(--tv-ink); color: #fff; }
.tv-action-tile.is-primary small { color: var(--tv-ink-soft); }
.tv-action-tile.is-primary .tv-kpi-icon { background: var(--tv-accent) !important; color: #fff !important; }
.tv-action-tile.is-disabled { opacity: .55; pointer-events: none; }

/* Barre d'action fixe en bas des écrans terrain (cible au pouce : 48 px) */
.tv-cta-bar { position: sticky; bottom: 0; z-index: 5; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--tv-panel) 70%, transparent); }
.tv-cta-bar .btn { width: 100%; min-height: 42px; font-size: 14px; font-weight: 600; }
.tv-cta-hint { margin-top: 8px; text-align: center; font-size: 12px; line-height: 16px; color: var(--tv-muted); }

.tv-take { cursor: pointer; }
.tv-take .form-check-input { flex: 0 0 auto; width: 24px; height: 24px; margin: 0; border: 2px solid var(--tv-faint); border-radius: 8px; }
.tv-take .form-check-input:checked { background-color: var(--tv-accent); border-color: var(--tv-accent); }
.tv-count-row:has(.tv-take .form-check-input:checked) { background: var(--tv-accent-50); }

/* Bandeau d'état de la connexion (mode dégradé) */
.tv-net { position: fixed; left: 50%; top: 12px; z-index: 1090; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 8px 16px; border-radius: 12px; box-shadow: var(--tv-shadow-pop); text-align: center; font-size: 13px; font-weight: 600; }
.tv-net.is-offline { background: var(--tv-ink); color: #fff; }
.tv-net.is-online { background: var(--tv-green-50); color: var(--tv-green); }

.tv-task-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; flex: 0 1 auto; min-width: 0; max-width: 45%; }
@media (max-width: 575.98px) {
    .tv-task:has(.tv-task-tags) { flex-wrap: wrap; row-gap: 8px; }
    .tv-task-tags { order: 3; flex-basis: 100%; max-width: none; justify-content: flex-start; padding-left: calc(28px + var(--sp-12)); } /* aligné sous le titre : pastille + écart */
}

.tv-palette .modal-dialog { margin-top: 10vh; }

/* ==========================================================================
   16. Navigation : groupes repliables, fil d'Ariane, onglets, Paramètres
   ========================================================================== */
.tv-nav button.nav-section { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.tv-nav .nav-section > span { flex: 1; min-width: 0; }
.tv-nav .nav-section .bi { font-size: 12px; transition: transform .15s; }
.tv-nav .nav-section.collapsed .bi { transform: rotate(-90deg); }
.tv-nav-group { flex-direction: column; gap: 4px; }
.tv-nav-group.show, .tv-nav-group.collapsing { display: flex; }

.tv-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 12px; line-height: 16px; color: var(--tv-faint); }
.tv-crumbs a { color: var(--tv-muted); font-weight: 500; }
.tv-crumbs a:hover { color: var(--tv-ink); }
.tv-crumbs a:last-child { color: var(--tv-ink); }

.tv-tabs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: -8px 0 24px; }
.tv-tabs-row .tv-tabs { margin-bottom: 0; }
.tv-tabs-row > :not(.tv-tabs) { margin-left: auto; }

.tv-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; margin-bottom: 16px; }
.tv-section-head > div:first-child { flex: 1 1 280px; }
.tv-section-title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--tv-ink); }

/* Paramètres, présentation inspirée de Claude (retour du 26/11/2026) :
   menu à gauche (titre, recherche, rubriques avec icône, séparateurs), rubrique à droite en lignes
   « libellé + description | réglage ». Téléphone : liste des rubriques, puis rubrique en pleine page. */
.tv-settings { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 992px) { .tv-settings { grid-template-columns: 248px minmax(0, 1fr); } }
.tv-settings-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px; background: var(--tv-card); border-radius: 16px; }
@media (min-width: 992px) { .tv-settings-nav { position: sticky; top: 0; } }
.tv-settings-title { padding: 0 8px 12px; font-size: 18px; line-height: 24px; font-weight: 600; color: var(--tv-ink); }
.tv-settings-search { position: relative; display: block; margin: 0 0 8px; }
.tv-settings-search .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--tv-faint); pointer-events: none; }
.tv-settings-search input { width: 100%; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--tv-line); border-radius: 10px; background: var(--tv-panel); font-size: 13px; color: var(--tv-ink); outline: 0; }
.tv-settings-search input:focus { border-color: var(--tv-accent); background: #fff; }
.tv-settings-nav .nav-section { display: none; }
.tv-settings-sep { margin: 8px 8px; border: 0; border-top: 1px solid var(--tv-line); opacity: 1; }
.tv-settings-nav .nav-link { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 8px 10px; border-radius: 10px; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--tv-body); }
.tv-settings-nav .nav-link > .bi:first-child { flex: none; width: 18px; font-size: 16px; text-align: center; color: var(--tv-muted); }
.tv-settings-nav .nav-link > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-settings-nav .nav-link:hover { background: var(--tv-panel); color: var(--tv-ink); }
.tv-settings-nav .nav-link.active { background: var(--tv-panel); color: var(--tv-ink); font-weight: 600; }
.tv-settings-nav .nav-link.active > .bi:first-child { color: var(--tv-ink); }
.tv-settings-chevron { display: none; flex: none; font-size: 12px; color: var(--tv-faint); }
.tv-settings-empty { margin: 8px; font-size: 13px; color: var(--tv-muted); }
.tv-settings-body { min-width: 0; display: flex; flex-direction: column; }
.tv-settings-back { display: none; }

/* Rubrique : titre, groupes de lignes (comme « Profil », « Connexions actives » chez Claude) */
.tv-set-page { display: flex; flex-direction: column; gap: 24px; }
.tv-set-group { background: var(--tv-card); border-radius: 16px; padding: 8px 24px; }
.tv-set-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 16px 0 8px; }
.tv-set-group-title { margin: 0; flex: 1; font-size: 15px; line-height: 24px; font-weight: 600; color: var(--tv-ink); }
.tv-set-row { display: flex; align-items: center; gap: 16px 24px; padding: 16px 0; border-top: 1px solid var(--tv-line); }
.tv-set-group-head + .tv-set-row, .tv-set-group > .tv-set-row:first-child { border-top: 0; }
.tv-set-label { flex: 1 1 auto; min-width: 0; }
.tv-set-label strong { display: block; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--tv-ink); }
.tv-set-label small { display: block; margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--tv-muted); }
.tv-set-control { flex: 0 0 320px; max-width: 100%; display: flex; justify-content: flex-end; }
.tv-set-control > * { width: 100%; }
.tv-set-control .form-check { width: auto; margin: 0; }
.tv-set-control .mb-3 { margin-bottom: 0 !important; }
.tv-set-control .form-label { display: none; }
.tv-set-value { flex: 0 1 auto; font-size: 13px; color: var(--tv-muted); text-align: right; overflow-wrap: anywhere; }
.tv-set-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 0; border-top: 1px solid var(--tv-line); }
.tv-set-table { width: 100%; }
.tv-set-table th { padding: 12px 8px 8px 0; font-size: 12px; font-weight: 500; color: var(--tv-muted); border-bottom: 1px solid var(--tv-line); }
.tv-set-table td { padding: 12px 8px 12px 0; font-size: 13px; border-bottom: 1px solid var(--tv-line); vertical-align: middle; }
.tv-set-table tr:last-child td { border-bottom: 0; }
.tv-set-badge { display: inline-flex; align-items: center; margin-left: 8px; padding: 0 8px; height: 20px; border-radius: 999px; background: var(--tv-accent-50); color: var(--tv-accent); font-size: 11px; font-weight: 600; }

@media (max-width: 991.98px) {
    /* Accueil des Paramètres : la liste des rubriques en pleine largeur, façon application. */
    .tv-settings.is-home .tv-settings-body { display: none; }
    .tv-settings:not(.is-home) .tv-settings-nav { display: none; }
    .tv-settings-nav { padding: 12px; }
    .tv-settings-title { font-size: 20px; padding: 4px 8px 12px; }
    .tv-settings-nav .nav-link { padding: 12px 10px; font-size: 14px; }
    .tv-settings-nav .nav-link.active { background: transparent; font-weight: 500; }
    .tv-settings-chevron { display: inline-block; }
    .tv-settings-back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; margin: 0 0 12px -4px; padding: 4px; font-size: 14px; font-weight: 600; color: var(--tv-ink); }
    .tv-set-group { padding: 4px 16px; }
    /* Lignes empilées : libellé au-dessus, réglage en pleine largeur. */
    .tv-set-row { flex-direction: column; align-items: stretch; gap: 8px; }
    .tv-set-control { flex: 1 1 auto; justify-content: flex-start; }
    .tv-set-row.is-inline { flex-direction: row; align-items: center; }
    .tv-set-row.is-inline .tv-set-control { flex: 0 0 auto; }
    .tv-set-value { text-align: left; }
    .tv-set-table thead { display: none; }
    .tv-set-table tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--tv-line); }
    .tv-set-table tr:last-child { border-bottom: 0; }
    .tv-set-table td { padding: 0; border: 0; }
    .tv-set-table td:not(:first-child):not(.tv-set-cell-action) { grid-column: 1; font-size: 12px; color: var(--tv-muted); }
    .tv-set-table td.tv-set-cell-action { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
}

/* Champs dans une grille : la gouttière de la rangée suffit */
.row > [class*="col"] > .mb-3:last-child, .row > [class*="col"] > div > .mb-3:last-child { margin-bottom: 0 !important; }

/* ==========================================================================
   17. Accueil : colonne principale + colonne de droite 288 px (audit §5.2, §4.13)
   ========================================================================== */
.tv-panel { container-type: inline-size; container-name: panel; }
.tv-dash { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: stretch; }
@container panel (min-width: 880px) { .tv-dash { grid-template-columns: minmax(0, 1fr) 288px; } .tv-dash-aside > .card:last-child { flex: 1; } }
.tv-dash-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.tv-dash-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tv-equal > [class*="col"] > .card { height: 100%; }
/* Rangées dans une colonne en flex : l'écart vertical vient du gap, pas des marges Bootstrap */
.tv-dash-main > .row, .tv-stack > .row { --bs-gutter-y: 0; row-gap: 16px; margin-top: 0; }

.tv-chart-total { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--tv-ink); }
.tv-chart { display: flex; flex-direction: column; gap: 8px; }
.tv-chart-plot { position: relative; height: 160px; }
.tv-chart-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tv-chart-hit { position: absolute; top: 0; bottom: 0; width: 32px; transform: translateX(-50%); }
.tv-chart-dot { position: absolute; width: 12px; height: 12px; border: 2px solid var(--tv-accent); border-radius: 999px; background: #fff; transform: translate(-50%, -50%); pointer-events: none; }
.tv-chart-tip { position: absolute; transform: translate(-100%, -150%); margin-left: -8px; padding: 4px 8px; border-radius: 8px; background: var(--tv-ink); color: #fff; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.tv-chart-axis { display: flex; justify-content: space-between; font-size: 12px; line-height: 16px; color: var(--tv-faint); }
.tv-legend i.is-dashed { height: 0; border-top: 2px dashed var(--tv-ink); background: none; }
.tv-split-bar { display: flex; gap: 4px; height: 8px; }
.tv-split-bar span { display: block; height: 8px; border-radius: 4px; min-width: 8px; }
.tv-list-item .tv-chip-icon.tint-neutral { background: var(--tv-gray-50); }

/* ==========================================================================
   18. Listes : barre de filtres intégrée à la carte, pied de liste
   ========================================================================== */
.tv-list-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.tv-list-card > .table-responsive, .tv-list-card > .table { padding: 0 !important; }
.tv-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.tv-filters .tv-status-filters { flex: 1 1 auto; }
.tv-filter-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.tv-filter-tools .tv-search { width: 240px; max-width: 100%; }
.tv-filter-tools .form-select.tv-filter { width: auto; max-width: 220px; font-weight: 500; }
.tv-filter-period { position: relative; }
.tv-filter-period > .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--tv-muted); pointer-events: none; }
.tv-filter-period > .form-select { padding-left: 32px; }
.tv-list-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 0; font-size: 12px; line-height: 16px; color: var(--tv-muted); }
.tv-list-foot .pagination { margin-left: auto; }
@media (max-width: 767.98px) {
    .tv-filters { flex-direction: column; align-items: stretch; }
    .tv-filters .tv-status-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .tv-filter-tools { margin-left: 0; }
    .tv-filter-tools .tv-search { width: 100%; }
}
.tv-kpi-row { margin-bottom: 24px; }
.tv-input-amount { width: 112px; }
.tv-tank.is-low { box-shadow: inset 0 0 0 1px var(--tv-red); }

/* Audit 4.8 : un conteneur flex doit pouvoir rétrécir (sinon les puces débordent sur téléphone) */
.tv-filters > *, .tv-list-card > * { min-width: 0; max-width: 100%; }

/* ==========================================================================
   19. Coquille à hauteur d'écran (bureau) : la page ne défile pas ;
       la sidebar et le panneau de contenu défilent chacun de leur côté (Figma).
   ========================================================================== */
@media (min-width: 992px) {
    html, body { height: 100%; overflow: hidden; }
    .tv-shell { height: calc(100vh - 32px); height: calc(100dvh - 32px); min-height: 0; }
    .tv-sidebar.offcanvas-lg { position: static; top: auto; align-self: stretch; height: 100%; overflow-y: auto; }
    .tv-zone { min-height: 0; height: 100%; }
    .tv-topbar { flex: none; }
    .tv-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--tv-line-2) transparent; }
}
@media print {
    html, body { height: auto; overflow: visible; }
    .tv-shell { height: auto; }
    .tv-panel { overflow: visible; }
}

/* ==========================================================================
   20. Connexion (Figma « 00 Connexion ») : fond pierre, visuel + carte formulaire de rayon 24
   ========================================================================== */
.tv-login-body { background: var(--tv-outer); }
.tv-login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr; gap: 16px; padding: 16px; background: var(--tv-outer); }
@media (min-width: 992px) { .tv-login { grid-template-columns: minmax(0, 832fr) minmax(400px, 560fr); height: 100vh; height: 100dvh; } }
.tv-login-visual { display: none; position: relative; overflow: hidden; flex-direction: column; justify-content: flex-end; gap: 24px; padding: 32px; border-radius: 24px; color: #fff;
    background: linear-gradient(0deg, rgba(31, 26, 23, .88) 0%, rgba(31, 26, 23, 0) 55%), radial-gradient(120% 90% at 85% 10%, rgba(230, 62, 32, .55), rgba(230, 62, 32, 0) 60%), var(--tv-ink); }
.tv-login-visual.has-photo { background: linear-gradient(0deg, rgba(31, 26, 23, .88) 0%, rgba(31, 26, 23, 0) 55%), var(--tv-login-photo) center / cover no-repeat, var(--tv-ink); }
@media (min-width: 992px) { .tv-login-visual { display: flex; } }
.tv-login-preview { width: 260px; }
.tv-login-preview .tv-kpi-value { font-size: 16px; line-height: 24px; }
.tv-login-claim { max-width: 420px; margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; color: #fff; }
.tv-login-place { margin: 4px 0 0; font-size: 13px; line-height: 20px; color: rgba(255, 255, 255, .8); }
.tv-login-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; border-radius: 24px; background: var(--tv-card); }
.tv-login-card { width: 100%; max-width: 464px; display: flex; flex-direction: column; gap: 24px; }
.tv-login-brand { display: flex; align-items: center; gap: 8px; }
.tv-login-brand .tv-logo-mark { transform: scale(.7); }
.tv-login-brand .tv-logo-word { font-size: 16px; font-weight: 600; }
.tv-login-form { display: flex; flex-direction: column; gap: 16px; }
.tv-login-form .mb-3 { margin-bottom: 0 !important; }
.tv-login-form .alert { margin: 0; }
.tv-login-version { margin: 0; font-size: 12px; line-height: 16px; color: var(--tv-faint); }
@media (max-width: 991.98px) { .tv-login { padding: 0; } .tv-login-main { border-radius: 0; min-height: 100dvh; } }
.tv-login-body { padding: 0 !important; overflow: auto !important; height: auto !important; }
html:has(.tv-login-body) { overflow: auto; height: auto; }
.tv-login-preview { height: auto; flex: none; margin-bottom: auto; }

/* ==========================================================================
   21. Téléphone (< 768 px) : application (Figma « 03 Responsive », Mobile 390)
       barre du haut réduite, navigation basse, listes en cartes, action principale en bas.
   ========================================================================== */
.tv-mobile-nav { display: none; }
@media (max-width: 767.98px) {
    body { background: var(--tv-panel); }
    .tv-shell { display: block; padding: 0; background: var(--tv-panel); min-height: 100dvh; }
    .tv-zone { gap: 0; }
    .tv-topbar { position: sticky; top: 0; z-index: 1030; min-height: 56px; padding: 8px 16px; background: var(--tv-panel); }
    .tv-topbar .tv-logo-word { font-size: 16px; }
    .tv-search-trigger { flex: 0 0 auto; width: 32px; height: 32px; padding: 0; justify-content: center; background: var(--tv-card); }
    .tv-search-trigger > span { display: none !important; }
    .tv-topbar-actions { gap: 8px; }
    .tv-topbar-actions .btn-accent { width: 32px; min-height: 32px; height: 32px; padding: 0; }
    .tv-topbar-actions .btn-accent > :not(.bi-plus-lg) { display: none !important; }
    .tv-usermenu { padding: 0; }
    .tv-panel { border-radius: 0; padding: 8px 16px calc(84px + env(safe-area-inset-bottom)); }
    .tv-page-head { margin-bottom: 16px; }
    .tv-tabs-row { margin: -4px -16px 16px; padding: 0 16px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .tv-tabs-row .tv-tabs { flex: none; }

    /* Action principale de la page : bouton pleine largeur au-dessus de la navigation basse */
    .tv-page-head .tv-actions { margin: 0; }
    .tv-page-head .tv-actions > .btn-accent:last-child, .tv-page-head .tv-actions > .btn-group:last-child {
        position: fixed; z-index: 1020; left: 16px; right: 16px; bottom: calc(64px + env(safe-area-inset-bottom)); width: auto;
        box-shadow: 0 8px 24px rgba(230, 62, 32, .3);
    }
    .tv-page-head .tv-actions > .btn-group:last-child > .btn:first-child { flex: 1; }

    /* Navigation basse : 5 entrées */
    .tv-mobile-nav {
        display: flex; justify-content: space-between; position: fixed; z-index: 1035; left: 0; right: 0; bottom: 0;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--tv-card); border-top: 1px solid var(--tv-line);
    }
    .tv-mobile-nav a, .tv-mobile-nav button {
        flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0; background: none;
        font-size: 11px; line-height: 14px; color: var(--tv-muted); text-decoration: none;
    }
    .tv-mobile-nav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tv-mobile-nav .bi { font-size: 18px; line-height: 18px; }
    .tv-mobile-nav .active { color: var(--tv-ink); font-weight: 600; }
    .tv-mobile-nav .active .bi { color: var(--tv-accent); }

    /* « Plus » : la sidebar s'ouvre en page pleine (Menu Plus) */
    .tv-sidebar.offcanvas-lg { width: 100% !important; padding: 16px; }
    .tv-sidebar .nav-section { display: none; }
    .tv-sidebar .tv-nav-group { display: flex !important; height: auto !important; }

    /* Listes : chaque ligne devient une carte (titre et montant, puis détail et statut) */
    .tv-list-card { background: transparent; padding: 0; }
    .tv-list-card > .table-responsive { overflow: visible; }
    .tv-list-card .table, .tv-list-card .table tbody { display: block; }
    .tv-list-card .table thead, .tv-list-card .table tfoot { display: none; }
    .tv-list-card .table tbody tr {
        display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 4px;
        margin-bottom: 8px; padding: 12px 16px; border-radius: 16px; background: var(--tv-card);
    }
    .tv-list-card .table tbody td { display: none; padding: 0; border: 0; background: transparent !important; }
    .tv-list-card .table tbody td:first-child { display: block; grid-column: 1; grid-row: 1 / span 2; min-width: 0; }
    .tv-list-card .table tbody td.num:not(td.num ~ td.num) { display: block; grid-column: 2; grid-row: 1; text-align: right; }
    .tv-list-card .table tbody td:last-child:not(:first-child) { display: block; grid-column: 2; grid-row: 2; justify-self: end; }
    .tv-list-card .table tbody td.tv-m-show { display: block; grid-column: 1 / -1; }
    .tv-list-card .tv-cell-name, .tv-list-card .tv-cell-title { display: block; max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tv-list-card .tv-filters { margin-bottom: 4px; }
    .tv-list-card .tv-empty, .tv-list-card > .card-title, .tv-list-card > .d-flex { background: var(--tv-card); border-radius: 16px; padding: 16px; }
    .tv-list-card .tv-list-foot { padding: 4px 4px 0; }
    .tv-list-card .tv-task { background: var(--tv-card); border-radius: 16px; margin-bottom: 8px; border-top: 0; }
    .row.tv-kpi-row > [class*="col-md"], .row[data-testid="kpis"] > [class*="col-md"] { flex: 0 0 auto; width: 50%; }
    .row.tv-kpi-row > [class*="col-md"]:nth-child(3):last-child, .row[data-testid="kpis"] > [class*="col-md"]:nth-child(3):last-child { width: 100%; }
    .tv-toasts { bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* Proposition d'installation (PWA) : feuille au-dessus de la navigation basse */
.tv-install { position: fixed; z-index: 1060; left: 16px; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 16px; background: var(--tv-card); box-shadow: var(--tv-shadow-pop); animation: tv-toast-in .2s ease-out; }
.tv-install[hidden] { display: none; }
@media (min-width: 768px) { .tv-install { left: auto; right: 24px; bottom: 24px; max-width: 420px; } }

/* ==========================================================================
   22. Chargement (Figma « Planche : alertes… », section Chargement) : au-delà de 300 ms,
       squelettes gris à la place du contenu, jamais de page blanche.
   ========================================================================== */
.tv-panel.is-loading > * { display: none !important; }
.tv-panel.is-loading > .tv-loading { display: flex !important; }
.tv-loading { display: none; flex-direction: column; gap: 24px; }
.tv-loading .tv-skel-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 16px; background: var(--tv-card); }
.tv-loading .tv-skel-row { display: flex; gap: 16px; }
.tv-loading .tv-skel-row .tv-skeleton { flex: none; }
.tv-loading .tv-skel-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.tv-results .tv-skeleton-line { display: flex; align-items: center; gap: 12px; padding: 8px; }
.tv-filter-toggle { display: none; }
@media (max-width: 767.98px) {
    .tv-filter-toggle { display: inline-flex; flex: none; }
    .tv-filter-tools { flex-wrap: wrap; }
    .tv-filter-tools .tv-search { flex: 1 1 0; width: auto; }
    .tv-filter-tools:not(.is-open) > .form-select, .tv-filter-tools:not(.is-open) > .tv-filter-period, .tv-filter-tools:not(.is-open) > input[type="date"], .tv-filter-tools:not(.is-open) > label { display: none; }
    .tv-filter-tools.is-open > .form-select, .tv-filter-tools.is-open > .tv-filter-period { flex: 1 1 100%; max-width: none; }
    .tv-filter-tools.is-open > .tv-filter-period > .form-select { width: 100%; max-width: none; }
    .tv-filter-tools .tv-link { flex-basis: 100%; }
    .row.tv-kpi-row > :nth-child(n+3) { display: none; }
}
.tv-form-narrow { max-width: 640px; }

/* ==========================================================================
   23. Modales métier (Figma 02 Modales et retours)
   ========================================================================== */
.tv-modal-md { max-width: 560px; }
/* Liste de vérifications (Figma « Contrôle » + « Case à cocher ») */
.tv-checklist { list-style: none; margin: 0; padding: 0; }
.tv-checklist > li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--tv-line); }
.tv-checklist > li:last-child { border-bottom: 0; }
.tv-check { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1px solid var(--tv-line-2); border-radius: 4px; background: #fff; color: transparent; font-size: 12px; }
.tv-checklist > li.is-done .tv-check { border-color: var(--tv-accent); background: var(--tv-accent); color: #fff; }
.tv-check-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tv-check-text strong { font-size: 13px; line-height: 20px; font-weight: 600; color: var(--tv-ink); }
.tv-check-text small { font-size: 12px; line-height: 16px; color: var(--tv-muted); }
/* Raccourcis clavier dans les menus (Figma « Option de menu » : lettre à droite) */
.dropdown-item .tv-shortcut, .tv-result .tv-shortcut { margin-left: auto; flex: none; min-width: 20px; padding: 0 4px; border-radius: 4px; background: var(--tv-gray-50); font-size: 12px; line-height: 20px; font-weight: 600; color: var(--tv-muted); text-align: center; }
.tv-quick-menu { width: 256px; padding: 8px; border-radius: 12px; }
.tv-quick-menu .dropdown-header { padding: 8px 8px 4px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-faint); }
.tv-quick-menu .dropdown-item { display: flex; align-items: center; gap: 8px; height: 36px; padding: 8px; border-radius: 8px; }
/* Palette : touche Échap dans la saisie et pied d'aide (Figma 22:4123) */
.tv-palette-esc { position: absolute; right: 16px; top: 14px; }
.tv-palette-help { padding: 12px 16px; background: var(--tv-panel); font-size: 12px; line-height: 16px; color: var(--tv-muted); }
.tv-palette .tv-result .tv-enter { display: none; margin-left: auto; font-size: 12px; color: var(--tv-muted); }
.tv-palette .tv-result.active .tv-enter { display: inline; }
@media (max-width: 767.98px) { .tv-palette-help, .tv-palette-esc { display: none; } }
.tv-palette .tv-palette-input { padding-right: 80px; }
/* Notifications (Figma 22:3780) : panneau 384 px */
.tv-notif-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--tv-accent); box-shadow: 0 0 0 2px #fff; }
.tv-notif > .btn { position: relative; }
.tv-notif-panel { width: 384px; max-width: calc(100vw - 32px); padding: 0 0 8px; border-radius: 16px; }
.tv-notif-head { display: flex; align-items: center; gap: 8px; padding: 16px 16px 0; }
.tv-notif-title { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--tv-ink); }
.tv-notif-head .btn-link { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-accent-600); text-decoration: none; }
.tv-notif-filter { padding: 8px 16px; }
.tv-notif-list { max-height: min(560px, 60vh); overflow-y: auto; padding: 0 8px; display: flex; flex-direction: column; gap: 4px; }
.tv-notif-group { padding: 8px 8px 0; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-faint); }
.tv-notif-item { display: flex; gap: 12px; padding: 12px; border-radius: 12px; color: var(--tv-body); text-decoration: none; }
.tv-notif-item.is-unread { background: var(--tv-accent-50); }
a.tv-notif-item:hover { background: var(--tv-panel); color: var(--tv-ink); }
.tv-notif-item-title { display: block; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--tv-ink); }
.tv-notif-item-text { display: block; font-size: 12px; line-height: 16px; color: var(--tv-muted); }
.tv-notif-foot { padding: 8px 16px 0; text-align: center; }
.tv-notif-foot a { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-accent-600); text-decoration: none; }

/* ==========================================================================
   24. Formulaires seuls et formulaires en étapes (Figma « Nouveau client », « Nouvel achat »)
   ========================================================================== */
/* Un formulaire seul est centré dans le panneau, en-tête compris : 800 px, ou 800 + 288 avec un résumé. */
.tv-narrow { width: 100%; max-width: 800px; margin-inline: auto; }
.tv-narrow-aside { max-width: 1112px; }
.tv-form-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@container panel (min-width: 980px) { .tv-form-layout { grid-template-columns: minmax(0, 1fr) 288px; } .tv-form-aside { position: sticky; top: 0; } }
.tv-form-main, .tv-form-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tv-form-main > .card > .card-body, .tv-form-aside > .card > .card-body { padding: 16px; }
.tv-step-title { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--tv-ink); }
.tv-step-sub { margin: 4px 0 16px; font-size: 13px; line-height: 20px; color: var(--tv-muted); }
/* Étapes reliées par un trait plein (Figma « Étapes » : trait 4 px, encre quand l'étape est faite) */
.tv-steps-line { flex-wrap: nowrap; gap: 12px; overflow-x: auto; }
.tv-steps-line .tv-step { flex: none; padding: 0; border: 0; background: none; white-space: nowrap; }
.tv-steps-line .tv-step + .tv-step::before, .tv-steps-line .tv-step-line + .tv-step::before { content: none; }
.tv-step-line { flex: 1 1 24px; min-width: 24px; height: 4px; border-radius: 4px; background: var(--tv-line-2); }
.tv-step.done + .tv-step-line { background: var(--tv-ink); }
.tv-wizard-nav { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.tv-dl-compact { grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; }
.tv-dl-compact dd { font-weight: 600; text-align: right; overflow-wrap: break-word; min-width: 0; }
@media (max-width: 767.98px) {
    .tv-steps-line .tv-step:not(.current) { font-size: 0; gap: 0; }
    .tv-wizard-nav { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); padding: 12px 0; background: var(--tv-panel); }
}

/* ==========================================================================
   25. Options des listes déroulantes : même dessin que les menus (Figma « Option de menu »)
   Ordinateur seulement (Chrome et Edge récents) ; le téléphone garde le sélecteur natif, plus adapté au doigt.
   ========================================================================== */
@supports (appearance: base-select) {
    @media (pointer: fine) {
        select.form-select { appearance: base-select; display: block; padding-top: 0; padding-bottom: 0; line-height: 30px; padding-right: 32px; white-space: nowrap; overflow: clip; overflow-clip-margin: content-box; text-overflow: ellipsis; }
        select.form-select::picker-icon { display: none; }
        select.form-select::picker(select) { appearance: base-select; margin-top: 4px; padding: 4px; min-width: anchor-size(width); max-height: min(320px, 50vh);
            border: 1px solid var(--tv-line); border-radius: 12px; background: #fff; box-shadow: var(--tv-shadow-pop); }
        select.form-select option { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 6px 8px; border-radius: 8px;
            font-size: 13px; line-height: 20px; font-weight: 500; color: var(--tv-body); cursor: pointer; }
        select.form-select option:hover, select.form-select option:focus-visible { background: var(--tv-panel); color: var(--tv-ink); outline: 0; }
        select.form-select option:checked { color: var(--tv-ink); font-weight: 600; }
        select.form-select option::checkmark { order: 1; margin-left: auto; color: var(--tv-accent); font-weight: 700; }
        select.form-select option[value=""] { color: var(--tv-faint); }
        select.form-select optgroup { padding: 8px 8px 4px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-faint); }
        select.form-select optgroup option { margin-top: 2px; }
        select.form-select[multiple], select.form-select[size]:not([size="1"]) { appearance: auto; }
    }
}
/* Totaux d'un document (Figma « Totaux ») */
.tv-totals { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--tv-line); }
.tv-totals dt { font-weight: 400; color: var(--tv-muted); }
.tv-totals dd { margin: 0; font-weight: 600; color: var(--tv-ink); text-align: right; font-variant-numeric: tabular-nums; }
.tv-totals .tv-total-ttc { font-size: 14px; font-weight: 600; color: var(--tv-ink); }
.tv-totals dd.tv-total-ttc { font-size: 16px; line-height: 24px; }
.tv-detail .tv-list-item { padding-inline: 0; }
.tv-cell-name { max-width: 320px; }
/* Rangée d'indicateurs dans une colonne (Figma « Indicateurs » : 3 KPI, gouttière 16) */
.tv-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 16px; }
.tv-kpi-grid > .card { height: 100%; }
/* En-tête de carte dans un corps de carte (Figma « En-tête de carte » : titre 14, lien accent à droite) */
.tv-card-head { display: flex; align-items: center; gap: 8px; min-height: 24px; margin-bottom: 12px; }
.tv-card-head > :first-child { flex: 1; min-width: 0; }
.tv-card-link { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-accent-600); text-decoration: none; }
.tv-card-link::after { content: "\F144"; font-family: "bootstrap-icons"; margin-left: 4px; font-size: 11px; vertical-align: -1px; }
.tv-totals-plain { margin-top: 0; padding-top: 0; border-top: 0; }
.tv-totals-plain dt.tv-total-ttc, .tv-totals-plain dd.tv-total-ttc { margin-top: 8px; }
/* Choix en puces (Figma « Qu'achetez-vous ? » : puce active teintée accent) */
.tv-choice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tv-choice-chips > input { position: absolute; opacity: 0; pointer-events: none; }
.tv-choice-chips > label { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border: 1px solid var(--tv-line-2); border-radius: 8px; background: #fff;
    font-size: 13px; line-height: 20px; font-weight: 600; color: var(--tv-ink); cursor: pointer; }
.tv-choice-chips > label small { font-size: 12px; font-weight: 400; color: var(--tv-faint); }
.tv-choice-chips > input:checked + label { border-color: var(--tv-accent-50); background: var(--tv-accent-50); color: var(--tv-accent-600); }
.tv-choice-chips > input:checked + label small { color: var(--tv-accent-600); }
.tv-choice-chips > input:focus-visible + label { box-shadow: 0 0 0 3px rgba(230, 62, 32, .2); }
.tv-lines th { position: relative; }
.table-responsive { position: relative; } /* les textes masqués (visually-hidden) restent dans la zone défilante */

/* ==========================================================================
   26. Connexion, mesures Figma « 00 Connexion » (prime sur la section 20)
   Visuel fluide (marges 40, contenu en bas, écart 24 : aperçu, accroche, lieu) ; formulaire 560 px,
   marges 48, contenu centré verticalement, écart 24.
   ========================================================================== */
@media (min-width: 992px) { .tv-login { grid-template-columns: minmax(0, 1fr) 560px; } }
.tv-login-visual { padding: 40px; gap: 24px; justify-content: flex-end; }
.tv-login-preview { width: 260px; height: auto; flex: none; margin: 0; color: var(--tv-body); }
.tv-login-preview .tv-kpi-label .bi { font-size: 12px; color: var(--tv-faint); }
.tv-login-preview .tv-kpi-value { font-size: 20px; line-height: 28px; font-weight: 600; color: var(--tv-ink); }
.tv-login-claim { max-width: 420px; margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; color: #fff; }
.tv-login-place { margin: 0; font-size: 13px; line-height: 20px; color: #fff; }
.tv-login-main { padding: 48px; }
.tv-login-card { max-width: 464px; gap: 24px; }
.tv-login-mark { width: 28px; height: 28px; border-radius: 12px; font-size: 16px; }
.tv-login-brand .tv-logo-word { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--tv-ink); }
.tv-login-titles { display: flex; flex-direction: column; gap: 4px; }
.tv-login-titles .tv-page-title { margin: 0; }
.tv-login-form, .tv-login-fields { display: flex; flex-direction: column; gap: 16px; }
.tv-login-options { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.tv-login-options .form-check-label { font-size: 13px; line-height: 20px; color: var(--tv-ink); }
.tv-login-forgot { margin-left: auto; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--tv-accent); text-decoration: none; }
.tv-login-forgot:hover { color: var(--tv-accent-600); }
@media (max-width: 991.98px) { .tv-login-main { padding: 48px 24px; } }
.form-control:focus, .form-select:focus, .form-control, .form-select { background-color: #fff; } /* Bootstrap reprend --bs-body-bg (pierre) au focus */
.form-control:disabled, .form-control[readonly], .form-select:disabled { background-color: var(--tv-gray-50); }
.tv-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 24px; }
.tv-form-actions > .me-auto { margin-right: auto; }
.tv-row-actions { white-space: nowrap; }
.tv-row-actions > .btn + .btn, .tv-row-actions > form + .btn, .tv-row-actions > .btn + form { margin-left: 8px; }
/* Boutons voisins en flux (hors flex à gouttière) : jamais collés */
td > .btn + .btn, td > .btn + form, td > form + .btn, .card-body > .btn + .btn { margin-left: 8px; }
/* Sélecteur d'activité, pied de sidebar (Figma : 208 × 32, fond accent 50, texte 12 accent 600) */
.tv-activity { margin-top: 8px; }
.tv-activity-btn { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 8px; border: 0; border-radius: 8px; background: var(--tv-accent-50); color: var(--tv-accent-600); font-size: 12px; line-height: 16px; font-weight: 600; text-align: left; }
.tv-activity-btn > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-activity-btn .bi { flex: none; font-size: 14px; }
.tv-activity-btn .bi-chevron-down { font-size: 12px; }
.tv-activity-btn:hover { background: var(--tv-accent-100); }
.tv-activity-menu { width: 100%; min-width: 0; --bs-dropdown-min-width: 0; }
.tv-activity-menu .dropdown-item { display: flex; align-items: center; }
.tv-activity-help { margin: 4px 8px 4px; font-size: 12px; line-height: 16px; color: var(--tv-muted); }
/* Cloche : nombre de non lues à côté de l'icône (Figma « Cloche » : 12 / 600, accent 600) */
.tv-notif > .btn { width: auto; min-width: 32px; gap: 4px; padding: 0 8px; }
.tv-notif-count { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-accent-600); }
.tv-side-foot button.nav-link { width: 100%; border: 0; background: none; text-align: left; }
.tv-notif-item { position: relative; }
.tv-notif-item-time { display: block; margin-top: 4px; font-size: 12px; line-height: 16px; color: var(--tv-faint); }
.tv-notif-item-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Mon compte (Figma 30:15951) : grille 2 × 2, écart 24 entre les cartes */
.tv-account { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@container panel (min-width: 880px) { .tv-account { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tv-account > .card > .card-body { padding: 16px; }
.tv-account-facts { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--tv-line); }
.tv-toggle-list > li { gap: 16px; }
.tv-toggle-list .form-switch .form-check-input { width: 32px; height: 18px; cursor: pointer; }
.tv-card-link-plain { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--tv-accent-600); text-decoration: none; }

/* ==========================================================================
   27. Règle d'aération des formulaires (Figma « Champ » : 16 px entre champs, en ligne comme en colonne)
   Toute rangée de champs a une gouttière de 16 px dans les deux sens, qu'elle porte ou non une classe g-*.
   Combinée à la règle qui retire la marge du dernier champ d'une colonne, l'écart est toujours de 16 px.
   ========================================================================== */
form .row, .card-body .row, .modal-body .row { --bs-gutter-x: 16px; --bs-gutter-y: 16px; }
form .row + .row, .card-body .row + .row { margin-top: 0; }
/* Un champ isolé suivi d'une rangée, ou l'inverse : même écart de 16 px. */
form .row + .mb-3, form .mb-3 + .row, form .row + .form-check, form .row + .tv-form-actions { margin-top: 16px; }
form .row:has(+ .mb-3), form .row:has(+ .form-check) { margin-bottom: 0; }
.tv-period-menu { min-width: 260px; max-height: 70vh; overflow-y: auto; }

/* Navigateurs mobiles : pas d'agrandissement automatique du texte (font boosting d'Android, rotation iOS). */
html { -webkit-text-size-adjust: 100%; -moz-text-size-adjust: 100%; text-size-adjust: 100%; }
