/* =====================================================================
   ESISFSFA — Thème de la maquette (surcouche Bootstrap 5)
   ===================================================================== */
:root {
  --brand: #1a7f43; --brand-600: #156b38; --brand-50: #e8f5ec; --accent: #c99a3a;
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --line: #ece4d2; --bg: #f8f4ea; --card: #fff;
  --sb: #0f3d23; --sb-2: #175232; --sb-text: #c3e3cf;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.06);
  --bs-primary: #1a7f43; --bs-primary-rgb: 26,127,67;
  --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-color: #334155; --bs-body-bg: #f8f4ea; --bs-border-color: #ece4d2;
  --bs-link-color: #1a7f43; --bs-link-color-rgb: 26,127,67; --bs-link-hover-color: #156b38; --bs-link-hover-color-rgb: 67,56,202;
}
body { font-family: var(--bs-body-font-family); background: var(--bg); color: var(--ink-2); font-size: .9rem; }
h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6 { color: var(--ink); font-weight: 700; font-family: var(--bs-body-font-family); }
a { color: var(--brand); }
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.text-ink { color: var(--ink) !important; }
.link-ink { color: var(--ink); text-decoration: none; font-weight: 600; }
.link-ink:hover { color: var(--brand); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.section-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: .75rem; }

/* ---------- Boutons & formulaires ---------- */
.btn { background-image: none !important; text-shadow: none !important; font-weight: 600; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font-size: .85rem; padding: .5rem .9rem; }
.btn-sm { padding: .3rem .65rem; font-size: .78rem; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600); --bs-btn-hover-color: #fff; --bs-btn-active-bg: #105a2f; --bs-btn-active-border-color: #105a2f; --bs-btn-active-color: #fff; --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); box-shadow: 0 4px 12px -4px rgba(26,127,67,.55); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: #bfe3cb; --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand); --bs-btn-active-color: #fff; }
.btn-outline-success { --bs-btn-color: #059669; --bs-btn-border-color: #f3d998; --bs-btn-hover-bg: #059669; --bs-btn-hover-border-color: #059669; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #047857; --bs-btn-active-color: #fff; }
.btn-success { --bs-btn-bg: #059669; --bs-btn-border-color: #059669; --bs-btn-hover-bg: #047857; --bs-btn-hover-border-color: #047857; --bs-btn-color: #fff; --bs-btn-hover-color: #fff; }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); --bs-btn-color: var(--ink-2); --bs-btn-hover-bg: #f8fafc; --bs-btn-hover-border-color: #cbd5e1; --bs-btn-hover-color: var(--ink); --bs-btn-active-bg: #f1f5f9; }
.btn-danger { --bs-btn-bg: #ef4444; --bs-btn-border-color: #ef4444; --bs-btn-hover-bg: #dc2626; --bs-btn-hover-border-color: #dc2626; --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #b91c1c; }
.btn-link { text-decoration: none; }
.form-control, .form-select { border-radius: 10px; border-color: var(--line); font-size: .88rem; padding: .55rem .8rem; color: var(--ink); }
.form-control-sm, .form-select-sm { padding: .3rem .6rem; font-size: .8rem; border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: #93cfa8; box-shadow: 0 0 0 4px rgba(26,127,67,.12); }
.form-label { font-weight: 600; font-size: .78rem; color: var(--ink-2); margin-bottom: .35rem; }
.form-text { font-size: .75rem; color: var(--muted); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(26,127,67,.12); border-color: #93cfa8; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.input-icon .form-control { padding-left: 2.3rem; }
.req::after { content: ' *'; color: #ef4444; }
.char-count { font-size: .72rem; color: var(--muted); text-align: right; margin-top: .2rem; }

/* ---------- Cartes ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--card); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: .95rem 1.25rem; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: .55rem; }
.card-header > svg { color: var(--brand); }
.card-header:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.card-body { padding: 1.25rem; }
.card-footer { background: #fafbfe; border-top: 1px solid var(--line); padding: .8rem 1.25rem; }
.card-footer:last-child { border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Connexion ---------- */
#login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; background-color: #0f3d23 !important;
  background: radial-gradient(circle at 15% 85%, rgba(201,154,58,.5), transparent 45%), radial-gradient(circle at 90% 10%, rgba(224,181,90,.45), transparent 40%), linear-gradient(140deg, #0a3d20, #105a2f 60%, #a5791f); }
.login-art::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); }
.login-art > * { position: relative; }
.login-art h1 { color: #fff; font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; max-width: 520px; }
.login-art .lead { color: #bfe3cb; max-width: 480px; font-size: 1rem; }
.feat { display: flex; gap: .75rem; align-items: center; margin-bottom: .9rem; color: #e0e7ff; }
.feat span { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.12); display: grid; place-items: center; }
.glass { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(12px); border-radius: 16px; padding: .9rem 1rem; display: flex; gap: .8rem; align-items: center; max-width: 340px; box-shadow: 0 20px 40px -20px rgba(0,0,0,.5); }
.glass .gi { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #ef4444; }
.glass small { color: #bfe3cb; }
.glass-stack { display: grid; gap: .8rem; }
.glass-stack .glass:nth-child(2) { margin-left: 3rem; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 2rem; background: #fff; }
.login-card { width: 100%; max-width: 410px; }
.login-card h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.logo { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, #22a052, #c99a3a); display: grid; place-items: center; color: #fff; flex-shrink: 0; box-shadow: 0 6px 16px -6px rgba(26,127,67,.5); }
.logo svg { width: 22px; height: 22px; }
.role-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.role-pick label { border: 1.5px solid var(--line); border-radius: 12px; padding: .6rem .4rem; text-align: center; cursor: pointer; font-size: .76rem; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: .3rem; color: var(--ink-2); transition: .15s; }
.role-pick input:checked + label { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.pw-toggle { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); }
@media (max-width: 991.98px) { #login { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ---------- Coque (sidebar + topbar) ---------- */
#shell { display: flex; min-height: 100vh; }
.sidebar { width: 264px; background: var(--sb); color: var(--sb-text); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1040; transition: transform .25s ease; }
.sb-brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem .75rem; color: #fff; text-decoration: none; }
.sb-brand b { display: block; font-size: 1.05rem; color: #fff; }
.sb-brand small { color: #9fcdb0; font-size: .72rem; }
.sb-nav { flex: 1; overflow-y: auto; padding: .25rem .75rem 1rem; }
.sb-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: #7fb592; padding: 1rem .75rem .4rem; font-weight: 700; }
.sb-link { display: flex; align-items: center; gap: .75rem; padding: .58rem .75rem; border-radius: 10px; color: var(--sb-text); text-decoration: none; font-weight: 500; margin-bottom: 2px; transition: .15s; }
.sb-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.sb-link.active { background: linear-gradient(90deg, rgba(224,181,90,.35), rgba(224,181,90,.05)); color: #fff; box-shadow: inset 3px 0 0 #e0b55a; }
.sb-link .count { margin-left: auto; background: rgba(255,255,255,.08); color: #bfe3cb; font-size: .68rem; padding: .1rem .5rem; border-radius: 20px; font-weight: 600; }
.sb-user { margin: .75rem; padding: .7rem; border-radius: 12px; background: var(--sb-2); display: flex; align-items: center; gap: .6rem; }
.sb-user b { color: #fff; font-size: .82rem; display: block; line-height: 1.2; }
.sb-user small { color: #9fcdb0; font-size: .7rem; }
.sb-user .btn-icon { color: #9fcdb0; margin-left: auto; }
.sb-user .btn-icon:hover { background: rgba(255,255,255,.08); color: #fff; }
.sb-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1030; }
.main { flex: 1; margin-left: 264px; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 68px; background: rgba(255,255,255,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem; position: sticky; top: 0; z-index: 1020; }
.topbar .search { max-width: 380px; flex: 1; }
.top-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--ink-2); position: relative; flex-shrink: 0; }
.top-btn:hover { border-color: #bfe3cb; color: var(--brand); }
.top-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; border: 2px solid #fff; }
.user-btn { display: flex; align-items: center; gap: .6rem; border: none; background: transparent; padding: .3rem .5rem; border-radius: 12px; text-align: left; }
.user-btn:hover { background: #f1f5f9; }
.user-btn b { display: block; font-size: .82rem; color: var(--ink); line-height: 1.2; }
.user-btn small { color: var(--muted); font-size: .7rem; }
.demo-pill { background: #fef3c7; color: #92400e; font-size: .66rem; font-weight: 700; padding: .3rem .65rem; border-radius: 20px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.content { padding: 1.5rem; flex: 1; }
.app-footer { padding: 1rem 1.5rem; color: var(--muted); font-size: .75rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 40px -12px rgba(15,23,42,.2); padding: .5rem; font-size: .85rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; display: flex; gap: .6rem; align-items: center; color: var(--ink-2); }
.dropdown-item svg { width: 16px; height: 16px; color: var(--muted); }
.dropdown-item:active { background: var(--brand-50); color: var(--brand); }
.notif { width: 340px; }
.notif .dropdown-item { white-space: normal; align-items: flex-start; }
.notif .ni { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  body.sb-open .sidebar { transform: none; }
  body.sb-open .sb-overlay { display: block; }
  .main { margin-left: 0; }
  .content { padding: 1rem; }
  .topbar { padding: 0 1rem; }
}

/* ---------- En-tête de page ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.5rem; margin: .3rem 0 .15rem; font-weight: 800; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.crumbs { display: flex; align-items: center; gap: .35rem; font-size: .76rem; color: var(--muted); flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.crumbs svg { width: 13px; height: 13px; }

/* ---------- Tableau de bord ---------- */
.welcome { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.welcome h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.welcome p { margin: .2rem 0 0; color: var(--muted); }
.hero-banner { display: flex; align-items: center; gap: 1.5rem; padding: 1.25rem; border-radius: 18px; color: #fff; text-decoration: none; position: relative; overflow: hidden; margin-bottom: 1.25rem;
  background: linear-gradient(120deg, #0a3d20 0%, #105a2f 50%, #a5791f 100%); box-shadow: 0 14px 30px -14px rgba(16,90,47,.7); transition: .2s; }
.hero-banner:hover { transform: translateY(-2px); color: #fff; }
.hero-banner::after { content: ''; position: absolute; right: -70px; top: -70px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.07); }
.hb-cover { width: 160px; height: 108px; flex-shrink: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 24px -10px rgba(0,0,0,.6); }
.hb-body { min-width: 0; position: relative; z-index: 1; }
.hb-tag { display: inline-flex; gap: .35rem; align-items: center; background: rgba(255,255,255,.16); padding: .25rem .65rem; border-radius: 20px; font-size: .72rem; font-weight: 600; }
.hb-tag svg { width: 14px; height: 14px; color: #fde68a; }
.hero-banner h2 { color: #fff; font-size: 1.25rem; margin: .5rem 0 .25rem; font-weight: 800; }
.hero-banner p { color: #bfe3cb; margin: 0; font-size: .85rem; }
.hb-meta { color: #93cfa8; font-size: .76rem; margin-top: .5rem; display: flex; gap: .9rem; flex-wrap: wrap; }
.hb-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.hb-meta svg { width: 14px; height: 14px; }
.hb-cta { margin-left: auto; background: #fff; color: #105a2f; padding: .6rem 1rem; border-radius: 12px; font-weight: 700; display: inline-flex; gap: .4rem; align-items: center; white-space: nowrap; position: relative; z-index: 1; }
@media (max-width: 767.98px) { .hb-cover { display: none; } .hero-banner { flex-wrap: wrap; } .hb-cta { margin-left: 0; } }
.stat { display: flex; gap: 1rem; align-items: center; padding: 1.1rem 1.25rem; }
.stat-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); flex-shrink: 0; }
.stat-ic svg { width: 22px; height: 22px; }
.stat .val { font-size: 1.6rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: .8rem; font-weight: 500; }
.list-item { display: flex; align-items: center; gap: .85rem; padding: .75rem 1.25rem; border-bottom: 1px solid #f1f5f9; text-decoration: none; color: inherit; }
.list-item:hover { background: #fafbff; color: inherit; }
.list-item:last-child { border-bottom: 0; }
.info-card { display: flex; gap: .8rem; padding: .9rem 1.25rem; border-bottom: 1px solid #f1f5f9; }
.info-card:last-child { border-bottom: 0; }
.info-dot { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.info-dot.brand { background: var(--brand-50); color: var(--brand); }
.info-dot.warning { background: #fef3c7; color: #d97706; }
.info-dot.muted { background: #f1f5f9; color: #64748b; }
.info-dot.danger { background: #fee2e2; color: #dc2626; }
.msg-item { padding: .85rem 1.25rem; border-bottom: 1px solid #f1f5f9; }
.msg-item:last-child { border-bottom: 0; }

/* ---------- Visuels (couverture, avatar, chips, badges) ---------- */
.cover { position: relative; overflow: hidden; height: 100%; width: 100%; display: grid; place-items: center; color: rgba(255,255,255,.92);
  background: linear-gradient(135deg, var(--c, #1a7f43), color-mix(in srgb, var(--c, #1a7f43), #0f172a 45%)); }
.cover::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 15%, rgba(255,255,255,.28), transparent 50%); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover svg { width: 40%; height: 40%; max-width: 54px; max-height: 54px; stroke-width: 1.5; position: relative; }
.thumb { width: 58px; height: 42px; border-radius: 9px; overflow: hidden; flex-shrink: 0; display: block; }
.thumb .cover svg { width: 20px; height: 20px; }
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-grid; place-items: center; }
.avatar-initials { color: #fff; font-weight: 700; letter-spacing: .02em; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 20px; font-size: .73rem; font-weight: 600; white-space: nowrap; margin: 0 .25rem .25rem 0;
  background: color-mix(in srgb, var(--c, #64748b) 12%, #fff); color: color-mix(in srgb, var(--c, #64748b), #0f172a 30%); }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c, #64748b); }
.chip.plain::before { display: none; }
.badge-soft { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border-radius: 8px; font-size: .73rem; font-weight: 600; background: #f1f5f9; color: #334155; white-space: nowrap; }
.badge-soft svg { width: 13px; height: 13px; }
.badge-soft.success { background: #dcfce7; color: #15803d; }
.badge-soft.muted { background: #f1f5f9; color: #64748b; }
.badge-soft.warning { background: #fef3c7; color: #b45309; }
.badge-soft.danger { background: #fee2e2; color: #b91c1c; }
.badge-soft.brand { background: var(--brand-50); color: var(--brand); }
.id-chip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .76rem; background: #f1f5f9; padding: .2rem .5rem; border-radius: 6px; color: var(--ink); letter-spacing: .02em; white-space: nowrap; }

/* ---------- Tableaux ---------- */
.data-table { margin: 0; }
.data-table thead th { background: #f8fafc; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); padding: .75rem .65rem; white-space: nowrap; }
.data-table td { padding: .6rem .65rem; border-color: #f1f5f9; vertical-align: middle; color: var(--ink-2); }
.data-table tbody tr:hover td { background: #fafbff; }
.data-table tr.selected td { background: #e8f5ec !important; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.sortable { cursor: pointer; user-select: none; }
.sortable svg { width: 14px; height: 14px; vertical-align: -2px; opacity: .45; }
.sortable.on { color: var(--brand) !important; }
.sortable.on svg { opacity: 1; }
.row-actions { display: inline-flex; gap: .2rem; }
.btn-icon { width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: transparent; display: inline-grid; place-items: center; color: var(--muted); transition: .15s; text-decoration: none; padding: 0; flex-shrink: 0; }
.btn-icon:hover { background: var(--brand-50); color: var(--brand); }
.btn-icon.danger:hover { background: #fee2e2; color: #dc2626; }
.btn-icon.success:hover { background: #dcfce7; color: #059669; }
.btn-icon svg { width: 17px; height: 17px; }
.btn-icon.sm { width: 28px; height: 28px; }
.btn-icon.sm svg { width: 15px; height: 15px; }
.bulk-bar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; background: var(--brand-50); border: 1px solid #bfe3cb; color: #105a2f; padding: .6rem 1rem; border-radius: 12px; margin-bottom: 1rem; }
.pager { display: flex; gap: .25rem; flex-wrap: wrap; }
.pager button { min-width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-weight: 600; color: var(--ink-2); display: inline-grid; place-items: center; }
.pager button svg { width: 16px; height: 16px; }
.pager button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button:disabled { opacity: .4; }
.view-toggle .btn { padding: .45rem .6rem; }
.view-toggle .btn.active { background: var(--brand-50); color: var(--brand); border-color: #bfe3cb; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty .e-ic { width: 64px; height: 64px; border-radius: 50%; background: #f1f5f9; display: grid; place-items: center; margin: 0 auto .75rem; color: #94a3b8; }
.empty .e-ic svg { width: 28px; height: 28px; }

/* ---------- Fiche étudiant ---------- */
.id-ecole { display: inline-flex; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.02rem; font-weight: 700; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.id-ecole span { padding: .35rem .5rem; }
.id-ecole .p1 { background: #e8f5ec; color: #156b38; }
.id-ecole .p2 { background: #ecfeff; color: #0e7490; }
.id-ecole .p3 { background: #f8fafc; color: #0f172a; }
.id-legend { display: flex; justify-content: center; gap: .9rem; font-size: .68rem; color: var(--muted); margin-top: .45rem; flex-wrap: wrap; }
.id-legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.id-legend .l1::before { background: #22a052; } .id-legend .l2::before { background: #06b6d4; } .id-legend .l3::before { background: #334155; }
.profile-band { height: 92px; background: linear-gradient(120deg, #1a7f43, #c99a3a); border-radius: var(--radius) var(--radius) 0 0; position: relative; overflow: hidden; }
.profile-band::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.18) 1px, transparent 1px); background-size: 16px 16px; }
.profile-card .card-body { margin-top: -60px; position: relative; }
.profile-card .avatar { border: 5px solid #fff; box-shadow: var(--shadow); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.1rem 1.5rem; }
.info-item small { display: block; color: var(--muted); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .2rem; }
.info-item > div { color: var(--ink); font-weight: 600; word-break: break-word; }
.info-item.wide { grid-column: 1 / -1; }
.contact-line { display: flex; gap: .65rem; align-items: center; padding: .55rem 0; color: var(--ink-2); word-break: break-all; }
.contact-line svg { color: var(--brand); }
.status-options { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.status-opt { border: 1.5px solid var(--line); border-radius: 12px; padding: .65rem .7rem; cursor: pointer; display: flex; gap: .5rem; align-items: flex-start; text-align: left; font-size: .74rem; margin: 0; color: var(--muted); transition: .15s; }
.status-opt input { margin-top: .1rem; flex-shrink: 0; }
.status-opt b { display: block; color: var(--ink); font-size: .8rem; }
.status-opt:has(input:checked) { border-color: #22c55e; background: #f0fdf4; }
.status-opt.gone:has(input:checked) { border-color: #94a3b8; background: #f1f5f9; }
.status-opt.gone input:checked { background-color: #64748b; border-color: #64748b; }
.status-opt:not(.gone) input:checked { background-color: #22c55e; border-color: #22c55e; }
.danger-zone { border-color: #fecaca; background: #fffafa; }
.regen-compare { display: flex; align-items: center; justify-content: center; gap: .75rem; background: #f8fafc; border-radius: 12px; padding: 1rem; flex-wrap: wrap; }
.regen-compare small { display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; font-weight: 700; margin-bottom: .2rem; }
.regen-compare code { font-size: .95rem; color: var(--ink); background: #fff; padding: .3rem .5rem; border-radius: 8px; border: 1px solid var(--line); }
.regen-compare code.new { color: var(--brand); border-color: #bfe3cb; }

/* ---------- Upload ---------- */
.img-upload { display: flex; gap: 1rem; align-items: center; }
.img-prev { width: 104px; height: 76px; border-radius: 12px; border: 2px dashed #cbd5e1; display: grid; place-items: center; color: #94a3b8; overflow: hidden; flex-shrink: 0; background: #f8fafc; }
.img-upload.round .img-prev { width: 100px; height: 100px; border-radius: 50%; }
.img-prev img { width: 100%; height: 100%; object-fit: cover; }
.img-upload.has-img .img-prev { border-style: solid; border-color: var(--line); }
.img-upload:not(.has-img) .img-remove { display: none; }
.img-upload.stack { flex-direction: column; align-items: stretch; text-align: center; }
.img-upload.stack .img-prev { width: 100%; height: 160px; }
.img-upload.stack.round .img-prev { width: 120px; height: 120px; margin: 0 auto; }
.dropzone { border: 2px dashed #bfe3cb; border-radius: 14px; background: #f8faff; padding: 1.75rem 1rem; text-align: center; cursor: pointer; transition: .15s; }
.dropzone.drag, .dropzone:hover { background: var(--brand-50); border-color: var(--brand); }
.dz-ic { width: 52px; height: 52px; margin: 0 auto .6rem; border-radius: 14px; background: #fff; display: grid; place-items: center; color: var(--brand); box-shadow: var(--shadow); }
.dz-types { display: flex; gap: .35rem; justify-content: center; flex-wrap: wrap; margin-top: .6rem; }
.file-row { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 12px; margin-top: .5rem; background: #fff; }
.ftype { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--c); flex-shrink: 0; position: relative; }
.ftype small { position: absolute; bottom: -6px; font-size: .52rem; font-weight: 800; background: var(--c); color: #fff; padding: 0 .3rem; border-radius: 4px; text-transform: uppercase; line-height: 1.4; }
.fname { font-weight: 600; color: var(--ink); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.file-card { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; display: flex; gap: .75rem; align-items: center; transition: .15s; background: #fff; }
.file-card:hover { border-color: #bfe3cb; box-shadow: var(--shadow); }
.chip-check { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .8rem; border-radius: 20px; border: 1.5px solid var(--line); font-weight: 600; font-size: .8rem; cursor: pointer; margin: 0 .35rem .45rem 0; background: #fff; transition: .15s; user-select: none; color: var(--ink-2); }
.chip-check svg { width: 14px; height: 14px; display: none; }
.btn-check:checked + .chip-check { border-color: var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 12%, #fff); color: color-mix(in srgb, var(--c, var(--brand)), #0f172a 30%); }
.btn-check:checked + .chip-check svg { display: inline; }
.btn-check:focus-visible + .chip-check { box-shadow: 0 0 0 4px rgba(26,127,67,.15); }
.form-actions { position: sticky; bottom: 0; background: rgba(248,244,234,.92); backdrop-filter: blur(6px); padding: 1rem 0; margin-top: 1rem; display: flex; justify-content: flex-end; gap: .5rem; border-top: 1px solid var(--line); z-index: 5; }

/* ---------- Documents ---------- */
.doc-card { overflow: hidden; transition: .2s; }
.doc-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -14px rgba(15,23,42,.28); }
.doc-card-cover { display: block; height: 140px; position: relative; }
.files-pill { position: absolute; right: .6rem; bottom: .6rem; background: rgba(15,23,42,.6); color: #fff; font-size: .7rem; padding: .2rem .5rem; border-radius: 20px; display: inline-flex; gap: .25rem; align-items: center; font-weight: 600; z-index: 1; }
.files-pill svg { width: 12px; height: 12px; }
.doc-hero { height: 230px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.doc-hero .cover svg { max-width: 80px; max-height: 80px; }
.comment { display: flex; gap: .75rem; padding: .9rem 0; border-bottom: 1px solid #f1f5f9; }
.comment:first-child { padding-top: 0; }
.comment-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.comment-body { flex: 1; min-width: 0; }
.comment p { margin: .3rem 0 0; color: var(--ink-2); }
.role-badge { font-size: .62rem; font-weight: 700; padding: .12rem .45rem; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.role-badge.direction { background: #ede9fe; color: #6d28d9; }
.role-badge.etudiant { background: #e0f2fe; color: #0369a1; }
.meta-row { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem 0; border-bottom: 1px solid #f1f5f9; }
.meta-row:last-child { border-bottom: 0; }
.meta-row > svg { color: var(--muted); margin-top: 2px; }
.meta-row small { display: block; color: var(--muted); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.meta-row .v { color: var(--ink); font-weight: 600; }

/* ---------- Personnel / filières ---------- */
.person-card .card-body { position: relative; padding-top: 1.6rem; }
.id-tag { position: absolute; left: 1rem; top: 1rem; font-size: .68rem; color: var(--muted); font-weight: 700; background: #f1f5f9; padding: .1rem .45rem; border-radius: 6px; }
.poste { color: var(--brand); font-size: .8rem; font-weight: 600; margin-top: .15rem; }
.pc-contact { margin-top: 1rem; display: grid; gap: .35rem; font-size: .8rem; }
.pc-contact span { color: var(--ink-2); display: inline-flex; gap: .4rem; align-items: center; justify-content: center; word-break: break-all; }
.pc-contact svg { width: 14px; height: 14px; color: var(--muted); }
.fil-card { overflow: hidden; transition: .2s; }
.fil-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -14px rgba(15,23,42,.28); }
.fil-cover { height: 130px; position: relative; }
.fil-code { position: absolute; left: .9rem; top: .9rem; z-index: 1; background: rgba(255,255,255,.95); color: var(--ink); font-family: ui-monospace, monospace; font-weight: 800; padding: .2rem .55rem; border-radius: 8px; font-size: .8rem; }
.year-big { position: absolute; left: 1rem; bottom: .7rem; z-index: 1; color: #fff; font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; text-shadow: 0 4px 16px rgba(0,0,0,.3); }
.mini-stats { display: flex; gap: 1.25rem; }
.mini-stats div { font-size: .75rem; color: var(--muted); }
.mini-stats b { display: block; color: var(--ink); font-size: 1.05rem; }

/* ---------- Modales, toasts, export ---------- */
.modal-content { border: none; border-radius: 18px; box-shadow: 0 25px 60px -15px rgba(15,23,42,.35); }
.modal-header { border-bottom: 1px solid var(--line); padding: 1rem 1.25rem; }
.modal-title { font-weight: 800; font-size: 1.05rem; }
.modal-footer { border-top: 1px solid var(--line); background: #fafbfe; border-radius: 0 0 18px 18px; }
.modal-content > form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.cm-icon { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; }
.cm-icon svg { width: 26px; height: 26px; }
.tone-danger { background: #fee2e2; color: #dc2626; }
.tone-primary { background: var(--brand-50); color: var(--brand); }
.tone-warning { background: #fef3c7; color: #d97706; }
.export-options { display: grid; gap: .6rem; }
.export-opt { display: flex; align-items: center; gap: .85rem; border: 1.5px solid var(--line); border-radius: 12px; padding: .85rem 1rem; cursor: pointer; margin: 0; transition: .15s; }
.export-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.export-opt.disabled { opacity: .5; cursor: not-allowed; }
.export-opt span { display: flex; flex-direction: column; }
.export-opt b { color: var(--ink); }
.export-opt small { color: var(--muted); }
.export-opt > svg { color: var(--brand); width: 22px; height: 22px; }
.preview-wrap { background: #e2e8f0; padding: 1.5rem; border-radius: 12px; max-height: 64vh; overflow: auto; }
.preview-sheet { background: #fff; border-radius: 6px; max-width: 700px; margin: 0 auto; box-shadow: 0 10px 30px -10px rgba(15,23,42,.3); overflow: hidden; }
.ps-head { background: #1a7f43; color: #fff; padding: 1.25rem 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.ps-head b { font-size: 1.15rem; display: block; }
.ps-table { width: 100%; }
.ps-table td { padding: .45rem 1.5rem; font-size: .83rem; vertical-align: top; }
.ps-table tr:nth-child(odd) td { background: #f8f4ea; }
.ps-table td:first-child { color: var(--muted); font-weight: 600; width: 38%; }
.xls-table { font-size: .76rem; background: #fff; margin: 0; }
.xls-table th { background: #107c41 !important; color: #fff !important; font-weight: 600; white-space: nowrap; }
.xls-table td { white-space: nowrap; }
#toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; max-width: 390px; }
.app-toast { display: flex; gap: .65rem; align-items: flex-start; background: #0f172a; color: #e2e8f0; padding: .85rem 1rem; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.22); animation: tin .25s ease; font-size: .84rem; }
.app-toast b { color: #fff; }
.app-toast > svg { margin-top: 1px; }
.app-toast.success > svg { color: #34d399; } .app-toast.danger > svg { color: #f87171; } .app-toast.info > svg { color: #60a5fa; } .app-toast.warning > svg { color: #fbbf24; }
.app-toast .btn-close { filter: invert(1); margin-left: auto; font-size: .6rem; flex-shrink: 0; margin-top: 3px; }
.app-toast.hide { opacity: 0; transform: translateY(10px); transition: .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }
.fade-in { animation: fin .25s ease; }
@keyframes fin { from { opacity: 0; transform: translateY(6px); } }
.min-w-0{min-width:0}
.data-table th:first-child,.data-table td:first-child{padding-left:1.1rem}.data-table th:last-child,.data-table td:last-child{padding-right:1.1rem}

/* ---------- Espace étudiant ---------- */
.new-pill { position: absolute; left: .6rem; top: .6rem; z-index: 1; background: #22c55e; color: #fff; font-size: .66rem; font-weight: 800; padding: .18rem .5rem; border-radius: 20px; text-transform: uppercase; letter-spacing: .05em; box-shadow: 0 4px 10px -4px rgba(0,0,0,.4); }
.stu-hero-empty { border: 2px dashed #bfe3cb; border-radius: 18px; padding: 1.5rem; text-align: center; color: var(--muted); margin-bottom: 1.25rem; background: #fff; }
.me-head { display: flex; gap: 1rem; align-items: center; padding: 1.25rem; border-bottom: 1px solid #f1f5f9; background: linear-gradient(120deg, #e8f5ec, #f0fdfa); border-radius: var(--radius) var(--radius) 0 0; }
.me-head .avatar { border: 4px solid #fff; box-shadow: var(--shadow); }
.class-banner { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .9rem; margin-bottom: 1rem; font-size: .82rem; }
.role-pick label svg { width: 18px; height: 18px; }

/* ---------- Identité ESISFSFA (vert des logos + ocre du bâtiment) ---------- */
:root { --ochre: #c99a3a; --ochre-50: #fbf3df; --ochre-dark: #a5791f; --logo-green: #1f8a3b; --logo-red: #d62e2e; }
.login-art::before { opacity: .5; }
.logo-duo { display: inline-flex; align-items: center; gap: 3px; background: #fff; border-radius: 12px; padding: 4px 7px; height: 46px; flex-shrink: 0; box-shadow: 0 6px 16px -8px rgba(0,0,0,.45); }
.logo-duo img { height: 36px; width: auto; display: block; }
.logo-duo.lg { height: 64px; padding: 6px 10px; border-radius: 16px; } .logo-duo.lg img { height: 52px; }
.univ { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: #f3d998; }
.school-full { font-size: .74rem; line-height: 1.3; }
.login-contact { font-size: .78rem; color: #e3f1e7; display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.sb-brand b { letter-spacing: .02em; }
.sb-brand { align-items: center; }
.sidebar { background: linear-gradient(180deg, #0f3d23 0%, #0b2f1b 100%); border-right: 3px solid var(--ochre); }
.sb-link .count { background: rgba(224,181,90,.18); color: #f3d998; }
.topbar { border-bottom: 1px solid var(--line); box-shadow: inset 0 -2px 0 rgba(201,154,58,.18); }
.demo-pill { background: var(--ochre-50); color: #8a6417; border: 1px solid #ecd9a8; }
.welcome h1 span.accent, .page-head h1 { color: #0f3d23; }
.profile-band { background: linear-gradient(120deg, #1a7f43, #c99a3a) !important; }
.me-head { background: linear-gradient(120deg, #e8f5ec, var(--ochre-50)) !important; }
.badge-soft.success { background: #e3f4e6; color: var(--logo-green); }
.app-footer { background: #fffdf7; }
.card-header > svg { color: var(--ochre-dark); }
.hb-cta { color: #105a2f; }
.btn-outline-primary { --bs-btn-border-color: #bfe3cb; }
.form-actions { background: rgba(248,244,234,.94); }
.dropzone { background: #fbf9f3; }
.form-control, .form-select, .input-group .btn-light { background-color: #fff; }
.form-control:disabled { background-color: #f3efe4; }
a.small, .login-card a { text-decoration: none; }

.data-table td .chip { white-space: normal; }

/* Connexion : photo du bâtiment sous un voile vert → ocre */
.login-art { background: linear-gradient(160deg, rgba(10,61,32,.94) 0%, rgba(26,127,67,.80) 50%, rgba(165,121,31,.86) 100%), url('../img/batiment.jpg') center / cover no-repeat !important; }
.login-art::before { opacity: .5; }
.sidebar { background: linear-gradient(180deg, #0f3d23 0%, #0b2f1b 100%) !important; border-right: 3px solid var(--ochre); }
.univ { color: #f3d998; }
.login-contact { color: #f3e3bd; }
.welcome h1, .page-head h1 { color: #0f3d23; }
.msg-item { color: inherit; border-bottom: 1px solid #f1ece0; }
.msg-item:hover { background: #fffaf0; }
.msg-item.unread { background: #f3faf5; box-shadow: inset 3px 0 0 #1a7f43; }
.pw-box .input-group-text { background: #fff; color: var(--muted); }
.was-validated .pw-box:has(input:invalid) .invalid-feedback { display: block; }
.person-card.is-admin { border-color: #ecd9a8; box-shadow: 0 0 0 3px #fbf3df, var(--shadow); }
.role-pick { grid-template-columns: repeat(3, 1fr) !important; }
.btn-light.disabled { opacity: .55; }
