/* Plateforme La Chrysalide : palette orangée du site (brand-ink #b45309). */
:root {
    --brand: #b45309;
    --brand-dark: #92400e;
    --brand-soft: #fef3c7;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #faf7f2;
    --card: #ffffff;
    --ok: #166534;
    --ok-bg: #dcfce7;
    --err: #991b1b;
    --err-bg: #fee2e2;
    --radius: 10px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
a { color: var(--brand); }
code { background: var(--brand-soft); padding: .1em .35em; border-radius: 4px; word-break: break-all; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .9rem; }

/* Formulaires */
label { display: block; font-weight: 600; font-size: .95rem; }
input, select { display: block; width: 100%; margin-top: .3rem; padding: .6rem .7rem; font: inherit; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; }
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.stack { display: grid; gap: .9rem; margin-bottom: 1rem; }
.grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; }
.inline-form { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; margin-top: 1rem; }
.inline-form label { flex: 1 1 240px; }

.btn { display: inline-block; padding: .6rem 1rem; font: inherit; font-weight: 600; border: 1px solid var(--brand); color: var(--brand); background: #fff; border-radius: 8px; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { background: var(--brand-soft); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { border-color: var(--err); color: var(--err); }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.btn.block { display: block; width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }

.alert { padding: .75rem 1rem; border-radius: 8px; margin: 0 0 1rem; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.error { background: var(--err-bg); color: var(--err); }
ul.alert { padding-left: 2rem; }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; }
td form { margin: 0; }

/* Écrans de connexion */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.auth-card { width: 100%; max-width: 440px; background: var(--card); padding: 2rem; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.brand { font-weight: 800; color: var(--brand); margin: 0 0 1.5rem; font-size: 1.2rem; }
.brand span { display: block; font-weight: 500; color: var(--muted); font-size: .9rem; }
.separator { text-align: center; color: var(--muted); margin: 1rem 0; }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .75rem; }
.qr { background: #fff; padding: .5rem; display: inline-block; margin: .5rem 0; border: 1px solid var(--line); border-radius: 8px; }
.qr svg { display: block; width: 200px; height: 200px; }
.codes { columns: 2; list-style: none; padding: 0; font-size: 1.05rem; }
.codes li { margin-bottom: .4rem; }
details { margin: 1rem 0; }
summary { cursor: pointer; color: var(--brand); }

/* Application */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 1.25rem 1rem; display: flex; flex-direction: column; }
.sidebar ul { list-style: none; padding: 0; margin: 0 0 1rem; }
.sidebar li a, .sidebar li.soon { display: block; padding: .45rem .6rem; border-radius: 6px; text-decoration: none; color: var(--ink); }
.sidebar li a:hover { background: var(--brand-soft); }
.sidebar li.soon { color: var(--muted); }
.sidebar small { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.nav-title { font-size: .75rem; text-transform: uppercase; color: var(--muted); margin: .5rem .6rem; letter-spacing: .05em; }
.me { margin-top: auto; display: grid; gap: .25rem; padding: .6rem; border-top: 1px solid var(--line); }
.me a { text-decoration: none; }
.content { padding: 2rem; max-width: 1100px; }
.panel { background: var(--card); padding: 1.25rem; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.card.soon { opacity: .75; }
.select-all { user-select: all; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 760px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
    .content { padding: 1rem; }
}
@media print {
    .sidebar, .btn { display: none; }
}
