:root {
    --md-orange: #FA5200;
    --md-orange-soft: #fff4ef;
    --md-dark: #404040;
    --md-text: #2e2e2e;
    --md-muted: #8a8a8a;
    --md-border: #eeeeee;
    --md-bg: #f8f8f8;
    --md-success: #28a65a;
    --md-warning: #e89b22;
    --md-danger: #d64545;
    --md-info: #3a6fd9;
    --shadow: 0 4px 18px rgba(64, 64, 64, .04);
    --md-gold: #FFD700;
}

.promo-type {
    transition: all 0.2s ease;
    cursor:pointer;
}

.promo-type:hover,
.promo-type.active {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.text-gold {

    color: var(--md-gold) !important;

}

* {
    box-sizing: border-box
}

html {
    font-size: 15px
}

body {
    margin: 0;
    background: var(--md-bg);
    color: var(--md-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-weight: 400;
    overflow-x: hidden
}

.app-shell {
    display: flex;
    min-height: 100vh
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    height: 100vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-right: 1px solid var(--md-border);
    padding: 20px 16px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 18px
}

.sidebar::-webkit-scrollbar {
    width: 7px
}

.sidebar::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 999px
}

.brand-area {
    padding: 8px 8px 18px;
    border-bottom: 1px solid var(--md-border)
}

.brand-logo {
    width: 154px;
    max-height: 68px;
    object-fit: contain;
    display: block;
    margin-bottom: 14px
}

.brand-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--md-orange-soft);
    color: var(--md-orange);
    border: 1px solid #ffd9c9;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: .72rem;
    font-weight: 600
}

.brand-title {
    margin-top: 11px;
    font-size: .96rem;
    line-height: 1.25;
    font-weight: 650;
    color: var(--md-dark)
}

.brand-subtitle {
    margin-top: 4px;
    font-size: .78rem;
    color: var(--md-muted);
    font-weight: 400
}

.nav-section-title {
    margin: 4px 9px 7px;
    color: #b0b0b0;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .66rem;
    font-weight: 600
}

.side-nav {
    display: grid;
    gap: 3px
}

.side-link {
    color: #626;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    font-weight: 450;
    font-size: .88rem;
    transition: .16s ease
}

.primary-link {
    color: var(--md-orange);
    text-decoration: underline dotted;
    text-underline-offset: 3px;

    display: flex;
    align-items: center;
    gap: 10px;

    border-radius: 12px;

    font-weight: 450;
    font-size: 0.88rem;

    transition: all 0.16s ease;
}
.muted-link {
    color: var(--md-muted);
    text-decoration: underline dotted;
    text-underline-offset: 3px;

    display: flex;
    align-items: center;
    gap: 10px;

    border-radius: 12px;

    font-weight: 450;
    /* font-size: 0.88rem; */

    transition: all 0.16s ease;
}

.side-link i {
    width: 18px;
    text-align: center;
    color: #9a9a9a;
    font-size: .92rem
}

.side-link:hover {
    background: #fafafa;
    color: var(--md-dark)
}

.side-link.active {
    background: var(--md-orange-soft);
    color: var(--md-orange);
    font-weight: 650
}

.side-link.active i {
    color: var(--md-orange)
}

.sidebar-footer {
    margin-top: auto;
    background: #fafafa;
    border: 1px solid var(--md-border);
    padding: 13px;
    border-radius: 16px
}

.sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--md-dark);
    font-size: .8rem;
    font-weight: 600
}

.pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--md-success);
    box-shadow: 0 0 0 0 rgba(40, 166, 90, .45);
    animation: pulse 1.8s infinite
}

@keyframes pulse {
    70% {
        box-shadow: 0 0 0 8px rgba(40, 166, 90, 0)
    }
}

.sidebar-footer small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-weight: 400
}

.main {
    margin-left: 270px;
    width: calc(100% - 270px);
    min-height: 100vh;
    padding: 22px 26px 32px
}

.topbar {
    background: #fff;
    border: 1px solid var(--md-border);
    border-radius: 20px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 14px;
    z-index: 10;
    box-shadow: var(--shadow)
}

.search-wrap {
    position: relative;
    flex: 1
}

.search-wrap i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: .88rem
}

.search-input {
    width: 100%;
    border: 1px solid var(--md-border);
    background: #fbfbfb;
    border-radius: 14px;
    padding: 10px 13px 10px 38px;
    outline: none;
    font-weight: 400;
    font-size: .88rem
}

.top-action {
    width: 39px;
    height: 39px;
    border-radius: 13px;
    border: 1px solid var(--md-border);
    background: #fff;
    display: grid;
    place-items: center;
    color: #6c6c6c;
    position: relative;
    font-size: .9rem
}

.top-action .dot {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 7px;
    height: 7px;
    background: var(--md-orange);
    border-radius: 50%;
    border: 2px solid #fff
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    border-left: 1px solid var(--md-border);
    padding-left: 13px;
    min-width: 184px
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--md-orange-soft);
    color: var(--md-orange);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: .82rem
}

.user-name {
    font-weight: 650;
    line-height: 1.1;
    font-size: .86rem
}

.user-role {
    font-size: .72rem;
    color: var(--md-muted);
    font-weight: 400
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin: 24px 2px 18px
}

.breadcrumb-light {
    display: flex;
    gap: 7px;
    align-items: center;
    color: var(--md-muted);
    font-size: .78rem;
    margin-bottom: 8px
}

.page-title {
    margin: 0;
    font-size: 1.9rem;
    line-height: 1.08;
    font-weight: 650;
    letter-spacing: -.03em;
    color: #232
}

.page-intro {
    margin: 8px 0 0;
    max-width: 840px;
    color: #777;
    font-size: .92rem;
    line-height: 1.55;
    font-weight: 400
}

.head-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    justify-content: flex-end
}

.btn-md-primary,
.btn-md-secondary {
    border-radius: 13px;
    padding: 9px 12px;
    font-weight: 550;
    font-size: .84rem;
    border: 1px solid transparent;
    white-space: nowrap;
    text-decoration: none
}

.btn-md-primary {
    background: var(--md-orange);
    color: #fff;
    border-color: var(--md-orange)
}

.btn-md-secondary {
    background: #fff;
    color: #575757;
    border-color: var(--md-border)
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px
}

.kpi-card,
.panel,
.module-card,
.product-card,
.commercial-banner,
.auth-card {
    background: #fff;
    border: 1px solid var(--md-border);
    box-shadow: var(--shadow)
}

.kpi-card {
    border-radius: 20px;
    padding: 17px
}

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--md-orange-soft);
    color: var(--md-orange);
    font-size: .88rem
}

.kpi-label {
    color: var(--md-muted);
    font-size: .76rem;
    font-weight: 500
}

.kpi-value {
    font-size: 1.58rem;
    line-height: 1.1;
    font-weight: 650;
    color: #222;
    letter-spacing: -.03em;
    margin-top: 2px
}

.kpi-trend {
    font-weight: 500;
    font-size: .75rem;
    display: flex;
    gap: 5px;
    align-items: center
}

.trend-up {
    color: var(--md-success)
}

.trend-down {
    color: var(--md-danger)
}

.trend-neutral {
    color: var(--md-warning)
}

.content-grid {
    display: grid;
    grid-template-columns: 1.45fr .85fr;
    gap: 14px;
    margin-top: 14px
}

.panel {
    border-radius: 22px;
    padding: 18px
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px
}

.panel-title {
    font-size: 1rem;
    font-weight: 650;
    color: #252525;
    margin: 0;
    letter-spacing: -.01em
}

.panel-subtitle {
    font-size: .78rem;
    color: var(--md-muted);
    font-weight: 400;
    margin: 3px 0 0
}

.filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap
}

.pill {
    border: 1px solid var(--md-border);
    background: #fff;
    border-radius: 13px;
    padding: 6px 9px;
    font-size: .72rem;
    font-weight: 500;
    color: #777
}

.pill.active {
    background: var(--md-dark);
    color: #fff;
    border-color: var(--md-dark)
}

.data-table {
    width: 100%;
    border-collapse: collapse
}

.data-table th {
    color: #999;
    font-size: .69rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 0 10px 9px;
    font-weight: 550;
    border-bottom: 1px solid var(--md-border)
}

.data-table td {
    padding: 12px 10px;
    vertical-align: middle;
    font-weight: 400;
    font-size: .84rem;
    border-bottom: 1px solid #f1f1f1
}

.client-name {
    font-weight: 600;
    color: #292929;
    font-size: .86rem
}

.client-meta,
.muted-small {
    font-size: .72rem;
    color: var(--md-muted);
    font-weight: 400;
    margin-top: 2px
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 550;
    white-space: nowrap
}

.status.ok {
    background: #edf9f1;
    color: var(--md-success)
}

.status.wait {
    background: #fff7e8;
    color: #b97710
}

.status.err {
    background: #fff0f0;
    color: var(--md-danger)
}

.status.info {
    background: #edf3ff;
    color: var(--md-info)
}

.btn-line {
    border: 1px solid var(--md-border);
    background: #fff;
    color: #666;
    border-radius: 10px;
    padding: 5px 8px;
    font-size: .74rem;
    font-weight: 500;
    text-decoration: none
}

.sync-list {
    display: grid;
    gap: 9px
}

.sync-item-parent {
border: 1px solid var(--md-border);
    border-radius: 15px;
    background: #fff;
    padding: 12px;
}

.sync-item {
    display: flex;
    align-items: center;
    gap: 10px;
    /* padding: 12px; */
    
}

.sync-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: #fafafa;
    color: var(--md-orange);
    border: 1px solid var(--md-border);
    font-size: .85rem
}

.sync-title {
    font-weight: 600;
    color: #2b2b2b;
    line-height: 1.1;
    font-size: .84rem
}

.sync-meta {
    font-size: .72rem;
    color: var(--md-muted);
    font-weight: 400;
    margin-top: 2px
}

.sync-state {
    margin-left: auto;
    font-weight: 600;
    font-size: .72rem
}

.editor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 14px
}

.module-card {
    border-radius: 20px;
    padding: 17px;
    min-height: 164px;
    display: flex;
    flex-direction: column
}

.module-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px
}

.module-icon {
    width: 37px;
    height: 37px;
    border-radius: 12px;
    background: #fafafa;
    color: var(--md-dark);
    display: grid;
    place-items: center;
    border: 1px solid var(--md-border);
    font-size: .9rem
}

.module-card.highlight .module-icon {
    background: var(--md-orange-soft);
    color: var(--md-orange);
    border-color: #ffd9c9
}

.module-title {
    font-size: .95rem;
    color: #292929;
    font-weight: 650;
    margin: 0 0 6px
}

.module-text {
    color: #777;
    font-weight: 400;
    font-size: .8rem;
    line-height: 1.42;
    margin: 0
}

.module-link {
    margin-top: auto;
    color: var(--md-orange);
    text-decoration: none;
    font-weight: 600;
    font-size: .78rem
}

.product-strip,
.card-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px
}

.product-card {
    border-radius: 18px;
    overflow: hidden
}

.product-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    background: #f2f2f2;
    display: block
}

.product-card-body {
    padding: 11px
}

.product-name {
    font-size: .82rem;
    font-weight: 600;
    color: #2b2b2b;
    margin: 0 0 3px
}

.product-meta {
    font-size: .7rem;
    color: #888;
    margin: 0
}

.product-warning {
    color: var(--md-warning);
    font-weight: 600;
    font-size: .72rem;
    margin-top: 7px
}

.commercial-banner {
    margin-top: 14px;
    border-radius: 22px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-left: 4px solid var(--md-orange)
}

.commercial-banner strong {
    font-size: .96rem;
    font-weight: 650;
    color: #2b2b2b
}

.commercial-banner span {
    display: block;
    margin-top: 3px;
    color: #777;
    font-weight: 400;
    font-size: .82rem
}

.form-label {
    font-size: .78rem;
    font-weight: 600;
    color: #555
}

.form-control,
.form-select {
    border-radius: 12px;
    border-color: var(--md-border);
    font-size: .86rem;
    padding: .62rem .75rem
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #fff, #fff4ef)
}

.auth-card {
    width: min(440px, 100%);
    border-radius: 24px;
    padding: 28px
}

.auth-logo {
    width: 170px;
    margin-bottom: 20px
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 14px
}

.timeline {
    display: grid;
    gap: 10px
}

.timeline-item {
    border-left: 3px solid var(--md-orange);
    padding: 0 0 0 12px
}

.timeline-item strong {
    font-size: .86rem
}

.timeline-item div {
    font-size: .76rem;
    color: #777
}

.promo-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px
}

.promo-type {
    border: 1px solid var(--md-border);
    border-radius: 16px;
    padding: 14px;
    background: #fff
}

.promo-type strong {
    display: block;
    font-size: .86rem;
    margin-bottom: 5px
}

.promo-type span {
    font-size: .76rem;
    color: #777
}

.promo-type i {
    color: var(--md-orange);
    margin-bottom: 9px
}

@media(max-width:1240px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .content-grid,
    .detail-grid {
        grid-template-columns: 1fr
    }

    .editor-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .product-strip,
    .card-grid {
        grid-template-columns: repeat(3, 1fr)
    }

    .promo-type-grid {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(max-width:860px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        max-height: 72vh
    }

    .app-shell {
        display: block
    }

    .main {
        margin-left: 0;
        width: 100%;
        padding: 16px
    }

    .topbar {
        position: relative;
        top: 0;
        flex-wrap: wrap
    }

    .user-chip {
        border-left: 0;
        padding-left: 0;
        min-width: auto
    }

    .page-head {
        display: block
    }

    .head-actions {
        justify-content: flex-start;
        margin-top: 14px
    }

    .kpi-grid,
    .editor-grid,
    .product-strip,
    .card-grid,
    .promo-type-grid {
        grid-template-columns: 1fr
    }

    .data-table {
        min-width: 780px
    }

    .table-responsive {
        overflow-x: auto
    }

    .commercial-banner {
        display: block
    }

    .commercial-banner .btn-md-primary {
        display: inline-block;
        margin-top: 12px
    }
}

.text-primary {
    color: var(--md-orange) !important;
}

table tfoot {
    display: table-header-group;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 10px !important;
}

.table-filters {
    display: none;
}

/* état visible */
.table-filters.show {
    display: table-header-group;
}

/* animation sur le contenu */
.table-filters th {
    padding-top: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.25s ease;
}

.table-filters.show th {
    padding-top: 12px;
    opacity: 1;
    transform: translateY(0);
}

.upper {
  text-transform: uppercase;
}

.hidden {
    display: none;
}

.div-hidden {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

.div-hidden.open {
    max-height: 1000px;
}

.swal-rounded {
    border-radius: 16px !important;
    background: #ffffff;
}

.swal-btn-primary {
    background-color: #FA5200 !important;
    color: white !important;
    border-radius: 10px !important;
    padding: 8px 16px;
    transition: 0.2s;
}

.swal-btn-primary:hover {
    background-color: #e04800 !important;
}

.swal-btn-secondary {
    background-color: #2e2e2e !important;
    color: white !important;
    border-radius: 10px !important;
    padding: 8px 16px;
    transition: 0.2s;
}

.swal-btn-secondary:hover {
    background-color: #1f1f1f !important;
}
th {
    position: relative;
    padding-right: 25px;
}

/* Flèche UP */
th::before {
    content: "\f062"; /* fa-arrow-up */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 8px;
    top: 4px;
    font-size: 12px;
    color: #bbb;
}

/* Flèche DOWN */
th::after {
    content: "\f063"; /* fa-arrow-down */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 8px;
    bottom: 4px;
    font-size: 12px;
    color: #bbb;
}

th::before,
th::after {
    opacity: 0.3;
    transition: 0.2s ease;
}

th[aria-sort="ascending"]::before {
    color:var(--md-orange);
    opacity: 1;
}

th[aria-sort="descending"]::after {
    color:var(--md-orange);
    opacity: 1;
}

th.sorting_disabled::before,
th.sorting_disabled::after,
th.dt-orderable-none::before,
th.dt-orderable-none::after {
    display: none !important;
}

nav[aria-label="pagination"] {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.pagination {
    display: flex;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
    align-items: center;
}

.pagination .page-link {
    border: 1px solid var(--md-border);
    background: #fff;
    color: var(--md-dark);
    padding: 7px 11px;
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    min-width: 36px;
    text-align: center;
}

.pagination .page-link:hover {
    background: var(--md-orange-soft);
    border-color: #ffd9c9;
    color: var(--md-orange);
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background: var(--md-orange);
    border-color: var(--md-orange);
    color: #fff !important;
    font-weight: 600;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #aaa;
}



.pagination .page-link {
    transition: all 0.18s ease;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination .ellipsis {
    border: none;
    background: transparent;
    cursor: default;
    color: var(--md-muted);
}

.dt-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    font-size: .8rem;
    font-weight: 500;

    color: var(--md-dark);
    background: var(--md-orange-soft);

    border: 1px solid #ffd9c9;
    padding: 6px 10px;
    border-radius: 999px;
}

.dt-info::before {
    content: "\f05a"; /* fa-circle-info */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 6px;
    color: var(--md-orange);
}

.btn-primary {
    border: 1px solid var(--md-border);
    background: #fff;
    color: var(--md-dark);
    padding: 7px 11px;
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    min-width: 36px;
    text-align: center;
}

.btn-primary:hover {
    background: var(--md-orange-soft);
    border-color: #ffd9c9;
    color: var(--md-orange);
    transform: translateY(-1px);
}

.btn-primary:active {
    background-color: var(--md-orange-soft) !important;
    border:1px solid var(--md-orange-soft) !important;
}

.swal2-input-error {
    border-color: var(--md-danger) !important;
    background: #fff0f0;
}

.swal2-input:focus {
    border-color: var(--md-orange);
    box-shadow: 0 0 0 2px rgba(250, 82, 0, 0.1);
}