/**
 * Fichier  : assets/css/reports-mobile.css
 * Auteur   : KREMER Régis
 * Version  : 2.6.85
 * Date     : 2026-07-20
 * Description : Rapports mobile/tablette — navigation, filtres, KPI, graphiques, cartes et tableau comparatif.
 *
 * Changelog :
 *   v2.6.85 (2026-07-20) — REPORTS MOBILE CARDS9 : conception tactile native des rapports.
 */

.reports-mobile-shell,
.reports-mobile-cards,
.reports-mobile-chart {
    display: none;
}

@media (max-width: 1199.98px) {
    #pgReports {
        --reports-mobile-gap: 12px;
        padding-bottom: calc(var(--ms-sticky-actions-height, 0px) + env(safe-area-inset-bottom, 0px) + 12px);
    }

    #pgReports .admin-page-hero {
        margin-bottom: 12px;
    }

    #pgReports .admin-page-hero__actions {
        display: none;
    }

    #pgReports .admin-page-hero__text {
        max-width: 70ch;
    }

    #pgReports .report-tabs {
        display: none !important;
    }

    .reports-mobile-shell {
        position: sticky;
        top: 0;
        z-index: 22;
        display: grid;
        gap: 10px;
        margin: 0 0 14px;
        padding: 10px;
        border: 1px solid var(--border, #dbe3ee);
        background: color-mix(in srgb, var(--surface, #fff) 94%, transparent);
        box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
        backdrop-filter: blur(12px);
    }

    .reports-mobile-selector {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) 28px;
        align-items: center;
        gap: 10px;
        width: 100%;
        min-height: 58px;
        padding: 8px 10px;
        border: 1px solid var(--border, #dbe3ee);
        background: var(--surface-2, #f8fafc);
        color: var(--text, #0f172a);
        text-align: left;
        cursor: pointer;
    }

    .reports-mobile-selector:focus-visible,
    .reports-mobile-quick:focus-visible,
    .reports-mobile-report-option:focus-visible,
    .reports-mobile-action-option:focus-visible {
        outline: 3px solid color-mix(in srgb, var(--primary, #2563eb) 40%, transparent);
        outline-offset: 2px;
    }

    .reports-mobile-selector__icon {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        border: 1px solid color-mix(in srgb, var(--primary, #2563eb) 28%, var(--border, #dbe3ee));
        background: color-mix(in srgb, var(--primary, #2563eb) 10%, var(--surface, #fff));
        color: var(--primary, #2563eb);
        font-size: 22px;
    }

    .reports-mobile-selector__copy {
        display: grid;
        min-width: 0;
        gap: 2px;
    }

    .reports-mobile-selector__copy strong {
        overflow: hidden;
        font-size: 16px;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .reports-mobile-selector__copy small {
        overflow: hidden;
        color: var(--text-muted, #64748b);
        font-size: 12px;
        line-height: 1.35;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .reports-mobile-selector__chevron {
        font-size: 24px;
        text-align: center;
    }

    .reports-mobile-quick-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .reports-mobile-quick {
        min-height: 48px;
        justify-content: center;
        gap: 8px;
    }

    .reports-mobile-count {
        display: inline-grid;
        place-items: center;
        min-width: 24px;
        height: 24px;
        padding: 0 7px;
        border-radius: 999px;
        background: var(--primary, #2563eb);
        color: #fff;
        font-size: 12px;
        font-weight: 800;
    }

    .reports-mobile-filter-summary {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
    }

    .reports-mobile-filter-summary:empty {
        display: none;
    }

    .reports-mobile-filter-chip {
        flex: 0 0 auto;
        max-width: 260px;
        overflow: hidden;
        padding: 6px 9px;
        border: 1px solid var(--border, #dbe3ee);
        background: var(--surface-2, #f8fafc);
        color: var(--text-muted, #64748b);
        font-size: 12px;
        font-weight: 650;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #pgReports .report-tab-content > .sect-toolbar,
    #pgReports .report-tab-content > .report-filter-bar,
    #pgReports #tabPrices > .filters-bar {
        display: none !important;
    }

    #pgReports .report-tab-content > .kpi-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    #pgReports .report-tab-content > .kpi-grid .kpi-card {
        min-width: 0;
        min-height: 104px;
        padding: 12px;
    }

    #pgReports .kpi-card .kpi-header {
        margin-bottom: 4px;
    }

    #pgReports .kpi-card .kpi-icon {
        width: 34px;
        height: 34px;
    }

    #pgReports .kpi-card .kpi-value {
        overflow-wrap: anywhere;
        font-size: clamp(20px, 5vw, 28px);
        line-height: 1.1;
    }

    #pgReports .kpi-card .kpi-label {
        font-size: 12px;
        line-height: 1.25;
    }

    .reports-mobile-chart,
    .reports-mobile-cards {
        display: block;
        margin: 0 0 12px;
    }

    .reports-mobile-chart {
        padding: 12px;
        border: 1px solid var(--border, #dbe3ee);
        background: var(--surface, #fff);
    }

    .reports-mobile-chart[hidden] {
        display: none !important;
    }

    .reports-mobile-section-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
    }

    .reports-mobile-section-heading > div {
        display: grid;
        gap: 2px;
    }

    .reports-mobile-section-heading span {
        color: var(--text-muted, #64748b);
        font-size: 11px;
        font-weight: 750;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .reports-mobile-section-heading strong {
        font-size: 15px;
    }

    .reports-mobile-chart__canvas {
        position: relative;
        height: 230px;
        min-height: 230px;
    }

    .reports-mobile-card-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    #pgReports .ms-entity-card {
        min-width: 0;
        box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
    }

    #pgReports .ms-entity-card[data-state="warning"] {
        border-inline-start: 4px solid var(--red, #dc2626);
    }

    #pgReports .ms-entity-card[data-state="ok"] {
        border-inline-start: 4px solid var(--green, #16a34a);
    }

    #pgReports .ms-entity-card__badge.is-danger {
        background: color-mix(in srgb, var(--red, #dc2626) 13%, var(--surface, #fff));
        color: var(--red, #dc2626);
    }

    #pgReports .ms-entity-card__badge.is-success {
        background: color-mix(in srgb, var(--green, #16a34a) 13%, var(--surface, #fff));
        color: var(--green, #16a34a);
    }

    #pgReports .ms-entity-card__badge.is-info {
        background: color-mix(in srgb, var(--primary, #2563eb) 13%, var(--surface, #fff));
        color: var(--primary, #2563eb);
    }

    #pgReports .ms-entity-card__field.is-danger dd {
        color: var(--red, #dc2626);
        font-weight: 800;
    }

    .reports-mobile-card-details {
        border-top: 1px solid var(--border, #dbe3ee);
    }

    .reports-mobile-card-details summary {
        min-height: 44px;
        display: flex;
        align-items: center;
        color: var(--primary, #2563eb);
        font-size: 13px;
        font-weight: 750;
        cursor: pointer;
    }

    .reports-mobile-card-details dl {
        display: grid;
        gap: 8px;
        margin: 0 0 10px;
    }

    .reports-mobile-card-details dl > div {
        display: grid;
        grid-template-columns: minmax(110px, .8fr) minmax(0, 1.2fr);
        gap: 10px;
        align-items: start;
    }

    .reports-mobile-card-details dt {
        color: var(--text-muted, #64748b);
        font-size: 12px;
        font-weight: 650;
    }

    .reports-mobile-card-details dd {
        min-width: 0;
        margin: 0;
        overflow-wrap: anywhere;
        font-size: 13px;
        text-align: right;
    }

    .reports-mobile-list-footer {
        display: grid;
        gap: 8px;
        justify-items: center;
        padding: 14px 0 4px;
        color: var(--text-muted, #64748b);
        font-size: 12px;
    }

    .reports-mobile-list-footer .btn {
        min-height: 46px;
    }

    .reports-mobile-empty {
        display: grid;
        min-height: 150px;
        place-content: center;
        gap: 6px;
        padding: 24px;
        border: 1px dashed var(--border, #dbe3ee);
        background: var(--surface, #fff);
        text-align: center;
    }

    .reports-mobile-empty span {
        color: var(--text-muted, #64748b);
        font-size: 13px;
    }

    #pgReports .reports-source-table-card {
        display: none;
    }

    #pgReports .report-tab-content.reports-mobile-table-mode .reports-source-table-card {
        display: block;
        overflow: hidden;
    }

    #pgReports .report-tab-content.reports-mobile-table-mode .reports-mobile-cards {
        display: none;
    }

    #pgReports .report-tab-content.reports-mobile-table-mode .table-container {
        display: block !important;
        overflow-x: auto !important;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }

    #pgReports .report-tab-content.reports-mobile-table-mode .data-table {
        display: table !important;
        min-width: 720px !important;
        width: 100% !important;
    }

    #pgReports .report-tab-content.reports-mobile-table-mode .data-table thead {
        display: table-header-group !important;
    }

    #pgReports .report-tab-content.reports-mobile-table-mode .data-table tbody {
        display: table-row-group !important;
    }

    #pgReports .report-tab-content.reports-mobile-table-mode .data-table tr {
        display: table-row !important;
    }

    #pgReports .report-tab-content.reports-mobile-table-mode .data-table th,
    #pgReports .report-tab-content.reports-mobile-table-mode .data-table td {
        display: table-cell !important;
        width: auto !important;
        min-height: 0 !important;
        padding: 10px 12px !important;
        text-align: left !important;
    }

    #pgReports .report-tab-content.reports-mobile-table-mode .data-table td::before {
        display: none !important;
        content: none !important;
    }

    .reports-mobile-report-list,
    .reports-mobile-action-list {
        display: grid;
        gap: 8px;
    }

    .reports-mobile-report-option,
    .reports-mobile-action-option {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 28px;
        align-items: center;
        gap: 10px;
        width: 100%;
        min-height: 58px;
        padding: 10px 12px;
        border: 1px solid var(--border, #dbe3ee);
        background: var(--surface, #fff);
        color: var(--text, #0f172a);
        text-align: left;
        cursor: pointer;
    }

    .reports-mobile-report-option.is-current {
        border-color: var(--primary, #2563eb);
        background: color-mix(in srgb, var(--primary, #2563eb) 8%, var(--surface, #fff));
    }

    .reports-mobile-report-option > span:first-child,
    .reports-mobile-action-option > span:first-child {
        display: grid;
        min-width: 0;
        gap: 3px;
    }

    .reports-mobile-report-option strong,
    .reports-mobile-action-option strong {
        font-size: 14px;
    }

    .reports-mobile-report-option small,
    .reports-mobile-action-option small {
        color: var(--text-muted, #64748b);
        font-size: 12px;
        line-height: 1.35;
    }

    .reports-mobile-filter-form {
        display: grid;
        gap: 14px;
    }

    .reports-mobile-filter-field {
        display: grid;
        gap: 6px;
    }

    .reports-mobile-filter-field label {
        color: var(--text-muted, #64748b);
        font-size: 12px;
        font-weight: 750;
    }

    .reports-mobile-filter-field input,
    .reports-mobile-filter-field select {
        width: 100%;
        min-height: 48px;
        font-size: 16px;
    }
}

@media (min-width: 600px) and (max-width: 1199.98px) {
    .reports-mobile-shell {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .reports-mobile-filter-summary {
        grid-column: 1 / -1;
    }

    .reports-mobile-quick-actions {
        grid-template-columns: repeat(2, minmax(132px, 1fr));
    }

    #pgReports .report-tab-content > .kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    #pgReports #tabValue > .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .reports-mobile-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reports-mobile-chart__canvas {
        height: 280px;
        min-height: 280px;
    }
}

@media (max-width: 599.98px) {
    #pgReports .admin-page-hero__text {
        display: none;
    }

    #pgReports .admin-page-hero {
        padding-block: 12px;
    }

    .reports-mobile-shell {
        margin-inline: -2px;
    }
}

@media print {
    .reports-mobile-shell,
    .reports-mobile-cards,
    .reports-mobile-chart {
        display: none !important;
    }

    #pgReports .reports-source-table-card {
        display: block !important;
    }
}
