/* ==========================================================
   MONCOACHSPORTIF - DASHBOARD APP
   Tout le CSS de l'espace connecté est ici.
========================================================== */

/* Le dashboard utilise le header principal du site */
body:has(.app-shell) main {
    padding-top: 0;
}

body:has(.app-shell) .site-footer {
    display: none;
}

body:has(.app-shell) .site-header {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom-color: transparent !important;
}

/* Structure générale */
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 20px;
    padding: 96px 24px 24px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow-x: hidden;
}

.app-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg, rgba(0, 0, 0, 0.90) 0%, rgba(0, 0, 0, 0.72) 45%, rgba(0, 0, 0, 0.55) 100%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35));
    z-index: 0;
    pointer-events: none;
}

/* Fonds par rôle */
.student-dashboard-bg {
    background-image: url('/assets/img/backgrounds/student-dashboard.webp');
}

.coach-dashboard-bg {
    background-image: url('/assets/img/backgrounds/coach-dashboard.webp');
}

.admin-dashboard-bg {
    background-image: url('/assets/img/backgrounds/admin-dashboard.webp');
}

.app-sidebar,
.app-main {
    position: relative;
    z-index: 1;
}

/* Sidebar */
.app-sidebar {
    min-height: calc(100vh - 120px);
    padding: 22px;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.app-sidebar-title {
    margin-bottom: 22px;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.app-menu {
    display: grid;
    gap: 2px;
}

.app-menu a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 14.5px;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.app-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text);
}

.app-menu a.active {
    background: rgba(255, 255, 255, 0.07);
    color: var(--color-text);
    position: relative;
}

.app-menu a.active::before {
    content: "";
    position: absolute;
    left: -22px;
    top: 50%;
    width: 3px;
    height: 16px;
    transform: translateY(-50%);
    background: var(--color-primary);
    border-radius: var(--radius-pill);
}

/* Zone contenu */
.app-main {
    min-width: 0;
}

.app-page-title {
    margin-bottom: 20px;
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.app-eyebrow {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.app-page-title h1 {
    color: var(--color-text);
    font-size: clamp(30px, 3.4vw, 44px);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.app-page-title p {
    margin-top: 10px;
    color: var(--color-text-muted);
    font-size: 15px;
}

/* Cartes statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    margin-top: 0;
}

.stat-card,
.app-panel {
    background: var(--color-surface);
    border: 0;
    border-radius: 0;
}

.stat-card {
    padding: 22px;
    background: rgba(0, 0, 0, 0.4);
}

.stat-card span,
.stat-card small {
    color: var(--color-text-muted);
}

.stat-card span {
    display: block;
    font-size: 13px;
    font-weight: 500;
}

.stat-card strong {
    display: block;
    margin: 14px 0 6px;
    color: var(--color-text);
    font-family: var(--font-mono);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

.stat-card small {
    font-size: 12.5px;
}

/* Grille principale */
.app-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.app-panel {
    padding: 26px;
    min-height: 210px;
    background: rgba(0, 0, 0, 0.4);
}

.app-panel.large {
    grid-row: span 2;
    min-height: 460px;
}

.app-panel.wide {
    grid-column: span 2;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.panel-pill {
    height: fit-content;
    padding: 7px 12px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
}

.app-panel h2 {
    color: var(--color-text);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.app-panel p {
    color: var(--color-text-muted);
    font-size: 14.5px;
    line-height: 1.6;
}

/* Séance / listes */
.workout-list {
    display: grid;
    gap: 10px;
    margin: 24px 0;
}

.workout-list div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
}

.workout-list strong {
    color: var(--color-text);
    font-size: 14.5px;
    font-weight: 600;
}

.workout-list span {
    color: var(--color-text-muted);
    font-size: 13.5px;
    text-align: right;
}

.progress-line {
    height: 3px;
    margin-top: 24px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.10);
    overflow: hidden;
}

.progress-line span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--color-primary);
}

.panel-link {
    display: inline-flex;
    margin-top: 20px;
    color: var(--color-text);
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--color-border-strong);
}

.activity-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.activity-list div {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text-muted);
    font-size: 14px;
}

.activity-list span {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: var(--color-primary);
}

/* Responsive tablette */
@media (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 1fr;
        padding: 92px 18px 22px;
    }

    .app-sidebar {
        min-height: auto;
        position: relative;
    }

    .app-menu {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .app-menu a.active::before {
        display: none;
    }

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

    .app-grid {
        grid-template-columns: 1fr 1fr;
    }

    .app-panel.large,
    .app-panel.wide {
        grid-column: span 2;
        grid-row: auto;
        min-height: auto;
    }
}

/* Responsive mobile */
@media (max-width: 700px) {
    .app-shell {
        padding: 84px 14px 18px;
        gap: 14px;
    }

    .app-sidebar,
    .app-page-title,
    .stat-card,
    .app-panel {
        border-radius: var(--radius-md);
    }

    .app-sidebar {
        padding: 16px;
    }

    .app-menu,
    .stats-grid,
    .app-grid {
        grid-template-columns: 1fr;
    }

    .app-menu {
        max-height: 230px;
        overflow: auto;
        padding-right: 4px;
    }

    .app-panel.large,
    .app-panel.wide {
        grid-column: auto;
    }

    .app-page-title {
        padding: 22px;
    }

    .app-page-title h1 {
        font-size: 30px;
    }

    .workout-list div {
        flex-direction: column;
    }

    .workout-list span {
        text-align: left;
    }
}

.app-sidebar-user {
    margin-bottom: 24px;
}

.app-sidebar-user span {
    display: block;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.app-sidebar-user strong {
    display: block;
    margin-top: 10px;
    color: var(--color-text);
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.app-main {
    animation: dashboardFadeUp var(--transition-slow) both;
}

.stat-card,
.app-panel,
.app-sidebar {
    animation: dashboardFadeUp var(--transition-slow) both;
}

.stat-card:nth-child(1) { animation-delay: .04s; }
.stat-card:nth-child(2) { animation-delay: .08s; }
.stat-card:nth-child(3) { animation-delay: .12s; }
.stat-card:nth-child(4) { animation-delay: .16s; }

.app-panel:nth-child(1) { animation-delay: .10s; }
.app-panel:nth-child(2) { animation-delay: .14s; }
.app-panel:nth-child(3) { animation-delay: .18s; }
.app-panel:nth-child(4) { animation-delay: .22s; }
.app-panel:nth-child(5) { animation-delay: .26s; }

.stat-card,
.app-panel,
.app-menu a {
    transition:
        transform var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast);
}

.stat-card:hover,
.app-panel:hover {
    background: rgba(255, 255, 255, 0.045);
}

.app-menu a:hover {
    transform: translateX(2px);
}

@keyframes dashboardFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
