/* ==========================================================================
   geeks-child : ajustements du dashboard Tutor LMS 4.0.x
   Charge par inc/tutor4-dashboard-compat.php
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Header : la zone "before_header_button" est un <div> nu dans Tutor 4.
      On l'aligne en ligne : pill de classement, badge cognitif, cloche.
   -------------------------------------------------------------------------- */
.tutor-dashboard-layout .tutor-dashboard-main .tutor-dashboard-header .tutor-dashboard-header-inner {
    padding-right: 16px;
    gap: 16px;
}

.tutor-dashboard-header .tutor-dashboard-header-left {
    min-width: 0;
}

.tutor-dashboard-header .tutor-dashboard-header-right {
    flex-shrink: 0;
    gap: 12px;
}

.tutor-dashboard-header .tutor-dashboard-header-right > div:first-child {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    position: static;
}

/* Tout enfant direct de cette zone reste dans le flux (annule les anciens
   positionnements absolus / centrages herites du CSS additionnel). */
.tutor-dashboard-header .tutor-dashboard-header-right > div:first-child > * {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    margin: 0 !important;
    float: none !important;
    flex: 0 0 auto;
}

/* Pill "Votre classement" */
.tutor-dashboard-header .tutor-rank-pill {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100%;
    height: 40px;
    padding: 0 14px 0 6px !important;
    border-radius: 999px !important;
    background: var(--tutor-surface-l1, #f6f4fd) !important;
    border: 1px solid var(--tutor-border-idle, #e6e3f1) !important;
    box-shadow: none !important;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
}

.tutor-dashboard-header .tutor-rank-pill img {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 !important;
}

.tutor-dashboard-header .tutor-rank-pill .label {
    color: var(--tutor-text-subdued, #6b6785);
    font-weight: 400;
}

.tutor-dashboard-header .tutor-rank-pill .value {
    color: var(--tutor-text-brand, #754ffe);
    font-weight: 600;
}

/* Badge du plugin Mon Profil Cognitif, s'il est present */
.tutor-dashboard-header .acg-header-badge,
.tutor-dashboard-header .mpc-badge {
    height: 40px;
    padding: 0 14px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center;
    line-height: 1 !important;
    white-space: nowrap;
}

@media (max-width: 1199px) {
    .tutor-dashboard-header .tutor-rank-pill .label { display: none; }
}

@media (max-width: 767px) {
    .tutor-dashboard-header .tutor-rank-pill {
        height: 32px;
        padding: 0 10px 0 4px !important;
        font-size: 12px;
    }
    .tutor-dashboard-header .tutor-rank-pill img {
        width: 22px !important;
        height: 22px !important;
    }
}

/* --------------------------------------------------------------------------
   2. Sidebar : icones et libelles sur la meme ligne de base
   -------------------------------------------------------------------------- */
.tutor-dashboard-sidebar .tutor-dashboard-sidebar-nav ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tutor-dashboard-sidebar .tutor-dashboard-sidebar-nav ul li a > svg {
    flex: 0 0 20px;
}

/* --------------------------------------------------------------------------
   3. Accueil : widgets personnalises sous les widgets natifs
   -------------------------------------------------------------------------- */
.geeks-child-t4-widgets {
    margin-top: 24px;
}

.geeks-child-t4-widgets .tutor-dashboard-content-inner {
    padding: 0;
}

.geeks-child-t4-page {
    max-width: 100%;
}

/* Mode sombre Tutor 4 (reglage "dark" ou "system") */
[data-tutor-theme="dark"] .geeks-child-t4-widgets .friendly-card {
    background: var(--tutor-surface-l1);
    color: var(--tutor-text-primary);
    box-shadow: none;
    border: 1px solid var(--tutor-border-idle);
}

[data-tutor-theme="dark"] .geeks-child-t4-widgets .dashboard-section-title {
    color: var(--tutor-text-primary);
}

@media (prefers-color-scheme: dark) {
    [data-tutor-theme="system"] .geeks-child-t4-widgets .friendly-card {
        background: var(--tutor-surface-l1);
        color: var(--tutor-text-primary);
        box-shadow: none;
        border: 1px solid var(--tutor-border-idle);
    }
    [data-tutor-theme="system"] .geeks-child-t4-widgets .dashboard-section-title {
        color: var(--tutor-text-primary);
    }
}
