/* ab-school Followup – charte ab-school : bleu #4285F4, turquoise #56BDB9, jaune #FBBB1B, rose #E96493. */
:root {
  --blue: #4285F4; --teal: #56BDB9; --yellow: #FBBB1B; --pink: #E96493; --navy: #0f3a8f;
  --hero: linear-gradient(150deg, #0c2f78 0%, #1a4fb8 50%, #3478f0 100%);
  --side: linear-gradient(180deg, #0c2f78, #1a4fb8);
  --paper: #f3f6fc; --panel: #fff; --panel-2: #f7f9fd; --ink: #142036; --muted: #5a6680; --line: #e2e7f1;
  --accent: #2f6fde; --accent-text: #1f5fd1; --accent-soft: #e8f0fe;
  --good: #188038; --good-soft: #e3f4e8; --warn: #8a5a00; --warn-soft: #fdf1d8; --bad: #c5221f; --bad-soft: #fce8e6;
  --shadow: 0 1px 2px rgba(16, 32, 72, .05), 0 10px 30px -14px rgba(16, 32, 72, .18);
  --font: Lexend, system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
h2 { font-size: 17px; } h3 { font-size: 14.5px; }
p { margin: 0; }
a { color: var(--accent-text); }
.muted { color: var(--muted); font-size: 13.5px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-text); }
.btn.primary { background: linear-gradient(135deg, #3478f0, #1f5fd1); color: #fff; border-color: transparent; }
.btn.primary:hover:not(:disabled) { color: #fff; filter: brightness(1.06); }
.btn.ok { background: var(--good); color: #fff; border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.fld { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); min-width: 0; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-width: 0; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
textarea { resize: vertical; min-height: 70px; }
.msg { padding: 10px 13px; border-radius: 10px; font-size: 13.5px; }
.msg.error { background: var(--bad-soft); color: var(--bad); } .msg.ok { background: var(--good-soft); color: var(--good); } .msg.warn { background: var(--warn-soft); color: var(--warn); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.pill.g { background: var(--good-soft); color: var(--good); } .pill.y { background: var(--warn-soft); color: var(--warn); } .pill.r { background: var(--bad-soft); color: var(--bad); }
.pill.n { background: #eef1f7; color: var(--muted); } .pill.p { background: #fdeef3; color: #b8366a; } .pill.t { background: #e6f6f5; color: #237d79; }

/* ---------- Connexion */
.login-page { min-height: 100vh; background: var(--hero); }
.login { min-height: 100vh; max-width: 1100px; margin: 0 auto; padding: 40px 24px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.login-hero { color: #fff; display: grid; gap: 22px; }
.logo-tile { background: #fff; border-radius: 12px; padding: 8px 12px; width: max-content; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .4); }
.logo-tile img { display: block; height: 56px; }
.login-hero h1 { font-size: clamp(32px, 4.5vw, 48px); font-weight: 700; letter-spacing: -.03em; }
.login-hero h1 em { font-style: normal; color: #FBBB1B; }
.login-hero .lead { color: rgba(255, 255, 255, .85); font-size: 17px; max-width: 500px; }
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.points li { display: flex; gap: 12px; align-items: center; padding: 11px 15px; border-radius: 13px; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .15); max-width: 500px; }
.d { width: 12px; height: 12px; border-radius: 4px; flex: none; } .d.b { background: #4285F4; } .d.t { background: #56BDB9; } .d.y { background: #FBBB1B; }
.login-card { background: #fff; border-radius: 20px; padding: 30px; display: grid; gap: 14px; box-shadow: 0 30px 60px -20px rgba(6, 20, 60, .5); max-width: 440px; width: 100%; justify-self: end; }
.login-card h2 { font-size: 22px; } .login-card .link { font-size: 13px; text-decoration: none; }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; gap: 26px; padding: 26px 16px; } .login-card { justify-self: stretch; max-width: none; padding: 22px; } .points { display: none; } }

/* ---------- Application : menu latéral + page */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); color: #fff; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; }
.side-logo { display: block; background: #fff; border-radius: 11px; padding: 6px 10px; margin-bottom: 10px; width: max-content; }
.side-logo img { display: block; height: 40px; }
.side .grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; opacity: .55; margin: 14px 10px 4px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: rgba(255, 255, 255, .86); text-decoration: none; font-size: 14px; }
.side nav a:hover { background: rgba(255, 255, 255, .1); }
.side nav a.on { background: rgba(255, 255, 255, .2); color: #fff; font-weight: 600; }
.side nav a i { width: 9px; height: 9px; border-radius: 3px; background: currentColor; opacity: .55; flex: none; }
.side nav a.soon { opacity: .5; cursor: default; } .side nav a.soon:hover { background: none; }
.side nav a .later { margin-left: auto; font-size: 10px; padding: 1px 7px; border-radius: 99px; background: rgba(255, 255, 255, .14); white-space: nowrap; flex: none; }
.side nav a { white-space: nowrap; }
.week-wrap { padding-bottom: 12px; }
.side-me { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 14px 6px 6px; border-top: 1px solid rgba(255, 255, 255, .15); }
.side-me b { display: block; font-size: 13.5px; } .side-me small { opacity: .75; font-size: 12px; }
.side-actions { display: flex; gap: 14px; padding: 4px 6px 0; } .side-actions .link { color: rgba(255, 255, 255, .8); font-size: 12.5px; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #FBBB1B; color: #142036; font-weight: 700; font-size: 13px; flex: none; }
.page { min-width: 0; display: grid; grid-template-rows: auto 1fr; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 20px 28px 8px; flex-wrap: wrap; }
.tb-title { flex: 1; min-width: 200px; } .tb-title h1 { font-size: 22px; } .tb-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
main { padding: 12px 28px 48px; display: grid; gap: 18px; align-content: start; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.menu-btn { display: none; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: #fff; padding: 10px 9px; flex-direction: column; justify-content: space-between; cursor: pointer; }
.menu-btn span { display: block; height: 2px; border-radius: 2px; background: var(--ink); }
.veil { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-105%); transition: transform .25s ease; }
  .shell.open .side { transform: none; }
  .shell.open .veil { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(8, 18, 45, .45); }
  .menu-btn { display: flex; }
  .topbar { padding: 14px 16px 4px; } main { padding: 10px 16px 40px; }
  .tb-title h1 { font-size: 19px; }
}

/* ---------- Composants */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card > h2 { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; } .card > h2 .r { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 14px 20px; position: relative; box-shadow: var(--shadow); }
.kpi::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c, var(--blue)); }
.kpi small { display: block; color: var(--muted); font-size: 12.5px; } .kpi b { font-size: 24px; letter-spacing: -.02em; } .kpi em { display: block; font-style: normal; font-size: 12px; color: var(--good); }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; } .grid2e { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .grid2, .grid2e { grid-template-columns: 1fr; } }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 9px 10px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr.click { cursor: pointer; } tbody tr.click:hover td { background: var(--panel-2); }
.line { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); } .line:last-child { border-bottom: 0; }
.hb { height: 9px; border-radius: 5px; background: #eef1f7; overflow: hidden; flex: 1; } .hb i { display: block; height: 100%; border-radius: 5px; background: var(--c, var(--accent)); }
.empty { color: var(--muted); text-align: center; padding: 26px 10px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; width: max-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 10px; font: inherit; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.chk { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; } .chk input { width: 17px; height: 17px; accent-color: var(--accent); }
.matrix td, .matrix th { text-align: center; } .matrix td:first-child, .matrix th:first-child { text-align: left; }
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; vertical-align: -2px; margin-right: 6px; }
dialog { border: 0; border-radius: 18px; padding: 22px; width: min(520px, calc(100% - 28px)); box-shadow: 0 30px 60px -20px rgba(6, 20, 60, .5); }
dialog::backdrop { background: rgba(8, 18, 45, .5); backdrop-filter: blur(3px); }
dialog .acts { display: flex; justify-content: flex-end; gap: 8px; }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 90; }
.toast { background: #142036; color: #fff; padding: 10px 16px; border-radius: 11px; font-size: 13.5px; box-shadow: var(--shadow); animation: fade 4s forwards; }
@keyframes fade { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
.secret { font: 600 16px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .05em; padding: 10px 14px; background: var(--warn-soft); color: #5c3c00; border-radius: 10px; user-select: all; }

/* ---------- Emploi du temps */
.week-wrap { overflow-x: auto; }
.week { display: grid; grid-template-columns: 52px repeat(var(--days, 6), minmax(120px, 1fr)); min-width: 720px; position: relative; }
.week .dh { text-align: center; font-weight: 600; font-size: 13px; color: var(--muted); padding: 6px 0 8px; }
.week .col { position: relative; border-left: 1px solid var(--line); height: calc(var(--hours) * 54px); background: repeating-linear-gradient(180deg, transparent 0 53px, var(--line) 53px 54px); }
.week .hours { position: relative; height: calc(var(--hours) * 54px); }
.week .hours span { position: absolute; right: 8px; font-size: 11.5px; color: var(--muted); transform: translateY(-50%); }
.slot { position: absolute; left: 4px; right: 4px; border-radius: 9px; padding: 5px 8px; color: #fff; font-size: 12px; line-height: 1.3; overflow: hidden; box-shadow: 0 2px 6px rgba(16, 32, 72, .18); cursor: default; }
.slot b { display: block; font-size: 12.5px; } .slot small { opacity: .9; font-size: 11px; display: block; }
.slot .x { position: absolute; top: 3px; right: 4px; background: rgba(0, 0, 0, .25); color: #fff; border: 0; border-radius: 6px; width: 20px; height: 20px; cursor: pointer; font-size: 13px; line-height: 1; display: none; }
.slot:hover .x { display: block; }
