/* =========================================================
           EL MAJD — Layout base
           ========================================================= */
html,
body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: #f5f8ff;
    color: #1e293b;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
}

/* Selective bold — NOT everything */
h1,
h2,
h3,
h4,
h5,
h6,
label,
th,
.btn,
button {
    font-weight: 600;
}

strong,
b {
    font-weight: 700;
}

/* Placeholders lighter, not bold */
input::placeholder,
textarea::placeholder {
    font-weight: 400;
    color: #94a3b8;
    opacity: 1;
}

/* Kill number input spinners */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Focus rings */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* =========================================================
           TOP NAVBAR — sticky
           ========================================================= */
.navbar-block {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border-bottom: 1px solid #e8eef7;
    transition: padding-left .28s cubic-bezier(.2, .8, .2, 1);
}

/* Offset navbar to the right of the fixed sidebar on desktop */
@media (min-width: 992px) {
    .navbar-block {
        padding-left: 260px;
        /* = sidebar width */
    }
}

/* =========================================================
           MAIN BLOCK — offset for fixed sidebar
           ========================================================= */
.main-block {
    min-height: calc(100vh - 60px);
    display: flex;
    transition: padding-left .28s cubic-bezier(.2, .8, .2, 1);
}

@media (min-width: 992px) {
    .main-block {
        padding-left: 260px;
        /* = sidebar width */
    }
}

.content-block {
    flex: 1;
    min-width: 0;
    /* prevents flex overflow bugs */
    padding: 0;
}

.content-block .container-fluid {
    padding: 20px 24px 40px;
    max-width: 100%;
}

@media (max-width: 991.98px) {
    .content-block .container-fluid {
        padding: 16px 14px 32px;
    }
}

/* =========================================================
           MOBILE HAMBURGER (injected by JS)
           ========================================================= */
.jm-mobile-burger {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1050;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid #e8eef7;
    background: #fff;
    color: #0f1e3d;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 14px rgba(15, 30, 61, .08);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

.jm-mobile-burger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(15, 30, 61, .12);
}

.jm-mobile-burger:active {
    transform: translateY(0);
}

@media (max-width: 991.98px) {
    .jm-mobile-burger {
        display: inline-flex;
    }
}

/* When drawer is open, hide burger */
body.jm-sidebar-open .jm-mobile-burger {
    opacity: 0;
    pointer-events: none;
}

/* =========================================================
           FLASH MESSAGES — polish
           ========================================================= */
.alert {
    border-radius: 12px;
    border: 0;
    padding: 14px 18px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(15, 30, 61, .06);
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
}

.alert-error,
.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
}

/* =========================================================
           REDUCED MOTION
           ========================================================= */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* =========================================================
   EL MAJD — Page / Index primitives
   ========================================================= */

/* ---------- Page wrapper ---------- */
.jm-page {
    max-width: 100%;
    padding: 4px 0 32px;
}

/* ---------- Page header ---------- */
.jm-page__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.jm-page__title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.4px;
    color: #0f1e3d;
    margin: 0 0 4px;
}

.jm-page__sub {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* ---------- Buttons ---------- */
.jm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .18s ease, background .18s ease;
    white-space: nowrap;
}

.jm-btn:hover {
    transform: translateY(-1px);
}

.jm-btn:active {
    transform: translateY(0);
}

.jm-btn--primary {
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
    color: #fff;
    box-shadow: 0 6px 16px rgba(14, 165, 233, .28);
}

.jm-btn--primary:hover {
    color: #fff;
    box-shadow: 0 10px 24px rgba(14, 165, 233, .38);
}

.jm-btn--ghost {
    background: #fff;
    color: #334155;
    border-color: #e2e8f2;
}

.jm-btn--ghost:hover {
    color: #0369a1;
    border-color: rgba(14, 165, 233, .4);
    background: #f8fbff;
}

.jm-btn--sm {
    padding: 8px 14px;
    font-size: 12.5px;
    border-radius: 9px;
}

/* ---------- Card ---------- */
.jm-card {
    background: #fff;
    border: 1px solid #e8eef7;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(15, 30, 61, .05);
}

/* ---------- Toolbar ---------- */
.jm-card__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid #e8eef7;
    background: linear-gradient(180deg, #fbfdff 0%, #f8fbfe 100%);
    flex-wrap: wrap;
}

.jm-toolbar__left,
.jm-toolbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---------- Search ---------- */
.jm-search {
    position: relative;
    display: inline-block;
}

.jm-search i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 13px;
    pointer-events: none;
}

.jm-search__input {
    height: 40px;
    padding: 0 14px 0 36px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f2;
    background: #fff;
    font-size: 13.5px;
    color: #0f1e3d;
    outline: none;
    width: 240px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.jm-search__input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, .12);
}

@media (max-width: 575.98px) {

    .jm-search,
    .jm-search__input {
        width: 100%;
    }
}

/* ---------- Table ---------- */
.jm-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.jm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.jm-table thead th {
    text-align: left;
    padding: 12px 16px;
    background: #f8fafd;
    border-bottom: 1px solid #e8eef7;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #64748b;
    white-space: nowrap;
}

.jm-table thead th.text-end {
    text-align: right;
}

.jm-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5fb;
    color: #1e293b;
    vertical-align: middle;
}

.jm-table tbody tr {
    transition: background .15s ease;
}

.jm-table tbody tr:hover {
    background: #f8fbff;
}

.jm-table tbody tr:last-child td {
    border-bottom: 0;
}

/* ---------- Sort buttons ---------- */
.jm-sort {
    background: transparent;
    border: 0;
    padding: 0;
    font: inherit;
    font-weight: 700;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: .6px;
    font-size: 11.5px;
    transition: color .18s ease;
}

.jm-sort:hover {
    color: #0ea5e9;
}

.jm-sort i {
    font-size: 10px;
    opacity: .4;
    transition: all .18s ease;
}

.jm-sort.asc i {
    opacity: 1;
    color: #0ea5e9;
}

.jm-sort.desc i {
    opacity: 1;
    color: #0ea5e9;
    transform: rotate(180deg);
}

/* ---------- Cells ---------- */
.jm-cell-user__name {
    font-weight: 600;
    color: #0f1e3d;
}

.jm-muted {
    color: #94a3b8;
}

.jm-link {
    color: #0369a1;
    text-decoration: none;
    font-weight: 500;
    transition: color .18s ease;
}

.jm-link:hover {
    color: #0ea5e9;
}

.jm-link i {
    font-size: 11px;
    margin-right: 4px;
    color: #94a3b8;
}

/* ---------- Badges ---------- */
.jm-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .2px;
}

.jm-badge--neutral {
    background: #f1f5fb;
    color: #475569;
}

.jm-badge--primary {
    background: rgba(14, 165, 233, .1);
    color: #0369a1;
}

/* ---------- Icon action buttons ---------- */
.jm-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.jm-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, transform .15s ease;
}

.jm-icon-btn:hover {
    transform: translateY(-1px);
}

.jm-icon-btn--view:hover {
    background: rgba(34, 197, 94, .12);
    color: #16a34a;
}

.jm-icon-btn--edit:hover {
    background: rgba(245, 158, 11, .14);
    color: #d97706;
}

.jm-icon-btn--danger:hover {
    background: rgba(239, 68, 68, .12);
    color: #dc2626;
}

.jm-icon-btn.is-disabled {
    opacity: .45;
    cursor: not-allowed;
}

.jm-icon-btn.is-disabled:hover {
    background: rgba(148, 163, 184, .15);
    color: #94a3b8;
    transform: none;
}

/* ---------- Empty state ---------- */
.jm-empty {
    text-align: center;
    padding: 56px 20px !important;
    color: #94a3b8;
}

.jm-empty i {
    font-size: 42px;
    opacity: .35;
    margin-bottom: 12px;
    display: block;
}

.jm-empty p {
    margin: 0 0 16px;
    font-size: 14px;
}

/* ---------- Card footer ---------- */
.jm-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid #e8eef7;
    background: #fbfdff;
    flex-wrap: wrap;
}

/* ---------- Pagination ---------- */
.jm-pagination {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    margin: 0;
}

.jm-pagination .page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f2;
    background: #fff;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s ease;
}

.jm-pagination .page-item .page-link:hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
    background: #f0f9ff;
}

.jm-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(14, 165, 233, .3);
}

.jm-pagination .page-item.disabled .page-link {
    opacity: .4;
    pointer-events: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
    .jm-page__title {
        font-size: 20px;
    }

    .jm-card__toolbar,
    .jm-card__footer {
        padding: 12px 14px;
    }

    .jm-table thead th,
    .jm-table tbody td {
        padding: 10px 12px;
    }
}


/* =========================================================
   EL MAJD — Form primitives
   ========================================================= */

/* ---------- Breadcrumb ---------- */
.jm-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #94a3b8;
    margin-bottom: 6px;
}
.jm-breadcrumb a {
    color: #0369a1;
    text-decoration: none;
    font-weight: 500;
    transition: color .18s ease;
}
.jm-breadcrumb a:hover { color: #0ea5e9; }
.jm-breadcrumb i { font-size: 9px; opacity: .5; }

/* ---------- Required marker ---------- */
.jm-req { color: #f43f5e; font-weight: 700; }

.jm-label__hint {
    font-weight: 400;
    color: #94a3b8;
    font-size: 11.5px;
    margin-left: 4px;
}

/* ---------- Form card ---------- */
.jm-form-card {
    background: #fff;
    border: 1px solid #e8eef7;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(15, 30, 61, .05);
}

/* ---------- Form section ---------- */
.jm-form-section {
    border-bottom: 1px solid #eef2f9;
}
.jm-form-section:last-of-type { border-bottom: 0; }

.jm-form-section__head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 24px 4px;
}
.jm-form-section__icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(14, 165, 233, .12), rgba(59, 130, 246, .12));
    color: #0ea5e9;
    font-size: 15px;
    flex-shrink: 0;
}
.jm-form-section__head h3 {
    font-size: 15px;
    font-weight: 700;
    color: #0f1e3d;
    margin: 0 0 2px;
    letter-spacing: -.2px;
}
.jm-form-section__head p {
    font-size: 12.5px;
    color: #94a3b8;
    margin: 0;
}

.jm-form-section__body {
    padding: 20px 24px 24px;
}

/* ---------- Subsection (père / mère) ---------- */
.jm-subsection {
    padding: 16px;
    border: 1px solid #eef2f9;
    border-radius: 12px;
    background: #fbfdff;
    height: 100%;
}
.jm-subsection__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #64748b;
    margin: 0 0 12px;
}
.jm-subsection__title i {
    color: #0ea5e9;
    font-size: 12px;
}

/* ---------- Labels ---------- */
.jm-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    letter-spacing: .2px;
}

/* ---------- Inputs ---------- */
.jm-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f2;
    background: #fff;
    font-size: 13.5px;
    color: #0f1e3d;
    font-family: inherit;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
    box-sizing: border-box;
}
textarea.jm-input {
    height: auto;
    padding: 12px 14px;
    resize: vertical;
    line-height: 1.5;
}
.jm-input::placeholder { color: #94a3b8; font-weight: 400; }
.jm-input:hover { border-color: #cbd5e1; }
.jm-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, .12);
}
.jm-input[readonly] {
    background: #f8fafd;
    color: #64748b;
    cursor: not-allowed;
}

/* TomSelect integration */
.jm-form-card .ts-wrapper { width: 100%; }
.jm-form-card .ts-control {
    min-height: 46px !important;
    border: 1.5px solid #e2e8f2 !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: none !important;
    padding: 12px 14px !important;
    font-size: 13.5px;
}
.jm-form-card .ts-wrapper.focus .ts-control {
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, .12) !important;
}

/* ---------- Input group (icon / suffix) ---------- */
.jm-input-group {
    position: relative;
    display: flex;
    align-items: center;
}
.jm-input-group__suffix {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: .5px;
    pointer-events: none;
}

.jm-input-group--icon > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #94a3b8;
    pointer-events: none;
    z-index: 2;
    transition: color .2s ease;
}
.jm-input-group--icon:focus-within > i { color: #0ea5e9; }

.jm-input--icon { padding-left: 36px; }

/* ---------- Form footer ---------- */
.jm-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 24px;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
    border-top: 1px solid #eef2f9;
    flex-wrap: wrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
    .jm-form-section__head { padding: 16px 16px 0; }
    .jm-form-section__body { padding: 16px 16px 20px; }
    .jm-form-footer {
        padding: 14px 16px;
        justify-content: stretch;
    }
    .jm-form-footer .jm-btn { flex: 1; }
}

/* =========================================================
   CLASS FILTER PILLS
   ========================================================= */
.jm-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 4px;
    background: #f1f5fb;
    border-radius: 12px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.jm-filter::-webkit-scrollbar { display: none; }

.jm-filter__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #64748b;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .2px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.jm-filter__pill:hover {
    background: rgba(255, 255, 255, .7);
    color: #0369a1;
}
.jm-filter__pill.is-active {
    background: #fff;
    color: #0369a1;
    box-shadow:
        0 2px 6px rgba(15, 30, 61, .08),
        0 0 0 1px rgba(14, 165, 233, .15);
}
.jm-filter__pill.is-active::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .18);
}
.jm-filter__pill:not(.is-active)::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
}

/* Mobile: pills scroll horizontally */
@media (max-width: 767.98px) {
    .jm-toolbar__right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .jm-filter {
        justify-content: flex-start;
    }
    .jm-search,
    .jm-search__input {
        width: 100%;
    }
}

/* ---------- Input group loading indicator ---------- */
.jm-input-group__loading {
    position: absolute;
    right: 44px;
    top: 50%;
    transform: translateY(-50%);
    color: #0ea5e9;
    font-size: 12px;
    pointer-events: none;
}

/* ---------- Hint under fields ---------- */
.jm-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
    transition: color .18s ease;
}
.jm-hint i { font-size: 12px; }

/* =========================================================
   DEMI-MOIS SWITCH
   ========================================================= */
.jm-mois-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.jm-mois-row .jm-input {
    flex: 1;
    min-width: 0;
}

/* Wrap */
.jm-switch-wrap {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* Label = tappable area */
.jm-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin: 0;
    padding: 6px 12px 6px 6px;
    border-radius: 100px;
    background: #f1f5fb;
    border: 1.5px solid #e2e8f2;
    transition: background .2s ease, border-color .2s ease;
    white-space: nowrap;
}
.jm-switch:hover {
    background: #eaf3ff;
    border-color: rgba(14, 165, 233, .35);
}

/* Hide native checkbox */
.jm-switch__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Track */
.jm-switch__track {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 100px;
    background: #cbd5e1;
    transition: background .25s ease, box-shadow .25s ease;
    flex-shrink: 0;
    box-shadow: inset 0 1px 2px rgba(15, 30, 61, .08);
}

/* Thumb */
.jm-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(15, 30, 61, .2);
    transition: transform .25s cubic-bezier(.3, 1.4, .5, 1);
}

/* Checked state */
.jm-switch__input:checked + .jm-switch__track {
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
    box-shadow:
        0 0 0 3px rgba(14, 165, 233, .15),
        inset 0 1px 2px rgba(0, 0, 0, .1);
}
.jm-switch__input:checked + .jm-switch__track .jm-switch__thumb {
    transform: translateX(18px);
}

/* Focus ring */
.jm-switch__input:focus-visible + .jm-switch__track {
    box-shadow:
        0 0 0 3px rgba(14, 165, 233, .25),
        inset 0 1px 2px rgba(0, 0, 0, .1);
}

/* Label text */
.jm-switch__label {
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

/* State indicator (Oui/Non) */
.jm-switch__state {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #94a3b8;
    padding: 2px 7px;
    border-radius: 100px;
    background: #fff;
    transition: color .2s ease, background .2s ease;
}
.jm-switch__input:checked ~ .jm-switch__label .jm-switch__state {
    color: #0369a1;
    background: rgba(14, 165, 233, .12);
}

/* When checked, tint whole label */
.jm-switch:has(.jm-switch__input:checked) {
    background: rgba(14, 165, 233, .08);
    border-color: rgba(14, 165, 233, .35);
}

/* Responsive — stack on narrow screens */
@media (max-width: 575.98px) {
    .jm-mois-row {
        flex-wrap: wrap;
    }
    .jm-mois-row .jm-input {
        width: 100%;
        flex-basis: 100%;
    }
    .jm-switch {
        margin-top: 4px;
    }
}

/* =========================================================
   RÉCAP MENSUEL
   ========================================================= */

/* Légende */
.jm-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}
.jm-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.jm-legend__dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
}

/* Table wrapper — allow horizontal scroll */
.jm-recap-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table */
.jm-recap {
    font-size: 13px;
    min-width: 900px;    /* force horizontal scroll on mobile */
}
.jm-recap th,
.jm-recap td {
    padding: 10px 12px !important;
    white-space: nowrap;
}

/* Header mois */
.jm-recap__month {
    text-transform: uppercase;
    font-size: 11px !important;
    letter-spacing: .6px;
    color: #64748b !important;
    background: #f8fafd !important;
    min-width: 70px;
    text-align: center;
}
.jm-recap__month small {
    font-size: 9px !important;
    text-transform: none;
    letter-spacing: 0;
    opacity: .7;
}

/* Colonnes sticky (Enfant + Classe) */
.jm-recap__sticky {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 2;
    box-shadow: 2px 0 6px rgba(15, 30, 61, .04);
}
.jm-recap__sticky--2 {
    left: 180px;    /* largeur de la colonne Enfant */
    z-index: 1;
}
.jm-recap thead .jm-recap__sticky {
    background: #f8fafd;
    z-index: 3;
}
.jm-recap tfoot .jm-recap__sticky {
    background: #f8fafd;
}

/* Cellules mois */
.jm-recap__cell {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    transition: transform .15s ease;
}
.jm-recap__cell--paid {
    background: #dcfce7;
    color: #166534;
}
.jm-recap__cell--missed {
    background: #fee2e2;
    color: #991b1b;
}
.jm-recap__cell--future {
    background: #f8fafd;
    color: #94a3b8;
}

/* Hover row */
.jm-recap tbody tr:hover .jm-recap__cell {
    filter: brightness(.97);
}
.jm-recap tbody tr:hover .jm-recap__sticky {
    background: #f8fbff !important;
}

/* Total column */
.jm-recap__total {
    font-weight: 800;
    background: #f8fafd !important;
    color: #0f1e3d;
    font-variant-numeric: tabular-nums;
    border-left: 2px solid #e8eef7 !important;
}

/* Total per month (footer) */
.jm-recap__total-cell {
    background: #f8fafd !important;
    color: #0f1e3d;
    font-variant-numeric: tabular-nums;
}

/* Scrollbar styling */
.jm-recap-wrap::-webkit-scrollbar {
    height: 8px;
}
.jm-recap-wrap::-webkit-scrollbar-track {
    background: #f1f5fb;
    border-radius: 4px;
}
.jm-recap-wrap::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.jm-recap-wrap::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile */
@media (max-width: 767.98px) {
    .jm-recap {
        font-size: 12px;
    }
    .jm-recap th,
    .jm-recap td {
        padding: 8px 10px !important;
    }
    .jm-recap__month {
        min-width: 60px;
    }
    .jm-legend {
        font-size: 11px;
        gap: 10px;
    }
}

/* =========================================================
   DASHBOARD / ACCUEIL
   ========================================================= */

/* ---------- Welcome header ---------- */
.jm-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 24px 28px;
    margin-bottom: 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, #f8fbff 0%, #eff6ff 100%);
    border: 1px solid #e0edff;
    position: relative;
    overflow: hidden;
}
.jm-welcome::before {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 233, .12) 0%, transparent 70%);
    top: -100px;
    right: -60px;
    pointer-events: none;
}
.jm-welcome__left { position: relative; z-index: 1; }

.jm-welcome__greeting {
    font-size: 13.5px;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 6px;
}
.jm-welcome__greeting strong { color: #0f1e3d; font-weight: 700; }

.jm-welcome__title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.6px;
    color: #0f1e3d;
    margin: 0 0 8px;
}

.jm-welcome__sub {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.jm-welcome__sub i { color: #0ea5e9; }
.jm-welcome__sub strong { color: #0f1e3d; font-weight: 700; }
.jm-welcome__dot { color: #cbd5e1; }

.jm-welcome__right { position: relative; z-index: 1; }

/* ---------- Stats grid ---------- */
.jm-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}
@media (max-width: 991.98px) {
    .jm-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
    .jm-stats-grid { grid-template-columns: 1fr; }
}

.jm-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: #fff;
    border: 1px solid #e8eef7;
    border-radius: 16px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.jm-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(15, 30, 61, .06);
}

.jm-stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 18px;
    flex-shrink: 0;
}

.jm-stat-card__value {
    font-size: 22px;
    font-weight: 800;
    color: #0f1e3d;
    letter-spacing: -.5px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.jm-stat-card__value small {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-left: 2px;
}

.jm-stat-card__label {
    font-size: 12.5px;
    color: #64748b;
    font-weight: 500;
    margin-top: 4px;
}

/* Color variants */
.jm-stat-card--blue   .jm-stat-card__icon { background: #eaf3ff; color: #0ea5e9; }
.jm-stat-card--green  .jm-stat-card__icon { background: #ecfdf5; color: #16a34a; }
.jm-stat-card--orange .jm-stat-card__icon { background: #fff7ed; color: #f97316; }
.jm-stat-card--red    .jm-stat-card__icon { background: #fef2f2; color: #dc2626; }

/* ---------- Section title ---------- */
.jm-section-title {
    margin: 0 0 14px;
}
.jm-section-title h2 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.3px;
    color: #0f1e3d;
    margin: 0;
}

/* ---------- Shortcuts grid ---------- */
.jm-shortcuts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}
@media (max-width: 991.98px) {
    .jm-shortcuts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
    .jm-shortcuts { grid-template-columns: 1fr; }
}

.jm-shortcut {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e8eef7;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    position: relative;
    overflow: hidden;
}
.jm-shortcut:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 30, 61, .07);
    border-color: rgba(14, 165, 233, .25);
}

.jm-shortcut__icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: transform .2s ease;
}
.jm-shortcut:hover .jm-shortcut__icon { transform: scale(1.05); }

.jm-shortcut__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.jm-shortcut__title {
    font-size: 14px;
    font-weight: 700;
    color: #0f1e3d;
    letter-spacing: -.2px;
}
.jm-shortcut__sub {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.jm-shortcut__arrow {
    color: #cbd5e1;
    font-size: 12px;
    transition: transform .2s ease, color .2s ease;
}
.jm-shortcut:hover .jm-shortcut__arrow {
    color: #0ea5e9;
    transform: translateX(3px);
}

/* Color variants */
.jm-shortcut--blue   .jm-shortcut__icon { background: #eaf3ff; color: #0ea5e9; }
.jm-shortcut--green  .jm-shortcut__icon { background: #ecfdf5; color: #16a34a; }
.jm-shortcut--purple .jm-shortcut__icon { background: #f5f3ff; color: #7c3aed; }
.jm-shortcut--orange .jm-shortcut__icon { background: #fff7ed; color: #f97316; }

/* ---------- Two columns ---------- */
.jm-dashboard-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 991.98px) {
    .jm-dashboard-cols { grid-template-columns: 1fr; }
}

/* ---------- Dashboard card ---------- */
.jm-dash-card {
    background: #fff;
    border: 1px solid #e8eef7;
    border-radius: 16px;
    overflow: hidden;
}
.jm-dash-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #eef2f9;
    background: linear-gradient(180deg, #fbfdff 0%, #f8fbfe 100%);
}
.jm-dash-card__head h3 {
    font-size: 14.5px;
    font-weight: 800;
    color: #0f1e3d;
    margin: 0 0 2px;
    letter-spacing: -.2px;
}
.jm-dash-card__head p {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}
.jm-dash-card__link {
    font-size: 12.5px;
    font-weight: 600;
    color: #0ea5e9;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background .15s ease;
}
.jm-dash-card__link:hover {
    background: rgba(14, 165, 233, .1);
    color: #0369a1;
}
.jm-dash-card__body { padding: 8px 12px 12px; }

.jm-dash-card__more {
    padding: 10px 8px 4px;
    border-top: 1px solid #eef2f9;
    margin-top: 8px;
    text-align: center;
}
.jm-dash-card__more a {
    font-size: 12.5px;
    font-weight: 600;
    color: #0ea5e9;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.jm-dash-card__more a:hover { color: #0369a1; }
.jm-dash-card__more i { font-size: 10px; }

/* ---------- List ---------- */
.jm-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.jm-list__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 10px;
    transition: background .15s ease;
}
.jm-list__item:hover { background: #f8fbff; }

.jm-list__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f43f5e;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, .15);
}

.jm-list__text {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    color: #0f1e3d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.jm-list__text strong { font-weight: 700; }
.jm-list__text small { font-size: 12px; }

.jm-list__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(14, 165, 233, .1);
    color: #0ea5e9;
    text-decoration: none;
    font-size: 12px;
    transition: all .15s ease;
    flex-shrink: 0;
}
.jm-list__action:hover {
    background: #0ea5e9;
    color: #fff;
    transform: scale(1.05);
}

/* Payment list variant */
.jm-list--payments .jm-list__item { padding: 8px 8px; }

.jm-avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #ecfdf5;
    color: #16a34a;
    font-size: 12px;
    flex-shrink: 0;
}
.jm-avatar--sm { width: 30px; height: 30px; }

.jm-list__amount {
    font-size: 13.5px;
    font-weight: 800;
    color: #16a34a;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    letter-spacing: -.2px;
}
.jm-list__amount small {
    font-size: 10.5px;
    font-weight: 600;
    color: #94a3b8;
    margin-left: 2px;
}

/* Badge danger */
.jm-badge--danger {
    background: #fee2e2;
    color: #991b1b;
}