/* Keep the institutional typeface consistent across desktop and compact shells. */
:root {
    --font-body: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.admin-body,
body.custom-cursor {
    font-family: var(--font-body);
}
/* KaiAdmin declares Public Sans on these text elements instead of inheriting it. */
body.admin-body :where(.alert, .brand, .btn-simple, .h1, .h2, .h3, .h4, .h5, .h6,
    .navbar, .td-name, a, button.close, h1, h2, h3, h4, h5, h6, p, td, th):not(.fa, .fas, .far, .fab, .fal) {
    font-family: var(--font-body);
}
/* KaiAdmin sets this text-bearing toggle to Public Sans explicitly. */
body.admin-body .main-header .navbar-header .figa-mobile-menu {
    font-family: var(--font-body);
}
body.admin-body button,
body.admin-body input,
body.admin-body select,
body.admin-body textarea,
body.custom-cursor button,
body.custom-cursor input,
body.custom-cursor select,
body.custom-cursor textarea {
    font-family: inherit;
}

@media (max-width: 1024px) {
    .figa-kpi-grid--analytics { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .figa-analytics-filters__grid { grid-template-columns:repeat(3,minmax(120px,1fr)); }
    .figa-analytics-layout--tables { grid-template-columns:1fr; }
    html,
    body {
        max-width: 100%;
    }

    .wrapper,
    .main-panel,
    .main-panel > .container,
    .page-inner,
    .card,
    .card-body,
    form {
        min-width: 0;
        max-width: 100%;
    }

    .page-inner > .d-flex,
    .card-header,
    .card-footer,
    .modal-footer {
        flex-wrap: wrap;
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive > .table {
        margin-bottom: 0;
    }

    canvas,
    svg,
    .chart-container,
    .chart-wrapper,
    .apexcharts-canvas,
    .apexcharts-svg {
        max-width: 100% !important;
    }

    .modal-dialog {
        width: auto;
        max-width: calc(100% - 2rem);
        margin: 1rem auto;
    }

    .dropzone,
    .dropzone-container,
    .upload-zone,
    input[type="file"] {
        max-width: 100%;
    }

    .dash-grid-six,
    .dash-grid-quatre,
    .dash-grid-cinq,
    .dash-grid-trois,
    .dash-grid-deux,
    .grid-six,
    .grid-cinq,
    .grid-quatre {
        grid-gap: 10px;
        border-radius: 15px;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
        padding: 0;
    }

    .sec-title__title {
        font-size: 22px;
        line-height: 24px;
    }

    .auth-block {
        width: 90%;
        left: 5%;
        right: 5%;
        top: 5%;
    }

    .card-form .card-body,
    .card-form .card-footer {
        padding: 10px;
    }
    .main-panel {
        width: 100%!important;
    }
    .card-stats .icon-big, .card-stats .col-icon {
        width: 35px;
        height: 35px;
        min-height: 35px;
    }
    .card-category{
        font-size: .7em!important;
    }
    .card-stats .col-stats{
        padding-left: 5px!important;
    }
    .card-stats .icon-big i.fa, .card-stats .icon-big i.fab, .card-stats .icon-big i.fal, .card-stats .icon-big i.far, .card-stats .icon-big i.fas {
        font-size: .7em;
    }
    .card-stats .card-body {
        padding: 8px !important;
    }
}
@media (max-width: 767px) {
    .figa-analytics-hero { display:block; }
    .figa-analytics-hero h1 { font-size:1.55rem; }
    .figa-analytics-hero p { margin-bottom:12px; }
    .figa-analytics-actions .btn { flex:1 1 auto; }
    .figa-analytics-nav { overflow-x:auto; flex-wrap:nowrap; }
    .figa-analytics-nav a { white-space:nowrap; }
    .figa-kpi-grid--analytics { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .figa-analytics-filters__grid { grid-template-columns:1fr 1fr; }
    .figa-analytics-filters__actions { grid-column:1/-1; }
    .figa-analytics-layout { grid-template-columns:1fr; }
    .figa-chart-frame { height:240px; }
    .figa-stats-groups { grid-template-columns: 1fr; gap: 12px; }
    .figa-stats-group { padding: 12px; }
    .dash-grid-six,
    .dash-grid-cinq,
    .dash-grid-quatre,
    .dash-grid-trois,
    .dash-grid-deux,
    .grid-six,
    .grid-cinq,
    .grid-quatre,
    .grid-trois,
    .grid-deux,
    form .grid-deux {
        grid-template-columns: 1fr;
    }

    .page-inner { padding: 16px 14px 28px !important; }
    .page-inner > .d-flex { align-items: flex-start !important; gap: 10px; }
    .page-inner > .d-flex .ms-md-auto { margin-left: 0 !important; width: 100%; }
    .page-inner > .d-flex .ms-md-auto .btn { width: 100%; margin: 2px 0; }
    .page-heading { padding-bottom:12px !important; margin-bottom:14px; }
    .page-context { margin-top:2px; }
    .header-context { display:flex; min-width:0; max-width:calc(100vw - 150px); }
    .header-context strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; }
    .header-context__eyebrow { display:none; }
    .header-context__agency { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .card-form .card-body, .card-form .card-footer { padding: 18px 16px; }
    .table-responsive { margin-bottom: 18px; }
    .table-responsive > .table { min-width: 620px; }
    .auth-block { width: calc(100% - 28px); left: 14px; right: 14px; top: 18px; transform: none; }
    .form-section { padding: 22px 18px; }
    .main-slider-one__item { min-height: 100dvh; height: auto; }
    .main-slider-one__content { padding-top: 24px !important; }
    .main-slider-one__title { font-size: 1.35rem; line-height: 1.25; }
    .navbar .profile-username { display: none; }
    .card-stats .card-body { min-height: 70px; }
    .navbar-header,
    .topbar-nav,
    .navbar-nav {
        min-width: 0;
    }
    .dropdown-menu {
        max-width: calc(100vw - 28px);
    }
    .modal-dialog {
        max-width: calc(100% - 1rem);
        margin: .5rem auto;
    }
    .modal-body {
        max-height: calc(100dvh - 8rem);
        overflow-y: auto;
    }
    .btn-group,
    .btn-group-flex,
    .check-field > div {
        max-width: 100%;
        flex-wrap: wrap;
    }
    input,
    select,
    textarea,
    .form-control,
    .form-select,
    .ts-wrapper {
        max-width: 100%;
    }
}

/* Phone hardening: the shell must never ask the viewport (or a table) to
   become wider than the device. Dense registers use wrapping and compact
   action controls instead of an inner horizontal scroller. */
@media (max-width: 767px) {
    html,
    body,
    body.admin-body,
    body.admin-body .wrapper,
    body.admin-body .main-panel,
    body.admin-body .page-inner {
        max-width: 100%;
        overflow-x: clip;
    }

    .figa-breadcrumb {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 7px;
        max-width: 100%;
        overflow-wrap: anywhere;
        line-height: 1.35;
    }
    .figa-breadcrumb a,
    .figa-breadcrumb span {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .table-responsive {
        overflow-x: clip !important;
        overscroll-behavior-inline: none;
    }
    .table-responsive > .table {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100%;
        table-layout: fixed;
    }
    .table-responsive > .table :where(th, td) {
        max-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
        white-space: normal !important;
    }
    /* Phone is useful on desktop but secondary in a narrow register card. */
    .table-responsive > .table :where(th[data-label*="Téléphone" i],
        td[data-label*="Téléphone" i],
        th[data-label*="Telephone" i],
        td[data-label*="Telephone" i],
        th.phone-column, td.phone-column) {
        display: none !important;
    }
    .table-responsive > .table :where(th.figa-table-actions, td.figa-table-actions) {
        width: 76px !important;
        min-width: 76px !important;
        padding-inline: 4px !important;
    }
    .table-responsive > .table td.figa-table-actions {
        white-space: normal !important;
    }
    .table-responsive > .table td.figa-table-actions :where(.btn, a) {
        min-width: 32px;
        min-height: 32px;
        width: 32px;
        padding: 5px !important;
    }
    .table-responsive > .table td.figa-table-actions :where(.btn-group, .figa-promoteurs-table__action-group) {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 3px;
    }

    .figa-form-actions {
        bottom: 0;
        padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
    }
    body.admin-body .main-header {
        padding-top: env(safe-area-inset-top);
    }
}

@media (max-width: 390px) {
    .figa-form-actions .btn {
        min-width: 0;
        padding-inline: 9px !important;
        font-size: .78rem;
    }
    .figa-breadcrumb { font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
    body.admin-body .wrapper .sidebar,
    .figa-sidebar-overlay,
    .figa-form-actions,
    .figa-sticky-table-header,
    .offline-banner {
        transition: none !important;
        animation: none !important;
    }
}

/* Audit is readable as stacked records on phones, with no horizontal page overflow. */
@media (max-width: 767px) {
    .audit-table thead { display: none; }
    .audit-table, .audit-table tbody, .audit-table tr, .audit-table td { display: block; width: 100%; }
    .audit-table tr { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-elevated); }
    .audit-table td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0 !important; border: 0; white-space: normal !important; text-align: right; }
    .audit-table td::before { content: attr(data-label); color: var(--muted); font-weight: 700; text-align: left; }
    .audit-table td:last-child { justify-content: flex-end; }
    .audit-table td[colspan] { display: block; text-align: center; }
}

@media (max-width: 767px) {
    .figa-modal .modal-dialog { margin:.5rem; }
    .figa-modal .modal-header, .figa-modal .modal-body, .figa-modal .modal-footer { padding-left:16px !important; padding-right:16px !important; }
    .figa-modal .modal-body { max-height:calc(100dvh - 170px); }
    .figa-form-guide { grid-template-columns:1fr; gap:12px; }
    .figa-form-nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
    .figa-form-nav a { min-width:0; overflow:hidden; }
    .figa-form-nav a:not(.is-active) { color:var(--muted); }
    .figa-form-actions { position:sticky !important; bottom:0; z-index:25; margin-left:-16px !important; margin-right:-16px !important; padding:10px 16px !important; background:rgba(246,248,247,.98) !important; border-top:1px solid var(--border); }
    .figa-form-actions .action { min-width:0; flex:1 1 0; }
    .figa-form-actions .figa-step-prev { margin-right:0; }
    .figa-form-actions .btn { white-space:nowrap; }
    .figa-toast { top:62px; right:12px; left:12px; max-width:none; }
}

@media (max-width: 991px) {
    body.admin-body.figa-sidebar-open { overflow:hidden; }
    .main-header .main-header-logo { display:none !important; }
    .main-header .navbar-header {
        position:relative !important;
        inset:0 auto auto 0 !important;
        width:100% !important;
        min-height:58px;
        transform:none !important;
    }
    .main-header .navbar-header > .container-fluid {
        min-height:58px;
        padding-inline:16px !important;
        flex-wrap:nowrap;
        gap:10px;
    }
    .main-header .navbar-header-left {
        position:static;
        display:flex;
        flex:1 1 auto;
        min-width:0;
        width:auto;
        margin:0;
    }
    .main-header .topbar-nav {
        position:static;
        flex:0 0 auto;
        width:auto;
        margin:0 0 0 auto !important;
    }
    .main-header .profile-username { display:none; }
    body.admin-body .wrapper .sidebar {
        position:fixed !important;
        top:0;
        bottom:0;
        left:0;
        z-index:1100 !important;
        width:min(286px, calc(100vw - 42px)) !important;
        transform:translateX(-105%);
        visibility:hidden;
        transition:transform .22s ease, visibility .22s ease;
        box-shadow: 14px 0 32px rgba(10, 43, 41, .18);
    }
    body.admin-body .wrapper .sidebar.is-open {
        transform:translateX(0);
        visibility:visible !important;
    }
    .figa-sidebar-overlay {
        position:fixed;
        inset:0;
        z-index:1090;
        display:block;
        background:rgba(10, 34, 32, .52);
        opacity:0;
        visibility:hidden;
        transition:opacity .22s ease, visibility .22s ease;
    }
    body.admin-body.figa-sidebar-open .figa-sidebar-overlay {
        opacity:1;
        visibility:visible;
    }
    .figa-mobile-menu {
        display:inline-flex;
        align-items:center;
        gap:8px;
        min-height:38px;
        margin-right:10px;
        padding:0 11px;
        border:1px solid #a6c4b7;
        border-radius:7px;
        background:#edf3f0;
        color:#124b4a;
        font-size:.78rem;
        font-weight:800;
        letter-spacing:.02em;
    }
    .figa-mobile-menu i { color:#b48628; font-size:.9rem; }
    .figa-mobile-menu:focus-visible { outline:3px solid rgba(217,181,74,.8) !important; outline-offset:2px; }
    .main-header .navbar-header-left { flex:1 1 auto; min-width:0; }
    .figa-sidebar-close {
        position:absolute;
        top:14px;
        right:12px;
        z-index:10;
        display:inline-flex;
        align-items:center;
        gap:6px;
        min-height:34px;
        padding:0 10px;
        border:1px solid rgba(255,255,255,.35);
        border-radius:7px;
        background:rgba(255,255,255,.1);
        color:#fffdf8;
        font-size:.72rem;
        font-weight:800;
    }
    .figa-sidebar-close:hover,
    .figa-sidebar-close:focus-visible { background:#fffdf8; color:#124b4a; }
    body.admin-body .wrapper .sidebar .sidebar-wrapper {
        top:58px !important;
        height:calc(100% - 58px) !important;
    }
    .page-heading { padding-top:4px !important; padding-bottom:10px !important; margin-bottom:12px !important; }
}

/* Shared mobile alignment: breadcrumb, heading and actions use one
   predictable left edge at every supported compact breakpoint. */
@media (max-width: 991px) {
    body.admin-body .page-heading {
        width: 100%;
        align-items: flex-start !important;
        gap: .75rem;
    }
    body.admin-body .figa-breadcrumb {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .25rem .45rem;
        width: 100%;
        line-height: 1.35;
    }
    body.admin-body .figa-form-actions,
    body.admin-body .figa-actions {
        width: 100%;
        justify-content: stretch;
    }
    body.admin-body .figa-form-actions > .action,
    body.admin-body .figa-form-actions > .btn,
    body.admin-body .figa-actions > .action,
    body.admin-body .figa-actions > .btn {
        flex: 1 1 auto;
        min-height: 42px;
    }
}

@media (max-width: 390px) {
    body.admin-body .figa-form-actions,
    body.admin-body .figa-actions {
        gap: .4rem;
    }
    body.admin-body .figa-form-actions > .action,
    body.admin-body .figa-form-actions > .btn,
    body.admin-body .figa-actions > .action,
    body.admin-body .figa-actions > .btn {
        flex-basis: 100%;
    }
}

@media (max-width: 767px) {
    body.admin-body td.figa-table-actions {
        min-width: 12rem;
    }
    body.admin-body td.figa-table-actions > :where(.btn, form, a),
    body.admin-body td.figa-table-actions form > .btn {
        min-height: 38px;
    }
}

@media (max-width: 390px) {
    .main-header .navbar-header > .container-fluid { padding-inline:10px !important; gap:6px; }
    .main-header .topbar-icon { display:list-item; }
    .main-header .topbar-icon > a { min-width:32px; padding-inline:5px !important; }
    .header-context { flex:1 1 auto; max-width:none; }
    .header-context strong { display:block; font-size:.72rem; }
    .header-context__agency { max-width:120px; }
    .figa-mobile-menu { margin-right:2px; }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .page-inner { padding-left:24px !important; padding-right:24px !important; }
    .header-context strong { font-size:.8rem; }
}

@media (max-width: 374px) {
    .figa-kpi-grid--analytics { grid-template-columns:1fr; }
    .figa-analytics-filters__grid { grid-template-columns:1fr; }
    .figa-analytics-filters__actions { grid-column:auto; }
    .page-inner { padding: 12px 10px 24px !important; }
    .card-form .card-body,
    .card-form .card-footer,
    .form-section { padding: 14px 12px; }
    h1 { font-size: 1.45rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
    .table-responsive > .table { min-width: 560px; }
}

/* FIGA dashboard */
@media (max-width: 767px) {
    .figa-dashboard__intro { display: block; margin-bottom: 20px; }
    .figa-status { width: max-content; margin-top: 16px; }
    .figa-kpi-strip { grid-template-columns: 1fr; gap: 8px; }
    .figa-dashboard__stage { grid-template-columns: 1fr; gap: 12px; margin-bottom: 26px; }
    .figa-chart-panel { padding: 18px 16px 15px; }
    .figa-chart-wrap--bar { height: 185px; }
    .figa-chart-wrap--doughnut { height: 175px; }
    .figa-register-list { grid-template-columns: 1fr; }
    .figa-register, .figa-register:nth-child(even), .figa-register:nth-child(odd) { border-right: 0; padding-left: 2px; padding-right: 2px; }
    .figa-register:hover, .figa-register:nth-child(even):hover { padding-left: 8px; }
}
@media (max-width: 374px) {
    .figa-dashboard h1 { font-size: 1.7rem; }
    .figa-dashboard__intro { margin-bottom: 16px; }
    .figa-chart-panel { padding: 16px 12px 13px; }
    .figa-chart-wrap--bar { height: 165px; }
    .figa-register { grid-template-columns: 30px minmax(0, 1fr) auto 12px; gap: 8px; }
    .figa-register__icon { width: 27px; height: 27px; }
}

@media (min-width: 901px) and (max-width: 1024px) {
    :root { --sidebar-space: 190px; }
    .sidebar, .logo-header { width: var(--sidebar-space); }
    .main-panel { width: calc(100% - var(--sidebar-space)); }
    .page-inner { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 767px) {
    .sidebar { z-index: 1100; }
    .main-header { position: sticky; top: 0; z-index: 1000; }
    .main-header .navbar-header { padding: 0 10px; }
    .main-header .logo-header { display: none; }
    .main-header .navbar-nav { margin-left: auto !important; }
    .main-panel { width: 100% !important; }
    .page-inner { padding-top: 18px !important; }
    .card-header, .card-body, .card-footer { padding: 14px 16px !important; }
    .page-header h3 { font-size: 1.12rem; }
    .page-header .breadcrumbs { margin-bottom: 8px !important; }
    .table-responsive { border-radius: 7px !important; }
    .table-responsive > .table { min-width: 680px; }
    .modal-content { margin: 0 .25rem; }
    .modal-header, .modal-body, .modal-footer { padding: 14px 16px !important; }
    .form-layout .col-sm-9, .form-layout .col-sm-8, .form-layout .col-sm-10 { width: 100%; }
    .form-layout .page-header { position: static !important; }
    .form-layout .card-footer .btn, .form-layout form > .text-start .btn { width: 100% !important; }
    .profile-pic { padding-right: 0 !important; }
    .page-inner > .dash-grid-deux,
    .page-inner > .dash-grid-trois,
    .page-inner > .dash-grid-quatre,
    .page-inner > .dash-grid-cinq,
    .page-inner > .dash-grid-six { gap: 12px; }
    .page-inner .dashboard-filter,
    .page-inner .filter { padding: 8px; }
    .page-inner .dashboard-filter .form-select,
    .page-inner .dashboard-filter .btn,
    .page-inner .filter .form-control,
    .page-inner .filter .form-select,
    .page-inner .filter .btn { width: 100%; margin-bottom: 6px; }
    .page-inner .app-panel .count { font-size: 1.65rem; }
    .page-inner .filter .accordion-body { padding: 12px; }
    .page-inner .filter .filter-fields { gap: 8px; }
    .page-inner .filter .text-end,
    .page-inner .filter .grid-quatre > div:last-child,
    .page-inner .filter .grid-trois > div:last-child,
    .page-inner .filter .grid-deux > div:last-child {
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
    }
    .page-inner .filter .text-end .btn,
    .page-inner .filter .grid-quatre > div:last-child .btn {
        width: 100%;
        margin: 0;
    }
    .page-inner .filter .grid-trois > div:last-child .btn,
    .page-inner .filter .grid-deux > div:last-child .btn {
        width: 100%;
        margin: 0;
    }
    .page-inner .table-responsive {
        max-width: 100%;
        overflow-x: auto;
    }
    body.admin-body .page-inner .table .figa-table-edit {
        min-width: 6rem;
        min-height: 38px;
        padding-inline: .58rem !important;
    }
    .dashboard-account-panels .card { margin-bottom: 0 !important; }
    .dashboard-quick-actions .col-md-3 { margin-bottom: 8px !important; }
    .page-inner .table > thead > tr > th:first-child,
    .page-inner .table > tbody > tr > td:first-child {
        padding-left: 14px !important;
    }
    .page-inner .table > tbody > tr > td[colspan] .row {
        min-width: 0;
        padding: 12px;
    }
    .page-inner .table > tbody > tr > td[colspan] .row > div {
        width: 100%;
        text-align: center !important;
    }
    .page-inner .table > tbody > tr > td[colspan] .pagination {
        justify-content: center !important;
        flex-wrap: wrap;
    }
}

@media (max-width: 320px) {
    .page-inner { padding-left: 9px !important; padding-right: 9px !important; }
    .card-body { padding-left: 12px !important; padding-right: 12px !important; }
    .dashboard-welcome h4 { font-size: 1.2rem; }
    .btn { font-size: .78rem; }
}

@media (max-width: 374px) {
    .main-header { min-height: 56px; }
    .topbar-user .avatar-sm { width: 30px; height: 30px; }
    .btn { min-height: 34px; }
    .table-responsive > .table { min-width: 620px; }
    .page-inner .card-body { padding: 14px !important; }
    .page-inner .app-panel .titre { font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (max-width: 767px) {
    .figa-form-guide { grid-template-columns: 1fr; gap: 12px; margin-bottom: 18px; padding: 14px; }
    .figa-form-nav { justify-content: flex-start; gap: 3px; }
    .figa-form-nav a { flex: 1 1 calc(50% - 4px); padding-left: 3px; }
    .figa-form-actions { position: sticky !important; bottom: 0; z-index: 25; margin-left: -16px !important; margin-right: -16px !important; padding: 10px 16px !important; background: rgba(246,248,247,.98) !important; border-top: 1px solid var(--border); }
    .figa-form-actions .action { min-width: 0; flex: 1 1 0; }
    .figa-dossier__hero { padding: 17px 15px; }
    .figa-dossier__hero h2 { font-size: 1.16rem; }
    .figa-dossier__section { padding: 13px; }
    .figa-dossier__grid { grid-template-columns: 1fr; }
    .figa-dossier__field--wide { grid-column: auto; }
    .figa-dossier__list { grid-template-columns: 1fr; gap: 3px; }
}

@media (max-width: 767px) {
    .form-layout .page-inner { padding-top: 18px !important; }
    .form-layout .page-header { margin-bottom: 10px; }
    .form-layout .page-header h3 { align-items: flex-start; font-size: 1.18rem; }
    .form-layout .card-form .card-header,
    .form-layout .card-form .card-body { padding: 18px 16px !important; }
    .form-layout .card-form .card-footer {
        padding: 12px 16px !important;
        justify-content: stretch;
    }
    .form-layout .card-form .card-footer .btn,
    .form-layout form > .text-start .btn { flex: 1 1 0; min-width: 0; }
    .form-layout form > .text-start { padding: 12px 0; }
    .form-layout form legend { margin-top: 24px; font-size: .95rem !important; }
    .form-layout form .grid-deux { grid-template-columns: 1fr; gap: 0; }
    .form-layout form .collection-row { padding: 14px 12px 3px; }
}

@media (max-width: 374px) {
    .form-layout .card-form .card-header,
    .form-layout .card-form .card-body { padding: 14px 12px !important; }
    .form-layout .card-form .card-footer { padding: 10px 12px !important; }
    .form-layout form > .text-start { gap: 6px; }
    .form-layout form > .text-start .btn { padding-left: 8px !important; padding-right: 8px !important; }
}

@media (max-width: 767px) {
    .page-heading { gap: 8px; }
    .page-heading > div:last-child { justify-content: stretch; }
    .page-heading > div:last-child > .btn,
    .page-heading > div:last-child > form,
    .page-heading > div:last-child > form .btn { flex: 1 1 100%; width: 100%; }
    .figa-ops__intro { align-items: flex-start; flex-direction: column; gap: 12px; }
    .figa-ops__intro > .btn { width: 100%; }
    .figa-detail__body { grid-template-columns: 1fr; }
    .figa-detail__hero { padding: 18px 16px; }
    .figa-actions { align-items: stretch; }
    .figa-actions > .btn { flex: 1 1 100%; }
    .figa-breadcrumb { margin-bottom: 4px; }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .page-heading > div:last-child { max-width: 48%; }
    .figa-ops__intro { gap: 16px; }
}

@media (max-width: 390px) {
    body.admin-body .main-panel { padding-top: 58px; }
    body.admin-body .page-inner { padding-top: 12px !important; }
    body.admin-body .page-heading {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
        min-height: 0;
        margin-bottom: 14px !important;
        padding-top: 0 !important;
    }
    body.admin-body .page-heading > div { max-width: 100%; }
    body.admin-body .page-heading > div:last-child { width: 100%; }
    body.admin-body .figa-breadcrumb {
        display: flex;
        flex-wrap: wrap;
        gap: 0 6px;
        line-height: 1.45;
    }
    body.admin-body .figa-breadcrumb span[aria-current="page"] { overflow-wrap: anywhere; }
    .figa-breadcrumb { font-size: .68rem; }
    .figa-detail__hero h1 { font-size: 1.3rem; }
    .figa-panel__head, .figa-panel__body { padding-left: 14px; padding-right: 14px; }
}

/* Auth forms are content-led on narrow screens: no artificial viewport
   reserve below the reset form and no horizontal white strip. */
@media (max-width: 390px) {
    body:not(.admin-body) .page-wrapper,
    body:not(.admin-body) .main-slider-one,
    body:not(.admin-body) .main-slider-one__item {
        min-height: 100dvh;
        height: auto;
    }
    body:not(.admin-body) .page-wrapper { overflow: hidden; }
    body:not(.admin-body) .main-slider-one__item { padding-bottom: 24px; }
    body:not(.admin-body) .main-slider-one__shape { display: none; }
    body:not(.admin-body) .auth-block {
        position: absolute;
        top: 14px;
        bottom: 14px;
        left: 12px;
        right: 12px;
        width: auto;
        transform: none;
        max-height: none;
        overflow-y: auto;
        padding-bottom: 2px;
    }
    body:not(.admin-body) .auth-block .form-section { padding: 16px 14px; }
    body:not(.admin-body) .auth-block .sec-title { padding-bottom: 18px; }
    body:not(.admin-body) .auth-block .form-group { padding: 4px 0 !important; }
}

/* Keep KaiAdmin's off-canvas drawer and panel translation in sync. */
@media (max-width: 991px) {
    body.admin-body .wrapper .sidebar {
        width: 265px !important;
    }
}

/* One responsive contract for dense forms and tables. */
@media (min-width: 1440px) {
    .figa-form-page { max-width: 1180px; }
}
@media (min-width: 901px) and (max-width: 1024px) {
    .figa-form-page { max-width: 100%; }
    .figa-form-shell .card-body { padding:18px; }
}
@media (max-width: 900px) {
    .figa-form-body .grid-deux, .figa-form-body .figa-dossier__grid { grid-template-columns:1fr; }
    .figa-form-body .grid-deux > :only-child, .figa-form-body .figa-dossier__field--wide { grid-column:auto; }
}
@media (max-width: 767px) {
    .figa-form-page__title { font-size:1.2rem; }
    .figa-form-shell__header, .figa-form-shell .card-body { padding:16px !important; }
    .figa-form-shell .card-footer { margin:0; padding:11px 16px !important; }
    .figa-form-actions { justify-content:stretch; margin-inline:-16px; padding-inline:16px !important; }
    .figa-form-actions .btn { flex:1 1 0; }
    .figa-breadcrumb { font-size:.68rem; }
    .figa-form-body fieldset, .figa-form-body .form-section, .figa-dossier__section { padding:13px; }
    .mobile-card-table thead { display:none; }
    .mobile-card-table, .mobile-card-table tbody, .mobile-card-table tr, .mobile-card-table td { display:block; width:100%; }
    .mobile-card-table tr { padding:11px 12px; margin-bottom:8px; border:1px solid var(--border); border-radius:8px; background:var(--white-color); }
    .mobile-card-table td { display:flex; justify-content:space-between; gap:12px; padding:4px 0 !important; white-space:normal !important; border:0; }
    .mobile-card-table td::before { content:attr(data-label); color:var(--muted); font-weight:700; }
}
@media (max-width: 390px) {
    .figa-form-page__heading { margin-bottom:12px; }
    .figa-form-shell__identity { align-items:flex-start; }
    .figa-form-shell__mark { width:34px; height:34px; }
    .figa-form-shell .card-body { padding:13px 12px !important; }
}
@media (max-width: 320px) {
    .figa-form-page__title { font-size:1.05rem; }
    .figa-form-shell .card-footer { padding-inline:12px !important; }
    .figa-form-actions { margin-inline:-12px; padding-inline:12px !important; }
}

/* Must remain last: KaiAdmin also positions the drawer in late responsive rules. */
@media (max-width: 991px) {
    body.admin-body .wrapper #figa-sidebar {
        left: 0 !important;
        right: auto !important;
        width: min(286px, calc(100vw - 42px)) !important;
        transform: translateX(-105%) !important;
    }
    body.admin-body .wrapper #figa-sidebar.is-open {
        transform: translateX(0) !important;
    }
}

@media (min-width: 992px) and (max-width: 1024px) {
    body.admin-body .wrapper .sidebar {
        width: 190px !important;
    }
    body.admin-body .wrapper .main-panel {
        width: calc(100% - 190px) !important;
        max-width: calc(100% - 190px);
        margin-left: 190px;
    }
    body.admin-body .main-header {
        left: 190px !important;
        right: 0 !important;
        width: calc(100% - 190px) !important;
    }
}

/* One breakpoint contract: 991px is the drawer, 992px is the workspace.
   Keep this block last because KaiAdmin ships late, broad tablet rules. */
@media (max-width: 991px) {
    :root { --sidebar-space: 0px; }
    body.admin-body .wrapper .sidebar,
    body.admin-body .wrapper #figa-sidebar {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0 !important;
        right: auto !important;
        width: min(286px, calc(100vw - 42px)) !important;
        margin: 0 !important;
        transform: translateX(-105%) !important;
        visibility: hidden;
        z-index: 1100 !important;
    }
    body.admin-body .wrapper .sidebar.is-open,
    body.admin-body .wrapper #figa-sidebar.is-open {
        transform: translateX(0) !important;
        visibility: visible !important;
    }
    body.admin-body .main-panel,
    body.admin-body .wrapper .main-panel {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
    }
    body.admin-body .main-header,
    body.admin-body .main-header .navbar-header {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
    }
    body.figa-sidebar-collapsed .sidebar,
    body.sidebar_minimize .sidebar,
    body.sidebar-mini .sidebar { width: min(286px, calc(100vw - 42px)) !important; }
    .figa-two-column,
    .figa-detail__body,
    .figa-dossier__grid,
    .figa-form-body .grid-deux,
    .form-layout form .grid-deux { grid-template-columns: 1fr; }
}

@media (min-width: 992px) {
    body.admin-body .wrapper .sidebar,
    body.admin-body .wrapper #figa-sidebar {
        position: fixed !important;
        left: 0 !important;
        right: auto !important;
        width: var(--sidebar-space) !important;
        transform: none !important;
        visibility: visible !important;
    }
    body.admin-body .main-panel,
    body.admin-body .wrapper .main-panel {
        width: calc(100% - var(--sidebar-space)) !important;
        max-width: calc(100% - var(--sidebar-space));
        margin-left: var(--sidebar-space) !important;
    }
    body.admin-body .main-header {
        left: var(--sidebar-space) !important;
        right: 0 !important;
        width: calc(100% - var(--sidebar-space)) !important;
    }
}

@media (min-width: 992px) and (max-width: 1024px) {
    :root { --sidebar-space: 190px; }
    body.admin-body .wrapper .sidebar,
    body.admin-body .wrapper #figa-sidebar { width: 190px !important; }
    body.admin-body .main-panel,
    body.admin-body .wrapper .main-panel {
        width: calc(100% - 190px) !important;
        max-width: calc(100% - 190px);
        margin-left: 190px !important;
    }
    body.admin-body .main-header {
        left: 190px !important;
        width: calc(100% - 190px) !important;
    }
}

@media (max-width: 767px) {
    .figa-two-column,
    .figa-detail__body,
    .figa-dossier__grid,
    .figa-form-body .grid-deux,
    .form-layout form .grid-deux { gap: 10px; }
    .dash-grid-six[data-grid-count],
    .dash-grid-cinq[data-grid-count],
    .dash-grid-quatre[data-grid-count],
    .dash-grid-trois[data-grid-count],
    .dash-grid-deux[data-grid-count],
    .figa-kpi-grid[data-grid-count],
    .dashboard-statistics[data-grid-count] { grid-template-columns: 1fr; }
}

@media (min-width: 992px) {
    body.admin-body .wrapper.sidebar_minimize .sidebar,
    body.admin-body .wrapper.sidebar_minimize .logo-header,
    body.admin-body .wrapper.sidebar_minimize_hover .sidebar,
    body.admin-body .wrapper.sidebar_minimize_hover .logo-header { width: 72px !important; }
    body.admin-body .wrapper.sidebar_minimize .main-panel,
    body.admin-body .wrapper.sidebar_minimize_hover .main-panel {
        width: calc(100% - 72px) !important;
        max-width: calc(100% - 72px);
        margin-left: 72px !important;
    }
    body.admin-body .wrapper.sidebar_minimize .main-header,
    body.admin-body .wrapper.sidebar_minimize_hover .main-header {
        left: 72px !important;
        width: calc(100% - 72px) !important;
    }
}

/* Final shared shell contract: responsive.css is loaded after app.css. */
html { font-size: 16px; }
body.admin-body {
    background: var(--app-bg);
    color: var(--black-color);
    font-size: max(12px, .875rem);
    overflow-x: hidden;
}
body.admin-body .main-header {
    position: fixed !important;
    top: 0 !important;
    z-index: 1000 !important;
    min-height: 58px;
    background: rgba(255,253,248,.97);
    border-bottom: 1px solid var(--border) !important;
}
body.admin-body .main-header .navbar-header { min-height: 58px; }
body.admin-body .container { width: 100%; max-width: none; padding-inline: 0; }
body.admin-body .page-inner {
    width: min(100%, 1600px);
    margin-inline: auto;
    padding: 18px clamp(16px, 2.1vw, 34px) 36px;
}
.figa-snapshot,
.figa-ops__intro > .figa-status,
.figa-dashboard__intro > .figa-status { display: none !important; }
.figa-panel { min-width: 0; overflow: hidden; }
.figa-panel__head { gap: 12px; padding: 14px 16px; }
.figa-panel__head h2 { font-size: 1rem; margin: 0; }
.figa-register-list--metrics > .card { min-width: 0; cursor: pointer; }
.figa-register-list--metrics > .card:hover,
.figa-register-list--metrics > .card:focus-within {
    border-color: #9cbcaf;
    box-shadow: 0 4px 14px rgba(18,75,74,.1);
}
.table-responsive {
    max-width: 100%;
    max-height: min(62dvh, 680px);
    overflow: auto;
    overscroll-behavior: contain;
}
.table-responsive > table { min-width: 680px; margin-bottom: 0; }
.table-responsive thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--white-color) !important;
    box-shadow: 0 1px 0 var(--border);
}
.table td, .table th { font-size: max(12px, .8125rem) !important; }
.sidebar.sidebar-style-2 .nav > .nav-item > a,
.sidebar.sidebar-style-2 .nav-collapse li a { font-size: max(12px, .8125rem); }
.modal-dialog { max-width: min(860px, calc(100vw - 32px)); }
.modal-content { max-height: calc(100dvh - 32px); }
.modal-body { overflow-y: auto; min-height: 0; }

@media (min-width: 992px) {
    body.admin-body .main-panel { margin-left: var(--sidebar-space) !important; }
    body.admin-body .main-header {
        left: var(--sidebar-space) !important;
        width: calc(100% - var(--sidebar-space)) !important;
    }
    body.admin-body .wrapper.sidebar_minimize .main-panel,
    body.admin-body .wrapper.sidebar_minimize_hover .main-panel {
        margin-left: 72px !important;
        width: calc(100% - 72px) !important;
    }
    body.admin-body .wrapper.sidebar_minimize .main-header,
    body.admin-body .wrapper.sidebar_minimize_hover .main-header {
        left: 72px !important;
        width: calc(100% - 72px) !important;
    }
}
@media (max-width: 991px) {
    body.admin-body .main-panel { margin-left: 0 !important; width: 100% !important; }
    body.admin-body .main-header { left: 0 !important; width: 100% !important; }
    .table-responsive { max-height: 58dvh; }
}
@media (max-width: 767px) {
    body.admin-body .page-inner { padding: 14px 12px 28px !important; }
    .figa-panel__head { padding: 12px 13px; }
    .table-responsive > table { min-width: 640px; }
    .modal-dialog { max-width: calc(100vw - 16px); margin: 8px auto; }
    .modal-content { max-height: calc(100dvh - 16px); }
}
@media (max-width: 390px) {
    body.admin-body .page-inner { padding-inline: 10px !important; }
    .table-responsive > table { min-width: 600px; }
}

/*
 * FIGA Core — single vertical rhythm contract.
 * This final shared layer wins over KaiAdmin and legacy feature patches:
 * <=991px is the drawer workspace, >=992px is the sidebar workspace.
 */
:root {
    --figa-shell-top: 12px;
    --figa-shell-bottom: 24px;
    --figa-shell-inline: clamp(12px, 1.8vw, 28px);
    --figa-section-gap: 10px;
    --figa-panel-pad-y: 12px;
    --figa-panel-pad-x: 14px;
}

body.admin-body .page-inner {
    padding: var(--figa-shell-top) var(--figa-shell-inline) var(--figa-shell-bottom) !important;
}

body.admin-body .page-heading {
    min-height: 0;
    margin: 0 0 var(--figa-section-gap) !important;
    padding: 0 0 8px !important;
    gap: 10px;
}

body.admin-body .page-heading + *,
body.admin-body .page-inner > .filter,
body.admin-body .page-inner > .dashboard-filter {
    margin-top: 0 !important;
}

body.admin-body :where(.figa-ops, .figa-dashboard) > * {
    margin-top: 0 !important;
    margin-bottom: var(--figa-section-gap) !important;
}

body.admin-body :where(.figa-ops, .figa-dashboard) > *:last-child {
    margin-bottom: 0 !important;
}

body.admin-body .filter,
body.admin-body .dashboard-filter,
body.admin-body .figa-panel,
body.admin-body .card-form {
    margin-bottom: var(--figa-section-gap) !important;
}

body.admin-body .figa-panel__head {
    padding: var(--figa-panel-pad-y) var(--figa-panel-pad-x);
}

body.admin-body .card-header,
body.admin-body .card-body,
body.admin-body .card-footer {
    padding-block: var(--figa-panel-pad-y);
}

body.admin-body .table-responsive {
    margin-bottom: var(--figa-section-gap) !important;
}

body.admin-body .row,
body.admin-body [class*="row-"] {
    --bs-gutter-y: var(--figa-section-gap);
}

@media (max-width: 390px) {
    body.admin-body .page-inner {
        --figa-shell-top: 10px;
        --figa-shell-bottom: 18px;
        --figa-shell-inline: 10px;
    }
    body.admin-body .page-heading {
        padding-bottom: 6px !important;
        margin-bottom: 8px !important;
    }
    body.admin-body .card-header,
    body.admin-body .card-body,
    body.admin-body .card-footer,
    body.admin-body .figa-panel__head {
        padding-block: 10px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    body.admin-body .page-inner {
        --figa-shell-top: 12px;
        --figa-shell-bottom: 22px;
        --figa-shell-inline: 18px;
    }
    body.admin-body .page-heading { flex-wrap: nowrap; }
    body.admin-body .page-heading > div:last-child { max-width: 42%; }
}

@media (min-width: 992px) and (max-width: 1024px) {
    body.admin-body .page-inner { --figa-shell-inline: 18px; }
    body.admin-body .page-heading { gap: 8px; }
}

@media (min-width: 1440px) {
    body.admin-body .page-inner { --figa-shell-inline: 28px; }
}

/* Final responsive shell/table contract. Keep this block last so plugin and
   legacy feature rules cannot reintroduce a second geometry. */
@media (max-width: 991px) {
    :root { --sidebar-space: 0px; }
    body.admin-body .main-header,
    body.admin-body .main-header .navbar-header {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
    }
    body.admin-body .main-panel,
    body.admin-body .wrapper .main-panel {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
    }
    body.admin-body .table-responsive {
        max-height: none !important;
        height: auto !important;
        overflow-y: hidden !important;
        overflow-x: auto !important;
    }
    body.admin-body .garantie-register-scroll {
        max-height: none !important;
        height: auto !important;
        overflow-y: hidden !important;
        overflow-x: auto !important;
    }
}

@media (min-width: 992px) {
    body.admin-body .wrapper .sidebar,
    body.admin-body .wrapper #figa-sidebar,
    body.admin-body .wrapper .logo-header {
        width: var(--sidebar-space) !important;
    }
    body.admin-body .main-panel,
    body.admin-body .wrapper .main-panel {
        width: calc(100% - var(--sidebar-space)) !important;
        max-width: calc(100% - var(--sidebar-space)) !important;
        margin-left: var(--sidebar-space) !important;
    }
    body.admin-body .main-header {
        left: var(--sidebar-space) !important;
        right: 0 !important;
        width: calc(100% - var(--sidebar-space)) !important;
    }
    body.admin-body .wrapper.sidebar_minimize .sidebar,
    body.admin-body .wrapper.sidebar_minimize_hover .sidebar,
    body.admin-body .wrapper.sidebar_minimize .logo-header,
    body.admin-body .wrapper.sidebar_minimize_hover .logo-header {
        width: var(--figa-sidebar-closed, 72px) !important;
    }
    body.admin-body .wrapper.sidebar_minimize .main-panel,
    body.admin-body .wrapper.sidebar_minimize_hover .main-panel {
        width: calc(100% - var(--figa-sidebar-closed, 72px)) !important;
        max-width: calc(100% - var(--figa-sidebar-closed, 72px)) !important;
        margin-left: var(--figa-sidebar-closed, 72px) !important;
    }
    body.admin-body .wrapper.sidebar_minimize .main-header,
    body.admin-body .wrapper.sidebar_minimize_hover .main-header {
        left: var(--figa-sidebar-closed, 72px) !important;
        width: calc(100% - var(--figa-sidebar-closed, 72px)) !important;
    }
}

@media (min-width: 992px) {
    body.admin-body .table-responsive {
        max-height: none !important;
        height: auto !important;
        overflow-y: hidden !important;
        overflow-x: auto !important;
    }
    body.admin-body .garantie-register-scroll {
        max-height: none !important;
        height: auto !important;
        overflow-y: hidden !important;
        overflow-x: auto !important;
    }
}

/* FIGA shell closure: one geometry for the navigation, header and workspace.
   This layer is intentionally last; KaiAdmin and feature styles are broad and
   should not be able to split the shell into competing coordinate systems. */
:root {
    --figa-shell-sidebar: 248px;
    --figa-shell-rail: 72px;
    --figa-shell-header: 58px;
    --figa-shell-header-current: var(--figa-shell-header);
    --figa-shell-ink: #193b34;
    --figa-shell-muted: #6a7d75;
    --figa-shell-line: #d6e2dc;
    --figa-shell-paper: #fffdf8;
}

body.admin-body {
    overflow-x: hidden;
    background: #f3f7f4;
}

body.admin-body .main-header {
    min-height: var(--figa-shell-header) !important;
    background: rgba(255,253,248,.98) !important;
    box-shadow: 0 1px 0 rgba(24,67,57,.06);
}
body.admin-body .main-header .navbar-header,
body.admin-body .main-header .container-fluid {
    min-height: var(--figa-shell-header) !important;
}
body.admin-body .header-context {
    min-width: 0;
    line-height: 1.15;
}
body.admin-body .header-context strong,
body.admin-body .header-context__agency {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.admin-body .header-context__agency { color: var(--figa-shell-muted); }

body.admin-body .sidebar,
body.admin-body .sidebar .sidebar-wrapper {
    background: #0e5049 !important;
}
body.admin-body #figa-sidebar {
    width: var(--figa-shell-sidebar) !important;
    overflow: hidden;
}
body.admin-body #figa-sidebar .sidebar-wrapper {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.25) transparent;
}
body.admin-body #figa-sidebar > .scroll-wrapper.sidebar-wrapper {
    top: 0 !important;
    height: calc(100dvh - var(--figa-shell-header-current)) !important;
    min-height: 0 !important;
    max-height: calc(100dvh - var(--figa-shell-header-current)) !important;
    padding-top: 0 !important;
}
body.admin-body #figa-sidebar .scroll-content.sidebar-wrapper {
    top: 0 !important;
    height: auto !important;
    min-height: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding-top: 0 !important;
    overflow: visible !important;
}
body.admin-body #figa-sidebar > .scroll-wrapper.sidebar-wrapper > .scroll-element {
    display: none !important;
}
body.admin-body #figa-sidebar .sidebar-content {
    padding: 12px 8px 76px;
}
body.admin-body #figa-sidebar .nav.nav-secondary {
    margin-top: 0 !important;
    padding-inline: 0 !important;
}
body.admin-body #figa-sidebar .nav > .nav-item {
    position: relative;
    margin: 2px 0 4px;
    padding: 0 !important;
}
body.admin-body #figa-sidebar .nav > .nav-item-guide {
    position: sticky !important;
    bottom: 8px;
    z-index: 20;
    margin-top: 12px;
    background: #0e5049;
    box-shadow: 0 -10px 18px rgba(14,80,73,.92);
}
body.admin-body #figa-sidebar .nav > .nav-item > a {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px !important;
    border-radius: 7px !important;
    line-height: 1.25;
}
body.admin-body #figa-sidebar .nav > .nav-item > a i {
    flex: 0 0 18px;
    width: 18px;
    margin: 0 !important;
    text-align: center;
}
body.admin-body #figa-sidebar .nav > .nav-item > a p {
    flex: 1 1 auto;
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    margin: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    text-transform: none;
}
body.admin-body #figa-sidebar .nav > .nav-item > a .caret {
    flex: 0 0 auto;
    margin-left: auto;
}
body.admin-body #figa-sidebar .nav > .nav-item.active > a {
    background: #fffdf8 !important;
    color: #13574c !important;
    box-shadow: inset 3px 0 0 #c08a2e;
}
body.admin-body #figa-sidebar .nav > .nav-item.active > a i,
body.admin-body #figa-sidebar .nav > .nav-item.active > a p,
body.admin-body #figa-sidebar .nav > .nav-item.active > a .caret {
    color: #13574c !important;
}
body.admin-body #figa-sidebar .nav-collapse {
    margin: 3px 0 7px 9px !important;
    padding: 4px 0 4px 8px !important;
    border-left: 1px solid rgba(222,243,235,.45);
    background: rgba(4,48,43,.22);
    border-radius: 0 7px 7px 0;
}
body.admin-body #figa-sidebar .nav-collapse li {
    margin: 1px 0;
    min-width: 0;
}
body.admin-body #figa-sidebar .nav-collapse li a {
    display: flex;
    min-height: 34px;
    align-items: center;
    padding: 7px 9px !important;
    border-radius: 5px !important;
    line-height: 1.25;
}
body.admin-body #figa-sidebar .nav-collapse li a .sub-item {
    min-width: 0;
    overflow-wrap: anywhere;
}
body.admin-body #figa-sidebar .nav-collapse li a.active {
    border-left: 3px solid #c08a2e;
    padding-left: 6px !important;
    background: #fffdf8 !important;
    color: #13574c !important;
    font-weight: 800;
}
body.admin-body #figa-sidebar .nav-collapse li a.active .sub-item { color: inherit !important; }
body.admin-body #figa-sidebar .figa-sidebar-close { display: none; }

/* Metric rows use a strict two-column contract so labels never run into values. */
body.admin-body .figa-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}
body.admin-body .figa-kpi {
    display: grid !important;
    min-width: 0;
    min-height: 78px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    padding: 13px 15px;
}
body.admin-body .figa-kpi span,
body.admin-body .figa-kpi small {
    min-width: 0;
    overflow-wrap: anywhere;
}
body.admin-body .figa-kpi span { line-height: 1.25; }
body.admin-body .figa-kpi strong {
    min-width: 2ch;
    white-space: nowrap;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
body.admin-body .figa-kpi small { line-height: 1.25; }

body.admin-body .figa-register-list--stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
    background: transparent;
}
body.admin-body .figa-register-list--stats .figa-register {
    min-width: 0;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid var(--figa-shell-line) !important;
    border-radius: 8px;
    background: var(--figa-shell-paper);
}

@media (min-width: 992px) {
    :root { --sidebar-space: var(--figa-shell-sidebar); }
    body.admin-body .wrapper .sidebar,
    body.admin-body .wrapper #figa-sidebar,
    body.admin-body .wrapper .logo-header {
        width: var(--figa-shell-sidebar) !important;
    }
    body.admin-body .main-panel {
        width: calc(100% - var(--figa-shell-sidebar)) !important;
        max-width: calc(100% - var(--figa-shell-sidebar)) !important;
        margin-left: var(--figa-shell-sidebar) !important;
    }
    body.admin-body .main-header {
        left: var(--figa-shell-sidebar) !important;
        width: calc(100% - var(--figa-shell-sidebar)) !important;
    }
    body.admin-body .wrapper.sidebar_minimize .sidebar,
    body.admin-body .wrapper.sidebar_minimize #figa-sidebar,
    body.admin-body .wrapper.sidebar_minimize .logo-header,
    body.admin-body .wrapper.sidebar_minimize_hover .sidebar,
    body.admin-body .wrapper.sidebar_minimize_hover #figa-sidebar,
    body.admin-body .wrapper.sidebar_minimize_hover .logo-header {
        width: var(--figa-shell-rail) !important;
    }
    body.admin-body .wrapper.sidebar_minimize.sidebar_minimize_hover .sidebar,
    body.admin-body .wrapper.sidebar_minimize.sidebar_minimize_hover #figa-sidebar,
    body.admin-body .wrapper.sidebar_minimize.sidebar_minimize_hover .logo-header {
        width: var(--figa-shell-sidebar) !important;
    }
    body.admin-body .wrapper.sidebar_minimize .main-panel,
    body.admin-body .wrapper.sidebar_minimize_hover .main-panel {
        width: calc(100% - var(--figa-shell-rail)) !important;
        max-width: calc(100% - var(--figa-shell-rail)) !important;
        margin-left: var(--figa-shell-rail) !important;
    }
    body.admin-body .wrapper.sidebar_minimize .main-header,
    body.admin-body .wrapper.sidebar_minimize_hover .main-header {
        left: var(--figa-shell-rail) !important;
        width: calc(100% - var(--figa-shell-rail)) !important;
    }
    body.admin-body .wrapper.sidebar_minimize #figa-sidebar .sidebar-content,
    body.admin-body .wrapper.sidebar_minimize_hover #figa-sidebar .sidebar-content {
        padding-inline: 8px;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    body.admin-body .figa-kpi-strip { gap: 8px; }
    body.admin-body .figa-register-list--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
    body.admin-body #figa-sidebar {
        width: min(286px, calc(100vw - 42px)) !important;
    }
    body.admin-body #figa-sidebar .sidebar-wrapper {
        top: 0 !important;
    }
    body.admin-body #figa-sidebar > .scroll-wrapper.sidebar-wrapper {
        top: var(--figa-shell-header-current) !important;
        height: calc(100dvh - var(--figa-shell-header-current)) !important;
        max-height: calc(100dvh - var(--figa-shell-header-current)) !important;
    }
    body.admin-body #figa-sidebar .figa-sidebar-close { display: inline-flex; }
    body.admin-body .figa-kpi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    body.admin-body .figa-kpi-strip { grid-template-columns: 1fr; gap: 8px; }
    body.admin-body .figa-kpi { min-height: 68px; }
    body.admin-body .figa-register-list--stats { grid-template-columns: 1fr; gap: 8px; }
}

/*
 * FIGA data-surface contract — authoritative final layer.
 * The shell closure above remains intact; this layer only reconciles the
 * shared register, metric, panel and table geometry after all legacy rules.
 */
:root {
    --figa-surface-gap: 14px;
    --figa-surface-radius: 9px;
    --figa-surface-line: #c7d8d0;
    --figa-surface-line-soft: #dce7e2;
    --figa-surface-wash: #f5f9f6;
}

body.admin-body .figa-analysis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--figa-surface-gap);
    align-items: stretch;
}

body.admin-body .figa-analysis > .figa-panel {
    display: flex;
    min-height: 0;
    flex-direction: column;
}

body.admin-body .figa-analysis > .figa-panel > .figa-panel__body {
    flex: 1 1 auto;
}

/*
 * Agropole uses the same page axis as the other institutional dashboards.
 * Keep this override route-scoped: the shared .figa-ops max-width is useful
 * for analytical surfaces, but must not introduce a second inset on this
 * register when the shell already provides the page gutter.
 */
body.admin-body .figa-ops--agropole {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    min-width: 0;
}

body.admin-body .figa-ops--agropole > * {
    min-width: 0;
    max-width: 100%;
}

body.admin-body .figa-ops--agropole .figa-analysis {
    min-width: 0;
}

body.admin-body .figa-agropole-catalogue .figa-panel__body {
    display: grid;
    gap: 20px;
}

body.admin-body .figa-agropole-group {
    min-width: 0;
}

body.admin-body .figa-agropole-group h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: var(--figa-text);
}

body.admin-body .figa-agropole-group h4 {
    margin: 15px 0 8px;
    font-size: .9rem;
    color: var(--figa-text-soft);
}

@media (max-width: 991px) {
    body.admin-body .figa-ops--agropole {
        width: 100%;
        max-width: 100%;
    }
}

body.admin-body .figa-panel,
body.admin-body .figa-chart-panel {
    min-width: 0;
    border: 1px solid var(--figa-surface-line) !important;
    border-radius: var(--figa-surface-radius) !important;
    box-shadow: 0 2px 8px rgba(18, 75, 74, .055) !important;
}

body.admin-body .figa-panel__head,
body.admin-body .figa-panel-heading {
    border-bottom: 1px solid var(--figa-surface-line-soft);
}

body.admin-body .figa-panel__head h2,
body.admin-body .figa-panel-heading h2,
body.admin-body .figa-section-heading h2 {
    font-size: 1.05rem;
    line-height: 1.25;
}

body.admin-body .figa-panel__head small,
body.admin-body .figa-chart-note,
body.admin-body .figa-legend,
body.admin-body .figa-section-heading > span {
    font-size: .78rem;
}

body.admin-body .figa-kicker,
body.admin-body .figa-eyebrow,
body.admin-body .figa-panel-index {
    font-size: .75rem;
    line-height: 1.25;
}

/* One row contract for links and legacy permission-gated metric cards. */
body.admin-body .figa-register-list {
    gap: 0;
    border: 1px solid var(--figa-surface-line);
    border-radius: var(--figa-surface-radius);
    background: var(--white-color);
    overflow: hidden;
}

body.admin-body .figa-register-list--directory {
    grid-template-columns: repeat(2, minmax(320px, 1fr));
}

body.admin-body .figa-register-list--stats {
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 0;
}

body.admin-body .figa-register,
body.admin-body .figa-register-list > .card,
body.admin-body .figa-register-list--metrics > .card {
    box-sizing: border-box;
    min-width: 0;
    min-height: 72px;
    margin: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--figa-surface-line) !important;
    border-right: 1px solid var(--figa-surface-line) !important;
    border-radius: 0 !important;
    background: var(--white-color) !important;
    box-shadow: none !important;
}

body.admin-body .figa-register-list--directory > .figa-register,
body.admin-body .figa-register-list--stats > .figa-register,
body.admin-body .figa-register-list--directory > .card,
body.admin-body .figa-register-list--stats > .card {
    height: auto !important;
    min-height: 78px !important;
}

body.admin-body .figa-register {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) minmax(2.5rem, auto) 14px;
    align-items: center;
    gap: 11px;
    padding: 12px 15px !important;
    color: var(--figa-ink, var(--primary-color));
    transition: background-color .16s ease, border-color .16s ease;
}

body.admin-body .figa-register:nth-child(even),
body.admin-body .figa-register:nth-child(odd),
body.admin-body .figa-register:nth-child(even):hover {
    padding-left: 15px;
    padding-right: 15px;
}

body.admin-body .figa-register-list > :nth-child(even) {
    border-right: 0 !important;
}

body.admin-body .figa-register-list > :nth-last-child(-n+2) {
    border-bottom: 0 !important;
}

body.admin-body .figa-register:hover,
body.admin-body .figa-register-list > .card:hover,
body.admin-body .figa-register-list > .card:focus-within {
    background: var(--figa-surface-wash) !important;
}

body.admin-body .figa-register b {
    display: block;
    min-width: 0;
    font-size: .86rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
    white-space: normal;
}

body.admin-body .figa-register small {
    display: block;
    min-width: 0;
    margin-top: 4px;
    font-size: .75rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
    white-space: normal;
}

body.admin-body .figa-register > strong {
    min-width: 2.5rem;
    color: var(--primary-color);
    font-size: 1.18rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

body.admin-body .figa-register-list > .card .card-body {
    min-height: 72px;
    padding: 12px 15px !important;
}

body.admin-body .figa-register-list > .card .numbers {
    min-width: 0;
    align-items: center;
}

body.admin-body .figa-register-list > .card .card-category {
    min-width: 0;
    font-size: .86rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
    white-space: normal;
}

body.admin-body .figa-register-list > .card .card-title {
    margin-left: auto;
    font-size: 1.18rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

body.admin-body .table-responsive {
    max-height: none !important;
    height: auto !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

body.admin-body .table-responsive > table {
    min-width: 720px;
}

body.admin-body .table td,
body.admin-body .table th {
    min-height: 42px;
    font-size: .82rem !important;
    line-height: 1.35;
}

/* Chart wrappers grow from their content; they no longer reserve dead space. */
body.admin-body .figa-chart-frame,
body.admin-body .figa-panel--compact .figa-chart-frame {
    min-height: 0;
    height: auto;
    padding: 14px 16px;
}

body.admin-body .figa-chart-frame canvas {
    max-height: 240px;
}

body.admin-body .figa-split-list {
    gap: 14px;
}

body.admin-body .figa-split-list__meta {
    font-size: .82rem;
}

@media (max-width: 1199px) and (min-width: 768px) {
    body.admin-body .figa-register-list--directory {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
    }
}

@media (max-width: 767px) {
    body.admin-body .figa-register-list--directory,
    body.admin-body .figa-register-list--stats {
        grid-template-columns: 1fr;
    }

    body.admin-body .figa-register-list > .figa-register,
    body.admin-body .figa-register-list > .card {
        border-right: 0 !important;
    }

    body.admin-body .figa-register-list > :last-child {
        border-bottom: 0 !important;
    }

    body.admin-body .figa-analysis {
        grid-template-columns: 1fr;
    }
}

/*
 * Canonical navigation context on every authenticated screen.
 * KaiAdmin reserves 69px above the container and a legacy rule adds another
 * 16px inside it; align the shared breadcrumb with the actual 58px header.
 */
body.admin-body .main-panel > .container {
    margin-top: var(--figa-shell-header) !important;
    overflow: visible !important;
}

/* The header is part of the panel flow.  On the drawer workspace the
   historical reservation above the container double-counted its height:
   the heading then started 66px below a 58px header and sticky positioning
   could never meet the header after scrolling. */
@media (max-width: 991px) {
    body.admin-body .main-panel > .container {
        margin-top: 0 !important;
    }
}

body.admin-body .main-panel > .container > .page-inner {
    padding-top: 8px !important;
}

body.admin-body {
    height: 100dvh;
    overflow-y: hidden;
}

body.admin-body .main-panel {
    height: 100dvh;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
}

body.admin-body .page-heading {
    position: static !important;
    top: auto !important;
    z-index: auto;
    background: #f3f7f4 !important;
    box-shadow: none;
    isolation: auto;
}

/* Shared closure: one compact navigation context and readable operational data. */
body.admin-body .page-heading {
    min-height: 0 !important;
}

body.admin-body .back {
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    line-height: 1 !important;
}

body.admin-body .back > i {
    width: auto;
    height: auto;
    margin: 0;
    font-size: 14px !important;
    line-height: 1 !important;
}

body.admin-body :where(.btn, button, a) > :where(
    .fa-arrow-left,
    .fas.fa-arrow-left,
    .far.fa-arrow-left
) {
    flex: 0 0 auto;
    width: auto;
    height: auto;
    margin: 0;
    font-size: 14px !important;
    line-height: 1 !important;
    vertical-align: middle;
}

body.admin-body :where(.figa-actions, .figa-form-actions) > .btn:has(
    :where(.fa-arrow-left, .fas.fa-arrow-left, .far.fa-arrow-left)
) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/*
 * Shared icon contract: informative glyphs must remain crisp and readable.
 * Sidebar icons keep their own navigation states and semantic colours.
 */
body.admin-body :where(
    .card-stats .icon-big,
    .app-panel .icon,
    .figa-register__icon,
    .figa-register-list > .card .icon-big
) {
    display: inline-grid !important;
    place-items: center;
    flex: 0 0 34px;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px;
    min-height: 34px;
    border: 1px solid #a9c9bb !important;
    border-radius: 7px !important;
    background: #dcece4 !important;
    color: #0d5948 !important;
    line-height: 1 !important;
    opacity: 1 !important;
    box-shadow: none !important;
}

body.admin-body :where(
    .card-stats .icon-big,
    .app-panel .icon,
    .figa-register__icon,
    .figa-register-list > .card .icon-big
) > i {
    display: block;
    margin: 0 !important;
    color: inherit !important;
    font-size: 15px !important;
    line-height: 1 !important;
    opacity: 1 !important;
    filter: none !important;
    text-shadow: none !important;
    transform: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.admin-body .card-stats .icon-big > i,
body.admin-body .app-panel .icon > i,
body.admin-body .figa-register-list > .card .icon-big > i {
    color: #0d5948 !important;
}

body.admin-body .figa-register:nth-child(3n) .figa-register__icon {
    border-color: #d2b46f !important;
    background: #f4e6c7 !important;
    color: #684707 !important;
}

body.admin-body .figa-register__arrow {
    color: #58756a !important;
    font-size: 13px !important;
    line-height: 1 !important;
    opacity: 1 !important;
    filter: none !important;
}

body.admin-body :where(.filter, .dashboard-filter) :where(
    .accordion-button,
    .card-title,
    h2,
    h3
) > i {
    color: #0d5948 !important;
    font-size: 17px !important;
    line-height: 1 !important;
    opacity: 1 !important;
    filter: none !important;
    text-shadow: none !important;
}

body.admin-body .btn > i {
    color: inherit;
    opacity: 1 !important;
    filter: none !important;
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/*
 * Operational tables use the main panel as their only vertical scroller.
 * The JS mirror below the sticky page heading supplies the persistent header,
 * while this wrapper owns horizontal overflow only when columns need it.
 */
body.admin-body .table-responsive,
body.admin-body .figa-panel .table-responsive,
body.admin-body .figa-data-surface .table-responsive {
    position: relative;
    max-width: 100%;
    max-height: none !important;
    height: auto !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-inline: contain;
    overscroll-behavior-block: auto;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

body.admin-body .table-responsive > table {
    width: 100% !important;
    min-width: 100% !important;
    margin-bottom: 0 !important;
}

body.admin-body .table-responsive :where(th, td) {
    overflow-wrap: anywhere;
    word-break: normal;
}

body.admin-body .table-responsive thead th,
body.admin-body .table-responsive tbody td:not(.text-end) {
    white-space: normal !important;
}

body.admin-body .table-responsive tbody td.text-end {
    white-space: nowrap;
}

body.admin-body .table-responsive :where(thead, thead th),
body.admin-body .table-responsive :where(th, td):first-child {
    position: static !important;
    left: auto !important;
    top: auto !important;
    box-shadow: none !important;
}

.figa-sticky-table-header {
    position: fixed;
    z-index: 890;
    display: none;
    overflow-x: auto;
    overflow-y: hidden;
    pointer-events: auto;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
    touch-action: pan-x;
    background: #edf3f0;
    border: 1px solid var(--figa-shell-line);
    border-top: 0;
    box-shadow: 0 4px 10px rgba(13, 45, 44, .1);
}

.figa-sticky-table-header::-webkit-scrollbar {
    display: none;
}

.figa-sticky-table-header.is-visible {
    display: block;
}

.figa-sticky-table-header table {
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.figa-sticky-table-header thead th {
    position: static !important;
    background: #e6f0eb !important;
    box-shadow: inset 0 -1px 0 #b7ccc2 !important;
}

.figa-table-scrollbar {
    width: 100%;
    height: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #f4f8f6;
    border-top: 1px solid var(--figa-shell-line);
    border-bottom: 1px solid var(--figa-shell-line);
    scrollbar-color: #789b8d #e8f0ec;
    scrollbar-width: thin;
    overscroll-behavior-inline: contain;
    touch-action: pan-x;
}

.figa-table-scrollbar[hidden] {
    display: none !important;
}

.figa-table-scrollbar__track {
    height: 1px;
}

body.admin-body .filter .accordion-button {
    justify-content: flex-start !important;
    min-height: 46px;
}

body.admin-body .filter .accordion-button::after {
    margin-left: auto;
}

body.admin-body .filter .filter-actions,
body.admin-body .filter :where(.grid-deux, .grid-trois, .grid-quatre) > div:last-child {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 8px;
}

body.admin-body .figa-register-list--metrics {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)) !important;
}

body.admin-body .figa-register-list--metrics > .card .row {
    flex-wrap: nowrap;
}

body.admin-body .figa-register-list--metrics > .card .col-stats {
    min-width: 0;
}

body.admin-body .figa-register-list--metrics > .card .numbers {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    width: 100%;
}

body.admin-body .figa-register-list--metrics > .card .card-category {
    overflow-wrap: normal;
    word-break: normal;
}

/* Header and page content share one horizontal grid at every viewport. */
body.admin-body .main-header .navbar-header > .container-fluid {
    padding-inline: 18px !important;
}

@media (min-width: 992px) {
    body.admin-body .main-header .navbar-header {
        padding-left: 0 !important;
    }
}

@media (min-width: 1200px) {
    body.admin-body .main-header .navbar-header > .container-fluid {
        padding-inline: 28px !important;
    }
}

/* Directory links and permission-gated role cards use the exact same columns. */
body.admin-body .figa-register-list--directory > :nth-child(odd) {
    border-right: 1px solid var(--figa-surface-line) !important;
}

body.admin-body .figa-register-list--directory > :nth-child(even) {
    border-right: 0 !important;
}

body.admin-body .figa-register-list--directory > .card .card-body {
    min-height: 78px;
    padding: 12px 15px !important;
}

body.admin-body .figa-register-list--directory > .card .card-body > .row {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) minmax(2.5rem, auto) 14px;
    align-items: center;
    gap: 11px;
    width: 100%;
    margin: 0 !important;
}

body.admin-body .figa-register-list--directory > .card .col-icon {
    grid-column: 1;
    width: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.admin-body .figa-register-list--directory > .card .col-stats,
body.admin-body .figa-register-list--directory > .card .numbers {
    display: contents !important;
}

body.admin-body .figa-register-list--directory > .card .card-category {
    grid-column: 2;
    margin: 0 !important;
}

body.admin-body .figa-register-list--directory > .card .card-title {
    grid-column: 3;
    min-width: 2.5rem;
    margin: 0 !important;
    text-align: right;
}

/* Summary groups stack because their internal cardinality is not comparable. */
body.admin-body .figa-stats-groups {
    grid-template-columns: minmax(0, 1fr) !important;
}

body.admin-body .figa-promoteurs-table {
    width: 100%;
    min-width: 680px;
    table-layout: fixed;
}

body.admin-body .figa-promoteurs-table th:nth-child(1) { width: 30%; }
body.admin-body .figa-promoteurs-table th:nth-child(2) { width: 18%; }
body.admin-body .figa-promoteurs-table th:nth-child(3) { width: 22%; }
body.admin-body .figa-promoteurs-table th:nth-child(4) { width: 10%; }
body.admin-body .figa-promoteurs-table th:nth-child(5) { width: 20%; }

body.admin-body .figa-promoteurs-table td {
    overflow-wrap: anywhere;
    white-space: normal;
}

body.admin-body .figa-promoteurs-table__projects,
body.admin-body .figa-promoteurs-table__actions {
    overflow-wrap: normal !important;
    white-space: nowrap !important;
}

/*
 * Quiet shared hierarchy: the breadcrumb already carries taxonomy, so body
 * introductions and section headers should not announce the same context twice.
 */
body.admin-body :where(.figa-ops__intro, .figa-dashboard__intro) {
    align-items: flex-start;
    margin-bottom: 12px !important;
}

body.admin-body :where(.figa-ops__intro, .figa-dashboard__intro)
    :where(.figa-kicker, .figa-eyebrow) {
    display: none !important;
}

body.admin-body :where(.figa-ops__intro, .figa-dashboard__intro) h1 {
    margin: 0 0 3px !important;
    font-size: clamp(1.35rem, 2vw, 1.65rem) !important;
    line-height: 1.15;
    letter-spacing: -.035em;
}

body.admin-body :where(.figa-ops__intro, .figa-dashboard__intro) h1 + p {
    max-width: 72ch;
    margin: 0 !important;
    color: var(--figa-text-soft) !important;
    font-size: .82rem !important;
    line-height: 1.4;
}

body.admin-body .figa-section-heading {
    align-items: center;
    min-height: 30px;
    margin: 0 0 8px !important;
}

body.admin-body .figa-section-heading > div {
    display: contents;
}

body.admin-body .figa-section-heading .figa-eyebrow,
body.admin-body .figa-section-heading > span,
body.admin-body .figa-panel__head > .figa-kicker,
body.admin-body .figa-panel-heading .figa-eyebrow,
body.admin-body .figa-panel-heading .figa-panel-index {
    display: none !important;
}

body.admin-body .figa-section-heading h2 {
    margin: 0 !important;
    color: var(--figa-ink);
    font-size: 1rem !important;
    line-height: 1.25;
    letter-spacing: -.02em;
}

body.admin-body .figa-panel-heading {
    align-items: center;
}

body.admin-body .figa-panel-heading > div {
    display: contents;
}

body.admin-body .figa-panel-heading h2 {
    margin: 0 !important;
    font-size: 1rem !important;
    line-height: 1.25;
    letter-spacing: -.02em;
}

body.admin-body .figa-register-list--stats {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-rows: 1fr;
    margin-bottom: 14px !important;
}

body.admin-body .figa-register-list--stats .figa-register {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 62px;
    padding: 10px 12px !important;
}

body.admin-body .figa-register-list--stats .figa-register small {
    display: none !important;
}

body.admin-body .figa-register-list--stats .figa-register b {
    overflow: visible;
    line-height: 1.25;
    text-overflow: clip;
    white-space: normal;
}

body.admin-body .figa-register-list--stats .figa-register > strong {
    min-width: 2ch;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 1199px) {
    body.admin-body .figa-stats-groups {
        grid-template-columns: 1fr;
    }

    body.admin-body .figa-form-guide {
        grid-template-columns: 1fr;
        align-items: start;
    }

    body.admin-body .figa-form-nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
        width: 100%;
    }

    body.admin-body .figa-form-nav a {
        min-width: 0;
        white-space: normal;
    }

    body.admin-body .figa-register-list--stats {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 767px) {
    body.admin-body .figa-register-list--stats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 479px) {
    body.admin-body .figa-register-list--stats {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 700px) {
    body.admin-body .figa-register-list--directory {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.admin-body .figa-register-list--directory > * {
        border-right: 0 !important;
    }

    body.admin-body .figa-register-list--directory > :not(:last-child) {
        border-bottom: 1px solid var(--figa-surface-line) !important;
    }

    body.admin-body .figa-register-list--directory > :last-child {
        border-bottom: 0 !important;
    }

    body.admin-body .figa-register-list--metrics {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (max-width: 767px) {
    body.admin-body .table-responsive > table {
        min-width: min(680px, calc(100vw + 260px)) !important;
    }
}

body.admin-body .table-responsive > table:has(thead th:nth-child(6)) {
    min-width: max(960px, 100%) !important;
}

body.admin-body .table-responsive > table:has(thead th:nth-child(7)) {
    min-width: max(1120px, 100%) !important;
}

@media print {
    body.admin-body .page-heading {
        position: static !important;
        box-shadow: none;
    }

    .figa-sticky-table-header {
        display: none !important;
    }
}

/* Final dynamic-UI contract: keep guided forms and animated copy stable after
   Turbo and LiveComponent replacements at every supported viewport. */
body.admin-body .figa-form-guide {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    overflow: visible;
}

body.admin-body .figa-form-guide__intro,
body.admin-body .figa-form-guide__intro > * {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

body.admin-body .figa-form-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    width: 100%;
    max-width: 100%;
    gap: 6px;
    overflow: visible;
}

body.admin-body .figa-form-nav a {
    min-width: 0;
    width: 100%;
    min-height: 40px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.figa-typed {
    display: inline-block;
    min-width: 0;
    max-width: 100%;
    min-height: 1.45em;
    height: auto !important;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.figa-remember {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 44px;
}

.figa-remember .form-check-input {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0 !important;
}

.figa-remember .form-check-label {
    display: inline;
    min-width: 0;
    margin: 0;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

@media (max-width: 360px) {
    body.admin-body .figa-form-nav {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .figa-typed + .typed-cursor {
        display: none !important;
    }
}

/*
 * The header already belongs to the main panel's flow. Its live measured
 * height positions the sticky context; reserving it again here would make
 * content collapse beneath or leave a duplicate gap on compact screens.
 */
@media (max-width: 991px) {
    body.admin-body .main-panel {
        padding-top: 0 !important;
    }

    body.admin-body .main-panel > .container {
        margin-top: var(--figa-shell-header-current) !important;
    }
}

/* One fixed navigation layer, one measured reservation, and one scroll owner.
   The page breadcrumb joins the header; page titles/actions remain in flow. */
body.admin-body .main-header {
    position: fixed !important;
    top: 0 !important;
    z-index: 1000 !important;
}
body.admin-body .main-header.figa-has-breadcrumb {
    height: auto !important;
}
body.admin-body .figa-shell-breadcrumb-slot {
    display: none;
}
body.admin-body .figa-has-breadcrumb .figa-shell-breadcrumb-slot {
    display: block;
    padding: 5px 18px 7px;
    background: var(--figa-shell-paper);
    border-top: 1px solid var(--figa-shell-line);
}
body.admin-body .figa-shell-breadcrumb-slot .figa-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0 6px;
    margin: 0 !important;
    line-height: 1.4;
}
body.admin-body .page-heading[hidden] {
    display: none !important;
}
@media (max-width: 991px) {
    body.admin-body .figa-has-breadcrumb .figa-shell-breadcrumb-slot {
        padding-inline: 12px;
    }
}
body.admin-body .main-panel {
    padding-top: 0 !important;
    scroll-padding-top: calc(var(--figa-shell-header-current) + 8px);
}
body.admin-body .main-panel > .container {
    margin-top: var(--figa-shell-header-current) !important;
}
body.admin-body .modal-backdrop { z-index: 1205; }
body.admin-body .modal { z-index: 1210; }

@media (max-width: 390px) {
    body.admin-body .main-header,
    body.admin-body .main-header .navbar-header,
    body.admin-body .main-header .navbar-header > .container-fluid {
        min-height: 74px !important;
    }
    body.admin-body .main-header .header-context { margin-top: 4px; }
}

/* This final action-cell rule intentionally wins over older register-specific
   nowrap declarations that otherwise clip the last operation on desktop. */
body.admin-body td.figa-table-actions {
    white-space: normal !important;
}

/* The authenticated header must be a real opaque layer while the workspace
   scrolls underneath it. Keep it below drawers/modals and above page context. */
@media (max-width: 991px) {
    body.admin-body .main-header {
        height: auto !important;
        z-index: 1000 !important;
        isolation: isolate;
        background: var(--figa-shell-paper) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    body.admin-body .main-header .navbar-header,
    body.admin-body .main-header .navbar-header > .container-fluid {
        height: auto !important;
        background: var(--figa-shell-paper) !important;
    }
}

/* Final width contract: FIGA never uses horizontal scrolling. Historical
   minimum widths and overflow rules above are intentionally neutralized. */
html,
body,
body.admin-body,
body.admin-body .wrapper,
body.admin-body .main-panel,
body.admin-body .main-panel > .container,
body.admin-body .page-inner {
    max-width: 100%;
    overflow-x: clip !important;
}

body.admin-body .table-responsive,
body.admin-body .figa-panel .table-responsive,
body.admin-body .figa-data-surface .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: clip !important;
}

body.admin-body .table-responsive > table,
body.admin-body .page-inner .table-responsive > .table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

body.admin-body .table-responsive :where(th, td) {
    min-width: 0 !important;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

body.admin-body .figa-analytics-nav {
    overflow-x: hidden !important;
    flex-wrap: wrap !important;
}

body.admin-body .figa-table-scrollbar {
    display: none !important;
}

body.admin-body .figa-sticky-table-header {
    overflow-x: clip !important;
}

body.admin-body .figa-promoteurs-table {
    table-layout: fixed;
}

body.admin-body .figa-promoteurs-table td.figa-table-actions {
    width: 148px;
    white-space: nowrap !important;
}

body.admin-body .figa-promoteurs-table td.figa-table-actions .btn,
body.admin-body .page-inner .figa-promoteurs-table .figa-table-edit {
    position: relative;
    width: 32px;
    min-width: 32px !important;
    min-height: 32px;
    padding: 5px !important;
    margin: 1px !important;
}

body.admin-body .figa-promoteurs-table td.figa-table-actions .btn > span {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body.admin-body .figa-promoteurs-table__action-group {
    gap: 1px;
}

@media (min-width: 1200px) {
    body.admin-body .figa-compact-actions-table :where(th, td):last-child,
    body.admin-body .figa-structures-table :where(th, td):last-child {
        width: 220px !important;
        min-width: 220px !important;
        white-space: nowrap !important;
    }

    body.admin-body .figa-business-plans-table :where(th, td):last-child {
        width: 96px !important;
        min-width: 96px !important;
    }

    body.admin-body .figa-users-table :where(th, td):last-child {
        width: 112px !important;
        min-width: 112px !important;
    }
}

@media (max-width: 1199px) {
    body.admin-body .figa-responsive-register {
        table-layout: fixed;
    }

    body.admin-body .figa-responsive-register :where(th, td) {
        min-width: 0 !important;
        overflow-wrap: anywhere;
    }

    body.admin-body .figa-compact-actions-table td.figa-table-actions {
        white-space: nowrap !important;
    }

    body.admin-body .figa-compact-actions-table td.figa-table-actions .btn,
    body.admin-body .figa-compact-actions-table td.figa-table-actions .figa-table-edit {
        position: relative;
        width: 32px;
        min-width: 32px !important;
        min-height: 32px;
        padding: 5px !important;
        margin: 1px !important;
    }

    body.admin-body .figa-compact-actions-table td.figa-table-actions .btn > span,
    body.admin-body .figa-compact-actions-table td.figa-table-actions .figa-table-edit > span {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    body.admin-body .figa-business-plans-table :where(th, td):last-child {
        width: 48px !important;
        min-width: 48px !important;
    }

    body.admin-body .figa-formations-table :where(th, td):last-child {
        width: 184px !important;
        min-width: 184px !important;
    }

    body.admin-body .figa-institutions-table :where(th, td):last-child,
    body.admin-body .figa-structures-table :where(th, td):last-child {
        width: 132px !important;
        min-width: 132px !important;
    }

    body.admin-body .figa-users-table :where(th, td):last-child {
        width: 96px !important;
        min-width: 96px !important;
    }

    body.admin-body .figa-promoteurs-table :where(th, td):last-child {
        width: 156px !important;
        min-width: 156px !important;
    }

    body.admin-body .figa-promoteurs-table :where(th, td):nth-child(2),
    body.admin-body .figa-business-plans-table :where(th, td):nth-child(3),
    body.admin-body .figa-business-plans-table :where(th, td):nth-child(5),
    body.admin-body .figa-formations-table :where(th, td):nth-child(3),
    body.admin-body .figa-formations-table :where(th, td):nth-child(4),
    body.admin-body .figa-formations-table :where(th, td):nth-child(2),
    body.admin-body .figa-institutions-table :where(th, td):nth-child(2),
    body.admin-body .figa-institutions-table :where(th, td):nth-child(3),
    body.admin-body .figa-structures-table :where(th, td):nth-child(3),
    body.admin-body .figa-users-table :where(th, td):nth-child(2),
    body.admin-body .figa-users-table :where(th, td):nth-child(3),
    body.admin-body .figa-users-table :where(th, td):nth-child(4) {
        display: none !important;
    }
}

@media (min-width: 992px) and (max-width: 1024px) {
    body.admin-body .figa-users-table tbody td:not(.figa-table-actions) {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap !important;
        overflow-wrap: normal;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    body.admin-body .figa-formations-table :where(th, td):first-child,
    body.admin-body .figa-institutions-table :where(th, td):first-child {
        width: 30% !important;
    }

    body.admin-body .figa-formations-table td:first-child .figa-cell-clamp,
    body.admin-body .figa-institutions-table td:first-child .figa-cell-clamp {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    body.admin-body .figa-formations-table td:nth-child(5) a span {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 1199px) {
    body.admin-body .figa-promoteurs-table td.figa-table-actions {
        width: 148px;
    }
}

@media (max-width: 767px) {
    body.admin-body .figa-business-plans-table :where(th, td):nth-child(3),
    body.admin-body .figa-business-plans-table :where(th, td):nth-child(5),
    body.admin-body .figa-formations-table :where(th, td):nth-child(2),
    body.admin-body .figa-formations-table :where(th, td):nth-child(3),
    body.admin-body .figa-formations-table :where(th, td):nth-child(4),
    body.admin-body .figa-institutions-table :where(th, td):nth-child(2),
    body.admin-body .figa-institutions-table :where(th, td):nth-child(4),
    body.admin-body .figa-institutions-table :where(th, td):nth-child(5),
    body.admin-body .figa-users-table :where(th, td):nth-child(2),
    body.admin-body .figa-users-table :where(th, td):nth-child(3),
    body.admin-body .figa-users-table :where(th, td):nth-child(4) {
        display: none !important;
    }

    body.admin-body .figa-responsive-register,
    body.admin-body .figa-responsive-register tbody {
        display: block;
        width: 100%;
    }

    body.admin-body .figa-responsive-register thead {
        display: none;
    }

    body.admin-body .figa-responsive-register tbody > tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        margin: 10px;
        overflow: hidden;
        border: 1px solid var(--figa-shell-line);
        border-radius: 10px;
        background: var(--figa-shell-paper);
    }

    body.admin-body .figa-responsive-register tbody > tr > td {
        display: grid;
        grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
        align-items: center;
        width: 100% !important;
        min-height: 42px;
        padding: 9px 12px !important;
        text-align: left !important;
        border: 0 !important;
        border-bottom: 1px solid var(--figa-shell-line) !important;
        white-space: normal !important;
    }

    body.admin-body .figa-responsive-register tbody > tr > td:last-child {
        border-bottom: 0 !important;
    }

    body.admin-body .figa-responsive-register tbody > tr > td::before {
        color: var(--figa-shell-muted);
        font-size: 12px !important;
        font-weight: 700;
        letter-spacing: .02em;
    }

    body.admin-body .figa-business-plans-table td:nth-child(1)::before { content: "Promoteur"; }
    body.admin-body .figa-business-plans-table td:nth-child(2)::before { content: "Projet"; }
    body.admin-body .figa-business-plans-table td:nth-child(4)::before { content: "Statut"; }
    body.admin-body .figa-business-plans-table td:nth-child(6)::before { content: "Actions"; }
    body.admin-body .figa-formations-table td:nth-child(1)::before { content: "Formation"; }
    body.admin-body .figa-formations-table td:nth-child(5)::before { content: "Participants"; }
    body.admin-body .figa-formations-table td:nth-child(6)::before { content: "Statut"; }
    body.admin-body .figa-formations-table td:nth-child(7)::before { content: "Actions"; }
    body.admin-body .figa-institutions-table td:nth-child(1)::before { content: "Institution"; }
    body.admin-body .figa-institutions-table td:nth-child(3)::before { content: "Clients"; }
    body.admin-body .figa-institutions-table td:nth-child(6)::before { content: "Solde"; }
    body.admin-body .figa-institutions-table td:nth-child(7)::before { content: "Actions"; }
    body.admin-body .figa-users-table td:nth-child(1)::before { content: "Utilisateur"; }
    body.admin-body .figa-users-table td:nth-child(5)::before { content: "Accès"; }
    body.admin-body .figa-users-table td:nth-child(6)::before { content: "Actions"; }

    body.admin-body .figa-responsive-register td.figa-table-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 2px;
    }

    body.admin-body .figa-responsive-register td.figa-table-actions::before {
        flex: 0 0 36%;
        min-width: 92px;
        align-self: center;
    }

    body.admin-body .figa-responsive-register td.figa-table-actions > form {
        display: inline-flex;
    }

    body.admin-body .figa-responsive-register tbody > tr:has(td[colspan]) {
        display: block;
        margin: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    body.admin-body .figa-responsive-register tbody > tr > td[colspan] {
        display: block;
        min-height: 0;
        border: 0 !important;
    }

    body.admin-body .figa-responsive-register tbody > tr > td[colspan]::before {
        content: none;
    }

    body.admin-body .figa-promoteurs-table :where(th, td):nth-child(2),
    body.admin-body .figa-promoteurs-table :where(th, td):nth-child(3) {
        display: none;
    }

    body.admin-body .figa-promoteurs-table :where(th, td):first-child {
        width: auto;
    }

    body.admin-body .figa-promoteurs-table__projects {
        width: 52px;
    }

    body.admin-body .figa-promoteurs-table__actions {
        width: 78px !important;
    }

    body.admin-body .figa-promoteurs-table__action-group {
        flex-wrap: wrap;
    }
}

/* The legacy light-sidebar skin still carries an !important dark brand color.
   The institutional sidebar is dark, so lock every brand text node to a
   presentation-safe contrast at the final cascade position. */
body.admin-body #figa-sidebar .figa-brand .figa-brand__name,
body.admin-body #figa-sidebar .figa-brand .figa-brand__name strong {
    color: #f7fbf8 !important;
}

body.admin-body #figa-sidebar .figa-brand .figa-brand__name small {
    color: #f1c75b !important;
}

/* Numeric hierarchy: operational totals must be readable at a glance on every
   dashboard and register, including projected presentation screens. */
body.admin-body :is(
    .figa-kpi strong,
    .figa-register > strong,
    .figa-register-list--metrics .card-title,
    .dashboard-statistics .card-stats .card-title,
    .card-stats .numbers .card-title,
    .app-panel .count,
    .figa-summary-list--metrics strong,
    .figa-chart-note strong,
    .figa-legend b
) {
    color: #082f27 !important;
    font-weight: 850 !important;
    font-variant-numeric: tabular-nums;
    opacity: 1 !important;
}

body.admin-body :is(
    .figa-kpi strong,
    .figa-register > strong,
    .figa-register-list--metrics .card-title,
    .dashboard-statistics .card-stats .card-title,
    .card-stats .numbers .card-title,
    .app-panel .count
) {
    font-size: clamp(1.35rem, 1.9vw, 1.75rem) !important;
    line-height: 1 !important;
    letter-spacing: -.025em;
}

body.admin-body .figa-kpi::after {
    z-index: 0;
    pointer-events: none;
}

body.admin-body .figa-kpi > * {
    position: relative;
    z-index: 1;
}

/* Guarantee allocations carry three related amounts. Keep them together
   instead of spending three narrow columns that force users to zoom out. */
body.admin-body .figa-guarantees-table {
    table-layout: fixed;
}

body.admin-body .figa-guarantees-table :where(th, td):nth-child(1) { width: 28%; }
body.admin-body .figa-guarantees-table :where(th, td):nth-child(2) { width: 19%; }
body.admin-body .figa-guarantees-table :where(th, td):nth-child(3) { width: 28%; }
body.admin-body .figa-guarantees-table :where(th, td):nth-child(4) { width: 15%; }
body.admin-body .figa-guarantees-table :where(th, td):nth-child(5) { width: 10%; }

body.admin-body .figa-guarantees-table td:first-child {
    position: relative;
    overflow: hidden;
    padding-right: 18px !important;
}

body.admin-body .figa-guarantees-table td:first-child > strong {
    display: block;
    width: 100%;
    max-width: 100%;
    line-height: 1.25;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}

body.admin-body .figa-guarantees-table .allocation-list {
    position: relative;
    z-index: 1;
    background: var(--figa-shell-paper);
    overflow-wrap: anywhere;
}

body.admin-body .figa-guarantees-table td.figa-table-actions {
    padding-inline: 8px !important;
    text-align: center !important;
    white-space: normal !important;
}

body.admin-body .figa-guarantees-table td.figa-table-actions .btn,
body.admin-body .figa-guarantees-table td.figa-table-actions .figa-table-edit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px !important;
    height: 34px;
    min-height: 34px;
    margin: 2px 1px !important;
    padding: 0 !important;
    border: 1px solid #55917d !important;
    border-radius: 7px !important;
    background: #e0eee8 !important;
    color: #064d3d !important;
    box-shadow: 0 1px 2px rgba(8, 47, 39, .08);
}

body.admin-body .figa-guarantees-table td.figa-table-actions .btn:hover,
body.admin-body .figa-guarantees-table td.figa-table-actions .btn:focus-visible,
body.admin-body .figa-guarantees-table td.figa-table-actions .figa-table-edit:hover,
body.admin-body .figa-guarantees-table td.figa-table-actions .figa-table-edit:focus-visible {
    background: #d4e9df !important;
    border-color: #44816d !important;
    color: #042f26 !important;
}

body.admin-body .figa-guarantees-table td.figa-table-actions .figa-guarantee-details {
    border-color: #075442 !important;
    background: #075f49 !important;
    color: #ffffff !important;
}

body.admin-body .figa-guarantees-table td.figa-table-actions :is(.btn, .figa-table-edit) > span {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body.admin-body .figa-guarantees-table .figa-guarantee-details i {
    margin: 0 !important;
    color: inherit !important;
    font-size: 14px !important;
}

body.admin-body .figa-financial-summary {
    display: grid;
    gap: 5px;
    min-width: 0;
}

body.admin-body .figa-financial-summary > span {
    display: grid;
    grid-template-columns: minmax(72px, .8fr) minmax(0, 1fr);
    align-items: center;
    gap: 6px;
}

body.admin-body .figa-financial-summary small {
    color: var(--figa-shell-muted);
    font-size: 12px !important;
    line-height: 1.2;
}

body.admin-body .figa-financial-summary .badge {
    justify-self: start;
    max-width: 100%;
    white-space: normal;
}

@media (max-width: 1199px) {
    body.admin-body .garantie-register-scroll {
        overflow: visible;
        border: 0;
    }

    body.admin-body .figa-guarantees-table,
    body.admin-body .figa-guarantees-table tbody {
        display: block;
        width: 100%;
    }

    body.admin-body .figa-guarantees-table thead {
        display: none;
    }

    body.admin-body .figa-guarantees-table tbody > tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin: 0 0 12px;
        overflow: hidden;
        border: 1px solid var(--figa-shell-line);
        border-radius: 10px;
        background: var(--figa-shell-paper);
    }

    body.admin-body .figa-guarantees-table tbody > tr > td {
        display: grid;
        grid-template-columns: minmax(112px, 38%) minmax(0, 1fr);
        align-items: start;
        width: 100% !important;
        min-height: 46px;
        padding: 10px 12px !important;
        text-align: left !important;
        border: 0 !important;
        border-bottom: 1px solid var(--figa-shell-line) !important;
        white-space: normal !important;
    }

    body.admin-body .figa-guarantees-table tbody > tr > td::before {
        content: attr(data-label);
        color: var(--figa-shell-muted);
        font-size: 12px !important;
        font-weight: 700;
        line-height: 1.25;
    }

    body.admin-body .figa-guarantees-table tbody > tr > td.figa-table-actions {
        display: flex;
        align-items: center;
        gap: 3px;
    }

    body.admin-body .figa-guarantees-table td.figa-table-actions::before {
        flex: 0 0 38%;
        min-width: 112px;
    }

    body.admin-body .figa-guarantees-table tbody > tr:has(td[colspan]) {
        display: block;
        border: 0;
    }

    body.admin-body .figa-guarantees-table tbody > tr > td[colspan] {
        display: block;
        border: 0 !important;
    }

    body.admin-body .figa-guarantees-table tbody > tr > td[colspan]::before {
        content: none;
    }
}

@media (max-width: 767px) {
    body.admin-body .figa-guarantees-table tbody > tr {
        grid-template-columns: minmax(0, 1fr);
        margin: 10px;
    }
}

/* User details: long labels and nested POST forms must fit the modal. */
.figa-modal .figa-user-detail-actions {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
}
.figa-modal .figa-user-detail-actions > *,
.figa-modal .figa-user-detail-actions .btn {
    min-width: 0;
    max-width: 100%;
}
.figa-modal .figa-user-detail-actions .btn {
    white-space: normal;
    overflow-wrap: anywhere;
}
@media (max-width: 575px) {
    .figa-modal .figa-user-detail-actions > .btn,
    .figa-modal .figa-user-detail-actions > form {
        flex: 1 1 100%;
        width: 100%;
    }
    .figa-modal .figa-user-detail-actions > form .btn {
        width: 100%;
    }
}
