/* ================================================================
   AXEANE KOMPTA — LAYOUT
   ================================================================
   Containers, toolbars, spacing, scrollbar, alerts, empty states
   Source : EcranTableEntreprises .ent-container / .ent-toolbar
   ================================================================ */

/* ── Container principal ── */
.ax-container {
    font-family: var(--ax-font);
    background: var(--ax-body);
    color: var(--ax-text);
    position: relative;
    z-index: 1;
    height: 100%;
    width: calc(100% + 30px);
    display: flex;
    flex-direction: column;
    padding: 0;
    padding-bottom: 37px;  /* réserve l'espace pour la barre KPI fixed en bas */
    margin: 0 -15px;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* ── Toolbar ── */
/* ⚠️ height fixée à 46px — doit rester identique entre mode table et mode fiche
   pour que le basculement soit visuellement stable (pas de saut vertical). */
.ax-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 24px;
    height: 46px;
    min-height: 46px;
    margin-top: 0;
    margin-bottom: 0;
    margin-left: -15px;
    margin-right: -15px;
    background: var(--ax-card);
    border-bottom: 1px solid var(--ax-border-strong);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    gap: 10px;
    flex-wrap: nowrap;
    overflow: hidden;
    width: calc(100% + 30px);
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

/* ── Dans .ax-container, le container gère déjà la pleine largeur ── */
.ax-container .ax-toolbar {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* ── Dans un dialog/modal/popup, la toolbar reste inline ── */
md-dialog .ax-toolbar,
.modal .ax-toolbar,
.ax-toolbar.ax-toolbar-inline {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.ax-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ax-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
    margin-left: auto;
}

/* ── Dropdown dans toolbar — inline pour rester dans le flux flex ── */
.ax-toolbar-right > .dropdown,
.ax-toolbar-right > .dropup,
.ax-toolbar-left > .dropdown,
.ax-toolbar-left > .dropup {
    display: inline-block;
    position: relative;
}

/* ── md-switch compact inside toolbar / header-bar ── */
.ax-toolbar md-switch,
.ax-table-header-bar md-switch {
    margin: 0;
    min-height: auto;
}

/* ── nya-bs-select compact inside toolbar — même hauteur que .ax-btn ── */
.ax-toolbar .nya-bs-select .btn {
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    border-radius: var(--ax-radius-sm, 8px);
    height: auto;
}

/* ── Alert ── */
.ax-alert {
    margin: 16px 24px;
    padding: 10px 14px;
    border-radius: var(--ax-radius-sm);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ax-alert i {
    font-size: 14px;
    flex-shrink: 0;
}

.ax-alert-warning {
    background: var(--ax-warning-light);
    border: 1px solid var(--ax-warning-border);
    color: var(--ax-warning-text);
}

.ax-alert-warning i {
    color: var(--ax-warning);
}

.ax-alert-danger {
    background: var(--ax-danger-light);
    border: 1px solid var(--ax-danger-border);
    color: var(--ax-danger-text);
}

.ax-alert-danger i {
    color: var(--ax-danger);
}

.ax-alert-info {
    background: var(--ax-info-light);
    border: 1px solid var(--ax-info-border);
    color: var(--ax-info-text);
}

.ax-alert-info i {
    color: var(--ax-info);
}

.ax-alert-success {
    background: var(--ax-success-light);
    border: 1px solid var(--ax-success-border);
    color: var(--ax-success-text);
}

.ax-alert-success i {
    color: var(--ax-success);
}

/* ── Empty state ── */
.ax-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--ax-text-muted);
}

.ax-empty-state i {
    font-size: 32px;
    color: var(--ax-text-disabled);
    margin-bottom: 12px;
    display: block;
}

.ax-empty-state p {
    font-size: 13px;
    font-weight: 500;
    color: var(--ax-text-sec);
}

/* ── Scrollbar (thin, SaaS-like) ── */
.ax-scroll::-webkit-scrollbar {
    width: 4px;
}

.ax-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.ax-scroll::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 10px;
}

.ax-scroll::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* ================================================================
   FICHE / FORM PANEL (Fiche Entreprise, etc.)
   ================================================================ */

/* ── Panel wrapper (card contenant le formulaire) ── */
/* ⚠️ Les marges doivent rester identiques à .ax-table-wrapper (12px 32px 4px)
   pour que le basculement table ↔ fiche soit visuellement stable
   (pas de changement de largeur/position perçu par l'utilisateur). */
.ax-fiche-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 12px 32px 4px;
    background: var(--ax-card);
    border-radius: var(--ax-radius);
    box-shadow: var(--ax-shadow-md);
    border: 1px solid var(--ax-border);
    min-height: 0;
    overflow: hidden;
}

/* ── Panel header ── */
/* ⚠️ height fixée à 44px — doit rester identique à .ax-table-header-bar
   pour que le basculement table ↔ fiche soit visuellement stable. */
.ax-fiche-header {
    display: flex;
    align-items: center;
    padding: 10px 22px;
    height: 44px;
    min-height: 44px;
    background: var(--ax-card);
    border-bottom: 1.5px solid var(--ax-border-strong);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
    border-radius: var(--ax-radius) var(--ax-radius) 0 0;
    flex-shrink: 0;
}

.ax-fiche-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ax-text-strong);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ax-fiche-title > i {
    font-size: 15px;
    color: var(--ax-primary);
}

/* ── Panel body (contient le wizard, PAS de scroll ici) ── */
.ax-fiche-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #FBF8F8;
}

/* form inside fiche-body — must propagate flex */
.ax-fiche-body > form {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* ── Panel body scrollable (formulaires simples, sans wizard) ── */
.ax-fiche-body-scroll {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px 24px;
    min-height: 0;
    background: #FBF8F8;
}

.ax-fiche-body-scroll::-webkit-scrollbar { width: 4px; }
.ax-fiche-body-scroll::-webkit-scrollbar-track { background: transparent; }
.ax-fiche-body-scroll::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 10px; }
.ax-fiche-body-scroll::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* ── Anti-FOUC : masquer h3/section bruts avant init jQuery Steps ── */
.ax-fiche-body wizard > h3,
.ax-fiche-body wizard > section,
wizard > h3,
wizard > section,
.ax-fiche-body form wizard > h3,
.ax-fiche-body form wizard > section,
.wizard > .steps-wrapper > h3,
.wizard > .steps-wrapper > section {
    display: none !important;
}

/* ── Wizard : flex column, occupe tout l'espace ── */
.ax-fiche-body .wizard {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* steps-wrapper generated by directive — propagate flex */
.ax-fiche-body .wizard > .steps-wrapper {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Steps header — FIXE en haut */
.ax-fiche-body .wizard .steps-wrapper > .steps,
.ax-fiche-body .wizard > .steps {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* Content (.content.clearfix) — SEUL élément qui scrolle */
.ax-fiche-body .wizard .steps-wrapper > .content,
.ax-fiche-body .wizard > .content {
    flex: 1 1 0%;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
}

.ax-fiche-body .wizard .steps-wrapper > .content::-webkit-scrollbar,
.ax-fiche-body .wizard > .content::-webkit-scrollbar { width: 6px; }
.ax-fiche-body .wizard .steps-wrapper > .content::-webkit-scrollbar-track,
.ax-fiche-body .wizard > .content::-webkit-scrollbar-track { background: var(--ax-border-light); border-radius: 3px; }
.ax-fiche-body .wizard .steps-wrapper > .content::-webkit-scrollbar-thumb,
.ax-fiche-body .wizard > .content::-webkit-scrollbar-thumb { background: #C5CAE9; border-radius: 3px; }
.ax-fiche-body .wizard .steps-wrapper > .content::-webkit-scrollbar-thumb:hover,
.ax-fiche-body .wizard > .content::-webkit-scrollbar-thumb:hover { background: #7986CB; }

/* Actions (Précédent/Suivant) — FIXE en bas, style card — ULTRA-COMPACT */
.ax-fiche-body .wizard .steps-wrapper > .actions,
.ax-fiche-body .wizard > .actions {
    position: relative !important;
    bottom: auto !important;
    padding: 6px 16px;
    flex-shrink: 0;
    border: 1px solid var(--ax-border);
    border-top: 1px solid var(--ax-border-light, #F3F4F6);
    background: var(--ax-card);
    margin: 0 16px 6px 16px;
    border-radius: var(--ax-radius-sm, 8px);
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.02);
}

/* ── Pièce jointe z-index fix ── */
.ax-container .nax-piece-jointe {
    z-index: 11001 !important;
}
.ax-container .nax-piece-jointe-shadow {
    z-index: 11000 !important;
}
.ax-container .nax-piece-jointe-icon {
    z-index: 11001 !important;
}

/* ================================================================
   TABS BAR — Pill / Button style (comme Plan Comptable)
   Utilisé à l'intérieur de .ax-table-wrapper, entre le header et la table
   ================================================================ */
.ax-tabs-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--ax-card);
    border-bottom: 1px solid var(--ax-border);
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ax-tabs-bar::-webkit-scrollbar {
    height: 0;
    display: none;
}

.ax-tab-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    border: 1px solid transparent;
    background: transparent;
    transition: all 0.2s cubic-bezier(.4, 0, .2, 1);
    position: relative;
}

.ax-tab-item .tab-icon {
    font-size: 13px;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.ax-tab-item .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 700;
    background: #f3f4f6;
    color: #9ca3af;
    transition: all 0.2s ease;
}

.ax-tab-item:hover {
    color: var(--ax-primary-dark);
    background: #eef2ff;
    border-color: #c7d2fe;
}

.ax-tab-item:hover .tab-icon {
    opacity: 1;
    color: var(--ax-primary-dark);
}

.ax-tab-item:hover .tab-count {
    background: #e0e7ff;
    color: var(--ax-primary-dark);
}

.ax-tab-item.active {
    color: #fff;
    background: linear-gradient(135deg, var(--ax-primary) 0%, #6366f1 100%);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(var(--ax-primary-rgb), 0.30), 0 1px 3px rgba(var(--ax-primary-rgb), 0.15);
}

.ax-tab-item.active .tab-icon {
    opacity: 1;
    color: #fff;
}

.ax-tab-item.active .tab-count {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

/* Separator dot (optionnel) */
.ax-tab-separator {
    display: none;
}

/* ================================================================
   PAGINATION BAR — ref: grandLivre.js V2 (ax-table-footer)
   ================================================================ */
.ax-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    border-top: 1px solid var(--ax-border);
    background: #fafbfc;
    flex-shrink: 0;
    min-height: 38px;
    font-size: 12px;
    color: var(--ax-text-sec);
}

/* ── Page-size buttons (15 / 25 / 50) ── */
.ax-pagination .ax-page-size-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ax-text-sec);
}

.ax-pagination .ax-page-size-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ax-text-sec);
    white-space: nowrap;
}

.ax-pagination .ax-page-size-btn {
    min-width: 28px;
    height: 26px;
    border: 1px solid var(--ax-border-strong);
    border-radius: 4px;
    background: #fff;
    color: var(--ax-text-sec);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: var(--ax-tr);
    padding: 0 6px;
    font-family: var(--ax-font);
}

.ax-pagination .ax-page-size-btn:hover {
    background: var(--ax-border-light);
    color: var(--ax-text);
}

.ax-pagination .ax-page-size-btn.active {
    background: var(--ax-primary);
    color: #fff;
    border-color: var(--ax-primary-dark);
    box-shadow: 0 2px 6px rgba(var(--ax-primary-rgb), 0.3);
}

.ax-pagination .ax-page-size-total {
    font-size: 12px;
    color: var(--ax-text-muted);
    margin-left: 6px;
    white-space: nowrap;
}

/* ── Surcharge uib-pagination Bootstrap — ref V2 (ax-pg / ax-pg-text) ── */
.ax-pagination .pagination {
    margin: 0;
    margin-left: auto;
    padding: 0;
    display: flex;
    gap: 2px;
    align-items: center;
}

.ax-pagination .pagination > li > a,
.ax-pagination .pagination > li > span {
    border: 1px solid transparent;
    background: rgba(37, 99, 235, 0.06);
    color: var(--ax-primary);
    border-radius: var(--ax-radius-xs) !important;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    margin: 0;
    transition: var(--ax-tr);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    height: 28px;
    white-space: nowrap;
    gap: 4px;
    FONT-WEIGHT: 700;
}

.ax-pagination .pagination > li > a:hover {
    background: rgba(37, 99, 235, 0.12);
    color: var(--ax-primary-dark);
    border-color: transparent;
}

.ax-pagination .pagination > li.active > a,
.ax-pagination .pagination > li.active > a:hover,
.ax-pagination .pagination > li.active > a:focus,
.ax-pagination .pagination > li.active > span {
    background: var(--ax-primary);
    color: #fff;
    border-color: var(--ax-primary);
    box-shadow: 0 2px 6px rgba(var(--ax-primary-rgb), 0.3);
    z-index: 1;
}

.ax-pagination .pagination > li.disabled > a,
.ax-pagination .pagination > li.disabled > span {
    background: transparent;
    color: #9CA3AF;
    border-color: transparent;
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.ax-pagination .pagination > li:first-child > a,
.ax-pagination .pagination > li:first-child > span,
.ax-pagination .pagination > li:last-child > a,
.ax-pagination .pagination > li:last-child > span {
    border-radius: var(--ax-radius-xs) !important;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .ax-pagination {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

/* ================================================================
   KPI BADGES — barre de totaux / indicateurs en pied d'écran
   Style badge compact, inline, une seule ligne par indicateur
   ================================================================ */
.ax-kpi-row {
    display: flex;
    gap: 6px;
    padding: 3px 20%;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--ax-border, #E5E7EB);
    background: #f8fafc;
    min-height: 34px;
}

.ax-badge-kpi {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #dde1ea;
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 13px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    white-space: nowrap;
    min-height: 30px;
}

/* Fixed bottom variant */
.ax-kpi-row.ax-kpi-row-fixed {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .08);
}

/* Bande colorée à gauche */
.ax-badge-kpi::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 8px 0 0 8px;
}

.ax-badge-kpi.ax-badge-blue::before   { background: var(--ax-primary, rgb(63, 81, 181)); }
.ax-badge-kpi.ax-badge-green::before  { background: #2ecc71; }
.ax-badge-kpi.ax-badge-red::before    { background: #e74c3c; }
.ax-badge-kpi.ax-badge-purple::before { background: #9c27b0; }
.ax-badge-kpi.ax-badge-teal::before   { background: #00897b; }
.ax-badge-kpi.ax-badge-orange::before { background: #e67e22; }

.ax-badge-kpi-label {
    font-weight: 600;
    color: #000000;
    font-size: 13px;
}

.ax-badge-kpi-value {
    font-weight: 700;
    font-size: 14.5px;
    text-align: center;
}

/* Couleur de la valeur selon le type */
.ax-badge-blue .ax-badge-kpi-value   { color: var(--ax-primary, rgb(63, 81, 181)); }
.ax-badge-green .ax-badge-kpi-value  { color: #1a9d52; }
.ax-badge-red .ax-badge-kpi-value    { color: #d63031; }
.ax-badge-purple .ax-badge-kpi-value { color: #7b1fa2; }
.ax-badge-teal .ax-badge-kpi-value   { color: #00796b; }
.ax-badge-orange .ax-badge-kpi-value { color: #d35400; }

/* ── KPI badge icon (V2) ── */
.ax-badge-kpi-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.ax-badge-kpi.ax-badge-green .ax-badge-kpi-icon { background: rgba(46, 204, 113, 0.12); color: #1a9d52; }
.ax-badge-kpi.ax-badge-red .ax-badge-kpi-icon { background: rgba(231, 76, 60, 0.12); color: #d63031; }
.ax-badge-kpi.ax-badge-purple .ax-badge-kpi-icon { background: rgba(156, 39, 176, 0.12); color: #7b1fa2; }
.ax-badge-kpi.ax-badge-blue .ax-badge-kpi-icon { background: rgba(63, 81, 181, 0.12); color: var(--ax-primary); }
.ax-badge-kpi.ax-badge-teal .ax-badge-kpi-icon { background: rgba(0, 121, 107, 0.12); color: #00796b; }
.ax-badge-kpi.ax-badge-orange .ax-badge-kpi-icon { background: rgba(230, 126, 34, 0.12); color: #d35400; }

@media (max-width: 768px) {
    .ax-kpi-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ================================================================
   KPI STAT CARDS — Cards row (parametrageControle, contrôle fiscal)
   ================================================================
   Usage: <div class="ax-kpi-stats-row">
              <div class="ax-kpi-stat-card">
                  <div class="ax-kpi-stat-stripe" style="background:#2ecc71"></div>
                  <div class="ax-kpi-stat-head">
                      <span class="ax-kpi-stat-title">OK</span>
                      <div class="ax-kpi-stat-icon" style="background:rgba(46,204,113,0.1);color:#2ecc71"><i class="fa fa-check-circle"></i></div>
                  </div>
                  <div class="ax-kpi-stat-value" style="color:#1a9d52">{{value}}</div>
                  <div class="ax-kpi-stat-sub">Aucune anomalie</div>
              </div>
          </div>
   ================================================================ */
.ax-kpi-stats-row {
    display: flex;
    gap: 14px;
    padding: 16px 32px 0 32px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.ax-kpi-stat-card {
    flex: 1;
    min-width: 140px;
    background: var(--ax-card);
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--ax-border);
    position: relative;
    overflow: hidden;
}

.ax-kpi-stat-stripe {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 10px 0 0 10px;
}

.ax-kpi-stat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.ax-kpi-stat-title {
    font-size: 12px;
    color: var(--ax-text-sec);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ax-kpi-stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.ax-kpi-stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 2px;
}

.ax-kpi-stat-sub {
    font-size: 12px;
    color: var(--ax-text-light);
}

/* ================================================================
   STATUS DOT BADGE — pill with colored dot (OK / KO / Warning)
   ================================================================
   Usage: <span class="ax-status-badge ax-status-ok">
              <span class="ax-status-dot"></span> OK
          </span>
   ================================================================ */
.ax-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.ax-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.ax-status-ok {
    background: rgba(76, 175, 80, 0.1);
    color: #388e3c;
    border: 1px solid rgba(76, 175, 80, 0.3);
}
.ax-status-ok .ax-status-dot { background: #4caf50; }

.ax-status-ko {
    background: rgba(220, 38, 38, 0.1);
    color: #991B1B;
    border: 1px solid rgba(220, 38, 38, 0.3);
}
.ax-status-ko .ax-status-dot { background: #DC2626; }

.ax-status-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400E;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.ax-status-warning .ax-status-dot { background: #F59E0B; }

/* ================================================================
   MODULE BADGE — colored chip per module type
   ================================================================ */
.ax-module-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* ================================================================
   DETAIL EXPAND PANEL — row detail (contrôle fiscal, etc.)
   ================================================================
   Usage: <div class="ax-detail-panel">
              <div class="ax-detail-grid">
                  <div class="ax-detail-card">
                      <div class="ax-detail-card-label"><i class="fa fa-..."></i> Label</div>
                      <div class="ax-detail-card-value">Value</div>
                  </div>
              </div>
              <div class="ax-detail-alert ax-detail-alert-danger">
                  <div class="ax-detail-alert-head"><i class="fa fa-building-o"></i> Title</div>
                  <div class="ax-detail-tags"><span class="ax-detail-tag-danger">TAG</span></div>
              </div>
          </div>
   ================================================================ */
.ax-detail-panel {
    padding: 16px 24px;
    background: #f8f9fd;
    border-left: 3px solid var(--ax-primary);
    margin-left: 30px;
}

/* Grid layout — info cards side by side */
.ax-detail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.ax-detail-card {
    flex: 1;
    min-width: 160px;
    max-width: 100%;
    background: var(--ax-card);
    border: 1px solid var(--ax-border);
    border-radius: var(--ax-radius-xs);
    padding: 10px 14px;
    overflow: hidden;
}

.ax-detail-card-label {
    font-size: 12px;
    color: var(--ax-text-sec);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ax-detail-card-label i {
    font-size: 12px;
    opacity: 0.7;
}

.ax-detail-card-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--ax-text-bold);
    line-height: 1.4;
    word-break: break-word;
}

/* Alert-style block inside detail (entreprises KO, etc.) */
.ax-detail-alert {
    border-radius: var(--ax-radius-xs);
    padding: 10px 14px;
    margin-top: 10px;
}

.ax-detail-alert-danger {
    background: var(--ax-danger-light);
    border: 1px solid var(--ax-danger-border);
}

.ax-detail-alert-head {
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ax-detail-alert-danger .ax-detail-alert-head {
    color: var(--ax-danger-text);
}

.ax-detail-alert-danger .ax-detail-alert-head i {
    color: var(--ax-danger);
}

/* Legacy section (simple text blocks) */
.ax-detail-section {
    margin-bottom: 10px;
    color: var(--ax-text-body);
    line-height: 1.6;
    font-size: 12.5px;
}

.ax-detail-section:last-child {
    margin-bottom: 0;
}

.ax-detail-section strong {
    color: var(--ax-text-strong);
}

.ax-detail-label {
    font-weight: 600;
    color: var(--ax-text-body);
    margin-bottom: 6px;
}

.ax-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ax-detail-tag-danger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--ax-radius-pill);
    font-size: 11.5px;
    font-weight: 600;
    background: rgba(220, 38, 38, 0.08);
    color: var(--ax-danger-text);
    border: 1px solid var(--ax-danger-border);
}

/* Empty detail message */
.ax-detail-empty {
    color: var(--ax-text-light);
    font-style: italic;
    font-size: 12.5px;
}

/* ── Expanded row highlight ── */
.ax-row-expanded {
    background: var(--ax-primary-50, #E8EAF6) !important;
}

.ax-row-expanded td:first-child {
    border-left-color: var(--ax-primary, #3F51B5) !important;
}

/* ── Detail row (expand) ── */
.ax-detail-row {
    background: #FAFAFA !important;
}

.ax-detail-row:hover {
    background: #FAFAFA !important;
}

/* Status-colored left accent on detail panel */
.ax-detail-status-ok .ax-detail-panel {
    border-left-color: #4caf50;
}

.ax-detail-status-ko .ax-detail-panel {
    border-left-color: #DC2626;
}

.ax-detail-status-warn .ax-detail-panel {
    border-left-color: #F59E0B;
}

/* ================================================================
   Status-colored left stripe on detail panel / Column filter button
   ================================================================ */
.ax-col-filter-btn {
    background: none;
    border: 1px solid var(--ax-border);
    border-radius: 4px;
    padding: 2px 7px;
    cursor: pointer;
    font-size: 12px;
    color: var(--ax-text-sec);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    transition: var(--ax-tr-fast);
}

.ax-col-filter-btn:hover {
    border-color: var(--ax-primary-light);
    color: var(--ax-primary);
}

.ax-col-filter-btn.active {
    border-color: var(--ax-primary);
    color: var(--ax-primary);
    background: var(--ax-primary-50);
}

.ax-col-filter-btn .fa-filter {
    font-size: 10px;
}

.ax-col-filter-count {
    background: var(--ax-primary);
    color: #fff;
    border-radius: 50%;
    width: 15px;
    height: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
}

.ax-col-filter-dropdown {
    position: fixed;
    z-index: 9999;
    background: var(--ax-card);
    border: 1px solid var(--ax-border);
    border-radius: var(--ax-radius-xs);
    box-shadow: var(--ax-shadow-lg);
    min-width: 240px;
    padding: 6px 0;
}

.ax-col-filter-dropdown-head {
    padding: 4px 12px 6px;
    border-bottom: 1px solid var(--ax-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ax-col-filter-dropdown-head span {
    font-size: 12px;
    font-weight: 600;
    color: var(--ax-text-strong);
}

.ax-col-filter-dropdown-head a {
    font-size: 10px;
    color: var(--ax-primary);
    cursor: pointer;
    text-decoration: none;
}

.ax-col-filter-dropdown-item {
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    transition: background 0.15s;
}

.ax-col-filter-dropdown-item:hover {
    background: var(--ax-border-light);
}

.ax-col-filter-dropdown-item.selected {
    background: var(--ax-primary-50);
}

.ax-col-filter-dropdown-item .fa {
    font-size: 14px;
}

/* ================================================================
   FILTER SECTION — Collapsible filter panel (rapprochement, etc.)
   ================================================================ */
.ax-filter-section {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    background: var(--ax-card);
    border-bottom: 1px solid var(--ax-border);
}

.ax-filter-section.open {
    max-height: 600px;
    opacity: 1;
    padding: 16px 22px;
    overflow: visible;
}

.ax-filter-section.closed {
    max-height: 0;
    opacity: 0;
    padding: 0 22px;
}

.ax-filter-section .ax-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.ax-filter-section .ax-filter-grid > .ax-form-group-flex {
    min-width: 180px;
}

/* ── Bouton action dans la barre de filtres (ref: grandLivre.js V2) ── */
.ax-filter-group-btn {
    display: flex;
    align-items: flex-end;
    margin-left: auto;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0;
    padding-bottom: 0;
}

/* ── Filter section: UNIFORM 30px height on ALL inputs / selects / buttons ── */

/* 1) All form-control (text inputs, datepickers) */
.ax-filter-section .form-control,
.ax-filter-section .form-control.input-sm {
    height: 30px !important;
    max-height: 30px !important;
    min-height: 30px !important;
    font-size: 12px !important;
    padding: 3px 8px !important;
    line-height: 1.4 !important;
    box-sizing: border-box;
    border: 1px solid var(--ax-border-input, #d1d5db);
    border-radius: 5px !important;
}
/* 1b) Override Bootstrap table-cell + float inside flex input-group */
.ax-filter-section .input-group .form-control {
    display: block !important;
    float: none !important;
}
/* 1c) form-control inside input-group WITH addon btn: no right radius */
.ax-filter-section .input-group .form-control:first-child:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* 2) nya-bs-select <ol> — reset the btn-group wrapper itself */
.ax-filter-section ol.nya-bs-select,
.ax-filter-section ol.select-perso {
    margin: 0 !important;
    height: 30px !important;
    max-height: 30px !important;
    min-height: 30px !important;
}
.ax-filter-section ol.nya-bs-select.btn-group,
.ax-filter-section ol.select-perso.btn-group {
    height: 30px !important;
    max-height: 30px !important;
    min-height: 30px !important;
    display: flex !important;
    align-items: stretch;
}

/* 3) nya-bs-select dropdown-toggle button */
.ax-filter-section ol.select-perso button.dropdown-toggle,
.ax-filter-section ol.nya-bs-select button.dropdown-toggle {
    margin: 0 !important;
    padding: 3px 22px 3px 8px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid var(--ax-border-input, #d1d5db);
    border-radius: 5px;
    box-sizing: border-box;
    background: #fff;
}

/* 4) nya-bs-select inside input-group WITH adjacent btn — no right radius, flush */
/*    Only applies when the input-group explicitly has the .ax-flush-select class   */
.ax-filter-section .input-group.ax-flush-select ol.select-perso button.dropdown-toggle,
.ax-filter-section .input-group.ax-flush-select ol.nya-bs-select button.dropdown-toggle {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: none;
}

/* 5) input-group buttons (calendar, remove filter, etc.) */
.ax-filter-section .input-group .btn,
.ax-filter-section .input-group.input-group-sm .btn,
.ax-filter-section .input-group-btn .btn {
    height: 30px !important;
    max-height: 30px !important;
    min-height: 30px !important;
    padding: 3px 8px !important;
    font-size: 12px !important;
    box-sizing: border-box;
    line-height: 1.4;
}
/* 5b) Override Bootstrap table-cell on input-group-btn */
.ax-filter-section .input-group .input-group-btn {
    display: flex !important;
    float: none !important;
    width: auto;
}

/* 6) input-group itself — ensure flex stretch, strict 30px */
.ax-filter-section .input-group,
.ax-filter-section .input-group.input-group-sm {
    display: flex !important;
    align-items: stretch;
    height: 30px;
    max-height: 30px !important;
    min-height: 30px !important;
}
.ax-filter-section .input-group .form-control {
    flex: 1 1 auto;
}
.ax-filter-section .input-group ol.nya-bs-select,
.ax-filter-section .input-group ol.select-perso {
    flex: 1 1 auto;
    width: 100% !important;
}
.ax-filter-section .input-group ol.nya-bs-select button.dropdown-toggle,
.ax-filter-section .input-group ol.select-perso button.dropdown-toggle {
    width: 100% !important;
}

/* 7) Caret inside nya-bs-select — vertically centered */
.ax-filter-section ol.nya-bs-select .caret,
.ax-filter-section ol.select-perso .caret {
    margin-top: -2px;
}

/* 8) .ax-btn inside filter section — same 30px height as inputs/selects */
.ax-filter-section .ax-btn {
    height: 30px !important;
    max-height: 30px !important;
    min-height: 30px !important;
    padding: 3px 12px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    box-sizing: border-box;
}

/* 8b) Reset form-group-flex padding-bottom (from axeane-forms) inside filter section */
.ax-filter-section .ax-form-group-flex {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}
/* 8c) Reset form-row-flex margin-bottom inside filter section */
.ax-filter-section .ax-form-row-flex {
    margin-bottom: 0 !important;
}

/* 9) overflow visible for dropdowns within Bootstrap grid */
.ax-filter-section .row,
.ax-filter-section [class*="col-"] {
    overflow: visible;
}

/* ================================================================
   DIALOG — md-dialog Axeane overrides
   ================================================================ */
.ax-dialog {
    max-height: unset !important;
    max-width: unset !important;
}

.ax-dialog md-toolbar {
    background: linear-gradient(135deg, var(--ax-primary), #6366f1) !important;
    min-height: 52px;
}

.ax-dialog md-toolbar .md-toolbar-tools {
    font-size: 15px;
    font-weight: 700;
}

.ax-dialog md-toolbar .md-toolbar-tools h2 {
    font-size: 15px;
    font-weight: 700;
}

.ax-dialog md-content {
    background: #FBF8F8 !important;
    padding: 20px 24px;
}

.ax-dialog md-dialog-actions {
    padding: 12px 20px;
    border-top: 1px solid var(--ax-border);
    background: var(--ax-card);
    gap: 8px;
    display: flex;
    justify-content: flex-end;
}

/* ================================================================
   SOLDE SUMMARY TABLE — inline summary (rapprochement bancaire)
   ================================================================ */
.ax-solde-summary {
    background: var(--ax-card);
    border: 1px solid var(--ax-border);
    border-radius: var(--ax-radius-sm);
    overflow: hidden;
}

.ax-solde-summary table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12.5px;
}

.ax-solde-summary table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--ax-border-light);
    vertical-align: middle;
    color: var(--ax-text-body);
}

.ax-solde-summary table tr:last-child td {
    border-bottom: none;
}

/* ================================================================
   TOGGLE SWITCH — Green (like template-v-traitement-doc OCR toggle)
   ================================================================
   Usage: <div class="ax-toggle" ng-click="...">
              <div class="ax-toggle-track" ng-class="{'on': model}">
                  <div class="ax-toggle-thumb"></div>
              </div>
          </div>
   ================================================================ */
.ax-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.ax-toggle-track {
    width: 36px;
    height: 20px;
    border-radius: 12px;
    background: #D1D5DB;
    position: relative;
    transition: background 0.25s ease;
    flex-shrink: 0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ax-toggle-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ax-toggle-track.on {
    background: var(--ax-success, #4caf50);
}

.ax-toggle-track.on .ax-toggle-thumb {
    transform: translateX(16px);
}

/* ================================================================
   SCROLLBAR MODERNE — Firefox (scrollbar-width / scrollbar-color)
   ================================================================ */
.ax-table-body-scroll {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.ax-table-body-scroll:hover {
    scrollbar-color: #D1D5DB transparent;
}

/* Scrollbar toujours visible (Firefox) */
.ax-table-body-scroll.ax-scroll-always {
    scrollbar-color: #D1D5DB transparent;
}

.ax-table-scroll {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.ax-table-scroll:hover {
    scrollbar-color: #D1D5DB transparent;
}

/* ================================================================
   PROFIL SETTING ROW
   ================================================================ */
.ax-profil-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ax-border-light, #f0f0f5);
}

.ax-profil-setting-row:last-of-type {
    border-bottom: none;
}

.ax-profil-setting-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ax-text-body, #374151);
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════════
   WIZARD — Axeane Modern Override
   Scoped to .ax-fiche-body and .ax-table-zone
   ═══════════════════════════════════════════════════════════════════ */

/* Steps bar (tablist) */
.ax-fiche-body .wizard > .steps,
.ax-fiche-body .wizard > .steps-wrapper > .steps,
.ax-table-zone .wizard > .steps {
    background: var(--ax-card, #fff);
    border-bottom: 1px solid var(--ax-border, #E5E7EB);
    padding: 0 24px;
    border-radius: 0;
}

.ax-fiche-body .wizard > .steps > ul > li > a,
.ax-fiche-body .wizard > .steps-wrapper > .steps > ul > li > a,
.ax-table-zone .wizard > .steps > ul > li > a {
    color: var(--ax-text-sec, #9CA3AF);
    padding: 14px 0;
    font-size: 13px;
}

/* ── Number circle — centré via flexbox ── */
.ax-fiche-body .wizard > .steps > ul > li > a > .number,
.ax-fiche-body .wizard > .steps-wrapper > .steps > ul > li > a > .number,
.ax-table-zone .wizard > .steps > ul > li > a > .number {
    width: 32px;
    height: 32px;
    line-height: 32px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 50%;
    background: var(--ax-border-light, #F3F4F6);
    color: var(--ax-text-sec, #9CA3AF);
    border: 2px solid var(--ax-border, #E5E7EB);
    transition: all 0.2s;
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 auto;
}

.ax-fiche-body .wizard > .steps > ul > li > a > .title,
.ax-fiche-body .wizard > .steps-wrapper > .steps > ul > li > a > .title,
.ax-table-zone .wizard > .steps > ul > li > a > .title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ax-text-sec, #9CA3AF);
    transition: color 0.2s;
}

/* Current step */
.ax-fiche-body .wizard > .steps > ul > li.current > a > .number,
.ax-fiche-body .wizard > .steps-wrapper > .steps > ul > li.current > a > .number,
.ax-table-zone .wizard > .steps > ul > li.current > a > .number {
    background: var(--ax-primary, #3F51B5);
    color: #fff;
    border-color: var(--ax-primary, #3F51B5);
    font-size: 13px;
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.15);
}

.ax-fiche-body .wizard > .steps > ul > li.current > a > .number:after,
.ax-fiche-body .wizard > .steps-wrapper > .steps > ul > li.current > a > .number:after,
.ax-table-zone .wizard > .steps > ul > li.current > a > .number:after {
    content: none;
}

.ax-fiche-body .wizard > .steps > ul > li.current > a > .title,
.ax-fiche-body .wizard > .steps-wrapper > .steps > ul > li.current > a > .title,
.ax-table-zone .wizard > .steps > ul > li.current > a > .title {
    color: var(--ax-primary, #3F51B5);
}

.ax-fiche-body .wizard > .steps > ul > li.current > a,
.ax-fiche-body .wizard > .steps > ul > li.done > a,
.ax-table-zone .wizard > .steps > ul > li.current > a,
.ax-table-zone .wizard > .steps > ul > li.done > a {
    color: var(--ax-text-strong, #1F2937);
}

/* Done step — uses primary for consistency */
.ax-fiche-body .wizard > .steps > ul > li.done > a > .number,
.ax-fiche-body .wizard > .steps-wrapper > .steps > ul > li.done > a > .number,
.ax-table-zone .wizard > .steps > ul > li.done > a > .number {
    background: var(--ax-primary, #3F51B5);
    color: #fff;
    border-color: var(--ax-primary, #3F51B5);
    font-size: 0px;
}

.ax-fiche-body .wizard > .steps > ul > li.done > a > .number:after,
.ax-fiche-body .wizard > .steps-wrapper > .steps > ul > li.done > a > .number:after,
.ax-table-zone .wizard > .steps > ul > li.done > a > .number:after {
    font-family: "FontAwesome";
    content: "\f00c";
    font-size: 13px;
    color: #fff;
}

.ax-fiche-body .wizard > .steps > ul > li.done > a > .title,
.ax-fiche-body .wizard > .steps-wrapper > .steps > ul > li.done > a > .title,
.ax-table-zone .wizard > .steps > ul > li.done > a > .title {
    color: var(--ax-primary, #3F51B5);
}

/* ── Connector lines — cohérentes primary palette ── */
@media (min-width: 768px) {
    /* Default (future) = gris */
    .ax-fiche-body .wizard > .steps > ul > li > a:after,
    .ax-fiche-body .wizard > .steps-wrapper > .steps > ul > li > a:after,
    .ax-table-zone .wizard > .steps > ul > li > a:after {
        background: var(--ax-border, #E5E7EB) !important;
        background-image: none !important;
        height: 2px;
        top: 30px !important;
        bottom: auto !important;
    }
    /* Done = solid primary */
    .ax-fiche-body .wizard > .steps > ul > li.done > a:after,
    .ax-fiche-body .wizard > .steps-wrapper > .steps > ul > li.done > a:after,
    .ax-table-zone .wizard > .steps > ul > li.done > a:after {
        background: var(--ax-primary, #3F51B5) !important;
        background-image: none !important;
    }
    /* Current = primary → gris */
    .ax-fiche-body .wizard > .steps > ul > li.current > a:after,
    .ax-fiche-body .wizard > .steps-wrapper > .steps > ul > li.current > a:after,
    .ax-table-zone .wizard > .steps > ul > li.current > a:after {
        background: linear-gradient(to right, var(--ax-primary, #3F51B5), var(--ax-border, #E5E7EB)) !important;
    }
    /* Current first-child */
    .ax-fiche-body .wizard > .steps > ul > li.current:first-child > a:after,
    .ax-fiche-body .wizard > .steps-wrapper > .steps > ul > li.current:first-child > a:after,
    .ax-table-zone .wizard > .steps > ul > li.current:first-child > a:after {
        background: linear-gradient(to right, var(--ax-primary, #3F51B5), var(--ax-border, #E5E7EB)) !important;
    }
}

/* Error step */
.ax-fiche-body .wizard > .steps > ul > li.error > a > .number,
.ax-table-zone .wizard > .steps > ul > li.error > a > .number {
    background: #DC2626;
    color: #fff;
    border-color: #DC2626;
    font-size: 0px;
}

.ax-fiche-body .wizard > .steps > ul > li.error > a > .number:after,
.ax-table-zone .wizard > .steps > ul > li.error > a > .number:after {
    font-family: "FontAwesome";
    content: "\f00d";
    font-size: 13px;
    color: #fff;
}

.ax-fiche-body .wizard > .steps > ul > li.error > a > .title,
.ax-table-zone .wizard > .steps > ul > li.error > a > .title {
    color: #DC2626;
}

.ax-fiche-body .wizard > .steps > ul > li.error > a:after,
.ax-table-zone .wizard > .steps > ul > li.error > a:after {
    background: #DC2626 !important;
    background-image: none !important;
}

/* Content area — NO min-height */
.ax-fiche-body .wizard > .content,
.ax-fiche-body .wizard .steps-wrapper > .content,
.ax-table-zone .wizard > .content {
    background: var(--ax-card, #fff);
    border: none;
    padding: 0;
    min-height: 0 !important;
    flex: 1 1 0%;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: none !important;
    height: auto !important;
}

.ax-fiche-body .wizard > .content > .body,
.ax-fiche-body .wizard .steps-wrapper > .content > .body,
.ax-table-zone .wizard > .content > .body {
    padding: 20px 24px;
}

/* Actions bar — pinned at bottom, ultra-compact modern style */
.ax-fiche-body .wizard > .actions,
.ax-fiche-body .wizard > .steps-wrapper > .actions,
.ax-fiche-body .wizard .steps-wrapper > .actions,
.ax-table-zone .wizard > .actions {
    background: var(--ax-card, #fff);
    padding: 6px 16px !important;
    margin: 0 16px 6px 16px !important;
    border-radius: var(--ax-radius-sm, 8px);
    flex-shrink: 0;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--ax-border, #E5E7EB);
    border-top-color: var(--ax-border-light, #F3F4F6);
}

/* Actions ul — use flex for proper alignment */
.ax-fiche-body .wizard .actions > ul,
.ax-table-zone .wizard .actions > ul {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding-right: 60px; /* reserve space so 'Suivant' button stays left of Crisp bubble */
}

.ax-fiche-body .wizard .actions > ul > li,
.ax-table-zone .wizard .actions > ul > li {
    float: none !important;
}

.ax-fiche-body .wizard > .actions > ul > li > a,
.ax-fiche-body .wizard > .actions > ul > li > .btn,
.ax-fiche-body .wizard .steps-wrapper > .actions > ul > li > a,
.ax-fiche-body .wizard .steps-wrapper > .actions > ul > li > .btn,
.ax-table-zone .wizard > .actions > ul > li > a,
.ax-table-zone .wizard > .actions > ul > li > .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: var(--ax-radius-sm, 8px);
    border: 1px solid var(--ax-primary, #3F51B5);
    background: var(--ax-primary, #3F51B5);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(.4, 0, .2, 1);
    text-decoration: none;
    line-height: 1.5;
}

.ax-fiche-body .wizard > .actions > ul > li > a:hover,
.ax-fiche-body .wizard > .actions > ul > li > .btn:hover,
.ax-fiche-body .wizard .steps-wrapper > .actions > ul > li > a:hover,
.ax-fiche-body .wizard .steps-wrapper > .actions > ul > li > .btn:hover,
.ax-table-zone .wizard > .actions > ul > li > a:hover,
.ax-table-zone .wizard > .actions > ul > li > .btn:hover {
    background: var(--ax-primary-hover, #303F9F);
    border-color: var(--ax-primary-hover, #303F9F);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(63, 81, 181, 0.25);
}

/* Active press — Suivant / Précédent */
.ax-fiche-body .wizard > .actions > ul > li > a:active,
.ax-fiche-body .wizard > .actions > ul > li > .btn:active,
.ax-fiche-body .wizard .steps-wrapper > .actions > ul > li > a:active,
.ax-fiche-body .wizard .steps-wrapper > .actions > ul > li > .btn:active,
.ax-table-zone .wizard > .actions > ul > li > a:active,
.ax-table-zone .wizard > .actions > ul > li > .btn:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 1px 3px rgba(63, 81, 181, 0.15);
    transition-duration: 0.08s;
}

/* Previous button — outline */
.ax-fiche-body .wizard > .actions > ul > li:first-child > a,
.ax-fiche-body .wizard > .actions > ul > li:first-child > .btn,
.ax-fiche-body .wizard .steps-wrapper > .actions > ul > li:first-child > a,
.ax-fiche-body .wizard .steps-wrapper > .actions > ul > li:first-child > .btn,
.ax-table-zone .wizard > .actions > ul > li:first-child > a,
.ax-table-zone .wizard > .actions > ul > li:first-child > .btn {
    background: transparent;
    color: var(--ax-primary, #3F51B5);
    border: 1px solid var(--ax-primary, #3F51B5);
}

.ax-fiche-body .wizard > .actions > ul > li:first-child > a:hover,
.ax-fiche-body .wizard > .actions > ul > li:first-child > .btn:hover,
.ax-fiche-body .wizard .steps-wrapper > .actions > ul > li:first-child > a:hover,
.ax-fiche-body .wizard .steps-wrapper > .actions > ul > li:first-child > .btn:hover,
.ax-table-zone .wizard > .actions > ul > li:first-child > a:hover,
.ax-table-zone .wizard > .actions > ul > li:first-child > .btn:hover {
    background: var(--ax-primary-50, rgba(63, 81, 181, 0.08));
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(63, 81, 181, 0.12);
}

/* Disabled action */
.ax-fiche-body .wizard > .actions > ul > li.disabled > a,
.ax-fiche-body .wizard > .actions > ul > li.disabled > .btn,
.ax-fiche-body .wizard .steps-wrapper > .actions > ul > li.disabled > a,
.ax-fiche-body .wizard .steps-wrapper > .actions > ul > li.disabled > .btn,
.ax-table-zone .wizard > .actions > ul > li.disabled > a,
.ax-table-zone .wizard > .actions > ul > li.disabled > .btn {
    background: var(--ax-border-light, #F3F4F6) !important;
    color: var(--ax-text-sec, #9CA3AF) !important;
    border-color: var(--ax-border, #E5E7EB) !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════════
   MD-CHECKBOX — Ultra-Modern Override (Centered icon fix)
   ═══════════════════════════════════════════════════════════════════ */
.ax-fiche-body md-checkbox {
    margin-bottom: 4px;
    cursor: pointer;
    min-height: 28px;
    display: flex;
    align-items: center;
}

.ax-fiche-body md-checkbox ._md-container,
.ax-fiche-body md-checkbox .md-container {
    width: 18px;
    height: 18px;
    top: 50%;
    transform: translateY(-50%);
    position: absolute;
    left: 0;
}

.ax-fiche-body md-checkbox ._md-icon,
.ax-fiche-body md-checkbox .md-icon {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid #CBD5E1;
    background: #fff;
    transition: all .2s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ax-fiche-body md-checkbox:not([disabled]):hover ._md-icon,
.ax-fiche-body md-checkbox:not([disabled]):hover .md-icon {
    border-color: var(--ax-primary, #3F51B5);
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.08);
    transform: none;
}

.ax-fiche-body md-checkbox.md-checked ._md-icon,
.ax-fiche-body md-checkbox.md-checked .md-icon {
    background: linear-gradient(135deg, var(--ax-primary, #3F51B5) 0%, var(--ax-primary-dark, #303F9F) 100%);
    border-color: var(--ax-primary, #3F51B5);
    box-shadow: 0 1px 3px rgba(63, 81, 181, 0.2);
}

.ax-fiche-body md-checkbox.md-checked ._md-icon:after,
.ax-fiche-body md-checkbox.md-checked .md-icon:after {
    border-color: #fff;
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -55%) rotate(45deg);
    width: 5px;
    height: 10px;
    border-width: 0 2px 2px 0;
    border-style: solid;
    margin: 0;
}

.ax-fiche-body md-checkbox ._md-label,
.ax-fiche-body md-checkbox .md-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ax-text-body, #374151);
    margin-left: 28px;
    transition: color .15s ease;
}

.ax-fiche-body md-checkbox.md-checked ._md-label,
.ax-fiche-body md-checkbox.md-checked .md-label {
    color: var(--ax-text-strong, #1F2937);
    font-weight: 600;
}

.ax-fiche-body md-checkbox.md-focused:not([disabled]) ._md-container:before,
.ax-fiche-body md-checkbox.md-focused:not([disabled]) .md-container:before {
    background: rgba(63, 81, 181, 0.06);
    border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════════════
   TREE COMPONENT — Modern droits tree
   ═══════════════════════════════════════════════════════════════════ */
.ax-fiche-body .nax-tree-component {
    border: 1px solid var(--ax-border, #E5E7EB);
    border-radius: var(--ax-radius, 12px);
    background: var(--ax-card, #fff);
    padding: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    overflow: hidden; /* clip inner tree-lines to parent radius */
}

.ax-fiche-body .nax-tree-line {
    padding: 6px 14px;
    border-bottom: 1px solid var(--ax-border-light, #F3F4F6);
    transition: background 0.15s ease;
    border-left: 3px solid transparent;
}

.ax-fiche-body .nax-tree-line:hover {
    background: rgba(63, 81, 181, 0.03);
    border-left-color: rgba(63, 81, 181, 0.25);
}

.ax-fiche-body .nax-tree-line:last-child {
    border-bottom: none;
}

/* ── Tree toggle icon buttons (plus-box / minus-box SVG) — animation ── */
.ax-fiche-body .nax-tree-line .md-button.md-icon-button {
    transition: background 0.2s ease, transform 0.2s cubic-bezier(.4, 0, .2, 1), box-shadow 0.2s ease;
    border-radius: 6px;
}

.ax-fiche-body .nax-tree-line .md-button.md-icon-button:hover {
    background: rgba(63, 81, 181, 0.1);
    transform: scale(1.12);
    box-shadow: 0 2px 6px rgba(63, 81, 181, 0.15);
}

.ax-fiche-body .nax-tree-line .md-button.md-icon-button:active {
    transform: scale(0.92);
    transition-duration: 0.08s;
}

.ax-fiche-body .nax-tree-line .md-button.md-icon-button md-icon {
    transition: color 0.2s ease;
}

.ax-fiche-body .nax-tree-sub-lines-container {
    padding-left: 32px;
    margin-top: 4px;
    border-left: 2px solid var(--ax-border-light, #E8EAF6);
    margin-left: 16px;
}

.ax-fiche-body .nax-tree-sub-line {
    padding: 3px 0;
    line-height: normal;
    height: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   MD-ICON-BUTTON — Fix icon centering (global in ax-fiche-body)
   ═══════════════════════════════════════════════════════════════════ */
.ax-fiche-body .md-button.md-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.ax-fiche-body .md-button.md-icon-button md-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    position: static;
    top: auto;
    left: auto;
    transform: none;
}

/* ═══════════════════════════════════════════════════════════════════
   MULTI-ITEM SELECTOR — Modern
   ═══════════════════════════════════════════════════════════════════ */
.ax-fiche-body .nax-multi-item-selector-container,
.ax-table-zone .nax-multi-item-selector-container {
    display: flex;
    gap: 0;
    align-items: stretch;
}

.ax-fiche-body .nax-multi-item-selector-producer,
.ax-fiche-body .nax-multi-item-selector-consumer,
.ax-table-zone .nax-multi-item-selector-producer,
.ax-table-zone .nax-multi-item-selector-consumer {
    border: 1px solid var(--ax-border, #E5E7EB);
    border-radius: var(--ax-radius, 12px);
    overflow: hidden;
    overflow-x: hidden;
    float: none;
    flex: 1;
    min-height: 260px;
    background: var(--ax-card, #fff);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 0 1px rgba(0,0,0,0.06);
    transition: box-shadow 0.25s cubic-bezier(.4, 0, .2, 1),
                border-color 0.25s cubic-bezier(.4, 0, .2, 1);
}

.ax-fiche-body .nax-multi-item-selector-producer:hover,
.ax-fiche-body .nax-multi-item-selector-consumer:hover,
.ax-table-zone .nax-multi-item-selector-producer:hover,
.ax-table-zone .nax-multi-item-selector-consumer:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
    border-color: rgba(63, 81, 181, 0.18);
}

.ax-fiche-body .nax-multi-item-selector-panel-title,
.ax-table-zone .nax-multi-item-selector-panel-title {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 0;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

/* Gradient overlay for panel titles */
.ax-fiche-body .nax-multi-item-selector-panel-title::before,
.ax-table-zone .nax-multi-item-selector-panel-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 60%);
    pointer-events: none;
}

.ax-fiche-body .nax-multi-item-selector-producer-item,
.ax-table-zone .nax-multi-item-selector-producer-item {
    padding: 9px 16px;
    font-size: 13px;
    color: var(--ax-text-body, #374151);
    border-bottom: 1px solid var(--ax-border-light, #F3F4F6);
    transition: background 0.2s cubic-bezier(.4, 0, .2, 1),
                color 0.2s cubic-bezier(.4, 0, .2, 1),
                border-left-color 0.2s cubic-bezier(.4, 0, .2, 1);
    cursor: pointer;
    position: relative;
    border-left: 3px solid transparent;
}

.ax-fiche-body .nax-multi-item-selector-producer-item:hover,
.ax-table-zone .nax-multi-item-selector-producer-item:hover {
    background: rgba(63, 81, 181, 0.06);
    border-left-color: var(--ax-primary, #3F51B5);
    color: var(--ax-primary, #3F51B5);
}

.ax-fiche-body .nax-multi-item-selector-producer-item-active,
.ax-table-zone .nax-multi-item-selector-producer-item-active {
    background: rgba(63, 81, 181, 0.08) !important;
    color: var(--ax-primary, #3F51B5);
    font-weight: 600;
    border-left: 3px solid var(--ax-primary, #3F51B5);
}

.ax-fiche-body .nax-multi-item-selector-intermediate,
.ax-table-zone .nax-multi-item-selector-intermediate {
    float: none;
    width: 60px;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 0;
}

.ax-fiche-body .nax-multi-item-selector-intermediate .md-button.md-icon-button,
.ax-table-zone .nax-multi-item-selector-intermediate .md-button.md-icon-button {
    margin: 3px 0;
    border: 1.5px solid var(--ax-border, #E5E7EB);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    line-height: 38px;
    padding: 0;
    background: var(--ax-card, #fff);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ax-fiche-body .nax-multi-item-selector-intermediate .md-button.md-icon-button md-icon,
.ax-table-zone .nax-multi-item-selector-intermediate .md-button.md-icon-button md-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    position: static;
    transform: none;
}

.ax-fiche-body .nax-multi-item-selector-intermediate .md-button.md-icon-button:hover,
.ax-table-zone .nax-multi-item-selector-intermediate .md-button.md-icon-button:hover {
    background: var(--ax-primary, #3F51B5);
    border-color: var(--ax-primary, #3F51B5);
    box-shadow: 0 3px 8px rgba(63, 81, 181, 0.25);
    transform: scale(1.06);
}

.ax-fiche-body .nax-multi-item-selector-intermediate .md-button.md-icon-button:active,
.ax-table-zone .nax-multi-item-selector-intermediate .md-button.md-icon-button:active {
    transform: scale(0.96);
    transition-duration: 0.08s;
}

.ax-fiche-body .nax-multi-item-selector-intermediate .md-button.md-icon-button:hover md-icon,
.ax-table-zone .nax-multi-item-selector-intermediate .md-button.md-icon-button:hover md-icon {
    color: #fff;
    fill: #fff;
}

.ax-fiche-body .nax-multi-item-selector-intermediate-spacer,
.ax-table-zone .nax-multi-item-selector-intermediate-spacer {
    display: none;
}

.ax-fiche-body .nax-multi-item-selector-search,
.ax-table-zone .nax-multi-item-selector-search {
    height: auto;
}

.ax-fiche-body .nax-multi-item-selector-search .form-control,
.ax-table-zone .nax-multi-item-selector-search .form-control {
    height: 30px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 4px 10px;
    backdrop-filter: blur(4px);
    transition: all .2s ease;
}

.ax-fiche-body .nax-multi-item-selector-search .form-control:focus,
.ax-table-zone .nax-multi-item-selector-search .form-control:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
    outline: none;
}

.ax-fiche-body .nax-multi-item-selector-search .form-control::placeholder,
.ax-table-zone .nax-multi-item-selector-search .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* ── Exercice affectation card — MODERN ── */
.ax-exercice-card {
    background: var(--ax-card, #fff);
    border: 1px solid var(--ax-border, #E5E7EB);
    border-radius: var(--ax-radius, 12px);
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 0 1px rgba(0,0,0,0.06);
    transition: box-shadow 0.25s cubic-bezier(.4, 0, .2, 1),
                border-color 0.25s cubic-bezier(.4, 0, .2, 1);
}

.ax-exercice-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
    border-color: rgba(63, 81, 181, 0.15);
}

.ax-exercice-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ax-exercice-card-header i {
    font-size: 16px;
    color: var(--ax-primary, #3F51B5);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(63, 81, 181, 0.08);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.ax-exercice-card:hover .ax-exercice-card-header i {
    background: rgba(63, 81, 181, 0.14);
}

.ax-exercice-card-header span {
    font-weight: 700;
    font-size: 14px;
    color: var(--ax-text-strong, #1F2937);
    letter-spacing: 0.01em;
}

.ax-exercice-card-hint {
    font-size: 12px;
    font-style: italic;
    color: var(--ax-text-sec, #9CA3AF);
    margin-bottom: 16px;
    padding-left: 25px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ax-exercice-card-hint i {
    font-size: 12px;
    color: var(--ax-text-sec, #9CA3AF);
}

/* ── Form section headers inside wizard — MODERN ── */
.ax-fiche-body .wizard .ax-form-section-header,
.ax-fiche-body-scroll .ax-form-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    margin: 0 0 14px 0;
    background: linear-gradient(135deg, rgba(63, 81, 181, 0.04) 0%, rgba(63, 81, 181, 0.01) 100%);
    border: none;
    border-left: 3px solid var(--ax-primary, #3F51B5);
    border-radius: 0 var(--ax-radius-sm, 8px) var(--ax-radius-sm, 8px) 0;
    box-shadow: 0 1px 3px rgba(63, 81, 181, 0.05);
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.ax-fiche-body .wizard .ax-form-section-header::after,
.ax-fiche-body-scroll .ax-form-section-header::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 60px;
    background: linear-gradient(90deg, transparent, rgba(63, 81, 181, 0.03));
    pointer-events: none;
}

.ax-fiche-body .wizard .ax-form-section-header:hover,
.ax-fiche-body-scroll .ax-form-section-header:hover {
    background: linear-gradient(135deg, rgba(63, 81, 181, 0.06) 0%, rgba(63, 81, 181, 0.02) 100%);
    border-left-color: var(--ax-primary-dark, #303F9F);
    box-shadow: inset 3px 0 0 -1px var(--ax-primary-dark, #303F9F),
                0 1px 3px rgba(0, 0, 0, 0.04);
}

.ax-fiche-body .wizard .ax-form-section-header i,
.ax-fiche-body-scroll .ax-form-section-header i {
    font-size: 13px;
    color: var(--ax-primary, #3F51B5);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(63, 81, 181, 0.1);
    border-radius: 6px;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.ax-fiche-body .wizard .ax-form-section-header:hover i,
.ax-fiche-body-scroll .ax-form-section-header:hover i {
    background: rgba(63, 81, 181, 0.16);
}

.ax-fiche-body .wizard .ax-form-section-header span,
.ax-fiche-body-scroll .ax-form-section-header span {
    font-weight: 700;
    font-size: 13px;
    color: var(--ax-text-strong, #1F2937);
    letter-spacing: 0.01em;
}

/* ── Form inputs inside wizard — MODERN ── */
.ax-fiche-body .wizard input.form-control,
.ax-fiche-body .wizard textarea.form-control {
    border: 1.5px solid var(--ax-border-input, #E2E8F0);
    border-radius: var(--ax-radius-sm, 8px);
    font-size: 13px;
    height: 38px;
    padding: 8px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    color: var(--ax-text-body, #374151);
    width: 100%;
    box-sizing: border-box;
    background: #fff;
}

/* ── Fix: input-group inside wizard — switch to flexbox so addon aligns correctly ── */
.ax-fiche-body .wizard .input-group {
    display: flex !important;
    align-items: stretch;
}

.ax-fiche-body .wizard .input-group input.form-control {
    flex: 1 1 auto;
    width: auto !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.ax-fiche-body .wizard .input-group .input-group-addon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 16px;
    min-width: 56px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-left: none;
    border-top-right-radius: var(--ax-radius-sm, 8px);
    border-bottom-right-radius: var(--ax-radius-sm, 8px);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    white-space: nowrap;
}

.ax-fiche-body .wizard input.form-control:hover,
.ax-fiche-body .wizard textarea.form-control:hover {
    border-color: var(--ax-border-hover, #CBD5E1);
    background: #FAFBFC;
}

.ax-fiche-body .wizard input.form-control:focus,
.ax-fiche-body .wizard textarea.form-control:focus {
    border-color: var(--ax-primary, #3F51B5);
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.12), 0 1px 2px rgba(0,0,0,0.04);
    outline: none;
    background: #fff;
}

.ax-fiche-body .wizard input.form-control::placeholder,
.ax-fiche-body .wizard textarea.form-control::placeholder {
    color: var(--ax-text-light, #94A3B8);
}

/* ── Modern form labels inside wizard ── */
.ax-fiche-body .wizard label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ax-text-sec, #64748B);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
}

/* ================================================================
   RESPONSIVE — Mobile & Petits écrans
   ================================================================ */

/* ── Mobile : container passe en scroll vertical ── */
@media (max-width: 768px) {
    .ax-container {
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
        min-height: 100%;
    }

    .ax-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 8px 12px;
        gap: 8px;
        height: auto;
        min-height: 46px;
        flex-wrap: wrap;
        overflow: visible;
    }

    .ax-toolbar-left,
    .ax-toolbar-right {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 6px;
    }

    .ax-toolbar-right {
        justify-content: flex-end;
    }

    .ax-alert {
        margin: 8px 12px 0 !important;
        font-size: 12px;
    }

    .ax-table-wrapper {
        margin: 12px 12px;
        min-height: 300px;
        max-height: 700px;
        flex: none;
    }

    .ax-fiche-wrapper {
        margin: 12px 12px;
    }

    .ax-table-header-bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 14px;
        gap: 8px;
        height: auto;
        min-height: 44px;
    }

    .ax-fiche-header {
        padding: 10px 14px;
        height: auto;
        min-height: 44px;
    }

    .ax-header-right {
        width: 100%;
    }

    .ax-search-wrapper {
        min-width: 100% !important;
        width: 100%;
    }

    .ax-table-head thead th {
        font-size: 10px;
        padding: 8px 6px;
        letter-spacing: 0.3px;
    }

    .ax-table tbody td {
        padding: 0 6px;
        font-size: 12px;
        height: 36px;
    }

    .ax-table-body-scroll {
        max-height: none;
        overflow-y: auto;
    }

    .ax-badge-kpi {
        min-width: 120px !important;
    }

    .ax-kpi-row {
        padding: 10px 12px 0 12px !important;
    }

    /* KPI stats row (parametrageControle) */
    .ax-kpi-stats-row {
        padding: 10px 12px 0 12px !important;
        gap: 10px !important;
    }

    .ax-kpi-card {
        min-width: calc(50% - 10px) !important;
        flex: 1 1 calc(50% - 10px) !important;
        padding: 10px 14px !important;
    }

    .ax-kpi-card > div:nth-child(3) {
        font-size: 20px !important;
    }

    /* Table : scroll horizontal si colonnes trop larges */
    .ax-table-body-scroll {
        overflow-x: auto;
    }

    .ax-table-head-wrap {
        overflow-x: auto;
    }
}

/* ── Très petit écran : KPI en 1 colonne ── */
@media (max-width: 480px) {
    .ax-kpi-card {
        min-width: 100% !important;
        flex: 1 1 100% !important;
    }
}

/* ── Tablette : ajustements intermédiaires ── */
@media (max-width: 1024px) and (min-width: 769px) {
    .ax-table-wrapper {
        margin: 16px 16px;
    }

    .ax-fiche-wrapper {
        margin: 16px 16px;
    }

    .ax-toolbar {
        padding: 8px 16px;
    }

    .ax-alert {
        margin: 10px 16px 0 !important;
    }

    .ax-kpi-stats-row {
        padding: 12px 16px 0 16px !important;
        gap: 10px !important;
    }

    .ax-kpi-card {
        min-width: 130px !important;
    }
}

/* ── Inline Tab Spinner Overlay ── */
.ax-tab-spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(1px);
    border-radius: 0 0 var(--ax-radius, 10px) var(--ax-radius, 10px);
    animation: ax-fade-in 0.15s ease;
}

.ax-tab-spinner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 28px;
    background: var(--ax-card, #fff);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--ax-border, #E5E7EB);
}

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

/* ================================================================
   SUMMARY CARDS — Factures recap (EcranEtatsFacturesClients)
   ================================================================ */
.ax-summary-card {
    background: var(--ax-card, #fff);
    border-radius: var(--ax-radius, 12px);
    border: 1px solid var(--ax-border, #E5E7EB);
    box-shadow: var(--ax-shadow-sm);
    overflow: hidden;
    transition: var(--ax-tr);
}

.ax-summary-card:hover {
    box-shadow: var(--ax-shadow-md);
}

.ax-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
}

.ax-summary-header i {
    font-size: 14px;
    flex-shrink: 0;
}

.ax-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ax-summary-table thead th {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ax-text-sec, #64748B);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    border-bottom: 1px solid var(--ax-border, #E5E7EB);
    background: var(--ax-panel, #F8FAFC);
}

.ax-summary-table tbody td {
    padding: 8px 14px;
    color: var(--ax-text-body, #374151);
    border-bottom: 1px solid var(--ax-border-light, #F3F4F6);
}

.ax-summary-table tbody tr:last-child td {
    border-bottom: none;
}

/* ================================================================
   FILTER CHIP GROUP — Checkbox groups (EcranEtatsFacturesClients)
   ================================================================ */
.ax-filter-chip-group {
    flex: 1;
    min-width: 180px;
}

.ax-checkbox-inline {
    display: inline-flex !important;
    align-items: center;
    margin: 0 !important;
    min-height: auto !important;
}

.ax-checkbox-inline .md-label {
    margin-left: 4px !important;
}

/* ================================================================
   AX-TEXT UTILITIES — Text alignment & styling
   ================================================================ */
.ax-text-mono {
    font-variant-numeric: tabular-nums;
    font-family: var(--ax-font-mono, 'SF Mono', Consolas, monospace);
    font-size: 12.5px;
}

.ax-text-sec {
    color: var(--ax-text-sec, #64748B);
}

.ax-text-bold {
    font-weight: 700;
    color: var(--ax-text-bold, #111827);
}

.ax-text-right {
    text-align: right;
}

/* ================================================================
   FILTER BAR — Barre de filtres compacte et moderne
   Utilisée dans les includes (EcranEtatsFacturesClients, etc.)
   ================================================================ */
.ax-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 20px;
    background: var(--ax-card, #fff);
    border-bottom: 1px solid var(--ax-border, #E5E7EB);
    flex-shrink: 0;
}

.ax-filter-row {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
}

.ax-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ax-filter-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--ax-text-sec, #64748B);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    line-height: 1;
}

.ax-filter-sep {
    width: 1px;
    align-self: stretch;
    background: var(--ax-border, #E5E7EB);
    margin: 4px 4px;
    flex-shrink: 0;
}

/* ── Date input inside filter bar ── */
.ax-filter-input-date {
    display: flex !important;
    min-width: 155px;
    max-width: 180px;
}

.ax-filter-input-date .form-control {
    height: 32px;
    font-size: 12px;
    padding: 4px 10px;
    border: 1px solid var(--ax-border-input, #CBD5E1);
    border-right: none;
    border-radius: var(--ax-radius-sm) 0 0 var(--ax-radius-sm) !important;
    background: var(--ax-card);
    color: var(--ax-text);
}

.ax-filter-input-date .form-control:focus {
    border-color: var(--ax-border-focus) !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
    z-index: 2;
}

.ax-filter-input-date .input-group-btn .btn {
    height: 32px;
    border: 1px solid var(--ax-border-input, #CBD5E1);
    border-left: none;
    border-radius: 0 var(--ax-radius-sm) var(--ax-radius-sm) 0 !important;
    background: #F8FAFC;
    color: var(--ax-text-sec);
    padding: 0 8px;
    box-shadow: none;
    transition: var(--ax-tr-fast);
}

.ax-filter-input-date .input-group-btn .btn:hover {
    background: #E2E8F0;
    color: var(--ax-primary);
}

/* ── Chips / Checkboxes groupées en ligne ── */
.ax-filter-chips {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 2px;
}

.ax-chip-check {
    display: inline-flex !important;
    align-items: center;
    margin: 0 !important;
    min-height: auto !important;
    padding: 3px 10px 3px 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--ax-text-body, #374151);
    white-space: nowrap;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.ax-chip-check:hover {
    background: rgba(63, 81, 181, 0.06);
}

.ax-chip-check .md-container {
    position: relative !important;
    top: auto !important;
    transform: none !important;
    margin-right: 4px;
}

.ax-chip-check .md-label {
    margin-left: 2px !important;
    font-size: 12px;
    font-weight: 500;
}

/* ── Summary cards grid ── */
.ax-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    padding: 12px 20px 16px;
    flex-shrink: 0;
}

