@font-face { font-family: "Aeonikfono"; src: url("/assets/fonts/AeonikFono-Light.otf") format("opentype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Aeonikfono"; src: url("/assets/fonts/AeonikFono-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Aeonikfono"; src: url("/assets/fonts/AeonikFono-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Aeonikfono"; src: url("/assets/fonts/AeonikFono-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }

:root {
  --black: #131313;
  --white: #ffffff;
  --dust: #fadcd2;
  --golden: #d5af78;
  --golden-ink: #8a6a35;
  --sky: #e5ecf0;
  --stone: #b4aca8;
  --bg: #faf8f6;
  --line: #ebe6e2;
  --muted: #6f6762;
  --ok: #3f7a4f;
  --crit: #b5452f;
  --display: "Aeonikfono", Tahoma, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --r-lg: 30px;
  --r-md: 20px;
  --r-sm: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--black); font-family: var(--body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -0.02em; margin: 0; line-height: 1.1; }
h1 { font-size: clamp(30px, 4vw, 44px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-family: var(--display); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ——— Coque ——— */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
.side { background: var(--black); color: var(--white); padding: 28px 18px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100dvh; }
.side .logo { display: flex; align-items: center; gap: 10px; padding: 0 10px; }
.side .logo img { height: 30px; width: auto; filter: brightness(0) invert(1); }
.side .logo span { font-family: var(--display); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; background: var(--dust); color: var(--black); padding: 3px 8px; border-radius: 50px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { padding: 10px 14px; border-radius: 50px; font-family: var(--display); font-size: 16px; color: #cfc9c5; display: flex; justify-content: space-between; align-items: center; }
.nav a:hover { color: var(--white); background: #222; }
.nav a[aria-current="page"] { background: var(--white); color: var(--black); }
.nav .count { font-size: 12px; background: var(--golden); color: var(--black); border-radius: 50px; padding: 1px 8px; }
.side .me { margin-top: auto; padding: 14px; border-radius: var(--r-md); background: #1e1e1e; display: flex; flex-direction: column; gap: 8px; }
.side .me b { font-family: var(--display); font-weight: 500; }
.side .me button { background: none; border: 0; padding: 0; color: #a9a29d; text-align: left; font-size: 13px; }
.side .me button:hover { color: var(--white); }
.main { padding: 40px clamp(18px, 4vw, 56px) 80px; max-width: 1280px; width: 100%; }
.pagehead { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.pagehead p { margin-top: 8px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; padding: 14px 16px; gap: 12px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav a { white-space: nowrap; gap: 8px; }
  .side .me { flex-direction: row; justify-content: space-between; align-items: center; margin-top: 0; }
  .main { padding: 24px 16px 60px; }
}

/* ——— Éléments ——— */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; min-width: 0; }
.card.dust { background: var(--dust); border-color: transparent; }
.card.sky { background: var(--sky); border-color: transparent; }
.card.dark { background: var(--black); color: var(--white); border-color: transparent; }
.card.dark .muted { color: #a9a29d; }
.cardhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .g3, .g-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .g2 { grid-template-columns: minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 18px; }

.big { font-family: var(--display); font-size: 44px; line-height: 1; letter-spacing: -0.03em; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 10px; border-radius: 50px; background: var(--sky); white-space: nowrap; }
.pill.dust { background: var(--dust); }
.pill.gold { background: var(--golden); }
.pill.line { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.pill.dark { background: var(--black); color: var(--white); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--black); background: var(--black); color: var(--white); padding: 10px 20px; border-radius: 50px; font-family: var(--display); font-size: 15px; white-space: nowrap; }
.btn:hover { background: #2b2b2b; }
.btn.ghost { background: transparent; color: var(--black); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--black); }
.btn.sm { padding: 6px 14px; font-size: 13px; }
.linkbtn { background: none; border: 0; padding: 4px 6px; color: var(--muted); font-size: 13px; border-radius: 8px; }
.linkbtn:hover { color: var(--crit); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.input { border: 1px solid var(--line); background: var(--white); border-radius: 50px; padding: 10px 16px; min-width: 0; width: 100%; color: var(--black); font-size: 15px; }
textarea.input { border-radius: var(--r-md); resize: vertical; }
.input:focus { outline: none; border-color: var(--black); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.row > .grow { flex: 1 1 220px; }
.msg { padding: 10px 16px; border-radius: var(--r-sm); font-size: 14px; }
.msg.err { background: #f9e3dc; color: var(--crit); }
.msg.ok { background: #e4ece3; color: var(--ok); overflow-wrap: anywhere; }

/* ——— Listes ——— */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list .meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.check { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 1.5px solid var(--stone); background: var(--white); display: grid; place-items: center; padding: 0; color: transparent; font-size: 13px; line-height: 1; }
.check:hover { border-color: var(--black); }
.check.on { background: var(--black); border-color: var(--black); color: var(--white); }
.done .txt { color: var(--muted); text-decoration: line-through; }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--stone); border-radius: var(--r-md); }
.bar { height: 8px; border-radius: 50px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--black); border-radius: 50px; }
.card.dust .bar, .card.sky .bar { background: rgba(0, 0, 0, 0.12); }

.tile { display: flex; flex-direction: column; gap: 10px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; transition: border-color 0.15s, transform 0.15s; min-width: 0; }
a.tile:hover, .tile:has(a.go:hover) { border-color: var(--black); transform: translateY(-2px); }
.tile > .pill { align-self: flex-start; }
.tile .go { font-family: var(--display); font-size: 14px; margin-top: auto; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } a.tile:hover { transform: none; } }

.day { border-top: 1px solid var(--line); }
.day:first-of-type { border-top: 0; }
.day summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; cursor: pointer; font-family: var(--display); font-size: 17px; list-style: none; }
.day summary::-webkit-details-marker { display: none; }
.day summary::before { content: "+"; width: 18px; color: var(--muted); }
.day[open] summary::before { content: "–"; }
.day summary > span:first-child { flex: 1; }
.day .list { padding: 0 0 10px 18px; }
.time { font-family: var(--display); width: 52px; flex: none; }

.weeknav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { padding: 6px 14px; border-radius: 50px; border: 1px solid var(--line); background: var(--white); font-size: 14px; }
.tabs a[aria-current="true"] { background: var(--black); color: var(--white); border-color: var(--black); }

/* ——— Connexion ——— */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login .art { background: var(--dust); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login .art img { height: 44px; width: auto; align-self: flex-start; }
.login .art h1 { font-size: clamp(36px, 5vw, 64px); max-width: 11ch; }
.login .form { display: grid; place-items: center; padding: 32px 20px; background: var(--white); }
.login form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 800px) { .login { grid-template-columns: minmax(0, 1fr); } .login .art { padding: 28px 20px; gap: 40px; } }

/* ——— Ajouts version PHP ——— */
.big { margin: 14px 0 6px; }
.card.dark .eyebrow { color: #a9a29d; }
.card.dark .bar { background: #333; }
.card.dark .bar > i { background: var(--dust); }
.side .me .mail { color: #a9a29d; overflow-wrap: anywhere; }
.tilefoot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.txt b { font-weight: 600; }
.day summary > span:first-child { text-transform: none; }

/* ——— Dashboards intégrés ——— */
.main.wide { max-width: none; padding-bottom: 24px; }
.embedbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.embedbar h2 { flex: 1; min-width: 160px; }
.embed { width: 100%; height: calc(100dvh - 150px); min-height: 520px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); }

/* ——— Menu par catégories, rôles ——— */
.side { overflow-y: auto; gap: 20px; }
.nav { gap: 14px; }
.navgroup { display: flex; flex-direction: column; gap: 2px; }
.navlabel { font-family: var(--display); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: #8d8580; padding: 0 14px 4px; }
.nav a { padding: 8px 14px; font-size: 15px; }
.msg.info { background: var(--sky); color: var(--black); }
.lecture form[action^="/action/"] { display: none; }
.list li.wrap { flex-wrap: wrap; }
form.inline { display: inline-flex; gap: 6px; align-items: center; }
.input.sm { padding: 6px 10px; font-size: 13px; width: auto; }
.linkbtn.plain:hover { color: var(--black); }
.scrollx { overflow-x: auto; }
table.rights { border-collapse: collapse; width: 100%; min-width: 860px; font-size: 14px; }
.rights th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.rights td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rights tr:last-child td { border-bottom: 0; }
.rights .acts { white-space: nowrap; }
.rights .acts form { display: inline-flex; }
@media (max-width: 860px) {
  .nav { flex-direction: row; gap: 4px; }
  .navgroup { flex-direction: row; gap: 4px; }
  .navlabel { display: none; }
}
