/* =====================================================================
   ENT Université 20 Août 1955 · Skikda
   Feuille de style unique, sans framework. Propriétés logiques
   (margin-inline, padding-inline, inset-inline…) : la même feuille sert
   l'arabe (RTL) et le français (LTR) sans fichier séparé.
   ===================================================================== */

/* Polices optionnelles : déposez les .woff2 dans public/assets/fonts (voir README).
   À défaut, les polices système prennent le relais. */
@font-face { font-family: "Cairo"; src: url("../fonts/cairo-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Cairo"; src: url("../fonts/cairo-arabic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ink: #16272c;        --ink-2: #4b5d62;     --ink-3: #7a8a8e;
  --bg: #eef3f3;         --surface: #ffffff;   --surface-2: #f5f8f8;  --line: #d8e1e2;
  --petrol: #0e5a64;     --petrol-700: #0a4750; --petrol-900: #07333a; --sea: #2a8a94;   --sea-50: #e4f1f2;
  --sand: #e6d6b3;       --sand-50: #f8f2e4;
  --ok: #2f7a4c;   --ok-50: #e5f2ea;
  --warn: #9a6410; --warn-50: #fbf0dc;
  --bad: #a3383a;  --bad-50: #f8e6e6;
  --info: #2c62a5; --info-50: #e6eef9;
  --violet: #6e4a96; --violet-50: #efe8f6;
  --grey: #66757a; --grey-50: #eceff0;
  --r-lg: 14px; --r: 10px; --r-sm: 6px;
  --shadow: 0 1px 2px rgba(7, 51, 58, .05), 0 6px 18px rgba(7, 51, 58, .06);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --sidebar: 268px;
  --focus: 0 0 0 3px rgba(42, 138, 148, .45);
  /* Motif géométrique (étoile à huit branches) : l'identité visuelle de l'ENT */
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.10' stroke-width='1.2'%3E%3Crect x='18' y='18' width='28' height='28'/%3E%3Crect x='18' y='18' width='28' height='28' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='6'/%3E%3Cpath d='M0 0l18 18M64 0L46 18M0 64l18-18M64 64L46 46'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}
html[lang="ar"] { --font: "Cairo", "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); }
html[lang="ar"] body { font-size: 16px; line-height: 1.7; }
h1, h2, h3, p { margin: 0; }
a { color: var(--petrol); text-underline-offset: 3px; }
a:hover { color: var(--sea); }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
[hidden] { display: none !important; }
code { font-size: .85em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }

.icon { flex: none; vertical-align: middle; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 1rem; inset-block-start: -3rem; background: var(--petrol); color: #fff; padding: .5rem 1rem; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { inset-block-start: 1rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; align-items: center; gap: .6rem; }
.row.wrap { flex-wrap: wrap; }
.inline { display: inline; }
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.h-sub { font-size: .95rem; font-weight: 700; margin-block: 1.2rem .5rem; }

/* ---------------------------------------------------------------- Mise en page */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar); z-index: 40;
  display: flex; flex-direction: column; color: #e7f1f2;
  background: var(--motif) repeat, linear-gradient(180deg, var(--petrol-700), var(--petrol-900));
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1rem; color: #fff; text-decoration: none; }
.brand img { background: #fff; border-radius: 10px; padding: 4px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__text strong { font-size: 1.05rem; }
.brand__text span { font-size: .78rem; opacity: .75; }
.nav { padding: .5rem .75rem 1.5rem; display: flex; flex-direction: column; gap: .15rem; }
.nav__section { margin-block-start: 1rem; }
.nav__title { font-size: .78rem; opacity: .65; padding-inline: .75rem; margin-block-end: .3rem; }
.nav__link { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: var(--r); color: #dbe9eb; text-decoration: none; }
.nav__link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav__link.is-active { background: #fff; color: var(--petrol-700); font-weight: 600; }
.sidebar__foot { margin-block-start: auto; padding: 1rem 1.25rem; font-size: .75rem; opacity: .55; }

.main { flex: 1; min-width: 0; margin-inline-start: var(--sidebar); display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; padding: .7rem 1.5rem; background: rgba(238,243,243,.92); backdrop-filter: blur(6px); border-block-end: 1px solid var(--line); }
.topbar__menu { display: none; }
.topbar__title { font-size: 1.2rem; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__actions { display: flex; align-items: center; gap: .5rem; }
.content { padding: 1.5rem; width: 100%; max-width: 1280px; display: flex; flex-direction: column; gap: 1.25rem; }
.content:focus { outline: none; box-shadow: none; }
.backdrop { display: none; }

.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--surface); }
.bell__count { position: absolute; inset-block-start: 4px; inset-inline-end: 3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .7rem; line-height: 18px; text-align: center; }
.lang-switch { padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--ink); background: var(--surface); font-size: .85rem; }
html[lang="ar"] .lang-switch { font-family: "Inter", "Segoe UI", sans-serif; }
html[lang="fr"] .lang-switch { font-family: "Cairo", Tahoma, sans-serif; }

.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .25rem .4rem; border-radius: var(--r); }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--surface); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--sand); color: var(--petrol-900); font-weight: 700; font-size: .85rem; }
.usermenu__name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.usermenu__panel { position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + 6px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: .4rem; display: grid; }
.usermenu__panel a, .usermenu__panel button { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: var(--r-sm); border: 0; background: none; text-decoration: none; color: var(--ink); cursor: pointer; text-align: start; width: 100%; }
.usermenu__panel a:hover, .usermenu__panel button:hover { background: var(--surface-2); }

/* ---------------------------------------------------------------- Blocs */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.25rem; min-width: 0; }
.panel.narrow { max-width: 640px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-block-end: 1rem; flex-wrap: wrap; }
.panel__title { font-size: 1.05rem; font-weight: 700; margin-block-end: .9rem; display: flex; align-items: center; gap: .5rem; }
.panel__head .panel__title { margin: 0; }
.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); align-items: start; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--sea-50); color: var(--petrol); font-size: .8rem; }
.hello { font-size: 1.35rem; font-weight: 700; }
.breadcrumb a { display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; }
html[dir="ltr"] .breadcrumb .icon { transform: scaleX(-1); }
.page-actions { display: flex; justify-content: flex-end; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; }
.kpi { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; color: var(--ink); }
a.kpi:hover { border-color: var(--sea); }
.kpi__val { font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi__lbl { color: var(--ink-2); font-size: .88rem; }
.kpi--accent { background: var(--motif) repeat, var(--petrol); border-color: var(--petrol); color: #fff; }
.kpi--accent .kpi__lbl { color: #cfe5e7; }

.empty { color: var(--ink-2); padding: 1.25rem; text-align: center; background: var(--surface-2); border-radius: var(--r); }
.empty--page { margin: 4rem auto; max-width: 460px; display: grid; gap: 1rem; justify-items: center; background: none; }
.empty__code { font-size: 4rem; font-weight: 700; color: var(--petrol); line-height: 1; }
.link-more { display: inline-block; margin-block-start: .8rem; font-size: .9rem; }

/* ---------------------------------------------------------------- Alertes, badges */
.alert { padding: .8rem 1rem; border-radius: var(--r); border: 1px solid transparent; border-inline-start-width: 4px; }
.alert--success { background: var(--ok-50); border-color: var(--ok); }
.alert--error { background: var(--bad-50); border-color: var(--bad); }
.alert--warning { background: var(--warn-50); border-color: var(--warn); }
.alert--info { background: var(--info-50); border-color: var(--info); }

.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .6rem; border-radius: 99px; font-size: .8rem; font-weight: 600; white-space: nowrap; background: var(--grey-50); color: var(--grey); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--en_attente { background: var(--warn-50); color: var(--warn); }
.badge--confirme { background: var(--ok-50); color: var(--ok); }
.badge--honore { background: var(--sea-50); color: var(--petrol); }
.badge--absent { background: var(--violet-50); color: var(--violet); }
.badge--refuse, .badge--annule_responsable { background: var(--bad-50); color: var(--bad); }
.badge--reporte { background: var(--info-50); color: var(--info); }
.badge--compte-actif { background: var(--ok-50); color: var(--ok); }
.badge--compte-en_attente { background: var(--warn-50); color: var(--warn); }
.badge--compte-suspendu { background: var(--bad-50); color: var(--bad); }
.tag { display: inline-flex; align-items: center; gap: .25rem; padding: .05rem .5rem; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: .78rem; color: var(--ink-2); }
.tag--ok { background: var(--ok-50); border-color: transparent; color: var(--ok); }
.tag--warn { background: var(--warn-50); border-color: transparent; color: var(--warn); }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .3rem .15rem .6rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: .8rem; }
.chip__x { border: 0; background: none; cursor: pointer; color: var(--ink-3); display: inline-grid; place-items: center; padding: 2px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------------------------------------------------------------- Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .6rem 1.05rem; border-radius: var(--r); border: 1px solid transparent; background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; white-space: nowrap; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--petrol); color: #fff; }
.btn--primary:hover { background: var(--petrol-700); color: #fff; }
.btn--ok { background: var(--ok); color: #fff; }
.btn--ok:hover { background: #276641; color: #fff; }
.btn--danger { background: var(--bad); color: #fff; }
.btn--danger:hover { background: #8a2e30; color: #fff; }
.btn--ghost { border-color: var(--line); background: var(--surface); }
.btn--ghost:hover { border-color: var(--sea); color: var(--petrol); }
.btn--danger-ghost { border-color: transparent; background: transparent; color: var(--bad); }
.btn--danger-ghost:hover { background: var(--bad-50); color: var(--bad); }
.btn--link { background: none; border: 0; color: var(--petrol); padding-inline: .4rem; text-decoration: underline; }
.btn--sm { padding: .38rem .7rem; font-size: .85rem; }
.btn--block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.actions form { display: inline; }

/* ---------------------------------------------------------------- Formulaires */
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field > label, .field > span { font-weight: 600; font-size: .9rem; }
.field__hint { font-size: .8rem; color: var(--ink-2); }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="date"], input[type="time"],
input[type="number"], input:not([type]), select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: var(--r); background: #fff; min-height: 42px;
}
input:focus, select:focus, textarea:focus { border-color: var(--sea); box-shadow: var(--focus); outline: none; }
input:disabled { background: var(--surface-2); color: var(--ink-2); }
textarea { resize: vertical; }
input[dir="ltr"] { text-align: start; }
html[dir="rtl"] input[dir="ltr"] { text-align: right; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; }
.span-2 { grid-column: 1 / -1; }
.fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; margin: 0; display: grid; gap: .9rem; }
.fieldset legend { font-weight: 700; padding-inline: .4rem; }
.check { display: flex; align-items: flex-start; gap: .55rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-block-start: .2rem; accent-color: var(--petrol); }
.field--inline { flex-direction: row; align-items: center; gap: .5rem; }
.field--inline > span { white-space: nowrap; font-size: .85rem; }
.field--inline select, .field--inline input { min-height: 38px; padding-block: .4rem; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-block-start: 1rem; }
.inline-form .field { flex: 1 1 200px; }
.pwd { position: relative; }
.pwd input { padding-inline-end: 2.8rem; }
.pwd__toggle { position: absolute; inset-inline-end: .35rem; inset-block-start: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: .35rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: .75rem 1rem; }
.toolbar__who { font-weight: 700; flex: 1; }
.toolbar input, .toolbar select { width: auto; min-height: 38px; padding-block: .4rem; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem; align-items: end; }
.filters__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; }

.segmented { border: 0; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.segmented legend { font-weight: 600; margin-block-end: .4rem; font-size: .9rem; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented label span, .segmented__btn { display: inline-block; padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); text-decoration: none; color: var(--ink); font-size: .9rem; }
.segmented input:checked + span, .segmented__btn.is-active { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.segmented input:focus-visible + span { box-shadow: var(--focus); }
.segmented--sm { margin: 0; }

/* ---------------------------------------------------------------- Tableaux et listes */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: start; font-size: .8rem; font-weight: 600; color: var(--ink-2); padding: .6rem .7rem; border-block-end: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: .65rem .7rem; border-block-end: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-block-end: 0; }
.table tr.is-off td { opacity: .55; }
.table--dense td { padding: .4rem .6rem; }
.list-lines { list-style: none; padding: 0; margin: 0; }
.list-lines > li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-block-end: 1px solid var(--line); }
.list-lines > li:last-child { border-block-end: 0; }
.list-lines a { text-decoration: none; color: inherit; display: grid; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-block-start: 1rem; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0 0 1rem; }
.dl dt { color: var(--ink-2); font-size: .88rem; }
.dl dd { margin: 0; }
.dl--compact { margin-block-start: .8rem; align-items: center; }
.tabs { display: flex; flex-wrap: wrap; gap: .3rem; border-block-end: 1px solid var(--line); }
.tabs__tab { padding: .55rem .9rem; text-decoration: none; color: var(--ink-2); border-block-end: 2px solid transparent; margin-block-end: -1px; }
.tabs__tab.is-active { color: var(--petrol); border-color: var(--petrol); font-weight: 600; }
.shortcuts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .5rem; }
.shortcuts a { display: flex; align-items: center; gap: .55rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.shortcuts a:hover { border-color: var(--sea); color: var(--petrol); }

.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { padding: .7rem 0 .7rem .1rem; border-block-end: 1px solid var(--line); display: grid; gap: .15rem; }
.notif:last-child { border-block-end: 0; }
.notif--new { padding-inline-start: .8rem; border-inline-start: 3px solid var(--sea); }

.identity { padding: .7rem 0; border-block-end: 1px solid var(--line); display: grid; gap: .2rem; justify-items: start; }
.identity__name { font-weight: 700; font-size: 1.05rem; }
.quote { margin-block-start: .4rem; padding: .5rem .75rem; background: var(--sand-50); border-inline-start: 3px solid var(--sand); border-radius: var(--r-sm); font-size: .9rem; }

/* Pastilles de date */
.datebox { display: inline-grid; place-items: center; width: 52px; flex: none; border-radius: var(--r); background: var(--sea-50); color: var(--petrol); line-height: 1.1; padding: .35rem 0; }
.datebox__d { font-size: 1.3rem; font-weight: 700; }
.datebox__m { font-size: .75rem; }
.datebox--lg { width: 64px; padding: .5rem 0; }
.datebox--lg .datebox__d { font-size: 1.6rem; }
.rdv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.rdv-list__item { display: flex; align-items: center; gap: .8rem; }
.rdv-list__body { flex: 1; display: grid; min-width: 0; }
.rdv-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.rdv-card { display: flex; gap: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--r-lg); align-items: flex-start; }
.rdv-card__body { flex: 1; display: grid; gap: .2rem; min-width: 0; }
.rdv-card__who { font-weight: 700; }
.rdv-card__side { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.cr-public summary { cursor: pointer; color: var(--petrol); font-size: .85rem; margin-block-start: .3rem; }
.cr-public p { margin-block-start: .4rem; }

/* ---------------------------------------------------------------- Assistant de réservation */
.wizard { display: grid; gap: 1.25rem; max-width: 980px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: .9rem; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); font-weight: 700; flex: none; }
.steps li.is-current { border-color: var(--petrol); color: var(--ink); font-weight: 600; }
.steps li.is-current::before { background: var(--petrol); color: #fff; }
.steps li.is-done::before { background: var(--ok); color: #fff; content: "✓"; }
.resp-group { border: 0; padding: 0; margin: 0 0 1.25rem; }
.resp-group legend { font-weight: 700; color: var(--ink-2); font-size: .85rem; margin-block-end: .5rem; }
.resp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; }
.resp-card { display: grid; gap: .2rem; text-align: start; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; transition: border-color .15s, transform .15s; }
.resp-card:hover { border-color: var(--sea); transform: translateY(-1px); }
.resp-card strong { color: var(--petrol-700); }
.resp-card span { font-size: .9rem; }
.resp-card small { color: var(--ink-2); }
.recap { display: grid; gap: .4rem; margin-block-end: 1rem; padding: .9rem 1rem; background: var(--sand-50); border-radius: var(--r); }
.recap-line { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.panel > .recap-line { margin-block-end: 1rem; padding: .7rem .9rem; background: var(--sand-50); border-radius: var(--r); }

/* Bande de jours puis tuiles horaires : l'élément signature de l'ENT */
.day-strip { display: flex; gap: .6rem; overflow-x: auto; padding-block-end: .5rem; scroll-snap-type: x mandatory; }
.day-btn { scroll-snap-align: start; flex: none; display: grid; justify-items: center; gap: .05rem; width: 82px; padding: .7rem .4rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; }
.day-btn:hover { border-color: var(--sea); }
.day-btn__dow { font-size: .8rem; color: var(--ink-2); }
.day-btn__num { font-size: 1.5rem; font-weight: 700; line-height: 1.15; }
.day-btn__mois { font-size: .8rem; }
.day-btn small { font-size: .72rem; color: var(--ok); margin-block-start: .2rem; }
.day-btn[aria-pressed="true"] { background: var(--motif) repeat, var(--petrol); border-color: var(--petrol); color: #fff; }
.day-btn[aria-pressed="true"] .day-btn__dow, .day-btn[aria-pressed="true"] small { color: #d4e9eb; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: .5rem; margin-block-start: .6rem; border: 0; padding: 0; }
.slot { display: block; position: relative; }
button.slot, .slot span { display: block; width: 100%; padding: .65rem 0; text-align: center; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; direction: ltr; }
button.slot:hover, .slot span:hover { border-color: var(--petrol); background: var(--sea-50); }
.slot input { position: absolute; opacity: 0; }
.slot input:checked + span { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.slot input:focus-visible + span { box-shadow: var(--focus); }
.result { text-align: center; display: grid; justify-items: center; gap: .8rem; }
.result__icon { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--sea-50); color: var(--petrol); }
.result__icon--ok { background: var(--ok-50); color: var(--ok); }
.ref { font-size: 1.4rem; font-weight: 700; letter-spacing: .04em; direction: ltr; padding: .4rem 1rem; border: 1px dashed var(--sea); border-radius: var(--r); }

/* ---------------------------------------------------------------- Traitement (responsable) */
.day-tabs { display: flex; gap: .5rem; overflow-x: auto; padding-block-end: .3rem; }
.day-tab { flex: none; display: grid; justify-items: center; gap: .1rem; min-width: 92px; padding: .55rem .6rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-decoration: none; color: var(--ink); }
.day-tab__d { font-size: .8rem; color: var(--ink-2); }
.day-tab__n { font-size: 1.25rem; font-weight: 700; }
.day-tab__w { font-size: .7rem; color: var(--warn); }
.day-tab.is-active { border-color: var(--petrol); box-shadow: inset 0 -3px 0 var(--petrol); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: .9rem; padding: .85rem 0; border-block-end: 1px solid var(--line); align-items: start; }
.timeline__item:last-child { border-block-end: 0; }
.timeline__time { font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; text-align: center; padding: .3rem 0; border-radius: var(--r-sm); background: var(--surface-2); }
.timeline__item--confirme .timeline__time { background: var(--ok-50); color: var(--ok); }
.timeline__item--en_attente .timeline__time { background: var(--warn-50); color: var(--warn); }
.timeline__item--honore .timeline__time { background: var(--sea-50); color: var(--petrol); }
.timeline__item--absent .timeline__time { background: var(--violet-50); color: var(--violet); }
.timeline__item--refuse, .timeline__item--annule_demandeur, .timeline__item--annule_responsable, .timeline__item--expire { opacity: .6; }
.timeline__who { font-weight: 600; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.timeline__side { display: grid; justify-items: end; gap: .45rem; }
.queue { list-style: none; margin: 0; padding: 0; }
.queue__item { padding: .75rem 0; border-block-end: 1px solid var(--line); display: grid; gap: .45rem; }
.queue__item:last-child { border-block-end: 0; }
.queue__link { display: grid; text-decoration: none; color: inherit; }
.danger-zone { margin-block-start: 1.25rem; border-block-start: 1px dashed var(--line); padding-block-start: 1rem; }
.danger-zone summary { cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; color: var(--ink-2); }
.danger-zone form { margin-block-start: .8rem; align-items: end; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.history li { display: grid; gap: .2rem; padding-inline-start: 1rem; border-inline-start: 2px solid var(--line); }
.history__date { font-size: .78rem; color: var(--ink-2); }
.time-pill { display: inline-block; min-width: 58px; text-align: center; padding: .3rem .5rem; border-radius: var(--r-sm); background: var(--sea-50); color: var(--petrol); font-weight: 700; direction: ltr; }

/* ---------------------------------------------------------------- Statistiques */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.bars__row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 3rem; gap: .7rem; align-items: center; font-size: .9rem; }
.bars__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars__track { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.bars__fill { display: block; height: 100%; width: var(--w, 0%); border-radius: 5px; background: linear-gradient(90deg, var(--petrol), var(--sea)); transition: width .5s ease; }
html[dir="rtl"] .bars__fill { background: linear-gradient(270deg, var(--petrol), var(--sea)); }
.bars__val { text-align: end; font-variant-numeric: tabular-nums; font-weight: 600; }
.chart-wrap { overflow-x: auto; }
.chart { width: 100%; min-width: 520px; height: auto; direction: ltr; }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__total { fill: var(--sea-50); }
.chart__honore { fill: var(--petrol); }
.chart__absent { fill: var(--violet); }
.chart__label { font-size: 11px; fill: var(--ink-2); font-family: var(--font); }
.chart__val { font-size: 11px; fill: var(--ink); font-weight: 600; font-family: var(--font); }
.legend { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; }
.legend li { display: inline-flex; align-items: center; gap: .4rem; }
.legend__sw { width: 12px; height: 12px; border-radius: 3px; }
.legend__sw--total { background: var(--sea-50); border: 1px solid var(--line); }
.legend__sw--honore { background: var(--petrol); }
.legend__sw--absent { background: var(--violet); }

/* ---------------------------------------------------------------- Administration */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.checks__item { display: grid; grid-template-columns: 18px 1fr; column-gap: .55rem; align-items: center; }
.checks__item small { grid-column: 2; }
.checks__item--ok .icon { color: var(--ok); }
.checks__item--ko .icon { color: var(--warn); }
.tree { list-style: none; margin: 0; padding: 0; }
.tree__item { display: flex; align-items: baseline; gap: .6rem; padding: .4rem 0; border-block-end: 1px solid var(--line); flex-wrap: wrap; }
.tree__item--n1 { padding-inline-start: 1.25rem; }
.tree__item--n2 { padding-inline-start: 2.5rem; }
.tree__item--n3 { padding-inline-start: 3.75rem; }
.tree__item--n4 { padding-inline-start: 5rem; }
.tree__item.is-off { opacity: .5; }
.tree__type { font-size: .72rem; color: var(--ink-2); background: var(--surface-2); padding: .05rem .45rem; border-radius: var(--r-sm); }
.resp-admin { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.resp-admin__item { border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1rem; display: grid; gap: .6rem; }
.resp-admin__head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.resp-admin__deleg { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.inline-details summary { cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; color: var(--petrol); }
.inline-details .inline-form { margin-block-start: .5rem; }
.inline-details input[type="email"] { width: auto; flex: 1 1 200px; }

/* ---------------------------------------------------------------- Pages d'accueil (connexion, création de compte) */
.guest { margin: 0; min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 42%) 1fr; }
.guest__panel { background: var(--motif) repeat, linear-gradient(160deg, var(--petrol-700), var(--petrol-900)); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; }
.guest__brand img { background: #fff; border-radius: 14px; padding: 6px; }
.guest__univ { margin-block-start: 1.5rem; font-size: .95rem; opacity: .8; }
.guest__app { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 700; line-height: 1.2; max-width: 14ch; }
.guest__tagline { font-size: 1.05rem; opacity: .85; max-width: 34ch; }
.guest__main { display: flex; flex-direction: column; align-items: center; padding: 1.5rem; }
.guest__top { align-self: stretch; display: flex; justify-content: flex-end; }
.guest__card { width: 100%; max-width: 470px; margin-block: auto; display: grid; gap: 1.1rem; padding-block: 2rem; }
.guest__title { font-size: 1.6rem; font-weight: 700; }
.guest__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-size: .9rem; }
.guest__cta { margin-block-start: .5rem; padding-block-start: 1.25rem; border-block-start: 1px solid var(--line); display: grid; gap: .6rem; }

/* ---------------------------------------------------------------- Impression : liste du jour */
.print-page { background: #fff; padding: 1.5rem; }
.print-bar { max-width: 1000px; margin: 0 auto 1.5rem; }
.sheet { max-width: 1000px; margin: 0 auto 2rem; }
.sheet__head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; border-block-end: 3px solid var(--petrol); padding-block-end: .8rem; margin-block-end: 1rem; }
.sheet__univ { font-size: .85rem; color: var(--ink-2); }
.sheet__title { font-size: 1.4rem; }
.sheet__who { font-weight: 700; color: var(--petrol); }
.sheet__date { text-align: end; font-weight: 600; }
.table--sheet td { padding-block: .7rem; }
.table--sheet .sign { min-width: 110px; border-inline-start: 1px solid var(--line); }
.sheet__foot { margin-block-start: .8rem; }

@media print {
  @page { size: A4; margin: 14mm; }
  .no-print, .print-bar { display: none !important; }
  .print-page { padding: 0; }
  .sheet { page-break-after: always; margin: 0; }
  .sheet:last-of-type { page-break-after: auto; }
  .table th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1080px) {
  .grid--main { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-105%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  html[dir="rtl"] .sidebar { transform: translateX(105%); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(7,51,58,.45); z-index: 35; }
  .main { margin-inline-start: 0; }
  .topbar__menu { display: inline-grid; }
  .usermenu__name { display: none; }
  .content { padding: 1rem; }
}
@media (max-width: 760px) {
  .guest { grid-template-columns: 1fr; }
  .guest__panel { padding: 1.5rem; flex-direction: row; align-items: center; }
  .guest__tagline, .guest__univ { display: none; }
  .guest__app { font-size: 1.3rem; }
  .guest__brand { display: flex; align-items: center; gap: .8rem; }
  .steps li span { display: none; }
  .steps li { justify-content: center; }
  .timeline__item { grid-template-columns: 58px 1fr; }
  .timeline__side { grid-column: 1 / -1; justify-items: start; }
  .rdv-card { flex-wrap: wrap; }
  .rdv-card__side { flex-direction: row; flex-wrap: wrap; align-items: center; width: 100%; }
  .bars__row { grid-template-columns: 1fr 2.5rem; }
  .bars__track { grid-column: 1 / -1; grid-row: 2; }
  .topbar { padding-inline: 1rem; }
  .dl { grid-template-columns: 1fr; gap: .1rem; }
  .dl dd { margin-block-end: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* =====================================================================
   Calendrier, congés académiques, doléances, documents officiels
   ===================================================================== */
.mt { margin-block-start: 1rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.mono { font-family: "Consolas", "DejaVu Sans Mono", monospace; letter-spacing: .03em; }
.list-dash { margin: .4rem 0 0; padding-inline-start: 1.1rem; display: grid; gap: .25rem; }
.panel--accent { border-color: var(--petrol); box-shadow: inset 0 3px 0 var(--petrol); }
.compteur { text-align: end; }
.guest__public { font-size: .9rem; }

/* Calendrier des opérations */
.cal__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.cal__item { display: grid; grid-template-columns: 14px 1fr auto; gap: .8rem; align-items: start; padding: .7rem .2rem; border-block-end: 1px dashed var(--line); }
.cal__item:last-child { border-block-end: 0; }
.cal__dot { width: 14px; height: 14px; border-radius: 50%; margin-block-start: .3rem; background: var(--grey-50); border: 2px solid var(--grey); }
.cal__item--ouverte .cal__dot { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 4px var(--ok-50); }
.cal__item--a_venir .cal__dot { background: #fff; border-color: var(--info); }
.cal__item--close { opacity: .62; }
.cal__item--close .cal__label { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.cal__label { font-weight: 600; }
.cal__etat { font-size: .78rem; font-weight: 600; padding: .15rem .55rem; border-radius: 99px; white-space: nowrap; background: var(--grey-50); color: var(--grey); }
.cal__item--ouverte .cal__etat { background: var(--ok-50); color: var(--ok); }
.cal__item--a_venir .cal__etat { background: var(--info-50); color: var(--info); }
.cal__bar { height: 6px; border-radius: 3px; background: var(--surface-2); margin-block-start: .45rem; overflow: hidden; }
.cal__bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--warn)); transition: width .6s ease; }
html[dir="rtl"] .cal__bar span { background: linear-gradient(270deg, var(--ok), var(--warn)); }

/* Suivi d'une demande de congé */
.track { list-style: none; margin: .8rem 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); position: relative; }
.track::before { content: ""; position: absolute; inset-inline: 16%; inset-block-start: 13px; height: 2px; background: var(--line); }
.track__step { position: relative; display: grid; justify-items: center; gap: .3rem; text-align: center; font-size: .85rem; color: var(--ink-2); }
.track__dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); z-index: 1; }
.track__step.is-done { color: var(--ink); }
.track__step.is-done .track__dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.track__step.is-ko .track__dot { background: var(--bad); border-color: var(--bad); }
.track--off { opacity: .5; }
.cg-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem; margin-block-end: .9rem; display: grid; gap: .5rem; }
.cg-card__head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; }
.badge--cg-soumise { background: var(--warn-50); color: var(--warn); }
.badge--cg-avis_emis { background: var(--info-50); color: var(--info); }
.badge--cg-accordee, .badge--avis-favorable, .badge--dec-accorde { background: var(--ok-50); color: var(--ok); }
.badge--cg-refusee, .badge--avis-defavorable, .badge--dec-refuse { background: var(--bad-50); color: var(--bad); }
.badge--dol-nouvelle { background: var(--warn-50); color: var(--warn); }
.badge--dol-en_cours { background: var(--info-50); color: var(--info); }
.badge--dol-repondue { background: var(--ok-50); color: var(--ok); }
.badge--dol-classee { background: var(--grey-50); color: var(--grey); }

/* Doléances */
.charte { background: var(--sand-50); border: 1px solid var(--sand); border-radius: var(--r); padding: .8rem 1rem; }
.charte summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: .4rem; }
.charte__list { margin: .7rem 0; padding-inline-start: 1.3rem; display: grid; gap: .35rem; font-size: .92rem; }
.reponse { margin-block-start: 1rem; padding: .9rem 1rem; border-inline-start: 4px solid var(--petrol); background: var(--sea-50); border-radius: var(--r-sm); }
.reponse__qui { font-weight: 600; color: var(--petrol-700); display: flex; align-items: center; gap: .4rem; margin-block-end: .4rem; }
.dol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.dol-card { display: grid; gap: .5rem; align-content: start; padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); text-decoration: none; color: var(--ink); }
.dol-card:hover { border-color: var(--sea); box-shadow: var(--shadow); }
.dol-card .tag { justify-self: start; }
.dol-card__t { font-size: 1.05rem; }
.dol-card__x { color: var(--ink-2); font-size: .92rem; }
.dol-public { max-width: 820px; display: grid; gap: .8rem; }
.dol-public .tag { justify-self: start; }
.dol-public__t { font-size: 1.5rem; }

/* Gabarit public (doléances publiées, vérification) */
.public { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
.public__bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1.5rem; color: #fff;
  background: var(--motif) repeat, linear-gradient(90deg, var(--petrol-700), var(--petrol-900)); }
.public__brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; }
.public__brand img { background: #fff; border-radius: 8px; padding: 3px; }
.public__brand span { display: grid; line-height: 1.2; }
.public__brand small { opacity: .75; }
.public__bar .lang-switch { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.public__main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.5rem; display: grid; gap: 1.2rem; align-content: start; }
.public__foot { padding: 1rem 1.5rem; text-align: center; font-size: .85rem; color: var(--ink-2); border-block-start: 1px solid var(--line); }
.public-hero { display: grid; gap: .7rem; padding: 1.5rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.public-hero h1 { font-size: 1.6rem; }
.public-search { display: flex; flex-wrap: wrap; gap: .6rem; }
.public-search input { flex: 2 1 260px; }
.public-search select { flex: 1 1 200px; width: auto; }

/* Documents officiels imprimables (récépissé, décision, état de sortie) */
.doc { background: #fff; padding: 2rem 2.4rem; border: 1px solid var(--line); line-height: 1.75; }
.doc--wide { max-width: 1100px; }
.doc__head { text-align: center; font-weight: 600; font-size: .95rem; line-height: 1.5; }
.doc__univ { font-size: 1.05rem; font-weight: 700; margin-block-start: .3rem; }
.doc__title { text-align: center; font-size: 1.35rem; margin-block: 1.4rem 1rem; text-decoration: underline; text-underline-offset: 6px; }
.doc__sub { text-align: center; margin-block-end: 1rem; }
.doc__num { margin-block-start: 1.2rem; font-weight: 600; }
.doc__dl { grid-template-columns: max-content 1fr; }
.doc__note { margin-block-start: 1rem; padding: .7rem 1rem; border: 1px dashed var(--line); border-radius: var(--r-sm); font-size: .9rem; }
.doc__visas p { margin-block: .25rem; }
.doc__decide { text-align: center; font-weight: 700; font-size: 1.1rem; margin-block: 1rem; letter-spacing: .1em; }
.doc--official p { margin-block: .45rem; }
.doc__sign { margin-block-start: 2.2rem; margin-inline-start: auto; width: max-content; max-width: 100%; text-align: center; }
.doc__signatures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-block: 2rem 4rem; text-align: center; font-weight: 600; }
.doc__verif { margin-block-start: 2rem; padding-block-start: .7rem; border-block-start: 1px solid var(--line); font-size: .8rem; text-align: center; }
@media print {
  .doc { border: 0; padding: 0; }
  .doc__signatures { page-break-inside: avoid; }
}
.form-grid > .full { grid-column: 1 / -1; margin-top: -.4rem; }

/* ---------- communauté, états, demandes ---------- */
.details { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.details summary { cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--petrol); }
.details[open] summary { margin-bottom: .6rem; }
.badge--etat-actif, .badge--etat-activite { background: var(--ok-50); color: var(--ok); }
.badge--etat-conge_academique, .badge--etat-detachement, .badge--etat-disponibilite, .badge--etat-conge_longue_duree { background: var(--info-50); color: var(--info); }
.badge--etat-diplome { background: var(--sea-50); color: var(--petrol); }
.badge--etat-abandon, .badge--etat-exclu, .badge--etat-transfere, .badge--etat-non_inscrit, .badge--etat-sans_situation,
.badge--etat-mutation, .badge--etat-retraite, .badge--etat-demission, .badge--etat-fin_contrat, .badge--etat-deces { background: var(--line); color: var(--ink-2); }
.badge--dm-deposee { background: var(--warn-50); color: var(--warn); }
.badge--dm-prise_en_charge { background: var(--info-50); color: var(--info); }
.badge--dm-a_completer { background: var(--violet-50); color: var(--violet); }
.badge--dm-traitee { background: var(--ok-50); color: var(--ok); }
.badge--dm-rejetee { background: var(--bad-50); color: var(--bad); }
.badge--dm-annulee { background: var(--line); color: var(--ink-2); }
.timeline-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.timeline-mini li { display: grid; grid-template-columns: 7.5rem 1fr; gap: .6rem; font-size: .9rem; }
.timeline-mini time { color: var(--ink-2); font-size: .82rem; }
.kv { display: grid; grid-template-columns: minmax(8rem, 30%) 1fr; gap: .35rem .8rem; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Module Demandes */
.dm-type { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.dm-type:last-child { border-bottom: 0; }
.mt-1 { margin-top: 1rem; }
.req { color: var(--bad); }
.dm-compteurs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }

/* ===== Documents officiels (décision et récépissé de congé) : format A4 de l'université ===== */
.doc-officiel { background: #fff; color: #000; width: 100%; max-width: 210mm; margin: 0 auto 2rem; padding: 14mm 16mm;
  border: 1px solid var(--line); font-family: "Traditional Arabic", "Simplified Arabic", "Amiri", "Times New Roman", "Cairo", serif;
  font-size: 15px; line-height: 1.7; }
.doc-officiel[lang="fr"], .doc-officiel[dir="ltr"] { font-family: "Times New Roman", "Cairo", serif; }
.doc-officiel p { margin: .25em 0; }
.doc-officiel h1, .doc-officiel h2, .doc-officiel h3 { font-family: inherit; color: #000; margin: .8em 0 .5em; }
.doc-officiel h2 { font-size: 1.5em; }
.doc-officiel h3 { font-size: 1.3em; letter-spacing: .05em; }
.doc-officiel hr { border: 0; border-top: 1px solid #000; margin: .6em 0; }
.doc-grille { width: 100%; border-collapse: collapse; margin: .3em 0; }
.doc-grille td, .doc-grille th { padding: .15em .4em; vertical-align: top; text-align: start; font-weight: inherit; }
.doc-grille.entete td { vertical-align: middle; }
.doc-grille.champs td { padding-block: .3em; }
.doc-grille.bordure td, .doc-grille.bordure th { border: 1px solid #000; }
.doc-grille.pied { color: #333; }
.doc-logo { width: 110px; height: auto; display: inline-block; }
.doc-officiel .al-l { text-align: left; } .doc-officiel .al-c { text-align: center; }
.doc-officiel .al-r { text-align: right; } .doc-officiel .al-j { text-align: justify; }
.doc-officiel .fs-1 { font-size: .65em; } .doc-officiel .fs-2 { font-size: .8em; } .doc-officiel .fs-3 { font-size: 1em; }
.doc-officiel .fs-4 { font-size: 1.15em; } .doc-officiel .fs-5 { font-size: 1.35em; } .doc-officiel .fs-6 { font-size: 1.65em; }
.doc-officiel .fs-7 { font-size: 2.1em; }
.doc-officiel .souligne { text-decoration: underline; text-underline-offset: 4px; }
.doc-officiel .gras { font-weight: 700; }
.doc-officiel .retrait { padding-inline-start: 3.5em; }
.doc-officiel .espace { min-height: 2.2em; }
.doc-officiel .nowrap { white-space: nowrap; }
.doc-grille .w-20 { width: 20%; } .doc-grille .w-25 { width: 25%; } .doc-grille .w-30 { width: 30%; }
.doc-grille .w-40 { width: 40%; } .doc-grille .w-50 { width: 50%; } .doc-grille .w-60 { width: 60%; }
.doc-officiel__verif { margin-top: 1.2em; font-family: var(--font, system-ui); font-size: 10px; color: #555; text-align: center; }
/* Récépissé */
.recu__titre { text-align: center; font-size: 1.9em; font-weight: 700; line-height: 1.5; margin: .8em 0 .1em; }
.recu__soustitre { text-align: center; font-weight: 700; margin-bottom: 1.2em; }
.recu__lignes th { font-weight: 600; white-space: nowrap; font-family: var(--font, system-ui); font-size: .9em; }
.recu__val { border-bottom: 1px dotted #777; }
.recu__sep { color: #777; }
.recu__note { margin-top: 1.2em; text-align: justify; }
.recu__pied { margin-top: 1.5em; padding-top: .6em; border-top: 1px solid #000; text-align: center; }
/* Éditeur du modèle */
.editeur-barre { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; padding: .5rem; margin-block: .8rem .5rem;
  background: var(--sand-50, #f7f3ea); border: 1px solid var(--line); border-radius: var(--r-sm); position: sticky; top: 0; z-index: 2; }
.editeur-barre select { width: auto; min-width: 8rem; padding-block: .3rem; }
.editeur-sep { width: 1px; align-self: stretch; background: var(--line); margin-inline: .2rem; }
.editeur-page { overflow-x: auto; background: var(--line); padding: 1rem; border-radius: var(--r-sm); }
.editeur { min-height: 297mm; outline: none; box-shadow: 0 2px 10px rgba(0,0,0,.12); margin-bottom: 0; }
.editeur:focus { box-shadow: 0 0 0 3px var(--petrol, #0e5a64); }
[data-editable-cible][contenteditable="true"] { outline: 2px dashed var(--warn, #b7791f); outline-offset: 4px; }
@media print {
  @page { size: A4; margin: 12mm; }
  .doc-officiel { border: 0; padding: 0; max-width: none; margin: 0; font-size: 14px; }
  [data-editable-cible][contenteditable="true"] { outline: 0; }
}
.print-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
/* Code QR de vérification (SVG généré par le serveur) */
.qr { display: block; margin: .2em auto; }
.verif-bloc { margin-top: .8em; }
.verif-bloc__qr { width: 100px; }
.verif-bloc .doc-officiel__verif { text-align: start; margin-top: .2em; }
/* Charte à signer */
.charte { border: 1px solid var(--line); border-radius: var(--r-sm); padding: .8rem 1rem; display: grid; gap: .7rem; }
.charte legend { font-weight: 700; padding-inline: .3rem; }
.charte__texte { max-height: 22rem; overflow-y: auto; margin: 0; padding: 1rem 1.2rem; font-size: 14px; }
.signature-bloc { margin-top: 1.2em; font-size: .9em; }
.signature-bloc th { text-align: center; font-weight: 700; }
/* Mises en forme des documents officiels (charte informatique) */
.doc-officiel .rouge { color: #c00000; }
.doc-officiel .bleu { color: #2e5597; }
.doc-officiel .encadre { border: 1px solid #000; padding: .5em 1em; margin: 1em 2em; box-shadow: 3px 3px 0 #999; }
.doc-officiel .titre-doc { font-size: 1.9em; text-align: center; margin: 1em 0 .6em; letter-spacing: .03em; }
.doc-officiel h3 { font-size: 1.1em; margin: .9em 0 .3em; }
.doc-officiel ul.fleches { list-style: none; padding-inline-start: 1.6em; margin: .2em 0; }
.doc-officiel ul.fleches > li::before { content: "➢"; display: inline-block; width: 1.4em; margin-inline-start: -1.4em; }
.doc-officiel ul.fleches ul { list-style: circle; padding-inline-start: 2em; }
.doc-officiel ul.fleches > li::before { content: "►"; font-size: .8em; }
[dir="rtl"] .doc-officiel ul.fleches > li::before, .doc-officiel[dir="rtl"] ul.fleches > li::before { content: "◄"; }
.editeur-barre .c-rouge { color: #c00000; font-weight: 700; } .editeur-barre .c-bleu { color: #2e5597; font-weight: 700; }
.doc-officiel .saut-page { margin-top: 2em; padding-top: 1em; border-top: 1px solid #000; }
@media print { .doc-officiel .saut-page { page-break-before: always; border-top: 0; margin-top: 0; } }

/* =====================================================================
   Version 2 : navigation multi-modules, tableau de bord à onglets,
   catalogue des services, avis et suggestions, publication des doléances
   ===================================================================== */
.nav__filtre { padding: .35rem .25rem .25rem; }
.nav__filtre input { width: 100%; padding: .45rem .7rem; border-radius: var(--r); border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; }
.nav__filtre input::placeholder { color: rgba(231,241,242,.65); }
.nav__filtre input:focus { background: rgba(255,255,255,.14); }
.nav__zone { margin-block-start: .9rem; display: flex; flex-direction: column; gap: .1rem; }
.nav__title { text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
html[lang="ar"] .nav__title { text-transform: none; letter-spacing: 0; font-size: .82rem; }
.nav__group { border-radius: var(--r); }
.nav__group[open] { background: rgba(255,255,255,.04); }
.nav__summary { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: var(--r); color: #dbe9eb; cursor: pointer; list-style: none; user-select: none; }
.nav__summary::-webkit-details-marker { display: none; }
.nav__summary:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav__summary.is-current { color: #fff; font-weight: 600; }
.nav__summary > span:first-of-type { flex: 1; min-width: 0; }
.nav__chevron { display: inline-flex; opacity: .7; transition: transform .15s ease; }
html[dir="rtl"] .nav__chevron { transform: scaleX(-1); }
.nav__group[open] > .nav__summary .nav__chevron { transform: rotate(90deg); }
html[dir="rtl"] .nav__group[open] > .nav__summary .nav__chevron { transform: scaleX(-1) rotate(90deg); }
.nav__items { display: flex; flex-direction: column; gap: .1rem; padding: .1rem 0 .35rem; padding-inline-start: 1.1rem; }
.nav__link--sub { padding-block: .42rem; font-size: .93rem; }
.nav__link--avenir { margin-block-start: 1rem; border: 1px dashed rgba(255,255,255,.28); color: #f3e7c9; }
.nav__link--avenir:hover { border-color: rgba(255,255,255,.5); }

/* Onglets du tableau de bord */
.dash-tabs { display: flex; flex-direction: column; gap: 1.1rem; }
.dash-tabs__bar { display: none; }
.js-onglets .dash-tabs__bar { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: thin; border-block-end: 1px solid var(--line); padding-block-end: 1px; }
.dash-tab { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem .95rem; border: 0; background: none; color: var(--ink-2); cursor: pointer; white-space: nowrap; border-block-end: 3px solid transparent; margin-block-end: -1px; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.dash-tab:hover { color: var(--petrol); background: var(--surface-2); }
.dash-tab.is-active { color: var(--petrol); border-color: var(--petrol); font-weight: 700; }
.dash-tab__n { min-width: 1.4rem; padding: 0 .4rem; border-radius: 99px; background: var(--petrol); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; }
.dash-panel { display: flex; flex-direction: column; gap: 1rem; }
.dash-panel__titre { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; }
.js-onglets .dash-panel__titre { display: none; }
.kpi__val--texte { font-size: 1.05rem; line-height: 1.6; }
.actions-module { flex-wrap: wrap; }

/* Cartes de modules (vue d'ensemble, catalogue) */
.cards-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; }
.card-module { display: flex; flex-direction: column; gap: .8rem; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.card-module__head { display: flex; align-items: center; gap: .6rem; }
.card-module__head h2, .card-module__head h3 { font-size: 1rem; }
.card-module__ic { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 10px; background: var(--sea-50); color: var(--petrol); }
.card-module__chiffres { margin: 0; display: grid; gap: .35rem; }
.card-module__chiffres div { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; border-block-end: 1px dashed var(--line); padding-block-end: .25rem; }
.card-module__chiffres dt { color: var(--ink-2); font-size: .88rem; }
.card-module__chiffres dd { margin: 0; font-weight: 700; font-size: 1.15rem; }
.card-module__chiffres dd.texte { font-size: .9rem; }
.card-module__chiffres .is-accent dd { color: var(--petrol); }
.card-module__pied { margin-block-start: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.card-module__liens { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.card-module__liens a { display: flex; align-items: center; gap: .45rem; text-decoration: none; }
.card-module--avenir { border-style: dashed; background: var(--sand-50); box-shadow: none; }
.card-module--avenir:hover { border-color: var(--sea); color: var(--ink); }
.card-module--avenir .card-module__ic { background: var(--sand); color: var(--petrol-900); }
.services-zone { margin-block-end: 1.4rem; }
.avenir { background: var(--motif) repeat, linear-gradient(135deg, var(--petrol-700), var(--petrol-900)); color: #e7f1f2; }
.avenir .panel__title { color: #fff; }
.avenir a, .avenir .muted { color: #f3e7c9; }

/* Avis et suggestions */
.notes { border: 0; padding: 0; margin: 0; }
.notes legend { font-weight: 600; margin-block-end: .4rem; }
.notes__choix { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.note-choix { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .55rem .3rem; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; text-align: center; background: var(--surface); }
.note-choix input { position: absolute; opacity: 0; pointer-events: none; }
.note-choix span { font-size: 1.2rem; font-weight: 700; color: var(--petrol); }
.note-choix small { font-size: .72rem; color: var(--ink-2); line-height: 1.25; }
.note-choix:has(input:checked) { border-color: var(--petrol); background: var(--sea-50); box-shadow: inset 0 0 0 1px var(--petrol); }
.note-choix:has(input:focus-visible) { box-shadow: var(--focus); }
.reponse--auto { background: var(--sea-50); }
.stack-s { display: grid; gap: .45rem; padding-inline-start: 1.1rem; margin: 0 0 .8rem; }
.badge--av-nouveau { background: var(--warn-50); color: var(--warn); }
.badge--av-lu { background: var(--info-50); color: var(--info); }
.badge--av-repondu { background: var(--ok-50); color: var(--ok); }
.badge--av-classe { background: var(--grey-50); color: var(--grey); }

/* Publication des doléances, structures, filtres */
.badge--pub { background: var(--ok-50); color: var(--ok); }
.badge--nonpub { background: var(--grey-50); color: var(--grey); }
.choix-pub, .choix-emails { border: 1px solid var(--line); border-radius: var(--r); padding: .7rem .9rem; margin: 0; display: grid; gap: .45rem; }
.choix-pub legend, .choix-emails legend { font-weight: 600; padding-inline: .3rem; }
input.filtre { max-width: 14rem; padding: .35rem .6rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.tree__item.is-current > a { font-weight: 700; }
tr.is-off td { opacity: .55; }
.note { background: var(--sand-50); border: 1px solid var(--sand); border-radius: var(--r); padding: .8rem 1rem; margin-block-start: 1rem; }
.note ul { margin: .4rem 0 0; padding-inline-start: 1.1rem; display: grid; gap: .3rem; }

@media (max-width: 640px) {
  .notes__choix { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .note-choix small { display: none; }
  .cards-modules { grid-template-columns: 1fr; }
}
@media print { .dash-tabs__bar { display: none !important; } .dash-panel[hidden] { display: flex !important; } }

/* ---------------------------------------------------------------- Modules : maintenance, gestion (version 2.1) */
.badge--maintenance, .badge--statut-maintenance { background: var(--warn-50); color: var(--warn); }
.badge--statut-actif { background: var(--ok-50); color: var(--ok); }
.badge--statut-inactif { background: var(--grey-50); color: var(--grey); }
.badge--statut-bientot { background: var(--info-50); color: var(--info); }
.nav__maint, .dash-tab__maint { display: inline-flex; color: var(--warn); margin-inline-start: .25rem; }
.nav__summary .nav__maint + .nav__chevron { margin-inline-start: .25rem; }
.card-module--maintenance { border-color: var(--warn); }
.card-module__head .badge { margin-inline-start: auto; }
.maintenance__ic { color: var(--warn); margin: 0; }
.modules-table td { vertical-align: top; }
.modules-table select, .modules-table input[type="number"] { min-width: 8rem; }
.modules-table input[type="number"] { width: 5rem; min-width: 0; }
.modules-msg { display: grid; gap: .4rem; min-width: 16rem; }
.modules-msg textarea { min-height: 2.6rem; }
