/* ============================================================================
   Design system Skillopolis — publie depuis src/styles/shell.css.
   Version 4. Ne pas editer ce fichier directement : republier via
   scripts/publish-design-system.mjs dans le depot skillopolis.
   ============================================================================ */
/* ============================================================================
   Coquille d'application des ecrans ecole / admin.

   Reprise a l'identique d'ecole-api (classes `.app-sidebar*`, `body.has-sidebar`)
   pour que les pages existantes s'y posent sans retouche de balisage. Seules les
   couleurs passent par les jetons de role.
   ========================================================================= */

body.has-sidebar { display: flex; min-height: 100vh; align-items: stretch; }

.app-sidebar {
    width: 232px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    background: var(--ui-page);
    border-right: 1px solid var(--ui-border);
}

.app-sidebar-brand { display: flex; align-items: center; gap: var(--space-2); padding: 2px 18px var(--space-4); }
.app-sidebar-brand-mark { width: 20px; height: 20px; border-radius: 5px; background: var(--ui-accent); flex-shrink: 0; }
.app-sidebar-brand-name { font-size: 13.5px; font-weight: 600; color: var(--ui-fg); }
.app-sidebar-brand-sub { font-size: var(--text-eyebrow); color: var(--ui-fg-faint); }

.app-sidebar-group { padding: 0 10px; }
.app-sidebar-group + .app-sidebar-group { margin-top: 14px; }
.app-sidebar-label {
    padding: 0 var(--space-2) 6px;
    font-size: var(--text-eyebrow);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ui-fg-faint);
}

.app-sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px var(--space-2);
    margin-bottom: 1px;
    border-left: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-size: var(--text-body);
    font-weight: 500;
    color: var(--ui-fg-muted);
}
.app-sidebar-link:hover { color: var(--ui-fg); }
.app-sidebar-link.active {
    background: var(--ui-accent-soft);
    border-left-color: var(--ui-accent);
    color: var(--ui-accent);
    font-weight: 600;
}

.app-sidebar-foot {
    margin-top: auto;
    padding: 14px 18px 0;
    border-top: 1px solid var(--ui-border);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.app-sidebar-email { font-size: 11.5px; color: var(--ui-fg-muted); word-break: break-all; }
.app-sidebar-logout {
    align-self: flex-start;
    padding: 0;
    border: none;
    background: none;
    color: var(--ui-fg-faint);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
}
.app-sidebar-logout:hover { color: var(--ui-fg); }

/* Pages a mise en page sur mesure : meme role que `.page`, sans son padding. */
.app-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ============================================================================
   Responsive — 3 paliers : plein / rail 74 px / tiroir + voile.

   Attend un bouton hamburger `header.mobile-bar` et un `.sidebar-backdrop`
   dans le balisage (masques par defaut hors palier tiroir), et une classe
   `body.drawer-open` pilotee en JS pour ouvrir/fermer le tiroir mobile.
   ========================================================================= */
body.has-sidebar .app-sidebar-toggle { display: none; }
header.mobile-bar { display: none; }

@media (max-width: 1023px) {
    body.has-sidebar .app-content { padding-top: 0; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .app-sidebar { width: 74px; }
    .app-sidebar-brand { padding: 2px 12px var(--space-4); }
    .app-sidebar-brand-names, .app-sidebar-label, .app-sidebar-link .link-text,
    .app-sidebar-foot .app-sidebar-email { display: none; }
    .app-sidebar-brand { justify-content: center; }
    .sidebar-search { display: none; }
    .theme-row { justify-content: center; padding: 0; }
    .theme-label { display: none; }
    .app-sidebar-group { padding: 0 8px; }
    .app-sidebar-link { justify-content: center; padding: 8px 4px; }
    .page { padding: var(--space-5) var(--space-5); }
}

@media (max-width: 767px) {
    body.has-sidebar { flex-direction: column; }
    .app-sidebar {
        position: fixed;
        top: 0; bottom: 0; left: 0;
        width: 232px;
        z-index: var(--z-panel);
        transform: translateX(-100%);
        transition: transform var(--transition);
        box-shadow: var(--ui-shadow);
    }
    body.drawer-open .app-sidebar { transform: none; }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 19, 26, 0.5);
        z-index: 35;
        display: none;
    }
    body.drawer-open .sidebar-backdrop { display: block; }
    header.mobile-bar {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        padding: var(--space-3) var(--space-4);
        border-bottom: 1px solid var(--ui-border);
        background: var(--ui-bg);
    }
    body.has-sidebar .page { padding: var(--space-4) var(--space-4); }
    .field-row { flex-wrap: wrap; }
    .field-row .field { flex: 1 1 100%; }
    .icon-btn { width: 44px; height: 44px; }
    .page-btn { min-width: 44px; height: 44px; }
}
