/* Polices de la charte CCI, hébergées localement (V1.0.1 : plus d'appel à Google Fonts ; licence SIL OFL, voir static/fonts) */
@font-face { font-family: "Archivo Black"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/archivo-black-400.woff") format("woff"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/roboto-var.woff") format("woff"); }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/roboto-italic-400.woff") format("woff"); }
@font-face { font-family: "Roboto Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/roboto-condensed-700.woff") format("woff"); }
@font-face { font-family: "Roboto Condensed"; font-style: italic; font-weight: 700; font-display: swap; src: url("../fonts/roboto-condensed-italic-700.woff") format("woff"); }

/* =====================================================================
   CCI Connect — charte graphique issue de la présentation officielle CCI
   Bois sombre · brun · beige · bordeaux · or ; couleurs officielles des classes
   ===================================================================== */
:root {
  --wood: #17110C;        /* bois sombre (fonds sombres) */
  --wood-2: #241A12;      /* brun (cartes sombres) */
  --wood-3: #33261A;
  --line-dark: #4A3A2A;
  --ink: #1F1710;         /* texte principal */
  --muted: #6B5A48;       /* texte secondaire */
  --muted-2: #8C7A65;
  --sand: #BFAE96;        /* texte clair sur fond sombre */
  --cream: #F4ECDF;       /* beige de la charte */
  --paper: #FFFAF1;       /* cartes claires */
  --bg: #F7F2EA;          /* fond général */
  --line: #E6DACA;
  --line-2: #EFE6D8;
  --bordeaux: #9E2A1F;    /* accent principal */
  --bordeaux-2: #7F2017;
  --gold: #D4A64A;        /* accent doré */
  --gold-soft: #F3E5C4;
  --ok: #2E7D4F;  --ok-bg: #E3F1E7;
  --warn: #9A6400; --warn-bg: #FBF0D6;
  --bad: #A8261B; --bad-bg: #F8E1DD;
  --info: #1F5E86; --info-bg: #E0EEF6;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(31, 23, 16, .05), 0 6px 18px rgba(31, 23, 16, .06);
  --shadow-lg: 0 18px 50px rgba(23, 17, 12, .22);
  --font-display: "Archivo Black", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-cond: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  --sidebar-w: 264px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font-body); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--bordeaux); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--ink); }
h1 { font: 400 28px/1.15 var(--font-display); letter-spacing: -.01em; }
h2 { font: 400 19px/1.25 var(--font-display); }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 .6em; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.eyebrow {
  font: 700 12px/1.2 var(--font-cond); letter-spacing: .14em; text-transform: uppercase; color: var(--bordeaux);
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon.lg { width: 22px; height: 22px; }
.icon.xl { width: 28px; height: 28px; }

/* ---------- Mise en page applicative ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--wood); color: var(--sand); position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 22px 14px 18px;
  background-image: linear-gradient(180deg, rgba(23,17,12,.82), var(--wood) 260px), url("../img/bibliotheque.jpg");
  background-size: cover, 900px auto; background-position: top, 40% 0; background-repeat: no-repeat;
}
.sidebar .brand { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 0 22px; }
.sidebar .brand img { width: 92px; height: auto; }
.sidebar .brand span { font: 700 11px/1.3 var(--font-cond); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); text-align: center; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #E4D8C6; font-weight: 500; font-size: 14.5px; text-decoration: none;
}
.nav a .icon { color: var(--sand); }
.nav a:hover { background: rgba(244, 236, 223, .07); }
.nav a.active { background: var(--wood-2); color: #fff; box-shadow: inset 0 0 0 1px var(--line-dark); }
.nav a.active .icon { color: var(--gold); }
.sidebar .spacer { flex: 1; min-height: 16px; }
.sidebar .user-box { border-top: 1px solid var(--line-dark); padding-top: 14px; display: flex; gap: 10px; align-items: center; }
.sidebar .user-box .who { min-width: 0; flex: 1; }
.sidebar .user-box .who strong { display: block; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .user-box .who span { font-size: 12px; color: var(--sand); }
.sidebar .logout { background: none; border: 0; color: var(--sand); cursor: pointer; padding: 8px; border-radius: 8px; }
.sidebar .logout:hover { background: rgba(255,255,255,.08); color: #fff; }

.scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; grid-column: 2; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.topbar {
  height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 32px; background: rgba(247, 242, 234, .9);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px);
}
.topbar .crumb { font-size: 14px; color: var(--muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .crumb strong { color: var(--ink); }
.topbar .role-chip { font: 700 11px/1 var(--font-cond); letter-spacing: .1em; text-transform: uppercase; padding: 7px 10px; border-radius: 999px; background: var(--gold-soft); color: #6B4A10; white-space: nowrap; }
.menu-btn { display: none; background: none; border: 0; padding: 8px; margin-left: -8px; color: var(--ink); cursor: pointer; }
.content { padding: 28px 32px 56px; max-width: 1360px; width: 100%; }
.sim-banner {
  background: var(--wood-2); color: var(--cream); font-size: 13px; padding: 8px 32px; display: flex; gap: 10px; align-items: center;
}
.sim-banner strong { color: var(--gold); }
.sim-banner a { color: var(--gold); }

/* ---------- En-têtes de page ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .titles { min-width: 0; }
.page-head h1 { margin-top: 4px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Bannière bibliothèque ---------- */
.hero {
  position: relative; border-radius: 18px; overflow: hidden; color: var(--cream); padding: 30px 32px; margin-bottom: 24px;
  background: linear-gradient(100deg, rgba(23,17,12,.94) 0%, rgba(23,17,12,.78) 55%, rgba(23,17,12,.45) 100%), url("../img/bibliotheque.jpg") center 35% / cover;
  box-shadow: var(--shadow);
}
.hero h1 { color: #fff; font-size: 30px; }
.hero .eyebrow { color: var(--gold); }
.hero p { color: #E8DCCB; margin: 8px 0 0; max-width: 640px; }
.hero .slogan { font: italic 700 15px var(--font-cond); color: var(--gold); margin-top: 14px; letter-spacing: .02em; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: end; }

/* ---------- Cartes & grilles ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.card-head h2 { font-size: 16px; }
.card-head .link { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.card-body { padding: 18px 22px; }
.card-body.flush { padding: 0; }
.card.dark { background: var(--wood-2); border-color: var(--line-dark); color: var(--cream); }
.card.dark h2, .card.dark h3 { color: #fff; }
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 20px; } .mt-s { margin-top: 10px; } .mb { margin-bottom: 20px; } .mb-s { margin-bottom: 10px; }

/* KPI */
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi .label { font: 700 12px/1.2 var(--font-cond); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.kpi .label .icon { width: 16px; height: 16px; color: var(--bordeaux); }
.kpi .value { font: 400 32px/1.1 var(--font-display); color: var(--ink); }
.kpi .hint { font-size: 13px; color: var(--muted); }
.kpi.accent { background: var(--bordeaux); border-color: var(--bordeaux); }
.kpi.accent .label, .kpi.accent .hint, .kpi.accent .label .icon { color: #F6D9D3; }
.kpi.accent .value { color: #fff; }
a.kpi { text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--gold); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 10px 16px;
  font: 600 14px/1.1 var(--font-body); border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: var(--bordeaux); color: #fff; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--bordeaux-2); text-decoration: none; }
.btn .icon { width: 17px; height: 17px; }
.btn.secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--muted-2); background: #fff; }
.btn.ghost { background: transparent; color: var(--bordeaux); padding-left: 10px; padding-right: 10px; }
.btn.ghost:hover { background: rgba(158, 42, 31, .08); }
.btn.dark { background: var(--wood); color: var(--cream); }
.btn.dark:hover { background: var(--wood-3); }
.btn.gold { background: var(--gold); color: var(--wood); }
.btn.gold:hover { background: #C4943A; }
.btn.danger { background: var(--paper); color: var(--bad); border-color: #E7C2BC; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 15px 22px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-wa { background: #25D366; color: #052E1B; }
.btn-wa:hover { background: #1EBE5A; }
.wa-note { font-size: 13px; color: var(--sand); margin-top: 8px; }
.card:not(.dark) .wa-note { color: var(--muted); }
.inline-form { display: inline; }

/* ---------- Badges, pastilles de classe ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 600 12.5px/1.2 var(--font-body);
  white-space: nowrap; background: #EEE6DA; color: var(--muted);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.brand { background: var(--gold-soft); color: #7A5410; }
.badge.plain::before { display: none; }
.class-pill {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 6px; font: 500 13.5px/1.35 var(--font-body);
  white-space: nowrap; letter-spacing: .01em;
}
.class-pill.lg { font-size: 16px; padding: 5px 13px; border-radius: 7px; }
.class-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.class-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.class-line .t { min-width: 0; }
.class-line .t strong { display: block; font-size: 14.5px; }
.class-line .t span { display: block; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font: 700 11.5px/1.2 var(--font-cond); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: #FBF6EE; white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FCF8F2; }
.table td.mono, .table td.nowrap { white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table a.rowlink { color: var(--ink); font-weight: 600; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .t strong { display: block; font-weight: 600; white-space: nowrap; }
.person .t span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  background: var(--cream); color: var(--bordeaux); font: 700 13px/1 var(--font-body); border: 1px solid var(--line);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 76px; height: 76px; font-size: 24px; }
.avatar.dark { background: var(--wood-2); color: var(--gold); border-color: var(--line-dark); }

/* ---------- Formulaires ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label-txt { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.field label .req { color: var(--bordeaux); }
.field .help { font-size: 12.5px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=number],
input[type=url], input[type=time], input[type=search], input:not([type]), select, textarea {
  width: 100%; border: 1px solid #DCCFBC; border-radius: 10px; padding: 10px 12px; font: 15px/1.35 var(--font-body);
  color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 166, 74, .25); }
input[type=file] { font-size: 14px; max-width: 100%; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--bordeaux); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
.form-section { padding: 20px 22px; border-top: 1px solid var(--line-2); }
.form-section:first-child { border-top: 0; }
.form-section h3 { margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }
.form-section h3 .num { width: 26px; height: 26px; border-radius: 50%; background: var(--wood); color: var(--gold); display: inline-grid; place-items: center; font: 700 12px var(--font-body); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--line-2); background: #FBF6EE; border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input, .filters select { width: auto; min-width: 160px; padding: 9px 12px; font-size: 14px; }
.filters input[type=search] { min-width: 240px; }

/* ---------- Onglets segmentés ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a {
  padding: 8px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); background: transparent;
  border: 1px solid var(--line); text-decoration: none; display: inline-flex; gap: 7px; align-items: center;
}
.tabs a .n { background: #EEE6DA; color: var(--muted); border-radius: 999px; padding: 1px 7px; font-size: 12px; }
.tabs a.active { background: var(--wood); color: var(--cream); border-color: var(--wood); }
.tabs a.active .n { background: var(--gold); color: var(--wood); }

/* ---------- Alertes ---------- */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.alert { border-radius: 10px; padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid; }
.alert .icon { margin-top: 1px; }
.alert.success { background: var(--ok-bg); color: #1E5A37; border-color: #BFDDC9; }
.alert.error { background: var(--bad-bg); color: #84201A; border-color: #ECC1BA; }
.alert.info { background: var(--info-bg); color: #1A4E70; border-color: #BCD8EA; }
.alert.warn { background: var(--warn-bg); color: #6E4A06; border-color: #EDD7A4; }

/* ---------- Barres, progression ---------- */
.bar { height: 8px; border-radius: 99px; background: #EDE3D4; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--bordeaux); }
.bar.gold > span { background: var(--gold); }
.bar.ok > span { background: var(--ok); }
.dist { display: flex; flex-direction: column; gap: 12px; }
.dist-row { display: grid; grid-template-columns: 190px 1fr 40px; gap: 12px; align-items: center; }
.dist-row .track { height: 22px; background: #F1E9DC; border-radius: 6px; overflow: hidden; }
.dist-row .fill { height: 100%; border-radius: 6px; min-width: 4px; }
.dist-row .n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(244,236,223,.15) 0); }
.ring.light { background: conic-gradient(var(--bordeaux) calc(var(--p) * 1%), #EDE3D4 0); }
.ring > div { width: 92px; height: 92px; border-radius: 50%; background: var(--wood-2); display: grid; place-items: center; text-align: center; }
.ring.light > div { background: var(--paper); }
.ring strong { font: 400 24px/1 var(--font-display); color: #fff; display: block; }
.ring.light strong { color: var(--ink); }
.ring span { font-size: 11px; color: var(--sand); text-transform: uppercase; letter-spacing: .08em; }
.ring.light span { color: var(--muted); }

/* ---------- Parcours CCI ---------- */
.journey { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; position: relative; }
.journey .step { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; position: relative; padding: 0 4px; }
.journey .step::before { content: ""; position: absolute; top: 21px; left: -50%; width: 100%; height: 3px; background: #E3D7C5; z-index: 0; }
.journey .step:first-child::before { display: none; }
.journey .step.done::before, .journey .step.current::before { background: var(--gold); }
.journey .node {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; position: relative; z-index: 1;
  font: 700 13px/1 var(--font-body); border: 3px solid var(--paper); box-shadow: 0 0 0 2px #E3D7C5; background: #F1E9DC; color: var(--muted);
}
.journey .step.done .node, .journey .step.current .node { box-shadow: 0 0 0 2px var(--gold); }
.journey .step.current .node { transform: scale(1.12); box-shadow: 0 0 0 3px var(--gold), 0 6px 16px rgba(158,42,31,.25); }
.journey .step.todo .node { background: #F1E9DC !important; color: var(--muted-2) !important; }
.journey .step.failed .node { box-shadow: 0 0 0 2px var(--bad); }
.journey .name { font-weight: 700; font-size: 13.5px; line-height: 1.2; }
.journey .sub { font-size: 11.5px; color: var(--muted); line-height: 1.25; text-transform: uppercase; letter-spacing: .02em; }
.journey .state { font-size: 11.5px; font-weight: 700; }
.journey .state.VALIDE { color: var(--ok); } .journey .state.EN_COURS { color: var(--bordeaux); } .journey .state.A_VENIR { color: var(--muted-2); } .journey .state.NON_VALIDE { color: var(--bad); }
.journey.dark .step::before { background: var(--line-dark); }
.journey.dark .step.done::before, .journey.dark .step.current::before { background: var(--gold); }
.journey.dark .node { border-color: var(--wood-2); box-shadow: 0 0 0 2px var(--line-dark); background: var(--wood-3); }
.journey.dark .step.todo .node { background: var(--wood-3) !important; color: var(--sand) !important; }
.journey.dark .name { color: #fff; }
.journey.dark .sub { color: var(--sand); }
.level-tag { font: 700 11px/1 var(--font-cond); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* Timeline verticale (fiche étudiant) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; padding: 10px 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: -10px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; z-index: 1; }
.timeline .dot .icon { width: 15px; height: 15px; stroke-width: 2.6; }

/* ---------- Planning ---------- */
.week-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.week-grid > div { background: var(--paper); padding: 12px; min-height: 64px; }
.week-grid .h { background: #FBF6EE; font: 700 12px/1.2 var(--font-cond); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); min-height: 0; }
.week-grid .slot { font-weight: 700; font-size: 14px; background: #FBF6EE; display: flex; align-items: center; }
.slot-card { border-radius: 10px; padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; text-decoration: none; color: inherit; }
.slot-card:last-child { margin-bottom: 0; }
.slot-card strong { font-size: 13.5px; }
.slot-card span { font-size: 12px; opacity: .85; }
.slot-card:hover { text-decoration: none; filter: brightness(.97); }
.week-block { margin-bottom: 18px; }
.week-block h3 { font: 700 13px/1.2 var(--font-cond); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.meeting-row { display: grid; grid-template-columns: 120px 110px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.meeting-row:last-child { border-bottom: 0; }
.meeting-row.past { opacity: .72; }
.meeting-row.today { background: #FFF6E2; }

/* Liste « prochains cours » */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 14px; padding: 13px 22px; border-bottom: 1px solid var(--line-2); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow strong { display: block; font-size: 14.5px; }
.list .grow span { display: block; font-size: 13px; color: var(--muted); }
.date-chip { width: 54px; flex: none; border-radius: 10px; background: var(--cream); text-align: center; padding: 6px 0; border: 1px solid var(--line); }
.date-chip b { display: block; font: 400 19px/1 var(--font-display); color: var(--ink); }
.date-chip i { display: block; font: 700 10.5px/1.4 var(--font-cond); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--bordeaux); }

/* Prochain cours (étudiant) */
.next-class { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.next-class .when { font: 400 24px/1.2 var(--font-display); color: #fff; }
.next-class .meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--sand); font-size: 14px; margin-top: 8px; }
.next-class .meta span { display: inline-flex; gap: 7px; align-items: center; }
.call-info { font-size: 13px; color: var(--sand); margin-top: 6px; }

/* Présences (saisie) */
.att-choices { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.att-choices label { position: relative; cursor: pointer; }
.att-choices input { position: absolute; opacity: 0; pointer-events: none; }
.att-choices span { display: block; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--muted); border-left: 1px solid var(--line); min-width: 44px; text-align: center; }
.att-choices label:first-child span { border-left: 0; }
.att-choices input:checked + span.PRESENT { background: var(--ok); color: #fff; }
.att-choices input:checked + span.ABSENT { background: var(--bad); color: #fff; }
.att-choices input:checked + span.RETARD { background: #C98A12; color: #fff; }
.att-choices input:checked + span.EXCUSE { background: var(--info); color: #fff; }
.att-choices input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: -2px; }

/* Description de liste (fiche) */
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* États vides */
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .icon { width: 34px; height: 34px; color: var(--sand); margin: 0 auto 10px; display: block; }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

/* Statut candidature (suivi) */
.status-track { display: flex; gap: 0; margin: 6px 0 4px; }
.status-track .s { flex: 1; text-align: center; position: relative; font-size: 12.5px; color: var(--muted); padding-top: 34px; }
.status-track .s::before { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 3px; background: var(--line); }
.status-track .s:first-child::before { display: none; }
.status-track .s::after { content: ""; position: absolute; top: 2px; left: calc(50% - 11px); width: 22px; height: 22px; border-radius: 50%; background: var(--paper); border: 3px solid var(--line); box-sizing: border-box; }
.status-track .s.done { color: var(--ink); font-weight: 600; }
.status-track .s.done::before { background: var(--gold); }
.status-track .s.done::after { background: var(--gold); border-color: var(--gold); }
.status-track .s.current::after { background: var(--bordeaux); border-color: var(--bordeaux); box-shadow: 0 0 0 4px rgba(158,42,31,.18); }
.status-track .s.current { color: var(--bordeaux); font-weight: 700; }

/* Identifiants provisoires */
.secret { font: 600 20px/1.3 ui-monospace, Menlo, monospace; background: var(--wood); color: var(--gold); padding: 12px 16px; border-radius: 10px; letter-spacing: .04em; overflow-wrap: anywhere; }

/* Pied de page */
.foot { text-align: center; font-size: 12.5px; color: var(--muted-2); padding: 24px 0 8px; }

/* ---------- Pages d'authentification ---------- */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr);
  background: var(--wood);
}
.auth-visual {
  position: relative; color: var(--cream); padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(180deg, rgba(23,17,12,.35) 0%, rgba(23,17,12,.55) 55%, rgba(23,17,12,.92) 100%), url("../img/bibliotheque.jpg") 30% center / cover;
}
.auth-visual .logo { width: 150px; }
.auth-visual h1 { font: 400 46px/1.05 var(--font-display); color: #fff; text-transform: uppercase; letter-spacing: -.01em; }
.auth-visual .slogan { font: italic 700 24px/1.3 var(--font-cond); color: var(--gold); margin-top: 16px; }
.auth-visual .church { font: 700 12px var(--font-cond); letter-spacing: .3em; text-transform: uppercase; color: var(--sand); margin-top: 26px; }
.auth-panel { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card h2 { font-size: 24px; margin: 8px 0 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 24px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-card .links { display: flex; justify-content: space-between; font-size: 14px; gap: 10px; flex-wrap: wrap; }
.auth-card .divider { border-top: 1px solid var(--line); margin: 26px 0 18px; }
.auth-card .cta { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px; font-size: 14px; }
.auth-mobile-logo { display: none; }
.pw-field { position: relative; }
.pw-field input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 7px; color: var(--muted); cursor: pointer; border-radius: 6px; }

/* Barre d'action mobile (étudiant) */
.mobile-cta { display: none; }

/* Erreurs */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.error-page .code { font: 400 72px/1 var(--font-display); color: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .main { grid-column: 1; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 50; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(23,17,12,.45); z-index: 40; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 18px; }
  .content { padding: 22px 18px 48px; }
  .sim-banner { padding: 8px 18px; }
  .journey { grid-template-columns: repeat(7, minmax(84px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { min-height: 250px; padding: 28px 24px; justify-content: flex-end; }
  .auth-visual .logo { width: 84px; margin-bottom: 16px; }
  .auth-visual h1 { font-size: 30px; }
  .auth-visual .slogan { font-size: 18px; margin-top: 8px; }
  .auth-visual .church { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  h1 { font-size: 23px; }
  .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .g-4.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 26px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 22px 20px; border-radius: 14px; }
  .hero h1 { font-size: 23px; }
  .card-head, .card-body, .form-section { padding-left: 16px; padding-right: 16px; }
  .list > li { padding: 12px 16px; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 10px; }
  .dist-row { grid-template-columns: 110px 1fr 30px; }
  .next-class { grid-template-columns: 1fr; }
  .meeting-row { grid-template-columns: 1fr auto; }
  .meeting-row .hide-sm { display: none; }
  .filters input, .filters select, .filters input[type=search] { min-width: 0; flex: 1 1 140px; }
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table.responsive td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 6px 16px; text-align: right; }
  .table.responsive td::before { content: attr(data-label); font: 700 11px/1.6 var(--font-cond); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; }
  .table.responsive td.num { justify-content: space-between; }
  .att-choices span { padding: 10px 9px; min-width: 0; }
  .topbar .role-chip { display: none; }
  .page-head .actions { width: 100%; }
  .status-track .s { font-size: 11px; }
  .mobile-cta {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(23,17,12,.96); gap: 10px; align-items: center; color: var(--cream);
  }
  .mobile-cta .txt { flex: 1; min-width: 0; font-size: 13px; line-height: 1.3; }
  .mobile-cta .txt strong { display: block; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .has-mobile-cta .content { padding-bottom: 96px; }
}
@media print {
  .sidebar, .topbar, .actions, .mobile-cta, .sim-banner { display: none !important; }
  .app { display: block; }
}

/* Rappels de cours (notifications) */
.push-panel h2{margin:0;font-size:18px}
.push-panel .push-head{display:flex;gap:14px;align-items:flex-start;margin-bottom:12px}
.push-panel .push-head .icon{color:var(--brand,#9E2A1F);flex:none;margin-top:2px}
.push-panel .push-head p{margin:4px 0 0}
.push-panel .push-ok{display:flex;gap:8px;align-items:center;color:#1E7A46;font-weight:600;margin:0 0 10px}
.push-panel .push-steps{margin:6px 0 8px;padding-left:20px;line-height:1.6}
.push-panel .push-error{color:#B3261E;margin:10px 0 0}
.push-panel.compact{margin-bottom:var(--gap,20px)}
.btn-wa { white-space: normal; text-align: center; }

/* Support de cours officiel */
.support-card .support-row{display:flex;gap:14px;align-items:flex-start}
.support-card .support-row > .icon{color:var(--brand,#9E2A1F);flex:none;margin-top:4px}
.support-card strong{display:block;margin:2px 0}
.table .export-btns { flex-wrap: nowrap; gap: 6px; }
