/* ============================================================================
   Wailo Admin : feuille de style du panel (chargée par le crochet panels::head.end d'AdminPanelProvider).
   Refonte de l'admin, lot A (CADRAGE.md du 29/10, maquettes validées par Vincent) : la charte de l'espace Entreprise
   (public/css/entreprise-custom.css), reprise pour l'admin. Mobile d'abord (390 px), puis ordinateur (1 024 px).
   Charte : Heebo ; bleu ardoise #5A7BA5 (actions) ; accent #4C89E3 ; titres navy #2C3E50 ; fond de page #F6F8FB ;
   cartes blanches au rayon 16 ; champs au rayon 14 ; boutons en pilules (rayon 9999) ; mode clair seulement.
   Les jetons --wz-* sont les MÊMES valeurs que côté Entreprise : une couleur ne se change qu'aux deux endroits à la fois.
   ============================================================================ */

:root {
    --wz-slate: #5A7BA5;
    --wz-slate-hover: #4A6A92;
    --wz-slate-soft: #E8F2FC;
    --wz-accent: #4C89E3;
    --wz-navy: #2C3E50;
    --wz-text: #1F2D3D;
    --wz-muted: #5F6E87;
    --wz-muted-light: #66758F;
    --wz-line: #E6EBF2;
    --wz-surface: #FFFFFF;
    --wz-surface-soft: #F6F8FB;
    --wz-danger: #D9534F;
    --wz-danger-text: #B42318;
    --wz-success: #1E7B3A;
    --wz-slate-strong: #3F6090;
    --wz-slate-line: #D3E3F7;
    --wz-danger-soft: #FDF2F2;
    --wz-danger-line: #F0C4C2;
    --wz-warning-bg: #FFF7ED;
    --wz-warning-line: #F3C58A;
    --wz-warning-text: #92400E;
    --wz-radius-card: 16px;
    --wz-radius-field: 14px;
    --wz-focus: 0 0 0 2px #fff, 0 0 0 4px var(--wz-slate);
    --wz-shadow-card: 0 1px 3px rgba(31, 45, 61, 0.05);
}

/* ---- Cadre général ---- */
[x-cloak] { display: none !important; }

html, body {
    font-family: Heebo, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--wz-text);
}
.fi-body {
    background: var(--wz-surface-soft);
}
/* Rien ne dépasse de l'écran : les grilles, les cartes et les tableaux se partagent la largeur disponible. */
.fi-layout, .fi-main-ctn, .fi-main, .fi-page, .fi-section, .fi-section-content, .fi-wi-widget, .fi-ta-ctn, .fi-in-entry,
.fi-fo-field-wrp, .fi-header, .fi-header-heading {
    min-width: 0;
    max-width: 100%;
}
.fi-main-ctn {
    overflow-x: clip;
}
.fi-header-heading {
    color: var(--wz-navy);
    font-weight: 800;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
}
.fi-header-subheading {
    color: var(--wz-muted);
}
.fi-section-header-heading, .fi-wi-stats-overview-stat-label, .fi-ta-header-heading {
    color: var(--wz-navy);
    font-weight: 700;
}

/* ---- Menu latéral : blanc, filet à droite, entrées arrondies, l'active sur fond bleu très clair ---- */
aside.fi-sidebar {
    background: var(--wz-surface);
    border-right: 1px solid var(--wz-line);
}
.fi-sidebar-header {
    background: var(--wz-surface);
    box-shadow: none;
    border-bottom: 1px solid var(--wz-line);
}
.fi-sidebar-header > div { flex: 1 1 auto; min-width: 0; }
.fi-sidebar-header > div > a { display: block; min-width: 0; }
.fi-sidebar-header .fi-logo { min-width: 0; max-width: 100%; }
.fi-sidebar-nav {
    padding-top: 16px;
}
.fi-sidebar-item-button {
    border-radius: 12px;
    padding: 10px 12px;
    transition: background .15s, color .15s;
}
.fi-sidebar-item-button:hover {
    background: var(--wz-surface-soft);
}
.fi-sidebar-item-label {
    color: var(--wz-navy);
    font-size: .95rem;
    font-weight: 500;
}
.fi-sidebar-item-icon {
    color: var(--wz-muted);
}
.fi-sidebar-item-active .fi-sidebar-item-button,
.fi-sidebar-item-active .fi-sidebar-item-button:hover {
    background: var(--wz-slate-soft);
}
.fi-sidebar-item-active .fi-sidebar-item-label {
    color: var(--wz-slate-strong);
    font-weight: 700;
}
.fi-sidebar-item-active .fi-sidebar-item-icon {
    color: var(--wz-slate-strong);
}
.fi-sidebar-item-button:focus-visible {
    outline: none;
    box-shadow: var(--wz-focus);
}

/* ---- La marque en haut à gauche : la pilule Wailo, un trait, « Admin » ---- */
.wz-marque { display: flex; align-items: center; gap: 12px; height: 100%; min-width: 0; max-width: 100%; }
.wz-marque-logo { display: block; flex: none; height: 100%; width: auto; }
.wz-marque-trait { flex: none; width: 1px; height: 60%; background: var(--wz-line); }
.wz-marque-espace {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--wz-navy); font-size: .95rem; font-weight: 700; line-height: 1.2;
}

/* ---- Barre du haut (sur téléphone : le bouton du menu, le compte) ---- */
.fi-topbar nav {
    background: var(--wz-surface);
    border-bottom: 1px solid var(--wz-line);
    box-shadow: none;
}
.fi-topbar-open-sidebar-btn, .fi-topbar-close-sidebar-btn {
    color: var(--wz-slate-strong);
}

/* ---- F7 (2.2.4) : version de Wailo en bas du menu ---- */
.wailo-version {
    margin-top: auto;
    padding: 14px 24px 18px;
    font-size: .74rem;
    line-height: 1.4;
    color: var(--wz-muted-light);
    text-align: left;
}
/* Téléphone (Chrome Android) : h-screen = 100vh dépasse la zone visible tant que la barre d'adresse est affichée, et la
   mention de version passe dessous. 100dvh suit la zone réellement visible. */
@supports (height: 100dvh) {
    aside.fi-sidebar {
        height: 100dvh;
    }
}

/* ---- Cartes : blanches, filet clair, rayon 16 ---- */
.fi-section, .fi-wi-stats-overview-stat, .fi-wi-chart, .fi-ta-ctn, .fi-fo-tabs, .fi-in-tabs, .fi-simple-main,
.fi-fo-wizard, .fi-wi-widget > .fi-section {
    background: var(--wz-surface);
    border: 1px solid var(--wz-line);
    border-radius: var(--wz-radius-card);
    box-shadow: var(--wz-shadow-card);
}
.fi-wi-stats-overview-stat-value {
    color: var(--wz-navy);
    font-weight: 800;
}
.fi-wi-stats-overview-stat-description {
    color: var(--wz-muted);
}

/* ---- Tableaux : dans leur boîte, défilement horizontal propre à la boîte, en-têtes discrets ---- */
.fi-ta-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.fi-ta-header-cell-label {
    color: var(--wz-muted);
    font-weight: 700;
    font-size: .8rem;
    text-transform: none;
}
.fi-ta-row:hover {
    background: var(--wz-surface-soft);
}
.fi-ta-text-item-label {
    color: var(--wz-text);
}
.fi-ta-header-ctn, .fi-ta-header-toolbar {
    border-color: var(--wz-line);
}

/* ---- Boutons : des pilules, à la largeur de leur texte ---- */
.fi-btn {
    border-radius: 9999px;
    min-height: 42px;
    padding-left: 20px;
    padding-right: 20px;
    font-family: inherit;
    font-weight: 700;
    box-shadow: none;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    -webkit-tap-highlight-color: transparent;
}
.fi-btn:focus-visible {
    outline: none;
    box-shadow: var(--wz-focus);
}
.fi-btn.fi-size-sm, .fi-btn.fi-size-xs {
    min-height: 36px;
    padding-left: 14px;
    padding-right: 14px;
}
.fi-btn.fi-color-primary {
    background: var(--wz-slate);
    color: #fff;
}
.fi-btn.fi-color-primary:hover {
    background: #6d8db3;
}
.fi-btn.fi-color-primary:active {
    background: var(--wz-slate-hover);
}
.fi-btn.fi-btn-outlined.fi-color-gray, .fi-btn.fi-color-gray {
    background: var(--wz-surface);
    color: var(--wz-slate-strong);
    border: 1px solid var(--wz-slate-line);
    --tw-ring-color: transparent;
    --tw-ring-shadow: 0 0 #0000;
}
.fi-btn.fi-color-gray:hover {
    background: var(--wz-slate-soft);
}
.fi-btn.fi-color-danger {
    background: var(--wz-danger);
    color: #fff;
}
.fi-btn.fi-color-danger:hover {
    background: #c9484a;
}
.fi-btn.fi-btn-outlined.fi-color-danger {
    background: transparent;
    color: var(--wz-danger-text);
    border-color: var(--wz-danger-line);
}
.fi-icon-btn {
    border-radius: 9999px;
    color: var(--wz-slate-strong);
}
.fi-icon-btn:focus-visible {
    outline: none;
    box-shadow: var(--wz-focus);
}
.fi-link.fi-color-primary {
    color: var(--wz-slate-strong);
}

/* ---- Champs : rayon 14, filet clair, anneau bleu ardoise au focus ---- */
.fi-input-wrp, .fi-select-input, .fi-input, .fi-fo-select .choices__inner, .fi-fo-textarea textarea {
    border-radius: var(--wz-radius-field);
}
.fi-input-wrp {
    background: var(--wz-surface);
    --tw-ring-color: var(--wz-line);
}
.fi-input-wrp:focus-within {
    --tw-ring-color: var(--wz-slate);
}
.fi-fo-field-wrp-label, .fi-in-entry-label {
    color: var(--wz-navy);
    font-weight: 600;
}
.fi-fo-field-wrp-hint, .fi-fo-field-wrp-helper-text {
    color: var(--wz-muted);
}

/* ---- Badges, menus déroulants, fenêtres, pagination ---- */
.fi-badge {
    border-radius: 9999px;
    font-weight: 700;
}
.fi-dropdown-panel {
    border-radius: 14px;
    border: 1px solid var(--wz-line);
    box-shadow: 0 10px 30px rgba(31, 45, 61, 0.12);
}
.fi-dropdown-list-item:hover {
    background: var(--wz-surface-soft);
}
.fi-modal-window {
    border-radius: var(--wz-radius-card);
}
.fi-modal-heading {
    color: var(--wz-navy);
    font-weight: 800;
}
.fi-pagination-item {
    border-radius: 9999px;
}
.fi-tabs {
    border-radius: 9999px;
}
.fi-tabs-item {
    border-radius: 9999px;
}
.fi-tabs-item-active {
    background: var(--wz-slate-soft);
    color: var(--wz-slate-strong);
}
.fi-no-notification { display: none; }

/* ---- Page de connexion : proche de l'application mobile ---- */
.fi-simple-layout {
    background: var(--wz-surface-soft);
}
.fi-simple-main {
    padding: 28px 24px;
}
.fi-simple-header-heading {
    color: var(--wz-navy);
    font-weight: 800;
}
.fi-simple-main-ctn form .fi-btn {
    width: 100%;
    min-height: 48px;
    border-radius: 9999px;
    background: var(--wz-slate);
    color: #fff;
    font-weight: 700;
}
.fi-simple-main-ctn form .fi-btn:hover {
    background: #6d8db3;
}

/* ---- Téléphone (jusqu'à 679 px) : titres plus petits, marges de 16 px, actions d'en-tête en colonne ---- */
@media (max-width: 679px) {
    .fi-main {
        padding-left: 16px;
        padding-right: 16px;
    }
    .fi-header-heading {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    .fi-header-actions {
        width: 100%;
    }
    .fi-header-actions .fi-btn {
        flex: 1 1 auto;
    }
    .fi-wi-stats-overview-stat-value {
        font-size: 1.6rem;
    }
    .fi-ta-header-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .fi-ta-header-toolbar .fi-ta-search-field {
        width: 100%;
    }
    .fi-ta-pagination {
        flex-wrap: wrap;
        gap: 8px;
    }
}
/* Sous 1 024 px, le menu est un volet (fermé au chargement) : le filet de droite n'a plus de raison d'être. */
@media (max-width: 1023px) {
    aside.fi-sidebar {
        border-right: 0;
        box-shadow: 0 10px 30px rgba(31, 45, 61, 0.16);
    }
}

/* ---- Ordinateur (dès 1 024 px) : le titre à 30 px comme sur les maquettes ---- */
@media (min-width: 1024px) {
    .fi-header-heading {
        font-size: 1.875rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fi-btn, .fi-sidebar-item-button { transition: none !important; }
}

/* ---- Lot C : fiche d'une entreprise (onglets, cartes, tableaux, menus « ⋯ ») ---- */
.wz-fiche-tete { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.wz-fiche-titres { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wz-fiche-fil { color: var(--wz-muted); font-size: 0.875rem; text-decoration: none; }
.wz-fiche-fil:hover { color: var(--wz-slate-hover); text-decoration: underline; }
.wz-fiche-sous { color: var(--wz-muted); margin: 0; }
.wz-fiche-pastilles { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; }
.wz-fiche-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wz-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 0.9375rem; text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.wz-btn-principal { background: var(--wz-slate); color: #fff; }
.wz-btn-principal:hover { background: var(--wz-slate-hover); }
.wz-btn-secondaire { background: var(--wz-surface); color: var(--wz-slate-strong); border-color: var(--wz-slate-line); }
.wz-btn-secondaire:hover { background: var(--wz-slate-soft); }
.wz-btn:focus-visible, .wz-ico-btn:focus-visible, .wz-onglet:focus-visible { outline: none; box-shadow: var(--wz-focus); }
.wz-ico-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--wz-slate-line); background: var(--wz-surface); color: var(--wz-slate-strong); cursor: pointer; }
.wz-ico-btn:hover { background: var(--wz-slate-soft); }
.wz-menu-wrap { position: relative; display: inline-block; }
.wz-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 270px; background: var(--wz-surface); border: 1px solid var(--wz-line); border-radius: 12px; box-shadow: 0 8px 24px rgba(31, 45, 61, 0.14); padding: 6px; display: flex; flex-direction: column; }
.wz-menu > button, .wz-menu > a { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 9px 12px; border-radius: 8px; background: none; border: 0; color: var(--wz-text); cursor: pointer; text-decoration: none; font: inherit; }
.wz-menu > button:hover, .wz-menu > a:hover { background: var(--wz-surface-soft); }
.wz-menu strong { font-weight: 600; }
.wz-menu span { color: var(--wz-muted); font-size: 0.8125rem; }
.wz-menu hr { border: 0; border-top: 1px solid var(--wz-line); margin: 4px 0; }
.wz-menu-danger strong { color: var(--wz-danger-text); }
.wz-pastille { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; }
.wz-pastille-ok { background: #E7F5EC; color: var(--wz-success); }
.wz-pastille-ko { background: var(--wz-danger-soft); color: var(--wz-danger-text); }
.wz-pastille-neutre { background: var(--wz-slate-soft); color: var(--wz-slate-strong); }
.wz-onglets { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--wz-line); }
.wz-onglet { background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--wz-muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.wz-onglet:hover { color: var(--wz-slate-hover); }
.wz-onglet-actif { color: var(--wz-slate-strong); border-bottom-color: var(--wz-slate); }
.wz-fiche-corps { display: flex; flex-direction: column; gap: 20px; }
.wz-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.wz-carte { background: var(--wz-surface); border: 1px solid var(--wz-line); border-radius: var(--wz-radius-card); box-shadow: var(--wz-shadow-card); padding: 18px 20px; }
.wz-carte-titre { margin: 0 0 6px; font-size: 0.875rem; font-weight: 600; color: var(--wz-muted); }
.wz-carte-grand { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--wz-navy); }
.wz-carte-sous { margin: 4px 0 0; color: var(--wz-text); }
.wz-carte-petit { margin: 6px 0 0; color: var(--wz-muted); font-size: 0.8125rem; }
.wz-carte-liste { margin: 0; padding-left: 18px; color: var(--wz-text); }
.wz-bloc { display: flex; flex-direction: column; gap: 12px; }
.wz-bloc-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.wz-bloc-titre { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--wz-navy); }
.wz-bloc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wz-sous-titre { margin: 0; color: var(--wz-muted); }
.wz-recherche { min-height: 40px; padding: 0 14px; border: 1px solid var(--wz-slate-line); border-radius: var(--wz-radius-field); background: var(--wz-surface); font: inherit; }
.wz-vide { color: var(--wz-muted); padding: 20px 0; margin: 0; }
.wz-lien { background: none; border: 0; padding: 0; color: var(--wz-slate-strong); font-weight: 600; cursor: pointer; text-decoration: none; font: inherit; font-weight: 600; }
.wz-lien:hover { text-decoration: underline; }
.wz-table-enveloppe { position: relative; overflow-x: auto; background: var(--wz-surface); border: 1px solid var(--wz-line); border-radius: var(--wz-radius-card); } /* Lot M2 : position relative, sinon le « Actions » lu par les lecteurs d'écran (wz-sr-only, absolu) sort de la boîte et élargit la page */
.wz-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.wz-table th { text-align: left; padding: 10px 14px; color: var(--wz-muted); font-size: 0.8125rem; font-weight: 600; border-bottom: 1px solid var(--wz-line); white-space: nowrap; }
.wz-table td { padding: 12px 14px; border-bottom: 1px solid var(--wz-line); vertical-align: top; }
.wz-table tr:last-child td { border-bottom: 0; }
.wz-col-menu { width: 1%; text-align: right; }
.wz-sous { display: block; color: var(--wz-muted); font-size: 0.8125rem; }
.wz-journal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wz-journal-date { color: var(--wz-muted); margin-right: 8px; font-variant-numeric: tabular-nums; }
.wz-liste-apercu { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.wz-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
@media (max-width: 640px) { .wz-menu { right: auto; left: 0; min-width: 240px; } .wz-fiche-actions { width: 100%; } }

/* ---- Lot M (02/11/2026) : listes Comptes et Entreprises en cartes sur téléphone (sous 768 px, le point de rupture md) ----
   La carte est une colonne Filament réservée au téléphone (hiddenFrom('md')) ; les autres colonnes n'existent qu'à partir
   de md (visibleFrom('md')) : l'ordinateur ne change pas. Sous md, sur ces deux listes (corps « wz-liste-cartes »), les
   en-têtes, la case de sélection et le menu d'actions de ligne sont masqués : toute la ligne ouvre la fiche. */
.wz-lc { display: flex; flex-direction: column; gap: 4px; width: 100%; min-width: 0; padding: 12px 16px; color: var(--wz-text); }
.wz-lc-haut { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wz-lc-nom { font-weight: 600; flex: 1 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.wz-lc-haut .fi-badge { flex-shrink: 0; }
.wz-lc-milieu { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 0.875rem; color: var(--wz-muted); }
.wz-lc-bas { font-size: 0.8125rem; color: var(--wz-muted-light); overflow-wrap: anywhere; }
.wz-lc-alerte { color: var(--wz-warning-text); font-weight: 600; }
.wz-lc-danger { color: var(--wz-danger-text); font-weight: 600; }
@media (max-width: 767px) {
    .wz-liste-cartes .fi-ta-table thead,
    .wz-liste-cartes .fi-ta-selection-cell,
    .wz-liste-cartes .fi-ta-actions-cell { display: none; }
    .wz-liste-cartes .fi-ta-table { table-layout: fixed; width: 100%; }
    .wz-liste-cartes .fi-ta-cell { padding: 0; }
}

/* ---- Lot M2 (02/11/2026) : le bouton « Retour » en haut des pages (crochet PAGE_START, App\Filament\Support\BoutonRetour) ----
   Rendu AVANT la section de la page (qui a 32 px de marge haute) : la zone remonte le titre de 24 px pour que le bouton
   reste collé au titre. Zone de toucher de 44 px de haut, flèche et texte en couleur primaire, discret. */
.wz-retour-zone { padding-top: 12px; margin-bottom: -24px; }
.wz-retour {
    display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 10px 0 2px; border-radius: 10px;
    color: var(--wz-slate-strong); font-size: 0.9375rem; font-weight: 600; line-height: 1; text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.wz-retour:hover { color: var(--wz-slate-hover); text-decoration: underline; }
.wz-retour:focus-visible { outline: none; box-shadow: var(--wz-focus); }
.wz-retour-fleche { width: 20px; height: 20px; flex: none; }

/* ---- Lot M2 (demande B3) : les tableaux .wz-tableau de la page Abonnements sur téléphone ----
   Sous md, les colonnes secondaires sont cachées dans la vue (« hidden md:table-cell ») et l'essentiel est rappelé en petit
   sous le compte (« md:hidden ») ; ici, seulement de quoi laisser une adresse mail longue se couper plutôt que déborder. */
@media (max-width: 767px) {
    .wz-tableau { width: 100%; table-layout: auto; }
    .wz-tableau th, .wz-tableau td { overflow-wrap: anywhere; }
    .wz-tableau td.pr-4, .wz-tableau th.pr-4 { padding-right: 0.5rem; }
}
