/* Seyidi — charte commune (palette ITQANATECH : bleu nuit, turquoise, bleu digital). Aucune ressource externe. */
@font-face { font-family: "Outfit"; src: url("fonts/Outfit-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("fonts/Outfit-SemiBold.ttf") format("truetype"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Noto Kufi Arabic"; src: url("fonts/NotoKufiArabic-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Kufi Arabic"; src: url("fonts/NotoKufiArabic-SemiBold.ttf") format("truetype"); font-weight: 600 700; font-display: swap; }

:root {
  --sy-night: #0B1830; --sy-accent: #00B8AE; --sy-blue: #2563EB; --sy-text: #0B1830; --sy-muted: #516174;
  --sy-bg: #F3F7FA; --sy-border: #D8E2E8; --sy-card: #fff;
  --bs-body-font-family: "Outfit", "Noto Kufi Arabic", system-ui, sans-serif;
  --bs-primary: var(--sy-blue); --bs-primary-rgb: 37,99,235; --bs-link-color: var(--sy-blue);
  --bs-body-color: var(--sy-text); --bs-body-bg: var(--sy-bg); --bs-border-color: var(--sy-border);
  --bs-border-radius: .6rem;
}
html[lang="ar"] body { font-family: "Noto Kufi Arabic", "Outfit", sans-serif; }
body { background: var(--sy-bg); color: var(--sy-text); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
.text-muted, .text-body-secondary { color: var(--sy-muted) !important; }

/* ---- coque : menu latéral + barre du haut (propriétés logiques : s'inverse tout seul en arabe) ---- */
:root { --sy-side-w: 16rem; --sy-side-w-collapsed: 4.6rem; --sy-top-h: 3.6rem; }
.sy-shell { display: flex; min-height: 100vh; }
.sy-sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sy-side-w); background: var(--sy-night); color: #fff;
  display: flex; flex-direction: column; z-index: 1040; transition: width .18s ease, transform .22s ease; overflow-x: hidden; }
.sy-brand-row { height: var(--sy-top-h); display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding-inline: 1.25rem .65rem; flex-shrink: 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.sy-brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; min-width: 0; }
.sy-collapse { width: 2rem; height: 2rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: .55rem; background: rgba(255,255,255,.07); color: rgba(255,255,255,.75); }
.sy-collapse:hover { background: rgba(255,255,255,.16); color: #fff; }
.sy-collapse .bi { margin: 0; font-size: .95rem; transition: transform .18s; }
.sy-collapse .ico-close { display: none; }
.sy-brand:hover { color: #fff; }
.sy-dot { width: .8rem; height: .8rem; border-radius: 50%; background: var(--sy-accent); flex-shrink: 0; display: inline-block; }
.sy-menu { list-style: none; margin: 0; padding: .75rem .65rem; flex: 1; overflow-y: auto; }
.sy-menu .sy-section { color: rgba(255,255,255,.4); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; padding: .9rem .65rem .35rem; white-space: nowrap; }
.sy-menu a { display: flex; align-items: center; gap: .8rem; color: rgba(255,255,255,.75); text-decoration: none; padding: .62rem .75rem;
  border-radius: .65rem; font-size: .95rem; white-space: nowrap; margin-bottom: .15rem; }
.sy-menu a .bi { font-size: 1.15rem; width: 1.4rem; text-align: center; flex-shrink: 0; margin: 0; }
.sy-menu a:hover { color: #fff; background: rgba(255,255,255,.08); }
.sy-menu a.active { color: #fff; background: rgba(0,184,174,.22); box-shadow: inset 3px 0 0 var(--sy-accent); }
[dir="rtl"] .sy-menu a.active { box-shadow: inset -3px 0 0 var(--sy-accent); }

.sy-main { flex: 1; min-width: 0; margin-inline-start: var(--sy-side-w); transition: margin .18s ease; display: flex; flex-direction: column; min-height: 100vh; }
.sy-topbar { position: sticky; top: 0; z-index: 1030; height: var(--sy-top-h); background: #fff; border-bottom: 1px solid var(--sy-border);
  display: flex; align-items: center; gap: .75rem; padding-inline: 1.25rem; }
.sy-topbar .sy-burger { display: none; }
.sy-topbar .spacer { flex: 1; }
.sy-topbar .sy-year { color: var(--sy-muted); font-size: .85rem; }
.sy-icon-btn { position: relative; width: 2.4rem; height: 2.4rem; border-radius: .65rem; border: 1px solid var(--sy-border); background: #fff; color: var(--sy-text);
  display: inline-flex; align-items: center; justify-content: center; }
.sy-icon-btn:hover { background: var(--sy-bg); }
.sy-icon-btn .bi { margin: 0; font-size: 1.1rem; }
.sy-badge { position: absolute; top: -.35rem; inset-inline-end: -.35rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 999px;
  background: #d92d20; color: #fff; font-size: .68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.sy-badge[hidden] { display: none; }
.sy-avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--sy-night); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .9rem; }
.sy-content { padding: 1.5rem 1.5rem 1rem; flex: 1; width: 100%; max-width: 1280px; margin-inline: auto; }

/* bureau replié : seulement les icônes */
html[data-sidebar="collapsed"] .sy-sidebar { width: var(--sy-side-w-collapsed); }
html[data-sidebar="collapsed"] .sy-main { margin-inline-start: var(--sy-side-w-collapsed); }
html[data-sidebar="collapsed"] .sy-label, html[data-sidebar="collapsed"] .sy-section { display: none; }
html[data-sidebar="collapsed"] .sy-brand-row { justify-content: center; padding-inline: 0; gap: .5rem; }
html[data-sidebar="collapsed"] .sy-collapse .ico-collapse { transform: rotate(180deg); }
html[data-sidebar="collapsed"] .sy-menu a { justify-content: center; padding-inline: 0; }

/* notifications */
.sy-bell-menu { width: 23rem; max-width: calc(100vw - 1.5rem); padding: 0; border-radius: 1rem; border: 1px solid var(--sy-border); overflow: hidden; }
.sy-notif { display: flex; gap: .75rem; padding: .8rem 1rem; text-decoration: none; color: inherit; border-bottom: 1px solid var(--sy-border); background: #fff; }
.sy-notif:hover { background: var(--sy-bg); color: inherit; }
.sy-notif.unread { background: #f2f8ff; }
.sy-notif .ico { width: 2.1rem; height: 2.1rem; border-radius: .65rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sy-notif .ico.info { background: #e1ebff; color: #1b4bb5; } .sy-notif .ico.success { background: #d9f6f3; color: #05665f; }
.sy-notif .ico.danger { background: #fde2e0; color: #9b1c12; } .sy-notif .ico.warning { background: #fff1cf; color: #7a5200; }
.sy-notif .t { font-weight: 600; font-size: .9rem; } .sy-notif .b { color: var(--sy-muted); font-size: .84rem; } .sy-notif .d { color: #8a99a6; font-size: .75rem; }
.sy-notif .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--sy-blue); flex-shrink: 0; margin-top: .45rem; }

/* page de connexion (sans menu) */
.sy-bare-lang { position: absolute; top: 1rem; inset-inline-end: 1rem; }
.sy-pw-toggle { border-color: var(--sy-border); background: #fff; color: var(--sy-muted); }
.sy-pw-toggle:hover { background: var(--sy-bg); color: var(--sy-text); }
.sy-bare { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 1.5rem; }

/* mobile : menu en tiroir */
.sy-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sy-sidebar { transform: translateX(-100%); width: min(18rem, 85vw); box-shadow: none; }
  [dir="rtl"] .sy-sidebar { transform: translateX(100%); }
  html[data-sidebar-open="1"] .sy-sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  html[data-sidebar-open="1"] .sy-backdrop { display: block; position: fixed; inset: 0; background: rgba(11,24,48,.5); z-index: 1035; }
  .sy-main, html[data-sidebar="collapsed"] .sy-main { margin-inline-start: 0; }
  html[data-sidebar="collapsed"] .sy-sidebar { width: min(18rem, 85vw); }
  html[data-sidebar="collapsed"] .sy-label, html[data-sidebar="collapsed"] .sy-section { display: initial; }
  html[data-sidebar="collapsed"] .sy-menu a { justify-content: flex-start; padding-inline: .75rem; }
  html[data-sidebar="collapsed"] .sy-brand-row { justify-content: space-between; padding-inline: 1.25rem .65rem; }
  html[data-sidebar="collapsed"] .sy-collapse .ico-collapse { transform: none; }
  .sy-topbar .sy-burger { display: inline-flex; }
  .sy-collapse .ico-collapse { display: none; } .sy-collapse .ico-close { display: inline; }
  .sy-content { padding: 1rem .9rem; }
}

/* cartes, titres, boutons */
.card { background: var(--sy-card); border: 1px solid var(--sy-border); border-radius: 1rem; box-shadow: 0 1px 2px rgba(11,24,48,.05); }
.card-header-sy { padding: .9rem 1.1rem; border-bottom: 1px solid var(--sy-border); font-weight: 600; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.45rem; font-weight: 700; margin: 0; }
.page-head .sub { color: var(--sy-muted); font-size: .92rem; margin-top: .15rem; }
.btn { border-radius: .6rem; font-weight: 500; }
.btn-primary { --bs-btn-bg: var(--sy-blue); --bs-btn-border-color: var(--sy-blue); --bs-btn-hover-bg: #1d4fc4; --bs-btn-hover-border-color: #1d4fc4; }
.btn-accent { background: var(--sy-accent); border-color: var(--sy-accent); color: #04332f; }
.btn-accent:hover { background: #00a199; border-color: #00a199; color: #04332f; }
.btn .bi { margin-inline-end: .35rem; }
.btn-icon { width: 2.1rem; height: 2.1rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon .bi { margin: 0; }

/* tableaux */
.table { --bs-table-bg: transparent; }
.table > thead > tr > th { color: var(--sy-muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-bottom-width: 1px; white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #F3F7FA; }
.table td, .table th { vertical-align: middle; }

/* formulaires */
.form-control, .form-select { border-color: var(--sy-border); padding: .5rem .75rem; }
.form-control:focus, .form-select:focus { border-color: var(--sy-blue); box-shadow: 0 0 0 .2rem rgba(37,99,235,.15); }
.form-label { font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
.form-text, .helptext { color: var(--sy-muted); font-size: .82rem; }
.errorlist { list-style: none; padding: 0; margin: .25rem 0 0; color: #b42318; font-size: .85rem; }
form .row-field, form > div > div { margin-bottom: .9rem; }
form input[type=file] { padding: .4rem; }

/* pastilles de statut */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill-ok { background: #d9f6f3; color: #05665f; } .pill-wait { background: #fff1cf; color: #7a5200; }
.pill-bad { background: #fde2e0; color: #9b1c12; } .pill-info { background: #e1ebff; color: #1b4bb5; } .pill-muted { background: #e8eef2; color: var(--sy-muted); }

/* état vide */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--sy-muted); }
.empty .bi { font-size: 2.2rem; display: block; margin-bottom: .5rem; color: #a8b6c2; }

/* statistiques */
.stat { padding: 1.1rem 1.25rem; }
.stat .label { color: var(--sy-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat .value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat .icon { width: 2.6rem; height: 2.6rem; border-radius: .8rem; display: inline-flex; align-items: center; justify-content: center; background: #e1ebff; color: var(--sy-blue); font-size: 1.2rem; }

/* saisie des notes */
.grade-value { min-width: 4.5rem; font-variant-numeric: tabular-nums; }
.grade-value.is-invalid { background-image: none; padding-inline-end: .5rem; }
select.grade-status { min-width: 10.5rem; }
.matrix-cell { display: block; text-align: center; padding: .55rem .4rem; border-radius: .6rem; border: 1px solid var(--sy-border); text-decoration: none; color: inherit; background: #fff; transition: border-color .12s, box-shadow .12s; }
.matrix-cell:hover { border-color: var(--sy-blue); box-shadow: 0 0 0 .15rem rgba(37,99,235,.12); }
.matrix-cell .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.matrix-cell.done { background: #d9f6f3; border-color: #9fe3dd; } .matrix-cell.part { background: #fff7e0; border-color: #f3d98a; }

/* parcours en étapes */
.sy-steps { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 1.25rem; }
.sy-steps li { flex: 1; display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border: 1px solid var(--sy-border); border-radius: .8rem; background: #fff; color: var(--sy-muted); min-width: 0; }
.sy-steps .n { width: 1.7rem; height: 1.7rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; background: var(--sy-bg); flex-shrink: 0; }
.sy-steps .n .bi { margin: 0; }
.sy-steps .l { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sy-steps li.current { border-color: var(--sy-blue); color: var(--sy-text); box-shadow: 0 0 0 .15rem rgba(37,99,235,.12); }
.sy-steps li.current .n { background: var(--sy-blue); color: #fff; }
.sy-steps li.done { color: var(--sy-text); } .sy-steps li.done .n { background: var(--sy-accent); color: #04332f; }
.sy-choice-input { position: absolute; opacity: 0; pointer-events: none; }
.sy-choice { display: flex; flex-direction: column; gap: .15rem; height: 100%; padding: .85rem 1rem; border: 1.5px solid var(--sy-border); border-radius: .8rem; background: #fff; cursor: pointer; transition: border-color .12s, box-shadow .12s, background .12s; }
.sy-choice:hover { border-color: #9db7f5; }
.sy-choice-input:checked + .sy-choice { border-color: var(--sy-blue); background: #f2f7ff; box-shadow: 0 0 0 .15rem rgba(37,99,235,.14); }
.sy-choice-input:focus-visible + .sy-choice { outline: 2px solid var(--sy-blue); outline-offset: 2px; }
.sy-bar { display: block; height: .3rem; border-radius: 999px; background: #e8eef2; margin-top: .45rem; overflow: hidden; }
.sy-bar > span { display: block; height: 100%; background: var(--sy-accent); border-radius: 999px; }
@media (max-width: 576px) { .sy-steps li { flex: 0 0 auto; } .sy-steps li.current { flex: 1; } .sy-steps .l { display: none; } .sy-steps li.current .l { display: inline; } }

/* bouton « Suivant » flottant (mobile), affiché seulement si le vrai bouton n'est pas visible */
.sy-step-float { display: none; }
@media (max-width: 767.98px) {
  .sy-step-float { position: fixed; inset-inline: 0; bottom: 0; z-index: 1025; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
    background: linear-gradient(to top, #fff 70%, rgba(255,255,255,0)); transform: translateY(110%); transition: transform .18s ease; display: block; pointer-events: none; }
  .sy-step-float.show { transform: none; pointer-events: auto; }
  .sy-step-float .btn { width: 100%; box-shadow: 0 6px 18px rgba(37,99,235,.35); }
  body.has-step-float .sy-content { padding-bottom: 6rem; }
}

/* navigation mobile : tableaux défilants, boutons plus larges */
@media (max-width: 576px) { .page-head h1 { font-size: 1.2rem; } .btn { padding: .5rem .8rem; } }
@media print { .sy-sidebar, .sy-topbar, .no-print { display: none !important; } .sy-main { margin: 0 !important; } body { background: #fff; } .card { box-shadow: none; border: 0; } }

/* ---- arabe (droite-gauche) : Bootstrap charge sa version RTL ; ici, les icônes qui indiquent une direction sont inversées ---- */
[dir="rtl"] .bi-arrow-left::before, [dir="rtl"] .bi-arrow-right::before,
[dir="rtl"] .bi-chevron-left::before, [dir="rtl"] .bi-chevron-right::before,
[dir="rtl"] .bi-chevron-double-left::before, [dir="rtl"] .bi-chevron-double-right::before,
[dir="rtl"] .bi-box-arrow-right::before, [dir="rtl"] .bi-box-arrow-in-right::before, [dir="rtl"] .bi-box-arrow-left::before,
[dir="rtl"] .bi-play-fill::before, [dir="rtl"] .bi-list-ul::before { transform: scaleX(-1); }
