/* JA Event — Premium CRUD (Devis + Factures) — responsive sans Tailwind utilities */
/* Couleurs : voir jaos-theme-tokens.css (--ja-premium-* alias) */

:root {
    --ja-premium-radius: 12px;
    --ja-premium-transition: var(--jaos-transition);
    --ja-panel-width: 420px;
    --ja-bp-mobile-max: 639px;
    --ja-bp-desktop-min: 1024px;
}

/* ── Page : pas de scroll horizontal ── */
.ja-premium-list,
.ja-premium-list .fi-main,
.ja-premium-list .fi-main-ctn,
.ja-premium-list .fi-page {
    max-width: 100%;
    overflow-x: clip;
}

/* ── Liste : pleine largeur, jamais dans un grid avec le panneau ── */
.ja-premium-crud {
    display: block;
    width: 100%;
    max-width: 100%;
}

.ja-premium-crud__main {
    width: 100%;
    max-width: 100%;
}

/* ── Drawer overlay (maquette) — hors flux, la liste ne bouge jamais ── */
.ja-premium-drawer-host {
    position: fixed;
    inset: 0;
    z-index: 40;
    pointer-events: none;
}

.ja-premium-drawer-host__backdrop {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.52);
    cursor: pointer;
    pointer-events: auto;
    animation: ja-fade-in 0.2s ease both;
}

.ja-premium-drawer-host__panel {
    position: fixed;
    z-index: 41;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto;
    background: var(--ja-premium-surface);
    border-left: 1px solid var(--ja-premium-border);
    box-shadow: -24px 0 64px rgba(0, 0, 0, 0.55);
}

.ja-premium-drawer-host__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 3;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--ja-premium-border);
    border-radius: 8px;
    background: var(--ja-premium-surface-2);
    color: var(--ja-premium-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: color var(--ja-premium-transition), border-color var(--ja-premium-transition);
}

.ja-premium-drawer-host__close:hover {
    color: var(--ja-premium-text);
    border-color: var(--jaos-primary);
}

.ja-premium-drawer-host__panel .ja-premium-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: transparent;
}

@keyframes ja-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ── MOBILE + TABLETTE (< 1024px) : cartes seules, tableau masqué ── */
.ja-premium-mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.75rem;
}

.ja-premium-desktop-table .fi-ta-table,
.ja-premium-desktop-table .fi-ta-record-checkbox,
.ja-premium-desktop-table thead,
.ja-premium-desktop-table .fi-ta-actions-header-cell,
.ja-premium-desktop-table .fi-ta-table > colgroup,
.ja-premium-desktop-table .fi-ta-row {
    display: none !important;
}

/* Sous la toolbar : pas de zone tableau vide (pagination, empty state) */
@media (max-width: 1023px) {
    .ja-premium-desktop-table .fi-ta-content,
    .ja-premium-desktop-table .fi-ta-pagination,
    .ja-premium-desktop-table .fi-pagination,
    .ja-premium-desktop-table .fi-ta-empty-state,
    .ja-premium-desktop-table .fi-ta-footer-ctn {
        display: none !important;
    }
}

/* ── MOBILE (< 640px) : drawer plein écran ── */
@media (max-width: 639px) {
    .ja-premium-drawer-host__panel {
        top: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border-left: none;
    }
}

/* ── TABLETTE (640px – 1023px) : cartes (même layout que mobile, plus d’espace) ── */
@media (min-width: 640px) and (max-width: 1023px) {
    .ja-premium-mobile-cards {
        gap: 0.65rem;
    }

    .ja-premium-mobile-card {
        padding: 1rem 1.15rem;
    }

    .ja-premium-mobile-card__top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.45rem;
    }

    .ja-premium-mobile-card__top .ja-status-summary {
        width: 100%;
        max-width: 100%;
    }

    .ja-premium-drawer-host__panel {
        top: 0;
        right: 0;
        width: 85vw;
        max-width: 85vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
}

/* ── DESKTOP (≥ 1024px) : tableau, pas de cartes ── */
@media (min-width: 1024px) {
    .ja-premium-mobile-cards {
        display: none !important;
    }

    .ja-premium-desktop-table .fi-ta-table {
        display: table !important;
    }

    .ja-premium-desktop-table thead {
        display: table-header-group !important;
    }

    .ja-premium-desktop-table .fi-ta-row {
        display: table-row !important;
    }

    .ja-premium-desktop-table .fi-ta-row > td {
        display: table-cell !important;
    }

    .ja-premium-desktop-table .fi-ta-record-checkbox,
    .ja-premium-desktop-table .fi-ta-actions-header-cell {
        display: table-cell !important;
    }

    .ja-premium-drawer-host__panel {
        top: 0;
        right: 0;
        width: var(--ja-panel-width);
        max-width: var(--ja-panel-width);
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
}

.ja-premium-panel-slide {
    animation: ja-panel-in var(--ja-premium-transition) both;
}

@keyframes ja-panel-in {
    from {
        opacity: 0;
        transform: translateX(12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ── Table premium desktop ── */
.ja-premium-desktop-table {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
}

.ja-premium-desktop-table--loading {
    opacity: 0.92;
    transition: opacity 0.15s ease;
}

.ja-premium-table .fi-ta-table,
.ja-data-table .fi-ta-table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    table-layout: auto;
}

@media (min-width: 1024px) {
    .ja-premium-desktop-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.ja-premium-table .fi-ta-header {
    background: transparent !important;
}

.ja-premium-table .fi-ta-header-cell {
    padding: 0 0.65rem 0.5rem;
    border: none !important;
    background: transparent !important;
}

/*
 * Une seule géométrie pour normal / hover / selected.
 * Seul background-color change — jamais border, padding, display, box-shadow par cellule.
 */
.ja-premium-table .fi-ta-row.ja-premium-row > td,
.ja-premium-table .fi-ta-row.ja-premium-row:hover > td,
.ja-premium-table .fi-ta-row.ja-premium-row--active > td {
    box-sizing: border-box;
    padding: 0.7rem 0.65rem;
    min-height: 3.25rem;
    font-size: 0.8125rem;
    line-height: 1.35;
    vertical-align: middle;
    overflow: hidden;
    transition: background-color var(--ja-premium-transition);
}

.ja-premium-table .fi-ta-row.ja-premium-row > td:first-child {
    padding-left: 0.75rem;
}

.ja-premium-table .fi-ta-row.ja-premium-row > td:last-child {
    padding-right: 0.5rem;
}

/*
 * Style Stripe/Linear : pas de cadre par ligne.
 * Fond transparent + un seul séparateur horizontal discret entre les lignes.
 */
.ja-premium-table .fi-ta-row.ja-premium-row > td {
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--ja-premium-border);
}

.ja-premium-table .fi-ta-row.ja-premium-row:last-child > td {
    border-bottom: none;
}

.ja-premium-table .fi-ta-row.ja-premium-row:hover > td {
    background-color: var(--ja-premium-hover);
}

.ja-premium-table .fi-ta-row.ja-premium-row--active > td {
    background-color: var(--ja-premium-gold-soft);
}

/* Barre gold à gauche de la ligne (colonne numéro, pas la checkbox) */
.ja-premium-table .fi-ta-row.ja-premium-row--active > td.ja-col-number {
    background-image: linear-gradient(
        90deg,
        var(--jaos-primary) 0,
        var(--jaos-primary) 3px,
        transparent 3px
    );
    background-repeat: no-repeat;
    background-size: 3px 100%;
}

/* Désactiver le style Filament fi-selected (barre primary sur 1re cellule) */
.ja-premium-table .fi-ta-row.fi-selected > td:first-child::before {
    display: none !important;
    content: none !important;
}

.ja-premium-table .fi-ta-row.fi-selected > td {
    background-color: var(--ja-premium-surface);
}

.ja-premium-table .fi-ta-row.fi-selected.ja-premium-row--active > td {
    background-color: var(--ja-premium-gold-soft);
}

/* Pas de hover Filament global sur les lignes premium */
.ja-premium-table .fi-ta-row:hover {
    background: transparent !important;
}

/* ── Bouton d'actions (⋮) : pas de cadre, fond léger au hover ── */
.ja-premium-table .fi-ta-actions .fi-icon-btn,
.ja-premium-table .fi-ta-actions .fi-btn,
.ja-premium-table .fi-dropdown-trigger .fi-icon-btn {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 8px;
    color: var(--ja-premium-muted);
    transition: background-color var(--ja-premium-transition), color var(--ja-premium-transition);
}

.ja-premium-table .fi-ta-actions .fi-icon-btn:hover,
.ja-premium-table .fi-ta-actions .fi-btn:hover,
.ja-premium-table .fi-dropdown-trigger .fi-icon-btn:hover {
    background: var(--ja-premium-hover) !important;
    color: var(--ja-premium-text);
}

/* ── Menu contextuel (dropdown) : bordure légère + ombre douce ── */
.ja-premium-list .fi-dropdown-panel {
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    background: var(--ja-premium-surface) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.ja-premium-list .fi-dropdown-list-item {
    border: none !important;
    border-radius: 6px;
}

.ja-premium-list .fi-dropdown-list-item:hover {
    background: var(--ja-premium-hover) !important;
}

.ja-premium-table .fi-ta-cell,
.ja-premium-table .fi-ta-col,
.ja-data-table .fi-ta-cell,
.ja-data-table .fi-ta-col {
    min-width: 0;
    max-width: 100%;
}

.ja-premium-table .fi-ta-col-wrapped,
.ja-data-table .fi-ta-col-wrapped {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

/* ── JAOS : colonnes sémantiques (tous tableaux premium + data) ── */
:is(.ja-premium-table, .ja-data-table) :is(
    th.ja-col-emission,
    td.ja-col-emission,
    th.ja-col-number,
    td.ja-col-number,
    th.ja-col-date,
    td.ja-col-date,
    th.ja-col-due,
    td.ja-col-due,
    th.ja-col-expiry,
    td.ja-col-expiry,
    th.ja-col-amount,
    td.ja-col-amount,
    th.ja-col-status,
    td.ja-col-status,
    th.ja-col-financial,
    td.ja-col-financial,
    th.ja-col-tracking,
    td.ja-col-tracking
) {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

:is(.ja-premium-table, .ja-data-table) :is(th.ja-col-emission, td.ja-col-emission) {
    min-width: 5.75rem;
}

:is(.ja-premium-table, .ja-data-table) :is(th.ja-col-number, td.ja-col-number) {
    min-width: 7.25rem;
}

:is(.ja-premium-table, .ja-data-table) :is(th.ja-col-date, td.ja-col-date) {
    min-width: 5.25rem;
}

:is(.ja-premium-table, .ja-data-table) :is(th.ja-col-due, td.ja-col-due),
:is(.ja-premium-table, .ja-data-table) :is(th.ja-col-expiry, td.ja-col-expiry) {
    min-width: 5.5rem;
}

:is(.ja-premium-table, .ja-data-table) :is(th.ja-col-amount, td.ja-col-amount) {
    min-width: 6.5rem;
    text-align: right;
}

:is(.ja-premium-table, .ja-data-table) :is(th.ja-col-payment, td.ja-col-payment) {
    min-width: 7rem;
    text-align: right;
}

:is(.ja-premium-table, .ja-data-table) :is(th.ja-col-status, td.ja-col-status),
:is(.ja-premium-table, .ja-data-table) :is(th.ja-col-financial, td.ja-col-financial) {
    min-width: 6.5rem;
}

:is(.ja-premium-table, .ja-data-table) :is(th.ja-col-tracking, td.ja-col-tracking) {
    min-width: 3.25rem;
    text-align: center;
}

:is(.ja-premium-table, .ja-data-table) th.ja-col-emission {
    padding-right: 0.85rem;
}

:is(.ja-premium-table, .ja-data-table) th.ja-col-number {
    padding-left: 0.15rem;
}

:is(.ja-premium-table, .ja-data-table) :is(
    .ja-col-emission,
    .ja-col-number,
    .ja-col-date,
    .ja-col-due,
    .ja-col-expiry,
    .ja-col-amount,
    .ja-col-payment,
    .ja-col-status,
    .ja-col-financial,
    .ja-col-tracking
) .fi-ta-col-wrapped {
    max-width: none;
    overflow: visible;
    white-space: nowrap;
}

:is(.ja-premium-table, .ja-data-table) .ja-col-amount .ja-premium-num,
:is(.ja-premium-table, .ja-data-table) .ja-col-payment .ja-premium-num,
:is(.ja-premium-table, .ja-data-table) .ja-col-number .ja-premium-ref {
    overflow: visible;
    text-overflow: clip;
}

:is(.ja-premium-table, .ja-data-table) .fi-ta-header-cell {
    white-space: nowrap;
    vertical-align: middle;
}

:is(.ja-premium-table, .ja-data-table) .fi-ta-header-cell .fi-ta-header-cell-sort-btn {
    flex-shrink: 0;
}

@media (min-width: 768px) and (max-width: 1279px) {
    .ja-premium-table :is(th.ja-col-hide-tablet, td.ja-col-hide-tablet) {
        display: none !important;
    }
}

/* Largeurs colonnes par classe (compatible checkbox + actions) */
:is(.ja-premium-table, .ja-data-table) .fi-ta-selection-cell {
    width: 2.75rem !important;
    max-width: 2.75rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.25rem !important;
}

.ja-premium-table--invoices .ja-col-emission {
    width: 7%;
}

.ja-premium-table--invoices .ja-col-number {
    width: 9%;
}

.ja-premium-table--invoices .ja-col-client {
    width: 18%;
}

.ja-premium-table--invoices .ja-col-date {
    width: 7%;
}

.ja-premium-table--invoices .ja-col-due {
    width: 8%;
}

.ja-premium-table--invoices .ja-col-amount {
    width: 10%;
}

.ja-premium-table--invoices .ja-col-payment {
    width: 12%;
}

.ja-premium-table--invoices .ja-col-status {
    width: 18%;
}

.ja-premium-table--invoices .ja-col-tracking {
    width: 5%;
}

.ja-premium-table--quotes .ja-col-number {
    width: 10%;
}

.ja-premium-table--quotes .ja-col-client {
    width: 22%;
}

.ja-premium-table--quotes .ja-col-object {
    width: 16%;
}

.ja-premium-table--quotes .ja-col-date {
    width: 8%;
}

.ja-premium-table--quotes .ja-col-expiry {
    width: 10%;
}

.ja-premium-table--quotes .ja-col-amount {
    width: 11%;
}

.ja-premium-table--quotes .ja-col-financial {
    width: 11%;
}

.ja-premium-table--quotes .ja-col-status {
    width: 12%;
}

.ja-premium-table .fi-ta-row.ja-premium-row > td.ja-col-emission,
.ja-premium-table .fi-ta-row.ja-premium-row > td.ja-col-number,
.ja-premium-table .fi-ta-row.ja-premium-row > td.ja-col-date,
.ja-premium-table .fi-ta-row.ja-premium-row > td.ja-col-due,
.ja-premium-table .fi-ta-row.ja-premium-row > td.ja-col-expiry,
.ja-premium-table .fi-ta-row.ja-premium-row > td.ja-col-amount,
.ja-premium-table .fi-ta-row.ja-premium-row > td.ja-col-payment,
.ja-premium-table .fi-ta-row.ja-premium-row > td.ja-col-status,
.ja-premium-table .fi-ta-row.ja-premium-row > td.ja-col-financial,
.ja-premium-table .fi-ta-row.ja-premium-row > td.ja-col-tracking {
    overflow: visible;
}

/* Colonne paiement : barre de progression compacte ; hint secondaire tronquable */
.ja-premium-table .ja-col-payment .ja-premium-progress--slim {
    max-width: 100%;
    margin-top: 0.2rem;
}

.ja-premium-table .ja-col-payment .ja-invoice-paid-hint {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Validité devis */
.ja-validity {
    font-size: 0.75rem;
    white-space: nowrap;
}

.ja-validity--ok {
    color: #4ade80;
}

.ja-validity--danger {
    color: #f87171;
    font-weight: 600;
}

.ja-validity--muted {
    color: var(--ja-premium-muted);
}

.ja-premium-table .fi-ta-header-cell,
.ja-data-table .fi-ta-header-cell {
    font-size: 0.65rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ja-premium-muted);
    font-weight: 600;
    border: none !important;
    background: transparent !important;
    padding: 0.35rem 0.65rem;
}

.ja-premium-table .fi-ta-header,
.ja-data-table .fi-ta-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--ja-premium-bg) !important;
}

.ja-premium-table .fi-ta-search-field input,
.ja-data-table .fi-ta-search-field input {
    border-radius: 10px;
}

/* Client : seul l’e-mail peut être tronqué (tooltip via title) */
@media (min-width: 1024px) {
    :is(.ja-premium-table, .ja-data-table) .ja-col-client .ja-col-email {
        display: block;
        max-width: 11rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Descriptions secondaires tronquables */
:is(.ja-premium-table, .ja-data-table) .ja-col-object .ja-premium-object,
:is(.ja-premium-table, .ja-data-table) .ja-col-desc {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 14rem;
}

/* Focus clavier actions ligne */
:is(.ja-premium-table, .ja-data-table) .fi-ta-actions .fi-icon-btn:focus-visible,
:is(.ja-premium-table, .ja-data-table) .fi-ta-actions .fi-btn:focus-visible {
    outline: 2px solid var(--jaos-primary);
    outline-offset: 2px;
}

.ja-premium-num {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--ja-premium-text);
    white-space: nowrap;
}

.ja-premium-ref {
    font-weight: 600;
    color: #60a5fa;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.ja-premium-client {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.ja-premium-avatar {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--jaos-primary);
    background: var(--ja-premium-gold-soft);
    border: 1px solid rgba(200, 156, 17, 0.25);
}

.ja-premium-client__name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ja-premium-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ja-premium-client__meta {
    font-size: 0.7rem;
    color: var(--ja-premium-muted);
}

@media (max-width: 1023px) {
    .ja-premium-client__meta {
        display: none;
    }
}

.ja-premium-object {
    font-size: 0.8rem;
    color: var(--ja-premium-muted);
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Carte client cliquable ── */
.ja-client-card__row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ja-client-card__link {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.4rem;
    margin: -0.4rem;
    border-radius: 0.6rem;
    text-decoration: none;
    transition: background 0.15s ease;
}

.ja-client-card__link:hover {
    background: var(--ja-premium-hover);
}

.ja-premium-panel__card .ja-premium-client .min-w-0 {
    display: flex;
    flex-direction: column;
}

.ja-premium-panel__card .ja-premium-client__meta {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ja-client-card__mail {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    color: var(--ja-premium-muted);
    transition: background 0.15s ease, color 0.15s ease;
}

.ja-client-card__mail:hover {
    background: var(--ja-premium-gold-soft);
    color: var(--jaos-primary);
}

/* ── Carte statut métier ── */
.ja-status-card__main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ja-status-card__label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ja-premium-text);
}

.ja-status-card--success .ja-status-card__label {
    color: #34d399;
}

.ja-status-card--warning .ja-status-card__label {
    color: #fbbf24;
}

.ja-status-card--danger .ja-status-card__label {
    color: #f87171;
}

.ja-status-card__sub {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--ja-premium-muted);
}

/* ── Bloc d'information avant envoi ── */
.ja-send-info {
    padding: 0.7rem 0.85rem;
    border-radius: 0.7rem;
    background: var(--ja-premium-hover);
    border: 1px solid var(--ja-premium-border);
    margin-bottom: 0.65rem;
}

.ja-send-info__title {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ja-premium-muted);
    margin-bottom: 0.4rem;
}

.ja-send-info__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ja-send-info__list li {
    position: relative;
    padding-left: 1.1rem;
    font-size: 0.78rem;
    color: var(--ja-premium-text);
}

.ja-send-info__list li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #34d399;
    font-weight: 700;
}

.ja-send-info__to {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.74rem;
    color: var(--jaos-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ja-send-info__warn {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.74rem;
    color: #f87171;
}

.ja-send-info__hint {
    margin: 0.35rem 0 0.65rem;
    font-size: 0.72rem;
    color: var(--ja-premium-muted);
    line-height: 1.45;
}

.ja-send-info__recipients {
    list-style: none;
    margin: 0 0 0.65rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ja-send-info__recipient {
    font-size: 0.78rem;
    color: var(--ja-premium-text);
    font-weight: 600;
}

.ja-send-info__recipient--cc span {
    font-weight: 500;
    color: var(--ja-premium-muted);
    font-size: 0.72rem;
}

.ja-send-info__client-link {
    margin-top: 0.35rem;
}

/* ── Badges ── */
.ja-premium-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    white-space: nowrap;
}

.ja-premium-badge--success {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.25);
}

.ja-premium-badge--info {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
}

.ja-premium-badge--deposit {
    color: #facc15;
    background: rgba(250, 204, 21, 0.12);
    border-color: rgba(250, 204, 21, 0.25);
}

.ja-premium-badge--warning {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.25);
}

.ja-premium-badge--danger {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
}

.ja-premium-badge--muted {
    color: var(--ja-premium-muted);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--ja-premium-border);
}

.ja-premium-badge--stripe {
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.3);
}

/* ── Progress ── */
.ja-premium-progress {
    height: 4px;
    border-radius: 999px;
    background: var(--ja-premium-border);
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.ja-premium-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--jaos-primary), #e8c547);
    border-radius: 999px;
    transition: width var(--ja-premium-transition);
}

.ja-premium-progress__label {
    font-size: 0.68rem;
    color: var(--ja-premium-muted);
}

.ja-premium-progress--slim {
    height: 3px;
    margin: 0.35rem 0 0.25rem;
}

/* ── Factures : cohérence paiement ── */
.ja-invoice-amounts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ja-invoice-amounts__total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ja-premium-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.ja-invoice-amounts__badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.ja-invoice-amounts__details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--ja-premium-border);
}

.ja-invoice-amounts__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    gap: 0.75rem;
}

.ja-invoice-amounts__row span:first-child {
    color: var(--ja-premium-muted);
}

.ja-invoice-amounts__paid {
    color: #4ade80;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ja-invoice-amounts__remaining {
    color: var(--jaos-primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ja-invoice-amounts__hint {
    margin: 0;
    font-size: 0.72rem;
    color: var(--ja-premium-muted);
}

.ja-invoice-paid-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--ja-premium-muted);
    margin-top: 0.15rem;
}

.ja-invoice-paid-hint--muted {
    color: var(--ja-premium-muted);
    font-style: normal;
}

.ja-invoice-paid-hint--success {
    color: #4ade80;
}

.ja-premium-num--paid {
    color: #4ade80;
}

.ja-invoice-due--late {
    color: #f87171;
    font-weight: 600;
}

.ja-premium-mobile-card__payment {
    padding: 0 0.25rem 0.5rem;
}

.ja-premium-panel__badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

/* Badges doubles : commercial + financier + source */
.ja-invoice-badges {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    align-items: center;
    max-width: 100%;
    overflow: hidden;
}

/* ── Résumé de statut hiérarchisé (facture > paiement > règlement) ── */
.ja-status-summary {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    max-width: 100%;
    min-width: 0;
}

.ja-status-summary__item {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.ja-status-line {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.ja-status-label {
    font-size: 0.75rem;
    color: var(--ja-premium-muted);
    white-space: normal;
    line-height: 1.2;
    word-break: break-word;
}

/* Statut facture = information principale, plus contrastée */
.ja-status-summary__item--primary .ja-status-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ja-premium-text);
}

.ja-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex-shrink: 0;
    background: var(--ja-premium-muted);
}

.ja-status-summary__item--primary .ja-status-dot {
    width: 9px;
    height: 9px;
}

/* Pastilles : couleurs déjà présentes dans le projet */
.ja-status-dot--success {
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18);
}

.ja-status-dot--warning {
    background: var(--jaos-primary);
    box-shadow: 0 0 0 3px rgba(200, 156, 17, 0.18);
}

.ja-status-dot--danger {
    background: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}

.ja-status-dot--info {
    background: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

.ja-status-dot--stripe {
    background: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}

.ja-status-dot--muted {
    background: var(--ja-premium-muted);
}

/* Catégories (mode détaillé : panneau) */
.ja-status-summary--detailed {
    gap: 0.55rem;
}

.ja-status-summary__cat {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ja-premium-muted);
    opacity: 0.75;
}

.ja-status-summary--detailed .ja-status-label {
    font-size: 0.8rem;
    color: var(--ja-premium-text);
}

.ja-premium-table .fi-ta-row > td .ja-invoice-badges .ja-premium-badge {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ja-badge--commercial {
    opacity: 0.85;
    font-size: 0.62rem !important;
    border-style: dashed !important;
}

.ja-badge--financial {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
}

.ja-badge--source {
    font-size: 0.62rem !important;
}

/* Section paiements / timeline */
.ja-payment-section__summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--ja-premium-border);
}

@media (max-width: 480px) {
    .ja-payment-section__summary {
        grid-template-columns: 1fr;
    }
}

.ja-payment-section__label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ja-premium-muted);
}

.ja-payment-section__value {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ja-premium-text);
}

.ja-payment-section__value--paid {
    color: #4ade80;
}

.ja-payment-section__stripe-hint {
    font-size: 0.72rem;
    color: var(--ja-premium-muted);
    margin: 0 0 0.65rem;
}

.ja-payment-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.ja-payment-timeline__item {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}

.ja-payment-timeline__item--empty {
    color: var(--ja-premium-muted);
    font-size: 0.8rem;
    padding: 0.5rem 0;
}

.ja-payment-timeline__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-top: 0.35rem;
    flex-shrink: 0;
}

.ja-payment-timeline__dot--stripe {
    background: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

.ja-payment-timeline__dot--manual {
    background: var(--ja-premium-muted);
}

.ja-payment-timeline__body {
    font-size: 0.8125rem;
    color: var(--ja-premium-text);
    min-width: 0;
}

.ja-payment-timeline__date {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ja-premium-muted);
    margin-bottom: 0.1rem;
}

.ja-payment-timeline__body strong {
    display: block;
    font-weight: 600;
}

.ja-payment-timeline__amount {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ja-premium-text);
    margin: 0.1rem 0;
}

.ja-payment-timeline__meta {
    display: block;
    font-size: 0.7rem;
    color: var(--ja-premium-muted);
    margin-top: 0.15rem;
}

.ja-payment-timeline__ref {
    display: block;
    font-size: 0.72rem;
    color: var(--ja-premium-muted);
    font-family: ui-monospace, monospace;
    margin-top: 0.1rem;
}

.ja-payment-timeline__note {
    font-style: italic;
}

.ja-payment-register {
    margin-bottom: 0.75rem;
}

.ja-payment-form-inline {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(124, 77, 255, 0.28);
}

.ja-payment-form-inline__title {
    margin: 0 0 0.15rem;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #c4b5fd;
}

.ja-payment-form-inline__field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ja-payment-form-inline__field label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ja-premium-muted);
}

.ja-payment-form-inline__field .fi-input {
    width: 100%;
    font-size: 0.82rem;
}

.ja-payment-form-inline__amount {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
}

.ja-payment-form-inline__amount .fi-input {
    flex: 1;
}

.ja-payment-form-inline__suffix {
    display: inline-flex;
    align-items: center;
    padding: 0 0.55rem;
    border-radius: 0.5rem;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: var(--ja-premium-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.ja-payment-form-inline__checks {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.1rem;
}

.ja-payment-form-inline__check {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.76rem;
    color: var(--ja-premium-text);
    cursor: pointer;
}

.ja-payment-form-inline__check input {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.ja-payment-form-inline__actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.15rem;
}

.ja-payment-form-inline__error {
    margin: 0;
    font-size: 0.68rem;
    color: #f87171;
}

.ja-track-badges {
    display: inline-flex;
    gap: 0.2rem;
    align-items: center;
    font-size: 0.95rem;
    line-height: 1;
}

.ja-track-badge {
    display: inline-flex;
    cursor: default;
}

.ja-track-badge--muted {
    color: var(--ja-premium-muted);
    font-size: 0.75rem;
}

.ja-client-tracking__steps {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.ja-client-tracking__step {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    font-size: 0.78rem;
    color: var(--ja-premium-text);
}

.ja-client-tracking__step strong {
    display: block;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.ja-client-tracking__step span {
    display: block;
    color: var(--ja-premium-muted);
    font-size: 0.72rem;
    line-height: 1.45;
}

.ja-client-tracking__icon {
    width: 1.35rem;
    flex-shrink: 0;
    text-align: center;
    font-size: 0.9rem;
}

.ja-client-tracking__step.is-pending strong {
    color: var(--ja-premium-muted);
}

.ja-client-tracking__step.is-error strong {
    color: #f87171;
}

.ja-client-tracking__step.is-progress strong {
    color: #fcd34d;
}

.ja-client-tracking__recipients {
    font-family: ui-monospace, monospace;
    font-size: 0.68rem !important;
}

.ja-client-tracking__history {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.ja-client-tracking__history h4 {
    margin: 0 0 0.45rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ja-premium-muted);
}

.ja-client-tracking__history ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ja-client-tracking__history li {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 0.45rem;
    font-size: 0.72rem;
}

.ja-client-tracking__history time {
    color: var(--ja-premium-muted);
    font-variant-numeric: tabular-nums;
}

.ja-client-tracking__rgpd {
    margin: 0.85rem 0 0;
    font-size: 0.66rem;
    line-height: 1.45;
    color: var(--ja-premium-muted);
    font-style: italic;
}

.ja-payment-register__settled {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.65rem;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.28);
    color: #6ee7b7;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* ── Detail panel ── */
.ja-premium-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.ja-premium-panel__head {
    padding: 0.9rem 2.5rem 0.9rem 1rem;
    border-bottom: 1px solid var(--ja-premium-border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
}

.ja-premium-panel__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ja-premium-text);
    margin: 0;
}

.ja-premium-panel__tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0 1rem;
    border-bottom: 1px solid var(--ja-premium-border);
    overflow-x: auto;
}

.ja-premium-panel__tab {
    padding: 0.55rem 0.65rem;
    font-size: 0.72rem;
    color: var(--ja-premium-muted);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.ja-premium-panel__tab--active {
    color: var(--jaos-primary);
    border-bottom-color: var(--jaos-primary);
}

.ja-premium-panel__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.9rem 1rem 1rem;
}

.ja-premium-panel__card {
    background: var(--ja-premium-surface-2);
    border: none;
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.65rem;
}

.ja-premium-panel__card-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ja-premium-muted);
    margin-bottom: 0.45rem;
}

.ja-premium-panel__row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.8rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ja-premium-panel__row:last-child {
    border-bottom: none;
}

.ja-premium-panel__row span:first-child {
    color: var(--ja-premium-muted);
}

.ja-premium-panel__row span:last-child {
    color: var(--ja-premium-text);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ja-premium-panel__total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--jaos-primary);
    margin-top: 0.25rem;
}

.ja-premium-panel__foot {
    flex-shrink: 0;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--ja-premium-border);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    background: var(--ja-premium-surface);
}

.ja-premium-panel__progress-block {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ja-premium-border);
}

.ja-premium-panel__progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--ja-premium-muted);
    margin-bottom: 0.35rem;
}

.ja-premium-panel__total {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--jaos-primary);
}

.ja-premium-btn--block {
    width: 100%;
}

.ja-premium-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.75rem;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--ja-premium-transition);
    border: 1px solid transparent;
    cursor: pointer;
    width: 100%;
}

.ja-premium-btn--primary {
    background: var(--jaos-primary);
    color: #0b0b0c;
}

.ja-premium-btn--primary:hover {
    filter: brightness(1.08);
}

.ja-premium-btn--ghost {
    background: transparent;
    border-color: var(--ja-premium-border);
    color: var(--ja-premium-text);
}

.ja-premium-btn--ghost:hover {
    border-color: rgba(200, 156, 17, 0.4);
    color: var(--jaos-primary);
}

.ja-premium-btn--accent {
    background: var(--ja-accent);
    color: #fff;
}

.ja-premium-btn--accent:hover {
    background: var(--ja-accent-hover);
}

.ja-payment-cell {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    max-width: 100%;
    min-width: 0;
    align-items: flex-end;
    text-align: right;
}

.ja-payment-cell__amounts {
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.ja-payment-cell__paid {
    color: var(--ja-premium-text);
    font-weight: 700;
}

.ja-payment-cell__paid--full {
    color: #4ade80;
}

.ja-payment-cell__sep,
.ja-payment-cell__total {
    color: var(--ja-premium-muted);
    font-weight: 500;
}

/* Barre de progression très discrète dans la cellule liste */
.ja-premium-progress--micro {
    height: 2px;
    width: 100%;
    max-width: 96px;
    margin: 0.15rem 0;
    opacity: 0.55;
}

.ja-payment-cell__status {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
}

.ja-payment-cell__status--paid {
    color: #4ade80;
}

.ja-payment-cell__status--partial {
    color: var(--jaos-primary);
}

.ja-payment-cell__status--unpaid {
    color: var(--ja-premium-muted);
}

.ja-payment-cell__source {
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ja-premium-muted);
    border: 1px solid var(--ja-premium-border);
    border-radius: 999px;
    padding: 0.05rem 0.4rem;
    margin-top: 0.1rem;
    white-space: nowrap;
}

.ja-premium-line-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ja-premium-line-items__row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--ja-premium-border);
    font-size: 0.8125rem;
}

.ja-premium-line-items__row:last-child {
    border-bottom: none;
}

/* ── Cartes mobile ── */
.ja-premium-mobile-card {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--ja-premium-border);
    border-radius: var(--ja-premium-radius);
    background: var(--ja-premium-surface);
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: border-color var(--ja-premium-transition), background var(--ja-premium-transition);
    -webkit-tap-highlight-color: transparent;
}

.ja-premium-mobile-card:active {
    transform: scale(0.992);
}

.ja-premium-mobile-card--active {
    border-color: rgba(200, 156, 17, 0.45);
    background: var(--ja-premium-gold-soft);
}

.ja-premium-mobile-card--empty {
    text-align: center;
    color: var(--ja-premium-muted);
    padding: 2rem 1rem;
    cursor: default;
}

.ja-premium-mobile-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

/* Statuts lisibles sur cartes : jamais de texte vertical ni badges tronqués */
.ja-premium-mobile-card .ja-status-summary {
    min-width: 0;
    max-width: 100%;
}

.ja-premium-mobile-card .ja-status-label {
    writing-mode: horizontal-tb;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.ja-premium-mobile-card .ja-status-line {
    flex-wrap: wrap;
}

.ja-premium-mobile-card .ja-payment-cell {
    max-width: 100%;
}

.ja-premium-mobile-card .ja-payment-cell__amounts,
.ja-premium-mobile-card .ja-payment-cell__status,
.ja-premium-mobile-card .ja-payment-cell__source {
    white-space: normal;
}

.ja-premium-mobile-card__client {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.5rem;
    min-width: 0;
}

.ja-premium-mobile-card__client-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ja-premium-text);
}

.ja-premium-mobile-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--ja-premium-muted);
    margin-bottom: 0.55rem;
}

.ja-premium-mobile-card__meta .ja-premium-num {
    font-size: 1rem;
    color: var(--jaos-primary);
}

.ja-premium-mobile-card__actions {
    display: flex;
    gap: 0.4rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--ja-premium-border);
}

.ja-premium-mobile-card__action-btn {
    flex: 1;
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--ja-premium-border);
    background: var(--ja-premium-surface-2);
    color: var(--ja-premium-text);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0 0.5rem;
}

/* ── Drawers ── */
.ja-premium-drawer {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    flex-direction: column;
}

.ja-premium-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    border: 0;
    cursor: pointer;
}

.ja-premium-drawer__panel {
    position: relative;
    z-index: 1;
    overflow: auto;
    background: var(--ja-premium-surface);
    border: 1px solid var(--ja-premium-border);
    animation: ja-drawer-in var(--ja-premium-transition) both;
}

.ja-premium-drawer__panel--tablet {
    margin-left: auto;
    width: min(88vw, 480px);
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 16px 0 0 16px;
    border-bottom: 1px solid var(--ja-premium-border);
    box-shadow: -16px 0 48px rgba(0, 0, 0, 0.5);
}

.ja-premium-drawer__panel--phone {
    margin-top: auto;
    max-height: 96dvh;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.5);
}

.ja-premium-drawer__handle {
    width: 2.5rem;
    height: 4px;
    border-radius: 999px;
    background: var(--ja-premium-border);
    margin: 0.65rem auto 0;
}

@keyframes ja-drawer-in {
    from {
        opacity: 0;
        transform: translateX(16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ja-premium-drawer__panel--phone {
    animation-name: ja-drawer-up;
}

@keyframes ja-drawer-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toolbar en mode cartes (< 1024px) : recherche + actions accessibles */
@media (max-width: 1023px) {
    .ja-premium-desktop-table .fi-ta-header-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.5rem;
        align-items: center;
    }

    .ja-premium-desktop-table .fi-ta-search-field {
        min-width: 0;
    }

    .ja-premium-desktop-table .fi-btn {
        min-height: 2.75rem;
    }
}

/* ── Formulaires (édition facture premium 2026) ── */
.ja-premium-form .fi-section,
.ja-premium-form .ja-form-card {
    border: 1px solid var(--ja-premium-border) !important;
    border-radius: 14px !important;
    background: var(--ja-premium-surface) !important;
    box-shadow: none !important;
}

/* En-tête de carte : icône + titre compacts */
.ja-premium-form .fi-section-header {
    padding: 0.85rem 1rem 0.5rem !important;
}

.ja-premium-form .fi-section-content {
    padding: 0.5rem 1rem 1rem !important;
}

.ja-premium-form .fi-section-header-icon,
.ja-premium-form .fi-section-header .fi-icon {
    color: var(--ja-accent);
}

.ja-premium-form .fi-section-header-heading {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Champs plus compacts et homogènes */
.ja-premium-form .fi-fo-field-wrp-label {
    font-size: 0.72rem;
    color: var(--ja-premium-muted);
}

.ja-premium-form .fi-input,
.ja-premium-form .fi-select-input,
.ja-premium-form .fi-fo-date-time-picker {
    border-radius: 9px;
}

/* ══════════════════════════════════════════════════════════════
   PRESTATIONS — cartes ergonomiques (devis & factures)
   ══════════════════════════════════════════════════════════════ */

/* Carte de prestation */
.ja-prestation-cards .fi-fo-repeater-item {
    border-radius: 14px !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    background: linear-gradient(170deg, rgba(30, 30, 50, 0.55), rgba(15, 15, 30, 0.35)) !important;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ja-prestation-cards .fi-fo-repeater-item:focus-within {
    border-color: rgba(124, 77, 255, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.1);
}

.ja-prestation-cards .fi-fo-repeater-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* En-tête de carte : numérotation automatique "Prestation #N" */
.ja-prestation-cards {
    counter-reset: ja-prestation;
}

.ja-prestation-cards .fi-fo-repeater-item-header {
    padding: 0.8rem 1rem !important;
    background: rgba(124, 77, 255, 0.06);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.ja-prestation-cards .fi-fo-repeater-item-header-label {
    font-weight: 700;
    font-size: 0.88rem;
}

.ja-prestation-cards .fi-fo-repeater-item-header-label::before {
    counter-increment: ja-prestation;
    content: "Prestation #" counter(ja-prestation) " · ";
    color: #a78bfa;
    font-weight: 800;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Corps de carte : respiration */
.ja-prestation-cards .fi-fo-repeater-item-content {
    padding: 1.1rem 1.15rem !important;
}

/* Champs confortables (desktop + tactile) */
.ja-prestation-cards .fi-input,
.ja-prestation-cards .fi-select-input {
    font-size: 0.92rem;
    min-height: 2.65rem;
}

.ja-prestation-cards textarea {
    font-size: 0.92rem;
    line-height: 1.55;
    min-height: 6.2rem;
    resize: vertical;
}

/* Options : pastilles cochables */
.ja-prestation-cards .fi-fo-checkbox-list-options {
    gap: 0.45rem;
}

.ja-prestation-cards label.fi-fo-checkbox-list-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(7, 7, 16, 0.35);
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
    width: 100%;
}

.ja-prestation-cards label.fi-fo-checkbox-list-option:hover {
    border-color: rgba(124, 77, 255, 0.4);
}

.ja-prestation-cards label.fi-fo-checkbox-list-option:has(input:checked) {
    border-color: rgba(124, 77, 255, 0.55);
    background: rgba(124, 77, 255, 0.12);
}

/* Total de ligne */
.ja-prestation-line-total {
    display: inline-flex;
    align-items: center;
    min-height: 2.65rem;
    padding: 0 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(124, 77, 255, 0.35);
    background: rgba(124, 77, 255, 0.1);
    font-size: 1.05rem;
    font-weight: 800;
    color: #c7d2fe;
    letter-spacing: -0.01em;
}

/* Actions de carte (dupliquer / déplacer / réduire / supprimer) */
.ja-prestation-cards .fi-fo-repeater-item-header .fi-icon-btn {
    width: 2.35rem;
    height: 2.35rem;
}

/* Bouton "Ajouter une prestation" : large et tactile */
.ja-prestation-cards .fi-fo-repeater-add .fi-btn {
    width: 100%;
    justify-content: center;
    min-height: 3rem;
    border-radius: 12px;
    border: 1px dashed rgba(124, 77, 255, 0.45);
    background: rgba(124, 77, 255, 0.06);
    font-weight: 700;
}

/* Récapitulatif financier sticky */
.ja-sticky-summary {
    position: sticky;
    top: 5rem;
    align-self: start;
}

@media (max-width: 1279px) {
    .ja-sticky-summary { position: static; }
}

/* Tablette / tactile : cibles plus grandes, aucune densité Excel */
@media (max-width: 1024px) {
    .ja-prestation-cards .fi-input,
    .ja-prestation-cards .fi-select-input {
        min-height: 3rem;
        font-size: 1rem;
    }

    .ja-prestation-cards textarea {
        min-height: 7rem;
        font-size: 1rem;
    }

    .ja-prestation-cards .fi-fo-repeater-item-header .fi-icon-btn {
        width: 2.75rem;
        height: 2.75rem;
    }

    .ja-prestation-cards label.fi-fo-checkbox-list-option {
        padding: 0.75rem 0.85rem;
    }

    .ja-prestation-cards label.fi-fo-checkbox-list-option input[type="checkbox"] {
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* ── Prestations : densité tableau (legacy, conservé pour autres tables) ── */
.ja-form-card--items .fi-fo-repeater-table thead th,
.ja-form-card--items table thead th {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ja-premium-muted);
    font-weight: 600;
    padding: 0.4rem 0.5rem;
}

.ja-form-card--items .fi-fo-repeater-table td,
.ja-form-card--items table td {
    padding: 0.3rem 0.45rem;
    vertical-align: top;
}

.ja-form-card--items .fi-input,
.ja-form-card--items .fi-select-input,
.ja-form-card--items textarea {
    font-size: 0.8rem;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

.ja-form-card--items .fi-fo-repeater-add-action,
.ja-form-card--items .fi-fo-repeater [class*="add"] .fi-btn {
    border-radius: 9px;
}

/* ── KPI Totaux ── */
.ja-kpi {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--ja-premium-border);
    border-radius: 12px;
    background: var(--ja-premium-surface-2);
    min-height: 100%;
}

.ja-kpi__label {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ja-premium-muted);
    font-weight: 600;
}

.ja-kpi__value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ja-premium-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.ja-kpi--accent {
    border-color: rgba(99, 102, 241, 0.45);
    background: linear-gradient(160deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.06));
}

.ja-kpi--accent .ja-kpi__value {
    font-size: 1.35rem;
    color: #c7d2fe;
}

/* ── Carte Paiement (édition) ── */
.ja-pay-kpi {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.ja-pay-kpi__amounts {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ja-premium-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.ja-pay-kpi__sep {
    color: var(--ja-premium-muted);
    font-weight: 500;
}

.ja-pay-kpi__line {
    font-size: 0.8rem;
    color: var(--jaos-primary);
    font-weight: 600;
}

.ja-pay-kpi__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ja-pay-kpi--empty {
    font-size: 0.8rem;
    color: var(--ja-premium-muted);
}

/* ── Bouton principal accent indigo ── */
.ja-premium-form .fi-btn.ja-btn-accent,
.fi-btn.ja-btn-accent {
    background: var(--ja-accent) !important;
    border-color: var(--ja-accent) !important;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35) !important;
}

.ja-premium-form .fi-btn.ja-btn-accent:hover,
.fi-btn.ja-btn-accent:hover {
    background: var(--ja-accent-hover) !important;
    border-color: var(--ja-accent-hover) !important;
}

/* Actions du formulaire alignées à droite, fond discret */
.ja-premium-form-sticky .fi-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--ja-premium-border);
    background: rgba(17, 18, 20, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.ja-premium-page-header .fi-header-heading {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ja-premium-page-header .fi-header-subheading {
    color: var(--ja-premium-muted);
    max-width: 52rem;
    font-size: 0.875rem;
}

@media (max-width: 767px) {
    .ja-premium-form .fi-section-content {
        grid-template-columns: 1fr !important;
    }

    .ja-premium-form .fi-form-actions .fi-btn {
        min-height: 2.75rem;
        flex: 1;
    }
}
