@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #14171a;
    --surface: #1e2328;
    --surface-2: #262c32;
    --stroke: #333a41;
    --text: #f2f0eb;
    --text-muted: #8b9199;
    --red: #e8432c;
    --red-dim: #7a291d;
    --amber: #ffb627;
    --green: #3fb95a;
    --blue: #4a9eff;
    --violet: #a78bfa;
    --font-display: 'Oswald', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: #0a0c0e;
    margin: 0;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.conteneur {
    max-width: 760px;
    margin: 40px auto;
    background: var(--bg);
    padding: 32px 36px;
    border-radius: 16px;
    border: 1px solid var(--stroke);
    box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
}
.conteneur-large { max-width: 1140px; }

h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 25px;
    margin-top: 0;
    letter-spacing: 0.01em;
}
h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 19px;
    color: var(--text);
    letter-spacing: 0.01em;
}
h3 { font-family: var(--font-display); font-weight: 600; }

.entete {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--stroke);
}
.entete a { color: var(--text-muted); text-decoration: none; font-size: 13px; }
.entete a:hover { color: var(--text); }
.entete a.deconnexion { color: var(--red); font-weight: 600; }

label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input[type=email], input[type=text], input[type=password], input[type=file], select, textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--stroke);
    border-radius: 10px;
    font-size: 15px;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-body);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(232,67,44,0.18);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }

button, .bouton {
    display: inline-block;
    margin-top: 18px;
    background: var(--red);
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s ease, transform 0.1s ease;
}
button.secondaire, .bouton.secondaire { background: var(--surface-2); color: var(--text); border: 1px solid var(--stroke); }
button.vert, .bouton.vert { background: var(--green); }
button:hover, .bouton:hover { opacity: 0.88; }
button:active, .bouton:active { transform: scale(0.98); }

.message-succes {
    background: rgba(63,185,90,0.12); color: var(--green);
    border: 1px solid rgba(63,185,90,0.35);
    padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px;
}
.message-erreur {
    background: rgba(232,67,44,0.12); color: #ff8a75;
    border: 1px solid rgba(232,67,44,0.35);
    padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px;
}

table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--stroke); }
th {
    color: var(--text-muted); font-size: 11px; text-transform: uppercase;
    font-family: var(--font-display); letter-spacing: 0.06em; font-weight: 600;
}
td { font-family: var(--font-body); }
tr:hover td { background: rgba(255,255,255,0.02); }

.badge {
    padding: 4px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 700;
    font-family: var(--font-body); display: inline-block;
    border: 1px solid transparent;
}
.badge-attente    { background: rgba(255,182,39,0.14);  color: var(--amber);  border-color: rgba(255,182,39,0.35); }
.badge-repondant  { background: rgba(74,158,255,0.14);  color: var(--blue);   border-color: rgba(74,158,255,0.35); }
.badge-forcee     { background: rgba(167,139,250,0.14); color: var(--violet); border-color: rgba(167,139,250,0.35); }
.badge-final      { background: rgba(63,185,90,0.14);   color: var(--green);  border-color: rgba(63,185,90,0.35); }
.badge-refuse     { background: rgba(139,145,153,0.14); color: var(--text-muted); border-color: rgba(139,145,153,0.3); }

.carte-cours {
    border: 1px solid var(--stroke); border-radius: 14px; padding: 18px;
    margin-bottom: 14px; background: var(--surface);
}
.carte-cours h3 { margin: 0 0 6px; font-size: 17px; }
.carte-cours .petite-note { font-family: var(--font-mono); }

.petite-note { color: var(--text-muted); font-size: 13px; }

.liens-accueil { display: flex; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.liens-accueil a {
    flex: 1; min-width: 140px; text-align: center; padding: 22px 14px; border-radius: 14px;
    background: var(--surface); border: 1px solid var(--stroke); text-decoration: none;
    color: var(--text); font-weight: 600; font-family: var(--font-display);
    letter-spacing: 0.02em; transition: border-color 0.15s ease, transform 0.1s ease;
}
.liens-accueil a:hover { border-color: var(--red); transform: translateY(-1px); }

a { color: var(--blue); }

::selection { background: rgba(232,67,44,0.35); }

/* ===== Squelette applicatif avec navigation latérale ===== */
.app-layout { display: flex; min-height: 100vh; }

.app-sidebar {
    width: 250px; background: var(--surface); border-right: 1px solid var(--stroke);
    display: flex; flex-direction: column; flex-shrink: 0;
    position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 20;
}
.app-sidebar .brand {
    padding: 20px 20px 18px; display: flex; align-items: center; gap: 11px;
    border-bottom: 1px solid var(--stroke); flex-shrink: 0;
}
.app-sidebar .brand .icone {
    width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
    background: linear-gradient(160deg, var(--red), var(--red-dim));
    display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.app-sidebar .brand p.n { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; margin: 0; }
.app-sidebar .brand p.c { font-family: monospace; font-size: 10.5px; color: var(--muted); margin: 1px 0 0; }

.app-nav { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.app-nav .groupe {
    font-family: var(--font-display); font-size: 10.5px; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase; color: #565d66; margin: 14px 10px 6px;
}
.app-nav .groupe:first-child { margin-top: 2px; }
.app-nav a.item {
    display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
    font-size: 13px; font-weight: 500; text-decoration: none; color: var(--muted);
    font-family: var(--font-body);
}
.app-nav a.item:hover { background: var(--surface2); color: var(--text); }
.app-nav a.item.actif { background: var(--red); color: #fff; font-weight: 600; }
.app-nav a.item .ic { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.app-sidebar .footer-side { padding: 12px; border-top: 1px solid var(--stroke); flex-shrink: 0; }
.app-sidebar .footer-side a, .app-sidebar .footer-side button {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--surface2); color: var(--text); border: 1px solid var(--stroke);
    border-radius: 9px; padding: 9px; font-size: 12.5px; font-weight: 600; cursor: pointer;
    text-decoration: none; margin: 0; box-sizing: border-box;
}
.app-sidebar .footer-side a.deconnexion { background: var(--red); border-color: var(--red); color: #fff; }

.app-main { flex: 1; min-width: 0; }
.app-inner { max-width: 900px; margin: 0 auto; padding: 32px 40px; }

.app-topbar-mobile {
    display: none; align-items: center; gap: 12px; padding: 14px 16px;
    background: var(--surface); border-bottom: 1px solid var(--stroke); position: sticky; top: 0; z-index: 15;
}
.app-topbar-mobile button {
    margin: 0; background: var(--surface2); border: 1px solid var(--stroke); color: var(--text);
    padding: 8px 12px; border-radius: 8px; font-size: 18px; line-height: 1;
}
.app-topbar-mobile .titre-mini { font-family: var(--font-display); font-weight: 600; font-size: 15px; }

@media (max-width: 900px) {
    .app-topbar-mobile { display: flex; }
    .app-sidebar {
        position: fixed; left: -270px; top: 0; height: 100vh; transition: left 0.2s ease;
        box-shadow: 20px 0 40px rgba(0,0,0,0.4);
    }
    .app-sidebar.ouvert { left: 0; }
    .app-overlay {
        display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 19;
    }
    .app-overlay.visible { display: block; }
    .app-inner { padding: 20px 18px; }
}
