:root {
    --bg: #0f1115;
    --card: #1a1d24;
    --border: #2a2f3a;
    --text: #e7e9ee;
    --muted: #9aa3b2;
    --primary: #4f7cff;
    --primary-hover: #3d68e6;
    --danger: #e05260;
    --success: #3fbf7f;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* ---- Auth ---- */
.auth-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.auth-shell { width: 100%; max-width: 400px; padding: 1.5rem; }
.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
}
.auth-header { text-align: center; margin-bottom: 1.5rem; }
.auth-brand { margin: 0; font-size: 1.4rem; }
.auth-version { margin: .25rem 0 0; color: var(--muted); font-size: .75rem; }
.auth-title { margin: 0 0 1.25rem; font-size: 1.1rem; }
.auth-link { text-align: center; margin-top: 1rem; font-size: .9rem; }
.auth-link a { color: var(--primary); text-decoration: none; }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field__label { font-size: .85rem; color: var(--muted); }
.field input {
    padding: .65rem .75rem;
    background: #11141a;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: .95rem;
}
.field input:focus { outline: none; border-color: var(--primary); }

/* ---- Buttons ---- */
.btn {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    padding: .6rem 1rem;
    font-size: .9rem;
    font-weight: 600;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn--ghost:hover { color: var(--text); }

/* ---- Flash ---- */
.flashes { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.flash { padding: .6rem .8rem; border-radius: 8px; font-size: .88rem; }
.flash--error { background: rgba(224, 82, 96, .15); color: var(--danger); border: 1px solid rgba(224,82,96,.3); }
.flash--success { background: rgba(63, 191, 127, .15); color: var(--success); border: 1px solid rgba(63,191,127,.3); }

/* ---- App layout ---- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 1.25rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}
.topbar__brand { font-weight: 700; }
.topbar__right { display: flex; align-items: center; gap: 1rem; }
.topbar__user { color: var(--muted); font-size: .9rem; }
.topbar__logout { margin: 0; }

.app-main { padding: 2rem 1.5rem; }
.app-main > * { max-width: 960px; }
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
}
.muted { color: var(--muted); }
.error-box { text-align: center; }

/* ---- Layout 2 colonnes (sidebar + contenu) ---- */
.layout { display: flex; min-height: 100vh; }
.layout__content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: #14171d;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0;
}
.sidebar__brand {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .75rem;
}
.sidebar__brand-name { font-weight: 700; font-size: 1rem; }
.sidebar__brand-version { color: var(--muted); font-size: .7rem; }

.sidebar__nav { display: flex; flex-direction: column; gap: .15rem; padding: 0 .65rem; }
.sidebar__link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem .75rem;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: .92rem;
    transition: background .12s, color .12s;
}
.sidebar__link:hover { background: rgba(255,255,255,.04); color: var(--text); }
.sidebar__link.is-active { background: rgba(79,124,255,.15); color: #fff; }
.sidebar__icon { width: 1.1rem; text-align: center; opacity: .9; }

.topbar__title { font-weight: 600; }
