/* EduCaisse — design professionnel, responsive */
:root {
  --navy: #0B1F3A;
  --navy-2: #132D4E;
  --teal: #0F766E;
  --teal-bright: #2DD4BF;
  --gold: #F5C542;
  --sand: #E8E0D4;
  --bg: #F3F6F9;
  --surface: #FFFFFF;
  --text: #0F172A;
  --muted: #64748B;
  --border: #D8E0EA;
  --danger: #B91C1C;
  --success: #047857;
  --warn: #B45309;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(11, 31, 58, 0.08);
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --sidebar: 260px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
a { color: var(--teal); }

/* ——— Preloader ——— */
.preloader {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #071526 0%, #0B1F3A 45%, #0F3D3A 100%);
  color: #fff;
  transition: opacity .45s ease, visibility .45s ease;
}
.preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader__inner { text-align: center; }
.preloader__mark { animation: float 2.2s ease-in-out infinite; }
.preloader__brand {
  font-family: var(--display);
  font-size: 1.6rem;
  margin: .85rem 0 .5rem;
  letter-spacing: .02em;
}
.preloader__bar {
  width: 160px; height: 4px; margin: 0 auto;
  background: rgba(255,255,255,.15); border-radius: 99px; overflow: hidden;
}
.preloader__bar span {
  display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, var(--teal-bright), var(--gold));
  border-radius: 99px;
  animation: load 1.1s ease-in-out infinite;
}
.preloader__hint { margin: .75rem 0 0; font-size: .85rem; opacity: .7; }
@keyframes load {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ——— App shell ——— */
.app { min-height: 100%; }
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
  transition: grid-template-columns .25s ease;
}
.shell--collapsed { grid-template-columns: 72px 1fr; }
.sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 1.25rem 1rem 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
  position: sticky; top: 0; height: 100vh;
  overflow: hidden;
  transition: padding .25s ease;
}
.brand {
  display: flex; align-items: center; gap: .75rem;
  padding: .25rem .5rem;
  position: relative;
}
.brand__logo { width: 40px; height: 40px; flex-shrink: 0; }
.brand__text { min-width: 0; flex: 1; }
.brand__name { font-family: var(--display); font-size: 1.15rem; margin: 0; line-height: 1.1; }
.brand__school { font-size: .75rem; opacity: .75; margin: .15rem 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-collapse {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.08);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  transition: background .15s;
}
.sidebar-collapse:hover { background: rgba(45, 212, 191, .25); }
.nav { display: flex; flex-direction: column; gap: .25rem; flex: 1; overflow: auto; }
.nav a {
  color: rgba(255,255,255,.82);
  text-decoration: none;
  padding: .65rem .85rem;
  border-radius: 10px;
  display: flex; align-items: center; gap: .65rem;
  font-size: .92rem; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a:hover, .nav a.active {
  background: rgba(45, 212, 191, .15);
  color: #fff;
}
.nav a.active { box-shadow: inset 3px 0 0 var(--teal-bright); }
.nav__icon { width: 1.15rem; text-align: center; opacity: .9; flex-shrink: 0; }
.nav__label { white-space: nowrap; overflow: hidden; }
.sidebar__foot {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: .85rem;
  font-size: .8rem;
}
.user-chip { opacity: .85; margin-bottom: .65rem; }
.user-chip strong { display: block; color: #fff; font-size: .9rem; }
.user-chip__role { display: block; }
.btn-link {
  background: none; border: none; color: var(--teal-bright);
  cursor: pointer; padding: 0; font-size: .85rem;
}
.btn--logout {
  width: 100%;
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px;
  padding: .55rem .85rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn--logout:hover {
  background: rgba(185, 28, 28, .35);
  border-color: rgba(254, 202, 202, .45);
}

.sidebar.is-collapsed {
  padding: 1rem .55rem 1.25rem;
}
.sidebar.is-collapsed .brand {
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: .25rem 0;
}
.sidebar.is-collapsed .brand__text,
.sidebar.is-collapsed .nav__label,
.sidebar.is-collapsed .user-chip,
.sidebar.is-collapsed .btn--logout {
  display: none;
}
.sidebar.is-collapsed .nav a {
  justify-content: center;
  padding: .7rem;
}
.sidebar.is-collapsed .sidebar-collapse {
  margin: 0 auto;
}

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .85rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { margin: 0; font-size: 1.15rem; font-weight: 650; }
.topbar__meta { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .75rem; font-weight: 600;
  padding: .3rem .6rem; border-radius: 999px;
  background: var(--sand); color: var(--navy);
}
.badge--online { background: #D1FAE5; color: var(--success); }
.badge--offline { background: #FEE2E2; color: var(--danger); }
.content { padding: 1.25rem 1.5rem 2rem; min-width: 0; overflow-x: hidden; }

.menu-toggle {
  display: none;
  background: var(--navy); color: #fff; border: none;
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
}

/* ——— Login ——— */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--bg);
}
.login-hero {
  position: relative;
  min-height: 100vh;
  background:
    linear-gradient(145deg, rgba(7,21,38,.88), rgba(15,61,58,.75)),
    radial-gradient(ellipse at 30% 20%, rgba(45,212,191,.35), transparent 50%),
    linear-gradient(160deg, #071526, #0B1F3A 50%, #0F4C46);
  color: #fff;
  padding: 2rem;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.login-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(-12deg, transparent, transparent 18px, rgba(255,255,255,.03) 18px, rgba(255,255,255,.03) 19px);
  pointer-events: none;
}
.login-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0 auto;
}
.login-hero__logo {
  display: block;
  width: clamp(260px, 72%, 460px);
  height: auto;
  max-width: 100%;
  margin: 0 auto 1.5rem;
  overflow: visible;
}
.login-hero__brand {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  margin: 0 0 .5rem;
}
.login-hero__tagline {
  max-width: 28rem;
  opacity: .85;
  margin: 0 auto;
  line-height: 1.45;
}
.login-panel {
  display: grid; place-items: center; padding: 2rem;
}
.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.login-card h2 { margin: 0 0 .35rem; font-size: 1.35rem; }
.login-card .sub { color: var(--muted); margin: 0 0 1.25rem; font-size: .9rem; }
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}
.password-field input {
  width: 100%;
  padding-right: 2.75rem;
}
.password-toggle {
  position: absolute;
  right: .35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 0;
}
.password-toggle:hover { color: var(--navy); background: var(--bg); }

/* ——— Forms ——— */
.form-grid { display: grid; gap: 1rem; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .82rem; font-weight: 600; color: var(--navy); }
.field input, .field select, .field textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .7rem .85rem;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .15);
}
.field .error {
  color: var(--danger); font-size: .78rem; min-height: 1.1em;
}
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea {
  border-color: var(--danger);
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: none; border-radius: 10px;
  padding: .7rem 1.1rem;
  font-weight: 600; cursor: pointer;
  transition: transform .12s, opacity .12s, background .15s;
  position: relative;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover:not(:disabled) { background: #132d4e; }
.btn--accent { background: var(--teal); color: #fff; }
.btn--accent:hover:not(:disabled) { background: #0d9488; }
.btn--ghost {
  background: transparent; color: var(--navy);
  border: 1px solid var(--border);
}
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { padding: .4rem .7rem; font-size: .82rem; }
.btn--ghost.is-active {
  background: rgba(15, 118, 110, 0.12);
  color: var(--teal);
  border-color: rgba(15, 118, 110, 0.35);
}
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 1.1rem; height: 1.1rem;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn--ghost.is-loading::after { border-color: rgba(11,31,58,.2); border-top-color: var(--navy); }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .25rem; }

/* ——— Cards / stats ——— */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: 0 2px 8px rgba(11,31,58,.04);
}
.stat__label { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat__value { font-family: var(--display); font-size: 1.55rem; margin: .35rem 0 0; color: var(--navy); }
.stat__hint { font-size: .8rem; color: var(--muted); margin-top: .2rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: 0 2px 8px rgba(11,31,58,.04);
  margin-bottom: 1rem;
}
.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.panel__head h2, .panel__head h3 { margin: 0; font-size: 1.05rem; }
.panel__head-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.section-hint {
  margin: -.35rem 0 .85rem;
  font-size: .8rem;
  color: var(--muted);
}
.debt-total-footer {
  margin: 1rem 0 0;
  padding: .85rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  background: rgba(245, 197, 66, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 10px;
  text-align: right;
}
.debt-total-footer strong {
  font-size: 1.15rem;
  color: var(--warn, #B45309);
}
.filter-inline {
  margin-bottom: 1rem;
  padding: .75rem .9rem;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 10px;
}
.filter-inline__label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .45rem;
}
.inline-limit {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  color: var(--muted);
}
.inline-limit select {
  padding: .25rem .4rem;
  border-radius: 6px;
  border: 1px solid var(--line, #D8E0EA);
  background: #fff;
}
button.link-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  color: var(--blue, #2563eb);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
button.link-btn:hover {
  color: var(--navy, #0F172A);
}
table.data--clickable tbody tr[data-class] {
  cursor: pointer;
}
table.data--clickable tbody tr[data-class]:hover td {
  background: rgba(59, 130, 246, 0.06);
}
tr.is-total-row td {
  background: rgba(15, 23, 42, 0.04);
  border-top: 2px solid var(--line, #D8E0EA);
  font-weight: 600;
}
.journal-search {
  width: 140px;
  max-width: 28vw;
  padding: .35rem .55rem;
  font-size: .82rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.journal-search:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, .12);
}
.journal-detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 8px;
  color: var(--teal);
  transition: background .15s ease, color .15s ease;
}
.journal-detail-btn:hover {
  background: rgba(15, 118, 110, .1);
  color: var(--navy);
}
.dash-modal-toolbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.dash-modal-search {
  flex: 1;
  min-width: 180px;
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
}
.dash-modal-search:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, .12);
}
.dash-modal-scope {
  margin: 0 0 .75rem;
  font-size: .85rem;
  color: var(--muted);
}
.link-student {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--teal);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-student:hover { color: var(--navy); }
.dash-detail__hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}
.dash-detail__kpi {
  text-align: right;
  padding: .75rem 1rem;
  background: linear-gradient(135deg, #F0FDFA, #ECFDF5);
  border: 1px solid #99F6E4;
  border-radius: 10px;
  min-width: 120px;
}
.dash-detail__kpi--warn {
  background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
  border-color: #FDBA74;
}
.dash-detail__kpi span {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.dash-detail__kpi strong {
  display: block;
  margin-top: .2rem;
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--navy);
}
.dash-detail__card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}
.dash-detail__card-title {
  margin: 0 0 .65rem;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
tr.is-row-active td {
  background: #ECFDF5;
  font-weight: 600;
}

/* ——— Tables ——— */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  max-width: 100%;
  min-width: 0;
}
table.data {
  width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px;
}
table.data.data--fit {
  min-width: 0;
}
table.data th, table.data td {
  text-align: left; padding: .7rem .85rem;
  border-bottom: 1px solid var(--border);
}
table.data th {
  background: #F8FAFC; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); font-weight: 700;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #F8FBFC; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 700;
  padding: .2rem .5rem; border-radius: 6px;
}
.tag--ok { background: #D1FAE5; color: var(--success); }
.tag--warn { background: #FEF3C7; color: var(--warn); }
.tag--bad { background: #FEE2E2; color: var(--danger); }
.tag--info { background: #E0F2FE; color: #0369A1; }

.empty {
  text-align: center; padding: 2rem 1rem; color: var(--muted);
}

/* ——— Modal ——— */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(7, 21, 38, .55);
  display: grid; place-items: center; padding: 1rem;
  animation: fade .2s ease;
}
.modal {
  background: #fff; border-radius: 16px;
  width: min(560px, 100%);
  max-height: 90vh; overflow: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  animation: rise .25s ease;
}
.modal--wide { width: min(760px, 100%); }
.modal--xl { width: min(920px, 100%); }
.modal-backdrop--full {
  padding: .5rem;
  place-items: stretch;
}
.modal--full {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal--full .modal__body {
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.modal--full .modal__foot {
  flex-shrink: 0;
}
.modal__body { padding: 1.25rem; }

.detail-grid {
  display: grid;
  grid-template-columns: 132px 1fr minmax(180px, 220px);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  align-items: start;
}
.student-photo-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  width: 132px;
  flex-shrink: 0;
}
.student-photo {
  width: 120px;
  height: 148px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid var(--line, #D8E0EA);
  background: #E8EEF4;
  display: block;
}
.student-photo--empty {
  display: grid;
  place-items: center;
  font-size: .72rem;
  font-weight: 600;
  color: #94A3B8;
  letter-spacing: .04em;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  margin: 0 0 .85rem;
  font-size: .82rem;
  color: var(--muted);
}
.detail-meta strong { color: var(--navy); font-weight: 600; }
.detail-dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem .85rem;
  margin: 0;
}
.detail-dl > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: .35rem;
  font-size: .9rem;
  padding: .35rem .5rem;
  background: #F8FAFC;
  border-radius: 8px;
}
.detail-dl dt { margin: 0; color: var(--muted); font-weight: 600; font-size: .78rem; }
.detail-dl dd { margin: 0; color: var(--navy); font-weight: 600; word-break: break-word; }
.detail-dl dd.is-empty { color: #94A3B8; font-weight: 500; font-style: italic; }
.card-preview-wrap {
  margin: 0 0 1.25rem;
  padding: 1rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #e8eef4 0%, #f7fafc 100%);
  border: 1px solid var(--line, #D8E0EA);
  min-height: 120px;
}
.card-preview-wrap canvas {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(11, 31, 58, .14);
}
.modal__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.modal__head h3 { margin: 0; font-size: 1.1rem; }
.modal__body { padding: 1.25rem; }
.modal__foot {
  padding: 1rem 1.25rem; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: .6rem;
}
.icon-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; line-height: 1; color: var(--muted);
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ——— Toasts ——— */
.toasts {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 200;
  display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  background: var(--navy); color: #fff;
  padding: .75rem 1rem; border-radius: 10px;
  box-shadow: var(--shadow); min-width: 240px; max-width: 360px;
  font-size: .9rem; animation: rise .25s ease;
}
.toast--ok { background: var(--success); }
.toast--err { background: var(--danger); }
.toast--warn { background: var(--warn); }
.toast--info { background: #0369A1; }

/* Bannière hors ligne */
.offline-banner {
  position: fixed;
  z-index: 9500;
  left: 50%;
  transform: translateX(-50%);
  top: .75rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  max-width: min(520px, calc(100vw - 1.5rem));
  padding: .65rem .9rem;
  background: #E0F2FE;
  color: #0C4A6E;
  border: 1px solid #7DD3FC;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(3, 105, 161, 0.18);
  font-size: .88rem;
  font-weight: 600;
}
.offline-banner[hidden] { display: none !important; }
.offline-banner__dot {
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  background: #0369A1;
  flex-shrink: 0;
}
.offline-banner__text { flex: 1; line-height: 1.35; }
.panel--error {
  border-color: #FECACA;
  background: #FEF2F2;
}
.error-panel__title {
  font-weight: 700;
  color: var(--danger);
  margin: 0 0 .35rem;
}
.error-modal {
  text-align: center;
  padding: .25rem 0 .5rem;
}
.error-modal__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto .85rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 700;
}
.error-modal__icon--danger { background: #FEE2E2; color: var(--danger); }
.error-modal__icon--warn { background: #FEF3C7; color: var(--warn); }
.error-modal__icon--info { background: #E0F2FE; color: #0369A1; }
.error-modal__msg {
  margin: 0;
  color: var(--navy);
  line-height: 1.45;
}

/* ——— Search bar ——— */
.toolbar {
  display: flex; flex-wrap: wrap; gap: .65rem; align-items: center;
  margin-bottom: 1rem;
}
.toolbar .grow { flex: 1; min-width: 180px; }
.search-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .65rem .85rem;
  background: #fff;
}

/* ——— Print (student card / receipt) ——— */
@media print {
  .preloader, .sidebar, .topbar, .btn, .toolbar, .toasts, .modal-backdrop { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .no-print { display: none !important; }
  .print-only { display: block !important; }
}

.student-card, .receipt {
  border: 2px solid var(--navy);
  border-radius: 12px;
  padding: 1.25rem;
  background: #fff;
  max-width: 420px;
}
.student-card__head {
  display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 2px solid var(--gold); padding-bottom: .75rem; margin-bottom: .75rem;
}
.student-card__school { font-weight: 700; color: var(--navy); }
.student-card__title {
  font-family: var(--display); font-size: 1.2rem; margin: .5rem 0;
  text-align: center;
}
.photo-box {
  width: 88px; height: 100px;
  border: 1px dashed var(--border);
  display: grid; place-items: center;
  font-size: .7rem; color: var(--muted); background: #F8FAFC;
}
.receipt__num { font-weight: 700; color: var(--teal); }

.demo-accounts {
  margin-top: 1rem;
}
.demo-accounts__toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: none;
  background: transparent;
  padding: .25rem 0;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  color: var(--teal);
  cursor: pointer;
}
.demo-accounts__toggle:hover {
  color: #0d9488;
}
.demo-accounts__arrow {
  display: inline-block;
  transition: transform .15s ease;
  font-size: .75rem;
  line-height: 1;
}
.demo-accounts.is-open .demo-accounts__arrow {
  transform: rotate(90deg);
}
.demo-hint {
  margin-top: .55rem; padding: .85rem;
  background: #F0FDFA; border: 1px solid #99F6E4;
  border-radius: 10px; font-size: .8rem; color: #115E59;
}
.demo-hint code {
  background: rgba(0,0,0,.06); padding: .1rem .35rem; border-radius: 4px;
  font-size: .78rem;
}

.sync-banner {
  background: #FEF3C7; color: #92400E;
  padding: .5rem 1.5rem; font-size: .85rem; text-align: center;
}

.offline-toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  user-select: none;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted, #64748B);
}
.offline-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.offline-toggle__track {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #CBD5E1;
  position: relative;
  transition: background .2s ease;
  flex-shrink: 0;
}
.offline-toggle__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
  transition: transform .2s ease;
}
.offline-toggle input:checked + .offline-toggle__track {
  background: #DC2626;
}
.offline-toggle input:checked + .offline-toggle__track::after {
  transform: translateX(16px);
}
.offline-toggle input:checked ~ .offline-toggle__label {
  color: #B91C1C;
}
.offline-toggle input:focus-visible + .offline-toggle__track {
  outline: 2px solid #0F766E;
  outline-offset: 2px;
}

/* ——— Responsive ——— */
@media (max-width: 1100px) {
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { min-height: 240px; padding: 1.5rem; }
  .login-hero__logo {
    width: clamp(120px, 38vw, 180px);
    margin-bottom: 1rem;
  }
  .login-hero__brand { font-size: 1.85rem; }
  .shell, .shell--collapsed { grid-template-columns: 1fr; }
  .sidebar, .sidebar.is-collapsed {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
    width: min(280px, 86vw);
    padding: 1.25rem 1rem 1.5rem;
    transform: translateX(-105%);
    transition: transform .25s ease;
  }
  .sidebar.is-collapsed .brand__text,
  .sidebar.is-collapsed .nav__label,
  .sidebar.is-collapsed .user-chip,
  .sidebar.is-collapsed .btn--logout {
    display: block;
  }
  .sidebar.is-collapsed .brand {
    flex-direction: row;
    align-items: center;
  }
  .sidebar.is-collapsed .nav a {
    justify-content: flex-start;
    padding: .65rem .85rem;
  }
  .sidebar-collapse { display: none; }
  .sidebar.is-open { transform: translateX(0); }
  .menu-toggle { display: inline-grid; place-items: center; }
  .form-grid.cols-2 { grid-template-columns: 1fr; }
  .backdrop-nav {
    position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40;
    touch-action: none;
  }
  /* Évite le :hover « collé » au doigt après ouverture du menu */
  .nav a:hover {
    background: transparent;
    color: inherit;
  }
  .nav a.active,
  .nav a:active {
    background: rgba(255,255,255,.12);
    color: #fff;
  }
}
@media (max-width: 900px) and (hover: hover) {
  .nav a:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
  }
}
.class-chip-grid, .class-custom-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
}
.class-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: .85rem;
  user-select: none;
}
.class-chip input { accent-color: var(--teal); }
.class-chip.is-on {
  border-color: var(--teal);
  background: #F0FDFA;
  color: #115E59;
  font-weight: 600;
}
.class-chip.is-custom { border-style: dashed; }

.tranche-presets {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.tranche-preset {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
}
.tranche-preset input { accent-color: var(--teal); }
.tranche-preset.is-on {
  border-color: var(--teal);
  background: #F0FDFA;
  color: #115E59;
}
.tranche-rows { display: grid; gap: .5rem; }
.tranche-row {
  display: grid;
  grid-template-columns: auto 1fr 72px 140px;
  gap: .45rem;
  align-items: center;
}
.tranche-sum {
  float: right;
  font-weight: 700;
  color: var(--muted);
}
.tranche-sum.is-ok { color: var(--success); }
.tranche-sum.is-bad { color: var(--danger); }
@media (max-width: 700px) {
  .tranche-row { grid-template-columns: auto 1fr; }
  .tranche-row input[type=number],
  .tranche-row input[type=date] { grid-column: 2; }
}

.detail-name {
  margin: .25rem 0 .65rem;
  font-family: var(--display);
  font-size: 1.45rem;
  color: var(--navy);
}
.section-title {
  margin: 1.25rem 0 .65rem;
  font-size: .95rem;
  color: var(--navy);
}
.linkish {
  background: none;
  border: none;
  color: var(--teal);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rate-bar {
  display: inline-block;
  vertical-align: middle;
  width: 56px;
  height: 6px;
  background: #E2E8F0;
  border-radius: 99px;
  overflow: hidden;
  margin-right: .35rem;
}
.rate-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-bright));
  border-radius: 99px;
}
@media (max-width: 700px) {
  .detail-grid { grid-template-columns: 1fr; }
  .student-photo-panel { flex-direction: row; justify-content: flex-start; }
}
.archive-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(90deg, #ECFDF5, #F0FDFA);
  border: 1px solid #99F6E4;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  color: #115E59;
}
.archive-banner p { margin: .35rem 0 0; font-size: .9rem; }
.archive-banner--bar {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  margin: 0;
}
.year-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}
.year-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: .45rem .85rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
}
.year-chip.is-active {
  border-color: var(--teal);
  background: #F0FDFA;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.year-select-wrap { display: inline-flex; }
.year-select {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .35rem .75rem;
  background: #fff;
  font-size: .8rem;
  font-weight: 600;
  color: var(--navy);
  max-width: 220px;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}
.date-filter {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.date-filter__presets {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.df-chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.df-chip:hover { border-color: var(--teal); }
.df-chip.is-on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.date-filter__custom {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: end;
}
.date-filter__custom.is-hidden { display: none; }
.date-filter__custom label {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
}
.date-filter__custom input[type="date"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .45rem .6rem;
  font: inherit;
  color: var(--text);
}
.filter-panel { margin-bottom: 1rem; }

/* Page loader (navigation) */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  background: rgba(7, 21, 38, .35);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.page-loader.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.page-loader[hidden] { display: none !important; }
.page-loader__card {
  background: #fff;
  border-radius: 16px;
  padding: 1.35rem 1.75rem;
  box-shadow: var(--shadow);
  text-align: center;
  min-width: 160px;
}
.page-loader__spin {
  width: 36px;
  height: 36px;
  margin: 0 auto .75rem;
  border: 3px solid #E2E8F0;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.page-loader__text {
  margin: 0;
  font-size: .9rem;
  font-weight: 600;
  color: var(--navy);
}
.preloader__pct {
  margin: .35rem 0 0;
  font-size: .75rem;
  opacity: .55;
}
@media (max-width: 560px) {
  .grid-stats { grid-template-columns: 1fr; }
  .content { padding: 1rem; }
  .topbar { padding: .75rem 1rem; }
  .year-select { max-width: 140px; }
}

/* ——— Caisse ——— */
.cashier-layout { display: flex; flex-direction: column; gap: 1.25rem; }
.cashier-stats { grid-template-columns: repeat(3, 1fr); }
.cashier-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.cashier-panel { min-height: 320px; }
.cashier-search-box {
  position: relative;
  margin-bottom: 1rem;
}
.cashier-search-icon {
  position: absolute;
  left: .95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.cashier-search-input {
  width: 100%;
  padding: .9rem 2.5rem .9rem 2.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 1rem;
  transition: border-color .2s, box-shadow .2s;
}
.cashier-search-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.cashier-search-clear {
  position: absolute;
  right: .5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 50%;
  line-height: 1;
}
.cashier-search-clear:hover { background: var(--bg); color: var(--text); }
.cashier-hint, .cashier-empty {
  padding: 1.25rem;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: .92rem;
}
.cashier-hint p, .cashier-empty p { margin: 0; }
.cashier-results { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.cashier-results__label {
  margin: 0 0 .25rem;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.cashier-result {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.cashier-result:hover {
  border-color: var(--teal);
  background: #F0FDFA;
}
.cashier-result.is-active {
  border-color: var(--teal);
  background: #ECFDF5;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, .15);
}
.cashier-result__mat {
  font-weight: 700;
  color: var(--navy);
  font-family: ui-monospace, monospace;
  font-size: .92rem;
}
.cashier-result__meta { font-size: .85rem; color: var(--muted); }
.cashier-result__action {
  font-size: .78rem;
  font-weight: 600;
  color: var(--teal);
  white-space: nowrap;
}
.cashier-student {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--bg);
  animation: cashierFadeIn .25s ease;
}
@keyframes cashierFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.cashier-student__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.cashier-student__kicker {
  margin: 0;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--teal);
}
.cashier-student__head h3 { margin: .2rem 0; font-size: 1.2rem; }
.cashier-student__meta { margin: 0; font-size: .88rem; color: var(--muted); }
.cashier-student__balance {
  text-align: right;
  padding: .75rem 1rem;
  background: linear-gradient(135deg, #F0FDFA, #ECFDF5);
  border-radius: 10px;
  border: 1px solid #99F6E4;
}
.cashier-student__balance span:first-child {
  display: block;
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cashier-student__balance strong {
  display: block;
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--navy);
  margin: .15rem 0;
}
.cashier-form { margin-top: 1rem; }
.cashier-form__actions { margin-top: 1rem; justify-content: flex-end; }
.cashier-overdue { margin-top: .25rem; }
.cashier-overdue__hint {
  margin: 0 0 .85rem;
  font-size: .88rem;
  color: var(--muted);
}
.cashier-overdue__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}
.cashier-overdue__class,
.cashier-overdue__tranche {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--navy);
}
.cashier-overdue__class select {
  padding: .35rem .55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  min-width: 120px;
}
.cashier-overdue__more {
  margin: .65rem 0 0;
  font-size: .82rem;
  color: var(--muted);
}
.cashier-overdue__evo {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0 0 .85rem;
}
.overdue-evo-chip {
  border: 1px solid rgba(15, 23, 42, .1);
  background: #f8fafc;
  border-radius: 12px;
  padding: .45rem .7rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .1rem;
  cursor: pointer;
  min-width: 5.5rem;
  font: inherit;
  color: inherit;
}
.overdue-evo-chip strong { font-size: 1.05rem; color: var(--navy, #0B1F3A); }
.overdue-evo-chip__label { font-size: .72rem; font-weight: 600; color: var(--muted); }
.overdue-evo-chip__money { font-size: .75rem; color: #0F766E; font-weight: 600; }
.overdue-evo-chip.is-on {
  background: #0B1F3A;
  border-color: #0B1F3A;
  color: #fff;
}
.overdue-evo-chip.is-on .overdue-evo-chip__label,
.overdue-evo-chip.is-on .overdue-evo-chip__money { color: rgba(255,255,255,.75); }
.overdue-evo-chip.is-on strong { color: #fff; }
.badge--ok { background: #D1FAE5; color: #047857; }
.data--compact th, .data--compact td { padding: .55rem .65rem; font-size: .88rem; }
.receipt-code {
  font-family: ui-monospace, monospace;
  font-size: .82rem;
  background: var(--bg);
  padding: .15rem .4rem;
  border-radius: 4px;
}

/* ——— Modal succès paiement ——— */
.success-modal { text-align: center; }
.success-modal__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #D1FAE5;
  color: #047857;
  font-size: 1.75rem;
  font-weight: 700;
}
.success-modal__title {
  margin: 0 0 .35rem;
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--navy);
}
.success-modal__subtitle {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: .92rem;
}
.success-modal__card {
  text-align: left;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
}
.success-modal__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}
.success-modal__row:last-of-type { border-bottom: none; }
.success-modal__row span { color: var(--muted); }
.success-modal__row--highlight {
  background: #ECFDF5;
  margin: .35rem -.5rem;
  padding: .65rem .5rem;
  border-radius: 8px;
  border-bottom: none;
}
.success-modal__row--highlight strong { color: var(--teal); font-size: 1.1rem; }
.success-modal__alloc {
  list-style: none;
  margin: .75rem 0 0;
  padding: .75rem 0 0;
  border-top: 1px dashed var(--border);
}
.success-modal__alloc-block {
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px dashed var(--border);
}
.success-modal__alloc-title {
  margin: 0 0 .5rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--teal);
  text-align: left;
}
.success-modal__alloc-empty {
  margin: 0;
  font-size: .88rem;
  color: var(--muted);
  text-align: left;
}
.success-modal__alloc-block .success-modal__alloc {
  margin: 0;
  padding: 0;
  border-top: none;
}
.success-modal__alloc li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .35rem 0;
  font-size: .88rem;
}
.success-modal__alloc span { color: var(--muted); }
.pay-alloc-mini {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .82rem;
}
.pay-alloc-mini li {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: .1rem 0;
}
.pay-alloc-mini em {
  font-style: normal;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}
.muted { color: var(--muted); }

/* ——— Vérification QR ——— */
.verify-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(45,212,191,.18), transparent 45%),
    linear-gradient(160deg, #F3F6F9, #E8EEF4);
}
.verify-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.verify-card__brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}
.verify-card__logo {
  width: 48px;
  height: 48px;
}
.verify-card__school-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
  padding: 6px;
  flex-shrink: 0;
}
.verify-card__brand strong { display: block; color: var(--navy); font-size: 1.05rem; }
.verify-card__brand span { font-size: .8rem; color: var(--muted); }
.verify-card h1 {
  margin: 0 0 .65rem;
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--navy);
}
.verify-card__status { display: inline-flex; margin-bottom: 1rem; }
.verify-dl {
  margin: 0 0 1.25rem;
  display: grid;
  gap: .55rem;
}
.verify-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}
.verify-dl dt { color: var(--muted); margin: 0; }
.verify-dl dd { margin: 0; font-weight: 600; text-align: right; }
.verify-card__foot {
  font-size: .8rem;
  color: var(--muted);
  margin: 0 0 1rem;
}
.verify-card .btn { width: 100%; justify-content: center; }
.alloc-preview {
  margin-top: 1rem;
  padding: .85rem 1rem;
  background: #F0FDFA;
  border: 1px solid #99F6E4;
  border-radius: 10px;
}
.alloc-preview__title {
  margin: 0 0 .5rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--teal);
}
.alloc-preview__hint {
  margin: 0;
  font-size: .85rem;
  color: var(--muted);
}
.alloc-preview__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.alloc-preview__list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .3rem 0;
  font-size: .88rem;
  border-bottom: 1px solid rgba(15, 118, 110, .12);
}
.alloc-preview__list li:last-child { border-bottom: none; }
.alloc-preview__list span { color: var(--muted); }
.alloc-preview__warn {
  margin: .5rem 0 0;
  font-size: .82rem;
  color: var(--warn);
}

.school-logo-config {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .85rem 1rem;
  border: 1px solid var(--border, #d8e0ea);
  border-radius: 14px;
  background: linear-gradient(145deg, #f8fafc, #eef4fb);
}
.school-logo-config__preview {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.school-logo-config__preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.school-logo-config__placeholder {
  font-size: .75rem;
  color: var(--muted);
  text-align: center;
  padding: .5rem;
}
.school-logo-config__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .45rem;
  min-width: 200px;
  flex: 1;
}

.alloc-detail {
  font-size: .86rem;
  color: var(--navy, #0B1F3A);
  max-width: 280px;
  line-height: 1.35;
}

.pager__info {
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted, #64748B);
}
.pager,
.section-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: .85rem;
}
.pager__nav {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.pager button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (max-width: 960px) {
  .cashier-grid { grid-template-columns: 1fr; }
  .cashier-stats { grid-template-columns: 1fr; }
  .cashier-result { grid-template-columns: 1fr; gap: .25rem; }
  .cashier-result__action { justify-self: start; }
}

.modules-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
}
.modules-toggles .check-inline {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .9rem;
}
.cash-tabs {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.cash-tabs__btn {
  appearance: none;
  border: 1px solid var(--line, #D8E0EA);
  background: #fff;
  border-radius: 999px;
  padding: .4rem .9rem;
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}
.cash-tabs__btn.is-on {
  background: var(--navy, #0F172A);
  border-color: var(--navy, #0F172A);
  color: #fff;
}
.cash-tabs__btn--overdue {
  border-color: rgba(180, 83, 9, 0.35);
  color: var(--warn, #B45309);
}
.cash-tabs__btn--overdue:hover {
  border-color: var(--warn, #B45309);
}
.cash-tabs__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .35rem;
  margin-left: .15rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  background: rgba(180, 83, 9, 0.15);
  color: inherit;
}
.cash-tabs__btn.is-on .cash-tabs__count {
  background: rgba(255, 255, 255, 0.2);
}
.cashier-overdue-modal .cashier-overdue {
  box-shadow: none;
  border: none;
  padding: 0;
  margin: 0;
}
.cashier-overdue-modal .panel__head h2 {
  font-size: 1rem;
}
.cash-subtabs {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.cash-subtabs button {
  appearance: none;
  border: 0;
  background: transparent;
  border-bottom: 2px solid transparent;
  padding: .35rem .55rem;
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.cash-subtabs button.is-on {
  color: var(--navy, #0F172A);
  border-bottom-color: var(--blue, #3B82F6);
}

/* ——— Rapports : navigation par sections ——— */
.reports-nav {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
  padding: .65rem .75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.06));
}
.reports-nav__btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid var(--line, #D8E0EA);
  background: #fff;
  border-radius: 999px;
  padding: .42rem .85rem;
  font: inherit;
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.reports-nav__btn:hover {
  border-color: var(--teal);
  color: var(--navy);
}
.reports-nav__btn.is-on {
  background: var(--navy, #0F172A);
  border-color: var(--navy, #0F172A);
  color: #fff;
}
.reports-nav__btn--modal {
  margin-left: auto;
  border-style: dashed;
}
.reports-nav__icon {
  font-size: .9rem;
  line-height: 1;
  opacity: .85;
}
.reports-nav__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 .35rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.1);
  color: inherit;
}
.reports-nav__btn.is-on .reports-nav__count {
  background: rgba(255, 255, 255, 0.2);
}
.reports-section {
  display: none;
}
.reports-section.is-active {
  display: block;
  animation: rise .2s ease;
}
.reports-modal-body .panel {
  box-shadow: none;
  border: none;
  padding: 0;
}

/* Recherche filtrable (enseignants, etc.) */
.search-select {
  position: relative;
}
.search-select__input {
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.search-select__dropdown {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 240px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.search-select__option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: .65rem .85rem;
  font: inherit;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}
.search-select__option:hover,
.search-select__option:focus {
  background: rgba(15, 118, 110, 0.08);
  outline: none;
}
.search-select__empty {
  padding: .75rem .85rem;
  color: var(--muted);
  font-size: .88rem;
}

.confirm-modal__msg {
  margin: 0 0 .5rem;
  font-size: 1rem;
  line-height: 1.45;
}
.confirm-modal__detail {
  margin: 0;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.4;
}
.confirm-modal__actions {
  justify-content: flex-end;
  margin-top: 0;
}

/* Session caisse (ouvrir / clôturer) */
.cash-session {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .85rem 1.25rem;
  padding: .9rem 1.1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
}
.cash-session--open {
  border-color: rgba(4, 120, 87, 0.35);
  background: linear-gradient(135deg, rgba(4, 120, 87, 0.08), #fff 55%);
}
.cash-session--closed {
  border-color: rgba(180, 83, 9, 0.35);
  background: linear-gradient(135deg, rgba(245, 197, 66, 0.18), #fff 55%);
}
.cash-session__info {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
}
.cash-session__status {
  font-weight: 700;
  font-size: .95rem;
  color: var(--navy);
}
.cash-session--open .cash-session__status { color: var(--success); }
.cash-session--closed .cash-session__status { color: var(--warn); }
.cash-session__meta {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.35;
}

.btn-install-pwa {
  white-space: nowrap;
}
.is-pwa-standalone .btn-install-pwa {
  display: none !important;
}

/* Proposition d'installation PWA */
.pwa-install-banner {
  position: fixed;
  z-index: 9600;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .75rem 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  padding-right: 2.4rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(11, 31, 58, 0.18);
  transform: translateY(120%);
  opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
}
.pwa-install-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
}
.pwa-install-banner.is-leaving {
  transform: translateY(120%);
  opacity: 0;
}
.pwa-install-banner__icon img {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
.pwa-install-banner__body {
  grid-column: 2;
  min-width: 0;
}
.pwa-install-banner__body strong {
  display: block;
  font-size: .98rem;
  color: var(--navy);
  margin-bottom: .2rem;
}
.pwa-install-banner__body p {
  margin: 0;
  font-size: .84rem;
  color: var(--muted);
  line-height: 1.4;
}
.pwa-install-banner__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: .15rem;
}
.pwa-install-banner__close {
  position: absolute;
  top: .45rem;
  right: .55rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: .25rem .4rem;
  border-radius: 8px;
}
.pwa-install-banner__close:hover {
  background: #f1f5f9;
  color: var(--navy);
}
@media (min-width: 720px) {
  .pwa-install-banner {
    left: auto;
    right: 1.25rem;
    bottom: 1.25rem;
    margin: 0;
  }
}
@media print {
  .pwa-install-banner { display: none !important; }
}

/* ——— Notifications (cloche) ——— */
.notif-bell-wrap {
  position: relative;
}
.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--navy);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.notif-bell:hover {
  background: var(--sand);
  border-color: #cbd5e1;
}
.notif-bell__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 .28rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.notif-panel {
  position: absolute;
  top: calc(100% + .45rem);
  right: 0;
  width: min(380px, calc(100vw - 1.5rem));
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(7, 21, 38, .18);
  z-index: 80;
  overflow: hidden;
}
.notif-panel[hidden] { display: none !important; }
.notif-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.notif-panel__filters {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .65rem .85rem;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.notif-filter {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
  padding: .28rem .55rem;
  border-radius: 8px;
  cursor: pointer;
}
.notif-filter.is-on,
.notif-filter:hover {
  background: #fff;
  border-color: var(--border);
  color: var(--navy);
}
.notif-panel__list {
  overflow: auto;
  flex: 1;
  padding: .35rem 0;
}
.notif-panel__empty {
  margin: 0;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}
.notif-item {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: .65rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: default;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.is-unread {
  background: #f0f9ff;
}
.notif-item__icon {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .85rem;
  background: #e2e8f0;
  color: var(--navy);
}
.notif-item--success .notif-item__icon { background: #d1fae5; color: var(--success); }
.notif-item--warning .notif-item__icon { background: #fef3c7; color: var(--warn); }
.notif-item--danger .notif-item__icon { background: #fee2e2; color: var(--danger); }
.notif-item--info .notif-item__icon { background: #e0f2fe; color: #0369a1; }
.notif-item__title {
  font-weight: 650;
  font-size: .9rem;
  color: var(--navy);
}
.notif-item__msg {
  margin: .2rem 0 .35rem;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.4;
}
.notif-item__meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .72rem;
  color: var(--muted);
}
.notif-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .35rem;
}
.link-btn--muted { color: var(--muted) !important; opacity: .85; }
@media (max-width: 640px) {
  .notif-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 78vh;
    border-radius: 16px 16px 0 0;
  }
}

.notif-panel__head-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}
.notif-page__filters {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: 0 0 .85rem;
}
.notif-page__toolbar {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: .85rem;
}
.notif-page__search {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .55rem .75rem;
  font: inherit;
  background: var(--surface);
}
.notif-page__pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  font-size: .85rem;
  color: var(--muted);
}
.notif-prefs {
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}
.notif-prefs__title {
  display: block;
  margin-bottom: .55rem;
  font-size: .9rem;
  color: var(--navy);
}
.notif-prefs__row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.1rem;
  align-items: center;
  margin-top: .35rem;
}
.notif-prefs__time {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  color: var(--muted);
}
.notif-prefs__time input[type="time"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .3rem .45rem;
  font: inherit;
  background: #fff;
}
.notif-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0 0 1rem;
}
.notif-stats__chip {
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 12px;
  padding: .55rem .85rem;
  display: grid;
  gap: .1rem;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--navy);
  min-width: 5.5rem;
}
.notif-stats__chip:hover { border-color: #93c5fd; background: #eff6ff; }
.notif-stats__chip strong { font-size: 1.05rem; line-height: 1.1; }
.notif-stats__chip span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.notif-digest-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem 1rem;
  margin: 0 0 1rem;
  padding: .75rem 1rem;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
  font-size: .9rem;
}
.notif-digest-banner strong { font-size: .95rem; }
.notif-ticker__digest {
  flex: 0 0 auto;
  border: none;
  background: #fee2e2;
  color: #991b1b;
  font-size: .72rem;
  font-weight: 700;
  padding: 0 .7rem;
  cursor: pointer;
  border-right: 1px solid #fecaca;
}
.notif-ticker__digest:hover { background: #fecaca; }
.notif-ticker__sync {
  flex: 0 0 auto;
  border: none;
  background: #ffedd5;
  color: #9a3412;
  font-size: .72rem;
  font-weight: 700;
  padding: 0 .7rem;
  cursor: pointer;
  border-right: 1px solid #fdba74;
}
.notif-ticker__sync:hover { background: #fed7aa; }
.notif-ticker__quiet {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0 .55rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #92400e;
  background: #fef3c7;
  border-right: 1px solid #fcd34d;
}
.notif-page__list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.notif-page-item {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: .75rem;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}
.notif-page-item.has-check {
  grid-template-columns: 1.25rem 2rem 1fr;
}
.notif-page-item.is-unread {
  border-color: #bae6fd;
  background: #f0f9ff;
}
.notif-page-item.is-selected {
  border-color: #93c5fd;
  box-shadow: inset 0 0 0 1px #93c5fd;
}
.notif-item.is-pinned,
.notif-page-item.is-pinned {
  border-color: #fcd34d;
  background: #fffbeb;
}
.notif-pin-mark {
  color: #b45309;
  font-weight: 700;
  margin-right: .15rem;
}
.notif-snooze-group {
  position: relative;
  display: inline-flex;
}
.notif-snooze-menu {
  position: absolute;
  bottom: calc(100% + .35rem);
  left: 0;
  z-index: 20;
  min-width: 10rem;
  padding: .35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
  display: grid;
  gap: .15rem;
}
.notif-snooze-menu[hidden] { display: none; }
.notif-snooze-menu button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: .45rem .55rem;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
  color: var(--navy);
}
.notif-snooze-menu button:hover { background: #f1f5f9; }
.notif-page-item__check {
  display: grid;
  place-items: start center;
  padding-top: .2rem;
}
.notif-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem .75rem;
  margin: 0 0 .75rem;
  padding: .65rem .85rem;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: .88rem;
  color: var(--navy);
}
.notif-bulk-bar--idle {
  background: transparent;
  border-style: dashed;
  border-color: var(--border);
  color: var(--muted);
}
.kbd {
  display: inline-block;
  padding: .05rem .35rem;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-size: .72rem;
  font-family: ui-monospace, Consolas, monospace;
  background: #f8fafc;
  color: var(--muted);
}
.dash-alerts {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dash-alerts__item {
  display: grid;
  gap: .2rem;
  padding: .75rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: .88rem;
}
.dash-alerts__item:last-child { border-bottom: none; }
.dash-alerts__item.is-unread strong { color: var(--navy); }
.dash-alerts__item span { color: var(--muted); font-size: .82rem; }
.dash-alerts__item a { font-size: .8rem; }
.dash-alerts__empty {
  color: var(--muted);
  padding: .75rem 0;
  font-size: .9rem;
}

/* Bande défilante alertes */
.notif-ticker {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, #fff7ed, #fffbeb 40%, #f0f9ff);
  min-height: 2.35rem;
  overflow: hidden;
}
.notif-ticker[hidden],
.notif-ticker--empty { display: none !important; }
.notif-ticker__label {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0 .85rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #9a3412;
  background: #ffedd5;
  border-right: 1px solid #fdba74;
  z-index: 1;
}
.notif-ticker__viewport {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.notif-ticker__track {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  white-space: nowrap;
  padding: .45rem 0;
  width: max-content;
  animation: notif-ticker-scroll 45s linear infinite;
}
.notif-ticker:hover .notif-ticker__track {
  animation-play-state: paused;
}
.notif-ticker__item {
  display: inline-flex;
  align-items: baseline;
  gap: .4rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  padding: .15rem .35rem;
  border-radius: 6px;
  max-width: min(420px, 70vw);
}
.notif-ticker__item:hover {
  background: rgba(255, 255, 255, .7);
}
.notif-ticker__item strong {
  font-size: .8rem;
  color: var(--navy);
  flex-shrink: 0;
}
.notif-ticker__item span {
  font-size: .78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-ticker__item--danger strong { color: var(--danger); }
.notif-ticker__item--warning strong { color: var(--warn); }
.notif-ticker__sep {
  color: #cbd5e1;
  font-size: .75rem;
  user-select: none;
}
@keyframes notif-ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.notif-detail__hero {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  margin-bottom: .85rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: #f8fafc;
}
.notif-detail__hero--danger { background: #fef2f2; }
.notif-detail__hero--warning { background: #fffbeb; }
.notif-detail__hero--success { background: #ecfdf5; }
.notif-detail__hero--info { background: #f0f9ff; }
.notif-detail__icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: #e2e8f0;
  flex-shrink: 0;
}
.notif-detail__hero--danger .notif-detail__icon { background: #fee2e2; color: var(--danger); }
.notif-detail__hero--warning .notif-detail__icon { background: #fef3c7; color: var(--warn); }
.notif-detail__hero--success .notif-detail__icon { background: #d1fae5; color: var(--success); }
.notif-detail__hero--info .notif-detail__icon { background: #e0f2fe; color: #0369a1; }
.notif-detail__title {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--navy);
}
.notif-detail__when {
  margin: .25rem 0 0;
  font-size: .8rem;
  color: var(--muted);
}
.notif-detail__msg {
  margin: 0 0 1rem;
  line-height: 1.5;
  color: var(--text, #1e293b);
}
.notif-detail__meta {
  display: grid;
  gap: .55rem;
  margin: 0;
  padding: .75rem 0 0;
  border-top: 1px solid var(--border);
}
.notif-detail__meta > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .85rem;
}
.notif-detail__meta dt {
  margin: 0;
  color: var(--muted);
}
.notif-detail__meta dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}
.notif-item { cursor: pointer; }
.notif-item:hover { background: #f8fafc; }
.notif-item.is-unread:hover { background: #e0f2fe; }

@media (prefers-reduced-motion: reduce) {
  .notif-ticker__track { animation: none; }
}
@media print {
  .notif-ticker { display: none !important; }
}


/* Bulletin de paie enseignant */
.tch-payslip__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .85rem;
}
.tch-payslip__meta {
  font-size: .85rem;
  color: var(--muted);
  margin-top: .2rem;
}
.tch-payslip__salary {
  text-align: right;
}
.tch-payslip__salary span {
  display: block;
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.tch-payslip__salary strong {
  font-size: 1.15rem;
  color: var(--navy);
}
.tch-payslip__kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
  margin-bottom: .5rem;
}
.tch-payslip__kpis > div {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .55rem .7rem;
  background: #f8fafc;
}
.tch-payslip__kpis span {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
}
.tch-payslip__kpis strong {
  font-size: .95rem;
  color: var(--navy);
}
@media (max-width: 720px) {
  .tch-payslip__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tch-payslip__filters {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .75rem;
  align-items: end;
  margin: 0 0 .85rem;
  padding: .75rem .85rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
.tch-payslip__filters label {
  display: grid;
  gap: .25rem;
  font-size: .78rem;
  color: var(--muted);
}
.tch-payslip__filters select,
.tch-payslip__filters input[type="date"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .35rem .5rem;
  font: inherit;
  background: #fff;
  color: var(--navy);
  min-width: 9rem;
}

/* Supervision */
.sup-alert-list {
  display: grid;
  gap: .85rem;
}
.sup-alert {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .85rem 1rem;
  background: #fff;
}
.sup-alert__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .65rem;
  margin-bottom: .35rem;
}
.sup-alert__msg {
  margin: 0 0 .5rem;
  color: var(--navy);
  font-size: .92rem;
  line-height: 1.4;
}
.sup-alert__note {
  margin: 0 0 .5rem;
  font-size: .82rem;
  color: var(--muted);
}
.sup-alert__actions {
  flex-wrap: wrap;
}
.sup-report-list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.7;
  color: var(--navy);
}
.table-wrap tr.is-warn-row td {
  background: rgba(245, 158, 11, 0.08);
}

/* District dashboard */
.dist-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.15rem;
  padding: 1.15rem 1.25rem;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 58, 95, 0.92)),
    #0f172a;
  color: #fff;
}
.dist-hero__kicker {
  margin: 0 0 .2rem;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .7;
}
.dist-hero__title {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.dist-hero__sub {
  margin: .35rem 0 0;
  font-size: .88rem;
  opacity: .78;
  max-width: 36rem;
  line-height: 1.4;
}
.dist-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.dist-hero__actions .btn--ghost {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.dist-hero__actions .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}
.dist-kpis--secondary .stat {
  background: #f8fafc;
}
.dist-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 1rem;
  margin: 1rem 0;
  min-width: 0;
  width: 100%;
}
.dist-columns > .panel {
  min-width: 0;
  max-width: 100%;
}
.dist-stack {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
  min-width: 0;
  width: 100%;
}
.dist-stack > .panel {
  min-width: 0;
  max-width: 100%;
}
.dist-money-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  align-items: flex-end;
  margin-top: .85rem;
}
@media (max-width: 960px) {
  .dist-columns {
    grid-template-columns: 1fr;
  }
}
.dist-action-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .55rem;
}
.dist-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}
.dist-action strong {
  display: block;
  font-size: .9rem;
}
.dist-action span {
  display: block;
  font-size: .8rem;
  color: var(--muted);
  margin-top: .15rem;
}
.dist-action--bad {
  border-color: #fecaca;
  background: #fff7f7;
}
.dist-action--warn {
  border-color: #fde68a;
  background: #fffbeb;
}
.dist-action--info {
  border-color: #bae6fd;
  background: #f0f9ff;
}
.dist-rank-block {
  display: grid;
  gap: .85rem;
}
.dist-rank-title {
  margin: 0;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.dist-rank {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .35rem;
  counter-reset: dist-rank;
}
.dist-rank li {
  counter-increment: dist-rank;
}
.dist-rank a {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: baseline;
  padding: .55rem .65rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: #f8fafc;
  border: 1px solid transparent;
}
.dist-rank a::before {
  content: counter(dist-rank) ".";
  font-weight: 700;
  color: var(--muted);
  margin-right: .35rem;
}
.dist-rank a:hover {
  border-color: var(--border);
  background: #fff;
}
.dist-rank__meta {
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
}
.dist-rank--ok a {
  background: #f0fdf4;
}
.dist-sort {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--muted);
}
.dist-sort select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .3rem .5rem;
  font: inherit;
  background: #fff;
}
.dist-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1rem;
  align-items: center;
}
.table-wrap tr.is-risk-high td {
  background: rgba(239, 68, 68, 0.06);
}
.table-wrap tr.is-risk-mid td {
  background: rgba(245, 158, 11, 0.06);
}
.dist-hero--compact {
  padding: .95rem 1.15rem;
  margin-bottom: 1rem;
}
.dist-trend {
  display: flex;
  align-items: flex-end;
  gap: .45rem;
  min-height: 140px;
  padding: .5rem .25rem 0;
}
.dist-trend__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: .3rem;
  min-width: 0;
}
.dist-trend__bar {
  width: 100%;
  max-width: 36px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #3b82f6, #1e3a5f);
  min-height: 4px;
}
.dist-trend__label {
  font-size: .68rem;
  color: var(--muted);
}
.dist-trend__val {
  font-size: .62rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
